summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexSm <[email protected]>2024-03-05 10:40:59 +0100
committerGitHub <[email protected]>2024-03-05 12:40:59 +0300
commit1ac13c847b5358faba44dbb638a828e24369467b (patch)
tree07672b4dd3604ad3dee540a02c6494cb7d10dc3d
parentffcca3e7f7958ddc6487b91d3df8c01054bd0638 (diff)
Library import 16 (#2433)
Co-authored-by: robot-piglet <[email protected]> Co-authored-by: deshevoy <[email protected]> Co-authored-by: robot-contrib <[email protected]> Co-authored-by: thegeorg <[email protected]> Co-authored-by: robot-ya-builder <[email protected]> Co-authored-by: svidyuk <[email protected]> Co-authored-by: shadchin <[email protected]> Co-authored-by: robot-ratatosk <[email protected]> Co-authored-by: innokentii <[email protected]> Co-authored-by: arkady-e1ppa <[email protected]> Co-authored-by: snermolaev <[email protected]> Co-authored-by: dimdim11 <[email protected]> Co-authored-by: kickbutt <[email protected]> Co-authored-by: abdullinsaid <[email protected]> Co-authored-by: korsunandrei <[email protected]> Co-authored-by: petrk <[email protected]> Co-authored-by: miroslav2 <[email protected]> Co-authored-by: serjflint <[email protected]> Co-authored-by: akhropov <[email protected]> Co-authored-by: prettyboy <[email protected]> Co-authored-by: ilikepugs <[email protected]> Co-authored-by: hiddenpath <[email protected]> Co-authored-by: mikhnenko <[email protected]> Co-authored-by: spreis <[email protected]> Co-authored-by: andreyshspb <[email protected]> Co-authored-by: dimaandreev <[email protected]> Co-authored-by: rashid <[email protected]> Co-authored-by: robot-ydb-importer <[email protected]> Co-authored-by: r-vetrov <[email protected]> Co-authored-by: ypodlesov <[email protected]> Co-authored-by: zaverden <[email protected]> Co-authored-by: vpozdyayev <[email protected]> Co-authored-by: robot-cozmo <[email protected]> Co-authored-by: v-korovin <[email protected]> Co-authored-by: arikon <[email protected]> Co-authored-by: khoden <[email protected]> Co-authored-by: psydmm <[email protected]> Co-authored-by: robot-javacom <[email protected]> Co-authored-by: dtorilov <[email protected]> Co-authored-by: sennikovmv <[email protected]> Co-authored-by: hcpp <[email protected]>
-rw-r--r--.mapping.json12371
-rw-r--r--build/conf/docs.conf4
-rw-r--r--build/conf/go.conf3
-rw-r--r--build/conf/java.conf56
-rw-r--r--build/conf/license.conf5
-rw-r--r--build/conf/linkers/ld.conf11
-rw-r--r--build/conf/linkers/msvc_linker.conf5
-rw-r--r--build/conf/opensource.conf4
-rw-r--r--build/conf/proto.conf6
-rw-r--r--build/conf/python.conf17
-rw-r--r--build/conf/ts/node_modules.conf106
-rw-r--r--build/conf/ts/ts.conf3
-rw-r--r--build/conf/ts/ts_next.conf5
-rw-r--r--build/conf/ts/ts_package.conf5
-rw-r--r--build/conf/ts/ts_proto.conf3
-rw-r--r--build/conf/ts/ts_test.conf3
-rw-r--r--build/conf/ts/ts_tsc.conf5
-rw-r--r--build/conf/ts/ts_vite.conf5
-rw-r--r--build/conf/ts/ts_webpack.conf5
-rw-r--r--build/export_generators/gradle/generator.toml10
-rw-r--r--build/export_generators/hardcoded-cmake/build/scripts/generate_vcs_info.py12
-rw-r--r--build/export_generators/hardcoded-cmake/cmake/cuda.cmake4
-rw-r--r--build/export_generators/hardcoded-cmake/conanfile.jinja20
-rw-r--r--build/export_generators/hardcoded-cmake/generator.toml3
-rw-r--r--build/export_generators/ide-gradle/build.gradle.kts.jinja8
-rw-r--r--build/export_generators/ide-gradle/generator.toml11
-rw-r--r--build/external_resources/yexport/resources.json6
-rw-r--r--build/external_resources/ymake/public.resources.json10
-rw-r--r--build/external_resources/ymake/resources.json10
-rw-r--r--build/mapping.conf.json122
-rw-r--r--build/platform/java/jdk/jdk11/jdk.json33
-rw-r--r--build/platform/java/jdk/jdk11/ya.make9
-rw-r--r--build/platform/java/jdk/jdk17/ya.make9
-rw-r--r--build/platform/java/jdk/jdk19/jdk.json20
-rw-r--r--build/platform/java/jdk/jdk19/ya.make17
-rw-r--r--build/platform/java/jdk/jdk20/jdk.json33
-rw-r--r--build/platform/java/jdk/jdk20/ya.make9
-rw-r--r--build/platform/java/jdk/jdk21/ya.make9
-rw-r--r--build/platform/java/jdk/ya.make4
-rw-r--r--build/platform/test_tool/host.ya.make.inc20
-rw-r--r--build/platform/test_tool/host_os.ya.make.inc20
-rw-r--r--build/platform/yfm/ya.make8
-rw-r--r--build/plugins/_common.py4
-rw-r--r--build/plugins/java.py2
-rw-r--r--build/plugins/lib/nots/package_manager/base/lockfile.py5
-rw-r--r--build/plugins/lib/nots/package_manager/base/package_json.py4
-rw-r--r--build/plugins/lib/nots/package_manager/base/package_manager.py4
-rw-r--r--build/plugins/lib/nots/package_manager/pnpm/__init__.py3
-rw-r--r--build/plugins/lib/nots/package_manager/pnpm/constants.py5
-rw-r--r--build/plugins/lib/nots/package_manager/pnpm/lockfile.py13
-rw-r--r--build/plugins/lib/nots/package_manager/pnpm/package_manager.py119
-rw-r--r--build/plugins/lib/nots/package_manager/pnpm/utils.py6
-rw-r--r--build/plugins/lib/nots/package_manager/pnpm/workspace.py3
-rw-r--r--build/plugins/lib/nots/typescript/tests/test_ts_config.py17
-rw-r--r--build/plugins/lib/test_const/__init__.py1
-rw-r--r--build/plugins/lib/tests/ruff/__init__.py17
-rw-r--r--build/plugins/lib/tests/ruff/ya.make11
-rw-r--r--build/plugins/nots.py48
-rw-r--r--build/plugins/pybuild.py21
-rw-r--r--build/plugins/ya.make1
-rw-r--r--build/plugins/ytest.py7
-rw-r--r--build/sanitize-blacklist.txt2
-rwxr-xr-xbuild/scripts/cat.py6
-rw-r--r--build/scripts/generate_vcs_info.py12
-rw-r--r--build/scripts/link_sbom.py67
-rw-r--r--build/scripts/move.py15
-rw-r--r--build/sysincl/darwin.yml8
-rw-r--r--build/sysincl/libc-to-nothing.yml1
-rw-r--r--build/sysincl/macro.yml14
-rw-r--r--build/sysincl/misc.yml18
-rw-r--r--build/sysincl/nvidia.yml22
-rw-r--r--build/sysincl/stl-to-libcxx.yml397
-rw-r--r--build/sysincl/stl-to-libcxxmsvc.yml3
-rw-r--r--build/sysincl/unsorted.yml37
-rw-r--r--build/sysincl/unused/stl-to-microsoft-stl.yml (renamed from build/sysincl/stl-to-microsoft-stl-UNUSED.yml)0
-rw-r--r--build/sysincl/unused/vms.yml24
-rw-r--r--build/sysincl/unused/vxworks.yml16
-rw-r--r--build/ya.conf.json34
-rw-r--r--build/ymake.core.conf54
-rwxr-xr-xbuild/ymake_conf.py24
-rw-r--r--contrib/libs/apache/arrow/cpp/src/arrow/util/endian.h2
-rw-r--r--contrib/libs/clang14-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp2
-rw-r--r--contrib/libs/clang14-rt/lib/sanitizer_common/sanitizer_solaris.cpp2
-rw-r--r--contrib/libs/clang14/include/ya.make4
-rw-r--r--contrib/libs/clang16-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp2
-rw-r--r--contrib/libs/clang16-rt/lib/sanitizer_common/sanitizer_solaris.cpp2
-rw-r--r--contrib/libs/clang16/include/ya.make8
-rw-r--r--contrib/libs/curl/lib/cf-socket.c2
-rw-r--r--contrib/libs/curl/lib/http2.c4
-rw-r--r--contrib/libs/curl/lib/vquic/curl_ngtcp2.c7
-rw-r--r--contrib/libs/curl/lib/vquic/curl_quiche.c2
-rw-r--r--contrib/libs/curl/lib/vtls/gtls.h2
-rw-r--r--contrib/libs/cxxsupp/builtins/int_endianness.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/CREDITS.TXT9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/adjacent_find.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/all_of.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/binary_search.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/comp.h47
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/comp_ref_type.h13
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/copy.h40
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_backward.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_move_common.h33
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_n.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/equal.h83
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/equal_range.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/fill.h1
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/fill_n.h1
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/find.h53
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/find_end.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/for_each_n.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/for_each_segment.h53
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/generate_n.h1
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/half_positive.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/in_found_result.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/in_fun_result.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_out_result.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_result.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/in_out_out_result.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/in_out_result.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/includes.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/inplace_merge.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap_until.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/is_permutation.h15
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted_until.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/iterator_operations.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare_three_way.h125
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/lower_bound.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/make_heap.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/make_projected.h53
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/max.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/max_element.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/merge.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/min.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/min_element.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/min_max_result.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax_element.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/mismatch.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/move.h37
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/move_backward.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/next_permutation.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/nth_element.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/partial_sort.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/partial_sort_copy.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/partition.h1
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pop_heap.h13
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/prev_permutation.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_any_all_none_of.h100
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backend.h198
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backend.h59
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/any_of.h90
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/backend.h41
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/fill.h60
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/find_if.h123
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/for_each.h60
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/libdispatch.h241
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/merge.h79
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/serial.h72
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/stable_sort.h45
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h78
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform.h132
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h194
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_copy.h59
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_count.h89
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_fill.h84
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_find.h95
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_for_each.h76
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_frontend_dispatch.h45
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_generate.h82
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_is_partitioned.h58
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_merge.h58
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_replace.h167
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_sort.h63
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_stable_sort.h43
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_transform.h77
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/push_heap.h11
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_adjacent_find.h28
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_all_of.h25
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_any_of.h25
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_binary_search.h29
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_clamp.h22
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy.h15
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_backward.h17
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_if.h27
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_n.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count_if.h26
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal.h93
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal_range.h33
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill_n.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find.h34
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_end.h38
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_first_of.h74
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if.h25
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if_not.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_for_each.h24
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_for_each_n.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_generate.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_generate_n.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_includes.h34
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_inplace_merge.h60
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap.h28
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap_until.h29
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_partitioned.h26
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_permutation.h73
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted_until.h25
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_iterator_concept.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lexicographical_compare.h77
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lower_bound.h30
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_make_heap.h18
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max.h41
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max_element.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_merge.h97
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min.h43
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min_element.h24
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax.h63
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax_element.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_mismatch.h46
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_move.h20
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_move_backward.h20
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_next_permutation.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_none_of.h26
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_nth_element.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partial_sort.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partial_sort_copy.h77
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition.h32
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition_copy.h55
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition_point.h28
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_pop_heap.h20
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_prev_permutation.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_push_heap.h18
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_copy.h52
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_copy_if.h50
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_if.h23
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace.h33
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_copy.h79
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_copy_if.h60
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_if.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_reverse.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_reverse_copy.h16
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_rotate.h23
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_rotate_copy.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sample.h33
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search.h39
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search_n.h38
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_difference.h49
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_intersection.h63
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_symmetric_difference.h57
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_union.h61
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_shuffle.h22
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sort.h18
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sort_heap.h18
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_stable_partition.h35
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_stable_sort.h16
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_starts_with.h90
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_swap_ranges.h15
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_transform.h124
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique.h52
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique_copy.h11
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_upper_bound.h35
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/rotate.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/sample.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h17
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/search_n.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/set_difference.h11
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/set_intersection.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/set_symmetric_difference.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/set_union.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/shift_left.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/shift_right.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/shuffle.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/sift_down.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/sort.h912
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/sort_heap.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/sort_old.h720
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/stable_partition.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/stable_sort.h37
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/three_way_comp_ref_type.h73
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_range.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/upper_bound.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__assert47
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/aliases.h116
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/atomic.h664
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_base.h232
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_flag.h230
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_init.h27
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_lock_free.h48
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_sync.h112
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/check_memory_order.h34
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/contention_t.h32
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/cxx_atomic_impl.h831
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/fence.h38
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/is_always_lock_free.h28
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/kill_dependency.h29
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__atomic/memory_order.h72
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__availability202
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__bit/bit_cast.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__bit/bit_ceil.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__bit/bit_floor.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__bit/bit_width.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__bit/byteswap.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__bit/countl.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__bit/countr.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__bit/has_single_bit.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__bit/popcount.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__bit/rotate.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__bit_reference55
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__bsd_locale_defaults.h36
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__bsd_locale_fallbacks.h142
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__charconv/chars_format.h45
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__charconv/from_chars_integral.h239
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__charconv/from_chars_result.h17
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__charconv/tables.h61
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars.h25
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_base_10.h20
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_floating_point.h56
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_integral.h326
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_result.h17
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__charconv/traits.h199
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/calendar.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/concepts.h36
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_tm.h77
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/day.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/duration.h43
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/file_clock.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/formatter.h342
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/hh_mm_ss.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/literals.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/month.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/month_weekday.h13
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/monthday.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/ostream.h82
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/parser_std_format_spec.h47
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/statically_widen.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/steady_clock.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/system_clock.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/time_point.h20
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/weekday.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/year.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/year_month.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/year_month_day.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__chrono/year_month_weekday.h15
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__compare/common_comparison_category.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__compare/compare_partial_order_fallback.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__compare/compare_strong_order_fallback.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__compare/compare_three_way.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__compare/compare_three_way_result.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__compare/compare_weak_order_fallback.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__compare/is_eq.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__compare/ordering.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__compare/partial_order.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__compare/strong_order.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__compare/synth_three_way.h40
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__compare/three_way_comparable.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__compare/weak_order.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/arithmetic.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/assignable.h16
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/boolean_testable.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/class_or_enum.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/common_reference_with.h11
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/common_with.h36
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/constructible.h33
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/convertible_to.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/copyable.h20
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/derived_from.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/destructible.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/different_from.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/equality_comparable.h42
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/invocable.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/movable.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/predicate.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/regular.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/relation.h13
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/same_as.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/semiregular.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/swappable.h124
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__concepts/totally_ordered.h51
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__condition_variable/condition_variable.h245
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__config411
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__config_site3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_handle.h26
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_traits.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__coroutine/noop_coroutine_handle.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__coroutine/trivial_awaitables.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__debug266
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__debug_utils/strict_weak_ordering_check.h77
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__exception/exception.h91
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__exception/exception_ptr.h90
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__exception/nested_exception.h101
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__exception/operations.h42
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__exception/terminate.h22
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/copy_options.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h35
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_iterator.h38
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_options.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/file_status.h22
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h63
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/operations.h72
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/path.h48
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/path_iterator.h30
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/perm_options.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/perms.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/recursive_directory_iterator.h62
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/space_info.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/u8path.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/buffer.h124
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/concepts.h32
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/container_adaptor.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/enable_insertable.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/escaped_output_table.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/extended_grapheme_cluster_table.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/format_arg.h36
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/format_arg_store.h41
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/format_args.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/format_context.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/format_error.h26
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/format_functions.h233
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/format_fwd.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/format_parse_context.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/format_string.h65
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/format_to_n_result.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/formatter.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/formatter_bool.h23
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/formatter_char.h31
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/formatter_floating_point.h123
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/formatter_integer.h46
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/formatter_integral.h121
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/formatter_output.h366
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/formatter_pointer.h29
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/formatter_string.h67
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/formatter_tuple.h122
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/parser_std_format_spec.h609
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/range_default_formatter.h85
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/range_formatter.h109
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/unicode.h380
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/width_estimation_table.h271
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__format/write_escaped.h222
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/bind.h75
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/bind_back.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/bind_front.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/binder1st.h28
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/binder2nd.h26
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/boyer_moore_searcher.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/compose.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/default_searcher.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/function.h118
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/hash.h260
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/identity.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/invoke.h534
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/is_transparent.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/mem_fn.h1
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/not_fn.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/operations.h93
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/perfect_forward.h24
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/ranges_operations.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/reference_wrapper.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__functional/unwrap_ref.h58
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__fwd/fstream.h53
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__fwd/get.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__fwd/ios.h41
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__fwd/istream.h43
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__fwd/memory_resource.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__fwd/ostream.h35
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__fwd/span.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__fwd/sstream.h57
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__fwd/streambuf.h35
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__fwd/string.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__hash_table456
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/access.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/advance.h26
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/back_insert_iterator.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/bounded_iter.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/common_iterator.h82
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/concepts.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/counted_iterator.h42
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/cpp17_iterator_concepts.h185
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/data.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/default_sentinel.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/distance.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/empty.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/erase_if_container.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/front_insert_iterator.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/incrementable_traits.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/indirectly_comparable.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/insert_iterator.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/istream_iterator.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/istreambuf_iterator.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/iter_move.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/iter_swap.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/iterator_traits.h73
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/mergeable.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/move_iterator.h50
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/move_sentinel.h11
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/next.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/ostream_iterator.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/ostreambuf_iterator.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/permutable.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/prev.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/projected.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/ranges_iterator_traits.h42
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/readable_traits.h15
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_access.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h62
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/size.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/sortable.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/unreachable_sentinel.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h62
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__locale142
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/bsd_locale_defaults.h36
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h148
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/locale_guard.h80
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__mbstate_t.h42
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/align.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/aligned_alloc.h67
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/allocate_at_least.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/allocation_guard.h37
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/allocator.h18
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/allocator_arg_t.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/allocator_traits.h23
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/assume_aligned.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/builtin_new_allocator.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/compressed_pair.h11
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/concepts.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/construct_at.h39
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/pointer_traits.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/ranges_construct_at.h11
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/ranges_uninitialized_algorithms.h34
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/raw_storage_iterator.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/shared_ptr.h193
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/swap_allocator.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/temp_value.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/uninitialized_algorithms.h79
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/unique_ptr.h15
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator_construction.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory_resource/memory_resource.h33
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory_resource/monotonic_buffer_resource.h11
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory_resource/polymorphic_allocator.h27
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory_resource/pool_options.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory_resource/synchronized_pool_resource.h13
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory_resource/unsynchronized_pool_resource.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__mutex/lock_guard.h53
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__mutex/mutex.h53
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__mutex/tag_types.h48
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__mutex/unique_lock.h173
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__mutex_base523
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__node_handle11
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/accumulate.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/adjacent_difference.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/exclusive_scan.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/gcd_lcm.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/inclusive_scan.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/inner_product.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/midpoint.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/partial_sum.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_reduce.h73
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_transform_reduce.h100
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/reduce.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/transform_exclusive_scan.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/transform_inclusive_scan.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__numeric/transform_reduce.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/binomial_distribution.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/clamp_to_integral.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/discard_block_engine.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/discrete_distribution.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/exponential_distribution.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/extreme_value_distribution.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/fisher_f_distribution.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/gamma_distribution.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/generate_canonical.h22
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/independent_bits_engine.h15
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/is_seed_sequence.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/is_valid.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/linear_congruential_engine.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/log2.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/lognormal_distribution.h138
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/mersenne_twister_engine.h13
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/negative_binomial_distribution.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/normal_distribution.h35
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/piecewise_constant_distribution.h17
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/piecewise_linear_distribution.h25
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/poisson_distribution.h17
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/random_device.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/seed_seq.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/shuffle_order_engine.h17
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/student_t_distribution.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/subtract_with_carry_engine.h11
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/uniform_int_distribution.h83
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/uniform_random_bit_generator.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__random/uniform_real_distribution.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/access.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/all.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/as_rvalue_view.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/container_compatible_range.h33
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/copyable_box.h180
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/dangling.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/data.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h55
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/drop_while_view.h13
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/elements_view.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/empty.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/empty_view.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/enable_borrowed_range.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/enable_view.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/filter_view.h29
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/from_range.h33
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h30
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/join_view.h11
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h18
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/movable_box.h206
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/non_propagating_cache.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/owning_view.h17
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h15
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/rbegin.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/repeat_view.h260
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/single_view.h78
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/size.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/split_view.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h43
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/take_while_view.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/to.h247
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/transform_view.h45
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/view_interface.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/views.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/zip_view.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__split_buffer355
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__std_mbstate_t.h29
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__std_stream361
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__string/char_traits.h237
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__string/constexpr_c_functions.h219
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__string/extern_template_lists.h189
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__support/musl/xlocale.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__support/solaris/xlocale.h75
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__support/win32/locale_win32.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__system_error/errc.h (renamed from contrib/libs/cxxsupp/libcxx/include/__errc)0
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__system_error/error_category.h75
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__system_error/error_code.h145
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__system_error/error_condition.h132
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__system_error/system_error.h48
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__thread/formatter.h80
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__thread/id.h121
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__thread/this_thread.h87
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__thread/thread.h297
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__threading_support155
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tree150
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple/make_tuple_types.h80
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple/pair_like.h32
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple/sfinae_helpers.h185
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_element.h108
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_indices.h (renamed from contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_indices.h)0
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_like.h (renamed from contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_like.h)0
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_like_ext.h44
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_size.h75
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_types.h (renamed from contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_types.h)0
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple_dir/apply_cv.h70
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple_dir/make_tuple_types.h84
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple_dir/pair_like.h32
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple_dir/sfinae_helpers.h198
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_element.h108
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_like_ext.h44
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_size.h75
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/add_const.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/add_cv.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/add_lvalue_reference.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/add_pointer.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/add_rvalue_reference.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/add_volatile.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/aligned_storage.h108
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/aligned_union.h31
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/alignment_of.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/apply_cv.h71
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/can_extract_key.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/common_reference.h129
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/common_type.h70
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/conditional.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/conjunction.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cv.h20
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cvref.h15
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/datasizeof.h55
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/decay.h38
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/disjunction.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/enable_if.h20
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/extent.h35
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/has_unique_object_representation.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/has_virtual_destructor.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/integral_constant.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/invoke.h461
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_abstract.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_aggregate.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_allocator.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_always_bitcastable.h83
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_arithmetic.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_array.h22
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_assignable.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_base_of.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_bounded_array.h17
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_callable.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_class.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_compound.h16
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_const.h16
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_constant_evaluated.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_constructible.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_convertible.h116
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_copy_assignable.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_copy_constructible.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_core_convertible.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_default_constructible.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_destructible.h43
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_empty.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_enum.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_equality_comparable.h78
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_execution_policy.h59
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_final.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_floating_point.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_function.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_fundamental.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_implicitly_default_constructible.h16
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_integral.h16
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_literal_type.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_function_pointer.h34
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_object_pointer.h18
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_pointer.h17
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_move_assignable.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_move_constructible.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_assignable.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_constructible.h43
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_convertible.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_copy_assignable.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_copy_constructible.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_default_constructible.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_destructible.h47
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_move_assignable.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_move_constructible.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_null_pointer.h22
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_object.h22
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_pod.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_pointer.h32
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_polymorphic.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_primary_template.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_reference.h45
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_reference_wrapper.h15
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_same.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_scalar.h43
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_scoped_enum.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_signed.h20
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_signed_integer.h16
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_specialization.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_standard_layout.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_swappable.h104
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivial.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_assignable.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_constructible.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copy_assignable.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copy_constructible.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copyable.h13
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_default_constructible.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_destructible.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_lexicographically_comparable.h53
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_move_assignable.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_move_constructible.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unbounded_array.h17
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_union.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unsigned.h20
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unsigned_integer.h16
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_valid_expansion.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_void.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/is_volatile.h16
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/lazy.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/make_32_64_or_128_bit.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/make_const_lvalue_ref.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/make_signed.h37
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/make_unsigned.h42
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/maybe_const.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/nat.h11
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/negation.h6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/noexcept_move_assign_container.h16
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/operation_traits.h26
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/predicate_traits.h26
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/promote.h85
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/rank.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_all_extents.h23
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_const.h15
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_cv.h13
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_cvref.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_extent.h23
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_pointer.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_reference.h7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_volatile.h15
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/result_of.h23
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/strip_signature.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/type_identity.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/type_list.h20
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/underlying_type.h13
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/unwrap_ref.h63
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__type_traits/void_t.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__undef_macros12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/as_const.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/auto_cast.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/cmp.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/exchange.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/forward_like.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/in_place.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/integer_sequence.h8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/is_pointer_in_range.h62
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/move.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/pair.h517
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/piecewise_construct.h9
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/swap.h5
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/terminate_on_exception.h48
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/to_underlying.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/unreachable.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__variant/monostate.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__verbose_abort13
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/algorithm284
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/any38
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/array101
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/atomic2151
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/barrier41
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/bit1
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/bitset119
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/charconv762
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/chrono51
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/cmath7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/codecvt24
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/compare1
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/complex23
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/condition_variable30
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/cstddef2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/cstdlib2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/cstring47
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/ctime4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/cwchar32
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/deque695
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/exception278
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/execution146
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/experimental/__config12
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/filesystem116
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/format8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/forward_list347
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/fstream57
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/functional95
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/future276
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/iomanip40
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/ios37
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/iosfwd118
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/iostream16
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/istream163
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/iterator4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/latch36
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/list738
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/locale177
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/map326
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/math.h44
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/memory8
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/memory_resource4
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/mutex52
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/new74
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/numeric6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/optional315
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/ostream192
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/print389
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/queue217
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/random1
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/ranges47
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/ratio6
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/regex314
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/semaphore59
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/set271
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/shared_mutex567
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/span107
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/sstream491
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/stack95
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/stdexcept85
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/stdlib.h10
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/streambuf3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/string1543
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/string.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/string_view170
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/strstream22
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/system_error396
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/thread323
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/tuple119
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/type_traits7
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/typeindex2
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/typeinfo48
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/unordered_map534
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/unordered_set484
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/utility51
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/valarray108
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/variant66
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/vector915
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/version108
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/wchar.h4
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/algorithm.cpp37
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/algorithm_old.cpp53
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/any.cpp2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/atomic.cpp14
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/charconv.cpp4
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/chrono.cpp69
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/condition_variable.cpp1
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/condition_variable_destructor.cpp2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/debug.cpp559
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/directory_entry.cpp74
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp18
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/error.h238
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/file_descriptor.h298
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_clock.cpp64
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_common.h613
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_error.cpp37
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/format_string.h77
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp1166
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/path.cpp460
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/path_parser.h372
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/posix_compat.h124
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/time_utils.h385
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/format.cpp17
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/future.cpp4
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/include/apple_availability.h18
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/include/config_elast.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/include/ryu/common.h21
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/include/ryu/d2s_intrinsics.h16
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/include/ryu/ryu.h3
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/include/to_chars_floating_point.h24
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/ios.cpp8
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/ios.instantiations.cpp2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/iostream.cpp38
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/legacy_pointer_safety.cpp8
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/locale.cpp63
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/memory.cpp2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/memory_resource.cpp15
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/mutex.cpp28
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/mutex_destructor.cpp2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/new.cpp93
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/new_handler.cpp39
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/new_helpers.cpp30
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/optional.cpp2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/print.cpp62
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/random.cpp6
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/ryu/d2fixed.cpp47
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/ryu/d2s.cpp44
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/ryu/f2s.cpp44
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/shared_mutex.cpp128
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/std_stream.h447
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/stdexcept.cpp1
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/string.cpp17
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/strstream.cpp2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_fallback.ipp8
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_msvc.ipp8
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/support/runtime/new_handler_fallback.ipp26
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/support/solaris/README4
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/support/win32/locale_win32.cpp2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/system_error.cpp9
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/thread.cpp2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/utility.cpp15
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/valarray.cpp4
-rw-r--r--contrib/libs/cxxsupp/libcxx/ya.make21
-rw-r--r--contrib/libs/cxxsupp/libcxxabi/src/fallback_malloc.cpp4
-rw-r--r--contrib/libs/cxxsupp/libcxxabi/src/stdlib_new_delete.cpp4
-rw-r--r--contrib/libs/cxxsupp/libcxxabi/ya.make14
-rw-r--r--contrib/libs/expat/Changes118
-rw-r--r--contrib/libs/expat/README.md7
-rw-r--r--contrib/libs/expat/expat.h28
-rw-r--r--contrib/libs/expat/expat_config.h16
-rw-r--r--contrib/libs/expat/lib/internal.h8
-rw-r--r--contrib/libs/expat/lib/siphash.h10
-rw-r--r--contrib/libs/expat/lib/winconfig.h7
-rw-r--r--contrib/libs/expat/lib/xmlparse.c558
-rw-r--r--contrib/libs/expat/lib/xmlrole.c6
-rw-r--r--contrib/libs/expat/lib/xmlrole.h6
-rw-r--r--contrib/libs/expat/lib/xmltok.c29
-rw-r--r--contrib/libs/expat/lib/xmltok.h8
-rw-r--r--contrib/libs/expat/lib/xmltok_impl.c2
-rw-r--r--contrib/libs/expat/ya.make6
-rw-r--r--contrib/libs/farmhash/common.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine_shims/tcp_client.cc1
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc2
-rw-r--r--contrib/libs/icu/include/unicode/platform.h2
-rw-r--r--contrib/libs/libpq/COPYRIGHT2
-rw-r--r--contrib/libs/libpq/src/common/scram-common.c11
-rw-r--r--contrib/libs/libpq/src/common/wchar.c1
-rw-r--r--contrib/libs/libpq/src/include/mb/pg_wchar.h69
-rw-r--r--contrib/libs/libpq/src/include/pg_config-linux.h17
-rw-r--r--contrib/libs/libpq/src/include/utils/ascii.h84
-rw-r--r--contrib/libs/libpq/src/interfaces/libpq/fe-exec.c65
-rw-r--r--contrib/libs/libpq/src/interfaces/libpq/fe-protocol3.c9
-rw-r--r--contrib/libs/libpq/src/interfaces/libpq/fe-secure-openssl.c99
-rw-r--r--contrib/libs/libpq/src/interfaces/libpq/fe-secure.c7
-rw-r--r--contrib/libs/libpq/src/interfaces/libpq/libpq-int.h7
-rw-r--r--contrib/libs/libpq/src/port/pg_config_paths.h18
-rw-r--r--contrib/libs/libpq/ya.make4
-rw-r--r--contrib/libs/libunwind/src/Unwind-wasm.c6
-rw-r--r--contrib/libs/libunwind/ya.make39
-rw-r--r--contrib/libs/libxml/xmlmodule.c2
-rw-r--r--contrib/libs/llvm16/lib/IR/LegacyPassManager.cpp5
-rw-r--r--contrib/libs/lzma/common/tuklib_integer.h2
-rw-r--r--contrib/libs/lzma/common/tuklib_physmem.c8
-rw-r--r--contrib/libs/mimalloc/include/mimalloc-atomic.h2
-rw-r--r--contrib/libs/openldap/include/ldap_int_thread.h2
-rw-r--r--contrib/libs/openssl/apps/apps.c2
-rw-r--r--contrib/libs/openssl/apps/openssl.c2
-rw-r--r--contrib/libs/openssl/crypto/LPdir_vms.c12
-rw-r--r--contrib/libs/openssl/crypto/bio/bss_log.c6
-rw-r--r--contrib/libs/openssl/crypto/dso/dso_vms.c12
-rw-r--r--contrib/libs/openssl/crypto/rand/randfile.c2
-rw-r--r--contrib/libs/openssl/crypto/ui/ui_openssl.c8
-rw-r--r--contrib/libs/openssl/crypto/ya.make20
-rw-r--r--contrib/libs/openssl/include/internal/sockets.h2
-rw-r--r--contrib/libs/openssl/ya.make12
-rw-r--r--contrib/libs/poco/Foundation/src/FPEnvironment_DEC.cpp2
-rw-r--r--contrib/libs/protobuf/src/google/protobuf/io/coded_stream.h2
-rw-r--r--contrib/libs/protobuf/src/google/protobuf/stubs/port.h2
-rw-r--r--contrib/libs/python/Include/Python.h2
-rw-r--r--contrib/libs/python/Include/abstract.h2
-rw-r--r--contrib/libs/python/Include/compile.h2
-rw-r--r--contrib/libs/python/Include/datetime.h2
-rw-r--r--contrib/libs/python/Include/descrobject.h2
-rw-r--r--contrib/libs/python/Include/frameobject.h2
-rw-r--r--contrib/libs/python/Include/internal/pycore_frame.h2
-rw-r--r--contrib/libs/python/Include/pyconfig.h2
-rw-r--r--contrib/libs/python/Include/pyerrors.h2
-rw-r--r--contrib/libs/python/Include/pymem.h2
-rw-r--r--contrib/libs/python/Include/pystate.h2
-rw-r--r--contrib/libs/python/Include/pythread.h2
-rw-r--r--contrib/libs/python/Include/structmember.h2
-rw-r--r--contrib/libs/python/Include/structseq.h2
-rw-r--r--contrib/libs/python/Include/traceback.h2
-rw-r--r--contrib/libs/python/Include/unicodeobject.h2
-rw-r--r--contrib/libs/python/ya.make4
-rw-r--r--contrib/libs/re2/re2/parse.cc63
-rw-r--r--contrib/libs/re2/re2/re2.h2
-rw-r--r--contrib/libs/re2/re2/testing/dump.cc20
-rw-r--r--contrib/libs/re2/re2/testing/parse_test.cc25
-rw-r--r--contrib/libs/re2/re2/testing/re2_test.cc19
-rw-r--r--contrib/libs/re2/util/pcre.cc2
-rw-r--r--contrib/libs/re2/ya.make4
-rw-r--r--contrib/libs/t1ha/t1ha.h2
-rw-r--r--contrib/libs/zlib/zconf.h2
-rw-r--r--contrib/python/MarkupSafe/py3/.dist-info/METADATA2
-rw-r--r--contrib/python/MarkupSafe/py3/markupsafe/__init__.py7
-rw-r--r--contrib/python/MarkupSafe/py3/tests/test_markupsafe.py2
-rw-r--r--contrib/python/MarkupSafe/py3/ya.make2
-rw-r--r--contrib/python/appnope/py3/.dist-info/METADATA11
-rw-r--r--contrib/python/appnope/py3/appnope/__init__.py10
-rw-r--r--contrib/python/appnope/py3/appnope/_dummy.py16
-rw-r--r--contrib/python/appnope/py3/appnope/_nope.py72
-rw-r--r--contrib/python/appnope/py3/ya.make2
-rw-r--r--contrib/python/fonttools/.dist-info/METADATA45
-rw-r--r--contrib/python/fonttools/README.rst2
-rw-r--r--contrib/python/fonttools/fontTools/__init__.py2
-rw-r--r--contrib/python/fonttools/fontTools/afmLib.py1
-rw-r--r--contrib/python/fonttools/fontTools/cffLib/__init__.py1
-rw-r--r--contrib/python/fonttools/fontTools/colorLib/builder.py15
-rw-r--r--contrib/python/fonttools/fontTools/config/__init__.py1
-rw-r--r--contrib/python/fonttools/fontTools/designspaceLib/__init__.py92
-rw-r--r--contrib/python/fonttools/fontTools/designspaceLib/__main__.py6
-rw-r--r--contrib/python/fonttools/fontTools/designspaceLib/statNames.py1
-rw-r--r--contrib/python/fonttools/fontTools/feaLib/builder.py32
-rw-r--r--contrib/python/fonttools/fontTools/feaLib/lexer.py4
-rw-r--r--contrib/python/fonttools/fontTools/feaLib/parser.py8
-rw-r--r--contrib/python/fonttools/fontTools/merge/layout.py16
-rw-r--r--contrib/python/fonttools/fontTools/misc/classifyTools.py1
-rw-r--r--contrib/python/fonttools/fontTools/misc/cliTools.py1
-rw-r--r--contrib/python/fonttools/fontTools/misc/configTools.py1
-rw-r--r--contrib/python/fonttools/fontTools/misc/dictTools.py1
-rw-r--r--contrib/python/fonttools/fontTools/misc/etree.py1
-rw-r--r--contrib/python/fonttools/fontTools/misc/filenames.py1
-rw-r--r--contrib/python/fonttools/fontTools/misc/textTools.py1
-rw-r--r--contrib/python/fonttools/fontTools/misc/transform.py1
-rw-r--r--contrib/python/fonttools/fontTools/misc/vector.py1
-rw-r--r--contrib/python/fonttools/fontTools/otlLib/builder.py346
-rw-r--r--contrib/python/fonttools/fontTools/pens/basePen.py3
-rw-r--r--contrib/python/fonttools/fontTools/pens/boundsPen.py2
-rw-r--r--contrib/python/fonttools/fontTools/pens/filterPen.py1
-rw-r--r--contrib/python/fonttools/fontTools/pens/hashPointPen.py14
-rw-r--r--contrib/python/fonttools/fontTools/pens/pointInsidePen.py1
-rw-r--r--contrib/python/fonttools/fontTools/pens/quartzPen.py1
-rw-r--r--contrib/python/fonttools/fontTools/pens/recordingPen.py1
-rw-r--r--contrib/python/fonttools/fontTools/pens/reportLabPen.py1
-rw-r--r--contrib/python/fonttools/fontTools/pens/roundingPen.py46
-rw-r--r--contrib/python/fonttools/fontTools/pens/statisticsPen.py3
-rw-r--r--contrib/python/fonttools/fontTools/pens/svgPathPen.py20
-rw-r--r--contrib/python/fonttools/fontTools/pens/teePen.py1
-rw-r--r--contrib/python/fonttools/fontTools/pens/transformPen.py1
-rw-r--r--contrib/python/fonttools/fontTools/subset/__init__.py3
-rw-r--r--contrib/python/fonttools/fontTools/svgLib/path/arc.py1
-rw-r--r--contrib/python/fonttools/fontTools/t1Lib/__init__.py2
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/macUtils.py2
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/removeOverlaps.py8
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/scaleUpem.py1
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/C_O_L_R_.py1
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/O_S_2f_2.py1
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__0.py1
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__1.py1
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__2.py1
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__3.py1
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__5.py1
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/TupleVariation.py20
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/V_O_R_G_.py1
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/_k_e_r_n.py6
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/otBase.py6
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/otConverters.py1
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/otTables.py35
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/otTraverse.py1
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/sbixGlyph.py14
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/tables/ttProgram.py1
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/ttCollection.py1
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/ttFont.py2
-rw-r--r--contrib/python/fonttools/fontTools/ttLib/ttGlyphSet.py2
-rw-r--r--contrib/python/fonttools/fontTools/ttx.py1
-rw-r--r--contrib/python/fonttools/fontTools/ufoLib/__init__.py2
-rw-r--r--contrib/python/fonttools/fontTools/ufoLib/converters.py1
-rw-r--r--contrib/python/fonttools/fontTools/ufoLib/etree.py1
-rw-r--r--contrib/python/fonttools/fontTools/ufoLib/glifLib.py9
-rw-r--r--contrib/python/fonttools/fontTools/ufoLib/plistlib.py1
-rw-r--r--contrib/python/fonttools/fontTools/ufoLib/pointPen.py1
-rw-r--r--contrib/python/fonttools/fontTools/ufoLib/utils.py1
-rw-r--r--contrib/python/fonttools/fontTools/unicodedata/__init__.py6
-rw-r--r--contrib/python/fonttools/fontTools/varLib/__init__.py17
-rw-r--r--contrib/python/fonttools/fontTools/varLib/featureVars.py1
-rw-r--r--contrib/python/fonttools/fontTools/varLib/instancer/__init__.py11
-rw-r--r--contrib/python/fonttools/fontTools/varLib/interpolate_layout.py1
-rw-r--r--contrib/python/fonttools/fontTools/varLib/merger.py1
-rw-r--r--contrib/python/fonttools/fontTools/varLib/mutator.py15
-rw-r--r--contrib/python/fonttools/ya.make3
-rw-r--r--contrib/python/google-auth/py3/.dist-info/METADATA2
-rw-r--r--contrib/python/google-auth/py3/google/auth/compute_engine/_metadata.py2
-rw-r--r--contrib/python/google-auth/py3/google/auth/compute_engine/credentials.py7
-rw-r--r--contrib/python/google-auth/py3/google/auth/credentials.py4
-rw-r--r--contrib/python/google-auth/py3/google/auth/downscoped.py14
-rw-r--r--contrib/python/google-auth/py3/google/auth/external_account.py10
-rw-r--r--contrib/python/google-auth/py3/google/auth/external_account_authorized_user.py9
-rw-r--r--contrib/python/google-auth/py3/google/auth/version.py2
-rw-r--r--contrib/python/google-auth/py3/google/oauth2/credentials.py11
-rw-r--r--contrib/python/google-auth/py3/google/oauth2/service_account.py31
-rw-r--r--contrib/python/google-auth/py3/tests/compute_engine/test__metadata.py13
-rw-r--r--contrib/python/google-auth/py3/tests/compute_engine/test_credentials.py8
-rw-r--r--contrib/python/google-auth/py3/tests/oauth2/test_service_account.py11
-rw-r--r--contrib/python/google-auth/py3/tests/test_aws.py3
-rw-r--r--contrib/python/google-auth/py3/tests/test_downscoped.py88
-rw-r--r--contrib/python/google-auth/py3/tests/test_external_account.py14
-rw-r--r--contrib/python/google-auth/py3/tests/test_external_account_authorized_user.py2
-rw-r--r--contrib/python/google-auth/py3/tests/test_identity_pool.py4
-rw-r--r--contrib/python/google-auth/py3/tests/test_pluggable.py2
-rw-r--r--contrib/python/google-auth/py3/ya.make2
-rw-r--r--contrib/python/httpcore/.dist-info/METADATA12
-rw-r--r--contrib/python/httpcore/httpcore/__init__.py2
-rw-r--r--contrib/python/httpcore/httpcore/_async/connection.py18
-rw-r--r--contrib/python/httpcore/httpcore/_async/connection_pool.py364
-rw-r--r--contrib/python/httpcore/httpcore/_async/http11.py3
-rw-r--r--contrib/python/httpcore/httpcore/_async/socks_proxy.py4
-rw-r--r--contrib/python/httpcore/httpcore/_sync/connection.py18
-rw-r--r--contrib/python/httpcore/httpcore/_sync/connection_pool.py364
-rw-r--r--contrib/python/httpcore/httpcore/_sync/http11.py3
-rw-r--r--contrib/python/httpcore/httpcore/_synchronization.py58
-rw-r--r--contrib/python/httpcore/ya.make2
-rw-r--r--contrib/python/hypothesis/py3/.dist-info/METADATA6
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/control.py62
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/core.py8
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/extra/_patching.py37
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/extra/codemods.py8
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/extra/ghostwriter.py158
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/extra/pandas/impl.py8
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py204
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/internal/conjecture/datatree.py801
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/internal/conjecture/engine.py23
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/internal/conjecture/junkdrawer.py8
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/internal/conjecture/shrinker.py12
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/internal/conjecture/utils.py22
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/internal/escalation.py8
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/internal/observability.py18
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/internal/reflection.py3
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/provisional.py8
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/stateful.py45
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/strategies/_internal/core.py37
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/strategies/_internal/misc.py8
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/strategies/_internal/utils.py18
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/vendor/pretty.py2
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/vendor/tlds-alpha-by-domain.txt6
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/version.py2
-rw-r--r--contrib/python/hypothesis/py3/ya.make2
-rw-r--r--contrib/python/numpy/py2/numpy/core/include/numpy/npy_math.h2
-rw-r--r--contrib/python/psutil/py2/psutil/_psaix.py552
-rw-r--r--contrib/python/psutil/py2/psutil/_psbsd.py917
-rw-r--r--contrib/python/psutil/py2/psutil/_pssunos.py727
-rw-r--r--contrib/python/psutil/py2/psutil/_psutil_posix.c4
-rw-r--r--contrib/python/psutil/py2/psutil/arch/aix/ifaddrs.h34
-rw-r--r--contrib/python/psutil/py2/psutil/arch/osx/ya.make9
-rw-r--r--contrib/python/psutil/py2/psutil/arch/solaris/v10/ifaddrs.h26
-rw-r--r--contrib/python/psutil/py2/test/test.py4
-rw-r--r--contrib/python/psutil/py2/test/ya.make8
-rw-r--r--contrib/python/psutil/py2/ya.make147
-rw-r--r--contrib/python/psutil/py3/psutil/_psaix.py552
-rw-r--r--contrib/python/psutil/py3/psutil/_psbsd.py917
-rw-r--r--contrib/python/psutil/py3/psutil/_pssunos.py727
-rw-r--r--contrib/python/psutil/py3/psutil/_psutil_posix.c4
-rw-r--r--contrib/python/psutil/py3/psutil/arch/aix/ifaddrs.h34
-rw-r--r--contrib/python/psutil/py3/psutil/arch/osx/ya.make9
-rw-r--r--contrib/python/psutil/py3/psutil/arch/solaris/v10/ifaddrs.h26
-rw-r--r--contrib/python/psutil/py3/test/test.py4
-rw-r--r--contrib/python/psutil/py3/test/ya.make8
-rw-r--r--contrib/python/psutil/py3/ya.make147
-rw-r--r--contrib/python/responses/py3/.dist-info/METADATA4
-rw-r--r--contrib/python/responses/py3/README.rst1
-rw-r--r--contrib/python/responses/py3/responses/matchers.py27
-rw-r--r--contrib/python/responses/py3/ya.make2
-rw-r--r--contrib/python/setuptools/py3/.dist-info/METADATA19
-rw-r--r--contrib/python/setuptools/py3/README.rst13
-rw-r--r--contrib/python/setuptools/py3/_distutils_hack/__init__.py13
-rw-r--r--contrib/python/setuptools/py3/pkg_resources/__init__.py113
-rw-r--r--contrib/python/setuptools/py3/setuptools/_core_metadata.py1
-rw-r--r--contrib/python/setuptools/py3/setuptools/_normalization.py16
-rw-r--r--contrib/python/setuptools/py3/setuptools/_reqs.py6
-rw-r--r--contrib/python/setuptools/py3/setuptools/build_meta.py8
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/_requirestxt.py1
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/bdist_egg.py23
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/bdist_rpm.py3
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/build.py11
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/build_ext.py60
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/build_py.py2
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/develop.py7
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/dist_info.py9
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/easy_install.py104
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/editable_wheel.py28
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/egg_info.py11
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/install.py5
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/sdist.py16
-rw-r--r--contrib/python/setuptools/py3/setuptools/command/test.py2
-rw-r--r--contrib/python/setuptools/py3/setuptools/compat/__init__.py (renamed from contrib/tools/python3/src/Lib/email/mime/__init__.py)0
-rw-r--r--contrib/python/setuptools/py3/setuptools/compat/py310.py10
-rw-r--r--contrib/python/setuptools/py3/setuptools/compat/py311.py (renamed from contrib/python/setuptools/py3/setuptools/py312compat.py)0
-rw-r--r--contrib/python/setuptools/py3/setuptools/config/__init__.py1
-rw-r--r--contrib/python/setuptools/py3/setuptools/config/_apply_pyprojecttoml.py7
-rw-r--r--contrib/python/setuptools/py3/setuptools/config/_validate_pyproject/error_reporting.py2
-rw-r--r--contrib/python/setuptools/py3/setuptools/config/expand.py1
-rw-r--r--contrib/python/setuptools/py3/setuptools/config/pyprojecttoml.py5
-rw-r--r--contrib/python/setuptools/py3/setuptools/config/setupcfg.py15
-rw-r--r--contrib/python/setuptools/py3/setuptools/depends.py2
-rw-r--r--contrib/python/setuptools/py3/setuptools/discovery.py2
-rw-r--r--contrib/python/setuptools/py3/setuptools/dist.py10
-rw-r--r--contrib/python/setuptools/py3/setuptools/glob.py7
-rw-r--r--contrib/python/setuptools/py3/setuptools/installer.py3
-rw-r--r--contrib/python/setuptools/py3/setuptools/monkey.py20
-rw-r--r--contrib/python/setuptools/py3/setuptools/msvc.py39
-rw-r--r--contrib/python/setuptools/py3/setuptools/namespaces.py7
-rw-r--r--contrib/python/setuptools/py3/setuptools/package_index.py17
-rw-r--r--contrib/python/setuptools/py3/setuptools/sandbox.py36
-rw-r--r--contrib/python/setuptools/py3/setuptools/unicode_utils.py4
-rw-r--r--contrib/python/setuptools/py3/setuptools/wheel.py8
-rw-r--r--contrib/python/setuptools/py3/ya.make6
-rw-r--r--contrib/python/types-protobuf/ya.make12
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/algorithm.h111
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/container.h128
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/ya.make4
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/attributes.h63
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h24
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/casts.h2
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h115
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/endian.h25
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/identity.h6
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/inline_variable.h37
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.cc2
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/nullability_impl.h106
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.cc20
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.h2
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.h21
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_annotations.h280
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.cc14
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unaligned_access.h19
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.cc1
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.h33
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/no_destructor.h217
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/nullability.h224
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/optimization.h1
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/options.h28
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/prefetch.h39
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/thread_annotations.h2
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/container/flat_hash_map.h6
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/container/flat_hash_set.h2
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/common_policy_traits.h6
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/container_memory.h22
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/hashtablez_sampler.h14
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/inlined_vector.h13
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/layout.h743
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_map.h13
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set.cc179
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set.h995
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/cpu_detect.cc28
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/cpu_detect.h6
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc32_x86_arm_combined_simd.h39
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy.h9
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy_fallback.cc6
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy_x86_64.cc432
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy_x86_arm_combined.cc450
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_x86_arm_combined.cc12
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/debugging/failure_signal_handler.cc2
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/address_is_readable.cc6
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/demangle.cc24
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/demangle.h68
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/stacktrace_aarch64-inl.inc58
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/debugging/symbolize_elf.inc152
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/flags/declare.h5
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/flags/flag.cc38
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/flags/flag.h11
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/flag.h5
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/flag_msvc.inc116
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/usage.cc5
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/flags/marshalling.cc11
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/flags/parse.cc2
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/flags/reflection.cc3
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/flags/ya.make1
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/functional/function_ref.h8
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/functional/internal/any_invocable.h4
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/functional/ya.make4
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal/hash.h51
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/memory/ya.make4
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/meta/ya.make4
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/numeric/bits.h55
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/random/distributions.h2
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/status_internal.cc248
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/status_internal.h69
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/statusor_internal.h55
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/status/status.cc274
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/status/status.h148
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.cc4
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.h5
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.cc7
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.h46
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/status/ya.make1
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/ascii.cc96
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/ascii.h14
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/charconv.cc31
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/charconv.h9
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/charset.h164
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord.cc335
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord.h230
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord_analysis.cc52
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord_analysis.h7
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/escaping.cc9
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/has_absl_stringify.h63
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/has_ostream_operator.h42
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/char_map.h158
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_internal.cc6
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_internal.h64
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_ring.cc773
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_ring.h607
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_info.cc51
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/has_absl_stringify.h55
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/memutil.cc16
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/arg.cc153
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/arg.h96
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/bind.cc18
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/bind.h11
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/constexpr_parser.h11
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/extension.h14
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/parser.h9
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/match.cc3
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/numbers.cc549
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/numbers.h228
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_cat.cc172
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_cat.h153
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_format.h50
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_join.h32
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_replace.cc15
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_replace.h13
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_split.cc14
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_split.h18
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.cc31
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.h117
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/strip.h7
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/substitute.cc16
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/substitute.h194
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/ya.make3
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/pthread_waiter.h4
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/win32_waiter.h6
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.cc628
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.h123
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/time/civil_time.h26
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/time/clock.h6
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/time/duration.cc6
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/include/cctz/civil_time_detail.h4
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_info.cc23
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/tzfile.h8
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_any_cast.cc18
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_optional_access.cc18
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_variant_access.cc18
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/types/internal/variant.h6
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/types/optional.h5
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/types/span.h13
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/utility/utility.h104
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/utility/ya.make4
-rw-r--r--contrib/restricted/aws/s2n/pq-crypto/kyber_r3/KeccakP-brg_endian_avx2.h2
-rw-r--r--contrib/restricted/fast_float/include/fast_float/float_common.h2
-rw-r--r--contrib/restricted/libffi/src/dlmalloc.c2
-rw-r--r--contrib/restricted/libffi/src/x86/ffi64.c2
-rw-r--r--contrib/restricted/llhttp/include/llhttp.h11
-rw-r--r--contrib/restricted/llhttp/src/llhttp.c827
-rw-r--r--contrib/restricted/llhttp/ya.make4
-rw-r--r--contrib/tools/bison/gnulib/src/glthread/lock.h2
-rw-r--r--contrib/tools/bison/gnulib/src/localcharset.c2
-rw-r--r--contrib/tools/python/src/Modules/posixmodule.c4
-rw-r--r--contrib/tools/python/src/Modules/socketmodule.c2
-rw-r--r--contrib/tools/python/src/Modules/timemodule.c2
-rw-r--r--contrib/tools/python/src/Python/import.c4
-rw-r--r--contrib/tools/python/src/Python/importdl.h2
-rw-r--r--contrib/tools/python3/Include/Python.h (renamed from contrib/tools/python3/src/Include/Python.h)0
-rw-r--r--contrib/tools/python3/Include/abstract.h (renamed from contrib/tools/python3/src/Include/abstract.h)0
-rw-r--r--contrib/tools/python3/Include/bltinmodule.h (renamed from contrib/tools/python3/src/Include/bltinmodule.h)0
-rw-r--r--contrib/tools/python3/Include/boolobject.h (renamed from contrib/tools/python3/src/Include/boolobject.h)0
-rw-r--r--contrib/tools/python3/Include/bytearrayobject.h (renamed from contrib/tools/python3/src/Include/bytearrayobject.h)0
-rw-r--r--contrib/tools/python3/Include/bytesobject.h (renamed from contrib/tools/python3/src/Include/bytesobject.h)0
-rw-r--r--contrib/tools/python3/Include/ceval.h (renamed from contrib/tools/python3/src/Include/ceval.h)0
-rw-r--r--contrib/tools/python3/Include/codecs.h (renamed from contrib/tools/python3/src/Include/codecs.h)0
-rw-r--r--contrib/tools/python3/Include/compile.h (renamed from contrib/tools/python3/src/Include/compile.h)0
-rw-r--r--contrib/tools/python3/Include/complexobject.h (renamed from contrib/tools/python3/src/Include/complexobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/abstract.h (renamed from contrib/tools/python3/src/Include/cpython/abstract.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/bytearrayobject.h (renamed from contrib/tools/python3/src/Include/cpython/bytearrayobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/bytesobject.h (renamed from contrib/tools/python3/src/Include/cpython/bytesobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/cellobject.h (renamed from contrib/tools/python3/src/Include/cpython/cellobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/ceval.h (renamed from contrib/tools/python3/src/Include/cpython/ceval.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/classobject.h (renamed from contrib/tools/python3/src/Include/cpython/classobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/code.h (renamed from contrib/tools/python3/src/Include/cpython/code.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/compile.h (renamed from contrib/tools/python3/src/Include/cpython/compile.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/complexobject.h (renamed from contrib/tools/python3/src/Include/cpython/complexobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/context.h (renamed from contrib/tools/python3/src/Include/cpython/context.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/descrobject.h (renamed from contrib/tools/python3/src/Include/cpython/descrobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/dictobject.h (renamed from contrib/tools/python3/src/Include/cpython/dictobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/fileobject.h (renamed from contrib/tools/python3/src/Include/cpython/fileobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/fileutils.h (renamed from contrib/tools/python3/src/Include/cpython/fileutils.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/floatobject.h (renamed from contrib/tools/python3/src/Include/cpython/floatobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/frameobject.h (renamed from contrib/tools/python3/src/Include/cpython/frameobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/funcobject.h (renamed from contrib/tools/python3/src/Include/cpython/funcobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/genobject.h (renamed from contrib/tools/python3/src/Include/cpython/genobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/import.h (renamed from contrib/tools/python3/src/Include/cpython/import.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/initconfig.h (renamed from contrib/tools/python3/src/Include/cpython/initconfig.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/interpreteridobject.h (renamed from contrib/tools/python3/src/Include/cpython/interpreteridobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/listobject.h (renamed from contrib/tools/python3/src/Include/cpython/listobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/longintrepr.h (renamed from contrib/tools/python3/src/Include/cpython/longintrepr.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/longobject.h (renamed from contrib/tools/python3/src/Include/cpython/longobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/memoryobject.h (renamed from contrib/tools/python3/src/Include/cpython/memoryobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/methodobject.h (renamed from contrib/tools/python3/src/Include/cpython/methodobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/modsupport.h (renamed from contrib/tools/python3/src/Include/cpython/modsupport.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/object.h (renamed from contrib/tools/python3/src/Include/cpython/object.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/objimpl.h (renamed from contrib/tools/python3/src/Include/cpython/objimpl.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/odictobject.h (renamed from contrib/tools/python3/src/Include/cpython/odictobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/picklebufobject.h (renamed from contrib/tools/python3/src/Include/cpython/picklebufobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/pthread_stubs.h (renamed from contrib/tools/python3/src/Include/cpython/pthread_stubs.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/pyctype.h (renamed from contrib/tools/python3/src/Include/cpython/pyctype.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/pydebug.h (renamed from contrib/tools/python3/src/Include/cpython/pydebug.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/pyerrors.h (renamed from contrib/tools/python3/src/Include/cpython/pyerrors.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/pyfpe.h (renamed from contrib/tools/python3/src/Include/cpython/pyfpe.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/pyframe.h (renamed from contrib/tools/python3/src/Include/cpython/pyframe.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/pylifecycle.h (renamed from contrib/tools/python3/src/Include/cpython/pylifecycle.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/pymem.h (renamed from contrib/tools/python3/src/Include/cpython/pymem.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/pystate.h (renamed from contrib/tools/python3/src/Include/cpython/pystate.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/pythonrun.h (renamed from contrib/tools/python3/src/Include/cpython/pythonrun.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/pythread.h (renamed from contrib/tools/python3/src/Include/cpython/pythread.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/pytime.h331
-rw-r--r--contrib/tools/python3/Include/cpython/setobject.h (renamed from contrib/tools/python3/src/Include/cpython/setobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/sysmodule.h (renamed from contrib/tools/python3/src/Include/cpython/sysmodule.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/traceback.h (renamed from contrib/tools/python3/src/Include/cpython/traceback.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/tupleobject.h (renamed from contrib/tools/python3/src/Include/cpython/tupleobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/unicodeobject.h (renamed from contrib/tools/python3/src/Include/cpython/unicodeobject.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/warnings.h (renamed from contrib/tools/python3/src/Include/cpython/warnings.h)0
-rw-r--r--contrib/tools/python3/Include/cpython/weakrefobject.h (renamed from contrib/tools/python3/src/Include/cpython/weakrefobject.h)0
-rw-r--r--contrib/tools/python3/Include/datetime.h (renamed from contrib/tools/python3/src/Include/datetime.h)0
-rw-r--r--contrib/tools/python3/Include/descrobject.h (renamed from contrib/tools/python3/src/Include/descrobject.h)0
-rw-r--r--contrib/tools/python3/Include/dictobject.h (renamed from contrib/tools/python3/src/Include/dictobject.h)0
-rw-r--r--contrib/tools/python3/Include/dynamic_annotations.h (renamed from contrib/tools/python3/src/Include/dynamic_annotations.h)0
-rw-r--r--contrib/tools/python3/Include/enumobject.h (renamed from contrib/tools/python3/src/Include/enumobject.h)0
-rw-r--r--contrib/tools/python3/Include/errcode.h (renamed from contrib/tools/python3/src/Include/errcode.h)0
-rw-r--r--contrib/tools/python3/Include/exports.h (renamed from contrib/tools/python3/src/Include/exports.h)0
-rw-r--r--contrib/tools/python3/Include/fileobject.h (renamed from contrib/tools/python3/src/Include/fileobject.h)0
-rw-r--r--contrib/tools/python3/Include/fileutils.h (renamed from contrib/tools/python3/src/Include/fileutils.h)0
-rw-r--r--contrib/tools/python3/Include/floatobject.h (renamed from contrib/tools/python3/src/Include/floatobject.h)0
-rw-r--r--contrib/tools/python3/Include/frameobject.h (renamed from contrib/tools/python3/src/Include/frameobject.h)0
-rw-r--r--contrib/tools/python3/Include/genericaliasobject.h (renamed from contrib/tools/python3/src/Include/genericaliasobject.h)0
-rw-r--r--contrib/tools/python3/Include/import.h (renamed from contrib/tools/python3/src/Include/import.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_abstract.h (renamed from contrib/tools/python3/src/Include/internal/pycore_abstract.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_asdl.h (renamed from contrib/tools/python3/src/Include/internal/pycore_asdl.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_ast.h (renamed from contrib/tools/python3/src/Include/internal/pycore_ast.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_ast_state.h (renamed from contrib/tools/python3/src/Include/internal/pycore_ast_state.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_atexit.h (renamed from contrib/tools/python3/src/Include/internal/pycore_atexit.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_atomic.h (renamed from contrib/tools/python3/src/Include/internal/pycore_atomic.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_atomic_funcs.h (renamed from contrib/tools/python3/src/Include/internal/pycore_atomic_funcs.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_bitutils.h (renamed from contrib/tools/python3/src/Include/internal/pycore_bitutils.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_blocks_output_buffer.h (renamed from contrib/tools/python3/src/Include/internal/pycore_blocks_output_buffer.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_bytes_methods.h (renamed from contrib/tools/python3/src/Include/internal/pycore_bytes_methods.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_bytesobject.h (renamed from contrib/tools/python3/src/Include/internal/pycore_bytesobject.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_call.h (renamed from contrib/tools/python3/src/Include/internal/pycore_call.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_ceval.h (renamed from contrib/tools/python3/src/Include/internal/pycore_ceval.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_ceval_state.h (renamed from contrib/tools/python3/src/Include/internal/pycore_ceval_state.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_code.h (renamed from contrib/tools/python3/src/Include/internal/pycore_code.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_compile.h (renamed from contrib/tools/python3/src/Include/internal/pycore_compile.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_condvar.h97
-rw-r--r--contrib/tools/python3/Include/internal/pycore_context.h (renamed from contrib/tools/python3/src/Include/internal/pycore_context.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_descrobject.h (renamed from contrib/tools/python3/src/Include/internal/pycore_descrobject.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_dict.h (renamed from contrib/tools/python3/src/Include/internal/pycore_dict.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_dict_state.h (renamed from contrib/tools/python3/src/Include/internal/pycore_dict_state.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_dtoa.h (renamed from contrib/tools/python3/src/Include/internal/pycore_dtoa.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_emscripten_signal.h (renamed from contrib/tools/python3/src/Include/internal/pycore_emscripten_signal.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_exceptions.h (renamed from contrib/tools/python3/src/Include/internal/pycore_exceptions.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_faulthandler.h (renamed from contrib/tools/python3/src/Include/internal/pycore_faulthandler.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_fileutils.h (renamed from contrib/tools/python3/src/Include/internal/pycore_fileutils.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_fileutils_windows.h (renamed from contrib/tools/python3/src/Include/internal/pycore_fileutils_windows.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_floatobject.h (renamed from contrib/tools/python3/src/Include/internal/pycore_floatobject.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_flowgraph.h (renamed from contrib/tools/python3/src/Include/internal/pycore_flowgraph.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_format.h (renamed from contrib/tools/python3/src/Include/internal/pycore_format.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_frame.h (renamed from contrib/tools/python3/src/Include/internal/pycore_frame.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_function.h (renamed from contrib/tools/python3/src/Include/internal/pycore_function.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_gc.h (renamed from contrib/tools/python3/src/Include/internal/pycore_gc.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_genobject.h (renamed from contrib/tools/python3/src/Include/internal/pycore_genobject.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_getopt.h (renamed from contrib/tools/python3/src/Include/internal/pycore_getopt.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_gil.h (renamed from contrib/tools/python3/src/Include/internal/pycore_gil.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_global_objects.h (renamed from contrib/tools/python3/src/Include/internal/pycore_global_objects.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_global_objects_fini_generated.h (renamed from contrib/tools/python3/src/Include/internal/pycore_global_objects_fini_generated.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_global_strings.h (renamed from contrib/tools/python3/src/Include/internal/pycore_global_strings.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_hamt.h (renamed from contrib/tools/python3/src/Include/internal/pycore_hamt.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_hashtable.h (renamed from contrib/tools/python3/src/Include/internal/pycore_hashtable.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_import.h (renamed from contrib/tools/python3/src/Include/internal/pycore_import.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_initconfig.h (renamed from contrib/tools/python3/src/Include/internal/pycore_initconfig.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_instruments.h (renamed from contrib/tools/python3/src/Include/internal/pycore_instruments.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_interp.h (renamed from contrib/tools/python3/src/Include/internal/pycore_interp.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_intrinsics.h (renamed from contrib/tools/python3/src/Include/internal/pycore_intrinsics.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_list.h (renamed from contrib/tools/python3/src/Include/internal/pycore_list.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_long.h (renamed from contrib/tools/python3/src/Include/internal/pycore_long.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_memoryobject.h (renamed from contrib/tools/python3/src/Include/internal/pycore_memoryobject.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_moduleobject.h (renamed from contrib/tools/python3/src/Include/internal/pycore_moduleobject.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_namespace.h (renamed from contrib/tools/python3/src/Include/internal/pycore_namespace.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_object.h (renamed from contrib/tools/python3/src/Include/internal/pycore_object.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_object_state.h (renamed from contrib/tools/python3/src/Include/internal/pycore_object_state.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_obmalloc.h (renamed from contrib/tools/python3/src/Include/internal/pycore_obmalloc.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_obmalloc_init.h (renamed from contrib/tools/python3/src/Include/internal/pycore_obmalloc_init.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_opcode.h (renamed from contrib/tools/python3/src/Include/internal/pycore_opcode.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_opcode_utils.h (renamed from contrib/tools/python3/src/Include/internal/pycore_opcode_utils.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_parser.h (renamed from contrib/tools/python3/src/Include/internal/pycore_parser.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_pathconfig.h (renamed from contrib/tools/python3/src/Include/internal/pycore_pathconfig.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_pyarena.h (renamed from contrib/tools/python3/src/Include/internal/pycore_pyarena.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_pyerrors.h (renamed from contrib/tools/python3/src/Include/internal/pycore_pyerrors.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_pyhash.h (renamed from contrib/tools/python3/src/Include/internal/pycore_pyhash.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_pylifecycle.h (renamed from contrib/tools/python3/src/Include/internal/pycore_pylifecycle.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_pymath.h (renamed from contrib/tools/python3/src/Include/internal/pycore_pymath.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_pymem.h (renamed from contrib/tools/python3/src/Include/internal/pycore_pymem.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_pymem_init.h (renamed from contrib/tools/python3/src/Include/internal/pycore_pymem_init.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_pystate.h (renamed from contrib/tools/python3/src/Include/internal/pycore_pystate.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_pythread.h (renamed from contrib/tools/python3/src/Include/internal/pycore_pythread.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_range.h (renamed from contrib/tools/python3/src/Include/internal/pycore_range.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_runtime.h (renamed from contrib/tools/python3/src/Include/internal/pycore_runtime.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_runtime_init.h (renamed from contrib/tools/python3/src/Include/internal/pycore_runtime_init.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_runtime_init_generated.h (renamed from contrib/tools/python3/src/Include/internal/pycore_runtime_init_generated.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_signal.h (renamed from contrib/tools/python3/src/Include/internal/pycore_signal.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_sliceobject.h (renamed from contrib/tools/python3/src/Include/internal/pycore_sliceobject.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_strhex.h (renamed from contrib/tools/python3/src/Include/internal/pycore_strhex.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_structseq.h (renamed from contrib/tools/python3/src/Include/internal/pycore_structseq.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_symtable.h (renamed from contrib/tools/python3/src/Include/internal/pycore_symtable.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_sysmodule.h (renamed from contrib/tools/python3/src/Include/internal/pycore_sysmodule.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_time.h (renamed from contrib/tools/python3/src/Include/internal/pycore_time.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_token.h (renamed from contrib/tools/python3/src/Include/internal/pycore_token.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_traceback.h (renamed from contrib/tools/python3/src/Include/internal/pycore_traceback.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_tracemalloc.h (renamed from contrib/tools/python3/src/Include/internal/pycore_tracemalloc.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_tuple.h (renamed from contrib/tools/python3/src/Include/internal/pycore_tuple.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_typeobject.h (renamed from contrib/tools/python3/src/Include/internal/pycore_typeobject.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_typevarobject.h (renamed from contrib/tools/python3/src/Include/internal/pycore_typevarobject.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_ucnhash.h (renamed from contrib/tools/python3/src/Include/internal/pycore_ucnhash.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_unicodeobject.h (renamed from contrib/tools/python3/src/Include/internal/pycore_unicodeobject.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_unicodeobject_generated.h (renamed from contrib/tools/python3/src/Include/internal/pycore_unicodeobject_generated.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_unionobject.h (renamed from contrib/tools/python3/src/Include/internal/pycore_unionobject.h)0
-rw-r--r--contrib/tools/python3/Include/internal/pycore_warnings.h (renamed from contrib/tools/python3/src/Include/internal/pycore_warnings.h)0
-rw-r--r--contrib/tools/python3/Include/interpreteridobject.h (renamed from contrib/tools/python3/src/Include/interpreteridobject.h)0
-rw-r--r--contrib/tools/python3/Include/intrcheck.h (renamed from contrib/tools/python3/src/Include/intrcheck.h)0
-rw-r--r--contrib/tools/python3/Include/iterobject.h (renamed from contrib/tools/python3/src/Include/iterobject.h)0
-rw-r--r--contrib/tools/python3/Include/listobject.h (renamed from contrib/tools/python3/src/Include/listobject.h)0
-rw-r--r--contrib/tools/python3/Include/longobject.h (renamed from contrib/tools/python3/src/Include/longobject.h)0
-rw-r--r--contrib/tools/python3/Include/marshal.h (renamed from contrib/tools/python3/src/Include/marshal.h)0
-rw-r--r--contrib/tools/python3/Include/memoryobject.h (renamed from contrib/tools/python3/src/Include/memoryobject.h)0
-rw-r--r--contrib/tools/python3/Include/methodobject.h (renamed from contrib/tools/python3/src/Include/methodobject.h)0
-rw-r--r--contrib/tools/python3/Include/modsupport.h (renamed from contrib/tools/python3/src/Include/modsupport.h)0
-rw-r--r--contrib/tools/python3/Include/moduleobject.h (renamed from contrib/tools/python3/src/Include/moduleobject.h)0
-rw-r--r--contrib/tools/python3/Include/object.h (renamed from contrib/tools/python3/src/Include/object.h)0
-rw-r--r--contrib/tools/python3/Include/objimpl.h (renamed from contrib/tools/python3/src/Include/objimpl.h)0
-rw-r--r--contrib/tools/python3/Include/opcode.h (renamed from contrib/tools/python3/src/Include/opcode.h)0
-rw-r--r--contrib/tools/python3/Include/osdefs.h (renamed from contrib/tools/python3/src/Include/osdefs.h)0
-rw-r--r--contrib/tools/python3/Include/osmodule.h (renamed from contrib/tools/python3/src/Include/osmodule.h)0
-rw-r--r--contrib/tools/python3/Include/patchlevel.h (renamed from contrib/tools/python3/src/Include/patchlevel.h)0
-rw-r--r--contrib/tools/python3/Include/pybuffer.h (renamed from contrib/tools/python3/src/Include/pybuffer.h)0
-rw-r--r--contrib/tools/python3/Include/pycapsule.h (renamed from contrib/tools/python3/src/Include/pycapsule.h)0
-rw-r--r--contrib/tools/python3/Include/pyconfig-linux.h1947
-rw-r--r--contrib/tools/python3/Include/pyconfig-musl.h (renamed from contrib/tools/python3/src/Include/pyconfig-musl.h)0
-rw-r--r--contrib/tools/python3/Include/pyconfig-osx-arm64.h (renamed from contrib/tools/python3/src/Include/pyconfig-osx-arm64.h)0
-rw-r--r--contrib/tools/python3/Include/pyconfig-osx.h (renamed from contrib/tools/python3/src/Include/pyconfig-osx.h)0
-rw-r--r--contrib/tools/python3/Include/pyconfig.h (renamed from contrib/tools/python3/src/Include/pyconfig.h)0
-rw-r--r--contrib/tools/python3/Include/pydtrace.h (renamed from contrib/tools/python3/src/Include/pydtrace.h)0
-rw-r--r--contrib/tools/python3/Include/pyerrors.h (renamed from contrib/tools/python3/src/Include/pyerrors.h)0
-rw-r--r--contrib/tools/python3/Include/pyexpat.h (renamed from contrib/tools/python3/src/Include/pyexpat.h)0
-rw-r--r--contrib/tools/python3/Include/pyframe.h (renamed from contrib/tools/python3/src/Include/pyframe.h)0
-rw-r--r--contrib/tools/python3/Include/pyhash.h (renamed from contrib/tools/python3/src/Include/pyhash.h)0
-rw-r--r--contrib/tools/python3/Include/pylifecycle.h (renamed from contrib/tools/python3/src/Include/pylifecycle.h)0
-rw-r--r--contrib/tools/python3/Include/pymacconfig.h (renamed from contrib/tools/python3/src/Include/pymacconfig.h)0
-rw-r--r--contrib/tools/python3/Include/pymacro.h (renamed from contrib/tools/python3/src/Include/pymacro.h)0
-rw-r--r--contrib/tools/python3/Include/pymath.h (renamed from contrib/tools/python3/src/Include/pymath.h)0
-rw-r--r--contrib/tools/python3/Include/pymem.h (renamed from contrib/tools/python3/src/Include/pymem.h)0
-rw-r--r--contrib/tools/python3/Include/pyport.h (renamed from contrib/tools/python3/src/Include/pyport.h)0
-rw-r--r--contrib/tools/python3/Include/pystate.h (renamed from contrib/tools/python3/src/Include/pystate.h)0
-rw-r--r--contrib/tools/python3/Include/pystats.h (renamed from contrib/tools/python3/src/Include/pystats.h)0
-rw-r--r--contrib/tools/python3/Include/pystrcmp.h (renamed from contrib/tools/python3/src/Include/pystrcmp.h)0
-rw-r--r--contrib/tools/python3/Include/pystrtod.h (renamed from contrib/tools/python3/src/Include/pystrtod.h)0
-rw-r--r--contrib/tools/python3/Include/pythonrun.h (renamed from contrib/tools/python3/src/Include/pythonrun.h)0
-rw-r--r--contrib/tools/python3/Include/pythread.h (renamed from contrib/tools/python3/src/Include/pythread.h)0
-rw-r--r--contrib/tools/python3/Include/pytypedefs.h (renamed from contrib/tools/python3/src/Include/pytypedefs.h)0
-rw-r--r--contrib/tools/python3/Include/rangeobject.h (renamed from contrib/tools/python3/src/Include/rangeobject.h)0
-rw-r--r--contrib/tools/python3/Include/setobject.h (renamed from contrib/tools/python3/src/Include/setobject.h)0
-rw-r--r--contrib/tools/python3/Include/sliceobject.h (renamed from contrib/tools/python3/src/Include/sliceobject.h)0
-rw-r--r--contrib/tools/python3/Include/structmember.h (renamed from contrib/tools/python3/src/Include/structmember.h)0
-rw-r--r--contrib/tools/python3/Include/structseq.h (renamed from contrib/tools/python3/src/Include/structseq.h)0
-rw-r--r--contrib/tools/python3/Include/sysmodule.h (renamed from contrib/tools/python3/src/Include/sysmodule.h)0
-rw-r--r--contrib/tools/python3/Include/traceback.h (renamed from contrib/tools/python3/src/Include/traceback.h)0
-rw-r--r--contrib/tools/python3/Include/tracemalloc.h (renamed from contrib/tools/python3/src/Include/tracemalloc.h)0
-rw-r--r--contrib/tools/python3/Include/tupleobject.h (renamed from contrib/tools/python3/src/Include/tupleobject.h)0
-rw-r--r--contrib/tools/python3/Include/typeslots.h (renamed from contrib/tools/python3/src/Include/typeslots.h)0
-rw-r--r--contrib/tools/python3/Include/unicodeobject.h (renamed from contrib/tools/python3/src/Include/unicodeobject.h)0
-rw-r--r--contrib/tools/python3/Include/warnings.h (renamed from contrib/tools/python3/src/Include/warnings.h)0
-rw-r--r--contrib/tools/python3/Include/weakrefobject.h (renamed from contrib/tools/python3/src/Include/weakrefobject.h)0
-rw-r--r--contrib/tools/python3/LICENSE (renamed from contrib/tools/python3/src/LICENSE)0
-rw-r--r--contrib/tools/python3/Lib/__future__.py (renamed from contrib/tools/python3/src/Lib/__future__.py)0
-rw-r--r--contrib/tools/python3/Lib/__hello__.py (renamed from contrib/tools/python3/src/Lib/__hello__.py)0
-rw-r--r--contrib/tools/python3/Lib/_aix_support.py (renamed from contrib/tools/python3/src/Lib/_aix_support.py)0
-rw-r--r--contrib/tools/python3/Lib/_collections_abc.py (renamed from contrib/tools/python3/src/Lib/_collections_abc.py)0
-rw-r--r--contrib/tools/python3/Lib/_compat_pickle.py (renamed from contrib/tools/python3/src/Lib/_compat_pickle.py)0
-rw-r--r--contrib/tools/python3/Lib/_compression.py (renamed from contrib/tools/python3/src/Lib/_compression.py)0
-rw-r--r--contrib/tools/python3/Lib/_markupbase.py (renamed from contrib/tools/python3/src/Lib/_markupbase.py)0
-rw-r--r--contrib/tools/python3/Lib/_osx_support.py (renamed from contrib/tools/python3/src/Lib/_osx_support.py)0
-rw-r--r--contrib/tools/python3/Lib/_py_abc.py (renamed from contrib/tools/python3/src/Lib/_py_abc.py)0
-rw-r--r--contrib/tools/python3/Lib/_pydatetime.py (renamed from contrib/tools/python3/src/Lib/_pydatetime.py)0
-rw-r--r--contrib/tools/python3/Lib/_pydecimal.py (renamed from contrib/tools/python3/src/Lib/_pydecimal.py)0
-rw-r--r--contrib/tools/python3/Lib/_pyio.py (renamed from contrib/tools/python3/src/Lib/_pyio.py)0
-rw-r--r--contrib/tools/python3/Lib/_pylong.py (renamed from contrib/tools/python3/src/Lib/_pylong.py)0
-rw-r--r--contrib/tools/python3/Lib/_sitebuiltins.py (renamed from contrib/tools/python3/src/Lib/_sitebuiltins.py)0
-rw-r--r--contrib/tools/python3/Lib/_strptime.py (renamed from contrib/tools/python3/src/Lib/_strptime.py)0
-rw-r--r--contrib/tools/python3/Lib/_sysconfigdata_arcadia.py (renamed from contrib/tools/python3/src/Lib/_sysconfigdata_arcadia.py)0
-rw-r--r--contrib/tools/python3/Lib/_threading_local.py (renamed from contrib/tools/python3/src/Lib/_threading_local.py)0
-rw-r--r--contrib/tools/python3/Lib/_weakrefset.py (renamed from contrib/tools/python3/src/Lib/_weakrefset.py)0
-rw-r--r--contrib/tools/python3/Lib/abc.py (renamed from contrib/tools/python3/src/Lib/abc.py)0
-rw-r--r--contrib/tools/python3/Lib/aifc.py (renamed from contrib/tools/python3/src/Lib/aifc.py)0
-rw-r--r--contrib/tools/python3/Lib/antigravity.py (renamed from contrib/tools/python3/src/Lib/antigravity.py)0
-rw-r--r--contrib/tools/python3/Lib/argparse.py (renamed from contrib/tools/python3/src/Lib/argparse.py)0
-rw-r--r--contrib/tools/python3/Lib/ast.py (renamed from contrib/tools/python3/src/Lib/ast.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/__init__.py (renamed from contrib/tools/python3/src/Lib/asyncio/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/__main__.py (renamed from contrib/tools/python3/src/Lib/asyncio/__main__.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/base_events.py (renamed from contrib/tools/python3/src/Lib/asyncio/base_events.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/base_futures.py (renamed from contrib/tools/python3/src/Lib/asyncio/base_futures.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/base_subprocess.py (renamed from contrib/tools/python3/src/Lib/asyncio/base_subprocess.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/base_tasks.py (renamed from contrib/tools/python3/src/Lib/asyncio/base_tasks.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/constants.py (renamed from contrib/tools/python3/src/Lib/asyncio/constants.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/coroutines.py (renamed from contrib/tools/python3/src/Lib/asyncio/coroutines.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/events.py (renamed from contrib/tools/python3/src/Lib/asyncio/events.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/exceptions.py (renamed from contrib/tools/python3/src/Lib/asyncio/exceptions.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/format_helpers.py (renamed from contrib/tools/python3/src/Lib/asyncio/format_helpers.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/futures.py (renamed from contrib/tools/python3/src/Lib/asyncio/futures.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/locks.py (renamed from contrib/tools/python3/src/Lib/asyncio/locks.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/log.py (renamed from contrib/tools/python3/src/Lib/asyncio/log.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/mixins.py (renamed from contrib/tools/python3/src/Lib/asyncio/mixins.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/proactor_events.py (renamed from contrib/tools/python3/src/Lib/asyncio/proactor_events.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/protocols.py (renamed from contrib/tools/python3/src/Lib/asyncio/protocols.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/queues.py (renamed from contrib/tools/python3/src/Lib/asyncio/queues.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/runners.py (renamed from contrib/tools/python3/src/Lib/asyncio/runners.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/selector_events.py (renamed from contrib/tools/python3/src/Lib/asyncio/selector_events.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/sslproto.py (renamed from contrib/tools/python3/src/Lib/asyncio/sslproto.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/staggered.py (renamed from contrib/tools/python3/src/Lib/asyncio/staggered.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/streams.py (renamed from contrib/tools/python3/src/Lib/asyncio/streams.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/subprocess.py (renamed from contrib/tools/python3/src/Lib/asyncio/subprocess.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/taskgroups.py (renamed from contrib/tools/python3/src/Lib/asyncio/taskgroups.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/tasks.py (renamed from contrib/tools/python3/src/Lib/asyncio/tasks.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/threads.py (renamed from contrib/tools/python3/src/Lib/asyncio/threads.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/timeouts.py (renamed from contrib/tools/python3/src/Lib/asyncio/timeouts.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/transports.py (renamed from contrib/tools/python3/src/Lib/asyncio/transports.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/trsock.py (renamed from contrib/tools/python3/src/Lib/asyncio/trsock.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/unix_events.py (renamed from contrib/tools/python3/src/Lib/asyncio/unix_events.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/windows_events.py (renamed from contrib/tools/python3/src/Lib/asyncio/windows_events.py)0
-rw-r--r--contrib/tools/python3/Lib/asyncio/windows_utils.py (renamed from contrib/tools/python3/src/Lib/asyncio/windows_utils.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/base64.py (renamed from contrib/tools/python3/src/Lib/base64.py)0
-rw-r--r--contrib/tools/python3/Lib/bdb.py (renamed from contrib/tools/python3/src/Lib/bdb.py)0
-rw-r--r--contrib/tools/python3/Lib/bisect.py (renamed from contrib/tools/python3/src/Lib/bisect.py)0
-rw-r--r--contrib/tools/python3/Lib/bz2.py (renamed from contrib/tools/python3/src/Lib/bz2.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/cProfile.py (renamed from contrib/tools/python3/src/Lib/cProfile.py)0
-rw-r--r--contrib/tools/python3/Lib/calendar.py (renamed from contrib/tools/python3/src/Lib/calendar.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/cgi.py (renamed from contrib/tools/python3/src/Lib/cgi.py)0
-rw-r--r--contrib/tools/python3/Lib/cgitb.py (renamed from contrib/tools/python3/src/Lib/cgitb.py)0
-rw-r--r--contrib/tools/python3/Lib/chunk.py (renamed from contrib/tools/python3/src/Lib/chunk.py)0
-rw-r--r--contrib/tools/python3/Lib/cmd.py (renamed from contrib/tools/python3/src/Lib/cmd.py)0
-rw-r--r--contrib/tools/python3/Lib/code.py (renamed from contrib/tools/python3/src/Lib/code.py)0
-rw-r--r--contrib/tools/python3/Lib/codecs.py (renamed from contrib/tools/python3/src/Lib/codecs.py)0
-rw-r--r--contrib/tools/python3/Lib/codeop.py (renamed from contrib/tools/python3/src/Lib/codeop.py)0
-rw-r--r--contrib/tools/python3/Lib/collections/__init__.py (renamed from contrib/tools/python3/src/Lib/collections/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/collections/abc.py (renamed from contrib/tools/python3/src/Lib/collections/abc.py)0
-rw-r--r--contrib/tools/python3/Lib/colorsys.py (renamed from contrib/tools/python3/src/Lib/colorsys.py)0
-rw-r--r--contrib/tools/python3/Lib/compileall.py (renamed from contrib/tools/python3/src/Lib/compileall.py)0
-rw-r--r--contrib/tools/python3/Lib/concurrent/__init__.py (renamed from contrib/tools/python3/src/Lib/concurrent/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/concurrent/futures/__init__.py (renamed from contrib/tools/python3/src/Lib/concurrent/futures/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/concurrent/futures/_base.py (renamed from contrib/tools/python3/src/Lib/concurrent/futures/_base.py)0
-rw-r--r--contrib/tools/python3/Lib/concurrent/futures/process.py (renamed from contrib/tools/python3/src/Lib/concurrent/futures/process.py)0
-rw-r--r--contrib/tools/python3/Lib/concurrent/futures/thread.py (renamed from contrib/tools/python3/src/Lib/concurrent/futures/thread.py)0
-rw-r--r--contrib/tools/python3/Lib/configparser.py (renamed from contrib/tools/python3/src/Lib/configparser.py)0
-rw-r--r--contrib/tools/python3/Lib/contextlib.py (renamed from contrib/tools/python3/src/Lib/contextlib.py)0
-rw-r--r--contrib/tools/python3/Lib/contextvars.py (renamed from contrib/tools/python3/src/Lib/contextvars.py)0
-rw-r--r--contrib/tools/python3/Lib/copy.py (renamed from contrib/tools/python3/src/Lib/copy.py)0
-rw-r--r--contrib/tools/python3/Lib/copyreg.py (renamed from contrib/tools/python3/src/Lib/copyreg.py)0
-rw-r--r--contrib/tools/python3/Lib/crypt.py (renamed from contrib/tools/python3/src/Lib/crypt.py)0
-rw-r--r--contrib/tools/python3/Lib/csv.py (renamed from contrib/tools/python3/src/Lib/csv.py)0
-rw-r--r--contrib/tools/python3/Lib/ctypes/__init__.py (renamed from contrib/tools/python3/src/Lib/ctypes/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/ctypes/_aix.py (renamed from contrib/tools/python3/src/Lib/ctypes/_aix.py)0
-rw-r--r--contrib/tools/python3/Lib/ctypes/_endian.py (renamed from contrib/tools/python3/src/Lib/ctypes/_endian.py)0
-rw-r--r--contrib/tools/python3/Lib/ctypes/macholib/__init__.py (renamed from contrib/tools/python3/src/Lib/ctypes/macholib/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/ctypes/macholib/dyld.py (renamed from contrib/tools/python3/src/Lib/ctypes/macholib/dyld.py)0
-rw-r--r--contrib/tools/python3/Lib/ctypes/macholib/dylib.py (renamed from contrib/tools/python3/src/Lib/ctypes/macholib/dylib.py)0
-rw-r--r--contrib/tools/python3/Lib/ctypes/macholib/framework.py (renamed from contrib/tools/python3/src/Lib/ctypes/macholib/framework.py)0
-rw-r--r--contrib/tools/python3/Lib/ctypes/util.py (renamed from contrib/tools/python3/src/Lib/ctypes/util.py)0
-rw-r--r--contrib/tools/python3/Lib/ctypes/wintypes.py (renamed from contrib/tools/python3/src/Lib/ctypes/wintypes.py)0
-rw-r--r--contrib/tools/python3/Lib/curses/__init__.py (renamed from contrib/tools/python3/src/Lib/curses/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/curses/ascii.py (renamed from contrib/tools/python3/src/Lib/curses/ascii.py)0
-rw-r--r--contrib/tools/python3/Lib/curses/has_key.py (renamed from contrib/tools/python3/src/Lib/curses/has_key.py)0
-rw-r--r--contrib/tools/python3/Lib/curses/panel.py (renamed from contrib/tools/python3/src/Lib/curses/panel.py)0
-rw-r--r--contrib/tools/python3/Lib/curses/textpad.py (renamed from contrib/tools/python3/src/Lib/curses/textpad.py)0
-rw-r--r--contrib/tools/python3/Lib/dataclasses.py (renamed from contrib/tools/python3/src/Lib/dataclasses.py)0
-rw-r--r--contrib/tools/python3/Lib/datetime.py (renamed from contrib/tools/python3/src/Lib/datetime.py)0
-rw-r--r--contrib/tools/python3/Lib/dbm/__init__.py (renamed from contrib/tools/python3/src/Lib/dbm/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/dbm/dumb.py (renamed from contrib/tools/python3/src/Lib/dbm/dumb.py)0
-rw-r--r--contrib/tools/python3/Lib/dbm/gnu.py (renamed from contrib/tools/python3/src/Lib/dbm/gnu.py)0
-rw-r--r--contrib/tools/python3/Lib/dbm/ndbm.py (renamed from contrib/tools/python3/src/Lib/dbm/ndbm.py)0
-rw-r--r--contrib/tools/python3/Lib/decimal.py (renamed from contrib/tools/python3/src/Lib/decimal.py)0
-rw-r--r--contrib/tools/python3/Lib/difflib.py (renamed from contrib/tools/python3/src/Lib/difflib.py)0
-rw-r--r--contrib/tools/python3/Lib/dis.py (renamed from contrib/tools/python3/src/Lib/dis.py)0
-rw-r--r--contrib/tools/python3/Lib/doctest.py (renamed from contrib/tools/python3/src/Lib/doctest.py)0
-rw-r--r--contrib/tools/python3/Lib/email/__init__.py (renamed from contrib/tools/python3/src/Lib/email/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/email/_encoded_words.py (renamed from contrib/tools/python3/src/Lib/email/_encoded_words.py)0
-rw-r--r--contrib/tools/python3/Lib/email/_header_value_parser.py (renamed from contrib/tools/python3/src/Lib/email/_header_value_parser.py)0
-rw-r--r--contrib/tools/python3/Lib/email/_parseaddr.py (renamed from contrib/tools/python3/src/Lib/email/_parseaddr.py)0
-rw-r--r--contrib/tools/python3/Lib/email/_policybase.py (renamed from contrib/tools/python3/src/Lib/email/_policybase.py)0
-rw-r--r--contrib/tools/python3/Lib/email/base64mime.py (renamed from contrib/tools/python3/src/Lib/email/base64mime.py)0
-rw-r--r--contrib/tools/python3/Lib/email/charset.py (renamed from contrib/tools/python3/src/Lib/email/charset.py)0
-rw-r--r--contrib/tools/python3/Lib/email/contentmanager.py (renamed from contrib/tools/python3/src/Lib/email/contentmanager.py)0
-rw-r--r--contrib/tools/python3/Lib/email/encoders.py (renamed from contrib/tools/python3/src/Lib/email/encoders.py)0
-rw-r--r--contrib/tools/python3/Lib/email/errors.py (renamed from contrib/tools/python3/src/Lib/email/errors.py)0
-rw-r--r--contrib/tools/python3/Lib/email/feedparser.py (renamed from contrib/tools/python3/src/Lib/email/feedparser.py)0
-rw-r--r--contrib/tools/python3/Lib/email/generator.py (renamed from contrib/tools/python3/src/Lib/email/generator.py)0
-rw-r--r--contrib/tools/python3/Lib/email/header.py (renamed from contrib/tools/python3/src/Lib/email/header.py)0
-rw-r--r--contrib/tools/python3/Lib/email/headerregistry.py (renamed from contrib/tools/python3/src/Lib/email/headerregistry.py)0
-rw-r--r--contrib/tools/python3/Lib/email/iterators.py (renamed from contrib/tools/python3/src/Lib/email/iterators.py)0
-rw-r--r--contrib/tools/python3/Lib/email/message.py (renamed from contrib/tools/python3/src/Lib/email/message.py)0
-rw-r--r--contrib/tools/python3/Lib/email/mime/__init__.py (renamed from contrib/tools/python3/src/Lib/pydoc_data/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/email/mime/application.py (renamed from contrib/tools/python3/src/Lib/email/mime/application.py)0
-rw-r--r--contrib/tools/python3/Lib/email/mime/audio.py (renamed from contrib/tools/python3/src/Lib/email/mime/audio.py)0
-rw-r--r--contrib/tools/python3/Lib/email/mime/base.py (renamed from contrib/tools/python3/src/Lib/email/mime/base.py)0
-rw-r--r--contrib/tools/python3/Lib/email/mime/image.py (renamed from contrib/tools/python3/src/Lib/email/mime/image.py)0
-rw-r--r--contrib/tools/python3/Lib/email/mime/message.py (renamed from contrib/tools/python3/src/Lib/email/mime/message.py)0
-rw-r--r--contrib/tools/python3/Lib/email/mime/multipart.py (renamed from contrib/tools/python3/src/Lib/email/mime/multipart.py)0
-rw-r--r--contrib/tools/python3/Lib/email/mime/nonmultipart.py (renamed from contrib/tools/python3/src/Lib/email/mime/nonmultipart.py)0
-rw-r--r--contrib/tools/python3/Lib/email/mime/text.py (renamed from contrib/tools/python3/src/Lib/email/mime/text.py)0
-rw-r--r--contrib/tools/python3/Lib/email/parser.py (renamed from contrib/tools/python3/src/Lib/email/parser.py)0
-rw-r--r--contrib/tools/python3/Lib/email/policy.py (renamed from contrib/tools/python3/src/Lib/email/policy.py)0
-rw-r--r--contrib/tools/python3/Lib/email/quoprimime.py (renamed from contrib/tools/python3/src/Lib/email/quoprimime.py)0
-rw-r--r--contrib/tools/python3/Lib/email/utils.py (renamed from contrib/tools/python3/src/Lib/email/utils.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/__init__.py (renamed from contrib/tools/python3/src/Lib/encodings/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/aliases.py (renamed from contrib/tools/python3/src/Lib/encodings/aliases.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/ascii.py (renamed from contrib/tools/python3/src/Lib/encodings/ascii.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/base64_codec.py (renamed from contrib/tools/python3/src/Lib/encodings/base64_codec.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/big5.py (renamed from contrib/tools/python3/src/Lib/encodings/big5.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/big5hkscs.py (renamed from contrib/tools/python3/src/Lib/encodings/big5hkscs.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/bz2_codec.py (renamed from contrib/tools/python3/src/Lib/encodings/bz2_codec.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/charmap.py (renamed from contrib/tools/python3/src/Lib/encodings/charmap.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp037.py (renamed from contrib/tools/python3/src/Lib/encodings/cp037.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp1006.py (renamed from contrib/tools/python3/src/Lib/encodings/cp1006.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp1026.py (renamed from contrib/tools/python3/src/Lib/encodings/cp1026.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp1125.py (renamed from contrib/tools/python3/src/Lib/encodings/cp1125.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp1140.py (renamed from contrib/tools/python3/src/Lib/encodings/cp1140.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp1250.py (renamed from contrib/tools/python3/src/Lib/encodings/cp1250.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp1251.py (renamed from contrib/tools/python3/src/Lib/encodings/cp1251.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp1252.py (renamed from contrib/tools/python3/src/Lib/encodings/cp1252.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp1253.py (renamed from contrib/tools/python3/src/Lib/encodings/cp1253.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp1254.py (renamed from contrib/tools/python3/src/Lib/encodings/cp1254.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp1255.py (renamed from contrib/tools/python3/src/Lib/encodings/cp1255.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp1256.py (renamed from contrib/tools/python3/src/Lib/encodings/cp1256.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp1257.py (renamed from contrib/tools/python3/src/Lib/encodings/cp1257.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp1258.py (renamed from contrib/tools/python3/src/Lib/encodings/cp1258.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp273.py (renamed from contrib/tools/python3/src/Lib/encodings/cp273.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp424.py (renamed from contrib/tools/python3/src/Lib/encodings/cp424.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp437.py (renamed from contrib/tools/python3/src/Lib/encodings/cp437.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp500.py (renamed from contrib/tools/python3/src/Lib/encodings/cp500.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp720.py (renamed from contrib/tools/python3/src/Lib/encodings/cp720.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp737.py (renamed from contrib/tools/python3/src/Lib/encodings/cp737.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp775.py (renamed from contrib/tools/python3/src/Lib/encodings/cp775.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp850.py (renamed from contrib/tools/python3/src/Lib/encodings/cp850.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp852.py (renamed from contrib/tools/python3/src/Lib/encodings/cp852.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp855.py (renamed from contrib/tools/python3/src/Lib/encodings/cp855.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp856.py (renamed from contrib/tools/python3/src/Lib/encodings/cp856.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp857.py (renamed from contrib/tools/python3/src/Lib/encodings/cp857.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp858.py (renamed from contrib/tools/python3/src/Lib/encodings/cp858.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp860.py (renamed from contrib/tools/python3/src/Lib/encodings/cp860.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp861.py (renamed from contrib/tools/python3/src/Lib/encodings/cp861.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp862.py (renamed from contrib/tools/python3/src/Lib/encodings/cp862.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp863.py (renamed from contrib/tools/python3/src/Lib/encodings/cp863.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp864.py (renamed from contrib/tools/python3/src/Lib/encodings/cp864.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp865.py (renamed from contrib/tools/python3/src/Lib/encodings/cp865.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp866.py (renamed from contrib/tools/python3/src/Lib/encodings/cp866.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp869.py (renamed from contrib/tools/python3/src/Lib/encodings/cp869.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp874.py (renamed from contrib/tools/python3/src/Lib/encodings/cp874.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp875.py (renamed from contrib/tools/python3/src/Lib/encodings/cp875.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp932.py (renamed from contrib/tools/python3/src/Lib/encodings/cp932.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp949.py (renamed from contrib/tools/python3/src/Lib/encodings/cp949.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/cp950.py (renamed from contrib/tools/python3/src/Lib/encodings/cp950.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/euc_jis_2004.py (renamed from contrib/tools/python3/src/Lib/encodings/euc_jis_2004.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/euc_jisx0213.py (renamed from contrib/tools/python3/src/Lib/encodings/euc_jisx0213.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/euc_jp.py (renamed from contrib/tools/python3/src/Lib/encodings/euc_jp.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/euc_kr.py (renamed from contrib/tools/python3/src/Lib/encodings/euc_kr.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/gb18030.py (renamed from contrib/tools/python3/src/Lib/encodings/gb18030.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/gb2312.py (renamed from contrib/tools/python3/src/Lib/encodings/gb2312.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/gbk.py (renamed from contrib/tools/python3/src/Lib/encodings/gbk.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/hex_codec.py (renamed from contrib/tools/python3/src/Lib/encodings/hex_codec.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/hp_roman8.py (renamed from contrib/tools/python3/src/Lib/encodings/hp_roman8.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/hz.py (renamed from contrib/tools/python3/src/Lib/encodings/hz.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/idna.py (renamed from contrib/tools/python3/src/Lib/encodings/idna.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso2022_jp.py (renamed from contrib/tools/python3/src/Lib/encodings/iso2022_jp.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso2022_jp_1.py (renamed from contrib/tools/python3/src/Lib/encodings/iso2022_jp_1.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso2022_jp_2.py (renamed from contrib/tools/python3/src/Lib/encodings/iso2022_jp_2.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso2022_jp_2004.py (renamed from contrib/tools/python3/src/Lib/encodings/iso2022_jp_2004.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso2022_jp_3.py (renamed from contrib/tools/python3/src/Lib/encodings/iso2022_jp_3.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso2022_jp_ext.py (renamed from contrib/tools/python3/src/Lib/encodings/iso2022_jp_ext.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso2022_kr.py (renamed from contrib/tools/python3/src/Lib/encodings/iso2022_kr.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_1.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_1.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_10.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_10.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_11.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_11.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_13.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_13.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_14.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_14.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_15.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_15.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_16.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_16.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_2.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_2.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_3.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_3.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_4.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_4.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_5.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_5.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_6.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_6.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_7.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_7.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_8.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_8.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/iso8859_9.py (renamed from contrib/tools/python3/src/Lib/encodings/iso8859_9.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/johab.py (renamed from contrib/tools/python3/src/Lib/encodings/johab.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/koi8_r.py (renamed from contrib/tools/python3/src/Lib/encodings/koi8_r.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/koi8_t.py (renamed from contrib/tools/python3/src/Lib/encodings/koi8_t.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/koi8_u.py (renamed from contrib/tools/python3/src/Lib/encodings/koi8_u.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/kz1048.py (renamed from contrib/tools/python3/src/Lib/encodings/kz1048.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/latin_1.py (renamed from contrib/tools/python3/src/Lib/encodings/latin_1.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/mac_arabic.py (renamed from contrib/tools/python3/src/Lib/encodings/mac_arabic.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/mac_croatian.py (renamed from contrib/tools/python3/src/Lib/encodings/mac_croatian.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/mac_cyrillic.py (renamed from contrib/tools/python3/src/Lib/encodings/mac_cyrillic.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/mac_farsi.py (renamed from contrib/tools/python3/src/Lib/encodings/mac_farsi.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/mac_greek.py (renamed from contrib/tools/python3/src/Lib/encodings/mac_greek.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/mac_iceland.py (renamed from contrib/tools/python3/src/Lib/encodings/mac_iceland.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/mac_latin2.py (renamed from contrib/tools/python3/src/Lib/encodings/mac_latin2.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/mac_roman.py (renamed from contrib/tools/python3/src/Lib/encodings/mac_roman.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/mac_romanian.py (renamed from contrib/tools/python3/src/Lib/encodings/mac_romanian.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/mac_turkish.py (renamed from contrib/tools/python3/src/Lib/encodings/mac_turkish.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/mbcs.py (renamed from contrib/tools/python3/src/Lib/encodings/mbcs.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/oem.py (renamed from contrib/tools/python3/src/Lib/encodings/oem.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/palmos.py (renamed from contrib/tools/python3/src/Lib/encodings/palmos.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/ptcp154.py (renamed from contrib/tools/python3/src/Lib/encodings/ptcp154.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/punycode.py (renamed from contrib/tools/python3/src/Lib/encodings/punycode.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/quopri_codec.py (renamed from contrib/tools/python3/src/Lib/encodings/quopri_codec.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/raw_unicode_escape.py (renamed from contrib/tools/python3/src/Lib/encodings/raw_unicode_escape.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/encodings/rot_13.py (renamed from contrib/tools/python3/src/Lib/encodings/rot_13.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/shift_jis.py (renamed from contrib/tools/python3/src/Lib/encodings/shift_jis.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/shift_jis_2004.py (renamed from contrib/tools/python3/src/Lib/encodings/shift_jis_2004.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/shift_jisx0213.py (renamed from contrib/tools/python3/src/Lib/encodings/shift_jisx0213.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/tis_620.py (renamed from contrib/tools/python3/src/Lib/encodings/tis_620.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/undefined.py (renamed from contrib/tools/python3/src/Lib/encodings/undefined.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/unicode_escape.py (renamed from contrib/tools/python3/src/Lib/encodings/unicode_escape.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/utf_16.py (renamed from contrib/tools/python3/src/Lib/encodings/utf_16.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/utf_16_be.py (renamed from contrib/tools/python3/src/Lib/encodings/utf_16_be.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/utf_16_le.py (renamed from contrib/tools/python3/src/Lib/encodings/utf_16_le.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/utf_32.py (renamed from contrib/tools/python3/src/Lib/encodings/utf_32.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/utf_32_be.py (renamed from contrib/tools/python3/src/Lib/encodings/utf_32_be.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/utf_32_le.py (renamed from contrib/tools/python3/src/Lib/encodings/utf_32_le.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/utf_7.py (renamed from contrib/tools/python3/src/Lib/encodings/utf_7.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/utf_8.py (renamed from contrib/tools/python3/src/Lib/encodings/utf_8.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/utf_8_sig.py (renamed from contrib/tools/python3/src/Lib/encodings/utf_8_sig.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/uu_codec.py (renamed from contrib/tools/python3/src/Lib/encodings/uu_codec.py)0
-rw-r--r--contrib/tools/python3/Lib/encodings/zlib_codec.py (renamed from contrib/tools/python3/src/Lib/encodings/zlib_codec.py)0
-rw-r--r--contrib/tools/python3/Lib/ensurepip/__init__.py (renamed from contrib/tools/python3/src/Lib/ensurepip/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/ensurepip/__main__.py (renamed from contrib/tools/python3/src/Lib/ensurepip/__main__.py)0
-rw-r--r--contrib/tools/python3/Lib/ensurepip/_uninstall.py (renamed from contrib/tools/python3/src/Lib/ensurepip/_uninstall.py)0
-rw-r--r--contrib/tools/python3/Lib/enum.py (renamed from contrib/tools/python3/src/Lib/enum.py)0
-rw-r--r--contrib/tools/python3/Lib/filecmp.py (renamed from contrib/tools/python3/src/Lib/filecmp.py)0
-rw-r--r--contrib/tools/python3/Lib/fileinput.py (renamed from contrib/tools/python3/src/Lib/fileinput.py)0
-rw-r--r--contrib/tools/python3/Lib/fnmatch.py (renamed from contrib/tools/python3/src/Lib/fnmatch.py)0
-rw-r--r--contrib/tools/python3/Lib/fractions.py (renamed from contrib/tools/python3/src/Lib/fractions.py)0
-rw-r--r--contrib/tools/python3/Lib/ftplib.py (renamed from contrib/tools/python3/src/Lib/ftplib.py)0
-rw-r--r--contrib/tools/python3/Lib/functools.py (renamed from contrib/tools/python3/src/Lib/functools.py)0
-rw-r--r--contrib/tools/python3/Lib/genericpath.py (renamed from contrib/tools/python3/src/Lib/genericpath.py)0
-rw-r--r--contrib/tools/python3/Lib/getopt.py (renamed from contrib/tools/python3/src/Lib/getopt.py)0
-rw-r--r--contrib/tools/python3/Lib/getpass.py (renamed from contrib/tools/python3/src/Lib/getpass.py)0
-rw-r--r--contrib/tools/python3/Lib/gettext.py (renamed from contrib/tools/python3/src/Lib/gettext.py)0
-rw-r--r--contrib/tools/python3/Lib/glob.py (renamed from contrib/tools/python3/src/Lib/glob.py)0
-rw-r--r--contrib/tools/python3/Lib/graphlib.py (renamed from contrib/tools/python3/src/Lib/graphlib.py)0
-rw-r--r--contrib/tools/python3/Lib/gzip.py (renamed from contrib/tools/python3/src/Lib/gzip.py)0
-rw-r--r--contrib/tools/python3/Lib/hashlib.py (renamed from contrib/tools/python3/src/Lib/hashlib.py)0
-rw-r--r--contrib/tools/python3/Lib/heapq.py (renamed from contrib/tools/python3/src/Lib/heapq.py)0
-rw-r--r--contrib/tools/python3/Lib/hmac.py (renamed from contrib/tools/python3/src/Lib/hmac.py)0
-rw-r--r--contrib/tools/python3/Lib/html/__init__.py (renamed from contrib/tools/python3/src/Lib/html/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/html/entities.py (renamed from contrib/tools/python3/src/Lib/html/entities.py)0
-rw-r--r--contrib/tools/python3/Lib/html/parser.py (renamed from contrib/tools/python3/src/Lib/html/parser.py)0
-rw-r--r--contrib/tools/python3/Lib/http/__init__.py (renamed from contrib/tools/python3/src/Lib/http/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/http/client.py (renamed from contrib/tools/python3/src/Lib/http/client.py)0
-rw-r--r--contrib/tools/python3/Lib/http/cookiejar.py (renamed from contrib/tools/python3/src/Lib/http/cookiejar.py)0
-rw-r--r--contrib/tools/python3/Lib/http/cookies.py (renamed from contrib/tools/python3/src/Lib/http/cookies.py)0
-rw-r--r--contrib/tools/python3/Lib/http/server.py (renamed from contrib/tools/python3/src/Lib/http/server.py)0
-rw-r--r--contrib/tools/python3/Lib/imaplib.py (renamed from contrib/tools/python3/src/Lib/imaplib.py)0
-rw-r--r--contrib/tools/python3/Lib/imghdr.py (renamed from contrib/tools/python3/src/Lib/imghdr.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/__init__.py (renamed from contrib/tools/python3/src/Lib/importlib/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/_abc.py (renamed from contrib/tools/python3/src/Lib/importlib/_abc.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/_bootstrap.py (renamed from contrib/tools/python3/src/Lib/importlib/_bootstrap.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/_bootstrap_external.py (renamed from contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/abc.py (renamed from contrib/tools/python3/src/Lib/importlib/abc.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/machinery.py (renamed from contrib/tools/python3/src/Lib/importlib/machinery.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/metadata/__init__.py (renamed from contrib/tools/python3/src/Lib/importlib/metadata/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/metadata/_adapters.py (renamed from contrib/tools/python3/src/Lib/importlib/metadata/_adapters.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/metadata/_collections.py (renamed from contrib/tools/python3/src/Lib/importlib/metadata/_collections.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/metadata/_functools.py (renamed from contrib/tools/python3/src/Lib/importlib/metadata/_functools.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/metadata/_itertools.py (renamed from contrib/tools/python3/src/Lib/importlib/metadata/_itertools.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/metadata/_meta.py (renamed from contrib/tools/python3/src/Lib/importlib/metadata/_meta.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/metadata/_text.py (renamed from contrib/tools/python3/src/Lib/importlib/metadata/_text.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/readers.py (renamed from contrib/tools/python3/src/Lib/importlib/readers.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/resources/__init__.py (renamed from contrib/tools/python3/src/Lib/importlib/resources/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/resources/_adapters.py (renamed from contrib/tools/python3/src/Lib/importlib/resources/_adapters.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/resources/_common.py (renamed from contrib/tools/python3/src/Lib/importlib/resources/_common.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/resources/_itertools.py (renamed from contrib/tools/python3/src/Lib/importlib/resources/_itertools.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/resources/_legacy.py (renamed from contrib/tools/python3/src/Lib/importlib/resources/_legacy.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/resources/abc.py (renamed from contrib/tools/python3/src/Lib/importlib/resources/abc.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/resources/readers.py (renamed from contrib/tools/python3/src/Lib/importlib/resources/readers.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/resources/simple.py (renamed from contrib/tools/python3/src/Lib/importlib/resources/simple.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/simple.py (renamed from contrib/tools/python3/src/Lib/importlib/simple.py)0
-rw-r--r--contrib/tools/python3/Lib/importlib/util.py (renamed from contrib/tools/python3/src/Lib/importlib/util.py)0
-rw-r--r--contrib/tools/python3/Lib/inspect.py (renamed from contrib/tools/python3/src/Lib/inspect.py)0
-rw-r--r--contrib/tools/python3/Lib/io.py (renamed from contrib/tools/python3/src/Lib/io.py)0
-rw-r--r--contrib/tools/python3/Lib/ipaddress.py (renamed from contrib/tools/python3/src/Lib/ipaddress.py)0
-rw-r--r--contrib/tools/python3/Lib/json/__init__.py (renamed from contrib/tools/python3/src/Lib/json/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/json/decoder.py (renamed from contrib/tools/python3/src/Lib/json/decoder.py)0
-rw-r--r--contrib/tools/python3/Lib/json/encoder.py (renamed from contrib/tools/python3/src/Lib/json/encoder.py)0
-rw-r--r--contrib/tools/python3/Lib/json/scanner.py (renamed from contrib/tools/python3/src/Lib/json/scanner.py)0
-rw-r--r--contrib/tools/python3/Lib/json/tool.py (renamed from contrib/tools/python3/src/Lib/json/tool.py)0
-rw-r--r--contrib/tools/python3/Lib/keyword.py (renamed from contrib/tools/python3/src/Lib/keyword.py)0
-rw-r--r--contrib/tools/python3/Lib/linecache.py (renamed from contrib/tools/python3/src/Lib/linecache.py)0
-rw-r--r--contrib/tools/python3/Lib/locale.py (renamed from contrib/tools/python3/src/Lib/locale.py)0
-rw-r--r--contrib/tools/python3/Lib/logging/__init__.py (renamed from contrib/tools/python3/src/Lib/logging/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/logging/config.py (renamed from contrib/tools/python3/src/Lib/logging/config.py)0
-rw-r--r--contrib/tools/python3/Lib/logging/handlers.py (renamed from contrib/tools/python3/src/Lib/logging/handlers.py)0
-rw-r--r--contrib/tools/python3/Lib/lzma.py (renamed from contrib/tools/python3/src/Lib/lzma.py)0
-rw-r--r--contrib/tools/python3/Lib/mailbox.py (renamed from contrib/tools/python3/src/Lib/mailbox.py)0
-rw-r--r--contrib/tools/python3/Lib/mailcap.py (renamed from contrib/tools/python3/src/Lib/mailcap.py)0
-rw-r--r--contrib/tools/python3/Lib/mimetypes.py (renamed from contrib/tools/python3/src/Lib/mimetypes.py)0
-rw-r--r--contrib/tools/python3/Lib/modulefinder.py (renamed from contrib/tools/python3/src/Lib/modulefinder.py)0
-rw-r--r--contrib/tools/python3/Lib/msilib/__init__.py (renamed from contrib/tools/python3/src/Lib/msilib/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/msilib/schema.py (renamed from contrib/tools/python3/src/Lib/msilib/schema.py)0
-rw-r--r--contrib/tools/python3/Lib/msilib/sequence.py (renamed from contrib/tools/python3/src/Lib/msilib/sequence.py)0
-rw-r--r--contrib/tools/python3/Lib/msilib/text.py (renamed from contrib/tools/python3/src/Lib/msilib/text.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/__init__.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/connection.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/connection.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/context.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/context.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/dummy/__init__.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/dummy/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/dummy/connection.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/dummy/connection.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/forkserver.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/forkserver.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/heap.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/heap.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/managers.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/managers.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/pool.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/pool.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/popen_fork.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/popen_fork.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/popen_forkserver.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/popen_forkserver.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/popen_spawn_posix.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/popen_spawn_posix.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/popen_spawn_win32.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/popen_spawn_win32.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/process.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/process.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/queues.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/queues.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/reduction.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/reduction.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/resource_sharer.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/resource_sharer.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/resource_tracker.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/resource_tracker.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/shared_memory.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/shared_memory.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/sharedctypes.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/sharedctypes.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/spawn.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/spawn.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/synchronize.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/synchronize.py)0
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/util.py (renamed from contrib/tools/python3/src/Lib/multiprocessing/util.py)0
-rw-r--r--contrib/tools/python3/Lib/netrc.py (renamed from contrib/tools/python3/src/Lib/netrc.py)0
-rw-r--r--contrib/tools/python3/Lib/nntplib.py (renamed from contrib/tools/python3/src/Lib/nntplib.py)0
-rw-r--r--contrib/tools/python3/Lib/ntpath.py (renamed from contrib/tools/python3/src/Lib/ntpath.py)0
-rw-r--r--contrib/tools/python3/Lib/nturl2path.py (renamed from contrib/tools/python3/src/Lib/nturl2path.py)0
-rw-r--r--contrib/tools/python3/Lib/numbers.py (renamed from contrib/tools/python3/src/Lib/numbers.py)0
-rw-r--r--contrib/tools/python3/Lib/opcode.py (renamed from contrib/tools/python3/src/Lib/opcode.py)0
-rw-r--r--contrib/tools/python3/Lib/operator.py (renamed from contrib/tools/python3/src/Lib/operator.py)0
-rw-r--r--contrib/tools/python3/Lib/optparse.py (renamed from contrib/tools/python3/src/Lib/optparse.py)0
-rw-r--r--contrib/tools/python3/Lib/os.py (renamed from contrib/tools/python3/src/Lib/os.py)0
-rw-r--r--contrib/tools/python3/Lib/pathlib.py (renamed from contrib/tools/python3/src/Lib/pathlib.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/pdb.py (renamed from contrib/tools/python3/src/Lib/pdb.py)0
-rw-r--r--contrib/tools/python3/Lib/pickle.py (renamed from contrib/tools/python3/src/Lib/pickle.py)0
-rw-r--r--contrib/tools/python3/Lib/pickletools.py (renamed from contrib/tools/python3/src/Lib/pickletools.py)0
-rw-r--r--contrib/tools/python3/Lib/pipes.py (renamed from contrib/tools/python3/src/Lib/pipes.py)0
-rw-r--r--contrib/tools/python3/Lib/pkgutil.py (renamed from contrib/tools/python3/src/Lib/pkgutil.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/platform.py (renamed from contrib/tools/python3/src/Lib/platform.py)0
-rw-r--r--contrib/tools/python3/Lib/plistlib.py (renamed from contrib/tools/python3/src/Lib/plistlib.py)0
-rw-r--r--contrib/tools/python3/Lib/poplib.py (renamed from contrib/tools/python3/src/Lib/poplib.py)0
-rw-r--r--contrib/tools/python3/Lib/posixpath.py (renamed from contrib/tools/python3/src/Lib/posixpath.py)0
-rw-r--r--contrib/tools/python3/Lib/pprint.py (renamed from contrib/tools/python3/src/Lib/pprint.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/profile.py (renamed from contrib/tools/python3/src/Lib/profile.py)0
-rw-r--r--contrib/tools/python3/Lib/pstats.py (renamed from contrib/tools/python3/src/Lib/pstats.py)0
-rw-r--r--contrib/tools/python3/Lib/pty.py (renamed from contrib/tools/python3/src/Lib/pty.py)0
-rw-r--r--contrib/tools/python3/Lib/py_compile.py (renamed from contrib/tools/python3/src/Lib/py_compile.py)0
-rw-r--r--contrib/tools/python3/Lib/pyclbr.py (renamed from contrib/tools/python3/src/Lib/pyclbr.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/pydoc.py (renamed from contrib/tools/python3/src/Lib/pydoc.py)0
-rw-r--r--contrib/tools/python3/Lib/pydoc_data/__init__.py (renamed from contrib/tools/python3/src/Lib/urllib/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/pydoc_data/topics.py (renamed from contrib/tools/python3/src/Lib/pydoc_data/topics.py)0
-rw-r--r--contrib/tools/python3/Lib/queue.py (renamed from contrib/tools/python3/src/Lib/queue.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/quopri.py (renamed from contrib/tools/python3/src/Lib/quopri.py)0
-rw-r--r--contrib/tools/python3/Lib/random.py (renamed from contrib/tools/python3/src/Lib/random.py)0
-rw-r--r--contrib/tools/python3/Lib/re/__init__.py (renamed from contrib/tools/python3/src/Lib/re/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/re/_casefix.py (renamed from contrib/tools/python3/src/Lib/re/_casefix.py)0
-rw-r--r--contrib/tools/python3/Lib/re/_compiler.py (renamed from contrib/tools/python3/src/Lib/re/_compiler.py)0
-rw-r--r--contrib/tools/python3/Lib/re/_constants.py (renamed from contrib/tools/python3/src/Lib/re/_constants.py)0
-rw-r--r--contrib/tools/python3/Lib/re/_parser.py (renamed from contrib/tools/python3/src/Lib/re/_parser.py)0
-rw-r--r--contrib/tools/python3/Lib/reprlib.py (renamed from contrib/tools/python3/src/Lib/reprlib.py)0
-rw-r--r--contrib/tools/python3/Lib/rlcompleter.py (renamed from contrib/tools/python3/src/Lib/rlcompleter.py)0
-rw-r--r--contrib/tools/python3/Lib/runpy.py (renamed from contrib/tools/python3/src/Lib/runpy.py)0
-rw-r--r--contrib/tools/python3/Lib/sched.py (renamed from contrib/tools/python3/src/Lib/sched.py)0
-rw-r--r--contrib/tools/python3/Lib/secrets.py (renamed from contrib/tools/python3/src/Lib/secrets.py)0
-rw-r--r--contrib/tools/python3/Lib/selectors.py (renamed from contrib/tools/python3/src/Lib/selectors.py)0
-rw-r--r--contrib/tools/python3/Lib/shelve.py (renamed from contrib/tools/python3/src/Lib/shelve.py)0
-rw-r--r--contrib/tools/python3/Lib/shlex.py (renamed from contrib/tools/python3/src/Lib/shlex.py)0
-rw-r--r--contrib/tools/python3/Lib/shutil.py (renamed from contrib/tools/python3/src/Lib/shutil.py)0
-rw-r--r--contrib/tools/python3/Lib/signal.py (renamed from contrib/tools/python3/src/Lib/signal.py)0
-rw-r--r--contrib/tools/python3/Lib/site.py (renamed from contrib/tools/python3/src/Lib/site.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/smtplib.py (renamed from contrib/tools/python3/src/Lib/smtplib.py)0
-rw-r--r--contrib/tools/python3/Lib/sndhdr.py (renamed from contrib/tools/python3/src/Lib/sndhdr.py)0
-rw-r--r--contrib/tools/python3/Lib/socket.py (renamed from contrib/tools/python3/src/Lib/socket.py)0
-rw-r--r--contrib/tools/python3/Lib/socketserver.py (renamed from contrib/tools/python3/src/Lib/socketserver.py)0
-rw-r--r--contrib/tools/python3/Lib/sqlite3/__init__.py (renamed from contrib/tools/python3/src/Lib/sqlite3/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/sqlite3/__main__.py (renamed from contrib/tools/python3/src/Lib/sqlite3/__main__.py)0
-rw-r--r--contrib/tools/python3/Lib/sqlite3/dbapi2.py (renamed from contrib/tools/python3/src/Lib/sqlite3/dbapi2.py)0
-rw-r--r--contrib/tools/python3/Lib/sqlite3/dump.py (renamed from contrib/tools/python3/src/Lib/sqlite3/dump.py)0
-rw-r--r--contrib/tools/python3/Lib/sre_compile.py (renamed from contrib/tools/python3/src/Lib/sre_compile.py)0
-rw-r--r--contrib/tools/python3/Lib/sre_constants.py (renamed from contrib/tools/python3/src/Lib/sre_constants.py)0
-rw-r--r--contrib/tools/python3/Lib/sre_parse.py (renamed from contrib/tools/python3/src/Lib/sre_parse.py)0
-rw-r--r--contrib/tools/python3/Lib/ssl.py (renamed from contrib/tools/python3/src/Lib/ssl.py)0
-rw-r--r--contrib/tools/python3/Lib/stat.py (renamed from contrib/tools/python3/src/Lib/stat.py)0
-rw-r--r--contrib/tools/python3/Lib/statistics.py (renamed from contrib/tools/python3/src/Lib/statistics.py)0
-rw-r--r--contrib/tools/python3/Lib/string.py (renamed from contrib/tools/python3/src/Lib/string.py)0
-rw-r--r--contrib/tools/python3/Lib/stringprep.py (renamed from contrib/tools/python3/src/Lib/stringprep.py)0
-rw-r--r--contrib/tools/python3/Lib/struct.py (renamed from contrib/tools/python3/src/Lib/struct.py)0
-rw-r--r--contrib/tools/python3/Lib/subprocess.py (renamed from contrib/tools/python3/src/Lib/subprocess.py)0
-rw-r--r--contrib/tools/python3/Lib/sunau.py (renamed from contrib/tools/python3/src/Lib/sunau.py)0
-rw-r--r--contrib/tools/python3/Lib/symtable.py (renamed from contrib/tools/python3/src/Lib/symtable.py)0
-rw-r--r--contrib/tools/python3/Lib/sysconfig.py (renamed from contrib/tools/python3/src/Lib/sysconfig.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/tabnanny.py (renamed from contrib/tools/python3/src/Lib/tabnanny.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/tarfile.py (renamed from contrib/tools/python3/src/Lib/tarfile.py)0
-rw-r--r--contrib/tools/python3/Lib/telnetlib.py (renamed from contrib/tools/python3/src/Lib/telnetlib.py)0
-rw-r--r--contrib/tools/python3/Lib/tempfile.py (renamed from contrib/tools/python3/src/Lib/tempfile.py)0
-rw-r--r--contrib/tools/python3/Lib/textwrap.py (renamed from contrib/tools/python3/src/Lib/textwrap.py)0
-rw-r--r--contrib/tools/python3/Lib/this.py (renamed from contrib/tools/python3/src/Lib/this.py)0
-rw-r--r--contrib/tools/python3/Lib/threading.py1706
-rwxr-xr-xcontrib/tools/python3/Lib/timeit.py (renamed from contrib/tools/python3/src/Lib/timeit.py)0
-rw-r--r--contrib/tools/python3/Lib/token.py (renamed from contrib/tools/python3/src/Lib/token.py)0
-rw-r--r--contrib/tools/python3/Lib/tokenize.py (renamed from contrib/tools/python3/src/Lib/tokenize.py)0
-rw-r--r--contrib/tools/python3/Lib/tomllib/__init__.py (renamed from contrib/tools/python3/src/Lib/tomllib/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/tomllib/_parser.py (renamed from contrib/tools/python3/src/Lib/tomllib/_parser.py)0
-rw-r--r--contrib/tools/python3/Lib/tomllib/_re.py (renamed from contrib/tools/python3/src/Lib/tomllib/_re.py)0
-rw-r--r--contrib/tools/python3/Lib/tomllib/_types.py (renamed from contrib/tools/python3/src/Lib/tomllib/_types.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/trace.py (renamed from contrib/tools/python3/src/Lib/trace.py)0
-rw-r--r--contrib/tools/python3/Lib/traceback.py (renamed from contrib/tools/python3/src/Lib/traceback.py)0
-rw-r--r--contrib/tools/python3/Lib/tracemalloc.py (renamed from contrib/tools/python3/src/Lib/tracemalloc.py)0
-rw-r--r--contrib/tools/python3/Lib/tty.py (renamed from contrib/tools/python3/src/Lib/tty.py)0
-rw-r--r--contrib/tools/python3/Lib/turtle.py (renamed from contrib/tools/python3/src/Lib/turtle.py)0
-rw-r--r--contrib/tools/python3/Lib/types.py (renamed from contrib/tools/python3/src/Lib/types.py)0
-rw-r--r--contrib/tools/python3/Lib/typing.py (renamed from contrib/tools/python3/src/Lib/typing.py)0
-rw-r--r--contrib/tools/python3/Lib/unittest/__init__.py (renamed from contrib/tools/python3/src/Lib/unittest/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/unittest/__main__.py (renamed from contrib/tools/python3/src/Lib/unittest/__main__.py)0
-rw-r--r--contrib/tools/python3/Lib/unittest/_log.py (renamed from contrib/tools/python3/src/Lib/unittest/_log.py)0
-rw-r--r--contrib/tools/python3/Lib/unittest/async_case.py (renamed from contrib/tools/python3/src/Lib/unittest/async_case.py)0
-rw-r--r--contrib/tools/python3/Lib/unittest/case.py (renamed from contrib/tools/python3/src/Lib/unittest/case.py)0
-rw-r--r--contrib/tools/python3/Lib/unittest/loader.py (renamed from contrib/tools/python3/src/Lib/unittest/loader.py)0
-rw-r--r--contrib/tools/python3/Lib/unittest/main.py (renamed from contrib/tools/python3/src/Lib/unittest/main.py)0
-rw-r--r--contrib/tools/python3/Lib/unittest/mock.py (renamed from contrib/tools/python3/src/Lib/unittest/mock.py)0
-rw-r--r--contrib/tools/python3/Lib/unittest/result.py (renamed from contrib/tools/python3/src/Lib/unittest/result.py)0
-rw-r--r--contrib/tools/python3/Lib/unittest/runner.py (renamed from contrib/tools/python3/src/Lib/unittest/runner.py)0
-rw-r--r--contrib/tools/python3/Lib/unittest/signals.py (renamed from contrib/tools/python3/src/Lib/unittest/signals.py)0
-rw-r--r--contrib/tools/python3/Lib/unittest/suite.py (renamed from contrib/tools/python3/src/Lib/unittest/suite.py)0
-rw-r--r--contrib/tools/python3/Lib/unittest/util.py (renamed from contrib/tools/python3/src/Lib/unittest/util.py)0
-rw-r--r--contrib/tools/python3/Lib/urllib/__init__.py0
-rw-r--r--contrib/tools/python3/Lib/urllib/error.py (renamed from contrib/tools/python3/src/Lib/urllib/error.py)0
-rw-r--r--contrib/tools/python3/Lib/urllib/parse.py (renamed from contrib/tools/python3/src/Lib/urllib/parse.py)0
-rw-r--r--contrib/tools/python3/Lib/urllib/request.py (renamed from contrib/tools/python3/src/Lib/urllib/request.py)0
-rw-r--r--contrib/tools/python3/Lib/urllib/response.py (renamed from contrib/tools/python3/src/Lib/urllib/response.py)0
-rw-r--r--contrib/tools/python3/Lib/urllib/robotparser.py (renamed from contrib/tools/python3/src/Lib/urllib/robotparser.py)0
-rw-r--r--contrib/tools/python3/Lib/uu.py (renamed from contrib/tools/python3/src/Lib/uu.py)0
-rw-r--r--contrib/tools/python3/Lib/uuid.py (renamed from contrib/tools/python3/src/Lib/uuid.py)0
-rw-r--r--contrib/tools/python3/Lib/venv/__init__.py (renamed from contrib/tools/python3/src/Lib/venv/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/venv/__main__.py (renamed from contrib/tools/python3/src/Lib/venv/__main__.py)0
-rw-r--r--contrib/tools/python3/Lib/warnings.py (renamed from contrib/tools/python3/src/Lib/warnings.py)0
-rw-r--r--contrib/tools/python3/Lib/wave.py (renamed from contrib/tools/python3/src/Lib/wave.py)0
-rw-r--r--contrib/tools/python3/Lib/weakref.py (renamed from contrib/tools/python3/src/Lib/weakref.py)0
-rwxr-xr-xcontrib/tools/python3/Lib/webbrowser.py (renamed from contrib/tools/python3/src/Lib/webbrowser.py)0
-rw-r--r--contrib/tools/python3/Lib/wsgiref/__init__.py (renamed from contrib/tools/python3/src/Lib/wsgiref/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/wsgiref/handlers.py (renamed from contrib/tools/python3/src/Lib/wsgiref/handlers.py)0
-rw-r--r--contrib/tools/python3/Lib/wsgiref/headers.py (renamed from contrib/tools/python3/src/Lib/wsgiref/headers.py)0
-rw-r--r--contrib/tools/python3/Lib/wsgiref/simple_server.py (renamed from contrib/tools/python3/src/Lib/wsgiref/simple_server.py)0
-rw-r--r--contrib/tools/python3/Lib/wsgiref/types.py (renamed from contrib/tools/python3/src/Lib/wsgiref/types.py)0
-rw-r--r--contrib/tools/python3/Lib/wsgiref/util.py (renamed from contrib/tools/python3/src/Lib/wsgiref/util.py)0
-rw-r--r--contrib/tools/python3/Lib/wsgiref/validate.py (renamed from contrib/tools/python3/src/Lib/wsgiref/validate.py)0
-rw-r--r--contrib/tools/python3/Lib/xdrlib.py (renamed from contrib/tools/python3/src/Lib/xdrlib.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/__init__.py (renamed from contrib/tools/python3/src/Lib/xml/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/dom/NodeFilter.py (renamed from contrib/tools/python3/src/Lib/xml/dom/NodeFilter.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/dom/__init__.py (renamed from contrib/tools/python3/src/Lib/xml/dom/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/dom/domreg.py (renamed from contrib/tools/python3/src/Lib/xml/dom/domreg.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/dom/expatbuilder.py (renamed from contrib/tools/python3/src/Lib/xml/dom/expatbuilder.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/dom/minicompat.py (renamed from contrib/tools/python3/src/Lib/xml/dom/minicompat.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/dom/minidom.py (renamed from contrib/tools/python3/src/Lib/xml/dom/minidom.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/dom/pulldom.py (renamed from contrib/tools/python3/src/Lib/xml/dom/pulldom.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/dom/xmlbuilder.py (renamed from contrib/tools/python3/src/Lib/xml/dom/xmlbuilder.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/etree/ElementInclude.py (renamed from contrib/tools/python3/src/Lib/xml/etree/ElementInclude.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/etree/ElementPath.py (renamed from contrib/tools/python3/src/Lib/xml/etree/ElementPath.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/etree/ElementTree.py (renamed from contrib/tools/python3/src/Lib/xml/etree/ElementTree.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/etree/__init__.py (renamed from contrib/tools/python3/src/Lib/xml/etree/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/etree/cElementTree.py (renamed from contrib/tools/python3/src/Lib/xml/etree/cElementTree.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/parsers/__init__.py (renamed from contrib/tools/python3/src/Lib/xml/parsers/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/parsers/expat.py (renamed from contrib/tools/python3/src/Lib/xml/parsers/expat.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/sax/__init__.py (renamed from contrib/tools/python3/src/Lib/xml/sax/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/sax/_exceptions.py (renamed from contrib/tools/python3/src/Lib/xml/sax/_exceptions.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/sax/expatreader.py (renamed from contrib/tools/python3/src/Lib/xml/sax/expatreader.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/sax/handler.py (renamed from contrib/tools/python3/src/Lib/xml/sax/handler.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/sax/saxutils.py (renamed from contrib/tools/python3/src/Lib/xml/sax/saxutils.py)0
-rw-r--r--contrib/tools/python3/Lib/xml/sax/xmlreader.py (renamed from contrib/tools/python3/src/Lib/xml/sax/xmlreader.py)0
-rw-r--r--contrib/tools/python3/Lib/xmlrpc/__init__.py (renamed from contrib/tools/python3/src/Lib/xmlrpc/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/xmlrpc/client.py (renamed from contrib/tools/python3/src/Lib/xmlrpc/client.py)0
-rw-r--r--contrib/tools/python3/Lib/xmlrpc/server.py (renamed from contrib/tools/python3/src/Lib/xmlrpc/server.py)0
-rw-r--r--contrib/tools/python3/Lib/ya.make545
-rw-r--r--contrib/tools/python3/Lib/zipapp.py (renamed from contrib/tools/python3/src/Lib/zipapp.py)0
-rw-r--r--contrib/tools/python3/Lib/zipfile/__init__.py (renamed from contrib/tools/python3/src/Lib/zipfile/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/zipfile/__main__.py (renamed from contrib/tools/python3/src/Lib/zipfile/__main__.py)0
-rw-r--r--contrib/tools/python3/Lib/zipfile/_path/__init__.py (renamed from contrib/tools/python3/src/Lib/zipfile/_path/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/zipfile/_path/glob.py (renamed from contrib/tools/python3/src/Lib/zipfile/_path/glob.py)0
-rw-r--r--contrib/tools/python3/Lib/zipimport.py (renamed from contrib/tools/python3/src/Lib/zipimport.py)0
-rw-r--r--contrib/tools/python3/Lib/zoneinfo/__init__.py (renamed from contrib/tools/python3/src/Lib/zoneinfo/__init__.py)0
-rw-r--r--contrib/tools/python3/Lib/zoneinfo/_common.py (renamed from contrib/tools/python3/src/Lib/zoneinfo/_common.py)0
-rw-r--r--contrib/tools/python3/Lib/zoneinfo/_tzpath.py (renamed from contrib/tools/python3/src/Lib/zoneinfo/_tzpath.py)0
-rw-r--r--contrib/tools/python3/Lib/zoneinfo/_zoneinfo.py (renamed from contrib/tools/python3/src/Lib/zoneinfo/_zoneinfo.py)0
-rw-r--r--contrib/tools/python3/Modules/README2
-rw-r--r--contrib/tools/python3/Modules/_abc.c (renamed from contrib/tools/python3/src/Modules/_abc.c)0
-rw-r--r--contrib/tools/python3/Modules/_asynciomodule.c (renamed from contrib/tools/python3/src/Modules/_asynciomodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_bisectmodule.c (renamed from contrib/tools/python3/src/Modules/_bisectmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/blake2b_impl.c (renamed from contrib/tools/python3/src/Modules/_blake2/blake2b_impl.c)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/blake2module.c (renamed from contrib/tools/python3/src/Modules/_blake2/blake2module.c)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/blake2module.h (renamed from contrib/tools/python3/src/Modules/_blake2/blake2module.h)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/blake2s_impl.c (renamed from contrib/tools/python3/src/Modules/_blake2/blake2s_impl.c)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/clinic/blake2b_impl.c.h (renamed from contrib/tools/python3/src/Modules/_blake2/clinic/blake2b_impl.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/clinic/blake2s_impl.c.h (renamed from contrib/tools/python3/src/Modules/_blake2/clinic/blake2s_impl.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2-config.h (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2-config.h)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2-impl.h (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2-impl.h)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2.h (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2.h)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse2.h (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2b-load-sse2.h)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse41.h (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2b-load-sse41.h)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2b-ref.c (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2b-ref.c)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2b-round.h (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2b-round.h)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2b.c (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2b.c)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse2.h (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2s-load-sse2.h)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse41.h (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2s-load-sse41.h)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2s-load-xop.h (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2s-load-xop.h)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2s-ref.c (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2s-ref.c)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2s-round.h (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2s-round.h)0
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2s.c (renamed from contrib/tools/python3/src/Modules/_blake2/impl/blake2s.c)0
-rw-r--r--contrib/tools/python3/Modules/_bz2module.c (renamed from contrib/tools/python3/src/Modules/_bz2module.c)0
-rw-r--r--contrib/tools/python3/Modules/_codecsmodule.c (renamed from contrib/tools/python3/src/Modules/_codecsmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_collectionsmodule.c (renamed from contrib/tools/python3/src/Modules/_collectionsmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_contextvarsmodule.c (renamed from contrib/tools/python3/src/Modules/_contextvarsmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_cryptmodule.c (renamed from contrib/tools/python3/src/Modules/_cryptmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_csv.c (renamed from contrib/tools/python3/src/Modules/_csv.c)0
-rw-r--r--contrib/tools/python3/Modules/_ctypes/_ctypes.c5835
-rw-r--r--contrib/tools/python3/Modules/_ctypes/callbacks.c612
-rw-r--r--contrib/tools/python3/Modules/_ctypes/callproc.c2038
-rw-r--r--contrib/tools/python3/Modules/_ctypes/cfield.c1585
-rw-r--r--contrib/tools/python3/Modules/_ctypes/ctypes.h414
-rw-r--r--contrib/tools/python3/Modules/_ctypes/stgdict.c963
-rw-r--r--contrib/tools/python3/Modules/_datetimemodule.c (renamed from contrib/tools/python3/src/Modules/_datetimemodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/_decimal.c (renamed from contrib/tools/python3/src/Modules/_decimal/_decimal.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/docstrings.h (renamed from contrib/tools/python3/src/Modules/_decimal/docstrings.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/basearith.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/basearith.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/basearith.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/basearith.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/bits.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/bits.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/constants.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/constants.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/constants.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/constants.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/context.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/context.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/convolute.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/convolute.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/convolute.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/convolute.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/crt.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/crt.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/crt.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/crt.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/difradix2.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/difradix2.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/fnt.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/fnt.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/fnt.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/fnt.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/fourstep.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/fourstep.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/io.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/io.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/mpalloc.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/mpalloc.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/mpd_io.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/mpd_io.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/mpdecimal.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/mpdecimal.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/mpsignal.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/mpsignal.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/numbertheory.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/numbertheory.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/sixstep.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/sixstep.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/transpose.c (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/transpose.c)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/transpose.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/transpose.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/typearith.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/typearith.h)0
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/umodarith.h (renamed from contrib/tools/python3/src/Modules/_decimal/libmpdec/umodarith.h)0
-rw-r--r--contrib/tools/python3/Modules/_elementtree.c (renamed from contrib/tools/python3/src/Modules/_elementtree.c)0
-rw-r--r--contrib/tools/python3/Modules/_functoolsmodule.c (renamed from contrib/tools/python3/src/Modules/_functoolsmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.c (renamed from contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_MD5.c)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.h (renamed from contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_MD5.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.c (renamed from contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA1.c)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.h (renamed from contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA1.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.c (renamed from contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA2.c)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.h (renamed from contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA2.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.c (renamed from contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA3.c)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.h (renamed from contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA3.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Streaming_Types.h (renamed from contrib/tools/python3/src/Modules/_hacl/Hacl_Streaming_Types.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt128_Verified.h (renamed from contrib/tools/python3/src/Modules/_hacl/include/krml/FStar_UInt128_Verified.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt_8_16_32_64.h (renamed from contrib/tools/python3/src/Modules/_hacl/include/krml/FStar_UInt_8_16_32_64.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/include/krml/fstar_uint128_struct_endianness.h (renamed from contrib/tools/python3/src/Modules/_hacl/include/krml/fstar_uint128_struct_endianness.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/include/krml/internal/target.h (renamed from contrib/tools/python3/src/Modules/_hacl/include/krml/internal/target.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/include/krml/lowstar_endianness.h231
-rw-r--r--contrib/tools/python3/Modules/_hacl/include/krml/types.h (renamed from contrib/tools/python3/src/Modules/_hacl/include/krml/types.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_MD5.h (renamed from contrib/tools/python3/src/Modules/_hacl/internal/Hacl_Hash_MD5.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA1.h (renamed from contrib/tools/python3/src/Modules/_hacl/internal/Hacl_Hash_SHA1.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA2.h (renamed from contrib/tools/python3/src/Modules/_hacl/internal/Hacl_Hash_SHA2.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA3.h (renamed from contrib/tools/python3/src/Modules/_hacl/internal/Hacl_Hash_SHA3.h)0
-rw-r--r--contrib/tools/python3/Modules/_hacl/python_hacl_namespaces.h (renamed from contrib/tools/python3/src/Modules/_hacl/python_hacl_namespaces.h)0
-rw-r--r--contrib/tools/python3/Modules/_hashopenssl.c (renamed from contrib/tools/python3/src/Modules/_hashopenssl.c)0
-rw-r--r--contrib/tools/python3/Modules/_heapqmodule.c (renamed from contrib/tools/python3/src/Modules/_heapqmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_io/_iomodule.c (renamed from contrib/tools/python3/src/Modules/_io/_iomodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_io/_iomodule.h (renamed from contrib/tools/python3/src/Modules/_io/_iomodule.h)0
-rw-r--r--contrib/tools/python3/Modules/_io/bufferedio.c (renamed from contrib/tools/python3/src/Modules/_io/bufferedio.c)0
-rw-r--r--contrib/tools/python3/Modules/_io/bytesio.c (renamed from contrib/tools/python3/src/Modules/_io/bytesio.c)0
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/_iomodule.c.h (renamed from contrib/tools/python3/src/Modules/_io/clinic/_iomodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/bufferedio.c.h (renamed from contrib/tools/python3/src/Modules/_io/clinic/bufferedio.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/bytesio.c.h (renamed from contrib/tools/python3/src/Modules/_io/clinic/bytesio.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/fileio.c.h (renamed from contrib/tools/python3/src/Modules/_io/clinic/fileio.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/iobase.c.h (renamed from contrib/tools/python3/src/Modules/_io/clinic/iobase.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/stringio.c.h (renamed from contrib/tools/python3/src/Modules/_io/clinic/stringio.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/textio.c.h (renamed from contrib/tools/python3/src/Modules/_io/clinic/textio.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/winconsoleio.c.h (renamed from contrib/tools/python3/src/Modules/_io/clinic/winconsoleio.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_io/fileio.c (renamed from contrib/tools/python3/src/Modules/_io/fileio.c)0
-rw-r--r--contrib/tools/python3/Modules/_io/iobase.c (renamed from contrib/tools/python3/src/Modules/_io/iobase.c)0
-rw-r--r--contrib/tools/python3/Modules/_io/stringio.c (renamed from contrib/tools/python3/src/Modules/_io/stringio.c)0
-rw-r--r--contrib/tools/python3/Modules/_io/textio.c (renamed from contrib/tools/python3/src/Modules/_io/textio.c)0
-rw-r--r--contrib/tools/python3/Modules/_io/winconsoleio.c (renamed from contrib/tools/python3/src/Modules/_io/winconsoleio.c)0
-rw-r--r--contrib/tools/python3/Modules/_json.c (renamed from contrib/tools/python3/src/Modules/_json.c)0
-rw-r--r--contrib/tools/python3/Modules/_localemodule.c (renamed from contrib/tools/python3/src/Modules/_localemodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_lsprof.c (renamed from contrib/tools/python3/src/Modules/_lsprof.c)0
-rw-r--r--contrib/tools/python3/Modules/_lzmamodule.c (renamed from contrib/tools/python3/src/Modules/_lzmamodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_math.h (renamed from contrib/tools/python3/src/Modules/_math.h)0
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/clinic/multiprocessing.c.h (renamed from contrib/tools/python3/src/Modules/_multiprocessing/clinic/multiprocessing.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/clinic/posixshmem.c.h (renamed from contrib/tools/python3/src/Modules/_multiprocessing/clinic/posixshmem.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/clinic/semaphore.c.h (renamed from contrib/tools/python3/src/Modules/_multiprocessing/clinic/semaphore.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/multiprocessing.c (renamed from contrib/tools/python3/src/Modules/_multiprocessing/multiprocessing.c)0
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/multiprocessing.h (renamed from contrib/tools/python3/src/Modules/_multiprocessing/multiprocessing.h)0
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/posixshmem.c (renamed from contrib/tools/python3/src/Modules/_multiprocessing/posixshmem.c)0
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/semaphore.c (renamed from contrib/tools/python3/src/Modules/_multiprocessing/semaphore.c)0
-rw-r--r--contrib/tools/python3/Modules/_opcode.c (renamed from contrib/tools/python3/src/Modules/_opcode.c)0
-rw-r--r--contrib/tools/python3/Modules/_operator.c (renamed from contrib/tools/python3/src/Modules/_operator.c)0
-rw-r--r--contrib/tools/python3/Modules/_pickle.c7986
-rw-r--r--contrib/tools/python3/Modules/_posixsubprocess.c (renamed from contrib/tools/python3/src/Modules/_posixsubprocess.c)0
-rw-r--r--contrib/tools/python3/Modules/_queuemodule.c (renamed from contrib/tools/python3/src/Modules/_queuemodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_randommodule.c (renamed from contrib/tools/python3/src/Modules/_randommodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_scproxy.c (renamed from contrib/tools/python3/src/Modules/_scproxy.c)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/blob.c (renamed from contrib/tools/python3/src/Modules/_sqlite/blob.c)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/blob.h (renamed from contrib/tools/python3/src/Modules/_sqlite/blob.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/clinic/blob.c.h (renamed from contrib/tools/python3/src/Modules/_sqlite/clinic/blob.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/clinic/connection.c.h (renamed from contrib/tools/python3/src/Modules/_sqlite/clinic/connection.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/clinic/cursor.c.h (renamed from contrib/tools/python3/src/Modules/_sqlite/clinic/cursor.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/clinic/module.c.h (renamed from contrib/tools/python3/src/Modules/_sqlite/clinic/module.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/clinic/row.c.h (renamed from contrib/tools/python3/src/Modules/_sqlite/clinic/row.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/connection.c (renamed from contrib/tools/python3/src/Modules/_sqlite/connection.c)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/connection.h (renamed from contrib/tools/python3/src/Modules/_sqlite/connection.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/cursor.c (renamed from contrib/tools/python3/src/Modules/_sqlite/cursor.c)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/cursor.h (renamed from contrib/tools/python3/src/Modules/_sqlite/cursor.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/microprotocols.c (renamed from contrib/tools/python3/src/Modules/_sqlite/microprotocols.c)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/microprotocols.h (renamed from contrib/tools/python3/src/Modules/_sqlite/microprotocols.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/module.c (renamed from contrib/tools/python3/src/Modules/_sqlite/module.c)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/module.h (renamed from contrib/tools/python3/src/Modules/_sqlite/module.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/prepare_protocol.c (renamed from contrib/tools/python3/src/Modules/_sqlite/prepare_protocol.c)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/prepare_protocol.h (renamed from contrib/tools/python3/src/Modules/_sqlite/prepare_protocol.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/row.c (renamed from contrib/tools/python3/src/Modules/_sqlite/row.c)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/row.h (renamed from contrib/tools/python3/src/Modules/_sqlite/row.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/statement.c (renamed from contrib/tools/python3/src/Modules/_sqlite/statement.c)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/statement.h (renamed from contrib/tools/python3/src/Modules/_sqlite/statement.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/util.c (renamed from contrib/tools/python3/src/Modules/_sqlite/util.c)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/util.h (renamed from contrib/tools/python3/src/Modules/_sqlite/util.h)0
-rw-r--r--contrib/tools/python3/Modules/_sqlite/ya.make47
-rw-r--r--contrib/tools/python3/Modules/_sre/clinic/sre.c.h (renamed from contrib/tools/python3/src/Modules/_sre/clinic/sre.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_sre/sre.c (renamed from contrib/tools/python3/src/Modules/_sre/sre.c)0
-rw-r--r--contrib/tools/python3/Modules/_sre/sre.h (renamed from contrib/tools/python3/src/Modules/_sre/sre.h)0
-rw-r--r--contrib/tools/python3/Modules/_sre/sre_constants.h (renamed from contrib/tools/python3/src/Modules/_sre/sre_constants.h)0
-rw-r--r--contrib/tools/python3/Modules/_sre/sre_lib.h (renamed from contrib/tools/python3/src/Modules/_sre/sre_lib.h)0
-rw-r--r--contrib/tools/python3/Modules/_sre/sre_targets.h (renamed from contrib/tools/python3/src/Modules/_sre/sre_targets.h)0
-rw-r--r--contrib/tools/python3/Modules/_ssl.c (renamed from contrib/tools/python3/src/Modules/_ssl.c)0
-rw-r--r--contrib/tools/python3/Modules/_ssl.h (renamed from contrib/tools/python3/src/Modules/_ssl.h)0
-rw-r--r--contrib/tools/python3/Modules/_ssl/cert.c (renamed from contrib/tools/python3/src/Modules/_ssl/cert.c)0
-rw-r--r--contrib/tools/python3/Modules/_ssl/clinic/cert.c.h (renamed from contrib/tools/python3/src/Modules/_ssl/clinic/cert.c.h)0
-rw-r--r--contrib/tools/python3/Modules/_ssl/debughelpers.c (renamed from contrib/tools/python3/src/Modules/_ssl/debughelpers.c)0
-rw-r--r--contrib/tools/python3/Modules/_ssl/misc.c (renamed from contrib/tools/python3/src/Modules/_ssl/misc.c)0
-rw-r--r--contrib/tools/python3/Modules/_ssl_data.h (renamed from contrib/tools/python3/src/Modules/_ssl_data.h)0
-rw-r--r--contrib/tools/python3/Modules/_ssl_data_111.h (renamed from contrib/tools/python3/src/Modules/_ssl_data_111.h)0
-rw-r--r--contrib/tools/python3/Modules/_ssl_data_300.h (renamed from contrib/tools/python3/src/Modules/_ssl_data_300.h)0
-rw-r--r--contrib/tools/python3/Modules/_ssl_data_31.h (renamed from contrib/tools/python3/src/Modules/_ssl_data_31.h)0
-rw-r--r--contrib/tools/python3/Modules/_stat.c (renamed from contrib/tools/python3/src/Modules/_stat.c)0
-rw-r--r--contrib/tools/python3/Modules/_statisticsmodule.c (renamed from contrib/tools/python3/src/Modules/_statisticsmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_struct.c (renamed from contrib/tools/python3/src/Modules/_struct.c)0
-rw-r--r--contrib/tools/python3/Modules/_threadmodule.c (renamed from contrib/tools/python3/src/Modules/_threadmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_tracemalloc.c (renamed from contrib/tools/python3/src/Modules/_tracemalloc.c)0
-rw-r--r--contrib/tools/python3/Modules/_typingmodule.c (renamed from contrib/tools/python3/src/Modules/_typingmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_weakref.c (renamed from contrib/tools/python3/src/Modules/_weakref.c)0
-rw-r--r--contrib/tools/python3/Modules/_winapi.c (renamed from contrib/tools/python3/src/Modules/_winapi.c)0
-rw-r--r--contrib/tools/python3/Modules/_xxinterpchannelsmodule.c (renamed from contrib/tools/python3/src/Modules/_xxinterpchannelsmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_xxsubinterpretersmodule.c (renamed from contrib/tools/python3/src/Modules/_xxsubinterpretersmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/_xxtestfuzz/_xxtestfuzz.c (renamed from contrib/tools/python3/src/Modules/_xxtestfuzz/_xxtestfuzz.c)0
-rw-r--r--contrib/tools/python3/Modules/_xxtestfuzz/fuzzer.c (renamed from contrib/tools/python3/src/Modules/_xxtestfuzz/fuzzer.c)0
-rw-r--r--contrib/tools/python3/Modules/_zoneinfo.c (renamed from contrib/tools/python3/src/Modules/_zoneinfo.c)0
-rw-r--r--contrib/tools/python3/Modules/addrinfo.h (renamed from contrib/tools/python3/src/Modules/addrinfo.h)0
-rw-r--r--contrib/tools/python3/Modules/arraymodule.c (renamed from contrib/tools/python3/src/Modules/arraymodule.c)0
-rw-r--r--contrib/tools/python3/Modules/atexitmodule.c (renamed from contrib/tools/python3/src/Modules/atexitmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/audioop.c (renamed from contrib/tools/python3/src/Modules/audioop.c)0
-rw-r--r--contrib/tools/python3/Modules/binascii.c (renamed from contrib/tools/python3/src/Modules/binascii.c)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/_codecs_cn.c (renamed from contrib/tools/python3/src/Modules/cjkcodecs/_codecs_cn.c)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/_codecs_hk.c (renamed from contrib/tools/python3/src/Modules/cjkcodecs/_codecs_hk.c)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/_codecs_iso2022.c (renamed from contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/_codecs_jp.c (renamed from contrib/tools/python3/src/Modules/cjkcodecs/_codecs_jp.c)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/_codecs_kr.c (renamed from contrib/tools/python3/src/Modules/cjkcodecs/_codecs_kr.c)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/_codecs_tw.c (renamed from contrib/tools/python3/src/Modules/cjkcodecs/_codecs_tw.c)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/alg_jisx0201.h (renamed from contrib/tools/python3/src/Modules/cjkcodecs/alg_jisx0201.h)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/cjkcodecs.h (renamed from contrib/tools/python3/src/Modules/cjkcodecs/cjkcodecs.h)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/clinic/multibytecodec.c.h (renamed from contrib/tools/python3/src/Modules/cjkcodecs/clinic/multibytecodec.c.h)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/emu_jisx0213_2000.h (renamed from contrib/tools/python3/src/Modules/cjkcodecs/emu_jisx0213_2000.h)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/mappings_cn.h (renamed from contrib/tools/python3/src/Modules/cjkcodecs/mappings_cn.h)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/mappings_hk.h (renamed from contrib/tools/python3/src/Modules/cjkcodecs/mappings_hk.h)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/mappings_jisx0213_pair.h (renamed from contrib/tools/python3/src/Modules/cjkcodecs/mappings_jisx0213_pair.h)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/mappings_jp.h (renamed from contrib/tools/python3/src/Modules/cjkcodecs/mappings_jp.h)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/mappings_kr.h (renamed from contrib/tools/python3/src/Modules/cjkcodecs/mappings_kr.h)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/mappings_tw.h (renamed from contrib/tools/python3/src/Modules/cjkcodecs/mappings_tw.h)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/multibytecodec.c (renamed from contrib/tools/python3/src/Modules/cjkcodecs/multibytecodec.c)0
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/multibytecodec.h (renamed from contrib/tools/python3/src/Modules/cjkcodecs/multibytecodec.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_abc.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_abc.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_asynciomodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_asynciomodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_bisectmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_bisectmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_bz2module.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_bz2module.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_codecsmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_codecsmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_collectionsmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_collectionsmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_contextvarsmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_contextvarsmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_cryptmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_cryptmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_csv.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_csv.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_datetimemodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_datetimemodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_elementtree.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_elementtree.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_functoolsmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_functoolsmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_hashopenssl.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_hashopenssl.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_heapqmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_heapqmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_localemodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_localemodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_lsprof.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_lsprof.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_lzmamodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_lzmamodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_opcode.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_opcode.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_operator.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_operator.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_pickle.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_pickle.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_posixsubprocess.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_posixsubprocess.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_queuemodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_queuemodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_randommodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_randommodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_ssl.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_ssl.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_statisticsmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_statisticsmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_struct.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_struct.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_tracemalloc.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_tracemalloc.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_typingmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_typingmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_weakref.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_weakref.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_winapi.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_winapi.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/_zoneinfo.c.h (renamed from contrib/tools/python3/src/Modules/clinic/_zoneinfo.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/arraymodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/arraymodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/audioop.c.h (renamed from contrib/tools/python3/src/Modules/clinic/audioop.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/binascii.c.h (renamed from contrib/tools/python3/src/Modules/clinic/binascii.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/cmathmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/cmathmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/fcntlmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/fcntlmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/gcmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/gcmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/grpmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/grpmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/itertoolsmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/itertoolsmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/mathmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/mathmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/md5module.c.h (renamed from contrib/tools/python3/src/Modules/clinic/md5module.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/overlapped.c.h (renamed from contrib/tools/python3/src/Modules/clinic/overlapped.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/posixmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/posixmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/pwdmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/pwdmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/pyexpat.c.h (renamed from contrib/tools/python3/src/Modules/clinic/pyexpat.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/resource.c.h (renamed from contrib/tools/python3/src/Modules/clinic/resource.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/selectmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/selectmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/sha1module.c.h (renamed from contrib/tools/python3/src/Modules/clinic/sha1module.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/sha2module.c.h (renamed from contrib/tools/python3/src/Modules/clinic/sha2module.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/sha3module.c.h (renamed from contrib/tools/python3/src/Modules/clinic/sha3module.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/signalmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/signalmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/socketmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/socketmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/spwdmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/spwdmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/symtablemodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/symtablemodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/syslogmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/syslogmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/termios.c.h (renamed from contrib/tools/python3/src/Modules/clinic/termios.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/unicodedata.c.h (renamed from contrib/tools/python3/src/Modules/clinic/unicodedata.c.h)0
-rw-r--r--contrib/tools/python3/Modules/clinic/zlibmodule.c.h (renamed from contrib/tools/python3/src/Modules/clinic/zlibmodule.c.h)0
-rw-r--r--contrib/tools/python3/Modules/cmathmodule.c (renamed from contrib/tools/python3/src/Modules/cmathmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/config.c (renamed from contrib/tools/python3/src/Modules/config.c)0
-rw-r--r--contrib/tools/python3/Modules/errnomodule.c (renamed from contrib/tools/python3/src/Modules/errnomodule.c)0
-rw-r--r--contrib/tools/python3/Modules/faulthandler.c (renamed from contrib/tools/python3/src/Modules/faulthandler.c)0
-rw-r--r--contrib/tools/python3/Modules/fcntlmodule.c (renamed from contrib/tools/python3/src/Modules/fcntlmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/gcmodule.c (renamed from contrib/tools/python3/src/Modules/gcmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/getaddrinfo.c (renamed from contrib/tools/python3/src/Modules/getaddrinfo.c)0
-rw-r--r--contrib/tools/python3/Modules/getbuildinfo.c (renamed from contrib/tools/python3/src/Modules/getbuildinfo.c)0
-rw-r--r--contrib/tools/python3/Modules/getnameinfo.c (renamed from contrib/tools/python3/src/Modules/getnameinfo.c)0
-rw-r--r--contrib/tools/python3/Modules/getpath.c (renamed from contrib/tools/python3/src/Modules/getpath.c)0
-rw-r--r--contrib/tools/python3/Modules/grpmodule.c (renamed from contrib/tools/python3/src/Modules/grpmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/hashlib.h (renamed from contrib/tools/python3/src/Modules/hashlib.h)0
-rw-r--r--contrib/tools/python3/Modules/itertoolsmodule.c (renamed from contrib/tools/python3/src/Modules/itertoolsmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/main.c (renamed from contrib/tools/python3/src/Modules/main.c)0
-rw-r--r--contrib/tools/python3/Modules/mathmodule.c (renamed from contrib/tools/python3/src/Modules/mathmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/md5module.c (renamed from contrib/tools/python3/src/Modules/md5module.c)0
-rw-r--r--contrib/tools/python3/Modules/mmapmodule.c (renamed from contrib/tools/python3/src/Modules/mmapmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/overlapped.c (renamed from contrib/tools/python3/src/Modules/overlapped.c)0
-rw-r--r--contrib/tools/python3/Modules/posixmodule.c (renamed from contrib/tools/python3/src/Modules/posixmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/posixmodule.h (renamed from contrib/tools/python3/src/Modules/posixmodule.h)0
-rw-r--r--contrib/tools/python3/Modules/pwdmodule.c (renamed from contrib/tools/python3/src/Modules/pwdmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/pyexpat.c (renamed from contrib/tools/python3/src/Modules/pyexpat.c)0
-rw-r--r--contrib/tools/python3/Modules/resource.c (renamed from contrib/tools/python3/src/Modules/resource.c)0
-rw-r--r--contrib/tools/python3/Modules/rotatingtree.c (renamed from contrib/tools/python3/src/Modules/rotatingtree.c)0
-rw-r--r--contrib/tools/python3/Modules/rotatingtree.h (renamed from contrib/tools/python3/src/Modules/rotatingtree.h)0
-rw-r--r--contrib/tools/python3/Modules/selectmodule.c (renamed from contrib/tools/python3/src/Modules/selectmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/sha1module.c (renamed from contrib/tools/python3/src/Modules/sha1module.c)0
-rw-r--r--contrib/tools/python3/Modules/sha2module.c (renamed from contrib/tools/python3/src/Modules/sha2module.c)0
-rw-r--r--contrib/tools/python3/Modules/sha3module.c (renamed from contrib/tools/python3/src/Modules/sha3module.c)0
-rw-r--r--contrib/tools/python3/Modules/signalmodule.c (renamed from contrib/tools/python3/src/Modules/signalmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/socketmodule.c (renamed from contrib/tools/python3/src/Modules/socketmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/socketmodule.h (renamed from contrib/tools/python3/src/Modules/socketmodule.h)0
-rw-r--r--contrib/tools/python3/Modules/spwdmodule.c (renamed from contrib/tools/python3/src/Modules/spwdmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/symtablemodule.c (renamed from contrib/tools/python3/src/Modules/symtablemodule.c)0
-rw-r--r--contrib/tools/python3/Modules/syslogmodule.c (renamed from contrib/tools/python3/src/Modules/syslogmodule.c)0
-rw-r--r--contrib/tools/python3/Modules/termios.c (renamed from contrib/tools/python3/src/Modules/termios.c)0
-rw-r--r--contrib/tools/python3/Modules/timemodule.c (renamed from contrib/tools/python3/src/Modules/timemodule.c)0
-rw-r--r--contrib/tools/python3/Modules/unicodedata.c (renamed from contrib/tools/python3/src/Modules/unicodedata.c)0
-rw-r--r--contrib/tools/python3/Modules/unicodedata_db.h (renamed from contrib/tools/python3/src/Modules/unicodedata_db.h)0
-rw-r--r--contrib/tools/python3/Modules/unicodename_db.h (renamed from contrib/tools/python3/src/Modules/unicodename_db.h)0
-rw-r--r--contrib/tools/python3/Modules/winreparse.h (renamed from contrib/tools/python3/src/Modules/winreparse.h)0
-rw-r--r--contrib/tools/python3/Modules/ya.make188
-rw-r--r--contrib/tools/python3/Modules/zlibmodule.c (renamed from contrib/tools/python3/src/Modules/zlibmodule.c)0
-rw-r--r--contrib/tools/python3/Objects/README1
-rw-r--r--contrib/tools/python3/Objects/abstract.c (renamed from contrib/tools/python3/src/Objects/abstract.c)0
-rw-r--r--contrib/tools/python3/Objects/boolobject.c (renamed from contrib/tools/python3/src/Objects/boolobject.c)0
-rw-r--r--contrib/tools/python3/Objects/bytearrayobject.c (renamed from contrib/tools/python3/src/Objects/bytearrayobject.c)0
-rw-r--r--contrib/tools/python3/Objects/bytes_methods.c (renamed from contrib/tools/python3/src/Objects/bytes_methods.c)0
-rw-r--r--contrib/tools/python3/Objects/bytesobject.c (renamed from contrib/tools/python3/src/Objects/bytesobject.c)0
-rw-r--r--contrib/tools/python3/Objects/call.c (renamed from contrib/tools/python3/src/Objects/call.c)0
-rw-r--r--contrib/tools/python3/Objects/capsule.c (renamed from contrib/tools/python3/src/Objects/capsule.c)0
-rw-r--r--contrib/tools/python3/Objects/cellobject.c (renamed from contrib/tools/python3/src/Objects/cellobject.c)0
-rw-r--r--contrib/tools/python3/Objects/classobject.c (renamed from contrib/tools/python3/src/Objects/classobject.c)0
-rw-r--r--contrib/tools/python3/Objects/clinic/bytearrayobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/bytearrayobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/bytesobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/bytesobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/classobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/classobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/codeobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/codeobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/complexobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/complexobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/descrobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/descrobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/dictobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/dictobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/enumobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/enumobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/floatobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/floatobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/funcobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/funcobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/listobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/listobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/longobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/longobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/memoryobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/memoryobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/moduleobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/moduleobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/odictobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/odictobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/structseq.c.h (renamed from contrib/tools/python3/src/Objects/clinic/structseq.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/tupleobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/tupleobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/typeobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/typeobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/typevarobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/typevarobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/clinic/unicodeobject.c.h (renamed from contrib/tools/python3/src/Objects/clinic/unicodeobject.c.h)0
-rw-r--r--contrib/tools/python3/Objects/codeobject.c (renamed from contrib/tools/python3/src/Objects/codeobject.c)0
-rw-r--r--contrib/tools/python3/Objects/complexobject.c (renamed from contrib/tools/python3/src/Objects/complexobject.c)0
-rw-r--r--contrib/tools/python3/Objects/descrobject.c (renamed from contrib/tools/python3/src/Objects/descrobject.c)0
-rw-r--r--contrib/tools/python3/Objects/dictobject.c (renamed from contrib/tools/python3/src/Objects/dictobject.c)0
-rw-r--r--contrib/tools/python3/Objects/enumobject.c (renamed from contrib/tools/python3/src/Objects/enumobject.c)0
-rw-r--r--contrib/tools/python3/Objects/exceptions.c (renamed from contrib/tools/python3/src/Objects/exceptions.c)0
-rw-r--r--contrib/tools/python3/Objects/fileobject.c (renamed from contrib/tools/python3/src/Objects/fileobject.c)0
-rw-r--r--contrib/tools/python3/Objects/floatobject.c (renamed from contrib/tools/python3/src/Objects/floatobject.c)0
-rw-r--r--contrib/tools/python3/Objects/frameobject.c (renamed from contrib/tools/python3/src/Objects/frameobject.c)0
-rw-r--r--contrib/tools/python3/Objects/funcobject.c (renamed from contrib/tools/python3/src/Objects/funcobject.c)0
-rw-r--r--contrib/tools/python3/Objects/genericaliasobject.c (renamed from contrib/tools/python3/src/Objects/genericaliasobject.c)0
-rw-r--r--contrib/tools/python3/Objects/genobject.c (renamed from contrib/tools/python3/src/Objects/genobject.c)0
-rw-r--r--contrib/tools/python3/Objects/interpreteridobject.c (renamed from contrib/tools/python3/src/Objects/interpreteridobject.c)0
-rw-r--r--contrib/tools/python3/Objects/iterobject.c (renamed from contrib/tools/python3/src/Objects/iterobject.c)0
-rw-r--r--contrib/tools/python3/Objects/listobject.c (renamed from contrib/tools/python3/src/Objects/listobject.c)0
-rw-r--r--contrib/tools/python3/Objects/longobject.c (renamed from contrib/tools/python3/src/Objects/longobject.c)0
-rw-r--r--contrib/tools/python3/Objects/memoryobject.c (renamed from contrib/tools/python3/src/Objects/memoryobject.c)0
-rw-r--r--contrib/tools/python3/Objects/methodobject.c (renamed from contrib/tools/python3/src/Objects/methodobject.c)0
-rw-r--r--contrib/tools/python3/Objects/moduleobject.c (renamed from contrib/tools/python3/src/Objects/moduleobject.c)0
-rw-r--r--contrib/tools/python3/Objects/namespaceobject.c (renamed from contrib/tools/python3/src/Objects/namespaceobject.c)0
-rw-r--r--contrib/tools/python3/Objects/object.c (renamed from contrib/tools/python3/src/Objects/object.c)0
-rw-r--r--contrib/tools/python3/Objects/obmalloc.c (renamed from contrib/tools/python3/src/Objects/obmalloc.c)0
-rw-r--r--contrib/tools/python3/Objects/odictobject.c (renamed from contrib/tools/python3/src/Objects/odictobject.c)0
-rw-r--r--contrib/tools/python3/Objects/picklebufobject.c (renamed from contrib/tools/python3/src/Objects/picklebufobject.c)0
-rw-r--r--contrib/tools/python3/Objects/rangeobject.c (renamed from contrib/tools/python3/src/Objects/rangeobject.c)0
-rw-r--r--contrib/tools/python3/Objects/setobject.c (renamed from contrib/tools/python3/src/Objects/setobject.c)0
-rw-r--r--contrib/tools/python3/Objects/sliceobject.c (renamed from contrib/tools/python3/src/Objects/sliceobject.c)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/asciilib.h (renamed from contrib/tools/python3/src/Objects/stringlib/asciilib.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/clinic/transmogrify.h.h (renamed from contrib/tools/python3/src/Objects/stringlib/clinic/transmogrify.h.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/codecs.h (renamed from contrib/tools/python3/src/Objects/stringlib/codecs.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/count.h (renamed from contrib/tools/python3/src/Objects/stringlib/count.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/ctype.h (renamed from contrib/tools/python3/src/Objects/stringlib/ctype.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/eq.h (renamed from contrib/tools/python3/src/Objects/stringlib/eq.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/fastsearch.h (renamed from contrib/tools/python3/src/Objects/stringlib/fastsearch.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/find.h (renamed from contrib/tools/python3/src/Objects/stringlib/find.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/find_max_char.h (renamed from contrib/tools/python3/src/Objects/stringlib/find_max_char.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/join.h (renamed from contrib/tools/python3/src/Objects/stringlib/join.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/localeutil.h (renamed from contrib/tools/python3/src/Objects/stringlib/localeutil.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/partition.h (renamed from contrib/tools/python3/src/Objects/stringlib/partition.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/replace.h (renamed from contrib/tools/python3/src/Objects/stringlib/replace.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/split.h (renamed from contrib/tools/python3/src/Objects/stringlib/split.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/stringdefs.h (renamed from contrib/tools/python3/src/Objects/stringlib/stringdefs.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/transmogrify.h (renamed from contrib/tools/python3/src/Objects/stringlib/transmogrify.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/ucs1lib.h (renamed from contrib/tools/python3/src/Objects/stringlib/ucs1lib.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/ucs2lib.h (renamed from contrib/tools/python3/src/Objects/stringlib/ucs2lib.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/ucs4lib.h (renamed from contrib/tools/python3/src/Objects/stringlib/ucs4lib.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/undef.h (renamed from contrib/tools/python3/src/Objects/stringlib/undef.h)0
-rw-r--r--contrib/tools/python3/Objects/stringlib/unicode_format.h (renamed from contrib/tools/python3/src/Objects/stringlib/unicode_format.h)0
-rw-r--r--contrib/tools/python3/Objects/structseq.c (renamed from contrib/tools/python3/src/Objects/structseq.c)0
-rw-r--r--contrib/tools/python3/Objects/tupleobject.c (renamed from contrib/tools/python3/src/Objects/tupleobject.c)0
-rw-r--r--contrib/tools/python3/Objects/typeobject.c (renamed from contrib/tools/python3/src/Objects/typeobject.c)0
-rw-r--r--contrib/tools/python3/Objects/typeslots.inc (renamed from contrib/tools/python3/src/Objects/typeslots.inc)0
-rw-r--r--contrib/tools/python3/Objects/typevarobject.c (renamed from contrib/tools/python3/src/Objects/typevarobject.c)0
-rw-r--r--contrib/tools/python3/Objects/unicodectype.c (renamed from contrib/tools/python3/src/Objects/unicodectype.c)0
-rw-r--r--contrib/tools/python3/Objects/unicodeobject.c (renamed from contrib/tools/python3/src/Objects/unicodeobject.c)0
-rw-r--r--contrib/tools/python3/Objects/unicodetype_db.h (renamed from contrib/tools/python3/src/Objects/unicodetype_db.h)0
-rw-r--r--contrib/tools/python3/Objects/unionobject.c (renamed from contrib/tools/python3/src/Objects/unionobject.c)0
-rw-r--r--contrib/tools/python3/Objects/weakrefobject.c (renamed from contrib/tools/python3/src/Objects/weakrefobject.c)0
-rw-r--r--contrib/tools/python3/PC/WinMain.c (renamed from contrib/tools/python3/src/PC/WinMain.c)0
-rw-r--r--contrib/tools/python3/PC/clinic/msvcrtmodule.c.h (renamed from contrib/tools/python3/src/PC/clinic/msvcrtmodule.c.h)0
-rw-r--r--contrib/tools/python3/PC/clinic/winreg.c.h (renamed from contrib/tools/python3/src/PC/clinic/winreg.c.h)0
-rw-r--r--contrib/tools/python3/PC/clinic/winsound.c.h (renamed from contrib/tools/python3/src/PC/clinic/winsound.c.h)0
-rw-r--r--contrib/tools/python3/PC/errmap.h (renamed from contrib/tools/python3/src/PC/errmap.h)0
-rw-r--r--contrib/tools/python3/PC/invalid_parameter_handler.c (renamed from contrib/tools/python3/src/PC/invalid_parameter_handler.c)0
-rw-r--r--contrib/tools/python3/PC/msvcrtmodule.c (renamed from contrib/tools/python3/src/PC/msvcrtmodule.c)0
-rw-r--r--contrib/tools/python3/PC/pyconfig.h (renamed from contrib/tools/python3/src/PC/pyconfig.h)0
-rw-r--r--contrib/tools/python3/PC/winreg.c (renamed from contrib/tools/python3/src/PC/winreg.c)0
-rw-r--r--contrib/tools/python3/PC/winsound.c (renamed from contrib/tools/python3/src/PC/winsound.c)0
-rw-r--r--contrib/tools/python3/Parser/action_helpers.c (renamed from contrib/tools/python3/src/Parser/action_helpers.c)0
-rw-r--r--contrib/tools/python3/Parser/myreadline.c (renamed from contrib/tools/python3/src/Parser/myreadline.c)0
-rw-r--r--contrib/tools/python3/Parser/parser.c (renamed from contrib/tools/python3/src/Parser/parser.c)0
-rw-r--r--contrib/tools/python3/Parser/peg_api.c (renamed from contrib/tools/python3/src/Parser/peg_api.c)0
-rw-r--r--contrib/tools/python3/Parser/pegen.c (renamed from contrib/tools/python3/src/Parser/pegen.c)0
-rw-r--r--contrib/tools/python3/Parser/pegen.h (renamed from contrib/tools/python3/src/Parser/pegen.h)0
-rw-r--r--contrib/tools/python3/Parser/pegen_errors.c (renamed from contrib/tools/python3/src/Parser/pegen_errors.c)0
-rw-r--r--contrib/tools/python3/Parser/string_parser.c (renamed from contrib/tools/python3/src/Parser/string_parser.c)0
-rw-r--r--contrib/tools/python3/Parser/string_parser.h (renamed from contrib/tools/python3/src/Parser/string_parser.h)0
-rw-r--r--contrib/tools/python3/Parser/token.c (renamed from contrib/tools/python3/src/Parser/token.c)0
-rw-r--r--contrib/tools/python3/Parser/tokenizer.c (renamed from contrib/tools/python3/src/Parser/tokenizer.c)0
-rw-r--r--contrib/tools/python3/Parser/tokenizer.h (renamed from contrib/tools/python3/src/Parser/tokenizer.h)0
-rw-r--r--contrib/tools/python3/Programs/python.c (renamed from contrib/tools/python3/src/Programs/python.c)0
-rw-r--r--contrib/tools/python3/Python/Python-ast.c (renamed from contrib/tools/python3/src/Python/Python-ast.c)0
-rw-r--r--contrib/tools/python3/Python/Python-tokenize.c (renamed from contrib/tools/python3/src/Python/Python-tokenize.c)0
-rw-r--r--contrib/tools/python3/Python/_warnings.c (renamed from contrib/tools/python3/src/Python/_warnings.c)0
-rw-r--r--contrib/tools/python3/Python/asdl.c (renamed from contrib/tools/python3/src/Python/asdl.c)0
-rw-r--r--contrib/tools/python3/Python/asm_trampoline.S28
-rw-r--r--contrib/tools/python3/Python/assemble.c (renamed from contrib/tools/python3/src/Python/assemble.c)0
-rw-r--r--contrib/tools/python3/Python/ast.c (renamed from contrib/tools/python3/src/Python/ast.c)0
-rw-r--r--contrib/tools/python3/Python/ast_opt.c (renamed from contrib/tools/python3/src/Python/ast_opt.c)0
-rw-r--r--contrib/tools/python3/Python/ast_unparse.c (renamed from contrib/tools/python3/src/Python/ast_unparse.c)0
-rw-r--r--contrib/tools/python3/Python/bltinmodule.c (renamed from contrib/tools/python3/src/Python/bltinmodule.c)0
-rw-r--r--contrib/tools/python3/Python/bootstrap_hash.c (renamed from contrib/tools/python3/src/Python/bootstrap_hash.c)0
-rw-r--r--contrib/tools/python3/Python/ceval.c (renamed from contrib/tools/python3/src/Python/ceval.c)0
-rw-r--r--contrib/tools/python3/Python/ceval_gil.c (renamed from contrib/tools/python3/src/Python/ceval_gil.c)0
-rw-r--r--contrib/tools/python3/Python/ceval_macros.h (renamed from contrib/tools/python3/src/Python/ceval_macros.h)0
-rw-r--r--contrib/tools/python3/Python/clinic/Python-tokenize.c.h (renamed from contrib/tools/python3/src/Python/clinic/Python-tokenize.c.h)0
-rw-r--r--contrib/tools/python3/Python/clinic/_warnings.c.h (renamed from contrib/tools/python3/src/Python/clinic/_warnings.c.h)0
-rw-r--r--contrib/tools/python3/Python/clinic/bltinmodule.c.h (renamed from contrib/tools/python3/src/Python/clinic/bltinmodule.c.h)0
-rw-r--r--contrib/tools/python3/Python/clinic/context.c.h (renamed from contrib/tools/python3/src/Python/clinic/context.c.h)0
-rw-r--r--contrib/tools/python3/Python/clinic/import.c.h (renamed from contrib/tools/python3/src/Python/clinic/import.c.h)0
-rw-r--r--contrib/tools/python3/Python/clinic/instrumentation.c.h (renamed from contrib/tools/python3/src/Python/clinic/instrumentation.c.h)0
-rw-r--r--contrib/tools/python3/Python/clinic/marshal.c.h (renamed from contrib/tools/python3/src/Python/clinic/marshal.c.h)0
-rw-r--r--contrib/tools/python3/Python/clinic/sysmodule.c.h (renamed from contrib/tools/python3/src/Python/clinic/sysmodule.c.h)0
-rw-r--r--contrib/tools/python3/Python/clinic/traceback.c.h (renamed from contrib/tools/python3/src/Python/clinic/traceback.c.h)0
-rw-r--r--contrib/tools/python3/Python/codecs.c (renamed from contrib/tools/python3/src/Python/codecs.c)0
-rw-r--r--contrib/tools/python3/Python/compile.c (renamed from contrib/tools/python3/src/Python/compile.c)0
-rw-r--r--contrib/tools/python3/Python/condvar.h (renamed from contrib/tools/python3/src/Python/condvar.h)0
-rw-r--r--contrib/tools/python3/Python/context.c (renamed from contrib/tools/python3/src/Python/context.c)0
-rw-r--r--contrib/tools/python3/Python/deepfreeze/README.txt (renamed from contrib/tools/python3/src/Python/deepfreeze/README.txt)0
-rw-r--r--contrib/tools/python3/Python/deepfreeze/deepfreeze.c (renamed from contrib/tools/python3/src/Python/deepfreeze/deepfreeze.c)0
-rw-r--r--contrib/tools/python3/Python/dtoa.c (renamed from contrib/tools/python3/src/Python/dtoa.c)0
-rw-r--r--contrib/tools/python3/Python/dynamic_annotations.c (renamed from contrib/tools/python3/src/Python/dynamic_annotations.c)0
-rw-r--r--contrib/tools/python3/Python/dynload_shlib.c (renamed from contrib/tools/python3/src/Python/dynload_shlib.c)0
-rw-r--r--contrib/tools/python3/Python/dynload_win.c (renamed from contrib/tools/python3/src/Python/dynload_win.c)0
-rw-r--r--contrib/tools/python3/Python/errors.c (renamed from contrib/tools/python3/src/Python/errors.c)0
-rw-r--r--contrib/tools/python3/Python/fileutils.c (renamed from contrib/tools/python3/src/Python/fileutils.c)0
-rw-r--r--contrib/tools/python3/Python/flowgraph.c (renamed from contrib/tools/python3/src/Python/flowgraph.c)0
-rw-r--r--contrib/tools/python3/Python/formatter_unicode.c (renamed from contrib/tools/python3/src/Python/formatter_unicode.c)0
-rw-r--r--contrib/tools/python3/Python/frame.c (renamed from contrib/tools/python3/src/Python/frame.c)0
-rw-r--r--contrib/tools/python3/Python/frozen.c (renamed from contrib/tools/python3/src/Python/frozen.c)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/README.txt (renamed from contrib/tools/python3/src/Python/frozen_modules/README.txt)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/__hello__.h (renamed from contrib/tools/python3/src/Python/frozen_modules/__hello__.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/__phello__.h (renamed from contrib/tools/python3/src/Python/frozen_modules/__phello__.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/__phello__.ham.eggs.h (renamed from contrib/tools/python3/src/Python/frozen_modules/__phello__.ham.eggs.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/__phello__.ham.h (renamed from contrib/tools/python3/src/Python/frozen_modules/__phello__.ham.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/__phello__.spam.h (renamed from contrib/tools/python3/src/Python/frozen_modules/__phello__.spam.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/_collections_abc.h (renamed from contrib/tools/python3/src/Python/frozen_modules/_collections_abc.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/_sitebuiltins.h (renamed from contrib/tools/python3/src/Python/frozen_modules/_sitebuiltins.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/abc.h (renamed from contrib/tools/python3/src/Python/frozen_modules/abc.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/codecs.h (renamed from contrib/tools/python3/src/Python/frozen_modules/codecs.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/frozen_only.h (renamed from contrib/tools/python3/src/Python/frozen_modules/frozen_only.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/genericpath.h (renamed from contrib/tools/python3/src/Python/frozen_modules/genericpath.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/getpath.h (renamed from contrib/tools/python3/src/Python/frozen_modules/getpath.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/importlib._bootstrap.h (renamed from contrib/tools/python3/src/Python/frozen_modules/importlib._bootstrap.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/importlib._bootstrap_external.h (renamed from contrib/tools/python3/src/Python/frozen_modules/importlib._bootstrap_external.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/importlib.machinery.h (renamed from contrib/tools/python3/src/Python/frozen_modules/importlib.machinery.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/importlib.util.h (renamed from contrib/tools/python3/src/Python/frozen_modules/importlib.util.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/io.h (renamed from contrib/tools/python3/src/Python/frozen_modules/io.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/ntpath.h (renamed from contrib/tools/python3/src/Python/frozen_modules/ntpath.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/os.h (renamed from contrib/tools/python3/src/Python/frozen_modules/os.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/posixpath.h (renamed from contrib/tools/python3/src/Python/frozen_modules/posixpath.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/runpy.h (renamed from contrib/tools/python3/src/Python/frozen_modules/runpy.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/site.h (renamed from contrib/tools/python3/src/Python/frozen_modules/site.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/stat.h (renamed from contrib/tools/python3/src/Python/frozen_modules/stat.h)0
-rw-r--r--contrib/tools/python3/Python/frozen_modules/zipimport.h (renamed from contrib/tools/python3/src/Python/frozen_modules/zipimport.h)0
-rw-r--r--contrib/tools/python3/Python/future.c (renamed from contrib/tools/python3/src/Python/future.c)0
-rw-r--r--contrib/tools/python3/Python/generated_cases.c.h (renamed from contrib/tools/python3/src/Python/generated_cases.c.h)0
-rw-r--r--contrib/tools/python3/Python/getargs.c (renamed from contrib/tools/python3/src/Python/getargs.c)0
-rw-r--r--contrib/tools/python3/Python/getcompiler.c (renamed from contrib/tools/python3/src/Python/getcompiler.c)0
-rw-r--r--contrib/tools/python3/Python/getcopyright.c (renamed from contrib/tools/python3/src/Python/getcopyright.c)0
-rw-r--r--contrib/tools/python3/Python/getopt.c (renamed from contrib/tools/python3/src/Python/getopt.c)0
-rw-r--r--contrib/tools/python3/Python/getplatform.c (renamed from contrib/tools/python3/src/Python/getplatform.c)0
-rw-r--r--contrib/tools/python3/Python/getversion.c (renamed from contrib/tools/python3/src/Python/getversion.c)0
-rw-r--r--contrib/tools/python3/Python/hamt.c (renamed from contrib/tools/python3/src/Python/hamt.c)0
-rw-r--r--contrib/tools/python3/Python/hashtable.c (renamed from contrib/tools/python3/src/Python/hashtable.c)0
-rw-r--r--contrib/tools/python3/Python/import.c (renamed from contrib/tools/python3/src/Python/import.c)0
-rw-r--r--contrib/tools/python3/Python/importdl.c (renamed from contrib/tools/python3/src/Python/importdl.c)0
-rw-r--r--contrib/tools/python3/Python/importdl.h (renamed from contrib/tools/python3/src/Python/importdl.h)0
-rw-r--r--contrib/tools/python3/Python/initconfig.c (renamed from contrib/tools/python3/src/Python/initconfig.c)0
-rw-r--r--contrib/tools/python3/Python/instrumentation.c (renamed from contrib/tools/python3/src/Python/instrumentation.c)0
-rw-r--r--contrib/tools/python3/Python/intrinsics.c (renamed from contrib/tools/python3/src/Python/intrinsics.c)0
-rw-r--r--contrib/tools/python3/Python/legacy_tracing.c (renamed from contrib/tools/python3/src/Python/legacy_tracing.c)0
-rw-r--r--contrib/tools/python3/Python/marshal.c (renamed from contrib/tools/python3/src/Python/marshal.c)0
-rw-r--r--contrib/tools/python3/Python/modsupport.c (renamed from contrib/tools/python3/src/Python/modsupport.c)0
-rw-r--r--contrib/tools/python3/Python/mysnprintf.c (renamed from contrib/tools/python3/src/Python/mysnprintf.c)0
-rw-r--r--contrib/tools/python3/Python/mystrtoul.c (renamed from contrib/tools/python3/src/Python/mystrtoul.c)0
-rw-r--r--contrib/tools/python3/Python/opcode_metadata.h (renamed from contrib/tools/python3/src/Python/opcode_metadata.h)0
-rw-r--r--contrib/tools/python3/Python/opcode_targets.h (renamed from contrib/tools/python3/src/Python/opcode_targets.h)0
-rw-r--r--contrib/tools/python3/Python/pathconfig.c (renamed from contrib/tools/python3/src/Python/pathconfig.c)0
-rw-r--r--contrib/tools/python3/Python/perf_trampoline.c (renamed from contrib/tools/python3/src/Python/perf_trampoline.c)0
-rw-r--r--contrib/tools/python3/Python/preconfig.c (renamed from contrib/tools/python3/src/Python/preconfig.c)0
-rw-r--r--contrib/tools/python3/Python/pyarena.c (renamed from contrib/tools/python3/src/Python/pyarena.c)0
-rw-r--r--contrib/tools/python3/Python/pyctype.c (renamed from contrib/tools/python3/src/Python/pyctype.c)0
-rw-r--r--contrib/tools/python3/Python/pyfpe.c (renamed from contrib/tools/python3/src/Python/pyfpe.c)0
-rw-r--r--contrib/tools/python3/Python/pyhash.c (renamed from contrib/tools/python3/src/Python/pyhash.c)0
-rw-r--r--contrib/tools/python3/Python/pylifecycle.c (renamed from contrib/tools/python3/src/Python/pylifecycle.c)0
-rw-r--r--contrib/tools/python3/Python/pymath.c (renamed from contrib/tools/python3/src/Python/pymath.c)0
-rw-r--r--contrib/tools/python3/Python/pystate.c (renamed from contrib/tools/python3/src/Python/pystate.c)0
-rw-r--r--contrib/tools/python3/Python/pystrcmp.c (renamed from contrib/tools/python3/src/Python/pystrcmp.c)0
-rw-r--r--contrib/tools/python3/Python/pystrhex.c (renamed from contrib/tools/python3/src/Python/pystrhex.c)0
-rw-r--r--contrib/tools/python3/Python/pystrtod.c (renamed from contrib/tools/python3/src/Python/pystrtod.c)0
-rw-r--r--contrib/tools/python3/Python/pythonrun.c (renamed from contrib/tools/python3/src/Python/pythonrun.c)0
-rw-r--r--contrib/tools/python3/Python/pytime.c (renamed from contrib/tools/python3/src/Python/pytime.c)0
-rw-r--r--contrib/tools/python3/Python/specialize.c (renamed from contrib/tools/python3/src/Python/specialize.c)0
-rw-r--r--contrib/tools/python3/Python/stdlib_module_names.h (renamed from contrib/tools/python3/src/Python/stdlib_module_names.h)0
-rw-r--r--contrib/tools/python3/Python/structmember.c (renamed from contrib/tools/python3/src/Python/structmember.c)0
-rw-r--r--contrib/tools/python3/Python/suggestions.c (renamed from contrib/tools/python3/src/Python/suggestions.c)0
-rw-r--r--contrib/tools/python3/Python/symtable.c (renamed from contrib/tools/python3/src/Python/symtable.c)0
-rw-r--r--contrib/tools/python3/Python/sysmodule.c (renamed from contrib/tools/python3/src/Python/sysmodule.c)0
-rw-r--r--contrib/tools/python3/Python/thread.c (renamed from contrib/tools/python3/src/Python/thread.c)0
-rw-r--r--contrib/tools/python3/Python/thread_nt.h (renamed from contrib/tools/python3/src/Python/thread_nt.h)0
-rw-r--r--contrib/tools/python3/Python/thread_pthread.h (renamed from contrib/tools/python3/src/Python/thread_pthread.h)0
-rw-r--r--contrib/tools/python3/Python/thread_pthread_stubs.h (renamed from contrib/tools/python3/src/Python/thread_pthread_stubs.h)0
-rw-r--r--contrib/tools/python3/Python/traceback.c (renamed from contrib/tools/python3/src/Python/traceback.c)0
-rw-r--r--contrib/tools/python3/Python/tracemalloc.c (renamed from contrib/tools/python3/src/Python/tracemalloc.c)0
-rw-r--r--contrib/tools/python3/README.rst (renamed from contrib/tools/python3/src/README.rst)0
-rw-r--r--contrib/tools/python3/bin/ya.make25
-rw-r--r--contrib/tools/python3/lib/lsan.supp2
-rw-r--r--contrib/tools/python3/lib/py/ya.make563
-rw-r--r--contrib/tools/python3/lib/ya.make15
-rw-r--r--contrib/tools/python3/lib2/py/ya.make563
-rw-r--r--contrib/tools/python3/lib2/ya.make15
-rw-r--r--contrib/tools/python3/patches/all-changes.patch106
-rw-r--r--contrib/tools/python3/src/Include/cpython/pytime.h333
-rw-r--r--contrib/tools/python3/src/Include/internal/pycore_condvar.h99
-rw-r--r--contrib/tools/python3/src/Include/pyconfig-linux.h1947
-rw-r--r--contrib/tools/python3/src/Lib/threading.py1711
-rw-r--r--contrib/tools/python3/src/Lib/ya.make545
-rw-r--r--contrib/tools/python3/src/Modules/_ctypes/_ctypes.c5836
-rw-r--r--contrib/tools/python3/src/Modules/_ctypes/callbacks.c613
-rw-r--r--contrib/tools/python3/src/Modules/_ctypes/callproc.c2039
-rw-r--r--contrib/tools/python3/src/Modules/_ctypes/cfield.c1586
-rw-r--r--contrib/tools/python3/src/Modules/_ctypes/ctypes.h410
-rw-r--r--contrib/tools/python3/src/Modules/_ctypes/stgdict.c964
-rw-r--r--contrib/tools/python3/src/Modules/_hacl/include/krml/lowstar_endianness.h231
-rw-r--r--contrib/tools/python3/src/Modules/_pickle.c7986
-rw-r--r--contrib/tools/python3/src/Modules/_sqlite/ya.make47
-rw-r--r--contrib/tools/python3/src/Modules/ya.make188
-rw-r--r--contrib/tools/python3/src/ya.make197
-rw-r--r--contrib/tools/python3/tsan.supp (renamed from contrib/tools/python3/src/tsan.supp)0
-rw-r--r--contrib/tools/python3/ya.make196
-rw-r--r--library/cpp/containers/disjoint_interval_tree/disjoint_interval_tree.h2
-rw-r--r--library/cpp/containers/disjoint_interval_tree/ut/disjoint_interval_tree_ut.cpp12
-rw-r--r--library/cpp/http/fetch/http_socket.cpp193
-rw-r--r--library/cpp/lfalloc/yt/ya.make28
-rw-r--r--library/cpp/timezone_conversion/civil.h8
-rw-r--r--library/cpp/timezone_conversion/ut/civil_ut.cpp5
-rw-r--r--library/cpp/tld/tlds-alpha-by-domain.txt2
-rw-r--r--library/python/import_test/__init__.py3
-rw-r--r--library/python/import_test/ya.make9
-rw-r--r--library/python/runtime_py3/importer.pxi23
-rw-r--r--library/python/runtime_py3/main/main.c2
-rw-r--r--library/python/runtime_py3/main/ya.make4
-rw-r--r--library/python/runtime_py3/ya.make4
-rw-r--r--util/generic/flags.h8
-rw-r--r--util/generic/vector.h4
-rw-r--r--util/system/context.cpp13
-rw-r--r--util/system/context.h25
-rw-r--r--util/system/fs.cpp23
-rw-r--r--util/system/fs.h7
-rw-r--r--util/system/sanitizers.cpp83
-rw-r--r--util/system/sanitizers.h44
-rw-r--r--vendor/github.com/google/uuid/hash.go6
-rw-r--r--vendor/github.com/google/uuid/time.go21
-rw-r--r--vendor/github.com/google/uuid/uuid.go53
-rw-r--r--vendor/github.com/google/uuid/version6.go56
-rw-r--r--vendor/github.com/google/uuid/version7.go104
-rw-r--r--vendor/github.com/google/uuid/ya.make2
-rwxr-xr-xya20
-rw-r--r--yt/cpp/mapreduce/client/client.cpp34
-rw-r--r--yt/python/yt/common.py4
-rw-r--r--yt/python/yt/logger.py67
-rw-r--r--yt/yt/client/api/client_common.h17
-rw-r--r--yt/yt/client/api/internal_client.cpp18
-rw-r--r--yt/yt/client/api/internal_client.h4
-rw-r--r--yt/yt/client/api/operations_archive_schema.cpp48
-rw-r--r--yt/yt/client/api/operations_archive_schema.h50
-rw-r--r--yt/yt/client/api/query_tracker_client.h4
-rw-r--r--yt/yt/client/api/rpc_proxy/api_service_proxy.h10
-rw-r--r--yt/yt/client/api/rpc_proxy/client_base.cpp4
-rw-r--r--yt/yt/client/api/rpc_proxy/client_impl.cpp227
-rw-r--r--yt/yt/client/api/rpc_proxy/helpers.cpp306
-rw-r--r--yt/yt/client/api/rpc_proxy/helpers.h19
-rw-r--r--yt/yt/client/chunk_client/data_statistics.cpp5
-rw-r--r--yt/yt/client/driver/command-inl.h14
-rw-r--r--yt/yt/client/driver/internal_commands.cpp2
-rw-r--r--yt/yt/client/driver/table_commands.cpp20
-rw-r--r--yt/yt/client/object_client/helpers.cpp5
-rw-r--r--yt/yt/client/object_client/helpers.h3
-rw-r--r--yt/yt/client/object_client/public.cpp2
-rw-r--r--yt/yt/client/object_client/public.h6
-rw-r--r--yt/yt/client/table_client/check_schema_compatibility.cpp12
-rw-r--r--yt/yt/client/table_client/columnar_statistics.cpp5
-rw-r--r--yt/yt/client/table_client/columnar_statistics.h4
-rw-r--r--yt/yt/client/table_client/config.cpp6
-rw-r--r--yt/yt/client/table_client/config.h4
-rw-r--r--yt/yt/client/table_client/name_table.cpp2
-rw-r--r--yt/yt/client/table_client/public.h5
-rw-r--r--yt/yt/client/table_client/schema.cpp328
-rw-r--r--yt/yt/client/table_client/schema.h78
-rw-r--r--yt/yt/client/table_client/schema_serialization_helpers.cpp23
-rw-r--r--yt/yt/client/table_client/schema_serialization_helpers.h2
-rw-r--r--yt/yt/client/table_client/unittests/columnar_statistics_ut.cpp14
-rw-r--r--yt/yt/client/table_client/unittests/serialization_ut.cpp6
-rw-r--r--yt/yt/client/table_client/unittests/unversioned_row_ut.cpp32
-rw-r--r--yt/yt/client/table_client/unittests/ya.make1
-rw-r--r--yt/yt/client/table_client/unversioned_row.h11
-rw-r--r--yt/yt/client/tablet_client/public.h2
-rw-r--r--yt/yt/client/transaction_client/config.cpp9
-rw-r--r--yt/yt/client/transaction_client/config.h20
-rw-r--r--yt/yt/client/transaction_client/remote_timestamp_provider.cpp48
-rw-r--r--yt/yt/client/transaction_client/remote_timestamp_provider.h14
-rw-r--r--yt/yt/client/unittests/check_schema_compatibility_ut.cpp4
-rw-r--r--yt/yt/client/unittests/schema_ut.cpp4
-rw-r--r--yt/yt/core/actions/invoker.h15
-rw-r--r--yt/yt/core/bus/tcp/client.cpp6
-rw-r--r--yt/yt/core/bus/tcp/connection.cpp79
-rw-r--r--yt/yt/core/bus/tcp/connection.h2
-rw-r--r--yt/yt/core/bus/unittests/ssl_ut.cpp271
-rw-r--r--yt/yt/core/compression/dictionary_codec.h6
-rw-r--r--yt/yt/core/compression/zstd.cpp8
-rw-r--r--yt/yt/core/concurrency/async_semaphore.cpp34
-rw-r--r--yt/yt/core/concurrency/async_semaphore.h15
-rw-r--r--yt/yt/core/concurrency/unittests/scheduler_ut.cpp12
-rw-r--r--yt/yt/core/crypto/tls.cpp141
-rw-r--r--yt/yt/core/crypto/tls.h5
-rw-r--r--yt/yt/core/crypto/unittests/tls_ut.cpp7
-rw-r--r--yt/yt/core/http/client.cpp55
-rw-r--r--yt/yt/core/http/config.cpp3
-rw-r--r--yt/yt/core/http/config.h2
-rw-r--r--yt/yt/core/http/connection_pool.cpp6
-rw-r--r--yt/yt/core/http/connection_pool.h4
-rw-r--r--yt/yt/core/http/helpers.cpp1
-rw-r--r--yt/yt/core/http/stream.cpp19
-rw-r--r--yt/yt/core/http/stream.h4
-rw-r--r--yt/yt/core/https/client.cpp1
-rw-r--r--yt/yt/core/https/config.cpp2
-rw-r--r--yt/yt/core/https/config.h1
-rw-r--r--yt/yt/core/https/server.cpp83
-rw-r--r--yt/yt/core/logging/config.cpp3
-rw-r--r--yt/yt/core/logging/config.h4
-rw-r--r--yt/yt/core/logging/formatter.cpp13
-rw-r--r--yt/yt/core/logging/formatter.h4
-rw-r--r--yt/yt/core/logging/log_manager.cpp2
-rw-r--r--yt/yt/core/logging/unittests/logging_ut.cpp32
-rw-r--r--yt/yt/core/misc/arithmetic_formula.cpp23
-rw-r--r--yt/yt/core/misc/atomic_ptr-inl.h8
-rw-r--r--yt/yt/core/misc/atomic_ptr.h4
-rw-r--r--yt/yt/core/misc/concurrent_cache-inl.h17
-rw-r--r--yt/yt/core/misc/concurrent_cache.h2
-rw-r--r--yt/yt/core/misc/error.h9
-rw-r--r--yt/yt/core/misc/lock_free_hash_table-inl.h19
-rw-r--r--yt/yt/core/misc/lock_free_hash_table.h26
-rw-r--r--yt/yt/core/misc/serialize-inl.h3
-rw-r--r--yt/yt/core/misc/unittests/boolean_formula_ut.cpp3
-rw-r--r--yt/yt/core/misc/unittests/concurrent_cache_ut.cpp2
-rw-r--r--yt/yt/core/misc/unittests/lock_free_hash_table_ut.cpp2
-rw-r--r--yt/yt/core/net/dialer.cpp4
-rw-r--r--yt/yt/core/net/dialer.h15
-rw-r--r--yt/yt/core/net/mock/dialer.cpp2
-rw-r--r--yt/yt/core/net/mock/dialer.h2
-rw-r--r--yt/yt/core/net/public.h1
-rw-r--r--yt/yt/core/rpc/config.cpp7
-rw-r--r--yt/yt/core/rpc/config.h3
-rw-r--r--yt/yt/core/rpc/grpc/config.cpp2
-rw-r--r--yt/yt/core/rpc/grpc/config.h8
-rw-r--r--yt/yt/core/rpc/grpc/public.h2
-rw-r--r--yt/yt/core/rpc/grpc/server.cpp3
-rw-r--r--yt/yt/core/rpc/server_detail.cpp1
-rw-r--r--yt/yt/core/rpc/service_detail.cpp195
-rw-r--r--yt/yt/core/rpc/service_detail.h57
-rw-r--r--yt/yt/core/threading/thread.cpp6
-rw-r--r--yt/yt/core/tracing/config.cpp2
-rw-r--r--yt/yt/core/tracing/config.h6
-rw-r--r--yt/yt/core/tracing/public.h2
-rw-r--r--yt/yt/core/tracing/trace_context.cpp14
-rw-r--r--yt/yt/core/tracing/trace_context.h4
-rw-r--r--yt/yt/core/ya.make2
-rw-r--r--yt/yt/core/ypath/tokenizer.cpp6
-rw-r--r--yt/yt/core/ypath/tokenizer.h9
-rw-r--r--yt/yt/core/yson/async_writer.cpp2
-rw-r--r--yt/yt/core/yson/consumer.h5
-rw-r--r--yt/yt/core/yson/depth_limiting_yson_consumer.cpp4
-rw-r--r--yt/yt/core/yson/depth_limiting_yson_consumer.h7
-rw-r--r--yt/yt/core/yson/pull_parser-inl.h1
-rw-r--r--yt/yt/core/yson/pull_parser.h2
-rw-r--r--yt/yt/core/yson/unittests/ya.make1
-rw-r--r--yt/yt/core/yson/unittests/ypath_filtering_yson_consumer_ut.cpp499
-rw-r--r--yt/yt/core/yson/ypath_designated_consumer.h5
-rw-r--r--yt/yt/core/yson/ypath_filtering_consumer.cpp446
-rw-r--r--yt/yt/core/yson/ypath_filtering_consumer.h41
-rw-r--r--yt/yt/core/ytree/public.h7
-rw-r--r--yt/yt/core/ytree/unittests/ya.make1
-rw-r--r--yt/yt/core/ytree/unittests/yson_serializable_ut.cpp1171
-rw-r--r--yt/yt/core/ytree/unittests/yson_struct_ut.cpp334
-rw-r--r--yt/yt/core/ytree/virtual.cpp272
-rw-r--r--yt/yt/core/ytree/virtual.h19
-rw-r--r--yt/yt/core/ytree/yson_schema-inl.h7
-rw-r--r--yt/yt/core/ytree/yson_serializable-inl.h1037
-rw-r--r--yt/yt/core/ytree/yson_serializable.cpp385
-rw-r--r--yt/yt/core/ytree/yson_serializable.h268
-rw-r--r--yt/yt/core/ytree/yson_serialize_common.h27
-rw-r--r--yt/yt/core/ytree/yson_struct.cpp4
-rw-r--r--yt/yt/core/ytree/yson_struct.h6
-rw-r--r--yt/yt/core/ytree/yson_struct_detail-inl.h448
-rw-r--r--yt/yt/core/ytree/yson_struct_detail.cpp3
-rw-r--r--yt/yt/core/ytree/yson_struct_detail.h27
-rw-r--r--yt/yt/core/ytree/yson_struct_enum.h21
-rw-r--r--yt/yt/library/monitoring/monitoring_manager.h1
-rw-r--r--yt/yt/library/profiling/sensor.cpp40
-rw-r--r--yt/yt/library/profiling/sensor.h10
-rw-r--r--yt/yt/library/profiling/sensors_owner/README.md95
-rw-r--r--yt/yt/library/profiling/sensors_owner/sensors_owner-inl.h102
-rw-r--r--yt/yt/library/profiling/sensors_owner/sensors_owner.cpp181
-rw-r--r--yt/yt/library/profiling/sensors_owner/sensors_owner.h118
-rw-r--r--yt/yt/library/profiling/sensors_owner/sensors_owner_traits.h100
-rw-r--r--yt/yt/library/profiling/sensors_owner/unittests/sensors_owner_ut.cpp178
-rw-r--r--yt/yt/library/profiling/sensors_owner/unittests/ya.make13
-rw-r--r--yt/yt/library/profiling/sensors_owner/ya.make16
-rw-r--r--yt/yt/library/profiling/testing.cpp6
-rw-r--r--yt/yt/library/profiling/testing.h1
-rw-r--r--yt/yt/library/profiling/ya.make1
-rw-r--r--yt/yt/library/program/config.cpp12
-rw-r--r--yt/yt/library/program/config.h22
-rw-r--r--yt/yt/library/program/helpers.cpp28
-rw-r--r--yt/yt/library/tracing/example/main.cpp2
-rw-r--r--yt/yt/library/tracing/jaeger/tracer.cpp2
-rw-r--r--yt/yt/library/ytprof/allocation_tag_profiler/allocation_tag_profiler.cpp84
-rw-r--r--yt/yt/library/ytprof/allocation_tag_profiler/allocation_tag_profiler.h53
-rw-r--r--yt/yt/library/ytprof/allocation_tag_profiler/public.h13
-rw-r--r--yt/yt/library/ytprof/allocation_tag_profiler/ya.make17
-rw-r--r--yt/yt/library/ytprof/ya.make1
-rw-r--r--yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto205
-rw-r--r--yt/yt_proto/yt/client/chunk_client/proto/chunk_meta.proto5
-rw-r--r--yt/yt_proto/yt/client/transaction_client/proto/timestamp_service.proto1
-rw-r--r--yt/yt_proto/yt/core/bus/proto/bus.proto4
2912 files changed, 79416 insertions, 73999 deletions
diff --git a/.mapping.json b/.mapping.json
deleted file mode 100644
index cf18f26e596..00000000000
--- a/.mapping.json
+++ /dev/null
@@ -1,12371 +0,0 @@
-{
- ".":"ydb/github_toplevel",
- ".github/actions/build/action.yml":"ydb/github_toplevel/.github/actions/build/action.yml",
- ".github/actions/build_ya/action.yml":"ydb/github_toplevel/.github/actions/build_ya/action.yml",
- ".github/actions/prepare_vm/action.yaml":"ydb/github_toplevel/.github/actions/prepare_vm/action.yaml",
- ".github/actions/s3cmd/action.yml":"ydb/github_toplevel/.github/actions/s3cmd/action.yml",
- ".github/actions/test/action.yml":"ydb/github_toplevel/.github/actions/test/action.yml",
- ".github/actions/test_ya/action.yml":"ydb/github_toplevel/.github/actions/test_ya/action.yml",
- ".github/check_dirs.sh":"ydb/github_toplevel/.github/check_dirs.sh",
- ".github/config/muted_functest.txt":"ydb/github_toplevel/.github/config/muted_functest.txt",
- ".github/config/muted_shard.txt":"ydb/github_toplevel/.github/config/muted_shard.txt",
- ".github/config/muted_test.txt":"ydb/github_toplevel/.github/config/muted_test.txt",
- ".github/docker/Dockerfile":"ydb/github_toplevel/.github/docker/Dockerfile",
- ".github/docker/files/LICENSE":"ydb/github_toplevel/.github/docker/files/LICENSE",
- ".github/docker/files/THIRD_PARTY_LICENSES":"ydb/github_toplevel/.github/docker/files/THIRD_PARTY_LICENSES",
- ".github/docker/files/health_check":"ydb/github_toplevel/.github/docker/files/health_check",
- ".github/docker/files/initialize_local_ydb":"ydb/github_toplevel/.github/docker/files/initialize_local_ydb",
- ".github/prewarm/build.sh":"ydb/github_toplevel/.github/prewarm/build.sh",
- ".github/prewarm/ubuntu-1804.dockerfile":"ydb/github_toplevel/.github/prewarm/ubuntu-1804.dockerfile",
- ".github/prewarm/ubuntu-2004.dockerfile":"ydb/github_toplevel/.github/prewarm/ubuntu-2004.dockerfile",
- ".github/prewarm/ubuntu-2204.dockerfile":"ydb/github_toplevel/.github/prewarm/ubuntu-2204.dockerfile",
- ".github/scripts/tests/attach-logs.py":"ydb/github_toplevel/.github/scripts/tests/attach-logs.py",
- ".github/scripts/tests/ctest-postprocess.py":"ydb/github_toplevel/.github/scripts/tests/ctest-postprocess.py",
- ".github/scripts/tests/ctest_utils.py":"ydb/github_toplevel/.github/scripts/tests/ctest_utils.py",
- ".github/scripts/tests/fail-checker.py":"ydb/github_toplevel/.github/scripts/tests/fail-checker.py",
- ".github/scripts/tests/generate-summary.py":"ydb/github_toplevel/.github/scripts/tests/generate-summary.py",
- ".github/scripts/tests/junit-postprocess.py":"ydb/github_toplevel/.github/scripts/tests/junit-postprocess.py",
- ".github/scripts/tests/junit_utils.py":"ydb/github_toplevel/.github/scripts/tests/junit_utils.py",
- ".github/scripts/tests/log_parser.py":"ydb/github_toplevel/.github/scripts/tests/log_parser.py",
- ".github/scripts/tests/mute_utils.py":"ydb/github_toplevel/.github/scripts/tests/mute_utils.py",
- ".github/scripts/tests/pytest-postprocess.py":"ydb/github_toplevel/.github/scripts/tests/pytest-postprocess.py",
- ".github/scripts/tests/split-junit.py":"ydb/github_toplevel/.github/scripts/tests/split-junit.py",
- ".github/scripts/tests/templates/summary.html":"ydb/github_toplevel/.github/scripts/tests/templates/summary.html",
- ".github/scripts/tests/transform-ya-junit.py":"ydb/github_toplevel/.github/scripts/tests/transform-ya-junit.py",
- ".github/workflows/allowed_dirs.yml":"ydb/github_toplevel/.github/workflows/allowed_dirs.yml",
- ".github/workflows/build_and_test_ondemand.yml":"ydb/github_toplevel/.github/workflows/build_and_test_ondemand.yml",
- ".github/workflows/build_and_test_provisioned.yml":"ydb/github_toplevel/.github/workflows/build_and_test_provisioned.yml",
- ".github/workflows/build_and_test_ya.yml":"ydb/github_toplevel/.github/workflows/build_and_test_ya.yml",
- ".github/workflows/build_and_test_ya_ondemand.yml":"ydb/github_toplevel/.github/workflows/build_and_test_ya_ondemand.yml",
- ".github/workflows/build_and_test_ya_provisioned.yml":"ydb/github_toplevel/.github/workflows/build_and_test_ya_provisioned.yml",
- ".github/workflows/docker_publish.yml":"ydb/github_toplevel/.github/workflows/docker_publish.yml",
- ".github/workflows/docs_build.yaml":"ydb/github_toplevel/.github/workflows/docs_build.yaml",
- ".github/workflows/docs_preview.yaml":"ydb/github_toplevel/.github/workflows/docs_preview.yaml",
- ".github/workflows/docs_release.yaml":"ydb/github_toplevel/.github/workflows/docs_release.yaml",
- ".github/workflows/nightly_run.yaml":"ydb/github_toplevel/.github/workflows/nightly_run.yaml",
- ".github/workflows/postcommit_asan.yml":"ydb/github_toplevel/.github/workflows/postcommit_asan.yml",
- ".github/workflows/postcommit_relwithdebinfo.yml":"ydb/github_toplevel/.github/workflows/postcommit_relwithdebinfo.yml",
- ".github/workflows/pr_check.yml":"ydb/github_toplevel/.github/workflows/pr_check.yml",
- ".github/workflows/prewarm-ccache.yml":"ydb/github_toplevel/.github/workflows/prewarm-ccache.yml",
- ".github/workflows/prewarm-debug.yaml":"ydb/github_toplevel/.github/workflows/prewarm-debug.yaml",
- ".gitignore":"ydb/github_toplevel/.gitignore",
- "AUTHORS":"ydb/github_toplevel/AUTHORS",
- "BUILD.md":"ydb/github_toplevel/BUILD.md",
- "CMakeLists.darwin-arm64.txt":"",
- "CMakeLists.darwin-x86_64.txt":"",
- "CMakeLists.linux-aarch64.txt":"",
- "CMakeLists.linux-x86_64.txt":"",
- "CMakeLists.txt":"",
- "CMakeLists.windows-x86_64.txt":"",
- "CODE_OF_CONDUCT.md":"ydb/github_toplevel/CODE_OF_CONDUCT.md",
- "CONTRIBUTING.md":"ydb/github_toplevel/CONTRIBUTING.md",
- "LICENSE":"ydb/github_toplevel/LICENSE",
- "README.md":"ydb/github_toplevel/README.md",
- "ROADMAP.md":"ydb/github_toplevel/ROADMAP.md",
- "SECURITY.md":"ydb/github_toplevel/SECURITY.md",
- "build/ext_mapping.conf.json":"ydb/github_toplevel/build/ext_mapping.conf.json",
- "build/internal/conf/internal.conf":"ydb/github_toplevel/build/internal/conf/internal.conf",
- "build/internal/ya.conf":"ydb/github_toplevel/build/internal/ya.conf",
- "build/mapping.conf.json":"devtools/ya/opensource/mapping.conf.json",
- "build/scripts/export_script_gen.py":"",
- "build/scripts/generate_vcs_info.py":"",
- "build/scripts/split_unittest.py":"",
- "build/ya.conf.json":"devtools/ya/opensource/ya.conf.json",
- "certs/CMakeLists.darwin-arm64.txt":"",
- "certs/CMakeLists.darwin-x86_64.txt":"",
- "certs/CMakeLists.linux-aarch64.txt":"",
- "certs/CMakeLists.linux-x86_64.txt":"",
- "certs/CMakeLists.txt":"",
- "certs/CMakeLists.windows-x86_64.txt":"",
- "clang.toolchain":"ydb/github_toplevel/clang.toolchain",
- "cmake/FindAIO.cmake":"",
- "cmake/FindIDN.cmake":"",
- "cmake/antlr.cmake":"",
- "cmake/archive.cmake":"",
- "cmake/bison.cmake":"",
- "cmake/common.cmake":"",
- "cmake/conan-profiles/linux.aarch64.profile":"",
- "cmake/conan-profiles/macos.arm64.profile":"",
- "cmake/conan.cmake":"",
- "cmake/fbs.cmake":"",
- "cmake/global_flags.cmake":"",
- "cmake/global_flags.compiler.gnu.cmake":"",
- "cmake/global_flags.compiler.msvc.cmake":"",
- "cmake/global_flags.linker.gnu.cmake":"",
- "cmake/global_flags.linker.msvc.cmake":"",
- "cmake/global_vars.cmake":"",
- "cmake/llvm-tools.cmake":"",
- "cmake/masm.cmake":"",
- "cmake/protobuf.cmake":"",
- "cmake/shared_libs.cmake":"",
- "conanfile.txt":"",
- "contrib/.gitignore":"ydb/yandex_specific/contrib_gitignore",
- "contrib/CMakeLists.txt":"",
- "contrib/libs/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/CMakeLists.txt":"",
- "contrib/libs/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/antlr3_cpp_runtime/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/antlr3_cpp_runtime/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/antlr3_cpp_runtime/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/antlr3_cpp_runtime/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/antlr3_cpp_runtime/CMakeLists.txt":"",
- "contrib/libs/antlr3_cpp_runtime/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/apache/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/apache/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/apache/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/apache/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/apache/CMakeLists.txt":"",
- "contrib/libs/apache/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/apache/arrow/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/apache/arrow/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/apache/arrow/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/apache/arrow/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/apache/arrow/CMakeLists.txt":"",
- "contrib/libs/apache/arrow/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/apache/avro/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/apache/avro/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/apache/avro/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/apache/avro/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/apache/avro/CMakeLists.txt":"",
- "contrib/libs/apache/orc/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/apache/orc/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/apache/orc/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/apache/orc/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/apache/orc/CMakeLists.txt":"",
- "contrib/libs/apache/orc/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/aws-sdk-cpp/CMakeLists.txt":"",
- "contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/CMakeLists.txt":"",
- "contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/aws-sdk-cpp/aws-cpp-sdk-s3/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/aws-sdk-cpp/aws-cpp-sdk-s3/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/aws-sdk-cpp/aws-cpp-sdk-s3/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/aws-sdk-cpp/aws-cpp-sdk-s3/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/aws-sdk-cpp/aws-cpp-sdk-s3/CMakeLists.txt":"",
- "contrib/libs/aws-sdk-cpp/aws-cpp-sdk-s3/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/backtrace/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/backtrace/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/backtrace/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/backtrace/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/backtrace/CMakeLists.txt":"",
- "contrib/libs/base64/CMakeLists.txt":"",
- "contrib/libs/base64/avx2/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/base64/avx2/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/base64/avx2/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/base64/avx2/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/base64/avx2/CMakeLists.txt":"",
- "contrib/libs/base64/avx2/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/base64/neon32/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/base64/neon32/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/base64/neon32/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/base64/neon32/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/base64/neon32/CMakeLists.txt":"",
- "contrib/libs/base64/neon32/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/base64/neon64/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/base64/neon64/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/base64/neon64/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/base64/neon64/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/base64/neon64/CMakeLists.txt":"",
- "contrib/libs/base64/neon64/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/base64/plain32/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/base64/plain32/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/base64/plain32/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/base64/plain32/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/base64/plain32/CMakeLists.txt":"",
- "contrib/libs/base64/plain32/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/base64/plain64/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/base64/plain64/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/base64/plain64/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/base64/plain64/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/base64/plain64/CMakeLists.txt":"",
- "contrib/libs/base64/plain64/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/base64/ssse3/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/base64/ssse3/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/base64/ssse3/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/base64/ssse3/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/base64/ssse3/CMakeLists.txt":"",
- "contrib/libs/base64/ssse3/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/brotli/CMakeLists.txt":"",
- "contrib/libs/brotli/common/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/brotli/common/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/brotli/common/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/brotli/common/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/brotli/common/CMakeLists.txt":"",
- "contrib/libs/brotli/common/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/brotli/dec/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/brotli/dec/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/brotli/dec/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/brotli/dec/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/brotli/dec/CMakeLists.txt":"",
- "contrib/libs/brotli/dec/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/brotli/enc/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/brotli/enc/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/brotli/enc/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/brotli/enc/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/brotli/enc/CMakeLists.txt":"",
- "contrib/libs/brotli/enc/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/c-ares/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/c-ares/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/c-ares/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/c-ares/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/c-ares/CMakeLists.txt":"",
- "contrib/libs/c-ares/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/cctz/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/cctz/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/cctz/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/cctz/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/cctz/CMakeLists.txt":"",
- "contrib/libs/cctz/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/cctz/tzdata/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/cctz/tzdata/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/cctz/tzdata/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/cctz/tzdata/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/cctz/tzdata/CMakeLists.txt":"",
- "contrib/libs/cctz/tzdata/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/crcutil/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/crcutil/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/crcutil/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/crcutil/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/crcutil/CMakeLists.txt":"",
- "contrib/libs/crcutil/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/curl/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/curl/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/curl/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/curl/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/curl/CMakeLists.txt":"",
- "contrib/libs/curl/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/cxxsupp/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/cxxsupp/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/cxxsupp/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/cxxsupp/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/cxxsupp/CMakeLists.txt":"",
- "contrib/libs/cxxsupp/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/cxxsupp/builtins/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/cxxsupp/builtins/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/cxxsupp/builtins/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/cxxsupp/builtins/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/cxxsupp/builtins/CMakeLists.txt":"",
- "contrib/libs/cxxsupp/builtins/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/cxxsupp/libcxx/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/cxxsupp/libcxx/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/cxxsupp/libcxx/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/cxxsupp/libcxx/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/cxxsupp/libcxx/CMakeLists.txt":"",
- "contrib/libs/cxxsupp/libcxx/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/cxxsupp/libcxxabi-parts/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/cxxsupp/libcxxabi-parts/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/cxxsupp/libcxxabi-parts/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/cxxsupp/libcxxabi-parts/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/cxxsupp/libcxxabi-parts/CMakeLists.txt":"",
- "contrib/libs/cxxsupp/libcxxrt/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/cxxsupp/libcxxrt/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/cxxsupp/libcxxrt/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/cxxsupp/libcxxrt/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/cxxsupp/libcxxrt/CMakeLists.txt":"",
- "contrib/libs/double-conversion/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/double-conversion/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/double-conversion/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/double-conversion/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/double-conversion/CMakeLists.txt":"",
- "contrib/libs/double-conversion/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/expat/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/expat/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/expat/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/expat/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/expat/CMakeLists.txt":"",
- "contrib/libs/expat/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/farmhash/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/farmhash/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/farmhash/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/farmhash/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/farmhash/CMakeLists.txt":"",
- "contrib/libs/farmhash/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/farmhash/arch/CMakeLists.txt":"",
- "contrib/libs/farmhash/arch/sse41/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/farmhash/arch/sse41/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/farmhash/arch/sse41/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/farmhash/arch/sse41/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/farmhash/arch/sse41/CMakeLists.txt":"",
- "contrib/libs/farmhash/arch/sse41/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/farmhash/arch/sse42/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/farmhash/arch/sse42/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/farmhash/arch/sse42/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/farmhash/arch/sse42/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/farmhash/arch/sse42/CMakeLists.txt":"",
- "contrib/libs/farmhash/arch/sse42/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/farmhash/arch/sse42_aesni/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/farmhash/arch/sse42_aesni/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/farmhash/arch/sse42_aesni/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/farmhash/arch/sse42_aesni/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/farmhash/arch/sse42_aesni/CMakeLists.txt":"",
- "contrib/libs/farmhash/arch/sse42_aesni/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/fastlz/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/fastlz/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/fastlz/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/fastlz/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/fastlz/CMakeLists.txt":"",
- "contrib/libs/fastlz/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/flatbuffers/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/flatbuffers/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/flatbuffers/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/flatbuffers/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/flatbuffers/CMakeLists.txt":"",
- "contrib/libs/flatbuffers/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/flatbuffers/flatc/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/flatbuffers/flatc/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/flatbuffers/flatc/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/flatbuffers/flatc/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/flatbuffers/flatc/CMakeLists.txt":"",
- "contrib/libs/flatbuffers/flatc/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/fmt/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/fmt/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/fmt/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/fmt/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/fmt/CMakeLists.txt":"",
- "contrib/libs/fmt/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/googleapis-common-protos/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/googleapis-common-protos/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/googleapis-common-protos/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/googleapis-common-protos/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/googleapis-common-protos/CMakeLists.txt":"",
- "contrib/libs/googleapis-common-protos/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/grpc/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/grpc/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/grpc/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/grpc/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/grpc/CMakeLists.txt":"",
- "contrib/libs/grpc/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/grpc/src/CMakeLists.txt":"",
- "contrib/libs/grpc/src/compiler/CMakeLists.txt":"",
- "contrib/libs/grpc/src/compiler/grpc_plugin_support/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/grpc/src/compiler/grpc_plugin_support/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/grpc/src/compiler/grpc_plugin_support/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/grpc/src/compiler/grpc_plugin_support/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/grpc/src/compiler/grpc_plugin_support/CMakeLists.txt":"",
- "contrib/libs/grpc/src/compiler/grpc_plugin_support/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/grpc/third_party/CMakeLists.txt":"",
- "contrib/libs/grpc/third_party/address_sorting/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/grpc/third_party/address_sorting/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/grpc/third_party/address_sorting/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/grpc/third_party/address_sorting/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/grpc/third_party/address_sorting/CMakeLists.txt":"",
- "contrib/libs/grpc/third_party/address_sorting/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/grpc/third_party/upb/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/grpc/third_party/upb/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/grpc/third_party/upb/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/grpc/third_party/upb/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/grpc/third_party/upb/CMakeLists.txt":"",
- "contrib/libs/grpc/third_party/upb/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/hdr_histogram/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/hdr_histogram/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/hdr_histogram/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/hdr_histogram/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/hdr_histogram/CMakeLists.txt":"",
- "contrib/libs/hdr_histogram/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/highwayhash/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/highwayhash/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/highwayhash/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/highwayhash/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/highwayhash/CMakeLists.txt":"",
- "contrib/libs/highwayhash/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/highwayhash/arch/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/highwayhash/arch/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/highwayhash/arch/CMakeLists.txt":"",
- "contrib/libs/highwayhash/arch/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/highwayhash/arch/avx2/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/highwayhash/arch/avx2/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/highwayhash/arch/avx2/CMakeLists.txt":"",
- "contrib/libs/highwayhash/arch/avx2/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/highwayhash/arch/sse41/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/highwayhash/arch/sse41/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/highwayhash/arch/sse41/CMakeLists.txt":"",
- "contrib/libs/highwayhash/arch/sse41/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/hyperscan/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/hyperscan/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/hyperscan/CMakeLists.txt":"",
- "contrib/libs/hyperscan/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/hyperscan/runtime_avx2/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/hyperscan/runtime_avx2/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/hyperscan/runtime_avx2/CMakeLists.txt":"",
- "contrib/libs/hyperscan/runtime_avx2/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/hyperscan/runtime_avx512/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/hyperscan/runtime_avx512/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/hyperscan/runtime_avx512/CMakeLists.txt":"",
- "contrib/libs/hyperscan/runtime_avx512/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/hyperscan/runtime_core2/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/hyperscan/runtime_core2/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/hyperscan/runtime_core2/CMakeLists.txt":"",
- "contrib/libs/hyperscan/runtime_core2/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/hyperscan/runtime_corei7/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/hyperscan/runtime_corei7/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/hyperscan/runtime_corei7/CMakeLists.txt":"",
- "contrib/libs/hyperscan/runtime_corei7/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/icu/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/icu/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/icu/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/icu/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/icu/CMakeLists.txt":"",
- "contrib/libs/icu/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/jemalloc/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/jemalloc/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/jemalloc/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/jemalloc/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/jemalloc/CMakeLists.txt":"",
- "contrib/libs/jwt-cpp/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/jwt-cpp/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/jwt-cpp/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/jwt-cpp/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/jwt-cpp/CMakeLists.txt":"",
- "contrib/libs/jwt-cpp/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/libbz2/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/libbz2/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/libbz2/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/libbz2/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/libbz2/CMakeLists.txt":"",
- "contrib/libs/libbz2/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/libc_compat/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/libc_compat/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/libc_compat/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/libc_compat/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/libc_compat/CMakeLists.txt":"",
- "contrib/libs/libc_compat/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/libcap/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/libcap/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/libcap/CMakeLists.txt":"",
- "contrib/libs/libevent/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/libevent/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/libevent/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/libevent/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/libevent/CMakeLists.txt":"",
- "contrib/libs/libevent/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/libevent/event_core/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/libevent/event_core/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/libevent/event_core/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/libevent/event_core/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/libevent/event_core/CMakeLists.txt":"",
- "contrib/libs/libevent/event_core/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/libevent/event_extra/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/libevent/event_extra/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/libevent/event_extra/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/libevent/event_extra/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/libevent/event_extra/CMakeLists.txt":"",
- "contrib/libs/libevent/event_extra/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/libevent/event_openssl/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/libevent/event_openssl/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/libevent/event_openssl/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/libevent/event_openssl/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/libevent/event_openssl/CMakeLists.txt":"",
- "contrib/libs/libevent/event_openssl/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/libevent/event_thread/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/libevent/event_thread/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/libevent/event_thread/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/libevent/event_thread/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/libevent/event_thread/CMakeLists.txt":"",
- "contrib/libs/libevent/event_thread/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/libfyaml/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/libfyaml/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/libfyaml/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/libfyaml/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/libfyaml/CMakeLists.txt":"",
- "contrib/libs/libfyaml/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/libpq/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/libpq/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/libpq/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/libpq/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/libpq/CMakeLists.txt":"",
- "contrib/libs/libpqxx/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/libpqxx/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/libpqxx/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/libpqxx/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/libpqxx/CMakeLists.txt":"",
- "contrib/libs/libunwind/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/libunwind/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/libunwind/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/libunwind/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/libunwind/CMakeLists.txt":"",
- "contrib/libs/libunwind/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/liburing/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/liburing/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/liburing/CMakeLists.txt":"",
- "contrib/libs/libxml/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/libxml/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/libxml/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/libxml/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/libxml/CMakeLists.txt":"",
- "contrib/libs/libxml/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/linux-headers/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/linux-headers/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/linux-headers/CMakeLists.txt":"",
- "contrib/libs/linuxvdso/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/linuxvdso/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/linuxvdso/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/linuxvdso/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/linuxvdso/CMakeLists.txt":"",
- "contrib/libs/linuxvdso/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/linuxvdso/original/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/linuxvdso/original/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/linuxvdso/original/CMakeLists.txt":"",
- "contrib/libs/llvm12/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/CMakeLists.txt":"",
- "contrib/libs/llvm12/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/include/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/include/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/include/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/include/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/include/CMakeLists.txt":"",
- "contrib/libs/llvm12/include/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Analysis/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Analysis/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Analysis/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Analysis/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Analysis/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Analysis/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/AsmParser/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/AsmParser/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/AsmParser/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/AsmParser/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/AsmParser/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/AsmParser/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/BinaryFormat/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/BinaryFormat/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/BinaryFormat/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/BinaryFormat/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/BinaryFormat/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/BinaryFormat/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Bitcode/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Bitcode/Reader/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Bitcode/Reader/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Bitcode/Reader/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Bitcode/Reader/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Bitcode/Reader/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Bitcode/Reader/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Bitcode/Writer/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Bitcode/Writer/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Bitcode/Writer/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Bitcode/Writer/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Bitcode/Writer/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Bitcode/Writer/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Bitstream/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Bitstream/Reader/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Bitstream/Reader/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Bitstream/Reader/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Bitstream/Reader/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Bitstream/Reader/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Bitstream/Reader/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/AsmPrinter/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/AsmPrinter/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/AsmPrinter/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/AsmPrinter/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/AsmPrinter/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/AsmPrinter/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/GlobalISel/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/GlobalISel/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/GlobalISel/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/GlobalISel/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/GlobalISel/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/GlobalISel/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/SelectionDAG/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/SelectionDAG/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/SelectionDAG/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/SelectionDAG/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/SelectionDAG/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/CodeGen/SelectionDAG/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/CodeView/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/CodeView/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/CodeView/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/CodeView/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/CodeView/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/CodeView/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/DWARF/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/DWARF/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/DWARF/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/DWARF/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/DWARF/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/DWARF/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/MSF/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/MSF/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/MSF/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/MSF/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/MSF/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/MSF/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/PDB/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/PDB/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/PDB/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/PDB/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/PDB/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/PDB/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/Symbolize/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/Symbolize/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/Symbolize/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/Symbolize/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/Symbolize/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/DebugInfo/Symbolize/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Demangle/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Demangle/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Demangle/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Demangle/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Demangle/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Demangle/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/PerfJITEvents/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/PerfJITEvents/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Frontend/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Frontend/OpenMP/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Frontend/OpenMP/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Frontend/OpenMP/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Frontend/OpenMP/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Frontend/OpenMP/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Frontend/OpenMP/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/IR/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/IR/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/IR/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/IR/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/IR/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/IR/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/IRReader/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/IRReader/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/IRReader/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/IRReader/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/IRReader/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/IRReader/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Linker/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Linker/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Linker/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Linker/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Linker/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Linker/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/MC/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/MC/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/MC/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/MC/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/MC/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/MC/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/MC/MCDisassembler/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/MC/MCDisassembler/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/MC/MCDisassembler/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/MC/MCDisassembler/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/MC/MCDisassembler/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/MC/MCDisassembler/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/MC/MCParser/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/MC/MCParser/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/MC/MCParser/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/MC/MCParser/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/MC/MCParser/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/MC/MCParser/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Object/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Object/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Object/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Object/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Object/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Object/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/ProfileData/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/ProfileData/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/ProfileData/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/ProfileData/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/ProfileData/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/ProfileData/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Remarks/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Remarks/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Remarks/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Remarks/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Remarks/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Remarks/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Support/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Support/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Support/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Support/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Support/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Support/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/TableGen/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/TableGen/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/TableGen/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/TableGen/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/TableGen/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/TableGen/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Target/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Target/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Target/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/AsmParser/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/AsmParser/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/AsmParser/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/AsmParser/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/AsmParser/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/AsmParser/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/Disassembler/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/Disassembler/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/Disassembler/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/Disassembler/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/Disassembler/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/Disassembler/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/MCTargetDesc/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/MCTargetDesc/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/MCTargetDesc/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/MCTargetDesc/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/MCTargetDesc/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/MCTargetDesc/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/TargetInfo/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/TargetInfo/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/TargetInfo/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/TargetInfo/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/TargetInfo/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Target/X86/TargetInfo/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/TextAPI/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/TextAPI/MachO/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/TextAPI/MachO/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/TextAPI/MachO/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/TextAPI/MachO/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/TextAPI/MachO/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/TextAPI/MachO/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/AggressiveInstCombine/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/AggressiveInstCombine/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/AggressiveInstCombine/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/AggressiveInstCombine/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/AggressiveInstCombine/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Transforms/AggressiveInstCombine/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/CFGuard/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/CFGuard/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/CFGuard/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/CFGuard/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/CFGuard/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Transforms/CFGuard/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Transforms/IPO/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/IPO/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/IPO/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/IPO/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/IPO/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Transforms/IPO/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/InstCombine/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/InstCombine/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/InstCombine/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/InstCombine/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/InstCombine/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Transforms/InstCombine/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Instrumentation/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Instrumentation/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Instrumentation/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Instrumentation/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Instrumentation/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Instrumentation/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/ObjCARC/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/ObjCARC/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/ObjCARC/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/ObjCARC/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/ObjCARC/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Transforms/ObjCARC/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Scalar/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Scalar/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Scalar/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Scalar/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Scalar/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Scalar/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Utils/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Utils/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Utils/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Utils/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Utils/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Utils/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Vectorize/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Vectorize/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Vectorize/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Vectorize/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Vectorize/CMakeLists.txt":"",
- "contrib/libs/llvm12/lib/Transforms/Vectorize/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/utils/CMakeLists.txt":"",
- "contrib/libs/llvm12/utils/TableGen/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/utils/TableGen/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/utils/TableGen/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/utils/TableGen/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/utils/TableGen/CMakeLists.txt":"",
- "contrib/libs/llvm12/utils/TableGen/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/llvm12/utils/TableGen/GlobalISel/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/llvm12/utils/TableGen/GlobalISel/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/llvm12/utils/TableGen/GlobalISel/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/llvm12/utils/TableGen/GlobalISel/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/llvm12/utils/TableGen/GlobalISel/CMakeLists.txt":"",
- "contrib/libs/llvm12/utils/TableGen/GlobalISel/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/lua/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/lua/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/lua/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/lua/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/lua/CMakeLists.txt":"",
- "contrib/libs/lua/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/lz4/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/lz4/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/lz4/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/lz4/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/lz4/CMakeLists.txt":"",
- "contrib/libs/lz4/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/lzma/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/lzma/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/lzma/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/lzma/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/lzma/CMakeLists.txt":"",
- "contrib/libs/lzma/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/lzmasdk/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/lzmasdk/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/lzmasdk/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/lzmasdk/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/lzmasdk/CMakeLists.txt":"",
- "contrib/libs/lzmasdk/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/miniselect/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/miniselect/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/miniselect/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/miniselect/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/miniselect/CMakeLists.txt":"",
- "contrib/libs/miniselect/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/nayuki_md5/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/nayuki_md5/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/nayuki_md5/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/nayuki_md5/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/nayuki_md5/CMakeLists.txt":"",
- "contrib/libs/nayuki_md5/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/nghttp2/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/nghttp2/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/nghttp2/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/nghttp2/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/nghttp2/CMakeLists.txt":"",
- "contrib/libs/openldap/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/openldap/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/openldap/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/openldap/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/openldap/CMakeLists.txt":"",
- "contrib/libs/openldap/libraries/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/openldap/libraries/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/openldap/libraries/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/openldap/libraries/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/openldap/libraries/CMakeLists.txt":"",
- "contrib/libs/openldap/libraries/liblber/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/openldap/libraries/liblber/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/openldap/libraries/liblber/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/openldap/libraries/liblber/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/openldap/libraries/liblber/CMakeLists.txt":"",
- "contrib/libs/openssl/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/openssl/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/openssl/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/openssl/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/openssl/CMakeLists.txt":"",
- "contrib/libs/openssl/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/openssl/crypto/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/openssl/crypto/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/openssl/crypto/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/openssl/crypto/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/openssl/crypto/CMakeLists.txt":"",
- "contrib/libs/openssl/crypto/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/opentelemetry-proto/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/opentelemetry-proto/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/opentelemetry-proto/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/opentelemetry-proto/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/opentelemetry-proto/CMakeLists.txt":"",
- "contrib/libs/opentelemetry-proto/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/pcre/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/pcre/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/pcre/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/pcre/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/pcre/CMakeLists.txt":"",
- "contrib/libs/pcre/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/pcre/pcre16/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/pcre/pcre16/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/pcre/pcre16/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/pcre/pcre16/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/pcre/pcre16/CMakeLists.txt":"",
- "contrib/libs/pcre/pcre16/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/pcre/pcre32/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/pcre/pcre32/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/pcre/pcre32/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/pcre/pcre32/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/pcre/pcre32/CMakeLists.txt":"",
- "contrib/libs/pcre/pcre32/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/pdqsort/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/pdqsort/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/pdqsort/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/pdqsort/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/pdqsort/CMakeLists.txt":"",
- "contrib/libs/pfr/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/pfr/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/pfr/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/pfr/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/pfr/CMakeLists.txt":"",
- "contrib/libs/poco/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/poco/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/poco/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/poco/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/poco/CMakeLists.txt":"",
- "contrib/libs/poco/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/poco/Crypto/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/poco/Crypto/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/poco/Crypto/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/poco/Crypto/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/poco/Crypto/CMakeLists.txt":"",
- "contrib/libs/poco/Foundation/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/poco/Foundation/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/poco/Foundation/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/poco/Foundation/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/poco/Foundation/CMakeLists.txt":"",
- "contrib/libs/poco/Foundation/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/poco/JSON/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/poco/JSON/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/poco/JSON/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/poco/JSON/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/poco/JSON/CMakeLists.txt":"",
- "contrib/libs/poco/JSON/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/poco/Net/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/poco/Net/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/poco/Net/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/poco/Net/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/poco/Net/CMakeLists.txt":"",
- "contrib/libs/poco/NetSSL_OpenSSL/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/poco/NetSSL_OpenSSL/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/poco/NetSSL_OpenSSL/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/poco/NetSSL_OpenSSL/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/poco/NetSSL_OpenSSL/CMakeLists.txt":"",
- "contrib/libs/poco/Util/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/poco/Util/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/poco/Util/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/poco/Util/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/poco/Util/CMakeLists.txt":"",
- "contrib/libs/poco/Util/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/poco/XML/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/poco/XML/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/poco/XML/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/poco/XML/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/poco/XML/CMakeLists.txt":"",
- "contrib/libs/poco/XML/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/protobuf/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/protobuf/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/protobuf/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/protobuf/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/protobuf/CMakeLists.txt":"",
- "contrib/libs/protobuf/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/protoc/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/protoc/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/protoc/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/protoc/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/protoc/CMakeLists.txt":"",
- "contrib/libs/protoc/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/rapidjson/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/rapidjson/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/rapidjson/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/rapidjson/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/rapidjson/CMakeLists.txt":"",
- "contrib/libs/rapidjson/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/re2/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/re2/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/re2/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/re2/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/re2/CMakeLists.txt":"",
- "contrib/libs/re2/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/sasl/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/sasl/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/sasl/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/sasl/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/sasl/CMakeLists.txt":"",
- "contrib/libs/snappy/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/snappy/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/snappy/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/snappy/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/snappy/CMakeLists.txt":"",
- "contrib/libs/snappy/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/sparsehash/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/sparsehash/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/sparsehash/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/sparsehash/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/sparsehash/CMakeLists.txt":"",
- "contrib/libs/sparsehash/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/t1ha/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/t1ha/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/t1ha/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/t1ha/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/t1ha/CMakeLists.txt":"",
- "contrib/libs/t1ha/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/tbb/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/tbb/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/tbb/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/tbb/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/tbb/CMakeLists.txt":"",
- "contrib/libs/tbb/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/tcmalloc/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/tcmalloc/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/tcmalloc/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/tcmalloc/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/tcmalloc/CMakeLists.txt":"",
- "contrib/libs/tcmalloc/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/tcmalloc/malloc_extension/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/tcmalloc/malloc_extension/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/tcmalloc/malloc_extension/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/tcmalloc/malloc_extension/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/tcmalloc/malloc_extension/CMakeLists.txt":"",
- "contrib/libs/tcmalloc/malloc_extension/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/tcmalloc/no_percpu_cache/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/tcmalloc/no_percpu_cache/CMakeLists.txt":"",
- "contrib/libs/utf8proc/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/utf8proc/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/utf8proc/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/utf8proc/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/utf8proc/CMakeLists.txt":"",
- "contrib/libs/utf8proc/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/xxhash/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/xxhash/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/xxhash/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/xxhash/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/xxhash/CMakeLists.txt":"",
- "contrib/libs/xxhash/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/yajl/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/yajl/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/yajl/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/yajl/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/yajl/CMakeLists.txt":"",
- "contrib/libs/yajl/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/yaml-cpp/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/yaml-cpp/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/yaml-cpp/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/yaml-cpp/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/yaml-cpp/CMakeLists.txt":"",
- "contrib/libs/yaml-cpp/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/zlib/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/zlib/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/zlib/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/zlib/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/zlib/CMakeLists.txt":"",
- "contrib/libs/zlib/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/zstd/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/zstd/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/zstd/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/zstd/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/zstd/CMakeLists.txt":"",
- "contrib/libs/zstd/CMakeLists.windows-x86_64.txt":"",
- "contrib/libs/zstd06/CMakeLists.darwin-arm64.txt":"",
- "contrib/libs/zstd06/CMakeLists.darwin-x86_64.txt":"",
- "contrib/libs/zstd06/CMakeLists.linux-aarch64.txt":"",
- "contrib/libs/zstd06/CMakeLists.linux-x86_64.txt":"",
- "contrib/libs/zstd06/CMakeLists.txt":"",
- "contrib/libs/zstd06/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/CMakeLists.txt":"",
- "contrib/restricted/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/base/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/base/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/base/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/base/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/base/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/base/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/container/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/container/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/container/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/container/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/container/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/container/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/debugging/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/debugging/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/debugging/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/debugging/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/debugging/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/debugging/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/flags/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/flags/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/flags/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/flags/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/flags/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/flags/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/functional/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/functional/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/functional/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/functional/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/functional/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/functional/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/hash/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/hash/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/hash/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/hash/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/hash/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/hash/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/memory/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/memory/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/memory/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/memory/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/memory/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/memory/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/meta/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/meta/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/meta/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/meta/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/meta/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/meta/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/numeric/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/numeric/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/numeric/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/numeric/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/numeric/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/numeric/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/profiling/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/profiling/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/profiling/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/profiling/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/profiling/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/profiling/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/random/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/random/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/random/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/random/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/random/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/random/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/status/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/status/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/status/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/status/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/status/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/status/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/strings/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/strings/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/strings/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/strings/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/strings/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/strings/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/time/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/time/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/time/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/time/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/time/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/time/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/types/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/types/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/types/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/types/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/types/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/types/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/utility/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/utility/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/utility/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/utility/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/utility/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp-tstring/y_absl/utility/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/algorithm/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/algorithm/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/algorithm/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/algorithm/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/algorithm/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/algorithm/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/base/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/base/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/base/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/base/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/base/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/base/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/container/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/container/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/container/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/container/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/container/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/container/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/debugging/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/debugging/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/debugging/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/debugging/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/debugging/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/debugging/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/flags/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/flags/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/flags/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/flags/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/flags/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/flags/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/functional/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/functional/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/functional/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/functional/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/functional/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/functional/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/hash/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/hash/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/hash/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/hash/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/hash/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/hash/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/log/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/log/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/log/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/log/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/log/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/log/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/memory/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/memory/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/memory/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/memory/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/memory/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/memory/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/meta/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/meta/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/meta/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/meta/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/meta/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/meta/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/numeric/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/numeric/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/numeric/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/numeric/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/numeric/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/numeric/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/profiling/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/profiling/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/profiling/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/profiling/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/profiling/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/profiling/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/random/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/random/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/random/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/random/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/random/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/random/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/status/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/status/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/status/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/status/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/status/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/status/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/strings/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/strings/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/strings/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/strings/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/strings/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/strings/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/synchronization/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/synchronization/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/synchronization/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/synchronization/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/synchronization/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/synchronization/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/time/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/time/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/time/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/time/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/time/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/time/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/types/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/types/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/types/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/types/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/types/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/types/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/utility/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/abseil-cpp/absl/utility/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/utility/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/abseil-cpp/absl/utility/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/abseil-cpp/absl/utility/CMakeLists.txt":"",
- "contrib/restricted/abseil-cpp/absl/utility/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/CMakeLists.txt":"",
- "contrib/restricted/aws/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-auth/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/aws-c-auth/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-auth/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/aws-c-auth/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-auth/CMakeLists.txt":"",
- "contrib/restricted/aws/aws-c-auth/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-cal/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/aws-c-cal/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-cal/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/aws-c-cal/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-cal/CMakeLists.txt":"",
- "contrib/restricted/aws/aws-c-cal/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-common/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/aws-c-common/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-common/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/aws-c-common/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-common/CMakeLists.txt":"",
- "contrib/restricted/aws/aws-c-common/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-compression/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/aws-c-compression/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-compression/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/aws-c-compression/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-compression/CMakeLists.txt":"",
- "contrib/restricted/aws/aws-c-compression/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-event-stream/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/aws-c-event-stream/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-event-stream/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/aws-c-event-stream/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-event-stream/CMakeLists.txt":"",
- "contrib/restricted/aws/aws-c-event-stream/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-http/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/aws-c-http/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-http/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/aws-c-http/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-http/CMakeLists.txt":"",
- "contrib/restricted/aws/aws-c-http/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-io/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/aws-c-io/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-io/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/aws-c-io/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-io/CMakeLists.txt":"",
- "contrib/restricted/aws/aws-c-io/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-mqtt/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/aws-c-mqtt/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-mqtt/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/aws-c-mqtt/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-mqtt/CMakeLists.txt":"",
- "contrib/restricted/aws/aws-c-mqtt/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-s3/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/aws-c-s3/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-s3/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/aws-c-s3/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-s3/CMakeLists.txt":"",
- "contrib/restricted/aws/aws-c-s3/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-sdkutils/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/aws-c-sdkutils/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-sdkutils/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/aws-c-sdkutils/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/aws-c-sdkutils/CMakeLists.txt":"",
- "contrib/restricted/aws/aws-c-sdkutils/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/aws-checksums/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/aws-checksums/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/aws-checksums/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/aws-checksums/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/aws-checksums/CMakeLists.txt":"",
- "contrib/restricted/aws/aws-checksums/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/aws-crt-cpp/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/aws-crt-cpp/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/aws-crt-cpp/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/aws-crt-cpp/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/aws-crt-cpp/CMakeLists.txt":"",
- "contrib/restricted/aws/aws-crt-cpp/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/aws/s2n/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/aws/s2n/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/aws/s2n/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/aws/s2n/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/aws/s2n/CMakeLists.txt":"",
- "contrib/restricted/boost/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/CMakeLists.txt":"",
- "contrib/restricted/boost/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/algorithm/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/algorithm/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/algorithm/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/algorithm/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/algorithm/CMakeLists.txt":"",
- "contrib/restricted/boost/algorithm/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/align/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/align/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/align/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/align/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/align/CMakeLists.txt":"",
- "contrib/restricted/boost/align/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/any/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/any/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/any/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/any/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/any/CMakeLists.txt":"",
- "contrib/restricted/boost/any/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/array/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/array/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/array/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/array/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/array/CMakeLists.txt":"",
- "contrib/restricted/boost/array/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/asio/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/asio/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/asio/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/asio/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/asio/CMakeLists.txt":"",
- "contrib/restricted/boost/assert/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/assert/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/assert/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/assert/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/assert/CMakeLists.txt":"",
- "contrib/restricted/boost/assert/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/atomic/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/atomic/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/atomic/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/atomic/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/atomic/CMakeLists.txt":"",
- "contrib/restricted/boost/atomic/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/bimap/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/bimap/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/bimap/CMakeLists.txt":"",
- "contrib/restricted/boost/bimap/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/bind/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/bind/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/bind/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/bind/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/bind/CMakeLists.txt":"",
- "contrib/restricted/boost/bind/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/chrono/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/chrono/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/chrono/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/chrono/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/chrono/CMakeLists.txt":"",
- "contrib/restricted/boost/chrono/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/concept_check/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/concept_check/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/concept_check/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/concept_check/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/concept_check/CMakeLists.txt":"",
- "contrib/restricted/boost/concept_check/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/config/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/config/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/config/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/config/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/config/CMakeLists.txt":"",
- "contrib/restricted/boost/config/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/container/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/container/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/container/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/container/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/container/CMakeLists.txt":"",
- "contrib/restricted/boost/container/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/container_hash/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/container_hash/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/container_hash/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/container_hash/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/container_hash/CMakeLists.txt":"",
- "contrib/restricted/boost/container_hash/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/context/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/context/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/context/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/context/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/context/CMakeLists.txt":"",
- "contrib/restricted/boost/context/fcontext_impl/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/context/fcontext_impl/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/context/fcontext_impl/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/context/fcontext_impl/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/context/fcontext_impl/CMakeLists.txt":"",
- "contrib/restricted/boost/context/impl_common/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/context/impl_common/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/context/impl_common/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/context/impl_common/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/context/impl_common/CMakeLists.txt":"",
- "contrib/restricted/boost/conversion/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/conversion/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/conversion/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/conversion/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/conversion/CMakeLists.txt":"",
- "contrib/restricted/boost/conversion/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/core/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/core/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/core/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/core/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/core/CMakeLists.txt":"",
- "contrib/restricted/boost/core/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/coroutine/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/coroutine/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/coroutine/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/coroutine/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/coroutine/CMakeLists.txt":"",
- "contrib/restricted/boost/crc/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/crc/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/crc/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/crc/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/crc/CMakeLists.txt":"",
- "contrib/restricted/boost/date_time/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/date_time/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/date_time/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/date_time/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/date_time/CMakeLists.txt":"",
- "contrib/restricted/boost/date_time/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/describe/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/describe/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/describe/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/describe/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/describe/CMakeLists.txt":"",
- "contrib/restricted/boost/describe/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/detail/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/detail/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/detail/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/detail/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/detail/CMakeLists.txt":"",
- "contrib/restricted/boost/detail/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/dynamic_bitset/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/dynamic_bitset/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/dynamic_bitset/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/dynamic_bitset/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/dynamic_bitset/CMakeLists.txt":"",
- "contrib/restricted/boost/dynamic_bitset/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/endian/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/endian/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/endian/CMakeLists.txt":"",
- "contrib/restricted/boost/endian/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/exception/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/exception/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/exception/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/exception/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/exception/CMakeLists.txt":"",
- "contrib/restricted/boost/exception/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/foreach/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/foreach/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/foreach/CMakeLists.txt":"",
- "contrib/restricted/boost/foreach/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/format/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/format/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/format/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/format/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/format/CMakeLists.txt":"",
- "contrib/restricted/boost/format/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/function/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/function/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/function/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/function/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/function/CMakeLists.txt":"",
- "contrib/restricted/boost/function/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/function_types/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/function_types/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/function_types/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/function_types/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/function_types/CMakeLists.txt":"",
- "contrib/restricted/boost/function_types/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/functional/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/functional/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/functional/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/functional/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/functional/CMakeLists.txt":"",
- "contrib/restricted/boost/functional/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/fusion/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/fusion/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/fusion/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/fusion/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/fusion/CMakeLists.txt":"",
- "contrib/restricted/boost/fusion/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/graph/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/graph/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/graph/CMakeLists.txt":"",
- "contrib/restricted/boost/graph/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/icl/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/icl/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/icl/CMakeLists.txt":"",
- "contrib/restricted/boost/icl/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/integer/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/integer/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/integer/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/integer/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/integer/CMakeLists.txt":"",
- "contrib/restricted/boost/integer/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/interprocess/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/interprocess/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/interprocess/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/interprocess/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/interprocess/CMakeLists.txt":"",
- "contrib/restricted/boost/interprocess/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/intrusive/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/intrusive/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/intrusive/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/intrusive/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/intrusive/CMakeLists.txt":"",
- "contrib/restricted/boost/intrusive/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/io/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/io/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/io/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/io/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/io/CMakeLists.txt":"",
- "contrib/restricted/boost/io/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/iostreams/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/iostreams/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/iostreams/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/iostreams/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/iostreams/CMakeLists.txt":"",
- "contrib/restricted/boost/iterator/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/iterator/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/iterator/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/iterator/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/iterator/CMakeLists.txt":"",
- "contrib/restricted/boost/iterator/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/lambda/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/lambda/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/lambda/CMakeLists.txt":"",
- "contrib/restricted/boost/lambda/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/lexical_cast/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/lexical_cast/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/lexical_cast/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/lexical_cast/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/lexical_cast/CMakeLists.txt":"",
- "contrib/restricted/boost/lexical_cast/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/locale/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/locale/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/locale/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/locale/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/locale/CMakeLists.txt":"",
- "contrib/restricted/boost/locale/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/math/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/math/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/math/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/math/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/math/CMakeLists.txt":"",
- "contrib/restricted/boost/math/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/move/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/move/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/move/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/move/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/move/CMakeLists.txt":"",
- "contrib/restricted/boost/move/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/mp11/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/mp11/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/mp11/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/mp11/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/mp11/CMakeLists.txt":"",
- "contrib/restricted/boost/mp11/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/mpl/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/mpl/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/mpl/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/mpl/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/mpl/CMakeLists.txt":"",
- "contrib/restricted/boost/mpl/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/multi_array/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/multi_array/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/multi_array/CMakeLists.txt":"",
- "contrib/restricted/boost/multi_array/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/multi_index/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/multi_index/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/multi_index/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/multi_index/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/multi_index/CMakeLists.txt":"",
- "contrib/restricted/boost/multi_index/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/numeric_conversion/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/numeric_conversion/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/numeric_conversion/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/numeric_conversion/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/numeric_conversion/CMakeLists.txt":"",
- "contrib/restricted/boost/numeric_conversion/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/optional/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/optional/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/optional/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/optional/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/optional/CMakeLists.txt":"",
- "contrib/restricted/boost/optional/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/parameter/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/parameter/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/parameter/CMakeLists.txt":"",
- "contrib/restricted/boost/parameter/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/phoenix/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/phoenix/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/phoenix/CMakeLists.txt":"",
- "contrib/restricted/boost/phoenix/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/pool/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/pool/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/pool/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/pool/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/pool/CMakeLists.txt":"",
- "contrib/restricted/boost/pool/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/predef/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/predef/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/predef/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/predef/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/predef/CMakeLists.txt":"",
- "contrib/restricted/boost/predef/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/preprocessor/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/preprocessor/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/preprocessor/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/preprocessor/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/preprocessor/CMakeLists.txt":"",
- "contrib/restricted/boost/preprocessor/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/program_options/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/program_options/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/program_options/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/program_options/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/program_options/CMakeLists.txt":"",
- "contrib/restricted/boost/property_map/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/property_map/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/property_map/CMakeLists.txt":"",
- "contrib/restricted/boost/property_map/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/property_tree/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/property_tree/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/property_tree/CMakeLists.txt":"",
- "contrib/restricted/boost/property_tree/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/proto/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/proto/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/proto/CMakeLists.txt":"",
- "contrib/restricted/boost/proto/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/random/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/random/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/random/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/random/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/random/CMakeLists.txt":"",
- "contrib/restricted/boost/random/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/range/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/range/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/range/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/range/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/range/CMakeLists.txt":"",
- "contrib/restricted/boost/range/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/ratio/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/ratio/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/ratio/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/ratio/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/ratio/CMakeLists.txt":"",
- "contrib/restricted/boost/ratio/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/rational/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/rational/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/rational/CMakeLists.txt":"",
- "contrib/restricted/boost/rational/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/regex/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/regex/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/regex/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/regex/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/regex/CMakeLists.txt":"",
- "contrib/restricted/boost/regex/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/scope_exit/CMakeLists.txt":"",
- "contrib/restricted/boost/scope_exit/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/serialization/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/serialization/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/serialization/CMakeLists.txt":"",
- "contrib/restricted/boost/serialization/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/smart_ptr/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/smart_ptr/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/smart_ptr/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/smart_ptr/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/smart_ptr/CMakeLists.txt":"",
- "contrib/restricted/boost/smart_ptr/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/spirit/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/spirit/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/spirit/CMakeLists.txt":"",
- "contrib/restricted/boost/spirit/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/static_assert/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/static_assert/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/static_assert/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/static_assert/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/static_assert/CMakeLists.txt":"",
- "contrib/restricted/boost/static_assert/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/system/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/system/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/system/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/system/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/system/CMakeLists.txt":"",
- "contrib/restricted/boost/system/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/thread/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/thread/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/thread/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/thread/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/thread/CMakeLists.txt":"",
- "contrib/restricted/boost/thread/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/throw_exception/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/throw_exception/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/throw_exception/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/throw_exception/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/throw_exception/CMakeLists.txt":"",
- "contrib/restricted/boost/throw_exception/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/tokenizer/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/tokenizer/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/tokenizer/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/tokenizer/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/tokenizer/CMakeLists.txt":"",
- "contrib/restricted/boost/tokenizer/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/tti/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/tti/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/tti/CMakeLists.txt":"",
- "contrib/restricted/boost/tti/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/tuple/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/tuple/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/tuple/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/tuple/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/tuple/CMakeLists.txt":"",
- "contrib/restricted/boost/tuple/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/type_index/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/type_index/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/type_index/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/type_index/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/type_index/CMakeLists.txt":"",
- "contrib/restricted/boost/type_index/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/type_traits/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/type_traits/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/type_traits/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/type_traits/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/type_traits/CMakeLists.txt":"",
- "contrib/restricted/boost/type_traits/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/typeof/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/typeof/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/typeof/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/typeof/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/typeof/CMakeLists.txt":"",
- "contrib/restricted/boost/typeof/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/unordered/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/unordered/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/unordered/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/unordered/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/unordered/CMakeLists.txt":"",
- "contrib/restricted/boost/unordered/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/utility/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/utility/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/utility/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/utility/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/utility/CMakeLists.txt":"",
- "contrib/restricted/boost/utility/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/variant/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/variant/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/variant/CMakeLists.txt":"",
- "contrib/restricted/boost/variant/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/variant2/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/variant2/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/variant2/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/variant2/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/variant2/CMakeLists.txt":"",
- "contrib/restricted/boost/variant2/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/winapi/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/boost/winapi/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/winapi/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/boost/winapi/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/winapi/CMakeLists.txt":"",
- "contrib/restricted/boost/winapi/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/boost/xpressive/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/boost/xpressive/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/boost/xpressive/CMakeLists.txt":"",
- "contrib/restricted/boost/xpressive/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/cityhash-1.0.2/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/cityhash-1.0.2/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/cityhash-1.0.2/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/cityhash-1.0.2/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/cityhash-1.0.2/CMakeLists.txt":"",
- "contrib/restricted/cityhash-1.0.2/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/dragonbox/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/dragonbox/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/dragonbox/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/dragonbox/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/dragonbox/CMakeLists.txt":"",
- "contrib/restricted/fast_float/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/fast_float/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/fast_float/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/fast_float/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/fast_float/CMakeLists.txt":"",
- "contrib/restricted/fast_float/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/google/CMakeLists.txt":"",
- "contrib/restricted/google/benchmark/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/google/benchmark/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/google/benchmark/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/google/benchmark/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/google/benchmark/CMakeLists.txt":"",
- "contrib/restricted/google/benchmark/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/googletest/CMakeLists.txt":"",
- "contrib/restricted/googletest/googlemock/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/googletest/googlemock/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/googletest/googlemock/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/googletest/googlemock/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/googletest/googlemock/CMakeLists.txt":"",
- "contrib/restricted/googletest/googlemock/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/googletest/googletest/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/googletest/googletest/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/googletest/googletest/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/googletest/googletest/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/googletest/googletest/CMakeLists.txt":"",
- "contrib/restricted/googletest/googletest/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/http-parser/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/http-parser/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/http-parser/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/http-parser/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/http-parser/CMakeLists.txt":"",
- "contrib/restricted/http-parser/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/nlohmann_json/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/nlohmann_json/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/nlohmann_json/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/nlohmann_json/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/nlohmann_json/CMakeLists.txt":"",
- "contrib/restricted/nlohmann_json/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/patched/CMakeLists.txt":"",
- "contrib/restricted/patched/replxx/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/patched/replxx/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/patched/replxx/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/patched/replxx/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/patched/replxx/CMakeLists.txt":"",
- "contrib/restricted/patched/replxx/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/thrift/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/thrift/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/thrift/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/thrift/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/thrift/CMakeLists.txt":"",
- "contrib/restricted/thrift/CMakeLists.windows-x86_64.txt":"",
- "contrib/restricted/uriparser/CMakeLists.darwin-arm64.txt":"",
- "contrib/restricted/uriparser/CMakeLists.darwin-x86_64.txt":"",
- "contrib/restricted/uriparser/CMakeLists.linux-aarch64.txt":"",
- "contrib/restricted/uriparser/CMakeLists.linux-x86_64.txt":"",
- "contrib/restricted/uriparser/CMakeLists.txt":"",
- "contrib/restricted/uriparser/CMakeLists.windows-x86_64.txt":"",
- "contrib/tools/CMakeLists.txt":"",
- "contrib/tools/bison/CMakeLists.txt":"",
- "contrib/tools/bison/bison/CMakeLists.txt":"",
- "contrib/tools/bison/bison/induced/CMakeLists.darwin-arm64.txt":"",
- "contrib/tools/bison/bison/induced/CMakeLists.darwin-x86_64.txt":"",
- "contrib/tools/bison/bison/induced/CMakeLists.linux-aarch64.txt":"",
- "contrib/tools/bison/bison/induced/CMakeLists.linux-x86_64.txt":"",
- "contrib/tools/bison/bison/induced/CMakeLists.txt":"",
- "contrib/tools/bison/bison/induced/CMakeLists.windows-x86_64.txt":"",
- "contrib/tools/flatc/CMakeLists.txt":"",
- "contrib/tools/flatc/bin/CMakeLists.darwin-arm64.txt":"",
- "contrib/tools/flatc/bin/CMakeLists.darwin-x86_64.txt":"",
- "contrib/tools/flatc/bin/CMakeLists.linux-aarch64.txt":"",
- "contrib/tools/flatc/bin/CMakeLists.linux-x86_64.txt":"",
- "contrib/tools/flatc/bin/CMakeLists.txt":"",
- "contrib/tools/flatc/bin/CMakeLists.windows-x86_64.txt":"",
- "contrib/tools/protoc/CMakeLists.txt":"",
- "contrib/tools/protoc/bin/CMakeLists.darwin-arm64.txt":"",
- "contrib/tools/protoc/bin/CMakeLists.darwin-x86_64.txt":"",
- "contrib/tools/protoc/bin/CMakeLists.linux-aarch64.txt":"",
- "contrib/tools/protoc/bin/CMakeLists.linux-x86_64.txt":"",
- "contrib/tools/protoc/bin/CMakeLists.txt":"",
- "contrib/tools/protoc/bin/CMakeLists.windows-x86_64.txt":"",
- "contrib/tools/protoc/plugins/CMakeLists.txt":"",
- "contrib/tools/protoc/plugins/cpp_styleguide/CMakeLists.darwin-arm64.txt":"",
- "contrib/tools/protoc/plugins/cpp_styleguide/CMakeLists.darwin-x86_64.txt":"",
- "contrib/tools/protoc/plugins/cpp_styleguide/CMakeLists.linux-aarch64.txt":"",
- "contrib/tools/protoc/plugins/cpp_styleguide/CMakeLists.linux-x86_64.txt":"",
- "contrib/tools/protoc/plugins/cpp_styleguide/CMakeLists.txt":"",
- "contrib/tools/protoc/plugins/cpp_styleguide/CMakeLists.windows-x86_64.txt":"",
- "contrib/tools/protoc/plugins/grpc_cpp/CMakeLists.darwin-arm64.txt":"",
- "contrib/tools/protoc/plugins/grpc_cpp/CMakeLists.darwin-x86_64.txt":"",
- "contrib/tools/protoc/plugins/grpc_cpp/CMakeLists.linux-aarch64.txt":"",
- "contrib/tools/protoc/plugins/grpc_cpp/CMakeLists.linux-x86_64.txt":"",
- "contrib/tools/protoc/plugins/grpc_cpp/CMakeLists.txt":"",
- "contrib/tools/protoc/plugins/grpc_cpp/CMakeLists.windows-x86_64.txt":"",
- "generate_cmake":"ydb/github_toplevel/generate_cmake",
- "go.mod":"ydb/github_toplevel/go.mod",
- "go.sum":"ydb/github_toplevel/go.sum",
- "library/CMakeLists.txt":"",
- "library/cpp/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/CMakeLists.txt":"",
- "library/cpp/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/accurate_accumulate/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/accurate_accumulate/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/accurate_accumulate/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/accurate_accumulate/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/accurate_accumulate/CMakeLists.txt":"",
- "library/cpp/accurate_accumulate/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/archive/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/archive/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/archive/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/archive/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/archive/CMakeLists.txt":"",
- "library/cpp/archive/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/balloc/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/balloc/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/balloc/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/balloc/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/balloc/CMakeLists.txt":"",
- "library/cpp/balloc/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/balloc/lib/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/balloc/lib/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/balloc/lib/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/balloc/lib/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/balloc/lib/CMakeLists.txt":"",
- "library/cpp/balloc/setup/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/balloc/setup/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/balloc/setup/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/balloc/setup/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/balloc/setup/CMakeLists.txt":"",
- "library/cpp/binsaver/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/binsaver/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/binsaver/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/binsaver/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/binsaver/CMakeLists.txt":"",
- "library/cpp/binsaver/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/bit_io/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/bit_io/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/bit_io/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/bit_io/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/bit_io/CMakeLists.txt":"",
- "library/cpp/bit_io/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/blockcodecs/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/blockcodecs/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/blockcodecs/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/blockcodecs/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/blockcodecs/CMakeLists.txt":"",
- "library/cpp/blockcodecs/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/CMakeLists.txt":"",
- "library/cpp/blockcodecs/codecs/brotli/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/blockcodecs/codecs/brotli/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/brotli/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/blockcodecs/codecs/brotli/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/brotli/CMakeLists.txt":"",
- "library/cpp/blockcodecs/codecs/brotli/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/bzip/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/blockcodecs/codecs/bzip/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/bzip/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/blockcodecs/codecs/bzip/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/bzip/CMakeLists.txt":"",
- "library/cpp/blockcodecs/codecs/bzip/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/fastlz/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/blockcodecs/codecs/fastlz/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/fastlz/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/blockcodecs/codecs/fastlz/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/fastlz/CMakeLists.txt":"",
- "library/cpp/blockcodecs/codecs/fastlz/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/legacy_zstd06/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/blockcodecs/codecs/legacy_zstd06/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/legacy_zstd06/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/blockcodecs/codecs/legacy_zstd06/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/legacy_zstd06/CMakeLists.txt":"",
- "library/cpp/blockcodecs/codecs/legacy_zstd06/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/lz4/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/blockcodecs/codecs/lz4/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/lz4/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/blockcodecs/codecs/lz4/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/lz4/CMakeLists.txt":"",
- "library/cpp/blockcodecs/codecs/lz4/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/lzma/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/blockcodecs/codecs/lzma/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/lzma/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/blockcodecs/codecs/lzma/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/lzma/CMakeLists.txt":"",
- "library/cpp/blockcodecs/codecs/lzma/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/snappy/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/blockcodecs/codecs/snappy/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/snappy/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/blockcodecs/codecs/snappy/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/snappy/CMakeLists.txt":"",
- "library/cpp/blockcodecs/codecs/snappy/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/zlib/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/blockcodecs/codecs/zlib/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/zlib/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/blockcodecs/codecs/zlib/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/zlib/CMakeLists.txt":"",
- "library/cpp/blockcodecs/codecs/zlib/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/zstd/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/blockcodecs/codecs/zstd/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/zstd/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/blockcodecs/codecs/zstd/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/blockcodecs/codecs/zstd/CMakeLists.txt":"",
- "library/cpp/blockcodecs/codecs/zstd/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/blockcodecs/core/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/blockcodecs/core/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/blockcodecs/core/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/blockcodecs/core/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/blockcodecs/core/CMakeLists.txt":"",
- "library/cpp/blockcodecs/core/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/bucket_quoter/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/bucket_quoter/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/bucket_quoter/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/bucket_quoter/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/bucket_quoter/CMakeLists.txt":"",
- "library/cpp/bucket_quoter/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/build_info/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/build_info/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/build_info/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/build_info/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/build_info/CMakeLists.txt":"",
- "library/cpp/build_info/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/cache/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/cache/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/cache/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/cache/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/cache/CMakeLists.txt":"",
- "library/cpp/cache/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/case_insensitive_string/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/case_insensitive_string/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/case_insensitive_string/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/case_insensitive_string/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/case_insensitive_string/CMakeLists.txt":"",
- "library/cpp/case_insensitive_string/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/cgiparam/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/cgiparam/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/cgiparam/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/cgiparam/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/cgiparam/CMakeLists.txt":"",
- "library/cpp/cgiparam/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/charset/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/charset/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/charset/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/charset/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/charset/CMakeLists.txt":"",
- "library/cpp/charset/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/charset/lite/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/charset/lite/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/charset/lite/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/charset/lite/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/charset/lite/CMakeLists.txt":"",
- "library/cpp/charset/lite/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/clickhouse/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/clickhouse/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/clickhouse/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/clickhouse/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/clickhouse/CMakeLists.txt":"",
- "library/cpp/clickhouse/client/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/clickhouse/client/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/clickhouse/client/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/clickhouse/client/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/clickhouse/client/CMakeLists.txt":"",
- "library/cpp/clickhouse/client/base/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/clickhouse/client/base/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/clickhouse/client/base/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/clickhouse/client/base/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/clickhouse/client/base/CMakeLists.txt":"",
- "library/cpp/clickhouse/client/columns/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/clickhouse/client/columns/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/clickhouse/client/columns/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/clickhouse/client/columns/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/clickhouse/client/columns/CMakeLists.txt":"",
- "library/cpp/clickhouse/client/types/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/clickhouse/client/types/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/clickhouse/client/types/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/clickhouse/client/types/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/clickhouse/client/types/CMakeLists.txt":"",
- "library/cpp/codecs/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/codecs/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/codecs/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/codecs/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/codecs/CMakeLists.txt":"",
- "library/cpp/codecs/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/codecs/greedy_dict/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/codecs/greedy_dict/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/codecs/greedy_dict/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/codecs/greedy_dict/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/codecs/greedy_dict/CMakeLists.txt":"",
- "library/cpp/codecs/greedy_dict/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/colorizer/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/colorizer/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/colorizer/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/colorizer/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/colorizer/CMakeLists.txt":"",
- "library/cpp/colorizer/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/compproto/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/compproto/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/compproto/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/compproto/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/compproto/CMakeLists.txt":"",
- "library/cpp/compproto/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/comptable/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/comptable/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/comptable/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/comptable/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/comptable/CMakeLists.txt":"",
- "library/cpp/comptable/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/config/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/config/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/config/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/config/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/config/CMakeLists.txt":"",
- "library/cpp/config/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/2d_array/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/2d_array/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/2d_array/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/2d_array/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/2d_array/CMakeLists.txt":"",
- "library/cpp/containers/2d_array/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/CMakeLists.txt":"",
- "library/cpp/containers/absl_flat_hash/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/absl_flat_hash/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/absl_flat_hash/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/absl_flat_hash/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/absl_flat_hash/CMakeLists.txt":"",
- "library/cpp/containers/absl_flat_hash/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/atomizer/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/atomizer/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/atomizer/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/atomizer/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/atomizer/CMakeLists.txt":"",
- "library/cpp/containers/atomizer/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/bitseq/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/bitseq/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/bitseq/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/bitseq/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/bitseq/CMakeLists.txt":"",
- "library/cpp/containers/bitseq/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/compact_vector/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/compact_vector/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/compact_vector/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/compact_vector/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/compact_vector/CMakeLists.txt":"",
- "library/cpp/containers/compact_vector/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/comptrie/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/comptrie/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/comptrie/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/comptrie/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/comptrie/CMakeLists.txt":"",
- "library/cpp/containers/comptrie/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/disjoint_interval_tree/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/disjoint_interval_tree/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/disjoint_interval_tree/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/disjoint_interval_tree/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/disjoint_interval_tree/CMakeLists.txt":"",
- "library/cpp/containers/disjoint_interval_tree/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/intrusive_avl_tree/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/intrusive_avl_tree/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/intrusive_avl_tree/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/intrusive_avl_tree/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/intrusive_avl_tree/CMakeLists.txt":"",
- "library/cpp/containers/intrusive_avl_tree/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/intrusive_rb_tree/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/intrusive_rb_tree/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/intrusive_rb_tree/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/intrusive_rb_tree/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/intrusive_rb_tree/CMakeLists.txt":"",
- "library/cpp/containers/intrusive_rb_tree/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/paged_vector/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/paged_vector/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/paged_vector/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/paged_vector/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/paged_vector/CMakeLists.txt":"",
- "library/cpp/containers/paged_vector/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/ring_buffer/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/ring_buffer/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/ring_buffer/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/ring_buffer/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/ring_buffer/CMakeLists.txt":"",
- "library/cpp/containers/ring_buffer/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/sorted_vector/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/sorted_vector/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/sorted_vector/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/sorted_vector/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/sorted_vector/CMakeLists.txt":"",
- "library/cpp/containers/sorted_vector/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/stack_array/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/stack_array/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/stack_array/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/stack_array/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/stack_array/CMakeLists.txt":"",
- "library/cpp/containers/stack_array/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/stack_vector/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/stack_vector/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/stack_vector/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/stack_vector/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/stack_vector/CMakeLists.txt":"",
- "library/cpp/containers/stack_vector/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/str_map/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/str_map/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/str_map/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/str_map/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/str_map/CMakeLists.txt":"",
- "library/cpp/containers/str_map/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/containers/top_keeper/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/containers/top_keeper/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/containers/top_keeper/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/containers/top_keeper/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/containers/top_keeper/CMakeLists.txt":"",
- "library/cpp/containers/top_keeper/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/coroutine/CMakeLists.txt":"",
- "library/cpp/coroutine/engine/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/coroutine/engine/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/coroutine/engine/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/coroutine/engine/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/coroutine/engine/CMakeLists.txt":"",
- "library/cpp/coroutine/engine/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/coroutine/listener/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/coroutine/listener/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/coroutine/listener/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/coroutine/listener/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/coroutine/listener/CMakeLists.txt":"",
- "library/cpp/coroutine/listener/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/cppparser/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/cppparser/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/cppparser/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/cppparser/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/cppparser/CMakeLists.txt":"",
- "library/cpp/cppparser/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/cpuid_check/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/cpuid_check/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/cpuid_check/CMakeLists.txt":"",
- "library/cpp/cpuid_check/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/dbg_output/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/dbg_output/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/dbg_output/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/dbg_output/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/dbg_output/CMakeLists.txt":"",
- "library/cpp/dbg_output/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/deprecated/CMakeLists.txt":"",
- "library/cpp/deprecated/accessors/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/deprecated/accessors/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/deprecated/accessors/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/deprecated/accessors/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/deprecated/accessors/CMakeLists.txt":"",
- "library/cpp/deprecated/accessors/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/deprecated/atomic/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/deprecated/atomic/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/deprecated/atomic/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/deprecated/atomic/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/deprecated/atomic/CMakeLists.txt":"",
- "library/cpp/deprecated/atomic/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/deprecated/enum_codegen/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/deprecated/enum_codegen/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/deprecated/enum_codegen/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/deprecated/enum_codegen/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/deprecated/enum_codegen/CMakeLists.txt":"",
- "library/cpp/deprecated/enum_codegen/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/deprecated/kmp/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/deprecated/kmp/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/deprecated/kmp/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/deprecated/kmp/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/deprecated/kmp/CMakeLists.txt":"",
- "library/cpp/deprecated/kmp/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/deprecated/split/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/deprecated/split/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/deprecated/split/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/deprecated/split/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/deprecated/split/CMakeLists.txt":"",
- "library/cpp/deprecated/split/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/diff/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/diff/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/diff/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/diff/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/diff/CMakeLists.txt":"",
- "library/cpp/diff/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/CMakeLists.txt":"",
- "library/cpp/digest/argonish/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/argonish/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/argonish/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/argonish/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/argonish/CMakeLists.txt":"",
- "library/cpp/digest/argonish/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/CMakeLists.txt":"",
- "library/cpp/digest/argonish/internal/argon2/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/argonish/internal/argon2/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/argon2/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/argonish/internal/argon2/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/argon2/CMakeLists.txt":"",
- "library/cpp/digest/argonish/internal/argon2/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/blake2b/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/argonish/internal/blake2b/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/blake2b/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/argonish/internal/blake2b/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/blake2b/CMakeLists.txt":"",
- "library/cpp/digest/argonish/internal/blake2b/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/blamka/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/argonish/internal/blamka/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/blamka/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/argonish/internal/blamka/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/blamka/CMakeLists.txt":"",
- "library/cpp/digest/argonish/internal/blamka/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/CMakeLists.txt":"",
- "library/cpp/digest/argonish/internal/proxies/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/avx2/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/avx2/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/avx2/CMakeLists.txt":"",
- "library/cpp/digest/argonish/internal/proxies/avx2/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/macro/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/macro/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/macro/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/macro/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/macro/CMakeLists.txt":"",
- "library/cpp/digest/argonish/internal/proxies/macro/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/ref/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/ref/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/ref/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/ref/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/ref/CMakeLists.txt":"",
- "library/cpp/digest/argonish/internal/proxies/ref/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/sse2/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/sse2/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/sse2/CMakeLists.txt":"",
- "library/cpp/digest/argonish/internal/proxies/sse2/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/sse41/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/sse41/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/sse41/CMakeLists.txt":"",
- "library/cpp/digest/argonish/internal/proxies/sse41/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/ssse3/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/ssse3/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/proxies/ssse3/CMakeLists.txt":"",
- "library/cpp/digest/argonish/internal/proxies/ssse3/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/rotations/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/argonish/internal/rotations/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/rotations/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/argonish/internal/rotations/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/argonish/internal/rotations/CMakeLists.txt":"",
- "library/cpp/digest/argonish/internal/rotations/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/crc32c/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/crc32c/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/crc32c/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/crc32c/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/crc32c/CMakeLists.txt":"",
- "library/cpp/digest/crc32c/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/lower_case/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/lower_case/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/lower_case/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/lower_case/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/lower_case/CMakeLists.txt":"",
- "library/cpp/digest/lower_case/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/md5/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/md5/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/md5/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/md5/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/md5/CMakeLists.txt":"",
- "library/cpp/digest/md5/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/murmur/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/murmur/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/murmur/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/murmur/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/murmur/CMakeLists.txt":"",
- "library/cpp/digest/murmur/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/old_crc/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/old_crc/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/old_crc/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/old_crc/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/old_crc/CMakeLists.txt":"",
- "library/cpp/digest/old_crc/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/old_crc/gencrc/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/old_crc/gencrc/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/old_crc/gencrc/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/old_crc/gencrc/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/old_crc/gencrc/CMakeLists.txt":"",
- "library/cpp/digest/old_crc/gencrc/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/digest/sfh/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/digest/sfh/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/digest/sfh/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/digest/sfh/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/digest/sfh/CMakeLists.txt":"",
- "library/cpp/digest/sfh/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/disjoint_sets/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/disjoint_sets/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/disjoint_sets/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/disjoint_sets/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/disjoint_sets/CMakeLists.txt":"",
- "library/cpp/disjoint_sets/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/dns/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/dns/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/dns/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/dns/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/dns/CMakeLists.txt":"",
- "library/cpp/dns/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/dwarf_backtrace/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/dwarf_backtrace/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/dwarf_backtrace/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/dwarf_backtrace/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/dwarf_backtrace/CMakeLists.txt":"",
- "library/cpp/enumbitset/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/enumbitset/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/enumbitset/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/enumbitset/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/enumbitset/CMakeLists.txt":"",
- "library/cpp/enumbitset/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/execprofile/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/execprofile/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/execprofile/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/execprofile/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/execprofile/CMakeLists.txt":"",
- "library/cpp/execprofile/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/getopt/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/getopt/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/getopt/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/getopt/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/getopt/CMakeLists.txt":"",
- "library/cpp/getopt/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/getopt/small/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/getopt/small/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/getopt/small/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/getopt/small/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/getopt/small/CMakeLists.txt":"",
- "library/cpp/getopt/small/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/histogram/CMakeLists.txt":"",
- "library/cpp/histogram/adaptive/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/histogram/adaptive/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/histogram/adaptive/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/histogram/adaptive/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/histogram/adaptive/CMakeLists.txt":"",
- "library/cpp/histogram/adaptive/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/histogram/adaptive/protos/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/histogram/adaptive/protos/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/histogram/adaptive/protos/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/histogram/adaptive/protos/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/histogram/adaptive/protos/CMakeLists.txt":"",
- "library/cpp/histogram/adaptive/protos/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/histogram/hdr/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/histogram/hdr/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/histogram/hdr/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/histogram/hdr/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/histogram/hdr/CMakeLists.txt":"",
- "library/cpp/histogram/hdr/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/html/CMakeLists.txt":"",
- "library/cpp/html/escape/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/html/escape/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/html/escape/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/html/escape/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/html/escape/CMakeLists.txt":"",
- "library/cpp/html/escape/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/html/pcdata/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/html/pcdata/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/html/pcdata/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/html/pcdata/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/html/pcdata/CMakeLists.txt":"",
- "library/cpp/html/pcdata/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/http/CMakeLists.txt":"",
- "library/cpp/http/fetch/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/http/fetch/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/http/fetch/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/http/fetch/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/http/fetch/CMakeLists.txt":"",
- "library/cpp/http/fetch/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/http/io/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/http/io/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/http/io/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/http/io/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/http/io/CMakeLists.txt":"",
- "library/cpp/http/io/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/http/misc/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/http/misc/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/http/misc/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/http/misc/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/http/misc/CMakeLists.txt":"",
- "library/cpp/http/misc/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/http/server/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/http/server/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/http/server/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/http/server/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/http/server/CMakeLists.txt":"",
- "library/cpp/http/server/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/http/simple/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/http/simple/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/http/simple/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/http/simple/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/http/simple/CMakeLists.txt":"",
- "library/cpp/http/simple/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/hyperloglog/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/hyperloglog/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/hyperloglog/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/hyperloglog/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/hyperloglog/CMakeLists.txt":"",
- "library/cpp/hyperloglog/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/int128/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/int128/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/int128/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/int128/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/int128/CMakeLists.txt":"",
- "library/cpp/int128/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/ipmath/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/ipmath/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/ipmath/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/ipmath/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/ipmath/CMakeLists.txt":"",
- "library/cpp/ipmath/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/ipv6_address/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/ipv6_address/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/ipv6_address/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/ipv6_address/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/ipv6_address/CMakeLists.txt":"",
- "library/cpp/ipv6_address/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/iterator/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/iterator/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/iterator/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/iterator/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/iterator/CMakeLists.txt":"",
- "library/cpp/iterator/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/json/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/json/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/json/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/json/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/json/CMakeLists.txt":"",
- "library/cpp/json/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/json/common/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/json/common/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/json/common/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/json/common/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/json/common/CMakeLists.txt":"",
- "library/cpp/json/common/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/json/easy_parse/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/json/easy_parse/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/json/easy_parse/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/json/easy_parse/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/json/easy_parse/CMakeLists.txt":"",
- "library/cpp/json/easy_parse/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/json/fast_sax/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/json/fast_sax/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/json/fast_sax/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/json/fast_sax/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/json/fast_sax/CMakeLists.txt":"",
- "library/cpp/json/fast_sax/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/json/writer/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/json/writer/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/json/writer/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/json/writer/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/json/writer/CMakeLists.txt":"",
- "library/cpp/json/writer/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/json/yson/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/json/yson/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/json/yson/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/json/yson/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/json/yson/CMakeLists.txt":"",
- "library/cpp/json/yson/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/lcs/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/lcs/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/lcs/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/lcs/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/lcs/CMakeLists.txt":"",
- "library/cpp/lcs/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/lfalloc/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/lfalloc/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/lfalloc/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/lfalloc/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/lfalloc/CMakeLists.txt":"",
- "library/cpp/lfalloc/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/lfalloc/alloc_profiler/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/lfalloc/alloc_profiler/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/lfalloc/alloc_profiler/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/lfalloc/alloc_profiler/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/lfalloc/alloc_profiler/CMakeLists.txt":"",
- "library/cpp/lfalloc/alloc_profiler/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/lfalloc/dbg_info/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/lfalloc/dbg_info/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/lfalloc/dbg_info/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/lfalloc/dbg_info/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/lfalloc/dbg_info/CMakeLists.txt":"",
- "library/cpp/lfalloc/dbg_info/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/lfalloc/yt/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/lfalloc/yt/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/lfalloc/yt/CMakeLists.txt":"",
- "library/cpp/lfalloc/yt/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/linear_regression/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/linear_regression/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/linear_regression/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/linear_regression/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/linear_regression/CMakeLists.txt":"",
- "library/cpp/linear_regression/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/logger/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/logger/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/logger/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/logger/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/logger/CMakeLists.txt":"",
- "library/cpp/logger/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/logger/global/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/logger/global/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/logger/global/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/logger/global/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/logger/global/CMakeLists.txt":"",
- "library/cpp/logger/global/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/lua/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/lua/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/lua/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/lua/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/lua/CMakeLists.txt":"",
- "library/cpp/lua/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/lwtrace/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/lwtrace/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/lwtrace/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/lwtrace/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/lwtrace/CMakeLists.txt":"",
- "library/cpp/lwtrace/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/lwtrace/mon/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/lwtrace/mon/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/lwtrace/mon/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/lwtrace/mon/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/lwtrace/mon/CMakeLists.txt":"",
- "library/cpp/lwtrace/mon/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/lwtrace/mon/analytics/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/lwtrace/mon/analytics/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/lwtrace/mon/analytics/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/lwtrace/mon/analytics/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/lwtrace/mon/analytics/CMakeLists.txt":"",
- "library/cpp/lwtrace/mon/analytics/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/lwtrace/protos/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/lwtrace/protos/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/lwtrace/protos/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/lwtrace/protos/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/lwtrace/protos/CMakeLists.txt":"",
- "library/cpp/lwtrace/protos/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/malloc/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/malloc/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/malloc/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/malloc/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/malloc/CMakeLists.txt":"",
- "library/cpp/malloc/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/malloc/api/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/malloc/api/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/malloc/api/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/malloc/api/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/malloc/api/CMakeLists.txt":"",
- "library/cpp/malloc/api/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/malloc/jemalloc/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/malloc/jemalloc/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/malloc/jemalloc/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/malloc/jemalloc/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/malloc/jemalloc/CMakeLists.txt":"",
- "library/cpp/malloc/system/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/malloc/system/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/malloc/system/CMakeLists.txt":"",
- "library/cpp/malloc/system/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/malloc/tcmalloc/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/malloc/tcmalloc/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/malloc/tcmalloc/CMakeLists.txt":"",
- "library/cpp/messagebus/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/messagebus/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/messagebus/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/messagebus/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/messagebus/CMakeLists.txt":"",
- "library/cpp/messagebus/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/messagebus/actor/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/messagebus/actor/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/messagebus/actor/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/messagebus/actor/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/messagebus/actor/CMakeLists.txt":"",
- "library/cpp/messagebus/actor/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/messagebus/config/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/messagebus/config/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/messagebus/config/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/messagebus/config/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/messagebus/config/CMakeLists.txt":"",
- "library/cpp/messagebus/config/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/messagebus/monitoring/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/messagebus/monitoring/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/messagebus/monitoring/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/messagebus/monitoring/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/messagebus/monitoring/CMakeLists.txt":"",
- "library/cpp/messagebus/monitoring/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/messagebus/oldmodule/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/messagebus/oldmodule/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/messagebus/oldmodule/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/messagebus/oldmodule/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/messagebus/oldmodule/CMakeLists.txt":"",
- "library/cpp/messagebus/oldmodule/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/messagebus/protobuf/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/messagebus/protobuf/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/messagebus/protobuf/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/messagebus/protobuf/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/messagebus/protobuf/CMakeLists.txt":"",
- "library/cpp/messagebus/protobuf/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/messagebus/scheduler/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/messagebus/scheduler/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/messagebus/scheduler/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/messagebus/scheduler/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/messagebus/scheduler/CMakeLists.txt":"",
- "library/cpp/messagebus/scheduler/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/messagebus/www/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/messagebus/www/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/messagebus/www/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/messagebus/www/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/messagebus/www/CMakeLists.txt":"",
- "library/cpp/messagebus/www/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/mime/CMakeLists.txt":"",
- "library/cpp/mime/types/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/mime/types/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/mime/types/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/mime/types/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/mime/types/CMakeLists.txt":"",
- "library/cpp/mime/types/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/CMakeLists.txt":"",
- "library/cpp/monlib/deprecated/CMakeLists.txt":"",
- "library/cpp/monlib/deprecated/json/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/deprecated/json/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/deprecated/json/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/deprecated/json/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/deprecated/json/CMakeLists.txt":"",
- "library/cpp/monlib/deprecated/json/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/dynamic_counters/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/dynamic_counters/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/dynamic_counters/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/dynamic_counters/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/dynamic_counters/CMakeLists.txt":"",
- "library/cpp/monlib/dynamic_counters/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/dynamic_counters/percentile/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/dynamic_counters/percentile/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/dynamic_counters/percentile/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/dynamic_counters/percentile/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/dynamic_counters/percentile/CMakeLists.txt":"",
- "library/cpp/monlib/dynamic_counters/percentile/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/encode/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/encode/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/encode/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/encode/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/encode/CMakeLists.txt":"",
- "library/cpp/monlib/encode/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/encode/buffered/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/encode/buffered/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/encode/buffered/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/encode/buffered/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/encode/buffered/CMakeLists.txt":"",
- "library/cpp/monlib/encode/buffered/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/encode/json/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/encode/json/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/encode/json/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/encode/json/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/encode/json/CMakeLists.txt":"",
- "library/cpp/monlib/encode/json/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/encode/legacy_protobuf/CMakeLists.txt":"",
- "library/cpp/monlib/encode/legacy_protobuf/protos/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/encode/legacy_protobuf/protos/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/encode/legacy_protobuf/protos/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/encode/legacy_protobuf/protos/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/encode/legacy_protobuf/protos/CMakeLists.txt":"",
- "library/cpp/monlib/encode/legacy_protobuf/protos/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/encode/prometheus/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/encode/prometheus/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/encode/prometheus/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/encode/prometheus/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/encode/prometheus/CMakeLists.txt":"",
- "library/cpp/monlib/encode/prometheus/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/encode/spack/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/encode/spack/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/encode/spack/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/encode/spack/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/encode/spack/CMakeLists.txt":"",
- "library/cpp/monlib/encode/spack/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/encode/text/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/encode/text/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/encode/text/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/encode/text/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/encode/text/CMakeLists.txt":"",
- "library/cpp/monlib/encode/text/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/exception/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/exception/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/exception/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/exception/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/exception/CMakeLists.txt":"",
- "library/cpp/monlib/exception/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/messagebus/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/messagebus/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/messagebus/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/messagebus/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/messagebus/CMakeLists.txt":"",
- "library/cpp/monlib/messagebus/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/metrics/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/metrics/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/metrics/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/metrics/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/metrics/CMakeLists.txt":"",
- "library/cpp/monlib/metrics/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/service/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/service/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/service/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/service/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/service/CMakeLists.txt":"",
- "library/cpp/monlib/service/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/service/pages/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/service/pages/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/service/pages/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/service/pages/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/service/pages/CMakeLists.txt":"",
- "library/cpp/monlib/service/pages/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/service/pages/resources/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/service/pages/resources/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/service/pages/resources/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/service/pages/resources/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/service/pages/resources/CMakeLists.txt":"",
- "library/cpp/monlib/service/pages/resources/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/monlib/service/pages/tablesorter/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/monlib/service/pages/tablesorter/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/monlib/service/pages/tablesorter/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/monlib/service/pages/tablesorter/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/monlib/service/pages/tablesorter/CMakeLists.txt":"",
- "library/cpp/monlib/service/pages/tablesorter/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/on_disk/CMakeLists.txt":"",
- "library/cpp/on_disk/chunks/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/on_disk/chunks/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/on_disk/chunks/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/on_disk/chunks/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/on_disk/chunks/CMakeLists.txt":"",
- "library/cpp/on_disk/chunks/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/openssl/CMakeLists.txt":"",
- "library/cpp/openssl/big_integer/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/openssl/big_integer/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/openssl/big_integer/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/openssl/big_integer/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/openssl/big_integer/CMakeLists.txt":"",
- "library/cpp/openssl/big_integer/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/openssl/crypto/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/openssl/crypto/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/openssl/crypto/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/openssl/crypto/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/openssl/crypto/CMakeLists.txt":"",
- "library/cpp/openssl/crypto/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/openssl/holders/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/openssl/holders/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/openssl/holders/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/openssl/holders/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/openssl/holders/CMakeLists.txt":"",
- "library/cpp/openssl/holders/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/openssl/init/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/openssl/init/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/openssl/init/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/openssl/init/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/openssl/init/CMakeLists.txt":"",
- "library/cpp/openssl/init/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/openssl/io/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/openssl/io/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/openssl/io/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/openssl/io/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/openssl/io/CMakeLists.txt":"",
- "library/cpp/openssl/io/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/openssl/method/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/openssl/method/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/openssl/method/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/openssl/method/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/openssl/method/CMakeLists.txt":"",
- "library/cpp/openssl/method/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/packedtypes/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/packedtypes/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/packedtypes/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/packedtypes/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/packedtypes/CMakeLists.txt":"",
- "library/cpp/packedtypes/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/packers/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/packers/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/packers/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/packers/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/packers/CMakeLists.txt":"",
- "library/cpp/packers/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/pop_count/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/pop_count/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/pop_count/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/pop_count/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/pop_count/CMakeLists.txt":"",
- "library/cpp/pop_count/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/presort/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/presort/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/presort/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/presort/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/presort/CMakeLists.txt":"",
- "library/cpp/presort/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/protobuf/CMakeLists.txt":"",
- "library/cpp/protobuf/dynamic_prototype/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/protobuf/dynamic_prototype/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/protobuf/dynamic_prototype/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/protobuf/dynamic_prototype/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/protobuf/dynamic_prototype/CMakeLists.txt":"",
- "library/cpp/protobuf/dynamic_prototype/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/protobuf/interop/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/protobuf/interop/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/protobuf/interop/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/protobuf/interop/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/protobuf/interop/CMakeLists.txt":"",
- "library/cpp/protobuf/interop/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/protobuf/json/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/protobuf/json/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/protobuf/json/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/protobuf/json/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/protobuf/json/CMakeLists.txt":"",
- "library/cpp/protobuf/json/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/protobuf/json/proto/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/protobuf/json/proto/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/protobuf/json/proto/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/protobuf/json/proto/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/protobuf/json/proto/CMakeLists.txt":"",
- "library/cpp/protobuf/json/proto/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/protobuf/util/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/protobuf/util/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/protobuf/util/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/protobuf/util/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/protobuf/util/CMakeLists.txt":"",
- "library/cpp/protobuf/util/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/protobuf/util/proto/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/protobuf/util/proto/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/protobuf/util/proto/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/protobuf/util/proto/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/protobuf/util/proto/CMakeLists.txt":"",
- "library/cpp/protobuf/util/proto/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/protobuf/yql/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/protobuf/yql/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/protobuf/yql/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/protobuf/yql/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/protobuf/yql/CMakeLists.txt":"",
- "library/cpp/protobuf/yql/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/random_provider/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/random_provider/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/random_provider/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/random_provider/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/random_provider/CMakeLists.txt":"",
- "library/cpp/random_provider/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/regex/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/regex/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/regex/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/regex/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/regex/CMakeLists.txt":"",
- "library/cpp/regex/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/regex/hyperscan/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/regex/hyperscan/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/regex/hyperscan/CMakeLists.txt":"",
- "library/cpp/regex/hyperscan/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/regex/pcre/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/regex/pcre/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/regex/pcre/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/regex/pcre/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/regex/pcre/CMakeLists.txt":"",
- "library/cpp/regex/pcre/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/regex/pire/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/regex/pire/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/regex/pire/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/regex/pire/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/regex/pire/CMakeLists.txt":"",
- "library/cpp/regex/pire/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/resource/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/resource/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/resource/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/resource/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/resource/CMakeLists.txt":"",
- "library/cpp/resource/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/retry/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/retry/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/retry/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/retry/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/retry/CMakeLists.txt":"",
- "library/cpp/retry/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/retry/protos/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/retry/protos/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/retry/protos/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/retry/protos/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/retry/protos/CMakeLists.txt":"",
- "library/cpp/retry/protos/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/sanitizer/CMakeLists.txt":"",
- "library/cpp/sanitizer/include/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/sanitizer/include/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/sanitizer/include/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/sanitizer/include/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/sanitizer/include/CMakeLists.txt":"",
- "library/cpp/sanitizer/include/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/scheme/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/scheme/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/scheme/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/scheme/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/scheme/CMakeLists.txt":"",
- "library/cpp/scheme/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/sighandler/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/sighandler/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/sighandler/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/sighandler/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/sighandler/CMakeLists.txt":"",
- "library/cpp/sighandler/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/skiff/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/skiff/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/skiff/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/skiff/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/skiff/CMakeLists.txt":"",
- "library/cpp/skiff/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/sliding_window/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/sliding_window/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/sliding_window/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/sliding_window/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/sliding_window/CMakeLists.txt":"",
- "library/cpp/sliding_window/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/sse/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/sse/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/sse/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/sse/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/sse/CMakeLists.txt":"",
- "library/cpp/sse/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/streams/CMakeLists.txt":"",
- "library/cpp/streams/brotli/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/streams/brotli/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/streams/brotli/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/streams/brotli/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/streams/brotli/CMakeLists.txt":"",
- "library/cpp/streams/brotli/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/streams/bzip2/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/streams/bzip2/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/streams/bzip2/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/streams/bzip2/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/streams/bzip2/CMakeLists.txt":"",
- "library/cpp/streams/bzip2/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/streams/lzma/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/streams/lzma/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/streams/lzma/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/streams/lzma/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/streams/lzma/CMakeLists.txt":"",
- "library/cpp/streams/lzma/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/streams/xz/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/streams/xz/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/streams/xz/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/streams/xz/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/streams/xz/CMakeLists.txt":"",
- "library/cpp/streams/xz/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/streams/zc_memory_input/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/streams/zc_memory_input/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/streams/zc_memory_input/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/streams/zc_memory_input/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/streams/zc_memory_input/CMakeLists.txt":"",
- "library/cpp/streams/zc_memory_input/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/streams/zstd/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/streams/zstd/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/streams/zstd/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/streams/zstd/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/streams/zstd/CMakeLists.txt":"",
- "library/cpp/streams/zstd/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/string_utils/CMakeLists.txt":"",
- "library/cpp/string_utils/base32/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/string_utils/base32/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/string_utils/base32/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/string_utils/base32/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/string_utils/base32/CMakeLists.txt":"",
- "library/cpp/string_utils/base32/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/string_utils/base64/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/string_utils/base64/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/string_utils/base64/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/string_utils/base64/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/string_utils/base64/CMakeLists.txt":"",
- "library/cpp/string_utils/base64/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/string_utils/csv/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/string_utils/csv/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/string_utils/csv/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/string_utils/csv/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/string_utils/csv/CMakeLists.txt":"",
- "library/cpp/string_utils/csv/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/string_utils/indent_text/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/string_utils/indent_text/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/string_utils/indent_text/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/string_utils/indent_text/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/string_utils/indent_text/CMakeLists.txt":"",
- "library/cpp/string_utils/indent_text/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/string_utils/levenshtein_diff/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/string_utils/levenshtein_diff/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/string_utils/levenshtein_diff/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/string_utils/levenshtein_diff/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/string_utils/levenshtein_diff/CMakeLists.txt":"",
- "library/cpp/string_utils/levenshtein_diff/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/string_utils/parse_size/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/string_utils/parse_size/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/string_utils/parse_size/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/string_utils/parse_size/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/string_utils/parse_size/CMakeLists.txt":"",
- "library/cpp/string_utils/parse_size/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/string_utils/quote/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/string_utils/quote/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/string_utils/quote/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/string_utils/quote/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/string_utils/quote/CMakeLists.txt":"",
- "library/cpp/string_utils/quote/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/string_utils/relaxed_escaper/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/string_utils/relaxed_escaper/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/string_utils/relaxed_escaper/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/string_utils/relaxed_escaper/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/string_utils/relaxed_escaper/CMakeLists.txt":"",
- "library/cpp/string_utils/relaxed_escaper/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/string_utils/scan/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/string_utils/scan/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/string_utils/scan/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/string_utils/scan/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/string_utils/scan/CMakeLists.txt":"",
- "library/cpp/string_utils/scan/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/string_utils/url/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/string_utils/url/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/string_utils/url/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/string_utils/url/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/string_utils/url/CMakeLists.txt":"",
- "library/cpp/string_utils/url/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/string_utils/ztstrbuf/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/string_utils/ztstrbuf/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/string_utils/ztstrbuf/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/string_utils/ztstrbuf/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/string_utils/ztstrbuf/CMakeLists.txt":"",
- "library/cpp/string_utils/ztstrbuf/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/svnversion/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/svnversion/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/svnversion/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/svnversion/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/svnversion/CMakeLists.txt":"",
- "library/cpp/svnversion/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/tdigest/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/tdigest/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/tdigest/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/tdigest/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/tdigest/CMakeLists.txt":"",
- "library/cpp/tdigest/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/terminate_handler/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/terminate_handler/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/terminate_handler/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/terminate_handler/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/terminate_handler/CMakeLists.txt":"",
- "library/cpp/terminate_handler/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/testing/CMakeLists.txt":"",
- "library/cpp/testing/benchmark/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/testing/benchmark/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/testing/benchmark/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/testing/benchmark/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/testing/benchmark/CMakeLists.txt":"",
- "library/cpp/testing/benchmark/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/testing/benchmark/main/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/testing/benchmark/main/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/testing/benchmark/main/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/testing/benchmark/main/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/testing/benchmark/main/CMakeLists.txt":"",
- "library/cpp/testing/benchmark/main/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/testing/common/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/testing/common/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/testing/common/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/testing/common/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/testing/common/CMakeLists.txt":"",
- "library/cpp/testing/common/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/testing/gbenchmark/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/testing/gbenchmark/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/testing/gbenchmark/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/testing/gbenchmark/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/testing/gbenchmark/CMakeLists.txt":"",
- "library/cpp/testing/gbenchmark/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/testing/gmock_in_unittest/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/testing/gmock_in_unittest/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/testing/gmock_in_unittest/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/testing/gmock_in_unittest/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/testing/gmock_in_unittest/CMakeLists.txt":"",
- "library/cpp/testing/gmock_in_unittest/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/testing/gtest/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/testing/gtest/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/testing/gtest/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/testing/gtest/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/testing/gtest/CMakeLists.txt":"",
- "library/cpp/testing/gtest/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/testing/gtest_extensions/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/testing/gtest_extensions/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/testing/gtest_extensions/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/testing/gtest_extensions/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/testing/gtest_extensions/CMakeLists.txt":"",
- "library/cpp/testing/gtest_extensions/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/testing/gtest_main/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/testing/gtest_main/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/testing/gtest_main/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/testing/gtest_main/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/testing/gtest_main/CMakeLists.txt":"",
- "library/cpp/testing/gtest_main/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/testing/hook/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/testing/hook/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/testing/hook/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/testing/hook/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/testing/hook/CMakeLists.txt":"",
- "library/cpp/testing/hook/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/testing/mock_server/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/testing/mock_server/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/testing/mock_server/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/testing/mock_server/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/testing/mock_server/CMakeLists.txt":"",
- "library/cpp/testing/mock_server/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/testing/unittest/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/testing/unittest/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/testing/unittest/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/testing/unittest/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/testing/unittest/CMakeLists.txt":"",
- "library/cpp/testing/unittest/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/testing/unittest_main/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/testing/unittest_main/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/testing/unittest_main/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/testing/unittest_main/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/testing/unittest_main/CMakeLists.txt":"",
- "library/cpp/testing/unittest_main/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/CMakeLists.txt":"",
- "library/cpp/threading/atomic/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/atomic/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/atomic/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/atomic/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/atomic/CMakeLists.txt":"",
- "library/cpp/threading/atomic/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/blocking_queue/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/blocking_queue/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/blocking_queue/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/blocking_queue/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/blocking_queue/CMakeLists.txt":"",
- "library/cpp/threading/blocking_queue/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/chunk_queue/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/chunk_queue/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/chunk_queue/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/chunk_queue/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/chunk_queue/CMakeLists.txt":"",
- "library/cpp/threading/chunk_queue/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/cron/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/cron/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/cron/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/cron/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/cron/CMakeLists.txt":"",
- "library/cpp/threading/cron/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/equeue/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/equeue/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/equeue/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/equeue/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/equeue/CMakeLists.txt":"",
- "library/cpp/threading/equeue/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/future/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/future/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/future/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/future/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/future/CMakeLists.txt":"",
- "library/cpp/threading/future/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/hot_swap/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/hot_swap/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/hot_swap/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/hot_swap/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/hot_swap/CMakeLists.txt":"",
- "library/cpp/threading/hot_swap/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/light_rw_lock/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/light_rw_lock/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/light_rw_lock/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/light_rw_lock/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/light_rw_lock/CMakeLists.txt":"",
- "library/cpp/threading/light_rw_lock/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/local_executor/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/local_executor/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/local_executor/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/local_executor/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/local_executor/CMakeLists.txt":"",
- "library/cpp/threading/local_executor/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/poor_man_openmp/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/poor_man_openmp/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/poor_man_openmp/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/poor_man_openmp/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/poor_man_openmp/CMakeLists.txt":"",
- "library/cpp/threading/poor_man_openmp/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/queue/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/queue/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/queue/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/queue/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/queue/CMakeLists.txt":"",
- "library/cpp/threading/queue/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/skip_list/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/skip_list/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/skip_list/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/skip_list/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/skip_list/CMakeLists.txt":"",
- "library/cpp/threading/skip_list/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/task_scheduler/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/task_scheduler/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/task_scheduler/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/task_scheduler/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/task_scheduler/CMakeLists.txt":"",
- "library/cpp/threading/task_scheduler/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/threading/thread_local/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/threading/thread_local/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/threading/thread_local/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/threading/thread_local/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/threading/thread_local/CMakeLists.txt":"",
- "library/cpp/threading/thread_local/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/time_provider/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/time_provider/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/time_provider/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/time_provider/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/time_provider/CMakeLists.txt":"",
- "library/cpp/time_provider/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/timezone_conversion/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/timezone_conversion/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/timezone_conversion/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/timezone_conversion/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/timezone_conversion/CMakeLists.txt":"",
- "library/cpp/timezone_conversion/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/tld/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/tld/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/tld/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/tld/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/tld/CMakeLists.txt":"",
- "library/cpp/tld/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/type_info/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/type_info/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/type_info/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/type_info/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/type_info/CMakeLists.txt":"",
- "library/cpp/type_info/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/unicode/CMakeLists.txt":"",
- "library/cpp/unicode/normalization/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/unicode/normalization/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/unicode/normalization/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/unicode/normalization/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/unicode/normalization/CMakeLists.txt":"",
- "library/cpp/unicode/normalization/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/unicode/punycode/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/unicode/punycode/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/unicode/punycode/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/unicode/punycode/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/unicode/punycode/CMakeLists.txt":"",
- "library/cpp/unicode/punycode/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/unicode/set/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/unicode/set/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/unicode/set/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/unicode/set/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/unicode/set/CMakeLists.txt":"",
- "library/cpp/unicode/set/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/unified_agent_client/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/unified_agent_client/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/unified_agent_client/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/unified_agent_client/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/unified_agent_client/CMakeLists.txt":"",
- "library/cpp/unified_agent_client/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/unified_agent_client/proto/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/unified_agent_client/proto/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/unified_agent_client/proto/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/unified_agent_client/proto/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/unified_agent_client/proto/CMakeLists.txt":"",
- "library/cpp/unified_agent_client/proto/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/uri/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/uri/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/uri/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/uri/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/uri/CMakeLists.txt":"",
- "library/cpp/uri/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/xml/CMakeLists.txt":"",
- "library/cpp/xml/document/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/xml/document/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/xml/document/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/xml/document/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/xml/document/CMakeLists.txt":"",
- "library/cpp/xml/document/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/xml/init/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/xml/init/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/xml/init/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/xml/init/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/xml/init/CMakeLists.txt":"",
- "library/cpp/xml/init/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yaml/CMakeLists.txt":"",
- "library/cpp/yaml/as/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yaml/as/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yaml/as/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yaml/as/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yaml/as/CMakeLists.txt":"",
- "library/cpp/yaml/as/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yson/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yson/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yson/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yson/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yson/CMakeLists.txt":"",
- "library/cpp/yson/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yson/json/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yson/json/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yson/json/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yson/json/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yson/json/CMakeLists.txt":"",
- "library/cpp/yson/json/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yson/node/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yson/node/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yson/node/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yson/node/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yson/node/CMakeLists.txt":"",
- "library/cpp/yson/node/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yson_pull/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yson_pull/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yson_pull/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yson_pull/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yson_pull/CMakeLists.txt":"",
- "library/cpp/yson_pull/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/CMakeLists.txt":"",
- "library/cpp/yt/assert/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/assert/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/assert/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/assert/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/assert/CMakeLists.txt":"",
- "library/cpp/yt/assert/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/backtrace/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/backtrace/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/backtrace/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/backtrace/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/backtrace/CMakeLists.txt":"",
- "library/cpp/yt/backtrace/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/backtrace/cursors/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/backtrace/cursors/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/backtrace/cursors/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/backtrace/cursors/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/backtrace/cursors/CMakeLists.txt":"",
- "library/cpp/yt/backtrace/cursors/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/backtrace/cursors/dummy/CMakeLists.txt":"",
- "library/cpp/yt/backtrace/cursors/dummy/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/backtrace/cursors/frame_pointer/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/backtrace/cursors/frame_pointer/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/backtrace/cursors/frame_pointer/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/backtrace/cursors/frame_pointer/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/backtrace/cursors/frame_pointer/CMakeLists.txt":"",
- "library/cpp/yt/backtrace/cursors/frame_pointer/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/backtrace/cursors/interop/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/backtrace/cursors/interop/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/backtrace/cursors/interop/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/backtrace/cursors/interop/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/backtrace/cursors/interop/CMakeLists.txt":"",
- "library/cpp/yt/backtrace/cursors/interop/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/backtrace/cursors/libunwind/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/backtrace/cursors/libunwind/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/backtrace/cursors/libunwind/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/backtrace/cursors/libunwind/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/backtrace/cursors/libunwind/CMakeLists.txt":"",
- "library/cpp/yt/backtrace/cursors/libunwind/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/coding/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/coding/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/coding/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/coding/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/coding/CMakeLists.txt":"",
- "library/cpp/yt/coding/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/containers/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/containers/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/containers/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/containers/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/containers/CMakeLists.txt":"",
- "library/cpp/yt/containers/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/cpu_clock/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/cpu_clock/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/cpu_clock/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/cpu_clock/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/cpu_clock/CMakeLists.txt":"",
- "library/cpp/yt/cpu_clock/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/exception/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/exception/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/exception/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/exception/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/exception/CMakeLists.txt":"",
- "library/cpp/yt/exception/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/logging/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/logging/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/logging/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/logging/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/logging/CMakeLists.txt":"",
- "library/cpp/yt/logging/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/logging/plain_text_formatter/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/logging/plain_text_formatter/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/logging/plain_text_formatter/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/logging/plain_text_formatter/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/logging/plain_text_formatter/CMakeLists.txt":"",
- "library/cpp/yt/logging/plain_text_formatter/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/malloc/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/malloc/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/malloc/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/malloc/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/malloc/CMakeLists.txt":"",
- "library/cpp/yt/malloc/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/memory/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/memory/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/memory/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/memory/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/memory/CMakeLists.txt":"",
- "library/cpp/yt/memory/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/misc/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/misc/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/misc/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/misc/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/misc/CMakeLists.txt":"",
- "library/cpp/yt/misc/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/mlock/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/mlock/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/mlock/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/mlock/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/mlock/CMakeLists.txt":"",
- "library/cpp/yt/mlock/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/small_containers/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/small_containers/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/small_containers/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/small_containers/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/small_containers/CMakeLists.txt":"",
- "library/cpp/yt/small_containers/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/stockpile/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/stockpile/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/stockpile/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/stockpile/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/stockpile/CMakeLists.txt":"",
- "library/cpp/yt/stockpile/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/string/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/string/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/string/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/string/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/string/CMakeLists.txt":"",
- "library/cpp/yt/string/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/system/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/system/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/system/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/system/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/system/CMakeLists.txt":"",
- "library/cpp/yt/system/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/threading/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/threading/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/threading/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/threading/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/threading/CMakeLists.txt":"",
- "library/cpp/yt/threading/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/yson/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/yson/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/yson/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/yson/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/yson/CMakeLists.txt":"",
- "library/cpp/yt/yson/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/yt/yson_string/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/yt/yson_string/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/yt/yson_string/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/yt/yson_string/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/yt/yson_string/CMakeLists.txt":"",
- "library/cpp/yt/yson_string/CMakeLists.windows-x86_64.txt":"",
- "library/cpp/ytalloc/CMakeLists.txt":"",
- "library/cpp/ytalloc/api/CMakeLists.darwin-arm64.txt":"",
- "library/cpp/ytalloc/api/CMakeLists.darwin-x86_64.txt":"",
- "library/cpp/ytalloc/api/CMakeLists.linux-aarch64.txt":"",
- "library/cpp/ytalloc/api/CMakeLists.linux-x86_64.txt":"",
- "library/cpp/ytalloc/api/CMakeLists.txt":"",
- "library/cpp/ytalloc/api/CMakeLists.windows-x86_64.txt":"",
- "scripts/generate_dump.sh":"ydb/github_toplevel/scripts/generate_dump.sh",
- "tools/CMakeLists.txt":"",
- "tools/archiver/CMakeLists.darwin-arm64.txt":"",
- "tools/archiver/CMakeLists.darwin-x86_64.txt":"",
- "tools/archiver/CMakeLists.linux-aarch64.txt":"",
- "tools/archiver/CMakeLists.linux-x86_64.txt":"",
- "tools/archiver/CMakeLists.txt":"",
- "tools/archiver/CMakeLists.windows-x86_64.txt":"",
- "tools/enum_parser/CMakeLists.txt":"",
- "tools/enum_parser/enum_parser/CMakeLists.darwin-arm64.txt":"",
- "tools/enum_parser/enum_parser/CMakeLists.darwin-x86_64.txt":"",
- "tools/enum_parser/enum_parser/CMakeLists.linux-aarch64.txt":"",
- "tools/enum_parser/enum_parser/CMakeLists.linux-x86_64.txt":"",
- "tools/enum_parser/enum_parser/CMakeLists.txt":"",
- "tools/enum_parser/enum_parser/CMakeLists.windows-x86_64.txt":"",
- "tools/enum_parser/enum_serialization_runtime/CMakeLists.darwin-arm64.txt":"",
- "tools/enum_parser/enum_serialization_runtime/CMakeLists.darwin-x86_64.txt":"",
- "tools/enum_parser/enum_serialization_runtime/CMakeLists.linux-aarch64.txt":"",
- "tools/enum_parser/enum_serialization_runtime/CMakeLists.linux-x86_64.txt":"",
- "tools/enum_parser/enum_serialization_runtime/CMakeLists.txt":"",
- "tools/enum_parser/enum_serialization_runtime/CMakeLists.windows-x86_64.txt":"",
- "tools/enum_parser/parse_enum/CMakeLists.darwin-arm64.txt":"",
- "tools/enum_parser/parse_enum/CMakeLists.darwin-x86_64.txt":"",
- "tools/enum_parser/parse_enum/CMakeLists.linux-aarch64.txt":"",
- "tools/enum_parser/parse_enum/CMakeLists.linux-x86_64.txt":"",
- "tools/enum_parser/parse_enum/CMakeLists.txt":"",
- "tools/enum_parser/parse_enum/CMakeLists.windows-x86_64.txt":"",
- "tools/rescompiler/CMakeLists.txt":"",
- "tools/rescompiler/bin/CMakeLists.darwin-arm64.txt":"",
- "tools/rescompiler/bin/CMakeLists.darwin-x86_64.txt":"",
- "tools/rescompiler/bin/CMakeLists.linux-aarch64.txt":"",
- "tools/rescompiler/bin/CMakeLists.linux-x86_64.txt":"",
- "tools/rescompiler/bin/CMakeLists.txt":"",
- "tools/rescompiler/bin/CMakeLists.windows-x86_64.txt":"",
- "util/CMakeLists.darwin-arm64.txt":"",
- "util/CMakeLists.darwin-x86_64.txt":"",
- "util/CMakeLists.linux-aarch64.txt":"",
- "util/CMakeLists.linux-x86_64.txt":"",
- "util/CMakeLists.txt":"",
- "util/CMakeLists.windows-x86_64.txt":"",
- "util/charset/CMakeLists.darwin-arm64.txt":"",
- "util/charset/CMakeLists.darwin-x86_64.txt":"",
- "util/charset/CMakeLists.linux-aarch64.txt":"",
- "util/charset/CMakeLists.linux-x86_64.txt":"",
- "util/charset/CMakeLists.txt":"",
- "util/charset/CMakeLists.windows-x86_64.txt":"",
- "util/draft/CMakeLists.darwin-arm64.txt":"",
- "util/draft/CMakeLists.darwin-x86_64.txt":"",
- "util/draft/CMakeLists.linux-aarch64.txt":"",
- "util/draft/CMakeLists.linux-x86_64.txt":"",
- "util/draft/CMakeLists.txt":"",
- "util/draft/CMakeLists.windows-x86_64.txt":"",
- "ya":"devtools/ya/opensource/ya",
- "ya.conf":"devtools/ya/opensource/ya.conf",
- "ydb/CMakeLists.txt":"",
- "ydb/apps/CMakeLists.txt":"",
- "ydb/apps/pgwire/CMakeLists.darwin-arm64.txt":"",
- "ydb/apps/pgwire/CMakeLists.darwin-x86_64.txt":"",
- "ydb/apps/pgwire/CMakeLists.linux-aarch64.txt":"",
- "ydb/apps/pgwire/CMakeLists.linux-x86_64.txt":"",
- "ydb/apps/pgwire/CMakeLists.txt":"",
- "ydb/apps/pgwire/CMakeLists.windows-x86_64.txt":"",
- "ydb/apps/ydb/CMakeLists.darwin-arm64.txt":"",
- "ydb/apps/ydb/CMakeLists.darwin-x86_64.txt":"",
- "ydb/apps/ydb/CMakeLists.linux-aarch64.txt":"",
- "ydb/apps/ydb/CMakeLists.linux-x86_64.txt":"",
- "ydb/apps/ydb/CMakeLists.txt":"",
- "ydb/apps/ydb/CMakeLists.windows-x86_64.txt":"",
- "ydb/apps/ydb/commands/CMakeLists.darwin-arm64.txt":"",
- "ydb/apps/ydb/commands/CMakeLists.darwin-x86_64.txt":"",
- "ydb/apps/ydb/commands/CMakeLists.linux-aarch64.txt":"",
- "ydb/apps/ydb/commands/CMakeLists.linux-x86_64.txt":"",
- "ydb/apps/ydb/commands/CMakeLists.txt":"",
- "ydb/apps/ydb/commands/CMakeLists.windows-x86_64.txt":"",
- "ydb/apps/ydb/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/apps/ydb/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/apps/ydb/ut/CMakeLists.txt":"",
- "ydb/apps/ydbd/CMakeLists.darwin-arm64.txt":"",
- "ydb/apps/ydbd/CMakeLists.darwin-x86_64.txt":"",
- "ydb/apps/ydbd/CMakeLists.linux-aarch64.txt":"",
- "ydb/apps/ydbd/CMakeLists.linux-x86_64.txt":"",
- "ydb/apps/ydbd/CMakeLists.txt":"",
- "ydb/apps/ydbd/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/CMakeLists.txt":"",
- "ydb/core/actorlib_impl/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/actorlib_impl/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/actorlib_impl/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/actorlib_impl/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/actorlib_impl/CMakeLists.txt":"",
- "ydb/core/actorlib_impl/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/actorlib_impl/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/actorlib_impl/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/actorlib_impl/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/actorlib_impl/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/actorlib_impl/ut/CMakeLists.txt":"",
- "ydb/core/actorlib_impl/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/audit/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/audit/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/audit/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/audit/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/audit/CMakeLists.txt":"",
- "ydb/core/audit/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/base/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/base/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/base/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/base/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/base/CMakeLists.txt":"",
- "ydb/core/base/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/base/services/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/base/services/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/base/services/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/base/services/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/base/services/CMakeLists.txt":"",
- "ydb/core/base/services/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/base/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/base/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/base/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/base/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/base/ut/CMakeLists.txt":"",
- "ydb/core/base/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/base/ut_board_subscriber/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/base/ut_board_subscriber/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/base/ut_board_subscriber/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/base/ut_board_subscriber/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/base/ut_board_subscriber/CMakeLists.txt":"",
- "ydb/core/base/ut_board_subscriber/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blob_depot/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blob_depot/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blob_depot/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blob_depot/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blob_depot/CMakeLists.txt":"",
- "ydb/core/blob_depot/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blob_depot/agent/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blob_depot/agent/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blob_depot/agent/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blob_depot/agent/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blob_depot/agent/CMakeLists.txt":"",
- "ydb/core/blob_depot/agent/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blob_depot/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blob_depot/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blob_depot/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blob_depot/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blob_depot/ut/CMakeLists.txt":"",
- "ydb/core/blob_depot/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/CMakeLists.txt":"",
- "ydb/core/blobstorage/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/backpressure/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/backpressure/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/backpressure/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/backpressure/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/backpressure/CMakeLists.txt":"",
- "ydb/core/blobstorage/backpressure/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/backpressure/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/backpressure/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/backpressure/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/backpressure/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/backpressure/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/backpressure/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/backpressure/ut_client/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/backpressure/ut_client/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/backpressure/ut_client/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/backpressure/ut_client/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/backpressure/ut_client/CMakeLists.txt":"",
- "ydb/core/blobstorage/backpressure/ut_client/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/base/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/base/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/base/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/base/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/base/CMakeLists.txt":"",
- "ydb/core/blobstorage/base/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/base/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/base/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/base/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/base/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/base/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/base/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/crypto/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/crypto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/crypto/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/crypto/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/crypto/CMakeLists.txt":"",
- "ydb/core/blobstorage/crypto/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/crypto/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/crypto/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/crypto/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/crypto/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/crypto/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/crypto/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/dsproxy/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/dsproxy/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/CMakeLists.txt":"",
- "ydb/core/blobstorage/dsproxy/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/mock/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/dsproxy/mock/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/mock/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/dsproxy/mock/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/mock/CMakeLists.txt":"",
- "ydb/core/blobstorage/dsproxy/mock/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/dsproxy/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut_fat/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut_fat/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut_fat/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut_fat/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut_fat/CMakeLists.txt":"",
- "ydb/core/blobstorage/dsproxy/ut_fat/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut_ftol/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut_ftol/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut_ftol/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut_ftol/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/dsproxy/ut_ftol/CMakeLists.txt":"",
- "ydb/core/blobstorage/dsproxy/ut_ftol/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/groupinfo/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/groupinfo/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/groupinfo/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/groupinfo/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/groupinfo/CMakeLists.txt":"",
- "ydb/core/blobstorage/groupinfo/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/groupinfo/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/groupinfo/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/groupinfo/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/groupinfo/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/groupinfo/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/groupinfo/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/incrhuge/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/incrhuge/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/incrhuge/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/incrhuge/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/incrhuge/CMakeLists.txt":"",
- "ydb/core/blobstorage/incrhuge/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/incrhuge/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/incrhuge/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/incrhuge/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/incrhuge/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/incrhuge/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/incrhuge/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/lwtrace_probes/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/lwtrace_probes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/lwtrace_probes/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/lwtrace_probes/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/lwtrace_probes/CMakeLists.txt":"",
- "ydb/core/blobstorage/lwtrace_probes/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/nodewarden/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/nodewarden/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/nodewarden/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/nodewarden/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/nodewarden/CMakeLists.txt":"",
- "ydb/core/blobstorage/nodewarden/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/nodewarden/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/nodewarden/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/nodewarden/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/nodewarden/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/nodewarden/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/nodewarden/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/nodewarden/ut_sequence/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/nodewarden/ut_sequence/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/nodewarden/ut_sequence/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/nodewarden/ut_sequence/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/nodewarden/ut_sequence/CMakeLists.txt":"",
- "ydb/core/blobstorage/nodewarden/ut_sequence/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/other/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/other/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/other/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/other/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/other/CMakeLists.txt":"",
- "ydb/core/blobstorage/other/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/pdisk/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/pdisk/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/pdisk/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/pdisk/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/pdisk/CMakeLists.txt":"",
- "ydb/core/blobstorage/pdisk/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/pdisk/mock/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/pdisk/mock/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/pdisk/mock/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/pdisk/mock/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/pdisk/mock/CMakeLists.txt":"",
- "ydb/core/blobstorage/pdisk/mock/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/pdisk/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/pdisk/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/pdisk/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/pdisk/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/pdisk/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/pdisk/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/storagepoolmon/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/storagepoolmon/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/storagepoolmon/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/storagepoolmon/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/storagepoolmon/CMakeLists.txt":"",
- "ydb/core/blobstorage/storagepoolmon/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/storagepoolmon/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/storagepoolmon/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/storagepoolmon/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/storagepoolmon/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/storagepoolmon/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/storagepoolmon/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/testing/CMakeLists.txt":"",
- "ydb/core/blobstorage/testing/group_overseer/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/testing/group_overseer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/testing/group_overseer/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/testing/group_overseer/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/testing/group_overseer/CMakeLists.txt":"",
- "ydb/core/blobstorage/testing/group_overseer/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/lib/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/lib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/lib/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/lib/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/lib/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/lib/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_blob_depot/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_blob_depot/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_blob_depot/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_blob_depot/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_blob_depot/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_blob_depot/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_blob_depot_fat/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_blob_depot_fat/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_blob_depot_fat/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_blob_depot_fat/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_blob_depot_fat/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_blob_depot_fat/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_donor/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_donor/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_donor/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_donor/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_donor/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_donor/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_group_reconfiguration/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_group_reconfiguration/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_group_reconfiguration/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_group_reconfiguration/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_group_reconfiguration/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_group_reconfiguration/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_osiris/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_osiris/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_osiris/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_osiris/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_osiris/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_osiris/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_read_only_vdisk/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_read_only_vdisk/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_read_only_vdisk/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_read_only_vdisk/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_read_only_vdisk/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_read_only_vdisk/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_replication/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_replication/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_replication/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_replication/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_replication/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_replication/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_scrub/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_scrub/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_scrub/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_scrub/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_scrub/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_scrub/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_vdisk_restart/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_vdisk_restart/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_vdisk_restart/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_vdisk_restart/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_vdisk_restart/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_blobstorage/ut_vdisk_restart/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_group/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_group/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_group/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_group/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_group/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_group/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_mirror3of4/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_mirror3of4/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_mirror3of4/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_mirror3of4/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_mirror3of4/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_mirror3of4/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/lib/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/lib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/lib/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/lib/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/lib/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/lib/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/pdiskfit/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/pdiskfit/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/pdiskfit/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_pdiskfit/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_testshard/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_testshard/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_testshard/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_testshard/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_testshard/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_testshard/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_vdisk/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_vdisk/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_vdisk/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_vdisk/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_vdisk/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_vdisk/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_vdisk/lib/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_vdisk/lib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_vdisk/lib/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_vdisk/lib/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_vdisk/lib/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_vdisk/lib/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/ut_vdisk2/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/ut_vdisk2/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/ut_vdisk2/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/ut_vdisk2/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/ut_vdisk2/CMakeLists.txt":"",
- "ydb/core/blobstorage/ut_vdisk2/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/anubis_osiris/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/anubis_osiris/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/anubis_osiris/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/anubis_osiris/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/anubis_osiris/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/anubis_osiris/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/anubis_osiris/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/anubis_osiris/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/anubis_osiris/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/anubis_osiris/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/anubis_osiris/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/anubis_osiris/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/common/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/common/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/common/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/common/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/common/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/common/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/common/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/defrag/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/defrag/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/defrag/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/defrag/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/defrag/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/defrag/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/defrag/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/defrag/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/defrag/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/defrag/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/defrag/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/defrag/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/handoff/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/handoff/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/handoff/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/handoff/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/handoff/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/handoff/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/huge/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/huge/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/huge/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/huge/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/huge/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/huge/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/huge/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/huge/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/huge/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/huge/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/huge/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/huge/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/barriers/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/barriers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/barriers/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/barriers/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/barriers/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/barriers/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/barriers/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/barriers/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/barriers/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/barriers/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/barriers/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/barriers/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/base/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/base/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/base/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/base/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/base/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/base/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/base/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/base/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/base/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/base/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/base/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/base/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/bulksst_add/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/bulksst_add/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/bulksst_add/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/bulksst_add/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/bulksst_add/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/bulksst_add/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/cache_block/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/cache_block/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/cache_block/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/cache_block/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/cache_block/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/cache_block/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/cache_block/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/cache_block/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/cache_block/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/cache_block/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/cache_block/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/cache_block/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/compstrat/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/compstrat/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/compstrat/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/compstrat/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/compstrat/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/compstrat/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/compstrat/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/compstrat/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/compstrat/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/compstrat/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/compstrat/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/compstrat/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/fresh/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/fresh/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/fresh/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/fresh/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/fresh/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/fresh/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/fresh/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/fresh/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/fresh/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/fresh/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/fresh/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/fresh/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/generic/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/generic/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/generic/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/generic/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/generic/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/generic/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/generic/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/generic/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/generic/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/generic/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/generic/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/generic/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/recovery/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/recovery/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/recovery/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/recovery/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/recovery/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/recovery/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/test/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/test/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/test/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/test/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/test/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hulldb/test/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/hullcompdelete/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/hullcompdelete/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/hullcompdelete/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/hullcompdelete/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/hullcompdelete/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/hullcompdelete/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/hullop/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/ingress/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/ingress/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/ingress/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/ingress/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/ingress/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/ingress/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/ingress/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/ingress/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/ingress/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/ingress/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/ingress/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/ingress/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/localrecovery/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/localrecovery/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/localrecovery/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/localrecovery/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/localrecovery/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/localrecovery/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/protos/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/query/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/query/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/query/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/query/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/query/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/query/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/query/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/query/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/query/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/query/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/query/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/query/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/repl/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/repl/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/repl/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/repl/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/repl/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/repl/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/repl/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/repl/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/repl/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/repl/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/repl/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/repl/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/scrub/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/scrub/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/scrub/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/scrub/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/scrub/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/scrub/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/skeleton/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/skeleton/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/skeleton/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/skeleton/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/skeleton/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/skeleton/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/skeleton/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/skeleton/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/skeleton/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/skeleton/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/skeleton/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/skeleton/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/syncer/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/syncer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/syncer/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/syncer/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/syncer/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/syncer/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/syncer/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/syncer/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/syncer/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/syncer/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/syncer/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/syncer/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/synclog/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/synclog/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/synclog/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/synclog/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/synclog/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/synclog/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/synclog/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blobstorage/vdisk/synclog/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/synclog/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blobstorage/vdisk/synclog/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blobstorage/vdisk/synclog/ut/CMakeLists.txt":"",
- "ydb/core/blobstorage/vdisk/synclog/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blockstore/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blockstore/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blockstore/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blockstore/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blockstore/CMakeLists.txt":"",
- "ydb/core/blockstore/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/blockstore/core/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/blockstore/core/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/blockstore/core/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/blockstore/core/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/blockstore/core/CMakeLists.txt":"",
- "ydb/core/blockstore/core/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/client/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/client/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/client/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/client/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/client/CMakeLists.txt":"",
- "ydb/core/client/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/client/metadata/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/client/metadata/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/client/metadata/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/client/metadata/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/client/metadata/CMakeLists.txt":"",
- "ydb/core/client/metadata/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/client/metadata/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/client/metadata/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/client/metadata/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/client/metadata/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/client/metadata/ut/CMakeLists.txt":"",
- "ydb/core/client/metadata/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/client/minikql_compile/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/client/minikql_compile/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/client/minikql_compile/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/client/minikql_compile/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/client/minikql_compile/CMakeLists.txt":"",
- "ydb/core/client/minikql_compile/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/client/minikql_compile/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/client/minikql_compile/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/client/minikql_compile/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/client/minikql_compile/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/client/minikql_compile/ut/CMakeLists.txt":"",
- "ydb/core/client/minikql_compile/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/client/minikql_result_lib/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/client/minikql_result_lib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/client/minikql_result_lib/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/client/minikql_result_lib/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/client/minikql_result_lib/CMakeLists.txt":"",
- "ydb/core/client/minikql_result_lib/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/client/minikql_result_lib/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/client/minikql_result_lib/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/client/minikql_result_lib/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/client/minikql_result_lib/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/client/minikql_result_lib/ut/CMakeLists.txt":"",
- "ydb/core/client/minikql_result_lib/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/client/scheme_cache_lib/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/client/scheme_cache_lib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/client/scheme_cache_lib/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/client/scheme_cache_lib/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/client/scheme_cache_lib/CMakeLists.txt":"",
- "ydb/core/client/scheme_cache_lib/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/client/server/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/client/server/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/client/server/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/client/server/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/client/server/CMakeLists.txt":"",
- "ydb/core/client/server/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/client/server/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/client/server/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/client/server/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/client/server/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/client/server/ut/CMakeLists.txt":"",
- "ydb/core/client/server/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/client/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/client/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/client/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/client/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/client/ut/CMakeLists.txt":"",
- "ydb/core/client/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/cms/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/cms/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/cms/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/cms/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/cms/CMakeLists.txt":"",
- "ydb/core/cms/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/cms/console/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/cms/console/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/cms/console/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/cms/console/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/cms/console/CMakeLists.txt":"",
- "ydb/core/cms/console/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/cms/console/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/cms/console/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/cms/console/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/cms/console/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/cms/console/ut/CMakeLists.txt":"",
- "ydb/core/cms/console/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/cms/console/util/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/cms/console/util/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/cms/console/util/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/cms/console/util/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/cms/console/util/CMakeLists.txt":"",
- "ydb/core/cms/console/util/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/cms/console/validators/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/cms/console/validators/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/cms/console/validators/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/cms/console/validators/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/cms/console/validators/CMakeLists.txt":"",
- "ydb/core/cms/console/validators/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/cms/console/validators/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/cms/console/validators/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/cms/console/validators/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/cms/console/validators/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/cms/console/validators/ut/CMakeLists.txt":"",
- "ydb/core/cms/console/validators/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/cms/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/cms/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/cms/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/cms/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/cms/ut/CMakeLists.txt":"",
- "ydb/core/cms/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/cms/ut_sentinel/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/cms/ut_sentinel/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/cms/ut_sentinel/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/cms/ut_sentinel/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/cms/ut_sentinel/CMakeLists.txt":"",
- "ydb/core/cms/ut_sentinel/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/control/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/control/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/control/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/control/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/control/CMakeLists.txt":"",
- "ydb/core/control/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/control/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/control/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/control/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/control/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/control/ut/CMakeLists.txt":"",
- "ydb/core/control/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/debug/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/debug/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/debug/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/debug/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/debug/CMakeLists.txt":"",
- "ydb/core/debug/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/debug_tools/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/debug_tools/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/debug_tools/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/debug_tools/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/debug_tools/CMakeLists.txt":"",
- "ydb/core/debug_tools/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/debug_tools/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/debug_tools/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/debug_tools/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/debug_tools/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/debug_tools/ut/CMakeLists.txt":"",
- "ydb/core/debug_tools/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/discovery/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/discovery/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/discovery/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/discovery/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/discovery/CMakeLists.txt":"",
- "ydb/core/discovery/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/docapi/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/docapi/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/docapi/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/docapi/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/docapi/CMakeLists.txt":"",
- "ydb/core/docapi/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/driver_lib/CMakeLists.txt":"",
- "ydb/core/driver_lib/base_utils/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/driver_lib/base_utils/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/driver_lib/base_utils/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/driver_lib/base_utils/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/driver_lib/base_utils/CMakeLists.txt":"",
- "ydb/core/driver_lib/base_utils/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/driver_lib/cli_base/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/driver_lib/cli_base/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/driver_lib/cli_base/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/driver_lib/cli_base/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/driver_lib/cli_base/CMakeLists.txt":"",
- "ydb/core/driver_lib/cli_base/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/driver_lib/cli_config_base/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/driver_lib/cli_config_base/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/driver_lib/cli_config_base/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/driver_lib/cli_config_base/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/driver_lib/cli_config_base/CMakeLists.txt":"",
- "ydb/core/driver_lib/cli_config_base/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/driver_lib/cli_utils/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/driver_lib/cli_utils/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/driver_lib/cli_utils/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/driver_lib/cli_utils/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/driver_lib/cli_utils/CMakeLists.txt":"",
- "ydb/core/driver_lib/cli_utils/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/driver_lib/run/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/driver_lib/run/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/driver_lib/run/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/driver_lib/run/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/driver_lib/run/CMakeLists.txt":"",
- "ydb/core/driver_lib/run/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/driver_lib/run/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/driver_lib/run/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/driver_lib/run/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/driver_lib/run/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/driver_lib/run/ut/CMakeLists.txt":"",
- "ydb/core/driver_lib/run/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/driver_lib/version/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/driver_lib/version/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/driver_lib/version/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/driver_lib/version/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/driver_lib/version/CMakeLists.txt":"",
- "ydb/core/driver_lib/version/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/driver_lib/version/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/driver_lib/version/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/driver_lib/version/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/driver_lib/version/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/driver_lib/version/ut/CMakeLists.txt":"",
- "ydb/core/driver_lib/version/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/engine/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/engine/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/engine/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/engine/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/engine/CMakeLists.txt":"",
- "ydb/core/engine/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/engine/minikql/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/engine/minikql/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/engine/minikql/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/engine/minikql/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/engine/minikql/CMakeLists.txt":"",
- "ydb/core/engine/minikql/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/engine/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/engine/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/engine/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/engine/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/engine/ut/CMakeLists.txt":"",
- "ydb/core/engine/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/erasure/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/erasure/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/erasure/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/erasure/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/erasure/CMakeLists.txt":"",
- "ydb/core/erasure/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/erasure/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/erasure/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/erasure/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/erasure/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/erasure/ut/CMakeLists.txt":"",
- "ydb/core/erasure/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/erasure/ut_perf/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/erasure/ut_perf/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/erasure/ut_perf/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/erasure/ut_perf/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/erasure/ut_perf/CMakeLists.txt":"",
- "ydb/core/erasure/ut_perf/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/erasure/ut_rope/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/erasure/ut_rope/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/erasure/ut_rope/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/erasure/ut_rope/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/erasure/ut_rope/CMakeLists.txt":"",
- "ydb/core/erasure/ut_rope/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/external_sources/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/external_sources/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/external_sources/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/external_sources/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/external_sources/CMakeLists.txt":"",
- "ydb/core/external_sources/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/external_sources/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/external_sources/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/external_sources/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/external_sources/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/external_sources/ut/CMakeLists.txt":"",
- "ydb/core/external_sources/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/filestore/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/filestore/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/filestore/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/filestore/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/filestore/CMakeLists.txt":"",
- "ydb/core/filestore/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/filestore/core/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/filestore/core/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/filestore/core/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/filestore/core/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/filestore/core/CMakeLists.txt":"",
- "ydb/core/filestore/core/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/formats/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/formats/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/formats/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/formats/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/formats/CMakeLists.txt":"",
- "ydb/core/formats/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/formats/arrow/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/formats/arrow/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/formats/arrow/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/formats/arrow/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/formats/arrow/CMakeLists.txt":"",
- "ydb/core/formats/arrow/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/formats/arrow/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/formats/arrow/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/formats/arrow/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/formats/arrow/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/formats/arrow/common/CMakeLists.txt":"",
- "ydb/core/formats/arrow/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/formats/arrow/compression/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/formats/arrow/compression/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/formats/arrow/compression/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/formats/arrow/compression/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/formats/arrow/compression/CMakeLists.txt":"",
- "ydb/core/formats/arrow/compression/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/formats/arrow/dictionary/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/formats/arrow/dictionary/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/formats/arrow/dictionary/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/formats/arrow/dictionary/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/formats/arrow/dictionary/CMakeLists.txt":"",
- "ydb/core/formats/arrow/dictionary/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/formats/arrow/hash/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/formats/arrow/hash/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/formats/arrow/hash/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/formats/arrow/hash/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/formats/arrow/hash/CMakeLists.txt":"",
- "ydb/core/formats/arrow/hash/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/formats/arrow/reader/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/formats/arrow/reader/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/formats/arrow/reader/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/formats/arrow/reader/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/formats/arrow/reader/CMakeLists.txt":"",
- "ydb/core/formats/arrow/reader/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/formats/arrow/serializer/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/formats/arrow/serializer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/formats/arrow/serializer/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/formats/arrow/serializer/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/formats/arrow/serializer/CMakeLists.txt":"",
- "ydb/core/formats/arrow/serializer/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/formats/arrow/simple_builder/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/formats/arrow/simple_builder/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/formats/arrow/simple_builder/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/formats/arrow/simple_builder/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/formats/arrow/simple_builder/CMakeLists.txt":"",
- "ydb/core/formats/arrow/simple_builder/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/formats/arrow/switch/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/formats/arrow/switch/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/formats/arrow/switch/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/formats/arrow/switch/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/formats/arrow/switch/CMakeLists.txt":"",
- "ydb/core/formats/arrow/switch/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/formats/arrow/transformer/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/formats/arrow/transformer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/formats/arrow/transformer/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/formats/arrow/transformer/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/formats/arrow/transformer/CMakeLists.txt":"",
- "ydb/core/formats/arrow/transformer/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/formats/arrow/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/formats/arrow/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/formats/arrow/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/formats/arrow/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/formats/arrow/ut/CMakeLists.txt":"",
- "ydb/core/formats/arrow/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/CMakeLists.txt":"",
- "ydb/core/fq/libs/CMakeLists.txt":"",
- "ydb/core/fq/libs/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/actors/CMakeLists.txt":"",
- "ydb/core/fq/libs/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/actors/logging/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/actors/logging/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/actors/logging/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/actors/logging/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/actors/logging/CMakeLists.txt":"",
- "ydb/core/fq/libs/actors/logging/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/actors/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/actors/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/actors/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/actors/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/actors/ut/CMakeLists.txt":"",
- "ydb/core/fq/libs/actors/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/audit/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/audit/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/audit/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/audit/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/audit/CMakeLists.txt":"",
- "ydb/core/fq/libs/audit/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/audit/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/audit/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/audit/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/audit/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/audit/events/CMakeLists.txt":"",
- "ydb/core/fq/libs/audit/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/CMakeLists.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/events/CMakeLists.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/proto/CMakeLists.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/ut/CMakeLists.txt":"",
- "ydb/core/fq/libs/checkpoint_storage/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/checkpointing/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/checkpointing/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/checkpointing/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/checkpointing/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/checkpointing/CMakeLists.txt":"",
- "ydb/core/fq/libs/checkpointing/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/checkpointing/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/checkpointing/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/checkpointing/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/checkpointing/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/checkpointing/events/CMakeLists.txt":"",
- "ydb/core/fq/libs/checkpointing/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/checkpointing/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/checkpointing/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/checkpointing/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/checkpointing/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/checkpointing/ut/CMakeLists.txt":"",
- "ydb/core/fq/libs/checkpointing/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/checkpointing_common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/checkpointing_common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/checkpointing_common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/checkpointing_common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/checkpointing_common/CMakeLists.txt":"",
- "ydb/core/fq/libs/checkpointing_common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/cloud_audit/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/cloud_audit/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/cloud_audit/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/cloud_audit/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/cloud_audit/CMakeLists.txt":"",
- "ydb/core/fq/libs/cloud_audit/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/common/CMakeLists.txt":"",
- "ydb/core/fq/libs/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/common/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/common/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/common/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/common/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/common/ut/CMakeLists.txt":"",
- "ydb/core/fq/libs/common/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/compute/CMakeLists.txt":"",
- "ydb/core/fq/libs/compute/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/compute/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/compute/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/compute/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/compute/common/CMakeLists.txt":"",
- "ydb/core/fq/libs/compute/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/compute/common/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/compute/common/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/compute/common/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/compute/common/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/compute/common/ut/CMakeLists.txt":"",
- "ydb/core/fq/libs/compute/common/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/compute/ydb/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/compute/ydb/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/compute/ydb/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/compute/ydb/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/compute/ydb/CMakeLists.txt":"",
- "ydb/core/fq/libs/compute/ydb/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/compute/ydb/control_plane/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/compute/ydb/control_plane/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/compute/ydb/control_plane/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/compute/ydb/control_plane/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/compute/ydb/control_plane/CMakeLists.txt":"",
- "ydb/core/fq/libs/compute/ydb/control_plane/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/compute/ydb/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/compute/ydb/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/compute/ydb/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/compute/ydb/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/compute/ydb/events/CMakeLists.txt":"",
- "ydb/core/fq/libs/compute/ydb/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/compute/ydb/synchronization_service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/compute/ydb/synchronization_service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/compute/ydb/synchronization_service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/compute/ydb/synchronization_service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/compute/ydb/synchronization_service/CMakeLists.txt":"",
- "ydb/core/fq/libs/compute/ydb/synchronization_service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/config/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/config/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/config/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/config/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/config/CMakeLists.txt":"",
- "ydb/core/fq/libs/config/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/config/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/config/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/config/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/config/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/config/protos/CMakeLists.txt":"",
- "ydb/core/fq/libs/config/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_config/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/control_plane_config/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_config/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/control_plane_config/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_config/CMakeLists.txt":"",
- "ydb/core/fq/libs/control_plane_config/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_config/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/control_plane_config/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_config/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/control_plane_config/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_config/events/CMakeLists.txt":"",
- "ydb/core/fq/libs/control_plane_config/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/CMakeLists.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/actors/CMakeLists.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/events/CMakeLists.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/ut/CMakeLists.txt":"",
- "ydb/core/fq/libs/control_plane_proxy/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/CMakeLists.txt":"",
- "ydb/core/fq/libs/control_plane_storage/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/events/CMakeLists.txt":"",
- "ydb/core/fq/libs/control_plane_storage/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/internal/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/internal/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/internal/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/internal/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/internal/CMakeLists.txt":"",
- "ydb/core/fq/libs/control_plane_storage/internal/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/control_plane_storage/proto/CMakeLists.txt":"",
- "ydb/core/fq/libs/control_plane_storage/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/db_id_async_resolver_impl/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/db_id_async_resolver_impl/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/db_id_async_resolver_impl/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/db_id_async_resolver_impl/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/db_id_async_resolver_impl/CMakeLists.txt":"",
- "ydb/core/fq/libs/db_id_async_resolver_impl/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/db_id_async_resolver_impl/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/db_id_async_resolver_impl/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/db_id_async_resolver_impl/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/db_id_async_resolver_impl/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/db_id_async_resolver_impl/ut/CMakeLists.txt":"",
- "ydb/core/fq/libs/db_id_async_resolver_impl/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/db_schema/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/db_schema/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/db_schema/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/db_schema/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/db_schema/CMakeLists.txt":"",
- "ydb/core/fq/libs/db_schema/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/events/CMakeLists.txt":"",
- "ydb/core/fq/libs/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/exceptions/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/exceptions/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/exceptions/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/exceptions/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/exceptions/CMakeLists.txt":"",
- "ydb/core/fq/libs/exceptions/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/gateway/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/gateway/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/gateway/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/gateway/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/gateway/CMakeLists.txt":"",
- "ydb/core/fq/libs/gateway/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/graph_params/CMakeLists.txt":"",
- "ydb/core/fq/libs/graph_params/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/graph_params/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/graph_params/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/graph_params/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/graph_params/proto/CMakeLists.txt":"",
- "ydb/core/fq/libs/graph_params/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/grpc/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/grpc/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/grpc/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/grpc/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/grpc/CMakeLists.txt":"",
- "ydb/core/fq/libs/grpc/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/health/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/health/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/health/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/health/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/health/CMakeLists.txt":"",
- "ydb/core/fq/libs/health/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/hmac/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/hmac/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/hmac/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/hmac/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/hmac/CMakeLists.txt":"",
- "ydb/core/fq/libs/hmac/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/hmac/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/hmac/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/hmac/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/hmac/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/hmac/ut/CMakeLists.txt":"",
- "ydb/core/fq/libs/hmac/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/init/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/init/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/init/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/init/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/init/CMakeLists.txt":"",
- "ydb/core/fq/libs/init/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/logs/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/logs/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/logs/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/logs/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/logs/CMakeLists.txt":"",
- "ydb/core/fq/libs/logs/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/mock/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/mock/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/mock/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/mock/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/mock/CMakeLists.txt":"",
- "ydb/core/fq/libs/mock/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/pretty_printers/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/pretty_printers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/pretty_printers/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/pretty_printers/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/pretty_printers/CMakeLists.txt":"",
- "ydb/core/fq/libs/pretty_printers/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/private_client/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/private_client/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/private_client/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/private_client/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/private_client/CMakeLists.txt":"",
- "ydb/core/fq/libs/private_client/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/protos/CMakeLists.txt":"",
- "ydb/core/fq/libs/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/quota_manager/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/quota_manager/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/quota_manager/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/quota_manager/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/quota_manager/CMakeLists.txt":"",
- "ydb/core/fq/libs/quota_manager/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/quota_manager/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/quota_manager/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/quota_manager/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/quota_manager/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/quota_manager/events/CMakeLists.txt":"",
- "ydb/core/fq/libs/quota_manager/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/quota_manager/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/quota_manager/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/quota_manager/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/quota_manager/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/quota_manager/proto/CMakeLists.txt":"",
- "ydb/core/fq/libs/quota_manager/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/quota_manager/ut_helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/quota_manager/ut_helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/quota_manager/ut_helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/quota_manager/ut_helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/quota_manager/ut_helpers/CMakeLists.txt":"",
- "ydb/core/fq/libs/quota_manager/ut_helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/rate_limiter/CMakeLists.txt":"",
- "ydb/core/fq/libs/rate_limiter/control_plane_service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/rate_limiter/control_plane_service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/rate_limiter/control_plane_service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/rate_limiter/control_plane_service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/rate_limiter/control_plane_service/CMakeLists.txt":"",
- "ydb/core/fq/libs/rate_limiter/control_plane_service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/rate_limiter/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/rate_limiter/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/rate_limiter/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/rate_limiter/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/rate_limiter/events/CMakeLists.txt":"",
- "ydb/core/fq/libs/rate_limiter/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/rate_limiter/quoter_service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/rate_limiter/quoter_service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/rate_limiter/quoter_service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/rate_limiter/quoter_service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/rate_limiter/quoter_service/CMakeLists.txt":"",
- "ydb/core/fq/libs/rate_limiter/quoter_service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/rate_limiter/utils/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/rate_limiter/utils/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/rate_limiter/utils/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/rate_limiter/utils/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/rate_limiter/utils/CMakeLists.txt":"",
- "ydb/core/fq/libs/rate_limiter/utils/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/read_rule/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/read_rule/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/read_rule/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/read_rule/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/read_rule/CMakeLists.txt":"",
- "ydb/core/fq/libs/read_rule/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/result_formatter/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/result_formatter/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/result_formatter/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/result_formatter/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/result_formatter/CMakeLists.txt":"",
- "ydb/core/fq/libs/result_formatter/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/result_formatter/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/result_formatter/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/result_formatter/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/result_formatter/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/result_formatter/ut/CMakeLists.txt":"",
- "ydb/core/fq/libs/result_formatter/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/shared_resources/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/shared_resources/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/shared_resources/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/shared_resources/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/shared_resources/CMakeLists.txt":"",
- "ydb/core/fq/libs/shared_resources/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/shared_resources/interface/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/shared_resources/interface/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/shared_resources/interface/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/shared_resources/interface/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/shared_resources/interface/CMakeLists.txt":"",
- "ydb/core/fq/libs/shared_resources/interface/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/signer/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/signer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/signer/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/signer/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/signer/CMakeLists.txt":"",
- "ydb/core/fq/libs/signer/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/signer/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/signer/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/signer/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/signer/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/signer/ut/CMakeLists.txt":"",
- "ydb/core/fq/libs/signer/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/tasks_packer/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/tasks_packer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/tasks_packer/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/tasks_packer/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/tasks_packer/CMakeLists.txt":"",
- "ydb/core/fq/libs/tasks_packer/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/test_connection/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/test_connection/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/test_connection/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/test_connection/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/test_connection/CMakeLists.txt":"",
- "ydb/core/fq/libs/test_connection/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/test_connection/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/test_connection/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/test_connection/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/test_connection/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/test_connection/events/CMakeLists.txt":"",
- "ydb/core/fq/libs/test_connection/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/test_connection/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/test_connection/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/test_connection/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/test_connection/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/test_connection/ut/CMakeLists.txt":"",
- "ydb/core/fq/libs/test_connection/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/fq/libs/ydb/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/fq/libs/ydb/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/fq/libs/ydb/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/fq/libs/ydb/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/fq/libs/ydb/CMakeLists.txt":"",
- "ydb/core/fq/libs/ydb/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/grpc_caching/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/grpc_caching/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/grpc_caching/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/grpc_caching/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/grpc_caching/CMakeLists.txt":"",
- "ydb/core/grpc_caching/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/grpc_services/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/grpc_services/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/grpc_services/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/grpc_services/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/grpc_services/CMakeLists.txt":"",
- "ydb/core/grpc_services/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/grpc_services/auth_processor/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/grpc_services/auth_processor/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/grpc_services/auth_processor/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/grpc_services/auth_processor/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/grpc_services/auth_processor/CMakeLists.txt":"",
- "ydb/core/grpc_services/auth_processor/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/grpc_services/base/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/grpc_services/base/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/grpc_services/base/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/grpc_services/base/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/grpc_services/base/CMakeLists.txt":"",
- "ydb/core/grpc_services/base/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/grpc_services/cancelation/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/grpc_services/cancelation/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/grpc_services/cancelation/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/grpc_services/cancelation/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/grpc_services/cancelation/CMakeLists.txt":"",
- "ydb/core/grpc_services/cancelation/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/grpc_services/cancelation/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/grpc_services/cancelation/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/grpc_services/cancelation/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/grpc_services/cancelation/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/grpc_services/cancelation/protos/CMakeLists.txt":"",
- "ydb/core/grpc_services/cancelation/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/grpc_services/counters/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/grpc_services/counters/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/grpc_services/counters/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/grpc_services/counters/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/grpc_services/counters/CMakeLists.txt":"",
- "ydb/core/grpc_services/counters/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/grpc_services/local_rpc/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/grpc_services/local_rpc/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/grpc_services/local_rpc/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/grpc_services/local_rpc/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/grpc_services/local_rpc/CMakeLists.txt":"",
- "ydb/core/grpc_services/local_rpc/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/grpc_services/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/grpc_services/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/grpc_services/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/grpc_services/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/grpc_services/ut/CMakeLists.txt":"",
- "ydb/core/grpc_services/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/grpc_streaming/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/grpc_streaming/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/grpc_streaming/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/grpc_streaming/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/grpc_streaming/CMakeLists.txt":"",
- "ydb/core/grpc_streaming/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/grpc_streaming/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/grpc_streaming/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/grpc_streaming/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/grpc_streaming/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/grpc_streaming/ut/CMakeLists.txt":"",
- "ydb/core/grpc_streaming/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/grpc_streaming/ut/grpc/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/grpc_streaming/ut/grpc/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/grpc_streaming/ut/grpc/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/grpc_streaming/ut/grpc/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/grpc_streaming/ut/grpc/CMakeLists.txt":"",
- "ydb/core/grpc_streaming/ut/grpc/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/health_check/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/health_check/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/health_check/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/health_check/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/health_check/CMakeLists.txt":"",
- "ydb/core/health_check/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/health_check/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/health_check/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/health_check/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/health_check/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/health_check/ut/CMakeLists.txt":"",
- "ydb/core/health_check/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/http_proxy/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/http_proxy/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/http_proxy/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/http_proxy/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/http_proxy/CMakeLists.txt":"",
- "ydb/core/http_proxy/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/http_proxy/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/http_proxy/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/http_proxy/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/http_proxy/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/http_proxy/ut/CMakeLists.txt":"",
- "ydb/core/http_proxy/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/io_formats/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/io_formats/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/io_formats/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/io_formats/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/io_formats/CMakeLists.txt":"",
- "ydb/core/io_formats/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/io_formats/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/io_formats/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/io_formats/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/io_formats/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/io_formats/ut/CMakeLists.txt":"",
- "ydb/core/io_formats/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kafka_proxy/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kafka_proxy/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kafka_proxy/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kafka_proxy/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kafka_proxy/CMakeLists.txt":"",
- "ydb/core/kafka_proxy/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kafka_proxy/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kafka_proxy/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kafka_proxy/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kafka_proxy/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kafka_proxy/ut/CMakeLists.txt":"",
- "ydb/core/kafka_proxy/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kesus/CMakeLists.txt":"",
- "ydb/core/kesus/proxy/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kesus/proxy/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kesus/proxy/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kesus/proxy/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kesus/proxy/CMakeLists.txt":"",
- "ydb/core/kesus/proxy/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kesus/proxy/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kesus/proxy/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kesus/proxy/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kesus/proxy/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kesus/proxy/ut/CMakeLists.txt":"",
- "ydb/core/kesus/proxy/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kesus/tablet/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kesus/tablet/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kesus/tablet/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kesus/tablet/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kesus/tablet/CMakeLists.txt":"",
- "ydb/core/kesus/tablet/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kesus/tablet/quoter_performance_test/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kesus/tablet/quoter_performance_test/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kesus/tablet/quoter_performance_test/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kesus/tablet/quoter_performance_test/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kesus/tablet/quoter_performance_test/CMakeLists.txt":"",
- "ydb/core/kesus/tablet/quoter_performance_test/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kesus/tablet/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kesus/tablet/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kesus/tablet/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kesus/tablet/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kesus/tablet/ut/CMakeLists.txt":"",
- "ydb/core/kesus/tablet/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/keyvalue/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/keyvalue/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/keyvalue/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/keyvalue/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/keyvalue/CMakeLists.txt":"",
- "ydb/core/keyvalue/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/keyvalue/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/keyvalue/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/keyvalue/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/keyvalue/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/keyvalue/protos/CMakeLists.txt":"",
- "ydb/core/keyvalue/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/keyvalue/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/keyvalue/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/keyvalue/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/keyvalue/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/keyvalue/ut/CMakeLists.txt":"",
- "ydb/core/keyvalue/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/CMakeLists.txt":"",
- "ydb/core/kqp/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/common/CMakeLists.txt":"",
- "ydb/core/kqp/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/common/compilation/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/common/compilation/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/common/compilation/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/common/compilation/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/common/compilation/CMakeLists.txt":"",
- "ydb/core/kqp/common/compilation/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/common/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/common/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/common/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/common/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/common/events/CMakeLists.txt":"",
- "ydb/core/kqp/common/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/common/shutdown/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/common/shutdown/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/common/shutdown/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/common/shutdown/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/common/shutdown/CMakeLists.txt":"",
- "ydb/core/kqp/common/shutdown/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/common/simple/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/common/simple/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/common/simple/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/common/simple/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/common/simple/CMakeLists.txt":"",
- "ydb/core/kqp/common/simple/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/compile_service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/compile_service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/compile_service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/compile_service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/compile_service/CMakeLists.txt":"",
- "ydb/core/kqp/compile_service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/compute_actor/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/compute_actor/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/compute_actor/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/compute_actor/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/compute_actor/CMakeLists.txt":"",
- "ydb/core/kqp/compute_actor/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/counters/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/counters/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/counters/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/counters/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/counters/CMakeLists.txt":"",
- "ydb/core/kqp/counters/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/executer_actor/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/executer_actor/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/executer_actor/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/executer_actor/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/executer_actor/CMakeLists.txt":"",
- "ydb/core/kqp/executer_actor/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/executer_actor/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/executer_actor/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/executer_actor/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/executer_actor/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/executer_actor/ut/CMakeLists.txt":"",
- "ydb/core/kqp/executer_actor/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/expr_nodes/CMakeLists.txt":"",
- "ydb/core/kqp/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/federated_query/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/federated_query/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/federated_query/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/federated_query/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/federated_query/CMakeLists.txt":"",
- "ydb/core/kqp/federated_query/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/finalize_script_service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/finalize_script_service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/finalize_script_service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/finalize_script_service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/finalize_script_service/CMakeLists.txt":"",
- "ydb/core/kqp/finalize_script_service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/gateway/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/gateway/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/gateway/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/gateway/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/gateway/CMakeLists.txt":"",
- "ydb/core/kqp/gateway/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/gateway/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/gateway/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/gateway/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/gateway/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/gateway/actors/CMakeLists.txt":"",
- "ydb/core/kqp/gateway/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/gateway/behaviour/CMakeLists.txt":"",
- "ydb/core/kqp/gateway/behaviour/external_data_source/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/gateway/behaviour/external_data_source/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/gateway/behaviour/external_data_source/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/gateway/behaviour/external_data_source/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/gateway/behaviour/external_data_source/CMakeLists.txt":"",
- "ydb/core/kqp/gateway/behaviour/external_data_source/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/gateway/behaviour/table/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/gateway/behaviour/table/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/gateway/behaviour/table/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/gateway/behaviour/table/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/gateway/behaviour/table/CMakeLists.txt":"",
- "ydb/core/kqp/gateway/behaviour/table/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/gateway/behaviour/tablestore/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/gateway/behaviour/tablestore/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/gateway/behaviour/tablestore/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/gateway/behaviour/tablestore/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/gateway/behaviour/tablestore/CMakeLists.txt":"",
- "ydb/core/kqp/gateway/behaviour/tablestore/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/gateway/behaviour/tablestore/operations/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/gateway/behaviour/tablestore/operations/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/gateway/behaviour/tablestore/operations/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/gateway/behaviour/tablestore/operations/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/gateway/behaviour/tablestore/operations/CMakeLists.txt":"",
- "ydb/core/kqp/gateway/behaviour/tablestore/operations/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/gateway/local_rpc/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/gateway/local_rpc/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/gateway/local_rpc/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/gateway/local_rpc/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/gateway/local_rpc/CMakeLists.txt":"",
- "ydb/core/kqp/gateway/local_rpc/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/host/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/host/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/host/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/host/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/host/CMakeLists.txt":"",
- "ydb/core/kqp/host/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/node_service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/node_service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/node_service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/node_service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/node_service/CMakeLists.txt":"",
- "ydb/core/kqp/node_service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/node_service/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/node_service/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/node_service/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/node_service/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/node_service/ut/CMakeLists.txt":"",
- "ydb/core/kqp/node_service/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/opt/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/opt/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/opt/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/opt/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/opt/CMakeLists.txt":"",
- "ydb/core/kqp/opt/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/opt/logical/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/opt/logical/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/opt/logical/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/opt/logical/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/opt/logical/CMakeLists.txt":"",
- "ydb/core/kqp/opt/logical/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/opt/peephole/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/opt/peephole/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/opt/peephole/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/opt/peephole/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/opt/peephole/CMakeLists.txt":"",
- "ydb/core/kqp/opt/peephole/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/opt/physical/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/opt/physical/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/opt/physical/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/opt/physical/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/opt/physical/CMakeLists.txt":"",
- "ydb/core/kqp/opt/physical/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/opt/physical/effects/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/opt/physical/effects/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/opt/physical/effects/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/opt/physical/effects/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/opt/physical/effects/CMakeLists.txt":"",
- "ydb/core/kqp/opt/physical/effects/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/provider/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/provider/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/provider/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/provider/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/provider/CMakeLists.txt":"",
- "ydb/core/kqp/provider/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/provider/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/provider/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/provider/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/provider/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/provider/ut/CMakeLists.txt":"",
- "ydb/core/kqp/provider/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/proxy_service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/proxy_service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/proxy_service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/proxy_service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/proxy_service/CMakeLists.txt":"",
- "ydb/core/kqp/proxy_service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/proxy_service/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/proxy_service/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/proxy_service/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/proxy_service/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/proxy_service/proto/CMakeLists.txt":"",
- "ydb/core/kqp/proxy_service/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/proxy_service/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/proxy_service/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/proxy_service/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/proxy_service/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/proxy_service/ut/CMakeLists.txt":"",
- "ydb/core/kqp/proxy_service/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/query_compiler/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/query_compiler/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/query_compiler/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/query_compiler/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/query_compiler/CMakeLists.txt":"",
- "ydb/core/kqp/query_compiler/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/query_data/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/query_data/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/query_data/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/query_data/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/query_data/CMakeLists.txt":"",
- "ydb/core/kqp/query_data/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/rm_service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/rm_service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/rm_service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/rm_service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/rm_service/CMakeLists.txt":"",
- "ydb/core/kqp/rm_service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/rm_service/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/rm_service/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/rm_service/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/rm_service/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/rm_service/ut/CMakeLists.txt":"",
- "ydb/core/kqp/rm_service/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/run_script_actor/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/run_script_actor/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/run_script_actor/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/run_script_actor/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/run_script_actor/CMakeLists.txt":"",
- "ydb/core/kqp/run_script_actor/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/runtime/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/runtime/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/runtime/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/runtime/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/runtime/CMakeLists.txt":"",
- "ydb/core/kqp/runtime/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/runtime/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/runtime/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/runtime/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/runtime/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/runtime/ut/CMakeLists.txt":"",
- "ydb/core/kqp/runtime/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/session_actor/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/session_actor/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/session_actor/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/session_actor/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/session_actor/CMakeLists.txt":"",
- "ydb/core/kqp/session_actor/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/topics/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/topics/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/topics/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/topics/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/topics/CMakeLists.txt":"",
- "ydb/core/kqp/topics/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/CMakeLists.txt":"",
- "ydb/core/kqp/ut/arrow/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/arrow/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/arrow/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/arrow/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/arrow/CMakeLists.txt":"",
- "ydb/core/kqp/ut/arrow/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/common/CMakeLists.txt":"",
- "ydb/core/kqp/ut/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/cost/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/cost/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/cost/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/cost/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/cost/CMakeLists.txt":"",
- "ydb/core/kqp/ut/cost/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/data/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/data/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/data/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/data/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/data/CMakeLists.txt":"",
- "ydb/core/kqp/ut/data/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/effects/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/effects/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/effects/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/effects/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/effects/CMakeLists.txt":"",
- "ydb/core/kqp/ut/effects/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/federated_query/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/federated_query/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/CMakeLists.txt":"",
- "ydb/core/kqp/ut/federated_query/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/federated_query/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/federated_query/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/common/CMakeLists.txt":"",
- "ydb/core/kqp/ut/federated_query/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/generic/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/federated_query/generic/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/generic/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/federated_query/generic/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/generic/CMakeLists.txt":"",
- "ydb/core/kqp/ut/federated_query/generic_ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/federated_query/generic_ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/generic_ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/federated_query/generic_ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/generic_ut/CMakeLists.txt":"",
- "ydb/core/kqp/ut/federated_query/generic_ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/s3/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/federated_query/s3/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/s3/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/federated_query/s3/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/federated_query/s3/CMakeLists.txt":"",
- "ydb/core/kqp/ut/federated_query/s3/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/idx_test/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/idx_test/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/idx_test/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/idx_test/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/idx_test/CMakeLists.txt":"",
- "ydb/core/kqp/ut/idx_test/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/indexes/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/indexes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/indexes/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/indexes/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/indexes/CMakeLists.txt":"",
- "ydb/core/kqp/ut/indexes/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/join/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/join/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/join/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/join/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/join/CMakeLists.txt":"",
- "ydb/core/kqp/ut/join/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/olap/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/olap/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/olap/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/olap/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/olap/CMakeLists.txt":"",
- "ydb/core/kqp/ut/olap/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/opt/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/opt/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/opt/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/opt/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/opt/CMakeLists.txt":"",
- "ydb/core/kqp/ut/opt/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/perf/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/perf/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/perf/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/perf/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/perf/CMakeLists.txt":"",
- "ydb/core/kqp/ut/perf/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/pg/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/pg/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/pg/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/pg/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/pg/CMakeLists.txt":"",
- "ydb/core/kqp/ut/pg/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/query/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/query/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/query/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/query/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/query/CMakeLists.txt":"",
- "ydb/core/kqp/ut/query/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/scan/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/scan/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/scan/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/scan/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/scan/CMakeLists.txt":"",
- "ydb/core/kqp/ut/scan/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/scheme/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/scheme/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/scheme/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/scheme/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/scheme/CMakeLists.txt":"",
- "ydb/core/kqp/ut/scheme/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/service/CMakeLists.txt":"",
- "ydb/core/kqp/ut/service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/spilling/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/spilling/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/spilling/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/spilling/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/spilling/CMakeLists.txt":"",
- "ydb/core/kqp/ut/spilling/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/sysview/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/sysview/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/sysview/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/sysview/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/sysview/CMakeLists.txt":"",
- "ydb/core/kqp/ut/sysview/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/tx/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/tx/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/tx/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/tx/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/tx/CMakeLists.txt":"",
- "ydb/core/kqp/ut/tx/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/kqp/ut/yql/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/kqp/ut/yql/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/kqp/ut/yql/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/kqp/ut/yql/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/kqp/ut/yql/CMakeLists.txt":"",
- "ydb/core/kqp/ut/yql/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/load_test/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/load_test/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/load_test/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/load_test/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/load_test/CMakeLists.txt":"",
- "ydb/core/load_test/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/load_test/ut_ycsb/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/load_test/ut_ycsb/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/load_test/ut_ycsb/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/load_test/ut_ycsb/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/load_test/ut_ycsb/CMakeLists.txt":"",
- "ydb/core/load_test/ut_ycsb/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/local_pgwire/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/local_pgwire/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/local_pgwire/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/local_pgwire/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/local_pgwire/CMakeLists.txt":"",
- "ydb/core/local_pgwire/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/log_backend/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/log_backend/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/log_backend/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/log_backend/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/log_backend/CMakeLists.txt":"",
- "ydb/core/log_backend/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/metering/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/metering/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/metering/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/metering/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/metering/CMakeLists.txt":"",
- "ydb/core/metering/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/metering/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/metering/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/metering/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/metering/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/metering/ut/CMakeLists.txt":"",
- "ydb/core/metering/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/mind/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/mind/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/mind/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/mind/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/mind/CMakeLists.txt":"",
- "ydb/core/mind/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/mind/address_classification/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/mind/address_classification/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/mind/address_classification/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/mind/address_classification/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/mind/address_classification/CMakeLists.txt":"",
- "ydb/core/mind/address_classification/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/mind/address_classification/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/mind/address_classification/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/mind/address_classification/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/mind/address_classification/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/mind/address_classification/ut/CMakeLists.txt":"",
- "ydb/core/mind/address_classification/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/mind/bscontroller/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/mind/bscontroller/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/mind/bscontroller/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/mind/bscontroller/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/mind/bscontroller/CMakeLists.txt":"",
- "ydb/core/mind/bscontroller/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/mind/bscontroller/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/mind/bscontroller/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/mind/bscontroller/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/mind/bscontroller/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/mind/bscontroller/ut/CMakeLists.txt":"",
- "ydb/core/mind/bscontroller/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/mind/bscontroller/ut_bscontroller/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/mind/bscontroller/ut_bscontroller/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/mind/bscontroller/ut_bscontroller/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/mind/bscontroller/ut_bscontroller/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/mind/bscontroller/ut_bscontroller/CMakeLists.txt":"",
- "ydb/core/mind/bscontroller/ut_bscontroller/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/mind/bscontroller/ut_selfheal/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/mind/bscontroller/ut_selfheal/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/mind/bscontroller/ut_selfheal/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/mind/bscontroller/ut_selfheal/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/mind/bscontroller/ut_selfheal/CMakeLists.txt":"",
- "ydb/core/mind/bscontroller/ut_selfheal/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/mind/hive/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/mind/hive/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/mind/hive/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/mind/hive/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/mind/hive/CMakeLists.txt":"",
- "ydb/core/mind/hive/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/mind/hive/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/mind/hive/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/mind/hive/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/mind/hive/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/mind/hive/ut/CMakeLists.txt":"",
- "ydb/core/mind/hive/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/mind/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/mind/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/mind/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/mind/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/mind/ut/CMakeLists.txt":"",
- "ydb/core/mind/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/mind/ut_fat/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/mind/ut_fat/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/mind/ut_fat/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/mind/ut_fat/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/mind/ut_fat/CMakeLists.txt":"",
- "ydb/core/mind/ut_fat/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/mon/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/mon/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/mon/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/mon/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/mon/CMakeLists.txt":"",
- "ydb/core/mon/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/mon_alloc/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/mon_alloc/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/mon_alloc/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/mon_alloc/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/mon_alloc/CMakeLists.txt":"",
- "ydb/core/mon_alloc/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/node_whiteboard/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/node_whiteboard/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/node_whiteboard/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/node_whiteboard/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/node_whiteboard/CMakeLists.txt":"",
- "ydb/core/node_whiteboard/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/persqueue/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/persqueue/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/persqueue/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/persqueue/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/persqueue/CMakeLists.txt":"",
- "ydb/core/persqueue/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/persqueue/codecs/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/persqueue/codecs/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/persqueue/codecs/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/persqueue/codecs/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/persqueue/codecs/CMakeLists.txt":"",
- "ydb/core/persqueue/codecs/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/persqueue/config/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/persqueue/config/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/persqueue/config/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/persqueue/config/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/persqueue/config/CMakeLists.txt":"",
- "ydb/core/persqueue/config/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/persqueue/dread_cache_service/CMakeLists.txt":"",
- "ydb/core/persqueue/dread_cache_service/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/persqueue/dread_cache_service/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/persqueue/dread_cache_service/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/persqueue/dread_cache_service/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/persqueue/dread_cache_service/ut/CMakeLists.txt":"",
- "ydb/core/persqueue/dread_cache_service/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/persqueue/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/persqueue/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/persqueue/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/persqueue/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/persqueue/events/CMakeLists.txt":"",
- "ydb/core/persqueue/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/persqueue/partition_key_range/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/persqueue/partition_key_range/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/persqueue/partition_key_range/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/persqueue/partition_key_range/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/persqueue/partition_key_range/CMakeLists.txt":"",
- "ydb/core/persqueue/partition_key_range/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/persqueue/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/persqueue/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/persqueue/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/persqueue/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/persqueue/ut/CMakeLists.txt":"",
- "ydb/core/persqueue/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/persqueue/ut/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/persqueue/ut/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/persqueue/ut/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/persqueue/ut/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/persqueue/ut/common/CMakeLists.txt":"",
- "ydb/core/persqueue/ut/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/persqueue/ut/slow/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/persqueue/ut/slow/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/persqueue/ut/slow/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/persqueue/ut/slow/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/persqueue/ut/slow/CMakeLists.txt":"",
- "ydb/core/persqueue/ut/slow/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/persqueue/writer/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/persqueue/writer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/persqueue/writer/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/persqueue/writer/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/persqueue/writer/CMakeLists.txt":"",
- "ydb/core/persqueue/writer/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/pgproxy/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/pgproxy/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/pgproxy/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/pgproxy/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/pgproxy/CMakeLists.txt":"",
- "ydb/core/pgproxy/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/pgproxy/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/pgproxy/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/pgproxy/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/pgproxy/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/pgproxy/protos/CMakeLists.txt":"",
- "ydb/core/pgproxy/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/pgproxy/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/pgproxy/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/pgproxy/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/pgproxy/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/pgproxy/ut/CMakeLists.txt":"",
- "ydb/core/pgproxy/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/protos/CMakeLists.txt":"",
- "ydb/core/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/protos/out/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/protos/out/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/protos/out/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/protos/out/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/protos/out/CMakeLists.txt":"",
- "ydb/core/protos/out/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/public_http/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/public_http/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/public_http/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/public_http/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/public_http/CMakeLists.txt":"",
- "ydb/core/public_http/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/public_http/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/public_http/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/public_http/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/public_http/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/public_http/protos/CMakeLists.txt":"",
- "ydb/core/public_http/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/public_http/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/public_http/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/public_http/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/public_http/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/public_http/ut/CMakeLists.txt":"",
- "ydb/core/public_http/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/quoter/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/quoter/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/quoter/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/quoter/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/quoter/CMakeLists.txt":"",
- "ydb/core/quoter/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/quoter/public/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/quoter/public/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/quoter/public/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/quoter/public/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/quoter/public/CMakeLists.txt":"",
- "ydb/core/quoter/public/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/quoter/quoter_service_bandwidth_test/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/quoter/quoter_service_bandwidth_test/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/quoter/quoter_service_bandwidth_test/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/quoter/quoter_service_bandwidth_test/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/quoter/quoter_service_bandwidth_test/CMakeLists.txt":"",
- "ydb/core/quoter/quoter_service_bandwidth_test/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/quoter/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/quoter/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/quoter/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/quoter/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/quoter/ut/CMakeLists.txt":"",
- "ydb/core/raw_socket/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/raw_socket/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/raw_socket/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/raw_socket/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/raw_socket/CMakeLists.txt":"",
- "ydb/core/raw_socket/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/scheme/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/scheme/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/scheme/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/scheme/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/scheme/CMakeLists.txt":"",
- "ydb/core/scheme/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/scheme/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/scheme/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/scheme/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/scheme/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/scheme/protos/CMakeLists.txt":"",
- "ydb/core/scheme/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/scheme/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/scheme/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/scheme/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/scheme/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/scheme/ut/CMakeLists.txt":"",
- "ydb/core/scheme/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/scheme_types/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/scheme_types/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/scheme_types/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/scheme_types/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/scheme_types/CMakeLists.txt":"",
- "ydb/core/scheme_types/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/security/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/security/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/security/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/security/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/security/CMakeLists.txt":"",
- "ydb/core/security/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/security/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/security/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/security/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/security/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/security/ut/CMakeLists.txt":"",
- "ydb/core/security/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/statistics/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/statistics/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/statistics/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/statistics/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/statistics/CMakeLists.txt":"",
- "ydb/core/statistics/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/statistics/aggregator/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/statistics/aggregator/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/statistics/aggregator/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/statistics/aggregator/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/statistics/aggregator/CMakeLists.txt":"",
- "ydb/core/statistics/aggregator/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/statistics/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/statistics/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/statistics/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/statistics/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/statistics/ut/CMakeLists.txt":"",
- "ydb/core/statistics/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/sys_view/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/sys_view/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/sys_view/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/sys_view/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/sys_view/CMakeLists.txt":"",
- "ydb/core/sys_view/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/sys_view/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/sys_view/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/sys_view/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/sys_view/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/sys_view/common/CMakeLists.txt":"",
- "ydb/core/sys_view/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/sys_view/nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/sys_view/nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/sys_view/nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/sys_view/nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/sys_view/nodes/CMakeLists.txt":"",
- "ydb/core/sys_view/nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/sys_view/partition_stats/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/sys_view/partition_stats/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/sys_view/partition_stats/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/sys_view/partition_stats/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/sys_view/partition_stats/CMakeLists.txt":"",
- "ydb/core/sys_view/partition_stats/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/sys_view/partition_stats/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/sys_view/partition_stats/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/sys_view/partition_stats/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/sys_view/partition_stats/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/sys_view/partition_stats/ut/CMakeLists.txt":"",
- "ydb/core/sys_view/partition_stats/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/sys_view/processor/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/sys_view/processor/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/sys_view/processor/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/sys_view/processor/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/sys_view/processor/CMakeLists.txt":"",
- "ydb/core/sys_view/processor/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/sys_view/query_stats/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/sys_view/query_stats/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/sys_view/query_stats/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/sys_view/query_stats/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/sys_view/query_stats/CMakeLists.txt":"",
- "ydb/core/sys_view/query_stats/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/sys_view/query_stats/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/sys_view/query_stats/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/sys_view/query_stats/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/sys_view/query_stats/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/sys_view/query_stats/ut/CMakeLists.txt":"",
- "ydb/core/sys_view/query_stats/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/sys_view/service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/sys_view/service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/sys_view/service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/sys_view/service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/sys_view/service/CMakeLists.txt":"",
- "ydb/core/sys_view/service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/sys_view/service/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/sys_view/service/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/sys_view/service/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/sys_view/service/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/sys_view/service/ut/CMakeLists.txt":"",
- "ydb/core/sys_view/service/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/sys_view/storage/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/sys_view/storage/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/sys_view/storage/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/sys_view/storage/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/sys_view/storage/CMakeLists.txt":"",
- "ydb/core/sys_view/storage/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/sys_view/tablets/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/sys_view/tablets/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/sys_view/tablets/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/sys_view/tablets/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/sys_view/tablets/CMakeLists.txt":"",
- "ydb/core/sys_view/tablets/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/sys_view/ut_kqp/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/sys_view/ut_kqp/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/sys_view/ut_kqp/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/sys_view/ut_kqp/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/sys_view/ut_kqp/CMakeLists.txt":"",
- "ydb/core/sys_view/ut_kqp/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet/CMakeLists.txt":"",
- "ydb/core/tablet/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet/ut/CMakeLists.txt":"",
- "ydb/core/tablet/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet_flat/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet_flat/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet_flat/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet_flat/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet_flat/CMakeLists.txt":"",
- "ydb/core/tablet_flat/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet_flat/benchmark/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet_flat/benchmark/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet_flat/benchmark/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet_flat/benchmark/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet_flat/benchmark/CMakeLists.txt":"",
- "ydb/core/tablet_flat/benchmark/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet_flat/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet_flat/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet_flat/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet_flat/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet_flat/protos/CMakeLists.txt":"",
- "ydb/core/tablet_flat/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet_flat/test/CMakeLists.txt":"",
- "ydb/core/tablet_flat/test/libs/CMakeLists.txt":"",
- "ydb/core/tablet_flat/test/libs/exec/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet_flat/test/libs/exec/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet_flat/test/libs/exec/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet_flat/test/libs/exec/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet_flat/test/libs/exec/CMakeLists.txt":"",
- "ydb/core/tablet_flat/test/libs/exec/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet_flat/test/libs/rows/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet_flat/test/libs/rows/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet_flat/test/libs/rows/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet_flat/test/libs/rows/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet_flat/test/libs/rows/CMakeLists.txt":"",
- "ydb/core/tablet_flat/test/libs/rows/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet_flat/test/libs/table/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet_flat/test/libs/table/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet_flat/test/libs/table/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet_flat/test/libs/table/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet_flat/test/libs/table/CMakeLists.txt":"",
- "ydb/core/tablet_flat/test/libs/table/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet_flat/test/libs/table/model/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet_flat/test/libs/table/model/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet_flat/test/libs/table/model/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet_flat/test/libs/table/model/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet_flat/test/libs/table/model/CMakeLists.txt":"",
- "ydb/core/tablet_flat/test/libs/table/model/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet_flat/test/tool/CMakeLists.txt":"",
- "ydb/core/tablet_flat/test/tool/perf/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet_flat/test/tool/perf/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet_flat/test/tool/perf/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet_flat/test/tool/perf/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet_flat/test/tool/perf/CMakeLists.txt":"",
- "ydb/core/tablet_flat/test/tool/perf/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet_flat/test/tool/surg/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet_flat/test/tool/surg/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet_flat/test/tool/surg/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet_flat/test/tool/surg/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet_flat/test/tool/surg/CMakeLists.txt":"",
- "ydb/core/tablet_flat/test/tool/surg/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet_flat/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet_flat/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet_flat/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet_flat/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet_flat/ut/CMakeLists.txt":"",
- "ydb/core/tablet_flat/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet_flat/ut_large/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet_flat/ut_large/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet_flat/ut_large/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet_flat/ut_large/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet_flat/ut_large/CMakeLists.txt":"",
- "ydb/core/tablet_flat/ut_large/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet_flat/ut_pg/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet_flat/ut_pg/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet_flat/ut_pg/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet_flat/ut_pg/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet_flat/ut_pg/CMakeLists.txt":"",
- "ydb/core/tablet_flat/ut_pg/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tablet_flat/ut_util/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tablet_flat/ut_util/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tablet_flat/ut_util/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tablet_flat/ut_util/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tablet_flat/ut_util/CMakeLists.txt":"",
- "ydb/core/tablet_flat/ut_util/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/test_tablet/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/test_tablet/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/test_tablet/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/test_tablet/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/test_tablet/CMakeLists.txt":"",
- "ydb/core/test_tablet/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/testlib/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/testlib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/testlib/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/testlib/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/testlib/CMakeLists.txt":"",
- "ydb/core/testlib/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/testlib/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/testlib/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/testlib/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/testlib/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/testlib/actors/CMakeLists.txt":"",
- "ydb/core/testlib/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/testlib/actors/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/testlib/actors/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/testlib/actors/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/testlib/actors/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/testlib/actors/ut/CMakeLists.txt":"",
- "ydb/core/testlib/actors/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/testlib/basics/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/testlib/basics/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/testlib/basics/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/testlib/basics/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/testlib/basics/CMakeLists.txt":"",
- "ydb/core/testlib/basics/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/testlib/basics/default/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/testlib/basics/default/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/testlib/basics/default/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/testlib/basics/default/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/testlib/basics/default/CMakeLists.txt":"",
- "ydb/core/testlib/basics/default/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/testlib/default/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/testlib/default/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/testlib/default/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/testlib/default/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/testlib/default/CMakeLists.txt":"",
- "ydb/core/testlib/default/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/testlib/pg/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/testlib/pg/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/testlib/pg/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/testlib/pg/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/testlib/pg/CMakeLists.txt":"",
- "ydb/core/testlib/pg/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tracing/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tracing/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tracing/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tracing/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tracing/CMakeLists.txt":"",
- "ydb/core/tracing/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/CMakeLists.txt":"",
- "ydb/core/tx/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/balance_coverage/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/balance_coverage/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/balance_coverage/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/balance_coverage/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/balance_coverage/CMakeLists.txt":"",
- "ydb/core/tx/balance_coverage/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/balance_coverage/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/balance_coverage/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/balance_coverage/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/balance_coverage/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/balance_coverage/ut/CMakeLists.txt":"",
- "ydb/core/tx/balance_coverage/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/blobs_action/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/abstract/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/abstract/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/abstract/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/abstract/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/abstract/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/blobs_action/abstract/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/bs/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/bs/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/bs/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/bs/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/bs/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/blobs_action/bs/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/counters/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/counters/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/counters/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/counters/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/counters/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/blobs_action/counters/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/tier/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/tier/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/tier/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/tier/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/tier/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/blobs_action/transaction/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/transaction/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/transaction/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/transaction/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_action/transaction/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/blobs_action/transaction/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_reader/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/blobs_reader/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_reader/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/blobs_reader/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/blobs_reader/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/blobs_reader/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/common/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/common/tests/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/common/tests/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/common/tests/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/common/tests/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/common/tests/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/common/tests/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/counters/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/counters/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/counters/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/counters/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/counters/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/counters/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/counters/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/counters/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/counters/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/counters/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/counters/common/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/counters/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/changes/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/abstract/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/abstract/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/abstract/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/abstract/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/abstract/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/changes/abstract/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/compaction/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/compaction/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/compaction/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/compaction/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/compaction/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/changes/compaction/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/counters/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/counters/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/counters/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/counters/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/changes/counters/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/changes/counters/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/insert_table/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/insert_table/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/insert_table/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/insert_table/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/insert_table/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/insert_table/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/portions/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/portions/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/portions/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/portions/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/portions/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/portions/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/predicate/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/predicate/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/predicate/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/predicate/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/predicate/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/predicate/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/reader/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/reader/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/reader/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/reader/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/reader/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/reader/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/reader/plain_reader/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/reader/plain_reader/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/reader/plain_reader/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/reader/plain_reader/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/reader/plain_reader/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/reader/plain_reader/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/scheme/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/scheme/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/scheme/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/scheme/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/scheme/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/scheme/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/storage/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/abstract/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/abstract/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/abstract/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/abstract/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/abstract/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/abstract/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/intervals/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/intervals/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/intervals/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/intervals/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/intervals/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/intervals/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/lbuckets/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/lbuckets/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/lbuckets/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/lbuckets/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/lbuckets/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/lbuckets/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/levels/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/levels/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/levels/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/levels/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/levels/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/storage/optimizer/levels/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/ut/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/writer/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/engines/writer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/writer/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/engines/writer/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/engines/writer/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/engines/writer/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/hooks/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/hooks/abstract/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/hooks/abstract/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/hooks/abstract/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/hooks/abstract/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/hooks/abstract/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/hooks/abstract/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/hooks/testing/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/hooks/testing/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/hooks/testing/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/hooks/testing/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/hooks/testing/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/hooks/testing/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/normalizer/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/normalizer/abstract/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/normalizer/abstract/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/normalizer/abstract/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/normalizer/abstract/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/normalizer/abstract/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/normalizer/abstract/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/normalizer/granule/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/normalizer/granule/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/normalizer/granule/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/normalizer/granule/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/normalizer/granule/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/normalizer/granule/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/normalizer/portion/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/normalizer/portion/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/normalizer/portion/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/normalizer/portion/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/normalizer/portion/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/normalizer/portion/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/operations/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/operations/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/operations/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/operations/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/operations/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/operations/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/resource_subscriber/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/resource_subscriber/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/resource_subscriber/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/resource_subscriber/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/resource_subscriber/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/resource_subscriber/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/resources/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/resources/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/resources/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/resources/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/resources/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/resources/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/splitter/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/splitter/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/splitter/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/splitter/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/splitter/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/splitter/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/splitter/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/splitter/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/splitter/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/splitter/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/splitter/ut/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/splitter/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/ut_rw/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/ut_rw/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/ut_rw/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/ut_rw/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/ut_rw/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/ut_rw/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/columnshard/ut_schema/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/columnshard/ut_schema/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/columnshard/ut_schema/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/columnshard/ut_schema/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/columnshard/ut_schema/CMakeLists.txt":"",
- "ydb/core/tx/columnshard/ut_schema/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/conveyor/CMakeLists.txt":"",
- "ydb/core/tx/conveyor/service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/conveyor/service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/conveyor/service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/conveyor/service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/conveyor/service/CMakeLists.txt":"",
- "ydb/core/tx/conveyor/service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/conveyor/usage/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/conveyor/usage/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/conveyor/usage/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/conveyor/usage/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/conveyor/usage/CMakeLists.txt":"",
- "ydb/core/tx/conveyor/usage/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/coordinator/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/coordinator/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/coordinator/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/coordinator/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/coordinator/CMakeLists.txt":"",
- "ydb/core/tx/coordinator/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/coordinator/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/coordinator/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/coordinator/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/coordinator/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/coordinator/protos/CMakeLists.txt":"",
- "ydb/core/tx/coordinator/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/coordinator/public/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/coordinator/public/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/coordinator/public/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/coordinator/public/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/coordinator/public/CMakeLists.txt":"",
- "ydb/core/tx/coordinator/public/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/coordinator/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/coordinator/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/coordinator/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/coordinator/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/coordinator/ut/CMakeLists.txt":"",
- "ydb/core/tx/coordinator/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/data_events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/data_events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/data_events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/data_events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/data_events/CMakeLists.txt":"",
- "ydb/core/tx/data_events/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/CMakeLists.txt":"",
- "ydb/core/tx/datashard/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_background_compaction/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_background_compaction/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_background_compaction/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_background_compaction/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_background_compaction/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_background_compaction/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_build_index/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_build_index/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_build_index/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_build_index/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_build_index/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_build_index/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_change_collector/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_change_collector/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_change_collector/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_change_collector/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_change_collector/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_change_collector/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_change_exchange/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_change_exchange/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_change_exchange/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_change_exchange/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_change_exchange/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_change_exchange/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_common/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_compaction/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_compaction/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_compaction/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_compaction/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_compaction/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_compaction/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_erase_rows/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_erase_rows/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_erase_rows/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_erase_rows/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_erase_rows/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_erase_rows/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_followers/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_followers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_followers/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_followers/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_followers/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_followers/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_init/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_init/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_init/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_init/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_init/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_init/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_keys/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_keys/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_keys/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_keys/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_keys/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_keys/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_kqp/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_kqp/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_kqp/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_kqp/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_kqp/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_kqp/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_kqp_errors/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_kqp_errors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_kqp_errors/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_kqp_errors/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_kqp_errors/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_kqp_errors/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_kqp_scan/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_kqp_scan/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_kqp_scan/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_kqp_scan/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_kqp_scan/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_kqp_scan/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_locks/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_locks/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_locks/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_locks/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_locks/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_locks/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_minikql/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_minikql/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_minikql/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_minikql/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_minikql/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_minikql/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_minstep/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_minstep/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_minstep/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_minstep/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_minstep/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_minstep/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_order/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_order/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_order/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_order/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_order/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_order/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_range_avl_tree/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_range_avl_tree/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_range_avl_tree/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_range_avl_tree/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_range_avl_tree/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_range_avl_tree/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_range_ops/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_range_ops/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_range_ops/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_range_ops/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_range_ops/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_range_ops/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_range_treap/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_range_treap/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_range_treap/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_range_treap/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_range_treap/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_range_treap/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_read_iterator/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_read_iterator/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_read_iterator/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_read_iterator/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_read_iterator/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_read_iterator/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_read_table/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_read_table/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_read_table/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_read_table/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_read_table/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_read_table/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_reassign/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_reassign/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_reassign/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_reassign/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_reassign/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_reassign/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_replication/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_replication/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_replication/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_replication/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_replication/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_replication/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_rs/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_rs/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_rs/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_rs/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_rs/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_rs/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_sequence/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_sequence/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_sequence/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_sequence/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_sequence/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_sequence/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_snapshot/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_snapshot/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_snapshot/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_snapshot/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_snapshot/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_snapshot/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_stats/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_stats/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_stats/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_stats/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_stats/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_stats/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_upload_rows/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_upload_rows/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_upload_rows/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_upload_rows/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_upload_rows/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_upload_rows/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_volatile/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_volatile/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_volatile/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_volatile/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_volatile/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_volatile/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_write/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/datashard/ut_write/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_write/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/datashard/ut_write/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/datashard/ut_write/CMakeLists.txt":"",
- "ydb/core/tx/datashard/ut_write/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/long_tx_service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/long_tx_service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/long_tx_service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/long_tx_service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/long_tx_service/CMakeLists.txt":"",
- "ydb/core/tx/long_tx_service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/long_tx_service/public/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/long_tx_service/public/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/long_tx_service/public/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/long_tx_service/public/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/long_tx_service/public/CMakeLists.txt":"",
- "ydb/core/tx/long_tx_service/public/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/long_tx_service/public/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/long_tx_service/public/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/long_tx_service/public/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/long_tx_service/public/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/long_tx_service/public/ut/CMakeLists.txt":"",
- "ydb/core/tx/long_tx_service/public/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/long_tx_service/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/long_tx_service/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/long_tx_service/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/long_tx_service/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/long_tx_service/ut/CMakeLists.txt":"",
- "ydb/core/tx/long_tx_service/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/mediator/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/mediator/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/mediator/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/mediator/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/mediator/CMakeLists.txt":"",
- "ydb/core/tx/mediator/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/program/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/program/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/program/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/program/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/program/CMakeLists.txt":"",
- "ydb/core/tx/program/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/replication/CMakeLists.txt":"",
- "ydb/core/tx/replication/controller/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/replication/controller/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/replication/controller/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/replication/controller/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/replication/controller/CMakeLists.txt":"",
- "ydb/core/tx/replication/controller/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/replication/service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/replication/service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/replication/service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/replication/service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/replication/service/CMakeLists.txt":"",
- "ydb/core/tx/replication/service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/replication/ydb_proxy/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/replication/ydb_proxy/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/replication/ydb_proxy/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/replication/ydb_proxy/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/replication/ydb_proxy/CMakeLists.txt":"",
- "ydb/core/tx/replication/ydb_proxy/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/replication/ydb_proxy/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/replication/ydb_proxy/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/replication/ydb_proxy/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/replication/ydb_proxy/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/replication/ydb_proxy/ut/CMakeLists.txt":"",
- "ydb/core/tx/replication/ydb_proxy/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/scheme_board/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/scheme_board/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/scheme_board/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/scheme_board/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/scheme_board/CMakeLists.txt":"",
- "ydb/core/tx/scheme_board/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_cache/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/scheme_board/ut_cache/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_cache/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/scheme_board/ut_cache/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_cache/CMakeLists.txt":"",
- "ydb/core/tx/scheme_board/ut_cache/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_double_indexed/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/scheme_board/ut_double_indexed/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_double_indexed/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/scheme_board/ut_double_indexed/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_double_indexed/CMakeLists.txt":"",
- "ydb/core/tx/scheme_board/ut_double_indexed/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_monitoring/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/scheme_board/ut_monitoring/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_monitoring/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/scheme_board/ut_monitoring/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_monitoring/CMakeLists.txt":"",
- "ydb/core/tx/scheme_board/ut_monitoring/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_populator/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/scheme_board/ut_populator/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_populator/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/scheme_board/ut_populator/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_populator/CMakeLists.txt":"",
- "ydb/core/tx/scheme_board/ut_populator/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_replica/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/scheme_board/ut_replica/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_replica/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/scheme_board/ut_replica/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_replica/CMakeLists.txt":"",
- "ydb/core/tx/scheme_board/ut_replica/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_subscriber/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/scheme_board/ut_subscriber/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_subscriber/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/scheme_board/ut_subscriber/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/scheme_board/ut_subscriber/CMakeLists.txt":"",
- "ydb/core/tx/scheme_board/ut_subscriber/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/scheme_cache/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/scheme_cache/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/scheme_cache/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/scheme_cache/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/scheme_cache/CMakeLists.txt":"",
- "ydb/core/tx/scheme_cache/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_auditsettings/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_auditsettings/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_auditsettings/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_auditsettings/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_auditsettings/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_auditsettings/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_backup/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_backup/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_backup/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_backup/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_backup/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_backup/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_base/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_base/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_base/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_base/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_base/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_base/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_base_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_base_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_base_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_base_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_base_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_base_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_bsvolume/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_bsvolume/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_bsvolume/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_bsvolume/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_bsvolume/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_bsvolume/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_bsvolume_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_bsvolume_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_bsvolume_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_bsvolume_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_bsvolume_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_bsvolume_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_cdc_stream/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_cdc_stream/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_cdc_stream/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_cdc_stream/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_cdc_stream/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_cdc_stream/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_cdc_stream_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_cdc_stream_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_cdc_stream_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_cdc_stream_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_cdc_stream_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_cdc_stream_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_column_build/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_column_build/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_column_build/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_column_build/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_column_build/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_column_build/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_compaction/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_compaction/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_compaction/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_compaction/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_compaction/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_compaction/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_export/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_export/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_export/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_export/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_export/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_export/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_export_reboots_s3/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_export_reboots_s3/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_export_reboots_s3/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_export_reboots_s3/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_export_reboots_s3/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_export_reboots_s3/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_data_source/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_data_source/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_data_source/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_data_source/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_data_source/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_external_data_source/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_data_source_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_data_source_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_data_source_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_data_source_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_data_source_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_external_data_source_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_table/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_table/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_table/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_table/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_table/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_external_table/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_table_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_table_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_table_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_table_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_external_table_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_external_table_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_extsubdomain/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_extsubdomain/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_extsubdomain/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_extsubdomain/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_extsubdomain/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_extsubdomain/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_extsubdomain_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_extsubdomain_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_extsubdomain_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_extsubdomain_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_extsubdomain_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_extsubdomain_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_filestore_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_filestore_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_filestore_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_filestore_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_filestore_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_filestore_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_helpers/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_index/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_index/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_index/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_index/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_index/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_index/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_index_build/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_index_build/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_index_build/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_index_build/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_index_build/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_index_build/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_index_build_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_index_build_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_index_build_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_index_build_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_index_build_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_index_build_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_login/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_login/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_login/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_login/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_login/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_login/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_move/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_move/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_move/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_move/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_move/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_move/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_move_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_move_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_move_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_move_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_move_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_move_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_olap/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_olap/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_olap/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_olap/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_olap/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_olap/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_olap_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_olap_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_olap_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_olap_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_olap_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_olap_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_pq_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_pq_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_pq_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_pq_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_pq_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_pq_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_replication/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_replication/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_replication/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_replication/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_replication/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_replication/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_replication_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_replication_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_replication_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_replication_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_replication_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_replication_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_restore/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_restore/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_restore/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_restore/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_restore/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_restore/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_rtmr/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_rtmr/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_rtmr/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_rtmr/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_rtmr/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_rtmr/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_rtmr_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_rtmr_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_rtmr_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_rtmr_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_rtmr_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_rtmr_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_ru_calculator/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_ru_calculator/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_ru_calculator/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_ru_calculator/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_ru_calculator/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_ru_calculator/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_sequence/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_sequence/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_sequence/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_sequence/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_sequence/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_sequence/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_sequence_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_sequence_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_sequence_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_sequence_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_sequence_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_sequence_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_serverless/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_serverless/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_serverless/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_serverless/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_serverless/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_serverless/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_serverless_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_serverless_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_serverless_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_serverless_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_serverless_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_serverless_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_split_merge/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_split_merge/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_split_merge/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_split_merge/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_split_merge/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_split_merge/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_split_merge_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_split_merge_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_split_merge_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_split_merge_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_split_merge_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_split_merge_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_stats/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_stats/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_stats/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_stats/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_stats/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_stats/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_subdomain/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_subdomain/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_subdomain/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_subdomain/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_subdomain/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_subdomain/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_subdomain_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_subdomain_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_subdomain_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_subdomain_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_subdomain_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_subdomain_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_topic_splitmerge/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_topic_splitmerge/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_topic_splitmerge/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_topic_splitmerge/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_topic_splitmerge/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_topic_splitmerge/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_ttl/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_ttl/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_ttl/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_ttl/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_ttl/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_ttl/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_user_attributes/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_user_attributes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_user_attributes/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_user_attributes/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_user_attributes/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_user_attributes/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_user_attributes_reboots/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_user_attributes_reboots/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_user_attributes_reboots/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_user_attributes_reboots/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_user_attributes_reboots/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_user_attributes_reboots/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_view/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/schemeshard/ut_view/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_view/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/schemeshard/ut_view/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/schemeshard/ut_view/CMakeLists.txt":"",
- "ydb/core/tx/schemeshard/ut_view/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/sequenceproxy/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/sequenceproxy/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/sequenceproxy/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/sequenceproxy/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/sequenceproxy/CMakeLists.txt":"",
- "ydb/core/tx/sequenceproxy/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/sequenceproxy/public/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/sequenceproxy/public/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/sequenceproxy/public/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/sequenceproxy/public/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/sequenceproxy/public/CMakeLists.txt":"",
- "ydb/core/tx/sequenceproxy/public/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/sequenceproxy/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/sequenceproxy/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/sequenceproxy/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/sequenceproxy/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/sequenceproxy/ut/CMakeLists.txt":"",
- "ydb/core/tx/sequenceproxy/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/sequenceshard/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/sequenceshard/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/sequenceshard/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/sequenceshard/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/sequenceshard/CMakeLists.txt":"",
- "ydb/core/tx/sequenceshard/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/sequenceshard/public/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/sequenceshard/public/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/sequenceshard/public/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/sequenceshard/public/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/sequenceshard/public/CMakeLists.txt":"",
- "ydb/core/tx/sequenceshard/public/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/sequenceshard/public/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/sequenceshard/public/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/sequenceshard/public/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/sequenceshard/public/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/sequenceshard/public/ut/CMakeLists.txt":"",
- "ydb/core/tx/sequenceshard/public/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/sequenceshard/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/sequenceshard/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/sequenceshard/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/sequenceshard/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/sequenceshard/ut/CMakeLists.txt":"",
- "ydb/core/tx/sequenceshard/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/sharding/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/sharding/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/sharding/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/sharding/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/sharding/CMakeLists.txt":"",
- "ydb/core/tx/sharding/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/sharding/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/sharding/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/sharding/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/sharding/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/sharding/ut/CMakeLists.txt":"",
- "ydb/core/tx/sharding/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tiering/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tiering/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tiering/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tiering/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tiering/CMakeLists.txt":"",
- "ydb/core/tx/tiering/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tiering/rule/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tiering/rule/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tiering/rule/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tiering/rule/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tiering/rule/CMakeLists.txt":"",
- "ydb/core/tx/tiering/rule/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tiering/tier/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tiering/tier/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tiering/tier/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tiering/tier/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tiering/tier/CMakeLists.txt":"",
- "ydb/core/tx/tiering/tier/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tiering/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tiering/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tiering/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tiering/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tiering/ut/CMakeLists.txt":"",
- "ydb/core/tx/tiering/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/time_cast/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/time_cast/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/time_cast/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/time_cast/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/time_cast/CMakeLists.txt":"",
- "ydb/core/tx/time_cast/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/time_cast/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/time_cast/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/time_cast/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/time_cast/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/time_cast/ut/CMakeLists.txt":"",
- "ydb/core/tx/time_cast/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tracing/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tracing/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tracing/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tracing/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tracing/CMakeLists.txt":"",
- "ydb/core/tx/tracing/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tracing/service/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tracing/service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tracing/service/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tracing/service/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tracing/service/CMakeLists.txt":"",
- "ydb/core/tx/tracing/service/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tracing/usage/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tracing/usage/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tracing/usage/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tracing/usage/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tracing/usage/CMakeLists.txt":"",
- "ydb/core/tx/tracing/usage/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tx_allocator/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tx_allocator/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tx_allocator/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tx_allocator/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tx_allocator/CMakeLists.txt":"",
- "ydb/core/tx/tx_allocator/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tx_allocator/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tx_allocator/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tx_allocator/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tx_allocator/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tx_allocator/ut/CMakeLists.txt":"",
- "ydb/core/tx/tx_allocator/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tx_allocator_client/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tx_allocator_client/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tx_allocator_client/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tx_allocator_client/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tx_allocator_client/CMakeLists.txt":"",
- "ydb/core/tx/tx_allocator_client/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tx_allocator_client/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tx_allocator_client/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tx_allocator_client/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tx_allocator_client/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tx_allocator_client/ut/CMakeLists.txt":"",
- "ydb/core/tx/tx_allocator_client/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tx_proxy/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tx_proxy/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/CMakeLists.txt":"",
- "ydb/core/tx/tx_proxy/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/ut_base_tenant/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tx_proxy/ut_base_tenant/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/ut_base_tenant/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tx_proxy/ut_base_tenant/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/ut_base_tenant/CMakeLists.txt":"",
- "ydb/core/tx/tx_proxy/ut_base_tenant/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/ut_encrypted_storage/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tx_proxy/ut_encrypted_storage/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/ut_encrypted_storage/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tx_proxy/ut_encrypted_storage/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/ut_encrypted_storage/CMakeLists.txt":"",
- "ydb/core/tx/tx_proxy/ut_encrypted_storage/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/ut_ext_tenant/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tx_proxy/ut_ext_tenant/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/ut_ext_tenant/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tx_proxy/ut_ext_tenant/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/ut_ext_tenant/CMakeLists.txt":"",
- "ydb/core/tx/tx_proxy/ut_ext_tenant/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/ut_storage_tenant/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/tx/tx_proxy/ut_storage_tenant/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/ut_storage_tenant/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/tx/tx_proxy/ut_storage_tenant/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/tx/tx_proxy/ut_storage_tenant/CMakeLists.txt":"",
- "ydb/core/tx/tx_proxy/ut_storage_tenant/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/util/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/util/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/util/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/util/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/util/CMakeLists.txt":"",
- "ydb/core/util/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/util/btree_benchmark/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/util/btree_benchmark/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/util/btree_benchmark/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/util/btree_benchmark/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/util/btree_benchmark/CMakeLists.txt":"",
- "ydb/core/util/btree_benchmark/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/util/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/util/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/util/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/util/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/util/ut/CMakeLists.txt":"",
- "ydb/core/util/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/viewer/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/viewer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/viewer/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/viewer/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/viewer/CMakeLists.txt":"",
- "ydb/core/viewer/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/viewer/json/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/viewer/json/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/viewer/json/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/viewer/json/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/viewer/json/CMakeLists.txt":"",
- "ydb/core/viewer/json/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/viewer/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/viewer/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/viewer/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/viewer/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/viewer/protos/CMakeLists.txt":"",
- "ydb/core/viewer/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/viewer/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/viewer/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/viewer/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/viewer/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/viewer/ut/CMakeLists.txt":"",
- "ydb/core/viewer/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/wrappers/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/wrappers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/wrappers/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/wrappers/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/wrappers/CMakeLists.txt":"",
- "ydb/core/wrappers/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/wrappers/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/wrappers/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/wrappers/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/wrappers/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/wrappers/events/CMakeLists.txt":"",
- "ydb/core/wrappers/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/wrappers/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/wrappers/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/wrappers/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/wrappers/ut/CMakeLists.txt":"",
- "ydb/core/wrappers/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/wrappers/ut_helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/wrappers/ut_helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/wrappers/ut_helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/wrappers/ut_helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/wrappers/ut_helpers/CMakeLists.txt":"",
- "ydb/core/wrappers/ut_helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ydb_convert/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ydb_convert/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ydb_convert/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ydb_convert/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ydb_convert/CMakeLists.txt":"",
- "ydb/core/ydb_convert/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ydb_convert/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ydb_convert/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ydb_convert/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ydb_convert/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ydb_convert/ut/CMakeLists.txt":"",
- "ydb/core/ydb_convert/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/CMakeLists.txt":"",
- "ydb/core/ymq/actor/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/actor/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/actor/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/actor/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/actor/CMakeLists.txt":"",
- "ydb/core/ymq/actor/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/actor/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/actor/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/actor/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/actor/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/actor/ut/CMakeLists.txt":"",
- "ydb/core/ymq/actor/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/actor/yc_search_ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/actor/yc_search_ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/actor/yc_search_ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/actor/yc_search_ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/actor/yc_search_ut/CMakeLists.txt":"",
- "ydb/core/ymq/actor/yc_search_ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/base/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/base/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/base/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/base/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/base/CMakeLists.txt":"",
- "ydb/core/ymq/base/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/base/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/base/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/base/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/base/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/base/ut/CMakeLists.txt":"",
- "ydb/core/ymq/base/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/client/CMakeLists.txt":"",
- "ydb/core/ymq/client/bin/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/client/bin/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/client/bin/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/client/bin/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/client/bin/CMakeLists.txt":"",
- "ydb/core/ymq/client/bin/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/client/cpp/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/client/cpp/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/client/cpp/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/client/cpp/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/client/cpp/CMakeLists.txt":"",
- "ydb/core/ymq/client/cpp/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/http/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/http/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/http/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/http/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/http/CMakeLists.txt":"",
- "ydb/core/ymq/http/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/http/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/http/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/http/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/http/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/http/ut/CMakeLists.txt":"",
- "ydb/core/ymq/http/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/proto/CMakeLists.txt":"",
- "ydb/core/ymq/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/queues/CMakeLists.txt":"",
- "ydb/core/ymq/queues/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/queues/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/queues/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/queues/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/queues/common/CMakeLists.txt":"",
- "ydb/core/ymq/queues/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/queues/fifo/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/queues/fifo/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/queues/fifo/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/queues/fifo/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/queues/fifo/CMakeLists.txt":"",
- "ydb/core/ymq/queues/fifo/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/queues/std/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/queues/std/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/queues/std/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/queues/std/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/queues/std/CMakeLists.txt":"",
- "ydb/core/ymq/queues/std/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/ymq/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/ymq/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/ymq/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/ymq/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/ymq/ut/CMakeLists.txt":"",
- "ydb/core/ymq/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/core/yql_testlib/CMakeLists.darwin-arm64.txt":"",
- "ydb/core/yql_testlib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/core/yql_testlib/CMakeLists.linux-aarch64.txt":"",
- "ydb/core/yql_testlib/CMakeLists.linux-x86_64.txt":"",
- "ydb/core/yql_testlib/CMakeLists.txt":"",
- "ydb/core/yql_testlib/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/CMakeLists.txt":"",
- "ydb/library/accessor/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/accessor/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/accessor/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/accessor/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/accessor/CMakeLists.txt":"",
- "ydb/library/accessor/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/aclib/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/aclib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/aclib/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/aclib/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/aclib/CMakeLists.txt":"",
- "ydb/library/aclib/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/aclib/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/aclib/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/aclib/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/aclib/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/aclib/protos/CMakeLists.txt":"",
- "ydb/library/aclib/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/aclib/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/aclib/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/aclib/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/aclib/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/aclib/ut/CMakeLists.txt":"",
- "ydb/library/aclib/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/CMakeLists.txt":"",
- "ydb/library/actors/actor_type/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/actor_type/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/actor_type/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/actor_type/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/actor_type/CMakeLists.txt":"",
- "ydb/library/actors/actor_type/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/core/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/core/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/core/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/core/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/core/CMakeLists.txt":"",
- "ydb/library/actors/core/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/core/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/core/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/core/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/core/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/core/ut/CMakeLists.txt":"",
- "ydb/library/actors/core/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/core/ut_fat/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/core/ut_fat/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/core/ut_fat/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/core/ut_fat/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/core/ut_fat/CMakeLists.txt":"",
- "ydb/library/actors/core/ut_fat/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/cppcoro/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/cppcoro/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/cppcoro/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/cppcoro/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/cppcoro/CMakeLists.txt":"",
- "ydb/library/actors/cppcoro/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/cppcoro/corobenchmark/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/cppcoro/corobenchmark/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/cppcoro/corobenchmark/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/cppcoro/corobenchmark/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/cppcoro/corobenchmark/CMakeLists.txt":"",
- "ydb/library/actors/cppcoro/corobenchmark/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/cppcoro/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/cppcoro/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/cppcoro/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/cppcoro/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/cppcoro/ut/CMakeLists.txt":"",
- "ydb/library/actors/cppcoro/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/dnscachelib/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/dnscachelib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/dnscachelib/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/dnscachelib/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/dnscachelib/CMakeLists.txt":"",
- "ydb/library/actors/dnscachelib/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/dnsresolver/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/dnsresolver/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/dnsresolver/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/dnsresolver/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/dnsresolver/CMakeLists.txt":"",
- "ydb/library/actors/dnsresolver/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/dnsresolver/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/dnsresolver/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/dnsresolver/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/dnsresolver/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/dnsresolver/ut/CMakeLists.txt":"",
- "ydb/library/actors/dnsresolver/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/examples/01_ping_pong/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/examples/01_ping_pong/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/examples/01_ping_pong/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/examples/01_ping_pong/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/examples/01_ping_pong/CMakeLists.txt":"",
- "ydb/library/actors/examples/01_ping_pong/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/examples/02_discovery/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/examples/02_discovery/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/examples/02_discovery/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/examples/02_discovery/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/examples/02_discovery/CMakeLists.txt":"",
- "ydb/library/actors/examples/02_discovery/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/examples/CMakeLists.txt":"",
- "ydb/library/actors/helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/helpers/CMakeLists.txt":"",
- "ydb/library/actors/helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/helpers/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/helpers/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/helpers/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/helpers/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/helpers/ut/CMakeLists.txt":"",
- "ydb/library/actors/helpers/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/http/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/http/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/http/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/http/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/http/CMakeLists.txt":"",
- "ydb/library/actors/http/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/http/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/http/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/http/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/http/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/http/ut/CMakeLists.txt":"",
- "ydb/library/actors/http/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/interconnect/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/interconnect/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/interconnect/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/interconnect/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/interconnect/CMakeLists.txt":"",
- "ydb/library/actors/interconnect/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/interconnect/mock/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/interconnect/mock/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/interconnect/mock/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/interconnect/mock/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/interconnect/mock/CMakeLists.txt":"",
- "ydb/library/actors/interconnect/mock/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/interconnect/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/interconnect/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut/CMakeLists.txt":"",
- "ydb/library/actors/interconnect/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut/lib/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/interconnect/ut/lib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut/lib/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/interconnect/ut/lib/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut/lib/CMakeLists.txt":"",
- "ydb/library/actors/interconnect/ut/lib/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/interconnect/ut/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/interconnect/ut/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut/protos/CMakeLists.txt":"",
- "ydb/library/actors/interconnect/ut/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut_fat/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/interconnect/ut_fat/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut_fat/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/interconnect/ut_fat/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut_fat/CMakeLists.txt":"",
- "ydb/library/actors/interconnect/ut_fat/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut_huge_cluster/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/interconnect/ut_huge_cluster/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut_huge_cluster/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/interconnect/ut_huge_cluster/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/interconnect/ut_huge_cluster/CMakeLists.txt":"",
- "ydb/library/actors/interconnect/ut_huge_cluster/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/log_backend/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/log_backend/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/log_backend/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/log_backend/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/log_backend/CMakeLists.txt":"",
- "ydb/library/actors/log_backend/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/memory_log/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/memory_log/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/memory_log/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/memory_log/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/memory_log/CMakeLists.txt":"",
- "ydb/library/actors/memory_log/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/prof/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/prof/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/prof/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/prof/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/prof/CMakeLists.txt":"",
- "ydb/library/actors/prof/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/prof/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/prof/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/prof/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/prof/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/prof/ut/CMakeLists.txt":"",
- "ydb/library/actors/prof/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/protos/CMakeLists.txt":"",
- "ydb/library/actors/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/testlib/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/testlib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/testlib/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/testlib/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/testlib/CMakeLists.txt":"",
- "ydb/library/actors/testlib/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/testlib/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/testlib/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/testlib/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/testlib/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/testlib/ut/CMakeLists.txt":"",
- "ydb/library/actors/testlib/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/util/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/util/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/util/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/util/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/util/CMakeLists.txt":"",
- "ydb/library/actors/util/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/util/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/util/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/util/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/util/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/util/ut/CMakeLists.txt":"",
- "ydb/library/actors/util/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/wilson/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/wilson/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/wilson/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/wilson/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/wilson/CMakeLists.txt":"",
- "ydb/library/actors/wilson/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/actors/wilson/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/actors/wilson/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/actors/wilson/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/actors/wilson/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/actors/wilson/protos/CMakeLists.txt":"",
- "ydb/library/actors/wilson/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/arrow_clickhouse/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/arrow_clickhouse/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/CMakeLists.txt":"",
- "ydb/library/arrow_clickhouse/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/Columns/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/arrow_clickhouse/Columns/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/Columns/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/arrow_clickhouse/Columns/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/Columns/CMakeLists.txt":"",
- "ydb/library/arrow_clickhouse/Columns/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/Common/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/arrow_clickhouse/Common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/Common/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/arrow_clickhouse/Common/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/Common/CMakeLists.txt":"",
- "ydb/library/arrow_clickhouse/Common/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/DataStreams/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/arrow_clickhouse/DataStreams/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/DataStreams/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/arrow_clickhouse/DataStreams/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/DataStreams/CMakeLists.txt":"",
- "ydb/library/arrow_clickhouse/DataStreams/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/arrow_clickhouse/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/arrow_clickhouse/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/arrow_clickhouse/ut/CMakeLists.txt":"",
- "ydb/library/arrow_clickhouse/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/arrow_kernels/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/arrow_kernels/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/arrow_kernels/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/arrow_kernels/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/arrow_kernels/CMakeLists.txt":"",
- "ydb/library/arrow_kernels/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/arrow_kernels/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/arrow_kernels/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/arrow_kernels/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/arrow_kernels/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/arrow_kernels/ut/CMakeLists.txt":"",
- "ydb/library/arrow_kernels/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/backup/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/backup/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/backup/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/backup/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/backup/CMakeLists.txt":"",
- "ydb/library/backup/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/backup/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/backup/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/backup/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/backup/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/backup/ut/CMakeLists.txt":"",
- "ydb/library/backup/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/binary_json/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/binary_json/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/binary_json/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/binary_json/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/binary_json/CMakeLists.txt":"",
- "ydb/library/binary_json/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/binary_json/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/binary_json/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/binary_json/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/binary_json/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/binary_json/ut/CMakeLists.txt":"",
- "ydb/library/binary_json/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/chunks_limiter/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/chunks_limiter/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/chunks_limiter/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/chunks_limiter/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/chunks_limiter/CMakeLists.txt":"",
- "ydb/library/chunks_limiter/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/conclusion/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/conclusion/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/conclusion/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/conclusion/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/conclusion/CMakeLists.txt":"",
- "ydb/library/conclusion/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/db_pool/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/db_pool/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/db_pool/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/db_pool/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/db_pool/CMakeLists.txt":"",
- "ydb/library/db_pool/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/db_pool/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/db_pool/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/db_pool/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/db_pool/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/db_pool/protos/CMakeLists.txt":"",
- "ydb/library/db_pool/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/dynumber/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/dynumber/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/dynumber/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/dynumber/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/dynumber/CMakeLists.txt":"",
- "ydb/library/dynumber/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/dynumber/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/dynumber/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/dynumber/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/dynumber/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/dynumber/ut/CMakeLists.txt":"",
- "ydb/library/dynumber/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/folder_service/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/folder_service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/folder_service/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/folder_service/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/folder_service/CMakeLists.txt":"",
- "ydb/library/folder_service/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/folder_service/mock/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/folder_service/mock/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/folder_service/mock/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/folder_service/mock/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/folder_service/mock/CMakeLists.txt":"",
- "ydb/library/folder_service/mock/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/folder_service/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/folder_service/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/folder_service/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/folder_service/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/folder_service/proto/CMakeLists.txt":"",
- "ydb/library/folder_service/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/fyamlcpp/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/fyamlcpp/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/fyamlcpp/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/fyamlcpp/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/fyamlcpp/CMakeLists.txt":"",
- "ydb/library/fyamlcpp/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/grpc/CMakeLists.txt":"",
- "ydb/library/grpc/client/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/grpc/client/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/grpc/client/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/grpc/client/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/grpc/client/CMakeLists.txt":"",
- "ydb/library/grpc/client/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/grpc/client/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/grpc/client/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/grpc/client/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/grpc/client/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/grpc/client/ut/CMakeLists.txt":"",
- "ydb/library/grpc/client/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/grpc/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/grpc/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/grpc/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/grpc/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/grpc/common/CMakeLists.txt":"",
- "ydb/library/grpc/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/grpc/server/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/grpc/server/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/grpc/server/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/grpc/server/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/grpc/server/CMakeLists.txt":"",
- "ydb/library/grpc/server/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/grpc/server/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/grpc/server/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/grpc/server/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/grpc/server/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/grpc/server/actors/CMakeLists.txt":"",
- "ydb/library/grpc/server/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/grpc/server/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/grpc/server/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/grpc/server/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/grpc/server/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/grpc/server/ut/CMakeLists.txt":"",
- "ydb/library/grpc/server/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/http_proxy/CMakeLists.txt":"",
- "ydb/library/http_proxy/authorization/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/http_proxy/authorization/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/http_proxy/authorization/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/http_proxy/authorization/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/http_proxy/authorization/CMakeLists.txt":"",
- "ydb/library/http_proxy/authorization/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/http_proxy/authorization/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/http_proxy/authorization/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/http_proxy/authorization/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/http_proxy/authorization/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/http_proxy/authorization/ut/CMakeLists.txt":"",
- "ydb/library/http_proxy/authorization/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/http_proxy/error/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/http_proxy/error/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/http_proxy/error/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/http_proxy/error/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/http_proxy/error/CMakeLists.txt":"",
- "ydb/library/http_proxy/error/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/keys/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/keys/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/keys/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/keys/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/keys/CMakeLists.txt":"",
- "ydb/library/keys/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/keys/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/keys/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/keys/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/keys/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/keys/ut/CMakeLists.txt":"",
- "ydb/library/keys/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/logger/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/logger/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/logger/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/logger/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/logger/CMakeLists.txt":"",
- "ydb/library/logger/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/login/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/login/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/login/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/login/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/login/CMakeLists.txt":"",
- "ydb/library/login/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/login/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/login/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/login/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/login/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/login/protos/CMakeLists.txt":"",
- "ydb/library/login/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/login/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/login/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/login/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/login/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/login/ut/CMakeLists.txt":"",
- "ydb/library/login/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/mkql_proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/mkql_proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/mkql_proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/mkql_proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/mkql_proto/CMakeLists.txt":"",
- "ydb/library/mkql_proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/mkql_proto/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/mkql_proto/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/mkql_proto/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/mkql_proto/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/mkql_proto/protos/CMakeLists.txt":"",
- "ydb/library/mkql_proto/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/mkql_proto/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/mkql_proto/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/mkql_proto/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/mkql_proto/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/mkql_proto/ut/CMakeLists.txt":"",
- "ydb/library/mkql_proto/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/mkql_proto/ut/helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/mkql_proto/ut/helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/mkql_proto/ut/helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/mkql_proto/ut/helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/mkql_proto/ut/helpers/CMakeLists.txt":"",
- "ydb/library/mkql_proto/ut/helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/naming_conventions/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/naming_conventions/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/naming_conventions/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/naming_conventions/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/naming_conventions/CMakeLists.txt":"",
- "ydb/library/naming_conventions/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/naming_conventions/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/naming_conventions/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/naming_conventions/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/naming_conventions/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/naming_conventions/ut/CMakeLists.txt":"",
- "ydb/library/naming_conventions/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/pdisk_io/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/pdisk_io/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/pdisk_io/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/pdisk_io/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/pdisk_io/CMakeLists.txt":"",
- "ydb/library/pdisk_io/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/pdisk_io/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/pdisk_io/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/pdisk_io/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/pdisk_io/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/pdisk_io/protos/CMakeLists.txt":"",
- "ydb/library/pdisk_io/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/persqueue/CMakeLists.txt":"",
- "ydb/library/persqueue/counter_time_keeper/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/persqueue/counter_time_keeper/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/persqueue/counter_time_keeper/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/persqueue/counter_time_keeper/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/persqueue/counter_time_keeper/CMakeLists.txt":"",
- "ydb/library/persqueue/counter_time_keeper/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/persqueue/deprecated/CMakeLists.txt":"",
- "ydb/library/persqueue/deprecated/read_batch_converter/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/persqueue/deprecated/read_batch_converter/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/persqueue/deprecated/read_batch_converter/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/persqueue/deprecated/read_batch_converter/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/persqueue/deprecated/read_batch_converter/CMakeLists.txt":"",
- "ydb/library/persqueue/deprecated/read_batch_converter/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/persqueue/obfuscate/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/persqueue/obfuscate/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/persqueue/obfuscate/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/persqueue/obfuscate/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/persqueue/obfuscate/CMakeLists.txt":"",
- "ydb/library/persqueue/obfuscate/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/persqueue/tests/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/persqueue/tests/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/persqueue/tests/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/persqueue/tests/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/persqueue/tests/CMakeLists.txt":"",
- "ydb/library/persqueue/tests/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/persqueue/topic_parser/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/persqueue/topic_parser/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/persqueue/topic_parser/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/persqueue/topic_parser/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/persqueue/topic_parser/CMakeLists.txt":"",
- "ydb/library/persqueue/topic_parser/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/persqueue/topic_parser/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/persqueue/topic_parser/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/persqueue/topic_parser/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/persqueue/topic_parser/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/persqueue/topic_parser/ut/CMakeLists.txt":"",
- "ydb/library/persqueue/topic_parser/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/persqueue/topic_parser_public/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/persqueue/topic_parser_public/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/persqueue/topic_parser_public/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/persqueue/topic_parser_public/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/persqueue/topic_parser_public/CMakeLists.txt":"",
- "ydb/library/persqueue/topic_parser_public/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/pretty_types_print/CMakeLists.txt":"",
- "ydb/library/pretty_types_print/protobuf/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/pretty_types_print/protobuf/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/pretty_types_print/protobuf/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/pretty_types_print/protobuf/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/pretty_types_print/protobuf/CMakeLists.txt":"",
- "ydb/library/pretty_types_print/protobuf/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/pretty_types_print/wilson/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/pretty_types_print/wilson/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/pretty_types_print/wilson/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/pretty_types_print/wilson/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/pretty_types_print/wilson/CMakeLists.txt":"",
- "ydb/library/pretty_types_print/wilson/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/protobuf_printer/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/protobuf_printer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/protobuf_printer/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/protobuf_printer/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/protobuf_printer/CMakeLists.txt":"",
- "ydb/library/protobuf_printer/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/protobuf_printer/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/protobuf_printer/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/protobuf_printer/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/protobuf_printer/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/protobuf_printer/ut/CMakeLists.txt":"",
- "ydb/library/protobuf_printer/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/query_actor/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/query_actor/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/query_actor/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/query_actor/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/query_actor/CMakeLists.txt":"",
- "ydb/library/query_actor/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/query_actor/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/query_actor/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/query_actor/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/query_actor/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/query_actor/ut/CMakeLists.txt":"",
- "ydb/library/query_actor/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/rewrapper/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/rewrapper/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/rewrapper/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/rewrapper/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/rewrapper/CMakeLists.txt":"",
- "ydb/library/rewrapper/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/rewrapper/hyperscan/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/rewrapper/hyperscan/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/rewrapper/hyperscan/CMakeLists.txt":"",
- "ydb/library/rewrapper/hyperscan/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/rewrapper/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/rewrapper/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/rewrapper/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/rewrapper/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/rewrapper/proto/CMakeLists.txt":"",
- "ydb/library/rewrapper/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/rewrapper/re2/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/rewrapper/re2/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/rewrapper/re2/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/rewrapper/re2/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/rewrapper/re2/CMakeLists.txt":"",
- "ydb/library/rewrapper/re2/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/schlab/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/schlab/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/schlab/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/schlab/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/schlab/CMakeLists.txt":"",
- "ydb/library/schlab/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/schlab/mon/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/schlab/mon/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/schlab/mon/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/schlab/mon/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/schlab/mon/CMakeLists.txt":"",
- "ydb/library/schlab/mon/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/schlab/mon/static/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/schlab/mon/static/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/schlab/mon/static/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/schlab/mon/static/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/schlab/mon/static/CMakeLists.txt":"",
- "ydb/library/schlab/mon/static/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/schlab/mon/static/css/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/schlab/mon/static/css/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/schlab/mon/static/css/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/schlab/mon/static/css/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/schlab/mon/static/css/CMakeLists.txt":"",
- "ydb/library/schlab/mon/static/css/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/schlab/mon/static/js/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/schlab/mon/static/js/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/schlab/mon/static/js/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/schlab/mon/static/js/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/schlab/mon/static/js/CMakeLists.txt":"",
- "ydb/library/schlab/mon/static/js/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/schlab/mon/test/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/schlab/mon/test/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/schlab/mon/test/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/schlab/mon/test/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/schlab/mon/test/CMakeLists.txt":"",
- "ydb/library/schlab/mon/test/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/schlab/probes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/schlab/probes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/schlab/probes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/schlab/probes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/schlab/probes/CMakeLists.txt":"",
- "ydb/library/schlab/probes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/schlab/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/schlab/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/schlab/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/schlab/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/schlab/protos/CMakeLists.txt":"",
- "ydb/library/schlab/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/schlab/schemu/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/schlab/schemu/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/schlab/schemu/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/schlab/schemu/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/schlab/schemu/CMakeLists.txt":"",
- "ydb/library/schlab/schemu/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/schlab/schine/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/schlab/schine/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/schlab/schine/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/schlab/schine/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/schlab/schine/CMakeLists.txt":"",
- "ydb/library/schlab/schine/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/schlab/schoot/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/schlab/schoot/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/schlab/schoot/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/schlab/schoot/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/schlab/schoot/CMakeLists.txt":"",
- "ydb/library/schlab/schoot/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/schlab/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/schlab/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/schlab/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/schlab/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/schlab/ut/CMakeLists.txt":"",
- "ydb/library/schlab/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/security/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/security/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/security/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/security/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/security/CMakeLists.txt":"",
- "ydb/library/security/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/security/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/security/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/security/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/security/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/security/ut/CMakeLists.txt":"",
- "ydb/library/security/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/services/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/services/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/services/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/services/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/services/CMakeLists.txt":"",
- "ydb/library/services/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/table_creator/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/table_creator/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/table_creator/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/table_creator/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/table_creator/CMakeLists.txt":"",
- "ydb/library/table_creator/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/table_creator/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/table_creator/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/table_creator/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/table_creator/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/table_creator/ut/CMakeLists.txt":"",
- "ydb/library/table_creator/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/testlib/CMakeLists.txt":"",
- "ydb/library/testlib/service_mocks/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/testlib/service_mocks/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/testlib/service_mocks/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/testlib/service_mocks/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/testlib/service_mocks/CMakeLists.txt":"",
- "ydb/library/testlib/service_mocks/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/testlib/service_mocks/ldap_mock/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/testlib/service_mocks/ldap_mock/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/testlib/service_mocks/ldap_mock/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/testlib/service_mocks/ldap_mock/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/testlib/service_mocks/ldap_mock/CMakeLists.txt":"",
- "ydb/library/testlib/service_mocks/ldap_mock/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/testlib/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/testlib/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/testlib/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/testlib/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/testlib/ut/CMakeLists.txt":"",
- "ydb/library/testlib/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/time_series_vec/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/time_series_vec/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/time_series_vec/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/time_series_vec/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/time_series_vec/CMakeLists.txt":"",
- "ydb/library/time_series_vec/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/time_series_vec/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/time_series_vec/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/time_series_vec/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/time_series_vec/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/time_series_vec/ut/CMakeLists.txt":"",
- "ydb/library/time_series_vec/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/uuid/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/uuid/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/uuid/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/uuid/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/uuid/CMakeLists.txt":"",
- "ydb/library/uuid/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/wilson_ids/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/wilson_ids/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/wilson_ids/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/wilson_ids/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/wilson_ids/CMakeLists.txt":"",
- "ydb/library/wilson_ids/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/workload/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/workload/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/workload/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/workload/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/workload/CMakeLists.txt":"",
- "ydb/library/workload/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yaml_config/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yaml_config/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yaml_config/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yaml_config/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yaml_config/CMakeLists.txt":"",
- "ydb/library/yaml_config/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yaml_config/public/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yaml_config/public/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yaml_config/public/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yaml_config/public/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yaml_config/public/CMakeLists.txt":"",
- "ydb/library/yaml_config/public/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yaml_config/static_validator/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yaml_config/static_validator/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yaml_config/static_validator/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yaml_config/static_validator/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yaml_config/static_validator/CMakeLists.txt":"",
- "ydb/library/yaml_config/static_validator/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yaml_config/static_validator/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yaml_config/static_validator/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yaml_config/static_validator/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yaml_config/static_validator/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yaml_config/static_validator/ut/CMakeLists.txt":"",
- "ydb/library/yaml_config/static_validator/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yaml_config/static_validator/ut/example_configs/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yaml_config/static_validator/ut/example_configs/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yaml_config/static_validator/ut/example_configs/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yaml_config/static_validator/ut/example_configs/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yaml_config/static_validator/ut/example_configs/CMakeLists.txt":"",
- "ydb/library/yaml_config/static_validator/ut/example_configs/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yaml_config/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yaml_config/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yaml_config/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yaml_config/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yaml_config/ut/CMakeLists.txt":"",
- "ydb/library/yaml_config/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yaml_config/validator/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yaml_config/validator/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yaml_config/validator/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yaml_config/validator/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yaml_config/validator/CMakeLists.txt":"",
- "ydb/library/yaml_config/validator/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yaml_config/validator/ut/CMakeLists.txt":"",
- "ydb/library/yaml_config/validator/ut/validator/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator/CMakeLists.txt":"",
- "ydb/library/yaml_config/validator/ut/validator/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator_builder/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator_builder/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator_builder/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator_builder/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator_builder/CMakeLists.txt":"",
- "ydb/library/yaml_config/validator/ut/validator_builder/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator_checks/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator_checks/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator_checks/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator_checks/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yaml_config/validator/ut/validator_checks/CMakeLists.txt":"",
- "ydb/library/yaml_config/validator/ut/validator_checks/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/ycloud/CMakeLists.txt":"",
- "ydb/library/ycloud/api/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/ycloud/api/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/ycloud/api/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/ycloud/api/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/ycloud/api/CMakeLists.txt":"",
- "ydb/library/ycloud/api/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/ycloud/impl/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/ycloud/impl/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/ycloud/impl/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/ycloud/impl/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/ycloud/impl/CMakeLists.txt":"",
- "ydb/library/ycloud/impl/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/ycloud/impl/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/ycloud/impl/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/ycloud/impl/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/ycloud/impl/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/ycloud/impl/ut/CMakeLists.txt":"",
- "ydb/library/ycloud/impl/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/ydb_issue/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/ydb_issue/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/ydb_issue/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/ydb_issue/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/ydb_issue/CMakeLists.txt":"",
- "ydb/library/ydb_issue/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/ydb_issue/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/ydb_issue/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/ydb_issue/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/ydb_issue/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/ydb_issue/proto/CMakeLists.txt":"",
- "ydb/library/ydb_issue/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/CMakeLists.txt":"",
- "ydb/library/yql/ast/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/ast/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/ast/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/ast/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/ast/CMakeLists.txt":"",
- "ydb/library/yql/ast/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/ast/serialize/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/ast/serialize/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/ast/serialize/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/ast/serialize/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/ast/serialize/CMakeLists.txt":"",
- "ydb/library/yql/ast/serialize/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/ast/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/ast/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/ast/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/ast/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/ast/ut/CMakeLists.txt":"",
- "ydb/library/yql/ast/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/CMakeLists.txt":"",
- "ydb/library/yql/core/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/arrow_kernels/CMakeLists.txt":"",
- "ydb/library/yql/core/arrow_kernels/registry/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/arrow_kernels/registry/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/arrow_kernels/registry/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/arrow_kernels/registry/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/arrow_kernels/registry/CMakeLists.txt":"",
- "ydb/library/yql/core/arrow_kernels/registry/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/arrow_kernels/registry/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/arrow_kernels/registry/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/arrow_kernels/registry/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/arrow_kernels/registry/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/arrow_kernels/registry/ut/CMakeLists.txt":"",
- "ydb/library/yql/core/arrow_kernels/registry/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/arrow_kernels/request/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/arrow_kernels/request/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/arrow_kernels/request/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/arrow_kernels/request/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/arrow_kernels/request/CMakeLists.txt":"",
- "ydb/library/yql/core/arrow_kernels/request/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/cbo/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/cbo/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/cbo/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/cbo/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/cbo/CMakeLists.txt":"",
- "ydb/library/yql/core/cbo/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/cbo/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/cbo/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/cbo/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/cbo/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/cbo/ut/CMakeLists.txt":"",
- "ydb/library/yql/core/cbo/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/common_opt/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/common_opt/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/common_opt/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/common_opt/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/common_opt/CMakeLists.txt":"",
- "ydb/library/yql/core/common_opt/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/credentials/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/credentials/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/credentials/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/credentials/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/credentials/CMakeLists.txt":"",
- "ydb/library/yql/core/credentials/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/core/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/expr_nodes_gen/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/expr_nodes_gen/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/expr_nodes_gen/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/expr_nodes_gen/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/expr_nodes_gen/CMakeLists.txt":"",
- "ydb/library/yql/core/expr_nodes_gen/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/extract_predicate/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/extract_predicate/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/extract_predicate/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/extract_predicate/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/extract_predicate/CMakeLists.txt":"",
- "ydb/library/yql/core/extract_predicate/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/extract_predicate/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/extract_predicate/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/extract_predicate/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/extract_predicate/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/extract_predicate/ut/CMakeLists.txt":"",
- "ydb/library/yql/core/extract_predicate/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/facade/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/facade/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/facade/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/facade/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/facade/CMakeLists.txt":"",
- "ydb/library/yql/core/facade/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/file_storage/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/file_storage/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/CMakeLists.txt":"",
- "ydb/library/yql/core/file_storage/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/defs/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/file_storage/defs/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/defs/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/file_storage/defs/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/defs/CMakeLists.txt":"",
- "ydb/library/yql/core/file_storage/defs/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/download/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/file_storage/download/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/download/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/file_storage/download/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/download/CMakeLists.txt":"",
- "ydb/library/yql/core/file_storage/download/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/http_download/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/file_storage/http_download/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/http_download/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/file_storage/http_download/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/http_download/CMakeLists.txt":"",
- "ydb/library/yql/core/file_storage/http_download/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/http_download/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/file_storage/http_download/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/http_download/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/file_storage/http_download/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/http_download/proto/CMakeLists.txt":"",
- "ydb/library/yql/core/file_storage/http_download/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/file_storage/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/file_storage/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/proto/CMakeLists.txt":"",
- "ydb/library/yql/core/file_storage/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/file_storage/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/file_storage/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/file_storage/ut/CMakeLists.txt":"",
- "ydb/library/yql/core/file_storage/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/issue/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/issue/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/issue/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/issue/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/issue/CMakeLists.txt":"",
- "ydb/library/yql/core/issue/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/issue/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/issue/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/issue/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/issue/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/issue/protos/CMakeLists.txt":"",
- "ydb/library/yql/core/issue/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/issue/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/issue/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/issue/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/issue/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/issue/ut/CMakeLists.txt":"",
- "ydb/library/yql/core/issue/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/peephole_opt/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/peephole_opt/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/peephole_opt/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/peephole_opt/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/peephole_opt/CMakeLists.txt":"",
- "ydb/library/yql/core/peephole_opt/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/progress_merger/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/progress_merger/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/progress_merger/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/progress_merger/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/progress_merger/CMakeLists.txt":"",
- "ydb/library/yql/core/progress_merger/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/services/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/services/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/services/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/services/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/services/CMakeLists.txt":"",
- "ydb/library/yql/core/services/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/services/mounts/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/services/mounts/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/services/mounts/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/services/mounts/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/services/mounts/CMakeLists.txt":"",
- "ydb/library/yql/core/services/mounts/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/spilling/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/spilling/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/spilling/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/spilling/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/spilling/CMakeLists.txt":"",
- "ydb/library/yql/core/spilling/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/spilling/storage/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/spilling/storage/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/spilling/storage/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/spilling/storage/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/spilling/storage/CMakeLists.txt":"",
- "ydb/library/yql/core/spilling/storage/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/spilling/storage/file_storage/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/spilling/storage/file_storage/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/spilling/storage/file_storage/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/spilling/storage/file_storage/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/spilling/storage/file_storage/CMakeLists.txt":"",
- "ydb/library/yql/core/spilling/storage/file_storage/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/spilling/storage/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/spilling/storage/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/spilling/storage/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/spilling/storage/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/spilling/storage/ut/CMakeLists.txt":"",
- "ydb/library/yql/core/spilling/storage/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/spilling/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/spilling/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/spilling/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/spilling/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/spilling/ut/CMakeLists.txt":"",
- "ydb/library/yql/core/spilling/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/sql_types/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/sql_types/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/sql_types/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/sql_types/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/sql_types/CMakeLists.txt":"",
- "ydb/library/yql/core/sql_types/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/sql_types/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/sql_types/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/sql_types/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/sql_types/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/sql_types/ut/CMakeLists.txt":"",
- "ydb/library/yql/core/sql_types/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/type_ann/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/type_ann/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/type_ann/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/type_ann/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/type_ann/CMakeLists.txt":"",
- "ydb/library/yql/core/type_ann/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/url_lister/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/url_lister/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/url_lister/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/url_lister/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/url_lister/CMakeLists.txt":"",
- "ydb/library/yql/core/url_lister/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/url_lister/interface/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/url_lister/interface/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/url_lister/interface/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/url_lister/interface/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/url_lister/interface/CMakeLists.txt":"",
- "ydb/library/yql/core/url_lister/interface/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/url_preprocessing/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/url_preprocessing/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/url_preprocessing/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/url_preprocessing/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/url_preprocessing/CMakeLists.txt":"",
- "ydb/library/yql/core/url_preprocessing/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/url_preprocessing/interface/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/url_preprocessing/interface/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/url_preprocessing/interface/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/url_preprocessing/interface/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/url_preprocessing/interface/CMakeLists.txt":"",
- "ydb/library/yql/core/url_preprocessing/interface/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/user_data/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/user_data/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/user_data/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/user_data/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/user_data/CMakeLists.txt":"",
- "ydb/library/yql/core/user_data/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/ut/CMakeLists.txt":"",
- "ydb/library/yql/core/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/core/ut_common/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/core/ut_common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/core/ut_common/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/core/ut_common/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/core/ut_common/CMakeLists.txt":"",
- "ydb/library/yql/core/ut_common/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/CMakeLists.txt":"",
- "ydb/library/yql/dq/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/actors/CMakeLists.txt":"",
- "ydb/library/yql/dq/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/actors/compute/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/actors/compute/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/actors/compute/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/actors/compute/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/actors/compute/CMakeLists.txt":"",
- "ydb/library/yql/dq/actors/compute/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/actors/compute/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/actors/compute/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/actors/compute/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/actors/compute/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/actors/compute/ut/CMakeLists.txt":"",
- "ydb/library/yql/dq/actors/compute/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/actors/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/actors/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/actors/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/actors/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/actors/protos/CMakeLists.txt":"",
- "ydb/library/yql/dq/actors/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/actors/spilling/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/actors/spilling/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/actors/spilling/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/actors/spilling/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/actors/spilling/CMakeLists.txt":"",
- "ydb/library/yql/dq/actors/spilling/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/actors/spilling/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/actors/spilling/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/actors/spilling/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/actors/spilling/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/actors/spilling/ut/CMakeLists.txt":"",
- "ydb/library/yql/dq/actors/spilling/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/actors/task_runner/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/actors/task_runner/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/actors/task_runner/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/actors/task_runner/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/actors/task_runner/CMakeLists.txt":"",
- "ydb/library/yql/dq/actors/task_runner/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/common/CMakeLists.txt":"",
- "ydb/library/yql/dq/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/comp_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/comp_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/comp_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/comp_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/comp_nodes/CMakeLists.txt":"",
- "ydb/library/yql/dq/comp_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/dq/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/integration/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/integration/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/integration/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/integration/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/integration/CMakeLists.txt":"",
- "ydb/library/yql/dq/integration/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/integration/transform/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/integration/transform/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/integration/transform/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/integration/transform/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/integration/transform/CMakeLists.txt":"",
- "ydb/library/yql/dq/integration/transform/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/opt/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/opt/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/opt/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/opt/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/opt/CMakeLists.txt":"",
- "ydb/library/yql/dq/opt/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/opt/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/opt/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/opt/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/opt/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/opt/ut/CMakeLists.txt":"",
- "ydb/library/yql/dq/opt/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/proto/CMakeLists.txt":"",
- "ydb/library/yql/dq/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/runtime/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/runtime/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/runtime/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/runtime/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/runtime/CMakeLists.txt":"",
- "ydb/library/yql/dq/runtime/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/runtime/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/runtime/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/runtime/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/runtime/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/runtime/ut/CMakeLists.txt":"",
- "ydb/library/yql/dq/runtime/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/state/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/state/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/state/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/state/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/state/CMakeLists.txt":"",
- "ydb/library/yql/dq/state/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/state/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/state/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/state/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/state/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/state/ut/CMakeLists.txt":"",
- "ydb/library/yql/dq/state/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/tasks/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/tasks/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/tasks/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/tasks/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/tasks/CMakeLists.txt":"",
- "ydb/library/yql/dq/tasks/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/transform/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/transform/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/transform/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/transform/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/transform/CMakeLists.txt":"",
- "ydb/library/yql/dq/transform/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/dq/type_ann/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/dq/type_ann/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/dq/type_ann/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/dq/type_ann/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/dq/type_ann/CMakeLists.txt":"",
- "ydb/library/yql/dq/type_ann/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/CMakeLists.txt":"",
- "ydb/library/yql/minikql/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/arrow/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/arrow/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/arrow/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/arrow/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/arrow/CMakeLists.txt":"",
- "ydb/library/yql/minikql/arrow/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/arrow/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/arrow/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/arrow/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/arrow/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/arrow/ut/CMakeLists.txt":"",
- "ydb/library/yql/minikql/arrow/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/benchmark/CMakeLists.txt":"",
- "ydb/library/yql/minikql/benchmark/pack_num/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/benchmark/pack_num/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/benchmark/pack_num/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/benchmark/pack_num/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/benchmark/pack_num/CMakeLists.txt":"",
- "ydb/library/yql/minikql/benchmark/pack_num/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/codegen/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/codegen/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/codegen/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/codegen/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/codegen/CMakeLists.txt":"",
- "ydb/library/yql/minikql/codegen/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/codegen/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/codegen/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/codegen/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/codegen/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/codegen/ut/CMakeLists.txt":"",
- "ydb/library/yql/minikql/codegen/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/CMakeLists.txt":"",
- "ydb/library/yql/minikql/comp_nodes/llvm/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/llvm/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/llvm/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/llvm/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/llvm/CMakeLists.txt":"",
- "ydb/library/yql/minikql/comp_nodes/llvm/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/no_llvm/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/no_llvm/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/no_llvm/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/no_llvm/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/no_llvm/CMakeLists.txt":"",
- "ydb/library/yql/minikql/comp_nodes/no_llvm/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/comp_nodes/ut/CMakeLists.txt":"",
- "ydb/library/yql/minikql/comp_nodes/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/computation/CMakeLists.txt":"",
- "ydb/library/yql/minikql/computation/llvm/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/computation/llvm/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/computation/llvm/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/computation/llvm/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/computation/llvm/CMakeLists.txt":"",
- "ydb/library/yql/minikql/computation/llvm/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/computation/no_llvm/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/computation/no_llvm/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/computation/no_llvm/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/computation/no_llvm/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/computation/no_llvm/CMakeLists.txt":"",
- "ydb/library/yql/minikql/computation/no_llvm/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/computation/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/computation/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/computation/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/computation/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/computation/ut/CMakeLists.txt":"",
- "ydb/library/yql/minikql/computation/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/datetime/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/datetime/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/datetime/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/datetime/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/datetime/CMakeLists.txt":"",
- "ydb/library/yql/minikql/datetime/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/dom/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/dom/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/dom/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/dom/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/dom/CMakeLists.txt":"",
- "ydb/library/yql/minikql/dom/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/dom/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/dom/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/dom/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/dom/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/dom/ut/CMakeLists.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/CMakeLists.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/no_llvm/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/no_llvm/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/no_llvm/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/no_llvm/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/no_llvm/CMakeLists.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/no_llvm/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/ut/CMakeLists.txt":"",
- "ydb/library/yql/minikql/invoke_builtins/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/jsonpath/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/jsonpath/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/jsonpath/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/jsonpath/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/jsonpath/CMakeLists.txt":"",
- "ydb/library/yql/minikql/jsonpath/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/jsonpath/benchmark/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/jsonpath/benchmark/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/jsonpath/benchmark/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/jsonpath/benchmark/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/jsonpath/benchmark/CMakeLists.txt":"",
- "ydb/library/yql/minikql/jsonpath/benchmark/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/jsonpath/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/jsonpath/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/jsonpath/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/jsonpath/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/jsonpath/ut/CMakeLists.txt":"",
- "ydb/library/yql/minikql/jsonpath/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/CMakeLists.txt":"",
- "ydb/library/yql/minikql/perf/alloc/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/perf/alloc/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/alloc/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/perf/alloc/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/alloc/CMakeLists.txt":"",
- "ydb/library/yql/minikql/perf/alloc/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/block_groupby/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/perf/block_groupby/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/block_groupby/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/perf/block_groupby/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/block_groupby/CMakeLists.txt":"",
- "ydb/library/yql/minikql/perf/block_groupby/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/mprefetch/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/perf/mprefetch/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/mprefetch/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/perf/mprefetch/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/mprefetch/CMakeLists.txt":"",
- "ydb/library/yql/minikql/perf/mprefetch/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/mt_param/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/perf/mt_param/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/mt_param/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/perf/mt_param/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/mt_param/CMakeLists.txt":"",
- "ydb/library/yql/minikql/perf/mt_param/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/packer/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/perf/packer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/packer/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/perf/packer/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/packer/CMakeLists.txt":"",
- "ydb/library/yql/minikql/perf/packer/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/param/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/perf/param/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/param/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/perf/param/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/param/CMakeLists.txt":"",
- "ydb/library/yql/minikql/perf/param/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/presort/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/perf/presort/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/presort/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/perf/presort/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/perf/presort/CMakeLists.txt":"",
- "ydb/library/yql/minikql/perf/presort/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/protobuf_udf/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/protobuf_udf/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/protobuf_udf/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/protobuf_udf/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/protobuf_udf/CMakeLists.txt":"",
- "ydb/library/yql/minikql/protobuf_udf/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/protobuf_udf/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/protobuf_udf/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/protobuf_udf/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/protobuf_udf/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/protobuf_udf/ut/CMakeLists.txt":"",
- "ydb/library/yql/minikql/protobuf_udf/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/minikql/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/minikql/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/minikql/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/minikql/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/minikql/ut/CMakeLists.txt":"",
- "ydb/library/yql/minikql/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/CMakeLists.txt":"",
- "ydb/library/yql/parser/lexer_common/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/lexer_common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/lexer_common/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/lexer_common/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/lexer_common/CMakeLists.txt":"",
- "ydb/library/yql/parser/lexer_common/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/lexer_common/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/lexer_common/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/lexer_common/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/lexer_common/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/lexer_common/ut/CMakeLists.txt":"",
- "ydb/library/yql/parser/lexer_common/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/pg_catalog/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/pg_catalog/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/pg_catalog/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/pg_catalog/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/pg_catalog/CMakeLists.txt":"",
- "ydb/library/yql/parser/pg_catalog/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/pg_catalog/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/pg_catalog/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/pg_catalog/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/pg_catalog/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/pg_catalog/ut/CMakeLists.txt":"",
- "ydb/library/yql/parser/pg_catalog/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/CMakeLists.txt":"",
- "ydb/library/yql/parser/pg_wrapper/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/interface/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/interface/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/interface/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/interface/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/interface/CMakeLists.txt":"",
- "ydb/library/yql/parser/pg_wrapper/interface/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/pg_wrapper/ut/CMakeLists.txt":"",
- "ydb/library/yql/parser/pg_wrapper/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/proto_ast/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/proto_ast/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/CMakeLists.txt":"",
- "ydb/library/yql/parser/proto_ast/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/collect_issues/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/proto_ast/collect_issues/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/collect_issues/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/proto_ast/collect_issues/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/collect_issues/CMakeLists.txt":"",
- "ydb/library/yql/parser/proto_ast/collect_issues/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/CMakeLists.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/jsonpath/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/jsonpath/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/jsonpath/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/jsonpath/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/jsonpath/CMakeLists.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/jsonpath/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v0/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v0/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v0/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v0/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v0/CMakeLists.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v0/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1/CMakeLists.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1_ansi/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1_ansi/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1_ansi/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1_ansi/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1_ansi/CMakeLists.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1_ansi/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1_proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1_proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1_proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1_proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1_proto/CMakeLists.txt":"",
- "ydb/library/yql/parser/proto_ast/gen/v1_proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/protos/CMakeLists.txt":"",
- "ydb/library/yql/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/CMakeLists.txt":"",
- "ydb/library/yql/providers/clickhouse/CMakeLists.txt":"",
- "ydb/library/yql/providers/clickhouse/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/clickhouse/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/clickhouse/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/clickhouse/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/clickhouse/actors/CMakeLists.txt":"",
- "ydb/library/yql/providers/clickhouse/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/clickhouse/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/clickhouse/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/clickhouse/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/clickhouse/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/clickhouse/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/clickhouse/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/clickhouse/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/clickhouse/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/clickhouse/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/clickhouse/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/clickhouse/proto/CMakeLists.txt":"",
- "ydb/library/yql/providers/clickhouse/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/clickhouse/provider/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/clickhouse/provider/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/clickhouse/provider/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/clickhouse/provider/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/clickhouse/provider/CMakeLists.txt":"",
- "ydb/library/yql/providers/clickhouse/provider/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/activation/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/activation/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/activation/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/activation/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/activation/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/activation/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/arrow/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/arrow/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/arrow/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/arrow/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/arrow/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/arrow/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/arrow/interface/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/arrow/interface/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/arrow/interface/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/arrow/interface/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/arrow/interface/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/arrow/interface/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/arrow_resolve/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/arrow_resolve/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/arrow_resolve/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/arrow_resolve/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/arrow_resolve/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/arrow_resolve/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/codec/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/codec/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/codec/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/codec/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/codec/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/codec/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/codec/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/codec/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/codec/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/codec/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/codec/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/codec/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/comp_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/comp_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/comp_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/comp_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/comp_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/comp_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/config/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/config/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/config/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/config/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/config/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/config/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/db_id_async_resolver/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/db_id_async_resolver/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/db_id_async_resolver/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/db_id_async_resolver/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/db_id_async_resolver/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/db_id_async_resolver/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/dq/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/dq/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/dq/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/dq/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/dq/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/dq/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/gateway/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/gateway/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/gateway/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/gateway/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/gateway/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/gateway/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/http_gateway/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/mock/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/mock/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/mock/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/mock/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/mock/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/http_gateway/mock/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/http_gateway/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/http_gateway/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/metrics/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/metrics/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/metrics/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/metrics/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/metrics/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/metrics/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/metrics/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/metrics/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/metrics/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/metrics/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/metrics/protos/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/metrics/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/mkql/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/mkql/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/mkql/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/mkql/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/mkql/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/mkql/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/proto/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/provider/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/provider/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/provider/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/provider/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/provider/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/provider/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/pushdown/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/pushdown/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/pushdown/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/pushdown/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/pushdown/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/pushdown/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/schema/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/schema/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/schema/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/expr/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/schema/expr/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/expr/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/schema/expr/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/expr/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/schema/expr/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/mkql/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/schema/mkql/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/mkql/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/schema/mkql/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/mkql/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/schema/mkql/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/parser/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/schema/parser/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/parser/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/schema/parser/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/parser/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/schema/parser/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/skiff/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/schema/skiff/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/skiff/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/schema/skiff/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/schema/skiff/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/schema/skiff/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/structured_token/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/structured_token/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/structured_token/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/structured_token/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/structured_token/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/structured_token/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/structured_token/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/structured_token/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/structured_token/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/structured_token/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/structured_token/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/structured_token/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/token_accessor/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/token_accessor/client/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/token_accessor/client/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/token_accessor/client/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/token_accessor/client/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/token_accessor/client/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/token_accessor/client/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/token_accessor/grpc/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/token_accessor/grpc/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/token_accessor/grpc/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/token_accessor/grpc/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/token_accessor/grpc/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/token_accessor/grpc/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/transform/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/transform/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/transform/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/transform/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/transform/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/transform/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/udf_resolve/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/udf_resolve/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/udf_resolve/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/udf_resolve/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/udf_resolve/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/udf_resolve/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/common/ut_helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/common/ut_helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/common/ut_helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/common/ut_helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/common/ut_helpers/CMakeLists.txt":"",
- "ydb/library/yql/providers/common/ut_helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/config/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/config/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/config/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/config/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/config/CMakeLists.txt":"",
- "ydb/library/yql/providers/config/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/actors/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/actors/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/actors/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/actors/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/actors/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/actors/events/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/actors/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/actors/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/actors/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/actors/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/actors/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/actors/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/actors/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/actors/yt/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/actors/yt/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/actors/yt/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/actors/yt/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/actors/yt/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/actors/yt/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/api/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/api/grpc/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/api/grpc/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/api/grpc/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/api/grpc/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/api/grpc/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/api/grpc/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/api/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/api/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/api/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/api/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/api/protos/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/api/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/common/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/config/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/config/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/config/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/config/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/config/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/config/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/counters/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/counters/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/counters/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/counters/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/counters/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/counters/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/global_worker_manager/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/global_worker_manager/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/global_worker_manager/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/global_worker_manager/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/global_worker_manager/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/global_worker_manager/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/global_worker_manager/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/global_worker_manager/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/global_worker_manager/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/global_worker_manager/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/global_worker_manager/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/interface/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/interface/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/interface/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/interface/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/interface/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/interface/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/local_gateway/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/local_gateway/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/local_gateway/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/local_gateway/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/local_gateway/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/metrics/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/metrics/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/metrics/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/metrics/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/metrics/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/metrics/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/mkql/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/mkql/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/mkql/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/mkql/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/mkql/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/mkql/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/opt/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/opt/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/opt/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/opt/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/opt/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/opt/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/planner/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/planner/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/planner/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/planner/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/planner/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/planner/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/provider/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/provider/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/provider/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/provider/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/provider/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/provider/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/provider/exec/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/provider/exec/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/provider/exec/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/provider/exec/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/provider/exec/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/provider/exec/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/provider/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/provider/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/provider/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/provider/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/provider/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/provider/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/runtime/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/runtime/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/runtime/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/runtime/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/runtime/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/runtime/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/scheduler/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/scheduler/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/scheduler/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/scheduler/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/scheduler/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/scheduler/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/scheduler/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/scheduler/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/scheduler/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/scheduler/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/scheduler/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/scheduler/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/service/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/service/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/service/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/service/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/service/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/stats_collector/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/stats_collector/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/stats_collector/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/stats_collector/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/stats_collector/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/task_runner/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/task_runner/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/task_runner/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/task_runner/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/task_runner/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/task_runner/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/task_runner_actor/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/task_runner_actor/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/task_runner_actor/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/task_runner_actor/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/task_runner_actor/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/task_runner_actor/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/worker_manager/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/worker_manager/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/worker_manager/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/worker_manager/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/worker_manager/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/worker_manager/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/dq/worker_manager/interface/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/dq/worker_manager/interface/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/dq/worker_manager/interface/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/dq/worker_manager/interface/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/dq/worker_manager/interface/CMakeLists.txt":"",
- "ydb/library/yql/providers/dq/worker_manager/interface/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/function/CMakeLists.txt":"",
- "ydb/library/yql/providers/function/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/function/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/function/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/function/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/function/common/CMakeLists.txt":"",
- "ydb/library/yql/providers/function/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/function/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/function/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/function/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/function/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/function/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/function/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/function/gateway/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/function/gateway/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/function/gateway/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/function/gateway/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/function/gateway/CMakeLists.txt":"",
- "ydb/library/yql/providers/function/gateway/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/function/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/function/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/function/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/function/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/function/proto/CMakeLists.txt":"",
- "ydb/library/yql/providers/function/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/function/provider/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/function/provider/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/function/provider/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/function/provider/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/function/provider/CMakeLists.txt":"",
- "ydb/library/yql/providers/function/provider/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/generic/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/generic/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/generic/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/generic/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/generic/actors/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/connector/api/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/connector/api/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/common/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/connector/api/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/service/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/service/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/service/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/service/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/connector/api/service/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/service/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/service/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/service/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/service/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/api/service/protos/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/connector/api/service/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/libcpp/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/generic/connector/libcpp/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/libcpp/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/generic/connector/libcpp/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/libcpp/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/connector/libcpp/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/libcpp/ut_helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/generic/connector/libcpp/ut_helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/libcpp/ut_helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/generic/connector/libcpp/ut_helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/generic/connector/libcpp/ut_helpers/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/connector/libcpp/ut_helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/generic/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/generic/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/generic/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/generic/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/generic/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/generic/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/generic/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/generic/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/generic/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/generic/proto/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/generic/provider/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/generic/provider/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/generic/provider/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/generic/provider/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/generic/provider/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/provider/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/generic/provider/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/provider/ut/pushdown/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/generic/provider/ut/pushdown/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/generic/provider/ut/pushdown/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/generic/provider/ut/pushdown/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/generic/provider/ut/pushdown/CMakeLists.txt":"",
- "ydb/library/yql/providers/generic/provider/ut/pushdown/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/pg/CMakeLists.txt":"",
- "ydb/library/yql/providers/pg/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/pg/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/pg/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/pg/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/pg/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/pg/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/pg/provider/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/pg/provider/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/pg/provider/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/pg/provider/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/pg/provider/CMakeLists.txt":"",
- "ydb/library/yql/providers/pg/provider/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/pq/CMakeLists.txt":"",
- "ydb/library/yql/providers/pq/async_io/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/pq/async_io/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/pq/async_io/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/pq/async_io/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/pq/async_io/CMakeLists.txt":"",
- "ydb/library/yql/providers/pq/async_io/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/pq/cm_client/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/pq/cm_client/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/pq/cm_client/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/pq/cm_client/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/pq/cm_client/CMakeLists.txt":"",
- "ydb/library/yql/providers/pq/cm_client/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/pq/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/pq/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/pq/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/pq/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/pq/common/CMakeLists.txt":"",
- "ydb/library/yql/providers/pq/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/pq/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/pq/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/pq/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/pq/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/pq/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/pq/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/pq/gateway/CMakeLists.txt":"",
- "ydb/library/yql/providers/pq/gateway/dummy/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/pq/gateway/dummy/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/pq/gateway/dummy/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/pq/gateway/dummy/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/pq/gateway/dummy/CMakeLists.txt":"",
- "ydb/library/yql/providers/pq/gateway/dummy/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/pq/gateway/native/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/pq/gateway/native/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/pq/gateway/native/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/pq/gateway/native/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/pq/gateway/native/CMakeLists.txt":"",
- "ydb/library/yql/providers/pq/gateway/native/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/pq/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/pq/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/pq/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/pq/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/pq/proto/CMakeLists.txt":"",
- "ydb/library/yql/providers/pq/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/pq/provider/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/pq/provider/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/pq/provider/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/pq/provider/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/pq/provider/CMakeLists.txt":"",
- "ydb/library/yql/providers/pq/provider/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/pq/task_meta/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/pq/task_meta/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/pq/task_meta/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/pq/task_meta/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/pq/task_meta/CMakeLists.txt":"",
- "ydb/library/yql/providers/pq/task_meta/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/result/CMakeLists.txt":"",
- "ydb/library/yql/providers/result/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/result/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/result/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/result/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/result/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/result/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/result/provider/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/result/provider/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/result/provider/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/result/provider/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/result/provider/CMakeLists.txt":"",
- "ydb/library/yql/providers/result/provider/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/actors/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/common/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/compressors/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/compressors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/compressors/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/compressors/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/compressors/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/compressors/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/credentials/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/credentials/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/credentials/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/credentials/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/credentials/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/credentials/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/credentials/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/credentials/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/credentials/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/credentials/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/credentials/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/credentials/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/object_listers/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/object_listers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/object_listers/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/object_listers/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/object_listers/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/object_listers/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/object_listers/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/object_listers/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/object_listers/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/object_listers/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/object_listers/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/object_listers/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/path_generator/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/path_generator/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/path_generator/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/path_generator/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/path_generator/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/path_generator/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/path_generator/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/path_generator/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/path_generator/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/path_generator/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/path_generator/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/proto/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/provider/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/provider/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/provider/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/provider/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/provider/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/provider/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/provider/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/provider/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/provider/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/provider/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/provider/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/provider/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/range_helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/range_helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/range_helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/range_helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/range_helpers/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/range_helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/range_helpers/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/range_helpers/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/range_helpers/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/range_helpers/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/range_helpers/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/range_helpers/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/s3/serializations/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/s3/serializations/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/s3/serializations/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/s3/serializations/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/s3/serializations/CMakeLists.txt":"",
- "ydb/library/yql/providers/s3/serializations/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/CMakeLists.txt":"",
- "ydb/library/yql/providers/solomon/async_io/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/solomon/async_io/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/async_io/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/solomon/async_io/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/async_io/CMakeLists.txt":"",
- "ydb/library/yql/providers/solomon/async_io/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/solomon/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/solomon/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/solomon/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/gateway/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/solomon/gateway/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/gateway/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/solomon/gateway/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/gateway/CMakeLists.txt":"",
- "ydb/library/yql/providers/solomon/gateway/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/solomon/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/solomon/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/proto/CMakeLists.txt":"",
- "ydb/library/yql/providers/solomon/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/provider/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/solomon/provider/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/provider/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/solomon/provider/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/solomon/provider/CMakeLists.txt":"",
- "ydb/library/yql/providers/solomon/provider/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/stat/CMakeLists.txt":"",
- "ydb/library/yql/providers/stat/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/stat/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/stat/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/stat/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/stat/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/stat/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/stat/uploader/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/stat/uploader/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/stat/uploader/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/stat/uploader/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/stat/uploader/CMakeLists.txt":"",
- "ydb/library/yql/providers/stat/uploader/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/CMakeLists.txt":"",
- "ydb/library/yql/providers/ydb/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/ydb/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/ydb/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/actors/CMakeLists.txt":"",
- "ydb/library/yql/providers/ydb/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/comp_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/ydb/comp_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/comp_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/ydb/comp_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/comp_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/ydb/comp_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/ydb/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/ydb/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/ydb/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/ydb/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/ydb/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/proto/CMakeLists.txt":"",
- "ydb/library/yql/providers/ydb/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/provider/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/ydb/provider/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/provider/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/ydb/provider/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/ydb/provider/CMakeLists.txt":"",
- "ydb/library/yql/providers/ydb/provider/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/codec/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/codec/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/codec/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/codec/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/codec/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/codec/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/codec/codegen/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/codec/codegen/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/codec/codegen/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/codec/codegen/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/codec/codegen/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/codec/codegen/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/codec/codegen/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/codec/codegen/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/codec/codegen/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/codec/codegen/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/codec/codegen/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/codec/codegen/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/codec/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/codec/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/codec/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/codec/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/codec/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/codec/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/common/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/dq/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/dq/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/dq/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/dq/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/dq/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/dq/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/comp_nodes/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/dq_task_preprocessor/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/dq_task_preprocessor/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/dq_task_preprocessor/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/dq_task_preprocessor/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/dq_task_preprocessor/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/expr_nodes/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/expr_nodes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/expr_nodes/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/expr_nodes/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/expr_nodes/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/expr_nodes/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/gateway/file/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/gateway/file/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/file/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/gateway/file/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/file/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/gateway/file/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/lib/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/gateway/lib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/lib/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/gateway/lib/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/lib/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/gateway/lib/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/native/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/gateway/native/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/native/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/gateway/native/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/native/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/gateway/native/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/profile/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/gateway/profile/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/profile/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/gateway/profile/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/gateway/profile/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/gateway/profile/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/job/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/job/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/job/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/job/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/job/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/job/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/config_clusters/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/config_clusters/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/config_clusters/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/config_clusters/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/config_clusters/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/config_clusters/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/expr_traits/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/expr_traits/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/expr_traits/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/expr_traits/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/expr_traits/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/expr_traits/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/graph_reorder/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/graph_reorder/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/graph_reorder/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/graph_reorder/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/graph_reorder/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/graph_reorder/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/hash/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/hash/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/hash/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/hash/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/hash/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/hash/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/infer_schema/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/infer_schema/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/infer_schema/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/infer_schema/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/infer_schema/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/infer_schema/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/init_yt_api/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/init_yt_api/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/init_yt_api/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/init_yt_api/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/init_yt_api/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/init_yt_api/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/key_filter/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/key_filter/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/key_filter/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/key_filter/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/key_filter/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/key_filter/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/lambda_builder/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/lambda_builder/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/lambda_builder/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/lambda_builder/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/lambda_builder/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/lambda_builder/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/log/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/log/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/log/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/log/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/log/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/log/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/mkql_helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/mkql_helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/mkql_helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/mkql_helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/mkql_helpers/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/mkql_helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/res_pull/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/res_pull/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/res_pull/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/res_pull/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/res_pull/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/res_pull/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/row_spec/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/row_spec/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/row_spec/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/row_spec/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/row_spec/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/row_spec/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/schema/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/schema/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/schema/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/schema/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/schema/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/schema/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/skiff/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/skiff/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/skiff/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/skiff/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/skiff/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/skiff/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/url_mapper/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/url_mapper/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/url_mapper/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/url_mapper/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/url_mapper/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/url_mapper/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/yson_helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/yson_helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/yson_helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/yson_helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/yson_helpers/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/yson_helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_download/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_download/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_download/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_download/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_download/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_download/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_rpc_helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_rpc_helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_rpc_helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_rpc_helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_rpc_helpers/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_rpc_helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_url_lister/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_url_lister/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_url_lister/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_url_lister/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_url_lister/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/lib/yt_url_lister/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/mkql_dq/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/mkql_dq/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/mkql_dq/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/mkql_dq/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/mkql_dq/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/mkql_dq/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/opt/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/opt/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/opt/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/opt/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/opt/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/opt/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/provider/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/provider/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/provider/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/provider/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/provider/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/provider/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/providers/yt/provider/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/providers/yt/provider/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/providers/yt/provider/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/providers/yt/provider/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/providers/yt/provider/ut/CMakeLists.txt":"",
- "ydb/library/yql/providers/yt/provider/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/CMakeLists.txt":"",
- "ydb/library/yql/public/decimal/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/decimal/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/decimal/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/decimal/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/decimal/CMakeLists.txt":"",
- "ydb/library/yql/public/decimal/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/decimal/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/decimal/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/decimal/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/decimal/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/decimal/ut/CMakeLists.txt":"",
- "ydb/library/yql/public/decimal/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/embedded/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/embedded/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/embedded/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/embedded/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/embedded/CMakeLists.txt":"",
- "ydb/library/yql/public/embedded/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/fastcheck/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/fastcheck/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/fastcheck/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/fastcheck/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/fastcheck/CMakeLists.txt":"",
- "ydb/library/yql/public/fastcheck/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/fastcheck/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/fastcheck/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/fastcheck/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/fastcheck/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/fastcheck/ut/CMakeLists.txt":"",
- "ydb/library/yql/public/fastcheck/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/issue/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/issue/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/issue/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/issue/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/issue/CMakeLists.txt":"",
- "ydb/library/yql/public/issue/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/issue/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/issue/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/issue/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/issue/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/issue/protos/CMakeLists.txt":"",
- "ydb/library/yql/public/issue/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/issue/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/issue/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/issue/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/issue/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/issue/ut/CMakeLists.txt":"",
- "ydb/library/yql/public/issue/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/common/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/examples/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/examples/protobuf/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/examples/protobuf/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/examples/protobuf/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/examples/protobuf/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/examples/protobuf/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/examples/protobuf/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/examples/protobuf_pull_list/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/examples/protobuf_pull_list/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/examples/protobuf_pull_list/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/examples/protobuf_pull_list/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/examples/protobuf_pull_list/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/examples/protobuf_pull_list/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/examples/skiff_pull_list/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/examples/skiff_pull_list/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/examples/skiff_pull_list/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/examples/skiff_pull_list/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/examples/skiff_pull_list/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/examples/skiff_pull_list/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/protobuf/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/protobuf/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/protobuf/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/protobuf/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/protobuf/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/helpers/protobuf/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/stream/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/stream/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/stream/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/stream/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/helpers/stream/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/helpers/stream/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/mkql/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/mkql/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/mkql/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/mkql/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/mkql/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/mkql/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/mkql/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/mkql/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/mkql/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/mkql/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/mkql/ut/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/mkql/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf/ut/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf_raw/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf_raw/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf_raw/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf_raw/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf_raw/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/io_specs/protobuf_raw/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/ut/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/ut/lib/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/ut/lib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/ut/lib/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/ut/lib/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/ut/lib/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/ut/lib/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/ut/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/purecalc/ut/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/ut/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/purecalc/ut/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/purecalc/ut/protos/CMakeLists.txt":"",
- "ydb/library/yql/public/purecalc/ut/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/types/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/types/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/types/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/types/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/types/CMakeLists.txt":"",
- "ydb/library/yql/public/types/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/udf/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/udf/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/udf/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/udf/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/udf/CMakeLists.txt":"",
- "ydb/library/yql/public/udf/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/udf/arrow/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/udf/arrow/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/udf/arrow/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/udf/arrow/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/udf/arrow/CMakeLists.txt":"",
- "ydb/library/yql/public/udf/arrow/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/udf/service/CMakeLists.txt":"",
- "ydb/library/yql/public/udf/service/exception_policy/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/udf/service/exception_policy/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/udf/service/exception_policy/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/udf/service/exception_policy/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/udf/service/exception_policy/CMakeLists.txt":"",
- "ydb/library/yql/public/udf/service/exception_policy/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/udf/service/stub/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/udf/service/stub/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/udf/service/stub/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/udf/service/stub/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/udf/service/stub/CMakeLists.txt":"",
- "ydb/library/yql/public/udf/service/stub/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/udf/service/terminate_policy/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/udf/service/terminate_policy/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/udf/service/terminate_policy/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/udf/service/terminate_policy/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/udf/service/terminate_policy/CMakeLists.txt":"",
- "ydb/library/yql/public/udf/service/terminate_policy/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/udf/support/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/udf/support/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/udf/support/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/udf/support/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/udf/support/CMakeLists.txt":"",
- "ydb/library/yql/public/udf/support/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/udf/tz/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/udf/tz/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/udf/tz/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/udf/tz/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/udf/tz/CMakeLists.txt":"",
- "ydb/library/yql/public/udf/tz/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/udf/tz/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/udf/tz/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/udf/tz/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/udf/tz/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/udf/tz/ut/CMakeLists.txt":"",
- "ydb/library/yql/public/udf/tz/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/public/udf/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/public/udf/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/public/udf/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/public/udf/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/public/udf/ut/CMakeLists.txt":"",
- "ydb/library/yql/public/udf/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/CMakeLists.txt":"",
- "ydb/library/yql/sql/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/pg/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/pg/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/pg/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/pg/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/pg/CMakeLists.txt":"",
- "ydb/library/yql/sql/pg/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/pg/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/pg/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/pg/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/pg/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/pg/ut/CMakeLists.txt":"",
- "ydb/library/yql/sql/pg/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/pg_dummy/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/pg_dummy/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/pg_dummy/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/pg_dummy/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/pg_dummy/CMakeLists.txt":"",
- "ydb/library/yql/sql/pg_dummy/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/settings/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/settings/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/settings/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/settings/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/settings/CMakeLists.txt":"",
- "ydb/library/yql/sql/settings/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/v0/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/v0/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/v0/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/v0/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/v0/CMakeLists.txt":"",
- "ydb/library/yql/sql/v0/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/v0/lexer/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/v0/lexer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/v0/lexer/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/v0/lexer/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/v0/lexer/CMakeLists.txt":"",
- "ydb/library/yql/sql/v0/lexer/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/v0/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/v0/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/v0/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/v0/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/v0/ut/CMakeLists.txt":"",
- "ydb/library/yql/sql/v0/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/v1/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/v1/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/v1/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/v1/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/v1/CMakeLists.txt":"",
- "ydb/library/yql/sql/v1/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/v1/format/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/v1/format/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/v1/format/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/v1/format/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/v1/format/CMakeLists.txt":"",
- "ydb/library/yql/sql/v1/format/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/v1/format/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/v1/format/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/v1/format/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/v1/format/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/v1/format/ut/CMakeLists.txt":"",
- "ydb/library/yql/sql/v1/format/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/v1/lexer/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/v1/lexer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/v1/lexer/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/v1/lexer/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/v1/lexer/CMakeLists.txt":"",
- "ydb/library/yql/sql/v1/lexer/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/v1/perf/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/v1/perf/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/v1/perf/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/v1/perf/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/v1/perf/CMakeLists.txt":"",
- "ydb/library/yql/sql/v1/perf/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/v1/proto_parser/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/v1/proto_parser/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/v1/proto_parser/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/v1/proto_parser/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/v1/proto_parser/CMakeLists.txt":"",
- "ydb/library/yql/sql/v1/proto_parser/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/sql/v1/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/sql/v1/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/sql/v1/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/sql/v1/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/sql/v1/ut/CMakeLists.txt":"",
- "ydb/library/yql/sql/v1/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/tools/CMakeLists.txt":"",
- "ydb/library/yql/tools/astdiff/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/astdiff/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/astdiff/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/astdiff/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/astdiff/CMakeLists.txt":"",
- "ydb/library/yql/tools/astdiff/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/tools/dq/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/dq/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/dq/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/dq/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/dq/CMakeLists.txt":"",
- "ydb/library/yql/tools/dq/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/tools/dq/dq_cli/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/dq/dq_cli/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/dq/dq_cli/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/dq/dq_cli/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/dq/dq_cli/CMakeLists.txt":"",
- "ydb/library/yql/tools/dq/dq_cli/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/tools/dq/service_node/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/dq/service_node/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/dq/service_node/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/dq/service_node/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/dq/service_node/CMakeLists.txt":"",
- "ydb/library/yql/tools/dq/worker_node/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/dq/worker_node/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/dq/worker_node/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/dq/worker_node/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/dq/worker_node/CMakeLists.txt":"",
- "ydb/library/yql/tools/dqrun/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/dqrun/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/dqrun/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/dqrun/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/dqrun/CMakeLists.txt":"",
- "ydb/library/yql/tools/dqrun/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/tools/mrjob/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/mrjob/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/mrjob/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/mrjob/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/mrjob/CMakeLists.txt":"",
- "ydb/library/yql/tools/mrjob/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/tools/pgrun/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/pgrun/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/pgrun/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/pgrun/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/pgrun/CMakeLists.txt":"",
- "ydb/library/yql/tools/pgrun/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/tools/sql2yql/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/sql2yql/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/sql2yql/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/sql2yql/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/sql2yql/CMakeLists.txt":"",
- "ydb/library/yql/tools/sql2yql/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/tools/sql_formatter/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/sql_formatter/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/sql_formatter/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/sql_formatter/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/sql_formatter/CMakeLists.txt":"",
- "ydb/library/yql/tools/sql_formatter/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/tools/udf_dep_stub/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/udf_dep_stub/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/udf_dep_stub/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/udf_dep_stub/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/udf_dep_stub/CMakeLists.txt":"",
- "ydb/library/yql/tools/udf_dep_stub/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/tools/udf_probe/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/udf_probe/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/udf_probe/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/udf_probe/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/udf_probe/CMakeLists.txt":"",
- "ydb/library/yql/tools/udf_probe/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/tools/udf_resolver/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/udf_resolver/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/udf_resolver/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/udf_resolver/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/udf_resolver/CMakeLists.txt":"",
- "ydb/library/yql/tools/udf_resolver/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/tools/yqlrun/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/yqlrun/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/yqlrun/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/yqlrun/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/yqlrun/CMakeLists.txt":"",
- "ydb/library/yql/tools/yqlrun/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/tools/yqlrun/http/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/tools/yqlrun/http/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/tools/yqlrun/http/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/tools/yqlrun/http/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/tools/yqlrun/http/CMakeLists.txt":"",
- "ydb/library/yql/tools/yqlrun/http/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/clickhouse/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/clickhouse/client/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/clickhouse/client/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/clickhouse/client/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/clickhouse/client/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/clickhouse/client/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/clickhouse/client/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/compress_base/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/compress_base/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/compress_base/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/compress_base/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/compress_base/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/compress_base/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/compress_base/lib/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/compress_base/lib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/compress_base/lib/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/compress_base/lib/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/compress_base/lib/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/compress_base/lib/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/datetime/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/datetime/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/datetime/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/datetime/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/datetime/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/datetime/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/datetime2/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/datetime2/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/datetime2/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/datetime2/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/datetime2/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/datetime2/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/digest/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/digest/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/digest/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/digest/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/digest/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/digest/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/file/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/file/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/file/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/file/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/file/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/file/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/histogram/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/histogram/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/histogram/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/histogram/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/histogram/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/histogram/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/hyperloglog/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/hyperloglog/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/hyperloglog/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/hyperloglog/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/hyperloglog/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/hyperloglog/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/hyperscan/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/hyperscan/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/hyperscan/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/hyperscan/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/ip_base/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/ip_base/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/ip_base/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/ip_base/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/ip_base/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/ip_base/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/ip_base/lib/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/ip_base/lib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/ip_base/lib/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/ip_base/lib/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/ip_base/lib/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/ip_base/lib/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/json/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/json/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/json/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/json/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/json/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/json/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/json2/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/json2/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/json2/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/json2/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/json2/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/json2/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/math/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/math/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/math/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/math/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/math/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/math/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/math/lib/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/math/lib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/math/lib/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/math/lib/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/math/lib/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/math/lib/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/pire/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/pire/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/pire/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/pire/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/pire/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/pire/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/protobuf/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/protobuf/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/protobuf/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/protobuf/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/protobuf/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/protobuf/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/re2/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/re2/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/re2/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/re2/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/re2/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/re2/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/set/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/set/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/set/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/set/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/set/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/set/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/stat/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/stat/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/stat/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/stat/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/stat/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/stat/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/stat/static/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/stat/static/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/stat/static/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/stat/static/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/stat/static/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/stat/static/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/stat/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/stat/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/stat/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/stat/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/stat/ut/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/stat/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/streaming/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/streaming/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/streaming/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/streaming/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/streaming/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/streaming/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/string/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/string/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/string/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/string/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/string/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/string/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/top/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/top/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/top/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/top/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/top/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/top/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/topfreq/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/static/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/static/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/static/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/static/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/static/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/topfreq/static/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/topfreq/ut/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/topfreq/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/unicode_base/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/unicode_base/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/unicode_base/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/unicode_base/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/unicode_base/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/unicode_base/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/unicode_base/lib/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/unicode_base/lib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/unicode_base/lib/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/unicode_base/lib/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/unicode_base/lib/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/unicode_base/lib/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/url_base/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/url_base/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/url_base/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/url_base/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/url_base/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/url_base/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/url_base/lib/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/url_base/lib/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/url_base/lib/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/url_base/lib/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/url_base/lib/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/url_base/lib/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/common/yson2/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/common/yson2/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/common/yson2/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/common/yson2/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/common/yson2/CMakeLists.txt":"",
- "ydb/library/yql/udfs/common/yson2/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/CMakeLists.txt":"",
- "ydb/library/yql/udfs/examples/callables/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/examples/callables/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/callables/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/examples/callables/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/callables/CMakeLists.txt":"",
- "ydb/library/yql/udfs/examples/callables/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/dicts/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/examples/dicts/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/dicts/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/examples/dicts/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/dicts/CMakeLists.txt":"",
- "ydb/library/yql/udfs/examples/dicts/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/dummylog/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/examples/dummylog/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/dummylog/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/examples/dummylog/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/dummylog/CMakeLists.txt":"",
- "ydb/library/yql/udfs/examples/dummylog/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/lists/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/examples/lists/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/lists/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/examples/lists/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/lists/CMakeLists.txt":"",
- "ydb/library/yql/udfs/examples/lists/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/structs/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/examples/structs/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/structs/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/examples/structs/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/structs/CMakeLists.txt":"",
- "ydb/library/yql/udfs/examples/structs/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/tagged/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/examples/tagged/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/tagged/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/examples/tagged/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/tagged/CMakeLists.txt":"",
- "ydb/library/yql/udfs/examples/tagged/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/type_inspection/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/examples/type_inspection/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/type_inspection/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/examples/type_inspection/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/examples/type_inspection/CMakeLists.txt":"",
- "ydb/library/yql/udfs/examples/type_inspection/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/logs/CMakeLists.txt":"",
- "ydb/library/yql/udfs/logs/dsv/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/logs/dsv/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/logs/dsv/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/logs/dsv/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/logs/dsv/CMakeLists.txt":"",
- "ydb/library/yql/udfs/logs/dsv/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/test/CMakeLists.txt":"",
- "ydb/library/yql/udfs/test/simple/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/test/simple/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/test/simple/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/test/simple/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/test/simple/CMakeLists.txt":"",
- "ydb/library/yql/udfs/test/simple/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/udfs/test/test_import/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/udfs/test/test_import/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/udfs/test/test_import/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/udfs/test/test_import/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/udfs/test/test_import/CMakeLists.txt":"",
- "ydb/library/yql/udfs/test/test_import/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/CMakeLists.txt":"",
- "ydb/library/yql/utils/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/actor_log/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/actor_log/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/actor_log/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/actor_log/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/actor_log/CMakeLists.txt":"",
- "ydb/library/yql/utils/actor_log/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/actor_system/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/actor_system/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/actor_system/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/actor_system/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/actor_system/CMakeLists.txt":"",
- "ydb/library/yql/utils/actor_system/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/actors/CMakeLists.txt":"",
- "ydb/library/yql/utils/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/actors/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/actors/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/actors/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/actors/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/actors/ut/CMakeLists.txt":"",
- "ydb/library/yql/utils/backtrace/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/backtrace/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/backtrace/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/backtrace/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/backtrace/CMakeLists.txt":"",
- "ydb/library/yql/utils/backtrace/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/backtrace/fake_llvm_symbolizer/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/backtrace/fake_llvm_symbolizer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/backtrace/fake_llvm_symbolizer/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/backtrace/fake_llvm_symbolizer/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/backtrace/fake_llvm_symbolizer/CMakeLists.txt":"",
- "ydb/library/yql/utils/backtrace/fake_llvm_symbolizer/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/backtrace/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/backtrace/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/backtrace/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/backtrace/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/backtrace/ut/CMakeLists.txt":"",
- "ydb/library/yql/utils/backtrace/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/bindings/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/bindings/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/bindings/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/bindings/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/bindings/CMakeLists.txt":"",
- "ydb/library/yql/utils/bindings/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/bindings/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/bindings/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/bindings/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/bindings/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/bindings/ut/CMakeLists.txt":"",
- "ydb/library/yql/utils/bindings/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/failure_injector/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/failure_injector/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/failure_injector/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/failure_injector/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/failure_injector/CMakeLists.txt":"",
- "ydb/library/yql/utils/failure_injector/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/failure_injector/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/failure_injector/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/failure_injector/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/failure_injector/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/failure_injector/ut/CMakeLists.txt":"",
- "ydb/library/yql/utils/fetch/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/fetch/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/fetch/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/fetch/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/fetch/CMakeLists.txt":"",
- "ydb/library/yql/utils/fetch/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/log/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/log/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/log/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/log/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/log/CMakeLists.txt":"",
- "ydb/library/yql/utils/log/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/log/proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/log/proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/log/proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/log/proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/log/proto/CMakeLists.txt":"",
- "ydb/library/yql/utils/log/proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/log/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/log/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/log/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/log/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/log/ut/CMakeLists.txt":"",
- "ydb/library/yql/utils/log/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/plan/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/plan/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/plan/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/plan/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/plan/CMakeLists.txt":"",
- "ydb/library/yql/utils/plan/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/plan/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/plan/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/plan/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/plan/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/plan/ut/CMakeLists.txt":"",
- "ydb/library/yql/utils/plan/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/simd/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/simd/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/simd/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/simd/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/simd/CMakeLists.txt":"",
- "ydb/library/yql/utils/simd/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/simd/exec/CMakeLists.txt":"",
- "ydb/library/yql/utils/simd/exec/pack_tuple/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/simd/exec/pack_tuple/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/simd/exec/pack_tuple/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/simd/exec/pack_tuple/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/simd/exec/pack_tuple/CMakeLists.txt":"",
- "ydb/library/yql/utils/simd/exec/pack_tuple/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/simd/exec/stream_store/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/simd/exec/stream_store/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/simd/exec/stream_store/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/simd/exec/stream_store/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/simd/exec/stream_store/CMakeLists.txt":"",
- "ydb/library/yql/utils/simd/exec/stream_store/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/simd/exec/tuples_to_bucket/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/simd/exec/tuples_to_bucket/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/simd/exec/tuples_to_bucket/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/simd/exec/tuples_to_bucket/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/simd/exec/tuples_to_bucket/CMakeLists.txt":"",
- "ydb/library/yql/utils/simd/exec/tuples_to_bucket/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/simd/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/simd/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/simd/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/simd/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/simd/ut/CMakeLists.txt":"",
- "ydb/library/yql/utils/simd/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/sys/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/sys/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/sys/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/sys/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/sys/CMakeLists.txt":"",
- "ydb/library/yql/utils/sys/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/test_http_server/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/test_http_server/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/test_http_server/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/test_http_server/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/test_http_server/CMakeLists.txt":"",
- "ydb/library/yql/utils/test_http_server/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/threading/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/threading/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/threading/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/threading/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/threading/CMakeLists.txt":"",
- "ydb/library/yql/utils/threading/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yql/utils/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yql/utils/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yql/utils/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yql/utils/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yql/utils/ut/CMakeLists.txt":"",
- "ydb/library/yql/utils/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/library/yverify_stream/CMakeLists.darwin-arm64.txt":"",
- "ydb/library/yverify_stream/CMakeLists.darwin-x86_64.txt":"",
- "ydb/library/yverify_stream/CMakeLists.linux-aarch64.txt":"",
- "ydb/library/yverify_stream/CMakeLists.linux-x86_64.txt":"",
- "ydb/library/yverify_stream/CMakeLists.txt":"",
- "ydb/library/yverify_stream/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/CMakeLists.txt":"",
- "ydb/public/api/CMakeLists.txt":"",
- "ydb/public/api/client/CMakeLists.txt":"",
- "ydb/public/api/client/yc_private/CMakeLists.txt":"",
- "ydb/public/api/client/yc_private/compute/CMakeLists.txt":"",
- "ydb/public/api/client/yc_private/compute/inner/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/client/yc_private/compute/inner/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/client/yc_private/compute/inner/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/client/yc_private/compute/inner/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/client/yc_private/compute/inner/CMakeLists.txt":"",
- "ydb/public/api/client/yc_private/compute/inner/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/client/yc_private/iam/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/client/yc_private/iam/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/client/yc_private/iam/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/client/yc_private/iam/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/client/yc_private/iam/CMakeLists.txt":"",
- "ydb/public/api/client/yc_private/iam/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/client/yc_private/kms/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/client/yc_private/kms/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/client/yc_private/kms/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/client/yc_private/kms/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/client/yc_private/kms/CMakeLists.txt":"",
- "ydb/public/api/client/yc_private/kms/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/client/yc_private/kms/asymmetricencryption/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/client/yc_private/kms/asymmetricencryption/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/client/yc_private/kms/asymmetricencryption/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/client/yc_private/kms/asymmetricencryption/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/client/yc_private/kms/asymmetricencryption/CMakeLists.txt":"",
- "ydb/public/api/client/yc_private/kms/asymmetricencryption/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/client/yc_private/kms/asymmetricsignature/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/client/yc_private/kms/asymmetricsignature/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/client/yc_private/kms/asymmetricsignature/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/client/yc_private/kms/asymmetricsignature/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/client/yc_private/kms/asymmetricsignature/CMakeLists.txt":"",
- "ydb/public/api/client/yc_private/kms/asymmetricsignature/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/client/yc_private/operation/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/client/yc_private/operation/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/client/yc_private/operation/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/client/yc_private/operation/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/client/yc_private/operation/CMakeLists.txt":"",
- "ydb/public/api/client/yc_private/operation/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/client/yc_private/resourcemanager/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/client/yc_private/resourcemanager/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/client/yc_private/resourcemanager/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/client/yc_private/resourcemanager/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/client/yc_private/resourcemanager/CMakeLists.txt":"",
- "ydb/public/api/client/yc_private/resourcemanager/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/client/yc_private/servicecontrol/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/client/yc_private/servicecontrol/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/client/yc_private/servicecontrol/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/client/yc_private/servicecontrol/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/client/yc_private/servicecontrol/CMakeLists.txt":"",
- "ydb/public/api/client/yc_private/servicecontrol/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/client/yc_public/CMakeLists.txt":"",
- "ydb/public/api/client/yc_public/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/client/yc_public/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/client/yc_public/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/client/yc_public/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/client/yc_public/common/CMakeLists.txt":"",
- "ydb/public/api/client/yc_public/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/client/yc_public/events/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/client/yc_public/events/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/client/yc_public/events/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/client/yc_public/events/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/client/yc_public/events/CMakeLists.txt":"",
- "ydb/public/api/client/yc_public/events/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/client/yc_public/iam/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/client/yc_public/iam/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/client/yc_public/iam/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/client/yc_public/iam/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/client/yc_public/iam/CMakeLists.txt":"",
- "ydb/public/api/client/yc_public/iam/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/client/yc_public/logging/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/client/yc_public/logging/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/client/yc_public/logging/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/client/yc_public/logging/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/client/yc_public/logging/CMakeLists.txt":"",
- "ydb/public/api/client/yc_public/logging/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/grpc/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/grpc/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/grpc/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/grpc/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/grpc/CMakeLists.txt":"",
- "ydb/public/api/grpc/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/grpc/draft/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/grpc/draft/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/grpc/draft/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/grpc/draft/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/grpc/draft/CMakeLists.txt":"",
- "ydb/public/api/grpc/draft/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/protos/CMakeLists.txt":"",
- "ydb/public/api/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/protos/annotations/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/protos/annotations/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/protos/annotations/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/protos/annotations/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/protos/annotations/CMakeLists.txt":"",
- "ydb/public/api/protos/annotations/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/api/protos/out/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/api/protos/out/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/api/protos/out/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/api/protos/out/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/api/protos/out/CMakeLists.txt":"",
- "ydb/public/api/protos/out/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/CMakeLists.txt":"",
- "ydb/public/lib/base/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/base/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/base/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/base/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/base/CMakeLists.txt":"",
- "ydb/public/lib/base/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/deprecated/CMakeLists.txt":"",
- "ydb/public/lib/deprecated/client/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/deprecated/client/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/deprecated/client/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/deprecated/client/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/deprecated/client/CMakeLists.txt":"",
- "ydb/public/lib/deprecated/client/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/deprecated/kicli/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/deprecated/kicli/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/deprecated/kicli/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/deprecated/kicli/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/deprecated/kicli/CMakeLists.txt":"",
- "ydb/public/lib/deprecated/kicli/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/deprecated/kicli/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/deprecated/kicli/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/deprecated/kicli/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/deprecated/kicli/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/deprecated/kicli/ut/CMakeLists.txt":"",
- "ydb/public/lib/deprecated/kicli/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/experimental/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/experimental/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/experimental/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/experimental/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/experimental/CMakeLists.txt":"",
- "ydb/public/lib/experimental/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/fq/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/fq/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/fq/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/fq/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/fq/CMakeLists.txt":"",
- "ydb/public/lib/fq/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/idx_test/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/idx_test/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/idx_test/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/idx_test/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/idx_test/CMakeLists.txt":"",
- "ydb/public/lib/idx_test/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/idx_test/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/idx_test/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/idx_test/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/idx_test/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/idx_test/ut/CMakeLists.txt":"",
- "ydb/public/lib/idx_test/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/json_value/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/json_value/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/json_value/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/json_value/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/json_value/CMakeLists.txt":"",
- "ydb/public/lib/json_value/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/json_value/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/json_value/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/json_value/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/json_value/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/json_value/ut/CMakeLists.txt":"",
- "ydb/public/lib/json_value/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/jwt/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/jwt/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/jwt/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/jwt/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/jwt/CMakeLists.txt":"",
- "ydb/public/lib/jwt/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/operation_id/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/operation_id/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/operation_id/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/operation_id/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/operation_id/CMakeLists.txt":"",
- "ydb/public/lib/operation_id/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/operation_id/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/operation_id/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/operation_id/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/operation_id/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/operation_id/protos/CMakeLists.txt":"",
- "ydb/public/lib/operation_id/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/operation_id/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/operation_id/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/operation_id/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/operation_id/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/operation_id/ut/CMakeLists.txt":"",
- "ydb/public/lib/operation_id/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/scheme_types/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/scheme_types/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/scheme_types/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/scheme_types/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/scheme_types/CMakeLists.txt":"",
- "ydb/public/lib/scheme_types/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/stat_visualization/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/stat_visualization/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/stat_visualization/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/stat_visualization/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/stat_visualization/CMakeLists.txt":"",
- "ydb/public/lib/stat_visualization/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/ut_helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/ut_helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/ut_helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/ut_helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/ut_helpers/CMakeLists.txt":"",
- "ydb/public/lib/ut_helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/validation/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/validation/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/validation/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/validation/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/validation/CMakeLists.txt":"",
- "ydb/public/lib/validation/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/validation/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/validation/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/validation/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/validation/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/validation/ut/CMakeLists.txt":"",
- "ydb/public/lib/validation/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/validation/ut/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/validation/ut/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/validation/ut/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/validation/ut/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/validation/ut/protos/CMakeLists.txt":"",
- "ydb/public/lib/validation/ut/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/value/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/value/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/value/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/value/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/value/CMakeLists.txt":"",
- "ydb/public/lib/value/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/CMakeLists.txt":"",
- "ydb/public/lib/ydb_cli/commands/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/ydb_cli/commands/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/commands/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/ydb_cli/commands/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/commands/CMakeLists.txt":"",
- "ydb/public/lib/ydb_cli/commands/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/commands/topic_workload/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/ydb_cli/commands/topic_workload/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/commands/topic_workload/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/ydb_cli/commands/topic_workload/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/commands/topic_workload/CMakeLists.txt":"",
- "ydb/public/lib/ydb_cli/commands/topic_workload/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/commands/topic_workload/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/ydb_cli/commands/topic_workload/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/commands/topic_workload/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/ydb_cli/commands/topic_workload/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/commands/topic_workload/ut/CMakeLists.txt":"",
- "ydb/public/lib/ydb_cli/commands/topic_workload/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/commands/transfer_workload/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/ydb_cli/commands/transfer_workload/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/commands/transfer_workload/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/ydb_cli/commands/transfer_workload/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/commands/transfer_workload/CMakeLists.txt":"",
- "ydb/public/lib/ydb_cli/commands/transfer_workload/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/ydb_cli/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/ydb_cli/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/common/CMakeLists.txt":"",
- "ydb/public/lib/ydb_cli/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/common/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/ydb_cli/common/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/common/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/ydb_cli/common/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/common/ut/CMakeLists.txt":"",
- "ydb/public/lib/ydb_cli/common/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/dump/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/ydb_cli/dump/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/dump/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/ydb_cli/dump/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/dump/CMakeLists.txt":"",
- "ydb/public/lib/ydb_cli/dump/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/dump/util/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/ydb_cli/dump/util/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/dump/util/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/ydb_cli/dump/util/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/dump/util/CMakeLists.txt":"",
- "ydb/public/lib/ydb_cli/dump/util/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/import/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/ydb_cli/import/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/import/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/ydb_cli/import/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/import/CMakeLists.txt":"",
- "ydb/public/lib/ydb_cli/import/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/topic/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/ydb_cli/topic/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/topic/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/ydb_cli/topic/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/topic/CMakeLists.txt":"",
- "ydb/public/lib/ydb_cli/topic/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/topic/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/ydb_cli/topic/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/topic/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/ydb_cli/topic/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/ydb_cli/topic/ut/CMakeLists.txt":"",
- "ydb/public/lib/ydb_cli/topic/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/lib/yson_value/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/lib/yson_value/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/lib/yson_value/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/lib/yson_value/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/lib/yson_value/CMakeLists.txt":"",
- "ydb/public/lib/yson_value/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/draft/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/draft/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/draft/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/draft/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/draft/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/draft/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/draft/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/draft/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/draft/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/draft/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/draft/ut/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/draft/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/extensions/discovery_mutator/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/discovery_mutator/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/discovery_mutator/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/discovery_mutator/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/discovery_mutator/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/extensions/discovery_mutator/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/discovery_mutator/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/discovery_mutator/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/discovery_mutator/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/discovery_mutator/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/discovery_mutator/ut/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/extensions/discovery_mutator/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/solomon_stats/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/solomon_stats/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/solomon_stats/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/solomon_stats/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/extensions/solomon_stats/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/extensions/solomon_stats/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/helpers/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/iam/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/iam/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/iam/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/iam/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/iam/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/iam/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/iam/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/iam/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/iam/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/iam/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/iam/common/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/iam/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/iam/impl/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/iam/impl/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/iam/impl/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/iam/impl/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/iam/impl/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/iam/impl/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/iam_private/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/iam_private/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/iam_private/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/iam_private/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/iam_private/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/iam_private/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_endpoints/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_endpoints/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_endpoints/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_endpoints/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_endpoints/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_endpoints/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_endpoints/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_endpoints/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_endpoints/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_endpoints/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_endpoints/ut/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_endpoints/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/common/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/db_driver_state/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/db_driver_state/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/db_driver_state/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/db_driver_state/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/db_driver_state/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/db_driver_state/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/grpc_connections/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/grpc_connections/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/grpc_connections/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/grpc_connections/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/grpc_connections/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/grpc_connections/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/kqp_session_common/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/kqp_session_common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/kqp_session_common/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/kqp_session_common/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/kqp_session_common/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/kqp_session_common/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/logger/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/logger/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/logger/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/logger/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/logger/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/logger/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/make_request/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/make_request/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/make_request/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/make_request/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/make_request/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/make_request/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/plain_status/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/plain_status/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/plain_status/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/plain_status/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/plain_status/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/plain_status/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/retry/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/retry/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/retry/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/retry/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/retry/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/retry/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/session_pool/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/session_pool/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/session_pool/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/session_pool/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/session_pool/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/session_pool/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/thread_pool/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/thread_pool/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/thread_pool/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/thread_pool/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/thread_pool/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/thread_pool/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/value_helpers/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/value_helpers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/value_helpers/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/value_helpers/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/value_helpers/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_internal/value_helpers/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_stats/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_stats/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_stats/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_stats/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_stats/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/impl/ydb_stats/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/resources/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/resources/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/resources/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/resources/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/resources/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/resources/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_common_client/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_common_client/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_common_client/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_common_client/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_common_client/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_common_client/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_common_client/impl/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_common_client/impl/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_common_client/impl/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_common_client/impl/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_common_client/impl/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_common_client/impl/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_coordination/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_coordination/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_coordination/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_coordination/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_coordination/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_coordination/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_coordination/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_coordination/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_coordination/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_coordination/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_coordination/ut/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_coordination/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_datastreams/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_datastreams/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_datastreams/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_datastreams/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_datastreams/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_datastreams/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_discovery/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_discovery/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_discovery/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_discovery/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_discovery/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_discovery/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_driver/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_driver/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_driver/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_driver/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_driver/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_driver/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_driver/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_driver/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_driver/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_driver/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_driver/ut/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_driver/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_export/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_export/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_export/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_export/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_export/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_export/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_extension/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_extension/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_extension/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_extension/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_extension/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_extension/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/impl/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/impl/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/impl/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/impl/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/impl/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/impl/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/ut/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_federated_topic/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_import/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_import/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_import/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_import/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_import/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_import/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_monitoring/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_monitoring/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_monitoring/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_monitoring/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_monitoring/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_monitoring/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_operation/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_operation/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_operation/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_operation/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_operation/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_operation/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_params/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_params/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_params/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_params/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_params/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_params/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_params/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_params/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_params/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_params/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_params/ut/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_params/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/impl/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/impl/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/impl/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/impl/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/impl/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/impl/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/with_offset_ranges_mode_ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/with_offset_ranges_mode_ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/with_offset_ranges_mode_ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/with_offset_ranges_mode_ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/with_offset_ranges_mode_ut/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/with_offset_ranges_mode_ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_public/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_public/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_public/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_public/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_public/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_public/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_public/codecs/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_public/codecs/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_public/codecs/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_public/codecs/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_public/codecs/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_persqueue_public/codecs/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_proto/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_proto/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_proto/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_proto/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_proto/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_proto/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_query/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_query/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_query/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_query/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_query/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_query/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_query/impl/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_query/impl/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_query/impl/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_query/impl/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_query/impl/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_query/impl/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_rate_limiter/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_rate_limiter/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_rate_limiter/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_rate_limiter/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_rate_limiter/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_rate_limiter/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_result/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_result/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_result/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_result/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_result/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_result/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_result/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_result/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_result/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_result/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_result/ut/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_result/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_scheme/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_scheme/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_scheme/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_scheme/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_scheme/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_scheme/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/impl/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/impl/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/impl/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/impl/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/impl/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/impl/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/query_stats/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/query_stats/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/query_stats/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/query_stats/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/query_stats/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_table/query_stats/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/codecs/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/codecs/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/codecs/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/codecs/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/codecs/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/codecs/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/impl/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/impl/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/impl/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/impl/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/impl/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/impl/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/ut/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/ut/ut_utils/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/ut/ut_utils/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/ut/ut_utils/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/ut/ut_utils/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/ut/ut_utils/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_topic/ut/ut_utils/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/credentials/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/credentials/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/credentials/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/credentials/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/credentials/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/credentials/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/credentials/login/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/credentials/login/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/credentials/login/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/credentials/login/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/credentials/login/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/credentials/login/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/exceptions/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/exceptions/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/exceptions/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/exceptions/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/exceptions/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/exceptions/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/fatal_error_handlers/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/fatal_error_handlers/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/fatal_error_handlers/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/fatal_error_handlers/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/fatal_error_handlers/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/fatal_error_handlers/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/operation/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/operation/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/operation/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/operation/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/operation/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/operation/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/status/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/status/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/status/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/status/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/status/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_types/status/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_value/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_value/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_value/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_value/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_value/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_value/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_value/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_value/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_value/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_value/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/client/ydb_value/ut/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/client/ydb_value/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/examples/basic_example/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/examples/basic_example/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/basic_example/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/examples/basic_example/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/basic_example/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/examples/basic_example/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/bulk_upsert_simple/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/examples/bulk_upsert_simple/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/bulk_upsert_simple/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/examples/bulk_upsert_simple/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/bulk_upsert_simple/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/examples/bulk_upsert_simple/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/pagination/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/examples/pagination/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/pagination/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/examples/pagination/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/pagination/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/examples/pagination/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/secondary_index/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/examples/secondary_index/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/secondary_index/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/examples/secondary_index/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/secondary_index/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/examples/secondary_index/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/secondary_index_builtin/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/examples/secondary_index_builtin/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/secondary_index_builtin/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/examples/secondary_index_builtin/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/secondary_index_builtin/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/examples/secondary_index_builtin/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/eventloop/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/eventloop/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/eventloop/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/eventloop/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/eventloop/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/eventloop/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/simple/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/simple/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/simple/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/simple/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/simple/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/simple/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/transaction/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/transaction/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/transaction/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/transaction/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/transaction/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/examples/topic_reader/transaction/CMakeLists.windows-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/ttl/CMakeLists.darwin-arm64.txt":"",
- "ydb/public/sdk/cpp/examples/ttl/CMakeLists.darwin-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/ttl/CMakeLists.linux-aarch64.txt":"",
- "ydb/public/sdk/cpp/examples/ttl/CMakeLists.linux-x86_64.txt":"",
- "ydb/public/sdk/cpp/examples/ttl/CMakeLists.txt":"",
- "ydb/public/sdk/cpp/examples/ttl/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/CMakeLists.txt":"",
- "ydb/services/auth/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/auth/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/auth/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/auth/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/auth/CMakeLists.txt":"",
- "ydb/services/auth/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/bg_tasks/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/bg_tasks/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/bg_tasks/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/bg_tasks/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/bg_tasks/CMakeLists.txt":"",
- "ydb/services/bg_tasks/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/bg_tasks/abstract/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/bg_tasks/abstract/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/bg_tasks/abstract/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/bg_tasks/abstract/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/bg_tasks/abstract/CMakeLists.txt":"",
- "ydb/services/bg_tasks/abstract/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/bg_tasks/ds_table/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/bg_tasks/ds_table/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/bg_tasks/ds_table/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/bg_tasks/ds_table/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/bg_tasks/ds_table/CMakeLists.txt":"",
- "ydb/services/bg_tasks/ds_table/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/bg_tasks/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/bg_tasks/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/bg_tasks/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/bg_tasks/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/bg_tasks/protos/CMakeLists.txt":"",
- "ydb/services/bg_tasks/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/bg_tasks/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/bg_tasks/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/bg_tasks/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/bg_tasks/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/bg_tasks/ut/CMakeLists.txt":"",
- "ydb/services/bg_tasks/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/cms/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/cms/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/cms/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/cms/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/cms/CMakeLists.txt":"",
- "ydb/services/cms/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/cms/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/cms/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/cms/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/cms/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/cms/ut/CMakeLists.txt":"",
- "ydb/services/cms/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/datastreams/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/datastreams/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/datastreams/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/datastreams/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/datastreams/CMakeLists.txt":"",
- "ydb/services/datastreams/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/datastreams/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/datastreams/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/datastreams/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/datastreams/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/datastreams/ut/CMakeLists.txt":"",
- "ydb/services/datastreams/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/deprecated/CMakeLists.txt":"",
- "ydb/services/deprecated/persqueue_v0/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/deprecated/persqueue_v0/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/deprecated/persqueue_v0/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/deprecated/persqueue_v0/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/deprecated/persqueue_v0/CMakeLists.txt":"",
- "ydb/services/deprecated/persqueue_v0/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/deprecated/persqueue_v0/api/CMakeLists.txt":"",
- "ydb/services/deprecated/persqueue_v0/api/grpc/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/deprecated/persqueue_v0/api/grpc/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/deprecated/persqueue_v0/api/grpc/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/deprecated/persqueue_v0/api/grpc/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/deprecated/persqueue_v0/api/grpc/CMakeLists.txt":"",
- "ydb/services/deprecated/persqueue_v0/api/grpc/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/deprecated/persqueue_v0/api/protos/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/deprecated/persqueue_v0/api/protos/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/deprecated/persqueue_v0/api/protos/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/deprecated/persqueue_v0/api/protos/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/deprecated/persqueue_v0/api/protos/CMakeLists.txt":"",
- "ydb/services/deprecated/persqueue_v0/api/protos/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/discovery/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/discovery/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/discovery/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/discovery/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/discovery/CMakeLists.txt":"",
- "ydb/services/discovery/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/dynamic_config/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/dynamic_config/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/dynamic_config/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/dynamic_config/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/dynamic_config/CMakeLists.txt":"",
- "ydb/services/dynamic_config/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/dynamic_config/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/dynamic_config/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/dynamic_config/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/dynamic_config/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/dynamic_config/ut/CMakeLists.txt":"",
- "ydb/services/dynamic_config/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/ext_index/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/ext_index/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/ext_index/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/ext_index/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/ext_index/CMakeLists.txt":"",
- "ydb/services/ext_index/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/ext_index/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/ext_index/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/ext_index/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/ext_index/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/ext_index/common/CMakeLists.txt":"",
- "ydb/services/ext_index/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/ext_index/metadata/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/ext_index/metadata/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/ext_index/metadata/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/ext_index/metadata/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/ext_index/metadata/CMakeLists.txt":"",
- "ydb/services/ext_index/metadata/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/ext_index/metadata/extractor/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/ext_index/metadata/extractor/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/ext_index/metadata/extractor/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/ext_index/metadata/extractor/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/ext_index/metadata/extractor/CMakeLists.txt":"",
- "ydb/services/ext_index/metadata/extractor/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/ext_index/service/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/ext_index/service/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/ext_index/service/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/ext_index/service/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/ext_index/service/CMakeLists.txt":"",
- "ydb/services/ext_index/service/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/ext_index/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/ext_index/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/ext_index/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/ext_index/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/ext_index/ut/CMakeLists.txt":"",
- "ydb/services/ext_index/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/fq/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/fq/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/fq/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/fq/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/fq/CMakeLists.txt":"",
- "ydb/services/fq/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/fq/ut_integration/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/fq/ut_integration/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/fq/ut_integration/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/fq/ut_integration/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/fq/ut_integration/CMakeLists.txt":"",
- "ydb/services/fq/ut_integration/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/kesus/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/kesus/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/kesus/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/kesus/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/kesus/CMakeLists.txt":"",
- "ydb/services/kesus/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/keyvalue/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/keyvalue/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/keyvalue/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/keyvalue/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/keyvalue/CMakeLists.txt":"",
- "ydb/services/keyvalue/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/keyvalue/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/keyvalue/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/keyvalue/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/keyvalue/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/keyvalue/ut/CMakeLists.txt":"",
- "ydb/services/keyvalue/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/lib/CMakeLists.txt":"",
- "ydb/services/lib/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/lib/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/lib/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/lib/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/lib/actors/CMakeLists.txt":"",
- "ydb/services/lib/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/lib/sharding/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/lib/sharding/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/lib/sharding/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/lib/sharding/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/lib/sharding/CMakeLists.txt":"",
- "ydb/services/lib/sharding/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/local_discovery/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/local_discovery/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/local_discovery/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/local_discovery/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/local_discovery/CMakeLists.txt":"",
- "ydb/services/local_discovery/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/maintenance/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/maintenance/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/maintenance/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/maintenance/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/maintenance/CMakeLists.txt":"",
- "ydb/services/maintenance/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/metadata/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/metadata/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/metadata/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/metadata/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/metadata/CMakeLists.txt":"",
- "ydb/services/metadata/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/metadata/abstract/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/metadata/abstract/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/metadata/abstract/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/metadata/abstract/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/metadata/abstract/CMakeLists.txt":"",
- "ydb/services/metadata/abstract/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/metadata/common/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/metadata/common/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/metadata/common/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/metadata/common/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/metadata/common/CMakeLists.txt":"",
- "ydb/services/metadata/common/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/metadata/ds_table/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/metadata/ds_table/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/metadata/ds_table/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/metadata/ds_table/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/metadata/ds_table/CMakeLists.txt":"",
- "ydb/services/metadata/ds_table/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/metadata/initializer/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/metadata/initializer/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/metadata/initializer/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/metadata/initializer/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/metadata/initializer/CMakeLists.txt":"",
- "ydb/services/metadata/initializer/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/metadata/initializer/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/metadata/initializer/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/metadata/initializer/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/metadata/initializer/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/metadata/initializer/ut/CMakeLists.txt":"",
- "ydb/services/metadata/initializer/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/metadata/manager/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/metadata/manager/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/metadata/manager/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/metadata/manager/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/metadata/manager/CMakeLists.txt":"",
- "ydb/services/metadata/manager/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/metadata/request/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/metadata/request/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/metadata/request/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/metadata/request/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/metadata/request/CMakeLists.txt":"",
- "ydb/services/metadata/request/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/metadata/secret/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/metadata/secret/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/metadata/secret/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/metadata/secret/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/metadata/secret/CMakeLists.txt":"",
- "ydb/services/metadata/secret/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/metadata/secret/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/metadata/secret/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/metadata/secret/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/metadata/secret/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/metadata/secret/ut/CMakeLists.txt":"",
- "ydb/services/metadata/secret/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/monitoring/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/monitoring/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/monitoring/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/monitoring/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/monitoring/CMakeLists.txt":"",
- "ydb/services/monitoring/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/persqueue_cluster_discovery/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/persqueue_cluster_discovery/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/persqueue_cluster_discovery/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/persqueue_cluster_discovery/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/persqueue_cluster_discovery/CMakeLists.txt":"",
- "ydb/services/persqueue_cluster_discovery/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/persqueue_cluster_discovery/cluster_ordering/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/persqueue_cluster_discovery/cluster_ordering/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/persqueue_cluster_discovery/cluster_ordering/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/persqueue_cluster_discovery/cluster_ordering/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/persqueue_cluster_discovery/cluster_ordering/CMakeLists.txt":"",
- "ydb/services/persqueue_cluster_discovery/cluster_ordering/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/persqueue_cluster_discovery/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/persqueue_cluster_discovery/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/persqueue_cluster_discovery/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/persqueue_cluster_discovery/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/persqueue_cluster_discovery/ut/CMakeLists.txt":"",
- "ydb/services/persqueue_cluster_discovery/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/persqueue_v1/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/persqueue_v1/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/persqueue_v1/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/persqueue_v1/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/persqueue_v1/CMakeLists.txt":"",
- "ydb/services/persqueue_v1/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/persqueue_v1/actors/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/persqueue_v1/actors/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/persqueue_v1/actors/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/persqueue_v1/actors/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/persqueue_v1/actors/CMakeLists.txt":"",
- "ydb/services/persqueue_v1/actors/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/persqueue_v1/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/persqueue_v1/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/persqueue_v1/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/persqueue_v1/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/persqueue_v1/ut/CMakeLists.txt":"",
- "ydb/services/persqueue_v1/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/persqueue_v1/ut/describes_ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/persqueue_v1/ut/describes_ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/persqueue_v1/ut/describes_ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/persqueue_v1/ut/describes_ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/persqueue_v1/ut/describes_ut/CMakeLists.txt":"",
- "ydb/services/persqueue_v1/ut/describes_ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/persqueue_v1/ut/new_schemecache_ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/persqueue_v1/ut/new_schemecache_ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/persqueue_v1/ut/new_schemecache_ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/persqueue_v1/ut/new_schemecache_ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/persqueue_v1/ut/new_schemecache_ut/CMakeLists.txt":"",
- "ydb/services/persqueue_v1/ut/new_schemecache_ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/rate_limiter/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/rate_limiter/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/rate_limiter/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/rate_limiter/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/rate_limiter/CMakeLists.txt":"",
- "ydb/services/rate_limiter/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/rate_limiter/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/rate_limiter/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/rate_limiter/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/rate_limiter/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/rate_limiter/ut/CMakeLists.txt":"",
- "ydb/services/rate_limiter/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/ydb/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/ydb/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/ydb/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/ydb/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/ydb/CMakeLists.txt":"",
- "ydb/services/ydb/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/ydb/sdk_credprovider_ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/ydb/sdk_credprovider_ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/ydb/sdk_credprovider_ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/ydb/sdk_credprovider_ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/ydb/sdk_credprovider_ut/CMakeLists.txt":"",
- "ydb/services/ydb/sdk_credprovider_ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/ydb/sdk_sessions_pool_ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/ydb/sdk_sessions_pool_ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/ydb/sdk_sessions_pool_ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/ydb/sdk_sessions_pool_ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/ydb/sdk_sessions_pool_ut/CMakeLists.txt":"",
- "ydb/services/ydb/sdk_sessions_pool_ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/ydb/sdk_sessions_ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/ydb/sdk_sessions_ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/ydb/sdk_sessions_ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/ydb/sdk_sessions_ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/ydb/sdk_sessions_ut/CMakeLists.txt":"",
- "ydb/services/ydb/sdk_sessions_ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/ydb/table_split_ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/ydb/table_split_ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/ydb/table_split_ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/ydb/table_split_ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/ydb/table_split_ut/CMakeLists.txt":"",
- "ydb/services/ydb/table_split_ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/services/ydb/ut/CMakeLists.darwin-arm64.txt":"",
- "ydb/services/ydb/ut/CMakeLists.darwin-x86_64.txt":"",
- "ydb/services/ydb/ut/CMakeLists.linux-aarch64.txt":"",
- "ydb/services/ydb/ut/CMakeLists.linux-x86_64.txt":"",
- "ydb/services/ydb/ut/CMakeLists.txt":"",
- "ydb/services/ydb/ut/CMakeLists.windows-x86_64.txt":"",
- "ydb/tests/CMakeLists.txt":"",
- "ydb/tests/functional/CMakeLists.txt":"",
- "ydb/tests/functional/kqp/CMakeLists.txt":"",
- "ydb/tests/functional/kqp/kqp_indexes/CMakeLists.darwin-arm64.txt":"",
- "ydb/tests/functional/kqp/kqp_indexes/CMakeLists.darwin-x86_64.txt":"",
- "ydb/tests/functional/kqp/kqp_indexes/CMakeLists.linux-aarch64.txt":"",
- "ydb/tests/functional/kqp/kqp_indexes/CMakeLists.linux-x86_64.txt":"",
- "ydb/tests/functional/kqp/kqp_indexes/CMakeLists.txt":"",
- "ydb/tests/functional/kqp/kqp_indexes/CMakeLists.windows-x86_64.txt":"",
- "ydb/tests/functional/kqp/kqp_query_session/CMakeLists.darwin-arm64.txt":"",
- "ydb/tests/functional/kqp/kqp_query_session/CMakeLists.darwin-x86_64.txt":"",
- "ydb/tests/functional/kqp/kqp_query_session/CMakeLists.linux-aarch64.txt":"",
- "ydb/tests/functional/kqp/kqp_query_session/CMakeLists.linux-x86_64.txt":"",
- "ydb/tests/functional/kqp/kqp_query_session/CMakeLists.txt":"",
- "ydb/tests/functional/kqp/kqp_query_session/CMakeLists.windows-x86_64.txt":"",
- "ydb/tests/tools/CMakeLists.txt":"",
- "ydb/tests/tools/idx_test/CMakeLists.darwin-arm64.txt":"",
- "ydb/tests/tools/idx_test/CMakeLists.darwin-x86_64.txt":"",
- "ydb/tests/tools/idx_test/CMakeLists.linux-aarch64.txt":"",
- "ydb/tests/tools/idx_test/CMakeLists.linux-x86_64.txt":"",
- "ydb/tests/tools/idx_test/CMakeLists.txt":"",
- "ydb/tests/tools/idx_test/CMakeLists.windows-x86_64.txt":"",
- "ydb/tests/tools/kqprun/CMakeLists.darwin-arm64.txt":"",
- "ydb/tests/tools/kqprun/CMakeLists.darwin-x86_64.txt":"",
- "ydb/tests/tools/kqprun/CMakeLists.linux-aarch64.txt":"",
- "ydb/tests/tools/kqprun/CMakeLists.linux-x86_64.txt":"",
- "ydb/tests/tools/kqprun/CMakeLists.txt":"",
- "ydb/tests/tools/kqprun/CMakeLists.windows-x86_64.txt":"",
- "ydb/tests/tools/kqprun/src/CMakeLists.darwin-arm64.txt":"",
- "ydb/tests/tools/kqprun/src/CMakeLists.darwin-x86_64.txt":"",
- "ydb/tests/tools/kqprun/src/CMakeLists.linux-aarch64.txt":"",
- "ydb/tests/tools/kqprun/src/CMakeLists.linux-x86_64.txt":"",
- "ydb/tests/tools/kqprun/src/CMakeLists.txt":"",
- "ydb/tests/tools/kqprun/src/CMakeLists.windows-x86_64.txt":"",
- "ydb/tests/tools/pq_read/CMakeLists.darwin-arm64.txt":"",
- "ydb/tests/tools/pq_read/CMakeLists.darwin-x86_64.txt":"",
- "ydb/tests/tools/pq_read/CMakeLists.linux-aarch64.txt":"",
- "ydb/tests/tools/pq_read/CMakeLists.linux-x86_64.txt":"",
- "ydb/tests/tools/pq_read/CMakeLists.txt":"",
- "ydb/tests/tools/pq_read/CMakeLists.windows-x86_64.txt":"",
- "yt/CMakeLists.txt":"",
- "yt/cpp/CMakeLists.txt":"",
- "yt/cpp/mapreduce/CMakeLists.txt":"",
- "yt/cpp/mapreduce/client/CMakeLists.darwin-arm64.txt":"",
- "yt/cpp/mapreduce/client/CMakeLists.darwin-x86_64.txt":"",
- "yt/cpp/mapreduce/client/CMakeLists.linux-aarch64.txt":"",
- "yt/cpp/mapreduce/client/CMakeLists.linux-x86_64.txt":"",
- "yt/cpp/mapreduce/client/CMakeLists.txt":"",
- "yt/cpp/mapreduce/client/CMakeLists.windows-x86_64.txt":"",
- "yt/cpp/mapreduce/common/CMakeLists.darwin-arm64.txt":"",
- "yt/cpp/mapreduce/common/CMakeLists.darwin-x86_64.txt":"",
- "yt/cpp/mapreduce/common/CMakeLists.linux-aarch64.txt":"",
- "yt/cpp/mapreduce/common/CMakeLists.linux-x86_64.txt":"",
- "yt/cpp/mapreduce/common/CMakeLists.txt":"",
- "yt/cpp/mapreduce/common/CMakeLists.windows-x86_64.txt":"",
- "yt/cpp/mapreduce/http/CMakeLists.darwin-arm64.txt":"",
- "yt/cpp/mapreduce/http/CMakeLists.darwin-x86_64.txt":"",
- "yt/cpp/mapreduce/http/CMakeLists.linux-aarch64.txt":"",
- "yt/cpp/mapreduce/http/CMakeLists.linux-x86_64.txt":"",
- "yt/cpp/mapreduce/http/CMakeLists.txt":"",
- "yt/cpp/mapreduce/http/CMakeLists.windows-x86_64.txt":"",
- "yt/cpp/mapreduce/interface/CMakeLists.darwin-arm64.txt":"",
- "yt/cpp/mapreduce/interface/CMakeLists.darwin-x86_64.txt":"",
- "yt/cpp/mapreduce/interface/CMakeLists.linux-aarch64.txt":"",
- "yt/cpp/mapreduce/interface/CMakeLists.linux-x86_64.txt":"",
- "yt/cpp/mapreduce/interface/CMakeLists.txt":"",
- "yt/cpp/mapreduce/interface/CMakeLists.windows-x86_64.txt":"",
- "yt/cpp/mapreduce/interface/logging/CMakeLists.darwin-arm64.txt":"",
- "yt/cpp/mapreduce/interface/logging/CMakeLists.darwin-x86_64.txt":"",
- "yt/cpp/mapreduce/interface/logging/CMakeLists.linux-aarch64.txt":"",
- "yt/cpp/mapreduce/interface/logging/CMakeLists.linux-x86_64.txt":"",
- "yt/cpp/mapreduce/interface/logging/CMakeLists.txt":"",
- "yt/cpp/mapreduce/interface/logging/CMakeLists.windows-x86_64.txt":"",
- "yt/cpp/mapreduce/io/CMakeLists.darwin-arm64.txt":"",
- "yt/cpp/mapreduce/io/CMakeLists.darwin-x86_64.txt":"",
- "yt/cpp/mapreduce/io/CMakeLists.linux-aarch64.txt":"",
- "yt/cpp/mapreduce/io/CMakeLists.linux-x86_64.txt":"",
- "yt/cpp/mapreduce/io/CMakeLists.txt":"",
- "yt/cpp/mapreduce/io/CMakeLists.windows-x86_64.txt":"",
- "yt/cpp/mapreduce/library/CMakeLists.txt":"",
- "yt/cpp/mapreduce/library/table_schema/CMakeLists.darwin-arm64.txt":"",
- "yt/cpp/mapreduce/library/table_schema/CMakeLists.darwin-x86_64.txt":"",
- "yt/cpp/mapreduce/library/table_schema/CMakeLists.linux-aarch64.txt":"",
- "yt/cpp/mapreduce/library/table_schema/CMakeLists.linux-x86_64.txt":"",
- "yt/cpp/mapreduce/library/table_schema/CMakeLists.txt":"",
- "yt/cpp/mapreduce/library/table_schema/CMakeLists.windows-x86_64.txt":"",
- "yt/cpp/mapreduce/library/user_job_statistics/CMakeLists.darwin-arm64.txt":"",
- "yt/cpp/mapreduce/library/user_job_statistics/CMakeLists.darwin-x86_64.txt":"",
- "yt/cpp/mapreduce/library/user_job_statistics/CMakeLists.linux-aarch64.txt":"",
- "yt/cpp/mapreduce/library/user_job_statistics/CMakeLists.linux-x86_64.txt":"",
- "yt/cpp/mapreduce/library/user_job_statistics/CMakeLists.txt":"",
- "yt/cpp/mapreduce/library/user_job_statistics/CMakeLists.windows-x86_64.txt":"",
- "yt/cpp/mapreduce/raw_client/CMakeLists.darwin-arm64.txt":"",
- "yt/cpp/mapreduce/raw_client/CMakeLists.darwin-x86_64.txt":"",
- "yt/cpp/mapreduce/raw_client/CMakeLists.linux-aarch64.txt":"",
- "yt/cpp/mapreduce/raw_client/CMakeLists.linux-x86_64.txt":"",
- "yt/cpp/mapreduce/raw_client/CMakeLists.txt":"",
- "yt/cpp/mapreduce/raw_client/CMakeLists.windows-x86_64.txt":"",
- "yt/cpp/mapreduce/skiff/CMakeLists.darwin-arm64.txt":"",
- "yt/cpp/mapreduce/skiff/CMakeLists.darwin-x86_64.txt":"",
- "yt/cpp/mapreduce/skiff/CMakeLists.linux-aarch64.txt":"",
- "yt/cpp/mapreduce/skiff/CMakeLists.linux-x86_64.txt":"",
- "yt/cpp/mapreduce/skiff/CMakeLists.txt":"",
- "yt/cpp/mapreduce/skiff/CMakeLists.windows-x86_64.txt":"",
- "yt/yql/CMakeLists.txt":"",
- "yt/yql/plugin/CMakeLists.darwin-arm64.txt":"",
- "yt/yql/plugin/CMakeLists.darwin-x86_64.txt":"",
- "yt/yql/plugin/CMakeLists.linux-aarch64.txt":"",
- "yt/yql/plugin/CMakeLists.linux-x86_64.txt":"",
- "yt/yql/plugin/CMakeLists.txt":"",
- "yt/yql/plugin/CMakeLists.windows-x86_64.txt":"",
- "yt/yql/plugin/dynamic/CMakeLists.darwin-arm64.txt":"",
- "yt/yql/plugin/dynamic/CMakeLists.darwin-x86_64.txt":"",
- "yt/yql/plugin/dynamic/CMakeLists.linux-aarch64.txt":"",
- "yt/yql/plugin/dynamic/CMakeLists.linux-x86_64.txt":"",
- "yt/yql/plugin/dynamic/CMakeLists.txt":"",
- "yt/yql/plugin/dynamic/CMakeLists.windows-x86_64.txt":"",
- "yt/yql/plugin/native/CMakeLists.darwin-arm64.txt":"",
- "yt/yql/plugin/native/CMakeLists.darwin-x86_64.txt":"",
- "yt/yql/plugin/native/CMakeLists.linux-aarch64.txt":"",
- "yt/yql/plugin/native/CMakeLists.linux-x86_64.txt":"",
- "yt/yql/plugin/native/CMakeLists.txt":"",
- "yt/yql/plugin/native/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/CMakeLists.txt":"",
- "yt/yt/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/build/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/build/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/build/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/build/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/build/CMakeLists.txt":"",
- "yt/yt/build/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/client/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/client/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/client/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/client/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/client/CMakeLists.txt":"",
- "yt/yt/client/arrow/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/client/arrow/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/client/arrow/CMakeLists.txt":"",
- "yt/yt/client/arrow/fbs/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/client/arrow/fbs/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/client/arrow/fbs/CMakeLists.txt":"",
- "yt/yt/client/query_tracker_client/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/client/query_tracker_client/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/client/query_tracker_client/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/client/query_tracker_client/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/client/query_tracker_client/CMakeLists.txt":"",
- "yt/yt/core/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/core/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/core/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/core/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/core/CMakeLists.txt":"",
- "yt/yt/core/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/core/http/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/core/http/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/core/http/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/core/http/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/core/http/CMakeLists.txt":"",
- "yt/yt/core/http/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/core/https/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/core/https/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/core/https/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/core/https/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/core/https/CMakeLists.txt":"",
- "yt/yt/core/https/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/core/misc/CMakeLists.txt":"",
- "yt/yt/core/misc/isa_crc64/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/core/misc/isa_crc64/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/core/misc/isa_crc64/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/core/misc/isa_crc64/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/core/misc/isa_crc64/CMakeLists.txt":"",
- "yt/yt/core/misc/isa_crc64/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/core/rpc/CMakeLists.txt":"",
- "yt/yt/core/rpc/grpc/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/core/rpc/grpc/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/core/rpc/grpc/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/core/rpc/grpc/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/core/rpc/grpc/CMakeLists.txt":"",
- "yt/yt/core/rpc/grpc/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/core/service_discovery/CMakeLists.txt":"",
- "yt/yt/core/service_discovery/yp/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/core/service_discovery/yp/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/core/service_discovery/yp/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/core/service_discovery/yp/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/core/service_discovery/yp/CMakeLists.txt":"",
- "yt/yt/core/service_discovery/yp/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/CMakeLists.txt":"",
- "yt/yt/library/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/auth/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/auth/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/auth/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/auth/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/auth/CMakeLists.txt":"",
- "yt/yt/library/backtrace_introspector/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/backtrace_introspector/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/backtrace_introspector/CMakeLists.txt":"",
- "yt/yt/library/backtrace_introspector/http/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/backtrace_introspector/http/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/backtrace_introspector/http/CMakeLists.txt":"",
- "yt/yt/library/decimal/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/decimal/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/decimal/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/decimal/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/decimal/CMakeLists.txt":"",
- "yt/yt/library/erasure/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/erasure/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/erasure/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/erasure/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/erasure/CMakeLists.txt":"",
- "yt/yt/library/monitoring/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/monitoring/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/monitoring/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/monitoring/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/monitoring/CMakeLists.txt":"",
- "yt/yt/library/monitoring/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/numeric/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/numeric/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/numeric/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/numeric/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/numeric/CMakeLists.txt":"",
- "yt/yt/library/process/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/process/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/process/CMakeLists.txt":"",
- "yt/yt/library/profiling/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/profiling/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/profiling/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/profiling/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/profiling/CMakeLists.txt":"",
- "yt/yt/library/profiling/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/profiling/perf/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/profiling/perf/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/profiling/perf/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/profiling/perf/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/profiling/perf/CMakeLists.txt":"",
- "yt/yt/library/profiling/perf/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/profiling/resource_tracker/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/profiling/resource_tracker/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/profiling/resource_tracker/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/profiling/resource_tracker/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/profiling/resource_tracker/CMakeLists.txt":"",
- "yt/yt/library/profiling/resource_tracker/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/profiling/solomon/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/profiling/solomon/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/profiling/solomon/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/profiling/solomon/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/profiling/solomon/CMakeLists.txt":"",
- "yt/yt/library/profiling/solomon/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/profiling/tcmalloc/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/profiling/tcmalloc/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/profiling/tcmalloc/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/profiling/tcmalloc/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/profiling/tcmalloc/CMakeLists.txt":"",
- "yt/yt/library/profiling/tcmalloc/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/program/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/program/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/program/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/program/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/program/CMakeLists.txt":"",
- "yt/yt/library/program/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/quantile_digest/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/quantile_digest/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/quantile_digest/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/quantile_digest/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/quantile_digest/CMakeLists.txt":"",
- "yt/yt/library/re2/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/re2/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/re2/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/re2/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/re2/CMakeLists.txt":"",
- "yt/yt/library/syncmap/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/syncmap/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/syncmap/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/syncmap/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/syncmap/CMakeLists.txt":"",
- "yt/yt/library/syncmap/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/tracing/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/tracing/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/tracing/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/tracing/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/tracing/CMakeLists.txt":"",
- "yt/yt/library/tracing/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/tracing/jaeger/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/tracing/jaeger/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/tracing/jaeger/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/tracing/jaeger/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/tracing/jaeger/CMakeLists.txt":"",
- "yt/yt/library/tracing/jaeger/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/tvm/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/tvm/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/tvm/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/tvm/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/tvm/CMakeLists.txt":"",
- "yt/yt/library/tvm/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/tvm/service/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/tvm/service/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/tvm/service/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/tvm/service/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/tvm/service/CMakeLists.txt":"",
- "yt/yt/library/tvm/service/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/undumpable/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/undumpable/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/undumpable/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/undumpable/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/undumpable/CMakeLists.txt":"",
- "yt/yt/library/undumpable/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/ytprof/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/ytprof/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/ytprof/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/ytprof/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/ytprof/CMakeLists.txt":"",
- "yt/yt/library/ytprof/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/ytprof/api/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/ytprof/api/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/ytprof/api/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/ytprof/api/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/ytprof/api/CMakeLists.txt":"",
- "yt/yt/library/ytprof/api/CMakeLists.windows-x86_64.txt":"",
- "yt/yt/library/ytprof/http/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/ytprof/http/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/ytprof/http/CMakeLists.txt":"",
- "yt/yt/library/ytprof/proto/CMakeLists.darwin-arm64.txt":"",
- "yt/yt/library/ytprof/proto/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt/library/ytprof/proto/CMakeLists.linux-aarch64.txt":"",
- "yt/yt/library/ytprof/proto/CMakeLists.linux-x86_64.txt":"",
- "yt/yt/library/ytprof/proto/CMakeLists.txt":"",
- "yt/yt/library/ytprof/proto/CMakeLists.windows-x86_64.txt":"",
- "yt/yt_proto/CMakeLists.txt":"",
- "yt/yt_proto/yt/CMakeLists.darwin-arm64.txt":"",
- "yt/yt_proto/yt/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt_proto/yt/CMakeLists.linux-aarch64.txt":"",
- "yt/yt_proto/yt/CMakeLists.linux-x86_64.txt":"",
- "yt/yt_proto/yt/CMakeLists.txt":"",
- "yt/yt_proto/yt/CMakeLists.windows-x86_64.txt":"",
- "yt/yt_proto/yt/client/CMakeLists.darwin-arm64.txt":"",
- "yt/yt_proto/yt/client/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt_proto/yt/client/CMakeLists.linux-aarch64.txt":"",
- "yt/yt_proto/yt/client/CMakeLists.linux-x86_64.txt":"",
- "yt/yt_proto/yt/client/CMakeLists.txt":"",
- "yt/yt_proto/yt/core/CMakeLists.darwin-arm64.txt":"",
- "yt/yt_proto/yt/core/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt_proto/yt/core/CMakeLists.linux-aarch64.txt":"",
- "yt/yt_proto/yt/core/CMakeLists.linux-x86_64.txt":"",
- "yt/yt_proto/yt/core/CMakeLists.txt":"",
- "yt/yt_proto/yt/core/CMakeLists.windows-x86_64.txt":"",
- "yt/yt_proto/yt/formats/CMakeLists.darwin-arm64.txt":"",
- "yt/yt_proto/yt/formats/CMakeLists.darwin-x86_64.txt":"",
- "yt/yt_proto/yt/formats/CMakeLists.linux-aarch64.txt":"",
- "yt/yt_proto/yt/formats/CMakeLists.linux-x86_64.txt":"",
- "yt/yt_proto/yt/formats/CMakeLists.txt":"",
- "yt/yt_proto/yt/formats/CMakeLists.windows-x86_64.txt":""
-} \ No newline at end of file
diff --git a/build/conf/docs.conf b/build/conf/docs.conf
index b0199a808c0..6a4c3b58059 100644
--- a/build/conf/docs.conf
+++ b/build/conf/docs.conf
@@ -22,7 +22,7 @@ _DOCS_ENV=
_DOCS_KV=${kv;hide:"p DO"} ${kv;hide:"pc light-cyan"} ${kv;hide:"show_out yes"}
_DOCS_PLANTUML_ENV=\
-${env:"JAVA_PATH=$JDK19_RESOURCE_GLOBAL/bin/java"} \
+${env:"JAVA_PATH=$JDK21_RESOURCE_GLOBAL/bin/java"} \
${env:"PLANTUML_PATH=contrib/tools/plantuml/plantuml.run.cp.jar"} \
${env:"_JAVA_OPTIONS='-Dsun.awt.fontconfig=contrib/java/openjdk-fontconfig/fontconfig.properties -Djava.awt.headless=true'"} \
${env:"LANG=en_US.UTF-8"} \
@@ -130,7 +130,7 @@ module _DOCS_BASE_UNIT: _DOCS_BARE_UNIT {
### This macr sets appropriate dependencies for use of plantuml plugin
macro _DOCS_YFM_USE_PLANTUML() {
when ($DOCSLIB == "yes") {
- PEERDIR+=build/platform/java/jdk/jdk19 contrib/java/openjdk-fontconfig
+ PEERDIR+=build/platform/java/jdk/jdk21 contrib/java/openjdk-fontconfig
_DOCS_ENV+=$_DOCS_PLANTUML_ENV
_DOCS_EXTRA_TOOLS+=${hide;tool:"contrib/tools/plantuml"}
diff --git a/build/conf/go.conf b/build/conf/go.conf
index 4a2a1b8becb..f44a87ae9d0 100644
--- a/build/conf/go.conf
+++ b/build/conf/go.conf
@@ -230,7 +230,7 @@ macro _GO_LINK_LIB_IMPL(CGO_FILES[], EXTRA_INPUTS[], EXTRA_TEXT_INPUTS[], GO_FIL
# tag:go-specific
macro _GO_LINK_EXE_IMPL(CGO_FILES[], EXTRA_INPUTS[], EXTRA_TEXT_INPUTS[], GO_FILES...) {
- .CMD=${hide:_GO_FAKEID} $GO_TOOL ${hide;input:EXTRA_INPUTS} ${hide;input;context=TEXT:EXTRA_TEXT_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++vcs $VCS_GO $GO_WITH_MUSL $GO_EXTLD ++peers ${rootrel;tags_in=local,GO|local,GO_PROTO|local,GO_FBS:PEERS} ++non-local-peers ${rootrel;tags_in=GO|GO_PROTO|GO_FBS;tags_out=local:PEERS} ++cgo-peers ${VCS_C_OBJ_RR} ${rootrel;tags_out=GO|GO_PROTO|GO_FBS:PEERS} --ya-end-command-file ${kv;hide:"p LD"} ${kv;hide:"pc light-red"} ${kv;hide:"show_out"} $_GO_LINK_EXE_EXT_CMD
+ .CMD=${hide:_GO_FAKEID} $GO_TOOL ${hide;input:EXTRA_INPUTS} ${hide;input;context=TEXT:EXTRA_TEXT_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++vcs $VCS_GO $GO_WITH_MUSL $GO_EXTLD ++peers ${rootrel;tags_in=local,GO|local,GO_PROTO|local,GO_FBS:PEERS} ++non-local-peers ${rootrel;tags_in=GO|GO_PROTO|GO_FBS;tags_out=local:PEERS} ++cgo-peers ${VCS_C_OBJ_RR} ${_EXTRA_OBJS} ${rootrel;tags_out=GO|GO_PROTO|GO_FBS:PEERS} --ya-end-command-file ${kv;hide:"p LD"} ${kv;hide:"pc light-red"} ${kv;hide:"show_out"} $_GO_LINK_EXE_EXT_CMD
}
# tag:go-specific
@@ -247,6 +247,7 @@ GO_LINK_EXE=
GO_LINK_EXE+=$GENERATE_MF
GO_LINK_EXE+=&& $GENERATE_VCS_C_INFO_NODEP
GO_LINK_EXE+=&& $GENERATE_VCS_GO_INFO_NODEP
+GO_LINK_EXE+=&& $_GENERATE_EXTRA_OBJS
GO_LINK_EXE+=&& $_GO_LINK_EXE_IMPL($_GO_SRCS_VALUE CGO_FILES $_CGO_SRCS_VALUE EXTRA_TEXT_INPUTS $_GO_EMBED_INPUTS)
GO_LINK_TEST=
diff --git a/build/conf/java.conf b/build/conf/java.conf
index 5879bc488cd..d044be58655 100644
--- a/build/conf/java.conf
+++ b/build/conf/java.conf
@@ -410,7 +410,7 @@ when($JDK_VERSION == "8") {
}
# tag:java-specific
-JDK_LATEST_VERSION=19
+JDK_LATEST_VERSION=21
JDK_LATEST_PEERDIR=build/platform/java/jdk/jdk${JDK_LATEST_VERSION}
# tag:java-specific
@@ -1045,11 +1045,6 @@ module JAR_LIBRARY: _COMPILABLE_JAR_BASE {
JAVAC_OPTS+=$ERROR_PRONE_JDK16_ADD_OPENS
}
- when($ERROR_PRONE_VALUE && $JDK_REAL_VERSION == "19") {
- JAVAC_FLAGS_VALUE+=$ERROR_PRONE_JDK16_ADD_OPENS
- JAVAC_OPTS+=$ERROR_PRONE_JDK16_ADD_OPENS
- }
-
when($ERROR_PRONE_VALUE && $JDK_REAL_VERSION == "20") {
JAVAC_FLAGS_VALUE+=$ERROR_PRONE_JDK16_ADD_OPENS
JAVAC_OPTS+=$ERROR_PRONE_JDK16_ADD_OPENS
@@ -1199,9 +1194,6 @@ when ($JDK_VERSION == "21") {
elsewhen ($JDK_VERSION == "20") {
JDK_REAL_VERSION=20
}
-elsewhen ($JDK_VERSION == "19") {
- JDK_REAL_VERSION=19
-}
elsewhen ($JDK_VERSION == "18") {
JDK_REAL_VERSION=18
}
@@ -1236,9 +1228,6 @@ otherwise {
when ($JDK_REAL_VERSION == "20") {
JDK_RESOURCE_PEERDIR=build/platform/java/jdk/jdk20 build/platform/java/jdk/jdk17
}
- when ($JDK_REAL_VERSION == "19") {
- JDK_RESOURCE_PEERDIR=build/platform/java/jdk/jdk19 build/platform/java/jdk/jdk17
- }
when ($JDK_REAL_VERSION == "18") {
JDK_RESOURCE_PEERDIR=build/platform/java/jdk/jdk18 build/platform/java/jdk/jdk17
}
@@ -1264,9 +1253,6 @@ when ($JDK_REAL_VERSION == "21") {
when ($JDK_REAL_VERSION == "20") {
UBERJAR_RESOURCE_PEERDIR=build/platform/java/uberjar/uberjar20
}
-when ($JDK_REAL_VERSION == "19") {
- UBERJAR_RESOURCE_PEERDIR=build/platform/java/uberjar/uberjar18
-}
when ($JDK_REAL_VERSION == "18") {
UBERJAR_RESOURCE_PEERDIR=build/platform/java/uberjar/uberjar18
}
@@ -1295,9 +1281,6 @@ otherwise {
when ($JDK_REAL_VERSION == "20") {
JDK_RESOURCE=$JDK20_RESOURCE_GLOBAL
}
- when ($JDK_REAL_VERSION == "19") {
- JDK_RESOURCE=$JDK19_RESOURCE_GLOBAL
- }
when ($JDK_REAL_VERSION == "18") {
JDK_RESOURCE=$JDK18_RESOURCE_GLOBAL
}
@@ -1338,11 +1321,6 @@ when (!$USE_SYSTEM_ERROR_PRONE) {
ERROR_PRONE_PEERDIR=build/platform/java/error_prone/2.14.0
ERROR_PRONE_RESOURCE=$ERROR_PRONE_2_14_0_RESOURCE_GLOBAL
}
- elsewhen ($JDK_REAL_VERSION == "19") {
- ERROR_PRONE_VERSION=2.18.0
- ERROR_PRONE_PEERDIR=build/platform/java/error_prone/2.18.0
- ERROR_PRONE_RESOURCE=$ERROR_PRONE_2_18_0_RESOURCE_GLOBAL
- }
elsewhen ($JDK_REAL_VERSION == "20") {
ERROR_PRONE_VERSION=2.18.0
ERROR_PRONE_PEERDIR=build/platform/java/error_prone/2.18.0
@@ -1376,9 +1354,6 @@ otherwise {
when ($JDK_REAL_VERSION == "20") {
UBERJAR_RESOURCE=$UBERJAR20_RESOURCE_GLOBAL
}
- when ($JDK_REAL_VERSION == "19") {
- UBERJAR_RESOURCE=$UBERJAR18_RESOURCE_GLOBAL
- }
when ($JDK_REAL_VERSION == "18") {
UBERJAR_RESOURCE=$UBERJAR18_RESOURCE_GLOBAL
}
@@ -1403,9 +1378,6 @@ when ($JDK_REAL_VERSION == "21") {
when ($JDK_REAL_VERSION == "20") {
WITH_JDK_RESOURCE=$WITH_JDK20_RESOURCE_GLOBAL
}
-when ($JDK_REAL_VERSION == "19") {
- WITH_JDK_RESOURCE=$WITH_JDK19_RESOURCE_GLOBAL
-}
when ($JDK_REAL_VERSION == "18") {
WITH_JDK_RESOURCE=$WITH_JDK18_RESOURCE_GLOBAL
}
@@ -1452,7 +1424,7 @@ macro SYSTEM_PROPERTIES(Args...) {
}
# tag:java-specific
-JVM_ARGS_VALUE=
+JVM_ARGS_VALUE=-ea
### @usage: JVM_ARGS(Args...)
###
### Arguments to run Java programs in tests.
@@ -1802,11 +1774,15 @@ macro WITH_JDK() {
# tag:kotlin-specific
WITH_KOTLIN_VALUE=
+_WITH_KOTLIN_SEM=
+_KOTLIN_VERSION_SEM=
### @usage: WITH_KOTLIN()
###
### Compile kotlin source code in this java module
macro WITH_KOTLIN() {
SET(WITH_KOTLIN_VALUE yes)
+ SET(_WITH_KOTLIN_SEM && with_kotlin)
+ SET(_KOTLIN_VERSION_SEM && kotlin_version ${KOTLIN_VERSION})
}
# tag:kotlin-specific
@@ -1838,9 +1814,11 @@ macro KOTLINC_FLAGS(Args...) {
# tag:kotlin-sppecific
WITH_KOTLINC_PLUGIN_ALLOPEN=
+_WITH_KOTLINC_PLUGIN_ALLOPEN_SEM=
macro _WITH_KOTLINC_ALLOPEN(Options...) {
SET_APPEND(KOTLINC_OPTS_VALUE ${pre=-P plugin\:org.jetbrains.kotlin.allopen\::Options})
SET(WITH_KOTLINC_PLUGIN_ALLOPEN yes)
+ SET(_WITH_KOTLINC_ALLOPEN_SEM && with_kotlinc_plugin_allopen)
}
# tag:kotlin-specific
@@ -1854,31 +1832,37 @@ macro WITH_KOTLINC_ALLOPEN(HEAD, TAIL...) {
# tag:kotlin-specific
WITH_KOTLINC_PLUGIN_LOMBOK=
+_WITH_KOTLINC_PLUGIN_LOMBOK_SEM=
### @usage: WITH_KOTLINC_LOMBOK(-flags)
###
### Enable lombok kotlin compiler plugin https://kotlinlang.org/docs/lombok.html
macro WITH_KOTLINC_LOMBOK(Options...) {
SET_APPEND(KOTLINC_OPTS_VALUE ${pre=-P plugin\:org.jetbrains.kotlin.lombok\::Options})
SET(WITH_KOTLINC_PLUGIN_LOMBOK yes)
+ SET(_WITH_KOTLINC_PLUGIN_LOMBOK_SEM && with_kotlinc_plugin_lombok)
}
# tag:kotlin-specific
WITH_KOTLINC_PLUGIN_NOARG=
+_WITH_KOTLINC_PLUGIN_NOARG_SEM=
### @usage: WITH_KOTLINC_NOARG(-flags)
###
### Enable noarg kotlin compiler plugin https://kotlinlang.org/docs/no-arg-plugin.html
macro WITH_KOTLINC_NOARG(Options...) {
SET_APPEND(KOTLINC_OPTS_VALUE ${pre=-P plugin\:org.jetbrains.kotlin.noarg\::Options})
SET(WITH_KOTLINC_PLUGIN_NOARG yes)
+ SET(_WITH_KOTLINC_PLUGIN_NOARG_SEM && with_kotlinc_plugin_noarg)
}
# tag:kotlin-specific
WITH_KOTLINC_PLUGIN_SERIALIZATION=
+_WITH_KOTLINC_PLUGIN_SERIALIZATION_SEM=
### @usage: WITH_KOTLINC_SERIALIZATION()
###
### Enable serialization kotlin compiler plugin https://kotlinlang.org/docs/serialization.html
macro WITH_KOTLINC_SERIALIZATION() {
SET(WITH_KOTLINC_PLUGIN_SERIALIZATION yes)
+ SET(_WITH_KOTLINC_PLUGIN_SERIALIZATION_SEM && with_kotlinc_plugin_serialization)
}
# tag:kotlin-specific
@@ -1888,12 +1872,12 @@ KOTLIN_BOM_FILE=${ARCADIA_ROOT}/contrib/java/org/jetbrains/kotlin/kotlin-bom/1.9
GROOVY_VERSION=3.0.5
_KOTLIN_SEM= \
- && kotlin_version ${KOTLIN_VERSION} \
- && with_kotlin ${WITH_KOTLIN_VALUE} \
- && with_kotlinc_plugin_allopen ${WITH_KOTLINC_PLUGIN_ALLOPEN} \
- && with_kotlinc_plugin_lombok ${WITH_KOTLINC_PLUGIN_LOMBOK} \
- && with_kotlinc_plugin_noarg ${WITH_KOTLINC_PLUGIN_NOARG} \
- && with_kotlinc_plugin_serialization ${WITH_KOTLINC_PLUGIN_SERIALIZATION}
+ ${_WITH_KOTLIN_SEM} \
+ ${_KOTLIN_VERSION_SEM} \
+ ${_WITH_KOTLINC_PLUGIN_ALLOPEN_SEM} \
+ ${_WITH_KOTLINC_PLUGIN_LOMBOK_SEM} \
+ ${_WITH_KOTLINC_PLUGIN_NOARG_SEM} \
+ ${_WITH_KOTLINC_PLUGIN_SERIALIZATION_SEM}
_JAVA_PROTO_GRPC_SEM=
diff --git a/build/conf/license.conf b/build/conf/license.conf
index ae2d9813962..ffb01e93f91 100644
--- a/build/conf/license.conf
+++ b/build/conf/license.conf
@@ -426,6 +426,11 @@ macro _DONT_REQUIRE_LICENSE() {
macro LICENSE(Flags...) {
SET(LICENSE_EXPRESSION $Flags)
SET(LICENSE_NAMES $Flags)
+ # TODO(YMAKE-1136) avoid abusing LICENSE
+ # NOTICE: final value of MODVER might not be set yet if VERSION macro is called after LICENSE. Var expansion is
+ # escaped here to prevent eager value substitution by SET but allow delayed value substitution when
+ # adding linking SBOM data command to graph.
+ SET_APPEND(_SBOM_INFO_GLOBAL "path=${MODDIR};ver=\${join=.:MODVER};lang=${MODULE_LANG}")
}
### @usage LICENSE_RESTRICTION(ALLOW_ONLY|DENY LicenseProperty...)
diff --git a/build/conf/linkers/ld.conf b/build/conf/linkers/ld.conf
index cf162a0db40..4fc8b1eb9c9 100644
--- a/build/conf/linkers/ld.conf
+++ b/build/conf/linkers/ld.conf
@@ -203,7 +203,7 @@ REAL_LINK_EXE_CMDLINE+=\
$LINK_SCRIPT_EXE_FLAGS \
$CXX_COMPILER \
$_LD_SRCS_GLOBALS \
- $VCS_C_OBJ $AUTO_INPUT -o $TARGET \
+ $VCS_C_OBJ $_EXTRA_OBJS $AUTO_INPUT -o $TARGET \
$_EXE_FLAGS \
$_PROCESS_WHOLE_ARCHIVE_SCRIPT \
$_LD_ENV_STYLE
@@ -230,7 +230,7 @@ REAL_LINK_EXEC_DYN_LIB_CMDLINE+=\
$LINK_DYN_LIB_FLAGS \
$CXX_COMPILER \
$_LD_SRCS_GLOBALS \
- $VCS_C_OBJ $AUTO_INPUT -o $TARGET \
+ $VCS_C_OBJ $_EXTRA_OBJS $AUTO_INPUT -o $TARGET \
$_EXEC_SHARED_FLAG \
$_SONAME_FLAG \
$_EXE_FLAGS \
@@ -254,7 +254,7 @@ REAL_LINK_DYN_LIB_CMDLINE+=\
$LINK_DYN_LIB_FLAGS \
$CXX_COMPILER \
$_LD_SRCS_GLOBALS \
- $VCS_C_OBJ $AUTO_INPUT -o $TARGET \
+ $VCS_C_OBJ $_EXTRA_OBJS $AUTO_INPUT -o $TARGET \
$_SHARED_FLAG \
$_SONAME_FLAG \
$_EXE_FLAGS \
@@ -276,10 +276,13 @@ otherwise {
DWARF_COMMAND=$_DWARF_COMMAND
_REAL_LINK_EXE=$REAL_LINK_EXE_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE)
+_EXTRA_OBJS=
+_GENERATE_EXTRA_OBJS=
_LINK_EXE=
_LINK_EXE+=$GENERATE_MF
_LINK_EXE+=&& $GENERATE_VCS_C_INFO_NODEP
+_LINK_EXE+=&& $_GENERATE_EXTRA_OBJS
_LINK_EXE+=&& $COPY_PROFILE_RUNTIME
_LINK_EXE+=&& $REAL_LINK_EXE
_LINK_EXE+=&& $DWARF_COMMAND
@@ -289,6 +292,7 @@ _LINK_EXE+=&& $PACK_IOS_CMD
_LINK_DYN_LIB=
_LINK_DYN_LIB+=$GENERATE_MF
_LINK_DYN_LIB+=&& $GENERATE_VCS_C_INFO_NODEP
+_LINK_DYN_LIB+=&& $_GENERATE_EXTRA_OBJS
_LINK_DYN_LIB+=&& $COPY_PROFILE_RUNTIME
_LINK_DYN_LIB+=&& $REAL_LINK_DYN_LIB
_LINK_DYN_LIB+=&& $DWARF_COMMAND
@@ -306,6 +310,7 @@ LINK_DYN_LIB=$_LINK_DYN_LIB
LINK_EXEC_DYN_LIB=\
$GENERATE_MF && \
$GENERATE_VCS_C_INFO_NODEP && \
+ $_GENERATE_EXTRA_OBJS && \
$REAL_LINK_EXEC_DYN_LIB && \
$DWARF_COMMAND && \
$LINK_ADDITIONAL_SECTIONS_COMMAND
diff --git a/build/conf/linkers/msvc_linker.conf b/build/conf/linkers/msvc_linker.conf
index 2372f3ef6cc..27d3a41b203 100644
--- a/build/conf/linkers/msvc_linker.conf
+++ b/build/conf/linkers/msvc_linker.conf
@@ -139,6 +139,9 @@ GENERATE_MF_CMD=\
-Ya,credits ${input:CREDITS_TEXTS_FILE} $CREDITS_FLAGS \
--ya-end-command-file
+_EXTRA_OBJS=
+_GENERATE_EXTRA_OBJS=
+
# we split srcs_global into two groups: libs and objs
# # each group can be in its own command file
# first group need /WHOLEARCHIVE: prefix which will be added in fix_msvc_output.py or run_msvc_wine.py
@@ -188,6 +191,7 @@ GLOBAL_LINK_LIB=$_MSVC_HEAD_LINK_LIB /OUT:${qe;rootrel:GLOBAL_TARGET} $_MSVC_TAI
LINK_EXE_CMDLINE=\
${GENERATE_MF} && \
+ ${_GENERATE_EXTRA_OBJS} && \
$GENERATE_VCS_C_INFO_NODEP && \
${TOOLCHAIN_ENV} \
${cwd:ARCADIA_BUILD_ROOT} \
@@ -200,6 +204,7 @@ LINK_EXE_CMDLINE=\
$_MSVC_SRCS_GLOBALS \
--ya-start-command-file \
${VCS_C_OBJ_RR} \
+ ${_EXTRA_OBJS} \
${qe;rootrel:AUTO_INPUT} \
$LINK_EXE_FLAGS \
$LINK_STDLIBS \
diff --git a/build/conf/opensource.conf b/build/conf/opensource.conf
index 7a52f06baa9..8e8ba81db59 100644
--- a/build/conf/opensource.conf
+++ b/build/conf/opensource.conf
@@ -34,6 +34,8 @@ when ($OPENSOURCE == "yes") {
when ($OPENSOURCE == "yes" && $EXPORT_GRADLE == "yes") {
RECURSIVE_ADD_PEERS_TESTS=yes
EXPORT_SEM=yes
+ EXPORTED_BUILD_SYSTEM_SOURCE_ROOT=${"$"}{PROJECT_SOURCE_DIR}
+ EXPORTED_BUILD_SYSTEM_BUILD_ROOT=${"$"}{PROJECT_BINARY_DIR}
}
# Extra macros to control how cmake export works
@@ -48,6 +50,8 @@ when ($OPENSOURCE == "yes" && $EXPORT_CMAKE == "yes") {
# USE_GLOBAL_CMD=yes does not work for Windows with ya make builds but works with exported CMake files: YMAKE-657.
USE_GLOBAL_CMD=yes
EXPORT_SEM=yes
+ EXPORTED_BUILD_SYSTEM_SOURCE_ROOT="${PROJECT_SOURCE_DIR}"
+ EXPORTED_BUILD_SYSTEM_BUILD_ROOT="${PROJECT_BINARY_DIR}"
}
CMAKE_PACKAGE=
diff --git a/build/conf/proto.conf b/build/conf/proto.conf
index b3fc5bc0a7b..4d867c45df7 100644
--- a/build/conf/proto.conf
+++ b/build/conf/proto.conf
@@ -759,6 +759,12 @@ multimodule PROTO_LIBRARY {
# To include TS_PROTO user have to set INCLUDE_TAGS(TS_PROTO) in ya.make
.INCLUDE_TAG=no
.EPILOGUE=_TS_CONFIG_EPILOGUE
+ .PEERDIRSELF=TS_PREPARE_DEPS
+ }
+
+ module TS_PREPARE_DEPS: _PREPARE_DEPS_BASE {
+ .INCLUDE_TAG=no
+ .IGNORED=PEERDIR
}
module DESC_PROTO: _BARE_UNIT {
diff --git a/build/conf/python.conf b/build/conf/python.conf
index f7ede3e4a5d..79c4eeb5bec 100644
--- a/build/conf/python.conf
+++ b/build/conf/python.conf
@@ -112,6 +112,11 @@ when ($USE_SYSTEM_PYTHON) {
PY_VERSION=3.11
PY_FRAMEWORK_VERSION=3.11
}
+ "3.12" ? {
+ _SYSTEM_PYTHON312=yes
+ PY_VERSION=3.12
+ PY_FRAMEWORK_VERSION=3.12
+ }
default ? {
FATAL_ERROR_MESSAGE+=invalid USE_SYSTEM_PYTHON value
}
@@ -238,13 +243,13 @@ macro STYLE_PYTHON(pyproject...) {
# tag:python-specific tag:test
STYLE_RUFF_VALUE=no
-STYLE_RUFF_PYPROJECT_VALUE=
-### @usage: STYLE_RUFF([pyproject])
+RUFF_CONFIG_PATHS_FILE=build/config/tests/ruff/ruff_config_paths.json
+### @usage: STYLE_RUFF()
###
### Check python3 sources for style issues using ruff.
-macro STYLE_RUFF(pyproject...) {
+macro STYLE_RUFF() {
SET(STYLE_RUFF_VALUE yes)
- SET(STYLE_RUFF_PYPROJECT_VALUE ${pyproject})
+ SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${RUFF_CONFIG_PATHS_FILE})
}
# tag:python-specific tag:test
@@ -467,7 +472,7 @@ macro PYTHON2_MODULE() {
### Use in PY_ANY_MODULE to set it up for Python 3.x.
macro PYTHON3_MODULE() {
when ($USE_ARCADIA_PYTHON == "yes" && $MSVC == "yes" || $IS_CROSS_TOOLS == "yes") {
- PEERDIR+=contrib/tools/python3/lib
+ PEERDIR+=contrib/tools/python3/lib2
}
SET(ANTLR_PYTHON Python3)
@@ -664,7 +669,7 @@ module _BASE_PY3_PROGRAM: _BASE_PROGRAM {
PYTHON_TYPE_FOR_CYTHON=PY3
PEERDIR(library/python/runtime_py3/main)
when ($PYTHON_SQLITE3 != "no") {
- PEERDIR += contrib/tools/python3/src/Modules/_sqlite
+ PEERDIR += contrib/tools/python3/Modules/_sqlite
}
when ($SANITIZER_TYPE && $SANITIZER_TYPE != "no") {
diff --git a/build/conf/ts/node_modules.conf b/build/conf/ts/node_modules.conf
index 13953e3c67c..115579711d3 100644
--- a/build/conf/ts/node_modules.conf
+++ b/build/conf/ts/node_modules.conf
@@ -1,71 +1,14 @@
PNPM_ROOT=
PNPM_SCRIPT=$PNPM_ROOT/node_modules/pnpm/dist/pnpm.cjs
NPM_CONTRIBS_PATH=contrib/typescript
-# inputs list, just paths, deprecated (use _NODE_MODULES_INOUTS instead), used only for eslint/jest/hermione
-_NODE_MODULES_INS=
-# outputs list, just paths, deprecated (use _NODE_MODULES_INOUTS instead), used only for eslint/jest/hermione
-_NODE_MODULES_OUTS=
# combined input/outputs records as list of directives ${input;hide:<path>} ${output;hide:<path>}, used in builders
_NODE_MODULES_INOUTS=
_YATOOL_PREBUILDER_ARG=
-# TOUCH_UNIT is required to create module identity file.
-# We can "call" macro as `$_GET_NODE_MODULES_INS_OUTS(...)`. in this case we will get .CMD from it.
-# This is the only way to process a variable data as an array.
-# ${output;hide:_NODE_MODULES_OUTS} does not produce list of paths, but a single value (space-separeted paths)
-_NODE_MODULES_CMD=$TOUCH_UNIT \
- && $NOTS_TOOL $NOTS_TOOL_BASE_ARGS create-node-modules \
- $_GET_NODE_MODULES_INS_OUTS(IN $_NODE_MODULES_INS OUT $_NODE_MODULES_OUTS) \
- ${kv;hide:"pc magenta"} ${kv;hide:"p TS_NM"}
-
-
-module _NODE_MODULES_BASE: _BARE_UNIT {
- .CMD=_NODE_MODULES_CMD
- # ignore SRCS macro, use TS_FILES instead of FILES
- .ALIASES=SRCS=_NOOP_MACRO FILES=TS_FILES
- # Propagates peers to related modules
- .PEERDIR_POLICY=as_build_from
- .NODE_TYPE=Bundle
-
- # TODO: remove this. YMAKE-1096 / FBP-1184
- _NEVERCACHE()
-
- # we have several modules in the same dir (.PEERDIRSELF=NODE_MODULES in BUILD)
- # we need different names for module identity file
- # .fake tells builder to not materialize it in results
- SET(MODULE_SUFFIX .n_m.fake)
- # .NODE_TYPE=Bundle is required for peers propagation, but it also affects
- # how merging of pic/nopic graphs. Here we can override this merging behaviour
- SET(MODULE_TYPE LIBRARY)
- # define own tag
- SET(MODULE_TAG NODE_MODULES)
- # what modules it can PEERDIR to
- SET(PEERDIR_TAGS TS TS_PROTO NPM_CONTRIBS)
- # do not include it into "results" of graph
- DISABLE(START_TARGET)
-
- # we read package.json and erm-packages.json during configuration
- SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/pnpm-lock.yaml ${CURDIR}/package.json ${ARCADIA_ROOT}/$ERM_PACKAGES_PATH)
-
- PEERDIR($NPM_CONTRIBS_PATH)
- # PEERDIR to the right version of nodejs and pnpm
- _PEERDIR_TS_RESOURCE(nodejs pnpm)
-
- # run py logic
- _NODE_MODULES_CONFIGURE()
-}
-
-# called in on_node_modules_configure
-macro _SET_NODE_MODULES_INS_OUTS(IN{input}[], OUT{output}[]) {
- SET(_NODE_MODULES_INS $IN)
- SET(_NODE_MODULES_OUTS $OUT)
+macro CUSTOM_CONTRIB_TYPESCRIPT(P) {
+ SET(NPM_CONTRIBS_PATH $P)
}
-macro _GET_NODE_MODULES_INS_OUTS(IN{input}[], OUT{output}[]) {
- .CMD=${input;hide:IN} ${output;hide:OUT}
-}
-
-
### @usage: NPM_CONTRIBS() # internal
###
### Defines special module that provides contrib tarballs from internal npm registry.
@@ -105,9 +48,48 @@ macro _FROM_NPM(TARBALL_URL, SKY_ID, INTEGRITY, INTEGRITY_ALGO, TARBALL_PATH) {
}
macro _TS_ADD_NODE_MODULES_FOR_BUILDER() {
- # Provide downloaded dependencies in `/contrib/typescript/-`
- PEERDIR($NPM_CONTRIBS_PATH)
-
# Calculate inputs and outputs of node_modules, fill `_NODE_MODULES_INOUTS` variable
_NODE_MODULES_CONFIGURE()
}
+
+_TARBALLS_STORE=__tarballs__
+_PREPARE_DEPS_INOUTS=
+_PREPARE_DEPS_CMD=$TOUCH_UNIT \
+ && $NOTS_TOOL $NOTS_TOOL_BASE_ARGS prepare-deps \
+ --tarballs-store $_TARBALLS_STORE \
+ $_PREPARE_DEPS_INOUTS \
+ ${kv;hide:"pc magenta"} ${kv;hide:"p TS_DEP"}
+
+# In case of no deps we need to create empty outputs for graph connectivity
+_PREPARE_NO_DEPS_CMD=$TOUCH_UNIT \
+ && $YMAKE_PYTHON ${input:"build/scripts/touch.py"} \
+ $_PREPARE_DEPS_INOUTS \
+ ${kv;hide:"pc magenta"} ${kv;hide:"p TS_NODEP"}
+
+module _PREPARE_DEPS_BASE: _BARE_UNIT {
+ .CMD=_PREPARE_DEPS_CMD
+ .IGNORED=SRCS FILES TS_FILES
+ # Propagates peers to related modules
+ .PEERDIR_POLICY=as_build_from
+ .NODE_TYPE=Bundle
+ .INCLUDE_TAG=no
+
+ # we have several modules in the same dir (.PEERDIRSELF=TS_PREPARE_DEPS in BUILD)
+ # we need different names for module identity file
+ # .fake tells builder to not materialize it in results
+ SET(MODULE_SUFFIX .prepare_deps.fake)
+ # .NODE_TYPE=Bundle is required for peers propagation, but it also affects
+ # how merging of pic/nopic graphs. Here we can override this merging behaviour
+ SET(MODULE_TYPE LIBRARY)
+ # define own tag
+ SET(MODULE_TAG TS_PREPARE_DEPS)
+ # what modules it can PEERDIR to
+ SET(PEERDIR_TAGS TS_PREPARE_DEPS)
+ # do not include it into "results" of graph
+ DISABLE(START_TARGET)
+
+ # we read pnpm-lock.yaml and package.json during configuration
+ SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/pnpm-lock.yaml ${CURDIR}/package.json)
+
+ _PREPARE_DEPS_CONFIGURE()
+}
diff --git a/build/conf/ts/ts.conf b/build/conf/ts/ts.conf
index c97de732325..14a3f9b507b 100644
--- a/build/conf/ts/ts.conf
+++ b/build/conf/ts/ts.conf
@@ -45,9 +45,6 @@ module _TS_BASE_UNIT: _BARE_UNIT {
# use TS_FILES instead of FILES
.ALIASES=FILES=TS_FILES
- # TODO: remove this. YMAKE-1096 / FBP-1184
- _NEVERCACHE()
-
# .NODE_TYPE=Bundle is required for peers propagation, but it also affects
# how merging of pic/nopic graphs. Here we can override this merging behaviour
SET(MODULE_TYPE LIBRARY)
diff --git a/build/conf/ts/ts_next.conf b/build/conf/ts/ts_next.conf
index 0bf65e3e2dc..58465b3a0d0 100644
--- a/build/conf/ts/ts_next.conf
+++ b/build/conf/ts/ts_next.conf
@@ -27,6 +27,7 @@ multimodule TS_NEXT {
module BUILD: _TS_BASE_UNIT {
.CMD=TS_NEXT_CMD
.EPILOGUE=_TS_CONFIG_EPILOGUE
+ .PEERDIRSELF=TS_PREPARE_DEPS
# by default multimodule overrides inherited MODULE_TAG to submodule name (BUILD in this case)
# but we have to set it to TS for include processor to work
@@ -42,6 +43,10 @@ multimodule TS_NEXT {
SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
_TS_ADD_NODE_MODULES_FOR_BUILDER()
}
+
+ module TS_PREPARE_DEPS: _PREPARE_DEPS_BASE {
+
+ }
}
macro TS_NEXT_CONFIG(Path) {
diff --git a/build/conf/ts/ts_package.conf b/build/conf/ts/ts_package.conf
index bad2085a62b..135e41a39e2 100644
--- a/build/conf/ts/ts_package.conf
+++ b/build/conf/ts/ts_package.conf
@@ -25,6 +25,7 @@ multimodule TS_PACKAGE {
.CMD=TS_PACK
.ALLOWED=TS_FILES
.ALIASES=FILES=TS_FILES SRCS=TS_FILES
+ .PEERDIRSELF=TS_PREPARE_DEPS
# by default multimodule overrides inherited MODULE_TAG to submodule name (BUILD in this case)
# but we have to set it to TS for include processor to work
@@ -33,4 +34,8 @@ multimodule TS_PACKAGE {
SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml)
_TS_ADD_NODE_MODULES_FOR_BUILDER()
}
+
+ module TS_PREPARE_DEPS: _PREPARE_DEPS_BASE {
+
+ }
}
diff --git a/build/conf/ts/ts_proto.conf b/build/conf/ts/ts_proto.conf
index dc8e83e43a0..115ec0f4980 100644
--- a/build/conf/ts/ts_proto.conf
+++ b/build/conf/ts/ts_proto.conf
@@ -12,7 +12,7 @@ _TS_PROTO_IMPL_CMD=$TOUCH_UNIT \
${kv;hide:"pc magenta"} ${kv;hide:"p TS_PRO"}
-
+### # internal
module _TS_PROTO_IMPL: _TS_BASE_UNIT {
.CMD=_TS_PROTO_IMPL_CMD
.IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER USE_SKIFF CPP_PROTO_PLUGIN2 PY_PROTO_PLUGIN YMAPS_SPROTO RESOURCE
@@ -39,6 +39,7 @@ module _TS_PROTO_IMPL: _TS_BASE_UNIT {
_TS_ADD_NODE_MODULES_FOR_BUILDER()
}
+### @usage: _TS_PROTO_SRCS(path1 path2) # internal
macro _TS_PROTO_SRCS(FILES...) {
_SET_APPEND_WITH_DIRECTIVE(_TS_PROTO_SRCS_FILES input $FILES)
} \ No newline at end of file
diff --git a/build/conf/ts/ts_test.conf b/build/conf/ts/ts_test.conf
index 86ab3431c8f..613c17039f4 100644
--- a/build/conf/ts/ts_test.conf
+++ b/build/conf/ts/ts_test.conf
@@ -76,9 +76,6 @@ module _TS_TEST_BASE: _BARE_UNIT {
.ARGS_PARSER=Raw
.NODE_TYPE=Program
- # TODO: remove this. YMAKE-1096 / FBP-1184
- _NEVERCACHE()
-
# .fake tells builder to not materialize it in results
SET(MODULE_SUFFIX .ts_test.fake)
# include processor works only for TS tag
diff --git a/build/conf/ts/ts_tsc.conf b/build/conf/ts/ts_tsc.conf
index bb7fb3bbef5..cba05e44a8c 100644
--- a/build/conf/ts/ts_tsc.conf
+++ b/build/conf/ts/ts_tsc.conf
@@ -21,6 +21,7 @@ multimodule TS_TSC {
module BUILD: _TS_BASE_UNIT {
.CMD=TS_TSC_CMD
.EPILOGUE=_TS_CONFIG_EPILOGUE
+ .PEERDIRSELF=TS_PREPARE_DEPS
# by default multimodule overrides inherited MODULE_TAG to submodule name (BUILD in this case)
# but we have to set it to TS for include processor to work
@@ -36,4 +37,8 @@ multimodule TS_TSC {
SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
_TS_ADD_NODE_MODULES_FOR_BUILDER()
}
+
+ module TS_PREPARE_DEPS: _PREPARE_DEPS_BASE {
+
+ }
}
diff --git a/build/conf/ts/ts_vite.conf b/build/conf/ts/ts_vite.conf
index 95e6ac8c62f..04ee37227eb 100644
--- a/build/conf/ts/ts_vite.conf
+++ b/build/conf/ts/ts_vite.conf
@@ -35,6 +35,7 @@ multimodule TS_VITE {
module BUILD: _TS_BASE_UNIT {
.CMD=TS_VITE_CMD
.EPILOGUE=_TS_CONFIG_EPILOGUE
+ .PEERDIRSELF=TS_PREPARE_DEPS
# by default multimodule overrides inherited MODULE_TAG to submodule name (BUILD in this case)
# but we have to set it to TS for include processor to work
@@ -50,4 +51,8 @@ multimodule TS_VITE {
SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
_TS_ADD_NODE_MODULES_FOR_BUILDER()
}
+
+ module TS_PREPARE_DEPS: _PREPARE_DEPS_BASE {
+
+ }
}
diff --git a/build/conf/ts/ts_webpack.conf b/build/conf/ts/ts_webpack.conf
index 6438147c4f8..6e9e0571cf3 100644
--- a/build/conf/ts/ts_webpack.conf
+++ b/build/conf/ts/ts_webpack.conf
@@ -35,6 +35,7 @@ multimodule TS_WEBPACK {
module BUILD: _TS_BASE_UNIT {
.CMD=TS_WEBPACK_CMD
.EPILOGUE=_TS_CONFIG_EPILOGUE
+ .PEERDIRSELF=TS_PREPARE_DEPS
# by default multimodule overrides inherited MODULE_TAG to submodule name (BUILD in this case)
# but we have to set it to TS for include processor to work
@@ -50,4 +51,8 @@ multimodule TS_WEBPACK {
SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
_TS_ADD_NODE_MODULES_FOR_BUILDER()
}
+
+ module TS_PREPARE_DEPS: _PREPARE_DEPS_BASE {
+
+ }
}
diff --git a/build/export_generators/gradle/generator.toml b/build/export_generators/gradle/generator.toml
index daff4c19e25..ada3193233c 100644
--- a/build/export_generators/gradle/generator.toml
+++ b/build/export_generators/gradle/generator.toml
@@ -37,11 +37,11 @@ proto_grpc="flag"
proto_grpc_version="str"
kotlin_version="str"
-with_kotlin="bool"
-with_kotlinc_plugin_allopen="bool"
-with_kotlinc_plugin_lombok="bool"
-with_kotlinc_plugin_noarg="bool"
-with_kotlinc_plugin_serialization="bool"
+with_kotlin="flag"
+with_kotlinc_plugin_allopen="flag"
+with_kotlinc_plugin_lombok="flag"
+with_kotlinc_plugin_noarg="flag"
+with_kotlinc_plugin_serialization="flag"
[attrs.root]
diff --git a/build/export_generators/hardcoded-cmake/build/scripts/generate_vcs_info.py b/build/export_generators/hardcoded-cmake/build/scripts/generate_vcs_info.py
index b311be5617d..b1ccdfcf9ce 100644
--- a/build/export_generators/hardcoded-cmake/build/scripts/generate_vcs_info.py
+++ b/build/export_generators/hardcoded-cmake/build/scripts/generate_vcs_info.py
@@ -6,7 +6,6 @@ import os
import subprocess
import sys
import time
-import six as six_
INDENT = " " * 4
@@ -21,10 +20,7 @@ def _get_vcs_dictionary(vcs_type, *arg):
def _get_user_locale():
try:
- if six_.PY3:
- return [locale.getencoding()]
- else:
- return [locale.getdefaultlocale()[1]]
+ return [locale.getencoding()]
except Exception:
return []
@@ -116,7 +112,7 @@ class _GitVersion:
except Exception:
branch_info = [''.encode('utf-8')]
- depth = six_.text_type(_GitVersion._get_git_depth(env, arc_root)).encode('utf-8')
+ depth = str(_GitVersion._get_git_depth(env, arc_root)).encode('utf-8')
# logger.debug('Git info commit:{}, author:{}, summary:{}, svn_id:{}'.format(commit, author, summary, svn_id))
return [commit, author, summary, svn_id, tag_info[0], branch_info[0], depth]
@@ -175,7 +171,7 @@ class _SystemInfo:
@staticmethod
def _to_text(s):
- if isinstance(s, six_.binary_type):
+ if isinstance(s, bytes):
return s.decode(_SystemInfo.get_locale(), errors='replace')
return s
@@ -239,7 +235,7 @@ class _SystemInfo:
try:
import ctypes
- msg = six_.text_type(ctypes.FormatError(e.winerror), _SystemInfo.get_locale()).encode('utf-8')
+ msg = str(ctypes.FormatError(e.winerror), _SystemInfo.get_locale()).encode('utf-8')
except ImportError:
pass
# logger.debug('System command call {} failed [{}]: {}\n'.format(command, errcodes, msg))
diff --git a/build/export_generators/hardcoded-cmake/cmake/cuda.cmake b/build/export_generators/hardcoded-cmake/cmake/cuda.cmake
index 2d25a6a46fc..296da7f2e23 100644
--- a/build/export_generators/hardcoded-cmake/cmake/cuda.cmake
+++ b/build/export_generators/hardcoded-cmake/cmake/cuda.cmake
@@ -124,9 +124,11 @@ if (HAVE_CUDA)
" --expt-extended-lambda"
# Allow host code to invoke __device__ constexpr functions and vice versa
" --expt-relaxed-constexpr"
+ # Allow to use newer compilers than CUDA Toolkit officially supports
+ " --allow-unsupported-compiler"
)
- set(NVCC_STD_VER 14)
+ set(NVCC_STD_VER 17)
if(MSVC)
set(NVCC_STD "/std:c++${NVCC_STD_VER}")
else()
diff --git a/build/export_generators/hardcoded-cmake/conanfile.jinja b/build/export_generators/hardcoded-cmake/conanfile.jinja
new file mode 100644
index 00000000000..87a70619e94
--- /dev/null
+++ b/build/export_generators/hardcoded-cmake/conanfile.jinja
@@ -0,0 +1,20 @@
+[requires]
+{% for package in conan_packages -%}
+{{ package }}
+{% endfor %}
+[tool_requires]
+{% for package in conan_tool_packages -%}
+{{ package }}
+{% endfor %}
+[options]
+{% for option in conan_options -%}
+{{ option }}
+{% endfor %}
+[imports]
+{% for imp in conan_imports -%}
+{{ imp }}
+{% endfor %}
+[generators]
+cmake_find_package
+cmake_paths
+{{"\n"}} \ No newline at end of file
diff --git a/build/export_generators/hardcoded-cmake/generator.toml b/build/export_generators/hardcoded-cmake/generator.toml
index 8d1fe96420a..756c100a0b0 100644
--- a/build/export_generators/hardcoded-cmake/generator.toml
+++ b/build/export_generators/hardcoded-cmake/generator.toml
@@ -1,5 +1,6 @@
[root]
templates=[
+ { path="conanfile.jinja", dest="conanfile.txt" },
{ path="root_cmake_lists.jinja", dest="CMakeLists.txt" },
{ path="root_global_vars.jinja", dest="cmake/global_vars.cmake" },
]
@@ -15,11 +16,11 @@ copy=[
[attrs.root]
project_name="str"
project_language_list="list"
-use_conan="bool"
platform_flags="list"
platform_cmakelists="list"
platform_vars="list"
includes="sorted_set"
+use_conan="bool"
[attrs.target]
diff --git a/build/export_generators/ide-gradle/build.gradle.kts.jinja b/build/export_generators/ide-gradle/build.gradle.kts.jinja
index 9794eb2b3f5..d47ab8089aa 100644
--- a/build/export_generators/ide-gradle/build.gradle.kts.jinja
+++ b/build/export_generators/ide-gradle/build.gradle.kts.jinja
@@ -166,7 +166,11 @@ dependencies {
implementation(files("$project_root/{{ library.jar }}"))
{%- else -%}
{%- if library.type != "contrib" %}
+{%- if library.testdep %}
+ implementation(project(path = ":{{ library.testdep | replace("/", ":") }}", configuration = "testArtifacts"))
+{%- else %}
implementation({{ library.classpath }})
+{%- endif -%}
{%- else %}
api({{ library.classpath }})
{%- endif -%}
@@ -186,8 +190,8 @@ dependencies {
{%- if library.prebuilt and library.jar and (library.type != "contrib" or build_contribs) %}
testImplementation(files("$project_root/{{ library.jar }}"))
{%- else -%}
-{%- if library.type != "contrib" and library.test2test %}
- testImplementation(project(path = ":{{ library.test2test | replace("/", ":") }}", configuration = "testArtifacts"))
+{%- if library.type != "contrib" and library.testdep %}
+ testImplementation(project(path = ":{{ library.testdep | replace("/", ":") }}", configuration = "testArtifacts"))
{%- else %}
testImplementation({{ library.classpath }})
{%- endif -%}
diff --git a/build/export_generators/ide-gradle/generator.toml b/build/export_generators/ide-gradle/generator.toml
index 67d1b1626f8..772a2626322 100644
--- a/build/export_generators/ide-gradle/generator.toml
+++ b/build/export_generators/ide-gradle/generator.toml
@@ -39,11 +39,11 @@ proto_grpc="flag"
proto_grpc_version="str"
kotlin_version="str"
-with_kotlin="bool"
-with_kotlinc_plugin_allopen="bool"
-with_kotlinc_plugin_lombok="bool"
-with_kotlinc_plugin_noarg="bool"
-with_kotlinc_plugin_serialization="bool"
+with_kotlin="flag"
+with_kotlinc_plugin_allopen="flag"
+with_kotlinc_plugin_lombok="flag"
+with_kotlinc_plugin_noarg="flag"
+with_kotlinc_plugin_serialization="flag"
runs="list"
runs-args="list"
@@ -74,5 +74,4 @@ test=[
"/src/test/java",
"/src/test-integration",
"/src/testFixtures",
- "/src/intTest",
]
diff --git a/build/external_resources/yexport/resources.json b/build/external_resources/yexport/resources.json
index 5ee06fa4eaa..e947da975d6 100644
--- a/build/external_resources/yexport/resources.json
+++ b/build/external_resources/yexport/resources.json
@@ -1,13 +1,13 @@
{
"by_platform": {
"darwin": {
- "uri": "sbr:5811800130"
+ "uri": "sbr:5860169896"
},
"darwin-arm64": {
- "uri": "sbr:5811799864"
+ "uri": "sbr:5860168386"
},
"linux": {
- "uri": "sbr:5811799588"
+ "uri": "sbr:5860166726"
}
}
}
diff --git a/build/external_resources/ymake/public.resources.json b/build/external_resources/ymake/public.resources.json
index 0a4ae321218..ae4fa741c66 100644
--- a/build/external_resources/ymake/public.resources.json
+++ b/build/external_resources/ymake/public.resources.json
@@ -1,19 +1,19 @@
{
"by_platform": {
"darwin": {
- "uri": "sbr:5829027626"
+ "uri": "sbr:5923294957"
},
"darwin-arm64": {
- "uri": "sbr:5829025456"
+ "uri": "sbr:5923294830"
},
"linux": {
- "uri": "sbr:5829031598"
+ "uri": "sbr:5923295246"
},
"linux-aarch64": {
- "uri": "sbr:5829023352"
+ "uri": "sbr:5923294644"
},
"win32-clang-cl": {
- "uri": "sbr:5829029743"
+ "uri": "sbr:5923295127"
}
}
}
diff --git a/build/external_resources/ymake/resources.json b/build/external_resources/ymake/resources.json
index da8bb5a2f2c..af9a8b8cc12 100644
--- a/build/external_resources/ymake/resources.json
+++ b/build/external_resources/ymake/resources.json
@@ -1,19 +1,19 @@
{
"by_platform": {
"darwin": {
- "uri": "sbr:5829005519"
+ "uri": "sbr:5923290440"
},
"darwin-arm64": {
- "uri": "sbr:5829003069"
+ "uri": "sbr:5923289693"
},
"linux": {
- "uri": "sbr:5829009917"
+ "uri": "sbr:5923291134"
},
"linux-aarch64": {
- "uri": "sbr:5829000729"
+ "uri": "sbr:5923289270"
},
"win32-clang-cl": {
- "uri": "sbr:5829007573"
+ "uri": "sbr:5923290831"
}
}
}
diff --git a/build/mapping.conf.json b/build/mapping.conf.json
index 3f0d50e2edb..f760c48d634 100644
--- a/build/mapping.conf.json
+++ b/build/mapping.conf.json
@@ -22,13 +22,18 @@
"2319130389": "https://devtools-registry.s3.yandex.net/2319130389",
"4561497708": "https://devtools-registry.s3.yandex.net/4561497708",
"3676726364": "https://devtools-registry.s3.yandex.net/3676726364",
+ "5876831065": "https://devtools-registry.s3.yandex.net/5876831065",
+ "5876842916": "https://devtools-registry.s3.yandex.net/5876842916",
"4561502654": "https://devtools-registry.s3.yandex.net/4561502654",
"3676730876": "https://devtools-registry.s3.yandex.net/3676730876",
"4561486916": "https://devtools-registry.s3.yandex.net/4561486916",
"3676221325": "https://devtools-registry.s3.yandex.net/3676221325",
"3989100748": "https://devtools-registry.s3.yandex.net/3989100748",
+ "5876846749": "https://devtools-registry.s3.yandex.net/5876846749",
"3989113687": "https://devtools-registry.s3.yandex.net/3989113687",
"4561490451": "https://devtools-registry.s3.yandex.net/4561490451",
+ "5876850605": "https://devtools-registry.s3.yandex.net/5876850605",
+ "5876857510": "https://devtools-registry.s3.yandex.net/5876857510",
"5002675116": "https://devtools-registry.s3.yandex.net/5002675116",
"3676654632": "https://devtools-registry.s3.yandex.net/3676654632",
"5424057306": "https://devtools-registry.s3.yandex.net/5424057306",
@@ -86,6 +91,8 @@
"2842390994": "https://devtools-registry.s3.yandex.net/2842390994",
"5310288728": "https://devtools-registry.s3.yandex.net/5310288728",
"5620327787": "https://devtools-registry.s3.yandex.net/5620327787",
+ "5257605552": "https://devtools-registry.s3.yandex.net/5257605552",
+ "5257606004": "https://devtools-registry.s3.yandex.net/5257606004",
"2989597929": "https://devtools-registry.s3.yandex.net/2989597929",
"2989596911": "https://devtools-registry.s3.yandex.net/2989596911",
"2989598506": "https://devtools-registry.s3.yandex.net/2989598506",
@@ -125,6 +132,12 @@
"5769205511": "https://devtools-registry.s3.yandex.net/5769205511",
"5798582956": "https://devtools-registry.s3.yandex.net/5798582956",
"5829311437": "https://devtools-registry.s3.yandex.net/5829311437",
+ "5862032891": "https://devtools-registry.s3.yandex.net/5862032891",
+ "5868020195": "https://devtools-registry.s3.yandex.net/5868020195",
+ "5899252064": "https://devtools-registry.s3.yandex.net/5899252064",
+ "5906496010": "https://devtools-registry.s3.yandex.net/5906496010",
+ "5913865442": "https://devtools-registry.s3.yandex.net/5913865442",
+ "5923487331": "https://devtools-registry.s3.yandex.net/5923487331",
"5486731632": "https://devtools-registry.s3.yandex.net/5486731632",
"5514350352": "https://devtools-registry.s3.yandex.net/5514350352",
"5514360398": "https://devtools-registry.s3.yandex.net/5514360398",
@@ -154,35 +167,83 @@
"5798651327": "https://devtools-registry.s3.yandex.net/5798651327",
"5829321497": "https://devtools-registry.s3.yandex.net/5829321497",
"5829394327": "https://devtools-registry.s3.yandex.net/5829394327",
+ "5862025327": "https://devtools-registry.s3.yandex.net/5862025327",
+ "5862049116": "https://devtools-registry.s3.yandex.net/5862049116",
+ "5868037312": "https://devtools-registry.s3.yandex.net/5868037312",
+ "5868082367": "https://devtools-registry.s3.yandex.net/5868082367",
+ "5899240787": "https://devtools-registry.s3.yandex.net/5899240787",
+ "5899304914": "https://devtools-registry.s3.yandex.net/5899304914",
+ "5906517812": "https://devtools-registry.s3.yandex.net/5906517812",
+ "5906526803": "https://devtools-registry.s3.yandex.net/5906526803",
+ "5913861249": "https://devtools-registry.s3.yandex.net/5913861249",
+ "5913867186": "https://devtools-registry.s3.yandex.net/5913867186",
+ "5923498245": "https://devtools-registry.s3.yandex.net/5923498245",
+ "5923500403": "https://devtools-registry.s3.yandex.net/5923500403",
"5811823978": "https://devtools-registry.s3.yandex.net/5811823978",
+ "5840611982": "https://devtools-registry.s3.yandex.net/5840611982",
+ "5860186783": "https://devtools-registry.s3.yandex.net/5860186783",
"5811823398": "https://devtools-registry.s3.yandex.net/5811823398",
+ "5840611310": "https://devtools-registry.s3.yandex.net/5840611310",
+ "5860185593": "https://devtools-registry.s3.yandex.net/5860185593",
"5811822876": "https://devtools-registry.s3.yandex.net/5811822876",
+ "5840610640": "https://devtools-registry.s3.yandex.net/5840610640",
+ "5860184285": "https://devtools-registry.s3.yandex.net/5860184285",
"5766172292": "https://devtools-registry.s3.yandex.net/5766172292",
"5805431504": "https://devtools-registry.s3.yandex.net/5805431504",
"5829027626": "https://devtools-registry.s3.yandex.net/5829027626",
+ "5844654329": "https://devtools-registry.s3.yandex.net/5844654329",
+ "5870478519": "https://devtools-registry.s3.yandex.net/5870478519",
+ "5880578889": "https://devtools-registry.s3.yandex.net/5880578889",
+ "5923294957": "https://devtools-registry.s3.yandex.net/5923294957",
"5766171800": "https://devtools-registry.s3.yandex.net/5766171800",
"5805430761": "https://devtools-registry.s3.yandex.net/5805430761",
"5829025456": "https://devtools-registry.s3.yandex.net/5829025456",
+ "5844653808": "https://devtools-registry.s3.yandex.net/5844653808",
+ "5870477747": "https://devtools-registry.s3.yandex.net/5870477747",
+ "5880578254": "https://devtools-registry.s3.yandex.net/5880578254",
+ "5923294830": "https://devtools-registry.s3.yandex.net/5923294830",
"5766173070": "https://devtools-registry.s3.yandex.net/5766173070",
"5805432830": "https://devtools-registry.s3.yandex.net/5805432830",
"5829031598": "https://devtools-registry.s3.yandex.net/5829031598",
+ "5844655347": "https://devtools-registry.s3.yandex.net/5844655347",
+ "5870480227": "https://devtools-registry.s3.yandex.net/5870480227",
+ "5880580674": "https://devtools-registry.s3.yandex.net/5880580674",
+ "5923295246": "https://devtools-registry.s3.yandex.net/5923295246",
"5766171341": "https://devtools-registry.s3.yandex.net/5766171341",
"5805430188": "https://devtools-registry.s3.yandex.net/5805430188",
"5829023352": "https://devtools-registry.s3.yandex.net/5829023352",
+ "5844653303": "https://devtools-registry.s3.yandex.net/5844653303",
+ "5870476994": "https://devtools-registry.s3.yandex.net/5870476994",
+ "5880577413": "https://devtools-registry.s3.yandex.net/5880577413",
+ "5923294644": "https://devtools-registry.s3.yandex.net/5923294644",
"5766172695": "https://devtools-registry.s3.yandex.net/5766172695",
"5805432230": "https://devtools-registry.s3.yandex.net/5805432230",
"5829029743": "https://devtools-registry.s3.yandex.net/5829029743",
+ "5844654735": "https://devtools-registry.s3.yandex.net/5844654735",
+ "5870479286": "https://devtools-registry.s3.yandex.net/5870479286",
+ "5880579742": "https://devtools-registry.s3.yandex.net/5880579742",
+ "5923295127": "https://devtools-registry.s3.yandex.net/5923295127",
"4307890075": "https://devtools-registry.s3.yandex.net/4307890075",
"5517245192": "https://devtools-registry.s3.yandex.net/5517245192",
"4307901240": "https://devtools-registry.s3.yandex.net/4307901240",
"5517239368": "https://devtools-registry.s3.yandex.net/5517239368",
"3833498694": "https://devtools-registry.s3.yandex.net/3833498694",
"1277521710": "https://devtools-registry.s3.yandex.net/1277521710",
+ "5776380974": "https://devtools-registry.s3.yandex.net/5776380974",
"5777101734": "https://devtools-registry.s3.yandex.net/5777101734",
+ "5909068951": "https://devtools-registry.s3.yandex.net/5909068951",
+ "5776379446": "https://devtools-registry.s3.yandex.net/5776379446",
"5777100597": "https://devtools-registry.s3.yandex.net/5777100597",
+ "5909067709": "https://devtools-registry.s3.yandex.net/5909067709",
+ "5776375952": "https://devtools-registry.s3.yandex.net/5776375952",
"5777098178": "https://devtools-registry.s3.yandex.net/5777098178",
+ "5909065014": "https://devtools-registry.s3.yandex.net/5909065014",
+ "5776374505": "https://devtools-registry.s3.yandex.net/5776374505",
"5777096988": "https://devtools-registry.s3.yandex.net/5777096988",
+ "5909063641": "https://devtools-registry.s3.yandex.net/5909063641",
+ "5776377955": "https://devtools-registry.s3.yandex.net/5776377955",
"5777099502": "https://devtools-registry.s3.yandex.net/5777099502",
+ "5909066324": "https://devtools-registry.s3.yandex.net/5909066324",
"3167009386": "https://devtools-registry.s3.yandex.net/3167009386",
"3050798466": "https://devtools-registry.s3.yandex.net/3050798466",
"3064614561": "https://devtools-registry.s3.yandex.net/3064614561",
@@ -285,13 +346,18 @@
"2319130389": "GDB 8.3 toolkit for darwin-arm64",
"4561497708": "JAVA_JDK_ENVIRONMENT-darwin-17.0.7+7-jdk-darwin-x86_64.yandex.tgz",
"3676726364": "JAVA_JDK_ENVIRONMENT-darwin-19.0.1.1-jdk-darwin-x86_64.yandex.tgz",
+ "5876831065": "JAVA_JDK_ENVIRONMENT-darwin-aarch64-11.0.21+9-jdk-darwin-aarch64.yandex.tgz",
+ "5876842916": "JAVA_JDK_ENVIRONMENT-darwin-arm64-11.0.21+9-jdk-darwin-x86_64.yandex.tgz",
"4561502654": "JAVA_JDK_ENVIRONMENT-darwin-arm64-17.0.7+7-jdk-darwin-aarch64.yandex.tgz",
"3676730876": "JAVA_JDK_ENVIRONMENT-darwin-arm64-19.0.1.1-jdk-darwin-aarch64.yandex.tgz",
"4561486916": "JAVA_JDK_ENVIRONMENT-linux-17.0.7+7-jdk-linux-x86_64.yandex.tgz",
"3676221325": "JAVA_JDK_ENVIRONMENT-linux-19.0.1.1-jdk-linux-x86_64.yandex.tgz",
"3989100748": "JAVA_JDK_ENVIRONMENT-linux-aarch64-11.0.17-result.tar.gz",
+ "5876846749": "JAVA_JDK_ENVIRONMENT-linux-aarch64-11.0.21+9-jdk-linux-aarch64.yandex.tgz",
"3989113687": "JAVA_JDK_ENVIRONMENT-linux-aarch64-19.0.1-result.tar.gz",
"4561490451": "JAVA_JDK_ENVIRONMENT-linux-arm64-17.0.7+7-jdk-linux-aarch64.yandex.tgz",
+ "5876850605": "JAVA_JDK_ENVIRONMENT-linux-x86_64-11.0.21+9-jdk-linux-x86_64.yandex.tgz",
+ "5876857510": "JAVA_JDK_ENVIRONMENT-windows-11.0.21+9-jdk-windows-amd64.yandex.tgz",
"5002675116": "JAVA_JDK_ENVIRONMENT-windows-17.0.7+7-jdk-windows-amd64.yandex.tgz",
"3676654632": "JAVA_JDK_ENVIRONMENT-windows-19.0.1.1-jdk-windows-i686.yandex.tgz",
"5424057306": "OTHER_RESOURCE-none-1.21.3-y_go1.21.3.darwin-amd64.tar.gz",
@@ -349,6 +415,8 @@
"2842390994": "devtools jacoco agent 0.8.7 with shaded asm",
"5310288728": "devtools jstyle runner 10.12.4",
"5620327787": "devtools jstyle runner 10.12.4",
+ "5257605552": "devtools/bloat2/tools/bloat/bloat for darwin",
+ "5257606004": "devtools/bloat2/tools/bloat/bloat for linux",
"2989597929": "devtools/huge_python/python for darwin",
"2989596911": "devtools/huge_python/python for darwin-arm64",
"2989598506": "devtools/huge_python/python for linux",
@@ -388,6 +456,12 @@
"5769205511": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
"5798582956": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
"5829311437": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
+ "5862032891": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
+ "5868020195": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
+ "5899252064": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
+ "5906496010": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
+ "5913865442": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
+ "5923487331": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
"5486731632": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
"5514350352": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
"5514360398": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
@@ -417,35 +491,83 @@
"5798651327": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
"5829321497": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
"5829394327": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
+ "5862025327": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
+ "5862049116": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
+ "5868037312": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
+ "5868082367": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
+ "5899240787": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
+ "5899304914": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
+ "5906517812": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
+ "5906526803": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
+ "5913861249": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
+ "5913867186": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
+ "5923498245": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
+ "5923500403": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
"5811823978": "devtools/yexport/bin/yexport for darwin",
+ "5840611982": "devtools/yexport/bin/yexport for darwin",
+ "5860186783": "devtools/yexport/bin/yexport for darwin",
"5811823398": "devtools/yexport/bin/yexport for darwin-arm64",
+ "5840611310": "devtools/yexport/bin/yexport for darwin-arm64",
+ "5860185593": "devtools/yexport/bin/yexport for darwin-arm64",
"5811822876": "devtools/yexport/bin/yexport for linux",
+ "5840610640": "devtools/yexport/bin/yexport for linux",
+ "5860184285": "devtools/yexport/bin/yexport for linux",
"5766172292": "devtools/ymake/bin/ymake for darwin",
"5805431504": "devtools/ymake/bin/ymake for darwin",
"5829027626": "devtools/ymake/bin/ymake for darwin",
+ "5844654329": "devtools/ymake/bin/ymake for darwin",
+ "5870478519": "devtools/ymake/bin/ymake for darwin",
+ "5880578889": "devtools/ymake/bin/ymake for darwin",
+ "5923294957": "devtools/ymake/bin/ymake for darwin",
"5766171800": "devtools/ymake/bin/ymake for darwin-arm64",
"5805430761": "devtools/ymake/bin/ymake for darwin-arm64",
"5829025456": "devtools/ymake/bin/ymake for darwin-arm64",
+ "5844653808": "devtools/ymake/bin/ymake for darwin-arm64",
+ "5870477747": "devtools/ymake/bin/ymake for darwin-arm64",
+ "5880578254": "devtools/ymake/bin/ymake for darwin-arm64",
+ "5923294830": "devtools/ymake/bin/ymake for darwin-arm64",
"5766173070": "devtools/ymake/bin/ymake for linux",
"5805432830": "devtools/ymake/bin/ymake for linux",
"5829031598": "devtools/ymake/bin/ymake for linux",
+ "5844655347": "devtools/ymake/bin/ymake for linux",
+ "5870480227": "devtools/ymake/bin/ymake for linux",
+ "5880580674": "devtools/ymake/bin/ymake for linux",
+ "5923295246": "devtools/ymake/bin/ymake for linux",
"5766171341": "devtools/ymake/bin/ymake for linux-aarch64",
"5805430188": "devtools/ymake/bin/ymake for linux-aarch64",
"5829023352": "devtools/ymake/bin/ymake for linux-aarch64",
+ "5844653303": "devtools/ymake/bin/ymake for linux-aarch64",
+ "5870476994": "devtools/ymake/bin/ymake for linux-aarch64",
+ "5880577413": "devtools/ymake/bin/ymake for linux-aarch64",
+ "5923294644": "devtools/ymake/bin/ymake for linux-aarch64",
"5766172695": "devtools/ymake/bin/ymake for win32-clang-cl",
"5805432230": "devtools/ymake/bin/ymake for win32-clang-cl",
"5829029743": "devtools/ymake/bin/ymake for win32-clang-cl",
+ "5844654735": "devtools/ymake/bin/ymake for win32-clang-cl",
+ "5870479286": "devtools/ymake/bin/ymake for win32-clang-cl",
+ "5880579742": "devtools/ymake/bin/ymake for win32-clang-cl",
+ "5923295127": "devtools/ymake/bin/ymake for win32-clang-cl",
"4307890075": "flake8_linter for linux",
"5517245192": "flake8_linter for linux",
"4307901240": "flake8_linter for linux-aarch64",
"5517239368": "flake8_linter for linux-aarch64",
"3833498694": "gdb 11.2 for osx_10.15_catalina",
"1277521710": "infra/kernel/tools/atop/build/atop-static.tar.gz",
+ "5776380974": "none-none-none-result_resources/jdk-darwin-aarch64.yandex.tgz",
"5777101734": "none-none-none-result_resources/jdk-darwin-aarch64.yandex.tgz",
+ "5909068951": "none-none-none-result_resources/jdk-darwin-aarch64.yandex.tgz",
+ "5776379446": "none-none-none-result_resources/jdk-darwin-x86_64.yandex.tgz",
"5777100597": "none-none-none-result_resources/jdk-darwin-x86_64.yandex.tgz",
+ "5909067709": "none-none-none-result_resources/jdk-darwin-x86_64.yandex.tgz",
+ "5776375952": "none-none-none-result_resources/jdk-linux-aarch64.yandex.tgz",
"5777098178": "none-none-none-result_resources/jdk-linux-aarch64.yandex.tgz",
+ "5909065014": "none-none-none-result_resources/jdk-linux-aarch64.yandex.tgz",
+ "5776374505": "none-none-none-result_resources/jdk-linux-x86_64.yandex.tgz",
"5777096988": "none-none-none-result_resources/jdk-linux-x86_64.yandex.tgz",
+ "5909063641": "none-none-none-result_resources/jdk-linux-x86_64.yandex.tgz",
+ "5776377955": "none-none-none-result_resources/jdk-windows-amd64.yandex.tgz",
"5777099502": "none-none-none-result_resources/jdk-windows-amd64.yandex.tgz",
+ "5909066324": "none-none-none-result_resources/jdk-windows-amd64.yandex.tgz",
"3167009386": "openjdk 11.0.15 vanilla for darwin",
"3050798466": "openjdk 11.0.15 vanilla for darwin-arm64",
"3064614561": "openjdk 11.0.15 vanilla for linux",
diff --git a/build/platform/java/jdk/jdk11/jdk.json b/build/platform/java/jdk/jdk11/jdk.json
index 2f3d8864020..f7e8782b6dd 100644
--- a/build/platform/java/jdk/jdk11/jdk.json
+++ b/build/platform/java/jdk/jdk11/jdk.json
@@ -1,20 +1,19 @@
{
- "by_platform": {
- "darwin-arm64": {
- "uri": "sbr:3050798466"
- },
- "darwin-x86_64": {
- "uri": "sbr:3167009386"
- },
- "linux-x86_64": {
- "uri": "sbr:3064614561"
- },
- "linux-aarch64": {
- "uri": "sbr:3989100748"
- },
- "win32-x86_64": {
- "uri": "sbr:3166999959"
- }
+ "by_platform": {
+ "darwin-arm64": {
+ "uri": "sbr:5909068951"
+ },
+ "darwin-x86_64": {
+ "uri": "sbr:5909067709"
+ },
+ "linux-x86_64": {
+ "uri": "sbr:5909063641"
+ },
+ "linux-aarch64": {
+ "uri": "sbr:5909065014"
+ },
+ "win32-x86_64": {
+ "uri": "sbr:5909066324"
}
+ }
}
-
diff --git a/build/platform/java/jdk/jdk11/ya.make b/build/platform/java/jdk/jdk11/ya.make
index 088f30ba20a..10fedbf8746 100644
--- a/build/platform/java/jdk/jdk11/ya.make
+++ b/build/platform/java/jdk/jdk11/ya.make
@@ -1,12 +1,7 @@
RESOURCES_LIBRARY()
-IF(NEBIUS)
- DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK11 jdk_nebius.json)
- SET_RESOURCE_URI_FROM_JSON(WITH_JDK11_URI jdk_nebius.json)
-ELSE()
- DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK11 jdk.json)
- SET_RESOURCE_URI_FROM_JSON(WITH_JDK11_URI jdk.json)
-ENDIF()
+DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK11 jdk.json)
+SET_RESOURCE_URI_FROM_JSON(WITH_JDK11_URI jdk.json)
IF (WITH_JDK11_URI)
DECLARE_EXTERNAL_RESOURCE(WITH_JDK11 ${WITH_JDK11_URI})
diff --git a/build/platform/java/jdk/jdk17/ya.make b/build/platform/java/jdk/jdk17/ya.make
index 3a1ee069d6a..c70a3a2ecae 100644
--- a/build/platform/java/jdk/jdk17/ya.make
+++ b/build/platform/java/jdk/jdk17/ya.make
@@ -1,12 +1,7 @@
RESOURCES_LIBRARY()
-IF(NEBIUS)
- DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK17 jdk_nebius.json)
- SET_RESOURCE_URI_FROM_JSON(WITH_JDK17_URI jdk_nebius.json)
-ELSE()
- DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK17 jdk.json)
- SET_RESOURCE_URI_FROM_JSON(WITH_JDK17_URI jdk.json)
-ENDIF()
+DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK17 jdk.json)
+SET_RESOURCE_URI_FROM_JSON(WITH_JDK17_URI jdk.json)
IF (WITH_JDK17_URI)
DECLARE_EXTERNAL_RESOURCE(WITH_JDK17 ${WITH_JDK17_URI})
diff --git a/build/platform/java/jdk/jdk19/jdk.json b/build/platform/java/jdk/jdk19/jdk.json
deleted file mode 100644
index 8b64529ab3e..00000000000
--- a/build/platform/java/jdk/jdk19/jdk.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "by_platform": {
- "darwin-arm64": {
- "uri": "sbr:3676730876"
- },
- "darwin-x86_64": {
- "uri": "sbr:3676726364"
- },
- "linux-x86_64": {
- "uri": "sbr:3676221325"
- },
- "linux-aarch64": {
- "uri": "sbr:3989113687"
- },
- "win32-x86_64": {
- "uri": "sbr:3676654632"
- }
- }
-}
-
diff --git a/build/platform/java/jdk/jdk19/ya.make b/build/platform/java/jdk/jdk19/ya.make
deleted file mode 100644
index b3d8780e057..00000000000
--- a/build/platform/java/jdk/jdk19/ya.make
+++ /dev/null
@@ -1,17 +0,0 @@
-RESOURCES_LIBRARY()
-
-DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK19 jdk.json)
-SET_RESOURCE_URI_FROM_JSON(WITH_JDK19_URI jdk.json)
-
-IF (WITH_JDK19_URI)
- DECLARE_EXTERNAL_RESOURCE(WITH_JDK19 ${WITH_JDK19_URI})
-ENDIF()
-
-END()
-
-IF (AUTOCHECK)
- RECURSE_FOR_TESTS(ut)
-ENDIF()
-IF(YA_IDE_IDEA)
- RECURSE_FOR_TESTS(ut)
-ENDIF()
diff --git a/build/platform/java/jdk/jdk20/jdk.json b/build/platform/java/jdk/jdk20/jdk.json
index 95ff250dfea..327cd9adbad 100644
--- a/build/platform/java/jdk/jdk20/jdk.json
+++ b/build/platform/java/jdk/jdk20/jdk.json
@@ -1,20 +1,19 @@
{
- "by_platform": {
- "darwin-arm64": {
- "uri": "sbr:4384866600"
- },
- "darwin-x86_64": {
- "uri": "sbr:4384863636"
- },
- "linux-x86_64": {
- "uri": "sbr:4384857315"
- },
- "linux-aarch64": {
- "uri": "sbr:4384859639"
- },
- "win32-x86_64": {
- "uri": "sbr:4384861822"
- }
+ "by_platform": {
+ "darwin-arm64": {
+ "uri": "sbr:5920323347"
+ },
+ "darwin-x86_64": {
+ "uri": "sbr:5920322428"
+ },
+ "linux-x86_64": {
+ "uri": "sbr:5920320011"
+ },
+ "linux-aarch64": {
+ "uri": "sbr:5920320608"
+ },
+ "win32-x86_64": {
+ "uri": "sbr:5920321413"
}
+ }
}
-
diff --git a/build/platform/java/jdk/jdk20/ya.make b/build/platform/java/jdk/jdk20/ya.make
index 66246045a4b..c3039523ef7 100644
--- a/build/platform/java/jdk/jdk20/ya.make
+++ b/build/platform/java/jdk/jdk20/ya.make
@@ -1,12 +1,7 @@
RESOURCES_LIBRARY()
-IF(NEBIUS)
- DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK20 jdk_nebius.json)
- SET_RESOURCE_URI_FROM_JSON(WITH_JDK20_URI jdk_nebius.json)
-ELSE()
- DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK20 jdk.json)
- SET_RESOURCE_URI_FROM_JSON(WITH_JDK20_URI jdk.json)
-ENDIF()
+DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK20 jdk.json)
+SET_RESOURCE_URI_FROM_JSON(WITH_JDK20_URI jdk.json)
IF (WITH_JDK20_URI)
DECLARE_EXTERNAL_RESOURCE(WITH_JDK20 ${WITH_JDK20_URI})
diff --git a/build/platform/java/jdk/jdk21/ya.make b/build/platform/java/jdk/jdk21/ya.make
index b47725dc31a..181698287fb 100644
--- a/build/platform/java/jdk/jdk21/ya.make
+++ b/build/platform/java/jdk/jdk21/ya.make
@@ -1,12 +1,7 @@
RESOURCES_LIBRARY()
-IF(NEBIUS)
- DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK21 jdk_nebius.json)
- SET_RESOURCE_URI_FROM_JSON(WITH_JDK21_URI jdk_nebius.json)
-ELSE()
- DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK21 jdk.json)
- SET_RESOURCE_URI_FROM_JSON(WITH_JDK21_URI jdk.json)
-ENDIF()
+DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK21 jdk.json)
+SET_RESOURCE_URI_FROM_JSON(WITH_JDK21_URI jdk.json)
IF (WITH_JDK21_URI)
DECLARE_EXTERNAL_RESOURCE(WITH_JDK21 ${WITH_JDK21_URI})
diff --git a/build/platform/java/jdk/ya.make b/build/platform/java/jdk/ya.make
index 4e2df0ed365..32720280125 100644
--- a/build/platform/java/jdk/ya.make
+++ b/build/platform/java/jdk/ya.make
@@ -9,9 +9,6 @@ ELSEIF(JDK_REAL_VERSION == "21")
ELSEIF(JDK_REAL_VERSION == "20")
DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK_DEFAULT jdk20/jdk.json)
SET_RESOURCE_URI_FROM_JSON(WITH_JDK_URI jdk20/jdk.json)
-ELSEIF(JDK_REAL_VERSION == "19")
- DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK_DEFAULT jdk19/jdk.json)
- SET_RESOURCE_URI_FROM_JSON(WITH_JDK_URI jdk19/jdk.json)
ELSEIF(JDK_REAL_VERSION == "18")
DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(JDK_DEFAULT jdk18/jdk.json)
SET_RESOURCE_URI_FROM_JSON(WITH_JDK_URI jdk18/jdk.json)
@@ -43,7 +40,6 @@ RECURSE(
jdk15
jdk17
jdk18
- jdk19
jdk20
jdk21
testing
diff --git a/build/platform/test_tool/host.ya.make.inc b/build/platform/test_tool/host.ya.make.inc
index 30784be049a..c8a3d6c12de 100644
--- a/build/platform/test_tool/host.ya.make.inc
+++ b/build/platform/test_tool/host.ya.make.inc
@@ -1,17 +1,17 @@
IF (HOST_OS_DARWIN AND HOST_ARCH_X86_64)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5829307477)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5829386348)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5923486130)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5923497883)
ELSEIF (HOST_OS_DARWIN AND HOST_ARCH_ARM64)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5829305273)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5829383916)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5923485664)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5923497466)
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_X86_64)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5829311437)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5829394327)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5923487331)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5923498245)
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_AARCH64)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5829303260)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5829380342)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5923485127)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5923497276)
ELSEIF (HOST_OS_WINDOWS AND HOST_ARCH_X86_64)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5829309607)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5829389352)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5923486746)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5923498073)
ENDIF()
diff --git a/build/platform/test_tool/host_os.ya.make.inc b/build/platform/test_tool/host_os.ya.make.inc
index 4722a41704d..1de1b99e333 100644
--- a/build/platform/test_tool/host_os.ya.make.inc
+++ b/build/platform/test_tool/host_os.ya.make.inc
@@ -1,17 +1,17 @@
IF (HOST_OS_DARWIN AND HOST_ARCH_X86_64)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5829318953)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5829318953)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5923499893)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5923499893)
ELSEIF (HOST_OS_DARWIN AND HOST_ARCH_ARM64)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5829316789)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5829316789)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5923499777)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5923499777)
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_X86_64)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5829321497)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5829321497)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5923500403)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5923500403)
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_AARCH64)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5829315151)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5829315151)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5923499613)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5923499613)
ELSEIF (HOST_OS_WINDOWS AND HOST_ARCH_X86_64)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5829320272)
- DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5829320272)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:5923500075)
+ DECLARE_EXTERNAL_RESOURCE(TEST_TOOL3_HOST sbr:5923500075)
ENDIF()
diff --git a/build/platform/yfm/ya.make b/build/platform/yfm/ya.make
index f7194ec44d2..09c7877b6a1 100644
--- a/build/platform/yfm/ya.make
+++ b/build/platform/yfm/ya.make
@@ -6,10 +6,10 @@ ENDIF()
DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE(
YFM_TOOL
- sbr:5815831745 FOR DARWIN-ARM64
- sbr:5815831745 FOR DARWIN
- sbr:5815825025 FOR LINUX
- sbr:5815836899 FOR WIN32
+ sbr:5896074622 FOR DARWIN-ARM64
+ sbr:5896074622 FOR DARWIN
+ sbr:5896068554 FOR LINUX
+ sbr:5896080661 FOR WIN32
)
END()
diff --git a/build/plugins/_common.py b/build/plugins/_common.py
index 9ac1d580d06..cd1d8024a88 100644
--- a/build/plugins/_common.py
+++ b/build/plugins/_common.py
@@ -11,11 +11,11 @@ class Result(object):
def lazy(func):
result = Result()
- def wrapper():
+ def wrapper(*args, **kwargs):
try:
return result._result
except AttributeError:
- result._result = func()
+ result._result = func(*args, **kwargs)
return result._result
diff --git a/build/plugins/java.py b/build/plugins/java.py
index 69da60361d4..68c00f72f91 100644
--- a/build/plugins/java.py
+++ b/build/plugins/java.py
@@ -143,7 +143,6 @@ def onjava_module(unit, *args):
'15',
'17',
'18',
- '19',
'20',
'21',
):
@@ -416,7 +415,6 @@ def on_jdk_version_macro_check(unit, *args):
'15',
'17',
'18',
- '19',
'20',
'21',
)
diff --git a/build/plugins/lib/nots/package_manager/base/lockfile.py b/build/plugins/lib/nots/package_manager/base/lockfile.py
index f13168b3201..b6b9952602b 100644
--- a/build/plugins/lib/nots/package_manager/base/lockfile.py
+++ b/build/plugins/lib/nots/package_manager/base/lockfile.py
@@ -9,16 +9,17 @@ class LockfilePackageMeta(object):
Basic struct representing package meta from lockfile.
"""
- __slots__ = ("tarball_url", "sky_id", "integrity", "integrity_algorithm", "tarball_path")
+ __slots__ = ("key", "tarball_url", "sky_id", "integrity", "integrity_algorithm", "tarball_path")
@staticmethod
def from_str(s):
return LockfilePackageMeta(*s.strip().split(" "))
- def __init__(self, tarball_url, sky_id, integrity, integrity_algorithm):
+ def __init__(self, key, tarball_url, sky_id, integrity, integrity_algorithm):
# http://npm.yandex-team.ru/@scope%2fname/-/name-0.0.1.tgz
parts = tarball_url.split("/")
+ self.key = key
self.tarball_url = tarball_url
self.sky_id = sky_id
self.integrity = integrity
diff --git a/build/plugins/lib/nots/package_manager/base/package_json.py b/build/plugins/lib/nots/package_manager/base/package_json.py
index cc498b33f73..24385118006 100644
--- a/build/plugins/lib/nots/package_manager/base/package_json.py
+++ b/build/plugins/lib/nots/package_manager/base/package_json.py
@@ -130,10 +130,12 @@ class PackageJson(object):
return None
+ # TODO: FBP-1254
+ # def get_workspace_dep_spec_paths(self) -> list[tuple[str, str]]:
def get_workspace_dep_spec_paths(self):
"""
Returns names and paths from specifiers of the defined workspace dependencies.
- :rtype: list of (str, str)
+ :rtype: list[tuple[str, str]]
"""
spec_paths = []
schema = self.WORKSPACE_SCHEMA
diff --git a/build/plugins/lib/nots/package_manager/base/package_manager.py b/build/plugins/lib/nots/package_manager/base/package_manager.py
index 6b9faa56e8f..1c7cedb6624 100644
--- a/build/plugins/lib/nots/package_manager/base/package_manager.py
+++ b/build/plugins/lib/nots/package_manager/base/package_manager.py
@@ -133,8 +133,8 @@ class BasePackageManager(object):
def _contrib_tarball_path(self, pkg):
return os.path.join(self.contribs_path, pkg.tarball_path)
- def _contrib_tarball_url(self, pkg):
- return "file:" + self._contrib_tarball_path(pkg)
+ def _tarballs_store_path(self, pkg, store_path):
+ return os.path.join(self.module_path, store_path, pkg.tarball_path)
def _get_default_options(self):
return ["--registry", NPM_REGISTRY_URL]
diff --git a/build/plugins/lib/nots/package_manager/pnpm/__init__.py b/build/plugins/lib/nots/package_manager/pnpm/__init__.py
index af6de8e62a8..0f50359c47c 100644
--- a/build/plugins/lib/nots/package_manager/pnpm/__init__.py
+++ b/build/plugins/lib/nots/package_manager/pnpm/__init__.py
@@ -1,11 +1,12 @@
from . import constants
from .lockfile import PnpmLockfile
from .package_manager import PnpmPackageManager
-from .utils import build_ws_config_path
+from .utils import build_ws_config_path, build_lockfile_path
from .workspace import PnpmWorkspace
__all__ = [
+ "build_lockfile_path",
"build_ws_config_path",
"constants",
"PnpmLockfile",
diff --git a/build/plugins/lib/nots/package_manager/pnpm/constants.py b/build/plugins/lib/nots/package_manager/pnpm/constants.py
index e84a78c55e9..10ca9e9272a 100644
--- a/build/plugins/lib/nots/package_manager/pnpm/constants.py
+++ b/build/plugins/lib/nots/package_manager/pnpm/constants.py
@@ -1,2 +1,7 @@
PNPM_WS_FILENAME = "pnpm-workspace.yaml"
PNPM_LOCKFILE_FILENAME = "pnpm-lock.yaml"
+
+# This is a name of intermediate file that is used in TS_PREPARE_DEPS.
+# This file has a structure same to pnpm-lock.yaml, but all tarballs
+# a set relative to the build root.
+PNPM_PRE_LOCKFILE_FILENAME = "pre.pnpm-lock.yaml"
diff --git a/build/plugins/lib/nots/package_manager/pnpm/lockfile.py b/build/plugins/lib/nots/package_manager/pnpm/lockfile.py
index eca1e4015bd..46558861bd1 100644
--- a/build/plugins/lib/nots/package_manager/pnpm/lockfile.py
+++ b/build/plugins/lib/nots/package_manager/pnpm/lockfile.py
@@ -10,21 +10,22 @@ from six import iteritems
from ..base import PackageJson, BaseLockfile, LockfilePackageMeta, LockfilePackageMetaInvalidError
+LOCKFILE_VERSION = "lockfileVersion"
+
class PnpmLockfile(BaseLockfile):
IMPORTER_KEYS = PackageJson.DEP_KEYS + ("specifiers",)
def read(self):
with io.open(self.path, "rb") as f:
- self.data = yaml.load(f, Loader=yaml.CSafeLoader)
+ self.data = yaml.load(f, Loader=yaml.CSafeLoader) or {LOCKFILE_VERSION: "6.0"}
- lockfileVersion = "lockfileVersion"
- version_in_data = lockfileVersion in self.data
+ version_in_data = LOCKFILE_VERSION in self.data
r = re.compile('^[56]\\.\\d$')
- if not version_in_data or not r.match(str(self.data[lockfileVersion])):
+ if not version_in_data or not r.match(str(self.data[LOCKFILE_VERSION])):
raise Exception(
'Error of project configuration: {} has lockfileVersion: {}. '.format(
- self.path, self.data[lockfileVersion] if version_in_data else "<no-version>"
+ self.path, self.data[LOCKFILE_VERSION] if version_in_data else "<no-version>"
)
+ 'This version is not supported. Please, delete pnpm-lock.yaml and regenerate it using "ya tool nots --clean update-lockfile"'
)
@@ -129,7 +130,7 @@ def _parse_package_meta(key, meta, allow_file_protocol=False):
except LockfilePackageMetaInvalidError as e:
raise TypeError("Invalid package meta for key {}, parse error: {}".format(key, e))
- return LockfilePackageMeta(tarball_url, sky_id, integrity, integrity_algorithm)
+ return LockfilePackageMeta(key, tarball_url, sky_id, integrity, integrity_algorithm)
def _parse_tarball_url(tarball_url, allow_file_protocol):
diff --git a/build/plugins/lib/nots/package_manager/pnpm/package_manager.py b/build/plugins/lib/nots/package_manager/pnpm/package_manager.py
index 3568dbff161..4a42093fffe 100644
--- a/build/plugins/lib/nots/package_manager/pnpm/package_manager.py
+++ b/build/plugins/lib/nots/package_manager/pnpm/package_manager.py
@@ -1,10 +1,8 @@
import os
import shutil
-from six import iteritems
-
from .lockfile import PnpmLockfile
-from .utils import build_lockfile_path, build_ws_config_path
+from .utils import build_lockfile_path, build_pre_lockfile_path, build_ws_config_path
from .workspace import PnpmWorkspace
from ..base import BasePackageManager, PackageManagerError
from ..base.constants import NODE_MODULES_WORKSPACE_BUNDLE_FILENAME
@@ -35,6 +33,10 @@ class PnpmPackageManager(BasePackageManager):
"""
return cls.load_lockfile(build_lockfile_path(dir_path))
+ @staticmethod
+ def get_local_pnpm_store():
+ return os.path.join(home_dir(), ".cache", "pnpm-store")
+
def create_node_modules(self, yatool_prebuilder_path=None, local_cli=False):
"""
Creates node_modules directory according to the lockfile.
@@ -48,7 +50,7 @@ class PnpmPackageManager(BasePackageManager):
# Local mode optimizations (run from the `ya tool nots`)
if local_cli:
# Use single CAS for all the projects built locally
- store_dir = os.path.join(home_dir(), ".cache", "pnpm-store")
+ store_dir = self.get_local_pnpm_store()
# It's a default value of pnpm itself. But it should be defined explicitly for not using values from the lockfiles or from the previous installations.
virtual_store_dir = self._nm_path('.pnpm')
@@ -59,6 +61,7 @@ class PnpmPackageManager(BasePackageManager):
"--ignore-scripts",
"--no-verify-store-integrity",
"--offline",
+ "--config.confirmModulesPurge=false", # hack for https://st.yandex-team.ru/FBP-1295
"--package-import-method",
"hardlink",
# "--registry" will be set later inside self._exec_command()
@@ -82,69 +85,54 @@ class PnpmPackageManager(BasePackageManager):
bundle_path=os.path.join(self.build_path, NODE_MODULES_WORKSPACE_BUNDLE_FILENAME),
)
+ # TODO: FBP-1254
+ # def calc_prepare_deps_inouts(self, store_path: str, has_deps: bool) -> (list[str], list[str]):
+ def calc_prepare_deps_inouts(self, store_path, has_deps):
+ ins = [
+ s_rooted(build_pj_path(self.module_path)),
+ s_rooted(build_lockfile_path(self.module_path)),
+ ]
+ outs = [
+ b_rooted(build_ws_config_path(self.module_path)),
+ b_rooted(build_pre_lockfile_path(self.module_path)),
+ ]
+
+ if has_deps:
+ for dep_path in self.get_local_peers_from_package_json():
+ ins.append(b_rooted(build_ws_config_path(dep_path)))
+ ins.append(b_rooted(build_pre_lockfile_path(dep_path)))
+
+ for pkg in self.extract_packages_meta_from_lockfiles([build_lockfile_path(self.sources_path)]):
+ ins.append(b_rooted(self._contrib_tarball_path(pkg)))
+ outs.append(b_rooted(self._tarballs_store_path(pkg, store_path)))
+
+ return ins, outs
+
+ # TODO: FBP-1254
+ # def calc_node_modules_inouts(self, local_cli=False) -> (list[str], list[str]):
def calc_node_modules_inouts(self, local_cli=False):
"""
Returns input and output paths for command that creates `node_modules` bundle.
- Errors: errors caught while processing lockfiles
+ It relies on .PEERDIRSELF=TS_PREPARE_DEPS
Inputs:
- - source package.json and lockfile,
- - built package.jsons of all deps,
- - merged lockfiles and workspace configs of direct non-leave deps,
- - tarballs.
+ - source package.json
+ - merged lockfiles and workspace configs of TS_PREPARE_DEPS
Outputs:
- - merged lockfile,
- - generated workspace config,
- - created node_modules bundle.
- :rtype: (list of errors, list of str, list of str)
+ - created node_modules bundle
"""
- ins = [
- s_rooted(build_pj_path(self.module_path)),
- ]
+ ins = [s_rooted(build_pj_path(self.module_path))]
outs = []
pj = self.load_package_json_from_dir(self.sources_path)
if pj.has_dependencies():
- ins.extend(
- [
- s_rooted(build_lockfile_path(self.module_path)),
- ]
- )
- outs.extend(
- [
- b_rooted(build_lockfile_path(self.module_path)),
- b_rooted(build_ws_config_path(self.module_path)),
- ]
- )
+ ins.append(b_rooted(build_pre_lockfile_path(self.module_path)))
+ ins.append(b_rooted(build_ws_config_path(self.module_path)))
if not local_cli:
- outs.extend([b_rooted(build_nm_bundle_path(self.module_path))])
-
- # Source lockfiles are used only to get tarballs info.
- src_lf_paths = [build_lockfile_path(self.sources_path)]
-
- for [dep_src_path, (_, depth)] in iteritems(pj.get_workspace_map(ignore_self=True)):
- dep_mod_path = dep_src_path[len(self.sources_root) + 1 :]
- # pnpm requires all package.jsons.
- ins.append(b_rooted(build_pj_path(dep_mod_path)))
-
- dep_lf_src_path = build_lockfile_path(dep_src_path)
- if not os.path.isfile(dep_lf_src_path):
- # It is ok for leaves.
- continue
- src_lf_paths.append(dep_lf_src_path)
+ outs.append(b_rooted(build_nm_bundle_path(self.module_path)))
+ for dep_path in self.get_local_peers_from_package_json():
+ ins.append(b_rooted(build_pj_path(dep_path)))
- if depth == 1:
- ins.append(b_rooted(build_ws_config_path(dep_mod_path)))
- ins.append(b_rooted(build_lockfile_path(dep_mod_path)))
-
- errors = []
- try:
- for pkg in self.extract_packages_meta_from_lockfiles(src_lf_paths):
- ins.append(b_rooted(self._contrib_tarball_path(pkg)))
- except Exception as e:
- errors.append(e)
- pass
-
- return errors, ins, outs
+ return ins, outs
def extract_packages_meta_from_lockfiles(self, lf_paths):
"""
@@ -167,6 +155,13 @@ class PnpmPackageManager(BasePackageManager):
raise PackageManagerError("Unable to process some lockfiles:\n{}".format("\n".join(errors)))
def _prepare_workspace(self):
+ lf = self.load_lockfile(build_pre_lockfile_path(self.build_path))
+ lf.update_tarball_resolutions(lambda p: "file:" + os.path.join(self.build_root, p.tarball_url))
+ lf.write(build_lockfile_path(self.build_path))
+
+ return PnpmWorkspace.load(build_ws_config_path(self.build_path))
+
+ def build_workspace(self, tarballs_store):
"""
:rtype: PnpmWorkspace
"""
@@ -177,7 +172,7 @@ class PnpmPackageManager(BasePackageManager):
dep_paths = ws.get_paths(ignore_self=True)
self._build_merged_workspace_config(ws, dep_paths)
- self._build_merged_lockfile(dep_paths)
+ self._build_merged_pre_lockfile(tarballs_store, dep_paths)
return ws
@@ -195,21 +190,21 @@ class PnpmPackageManager(BasePackageManager):
return pj
- def _build_merged_lockfile(self, dep_paths):
+ def _build_merged_pre_lockfile(self, tarballs_store, dep_paths):
"""
:type dep_paths: list of str
:rtype: PnpmLockfile
"""
lf = self.load_lockfile_from_dir(self.sources_path)
# Change to the output path for correct path calcs on merging.
- lf.path = build_lockfile_path(self.build_path)
+ lf.path = build_pre_lockfile_path(self.build_path)
+ lf.update_tarball_resolutions(lambda p: self._tarballs_store_path(p, tarballs_store))
for dep_path in dep_paths:
- lf_path = build_lockfile_path(dep_path)
- if os.path.isfile(lf_path):
- lf.merge(self.load_lockfile(lf_path))
+ pre_lf_path = build_pre_lockfile_path(dep_path)
+ if os.path.isfile(pre_lf_path):
+ lf.merge(self.load_lockfile(pre_lf_path))
- lf.update_tarball_resolutions(lambda p: self._contrib_tarball_url(p))
lf.write()
def _build_merged_workspace_config(self, ws, dep_paths):
diff --git a/build/plugins/lib/nots/package_manager/pnpm/utils.py b/build/plugins/lib/nots/package_manager/pnpm/utils.py
index 1fa4291b9d3..9b6b9d80db6 100644
--- a/build/plugins/lib/nots/package_manager/pnpm/utils.py
+++ b/build/plugins/lib/nots/package_manager/pnpm/utils.py
@@ -1,6 +1,10 @@
import os
-from .constants import PNPM_LOCKFILE_FILENAME, PNPM_WS_FILENAME
+from .constants import PNPM_PRE_LOCKFILE_FILENAME, PNPM_LOCKFILE_FILENAME, PNPM_WS_FILENAME
+
+
+def build_pre_lockfile_path(p):
+ return os.path.join(p, PNPM_PRE_LOCKFILE_FILENAME)
def build_lockfile_path(p):
diff --git a/build/plugins/lib/nots/package_manager/pnpm/workspace.py b/build/plugins/lib/nots/package_manager/pnpm/workspace.py
index e596e20a18b..5639ae1c205 100644
--- a/build/plugins/lib/nots/package_manager/pnpm/workspace.py
+++ b/build/plugins/lib/nots/package_manager/pnpm/workspace.py
@@ -20,7 +20,8 @@ class PnpmWorkspace(object):
def read(self):
with open(self.path) as f:
- self.packages = set(yaml.load(f, Loader=yaml.CSafeLoader).get("packages", []))
+ parsed = yaml.load(f, Loader=yaml.CSafeLoader) or {}
+ self.packages = set(parsed.get("packages", []))
def write(self, path=None):
if not path:
diff --git a/build/plugins/lib/nots/typescript/tests/test_ts_config.py b/build/plugins/lib/nots/typescript/tests/test_ts_config.py
index cf67ca5ff98..43ae2d6738d 100644
--- a/build/plugins/lib/nots/typescript/tests/test_ts_config.py
+++ b/build/plugins/lib/nots/typescript/tests/test_ts_config.py
@@ -48,11 +48,7 @@ def test_ts_config_validate_empty():
def test_ts_config_declaration_with_dir():
cfg = TsConfig(path="/tsconfig.json")
cfg.data = {
- "compilerOptions": {
- "rootDir": "./src",
- "declaration": True,
- "declarationDir": "some/dir"
- },
+ "compilerOptions": {"rootDir": "./src", "declaration": True, "declarationDir": "some/dir"},
}
cfg.validate(use_outdir=False)
@@ -61,10 +57,7 @@ def test_ts_config_declaration_with_dir():
def test_ts_config_declaration_without_dir():
cfg = TsConfig(path="/tsconfig.json")
cfg.data = {
- "compilerOptions": {
- "rootDir": "./src",
- "declaration": True
- },
+ "compilerOptions": {"rootDir": "./src", "declaration": True},
}
# When outDir should not be used we got the error
@@ -79,11 +72,7 @@ def test_ts_config_declaration_without_dir():
def test_ts_config_declaration_with_outdir():
cfg = TsConfig(path="/tsconfig.json")
cfg.data = {
- "compilerOptions": {
- "rootDir": "./src",
- "outDir": "some/dir",
- "declaration": True
- },
+ "compilerOptions": {"rootDir": "./src", "outDir": "some/dir", "declaration": True},
}
# When we allow outDir it will be enought to set it
diff --git a/build/plugins/lib/test_const/__init__.py b/build/plugins/lib/test_const/__init__.py
index 8a91bd5ebed..79783a0218a 100644
--- a/build/plugins/lib/test_const/__init__.py
+++ b/build/plugins/lib/test_const/__init__.py
@@ -73,6 +73,7 @@ STYLE_TEST_TYPES = [
"py2_flake8",
"flake8",
"black",
+ "ruff",
]
REGULAR_TEST_TYPES = [
diff --git a/build/plugins/lib/tests/ruff/__init__.py b/build/plugins/lib/tests/ruff/__init__.py
new file mode 100644
index 00000000000..2009d0e29a3
--- /dev/null
+++ b/build/plugins/lib/tests/ruff/__init__.py
@@ -0,0 +1,17 @@
+import os
+
+
+def get_ruff_config(path, config_paths, arc_root):
+ # type(str, dict, str) -> Optional[str]
+ relative_path = os.path.relpath(path, arc_root)
+
+ # find longest path
+ deepest_path = ''
+ for p in config_paths.keys():
+ if relative_path.startswith(p) and len(p) > len(deepest_path):
+ deepest_path = p
+ if deepest_path:
+ config = config_paths[deepest_path]
+ full_config_path = os.path.join(arc_root, config)
+ return full_config_path
+ return None
diff --git a/build/plugins/lib/tests/ruff/ya.make b/build/plugins/lib/tests/ruff/ya.make
new file mode 100644
index 00000000000..1d5c87e0414
--- /dev/null
+++ b/build/plugins/lib/tests/ruff/ya.make
@@ -0,0 +1,11 @@
+OWNER(g:ymake)
+
+PY23_LIBRARY()
+
+STYLE_PYTHON()
+
+PY_SRCS(
+ __init__.py
+)
+
+END()
diff --git a/build/plugins/nots.py b/build/plugins/nots.py
index 6e99f5c10b4..6a8d825bd21 100644
--- a/build/plugins/nots.py
+++ b/build/plugins/nots.py
@@ -422,10 +422,6 @@ def _add_test(unit, test_type, test_files, deps=None, test_record=None, test_cwd
if test_record:
full_test_record.update(test_record)
- for k, v in full_test_record.items():
- if not isinstance(v, str):
- logger.warn(k, "expected 'str', got:", type(v))
-
data = ytest.dump_test(unit, full_test_record)
if data:
unit.set_property(["DART_DATA", data])
@@ -480,6 +476,28 @@ def _select_matching_version(erm_json, resource_name, range_str, dep_is_required
@_with_report_configure_error
+def on_prepare_deps_configure(unit):
+ # Originally this peerdir was in .conf file
+ # but it kept taking default value of NPM_CONTRIBS_PATH
+ # before it was updated by CUSTOM_CONTRIB_TYPESCRIPT()
+ # so I moved it here.
+ unit.onpeerdir(unit.get("NPM_CONTRIBS_PATH"))
+ pm = _create_pm(unit)
+ pj = pm.load_package_json_from_dir(pm.sources_path)
+ has_deps = pj.has_dependencies()
+ ins, outs = pm.calc_prepare_deps_inouts(unit.get("_TARBALLS_STORE"), has_deps)
+
+ if pj.has_dependencies():
+ unit.onpeerdir(pm.get_local_peers_from_package_json())
+ __set_append(unit, "_PREPARE_DEPS_INOUTS", _build_directives("input", ["hide"], sorted(ins)))
+ __set_append(unit, "_PREPARE_DEPS_INOUTS", _build_directives("output", ["hide"], sorted(outs)))
+
+ else:
+ __set_append(unit, "_PREPARE_DEPS_INOUTS", _build_directives("output", [], sorted(outs)))
+ unit.set(["_PREPARE_DEPS_CMD", "$_PREPARE_NO_DEPS_CMD"])
+
+
+@_with_report_configure_error
def on_node_modules_configure(unit):
pm = _create_pm(unit)
pj = pm.load_package_json_from_dir(pm.sources_path)
@@ -487,21 +505,11 @@ def on_node_modules_configure(unit):
if pj.has_dependencies():
unit.onpeerdir(pm.get_local_peers_from_package_json())
local_cli = unit.get("TS_LOCAL_CLI") == "yes"
- errors, ins, outs = pm.calc_node_modules_inouts(local_cli)
-
- if errors:
- ymake.report_configure_error(
- "There are some issues with lockfiles.\n"
- + "Please contact support (https://nda.ya.ru/t/sNoSFsO76ygSXL),\n"
- + "providing following details:\n"
- + "\n---\n".join([str(err) for err in errors])
- )
- else:
- unit.on_set_node_modules_ins_outs(["IN"] + sorted(ins) + ["OUT"] + sorted(outs))
+ ins, outs = pm.calc_node_modules_inouts(local_cli)
- __set_append(unit, "_NODE_MODULES_INOUTS", _build_directives("input", ["hide"], sorted(ins)))
- if not unit.get("TS_TEST_FOR"):
- __set_append(unit, "_NODE_MODULES_INOUTS", _build_directives("output", ["hide"], sorted(outs)))
+ __set_append(unit, "_NODE_MODULES_INOUTS", _build_directives("input", ["hide"], sorted(ins)))
+ if not unit.get("TS_TEST_FOR"):
+ __set_append(unit, "_NODE_MODULES_INOUTS", _build_directives("output", ["hide"], sorted(outs)))
if pj.get_use_prebuilder():
lf = pm.load_lockfile_from_dir(pm.sources_path)
@@ -526,10 +534,6 @@ def on_node_modules_configure(unit):
]
)
- else:
- # default "noop" command
- unit.set(["_NODE_MODULES_CMD", "$TOUCH_UNIT"])
-
@_with_report_configure_error
def on_ts_test_for_configure(unit, test_runner, default_config, node_modules_filename):
diff --git a/build/plugins/pybuild.py b/build/plugins/pybuild.py
index e58f0906cdf..399dac51029 100644
--- a/build/plugins/pybuild.py
+++ b/build/plugins/pybuild.py
@@ -1,4 +1,5 @@
import collections
+import json
import os
import six
from hashlib import md5
@@ -135,6 +136,15 @@ def get_srcdir(path, unit):
return rootrel_arc_src(path, unit)[: -len(path)].rstrip('/')
+@lazy
+def get_ruff_configs(unit):
+ rel_config_path = rootrel_arc_src(unit.get('RUFF_CONFIG_PATHS_FILE'), unit)
+ arc_config_path = unit.resolve_arc_path(rel_config_path)
+ abs_config_path = unit.resolve(arc_config_path)
+ with open(abs_config_path, 'r') as fd:
+ return list(json.load(fd).values())
+
+
def add_python_lint_checks(unit, py_ver, files):
@lazy
def get_resolved_files():
@@ -210,8 +220,8 @@ def add_python_lint_checks(unit, py_ver, files):
params = ["ruff", "tools/ruff_linter/bin/ruff_linter"]
params += ["FILES"] + resolved_files
params += ["GLOBAL_RESOURCES", resource]
- ruff_cfg = unit.get('STYLE_RUFF_PYPROJECT_VALUE') or 'build/config/tests/ruff/ruff.toml'
- params += ['CONFIGS', ruff_cfg]
+ configs = [unit.get('RUFF_CONFIG_PATHS_FILE'), 'build/config/tests/ruff/ruff.toml'] + get_ruff_configs(unit)
+ params += ['CONFIGS'] + configs
unit.on_add_linter_check(params)
if files and unit.get('STYLE_PYTHON_VALUE') == 'yes' and is_py3(unit):
@@ -239,7 +249,7 @@ def py_program(unit, py3):
if py3:
peers = ['library/python/runtime_py3/main']
if unit.get('PYTHON_SQLITE3') != 'no':
- peers.append('contrib/tools/python3/src/Modules/_sqlite')
+ peers.append('contrib/tools/python3/Modules/_sqlite')
else:
peers = ['library/python/runtime/main']
if unit.get('PYTHON_SQLITE3') != 'no':
@@ -470,7 +480,10 @@ def onpy_srcs(unit, *args):
# generated
if with_ext is None:
cpp_files2res.add(
- (os.path.splitext(filename)[0] + out_suffix, os.path.splitext(path)[0] + out_suffix)
+ (
+ os.path.splitext(filename)[0] + out_suffix,
+ os.path.splitext(path)[0] + out_suffix,
+ )
)
else:
cpp_files2res.add((filename + with_ext + out_suffix, path + with_ext + out_suffix))
diff --git a/build/plugins/ya.make b/build/plugins/ya.make
index 164104c5623..e55053fb9ff 100644
--- a/build/plugins/ya.make
+++ b/build/plugins/ya.make
@@ -48,4 +48,5 @@ RECURSE(
lib/proxy
lib/test_const
lib/test_const/proxy
+ lib/tests/ruff
)
diff --git a/build/plugins/ytest.py b/build/plugins/ytest.py
index 10705927b6e..23b63cc69fe 100644
--- a/build/plugins/ytest.py
+++ b/build/plugins/ytest.py
@@ -656,10 +656,11 @@ def onadd_check(unit, *args):
extra_test_dart_data['USE_KTLINT_OLD'] = 'yes'
else:
data_list = [KTLINT_CURRENT_EDITOR_CONFIG]
- baseline_path = unit.get('_KTLINT_BASELINE_FILE')
- if baseline_path:
+ baseline_path_relative = unit.get('_KTLINT_BASELINE_FILE')
+ if baseline_path_relative:
+ baseline_path = unit.resolve_arc_path(baseline_path_relative).replace('$S', 'arcadia')
data_list += [baseline_path]
- extra_test_dart_data['KTLINT_BASELINE_FILE'] = baseline_path
+ extra_test_dart_data['KTLINT_BASELINE_FILE'] = baseline_path_relative
extra_test_data = serialize_list(data_list)
extra_test_dart_data['KTLINT_BINARY'] = '$(KTLINT)/run.bat'
elif check_type == "JAVA_STYLE":
diff --git a/build/sanitize-blacklist.txt b/build/sanitize-blacklist.txt
index 27df3aa9402..711002774b6 100644
--- a/build/sanitize-blacklist.txt
+++ b/build/sanitize-blacklist.txt
@@ -1,5 +1,5 @@
src:*contrib/tools/python/src*
-src:*contrib/tools/python3/src*
+src:*contrib/tools/python3*
src:*contrib/libs/luajit*
type:std::__*::locale::id=init
diff --git a/build/scripts/cat.py b/build/scripts/cat.py
index 0c3f73d96f6..875050cac67 100755
--- a/build/scripts/cat.py
+++ b/build/scripts/cat.py
@@ -3,13 +3,17 @@ import sys
from shutil import copyfileobj as copy
import os.path
+
+PY3 = sys.version_info[0] == 3
+
+
if __name__ == '__main__':
for filename in sys.argv[1:] or ["-"]:
if filename == "-":
copy(sys.stdin, sys.stdout)
else:
if os.path.exists(filename):
- with open(filename, 'rb') as file:
+ with open(filename, 'r' if PY3 else 'rb') as file:
copy(file, sys.stdout)
else:
sys.stderr.write('cat.py: {0}: No such file or directory\n'.format(filename))
diff --git a/build/scripts/generate_vcs_info.py b/build/scripts/generate_vcs_info.py
index b311be5617d..b1ccdfcf9ce 100644
--- a/build/scripts/generate_vcs_info.py
+++ b/build/scripts/generate_vcs_info.py
@@ -6,7 +6,6 @@ import os
import subprocess
import sys
import time
-import six as six_
INDENT = " " * 4
@@ -21,10 +20,7 @@ def _get_vcs_dictionary(vcs_type, *arg):
def _get_user_locale():
try:
- if six_.PY3:
- return [locale.getencoding()]
- else:
- return [locale.getdefaultlocale()[1]]
+ return [locale.getencoding()]
except Exception:
return []
@@ -116,7 +112,7 @@ class _GitVersion:
except Exception:
branch_info = [''.encode('utf-8')]
- depth = six_.text_type(_GitVersion._get_git_depth(env, arc_root)).encode('utf-8')
+ depth = str(_GitVersion._get_git_depth(env, arc_root)).encode('utf-8')
# logger.debug('Git info commit:{}, author:{}, summary:{}, svn_id:{}'.format(commit, author, summary, svn_id))
return [commit, author, summary, svn_id, tag_info[0], branch_info[0], depth]
@@ -175,7 +171,7 @@ class _SystemInfo:
@staticmethod
def _to_text(s):
- if isinstance(s, six_.binary_type):
+ if isinstance(s, bytes):
return s.decode(_SystemInfo.get_locale(), errors='replace')
return s
@@ -239,7 +235,7 @@ class _SystemInfo:
try:
import ctypes
- msg = six_.text_type(ctypes.FormatError(e.winerror), _SystemInfo.get_locale()).encode('utf-8')
+ msg = str(ctypes.FormatError(e.winerror), _SystemInfo.get_locale()).encode('utf-8')
except ImportError:
pass
# logger.debug('System command call {} failed [{}]: {}\n'.format(command, errcodes, msg))
diff --git a/build/scripts/link_sbom.py b/build/scripts/link_sbom.py
new file mode 100644
index 00000000000..8210415ab9a
--- /dev/null
+++ b/build/scripts/link_sbom.py
@@ -0,0 +1,67 @@
+import argparse
+import json
+import os
+
+
+def parse_kv_arr(val):
+ res = {}
+ for kv in val.split(';'):
+ k, v = kv.split('=')
+ res[k] = v
+ return res
+
+
+def deduce_name(path):
+ name = os.path.basename(path)
+ for prefix in ['contrib/libs/', 'contrib/python/py2/', 'contrib/python/py3/', 'contrib/python/']:
+ if path.startswith(prefix):
+ name = path[len(prefix):].replace('/', '-')
+ break
+ return name
+
+
+def parse_componenet(component):
+ props = parse_kv_arr(component)
+ path = props['path']
+ ver = props['ver']
+
+ res = {}
+ res['type'] = 'library'
+ res['name'] = deduce_name(path)
+ res['version'] = ver
+ res["properties"] = [
+ {'name': 'arcadia_module_subdir', 'value': path},
+ {'name': 'language', 'value': props['lang']}
+ ]
+ return res
+
+
+def main():
+ parser = argparse.ArgumentParser(description='Generate SBOM data from used contribs info')
+ parser.add_argument('-o', '--output', type=argparse.FileType('w', encoding='UTF-8'), help='resulting SBOM file', required=True)
+ parser.add_argument('--vcs-info', type=argparse.FileType('r', encoding='UTF-8'), help='VCS information file', required=True)
+ parser.add_argument('--mod-path', type=str, help='Path to module in arcadia', required=True)
+ parser.add_argument('libinfo', metavar='N', type=str, nargs='*', help='libraries info for components section')
+
+ args = parser.parse_args()
+
+ vcs = json.load(args.vcs_info)
+
+ res = {}
+ res['$schema'] = "http://cyclonedx.org/schema/bom-1.5.schema.json"
+ res["bomFormat"] = "CycloneDX"
+ res["specVersion"] = "1.5"
+ res["version"] = 1
+ res["components"] = [parse_componenet(lib) for lib in args.libinfo]
+ res["properties"] = [
+ {'name': 'commit_hash', 'value': vcs['ARCADIA_SOURCE_HG_HASH'], 'arcadia_module_subdir': args.mod_path}
+ ]
+ if vcs.get('DIRTY', '') == 'dirty':
+ res["properties"].append({'name': 'has_uncommited_changes', 'value': True})
+
+ json.dump(res, args.output)
+ args.output.close()
+
+
+if __name__ == '__main__':
+ main()
diff --git a/build/scripts/move.py b/build/scripts/move.py
index 3f611fbc2e3..f38e88a4065 100644
--- a/build/scripts/move.py
+++ b/build/scripts/move.py
@@ -1,14 +1,23 @@
import os
import sys
+import process_command_files as pcf
+
# /script/move.py <src-1> <tgt-1> <src-2> <tgt-2> ... <src-n> <tgt-n>
# renames src-1 to tgt-1, src-2 to tgt-2, ..., src-n to tgt-n.
def main():
- assert len(sys.argv) % 2 == 1
- for index in range(1, len(sys.argv), 2):
- os.rename(sys.argv[index], sys.argv[index + 1])
+ args = pcf.get_args(sys.argv[1:])
+ assert len(args) % 2 == 0, (len(args), args)
+
+ copied = set()
+
+ for index in range(0, len(args), 2):
+ assert args[index] not in copied, "Double input detected for file: {}".format(args[index])
+
+ os.rename(args[index], args[index + 1])
+ copied.add(args[index])
if __name__ == '__main__':
diff --git a/build/sysincl/darwin.yml b/build/sysincl/darwin.yml
index 6991ba63c2e..1891a8f0a37 100644
--- a/build/sysincl/darwin.yml
+++ b/build/sysincl/darwin.yml
@@ -43,6 +43,7 @@
- crt_externs.h
- curses.h
- dispatch/dispatch.h
+ - dns_sd.h
- editline/readline.h
- Files.h
- ffi/ffi.h
@@ -189,6 +190,7 @@
- Carbon/Carbon.h
- CFNetwork/CFNetwork.h
- Cocoa/Cocoa.h
+ - CoreData/CoreData.h
- CoreFoundation/CFArray.h
- CoreFoundation/CFBase.h
- CoreFoundation/CFBundle.h
@@ -228,6 +230,10 @@
- IOKit/hid/IOHIDKeys.h
- IOKit/hid/IOHIDLib.h
- IOKit/kext/KextManager.h
+ - IOKit/network/IOEthernetController.h
+ - IOKit/network/IOEthernetInterface.h
+ - IOKit/network/IONetworkInterface.h
+ - IOKit/network/IONetworkMedium.h
- IOKit/ps/IOPSKeys.h
- IOKit/ps/IOPSKeys.h
- IOKit/ps/IOPowerSources.h
@@ -239,6 +245,7 @@
- Kernel/IOKit/hidsystem/IOHIDUsageTables.h
- Metal/Metal.h
- metal_stdlib
+ - Network/Network.h
- OpenCL/cl.h
- OpenCL/cl_gl.h
- OpenCL/opencl.h
@@ -265,6 +272,7 @@
- Security/Security.h
- SystemConfiguration/SystemConfiguration.h
- SystemConfiguration/SCDynamicStoreCopySpecific.h
+ - SystemConfiguration/SCNetworkConfiguration.h
- TextUtils.h
- Types.h
- UIKit/UIImage.h
diff --git a/build/sysincl/libc-to-nothing.yml b/build/sysincl/libc-to-nothing.yml
index 9d774349fe6..a7fdcbd87e8 100644
--- a/build/sysincl/libc-to-nothing.yml
+++ b/build/sysincl/libc-to-nothing.yml
@@ -10,6 +10,7 @@
- arpa/telnet.h
- arpa/tftp.h
- assert.h
+ - bits/alltypes.h # not libc, but similar
- byteswap.h
- cpio.h
- crypt.h
diff --git a/build/sysincl/macro.yml b/build/sysincl/macro.yml
index 0f533cdb36f..b48ba7895a1 100644
--- a/build/sysincl/macro.yml
+++ b/build/sysincl/macro.yml
@@ -1180,6 +1180,8 @@
# after resolving a problem via ADDINCL there will be much more errors. So currently these types of errors hide under empty resolving
- source_filter: "^contrib/libs/connectedhomeip/src"
includes:
+ - CHIP_SYSTEM_CONFIG_PLATFORM_LOG_INCLUDE:
+ - contrib/libs/connectedhomeip/src/platform/Darwin/Logging.h
- CHIP_SYSTEM_LAYER_IMPL_CONFIG_FILE:
- contrib/libs/connectedhomeip/src/system/SystemLayerImplSelect.h
- contrib/libs/connectedhomeip/src/system/SystemLayerImplFreeRTOS.h
@@ -1204,3 +1206,15 @@
- source_filter: "^contrib/libs/sdbus-cpp"
includes:
- SDBUS_HEADER: contrib/libs/systemd/src/systemd/sd-bus.h
+
+- source_filter: "^smart_devices/third_party/beken_freertos_sdk"
+ includes:
+ - LWIP_ERRNO_INCLUDE: smart_devices/third_party/beken_freertos_sdk/beken378/func/lwip_intf/lwip-2.1.2/src/include/lwip/errno.h
+ - LWIP_HOOK_FILENAME
+ - DHCP_GLOBAL_XID_HEADER
+ - MBEDTLS_CONFIG_FILE: smart_devices/third_party/beken_freertos_sdk/beken378/func/mbedtls/mbedtls-port/inc/aws_mbedtls_config.h
+ - MBEDTLS_USER_CONFIG_FILE
+ - MBEDTLS_PLATFORM_STD_MEM_HDR
+ - YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
+ - YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
+ - xstr(MQTTCLIENT_PLATFORM_HEADER)
diff --git a/build/sysincl/misc.yml b/build/sysincl/misc.yml
index 82c9ae12ecd..a347ac51f35 100644
--- a/build/sysincl/misc.yml
+++ b/build/sysincl/misc.yml
@@ -384,6 +384,16 @@
- lwip/stats.h
- lwip/sys.h
- lwip/tcpip.h
+ # contrib/libs/connectedhomeip/src/crypto uses boringssl on OS_DARWIN
+ - openssl/aead.h:
+ - contrib/libs/connectedhomeip/third_party/boringssl/repo/src/include/openssl/aead.h
+ - openssl/base.h:
+ - contrib/libs/connectedhomeip/third_party/boringssl/repo/src/include/openssl/base.h
+ - openssl/is_boringssl.h:
+ - contrib/libs/connectedhomeip/third_party/boringssl/repo/src/include/openssl/is_boringssl.h
+ # contrib/libs/connectedhomeip: src/lib/support, src/inet, src/system on OS_DARWIN
+ - nlfaultinjection.hpp:
+ - contrib/libs/connectedhomeip/third_party/nlfaultinjection/include/nlfaultinjection.hpp
- source_filter: "^contrib/libs/glibcasm"
includes:
@@ -509,3 +519,11 @@
- vendor/github.com/NVIDIA/go-dcgm/pkg/dcgm/nvml.h
- vendor/github.com/NVIDIA/go-nvml/gen/nvml/nvml.h
- vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.h
+
+- source_filter: "^smart_devices/third_party/beken_freertos_sdk"
+ includes:
+ - error.h: smart_devices/third_party/beken_freertos_sdk/beken378/common/error.h
+ - errno.h: smart_devices/third_party/beken_freertos_sdk/beken378/func/lwip_intf/lwip-2.1.2/src/include/lwip/errno.h
+ - netdb.h: smart_devices/third_party/beken_freertos_sdk/beken378/func/lwip_intf/lwip-2.1.2/src/include/lwip/netdb.h
+ - signal.h: smart_devices/third_party/beken_freertos_sdk/beken378/func/wpa_supplicant_2_9/bk_patch/signal.h
+ - check_config.h: smart_devices/third_party/beken_freertos_sdk/beken378/func/mbedtls/mbedtls-2.27.0/include/mbedtls/check_config.h
diff --git a/build/sysincl/nvidia.yml b/build/sysincl/nvidia.yml
index 8e79d0e0979..4de42a89b3a 100644
--- a/build/sysincl/nvidia.yml
+++ b/build/sysincl/nvidia.yml
@@ -12,15 +12,27 @@
- cublasLt.h
- cublas_v2.h
- cuda.h
+ - cudaEGL.h
- cudaProfiler.h
- cudaTypedefs.h
- cuda_bf16.h
- cuda_fp16.h
+ - cuda_fp8.h
- cuda_gl_interop.h
- cuda_occupancy.h
- cuda_profiler_api.h
- cuda_runtime.h
- cuda_runtime_api.h
+ - cuda/std/cassert
+ - cuda/std/cmath
+ - cuda/std/cstddef
+ - cuda/std/cstdint
+ - cuda/std/functional
+ - cuda/std/limits
+ - cuda/std/tuple
+ - cuda/std/type_traits
+ - cuda/std/utility
+ - mma.h
- cufft.h
- cufftXt.h
- cupti.h
@@ -42,6 +54,7 @@
- nvToolsExtCuda.h
- npp.h
- nppi.h
+ - nv/target
- nvToolsExt.h
- nvml.h
- surface_types.h
@@ -55,17 +68,10 @@
- thrust/iterator/iterator_facade.h: contrib/libs/nvidia/thrust/thrust/iterator/iterator_facade.h
- thrust/system/cuda/detail/core/triple_chevron_launch.h: contrib/libs/nvidia/thrust/thrust/system/cuda/detail/core/triple_chevron_launch.h
- thrust/version.h: contrib/libs/nvidia/thrust/thrust/version.h
+
# These headers should be provided by TensorRT.
# Proper solution must be found in DTCC-171
- source_filter: "^contrib/libs/tf/.*"
includes:
- NvInfer.h
- NvInferPlugin.h
-# Add support nvrtc
-- source_filter: "^contrib/libs/nvidia/cutlass/.*"
- includes:
- - cuda/std/cassert
- - cuda/std/cmath
- - cuda/std/cstdint
- - cuda/std/utility
- - mma.h
diff --git a/build/sysincl/stl-to-libcxx.yml b/build/sysincl/stl-to-libcxx.yml
index 7b3149fef0f..c8d6de75b24 100644
--- a/build/sysincl/stl-to-libcxx.yml
+++ b/build/sysincl/stl-to-libcxx.yml
@@ -41,110 +41,13 @@
- contrib/libs/cxxsupp/libcxx/include/unwind.h
- contrib/libs/cxxsupp/libcxxrt/unwind.h
- contrib/libs/libunwind/include/unwind.h
+ - use_ansi.h:
+ - contrib/libs/cxxsupp/libcxx/include/use_ansi.h
- source_filter: "^contrib/libs/cxxsupp/libcxxabi/"
includes:
- cxxabi.h: contrib/libs/cxxsupp/libcxxabi/include/cxxabi.h
-- includes:
- - algorithm: contrib/libs/cxxsupp/libcxx/include/algorithm
- - any: contrib/libs/cxxsupp/libcxx/include/any
- - array: contrib/libs/cxxsupp/libcxx/include/array
- - atomic: contrib/libs/cxxsupp/libcxx/include/atomic
- - bit: contrib/libs/cxxsupp/libcxx/include/bit
- - bitset: contrib/libs/cxxsupp/libcxx/include/bitset
- - cassert: contrib/libs/cxxsupp/libcxx/include/cassert
- - ccomplex: contrib/libs/cxxsupp/libcxx/include/ccomplex
- - cctype: contrib/libs/cxxsupp/libcxx/include/cctype
- - cerrno: contrib/libs/cxxsupp/libcxx/include/cerrno
- - cfenv: contrib/libs/cxxsupp/libcxx/include/cfenv
- - cfloat: contrib/libs/cxxsupp/libcxx/include/cfloat
- - charconv: contrib/libs/cxxsupp/libcxx/include/charconv
- - chrono: contrib/libs/cxxsupp/libcxx/include/chrono
- - cinttypes: contrib/libs/cxxsupp/libcxx/include/cinttypes
- - ciso646: contrib/libs/cxxsupp/libcxx/include/ciso646
- - climits: contrib/libs/cxxsupp/libcxx/include/climits
- - clocale: contrib/libs/cxxsupp/libcxx/include/clocale
- - cmath: contrib/libs/cxxsupp/libcxx/include/cmath
- - codecvt: contrib/libs/cxxsupp/libcxx/include/codecvt
- - compare: contrib/libs/cxxsupp/libcxx/include/compare
- - complex: contrib/libs/cxxsupp/libcxx/include/complex
- - concepts: contrib/libs/cxxsupp/libcxx/include/concepts
- - condition_variable: contrib/libs/cxxsupp/libcxx/include/condition_variable
- - coroutine: contrib/libs/cxxsupp/libcxx/include/coroutine
- - csetjmp: contrib/libs/cxxsupp/libcxx/include/csetjmp
- - csignal: contrib/libs/cxxsupp/libcxx/include/csignal
- - cstdarg: contrib/libs/cxxsupp/libcxx/include/cstdarg
- - cstdbool: contrib/libs/cxxsupp/libcxx/include/cstdbool
- - cstddef: contrib/libs/cxxsupp/libcxx/include/cstddef
- - cstdint: contrib/libs/cxxsupp/libcxx/include/cstdint
- - cstdio: contrib/libs/cxxsupp/libcxx/include/cstdio
- - cstdlib: contrib/libs/cxxsupp/libcxx/include/cstdlib
- - cstring: contrib/libs/cxxsupp/libcxx/include/cstring
- - ctgmath: contrib/libs/cxxsupp/libcxx/include/ctgmath
- - ctime: contrib/libs/cxxsupp/libcxx/include/ctime
- - cuchar: contrib/libs/cxxsupp/libcxx/include/cuchar
- - cwchar: contrib/libs/cxxsupp/libcxx/include/cwchar
- - cwctype: contrib/libs/cxxsupp/libcxx/include/cwctype
- - deque: contrib/libs/cxxsupp/libcxx/include/deque
- - exception: contrib/libs/cxxsupp/libcxx/include/exception
- - expected: contrib/libs/cxxsupp/libcxx/include/expected
- - filesystem: contrib/libs/cxxsupp/libcxx/include/filesystem
- - forward_list: contrib/libs/cxxsupp/libcxx/include/forward_list
- - fstream: contrib/libs/cxxsupp/libcxx/include/fstream
- - functional: contrib/libs/cxxsupp/libcxx/include/functional
- - future: contrib/libs/cxxsupp/libcxx/include/future
- - initializer_list: contrib/libs/cxxsupp/libcxx/include/initializer_list
- - iomanip: contrib/libs/cxxsupp/libcxx/include/iomanip
- - ios: contrib/libs/cxxsupp/libcxx/include/ios
- - iosfwd: contrib/libs/cxxsupp/libcxx/include/iosfwd
- - iostream: contrib/libs/cxxsupp/libcxx/include/iostream
- - istream: contrib/libs/cxxsupp/libcxx/include/istream
- - iterator: contrib/libs/cxxsupp/libcxx/include/iterator
- - limits: contrib/libs/cxxsupp/libcxx/include/limits
- - list: contrib/libs/cxxsupp/libcxx/include/list
- - locale: contrib/libs/cxxsupp/libcxx/include/locale
- - map: contrib/libs/cxxsupp/libcxx/include/map
- - memory: contrib/libs/cxxsupp/libcxx/include/memory
- - mutex: contrib/libs/cxxsupp/libcxx/include/mutex
- - new: contrib/libs/cxxsupp/libcxx/include/new
- - numbers: contrib/libs/cxxsupp/libcxx/include/numbers
- - numeric: contrib/libs/cxxsupp/libcxx/include/numeric
- - optional: contrib/libs/cxxsupp/libcxx/include/optional
- - ostream: contrib/libs/cxxsupp/libcxx/include/ostream
- - queue: contrib/libs/cxxsupp/libcxx/include/queue
- - random: contrib/libs/cxxsupp/libcxx/include/random
- - ranges: contrib/libs/cxxsupp/libcxx/include/ranges
- - ratio: contrib/libs/cxxsupp/libcxx/include/ratio
- - regex: contrib/libs/cxxsupp/libcxx/include/regex
- - scoped_allocator: contrib/libs/cxxsupp/libcxx/include/scoped_allocator
- - set: contrib/libs/cxxsupp/libcxx/include/set
- - shared_mutex: contrib/libs/cxxsupp/libcxx/include/shared_mutex
- - source_location: contrib/libs/cxxsupp/libcxx/include/source_location
- - span: contrib/libs/cxxsupp/libcxx/include/span
- - sstream: contrib/libs/cxxsupp/libcxx/include/sstream
- - stack: contrib/libs/cxxsupp/libcxx/include/stack
- - stdexcept: contrib/libs/cxxsupp/libcxx/include/stdexcept
- - stlfwd: contrib/libs/cxxsupp/libcxx/include/stlfwd
- - streambuf: contrib/libs/cxxsupp/libcxx/include/streambuf
- - string: contrib/libs/cxxsupp/libcxx/include/string
- - string_view: contrib/libs/cxxsupp/libcxx/include/string_view
- - strstream: contrib/libs/cxxsupp/libcxx/include/strstream
- - system_error: contrib/libs/cxxsupp/libcxx/include/system_error
- - thread: contrib/libs/cxxsupp/libcxx/include/thread
- - tuple: contrib/libs/cxxsupp/libcxx/include/tuple
- - type_traits: contrib/libs/cxxsupp/libcxx/include/type_traits
- - typeindex: contrib/libs/cxxsupp/libcxx/include/typeindex
- - typeinfo: contrib/libs/cxxsupp/libcxx/include/typeinfo
- - unordered_map: contrib/libs/cxxsupp/libcxx/include/unordered_map
- - unordered_set: contrib/libs/cxxsupp/libcxx/include/unordered_set
- - use_ansi.h: contrib/libs/cxxsupp/libcxx/include/use_ansi.h
- - utility: contrib/libs/cxxsupp/libcxx/include/utility
- - valarray: contrib/libs/cxxsupp/libcxx/include/valarray
- - variant: contrib/libs/cxxsupp/libcxx/include/variant
- - vector: contrib/libs/cxxsupp/libcxx/include/vector
- - version: contrib/libs/cxxsupp/libcxx/include/version
-
# Though these are headers provided by libcxx, we do not want to allow them to be included.
# We are using non-existent filename to generate error instead, as there is no specific syntax for this case.
- includes:
@@ -161,29 +64,136 @@
- experimental/system_error: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_SYSTEM_ERROR
- experimental/tuple: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_TUPLE
- # TODO: Forbid including <experimental/coroutine> upon migration to clang14
- - experimental/coroutine: contrib/libs/cxxsupp/libcxx/include/experimental/coroutine
+# TODO: Forbid including <experimental/coroutine> upon MapKit migration to clang14
+# After that we can mark #include <experimental/coroutine> as error in contrib/libs/asio
+- includes:
+ - experimental/coroutine
# This includes all headers needed to resolve includes in c-headers from libcxx listed above
# GENERATED BY YM2
- includes:
+ - algorithm: contrib/libs/cxxsupp/libcxx/include/algorithm
+ - any: contrib/libs/cxxsupp/libcxx/include/any
+ - array: contrib/libs/cxxsupp/libcxx/include/array
+ - atomic: contrib/libs/cxxsupp/libcxx/include/atomic
+ - barrier: contrib/libs/cxxsupp/libcxx/include/barrier
+ - bit: contrib/libs/cxxsupp/libcxx/include/bit
+ - bitset: contrib/libs/cxxsupp/libcxx/include/bitset
+ - cassert: contrib/libs/cxxsupp/libcxx/include/cassert
+ - ccomplex: contrib/libs/cxxsupp/libcxx/include/ccomplex
+ - cctype: contrib/libs/cxxsupp/libcxx/include/cctype
+ - cerrno: contrib/libs/cxxsupp/libcxx/include/cerrno
+ - cfenv: contrib/libs/cxxsupp/libcxx/include/cfenv
+ - cfloat: contrib/libs/cxxsupp/libcxx/include/cfloat
+ - charconv: contrib/libs/cxxsupp/libcxx/include/charconv
+ - chrono: contrib/libs/cxxsupp/libcxx/include/chrono
+ - cinttypes: contrib/libs/cxxsupp/libcxx/include/cinttypes
+ - ciso646: contrib/libs/cxxsupp/libcxx/include/ciso646
+ - climits: contrib/libs/cxxsupp/libcxx/include/climits
+ - clocale: contrib/libs/cxxsupp/libcxx/include/clocale
+ - cmath: contrib/libs/cxxsupp/libcxx/include/cmath
+ - codecvt: contrib/libs/cxxsupp/libcxx/include/codecvt
+ - compare: contrib/libs/cxxsupp/libcxx/include/compare
+ - complex: contrib/libs/cxxsupp/libcxx/include/complex
+ - concepts: contrib/libs/cxxsupp/libcxx/include/concepts
+ - condition_variable: contrib/libs/cxxsupp/libcxx/include/condition_variable
+ - coroutine: contrib/libs/cxxsupp/libcxx/include/coroutine
+ - csetjmp: contrib/libs/cxxsupp/libcxx/include/csetjmp
+ - csignal: contrib/libs/cxxsupp/libcxx/include/csignal
+ - cstdarg: contrib/libs/cxxsupp/libcxx/include/cstdarg
+ - cstdbool: contrib/libs/cxxsupp/libcxx/include/cstdbool
+ - cstddef: contrib/libs/cxxsupp/libcxx/include/cstddef
+ - cstdint: contrib/libs/cxxsupp/libcxx/include/cstdint
+ - cstdio: contrib/libs/cxxsupp/libcxx/include/cstdio
+ - cstdlib: contrib/libs/cxxsupp/libcxx/include/cstdlib
+ - cstring: contrib/libs/cxxsupp/libcxx/include/cstring
+ - ctgmath: contrib/libs/cxxsupp/libcxx/include/ctgmath
+ - ctime: contrib/libs/cxxsupp/libcxx/include/ctime
+ - cuchar: contrib/libs/cxxsupp/libcxx/include/cuchar
+ - cwchar: contrib/libs/cxxsupp/libcxx/include/cwchar
+ - cwctype: contrib/libs/cxxsupp/libcxx/include/cwctype
+ - deque: contrib/libs/cxxsupp/libcxx/include/deque
+ - exception: contrib/libs/cxxsupp/libcxx/include/exception
+ - execution: contrib/libs/cxxsupp/libcxx/include/execution
+ - expected: contrib/libs/cxxsupp/libcxx/include/expected
+ - filesystem: contrib/libs/cxxsupp/libcxx/include/filesystem
+ - format: contrib/libs/cxxsupp/libcxx/include/format
+ - forward_list: contrib/libs/cxxsupp/libcxx/include/forward_list
+ - fstream: contrib/libs/cxxsupp/libcxx/include/fstream
+ - functional: contrib/libs/cxxsupp/libcxx/include/functional
+ - future: contrib/libs/cxxsupp/libcxx/include/future
+ - initializer_list: contrib/libs/cxxsupp/libcxx/include/initializer_list
+ - iomanip: contrib/libs/cxxsupp/libcxx/include/iomanip
+ - ios: contrib/libs/cxxsupp/libcxx/include/ios
+ - iosfwd: contrib/libs/cxxsupp/libcxx/include/iosfwd
+ - iostream: contrib/libs/cxxsupp/libcxx/include/iostream
+ - istream: contrib/libs/cxxsupp/libcxx/include/istream
+ - iterator: contrib/libs/cxxsupp/libcxx/include/iterator
+ - latch: contrib/libs/cxxsupp/libcxx/include/latch
+ - limits: contrib/libs/cxxsupp/libcxx/include/limits
+ - list: contrib/libs/cxxsupp/libcxx/include/list
+ - locale: contrib/libs/cxxsupp/libcxx/include/locale
+ - map: contrib/libs/cxxsupp/libcxx/include/map
+ - mdspan: contrib/libs/cxxsupp/libcxx/include/mdspan
+ - memory: contrib/libs/cxxsupp/libcxx/include/memory
+ - memory_resource: contrib/libs/cxxsupp/libcxx/include/memory_resource
+ - mutex: contrib/libs/cxxsupp/libcxx/include/mutex
+ - new: contrib/libs/cxxsupp/libcxx/include/new
+ - numbers: contrib/libs/cxxsupp/libcxx/include/numbers
+ - numeric: contrib/libs/cxxsupp/libcxx/include/numeric
+ - optional: contrib/libs/cxxsupp/libcxx/include/optional
+ - ostream: contrib/libs/cxxsupp/libcxx/include/ostream
+ - print: contrib/libs/cxxsupp/libcxx/include/print
+ - queue: contrib/libs/cxxsupp/libcxx/include/queue
+ - random: contrib/libs/cxxsupp/libcxx/include/random
+ - ranges: contrib/libs/cxxsupp/libcxx/include/ranges
+ - ratio: contrib/libs/cxxsupp/libcxx/include/ratio
+ - regex: contrib/libs/cxxsupp/libcxx/include/regex
+ - scoped_allocator: contrib/libs/cxxsupp/libcxx/include/scoped_allocator
+ - semaphore: contrib/libs/cxxsupp/libcxx/include/semaphore
+ - set: contrib/libs/cxxsupp/libcxx/include/set
+ - shared_mutex: contrib/libs/cxxsupp/libcxx/include/shared_mutex
+ - source_location: contrib/libs/cxxsupp/libcxx/include/source_location
+ - span: contrib/libs/cxxsupp/libcxx/include/span
+ - sstream: contrib/libs/cxxsupp/libcxx/include/sstream
+ - stack: contrib/libs/cxxsupp/libcxx/include/stack
+ - stdexcept: contrib/libs/cxxsupp/libcxx/include/stdexcept
+ - stlfwd: contrib/libs/cxxsupp/libcxx/include/stlfwd
+ - stop_token: contrib/libs/cxxsupp/libcxx/include/stop_token
+ - streambuf: contrib/libs/cxxsupp/libcxx/include/streambuf
+ - string: contrib/libs/cxxsupp/libcxx/include/string
+ - string_view: contrib/libs/cxxsupp/libcxx/include/string_view
+ - strstream: contrib/libs/cxxsupp/libcxx/include/strstream
+ - system_error: contrib/libs/cxxsupp/libcxx/include/system_error
+ - thread: contrib/libs/cxxsupp/libcxx/include/thread
+ - tuple: contrib/libs/cxxsupp/libcxx/include/tuple
+ - type_traits: contrib/libs/cxxsupp/libcxx/include/type_traits
+ - typeindex: contrib/libs/cxxsupp/libcxx/include/typeindex
+ - typeinfo: contrib/libs/cxxsupp/libcxx/include/typeinfo
+ - unordered_map: contrib/libs/cxxsupp/libcxx/include/unordered_map
+ - unordered_set: contrib/libs/cxxsupp/libcxx/include/unordered_set
+ - utility: contrib/libs/cxxsupp/libcxx/include/utility
+ - valarray: contrib/libs/cxxsupp/libcxx/include/valarray
+ - variant: contrib/libs/cxxsupp/libcxx/include/variant
+ - vector: contrib/libs/cxxsupp/libcxx/include/vector
+ - version: contrib/libs/cxxsupp/libcxx/include/version
- __assert: contrib/libs/cxxsupp/libcxx/include/__assert
- __availability: contrib/libs/cxxsupp/libcxx/include/__availability
- __bit_reference: contrib/libs/cxxsupp/libcxx/include/__bit_reference
- - __bsd_locale_defaults.h: contrib/libs/cxxsupp/libcxx/include/__bsd_locale_defaults.h
- - __bsd_locale_fallbacks.h: contrib/libs/cxxsupp/libcxx/include/__bsd_locale_fallbacks.h
- __config: contrib/libs/cxxsupp/libcxx/include/__config
- __config_site: contrib/libs/cxxsupp/libcxx/include/__config_site
- __config_site.in: contrib/libs/cxxsupp/libcxx/include/__config_site.in
- - __debug: contrib/libs/cxxsupp/libcxx/include/__debug
- - __errc: contrib/libs/cxxsupp/libcxx/include/__errc
- __hash_table: contrib/libs/cxxsupp/libcxx/include/__hash_table
- __locale: contrib/libs/cxxsupp/libcxx/include/__locale
- __mbstate_t.h: contrib/libs/cxxsupp/libcxx/include/__mbstate_t.h
- - __mutex_base: contrib/libs/cxxsupp/libcxx/include/__mutex_base
- __node_handle: contrib/libs/cxxsupp/libcxx/include/__node_handle
+ - __pstl_algorithm: contrib/libs/cxxsupp/libcxx/include/__pstl_algorithm
+ - __pstl_config_site.in: contrib/libs/cxxsupp/libcxx/include/__pstl_config_site.in
+ - __pstl_memory: contrib/libs/cxxsupp/libcxx/include/__pstl_memory
+ - __pstl_numeric: contrib/libs/cxxsupp/libcxx/include/__pstl_numeric
- __split_buffer: contrib/libs/cxxsupp/libcxx/include/__split_buffer
- - __std_stream: contrib/libs/cxxsupp/libcxx/include/__std_stream
+ - __std_clang_module: contrib/libs/cxxsupp/libcxx/include/__std_clang_module
+ - __std_mbstate_t.h: contrib/libs/cxxsupp/libcxx/include/__std_mbstate_t.h
- __threading_support: contrib/libs/cxxsupp/libcxx/include/__threading_support
- __tree: contrib/libs/cxxsupp/libcxx/include/__tree
- __undef_macros: contrib/libs/cxxsupp/libcxx/include/__undef_macros
@@ -213,6 +223,7 @@
- __algorithm/find_if_not.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/find_if_not.h
- __algorithm/for_each.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/for_each.h
- __algorithm/for_each_n.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/for_each_n.h
+ - __algorithm/for_each_segment.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/for_each_segment.h
- __algorithm/generate.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/generate.h
- __algorithm/generate_n.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/generate_n.h
- __algorithm/half_positive.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/half_positive.h
@@ -233,6 +244,7 @@
- __algorithm/iter_swap.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/iter_swap.h
- __algorithm/iterator_operations.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/iterator_operations.h
- __algorithm/lexicographical_compare.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare.h
+ - __algorithm/lexicographical_compare_three_way.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare_three_way.h
- __algorithm/lower_bound.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/lower_bound.h
- __algorithm/make_heap.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/make_heap.h
- __algorithm/make_projected.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/make_projected.h
@@ -257,6 +269,34 @@
- __algorithm/partition_point.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/partition_point.h
- __algorithm/pop_heap.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pop_heap.h
- __algorithm/prev_permutation.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/prev_permutation.h
+ - __algorithm/pstl_any_all_none_of.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_any_all_none_of.h
+ - __algorithm/pstl_backend.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backend.h
+ - __algorithm/pstl_backends/cpu_backend.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backend.h
+ - __algorithm/pstl_backends/cpu_backends/any_of.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/any_of.h
+ - __algorithm/pstl_backends/cpu_backends/backend.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/backend.h
+ - __algorithm/pstl_backends/cpu_backends/fill.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/fill.h
+ - __algorithm/pstl_backends/cpu_backends/find_if.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/find_if.h
+ - __algorithm/pstl_backends/cpu_backends/for_each.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/for_each.h
+ - __algorithm/pstl_backends/cpu_backends/libdispatch.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/libdispatch.h
+ - __algorithm/pstl_backends/cpu_backends/merge.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/merge.h
+ - __algorithm/pstl_backends/cpu_backends/serial.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/serial.h
+ - __algorithm/pstl_backends/cpu_backends/stable_sort.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/stable_sort.h
+ - __algorithm/pstl_backends/cpu_backends/thread.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h
+ - __algorithm/pstl_backends/cpu_backends/transform.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform.h
+ - __algorithm/pstl_backends/cpu_backends/transform_reduce.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h
+ - __algorithm/pstl_copy.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_copy.h
+ - __algorithm/pstl_count.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_count.h
+ - __algorithm/pstl_fill.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_fill.h
+ - __algorithm/pstl_find.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_find.h
+ - __algorithm/pstl_for_each.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_for_each.h
+ - __algorithm/pstl_frontend_dispatch.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_frontend_dispatch.h
+ - __algorithm/pstl_generate.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_generate.h
+ - __algorithm/pstl_is_partitioned.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_is_partitioned.h
+ - __algorithm/pstl_merge.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_merge.h
+ - __algorithm/pstl_replace.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_replace.h
+ - __algorithm/pstl_sort.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_sort.h
+ - __algorithm/pstl_stable_sort.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_stable_sort.h
+ - __algorithm/pstl_transform.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_transform.h
- __algorithm/push_heap.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/push_heap.h
- __algorithm/ranges_adjacent_find.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_adjacent_find.h
- __algorithm/ranges_all_of.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_all_of.h
@@ -339,6 +379,7 @@
- __algorithm/ranges_sort_heap.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sort_heap.h
- __algorithm/ranges_stable_partition.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_stable_partition.h
- __algorithm/ranges_stable_sort.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_stable_sort.h
+ - __algorithm/ranges_starts_with.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_starts_with.h
- __algorithm/ranges_swap_ranges.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_swap_ranges.h
- __algorithm/ranges_transform.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_transform.h
- __algorithm/ranges_unique.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique.h
@@ -369,9 +410,11 @@
- __algorithm/sift_down.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/sift_down.h
- __algorithm/sort.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/sort.h
- __algorithm/sort_heap.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/sort_heap.h
+ - __algorithm/sort_old.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/sort_old.h
- __algorithm/stable_partition.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/stable_partition.h
- __algorithm/stable_sort.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/stable_sort.h
- __algorithm/swap_ranges.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/swap_ranges.h
+ - __algorithm/three_way_comp_ref_type.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/three_way_comp_ref_type.h
- __algorithm/transform.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/transform.h
- __algorithm/uniform_random_bit_generator_adaptor.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
- __algorithm/unique.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/unique.h
@@ -379,6 +422,20 @@
- __algorithm/unwrap_iter.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h
- __algorithm/unwrap_range.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_range.h
- __algorithm/upper_bound.h: contrib/libs/cxxsupp/libcxx/include/__algorithm/upper_bound.h
+ - __atomic/aliases.h: contrib/libs/cxxsupp/libcxx/include/__atomic/aliases.h
+ - __atomic/atomic.h: contrib/libs/cxxsupp/libcxx/include/__atomic/atomic.h
+ - __atomic/atomic_base.h: contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_base.h
+ - __atomic/atomic_flag.h: contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_flag.h
+ - __atomic/atomic_init.h: contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_init.h
+ - __atomic/atomic_lock_free.h: contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_lock_free.h
+ - __atomic/atomic_sync.h: contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_sync.h
+ - __atomic/check_memory_order.h: contrib/libs/cxxsupp/libcxx/include/__atomic/check_memory_order.h
+ - __atomic/contention_t.h: contrib/libs/cxxsupp/libcxx/include/__atomic/contention_t.h
+ - __atomic/cxx_atomic_impl.h: contrib/libs/cxxsupp/libcxx/include/__atomic/cxx_atomic_impl.h
+ - __atomic/fence.h: contrib/libs/cxxsupp/libcxx/include/__atomic/fence.h
+ - __atomic/is_always_lock_free.h: contrib/libs/cxxsupp/libcxx/include/__atomic/is_always_lock_free.h
+ - __atomic/kill_dependency.h: contrib/libs/cxxsupp/libcxx/include/__atomic/kill_dependency.h
+ - __atomic/memory_order.h: contrib/libs/cxxsupp/libcxx/include/__atomic/memory_order.h
- __bit/bit_cast.h: contrib/libs/cxxsupp/libcxx/include/__bit/bit_cast.h
- __bit/bit_ceil.h: contrib/libs/cxxsupp/libcxx/include/__bit/bit_ceil.h
- __bit/bit_floor.h: contrib/libs/cxxsupp/libcxx/include/__bit/bit_floor.h
@@ -393,11 +450,17 @@
- __bit/popcount.h: contrib/libs/cxxsupp/libcxx/include/__bit/popcount.h
- __bit/rotate.h: contrib/libs/cxxsupp/libcxx/include/__bit/rotate.h
- __charconv/chars_format.h: contrib/libs/cxxsupp/libcxx/include/__charconv/chars_format.h
+ - __charconv/from_chars_integral.h: contrib/libs/cxxsupp/libcxx/include/__charconv/from_chars_integral.h
- __charconv/from_chars_result.h: contrib/libs/cxxsupp/libcxx/include/__charconv/from_chars_result.h
- __charconv/tables.h: contrib/libs/cxxsupp/libcxx/include/__charconv/tables.h
+ - __charconv/to_chars.h: contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars.h
- __charconv/to_chars_base_10.h: contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_base_10.h
+ - __charconv/to_chars_floating_point.h: contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_floating_point.h
+ - __charconv/to_chars_integral.h: contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_integral.h
- __charconv/to_chars_result.h: contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_result.h
+ - __charconv/traits.h: contrib/libs/cxxsupp/libcxx/include/__charconv/traits.h
- __chrono/calendar.h: contrib/libs/cxxsupp/libcxx/include/__chrono/calendar.h
+ - __chrono/concepts.h: contrib/libs/cxxsupp/libcxx/include/__chrono/concepts.h
- __chrono/convert_to_timespec.h: contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_timespec.h
- __chrono/convert_to_tm.h: contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_tm.h
- __chrono/day.h: contrib/libs/cxxsupp/libcxx/include/__chrono/day.h
@@ -456,11 +519,18 @@
- __concepts/semiregular.h: contrib/libs/cxxsupp/libcxx/include/__concepts/semiregular.h
- __concepts/swappable.h: contrib/libs/cxxsupp/libcxx/include/__concepts/swappable.h
- __concepts/totally_ordered.h: contrib/libs/cxxsupp/libcxx/include/__concepts/totally_ordered.h
+ - __condition_variable/condition_variable.h: contrib/libs/cxxsupp/libcxx/include/__condition_variable/condition_variable.h
- __coroutine/coroutine_handle.h: contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_handle.h
- __coroutine/coroutine_traits.h: contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_traits.h
- __coroutine/noop_coroutine_handle.h: contrib/libs/cxxsupp/libcxx/include/__coroutine/noop_coroutine_handle.h
- __coroutine/trivial_awaitables.h: contrib/libs/cxxsupp/libcxx/include/__coroutine/trivial_awaitables.h
- __debug_utils/randomize_range.h: contrib/libs/cxxsupp/libcxx/include/__debug_utils/randomize_range.h
+ - __debug_utils/strict_weak_ordering_check.h: contrib/libs/cxxsupp/libcxx/include/__debug_utils/strict_weak_ordering_check.h
+ - __exception/exception.h: contrib/libs/cxxsupp/libcxx/include/__exception/exception.h
+ - __exception/exception_ptr.h: contrib/libs/cxxsupp/libcxx/include/__exception/exception_ptr.h
+ - __exception/nested_exception.h: contrib/libs/cxxsupp/libcxx/include/__exception/nested_exception.h
+ - __exception/operations.h: contrib/libs/cxxsupp/libcxx/include/__exception/operations.h
+ - __exception/terminate.h: contrib/libs/cxxsupp/libcxx/include/__exception/terminate.h
- __expected/bad_expected_access.h: contrib/libs/cxxsupp/libcxx/include/__expected/bad_expected_access.h
- __expected/expected.h: contrib/libs/cxxsupp/libcxx/include/__expected/expected.h
- __expected/unexpect.h: contrib/libs/cxxsupp/libcxx/include/__expected/unexpect.h
@@ -511,6 +581,8 @@
- __format/range_default_formatter.h: contrib/libs/cxxsupp/libcxx/include/__format/range_default_formatter.h
- __format/range_formatter.h: contrib/libs/cxxsupp/libcxx/include/__format/range_formatter.h
- __format/unicode.h: contrib/libs/cxxsupp/libcxx/include/__format/unicode.h
+ - __format/width_estimation_table.h: contrib/libs/cxxsupp/libcxx/include/__format/width_estimation_table.h
+ - __format/write_escaped.h: contrib/libs/cxxsupp/libcxx/include/__format/write_escaped.h
- __functional/binary_function.h: contrib/libs/cxxsupp/libcxx/include/__functional/binary_function.h
- __functional/binary_negate.h: contrib/libs/cxxsupp/libcxx/include/__functional/binary_negate.h
- __functional/bind.h: contrib/libs/cxxsupp/libcxx/include/__functional/bind.h
@@ -537,14 +609,20 @@
- __functional/reference_wrapper.h: contrib/libs/cxxsupp/libcxx/include/__functional/reference_wrapper.h
- __functional/unary_function.h: contrib/libs/cxxsupp/libcxx/include/__functional/unary_function.h
- __functional/unary_negate.h: contrib/libs/cxxsupp/libcxx/include/__functional/unary_negate.h
- - __functional/unwrap_ref.h: contrib/libs/cxxsupp/libcxx/include/__functional/unwrap_ref.h
- __functional/weak_result_type.h: contrib/libs/cxxsupp/libcxx/include/__functional/weak_result_type.h
- __fwd/array.h: contrib/libs/cxxsupp/libcxx/include/__fwd/array.h
+ - __fwd/fstream.h: contrib/libs/cxxsupp/libcxx/include/__fwd/fstream.h
- __fwd/get.h: contrib/libs/cxxsupp/libcxx/include/__fwd/get.h
- __fwd/hash.h: contrib/libs/cxxsupp/libcxx/include/__fwd/hash.h
+ - __fwd/ios.h: contrib/libs/cxxsupp/libcxx/include/__fwd/ios.h
+ - __fwd/istream.h: contrib/libs/cxxsupp/libcxx/include/__fwd/istream.h
+ - __fwd/mdspan.h: contrib/libs/cxxsupp/libcxx/include/__fwd/mdspan.h
- __fwd/memory_resource.h: contrib/libs/cxxsupp/libcxx/include/__fwd/memory_resource.h
+ - __fwd/ostream.h: contrib/libs/cxxsupp/libcxx/include/__fwd/ostream.h
- __fwd/pair.h: contrib/libs/cxxsupp/libcxx/include/__fwd/pair.h
- __fwd/span.h: contrib/libs/cxxsupp/libcxx/include/__fwd/span.h
+ - __fwd/sstream.h: contrib/libs/cxxsupp/libcxx/include/__fwd/sstream.h
+ - __fwd/streambuf.h: contrib/libs/cxxsupp/libcxx/include/__fwd/streambuf.h
- __fwd/string.h: contrib/libs/cxxsupp/libcxx/include/__fwd/string.h
- __fwd/string_view.h: contrib/libs/cxxsupp/libcxx/include/__fwd/string_view.h
- __fwd/subrange.h: contrib/libs/cxxsupp/libcxx/include/__fwd/subrange.h
@@ -557,6 +635,7 @@
- __iterator/common_iterator.h: contrib/libs/cxxsupp/libcxx/include/__iterator/common_iterator.h
- __iterator/concepts.h: contrib/libs/cxxsupp/libcxx/include/__iterator/concepts.h
- __iterator/counted_iterator.h: contrib/libs/cxxsupp/libcxx/include/__iterator/counted_iterator.h
+ - __iterator/cpp17_iterator_concepts.h: contrib/libs/cxxsupp/libcxx/include/__iterator/cpp17_iterator_concepts.h
- __iterator/data.h: contrib/libs/cxxsupp/libcxx/include/__iterator/data.h
- __iterator/default_sentinel.h: contrib/libs/cxxsupp/libcxx/include/__iterator/default_sentinel.h
- __iterator/distance.h: contrib/libs/cxxsupp/libcxx/include/__iterator/distance.h
@@ -582,6 +661,7 @@
- __iterator/permutable.h: contrib/libs/cxxsupp/libcxx/include/__iterator/permutable.h
- __iterator/prev.h: contrib/libs/cxxsupp/libcxx/include/__iterator/prev.h
- __iterator/projected.h: contrib/libs/cxxsupp/libcxx/include/__iterator/projected.h
+ - __iterator/ranges_iterator_traits.h: contrib/libs/cxxsupp/libcxx/include/__iterator/ranges_iterator_traits.h
- __iterator/readable_traits.h: contrib/libs/cxxsupp/libcxx/include/__iterator/readable_traits.h
- __iterator/reverse_access.h: contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_access.h
- __iterator/reverse_iterator.h: contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h
@@ -590,8 +670,17 @@
- __iterator/sortable.h: contrib/libs/cxxsupp/libcxx/include/__iterator/sortable.h
- __iterator/unreachable_sentinel.h: contrib/libs/cxxsupp/libcxx/include/__iterator/unreachable_sentinel.h
- __iterator/wrap_iter.h: contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h
+ - __locale_dir/locale_base_api/bsd_locale_defaults.h: contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/bsd_locale_defaults.h
+ - __locale_dir/locale_base_api/bsd_locale_fallbacks.h: contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h
+ - __locale_dir/locale_base_api/locale_guard.h: contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/locale_guard.h
+ - __mdspan/default_accessor.h: contrib/libs/cxxsupp/libcxx/include/__mdspan/default_accessor.h
+ - __mdspan/extents.h: contrib/libs/cxxsupp/libcxx/include/__mdspan/extents.h
+ - __mdspan/layout_left.h: contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_left.h
+ - __mdspan/layout_right.h: contrib/libs/cxxsupp/libcxx/include/__mdspan/layout_right.h
+ - __mdspan/mdspan.h: contrib/libs/cxxsupp/libcxx/include/__mdspan/mdspan.h
- __memory/addressof.h: contrib/libs/cxxsupp/libcxx/include/__memory/addressof.h
- __memory/align.h: contrib/libs/cxxsupp/libcxx/include/__memory/align.h
+ - __memory/aligned_alloc.h: contrib/libs/cxxsupp/libcxx/include/__memory/aligned_alloc.h
- __memory/allocate_at_least.h: contrib/libs/cxxsupp/libcxx/include/__memory/allocate_at_least.h
- __memory/allocation_guard.h: contrib/libs/cxxsupp/libcxx/include/__memory/allocation_guard.h
- __memory/allocator.h: contrib/libs/cxxsupp/libcxx/include/__memory/allocator.h
@@ -625,6 +714,10 @@
- __memory_resource/pool_options.h: contrib/libs/cxxsupp/libcxx/include/__memory_resource/pool_options.h
- __memory_resource/synchronized_pool_resource.h: contrib/libs/cxxsupp/libcxx/include/__memory_resource/synchronized_pool_resource.h
- __memory_resource/unsynchronized_pool_resource.h: contrib/libs/cxxsupp/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
+ - __mutex/lock_guard.h: contrib/libs/cxxsupp/libcxx/include/__mutex/lock_guard.h
+ - __mutex/mutex.h: contrib/libs/cxxsupp/libcxx/include/__mutex/mutex.h
+ - __mutex/tag_types.h: contrib/libs/cxxsupp/libcxx/include/__mutex/tag_types.h
+ - __mutex/unique_lock.h: contrib/libs/cxxsupp/libcxx/include/__mutex/unique_lock.h
- __numeric/accumulate.h: contrib/libs/cxxsupp/libcxx/include/__numeric/accumulate.h
- __numeric/adjacent_difference.h: contrib/libs/cxxsupp/libcxx/include/__numeric/adjacent_difference.h
- __numeric/exclusive_scan.h: contrib/libs/cxxsupp/libcxx/include/__numeric/exclusive_scan.h
@@ -634,10 +727,43 @@
- __numeric/iota.h: contrib/libs/cxxsupp/libcxx/include/__numeric/iota.h
- __numeric/midpoint.h: contrib/libs/cxxsupp/libcxx/include/__numeric/midpoint.h
- __numeric/partial_sum.h: contrib/libs/cxxsupp/libcxx/include/__numeric/partial_sum.h
+ - __numeric/pstl_reduce.h: contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_reduce.h
+ - __numeric/pstl_transform_reduce.h: contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_transform_reduce.h
- __numeric/reduce.h: contrib/libs/cxxsupp/libcxx/include/__numeric/reduce.h
- __numeric/transform_exclusive_scan.h: contrib/libs/cxxsupp/libcxx/include/__numeric/transform_exclusive_scan.h
- __numeric/transform_inclusive_scan.h: contrib/libs/cxxsupp/libcxx/include/__numeric/transform_inclusive_scan.h
- __numeric/transform_reduce.h: contrib/libs/cxxsupp/libcxx/include/__numeric/transform_reduce.h
+ - __pstl/internal/algorithm_fwd.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/algorithm_fwd.h
+ - __pstl/internal/algorithm_impl.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/algorithm_impl.h
+ - __pstl/internal/execution_defs.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/execution_defs.h
+ - __pstl/internal/execution_impl.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/execution_impl.h
+ - __pstl/internal/glue_algorithm_defs.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/glue_algorithm_defs.h
+ - __pstl/internal/glue_algorithm_impl.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/glue_algorithm_impl.h
+ - __pstl/internal/glue_memory_defs.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/glue_memory_defs.h
+ - __pstl/internal/glue_memory_impl.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/glue_memory_impl.h
+ - __pstl/internal/glue_numeric_defs.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/glue_numeric_defs.h
+ - __pstl/internal/glue_numeric_impl.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/glue_numeric_impl.h
+ - __pstl/internal/memory_impl.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/memory_impl.h
+ - __pstl/internal/numeric_fwd.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/numeric_fwd.h
+ - __pstl/internal/numeric_impl.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/numeric_impl.h
+ - __pstl/internal/omp/parallel_for.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/omp/parallel_for.h
+ - __pstl/internal/omp/parallel_for_each.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/omp/parallel_for_each.h
+ - __pstl/internal/omp/parallel_invoke.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/omp/parallel_invoke.h
+ - __pstl/internal/omp/parallel_merge.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/omp/parallel_merge.h
+ - __pstl/internal/omp/parallel_reduce.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/omp/parallel_reduce.h
+ - __pstl/internal/omp/parallel_scan.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/omp/parallel_scan.h
+ - __pstl/internal/omp/parallel_stable_partial_sort.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/omp/parallel_stable_partial_sort.h
+ - __pstl/internal/omp/parallel_stable_sort.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/omp/parallel_stable_sort.h
+ - __pstl/internal/omp/parallel_transform_reduce.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/omp/parallel_transform_reduce.h
+ - __pstl/internal/omp/parallel_transform_scan.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/omp/parallel_transform_scan.h
+ - __pstl/internal/omp/util.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/omp/util.h
+ - __pstl/internal/parallel_backend.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/parallel_backend.h
+ - __pstl/internal/parallel_backend_omp.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/parallel_backend_omp.h
+ - __pstl/internal/parallel_backend_serial.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/parallel_backend_serial.h
+ - __pstl/internal/parallel_backend_tbb.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/parallel_backend_tbb.h
+ - __pstl/internal/parallel_backend_utils.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/parallel_backend_utils.h
+ - __pstl/internal/unseq_backend_simd.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/unseq_backend_simd.h
+ - __pstl/internal/utils.h: contrib/libs/cxxsupp/libcxx/include/__pstl/internal/utils.h
- __random/bernoulli_distribution.h: contrib/libs/cxxsupp/libcxx/include/__random/bernoulli_distribution.h
- __random/binomial_distribution.h: contrib/libs/cxxsupp/libcxx/include/__random/binomial_distribution.h
- __random/cauchy_distribution.h: contrib/libs/cxxsupp/libcxx/include/__random/cauchy_distribution.h
@@ -680,7 +806,7 @@
- __ranges/as_rvalue_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/as_rvalue_view.h
- __ranges/common_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h
- __ranges/concepts.h: contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h
- - __ranges/copyable_box.h: contrib/libs/cxxsupp/libcxx/include/__ranges/copyable_box.h
+ - __ranges/container_compatible_range.h: contrib/libs/cxxsupp/libcxx/include/__ranges/container_compatible_range.h
- __ranges/counted.h: contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h
- __ranges/dangling.h: contrib/libs/cxxsupp/libcxx/include/__ranges/dangling.h
- __ranges/data.h: contrib/libs/cxxsupp/libcxx/include/__ranges/data.h
@@ -692,16 +818,19 @@
- __ranges/enable_borrowed_range.h: contrib/libs/cxxsupp/libcxx/include/__ranges/enable_borrowed_range.h
- __ranges/enable_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/enable_view.h
- __ranges/filter_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/filter_view.h
+ - __ranges/from_range.h: contrib/libs/cxxsupp/libcxx/include/__ranges/from_range.h
- __ranges/iota_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h
- __ranges/istream_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/istream_view.h
- __ranges/join_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/join_view.h
- __ranges/lazy_split_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h
+ - __ranges/movable_box.h: contrib/libs/cxxsupp/libcxx/include/__ranges/movable_box.h
- __ranges/non_propagating_cache.h: contrib/libs/cxxsupp/libcxx/include/__ranges/non_propagating_cache.h
- __ranges/owning_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/owning_view.h
- __ranges/range_adaptor.h: contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h
- __ranges/rbegin.h: contrib/libs/cxxsupp/libcxx/include/__ranges/rbegin.h
- __ranges/ref_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h
- __ranges/rend.h: contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h
+ - __ranges/repeat_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/repeat_view.h
- __ranges/reverse_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h
- __ranges/single_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/single_view.h
- __ranges/size.h: contrib/libs/cxxsupp/libcxx/include/__ranges/size.h
@@ -709,11 +838,20 @@
- __ranges/subrange.h: contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h
- __ranges/take_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h
- __ranges/take_while_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/take_while_view.h
+ - __ranges/to.h: contrib/libs/cxxsupp/libcxx/include/__ranges/to.h
- __ranges/transform_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/transform_view.h
- __ranges/view_interface.h: contrib/libs/cxxsupp/libcxx/include/__ranges/view_interface.h
- __ranges/views.h: contrib/libs/cxxsupp/libcxx/include/__ranges/views.h
- __ranges/zip_view.h: contrib/libs/cxxsupp/libcxx/include/__ranges/zip_view.h
+ - __stop_token/atomic_unique_lock.h: contrib/libs/cxxsupp/libcxx/include/__stop_token/atomic_unique_lock.h
+ - __stop_token/intrusive_list_view.h: contrib/libs/cxxsupp/libcxx/include/__stop_token/intrusive_list_view.h
+ - __stop_token/intrusive_shared_ptr.h: contrib/libs/cxxsupp/libcxx/include/__stop_token/intrusive_shared_ptr.h
+ - __stop_token/stop_callback.h: contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_callback.h
+ - __stop_token/stop_source.h: contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_source.h
+ - __stop_token/stop_state.h: contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_state.h
+ - __stop_token/stop_token.h: contrib/libs/cxxsupp/libcxx/include/__stop_token/stop_token.h
- __string/char_traits.h: contrib/libs/cxxsupp/libcxx/include/__string/char_traits.h
+ - __string/constexpr_c_functions.h: contrib/libs/cxxsupp/libcxx/include/__string/constexpr_c_functions.h
- __string/extern_template_lists.h: contrib/libs/cxxsupp/libcxx/include/__string/extern_template_lists.h
- __support/android/locale_bionic.h: contrib/libs/cxxsupp/libcxx/include/__support/android/locale_bionic.h
- __support/fuchsia/xlocale.h: contrib/libs/cxxsupp/libcxx/include/__support/fuchsia/xlocale.h
@@ -724,26 +862,31 @@
- __support/musl/xlocale.h: contrib/libs/cxxsupp/libcxx/include/__support/musl/xlocale.h
- __support/newlib/xlocale.h: contrib/libs/cxxsupp/libcxx/include/__support/newlib/xlocale.h
- __support/openbsd/xlocale.h: contrib/libs/cxxsupp/libcxx/include/__support/openbsd/xlocale.h
- - __support/solaris/floatingpoint.h: contrib/libs/cxxsupp/libcxx/include/__support/solaris/floatingpoint.h
- - __support/solaris/wchar.h: contrib/libs/cxxsupp/libcxx/include/__support/solaris/wchar.h
- - __support/solaris/xlocale.h: contrib/libs/cxxsupp/libcxx/include/__support/solaris/xlocale.h
- __support/win32/atomic_win32.h: contrib/libs/cxxsupp/libcxx/include/__support/win32/atomic_win32.h
- __support/win32/locale_win32.h: contrib/libs/cxxsupp/libcxx/include/__support/win32/locale_win32.h
- __support/xlocale/__nop_locale_mgmt.h: contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__nop_locale_mgmt.h
- __support/xlocale/__posix_l_fallback.h: contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__posix_l_fallback.h
- __support/xlocale/__strtonum_fallback.h: contrib/libs/cxxsupp/libcxx/include/__support/xlocale/__strtonum_fallback.h
+ - __system_error/errc.h: contrib/libs/cxxsupp/libcxx/include/__system_error/errc.h
+ - __system_error/error_category.h: contrib/libs/cxxsupp/libcxx/include/__system_error/error_category.h
+ - __system_error/error_code.h: contrib/libs/cxxsupp/libcxx/include/__system_error/error_code.h
+ - __system_error/error_condition.h: contrib/libs/cxxsupp/libcxx/include/__system_error/error_condition.h
+ - __system_error/system_error.h: contrib/libs/cxxsupp/libcxx/include/__system_error/system_error.h
+ - __thread/formatter.h: contrib/libs/cxxsupp/libcxx/include/__thread/formatter.h
+ - __thread/id.h: contrib/libs/cxxsupp/libcxx/include/__thread/id.h
- __thread/poll_with_backoff.h: contrib/libs/cxxsupp/libcxx/include/__thread/poll_with_backoff.h
+ - __thread/this_thread.h: contrib/libs/cxxsupp/libcxx/include/__thread/this_thread.h
+ - __thread/thread.h: contrib/libs/cxxsupp/libcxx/include/__thread/thread.h
- __thread/timed_backoff_policy.h: contrib/libs/cxxsupp/libcxx/include/__thread/timed_backoff_policy.h
- - __tuple_dir/apply_cv.h: contrib/libs/cxxsupp/libcxx/include/__tuple_dir/apply_cv.h
- - __tuple_dir/make_tuple_types.h: contrib/libs/cxxsupp/libcxx/include/__tuple_dir/make_tuple_types.h
- - __tuple_dir/pair_like.h: contrib/libs/cxxsupp/libcxx/include/__tuple_dir/pair_like.h
- - __tuple_dir/sfinae_helpers.h: contrib/libs/cxxsupp/libcxx/include/__tuple_dir/sfinae_helpers.h
- - __tuple_dir/tuple_element.h: contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_element.h
- - __tuple_dir/tuple_indices.h: contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_indices.h
- - __tuple_dir/tuple_like.h: contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_like.h
- - __tuple_dir/tuple_like_ext.h: contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_like_ext.h
- - __tuple_dir/tuple_size.h: contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_size.h
- - __tuple_dir/tuple_types.h: contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_types.h
+ - __tuple/make_tuple_types.h: contrib/libs/cxxsupp/libcxx/include/__tuple/make_tuple_types.h
+ - __tuple/pair_like.h: contrib/libs/cxxsupp/libcxx/include/__tuple/pair_like.h
+ - __tuple/sfinae_helpers.h: contrib/libs/cxxsupp/libcxx/include/__tuple/sfinae_helpers.h
+ - __tuple/tuple_element.h: contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_element.h
+ - __tuple/tuple_indices.h: contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_indices.h
+ - __tuple/tuple_like.h: contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_like.h
+ - __tuple/tuple_like_ext.h: contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_like_ext.h
+ - __tuple/tuple_size.h: contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_size.h
+ - __tuple/tuple_types.h: contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_types.h
- __type_traits/add_const.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/add_const.h
- __type_traits/add_cv.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/add_cv.h
- __type_traits/add_lvalue_reference.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/add_lvalue_reference.h
@@ -761,6 +904,7 @@
- __type_traits/conjunction.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/conjunction.h
- __type_traits/copy_cv.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cv.h
- __type_traits/copy_cvref.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cvref.h
+ - __type_traits/datasizeof.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/datasizeof.h
- __type_traits/decay.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/decay.h
- __type_traits/dependent_type.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/dependent_type.h
- __type_traits/disjunction.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/disjunction.h
@@ -769,6 +913,7 @@
- __type_traits/has_unique_object_representation.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/has_unique_object_representation.h
- __type_traits/has_virtual_destructor.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/has_virtual_destructor.h
- __type_traits/integral_constant.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/integral_constant.h
+ - __type_traits/invoke.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/invoke.h
- __type_traits/is_abstract.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_abstract.h
- __type_traits/is_aggregate.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_aggregate.h
- __type_traits/is_allocator.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_allocator.h
@@ -793,6 +938,8 @@
- __type_traits/is_destructible.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_destructible.h
- __type_traits/is_empty.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_empty.h
- __type_traits/is_enum.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_enum.h
+ - __type_traits/is_equality_comparable.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_equality_comparable.h
+ - __type_traits/is_execution_policy.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_execution_policy.h
- __type_traits/is_final.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_final.h
- __type_traits/is_floating_point.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_floating_point.h
- __type_traits/is_function.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_function.h
@@ -839,6 +986,7 @@
- __type_traits/is_trivially_copyable.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copyable.h
- __type_traits/is_trivially_default_constructible.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_default_constructible.h
- __type_traits/is_trivially_destructible.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_destructible.h
+ - __type_traits/is_trivially_lexicographically_comparable.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_lexicographically_comparable.h
- __type_traits/is_trivially_move_assignable.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_move_assignable.h
- __type_traits/is_trivially_move_constructible.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_move_constructible.h
- __type_traits/is_unbounded_array.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unbounded_array.h
@@ -857,6 +1005,8 @@
- __type_traits/nat.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/nat.h
- __type_traits/negation.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/negation.h
- __type_traits/noexcept_move_assign_container.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/noexcept_move_assign_container.h
+ - __type_traits/operation_traits.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/operation_traits.h
+ - __type_traits/predicate_traits.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/predicate_traits.h
- __type_traits/promote.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/promote.h
- __type_traits/rank.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/rank.h
- __type_traits/remove_all_extents.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_all_extents.h
@@ -873,6 +1023,7 @@
- __type_traits/type_identity.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/type_identity.h
- __type_traits/type_list.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/type_list.h
- __type_traits/underlying_type.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/underlying_type.h
+ - __type_traits/unwrap_ref.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/unwrap_ref.h
- __type_traits/void_t.h: contrib/libs/cxxsupp/libcxx/include/__type_traits/void_t.h
- __utility/as_const.h: contrib/libs/cxxsupp/libcxx/include/__utility/as_const.h
- __utility/auto_cast.h: contrib/libs/cxxsupp/libcxx/include/__utility/auto_cast.h
@@ -885,12 +1036,14 @@
- __utility/forward_like.h: contrib/libs/cxxsupp/libcxx/include/__utility/forward_like.h
- __utility/in_place.h: contrib/libs/cxxsupp/libcxx/include/__utility/in_place.h
- __utility/integer_sequence.h: contrib/libs/cxxsupp/libcxx/include/__utility/integer_sequence.h
+ - __utility/is_pointer_in_range.h: contrib/libs/cxxsupp/libcxx/include/__utility/is_pointer_in_range.h
- __utility/move.h: contrib/libs/cxxsupp/libcxx/include/__utility/move.h
- __utility/pair.h: contrib/libs/cxxsupp/libcxx/include/__utility/pair.h
- __utility/piecewise_construct.h: contrib/libs/cxxsupp/libcxx/include/__utility/piecewise_construct.h
- __utility/priority_tag.h: contrib/libs/cxxsupp/libcxx/include/__utility/priority_tag.h
- __utility/rel_ops.h: contrib/libs/cxxsupp/libcxx/include/__utility/rel_ops.h
- __utility/swap.h: contrib/libs/cxxsupp/libcxx/include/__utility/swap.h
+ - __utility/terminate_on_exception.h: contrib/libs/cxxsupp/libcxx/include/__utility/terminate_on_exception.h
- __utility/to_underlying.h: contrib/libs/cxxsupp/libcxx/include/__utility/to_underlying.h
- __utility/unreachable.h: contrib/libs/cxxsupp/libcxx/include/__utility/unreachable.h
- __variant/monostate.h: contrib/libs/cxxsupp/libcxx/include/__variant/monostate.h
diff --git a/build/sysincl/stl-to-libcxxmsvc.yml b/build/sysincl/stl-to-libcxxmsvc.yml
index 774ff5e1212..4d86c734198 100644
--- a/build/sysincl/stl-to-libcxxmsvc.yml
+++ b/build/sysincl/stl-to-libcxxmsvc.yml
@@ -39,6 +39,7 @@
- any: contrib/libs/cxxsupp/libcxxmsvc/include/any
- array: contrib/libs/cxxsupp/libcxxmsvc/include/array
- atomic: contrib/libs/cxxsupp/libcxxmsvc/include/atomic
+ - barrier: contrib/libs/cxxsupp/libcxxmsvc/include/barrier
- bit: contrib/libs/cxxsupp/libcxxmsvc/include/bit
- bitset: contrib/libs/cxxsupp/libcxxmsvc/include/bitset
- cassert: contrib/libs/cxxsupp/libcxxmsvc/include/cassert
@@ -75,7 +76,9 @@
- cwctype: contrib/libs/cxxsupp/libcxxmsvc/include/cwctype
- deque: contrib/libs/cxxsupp/libcxxmsvc/include/deque
- exception: contrib/libs/cxxsupp/libcxxmsvc/include/exception
+ - execution: contrib/libs/cxxsupp/libcxxmsvc/include/execution
- filesystem: contrib/libs/cxxsupp/libcxxmsvc/include/filesystem
+ - format: contrib/libs/cxxsupp/libcxxmsvc/include/format
- forward_list: contrib/libs/cxxsupp/libcxxmsvc/include/forward_list
- fstream: contrib/libs/cxxsupp/libcxxmsvc/include/fstream
- functional: contrib/libs/cxxsupp/libcxxmsvc/include/functional
diff --git a/build/sysincl/unsorted.yml b/build/sysincl/unsorted.yml
index eebe6ce834a..2d7a55df9a3 100644
--- a/build/sysincl/unsorted.yml
+++ b/build/sysincl/unsorted.yml
@@ -50,10 +50,7 @@
- fsio.h
- fwriteerror.h
- gdbm.h
- - ghostscript/iapi.h
- - ghostscript/ierrors.h
- gmp.h
- - gnutls/x509.h
- hp-timing.h
- httpd_wrap.h
- i86.h
@@ -104,8 +101,6 @@
- nonblocking.h
- note.h
- opcdef.h
- - os2def.h
- - oslib/osfscontrol.h
- paper.h
- pire/config.h
- pngusr.h
@@ -308,37 +303,9 @@
- perl.h
- XSUB.h
#endif
- #if defined(_OS2_)
- - os2.h
- #endif
#if defined(_arm_)
- arm/limits.h
#endif
- #if defined(_VMS_) && TODO
- - atrdef.h
- - dcdef.h
- - descrip.h
- - dvsdef.h
- - fab.h
- - fibdef.h
- - gen64def.h
- - iledef.h
- - iodef.h
- - lib$routines.h
- - libfildef.h
- - libfisdef.h
- - lnmdef.h
- - nam.h
- - rms.h
- - rmsdef.h
- - ssdef.h
- - starlet.h
- - str$routines.h
- - stsdef.h
- - syidef.h
- - times.h
- - unixio.h
- #endif
#if defined(_SOLARIS_) && TODO
- synch.h
- sys/byteorder.h
@@ -374,7 +341,6 @@
#endif
#if defined(_TRASH_) && TODO
- gcrypt.h
- - gnutls/gnutls.h
- gdwmfapi.h
- winmmap.h
- sf_unistd.h
@@ -393,9 +359,6 @@
- sys/systemcfg.h
- sys/thread.h
#endif
- - iostream.h
- - streambuf.h
- - ostream.h
- nacl/nacl_random.h
- jemalloc/jemalloc.h
- sys/inttypes.h
diff --git a/build/sysincl/stl-to-microsoft-stl-UNUSED.yml b/build/sysincl/unused/stl-to-microsoft-stl.yml
index 2a6f486e253..2a6f486e253 100644
--- a/build/sysincl/stl-to-microsoft-stl-UNUSED.yml
+++ b/build/sysincl/unused/stl-to-microsoft-stl.yml
diff --git a/build/sysincl/unused/vms.yml b/build/sysincl/unused/vms.yml
new file mode 100644
index 00000000000..9f328b5593c
--- /dev/null
+++ b/build/sysincl/unused/vms.yml
@@ -0,0 +1,24 @@
+- includes:
+ - atrdef.h
+ - dcdef.h
+ - descrip.h
+ - dvsdef.h
+ - fab.h
+ - fibdef.h
+ - gen64def.h
+ - iledef.h
+ - iodef.h
+ - lib$routines.h
+ - libfildef.h
+ - libfisdef.h
+ - lnmdef.h
+ - nam.h
+ - rms.h
+ - rmsdef.h
+ - ssdef.h
+ - starlet.h
+ - str$routines.h
+ - stsdef.h
+ - syidef.h
+ - times.h
+ - unixio.h
diff --git a/build/sysincl/unused/vxworks.yml b/build/sysincl/unused/vxworks.yml
new file mode 100644
index 00000000000..ea694ddf0ce
--- /dev/null
+++ b/build/sysincl/unused/vxworks.yml
@@ -0,0 +1,16 @@
+- includes:
+ - hostLib.h
+ - ioLib.h
+ - iosLib.h
+ - pipeDrv.h
+ - resolvLib.h
+ - rtpLib.h
+ - selectLib.h
+ - semLib.h
+ - sockLib.h
+ - sockLib.h
+ - sysLib.h
+ - taskLib.h
+ - tickLib.h
+ - vxCpuLib.h
+ - vxWorks.h
diff --git a/build/ya.conf.json b/build/ya.conf.json
index 7473b7c2288..14b62d870f2 100644
--- a/build/ya.conf.json
+++ b/build/ya.conf.json
@@ -41,6 +41,14 @@
}
}
},
+ "bloat": {
+ "executable": {
+ "bloat": [
+ "bloat"
+ ]
+ },
+ "formula": "build/external_resources/bloat/resources.json"
+ },
"clang-format": {
"executable": {
"clang-format": [
@@ -319,6 +327,28 @@
}
}
},
+ "bloat": {
+ "platforms": [
+ {
+ "default": true,
+ "host": {
+ "os": "LINUX"
+ }
+ },
+ {
+ "default": true,
+ "host": {
+ "os": "DARWIN"
+ }
+ }
+ ],
+ "tools": {
+ "bloat": {
+ "bottle": "bloat",
+ "executable": "bloat"
+ }
+ }
+ },
"clang-format": {
"platforms": [
{
@@ -1932,6 +1962,10 @@
"black": {
"description": "Python styler, Python 3 only"
},
+ "bloat": {
+ "description": "Run bloat tool",
+ "visible": false
+ },
"c++": {
"description": "Run C++ compiler"
},
diff --git a/build/ymake.core.conf b/build/ymake.core.conf
index f55ace28a17..ebdbf4c01b4 100644
--- a/build/ymake.core.conf
+++ b/build/ymake.core.conf
@@ -45,6 +45,17 @@ FALSE=no
MODULE_PREFIX=
MODULE_SUFFIX=
+# tag:src-processing tag:internal
+### @usage: _SRC(Ext Src Flags) # internal
+###
+### Basic building block of extension-based command dispatching
+### To enable specific extension processing define _SRC() macro with fixed first argument (Ext).
+### Internal logic will apply this macro to all files with this Ext listed in SRC/SRCS macros or outputs
+### of other commands (except ones marked as noauto)
+macro _SRC(EXT, SRC, SRCFLAGS...) {
+ # Generic macro definition for _SRC (just a placeholder, it does nothing)
+}
+
CLANG_VER=14
when ($CLANG16 == "yes") {
CLANG_VER=16
@@ -80,6 +91,10 @@ when ($USE_PYTHON) {
}
__COMMA__=${comma:""}
+__BSDQ__=\"
+when ($STRUCT_CMD == "yes") {
+ __BSDQ__=\\\"
+}
ARCADIA_TEST_ROOT=../arcadia_tests_data/
DEFAULT_REQUIREMENTS=network:restricted cpu:1 ram:32
@@ -370,9 +385,6 @@ when ($OS_LINUX == "yes") {
when ($GCC) {
# tcmalloc broken build
}
- elsewhen ($SANDBOXING) {
- # broken
- }
elsewhen ($ARCH_X86_64) {
DEFAULT_ALLOCATOR=TCMALLOC_TC
}
@@ -549,9 +561,9 @@ module GEN_LIBRARY: _BARE_UNIT {
### The base of all LIBRARY/PROGRAM modules describing common logic for all modules.
### To avoid surprises, all buildable modules are better to be inherited from it or its descendants.
module _BASE_UNIT: _BARE_UNIT {
- .GLOBAL=_FBS_NAMESPACE_MAP
+ .GLOBAL=_FBS_NAMESPACE_MAP _SBOM_INFO
- PEERDIR_TAGS=CPP_PROTO CPP_FBS H_IDL PY2 PY2_NATIVE YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB
+ PEERDIR_TAGS=CPP_PROTO CPP_FBS CPP_ROSMSG H_IDL PY2 PY2_NATIVE YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB
CPP_PROTO_CMDLINE=${cwd;rootdir;input:File} $PROTOC -I=./$PROTO_NAMESPACE -I=$ARCADIA_ROOT/$PROTO_NAMESPACE ${pre=-I=:_PROTO__INCLUDE} -I=$ARCADIA_BUILD_ROOT -I=$PROTOBUF_PATH --cpp_out=${CPP_PROTO_PLUGINS}$ARCADIA_BUILD_ROOT/$PROTO_NAMESPACE $_PROTOC_FLAGS $PROTOC_STYLEGUIDE_OUT $PROTOC_PLUGIN_STYLEGUIDE ${input;rootrel:File} ${hide:PROTO_FAKEID}
CPP_PROTO_OUTS+=${hide;output;norel;nopath;noext:File.pb.cc} ${output;main;hide;norel;nopath;noext:File.pb.h}
@@ -717,6 +729,12 @@ module _BASE_UNIT: _BARE_UNIT {
PEERDIR+=contrib/libs/musl/include
}
+ when ($OS_EMSCRIPTEN == "yes") {
+ when ($NOLIBC != "yes") {
+ PEERDIR+=contrib/restricted/emscripten/include
+ }
+ }
+
# g++ has proxy C-headers which are incompatible with libc++ proxy C-headers.
# The same problem exists for clang toolchain. On the other hand, the problem
# doesn't affect cl since it has united C/C++ library and doesn't need
@@ -1898,7 +1916,7 @@ module RESOURCES_LIBRARY: _BARE_UNIT {
.EXTS=.o .obj .a .mf .supp .tidyjson .ld .lib
.GLOBAL=USER_CFLAGS USER_CXXFLAGS USER_CONLYFLAGS LDFLAGS _WHOLE_ARCHIVE_LIBS_VALUE RPATH OBJADDE_LIB
-
+
SET(MODULE_TAG RESOURCE_LIB)
SET(PEERDIR_TAGS RESOURCE_LIB)
@@ -2934,17 +2952,6 @@ macro _ADD_EXTRA_FLAGS(COMPILE_OUT_SUFFIX="", Args...) {
_EMPTY_CMD=
-# tag:src-processing tag:internal
-### @usage: _SRC(Ext Src Flags) # internal
-###
-### Basic building block of extension-based command dispatching
-### To enable specific extension processing define _SRC() macro with fixed first argument (Ext).
-### Internal logic will apply this macro to all files with this Ext listed in SRC/SRCS macros or outputs
-### of other commands (except ones marked as noauto)
-macro _SRC(EXT, SRC, SRCFLAGS...) {
- # Generic macro definition for _SRC (just a placeholder, it does nothing)
-}
-
# tag:src-processing
macro _SRC("swg", SRC, SRCFLAGS...) {
.CMD=${_SWIG_CMD}
@@ -3189,7 +3196,7 @@ when ($IDE_MSVS_CALL == "yes") {
NVCC_CFLAGS+=/Fd$(TEMP)
}
-NVCC_STD_VER=14
+NVCC_STD_VER=17
when ($MSVC == "yes") {
NVCC_STD=/std:c++${NVCC_STD_VER}
}
@@ -4099,6 +4106,7 @@ macro NO_RUNTIME() {
macro NO_LIBC() {
NO_RUNTIME()
DISABLE(MUSL)
+ ENABLE(NOLIBC)
}
### @usage: NO_PLATFORM()
@@ -4261,11 +4269,12 @@ macro NEED_REVIEW(Flags...) {
ENABLE(UNUSED_MACRO)
}
+MODVER=unknown
### @usage: VERSION(Args...)
###
### Specify version of a module. Currently unused by build system, only informative.
macro VERSION(Flags...) {
- ENABLE(UNUSED_MACRO)
+ SET(MODVER ${Flags})
}
DATAWORK_SCHEEME_EXPORT_FLAGS=
@@ -4910,7 +4919,7 @@ macro WHOLE_ARCHIVE(PEERS...) {
ANDROID_SDK_ROOT=${ANDROID_SDK_RESOURCE_GLOBAL}/android_sdk
macro TASKLET() {
- PEERDIR(tasklet/api)
+ PEERDIR(tasklet/v1/api)
# CPP
CPP_PROTO_PLUGIN(tasklet_cpp tasklet/v1/gen/cpp .tasklet.h)
@@ -5421,6 +5430,11 @@ macro _SRC("xib", SRC, SRCFLAGS...) {
.CMD=$IBTOOL_PATH $STORYBOARD_FLAGS --module $REALPRJNAME --output-partial-info-plist ${output;suf=.partial_plist:SRC} --compile ${output;tobindir;nopath;noext;suf=.nib:SRC} ${input:SRC}
}
+# tag:src-processing
+macro _SRC("msg", SRC, SRCFLAGS...) {
+ .CMD=$ROSMSG_CMD($SRC)
+}
+
ACTOOL_PATH=$XCODE_TOOLS_ROOT_RESOURCE_GLOBAL/Xcode/Contents/Developer/usr/bin/ibtool
# tag:ios-specific
ASSETS_FLAGS=--output-format human-readable-text --notices --warnings
diff --git a/build/ymake_conf.py b/build/ymake_conf.py
index 98a75598074..0a2d86a4168 100755
--- a/build/ymake_conf.py
+++ b/build/ymake_conf.py
@@ -70,6 +70,7 @@ class Platform(object):
self.is_arm = self.is_armv7 or self.is_armv8 or self.is_armv8m or self.is_armv7em
self.is_armv7_neon = self.arch in ('armv7a_neon', 'armv7ahf', 'armv7a_cortex_a9', 'armv7ahf_cortex_a35', 'armv7ahf_cortex_a53')
self.is_armv7hf = self.arch in ('armv7ahf', 'armv7ahf_cortex_a35', 'armv7ahf_cortex_a53')
+ self.is_armv5te = self.arch in ('armv5te_arm968e_s')
self.is_rv32imc = self.arch in ('riscv32_esp',)
self.is_riscv32 = self.is_rv32imc
@@ -93,6 +94,7 @@ class Platform(object):
self.is_cortex_m23 = self.arch in ('armv8m_cortex_m23',)
self.is_cortex_m4 = self.arch in ('armv7em_cortex_m4',)
self.is_cortex_m7 = self.arch in ('armv7em_cortex_m7')
+ self.is_arm968e_s = self.arch in ('armv5te_arm968e_s')
self.is_power8le = self.arch == 'ppc64le'
self.is_power9le = self.arch == 'power9le'
@@ -101,7 +103,7 @@ class Platform(object):
self.is_wasm64 = self.arch == 'wasm64'
self.is_wasm = self.is_wasm64
- self.is_32_bit = self.is_x86 or self.is_armv7 or self.is_armv8m or self.is_riscv32 or self.is_nds32 or self.is_armv7em or self.is_xtensa or self.is_tc32
+ self.is_32_bit = self.is_x86 or self.is_armv5te or self.is_armv7 or self.is_armv8m or self.is_riscv32 or self.is_nds32 or self.is_armv7em or self.is_xtensa or self.is_tc32
self.is_64_bit = self.is_x86_64 or self.is_armv8 or self.is_powerpc or self.is_wasm64
assert self.is_32_bit or self.is_64_bit
@@ -176,6 +178,7 @@ class Platform(object):
(self.is_armv8, 'ARCH_ARM64'),
(self.is_armv8m, 'ARCH_ARM8M'),
(self.is_armv7em, 'ARCH_ARM7EM'),
+ (self.is_armv5te, 'ARCH_ARM5TE'),
(self.is_arm, 'ARCH_ARM'),
(self.is_linux_armv8 or self.is_macos_arm64, 'ARCH_AARCH64'),
(self.is_powerpc, 'ARCH_PPC64LE'),
@@ -1242,7 +1245,10 @@ class GnuToolchain(Toolchain):
elif target.is_armv7_neon:
self.c_flags_platform.append('-mfpu=neon')
- if (target.is_armv7 or target.is_armv8m or target.is_armv7em) and build.is_size_optimized:
+ elif target.is_arm968e_s:
+ self.c_flags_platform.append('-march=armv5te -mcpu=arm968e-s -mthumb-interwork -mlittle-endian')
+
+ if (target.is_armv7 or target.is_armv8m or target.is_armv7em or target.is_armv5te) and build.is_size_optimized:
# Enable ARM Thumb2 variable-length instruction encoding
# to reduce code size
self.c_flags_platform.append('-mthumb')
@@ -1469,6 +1475,12 @@ class GnuCompiler(Compiler):
if self.target.is_x86_64:
self.c_flags.append('-m64')
+ if self.target.is_wasm64:
+ # WebAssembly-specific exception handling flags
+ self.c_foptions += [
+ '-fwasm-exceptions',
+ ]
+
self.debug_info_flags = ['-g']
if self.target.is_linux:
self.debug_info_flags.append('-ggnu-pubnames')
@@ -2302,6 +2314,8 @@ class Cuda(object):
"--expt-extended-lambda",
# Allow host code to invoke __device__ constexpr functions and vice versa
"--expt-relaxed-constexpr",
+ # Allow to use newer compilers than CUDA Toolkit officially supports
+ "--allow-unsupported-compiler",
]
if not self.have_cuda.value:
@@ -2374,10 +2388,10 @@ class Cuda(object):
if not self.cuda_version.from_user:
return False
- if self.cuda_version.value in ('8.0', '9.0', '9.1', '9.2', '10.0'):
- raise ConfigureError('CUDA versions 8.x, 9.x and 10.0 are no longer supported.\nSee DEVTOOLS-7108.')
+ if self.cuda_version.value in ('8.0', '9.0', '9.1', '9.2', '10.0', '10.1'):
+ raise ConfigureError('CUDA versions 8.x, 9.x and 10.x are no longer supported.\nSee DEVTOOLS-7108 and DTCC-2118.')
- if self.cuda_version.value in ('10.1', '11.0', '11.1', '11.3', '11.4', '11.8', '12.1'):
+ if self.cuda_version.value in ('11.0', '11.1', '11.3', '11.4', '11.8', '12.1'):
return True
return False
diff --git a/contrib/libs/apache/arrow/cpp/src/arrow/util/endian.h b/contrib/libs/apache/arrow/cpp/src/arrow/util/endian.h
index 0cb2e44d275..2c2c415f549 100644
--- a/contrib/libs/apache/arrow/cpp/src/arrow/util/endian.h
+++ b/contrib/libs/apache/arrow/cpp/src/arrow/util/endian.h
@@ -23,7 +23,7 @@
#if defined(__APPLE__) || defined(__FreeBSD__)
#include <machine/endian.h> // IWYU pragma: keep
#elif defined(sun) || defined(__sun)
-#include <sys/byteorder.h> // IWYU pragma: keep
+#error #include <sys/byteorder.h> // IWYU pragma: keep
#else
#include <endian.h> // IWYU pragma: keep
#endif
diff --git a/contrib/libs/clang14-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp b/contrib/libs/clang14-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp
index e16c4e938cb..31818da6282 100644
--- a/contrib/libs/clang14-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp
+++ b/contrib/libs/clang14-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp
@@ -16,7 +16,7 @@
#include "sanitizer_common.h"
#include "sanitizer_procmaps.h"
-#include <procfs.h>
+#error #include <procfs.h>
#include <limits.h>
namespace __sanitizer {
diff --git a/contrib/libs/clang14-rt/lib/sanitizer_common/sanitizer_solaris.cpp b/contrib/libs/clang14-rt/lib/sanitizer_common/sanitizer_solaris.cpp
index 62c40affc9a..d95e5a9500d 100644
--- a/contrib/libs/clang14-rt/lib/sanitizer_common/sanitizer_solaris.cpp
+++ b/contrib/libs/clang14-rt/lib/sanitizer_common/sanitizer_solaris.cpp
@@ -27,7 +27,7 @@
#include <pthread.h>
#include <sched.h>
#include <thread.h>
-#include <synch.h>
+#error #include <synch.h>
#include <signal.h>
#include <sys/mman.h>
#include <sys/resource.h>
diff --git a/contrib/libs/clang14/include/ya.make b/contrib/libs/clang14/include/ya.make
index 19711defc3e..707428781d9 100644
--- a/contrib/libs/clang14/include/ya.make
+++ b/contrib/libs/clang14/include/ya.make
@@ -802,7 +802,7 @@ RUN_PROGRAM(
)
RUN_PROGRAM(
- contrib/tools/python3 contrib/libs/clang14/lib/Tooling/DumpTool/generate_cxx_src_locs.py --json-input-path
+ contrib/tools/python3/bin contrib/libs/clang14/lib/Tooling/DumpTool/generate_cxx_src_locs.py --json-input-path
contrib/libs/clang14/lib/Tooling/ASTNodeAPI.json --output-file clang/Tooling/NodeIntrospection.inc
--use-empty-implementation 0 --empty-implementation
contrib/libs/clang14/lib/Tooling/EmptyNodeIntrospection.inc.in
@@ -856,7 +856,7 @@ RUN_PROGRAM(
)
RUN_PROGRAM(
- contrib/tools/python3 ${ARCADIA_ROOT}/contrib/libs/clang14/include/yamaker_mkdepdir.py
+ contrib/tools/python3/bin ${ARCADIA_ROOT}/contrib/libs/clang14/include/yamaker_mkdepdir.py
${ARCADIA_BUILD_ROOT}/contrib/libs/clang14/lib/Tooling
CWD ${ARCADIA_BUILD_ROOT}/contrib/libs/clang14
OUT_NOAUTO ${ARCADIA_BUILD_ROOT}/contrib/libs/clang14/lib/Tooling/yamaker_mock.dep
diff --git a/contrib/libs/clang16-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp b/contrib/libs/clang16-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp
index eeb49e2afe3..a2fe93566d5 100644
--- a/contrib/libs/clang16-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp
+++ b/contrib/libs/clang16-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp
@@ -15,7 +15,7 @@
#if SANITIZER_SOLARIS
# include <fcntl.h>
# include <limits.h>
-# include <procfs.h>
+# error #include <procfs.h>
# include "sanitizer_common.h"
# include "sanitizer_procmaps.h"
diff --git a/contrib/libs/clang16-rt/lib/sanitizer_common/sanitizer_solaris.cpp b/contrib/libs/clang16-rt/lib/sanitizer_common/sanitizer_solaris.cpp
index 62c40affc9a..d95e5a9500d 100644
--- a/contrib/libs/clang16-rt/lib/sanitizer_common/sanitizer_solaris.cpp
+++ b/contrib/libs/clang16-rt/lib/sanitizer_common/sanitizer_solaris.cpp
@@ -27,7 +27,7 @@
#include <pthread.h>
#include <sched.h>
#include <thread.h>
-#include <synch.h>
+#error #include <synch.h>
#include <signal.h>
#include <sys/mman.h>
#include <sys/resource.h>
diff --git a/contrib/libs/clang16/include/ya.make b/contrib/libs/clang16/include/ya.make
index 5e1b6d8165e..8dd83cf4d7a 100644
--- a/contrib/libs/clang16/include/ya.make
+++ b/contrib/libs/clang16/include/ya.make
@@ -806,9 +806,9 @@ RUN_PROGRAM(
)
RUN_PROGRAM(
- contrib/tools/python3 contrib/libs/clang16/lib/Tooling/DumpTool/generate_cxx_src_locs.py --json-input-path
- contrib/libs/clang16/lib/Tooling/ASTNodeAPI.json --output-file clang/Tooling/NodeIntrospection.inc
- --use-empty-implementation 0 --empty-implementation
+ contrib/tools/python3/bin contrib/libs/clang16/lib/Tooling/DumpTool/generate_cxx_src_locs.py
+ --json-input-path contrib/libs/clang16/lib/Tooling/ASTNodeAPI.json --output-file
+ clang/Tooling/NodeIntrospection.inc --use-empty-implementation 0 --empty-implementation
contrib/libs/clang16/lib/Tooling/EmptyNodeIntrospection.inc.in
CWD ${ARCADIA_BUILD_ROOT}/contrib/libs/clang16/lib/Tooling
IN ${ARCADIA_BUILD_ROOT}/contrib/libs/clang16/lib/Tooling/yamaker_mock.dep
@@ -882,7 +882,7 @@ RUN_PROGRAM(
)
RUN_PROGRAM(
- contrib/tools/python3 ${ARCADIA_ROOT}/contrib/libs/clang16/include/yamaker_mkdepdir.py
+ contrib/tools/python3/bin ${ARCADIA_ROOT}/contrib/libs/clang16/include/yamaker_mkdepdir.py
${ARCADIA_BUILD_ROOT}/contrib/libs/clang16/lib/Tooling
CWD ${ARCADIA_BUILD_ROOT}/contrib/libs/clang16
OUT_NOAUTO ${ARCADIA_BUILD_ROOT}/contrib/libs/clang16/lib/Tooling/yamaker_mock.dep
diff --git a/contrib/libs/curl/lib/cf-socket.c b/contrib/libs/curl/lib/cf-socket.c
index e42b4a87b19..d86dfd7b726 100644
--- a/contrib/libs/curl/lib/cf-socket.c
+++ b/contrib/libs/curl/lib/cf-socket.c
@@ -1244,7 +1244,7 @@ static void cf_socket_adjust_pollset(struct Curl_cfilter *cf,
if(ctx->sock != CURL_SOCKET_BAD) {
if(!cf->connected)
Curl_pollset_set_out_only(data, ps, ctx->sock);
- else
+ else if(CURL_WANT_RECV(data))
Curl_pollset_add_in(data, ps, ctx->sock);
CURL_TRC_CF(data, cf, "adjust_pollset -> %d socks", ps->num);
}
diff --git a/contrib/libs/curl/lib/http2.c b/contrib/libs/curl/lib/http2.c
index fd37d3c8b20..f202b81d0ca 100644
--- a/contrib/libs/curl/lib/http2.c
+++ b/contrib/libs/curl/lib/http2.c
@@ -2341,8 +2341,8 @@ static void cf_h2_adjust_pollset(struct Curl_cfilter *cf,
bool c_exhaust, s_exhaust;
CF_DATA_SAVE(save, cf, data);
- c_exhaust = !nghttp2_session_get_remote_window_size(ctx->h2);
- s_exhaust = stream && stream->id >= 0 &&
+ c_exhaust = want_send && !nghttp2_session_get_remote_window_size(ctx->h2);
+ s_exhaust = want_send && stream && stream->id >= 0 &&
!nghttp2_session_get_stream_remote_window_size(ctx->h2,
stream->id);
want_recv = (want_recv || c_exhaust || s_exhaust);
diff --git a/contrib/libs/curl/lib/vquic/curl_ngtcp2.c b/contrib/libs/curl/lib/vquic/curl_ngtcp2.c
index 4a3ea0b516e..416c8fb3ecb 100644
--- a/contrib/libs/curl/lib/vquic/curl_ngtcp2.c
+++ b/contrib/libs/curl/lib/vquic/curl_ngtcp2.c
@@ -1166,9 +1166,10 @@ static void cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf,
bool c_exhaust, s_exhaust;
CF_DATA_SAVE(save, cf, data);
- c_exhaust = !ngtcp2_conn_get_cwnd_left(ctx->qconn) ||
- !ngtcp2_conn_get_max_data_left(ctx->qconn);
- s_exhaust = stream && stream->id >= 0 && stream->quic_flow_blocked;
+ c_exhaust = want_send && (!ngtcp2_conn_get_cwnd_left(ctx->qconn) ||
+ !ngtcp2_conn_get_max_data_left(ctx->qconn));
+ s_exhaust = want_send && stream && stream->id >= 0 &&
+ stream->quic_flow_blocked;
want_recv = (want_recv || c_exhaust || s_exhaust);
want_send = (!s_exhaust && want_send) ||
!Curl_bufq_is_empty(&ctx->q.sendbuf);
diff --git a/contrib/libs/curl/lib/vquic/curl_quiche.c b/contrib/libs/curl/lib/vquic/curl_quiche.c
index 1fc6e5a86bd..0f603787762 100644
--- a/contrib/libs/curl/lib/vquic/curl_quiche.c
+++ b/contrib/libs/curl/lib/vquic/curl_quiche.c
@@ -1176,7 +1176,7 @@ static void cf_quiche_adjust_pollset(struct Curl_cfilter *cf,
c_exhaust = FALSE; /* Have not found any call in quiche that tells
us if the connection itself is blocked */
- s_exhaust = stream && stream->id >= 0 &&
+ s_exhaust = want_send && stream && stream->id >= 0 &&
(stream->quic_flow_blocked || !stream_is_writeable(cf, data));
want_recv = (want_recv || c_exhaust || s_exhaust);
want_send = (!s_exhaust && want_send) ||
diff --git a/contrib/libs/curl/lib/vtls/gtls.h b/contrib/libs/curl/lib/vtls/gtls.h
index 1a81c01e93b..a1e1729060f 100644
--- a/contrib/libs/curl/lib/vtls/gtls.h
+++ b/contrib/libs/curl/lib/vtls/gtls.h
@@ -29,7 +29,7 @@
#ifdef USE_GNUTLS
-#include <gnutls/gnutls.h>
+#error #include <gnutls/gnutls.h>
#ifdef HAVE_GNUTLS_SRP
/* the function exists */
diff --git a/contrib/libs/cxxsupp/builtins/int_endianness.h b/contrib/libs/cxxsupp/builtins/int_endianness.h
index 7995ddbb953..5aca6d29c13 100644
--- a/contrib/libs/cxxsupp/builtins/int_endianness.h
+++ b/contrib/libs/cxxsupp/builtins/int_endianness.h
@@ -31,7 +31,7 @@
#else /* Compilers other than Clang or GCC. */
#if defined(__SVR4) && defined(__sun)
-#include <sys/byteorder.h>
+#error #include <sys/byteorder.h>
#if defined(_BIG_ENDIAN)
#define _YUGA_LITTLE_ENDIAN 0
diff --git a/contrib/libs/cxxsupp/libcxx/CREDITS.TXT b/contrib/libs/cxxsupp/libcxx/CREDITS.TXT
index cd5bc08a60f..aa3c8cf1a8c 100644
--- a/contrib/libs/cxxsupp/libcxx/CREDITS.TXT
+++ b/contrib/libs/cxxsupp/libcxx/CREDITS.TXT
@@ -92,6 +92,11 @@ E: [email protected]
D: Implemented floating-point to_chars.
+N: Damien Lebrun-Grandie
+D: Implementation of mdspan.
+
N: Microsoft Corporation
D: Contributed floating-point to_chars.
@@ -149,6 +154,10 @@ N: Stephan Tolksdorf
D: Minor <atomic> fix
+N: Christian Trott
+D: Implementation of mdspan.
+
N: Ruben Van Boxem
E: vanboxem dot ruben at gmail dot com
D: Initial Windows patches.
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/adjacent_find.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/adjacent_find.h
index 30df4a976f3..7819e2cf49b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/adjacent_find.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/adjacent_find.h
@@ -20,6 +20,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Iter, class _Sent, class _BinaryPredicate>
@@ -50,4 +53,6 @@ adjacent_find(_ForwardIterator __first, _ForwardIterator __last) {
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ALGORITHM_ADJACENT_FIND_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/all_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/all_of.h
index 284c34ffcda..237f8495c64 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/all_of.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/all_of.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
for (; __first != __last; ++__first)
if (!__pred(*__first))
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/binary_search.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/binary_search.h
index 8f958c2c1ad..0c8f5545e06 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/binary_search.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/binary_search.h
@@ -37,8 +37,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
bool
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
{
- return std::binary_search(__first, __last, __value,
- __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
+ return std::binary_search(__first, __last, __value, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h
index 30ddbdce64a..31deb4fd94a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h
@@ -19,14 +19,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Tp, class _Compare>
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY constexpr
const _Tp&
clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp)
{
- _LIBCPP_ASSERT(!__comp(__hi, __lo), "Bad bounds passed to std::clamp");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__comp(__hi, __lo), "Bad bounds passed to std::clamp");
return __comp(__v, __lo) ? __lo : __comp(__hi, __v) ? __hi : __v;
}
@@ -37,7 +37,7 @@ _LIBCPP_INLINE_VISIBILITY constexpr
const _Tp&
clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi)
{
- return _VSTD::clamp(__v, __lo, __hi, __less<_Tp>());
+ return _VSTD::clamp(__v, __lo, __hi, __less<>());
}
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp.h
index af8eb7b5d76..9474536615f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp.h
@@ -10,6 +10,8 @@
#define _LIBCPP___ALGORITHM_COMP_H
#include <__config>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/predicate_traits.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -24,41 +26,20 @@ struct __equal_to {
}
};
-template <class _T1, class _T2 = _T1>
-struct __less
-{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
- bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
+template <class _Lhs, class _Rhs>
+struct __is_trivial_equality_predicate<__equal_to, _Lhs, _Rhs> : true_type {};
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
- bool operator()(const _T1& __x, const _T2& __y) const {return __x < __y;}
+// The definition is required because __less is part of the ABI, but it's empty
+// because all comparisons should be transparent.
+template <class _T1 = void, class _T2 = _T1>
+struct __less {};
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
- bool operator()(const _T2& __x, const _T1& __y) const {return __x < __y;}
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
- bool operator()(const _T2& __x, const _T2& __y) const {return __x < __y;}
-};
-
-template <class _T1>
-struct __less<_T1, _T1>
-{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
- bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
-};
-
-template <class _T1>
-struct __less<const _T1, _T1>
-{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
- bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
-};
-
-template <class _T1>
-struct __less<_T1, const _T1>
-{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
- bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
+template <>
+struct __less<void, void> {
+ template <class _Tp, class _Up>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _Tp& __lhs, const _Up& __rhs) const {
+ return __lhs < __rhs;
+ }
};
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp_ref_type.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp_ref_type.h
index f2338e14468..d16bd0f5310 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp_ref_type.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/comp_ref_type.h
@@ -9,8 +9,8 @@
#ifndef _LIBCPP___ALGORITHM_COMP_REF_TYPE_H
#define _LIBCPP___ALGORITHM_COMP_REF_TYPE_H
+#include <__assert>
#include <__config>
-#include <__debug>
#include <__utility/declval.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -23,11 +23,10 @@ template <class _Compare>
struct __debug_less
{
_Compare &__comp_;
- _LIBCPP_CONSTEXPR_SINCE_CXX14
- __debug_less(_Compare& __c) : __comp_(__c) {}
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI __debug_less(_Compare& __c) : __comp_(__c) {}
template <class _Tp, class _Up>
- _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI
bool operator()(const _Tp& __x, const _Up& __y)
{
bool __r = __comp_(__x, __y);
@@ -37,7 +36,7 @@ struct __debug_less
}
template <class _Tp, class _Up>
- _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI
bool operator()(_Tp& __x, _Up& __y)
{
bool __r = __comp_(__x, __y);
@@ -52,7 +51,7 @@ struct __debug_less
decltype((void)std::declval<_Compare&>()(
std::declval<_LHS &>(), std::declval<_RHS &>()))
__do_compare_assert(int, _LHS & __l, _RHS & __r) {
- _LIBCPP_DEBUG_ASSERT(!__comp_(__l, __r),
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__comp_(__l, __r),
"Comparator does not induce a strict weak ordering");
(void)__l;
(void)__r;
@@ -66,7 +65,7 @@ struct __debug_less
// Pass the comparator by lvalue reference. Or in debug mode, using a
// debugging wrapper that stores a reference.
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#if _LIBCPP_ENABLE_DEBUG_MODE
template <class _Comp>
using __comp_ref_type = __debug_less<_Comp>;
#else
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy.h
index 193a6df3165..dfe9898c648 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy.h
@@ -10,6 +10,7 @@
#define _LIBCPP___ALGORITHM_COPY_H
#include <__algorithm/copy_move_common.h>
+#include <__algorithm/for_each_segment.h>
#include <__algorithm/iterator_operations.h>
#include <__algorithm/min.h>
#include <__config>
@@ -44,36 +45,34 @@ struct __copy_loop {
return std::make_pair(std::move(__first), std::move(__result));
}
- template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator<_InIter>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
- operator()(_InIter __first, _InIter __last, _OutIter __result) const {
+ template <class _InIter, class _OutIter>
+ struct _CopySegment {
using _Traits = __segmented_iterator_traits<_InIter>;
- auto __sfirst = _Traits::__segment(__first);
- auto __slast = _Traits::__segment(__last);
- if (__sfirst == __slast) {
- auto __iters = std::__copy<_AlgPolicy>(_Traits::__local(__first), _Traits::__local(__last), std::move(__result));
- return std::make_pair(__last, std::move(__iters.second));
- }
- __result = std::__copy<_AlgPolicy>(_Traits::__local(__first), _Traits::__end(__sfirst), std::move(__result)).second;
- ++__sfirst;
- while (__sfirst != __slast) {
- __result =
- std::__copy<_AlgPolicy>(_Traits::__begin(__sfirst), _Traits::__end(__sfirst), std::move(__result)).second;
- ++__sfirst;
+ _OutIter& __result_;
+
+ _LIBCPP_HIDE_FROM_ABI _CopySegment(_OutIter& __result) : __result_(__result) {}
+
+ _LIBCPP_HIDE_FROM_ABI void
+ operator()(typename _Traits::__local_iterator __lfirst, typename _Traits::__local_iterator __llast) {
+ __result_ = std::__copy<_AlgPolicy>(__lfirst, __llast, std::move(__result_)).second;
}
- __result =
- std::__copy<_AlgPolicy>(_Traits::__begin(__sfirst), _Traits::__local(__last), std::move(__result)).second;
+ };
+
+ template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator<_InIter>::value, int> = 0>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
+ operator()(_InIter __first, _InIter __last, _OutIter __result) const {
+ std::__for_each_segment(__first, __last, _CopySegment<_InIter, _OutIter>(__result));
return std::make_pair(__last, std::move(__result));
}
template <class _InIter,
class _OutIter,
- __enable_if_t<__is_cpp17_random_access_iterator<_InIter>::value &&
+ __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&
!__is_segmented_iterator<_InIter>::value && __is_segmented_iterator<_OutIter>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
- operator()(_InIter __first, _InIter __last, _OutIter __result) {
+ operator()(_InIter __first, _InIter __last, _OutIter __result) const {
using _Traits = __segmented_iterator_traits<_OutIter>;
using _DiffT = typename common_type<__iter_diff_t<_InIter>, __iter_diff_t<_OutIter> >::type;
@@ -98,8 +97,7 @@ struct __copy_loop {
struct __copy_trivial {
// At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.
- template <class _In, class _Out,
- __enable_if_t<__can_lower_copy_assignment_to_memmove<_In, _Out>::value, int> = 0>
+ template <class _In, class _Out, __enable_if_t<__can_lower_copy_assignment_to_memmove<_In, _Out>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_In*, _Out*>
operator()(_In* __first, _In* __last, _Out* __result) const {
return std::__copy_trivial_impl(__first, __last, __result);
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_backward.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_backward.h
index bb2a4328781..d85d297b322 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_backward.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_backward.h
@@ -76,11 +76,11 @@ struct __copy_backward_loop {
template <class _InIter,
class _OutIter,
- __enable_if_t<__is_cpp17_random_access_iterator<_InIter>::value &&
+ __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&
!__is_segmented_iterator<_InIter>::value && __is_segmented_iterator<_OutIter>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
- operator()(_InIter __first, _InIter __last, _OutIter __result) {
+ operator()(_InIter __first, _InIter __last, _OutIter __result) const {
using _Traits = __segmented_iterator_traits<_OutIter>;
auto __orig_last = __last;
auto __segment_iterator = _Traits::__segment(__result);
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_move_common.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_move_common.h
index b88c14911b9..c06892e9e3c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_move_common.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_move_common.h
@@ -15,6 +15,7 @@
#include <__config>
#include <__iterator/iterator_traits.h>
#include <__memory/pointer_traits.h>
+#include <__string/constexpr_c_functions.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/is_always_bitcastable.h>
#include <__type_traits/is_constant_evaluated.h>
@@ -61,7 +62,8 @@ template <class _In, class _Out>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_In*, _Out*>
__copy_trivial_impl(_In* __first, _In* __last, _Out* __result) {
const size_t __n = static_cast<size_t>(__last - __first);
- ::__builtin_memmove(__result, __first, __n * sizeof(_Out));
+
+ std::__constexpr_memmove(__result, __first, __element_count(__n));
return std::make_pair(__last, __result + __n);
}
@@ -72,7 +74,7 @@ __copy_backward_trivial_impl(_In* __first, _In* __last, _Out* __result) {
const size_t __n = static_cast<size_t>(__last - __first);
__result -= __n;
- ::__builtin_memmove(__result, __first, __n * sizeof(_Out));
+ std::__constexpr_memmove(__result, __first, __element_count(__n));
return std::make_pair(__last, __result);
}
@@ -119,16 +121,6 @@ __unwrap_and_dispatch(_InIter __first, _Sent __last, _OutIter __out_first) {
return _Algorithm()(std::move(__first), std::move(__last), std::move(__out_first));
}
-template <class _IterOps, class _InValue, class _OutIter, class = void>
-struct __can_copy_without_conversion : false_type {};
-
-template <class _IterOps, class _InValue, class _OutIter>
-struct __can_copy_without_conversion<
- _IterOps,
- _InValue,
- _OutIter,
- __enable_if_t<is_same<_InValue, typename _IterOps::template __value_type<_OutIter> >::value> > : true_type {};
-
template <class _AlgPolicy,
class _NaiveAlgorithm,
class _OptimizedAlgorithm,
@@ -137,23 +129,6 @@ template <class _AlgPolicy,
class _OutIter>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 pair<_InIter, _OutIter>
__dispatch_copy_or_move(_InIter __first, _Sent __last, _OutIter __out_first) {
-#ifdef _LIBCPP_COMPILER_GCC
- // GCC doesn't support `__builtin_memmove` during constant evaluation.
- if (__libcpp_is_constant_evaluated()) {
- return std::__unwrap_and_dispatch<_NaiveAlgorithm>(std::move(__first), std::move(__last), std::move(__out_first));
- }
-#else
- // In Clang, `__builtin_memmove` only supports fully trivially copyable types (just having trivial copy assignment is
- // insufficient). Also, conversions are not supported.
- if (__libcpp_is_constant_evaluated()) {
- using _InValue = typename _IterOps<_AlgPolicy>::template __value_type<_InIter>;
- if (!is_trivially_copyable<_InValue>::value ||
- !__can_copy_without_conversion<_IterOps<_AlgPolicy>, _InValue, _OutIter>::value) {
- return std::__unwrap_and_dispatch<_NaiveAlgorithm>(std::move(__first), std::move(__last), std::move(__out_first));
- }
- }
-#endif // _LIBCPP_COMPILER_GCC
-
using _Algorithm = __overload<_NaiveAlgorithm, _OptimizedAlgorithm>;
return std::__unwrap_and_dispatch<_Algorithm>(std::move(__first), std::move(__last), std::move(__out_first));
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_n.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_n.h
index b08bbdfb9b7..f3701662aac 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_n.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_n.h
@@ -12,8 +12,8 @@
#include <__algorithm/copy.h>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
#include <__utility/convert_to_integral.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -25,8 +25,8 @@ template<class _InputIterator, class _Size, class _OutputIterator>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
typename enable_if
<
- __is_cpp17_input_iterator<_InputIterator>::value &&
- !__is_cpp17_random_access_iterator<_InputIterator>::value,
+ __has_input_iterator_category<_InputIterator>::value &&
+ !__has_random_access_iterator_category<_InputIterator>::value,
_OutputIterator
>::type
copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
@@ -51,7 +51,7 @@ template<class _InputIterator, class _Size, class _OutputIterator>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
typename enable_if
<
- __is_cpp17_random_access_iterator<_InputIterator>::value,
+ __has_random_access_iterator_category<_InputIterator>::value,
_OutputIterator
>::type
copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal.h
index cf37f46aaf6..b69aeff92bb 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal.h
@@ -11,9 +11,20 @@
#define _LIBCPP___ALGORITHM_EQUAL_H
#include <__algorithm/comp.h>
+#include <__algorithm/unwrap_iter.h>
#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
+#include <__string/constexpr_c_functions.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_constant_evaluated.h>
+#include <__type_traits/is_equality_comparable.h>
+#include <__type_traits/is_volatile.h>
+#include <__type_traits/predicate_traits.h>
+#include <__utility/move.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -22,23 +33,42 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
-equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) {
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_iter_impl(
+ _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate& __pred) {
for (; __first1 != __last1; ++__first1, (void)++__first2)
if (!__pred(*__first1, *__first2))
return false;
return true;
}
+template <
+ class _Tp,
+ class _Up,
+ class _BinaryPredicate,
+ __enable_if_t<__is_trivial_equality_predicate<_BinaryPredicate, _Tp, _Up>::value && !is_volatile<_Tp>::value &&
+ !is_volatile<_Up>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
+ int> = 0>
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+__equal_iter_impl(_Tp* __first1, _Tp* __last1, _Up* __first2, _BinaryPredicate&) {
+ return std::__constexpr_memcmp_equal(__first1, __first2, __element_count(__last1 - __first1));
+}
+
+template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) {
+ return std::__equal_iter_impl(
+ std::__unwrap_iter(__first1), std::__unwrap_iter(__last1), std::__unwrap_iter(__first2), __pred);
+}
+
template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) {
return std::equal(__first1, __last1, __first2, __equal_to());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
__equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
_BinaryPredicate __pred, input_iterator_tag, input_iterator_tag) {
for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void)++__first2)
@@ -47,19 +77,52 @@ __equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fir
return __first1 == __last1 && __first2 == __last2;
}
+template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Pred, class _Proj1, class _Proj2>
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_impl(
+ _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Pred& __comp, _Proj1& __proj1, _Proj2& __proj2) {
+ while (__first1 != __last1 && __first2 != __last2) {
+ if (!std::__invoke(__comp, std::__invoke(__proj1, *__first1), std::__invoke(__proj2, *__first2)))
+ return false;
+ ++__first1;
+ ++__first2;
+ }
+ return __first1 == __last1 && __first2 == __last2;
+}
+
+template <class _Tp,
+ class _Up,
+ class _Pred,
+ class _Proj1,
+ class _Proj2,
+ __enable_if_t<__is_trivial_equality_predicate<_Pred, _Tp, _Up>::value && __is_identity<_Proj1>::value &&
+ __is_identity<_Proj2>::value && !is_volatile<_Tp>::value && !is_volatile<_Up>::value &&
+ __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
+ int> = 0>
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_impl(
+ _Tp* __first1, _Tp* __last1, _Up* __first2, _Up*, _Pred&, _Proj1&, _Proj2&) {
+ return std::__constexpr_memcmp_equal(__first1, __first2, __element_count(__last1 - __first1));
+}
+
template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
__equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2,
_RandomAccessIterator2 __last2, _BinaryPredicate __pred, random_access_iterator_tag,
random_access_iterator_tag) {
if (_VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2))
return false;
- return _VSTD::equal<_RandomAccessIterator1, _RandomAccessIterator2,
- _BinaryPredicate&>(__first1, __last1, __first2, __pred);
+ __identity __proj;
+ return std::__equal_impl(
+ std::__unwrap_iter(__first1),
+ std::__unwrap_iter(__last1),
+ std::__unwrap_iter(__first2),
+ std::__unwrap_iter(__last2),
+ __pred,
+ __proj,
+ __proj);
}
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
_BinaryPredicate __pred) {
return _VSTD::__equal<_BinaryPredicate&>(
@@ -68,7 +131,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first
}
template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) {
return std::__equal(
__first1,
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal_range.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal_range.h
index 2075b03412e..dc1268a6ff1 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal_range.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/equal_range.h
@@ -50,7 +50,7 @@ __equal_range(_Iter __first, _Sent __last, const _Tp& __value, _Compare&& __comp
} else {
_Iter __mp1 = __mid;
return pair<_Iter, _Iter>(
- std::__lower_bound_impl<_AlgPolicy>(__first, __mid, __value, __comp, __proj),
+ std::__lower_bound<_AlgPolicy>(__first, __mid, __value, __comp, __proj),
std::__upper_bound<_AlgPolicy>(++__mp1, __end, __value, __comp, __proj));
}
}
@@ -75,11 +75,7 @@ equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu
template <class _ForwardIterator, class _Tp>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_ForwardIterator, _ForwardIterator>
equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
- return std::equal_range(
- std::move(__first),
- std::move(__last),
- __value,
- __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
+ return std::equal_range(std::move(__first), std::move(__last), __value, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/fill.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/fill.h
index 76cf4a1477a..0753c427ae4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/fill.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/fill.h
@@ -12,7 +12,6 @@
#include <__algorithm/fill_n.h>
#include <__config>
#include <__iterator/iterator_traits.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/fill_n.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/fill_n.h
index fe58c8d6417..e7863ac7ec7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/fill_n.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/fill_n.h
@@ -12,7 +12,6 @@
#include <__config>
#include <__iterator/iterator_traits.h>
#include <__utility/convert_to_integral.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find.h
index e51dc9bb160..e0de5032878 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find.h
@@ -10,7 +10,16 @@
#ifndef _LIBCPP___ALGORITHM_FIND_H
#define _LIBCPP___ALGORITHM_FIND_H
+#include <__algorithm/unwrap_iter.h>
#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__string/constexpr_c_functions.h>
+#include <__type_traits/is_same.h>
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+# include <cwchar>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -18,15 +27,51 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _InputIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
-find(_InputIterator __first, _InputIterator __last, const _Tp& __value) {
+template <class _Iter, class _Sent, class _Tp, class _Proj>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Iter
+__find_impl(_Iter __first, _Sent __last, const _Tp& __value, _Proj& __proj) {
for (; __first != __last; ++__first)
- if (*__first == __value)
+ if (std::__invoke(__proj, *__first) == __value)
break;
return __first;
}
+template <class _Tp,
+ class _Up,
+ class _Proj,
+ __enable_if_t<__is_identity<_Proj>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value &&
+ sizeof(_Tp) == 1,
+ int> = 0>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp*
+__find_impl(_Tp* __first, _Tp* __last, const _Up& __value, _Proj&) {
+ if (auto __ret = std::__constexpr_memchr(__first, __value, __last - __first))
+ return __ret;
+ return __last;
+}
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+template <class _Tp,
+ class _Up,
+ class _Proj,
+ __enable_if_t<__is_identity<_Proj>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value &&
+ sizeof(_Tp) == sizeof(wchar_t) && _LIBCPP_ALIGNOF(_Tp) >= _LIBCPP_ALIGNOF(wchar_t),
+ int> = 0>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp*
+__find_impl(_Tp* __first, _Tp* __last, const _Up& __value, _Proj&) {
+ if (auto __ret = std::__constexpr_wmemchr(__first, __value, __last - __first))
+ return __ret;
+ return __last;
+}
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+
+template <class _InputIterator, class _Tp>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
+find(_InputIterator __first, _InputIterator __last, const _Tp& __value) {
+ __identity __proj;
+ return std::__rewrap_iter(
+ __first, std::__find_impl(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __value, __proj));
+}
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___ALGORITHM_FIND_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_end.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_end.h
index e2fee6b3c45..edb9891c66f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_end.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/find_end.h
@@ -15,12 +15,12 @@
#include <__algorithm/search.h>
#include <__config>
#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/advance.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/next.h>
#include <__iterator/reverse_iterator.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/for_each_n.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/for_each_n.h
index 38d204a1181..5bd7318224d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/for_each_n.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/for_each_n.h
@@ -12,7 +12,6 @@
#include <__config>
#include <__utility/convert_to_integral.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -20,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _Size, class _Function>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator for_each_n(_InputIterator __first,
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/for_each_segment.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/for_each_segment.h
new file mode 100644
index 00000000000..93aa8259b2f
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/for_each_segment.h
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_FOR_EACH_SEGMENT_H
+#define _LIBCPP___ALGORITHM_FOR_EACH_SEGMENT_H
+
+#include <__config>
+#include <__iterator/segmented_iterator.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// __for_each_segment is a utility function for optimizing iterating over segmented iterators linearly.
+// __first and __last are expected to be a segmented range. __func is expected to take a range of local iterators.
+// Anything that is returned from __func is ignored.
+
+template <class _SegmentedIterator, class _Functor>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
+__for_each_segment(_SegmentedIterator __first, _SegmentedIterator __last, _Functor __func) {
+ using _Traits = __segmented_iterator_traits<_SegmentedIterator>;
+
+ auto __sfirst = _Traits::__segment(__first);
+ auto __slast = _Traits::__segment(__last);
+
+ // We are in a single segment, so we might not be at the beginning or end
+ if (__sfirst == __slast) {
+ __func(_Traits::__local(__first), _Traits::__local(__last));
+ return;
+ }
+
+ // We have more than one segment. Iterate over the first segment, since we might not start at the beginning
+ __func(_Traits::__local(__first), _Traits::__end(__sfirst));
+ ++__sfirst;
+ // iterate over the segments which are guaranteed to be completely in the range
+ while (__sfirst != __slast) {
+ __func(_Traits::__begin(__sfirst), _Traits::__end(__sfirst));
+ ++__sfirst;
+ }
+ // iterate over the last segment
+ __func(_Traits::__begin(__sfirst), _Traits::__local(__last));
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ALGORITHM_FOR_EACH_SEGMENT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/generate_n.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/generate_n.h
index 45259989bf0..ff5c82d3e42 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/generate_n.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/generate_n.h
@@ -11,7 +11,6 @@
#include <__config>
#include <__utility/convert_to_integral.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/half_positive.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/half_positive.h
index 74aede2b566..5a0f4baf6aa 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/half_positive.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/half_positive.h
@@ -10,7 +10,9 @@
#define _LIBCPP___ALGORITHM_HALF_POSITIVE_H
#include <__config>
-#include <type_traits>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_integral.h>
+#include <__type_traits/make_unsigned.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_found_result.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_found_result.h
index 3134d6e0df2..d9ca287f017 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_found_result.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_found_result.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -44,6 +44,6 @@ struct in_found_result {
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_IN_FOUND_RESULT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_fun_result.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_fun_result.h
index 3cbb9e12d3b..33374eddc30 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_fun_result.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_fun_result.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template <class _InIter1, class _Func1>
@@ -42,7 +42,7 @@ struct in_fun_result {
};
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_out_result.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_out_result.h
index 3e747be44d6..6b50e0e2456 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_out_result.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_out_result.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -49,7 +49,7 @@ struct in_in_out_result {
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_result.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_result.h
index 2098c188cc9..1eceb9de023 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_result.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_result.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -46,7 +46,7 @@ struct in_in_result {
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_out_out_result.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_out_out_result.h
index 4046eee57df..2f7a09b5c30 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_out_out_result.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_out_out_result.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template <class _InIter1, class _OutIter1, class _OutIter2>
@@ -47,7 +47,7 @@ struct in_out_out_result {
};
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_out_result.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_out_result.h
index 7f5a0271b4c..e4741cb71f6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_out_result.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_out_result.h
@@ -18,9 +18,12 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -46,8 +49,10 @@ struct in_out_result {
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ALGORITHM_IN_OUT_RESULT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/includes.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/includes.h
index cc39f275bf4..88253e2653d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/includes.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/includes.h
@@ -61,13 +61,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
template <class _InputIterator1, class _InputIterator2>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) {
- return std::includes(
- std::move(__first1),
- std::move(__last1),
- std::move(__first2),
- std::move(__last2),
- __less<typename iterator_traits<_InputIterator1>::value_type,
- typename iterator_traits<_InputIterator2>::value_type>());
+ return std::includes(std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/inplace_merge.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/inplace_merge.h
index 5bbefc94bdf..44a9425559e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/inplace_merge.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/inplace_merge.h
@@ -246,8 +246,7 @@ inline _LIBCPP_HIDE_FROM_ABI
void
inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last)
{
- std::inplace_merge(std::move(__first), std::move(__middle), std::move(__last),
- __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
+ std::inplace_merge(std::move(__first), std::move(__middle), std::move(__last), __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap.h
index 2dcb4a28e8d..93d84d33806 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap.h
@@ -36,7 +36,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
bool
is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
- return _VSTD::is_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+ return _VSTD::is_heap(__first, __last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap_until.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap_until.h
index 6ed4cb29c42..d7131114bd6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap_until.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_heap_until.h
@@ -58,7 +58,7 @@ template<class _RandomAccessIterator>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _RandomAccessIterator
is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
- return _VSTD::__is_heap_until(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+ return _VSTD::__is_heap_until(__first, __last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_permutation.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_permutation.h
index 005445652e9..105a0732283 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_permutation.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_permutation.h
@@ -19,19 +19,22 @@
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/next.h>
+#include <__type_traits/is_callable.h>
#include <__utility/move.h>
-#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
template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class = void>
struct _ConstTimeDistance : false_type {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter1, class _Sent1, class _Iter2, class _Sent2>
struct _ConstTimeDistance<_Iter1, _Sent1, _Iter2, _Sent2, __enable_if_t<
@@ -47,7 +50,7 @@ struct _ConstTimeDistance<_Iter1, _Iter1, _Iter2, _Iter2, __enable_if_t<
is_same<typename iterator_traits<_Iter2>::iterator_category, random_access_iterator_tag>::value
> > : true_type {};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
// Internal functions
@@ -202,7 +205,7 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIt
return std::is_permutation(__first1, __last1, __first2, __equal_to());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
// 2+2 iterators
template <class _ForwardIterator1, class _ForwardIterator2>
@@ -231,8 +234,10 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIt
__pred, __identity(), __identity());
}
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ALGORITHM_IS_PERMUTATION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted.h
index bf44f45764d..a321c2c12dc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted.h
@@ -36,7 +36,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
bool
is_sorted(_ForwardIterator __first, _ForwardIterator __last)
{
- return _VSTD::is_sorted(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
+ return _VSTD::is_sorted(__first, __last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted_until.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted_until.h
index b6683000a06..890b93631c4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted_until.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/is_sorted_until.h
@@ -48,7 +48,7 @@ template<class _ForwardIterator>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
is_sorted_until(_ForwardIterator __first, _ForwardIterator __last)
{
- return _VSTD::is_sorted_until(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
+ return _VSTD::is_sorted_until(__first, __last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/iterator_operations.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/iterator_operations.h
index bd3e6f1d38f..002978014cc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/iterator_operations.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/iterator_operations.h
@@ -33,11 +33,14 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _AlgPolicy> struct _IterOps;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct _RangeAlgPolicy {};
template <>
@@ -172,4 +175,6 @@ struct _IterOps<_ClassicAlgPolicy> {
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ALGORITHM_ITERATOR_OPERATIONS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare.h
index 0a13c5dd31c..62b72edc80f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare.h
@@ -52,9 +52,7 @@ bool
lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2)
{
- return _VSTD::lexicographical_compare(__first1, __last1, __first2, __last2,
- __less<typename iterator_traits<_InputIterator1>::value_type,
- typename iterator_traits<_InputIterator2>::value_type>());
+ return _VSTD::lexicographical_compare(__first1, __last1, __first2, __last2, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare_three_way.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare_three_way.h
new file mode 100644
index 00000000000..32de97d07a1
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/lexicographical_compare_three_way.h
@@ -0,0 +1,125 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_LEXICOGRAPHICAL_COMPARE_THREE_WAY_H
+#define _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_THREE_WAY_H
+
+#include <__algorithm/min.h>
+#include <__algorithm/three_way_comp_ref_type.h>
+#include <__compare/compare_three_way.h>
+#include <__compare/ordering.h>
+#include <__concepts/arithmetic.h>
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/common_type.h>
+#include <__type_traits/is_copy_constructible.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 20
+
+// Fast path for random access iterators which computes the number of loop iterations up-front and
+// then skips the iterator comparisons inside the loop.
+template <class _InputIterator1, class _InputIterator2, class _Cmp>
+_LIBCPP_HIDE_FROM_ABI constexpr auto __lexicographical_compare_three_way_fast_path(
+ _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Cmp& __comp)
+ -> decltype(__comp(*__first1, *__first2)) {
+ static_assert(
+ signed_integral<__iter_diff_t<_InputIterator1>>, "Using a non-integral difference_type is undefined behavior.");
+ static_assert(
+ signed_integral<__iter_diff_t<_InputIterator2>>, "Using a non-integral difference_type is undefined behavior.");
+
+ using _Len1 = __iter_diff_t<_InputIterator1>;
+ using _Len2 = __iter_diff_t<_InputIterator2>;
+ using _Common = common_type_t<_Len1, _Len2>;
+
+ _Len1 __len1 = __last1 - __first1;
+ _Len2 __len2 = __last2 - __first2;
+ _Common __min_len = std::min<_Common>(__len1, __len2);
+
+ for (_Common __i = 0; __i < __min_len; ++__i) {
+ auto __c = __comp(*__first1, *__first2);
+ if (__c != 0) {
+ return __c;
+ }
+ ++__first1;
+ ++__first2;
+ }
+
+ return __len1 <=> __len2;
+}
+
+// Unoptimized implementation which compares the iterators against the end in every loop iteration
+template <class _InputIterator1, class _InputIterator2, class _Cmp>
+_LIBCPP_HIDE_FROM_ABI constexpr auto __lexicographical_compare_three_way_slow_path(
+ _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Cmp& __comp)
+ -> decltype(__comp(*__first1, *__first2)) {
+ while (true) {
+ bool __exhausted1 = __first1 == __last1;
+ bool __exhausted2 = __first2 == __last2;
+
+ if (__exhausted1 || __exhausted2) {
+ if (!__exhausted1)
+ return strong_ordering::greater;
+ if (!__exhausted2)
+ return strong_ordering::less;
+ return strong_ordering::equal;
+ }
+
+ auto __c = __comp(*__first1, *__first2);
+ if (__c != 0) {
+ return __c;
+ }
+
+ ++__first1;
+ ++__first2;
+ }
+}
+
+template <class _InputIterator1, class _InputIterator2, class _Cmp>
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto lexicographical_compare_three_way(
+ _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Cmp __comp)
+ -> decltype(__comp(*__first1, *__first2)) {
+ static_assert(__comparison_category<decltype(__comp(*__first1, *__first2))>,
+ "The comparator passed to lexicographical_compare_three_way must return a comparison category type.");
+ static_assert(std::is_copy_constructible_v<_InputIterator1>, "Iterators must be copy constructible.");
+ static_assert(std::is_copy_constructible_v<_InputIterator2>, "Iterators must be copy constructible.");
+ __three_way_comp_ref_type<_Cmp> __wrapped_comp_ref(__comp);
+ if constexpr (__has_random_access_iterator_category<_InputIterator1>::value &&
+ __has_random_access_iterator_category<_InputIterator2>::value) {
+ return std::__lexicographical_compare_three_way_fast_path(
+ std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), __wrapped_comp_ref);
+ } else {
+ // Unoptimized implementation which compares the iterators against the end in every loop iteration
+ return std::__lexicographical_compare_three_way_slow_path(
+ std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), __wrapped_comp_ref);
+ }
+}
+
+template <class _InputIterator1, class _InputIterator2>
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto lexicographical_compare_three_way(
+ _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) {
+ return std::lexicographical_compare_three_way(
+ std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), std::compare_three_way());
+}
+
+#endif // _LIBCPP_STD_VER >= 20
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_THREE_WAY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/lower_bound.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/lower_bound.h
index 2648982ea50..91c3bdaafd0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/lower_bound.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/lower_bound.h
@@ -20,7 +20,6 @@
#include <__iterator/iterator_traits.h>
#include <__type_traits/is_callable.h>
#include <__type_traits/remove_reference.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -30,7 +29,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _AlgPolicy, class _Iter, class _Sent, class _Type, class _Proj, class _Comp>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
-_Iter __lower_bound_impl(_Iter __first, _Sent __last, const _Type& __value, _Comp& __comp, _Proj& __proj) {
+_Iter __lower_bound(_Iter __first, _Sent __last, const _Type& __value, _Comp& __comp, _Proj& __proj) {
auto __len = _IterOps<_AlgPolicy>::distance(__first, __last);
while (__len != 0) {
@@ -53,14 +52,13 @@ _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last,
static_assert(__is_callable<_Compare, decltype(*__first), const _Tp&>::value,
"The comparator has to be callable");
auto __proj = std::__identity();
- return std::__lower_bound_impl<_ClassicAlgPolicy>(__first, __last, __value, __comp, __proj);
+ return std::__lower_bound<_ClassicAlgPolicy>(__first, __last, __value, __comp, __proj);
}
template <class _ForwardIterator, class _Tp>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
_ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
- return std::lower_bound(__first, __last, __value,
- __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
+ return std::lower_bound(__first, __last, __value, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/make_heap.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/make_heap.h
index d66cfe2e5fc..eaf9259c0b3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/make_heap.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/make_heap.h
@@ -21,6 +21,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
@@ -47,10 +50,11 @@ void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Com
template <class _RandomAccessIterator>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) {
- std::make_heap(std::move(__first), std::move(__last),
- __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+ std::make_heap(std::move(__first), std::move(__last), __less<>());
}
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ALGORITHM_MAKE_HEAP_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/make_projected.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/make_projected.h
index 87d4d59042c..ec854763a5a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/make_projected.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/make_projected.h
@@ -32,13 +32,14 @@ struct _ProjectedPred {
_Pred& __pred; // Can be a unary or a binary predicate.
_Proj& __proj;
- _LIBCPP_CONSTEXPR _ProjectedPred(_Pred& __pred_arg, _Proj& __proj_arg) : __pred(__pred_arg), __proj(__proj_arg) {}
+ _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI _ProjectedPred(_Pred& __pred_arg, _Proj& __proj_arg)
+ : __pred(__pred_arg), __proj(__proj_arg) {}
template <class _Tp>
typename __invoke_of<_Pred&,
decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_Tp>()))
>::type
- _LIBCPP_CONSTEXPR operator()(_Tp&& __v) const {
+ _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI operator()(_Tp&& __v) const {
return std::__invoke(__pred, std::__invoke(__proj, std::forward<_Tp>(__v)));
}
@@ -47,7 +48,7 @@ struct _ProjectedPred {
decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_T1>())),
decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_T2>()))
>::type
- _LIBCPP_CONSTEXPR operator()(_T1&& __lhs, _T2&& __rhs) const {
+ _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI operator()(_T1&& __lhs, _T2&& __rhs) const {
return std::__invoke(__pred,
std::__invoke(__proj, std::forward<_T1>(__lhs)),
std::__invoke(__proj, std::forward<_T2>(__rhs)));
@@ -55,25 +56,12 @@ struct _ProjectedPred {
};
-template <class _Pred, class _Proj, class = void>
-struct __can_use_pristine_comp : false_type {};
-
-template <class _Pred, class _Proj>
-struct __can_use_pristine_comp<_Pred, _Proj, __enable_if_t<
- !is_member_pointer<typename decay<_Pred>::type>::value && (
-#if _LIBCPP_STD_VER > 17
- is_same<typename decay<_Proj>::type, identity>::value ||
-#endif
- is_same<typename decay<_Proj>::type, __identity>::value
- )
-> > : true_type {};
-
-template <class _Pred, class _Proj>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static
-__enable_if_t<
- !__can_use_pristine_comp<_Pred, _Proj>::value,
- _ProjectedPred<_Pred, _Proj>
->
+template <class _Pred,
+ class _Proj,
+ __enable_if_t<!(!is_member_pointer<__decay_t<_Pred> >::value &&
+ __is_identity<__decay_t<_Proj> >::value),
+ int> = 0>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ProjectedPred<_Pred, _Proj>
__make_projected(_Pred& __pred, _Proj& __proj) {
return _ProjectedPred<_Pred, _Proj>(__pred, __proj);
}
@@ -81,28 +69,27 @@ __make_projected(_Pred& __pred, _Proj& __proj) {
// Avoid creating the functor and just use the pristine comparator -- for certain algorithms, this would enable
// optimizations that rely on the type of the comparator. Additionally, this results in less layers of indirection in
// the call stack when the comparator is invoked, even in an unoptimized build.
-template <class _Pred, class _Proj>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static
-__enable_if_t<
- __can_use_pristine_comp<_Pred, _Proj>::value,
- _Pred&
->
-__make_projected(_Pred& __pred, _Proj&) {
+template <class _Pred,
+ class _Proj,
+ __enable_if_t<!is_member_pointer<__decay_t<_Pred> >::value &&
+ __is_identity<__decay_t<_Proj> >::value,
+ int> = 0>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Pred& __make_projected(_Pred& __pred, _Proj&) {
return __pred;
}
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
template <class _Comp, class _Proj1, class _Proj2>
-_LIBCPP_HIDE_FROM_ABI constexpr static
+_LIBCPP_HIDE_FROM_ABI constexpr
decltype(auto) __make_projected_comp(_Comp& __comp, _Proj1& __proj1, _Proj2& __proj2) {
- if constexpr (same_as<decay_t<_Proj1>, identity> && same_as<decay_t<_Proj2>, identity> &&
+ if constexpr (__is_identity<decay_t<_Proj1>>::value && __is_identity<decay_t<_Proj2>>::value &&
!is_member_pointer_v<decay_t<_Comp>>) {
// Avoid creating the lambda and just use the pristine comparator -- for certain algorithms, this would enable
// optimizations that rely on the type of the comparator.
@@ -121,6 +108,6 @@ decltype(auto) __make_projected_comp(_Comp& __comp, _Proj1& __proj1, _Proj2& __p
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_MAKE_PROJECTED_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/max.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/max.h
index a08a3fc59bd..5d8e64cfff3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/max.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/max.h
@@ -28,7 +28,7 @@ template <class _Tp, class _Compare>
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const _Tp&
-max(const _Tp& __a, const _Tp& __b, _Compare __comp)
+max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp)
{
return __comp(__a, __b) ? __b : __a;
}
@@ -37,9 +37,9 @@ template <class _Tp>
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const _Tp&
-max(const _Tp& __a, const _Tp& __b)
+max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b)
{
- return _VSTD::max(__a, __b, __less<_Tp>());
+ return _VSTD::max(__a, __b, __less<>());
}
#ifndef _LIBCPP_CXX03_LANG
@@ -59,7 +59,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
_Tp
max(initializer_list<_Tp> __t)
{
- return *_VSTD::max_element(__t.begin(), __t.end(), __less<_Tp>());
+ return *_VSTD::max_element(__t.begin(), __t.end(), __less<>());
}
#endif // _LIBCPP_CXX03_LANG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/max_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/max_element.h
index 6ac310619bf..8fd52c77723 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/max_element.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/max_element.h
@@ -24,7 +24,7 @@ template <class _Compare, class _ForwardIterator>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator
__max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
{
- static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
+ static_assert(__has_forward_iterator_category<_ForwardIterator>::value,
"std::max_element requires a ForwardIterator");
if (__first != __last)
{
@@ -48,8 +48,7 @@ template <class _ForwardIterator>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator
max_element(_ForwardIterator __first, _ForwardIterator __last)
{
- return _VSTD::max_element(__first, __last,
- __less<typename iterator_traits<_ForwardIterator>::value_type>());
+ return _VSTD::max_element(__first, __last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/merge.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/merge.h
index e54e430bcb6..7ee7aaad716 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/merge.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/merge.h
@@ -60,9 +60,7 @@ _OutputIterator
merge(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
{
- typedef typename iterator_traits<_InputIterator1>::value_type __v1;
- typedef typename iterator_traits<_InputIterator2>::value_type __v2;
- return _VSTD::merge(__first1, __last1, __first2, __last2, __result, __less<__v1, __v2>());
+ return _VSTD::merge(__first1, __last1, __first2, __last2, __result, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/min.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/min.h
index 2882485ad76..3c0debd6b04 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/min.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/min.h
@@ -28,7 +28,7 @@ template <class _Tp, class _Compare>
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const _Tp&
-min(const _Tp& __a, const _Tp& __b, _Compare __comp)
+min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp)
{
return __comp(__b, __a) ? __b : __a;
}
@@ -37,9 +37,9 @@ template <class _Tp>
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const _Tp&
-min(const _Tp& __a, const _Tp& __b)
+min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b)
{
- return _VSTD::min(__a, __b, __less<_Tp>());
+ return _VSTD::min(__a, __b, __less<>());
}
#ifndef _LIBCPP_CXX03_LANG
@@ -59,7 +59,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
_Tp
min(initializer_list<_Tp> __t)
{
- return *_VSTD::min_element(__t.begin(), __t.end(), __less<_Tp>());
+ return *_VSTD::min_element(__t.begin(), __t.end(), __less<>());
}
#endif // _LIBCPP_CXX03_LANG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/min_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/min_element.h
index c0706fe9e44..45f3e85ef92 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/min_element.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/min_element.h
@@ -22,6 +22,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Comp, class _Iter, class _Sent, class _Proj>
@@ -49,7 +52,7 @@ template <class _ForwardIterator, class _Compare>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator
min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
{
- static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
+ static_assert(__has_forward_iterator_category<_ForwardIterator>::value,
"std::min_element requires a ForwardIterator");
static_assert(__is_callable<_Compare, decltype(*__first), decltype(*__first)>::value,
"The comparator has to be callable");
@@ -61,10 +64,11 @@ template <class _ForwardIterator>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator
min_element(_ForwardIterator __first, _ForwardIterator __last)
{
- return _VSTD::min_element(__first, __last,
- __less<typename iterator_traits<_ForwardIterator>::value_type>());
+ return _VSTD::min_element(__first, __last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ALGORITHM_MIN_ELEMENT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/min_max_result.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/min_max_result.h
index 4be39992b42..ef2d9903808 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/min_max_result.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/min_max_result.h
@@ -23,7 +23,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -47,7 +47,7 @@ struct min_max_result {
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax.h
index 6ef0a777083..bdcf57b101e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax.h
@@ -27,7 +27,7 @@ template<class _Tp, class _Compare>
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
pair<const _Tp&, const _Tp&>
-minmax(const _Tp& __a, const _Tp& __b, _Compare __comp)
+minmax(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp)
{
return __comp(__b, __a) ? pair<const _Tp&, const _Tp&>(__b, __a) :
pair<const _Tp&, const _Tp&>(__a, __b);
@@ -37,9 +37,9 @@ template<class _Tp>
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
pair<const _Tp&, const _Tp&>
-minmax(const _Tp& __a, const _Tp& __b)
+minmax(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b)
{
- return std::minmax(__a, __b, __less<_Tp>());
+ return std::minmax(__a, __b, __less<>());
}
#ifndef _LIBCPP_CXX03_LANG
@@ -59,7 +59,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
pair<_Tp, _Tp>
minmax(initializer_list<_Tp> __t)
{
- return std::minmax(__t, __less<_Tp>());
+ return std::minmax(__t, __less<>());
}
#endif // _LIBCPP_CXX03_LANG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax_element.h
index caa963e112e..5bcaf8354d9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax_element.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/minmax_element.h
@@ -12,9 +12,10 @@
#include <__algorithm/comp.h>
#include <__config>
#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_callable.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -82,7 +83,7 @@ template <class _ForwardIterator, class _Compare>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair<_ForwardIterator, _ForwardIterator>
minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) {
- static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
+ static_assert(__has_forward_iterator_category<_ForwardIterator>::value,
"std::minmax_element requires a ForwardIterator");
static_assert(__is_callable<_Compare, decltype(*__first), decltype(*__first)>::value,
"The comparator has to be callable");
@@ -93,7 +94,7 @@ minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __com
template <class _ForwardIterator>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair<_ForwardIterator, _ForwardIterator> minmax_element(_ForwardIterator __first, _ForwardIterator __last) {
- return std::minmax_element(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
+ return std::minmax_element(__first, __last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/mismatch.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/mismatch.h
index 600e2cdd3da..e5b014f4573 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/mismatch.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/mismatch.h
@@ -38,7 +38,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY
return std::mismatch(__first1, __last1, __first2, __equal_to());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator1, _InputIterator2>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/move.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/move.h
index ac95bda7b61..01aeef4e177 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/move.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/move.h
@@ -10,6 +10,7 @@
#define _LIBCPP___ALGORITHM_MOVE_H
#include <__algorithm/copy_move_common.h>
+#include <__algorithm/for_each_segment.h>
#include <__algorithm/iterator_operations.h>
#include <__algorithm/min.h>
#include <__config>
@@ -45,36 +46,34 @@ struct __move_loop {
return std::make_pair(std::move(__first), std::move(__result));
}
- template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator<_InIter>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
- operator()(_InIter __first, _InIter __last, _OutIter __result) const {
+ template <class _InIter, class _OutIter>
+ struct _MoveSegment {
using _Traits = __segmented_iterator_traits<_InIter>;
- auto __sfirst = _Traits::__segment(__first);
- auto __slast = _Traits::__segment(__last);
- if (__sfirst == __slast) {
- auto __iters = std::__move<_AlgPolicy>(_Traits::__local(__first), _Traits::__local(__last), std::move(__result));
- return std::make_pair(__last, std::move(__iters.second));
- }
- __result = std::__move<_AlgPolicy>(_Traits::__local(__first), _Traits::__end(__sfirst), std::move(__result)).second;
- ++__sfirst;
- while (__sfirst != __slast) {
- __result =
- std::__move<_AlgPolicy>(_Traits::__begin(__sfirst), _Traits::__end(__sfirst), std::move(__result)).second;
- ++__sfirst;
+ _OutIter& __result_;
+
+ _LIBCPP_HIDE_FROM_ABI _MoveSegment(_OutIter& __result) : __result_(__result) {}
+
+ _LIBCPP_HIDE_FROM_ABI void
+ operator()(typename _Traits::__local_iterator __lfirst, typename _Traits::__local_iterator __llast) {
+ __result_ = std::__move<_AlgPolicy>(__lfirst, __llast, std::move(__result_)).second;
}
- __result =
- std::__move<_AlgPolicy>(_Traits::__begin(__sfirst), _Traits::__local(__last), std::move(__result)).second;
+ };
+
+ template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator<_InIter>::value, int> = 0>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
+ operator()(_InIter __first, _InIter __last, _OutIter __result) const {
+ std::__for_each_segment(__first, __last, _MoveSegment<_InIter, _OutIter>(__result));
return std::make_pair(__last, std::move(__result));
}
template <class _InIter,
class _OutIter,
- __enable_if_t<__is_cpp17_random_access_iterator<_InIter>::value &&
+ __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&
!__is_segmented_iterator<_InIter>::value && __is_segmented_iterator<_OutIter>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
- operator()(_InIter __first, _InIter __last, _OutIter __result) {
+ operator()(_InIter __first, _InIter __last, _OutIter __result) const {
using _Traits = __segmented_iterator_traits<_OutIter>;
using _DiffT = typename common_type<__iter_diff_t<_InIter>, __iter_diff_t<_OutIter> >::type;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/move_backward.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/move_backward.h
index d4f013be680..e396abfe0d3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/move_backward.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/move_backward.h
@@ -76,11 +76,11 @@ struct __move_backward_loop {
template <class _InIter,
class _OutIter,
- __enable_if_t<__is_cpp17_random_access_iterator<_InIter>::value &&
+ __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&
!__is_segmented_iterator<_InIter>::value && __is_segmented_iterator<_OutIter>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
- operator()(_InIter __first, _InIter __last, _OutIter __result) {
+ operator()(_InIter __first, _InIter __last, _OutIter __result) const {
using _Traits = __segmented_iterator_traits<_OutIter>;
using _DiffT = typename common_type<__iter_diff_t<_InIter>, __iter_diff_t<_OutIter> >::type;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/next_permutation.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/next_permutation.h
index 73e8b99ab90..d89768ddc19 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/next_permutation.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/next_permutation.h
@@ -69,8 +69,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
bool
next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
{
- return _VSTD::next_permutation(__first, __last,
- __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
+ return _VSTD::next_permutation(__first, __last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/nth_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/nth_element.h
index 9fdfb2cae64..dbacf58f9ec 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/nth_element.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/nth_element.h
@@ -14,7 +14,6 @@
#include <__algorithm/iterator_operations.h>
#include <__algorithm/sort.h>
#include <__config>
-#include <__debug>
#include <__debug_utils/randomize_range.h>
#include <__iterator/iterator_traits.h>
#include <__utility/move.h>
@@ -249,8 +248,7 @@ void nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Ra
template <class _RandomAccessIterator>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last) {
- std::nth_element(std::move(__first), std::move(__nth), std::move(__last), __less<typename
- iterator_traits<_RandomAccessIterator>::value_type>());
+ std::nth_element(std::move(__first), std::move(__nth), std::move(__last), __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/partial_sort.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/partial_sort.h
index e0812affe6b..56bc9052c74 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/partial_sort.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/partial_sort.h
@@ -16,11 +16,11 @@
#include <__algorithm/sift_down.h>
#include <__algorithm/sort_heap.h>
#include <__config>
-#include <__debug>
#include <__debug_utils/randomize_range.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -87,8 +87,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
void
partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
{
- _VSTD::partial_sort(__first, __middle, __last,
- __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+ _VSTD::partial_sort(__first, __middle, __last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/partial_sort_copy.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/partial_sort_copy.h
index 1aba07105dc..b9635c51d5f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/partial_sort_copy.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/partial_sort_copy.h
@@ -79,8 +79,7 @@ _RandomAccessIterator
partial_sort_copy(_InputIterator __first, _InputIterator __last,
_RandomAccessIterator __result_first, _RandomAccessIterator __result_last)
{
- return _VSTD::partial_sort_copy(__first, __last, __result_first, __result_last,
- __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+ return _VSTD::partial_sort_copy(__first, __last, __result_first, __result_last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/partition.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/partition.h
index 0e094bf8dd9..a58dd6464aa 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/partition.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/partition.h
@@ -14,7 +14,6 @@
#include <__iterator/iterator_traits.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pop_heap.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pop_heap.h
index 94d32a42391..033af6f2f80 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pop_heap.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pop_heap.h
@@ -17,20 +17,24 @@
#include <__assert>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
#include <__utility/move.h>
-#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
template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
void __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare& __comp,
typename iterator_traits<_RandomAccessIterator>::difference_type __len) {
- _LIBCPP_ASSERT(__len > 0, "The heap given to pop_heap must be non-empty");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__len > 0, "The heap given to pop_heap must be non-empty");
__comp_ref_type<_Compare> __comp_ref = __comp;
@@ -64,10 +68,11 @@ void pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp
template <class _RandomAccessIterator>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) {
- std::pop_heap(std::move(__first), std::move(__last),
- __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+ std::pop_heap(std::move(__first), std::move(__last), __less<>());
}
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ALGORITHM_POP_HEAP_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/prev_permutation.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/prev_permutation.h
index 0b86ab74ee0..187f1e3e5ba 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/prev_permutation.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/prev_permutation.h
@@ -70,8 +70,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
bool
prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
{
- return _VSTD::prev_permutation(__first, __last,
- __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
+ return _VSTD::prev_permutation(__first, __last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_any_all_none_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_any_all_none_of.h
new file mode 100644
index 00000000000..0e50e0ed366
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_any_all_none_of.h
@@ -0,0 +1,100 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_ANY_ALL_NONE_OF_H
+#define _LIBCPP___ALGORITHM_PSTL_ANY_ALL_NONE_OF_H
+
+#include <__algorithm/pstl_find.h>
+#include <__algorithm/pstl_frontend_dispatch.h>
+#include <__config>
+#include <__iterator/cpp17_iterator_concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/remove_cvref.h>
+#include <__utility/move.h>
+#include <__utility/terminate_on_exception.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class>
+void __pstl_any_of(); // declaration needed for the frontend dispatch below
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Predicate,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI bool
+any_of(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator);
+ return std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_any_of),
+ [&](_ForwardIterator __g_first, _ForwardIterator __g_last, _Predicate __g_pred) {
+ return std::find_if(__policy, __g_first, __g_last, __g_pred) != __g_last;
+ },
+ std::move(__first),
+ std::move(__last),
+ std::move(__pred));
+}
+
+template <class>
+void __pstl_all_of(); // declaration needed for the frontend dispatch below
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Pred,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI bool
+all_of(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator);
+ return std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_all_of),
+ [&](_ForwardIterator __g_first, _ForwardIterator __g_last, _Pred __g_pred) {
+ return !std::any_of(__policy, __g_first, __g_last, [&](__iter_reference<_ForwardIterator> __value) {
+ return !__g_pred(__value);
+ });
+ },
+ std::move(__first),
+ std::move(__last),
+ std::move(__pred));
+}
+
+template <class>
+void __pstl_none_of(); // declaration needed for the frontend dispatch below
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Pred,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI bool
+none_of(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator);
+ return std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_none_of),
+ [&](_ForwardIterator __g_first, _ForwardIterator __g_last, _Pred __g_pred) {
+ return !std::any_of(__policy, __g_first, __g_last, __g_pred);
+ },
+ std::move(__first),
+ std::move(__last),
+ std::move(__pred));
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_ANY_ALL_NONE_OF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backend.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backend.h
new file mode 100644
index 00000000000..93372f01903
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backend.h
@@ -0,0 +1,198 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_BACKEND_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKEND_H
+
+#include <__algorithm/pstl_backends/cpu_backend.h>
+#include <__config>
+#include <execution>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+/*
+TODO: Documentation of how backends work
+
+A PSTL parallel backend is a tag type to which the following functions are associated, at minimum:
+
+ template <class _ExecutionPolicy, class _Iterator, class _Func>
+ void __pstl_for_each(_Backend, _ExecutionPolicy&&, _Iterator __first, _Iterator __last, _Func __f);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Predicate>
+ _Iterator __pstl_find_if(_Backend, _Iterator __first, _Iterator __last, _Predicate __pred);
+
+ template <class _ExecutionPolicy, class _RandomAccessIterator, class _Comp>
+ void __pstl_stable_sort(_Backend, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp);
+
+ template <class _ExecutionPolicy, class _InIterator, class _OutIterator, class _UnaryOperation>
+ _OutIterator __pstl_transform(_InIterator __first, _InIterator __last, _OutIterator __result, _UnaryOperation __op);
+
+ template <class _ExecutionPolicy, class _InIterator1, class _InIterator2, class _OutIterator, class _BinaryOperation>
+ _OutIterator __pstl_transform(_InIterator1 __first1,
+ _InIterator1 __last1,
+ _InIterator2 __first2,
+ _OutIterator __result,
+ _BinaryOperation __op);
+
+ template <class _ExecutionPolicy,
+ class _Iterator1,
+ class _Iterator2,
+ class _Tp,
+ class _BinaryOperation1,
+ class _BinaryOperation2>
+ _Tp __pstl_transform_reduce(_Backend,
+ _Iterator1 __first1,
+ _Iterator1 __last1,
+ _Iterator2 __first2,
+ _Iterator2 __last2,
+ _Tp __init,
+ _BinaryOperation1 __reduce,
+ _BinaryOperation2 __transform);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Tp, class _BinaryOperation, class _UnaryOperation>
+ _Tp __pstl_transform_reduce(_Backend,
+ _Iterator __first,
+ _Iterator __last,
+ _Tp __init,
+ _BinaryOperation __reduce,
+ _UnaryOperation __transform);
+
+// TODO: Complete this list
+
+The following functions are optional but can be provided. If provided, they are used by the corresponding
+algorithms, otherwise they are implemented in terms of other algorithms. If none of the optional algorithms are
+implemented, all the algorithms will eventually forward to the basis algorithms listed above:
+
+ template <class _ExecutionPolicy, class _Iterator, class _Size, class _Func>
+ void __pstl_for_each_n(_Backend, _Iterator __first, _Size __n, _Func __f);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Predicate>
+ bool __pstl_any_of(_Backend, _Iterator __first, _iterator __last, _Predicate __pred);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Predicate>
+ bool __pstl_all_of(_Backend, _Iterator __first, _iterator __last, _Predicate __pred);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Predicate>
+ bool __pstl_none_of(_Backend, _Iterator __first, _iterator __last, _Predicate __pred);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Tp>
+ _Iterator __pstl_find(_Backend, _Iterator __first, _Iterator __last, const _Tp& __value);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Predicate>
+ _Iterator __pstl_find_if_not(_Backend, _Iterator __first, _Iterator __last, _Predicate __pred);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Tp>
+ void __pstl_fill(_Backend, _Iterator __first, _Iterator __last, const _Tp& __value);
+
+ template <class _ExecutionPolicy, class _Iterator, class _SizeT, class _Tp>
+ void __pstl_fill_n(_Backend, _Iterator __first, _SizeT __n, const _Tp& __value);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Generator>
+ void __pstl_generate(_Backend, _Iterator __first, _Iterator __last, _Generator __gen);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Predicate>
+ void __pstl_is_partitioned(_Backend, _Iterator __first, _Iterator __last, _Predicate __pred);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Size, class _Generator>
+ void __pstl_generator_n(_Backend, _Iterator __first, _Size __n, _Generator __gen);
+
+ template <class _ExecutionPolicy, class _terator1, class _Iterator2, class _OutIterator, class _Comp>
+ _OutIterator __pstl_merge(_Backend,
+ _Iterator1 __first1,
+ _Iterator1 __last1,
+ _Iterator2 __first2,
+ _Iterator2 __last2,
+ _OutIterator __result,
+ _Comp __comp);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Tp, class _BinaryOperation>
+ _Tp __pstl_reduce(_Backend, _Iterator __first, _Iterator __last, _Tp __init, _BinaryOperation __op);
+
+ temlate <class _ExecutionPolicy, class _Iterator>
+ __iter_value_type<_Iterator> __pstl_reduce(_Backend, _Iterator __first, _Iterator __last);
+
+ template <class _ExecuitonPolicy, class _Iterator, class _Tp>
+ __iter_diff_t<_Iterator> __pstl_count(_Backend, _Iterator __first, _Iterator __last, const _Tp& __value);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Predicate>
+ __iter_diff_t<_Iterator> __pstl_count_if(_Backend, _Iterator __first, _Iterator __last, _Predicate __pred);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Tp>
+ void __pstl_replace(_Backend, _Iterator __first, _Iterator __last, const _Tp& __old_value, const _Tp& __new_value);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Pred, class _Tp>
+ void __pstl_replace_if(_Backend, _Iterator __first, _Iterator __last, _Pred __pred, const _Tp& __new_value);
+
+ template <class _ExecutionPolicy, class _Iterator, class _OutIterator, class _Tp>
+ void __pstl_replace_copy(_Backend,
+ _Iterator __first,
+ _Iterator __last,
+ _OutIterator __result,
+ const _Tp& __old_value,
+ const _Tp& __new_value);
+
+ template <class _ExecutionPolicy, class _Iterator, class _OutIterator, class _Pred, class _Tp>
+ void __pstl_replace_copy_if(_Backend,
+ _Iterator __first,
+ _Iterator __last,
+ _OutIterator __result,
+ _Pred __pred,
+ const _Tp& __new_value);
+
+ template <class _ExecutionPolicy, class _Iterator, class _Comp>
+ void __pstl_sort(_Backend, _Iterator __first, _Iterator __last, _Comp __comp);
+
+// TODO: Complete this list
+
+*/
+
+template <class _ExecutionPolicy>
+struct __select_backend;
+
+template <>
+struct __select_backend<std::execution::sequenced_policy> {
+ using type = __cpu_backend_tag;
+};
+
+# if _LIBCPP_STD_VER >= 20
+template <>
+struct __select_backend<std::execution::unsequenced_policy> {
+ using type = __cpu_backend_tag;
+};
+# endif
+
+# if defined(_LIBCPP_PSTL_CPU_BACKEND_SERIAL) || defined(_LIBCPP_PSTL_CPU_BACKEND_THREAD) || \
+ defined(_LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH)
+template <>
+struct __select_backend<std::execution::parallel_policy> {
+ using type = __cpu_backend_tag;
+};
+
+template <>
+struct __select_backend<std::execution::parallel_unsequenced_policy> {
+ using type = __cpu_backend_tag;
+};
+
+# else
+
+// ...New vendors can add parallel backends here...
+
+# error "Invalid choice of a PSTL parallel backend"
+# endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKEND_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backend.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backend.h
new file mode 100644
index 00000000000..e54f331b943
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backend.h
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_H
+
+#include <__config>
+
+/*
+
+ // _Functor takes a subrange for [__first, __last) that should be executed in serial
+ template <class _RandomAccessIterator, class _Functor>
+ void __parallel_for(_RandomAccessIterator __first, _RandomAccessIterator __last, _Functor __func);
+
+ template <class _Iterator, class _UnaryOp, class _Tp, class _BinaryOp, class _Reduction>
+ _Tp __parallel_transform_reduce(_Iterator __first, _Iterator __last, _UnaryOp, _Tp __init, _BinaryOp, _Reduction);
+
+ // Cancel the execution of other jobs - they aren't needed anymore
+ void __cancel_execution();
+
+ template <class _RandomAccessIterator1,
+ class _RandomAccessIterator2,
+ class _RandomAccessIterator3,
+ class _Compare,
+ class _LeafMerge>
+ void __parallel_merge(
+ _RandomAccessIterator1 __first1,
+ _RandomAccessIterator1 __last1,
+ _RandomAccessIterator2 __first2,
+ _RandomAccessIterator2 __last2,
+ _RandomAccessIterator3 __outit,
+ _Compare __comp,
+ _LeafMerge __leaf_merge);
+
+ template <class _RandomAccessIterator, class _Comp, class _LeafSort>
+ void __parallel_stable_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Comp __comp,
+ _LeafSort __leaf_sort);
+
+ TODO: Document the parallel backend
+*/
+
+#include <__algorithm/pstl_backends/cpu_backends/any_of.h>
+#include <__algorithm/pstl_backends/cpu_backends/backend.h>
+#include <__algorithm/pstl_backends/cpu_backends/fill.h>
+#include <__algorithm/pstl_backends/cpu_backends/find_if.h>
+#include <__algorithm/pstl_backends/cpu_backends/for_each.h>
+#include <__algorithm/pstl_backends/cpu_backends/merge.h>
+#include <__algorithm/pstl_backends/cpu_backends/stable_sort.h>
+#include <__algorithm/pstl_backends/cpu_backends/transform.h>
+#include <__algorithm/pstl_backends/cpu_backends/transform_reduce.h>
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/any_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/any_of.h
new file mode 100644
index 00000000000..8fe26797bf1
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/any_of.h
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_ANY_OF_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_ANY_OF_H
+
+#include <__algorithm/any_of.h>
+#include <__algorithm/find_if.h>
+#include <__algorithm/pstl_backends/cpu_backends/backend.h>
+#include <__atomic/atomic.h>
+#include <__atomic/memory_order.h>
+#include <__config>
+#include <__functional/operations.h>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__utility/pair.h>
+#include <__utility/terminate_on_exception.h>
+#include <cstdint>
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Index, class _Brick>
+_LIBCPP_HIDE_FROM_ABI bool __parallel_or(_Index __first, _Index __last, _Brick __f) {
+ std::atomic<bool> __found(false);
+ __par_backend::__parallel_for(__first, __last, [__f, &__found](_Index __i, _Index __j) {
+ if (!__found.load(std::memory_order_relaxed) && __f(__i, __j)) {
+ __found.store(true, std::memory_order_relaxed);
+ __par_backend::__cancel_execution();
+ }
+ });
+ return __found;
+}
+
+// TODO: check whether __simd_first() can be used here
+template <class _Index, class _DifferenceType, class _Pred>
+_LIBCPP_HIDE_FROM_ABI bool __simd_or(_Index __first, _DifferenceType __n, _Pred __pred) noexcept {
+ _DifferenceType __block_size = 4 < __n ? 4 : __n;
+ const _Index __last = __first + __n;
+ while (__last != __first) {
+ int32_t __flag = 1;
+ _PSTL_PRAGMA_SIMD_REDUCTION(& : __flag)
+ for (_DifferenceType __i = 0; __i < __block_size; ++__i)
+ if (__pred(*(__first + __i)))
+ __flag = 0;
+ if (!__flag)
+ return true;
+
+ __first += __block_size;
+ if (__last - __first >= __block_size << 1) {
+ // Double the block _Size. Any unnecessary iterations can be amortized against work done so far.
+ __block_size <<= 1;
+ } else {
+ __block_size = __last - __first;
+ }
+ }
+ return false;
+}
+
+template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
+_LIBCPP_HIDE_FROM_ABI bool
+__pstl_any_of(__cpu_backend_tag, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {
+ if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator>::value) {
+ return std::__terminate_on_exception([&] {
+ return std::__parallel_or(
+ __first, __last, [&__pred](_ForwardIterator __brick_first, _ForwardIterator __brick_last) {
+ return std::__pstl_any_of<__remove_parallel_policy_t<_ExecutionPolicy>>(
+ __cpu_backend_tag{}, __brick_first, __brick_last, __pred);
+ });
+ });
+ } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator>::value) {
+ return std::__simd_or(__first, __last - __first, __pred);
+ } else {
+ return std::any_of(__first, __last, __pred);
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_ANY_OF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/backend.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/backend.h
new file mode 100644
index 00000000000..ea2210a4a7a
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/backend.h
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_BACKEND_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_BACKEND_H
+
+#include <__config>
+#include <cstddef>
+
+#if defined(_LIBCPP_PSTL_CPU_BACKEND_SERIAL)
+# include <__algorithm/pstl_backends/cpu_backends/serial.h>
+#elif defined(_LIBCPP_PSTL_CPU_BACKEND_THREAD)
+# include <__algorithm/pstl_backends/cpu_backends/thread.h>
+#elif defined(_LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH)
+# include <__algorithm/pstl_backends/cpu_backends/libdispatch.h>
+#else
+# error "Invalid CPU backend choice"
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+struct __cpu_backend_tag {};
+
+inline constexpr size_t __lane_size = 64;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKEND_BACKEND_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/fill.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/fill.h
new file mode 100644
index 00000000000..5e5e0a23bf8
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/fill.h
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_FILL_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_FILL_H
+
+#include <__algorithm/fill.h>
+#include <__algorithm/pstl_backends/cpu_backends/backend.h>
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__utility/terminate_on_exception.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Index, class _DifferenceType, class _Tp>
+_LIBCPP_HIDE_FROM_ABI _Index __simd_fill_n(_Index __first, _DifferenceType __n, const _Tp& __value) noexcept {
+ _PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED
+ _PSTL_PRAGMA_SIMD
+ for (_DifferenceType __i = 0; __i < __n; ++__i)
+ __first[__i] = __value;
+ return __first + __n;
+}
+
+template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
+_LIBCPP_HIDE_FROM_ABI void
+__pstl_fill(__cpu_backend_tag, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
+ if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator>::value) {
+ std::__terminate_on_exception([&] {
+ __par_backend::__parallel_for(
+ __first, __last, [&__value](_ForwardIterator __brick_first, _ForwardIterator __brick_last) {
+ std::__pstl_fill<__remove_parallel_policy_t<_ExecutionPolicy>>(
+ __cpu_backend_tag{}, __brick_first, __brick_last, __value);
+ });
+ });
+ } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator>::value) {
+ std::__simd_fill_n(__first, __last - __first, __value);
+ } else {
+ std::fill(__first, __last, __value);
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_FILL_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/find_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/find_if.h
new file mode 100644
index 00000000000..3fa49549e64
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/find_if.h
@@ -0,0 +1,123 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_FIND_IF_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_FIND_IF_H
+
+#include <__algorithm/find_if.h>
+#include <__algorithm/pstl_backends/cpu_backends/backend.h>
+#include <__atomic/atomic.h>
+#include <__config>
+#include <__functional/operations.h>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__utility/pair.h>
+#include <__utility/terminate_on_exception.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Index, class _Brick, class _Compare>
+_LIBCPP_HIDE_FROM_ABI _Index
+__parallel_find(_Index __first, _Index __last, _Brick __f, _Compare __comp, bool __b_first) {
+ typedef typename std::iterator_traits<_Index>::difference_type _DifferenceType;
+ const _DifferenceType __n = __last - __first;
+ _DifferenceType __initial_dist = __b_first ? __n : -1;
+ std::atomic<_DifferenceType> __extremum(__initial_dist);
+ // TODO: find out what is better here: parallel_for or parallel_reduce
+ __par_backend::__parallel_for(__first, __last, [__comp, __f, __first, &__extremum](_Index __i, _Index __j) {
+ // See "Reducing Contention Through Priority Updates", PPoPP '13, for discussion of
+ // why using a shared variable scales fairly well in this situation.
+ if (__comp(__i - __first, __extremum)) {
+ _Index __res = __f(__i, __j);
+ // If not '__last' returned then we found what we want so put this to extremum
+ if (__res != __j) {
+ const _DifferenceType __k = __res - __first;
+ for (_DifferenceType __old = __extremum; __comp(__k, __old); __old = __extremum) {
+ __extremum.compare_exchange_weak(__old, __k);
+ }
+ }
+ }
+ });
+ return __extremum != __initial_dist ? __first + __extremum : __last;
+}
+
+template <class _Index, class _DifferenceType, class _Compare>
+_LIBCPP_HIDE_FROM_ABI _Index
+__simd_first(_Index __first, _DifferenceType __begin, _DifferenceType __end, _Compare __comp) noexcept {
+ // Experiments show good block sizes like this
+ const _DifferenceType __block_size = 8;
+ alignas(__lane_size) _DifferenceType __lane[__block_size] = {0};
+ while (__end - __begin >= __block_size) {
+ _DifferenceType __found = 0;
+ _PSTL_PRAGMA_SIMD_REDUCTION(| : __found) for (_DifferenceType __i = __begin; __i < __begin + __block_size; ++__i) {
+ const _DifferenceType __t = __comp(__first, __i);
+ __lane[__i - __begin] = __t;
+ __found |= __t;
+ }
+ if (__found) {
+ _DifferenceType __i;
+ // This will vectorize
+ for (__i = 0; __i < __block_size; ++__i) {
+ if (__lane[__i]) {
+ break;
+ }
+ }
+ return __first + __begin + __i;
+ }
+ __begin += __block_size;
+ }
+
+ // Keep remainder scalar
+ while (__begin != __end) {
+ if (__comp(__first, __begin)) {
+ return __first + __begin;
+ }
+ ++__begin;
+ }
+ return __first + __end;
+}
+
+template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
+_LIBCPP_HIDE_FROM_ABI _ForwardIterator
+__pstl_find_if(__cpu_backend_tag, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {
+ if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator>::value) {
+ return std::__terminate_on_exception([&] {
+ return std::__parallel_find(
+ __first,
+ __last,
+ [&__pred](_ForwardIterator __brick_first, _ForwardIterator __brick_last) {
+ return std::__pstl_find_if<__remove_parallel_policy_t<_ExecutionPolicy>>(
+ __cpu_backend_tag{}, __brick_first, __brick_last, __pred);
+ },
+ less<>{},
+ true);
+ });
+ } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator>::value) {
+ using __diff_t = __iter_diff_t<_ForwardIterator>;
+ return std::__simd_first(__first, __diff_t(0), __last - __first, [&__pred](_ForwardIterator __iter, __diff_t __i) {
+ return __pred(__iter[__i]);
+ });
+ } else {
+ return std::find_if(__first, __last, __pred);
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_FIND_IF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/for_each.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/for_each.h
new file mode 100644
index 00000000000..36d0ac238e2
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/for_each.h
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_BACKENDS_CPU_BACKNEDS_FOR_EACH_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKNEDS_FOR_EACH_H
+
+#include <__algorithm/for_each.h>
+#include <__algorithm/pstl_backends/cpu_backends/backend.h>
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__utility/terminate_on_exception.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Iterator, class _DifferenceType, class _Function>
+_LIBCPP_HIDE_FROM_ABI _Iterator __simd_walk_1(_Iterator __first, _DifferenceType __n, _Function __f) noexcept {
+ _PSTL_PRAGMA_SIMD
+ for (_DifferenceType __i = 0; __i < __n; ++__i)
+ __f(__first[__i]);
+
+ return __first + __n;
+}
+
+template <class _ExecutionPolicy, class _ForwardIterator, class _Functor>
+_LIBCPP_HIDE_FROM_ABI void
+__pstl_for_each(__cpu_backend_tag, _ForwardIterator __first, _ForwardIterator __last, _Functor __func) {
+ if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator>::value) {
+ std::__terminate_on_exception([&] {
+ std::__par_backend::__parallel_for(
+ __first, __last, [__func](_ForwardIterator __brick_first, _ForwardIterator __brick_last) {
+ std::__pstl_for_each<__remove_parallel_policy_t<_ExecutionPolicy>>(
+ __cpu_backend_tag{}, __brick_first, __brick_last, __func);
+ });
+ });
+ } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator>::value) {
+ std::__simd_walk_1(__first, __last - __first, __func);
+ } else {
+ std::for_each(__first, __last, __func);
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKNEDS_FOR_EACH_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/libdispatch.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/libdispatch.h
new file mode 100644
index 00000000000..bab6a3639bd
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/libdispatch.h
@@ -0,0 +1,241 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_LIBDISPATCH_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_LIBDISPATCH_H
+
+#include <__algorithm/lower_bound.h>
+#include <__algorithm/max.h>
+#include <__algorithm/upper_bound.h>
+#include <__atomic/atomic.h>
+#include <__config>
+#include <__exception/terminate.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/move_iterator.h>
+#include <__memory/allocator.h>
+#include <__memory/construct_at.h>
+#include <__memory/unique_ptr.h>
+#include <__numeric/reduce.h>
+#include <__utility/exception_guard.h>
+#include <__utility/move.h>
+#include <__utility/pair.h>
+#include <__utility/terminate_on_exception.h>
+#include <cstddef>
+#include <new>
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace __par_backend {
+inline namespace __libdispatch {
+
+// ::dispatch_apply is marked as __attribute__((nothrow)) because it doesn't let exceptions propagate, and neither do
+// we.
+// TODO: Do we want to add [[_Clang::__callback__(__func, __context, __)]]?
+_LIBCPP_EXPORTED_FROM_ABI void
+__dispatch_apply(size_t __chunk_count, void* __context, void (*__func)(void* __context, size_t __chunk)) noexcept;
+
+template <class _Func>
+_LIBCPP_HIDE_FROM_ABI void __dispatch_apply(size_t __chunk_count, _Func __func) noexcept {
+ __libdispatch::__dispatch_apply(__chunk_count, &__func, [](void* __context, size_t __chunk) {
+ (*static_cast<_Func*>(__context))(__chunk);
+ });
+}
+
+struct __chunk_partitions {
+ ptrdiff_t __chunk_count_; // includes the first chunk
+ ptrdiff_t __chunk_size_;
+ ptrdiff_t __first_chunk_size_;
+};
+
+[[__gnu__::__const__]] _LIBCPP_EXPORTED_FROM_ABI __chunk_partitions __partition_chunks(ptrdiff_t __size);
+
+template <class _RandomAccessIterator, class _Functor>
+_LIBCPP_HIDE_FROM_ABI void
+__parallel_for(_RandomAccessIterator __first, _RandomAccessIterator __last, _Functor __func) {
+ auto __partitions = __libdispatch::__partition_chunks(__last - __first);
+
+ // Perform the chunked execution.
+ __libdispatch::__dispatch_apply(__partitions.__chunk_count_, [&](size_t __chunk) {
+ auto __this_chunk_size = __chunk == 0 ? __partitions.__first_chunk_size_ : __partitions.__chunk_size_;
+ auto __index =
+ __chunk == 0
+ ? 0
+ : (__chunk * __partitions.__chunk_size_) + (__partitions.__first_chunk_size_ - __partitions.__chunk_size_);
+ __func(__first + __index, __first + __index + __this_chunk_size);
+ });
+}
+
+template <class _RandomAccessIterator1, class _RandomAccessIterator2, class _RandomAccessIteratorOut>
+struct __merge_range {
+ __merge_range(_RandomAccessIterator1 __mid1, _RandomAccessIterator2 __mid2, _RandomAccessIteratorOut __result)
+ : __mid1_(__mid1), __mid2_(__mid2), __result_(__result) {}
+
+ _RandomAccessIterator1 __mid1_;
+ _RandomAccessIterator2 __mid2_;
+ _RandomAccessIteratorOut __result_;
+};
+
+template <typename _RandomAccessIterator1,
+ typename _RandomAccessIterator2,
+ typename _RandomAccessIterator3,
+ typename _Compare,
+ typename _LeafMerge>
+_LIBCPP_HIDE_FROM_ABI void __parallel_merge(
+ _RandomAccessIterator1 __first1,
+ _RandomAccessIterator1 __last1,
+ _RandomAccessIterator2 __first2,
+ _RandomAccessIterator2 __last2,
+ _RandomAccessIterator3 __result,
+ _Compare __comp,
+ _LeafMerge __leaf_merge) {
+ __chunk_partitions __partitions =
+ __libdispatch::__partition_chunks(std::max<ptrdiff_t>(__last1 - __first1, __last2 - __first2));
+
+ if (__partitions.__chunk_count_ == 0)
+ return;
+
+ if (__partitions.__chunk_count_ == 1) {
+ __leaf_merge(__first1, __last1, __first2, __last2, __result, __comp);
+ return;
+ }
+
+ using __merge_range_t = __merge_range<_RandomAccessIterator1, _RandomAccessIterator2, _RandomAccessIterator3>;
+ auto const __n_ranges = __partitions.__chunk_count_ + 1;
+
+ // TODO: use __uninitialized_buffer
+ auto __destroy = [=](__merge_range_t* __ptr) {
+ std::destroy_n(__ptr, __n_ranges);
+ std::allocator<__merge_range_t>().deallocate(__ptr, __n_ranges);
+ };
+ unique_ptr<__merge_range_t[], decltype(__destroy)> __ranges(
+ std::allocator<__merge_range_t>().allocate(__n_ranges), __destroy);
+
+ // TODO: Improve the case where the smaller range is merged into just a few (or even one) chunks of the larger case
+ std::__terminate_on_exception([&] {
+ __merge_range_t* __r = __ranges.get();
+ std::__construct_at(__r++, __first1, __first2, __result);
+
+ bool __iterate_first_range = __last1 - __first1 > __last2 - __first2;
+
+ auto __compute_chunk = [&](size_t __chunk_size) -> __merge_range_t {
+ auto [__mid1, __mid2] = [&] {
+ if (__iterate_first_range) {
+ auto __m1 = __first1 + __chunk_size;
+ auto __m2 = std::lower_bound(__first2, __last2, __m1[-1], __comp);
+ return std::make_pair(__m1, __m2);
+ } else {
+ auto __m2 = __first2 + __chunk_size;
+ auto __m1 = std::lower_bound(__first1, __last1, __m2[-1], __comp);
+ return std::make_pair(__m1, __m2);
+ }
+ }();
+
+ __result += (__mid1 - __first1) + (__mid2 - __first2);
+ __first1 = __mid1;
+ __first2 = __mid2;
+ return {std::move(__mid1), std::move(__mid2), __result};
+ };
+
+ // handle first chunk
+ std::__construct_at(__r++, __compute_chunk(__partitions.__first_chunk_size_));
+
+ // handle 2 -> N - 1 chunks
+ for (ptrdiff_t __i = 0; __i != __partitions.__chunk_count_ - 2; ++__i)
+ std::__construct_at(__r++, __compute_chunk(__partitions.__chunk_size_));
+
+ // handle last chunk
+ std::__construct_at(__r, __last1, __last2, __result);
+
+ __libdispatch::__dispatch_apply(__partitions.__chunk_count_, [&](size_t __index) {
+ auto __first_iters = __ranges[__index];
+ auto __last_iters = __ranges[__index + 1];
+ __leaf_merge(
+ __first_iters.__mid1_,
+ __last_iters.__mid1_,
+ __first_iters.__mid2_,
+ __last_iters.__mid2_,
+ __first_iters.__result_,
+ __comp);
+ });
+ });
+}
+
+template <class _RandomAccessIterator, class _Transform, class _Value, class _Combiner, class _Reduction>
+_LIBCPP_HIDE_FROM_ABI _Value __parallel_transform_reduce(
+ _RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Transform __transform,
+ _Value __init,
+ _Combiner __combiner,
+ _Reduction __reduction) {
+ if (__first == __last)
+ return __init;
+
+ auto __partitions = __libdispatch::__partition_chunks(__last - __first);
+
+ auto __destroy = [__count = __partitions.__chunk_count_](_Value* __ptr) {
+ std::destroy_n(__ptr, __count);
+ std::allocator<_Value>().deallocate(__ptr, __count);
+ };
+
+ // TODO: use __uninitialized_buffer
+ // TODO: allocate one element per worker instead of one element per chunk
+ unique_ptr<_Value[], decltype(__destroy)> __values(
+ std::allocator<_Value>().allocate(__partitions.__chunk_count_), __destroy);
+
+ // __dispatch_apply is noexcept
+ __libdispatch::__dispatch_apply(__partitions.__chunk_count_, [&](size_t __chunk) {
+ auto __this_chunk_size = __chunk == 0 ? __partitions.__first_chunk_size_ : __partitions.__chunk_size_;
+ auto __index =
+ __chunk == 0
+ ? 0
+ : (__chunk * __partitions.__chunk_size_) + (__partitions.__first_chunk_size_ - __partitions.__chunk_size_);
+ if (__this_chunk_size != 1) {
+ std::__construct_at(
+ __values.get() + __chunk,
+ __reduction(__first + __index + 2,
+ __first + __index + __this_chunk_size,
+ __combiner(__transform(__first + __index), __transform(__first + __index + 1))));
+ } else {
+ std::__construct_at(__values.get() + __chunk, __transform(__first + __index));
+ }
+ });
+
+ return std::__terminate_on_exception([&] {
+ return std::reduce(
+ std::make_move_iterator(__values.get()),
+ std::make_move_iterator(__values.get() + __partitions.__chunk_count_),
+ std::move(__init),
+ __combiner);
+ });
+}
+
+// TODO: parallelize this
+template <class _RandomAccessIterator, class _Comp, class _LeafSort>
+_LIBCPP_HIDE_FROM_ABI void __parallel_stable_sort(
+ _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp, _LeafSort __leaf_sort) {
+ __leaf_sort(__first, __last, __comp);
+}
+
+_LIBCPP_HIDE_FROM_ABI inline void __cancel_execution() {}
+
+} // namespace __libdispatch
+} // namespace __par_backend
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_LIBDISPATCH_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/merge.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/merge.h
new file mode 100644
index 00000000000..d5be1e302d3
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/merge.h
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_MERGE_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_MERGE_H
+
+#include <__algorithm/merge.h>
+#include <__algorithm/pstl_backends/cpu_backends/backend.h>
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__utility/move.h>
+#include <__utility/terminate_on_exception.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator1,
+ class _ForwardIterator2,
+ class _ForwardOutIterator,
+ class _Comp>
+_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator __pstl_merge(
+ __cpu_backend_tag,
+ _ForwardIterator1 __first1,
+ _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2,
+ _ForwardOutIterator __result,
+ _Comp __comp) {
+ if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator1>::value &&
+ __has_random_access_iterator_category<_ForwardIterator2>::value &&
+ __has_random_access_iterator_category<_ForwardOutIterator>::value) {
+ return std::__terminate_on_exception([&] {
+ __par_backend::__parallel_merge(
+ __first1,
+ __last1,
+ __first2,
+ __last2,
+ __result,
+ __comp,
+ [](_ForwardIterator1 __g_first1,
+ _ForwardIterator1 __g_last1,
+ _ForwardIterator2 __g_first2,
+ _ForwardIterator2 __g_last2,
+ _ForwardOutIterator __g_result,
+ _Comp __g_comp) {
+ return std::__pstl_merge<__remove_parallel_policy_t<_ExecutionPolicy>>(
+ __cpu_backend_tag{},
+ std::move(__g_first1),
+ std::move(__g_last1),
+ std::move(__g_first2),
+ std::move(__g_last2),
+ std::move(__g_result),
+ std::move(__g_comp));
+ });
+ return __result + (__last1 - __first1) + (__last2 - __first2);
+ });
+ } else {
+ return std::merge(__first1, __last1, __first2, __last2, __result, __comp);
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_MERGE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/serial.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/serial.h
new file mode 100644
index 00000000000..f151c3b098f
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/serial.h
@@ -0,0 +1,72 @@
+// -*- 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___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_SERIAL_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_SERIAL_H
+
+#include <__config>
+#include <__utility/move.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace __par_backend {
+inline namespace __serial_cpu_backend {
+
+template <class _RandomAccessIterator, class _Fp>
+_LIBCPP_HIDE_FROM_ABI void __parallel_for(_RandomAccessIterator __first, _RandomAccessIterator __last, _Fp __f) {
+ __f(__first, __last);
+}
+
+template <class _Index, class _UnaryOp, class _Tp, class _BinaryOp, class _Reduce>
+_LIBCPP_HIDE_FROM_ABI _Tp
+__parallel_transform_reduce(_Index __first, _Index __last, _UnaryOp, _Tp __init, _BinaryOp, _Reduce __reduce) {
+ return __reduce(std::move(__first), std::move(__last), std::move(__init));
+}
+
+template <class _RandomAccessIterator, class _Compare, class _LeafSort>
+_LIBCPP_HIDE_FROM_ABI void __parallel_stable_sort(
+ _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, _LeafSort __leaf_sort) {
+ __leaf_sort(__first, __last, __comp);
+}
+
+_LIBCPP_HIDE_FROM_ABI inline void __cancel_execution() {}
+
+template <class _RandomAccessIterator1,
+ class _RandomAccessIterator2,
+ class _RandomAccessIterator3,
+ class _Compare,
+ class _LeafMerge>
+_LIBCPP_HIDE_FROM_ABI void __parallel_merge(
+ _RandomAccessIterator1 __first1,
+ _RandomAccessIterator1 __last1,
+ _RandomAccessIterator2 __first2,
+ _RandomAccessIterator2 __last2,
+ _RandomAccessIterator3 __outit,
+ _Compare __comp,
+ _LeafMerge __leaf_merge) {
+ __leaf_merge(__first1, __last1, __first2, __last2, __outit, __comp);
+}
+
+// TODO: Complete this list
+
+} // namespace __serial_cpu_backend
+} // namespace __par_backend
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_SERIAL_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/stable_sort.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/stable_sort.h
new file mode 100644
index 00000000000..0a701443b3c
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/stable_sort.h
@@ -0,0 +1,45 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_STABLE_SORT_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_STABLE_SORT_H
+
+#include <__algorithm/pstl_backends/cpu_backends/backend.h>
+#include <__algorithm/stable_sort.h>
+#include <__config>
+#include <__type_traits/is_execution_policy.h>
+#include <__utility/terminate_on_exception.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ExecutionPolicy, class _RandomAccessIterator, class _Comp>
+_LIBCPP_HIDE_FROM_ABI void
+__pstl_stable_sort(__cpu_backend_tag, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
+ if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy>) {
+ std::__terminate_on_exception([&] {
+ __par_backend::__parallel_stable_sort(
+ __first, __last, __comp, [](_RandomAccessIterator __g_first, _RandomAccessIterator __g_last, _Comp __g_comp) {
+ std::stable_sort(__g_first, __g_last, __g_comp);
+ });
+ });
+ } else {
+ std::stable_sort(__first, __last, __comp);
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_STABLE_SORT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h
new file mode 100644
index 00000000000..30eb0ae3626
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_THREAD_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_THREAD_H
+
+#include <__assert>
+#include <__config>
+#include <__utility/move.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+// This backend implementation is for testing purposes only and not meant for production use. This will be replaced
+// by a proper implementation once the PSTL implementation is somewhat stable.
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace __par_backend {
+inline namespace __thread_cpu_backend {
+
+template <class _RandomAccessIterator, class _Fp>
+_LIBCPP_HIDE_FROM_ABI void __parallel_for(_RandomAccessIterator __first, _RandomAccessIterator __last, _Fp __f) {
+ __f(__first, __last);
+}
+
+template <class _Index, class _UnaryOp, class _Tp, class _BinaryOp, class _Reduce>
+_LIBCPP_HIDE_FROM_ABI _Tp
+__parallel_transform_reduce(_Index __first, _Index __last, _UnaryOp, _Tp __init, _BinaryOp, _Reduce __reduce) {
+ return __reduce(std::move(__first), std::move(__last), std::move(__init));
+}
+
+template <class _RandomAccessIterator, class _Compare, class _LeafSort>
+_LIBCPP_HIDE_FROM_ABI void __parallel_stable_sort(
+ _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, _LeafSort __leaf_sort) {
+ __leaf_sort(__first, __last, __comp);
+}
+
+_LIBCPP_HIDE_FROM_ABI inline void __cancel_execution() {}
+
+template <class _RandomAccessIterator1,
+ class _RandomAccessIterator2,
+ class _RandomAccessIterator3,
+ class _Compare,
+ class _LeafMerge>
+_LIBCPP_HIDE_FROM_ABI void __parallel_merge(
+ _RandomAccessIterator1 __first1,
+ _RandomAccessIterator1 __last1,
+ _RandomAccessIterator2 __first2,
+ _RandomAccessIterator2 __last2,
+ _RandomAccessIterator3 __outit,
+ _Compare __comp,
+ _LeafMerge __leaf_merge) {
+ __leaf_merge(__first1, __last1, __first2, __last2, __outit, __comp);
+}
+
+} // namespace __thread_cpu_backend
+} // namespace __par_backend
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_THREAD_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform.h
new file mode 100644
index 00000000000..ef25ff0238d
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform.h
@@ -0,0 +1,132 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_TRANSFORM_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_TRANSFORM_H
+
+#include <__algorithm/pstl_backends/cpu_backends/backend.h>
+#include <__algorithm/transform.h>
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/remove_cvref.h>
+#include <__utility/terminate_on_exception.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Iterator1, class _DifferenceType, class _Iterator2, class _Function>
+_LIBCPP_HIDE_FROM_ABI _Iterator2
+__simd_walk_2(_Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Function __f) noexcept {
+ _PSTL_PRAGMA_SIMD
+ for (_DifferenceType __i = 0; __i < __n; ++__i)
+ __f(__first1[__i], __first2[__i]);
+ return __first2 + __n;
+}
+
+template <class _ExecutionPolicy, class _ForwardIterator, class _ForwardOutIterator, class _UnaryOperation>
+_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator __pstl_transform(
+ __cpu_backend_tag,
+ _ForwardIterator __first,
+ _ForwardIterator __last,
+ _ForwardOutIterator __result,
+ _UnaryOperation __op) {
+ if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator>::value &&
+ __has_random_access_iterator_category<_ForwardOutIterator>::value) {
+ std::__terminate_on_exception([&] {
+ std::__par_backend::__parallel_for(
+ __first, __last, [__op, __first, __result](_ForwardIterator __brick_first, _ForwardIterator __brick_last) {
+ return std::__pstl_transform<__remove_parallel_policy_t<_ExecutionPolicy>>(
+ __cpu_backend_tag{}, __brick_first, __brick_last, __result + (__brick_first - __first), __op);
+ });
+ });
+ return __result + (__last - __first);
+ } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator>::value &&
+ __has_random_access_iterator_category<_ForwardOutIterator>::value) {
+ return std::__simd_walk_2(
+ __first,
+ __last - __first,
+ __result,
+ [&](__iter_reference<_ForwardIterator> __in_value, __iter_reference<_ForwardOutIterator> __out_value) {
+ __out_value = __op(__in_value);
+ });
+ } else {
+ return std::transform(__first, __last, __result, __op);
+ }
+}
+
+template <class _Iterator1, class _DifferenceType, class _Iterator2, class _Iterator3, class _Function>
+_LIBCPP_HIDE_FROM_ABI _Iterator3 __simd_walk_3(
+ _Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Iterator3 __first3, _Function __f) noexcept {
+ _PSTL_PRAGMA_SIMD
+ for (_DifferenceType __i = 0; __i < __n; ++__i)
+ __f(__first1[__i], __first2[__i], __first3[__i]);
+ return __first3 + __n;
+}
+template <class _ExecutionPolicy,
+ class _ForwardIterator1,
+ class _ForwardIterator2,
+ class _ForwardOutIterator,
+ class _BinaryOperation,
+ enable_if_t<is_execution_policy_v<__remove_cvref_t<_ExecutionPolicy>>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator __pstl_transform(
+ __cpu_backend_tag,
+ _ForwardIterator1 __first1,
+ _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2,
+ _ForwardOutIterator __result,
+ _BinaryOperation __op) {
+ if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator1>::value &&
+ __has_random_access_iterator_category<_ForwardIterator2>::value &&
+ __has_random_access_iterator_category<_ForwardOutIterator>::value) {
+ std::__terminate_on_exception([&] {
+ std::__par_backend::__parallel_for(
+ __first1,
+ __last1,
+ [__op, __first1, __first2, __result](_ForwardIterator1 __brick_first, _ForwardIterator1 __brick_last) {
+ return std::__pstl_transform<__remove_parallel_policy_t<_ExecutionPolicy>>(
+ __cpu_backend_tag{},
+ __brick_first,
+ __brick_last,
+ __first2 + (__brick_first - __first1),
+ __result + (__brick_first - __first1),
+ __op);
+ });
+ });
+ return __result + (__last1 - __first1);
+ } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator1>::value &&
+ __has_random_access_iterator_category<_ForwardIterator2>::value &&
+ __has_random_access_iterator_category<_ForwardOutIterator>::value) {
+ return std::__simd_walk_3(
+ __first1,
+ __last1 - __first1,
+ __first2,
+ __result,
+ [&](__iter_reference<_ForwardIterator1> __in1,
+ __iter_reference<_ForwardIterator2> __in2,
+ __iter_reference<_ForwardOutIterator> __out_value) { __out_value = __op(__in1, __in2); });
+ } else {
+ return std::transform(__first1, __last1, __first2, __result, __op);
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_TRANSFORM_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h
new file mode 100644
index 00000000000..c51c312d938
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h
@@ -0,0 +1,194 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_TRANSFORM_REDUCE_H
+#define _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_TRANSFORM_REDUCE_H
+
+#include <__algorithm/pstl_backends/cpu_backends/backend.h>
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__numeric/transform_reduce.h>
+#include <__type_traits/is_arithmetic.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/operation_traits.h>
+#include <__utility/move.h>
+#include <__utility/terminate_on_exception.h>
+#include <new>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <
+ typename _DifferenceType,
+ typename _Tp,
+ typename _BinaryOperation,
+ typename _UnaryOperation,
+ __enable_if_t<__is_trivial_plus_operation<_BinaryOperation, _Tp, _Tp>::value && is_arithmetic_v<_Tp>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _Tp
+__simd_transform_reduce(_DifferenceType __n, _Tp __init, _BinaryOperation, _UnaryOperation __f) noexcept {
+ _PSTL_PRAGMA_SIMD_REDUCTION(+ : __init)
+ for (_DifferenceType __i = 0; __i < __n; ++__i)
+ __init += __f(__i);
+ return __init;
+}
+
+template <
+ typename _Size,
+ typename _Tp,
+ typename _BinaryOperation,
+ typename _UnaryOperation,
+ __enable_if_t<!(__is_trivial_plus_operation<_BinaryOperation, _Tp, _Tp>::value && is_arithmetic_v<_Tp>), int> = 0>
+_LIBCPP_HIDE_FROM_ABI _Tp
+__simd_transform_reduce(_Size __n, _Tp __init, _BinaryOperation __binary_op, _UnaryOperation __f) noexcept {
+ const _Size __block_size = __lane_size / sizeof(_Tp);
+ if (__n > 2 * __block_size && __block_size > 1) {
+ alignas(__lane_size) char __lane_buffer[__lane_size];
+ _Tp* __lane = reinterpret_cast<_Tp*>(__lane_buffer);
+
+ // initializer
+ _PSTL_PRAGMA_SIMD
+ for (_Size __i = 0; __i < __block_size; ++__i) {
+ ::new (__lane + __i) _Tp(__binary_op(__f(__i), __f(__block_size + __i)));
+ }
+ // main loop
+ _Size __i = 2 * __block_size;
+ const _Size __last_iteration = __block_size * (__n / __block_size);
+ for (; __i < __last_iteration; __i += __block_size) {
+ _PSTL_PRAGMA_SIMD
+ for (_Size __j = 0; __j < __block_size; ++__j) {
+ __lane[__j] = __binary_op(std::move(__lane[__j]), __f(__i + __j));
+ }
+ }
+ // remainder
+ _PSTL_PRAGMA_SIMD
+ for (_Size __j = 0; __j < __n - __last_iteration; ++__j) {
+ __lane[__j] = __binary_op(std::move(__lane[__j]), __f(__last_iteration + __j));
+ }
+ // combiner
+ for (_Size __j = 0; __j < __block_size; ++__j) {
+ __init = __binary_op(std::move(__init), std::move(__lane[__j]));
+ }
+ // destroyer
+ _PSTL_PRAGMA_SIMD
+ for (_Size __j = 0; __j < __block_size; ++__j) {
+ __lane[__j].~_Tp();
+ }
+ } else {
+ for (_Size __i = 0; __i < __n; ++__i) {
+ __init = __binary_op(std::move(__init), __f(__i));
+ }
+ }
+ return __init;
+}
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator1,
+ class _ForwardIterator2,
+ class _Tp,
+ class _BinaryOperation1,
+ class _BinaryOperation2>
+_LIBCPP_HIDE_FROM_ABI _Tp __pstl_transform_reduce(
+ __cpu_backend_tag,
+ _ForwardIterator1 __first1,
+ _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2,
+ _Tp __init,
+ _BinaryOperation1 __reduce,
+ _BinaryOperation2 __transform) {
+ if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator1>::value &&
+ __has_random_access_iterator_category<_ForwardIterator2>::value) {
+ return std::__terminate_on_exception([&] {
+ return __par_backend::__parallel_transform_reduce(
+ __first1,
+ std::move(__last1),
+ [__first1, __first2, __transform](_ForwardIterator1 __iter) {
+ return __transform(*__iter, *(__first2 + (__iter - __first1)));
+ },
+ std::move(__init),
+ std::move(__reduce),
+ [__first1, __first2, __reduce, __transform](
+ _ForwardIterator1 __brick_first, _ForwardIterator1 __brick_last, _Tp __brick_init) {
+ return std::__pstl_transform_reduce<__remove_parallel_policy_t<_ExecutionPolicy>>(
+ __cpu_backend_tag{},
+ __brick_first,
+ std::move(__brick_last),
+ __first2 + (__brick_first - __first1),
+ std::move(__brick_init),
+ std::move(__reduce),
+ std::move(__transform));
+ });
+ });
+ } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator1>::value &&
+ __has_random_access_iterator_category<_ForwardIterator2>::value) {
+ return std::__simd_transform_reduce(
+ __last1 - __first1, std::move(__init), std::move(__reduce), [&](__iter_diff_t<_ForwardIterator1> __i) {
+ return __transform(__first1[__i], __first2[__i]);
+ });
+ } else {
+ return std::transform_reduce(
+ std::move(__first1),
+ std::move(__last1),
+ std::move(__first2),
+ std::move(__init),
+ std::move(__reduce),
+ std::move(__transform));
+ }
+}
+
+template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation>
+_LIBCPP_HIDE_FROM_ABI _Tp __pstl_transform_reduce(
+ __cpu_backend_tag,
+ _ForwardIterator __first,
+ _ForwardIterator __last,
+ _Tp __init,
+ _BinaryOperation __reduce,
+ _UnaryOperation __transform) {
+ if constexpr (__is_parallel_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator>::value) {
+ return std::__terminate_on_exception([&] {
+ return __par_backend::__parallel_transform_reduce(
+ std::move(__first),
+ std::move(__last),
+ [__transform](_ForwardIterator __iter) { return __transform(*__iter); },
+ std::move(__init),
+ __reduce,
+ [__transform, __reduce](auto __brick_first, auto __brick_last, _Tp __brick_init) {
+ return std::__pstl_transform_reduce<__remove_parallel_policy_t<_ExecutionPolicy>>(
+ __cpu_backend_tag{},
+ std::move(__brick_first),
+ std::move(__brick_last),
+ std::move(__brick_init),
+ std::move(__reduce),
+ std::move(__transform));
+ });
+ });
+ } else if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> &&
+ __has_random_access_iterator_category<_ForwardIterator>::value) {
+ return std::__simd_transform_reduce(
+ __last - __first,
+ std::move(__init),
+ std::move(__reduce),
+ [=, &__transform](__iter_diff_t<_ForwardIterator> __i) { return __transform(__first[__i]); });
+ } else {
+ return std::transform_reduce(
+ std::move(__first), std::move(__last), std::move(__init), std::move(__reduce), std::move(__transform));
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_TRANSFORM_REDUCE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_copy.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_copy.h
new file mode 100644
index 00000000000..83c712c3540
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_copy.h
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_COPY_H
+#define _LIBCPP___ALGORITHM_PSTL_COPY_H
+
+#include <__algorithm/copy_n.h>
+#include <__algorithm/pstl_transform.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_constant_evaluated.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/is_trivially_copyable.h>
+#include <__type_traits/remove_cvref.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// TODO: Use the std::copy/move shenanigans to forward to std::memmove
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _ForwardOutIterator,
+ enable_if_t<is_execution_policy_v<__remove_cvref_t<_ExecutionPolicy>>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator
+copy(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _ForwardOutIterator __result) {
+ return std::transform(__policy, __first, __last, __result, __identity());
+}
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _ForwardOutIterator,
+ class _Size,
+ enable_if_t<is_execution_policy_v<__remove_cvref_t<_ExecutionPolicy>>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator
+copy_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _Size __n, _ForwardOutIterator __result) {
+ if constexpr (__has_random_access_iterator_category<_ForwardIterator>::value)
+ return std::copy(__policy, __first, __first + __n, __result);
+ else
+ return std::copy_n(__first, __n, __result);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_COPY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_count.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_count.h
new file mode 100644
index 00000000000..15acb85de0b
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_count.h
@@ -0,0 +1,89 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_COUNT_H
+#define _LIBCPP___ALGORITHM_PSTL_COUNT_H
+
+#include <__algorithm/count.h>
+#include <__algorithm/for_each.h>
+#include <__algorithm/pstl_backend.h>
+#include <__algorithm/pstl_for_each.h>
+#include <__algorithm/pstl_frontend_dispatch.h>
+#include <__atomic/atomic.h>
+#include <__config>
+#include <__functional/operations.h>
+#include <__iterator/iterator_traits.h>
+#include <__numeric/pstl_transform_reduce.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/remove_cvref.h>
+#include <__utility/move.h>
+#include <__utility/terminate_on_exception.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class>
+void __pstl_count_if(); // declaration needed for the frontend dispatch below
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Predicate,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI __iter_diff_t<_ForwardIterator>
+count_if(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {
+ using __diff_t = __iter_diff_t<_ForwardIterator>;
+ return std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_count_if),
+ [&](_ForwardIterator __g_first, _ForwardIterator __g_last, _Predicate __g_pred) {
+ return std::transform_reduce(
+ __policy,
+ std::move(__g_first),
+ std::move(__g_last),
+ __diff_t(),
+ std::plus{},
+ [&](__iter_reference<_ForwardIterator> __element) -> bool { return __g_pred(__element); });
+ },
+ std::move(__first),
+ std::move(__last),
+ std::move(__pred));
+}
+
+template <class>
+void __pstl_count(); // declaration needed for the frontend dispatch below
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Tp,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI __iter_diff_t<_ForwardIterator>
+count(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
+ return std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_count),
+ [&](_ForwardIterator __g_first, _ForwardIterator __g_last, const _Tp& __g_value) {
+ return std::count_if(__policy, __g_first, __g_last, [&](__iter_reference<_ForwardIterator> __v) {
+ return __v == __g_value;
+ });
+ },
+ std::move(__first),
+ std::move(__last),
+ __value);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_COUNT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_fill.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_fill.h
new file mode 100644
index 00000000000..d64c828d904
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_fill.h
@@ -0,0 +1,84 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_FILL_H
+#define _LIBCPP___ALGORITHM_PSTL_FILL_H
+
+#include <__algorithm/fill_n.h>
+#include <__algorithm/pstl_for_each.h>
+#include <__algorithm/pstl_frontend_dispatch.h>
+#include <__config>
+#include <__iterator/cpp17_iterator_concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/remove_cvref.h>
+#include <__utility/move.h>
+#include <__utility/terminate_on_exception.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class>
+void __pstl_fill(); // declaration needed for the frontend dispatch below
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Tp,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void
+fill(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator);
+ std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_fill),
+ [&](_ForwardIterator __g_first, _ForwardIterator __g_last, const _Tp& __g_value) {
+ std::for_each(__policy, __g_first, __g_last, [&](__iter_reference<_ForwardIterator> __element) {
+ __element = __g_value;
+ });
+ },
+ std::move(__first),
+ std::move(__last),
+ __value);
+}
+
+template <class>
+void __pstl_fill_n(); // declaration needed for the frontend dispatch below
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _SizeT,
+ class _Tp,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void
+fill_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _SizeT __n, const _Tp& __value) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator);
+ std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_fill_n),
+ [&](_ForwardIterator __g_first, _SizeT __g_n, const _Tp& __g_value) {
+ if constexpr (__has_random_access_iterator_category<_ForwardIterator>::value)
+ std::fill(__policy, __g_first, __g_first + __g_n, __g_value);
+ else
+ std::fill_n(__g_first, __g_n, __g_value);
+ },
+ std::move(__first),
+ __n,
+ __value);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_FILL_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_find.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_find.h
new file mode 100644
index 00000000000..8e8adfecfa4
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_find.h
@@ -0,0 +1,95 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_FIND_H
+#define _LIBCPP___ALGORITHM_PSTL_FIND_H
+
+#include <__algorithm/comp.h>
+#include <__algorithm/find.h>
+#include <__algorithm/pstl_backend.h>
+#include <__algorithm/pstl_frontend_dispatch.h>
+#include <__config>
+#include <__iterator/cpp17_iterator_concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/remove_cvref.h>
+#include <__utility/move.h>
+#include <__utility/terminate_on_exception.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Predicate,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _ForwardIterator
+find_if(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator);
+ using _Backend = typename __select_backend<_RawPolicy>::type;
+ return std::__pstl_find_if<_RawPolicy>(_Backend{}, std::move(__first), std::move(__last), std::move(__pred));
+}
+
+template <class>
+void __pstl_find_if_not();
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Predicate,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _ForwardIterator
+find_if_not(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator);
+ return std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_find_if_not),
+ [&](_ForwardIterator __g_first, _ForwardIterator __g_last, _Predicate __g_pred) {
+ return std::find_if(__policy, __g_first, __g_last, [&](__iter_reference<_ForwardIterator> __value) {
+ return !__g_pred(__value);
+ });
+ },
+ std::move(__first),
+ std::move(__last),
+ std::move(__pred));
+}
+
+template <class>
+void __pstl_find();
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Tp,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _ForwardIterator
+find(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator);
+ return std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_find),
+ [&](_ForwardIterator __g_first, _ForwardIterator __g_last, const _Tp& __g_value) {
+ return std::find_if(__policy, __g_first, __g_last, [&](__iter_reference<_ForwardIterator> __element) {
+ return __element == __g_value;
+ });
+ },
+ std::move(__first),
+ std::move(__last),
+ __value);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_FIND_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_for_each.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_for_each.h
new file mode 100644
index 00000000000..09efc24950d
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_for_each.h
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_FOR_EACH_H
+#define _LIBCPP___ALGORITHM_PSTL_FOR_EACH_H
+
+#include <__algorithm/for_each.h>
+#include <__algorithm/for_each_n.h>
+#include <__algorithm/pstl_backend.h>
+#include <__algorithm/pstl_frontend_dispatch.h>
+#include <__config>
+#include <__iterator/cpp17_iterator_concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/void_t.h>
+#include <__utility/move.h>
+#include <__utility/terminate_on_exception.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Function,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void
+for_each(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Function __func) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator);
+ using _Backend = typename __select_backend<_RawPolicy>::type;
+ std::__pstl_for_each<_RawPolicy>(_Backend{}, std::move(__first), std::move(__last), std::move(__func));
+}
+
+template <class>
+void __pstl_for_each_n(); // declaration needed for the frontend dispatch below
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Size,
+ class _Function,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void
+for_each_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _Size __size, _Function __func) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator);
+ return std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_for_each_n),
+ [&](_ForwardIterator __g_first, _Size __g_size, _Function __g_func) {
+ if constexpr (__has_random_access_iterator_category<_ForwardIterator>::value) {
+ std::for_each(__policy, std::move(__g_first), __g_first + __g_size, std::move(__g_func));
+ } else {
+ std::for_each_n(std::move(__g_first), __g_size, std::move(__g_func));
+ }
+ },
+ __first,
+ __size,
+ std::move(__func));
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_FOR_EACH_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_frontend_dispatch.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_frontend_dispatch.h
new file mode 100644
index 00000000000..dc49f3e5163
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_frontend_dispatch.h
@@ -0,0 +1,45 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_FRONTEND_DISPATCH
+#define _LIBCPP___ALGORITHM_PSTL_FRONTEND_DISPATCH
+
+#include <__config>
+#include <__type_traits/is_callable.h>
+#include <__utility/forward.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+# define _LIBCPP_PSTL_CUSTOMIZATION_POINT(name) \
+ [](auto&&... __args) -> decltype(std::name<_RawPolicy>(typename __select_backend<_RawPolicy>::type{}, \
+ std::forward<decltype(__args)>(__args)...)) { \
+ return std::name<_RawPolicy>( \
+ typename __select_backend<_RawPolicy>::type{}, std::forward<decltype(__args)>(__args)...); \
+ }
+
+template <class _SpecializedImpl, class _GenericImpl, class... _Args>
+_LIBCPP_HIDE_FROM_ABI decltype(auto)
+__pstl_frontend_dispatch(_SpecializedImpl __specialized_impl, _GenericImpl __generic_impl, _Args&&... __args) {
+ if constexpr (__is_callable<_SpecializedImpl, _Args...>::value) {
+ return __specialized_impl(std::forward<_Args>(__args)...);
+ } else {
+ return __generic_impl(std::forward<_Args>(__args)...);
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_FRONTEND_DISPATCH
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_generate.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_generate.h
new file mode 100644
index 00000000000..e1ba0183dcb
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_generate.h
@@ -0,0 +1,82 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_GENERATE_H
+#define _LIBCPP___ALGORITHM_PSTL_GENERATE_H
+
+#include <__algorithm/pstl_backend.h>
+#include <__algorithm/pstl_for_each.h>
+#include <__algorithm/pstl_frontend_dispatch.h>
+#include <__config>
+#include <__iterator/cpp17_iterator_concepts.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/remove_cvref.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class>
+void __pstl_generate();
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Generator,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void
+generate(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Generator __gen) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator);
+ std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_generate),
+ [&__policy](_ForwardIterator __g_first, _ForwardIterator __g_last, _Generator __g_gen) {
+ std::for_each(
+ __policy, std::move(__g_first), std::move(__g_last), [&](__iter_reference<_ForwardIterator> __element) {
+ __element = __g_gen();
+ });
+ },
+ std::move(__first),
+ std::move(__last),
+ std::move(__gen));
+}
+
+template <class>
+void __pstl_generate_n();
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Size,
+ class _Generator,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void
+generate_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _Size __n, _Generator __gen) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator);
+ std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_generate_n),
+ [&__policy](_ForwardIterator __g_first, _Size __g_n, _Generator __g_gen) {
+ std::for_each_n(__policy, std::move(__g_first), __g_n, [&](__iter_reference<_ForwardIterator> __element) {
+ __element = __g_gen();
+ });
+ },
+ std::move(__first),
+ __n,
+ std::move(__gen));
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_GENERATE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_is_partitioned.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_is_partitioned.h
new file mode 100644
index 00000000000..6f6e9b2f447
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_is_partitioned.h
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_IS_PARITTIONED
+#define _LIBCPP___ALGORITHM_PSTL_IS_PARITTIONED
+
+#include <__algorithm/pstl_any_all_none_of.h>
+#include <__algorithm/pstl_backend.h>
+#include <__algorithm/pstl_find.h>
+#include <__algorithm/pstl_frontend_dispatch.h>
+#include <__config>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/remove_cvref.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class>
+void __pstl_is_partitioned();
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Predicate,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI bool
+is_partitioned(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {
+ return std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_is_partitioned),
+ [&__policy](_ForwardIterator __g_first, _ForwardIterator __g_last, _Predicate __g_pred) {
+ __g_first = std::find_if_not(__policy, __g_first, __g_last, __g_pred);
+ if (__g_first == __g_last)
+ return true;
+ ++__g_first;
+ return std::none_of(__policy, __g_first, __g_last, __g_pred);
+ },
+ std::move(__first),
+ std::move(__last),
+ std::move(__pred));
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_IS_PARITTIONED
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_merge.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_merge.h
new file mode 100644
index 00000000000..f10ac767428
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_merge.h
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_MERGE_H
+#define _LIBCPP___ALGORITHM_PSTL_MERGE_H
+
+#include <__algorithm/pstl_backend.h>
+#include <__config>
+#include <__functional/operations.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/remove_cvref.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator1,
+ class _ForwardIterator2,
+ class _ForwardOutIterator,
+ class _Comp = std::less<>,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator
+merge(_ExecutionPolicy&&,
+ _ForwardIterator1 __first1,
+ _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2,
+ _ForwardOutIterator __result,
+ _Comp __comp = {}) {
+ using _Backend = typename __select_backend<_RawPolicy>::type;
+ return std::__pstl_merge<_RawPolicy>(
+ _Backend{},
+ std::move(__first1),
+ std::move(__last1),
+ std::move(__first2),
+ std::move(__last2),
+ std::move(__result),
+ std::move(__comp));
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_MERGE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_replace.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_replace.h
new file mode 100644
index 00000000000..04ffaaba596
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_replace.h
@@ -0,0 +1,167 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_REPLACE_H
+#define _LIBCPP___ALGORITHM_PSTL_REPLACE_H
+
+#include <__algorithm/pstl_backend.h>
+#include <__algorithm/pstl_for_each.h>
+#include <__algorithm/pstl_frontend_dispatch.h>
+#include <__algorithm/pstl_transform.h>
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/remove_cvref.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class>
+void __pstl_replace_if();
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Pred,
+ class _Tp,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void
+replace_if(_ExecutionPolicy&& __policy,
+ _ForwardIterator __first,
+ _ForwardIterator __last,
+ _Pred __pred,
+ const _Tp& __new_value) {
+ std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_replace_if),
+ [&__policy](_ForwardIterator __g_first, _ForwardIterator __g_last, _Pred __g_pred, const _Tp& __g_new_value) {
+ std::for_each(__policy, __g_first, __g_last, [&](__iter_reference<_ForwardIterator> __element) {
+ if (__g_pred(__element))
+ __element = __g_new_value;
+ });
+ },
+ std::move(__first),
+ std::move(__last),
+ std::move(__pred),
+ __new_value);
+}
+
+template <class>
+void __pstl_replace();
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Tp,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void
+replace(_ExecutionPolicy&& __policy,
+ _ForwardIterator __first,
+ _ForwardIterator __last,
+ const _Tp& __old_value,
+ const _Tp& __new_value) {
+ std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_replace),
+ [&__policy](
+ _ForwardIterator __g_first, _ForwardIterator __g_last, const _Tp& __g_old_value, const _Tp& __g_new_value) {
+ std::replace_if(
+ __policy,
+ std::move(__g_first),
+ std::move(__g_last),
+ [&](__iter_reference<_ForwardIterator> __element) { return __element == __g_old_value; },
+ __g_new_value);
+ },
+ std::move(__first),
+ std::move(__last),
+ __old_value,
+ __new_value);
+}
+
+template <class>
+void __pstl_replace_copy_if();
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _ForwardOutIterator,
+ class _Pred,
+ class _Tp,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void replace_copy_if(
+ _ExecutionPolicy&& __policy,
+ _ForwardIterator __first,
+ _ForwardIterator __last,
+ _ForwardOutIterator __result,
+ _Pred __pred,
+ const _Tp& __new_value) {
+ std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_replace_copy_if),
+ [&__policy](_ForwardIterator __g_first,
+ _ForwardIterator __g_last,
+ _ForwardOutIterator __g_result,
+ _Pred __g_pred,
+ const _Tp& __g_new_value) {
+ std::transform(__policy, __g_first, __g_last, __g_result, [&](__iter_reference<_ForwardIterator> __element) {
+ return __g_pred(__element) ? __g_new_value : __element;
+ });
+ },
+ std::move(__first),
+ std::move(__last),
+ std::move(__result),
+ std::move(__pred),
+ __new_value);
+}
+
+template <class>
+void __pstl_replace_copy();
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _ForwardOutIterator,
+ class _Tp,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void replace_copy(
+ _ExecutionPolicy&& __policy,
+ _ForwardIterator __first,
+ _ForwardIterator __last,
+ _ForwardOutIterator __result,
+ const _Tp& __old_value,
+ const _Tp& __new_value) {
+ std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_replace_copy),
+ [&__policy](_ForwardIterator __g_first,
+ _ForwardIterator __g_last,
+ _ForwardOutIterator __g_result,
+ const _Tp& __g_old_value,
+ const _Tp& __g_new_value) {
+ return std::replace_copy_if(
+ __policy,
+ std::move(__g_first),
+ std::move(__g_last),
+ std::move(__g_result),
+ [&](__iter_reference<_ForwardIterator> __element) { return __element == __g_old_value; },
+ __g_new_value);
+ },
+ std::move(__first),
+ std::move(__last),
+ std::move(__result),
+ __old_value,
+ __new_value);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_REPLACE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_sort.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_sort.h
new file mode 100644
index 00000000000..75c77ed4052
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_sort.h
@@ -0,0 +1,63 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_SORT_H
+#define _LIBCPP___ALGORITHM_PSTL_SORT_H
+
+#include <__algorithm/pstl_backend.h>
+#include <__algorithm/pstl_frontend_dispatch.h>
+#include <__algorithm/pstl_stable_sort.h>
+#include <__config>
+#include <__functional/operations.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/remove_cvref.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class>
+void __pstl_sort();
+
+template <class _ExecutionPolicy,
+ class _RandomAccessIterator,
+ class _Comp,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void
+sort(_ExecutionPolicy&& __policy, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
+ std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_sort),
+ [&__policy](_RandomAccessIterator __g_first, _RandomAccessIterator __g_last, _Comp __g_comp) {
+ std::stable_sort(__policy, std::move(__g_first), std::move(__g_last), std::move(__g_comp));
+ },
+ std::move(__first),
+ std::move(__last),
+ std::move(__comp));
+}
+
+template <class _ExecutionPolicy,
+ class _RandomAccessIterator,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void
+sort(_ExecutionPolicy&& __policy, _RandomAccessIterator __first, _RandomAccessIterator __last) {
+ std::sort(std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), less{});
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_SORT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_stable_sort.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_stable_sort.h
new file mode 100644
index 00000000000..510ffd86298
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_stable_sort.h
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_STABLE_SORT_H
+#define _LIBCPP___ALGORITHM_PSTL_STABLE_SORT_H
+
+#include <__algorithm/pstl_backend.h>
+#include <__config>
+#include <__functional/operations.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/remove_cvref.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ExecutionPolicy,
+ class _RandomAccessIterator,
+ class _Comp = less<>,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void
+stable_sort(_ExecutionPolicy&&, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp = {}) {
+ using _Backend = typename __select_backend<_RawPolicy>::type;
+ std::__pstl_stable_sort<_RawPolicy>(_Backend{}, std::move(__first), std::move(__last), std::move(__comp));
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_STABLE_SORT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_transform.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_transform.h
new file mode 100644
index 00000000000..27d95349fc8
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/pstl_transform.h
@@ -0,0 +1,77 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_PSTL_TRANSFORM_H
+#define _LIBCPP___ALGORITHM_PSTL_TRANSFORM_H
+
+#include <__algorithm/pstl_backend.h>
+#include <__config>
+#include <__iterator/cpp17_iterator_concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/remove_cvref.h>
+#include <__utility/move.h>
+#include <__utility/terminate_on_exception.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _ForwardOutIterator,
+ class _UnaryOperation,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator transform(
+ _ExecutionPolicy&&,
+ _ForwardIterator __first,
+ _ForwardIterator __last,
+ _ForwardOutIterator __result,
+ _UnaryOperation __op) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator);
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardOutIterator);
+ _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(_ForwardOutIterator, decltype(__op(*__first)));
+ using _Backend = typename __select_backend<_RawPolicy>::type;
+ return std::__pstl_transform<_RawPolicy>(
+ _Backend{}, std::move(__first), std::move(__last), std::move(__result), std::move(__op));
+}
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator1,
+ class _ForwardIterator2,
+ class _ForwardOutIterator,
+ class _BinaryOperation,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _ForwardOutIterator transform(
+ _ExecutionPolicy&&,
+ _ForwardIterator1 __first1,
+ _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2,
+ _ForwardOutIterator __result,
+ _BinaryOperation __op) {
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1);
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2);
+ _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardOutIterator);
+ _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(_ForwardOutIterator, decltype(__op(*__first1, *__first2)));
+ using _Backend = typename __select_backend<_RawPolicy>::type;
+ return std::__pstl_transform<_RawPolicy>(
+ _Backend{}, std::move(__first1), std::move(__last1), std::move(__first2), std::move(__result), std::move(__op));
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___ALGORITHM_PSTL_TRANSFORM_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/push_heap.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/push_heap.h
index 90684957744..82b571e44bd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/push_heap.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/push_heap.h
@@ -14,13 +14,17 @@
#include <__algorithm/iterator_operations.h>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
#include <__utility/move.h>
-#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
template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
@@ -68,10 +72,11 @@ void push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Com
template <class _RandomAccessIterator>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) {
- std::push_heap(std::move(__first), std::move(__last),
- __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+ std::push_heap(std::move(__first), std::move(__last), __less<>());
}
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ALGORITHM_PUSH_HEAP_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_adjacent_find.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_adjacent_find.h
index d338d13e6ee..5f33192666a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_adjacent_find.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_adjacent_find.h
@@ -24,17 +24,16 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __adjacent_find {
struct __fn {
-
template <class _Iter, class _Sent, class _Proj, class _Pred>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- _Iter __adjacent_find_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static _Iter
+ __adjacent_find_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
if (__first == __last)
return __first;
@@ -47,32 +46,33 @@ struct __fn {
return __i;
}
- template <forward_iterator _Iter, sentinel_for<_Iter> _Sent,
- class _Proj = identity,
+ template <forward_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Proj = identity,
indirect_binary_predicate<projected<_Iter, _Proj>, projected<_Iter, _Proj>> _Pred = ranges::equal_to>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last, _Pred __pred = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, _Sent __last, _Pred __pred = {}, _Proj __proj = {}) const {
return __adjacent_find_impl(std::move(__first), std::move(__last), __pred, __proj);
}
template <forward_range _Range,
class _Proj = identity,
- indirect_binary_predicate<projected<iterator_t<_Range>, _Proj>,
- projected<iterator_t<_Range>, _Proj>> _Pred = ranges::equal_to>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __range, _Pred __pred = {}, _Proj __proj = {}) const {
+ indirect_binary_predicate<projected<iterator_t<_Range>, _Proj>, projected<iterator_t<_Range>, _Proj>>
+ _Pred = ranges::equal_to>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+ operator()(_Range&& __range, _Pred __pred = {}, _Proj __proj = {}) const {
return __adjacent_find_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
}
};
} // namespace __adjacent_find
inline namespace __cpo {
- inline constexpr auto adjacent_find = __adjacent_find::__fn{};
+inline constexpr auto adjacent_find = __adjacent_find::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_ADJACENT_FIND_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_all_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_all_of.h
index e45c4e58437..39a2ae4de01 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_all_of.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_all_of.h
@@ -22,17 +22,15 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __all_of {
struct __fn {
-
template <class _Iter, class _Sent, class _Proj, class _Pred>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- bool __all_of_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static bool __all_of_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
for (; __first != __last; ++__first) {
if (!std::invoke(__pred, std::invoke(__proj, *__first)))
return false;
@@ -40,29 +38,32 @@ struct __fn {
return true;
}
- template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+ template <input_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
return __all_of_impl(std::move(__first), std::move(__last), __pred, __proj);
}
- template <input_range _Range, class _Proj = identity,
+ template <input_range _Range,
+ class _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
return __all_of_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
}
};
} // namespace __all_of
inline namespace __cpo {
- inline constexpr auto all_of = __all_of::__fn{};
+inline constexpr auto all_of = __all_of::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_ALL_OF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_any_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_any_of.h
index e7d1e723a70..2ca8531102e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_any_of.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_any_of.h
@@ -22,17 +22,15 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __any_of {
struct __fn {
-
template <class _Iter, class _Sent, class _Proj, class _Pred>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- bool __any_of_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static bool __any_of_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
for (; __first != __last; ++__first) {
if (std::invoke(__pred, std::invoke(__proj, *__first)))
return true;
@@ -40,29 +38,32 @@ struct __fn {
return false;
}
- template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+ template <input_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Iter __first, _Sent __last, _Pred __pred = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Iter __first, _Sent __last, _Pred __pred = {}, _Proj __proj = {}) const {
return __any_of_impl(std::move(__first), std::move(__last), __pred, __proj);
}
- template <input_range _Range, class _Proj = identity,
+ template <input_range _Range,
+ class _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
return __any_of_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
}
};
} // namespace __any_of
inline namespace __cpo {
- inline constexpr auto any_of = __any_of::__fn{};
+inline constexpr auto any_of = __any_of::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_ANY_OF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_binary_search.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_binary_search.h
index d72d4e05740..22008e0f1bc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_binary_search.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_binary_search.h
@@ -24,40 +24,45 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __binary_search {
struct __fn {
- template <forward_iterator _Iter, sentinel_for<_Iter> _Sent, class _Type, class _Proj = identity,
+ template <forward_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Type,
+ class _Proj = identity,
indirect_strict_weak_order<const _Type*, projected<_Iter, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Iter __first, _Sent __last, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
- auto __ret = std::__lower_bound_impl<_RangeAlgPolicy>(__first, __last, __value, __comp, __proj);
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Iter __first, _Sent __last, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
+ auto __ret = std::__lower_bound<_RangeAlgPolicy>(__first, __last, __value, __comp, __proj);
return __ret != __last && !std::invoke(__comp, __value, std::invoke(__proj, *__ret));
}
- template <forward_range _Range, class _Type, class _Proj = identity,
+ template <forward_range _Range,
+ class _Type,
+ class _Proj = identity,
indirect_strict_weak_order<const _Type*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Range&& __r, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Range&& __r, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
auto __first = ranges::begin(__r);
- auto __last = ranges::end(__r);
- auto __ret = std::__lower_bound_impl<_RangeAlgPolicy>(__first, __last, __value, __comp, __proj);
+ auto __last = ranges::end(__r);
+ auto __ret = std::__lower_bound<_RangeAlgPolicy>(__first, __last, __value, __comp, __proj);
return __ret != __last && !std::invoke(__comp, __value, std::invoke(__proj, *__ret));
}
};
} // namespace __binary_search
inline namespace __cpo {
- inline constexpr auto binary_search = __binary_search::__fn{};
+inline constexpr auto binary_search = __binary_search::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_BINARY_SEARCH_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_clamp.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_clamp.h
index 09a97fc790e..9613f7f3772 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_clamp.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_clamp.h
@@ -22,25 +22,20 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __clamp {
struct __fn {
-
template <class _Type,
- class _Proj = identity,
+ class _Proj = identity,
indirect_strict_weak_order<projected<const _Type*, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- const _Type& operator()(const _Type& __value,
- const _Type& __low,
- const _Type& __high,
- _Comp __comp = {},
- _Proj __proj = {}) const {
- _LIBCPP_ASSERT(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))),
- "Bad bounds passed to std::ranges::clamp");
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr const _Type& operator()(
+ const _Type& __value, const _Type& __low, const _Type& __high, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_ASSERT_UNCATEGORIZED(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))),
+ "Bad bounds passed to std::ranges::clamp");
if (std::invoke(__comp, std::invoke(__proj, __value), std::invoke(__proj, __low)))
return __low;
@@ -49,17 +44,16 @@ struct __fn {
else
return __value;
}
-
};
} // namespace __clamp
inline namespace __cpo {
- inline constexpr auto clamp = __clamp::__fn{};
+inline constexpr auto clamp = __clamp::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_CLAMP_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy.h
index bb02c84efbd..1c87f074e7c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -36,19 +36,18 @@ using copy_result = in_out_result<_InIter, _OutIter>;
namespace __copy {
struct __fn {
-
template <input_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter>
requires indirectly_copyable<_InIter, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- copy_result<_InIter, _OutIter> operator()(_InIter __first, _Sent __last, _OutIter __result) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr copy_result<_InIter, _OutIter>
+ operator()(_InIter __first, _Sent __last, _OutIter __result) const {
auto __ret = std::__copy<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
return {std::move(__ret.first), std::move(__ret.second)};
}
template <input_range _Range, weakly_incrementable _OutIter>
requires indirectly_copyable<iterator_t<_Range>, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- copy_result<borrowed_iterator_t<_Range>, _OutIter> operator()(_Range&& __r, _OutIter __result) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr copy_result<borrowed_iterator_t<_Range>, _OutIter>
+ operator()(_Range&& __r, _OutIter __result) const {
auto __ret = std::__copy<_RangeAlgPolicy>(ranges::begin(__r), ranges::end(__r), std::move(__result));
return {std::move(__ret.first), std::move(__ret.second)};
}
@@ -56,12 +55,12 @@ struct __fn {
} // namespace __copy
inline namespace __cpo {
- inline constexpr auto copy = __copy::__fn{};
+inline constexpr auto copy = __copy::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_COPY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_backward.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_backward.h
index f41af66f39f..865e944d438 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_backward.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_backward.h
@@ -23,30 +23,29 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
-template<class _Ip, class _Op>
+template <class _Ip, class _Op>
using copy_backward_result = in_out_result<_Ip, _Op>;
namespace __copy_backward {
struct __fn {
-
template <bidirectional_iterator _InIter1, sentinel_for<_InIter1> _Sent1, bidirectional_iterator _InIter2>
requires indirectly_copyable<_InIter1, _InIter2>
- _LIBCPP_HIDE_FROM_ABI constexpr
- copy_backward_result<_InIter1, _InIter2> operator()(_InIter1 __first, _Sent1 __last, _InIter2 __result) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr copy_backward_result<_InIter1, _InIter2>
+ operator()(_InIter1 __first, _Sent1 __last, _InIter2 __result) const {
auto __ret = std::__copy_backward<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
return {std::move(__ret.first), std::move(__ret.second)};
}
template <bidirectional_range _Range, bidirectional_iterator _Iter>
requires indirectly_copyable<iterator_t<_Range>, _Iter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- copy_backward_result<borrowed_iterator_t<_Range>, _Iter> operator()(_Range&& __r, _Iter __result) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr copy_backward_result<borrowed_iterator_t<_Range>, _Iter>
+ operator()(_Range&& __r, _Iter __result) const {
auto __ret = std::__copy_backward<_RangeAlgPolicy>(ranges::begin(__r), ranges::end(__r), std::move(__result));
return {std::move(__ret.first), std::move(__ret.second)};
}
@@ -54,12 +53,12 @@ struct __fn {
} // namespace __copy_backward
inline namespace __cpo {
- inline constexpr auto copy_backward = __copy_backward::__fn{};
+inline constexpr auto copy_backward = __copy_backward::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_COPY_BACKWARD_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_if.h
index dba41c3b3ab..b77dbd37fce 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_if.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_if.h
@@ -24,21 +24,19 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
-template<class _Ip, class _Op>
+template <class _Ip, class _Op>
using copy_if_result = in_out_result<_Ip, _Op>;
namespace __copy_if {
struct __fn {
-
template <class _InIter, class _Sent, class _OutIter, class _Proj, class _Pred>
- _LIBCPP_HIDE_FROM_ABI static constexpr
- copy_if_result <_InIter, _OutIter>
+ _LIBCPP_HIDE_FROM_ABI static constexpr copy_if_result<_InIter, _OutIter>
__copy_if_impl(_InIter __first, _Sent __last, _OutIter __result, _Pred& __pred, _Proj& __proj) {
for (; __first != __last; ++__first) {
if (std::invoke(__pred, std::invoke(__proj, *__first))) {
@@ -49,20 +47,23 @@ struct __fn {
return {std::move(__first), std::move(__result)};
}
- template <input_iterator _Iter, sentinel_for<_Iter> _Sent, weakly_incrementable _OutIter, class _Proj = identity,
+ template <input_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ weakly_incrementable _OutIter,
+ class _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
requires indirectly_copyable<_Iter, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- copy_if_result<_Iter, _OutIter>
+ _LIBCPP_HIDE_FROM_ABI constexpr copy_if_result<_Iter, _OutIter>
operator()(_Iter __first, _Sent __last, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
return __copy_if_impl(std::move(__first), std::move(__last), std::move(__result), __pred, __proj);
}
- template <input_range _Range, weakly_incrementable _OutIter, class _Proj = identity,
+ template <input_range _Range,
+ weakly_incrementable _OutIter,
+ class _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
requires indirectly_copyable<iterator_t<_Range>, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
+ _LIBCPP_HIDE_FROM_ABI constexpr copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
operator()(_Range&& __r, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
return __copy_if_impl(ranges::begin(__r), ranges::end(__r), std::move(__result), __pred, __proj);
}
@@ -70,12 +71,12 @@ struct __fn {
} // namespace __copy_if
inline namespace __cpo {
- inline constexpr auto copy_if = __copy_if::__fn{};
+inline constexpr auto copy_if = __copy_if::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_COPY_IF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_n.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_n.h
index 04bb80b3ba1..99e8eee14d0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_n.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_copy_n.h
@@ -27,7 +27,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -36,10 +36,9 @@ using copy_n_result = in_out_result<_Ip, _Op>;
namespace __copy_n {
struct __fn {
-
template <class _InIter, class _DiffType, class _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- copy_n_result<_InIter, _OutIter> __go(_InIter __first, _DiffType __n, _OutIter __result) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static copy_n_result<_InIter, _OutIter>
+ __go(_InIter __first, _DiffType __n, _OutIter __result) {
while (__n != 0) {
*__result = *__first;
++__first;
@@ -50,27 +49,27 @@ struct __fn {
}
template <random_access_iterator _InIter, class _DiffType, random_access_iterator _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- copy_n_result<_InIter, _OutIter> __go(_InIter __first, _DiffType __n, _OutIter __result) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static copy_n_result<_InIter, _OutIter>
+ __go(_InIter __first, _DiffType __n, _OutIter __result) {
auto __ret = std::__copy<_RangeAlgPolicy>(__first, __first + __n, __result);
return {__ret.first, __ret.second};
}
template <input_iterator _Ip, weakly_incrementable _Op>
requires indirectly_copyable<_Ip, _Op>
- _LIBCPP_HIDE_FROM_ABI constexpr
- copy_n_result<_Ip, _Op> operator()(_Ip __first, iter_difference_t<_Ip> __n, _Op __result) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr copy_n_result<_Ip, _Op>
+ operator()(_Ip __first, iter_difference_t<_Ip> __n, _Op __result) const {
return __go(std::move(__first), __n, std::move(__result));
}
};
} // namespace __copy_n
inline namespace __cpo {
- inline constexpr auto copy_n = __copy_n::__fn{};
+inline constexpr auto copy_n = __copy_n::__fn{};
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count.h
index 527dd062008..82f54567561 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -34,16 +34,16 @@ namespace __count {
struct __fn {
template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Type, class _Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<_Iter, _Proj>, const _Type*>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- iter_difference_t<_Iter> operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter>
+ operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) const {
auto __pred = [&](auto&& __e) { return __e == __value; };
return ranges::__count_if_impl(std::move(__first), std::move(__last), __pred, __proj);
}
template <input_range _Range, class _Type, class _Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type*>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- range_difference_t<_Range> operator()(_Range&& __r, const _Type& __value, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr range_difference_t<_Range>
+ operator()(_Range&& __r, const _Type& __value, _Proj __proj = {}) const {
auto __pred = [&](auto&& __e) { return __e == __value; };
return ranges::__count_if_impl(ranges::begin(__r), ranges::end(__r), __pred, __proj);
}
@@ -51,12 +51,12 @@ struct __fn {
} // namespace __count
inline namespace __cpo {
- inline constexpr auto count = __count::__fn{};
+inline constexpr auto count = __count::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_COUNT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count_if.h
index 931618b7b54..92f37d049e0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count_if.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_count_if.h
@@ -25,15 +25,14 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
template <class _Iter, class _Sent, class _Proj, class _Pred>
-_LIBCPP_HIDE_FROM_ABI constexpr
-iter_difference_t<_Iter> __count_if_impl(_Iter __first, _Sent __last,
- _Pred& __pred, _Proj& __proj) {
+_LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter>
+__count_if_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
iter_difference_t<_Iter> __counter(0);
for (; __first != __last; ++__first) {
if (std::invoke(__pred, std::invoke(__proj, *__first)))
@@ -44,29 +43,32 @@ iter_difference_t<_Iter> __count_if_impl(_Iter __first, _Sent __last,
namespace __count_if {
struct __fn {
- template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+ template <input_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Predicate>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- iter_difference_t<_Iter> operator()(_Iter __first, _Sent __last, _Predicate __pred, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter>
+ operator()(_Iter __first, _Sent __last, _Predicate __pred, _Proj __proj = {}) const {
return ranges::__count_if_impl(std::move(__first), std::move(__last), __pred, __proj);
}
- template <input_range _Range, class _Proj = identity,
+ template <input_range _Range,
+ class _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Predicate>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- range_difference_t<_Range> operator()(_Range&& __r, _Predicate __pred, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr range_difference_t<_Range>
+ operator()(_Range&& __r, _Predicate __pred, _Proj __proj = {}) const {
return ranges::__count_if_impl(ranges::begin(__r), ranges::end(__r), __pred, __proj);
}
};
} // namespace __count_if
inline namespace __cpo {
- inline constexpr auto count_if = __count_if::__fn{};
+inline constexpr auto count_if = __count_if::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_COUNT_IF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal.h
index 3c417f09de9..4cb1f7df195 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal.h
@@ -9,6 +9,8 @@
#ifndef _LIBCPP___ALGORITHM_RANGES_EQUAL_H
#define _LIBCPP___ALGORITHM_RANGES_EQUAL_H
+#include <__algorithm/equal.h>
+#include <__algorithm/unwrap_range.h>
#include <__config>
#include <__functional/identity.h>
#include <__functional/invoke.h>
@@ -24,92 +26,79 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __equal {
struct __fn {
-private:
- template <class _Iter1, class _Sent1,
- class _Iter2, class _Sent2,
- class _Pred,
- class _Proj1,
- class _Proj2>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- bool __equal_impl(_Iter1 __first1, _Sent1 __last1,
- _Iter2 __first2, _Sent2 __last2,
- _Pred& __pred,
- _Proj1& __proj1,
- _Proj2& __proj2) {
- while (__first1 != __last1 && __first2 != __last2) {
- if (!std::invoke(__pred, std::invoke(__proj1, *__first1), std::invoke(__proj2, *__first2)))
- return false;
- ++__first1;
- ++__first2;
- }
- return __first1 == __last1 && __first2 == __last2;
- }
-
-public:
-
- template <input_iterator _Iter1, sentinel_for<_Iter1> _Sent1,
- input_iterator _Iter2, sentinel_for<_Iter2> _Sent2,
- class _Pred = ranges::equal_to,
+ template <input_iterator _Iter1,
+ sentinel_for<_Iter1> _Sent1,
+ input_iterator _Iter2,
+ sentinel_for<_Iter2> _Sent2,
+ class _Pred = ranges::equal_to,
class _Proj1 = identity,
class _Proj2 = identity>
requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Iter1 __first1, _Sent1 __last1,
- _Iter2 __first2, _Sent2 __last2,
- _Pred __pred = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
+ _Iter1 __first1,
+ _Sent1 __last1,
+ _Iter2 __first2,
+ _Sent2 __last2,
+ _Pred __pred = {},
+ _Proj1 __proj1 = {},
+ _Proj2 __proj2 = {}) const {
if constexpr (sized_sentinel_for<_Sent1, _Iter1> && sized_sentinel_for<_Sent2, _Iter2>) {
if (__last1 - __first1 != __last2 - __first2)
return false;
}
- return __equal_impl(std::move(__first1), std::move(__last1),
- std::move(__first2), std::move(__last2),
- __pred,
- __proj1,
- __proj2);
+ auto __unwrapped1 = std::__unwrap_range(std::move(__first1), std::move(__last1));
+ auto __unwrapped2 = std::__unwrap_range(std::move(__first2), std::move(__last2));
+ return std::__equal_impl(
+ std::move(__unwrapped1.first),
+ std::move(__unwrapped1.second),
+ std::move(__unwrapped2.first),
+ std::move(__unwrapped2.second),
+ __pred,
+ __proj1,
+ __proj2);
}
template <input_range _Range1,
input_range _Range2,
- class _Pred = ranges::equal_to,
+ class _Pred = ranges::equal_to,
class _Proj1 = identity,
class _Proj2 = identity>
requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Range1&& __range1,
- _Range2&& __range2,
- _Pred __pred = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
+ _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
if constexpr (sized_range<_Range1> && sized_range<_Range2>) {
if (ranges::distance(__range1) != ranges::distance(__range2))
return false;
}
- return __equal_impl(ranges::begin(__range1), ranges::end(__range1),
- ranges::begin(__range2), ranges::end(__range2),
- __pred,
- __proj1,
- __proj2);
+ auto __unwrapped1 = std::__unwrap_range(ranges::begin(__range1), ranges::end(__range1));
+ auto __unwrapped2 = std::__unwrap_range(ranges::begin(__range2), ranges::end(__range2));
+ return std::__equal_impl(
+ std::move(__unwrapped1.first),
+ std::move(__unwrapped1.second),
+ std::move(__unwrapped2.first),
+ std::move(__unwrapped2.second),
+ __pred,
+ __proj1,
+ __proj2);
return false;
}
};
} // namespace __equal
inline namespace __cpo {
- inline constexpr auto equal = __equal::__fn{};
+inline constexpr auto equal = __equal::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_EQUAL_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal_range.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal_range.h
index 4e794209162..1ff8856ca03 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal_range.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_equal_range.h
@@ -30,7 +30,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -38,28 +38,25 @@ namespace ranges {
namespace __equal_range {
struct __fn {
- template <
- forward_iterator _Iter,
- sentinel_for<_Iter> _Sent,
- class _Tp,
- class _Proj = identity,
- indirect_strict_weak_order<const _Tp*, projected<_Iter, _Proj>> _Comp = ranges::less>
+ template <forward_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Tp,
+ class _Proj = identity,
+ indirect_strict_weak_order<const _Tp*, projected<_Iter, _Proj>> _Comp = ranges::less>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter>
operator()(_Iter __first, _Sent __last, const _Tp& __value, _Comp __comp = {}, _Proj __proj = {}) const {
- auto __ret = std::__equal_range<_RangeAlgPolicy>(
- std::move(__first), std::move(__last), __value, __comp, __proj);
+ auto __ret = std::__equal_range<_RangeAlgPolicy>(std::move(__first), std::move(__last), __value, __comp, __proj);
return {std::move(__ret.first), std::move(__ret.second)};
}
- template <
- forward_range _Range,
- class _Tp,
- class _Proj = identity,
- indirect_strict_weak_order<const _Tp*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
+ template <forward_range _Range,
+ class _Tp,
+ class _Proj = identity,
+ indirect_strict_weak_order<const _Tp*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range>
operator()(_Range&& __range, const _Tp& __value, _Comp __comp = {}, _Proj __proj = {}) const {
- auto __ret = std::__equal_range<_RangeAlgPolicy>(
- ranges::begin(__range), ranges::end(__range), __value, __comp, __proj);
+ auto __ret =
+ std::__equal_range<_RangeAlgPolicy>(ranges::begin(__range), ranges::end(__range), __value, __comp, __proj);
return {std::move(__ret.first), std::move(__ret.second)};
}
};
@@ -67,12 +64,12 @@ struct __fn {
} // namespace __equal_range
inline namespace __cpo {
- inline constexpr auto equal_range = __equal_range::__fn{};
+inline constexpr auto equal_range = __equal_range::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_EQUAL_RANGE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill.h
index 6ebc2bd67d6..88a892f5c27 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill.h
@@ -20,7 +20,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -28,9 +28,8 @@ namespace ranges {
namespace __fill {
struct __fn {
template <class _Type, output_iterator<const _Type&> _Iter, sentinel_for<_Iter> _Sent>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last, const _Type& __value) const {
- if constexpr(random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>) {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iter operator()(_Iter __first, _Sent __last, const _Type& __value) const {
+ if constexpr (random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>) {
return ranges::fill_n(__first, __last - __first, __value);
} else {
for (; __first != __last; ++__first)
@@ -40,20 +39,19 @@ struct __fn {
}
template <class _Type, output_range<const _Type&> _Range>
- _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __range, const _Type& __value) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> operator()(_Range&& __range, const _Type& __value) const {
return (*this)(ranges::begin(__range), ranges::end(__range), __value);
}
};
} // namespace __fill
inline namespace __cpo {
- inline constexpr auto fill = __fill::__fn{};
+inline constexpr auto fill = __fill::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FILL_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill_n.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill_n.h
index a2660e8b592..dbd8ec27aef 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill_n.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_fill_n.h
@@ -17,7 +17,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -25,8 +25,8 @@ namespace ranges {
namespace __fill_n {
struct __fn {
template <class _Type, output_iterator<const _Type&> _Iter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, iter_difference_t<_Iter> __n, const _Type& __value) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, iter_difference_t<_Iter> __n, const _Type& __value) const {
for (; __n != 0; --__n) {
*__first = __value;
++__first;
@@ -37,12 +37,12 @@ struct __fn {
} // namespace __fill_n
inline namespace __cpo {
- inline constexpr auto fill_n = __fill_n::__fn{};
+inline constexpr auto fill_n = __fill_n::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FILL_N_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find.h
index 580c2a14c9e..de870e38118 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find.h
@@ -9,7 +9,9 @@
#ifndef _LIBCPP___ALGORITHM_RANGES_FIND_H
#define _LIBCPP___ALGORITHM_RANGES_FIND_H
+#include <__algorithm/find.h>
#include <__algorithm/ranges_find_if.h>
+#include <__algorithm/unwrap_range.h>
#include <__config>
#include <__functional/identity.h>
#include <__functional/invoke.h>
@@ -26,38 +28,48 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __find {
struct __fn {
+ template <class _Iter, class _Sent, class _Tp, class _Proj>
+ _LIBCPP_HIDE_FROM_ABI static constexpr _Iter
+ __find_unwrap(_Iter __first, _Sent __last, const _Tp& __value, _Proj& __proj) {
+ if constexpr (forward_iterator<_Iter>) {
+ auto [__first_un, __last_un] = std::__unwrap_range(__first, std::move(__last));
+ return std::__rewrap_range<_Sent>(
+ std::move(__first), std::__find_impl(std::move(__first_un), std::move(__last_un), __value, __proj));
+ } else {
+ return std::__find_impl(std::move(__first), std::move(__last), __value, __proj);
+ }
+ }
+
template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Tp, class _Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<_Ip, _Proj>, const _Tp*>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- _Ip operator()(_Ip __first, _Sp __last, const _Tp& __value, _Proj __proj = {}) const {
- auto __pred = [&](auto&& __e) { return std::forward<decltype(__e)>(__e) == __value; };
- return ranges::__find_if_impl(std::move(__first), std::move(__last), __pred, __proj);
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Ip
+ operator()(_Ip __first, _Sp __last, const _Tp& __value, _Proj __proj = {}) const {
+ return __find_unwrap(std::move(__first), std::move(__last), __value, __proj);
}
template <input_range _Rp, class _Tp, class _Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Rp>, _Proj>, const _Tp*>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Rp> operator()(_Rp&& __r, const _Tp& __value, _Proj __proj = {}) const {
- auto __pred = [&](auto&& __e) { return std::forward<decltype(__e)>(__e) == __value; };
- return ranges::__find_if_impl(ranges::begin(__r), ranges::end(__r), __pred, __proj);
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp>
+ operator()(_Rp&& __r, const _Tp& __value, _Proj __proj = {}) const {
+ return __find_unwrap(ranges::begin(__r), ranges::end(__r), __value, __proj);
}
};
} // namespace __find
inline namespace __cpo {
- inline constexpr auto find = __find::__fn{};
+inline constexpr auto find = __find::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FIND_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_end.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_end.h
index ea36f4d4e6e..2c57ad424bf 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_end.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_end.h
@@ -27,25 +27,29 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __find_end {
struct __fn {
- template <forward_iterator _Iter1, sentinel_for<_Iter1> _Sent1,
- forward_iterator _Iter2, sentinel_for<_Iter2> _Sent2,
- class _Pred = ranges::equal_to,
+ template <forward_iterator _Iter1,
+ sentinel_for<_Iter1> _Sent1,
+ forward_iterator _Iter2,
+ sentinel_for<_Iter2> _Sent2,
+ class _Pred = ranges::equal_to,
class _Proj1 = identity,
class _Proj2 = identity>
requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- subrange<_Iter1> operator()(_Iter1 __first1, _Sent1 __last1,
- _Iter2 __first2, _Sent2 __last2,
- _Pred __pred = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter1> operator()(
+ _Iter1 __first1,
+ _Sent1 __last1,
+ _Iter2 __first2,
+ _Sent2 __last2,
+ _Pred __pred = {},
+ _Proj1 __proj1 = {},
+ _Proj2 __proj2 = {}) const {
auto __ret = std::__find_end_impl<_RangeAlgPolicy>(
__first1,
__last1,
@@ -61,16 +65,12 @@ struct __fn {
template <forward_range _Range1,
forward_range _Range2,
- class _Pred = ranges::equal_to,
+ class _Pred = ranges::equal_to,
class _Proj1 = identity,
class _Proj2 = identity>
requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_subrange_t<_Range1> operator()(_Range1&& __range1,
- _Range2&& __range2,
- _Pred __pred = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range1> operator()(
+ _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
auto __ret = std::__find_end_impl<_RangeAlgPolicy>(
ranges::begin(__range1),
ranges::end(__range1),
@@ -87,12 +87,12 @@ struct __fn {
} // namespace __find_end
inline namespace __cpo {
- inline constexpr auto find_end = __find_end::__fn{};
+inline constexpr auto find_end = __find_end::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FIND_END_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_first_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_first_of.h
index 9d66e7511c0..ec6d52c6325 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_first_of.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_first_of.h
@@ -24,21 +24,22 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __find_first_of {
struct __fn {
-
template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Pred, class _Proj1, class _Proj2>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- _Iter1 __find_first_of_impl(_Iter1 __first1, _Sent1 __last1,
- _Iter2 __first2, _Sent2 __last2,
- _Pred& __pred,
- _Proj1& __proj1,
- _Proj2& __proj2) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static _Iter1 __find_first_of_impl(
+ _Iter1 __first1,
+ _Sent1 __last1,
+ _Iter2 __first2,
+ _Sent2 __last2,
+ _Pred& __pred,
+ _Proj1& __proj1,
+ _Proj2& __proj2) {
for (; __first1 != __last1; ++__first1) {
for (auto __j = __first2; __j != __last2; ++__j) {
if (std::invoke(__pred, std::invoke(__proj1, *__first1), std::invoke(__proj2, *__j)))
@@ -48,54 +49,53 @@ struct __fn {
return __first1;
}
- template <input_iterator _Iter1, sentinel_for<_Iter1> _Sent1,
- forward_iterator _Iter2, sentinel_for<_Iter2> _Sent2,
- class _Pred = ranges::equal_to,
+ template <input_iterator _Iter1,
+ sentinel_for<_Iter1> _Sent1,
+ forward_iterator _Iter2,
+ sentinel_for<_Iter2> _Sent2,
+ class _Pred = ranges::equal_to,
class _Proj1 = identity,
class _Proj2 = identity>
requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter1 operator()(_Iter1 __first1, _Sent1 __last1,
- _Iter2 __first2, _Sent2 __last2,
- _Pred __pred = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
- return __find_first_of_impl(std::move(__first1), std::move(__last1),
- std::move(__first2), std::move(__last2),
- __pred,
- __proj1,
- __proj2);
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Iter1 operator()(
+ _Iter1 __first1,
+ _Sent1 __last1,
+ _Iter2 __first2,
+ _Sent2 __last2,
+ _Pred __pred = {},
+ _Proj1 __proj1 = {},
+ _Proj2 __proj2 = {}) const {
+ return __find_first_of_impl(
+ std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), __pred, __proj1, __proj2);
}
template <input_range _Range1,
forward_range _Range2,
- class _Pred = ranges::equal_to,
+ class _Pred = ranges::equal_to,
class _Proj1 = identity,
class _Proj2 = identity>
requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range1> operator()(_Range1&& __range1,
- _Range2&& __range2,
- _Pred __pred = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
- return __find_first_of_impl(ranges::begin(__range1), ranges::end(__range1),
- ranges::begin(__range2), ranges::end(__range2),
- __pred,
- __proj1,
- __proj2);
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range1> operator()(
+ _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+ return __find_first_of_impl(
+ ranges::begin(__range1),
+ ranges::end(__range1),
+ ranges::begin(__range2),
+ ranges::end(__range2),
+ __pred,
+ __proj1,
+ __proj2);
}
-
};
} // namespace __find_first_of
inline namespace __cpo {
- inline constexpr auto find_first_of = __find_first_of::__fn{};
+inline constexpr auto find_first_of = __find_first_of::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FIND_FIRST_OF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if.h
index 45ce6e460d6..af54a5007ee 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if.h
@@ -24,15 +24,14 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
template <class _Ip, class _Sp, class _Pred, class _Proj>
-_LIBCPP_HIDE_FROM_ABI static constexpr
-_Ip __find_if_impl(_Ip __first, _Sp __last, _Pred& __pred, _Proj& __proj) {
+_LIBCPP_HIDE_FROM_ABI constexpr _Ip __find_if_impl(_Ip __first, _Sp __last, _Pred& __pred, _Proj& __proj) {
for (; __first != __last; ++__first) {
if (std::invoke(__pred, std::invoke(__proj, *__first)))
break;
@@ -42,30 +41,30 @@ _Ip __find_if_impl(_Ip __first, _Sp __last, _Pred& __pred, _Proj& __proj) {
namespace __find_if {
struct __fn {
-
- template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Proj = identity,
+ template <input_iterator _Ip,
+ sentinel_for<_Ip> _Sp,
+ class _Proj = identity,
indirect_unary_predicate<projected<_Ip, _Proj>> _Pred>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- _Ip operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Ip
+ operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const {
return ranges::__find_if_impl(std::move(__first), std::move(__last), __pred, __proj);
}
- template <input_range _Rp, class _Proj = identity,
- indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const {
+ template <input_range _Rp, class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp>
+ operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const {
return ranges::__find_if_impl(ranges::begin(__r), ranges::end(__r), __pred, __proj);
}
};
} // namespace __find_if
inline namespace __cpo {
- inline constexpr auto find_if = __find_if::__fn{};
+inline constexpr auto find_if = __find_if::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FIND_IF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if_not.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if_not.h
index 3dd12132754..6beade1462e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if_not.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_find_if_not.h
@@ -26,25 +26,26 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __find_if_not {
struct __fn {
- template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Proj = identity,
+ template <input_iterator _Ip,
+ sentinel_for<_Ip> _Sp,
+ class _Proj = identity,
indirect_unary_predicate<projected<_Ip, _Proj>> _Pred>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- _Ip operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Ip
+ operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const {
auto __pred2 = [&](auto&& __e) { return !std::invoke(__pred, std::forward<decltype(__e)>(__e)); };
return ranges::__find_if_impl(std::move(__first), std::move(__last), __pred2, __proj);
}
- template <input_range _Rp, class _Proj = identity,
- indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const {
+ template <input_range _Rp, class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp>
+ operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const {
auto __pred2 = [&](auto&& __e) { return !std::invoke(__pred, std::forward<decltype(__e)>(__e)); };
return ranges::__find_if_impl(ranges::begin(__r), ranges::end(__r), __pred2, __proj);
}
@@ -52,12 +53,12 @@ struct __fn {
} // namespace __find_if_not
inline namespace __cpo {
- inline constexpr auto find_if_not = __find_if_not::__fn{};
+inline constexpr auto find_if_not = __find_if_not::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FIND_IF_NOT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_for_each.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_for_each.h
index 0c70c05981a..7878ed26709 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_for_each.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_for_each.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -37,42 +37,40 @@ namespace __for_each {
struct __fn {
private:
template <class _Iter, class _Sent, class _Proj, class _Func>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- for_each_result<_Iter, _Func> __for_each_impl(_Iter __first, _Sent __last, _Func& __func, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static for_each_result<_Iter, _Func>
+ __for_each_impl(_Iter __first, _Sent __last, _Func& __func, _Proj& __proj) {
for (; __first != __last; ++__first)
std::invoke(__func, std::invoke(__proj, *__first));
return {std::move(__first), std::move(__func)};
}
public:
- template <input_iterator _Iter, sentinel_for<_Iter> _Sent,
+ template <input_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
class _Proj = identity,
indirectly_unary_invocable<projected<_Iter, _Proj>> _Func>
- _LIBCPP_HIDE_FROM_ABI constexpr
- for_each_result<_Iter, _Func> operator()(_Iter __first, _Sent __last, _Func __func, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr for_each_result<_Iter, _Func>
+ operator()(_Iter __first, _Sent __last, _Func __func, _Proj __proj = {}) const {
return __for_each_impl(std::move(__first), std::move(__last), __func, __proj);
}
template <input_range _Range,
class _Proj = identity,
indirectly_unary_invocable<projected<iterator_t<_Range>, _Proj>> _Func>
- _LIBCPP_HIDE_FROM_ABI constexpr
- for_each_result<borrowed_iterator_t<_Range>, _Func> operator()(_Range&& __range,
- _Func __func,
- _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr for_each_result<borrowed_iterator_t<_Range>, _Func>
+ operator()(_Range&& __range, _Func __func, _Proj __proj = {}) const {
return __for_each_impl(ranges::begin(__range), ranges::end(__range), __func, __proj);
}
-
};
} // namespace __for_each
inline namespace __cpo {
- inline constexpr auto for_each = __for_each::__fn{};
+inline constexpr auto for_each = __for_each::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FOR_EACH_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_for_each_n.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_for_each_n.h
index 261816aba43..53ccb9a6035 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_for_each_n.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_for_each_n.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -35,32 +35,25 @@ using for_each_n_result = in_fun_result<_Iter, _Func>;
namespace __for_each_n {
struct __fn {
-
- template <input_iterator _Iter,
- class _Proj = identity,
- indirectly_unary_invocable<projected<_Iter, _Proj>> _Func>
- _LIBCPP_HIDE_FROM_ABI constexpr
- for_each_n_result<_Iter, _Func> operator()(_Iter __first,
- iter_difference_t<_Iter> __count,
- _Func __func,
- _Proj __proj = {}) const {
+ template <input_iterator _Iter, class _Proj = identity, indirectly_unary_invocable<projected<_Iter, _Proj>> _Func>
+ _LIBCPP_HIDE_FROM_ABI constexpr for_each_n_result<_Iter, _Func>
+ operator()(_Iter __first, iter_difference_t<_Iter> __count, _Func __func, _Proj __proj = {}) const {
while (__count-- > 0) {
std::invoke(__func, std::invoke(__proj, *__first));
++__first;
}
return {std::move(__first), std::move(__func)};
}
-
};
} // namespace __for_each_n
inline namespace __cpo {
- inline constexpr auto for_each_n = __for_each_n::__fn{};
+inline constexpr auto for_each_n = __for_each_n::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FOR_EACH_N_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_generate.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_generate.h
index ae486ae6539..3ff1e13c422 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_generate.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_generate.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -32,10 +32,8 @@ namespace ranges {
namespace __generate {
struct __fn {
-
template <class _OutIter, class _Sent, class _Func>
- _LIBCPP_HIDE_FROM_ABI constexpr
- static _OutIter __generate_fn_impl(_OutIter __first, _Sent __last, _Func& __gen) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static _OutIter __generate_fn_impl(_OutIter __first, _Sent __last, _Func& __gen) {
for (; __first != __last; ++__first) {
*__first = __gen();
}
@@ -44,30 +42,27 @@ struct __fn {
}
template <input_or_output_iterator _OutIter, sentinel_for<_OutIter> _Sent, copy_constructible _Func>
- requires invocable<_Func&> && indirectly_writable<_OutIter, invoke_result_t<_Func&>>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _OutIter operator()(_OutIter __first, _Sent __last, _Func __gen) const {
+ requires invocable<_Func&> && indirectly_writable<_OutIter, invoke_result_t<_Func&>>
+ _LIBCPP_HIDE_FROM_ABI constexpr _OutIter operator()(_OutIter __first, _Sent __last, _Func __gen) const {
return __generate_fn_impl(std::move(__first), std::move(__last), __gen);
}
template <class _Range, copy_constructible _Func>
- requires invocable<_Func&> && output_range<_Range, invoke_result_t<_Func&>>
- _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __range, _Func __gen) const {
+ requires invocable<_Func&> && output_range<_Range, invoke_result_t<_Func&>>
+ _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> operator()(_Range&& __range, _Func __gen) const {
return __generate_fn_impl(ranges::begin(__range), ranges::end(__range), __gen);
}
-
};
} // namespace __generate
inline namespace __cpo {
- inline constexpr auto generate = __generate::__fn{};
+inline constexpr auto generate = __generate::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_GENERATE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_generate_n.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_generate_n.h
index e625e3a9742..c025c621a19 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_generate_n.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_generate_n.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -33,11 +33,10 @@ namespace ranges {
namespace __generate_n {
struct __fn {
-
template <input_or_output_iterator _OutIter, copy_constructible _Func>
- requires invocable<_Func&> && indirectly_writable<_OutIter, invoke_result_t<_Func&>>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _OutIter operator()(_OutIter __first, iter_difference_t<_OutIter> __n, _Func __gen) const {
+ requires invocable<_Func&> && indirectly_writable<_OutIter, invoke_result_t<_Func&>>
+ _LIBCPP_HIDE_FROM_ABI constexpr _OutIter
+ operator()(_OutIter __first, iter_difference_t<_OutIter> __n, _Func __gen) const {
for (; __n > 0; --__n) {
*__first = __gen();
++__first;
@@ -45,18 +44,17 @@ struct __fn {
return __first;
}
-
};
} // namespace __generate_n
inline namespace __cpo {
- inline constexpr auto generate_n = __generate_n::__fn{};
+inline constexpr auto generate_n = __generate_n::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_GENERATE_N_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_includes.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_includes.h
index 8438117cfa8..aa35080c8cf 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_includes.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_includes.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -35,14 +35,13 @@ namespace ranges {
namespace __includes {
struct __fn {
- template <
- input_iterator _Iter1,
- sentinel_for<_Iter1> _Sent1,
- input_iterator _Iter2,
- sentinel_for<_Iter2> _Sent2,
- class _Proj1 = identity,
- class _Proj2 = identity,
- indirect_strict_weak_order<projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>> _Comp = ranges::less>
+ template <input_iterator _Iter1,
+ sentinel_for<_Iter1> _Sent1,
+ input_iterator _Iter2,
+ sentinel_for<_Iter2> _Sent2,
+ class _Proj1 = identity,
+ class _Proj2 = identity,
+ indirect_strict_weak_order<projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>> _Comp = ranges::less>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
_Iter1 __first1,
_Sent1 __last1,
@@ -61,13 +60,12 @@ struct __fn {
std::move(__proj2));
}
- template <
- input_range _Range1,
- input_range _Range2,
- class _Proj1 = identity,
- class _Proj2 = identity,
- indirect_strict_weak_order<projected<iterator_t<_Range1>, _Proj1>, projected<iterator_t<_Range2>, _Proj2>>
- _Comp = ranges::less>
+ template <input_range _Range1,
+ input_range _Range2,
+ class _Proj1 = identity,
+ class _Proj2 = identity,
+ indirect_strict_weak_order<projected<iterator_t<_Range1>, _Proj1>, projected<iterator_t<_Range2>, _Proj2>>
+ _Comp = ranges::less>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
_Range1&& __range1, _Range2&& __range2, _Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
return std::__includes(
@@ -84,12 +82,12 @@ struct __fn {
} // namespace __includes
inline namespace __cpo {
- inline constexpr auto includes = __includes::__fn{};
+inline constexpr auto includes = __includes::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_INCLUDES_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_inplace_merge.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_inplace_merge.h
index 88171a65c8e..86001b003d5 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_inplace_merge.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_inplace_merge.h
@@ -31,55 +31,49 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __inplace_merge {
- struct __fn {
- template <class _Iter, class _Sent, class _Comp, class _Proj>
- _LIBCPP_HIDE_FROM_ABI static constexpr auto
- __inplace_merge_impl(_Iter __first, _Iter __middle, _Sent __last, _Comp&& __comp, _Proj&& __proj) {
- auto __last_iter = ranges::next(__middle, __last);
- std::__inplace_merge<_RangeAlgPolicy>(
- std::move(__first), std::move(__middle), __last_iter, std::__make_projected(__comp, __proj));
- return __last_iter;
- }
+struct __fn {
+ template <class _Iter, class _Sent, class _Comp, class _Proj>
+ _LIBCPP_HIDE_FROM_ABI static constexpr auto
+ __inplace_merge_impl(_Iter __first, _Iter __middle, _Sent __last, _Comp&& __comp, _Proj&& __proj) {
+ auto __last_iter = ranges::next(__middle, __last);
+ std::__inplace_merge<_RangeAlgPolicy>(
+ std::move(__first), std::move(__middle), __last_iter, std::__make_projected(__comp, __proj));
+ return __last_iter;
+ }
- template <
- bidirectional_iterator _Iter,
- sentinel_for<_Iter> _Sent,
- class _Comp = ranges::less,
- class _Proj = identity>
- requires sortable<_Iter, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI _Iter
- operator()(_Iter __first, _Iter __middle, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
- return __inplace_merge_impl(
- std::move(__first), std::move(__middle), std::move(__last), std::move(__comp), std::move(__proj));
- }
+ template <bidirectional_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
+ requires sortable<_Iter, _Comp, _Proj>
+ _LIBCPP_HIDE_FROM_ABI _Iter
+ operator()(_Iter __first, _Iter __middle, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ return __inplace_merge_impl(
+ std::move(__first), std::move(__middle), std::move(__last), std::move(__comp), std::move(__proj));
+ }
- template <bidirectional_range _Range, class _Comp = ranges::less, class _Proj = identity>
- requires sortable<
- iterator_t<_Range>,
- _Comp,
- _Proj> _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_Range>
- operator()(_Range&& __range, iterator_t<_Range> __middle, _Comp __comp = {}, _Proj __proj = {}) const {
- return __inplace_merge_impl(
- ranges::begin(__range), std::move(__middle), ranges::end(__range), std::move(__comp), std::move(__proj));
- }
- };
+ template <bidirectional_range _Range, class _Comp = ranges::less, class _Proj = identity>
+ requires sortable<iterator_t<_Range>, _Comp, _Proj>
+ _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_Range>
+ operator()(_Range&& __range, iterator_t<_Range> __middle, _Comp __comp = {}, _Proj __proj = {}) const {
+ return __inplace_merge_impl(
+ ranges::begin(__range), std::move(__middle), ranges::end(__range), std::move(__comp), std::move(__proj));
+ }
+};
} // namespace __inplace_merge
inline namespace __cpo {
- inline constexpr auto inplace_merge = __inplace_merge::__fn{};
+inline constexpr auto inplace_merge = __inplace_merge::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_INPLACE_MERGE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap.h
index a16c075b076..f298c347b74 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap.h
@@ -26,7 +26,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -34,28 +34,30 @@ namespace ranges {
namespace __is_heap {
struct __fn {
-
template <class _Iter, class _Sent, class _Proj, class _Comp>
- _LIBCPP_HIDE_FROM_ABI constexpr
- static bool __is_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
- auto __last_iter = ranges::next(__first, __last);
+ _LIBCPP_HIDE_FROM_ABI constexpr static bool
+ __is_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
+ auto __last_iter = ranges::next(__first, __last);
auto&& __projected_comp = std::__make_projected(__comp, __proj);
auto __result = std::__is_heap_until(std::move(__first), std::move(__last_iter), __projected_comp);
return __result == __last;
}
- template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+ template <random_access_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Proj = identity,
indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
return __is_heap_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
}
- template <random_access_range _Range, class _Proj = identity,
+ template <random_access_range _Range,
+ class _Proj = identity,
indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
return __is_heap_fn_impl(ranges::begin(__range), ranges::end(__range), __comp, __proj);
}
};
@@ -63,12 +65,12 @@ struct __fn {
} // namespace __is_heap
inline namespace __cpo {
- inline constexpr auto is_heap = __is_heap::__fn{};
+inline constexpr auto is_heap = __is_heap::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_IS_HEAP_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap_until.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap_until.h
index 8c8dac5bc90..73f13fb5044 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap_until.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_heap_until.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -35,41 +35,42 @@ namespace ranges {
namespace __is_heap_until {
struct __fn {
-
template <class _Iter, class _Sent, class _Proj, class _Comp>
- _LIBCPP_HIDE_FROM_ABI constexpr
- static _Iter __is_heap_until_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
- auto __last_iter = ranges::next(__first, __last);
+ _LIBCPP_HIDE_FROM_ABI constexpr static _Iter
+ __is_heap_until_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
+ auto __last_iter = ranges::next(__first, __last);
auto&& __projected_comp = std::__make_projected(__comp, __proj);
return std::__is_heap_until(std::move(__first), std::move(__last_iter), __projected_comp);
}
- template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+ template <random_access_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Proj = identity,
indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
return __is_heap_until_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
}
- template <random_access_range _Range, class _Proj = identity,
+ template <random_access_range _Range,
+ class _Proj = identity,
indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+ operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
return __is_heap_until_fn_impl(ranges::begin(__range), ranges::end(__range), __comp, __proj);
}
-
};
} // namespace __is_heap_until
inline namespace __cpo {
- inline constexpr auto is_heap_until = __is_heap_until::__fn{};
+inline constexpr auto is_heap_until = __is_heap_until::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_IS_HEAP_UNTIL_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_partitioned.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_partitioned.h
index b903953d616..76db870efc7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_partitioned.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_partitioned.h
@@ -23,17 +23,16 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __is_partitioned {
struct __fn {
-
template <class _Iter, class _Sent, class _Proj, class _Pred>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- bool __is_parititioned_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static bool
+ __is_partitioned_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
for (; __first != __last; ++__first) {
if (!std::invoke(__pred, std::invoke(__proj, *__first)))
break;
@@ -51,31 +50,32 @@ struct __fn {
return true;
}
- template <input_iterator _Iter, sentinel_for<_Iter> _Sent,
+ template <input_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
class _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
- return __is_parititioned_impl(std::move(__first), std::move(__last), __pred, __proj);
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
+ return __is_partitioned_impl(std::move(__first), std::move(__last), __pred, __proj);
}
template <input_range _Range,
class _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
- return __is_parititioned_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
+ return __is_partitioned_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
}
};
} // namespace __is_partitioned
inline namespace __cpo {
- inline constexpr auto is_partitioned = __is_partitioned::__fn{};
+inline constexpr auto is_partitioned = __is_partitioned::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_IS_PARTITIONED_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_permutation.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_permutation.h
index b617500ea0d..2b99839bc66 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_permutation.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_permutation.h
@@ -25,65 +25,78 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __is_permutation {
struct __fn {
-
- template <class _Iter1, class _Sent1, class _Iter2, class _Sent2,
- class _Proj1, class _Proj2, class _Pred>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- bool __is_permutation_func_impl(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
- _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
+ template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Proj1, class _Proj2, class _Pred>
+ _LIBCPP_HIDE_FROM_ABI constexpr static bool __is_permutation_func_impl(
+ _Iter1 __first1,
+ _Sent1 __last1,
+ _Iter2 __first2,
+ _Sent2 __last2,
+ _Pred& __pred,
+ _Proj1& __proj1,
+ _Proj2& __proj2) {
return std::__is_permutation<_RangeAlgPolicy>(
- std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2),
- __pred, __proj1, __proj2);
+ std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), __pred, __proj1, __proj2);
}
- template <forward_iterator _Iter1, sentinel_for<_Iter1> _Sent1,
- forward_iterator _Iter2, sentinel_for<_Iter2> _Sent2,
- class _Proj1 = identity,
- class _Proj2 = identity,
- indirect_equivalence_relation<projected<_Iter1, _Proj1>,
- projected<_Iter2, _Proj2>> _Pred = ranges::equal_to>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
- _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+ template <
+ forward_iterator _Iter1,
+ sentinel_for<_Iter1> _Sent1,
+ forward_iterator _Iter2,
+ sentinel_for<_Iter2> _Sent2,
+ class _Proj1 = identity,
+ class _Proj2 = identity,
+ indirect_equivalence_relation<projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>> _Pred = ranges::equal_to>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
+ _Iter1 __first1,
+ _Sent1 __last1,
+ _Iter2 __first2,
+ _Sent2 __last2,
+ _Pred __pred = {},
+ _Proj1 __proj1 = {},
+ _Proj2 __proj2 = {}) const {
return __is_permutation_func_impl(
- std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2),
- __pred, __proj1, __proj2);
+ std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), __pred, __proj1, __proj2);
}
template <forward_range _Range1,
forward_range _Range2,
- class _Proj1 = identity,
- class _Proj2 = identity,
- indirect_equivalence_relation<projected<iterator_t<_Range1>, _Proj1>, projected<iterator_t<_Range2>, _Proj2>> _Pred = ranges::equal_to>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Range1&& __range1, _Range2&& __range2,
- _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+ class _Proj1 = identity,
+ class _Proj2 = identity,
+ indirect_equivalence_relation<projected<iterator_t<_Range1>, _Proj1>,
+ projected<iterator_t<_Range2>, _Proj2>> _Pred = ranges::equal_to>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
+ _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
if constexpr (sized_range<_Range1> && sized_range<_Range2>) {
if (ranges::distance(__range1) != ranges::distance(__range2))
return false;
}
return __is_permutation_func_impl(
- ranges::begin(__range1), ranges::end(__range1), ranges::begin(__range2), ranges::end(__range2),
- __pred, __proj1, __proj2);
+ ranges::begin(__range1),
+ ranges::end(__range1),
+ ranges::begin(__range2),
+ ranges::end(__range2),
+ __pred,
+ __proj1,
+ __proj2);
}
};
} // namespace __is_permutation
inline namespace __cpo {
- inline constexpr auto is_permutation = __is_permutation::__fn{};
+inline constexpr auto is_permutation = __is_permutation::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_IS_PERMUTATION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted.h
index ce3032ff226..3eb2c768d66 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted.h
@@ -23,26 +23,27 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __is_sorted {
struct __fn {
- template <forward_iterator _Iter, sentinel_for<_Iter> _Sent,
- class _Proj = identity,
+ template <forward_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Proj = identity,
indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
return ranges::__is_sorted_until_impl(std::move(__first), __last, __comp, __proj) == __last;
}
template <forward_range _Range,
- class _Proj = identity,
+ class _Proj = identity,
indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
auto __last = ranges::end(__range);
return ranges::__is_sorted_until_impl(ranges::begin(__range), __last, __comp, __proj) == __last;
}
@@ -50,12 +51,12 @@ struct __fn {
} // namespace __is_sorted
inline namespace __cpo {
- inline constexpr auto is_sorted = __is_sorted::__fn{};
+inline constexpr auto is_sorted = __is_sorted::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP__ALGORITHM_RANGES_IS_SORTED_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted_until.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted_until.h
index 17fc42e97fd..19e9875d275 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted_until.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_is_sorted_until.h
@@ -24,15 +24,15 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
template <class _Iter, class _Sent, class _Proj, class _Comp>
-_LIBCPP_HIDE_FROM_ABI constexpr
-_Iter __is_sorted_until_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
+_LIBCPP_HIDE_FROM_ABI constexpr _Iter
+__is_sorted_until_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
if (__first == __last)
return __first;
auto __i = __first;
@@ -46,31 +46,32 @@ _Iter __is_sorted_until_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj&
namespace __is_sorted_until {
struct __fn {
- template <forward_iterator _Iter, sentinel_for<_Iter> _Sent,
- class _Proj = identity,
+ template <forward_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Proj = identity,
indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
return ranges::__is_sorted_until_impl(std::move(__first), std::move(__last), __comp, __proj);
}
template <forward_range _Range,
- class _Proj = identity,
+ class _Proj = identity,
indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+ operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
return ranges::__is_sorted_until_impl(ranges::begin(__range), ranges::end(__range), __comp, __proj);
}
};
} // namespace __is_sorted_until
inline namespace __cpo {
- inline constexpr auto is_sorted_until = __is_sorted_until::__fn{};
+inline constexpr auto is_sorted_until = __is_sorted_until::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP__ALGORITHM_RANGES_IS_SORTED_UNTIL_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_iterator_concept.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_iterator_concept.h
index 3ac6b317031..9a920304033 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_iterator_concept.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_iterator_concept.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -46,6 +46,6 @@ using __iterator_concept = decltype(__get_iterator_concept<_Iter>());
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_ITERATOR_CONCEPT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lexicographical_compare.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lexicographical_compare.h
index 2972e327169..5b843dfd7b3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lexicographical_compare.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lexicographical_compare.h
@@ -23,24 +23,24 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __lexicographical_compare {
struct __fn {
-
template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Proj1, class _Proj2, class _Comp>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- bool __lexicographical_compare_impl(_Iter1 __first1, _Sent1 __last1,
- _Iter2 __first2, _Sent2 __last2,
- _Comp& __comp,
- _Proj1& __proj1,
- _Proj2& __proj2) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static bool __lexicographical_compare_impl(
+ _Iter1 __first1,
+ _Sent1 __last1,
+ _Iter2 __first2,
+ _Sent2 __last2,
+ _Comp& __comp,
+ _Proj1& __proj1,
+ _Proj2& __proj2) {
while (__first2 != __last2) {
- if (__first1 == __last1
- || std::invoke(__comp, std::invoke(__proj1, *__first1), std::invoke(__proj2, *__first2)))
+ if (__first1 == __last1 || std::invoke(__comp, std::invoke(__proj1, *__first1), std::invoke(__proj2, *__first2)))
return true;
if (std::invoke(__comp, std::invoke(__proj2, *__first2), std::invoke(__proj1, *__first1)))
return false;
@@ -50,49 +50,52 @@ struct __fn {
return false;
}
- template <input_iterator _Iter1, sentinel_for<_Iter1> _Sent1,
- input_iterator _Iter2, sentinel_for<_Iter2> _Sent2,
- class _Proj1 = identity,
- class _Proj2 = identity,
+ template <input_iterator _Iter1,
+ sentinel_for<_Iter1> _Sent1,
+ input_iterator _Iter2,
+ sentinel_for<_Iter2> _Sent2,
+ class _Proj1 = identity,
+ class _Proj2 = identity,
indirect_strict_weak_order<projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Iter1 __first1, _Sent1 __last1,
- _Iter2 __first2, _Sent2 __last2,
- _Comp __comp = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
- return __lexicographical_compare_impl(std::move(__first1), std::move(__last1),
- std::move(__first2), std::move(__last2),
- __comp,
- __proj1,
- __proj2);
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
+ _Iter1 __first1,
+ _Sent1 __last1,
+ _Iter2 __first2,
+ _Sent2 __last2,
+ _Comp __comp = {},
+ _Proj1 __proj1 = {},
+ _Proj2 __proj2 = {}) const {
+ return __lexicographical_compare_impl(
+ std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), __comp, __proj1, __proj2);
}
template <input_range _Range1,
input_range _Range2,
class _Proj1 = identity,
class _Proj2 = identity,
- indirect_strict_weak_order<projected<iterator_t<_Range1>, _Proj1>,
- projected<iterator_t<_Range2>, _Proj2>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Range1&& __range1, _Range2&& __range2, _Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
- return __lexicographical_compare_impl(ranges::begin(__range1), ranges::end(__range1),
- ranges::begin(__range2), ranges::end(__range2),
- __comp,
- __proj1,
- __proj2);
+ indirect_strict_weak_order<projected<iterator_t<_Range1>, _Proj1>, projected<iterator_t<_Range2>, _Proj2>>
+ _Comp = ranges::less>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
+ _Range1&& __range1, _Range2&& __range2, _Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+ return __lexicographical_compare_impl(
+ ranges::begin(__range1),
+ ranges::end(__range1),
+ ranges::begin(__range2),
+ ranges::end(__range2),
+ __comp,
+ __proj1,
+ __proj2);
}
-
};
} // namespace __lexicographical_compare
inline namespace __cpo {
- inline constexpr auto lexicographical_compare = __lexicographical_compare::__fn{};
+inline constexpr auto lexicographical_compare = __lexicographical_compare::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_LEXICOGRAPHICAL_COMPARE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lower_bound.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lower_bound.h
index 78cbb6d4fb2..58b3f815b96 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lower_bound.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_lower_bound.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -35,32 +35,34 @@ namespace ranges {
namespace __lower_bound {
struct __fn {
- template <forward_iterator _Iter, sentinel_for<_Iter> _Sent, class _Type, class _Proj = identity,
+ template <forward_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Type,
+ class _Proj = identity,
indirect_strict_weak_order<const _Type*, projected<_Iter, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
- return std::__lower_bound_impl<_RangeAlgPolicy>(__first, __last, __value, __comp, __proj);
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, _Sent __last, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
+ return std::__lower_bound<_RangeAlgPolicy>(__first, __last, __value, __comp, __proj);
}
- template <forward_range _Range, class _Type, class _Proj = identity,
+ template <forward_range _Range,
+ class _Type,
+ class _Proj = identity,
indirect_strict_weak_order<const _Type*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __r,
- const _Type& __value,
- _Comp __comp = {},
- _Proj __proj = {}) const {
- return std::__lower_bound_impl<_RangeAlgPolicy>(ranges::begin(__r), ranges::end(__r), __value, __comp, __proj);
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+ operator()(_Range&& __r, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
+ return std::__lower_bound<_RangeAlgPolicy>(ranges::begin(__r), ranges::end(__r), __value, __comp, __proj);
}
};
} // namespace __lower_bound
inline namespace __cpo {
- inline constexpr auto lower_bound = __lower_bound::__fn{};
+inline constexpr auto lower_bound = __lower_bound::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_LOWER_BOUND_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_make_heap.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_make_heap.h
index f25c7ab5888..f17eabff43d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_make_heap.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_make_heap.h
@@ -32,7 +32,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -41,8 +41,8 @@ namespace __make_heap {
struct __fn {
template <class _Iter, class _Sent, class _Comp, class _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- _Iter __make_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static _Iter
+ __make_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
auto __last_iter = ranges::next(__first, __last);
auto&& __projected_comp = std::__make_projected(__comp, __proj);
@@ -53,15 +53,15 @@ struct __fn {
template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
return __make_heap_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
}
template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
requires sortable<iterator_t<_Range>, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+ operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
return __make_heap_fn_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
}
};
@@ -69,12 +69,12 @@ struct __fn {
} // namespace __make_heap
inline namespace __cpo {
- inline constexpr auto make_heap = __make_heap::__fn{};
+inline constexpr auto make_heap = __make_heap::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MAKE_HEAP_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max.h
index 55aef997698..5cc418d3393 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max.h
@@ -20,6 +20,7 @@
#include <__iterator/projected.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
+#include <__type_traits/is_trivially_copyable.h>
#include <__utility/move.h>
#include <initializer_list>
@@ -27,44 +28,50 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
+# include <__undef_macros>
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __max {
struct __fn {
- template <class _Tp, class _Proj = identity,
+ template <class _Tp,
+ class _Proj = identity,
indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- const _Tp& operator()(const _Tp& __a, const _Tp& __b, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
+ operator()(_LIBCPP_LIFETIMEBOUND const _Tp& __a,
+ _LIBCPP_LIFETIMEBOUND const _Tp& __b,
+ _Comp __comp = {},
+ _Proj __proj = {}) const {
return std::invoke(__comp, std::invoke(__proj, __a), std::invoke(__proj, __b)) ? __b : __a;
}
- template <copyable _Tp, class _Proj = identity,
+ template <copyable _Tp,
+ class _Proj = identity,
indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- _Tp operator()(initializer_list<_Tp> __il, _Comp __comp = {}, _Proj __proj = {}) const {
- _LIBCPP_ASSERT(__il.begin() != __il.end(), "initializer_list must contain at least one element");
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp
+ operator()(initializer_list<_Tp> __il, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__il.begin() != __il.end(), "initializer_list must contain at least one element");
auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
return *ranges::__min_element_impl(__il.begin(), __il.end(), __comp_lhs_rhs_swapped, __proj);
}
- template <input_range _Rp, class _Proj = identity,
+ template <input_range _Rp,
+ class _Proj = identity,
indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less>
requires indirectly_copyable_storable<iterator_t<_Rp>, range_value_t<_Rp>*>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- range_value_t<_Rp> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr range_value_t<_Rp>
+ operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
auto __first = ranges::begin(__r);
- auto __last = ranges::end(__r);
+ auto __last = ranges::end(__r);
- _LIBCPP_ASSERT(__first != __last, "range must contain at least one element");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first != __last, "range must contain at least one element");
- if constexpr (forward_range<_Rp>) {
+ if constexpr (forward_range<_Rp> && !__is_cheap_to_copy<range_value_t<_Rp>>) {
auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
return *ranges::__min_element_impl(std::move(__first), std::move(__last), __comp_lhs_rhs_swapped, __proj);
} else {
@@ -80,7 +87,7 @@ struct __fn {
} // namespace __max
inline namespace __cpo {
- inline constexpr auto max = __max::__fn{};
+inline constexpr auto max = __max::__fn{};
} // namespace __cpo
} // namespace ranges
@@ -88,6 +95,6 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_STD_VER > 17 &&
+#endif // _LIBCPP_STD_VER >= 20 &&
#endif // _LIBCPP___ALGORITHM_RANGES_MAX_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max_element.h
index 490f32075a4..2d92661c810 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max_element.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_max_element.h
@@ -24,25 +24,28 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __max_element {
struct __fn {
- template <forward_iterator _Ip, sentinel_for<_Ip> _Sp, class _Proj = identity,
+ template <forward_iterator _Ip,
+ sentinel_for<_Ip> _Sp,
+ class _Proj = identity,
indirect_strict_weak_order<projected<_Ip, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- _Ip operator()(_Ip __first, _Sp __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Ip
+ operator()(_Ip __first, _Sp __last, _Comp __comp = {}, _Proj __proj = {}) const {
auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
return ranges::__min_element_impl(__first, __last, __comp_lhs_rhs_swapped, __proj);
}
- template <forward_range _Rp, class _Proj = identity,
+ template <forward_range _Rp,
+ class _Proj = identity,
indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp>
+ operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
return ranges::__min_element_impl(ranges::begin(__r), ranges::end(__r), __comp_lhs_rhs_swapped, __proj);
}
@@ -50,12 +53,12 @@ struct __fn {
} // namespace __max_element
inline namespace __cpo {
- inline constexpr auto max_element = __max_element::__fn{};
+inline constexpr auto max_element = __max_element::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MAX_ELEMENT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_merge.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_merge.h
index b36a05abc41..7f49154ec92 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_merge.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_merge.h
@@ -20,14 +20,14 @@
#include <__ranges/access.h>
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -38,25 +38,25 @@ using merge_result = in_in_out_result<_InIter1, _InIter2, _OutIter>;
namespace __merge {
-template <
- class _InIter1,
- class _Sent1,
- class _InIter2,
- class _Sent2,
- class _OutIter,
- class _Comp,
- class _Proj1,
- class _Proj2>
-_LIBCPP_HIDE_FROM_ABI constexpr merge_result<__remove_cvref_t<_InIter1>, __remove_cvref_t<_InIter2>, __remove_cvref_t<_OutIter>>
-__merge_impl(
- _InIter1&& __first1,
- _Sent1&& __last1,
- _InIter2&& __first2,
- _Sent2&& __last2,
- _OutIter&& __result,
- _Comp&& __comp,
- _Proj1&& __proj1,
- _Proj2&& __proj2) {
+template < class _InIter1,
+ class _Sent1,
+ class _InIter2,
+ class _Sent2,
+ class _OutIter,
+ class _Comp,
+ class _Proj1,
+ class _Proj2>
+_LIBCPP_HIDE_FROM_ABI constexpr merge_result<__remove_cvref_t<_InIter1>,
+ __remove_cvref_t<_InIter2>,
+ __remove_cvref_t<_OutIter>>
+__merge_impl(_InIter1&& __first1,
+ _Sent1&& __last1,
+ _InIter2&& __first2,
+ _Sent2&& __last2,
+ _OutIter&& __result,
+ _Comp&& __comp,
+ _Proj1&& __proj1,
+ _Proj2&& __proj2) {
for (; __first1 != __last1 && __first2 != __last2; ++__result) {
if (std::invoke(__comp, std::invoke(__proj2, *__first2), std::invoke(__proj1, *__first1))) {
*__result = *__first2;
@@ -72,15 +72,14 @@ __merge_impl(
}
struct __fn {
- template <
- input_iterator _InIter1,
- sentinel_for<_InIter1> _Sent1,
- input_iterator _InIter2,
- sentinel_for<_InIter2> _Sent2,
- weakly_incrementable _OutIter,
- class _Comp = less,
- class _Proj1 = identity,
- class _Proj2 = identity>
+ template <input_iterator _InIter1,
+ sentinel_for<_InIter1> _Sent1,
+ input_iterator _InIter2,
+ sentinel_for<_InIter2> _Sent2,
+ weakly_incrementable _OutIter,
+ class _Comp = less,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
requires mergeable<_InIter1, _InIter2, _OutIter, _Comp, _Proj1, _Proj2>
_LIBCPP_HIDE_FROM_ABI constexpr merge_result<_InIter1, _InIter2, _OutIter> operator()(
_InIter1 __first1,
@@ -94,28 +93,20 @@ struct __fn {
return __merge::__merge_impl(__first1, __last1, __first2, __last2, __result, __comp, __proj1, __proj2);
}
- template <
- input_range _Range1,
- input_range _Range2,
- weakly_incrementable _OutIter,
- class _Comp = less,
- class _Proj1 = identity,
- class _Proj2 = identity>
- requires mergeable<
- iterator_t<_Range1>,
- iterator_t<_Range2>,
- _OutIter,
- _Comp,
- _Proj1,
- _Proj2>
+ template <input_range _Range1,
+ input_range _Range2,
+ weakly_incrementable _OutIter,
+ class _Comp = less,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
+ requires mergeable<iterator_t<_Range1>, iterator_t<_Range2>, _OutIter, _Comp, _Proj1, _Proj2>
_LIBCPP_HIDE_FROM_ABI constexpr merge_result<borrowed_iterator_t<_Range1>, borrowed_iterator_t<_Range2>, _OutIter>
- operator()(
- _Range1&& __range1,
- _Range2&& __range2,
- _OutIter __result,
- _Comp __comp = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
+ operator()(_Range1&& __range1,
+ _Range2&& __range2,
+ _OutIter __result,
+ _Comp __comp = {},
+ _Proj1 __proj1 = {},
+ _Proj2 __proj2 = {}) const {
return __merge::__merge_impl(
ranges::begin(__range1),
ranges::end(__range1),
@@ -131,12 +122,12 @@ struct __fn {
} // namespace __merge
inline namespace __cpo {
- inline constexpr auto merge = __merge::__fn{};
+inline constexpr auto merge = __merge::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MERGE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min.h
index 0e31f57fb8d..be15b453673 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min.h
@@ -20,48 +20,53 @@
#include <__iterator/projected.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
+#include <__type_traits/is_trivially_copyable.h>
#include <initializer_list>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
+# include <__undef_macros>
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __min {
struct __fn {
- template <class _Tp, class _Proj = identity,
+ template <class _Tp,
+ class _Proj = identity,
indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- const _Tp& operator()(const _Tp& __a, const _Tp& __b, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
+ operator()(_LIBCPP_LIFETIMEBOUND const _Tp& __a,
+ _LIBCPP_LIFETIMEBOUND const _Tp& __b,
+ _Comp __comp = {},
+ _Proj __proj = {}) const {
return std::invoke(__comp, std::invoke(__proj, __b), std::invoke(__proj, __a)) ? __b : __a;
}
- template <copyable _Tp, class _Proj = identity,
+ template <copyable _Tp,
+ class _Proj = identity,
indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- _Tp operator()(initializer_list<_Tp> __il, _Comp __comp = {}, _Proj __proj = {}) const {
- _LIBCPP_ASSERT(__il.begin() != __il.end(), "initializer_list must contain at least one element");
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp
+ operator()(initializer_list<_Tp> __il, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__il.begin() != __il.end(), "initializer_list must contain at least one element");
return *ranges::__min_element_impl(__il.begin(), __il.end(), __comp, __proj);
}
- template <input_range _Rp, class _Proj = identity,
+ template <input_range _Rp,
+ class _Proj = identity,
indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less>
requires indirectly_copyable_storable<iterator_t<_Rp>, range_value_t<_Rp>*>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- range_value_t<_Rp> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr range_value_t<_Rp>
+ operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
auto __first = ranges::begin(__r);
- auto __last = ranges::end(__r);
-
- _LIBCPP_ASSERT(__first != __last, "range must contain at least one element");
-
- if constexpr (forward_range<_Rp>) {
+ auto __last = ranges::end(__r);
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first != __last, "range must contain at least one element");
+ if constexpr (forward_range<_Rp> && !__is_cheap_to_copy<range_value_t<_Rp>>) {
return *ranges::__min_element_impl(__first, __last, __comp, __proj);
} else {
range_value_t<_Rp> __result = *__first;
@@ -76,7 +81,7 @@ struct __fn {
} // namespace __min
inline namespace __cpo {
- inline constexpr auto min = __min::__fn{};
+inline constexpr auto min = __min::__fn{};
} // namespace __cpo
} // namespace ranges
@@ -84,6 +89,6 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_STD_VER > 17 &&
+#endif // _LIBCPP_STD_VER >= 20 &&
#endif // _LIBCPP___ALGORITHM_RANGES_MIN_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min_element.h
index 1751874d03b..07826a0e6b8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min_element.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_min_element.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -32,8 +32,7 @@ namespace ranges {
// TODO(ranges): `ranges::min_element` can now simply delegate to `std::__min_element`.
template <class _Ip, class _Sp, class _Proj, class _Comp>
-_LIBCPP_HIDE_FROM_ABI static constexpr
-_Ip __min_element_impl(_Ip __first, _Sp __last, _Comp& __comp, _Proj& __proj) {
+_LIBCPP_HIDE_FROM_ABI constexpr _Ip __min_element_impl(_Ip __first, _Sp __last, _Comp& __comp, _Proj& __proj) {
if (__first == __last)
return __first;
@@ -46,29 +45,32 @@ _Ip __min_element_impl(_Ip __first, _Sp __last, _Comp& __comp, _Proj& __proj) {
namespace __min_element {
struct __fn {
- template <forward_iterator _Ip, sentinel_for<_Ip> _Sp, class _Proj = identity,
+ template <forward_iterator _Ip,
+ sentinel_for<_Ip> _Sp,
+ class _Proj = identity,
indirect_strict_weak_order<projected<_Ip, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- _Ip operator()(_Ip __first, _Sp __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Ip
+ operator()(_Ip __first, _Sp __last, _Comp __comp = {}, _Proj __proj = {}) const {
return ranges::__min_element_impl(__first, __last, __comp, __proj);
}
- template <forward_range _Rp, class _Proj = identity,
+ template <forward_range _Rp,
+ class _Proj = identity,
indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp>
+ operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
return ranges::__min_element_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
}
};
} // namespace __min_element
inline namespace __cpo {
- inline constexpr auto min_element = __min_element::__fn{};
+inline constexpr auto min_element = __min_element::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MIN_ELEMENT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax.h
index f82e00551e4..a5b5cf9bd0a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax.h
@@ -13,14 +13,18 @@
#include <__algorithm/minmax_element.h>
#include <__assert>
#include <__concepts/copyable.h>
+#include <__concepts/same_as.h>
#include <__config>
#include <__functional/identity.h>
#include <__functional/invoke.h>
#include <__functional/ranges_operations.h>
#include <__iterator/concepts.h>
+#include <__iterator/next.h>
#include <__iterator/projected.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/pair.h>
@@ -30,10 +34,10 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
+# include <__undef_macros>
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -43,46 +47,67 @@ using minmax_result = min_max_result<_T1>;
namespace __minmax {
struct __fn {
- template <class _Type, class _Proj = identity,
+ template <class _Type,
+ class _Proj = identity,
indirect_strict_weak_order<projected<const _Type*, _Proj>> _Comp = ranges::less>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_result<const _Type&>
- operator()(const _Type& __a, const _Type& __b, _Comp __comp = {}, _Proj __proj = {}) const {
+ operator()(_LIBCPP_LIFETIMEBOUND const _Type& __a,
+ _LIBCPP_LIFETIMEBOUND const _Type& __b,
+ _Comp __comp = {},
+ _Proj __proj = {}) const {
if (std::invoke(__comp, std::invoke(__proj, __b), std::invoke(__proj, __a)))
return {__b, __a};
return {__a, __b};
}
- template <copyable _Type, class _Proj = identity,
+ template <copyable _Type,
+ class _Proj = identity,
indirect_strict_weak_order<projected<const _Type*, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- ranges::minmax_result<_Type> operator()(initializer_list<_Type> __il, _Comp __comp = {}, _Proj __proj = {}) const {
- _LIBCPP_ASSERT(__il.begin() != __il.end(), "initializer_list has to contain at least one element");
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_result<_Type>
+ operator()(initializer_list<_Type> __il, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__il.begin() != __il.end(), "initializer_list has to contain at least one element");
auto __iters = std::__minmax_element_impl(__il.begin(), __il.end(), __comp, __proj);
- return ranges::minmax_result<_Type> { *__iters.first, *__iters.second };
+ return ranges::minmax_result<_Type>{*__iters.first, *__iters.second};
}
- template <input_range _Range, class _Proj = identity,
+ template <input_range _Range,
+ class _Proj = identity,
indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
requires indirectly_copyable_storable<iterator_t<_Range>, range_value_t<_Range>*>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- ranges::minmax_result<range_value_t<_Range>> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
- auto __first = ranges::begin(__r);
- auto __last = ranges::end(__r);
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_result<range_value_t<_Range>>
+ operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
+ auto __first = ranges::begin(__r);
+ auto __last = ranges::end(__r);
using _ValueT = range_value_t<_Range>;
- _LIBCPP_ASSERT(__first != __last, "range has to contain at least one element");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first != __last, "range has to contain at least one element");
if constexpr (forward_range<_Range>) {
+ // Special-case the one element case. Avoid repeatedly initializing objects from the result of an iterator
+ // dereference when doing so might not be idempotent. The `if constexpr` avoids the extra branch in cases where
+ // it's not needed.
+ if constexpr (!same_as<remove_cvref_t<range_reference_t<_Range>>, _ValueT> ||
+ is_rvalue_reference_v<range_reference_t<_Range>>) {
+ if (ranges::next(__first) == __last) {
+ // During initialization, members are allowed to refer to already initialized members
+ // (see http://eel.is/c++draft/dcl.init.aggr#6)
+ minmax_result<_ValueT> __result = {*__first, __result.min};
+ return __result;
+ }
+ }
auto __result = std::__minmax_element_impl(__first, __last, __comp, __proj);
return {*__result.first, *__result.second};
} else {
// input_iterators can't be copied, so the implementation for input_iterators has to store
// the values instead of a pointer to the correct values
auto __less = [&](auto&& __a, auto&& __b) -> bool {
- return std::invoke(__comp, std::invoke(__proj, std::forward<decltype(__a)>(__a)),
- std::invoke(__proj, std::forward<decltype(__b)>(__b)));
+ return std::invoke(__comp,
+ std::invoke(__proj, std::forward<decltype(__a)>(__a)),
+ std::invoke(__proj, std::forward<decltype(__b)>(__b)));
};
+ // During initialization, members are allowed to refer to already initialized members
+ // (see http://eel.is/c++draft/dcl.init.aggr#6)
ranges::minmax_result<_ValueT> __result = {*__first, __result.min};
if (__first == __last || ++__first == __last)
return __result;
@@ -121,7 +146,7 @@ struct __fn {
} // namespace __minmax
inline namespace __cpo {
- inline constexpr auto minmax = __minmax::__fn{};
+inline constexpr auto minmax = __minmax::__fn{};
} // namespace __cpo
} // namespace ranges
@@ -129,6 +154,6 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MINMAX_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax_element.h
index 6699f9626e1..a52319f6b5d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax_element.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_minmax_element.h
@@ -23,13 +23,12 @@
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -40,18 +39,20 @@ using minmax_element_result = min_max_result<_T1>;
namespace __minmax_element {
struct __fn {
- template <forward_iterator _Ip, sentinel_for<_Ip> _Sp, class _Proj = identity,
+ template <forward_iterator _Ip,
+ sentinel_for<_Ip> _Sp,
+ class _Proj = identity,
indirect_strict_weak_order<projected<_Ip, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- ranges::minmax_element_result<_Ip> operator()(_Ip __first, _Sp __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_element_result<_Ip>
+ operator()(_Ip __first, _Sp __last, _Comp __comp = {}, _Proj __proj = {}) const {
auto __ret = std::__minmax_element_impl(std::move(__first), std::move(__last), __comp, __proj);
return {__ret.first, __ret.second};
}
- template <forward_range _Rp, class _Proj = identity,
+ template <forward_range _Rp,
+ class _Proj = identity,
indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- ranges::minmax_element_result<borrowed_iterator_t<_Rp>>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_element_result<borrowed_iterator_t<_Rp>>
operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
auto __ret = std::__minmax_element_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
return {__ret.first, __ret.second};
@@ -60,13 +61,13 @@ struct __fn {
} // namespace __minmax_element
inline namespace __cpo {
- inline constexpr auto minmax_element = __minmax_element::__fn{};
+inline constexpr auto minmax_element = __minmax_element::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MINMAX_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_mismatch.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_mismatch.h
index 4fd05179283..db9bfc8e87d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_mismatch.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_mismatch.h
@@ -27,7 +27,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -36,12 +36,9 @@ using mismatch_result = in_in_result<_I1, _I2>;
namespace __mismatch {
struct __fn {
- template <class _I1, class _S1, class _I2, class _S2,
- class _Pred, class _Proj1, class _Proj2>
- static _LIBCPP_HIDE_FROM_ABI constexpr
- mismatch_result<_I1, _I2>
- __go(_I1 __first1, _S1 __last1, _I2 __first2, _S2 __last2,
- _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
+ template <class _I1, class _S1, class _I2, class _S2, class _Pred, class _Proj1, class _Proj2>
+ static _LIBCPP_HIDE_FROM_ABI constexpr mismatch_result<_I1, _I2>
+ __go(_I1 __first1, _S1 __last1, _I2 __first2, _S2 __last2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
while (__first1 != __last1 && __first2 != __last2) {
if (!std::invoke(__pred, std::invoke(__proj1, *__first1), std::invoke(__proj2, *__first2)))
break;
@@ -51,34 +48,41 @@ struct __fn {
return {std::move(__first1), std::move(__first2)};
}
- template <input_iterator _I1, sentinel_for<_I1> _S1,
- input_iterator _I2, sentinel_for<_I2> _S2,
- class _Pred = ranges::equal_to, class _Proj1 = identity, class _Proj2 = identity>
+ template <input_iterator _I1,
+ sentinel_for<_I1> _S1,
+ input_iterator _I2,
+ sentinel_for<_I2> _S2,
+ class _Pred = ranges::equal_to,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
requires indirectly_comparable<_I1, _I2, _Pred, _Proj1, _Proj2>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- mismatch_result<_I1, _I2> operator()(_I1 __first1, _S1 __last1, _I2 __first2, _S2 __last2,
- _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr mismatch_result<_I1, _I2> operator()(
+ _I1 __first1, _S1 __last1, _I2 __first2, _S2 __last2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {})
+ const {
return __go(std::move(__first1), __last1, std::move(__first2), __last2, __pred, __proj1, __proj2);
}
- template <input_range _R1, input_range _R2,
- class _Pred = ranges::equal_to, class _Proj1 = identity, class _Proj2 = identity>
+ template <input_range _R1,
+ input_range _R2,
+ class _Pred = ranges::equal_to,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
requires indirectly_comparable<iterator_t<_R1>, iterator_t<_R2>, _Pred, _Proj1, _Proj2>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- mismatch_result<borrowed_iterator_t<_R1>, borrowed_iterator_t<_R2>>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr mismatch_result<borrowed_iterator_t<_R1>,
+ borrowed_iterator_t<_R2>>
operator()(_R1&& __r1, _R2&& __r2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
- return __go(ranges::begin(__r1), ranges::end(__r1), ranges::begin(__r2), ranges::end(__r2),
- __pred, __proj1, __proj2);
+ return __go(
+ ranges::begin(__r1), ranges::end(__r1), ranges::begin(__r2), ranges::end(__r2), __pred, __proj1, __proj2);
}
};
} // namespace __mismatch
inline namespace __cpo {
- constexpr inline auto mismatch = __mismatch::__fn{};
+constexpr inline auto mismatch = __mismatch::__fn{};
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_move.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_move.h
index 46a0970f834..8bd2409f891 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_move.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_move.h
@@ -23,7 +23,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -34,38 +34,36 @@ using move_result = in_out_result<_InIter, _OutIter>;
namespace __move {
struct __fn {
-
template <class _InIter, class _Sent, class _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- move_result<_InIter, _OutIter> __move_impl(_InIter __first, _Sent __last, _OutIter __result) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static move_result<_InIter, _OutIter>
+ __move_impl(_InIter __first, _Sent __last, _OutIter __result) {
auto __ret = std::__move<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
return {std::move(__ret.first), std::move(__ret.second)};
}
template <input_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter>
requires indirectly_movable<_InIter, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- move_result<_InIter, _OutIter> operator()(_InIter __first, _Sent __last, _OutIter __result) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr move_result<_InIter, _OutIter>
+ operator()(_InIter __first, _Sent __last, _OutIter __result) const {
return __move_impl(std::move(__first), std::move(__last), std::move(__result));
}
template <input_range _Range, weakly_incrementable _OutIter>
requires indirectly_movable<iterator_t<_Range>, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- move_result<borrowed_iterator_t<_Range>, _OutIter> operator()(_Range&& __range, _OutIter __result) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr move_result<borrowed_iterator_t<_Range>, _OutIter>
+ operator()(_Range&& __range, _OutIter __result) const {
return __move_impl(ranges::begin(__range), ranges::end(__range), std::move(__result));
}
-
};
} // namespace __move
inline namespace __cpo {
- inline constexpr auto move = __move::__fn{};
+inline constexpr auto move = __move::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MOVE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_move_backward.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_move_backward.h
index d4e8eb1a500..ee390a40e48 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_move_backward.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_move_backward.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -36,38 +36,36 @@ using move_backward_result = in_out_result<_InIter, _OutIter>;
namespace __move_backward {
struct __fn {
-
template <class _InIter, class _Sent, class _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- move_backward_result<_InIter, _OutIter> __move_backward_impl(_InIter __first, _Sent __last, _OutIter __result) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static move_backward_result<_InIter, _OutIter>
+ __move_backward_impl(_InIter __first, _Sent __last, _OutIter __result) {
auto __ret = std::__move_backward<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
return {std::move(__ret.first), std::move(__ret.second)};
}
template <bidirectional_iterator _InIter, sentinel_for<_InIter> _Sent, bidirectional_iterator _OutIter>
requires indirectly_movable<_InIter, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- move_backward_result<_InIter, _OutIter> operator()(_InIter __first, _Sent __last, _OutIter __result) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr move_backward_result<_InIter, _OutIter>
+ operator()(_InIter __first, _Sent __last, _OutIter __result) const {
return __move_backward_impl(std::move(__first), std::move(__last), std::move(__result));
}
template <bidirectional_range _Range, bidirectional_iterator _Iter>
requires indirectly_movable<iterator_t<_Range>, _Iter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- move_backward_result<borrowed_iterator_t<_Range>, _Iter> operator()(_Range&& __range, _Iter __result) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr move_backward_result<borrowed_iterator_t<_Range>, _Iter>
+ operator()(_Range&& __range, _Iter __result) const {
return __move_backward_impl(ranges::begin(__range), ranges::end(__range), std::move(__result));
}
-
};
} // namespace __move_backward
inline namespace __cpo {
- inline constexpr auto move_backward = __move_backward::__fn{};
+inline constexpr auto move_backward = __move_backward::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MOVE_BACKWARD_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_next_permutation.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_next_permutation.h
index 6c8e8e1529f..9ebab3ea7c1 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_next_permutation.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_next_permutation.h
@@ -28,7 +28,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -68,6 +68,6 @@ constexpr inline auto next_permutation = __next_permutation::__fn{};
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_NEXT_PERMUTATION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_none_of.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_none_of.h
index b39e570fd33..b0d363895e0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_none_of.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_none_of.h
@@ -22,17 +22,16 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __none_of {
struct __fn {
-
template <class _Iter, class _Sent, class _Proj, class _Pred>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- bool __none_of_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static bool
+ __none_of_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
for (; __first != __last; ++__first) {
if (std::invoke(__pred, std::invoke(__proj, *__first)))
return false;
@@ -40,29 +39,32 @@ struct __fn {
return true;
}
- template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+ template <input_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Iter __first, _Sent __last, _Pred __pred = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Iter __first, _Sent __last, _Pred __pred = {}, _Proj __proj = {}) const {
return __none_of_impl(std::move(__first), std::move(__last), __pred, __proj);
}
- template <input_range _Range, class _Proj = identity,
+ template <input_range _Range,
+ class _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- bool operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+ operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
return __none_of_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
}
};
} // namespace __none_of
inline namespace __cpo {
- inline constexpr auto none_of = __none_of::__fn{};
+inline constexpr auto none_of = __none_of::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_NONE_OF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_nth_element.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_nth_element.h
index d9ec4f13825..7abdbd0889e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_nth_element.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_nth_element.h
@@ -31,7 +31,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -40,8 +40,8 @@ namespace __nth_element {
struct __fn {
template <class _Iter, class _Sent, class _Comp, class _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- _Iter __nth_element_fn_impl(_Iter __first, _Iter __nth, _Sent __last, _Comp& __comp, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static _Iter
+ __nth_element_fn_impl(_Iter __first, _Iter __nth, _Sent __last, _Comp& __comp, _Proj& __proj) {
auto __last_iter = ranges::next(__first, __last);
auto&& __projected_comp = std::__make_projected(__comp, __proj);
@@ -52,16 +52,15 @@ struct __fn {
template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Iter __nth, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, _Iter __nth, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
return __nth_element_fn_impl(std::move(__first), std::move(__nth), std::move(__last), __comp, __proj);
}
template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
requires sortable<iterator_t<_Range>, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __r, iterator_t<_Range> __nth, _Comp __comp = {},
- _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+ operator()(_Range&& __r, iterator_t<_Range> __nth, _Comp __comp = {}, _Proj __proj = {}) const {
return __nth_element_fn_impl(ranges::begin(__r), std::move(__nth), ranges::end(__r), __comp, __proj);
}
};
@@ -69,12 +68,12 @@ struct __fn {
} // namespace __nth_element
inline namespace __cpo {
- inline constexpr auto nth_element = __nth_element::__fn{};
+inline constexpr auto nth_element = __nth_element::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_NTH_ELEMENT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partial_sort.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partial_sort.h
index 3ea0a7fb44b..9ec8882097d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partial_sort.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partial_sort.h
@@ -33,7 +33,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -42,24 +42,23 @@ namespace __partial_sort {
struct __fn {
template <class _Iter, class _Sent, class _Comp, class _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- _Iter __partial_sort_fn_impl(_Iter __first, _Iter __middle, _Sent __last, _Comp& __comp, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static _Iter
+ __partial_sort_fn_impl(_Iter __first, _Iter __middle, _Sent __last, _Comp& __comp, _Proj& __proj) {
auto&& __projected_comp = std::__make_projected(__comp, __proj);
return std::__partial_sort<_RangeAlgPolicy>(std::move(__first), std::move(__middle), __last, __projected_comp);
}
template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Iter __middle, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, _Iter __middle, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
return __partial_sort_fn_impl(std::move(__first), std::move(__middle), std::move(__last), __comp, __proj);
}
template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
requires sortable<iterator_t<_Range>, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __r, iterator_t<_Range> __middle, _Comp __comp = {},
- _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+ operator()(_Range&& __r, iterator_t<_Range> __middle, _Comp __comp = {}, _Proj __proj = {}) const {
return __partial_sort_fn_impl(ranges::begin(__r), std::move(__middle), ranges::end(__r), __comp, __proj);
}
};
@@ -67,12 +66,12 @@ struct __fn {
} // namespace __partial_sort
inline namespace __cpo {
- inline constexpr auto partial_sort = __partial_sort::__fn{};
+inline constexpr auto partial_sort = __partial_sort::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partial_sort_copy.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partial_sort_copy.h
index 212db555a8d..eba7d9ac416 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partial_sort_copy.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partial_sort_copy.h
@@ -30,7 +30,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -42,51 +42,68 @@ using partial_sort_copy_result = in_out_result<_InIter, _OutIter>;
namespace __partial_sort_copy {
struct __fn {
-
- template <input_iterator _Iter1, sentinel_for<_Iter1> _Sent1,
- random_access_iterator _Iter2, sentinel_for<_Iter2> _Sent2,
- class _Comp = ranges::less, class _Proj1 = identity, class _Proj2 = identity>
- requires indirectly_copyable<_Iter1, _Iter2> && sortable<_Iter2, _Comp, _Proj2> &&
- indirect_strict_weak_order<_Comp, projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>>
- _LIBCPP_HIDE_FROM_ABI constexpr
- partial_sort_copy_result<_Iter1, _Iter2>
- operator()(_Iter1 __first, _Sent1 __last, _Iter2 __result_first, _Sent2 __result_last,
- _Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+ template <input_iterator _Iter1,
+ sentinel_for<_Iter1> _Sent1,
+ random_access_iterator _Iter2,
+ sentinel_for<_Iter2> _Sent2,
+ class _Comp = ranges::less,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
+ requires indirectly_copyable<_Iter1, _Iter2> && sortable<_Iter2, _Comp, _Proj2> &&
+ indirect_strict_weak_order<_Comp, projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>>
+ _LIBCPP_HIDE_FROM_ABI constexpr partial_sort_copy_result<_Iter1, _Iter2> operator()(
+ _Iter1 __first,
+ _Sent1 __last,
+ _Iter2 __result_first,
+ _Sent2 __result_last,
+ _Comp __comp = {},
+ _Proj1 __proj1 = {},
+ _Proj2 __proj2 = {}) const {
auto __result = std::__partial_sort_copy<_RangeAlgPolicy>(
- std::move(__first), std::move(__last), std::move(__result_first), std::move(__result_last),
- __comp, __proj1, __proj2
- );
+ std::move(__first),
+ std::move(__last),
+ std::move(__result_first),
+ std::move(__result_last),
+ __comp,
+ __proj1,
+ __proj2);
return {std::move(__result.first), std::move(__result.second)};
}
- template <input_range _Range1, random_access_range _Range2, class _Comp = ranges::less,
- class _Proj1 = identity, class _Proj2 = identity>
- requires indirectly_copyable<iterator_t<_Range1>, iterator_t<_Range2>> &&
- sortable<iterator_t<_Range2>, _Comp, _Proj2> &&
- indirect_strict_weak_order<_Comp, projected<iterator_t<_Range1>, _Proj1>,
- projected<iterator_t<_Range2>, _Proj2>>
- _LIBCPP_HIDE_FROM_ABI constexpr
- partial_sort_copy_result<borrowed_iterator_t<_Range1>, borrowed_iterator_t<_Range2>>
- operator()(_Range1&& __range, _Range2&& __result_range, _Comp __comp = {},
- _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+ template <input_range _Range1,
+ random_access_range _Range2,
+ class _Comp = ranges::less,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
+ requires indirectly_copyable<iterator_t<_Range1>, iterator_t<_Range2>> &&
+ sortable<iterator_t<_Range2>, _Comp, _Proj2> &&
+ indirect_strict_weak_order<_Comp,
+ projected<iterator_t<_Range1>, _Proj1>,
+ projected<iterator_t<_Range2>, _Proj2>>
+ _LIBCPP_HIDE_FROM_ABI constexpr partial_sort_copy_result<borrowed_iterator_t<_Range1>, borrowed_iterator_t<_Range2>>
+ operator()(
+ _Range1&& __range, _Range2&& __result_range, _Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
auto __result = std::__partial_sort_copy<_RangeAlgPolicy>(
- ranges::begin(__range), ranges::end(__range), ranges::begin(__result_range), ranges::end(__result_range),
- __comp, __proj1, __proj2
- );
+ ranges::begin(__range),
+ ranges::end(__range),
+ ranges::begin(__result_range),
+ ranges::end(__result_range),
+ __comp,
+ __proj1,
+ __proj2);
return {std::move(__result.first), std::move(__result.second)};
}
-
};
} // namespace __partial_sort_copy
inline namespace __cpo {
- inline constexpr auto partial_sort_copy = __partial_sort_copy::__fn{};
+inline constexpr auto partial_sort_copy = __partial_sort_copy::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_COPY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition.h
index 8b3aae5c250..89d192b51fd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition.h
@@ -27,13 +27,12 @@
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -41,43 +40,44 @@ namespace ranges {
namespace __partition {
struct __fn {
-
template <class _Iter, class _Sent, class _Proj, class _Pred>
- _LIBCPP_HIDE_FROM_ABI static constexpr
- subrange<__remove_cvref_t<_Iter>> __partition_fn_impl(_Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) {
+ _LIBCPP_HIDE_FROM_ABI static constexpr subrange<__remove_cvref_t<_Iter>>
+ __partition_fn_impl(_Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) {
auto&& __projected_pred = std::__make_projected(__pred, __proj);
- auto __result = std::__partition<_RangeAlgPolicy>(
+ auto __result = std::__partition<_RangeAlgPolicy>(
std::move(__first), std::move(__last), __projected_pred, __iterator_concept<_Iter>());
return {std::move(__result.first), std::move(__result.second)};
}
- template <permutable _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+ template <permutable _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
- _LIBCPP_HIDE_FROM_ABI constexpr
- subrange<_Iter> operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter>
+ operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
return __partition_fn_impl(__first, __last, __pred, __proj);
}
- template <forward_range _Range, class _Proj = identity,
+ template <forward_range _Range,
+ class _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
- requires permutable<iterator_t<_Range>>
- _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_subrange_t<_Range> operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
+ requires permutable<iterator_t<_Range>>
+ _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range>
+ operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
return __partition_fn_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
}
-
};
} // namespace __partition
inline namespace __cpo {
- inline constexpr auto partition = __partition::__fn{};
+inline constexpr auto partition = __partition::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PARTITION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition_copy.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition_copy.h
index e7a9a347df5..6a16b02db3e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition_copy.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition_copy.h
@@ -19,14 +19,14 @@
#include <__ranges/access.h>
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -38,14 +38,18 @@ using partition_copy_result = in_out_out_result<_InIter, _OutIter1, _OutIter2>;
namespace __partition_copy {
struct __fn {
-
// TODO(ranges): delegate to the classic algorithm.
template <class _InIter, class _Sent, class _OutIter1, class _OutIter2, class _Proj, class _Pred>
- _LIBCPP_HIDE_FROM_ABI constexpr
- static partition_copy_result<
- __remove_cvref_t<_InIter>, __remove_cvref_t<_OutIter1>, __remove_cvref_t<_OutIter2>
- > __partition_copy_fn_impl( _InIter&& __first, _Sent&& __last, _OutIter1&& __out_true, _OutIter2&& __out_false,
- _Pred& __pred, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static partition_copy_result<__remove_cvref_t<_InIter>,
+ __remove_cvref_t<_OutIter1>,
+ __remove_cvref_t<_OutIter2> >
+ __partition_copy_fn_impl(
+ _InIter&& __first,
+ _Sent&& __last,
+ _OutIter1&& __out_true,
+ _OutIter2&& __out_false,
+ _Pred& __pred,
+ _Proj& __proj) {
for (; __first != __last; ++__first) {
if (std::invoke(__pred, std::invoke(__proj, *__first))) {
*__out_true = *__first;
@@ -60,39 +64,42 @@ struct __fn {
return {std::move(__first), std::move(__out_true), std::move(__out_false)};
}
- template <input_iterator _InIter, sentinel_for<_InIter> _Sent,
- weakly_incrementable _OutIter1, weakly_incrementable _OutIter2,
- class _Proj = identity, indirect_unary_predicate<projected<_InIter, _Proj>> _Pred>
- requires indirectly_copyable<_InIter, _OutIter1> && indirectly_copyable<_InIter, _OutIter2>
- _LIBCPP_HIDE_FROM_ABI constexpr
- partition_copy_result<_InIter, _OutIter1, _OutIter2>
- operator()(_InIter __first, _Sent __last, _OutIter1 __out_true, _OutIter2 __out_false,
- _Pred __pred, _Proj __proj = {}) const {
+ template <input_iterator _InIter,
+ sentinel_for<_InIter> _Sent,
+ weakly_incrementable _OutIter1,
+ weakly_incrementable _OutIter2,
+ class _Proj = identity,
+ indirect_unary_predicate<projected<_InIter, _Proj>> _Pred>
+ requires indirectly_copyable<_InIter, _OutIter1> && indirectly_copyable<_InIter, _OutIter2>
+ _LIBCPP_HIDE_FROM_ABI constexpr partition_copy_result<_InIter, _OutIter1, _OutIter2> operator()(
+ _InIter __first, _Sent __last, _OutIter1 __out_true, _OutIter2 __out_false, _Pred __pred, _Proj __proj = {})
+ const {
return __partition_copy_fn_impl(
std::move(__first), std::move(__last), std::move(__out_true), std::move(__out_false), __pred, __proj);
}
- template <input_range _Range, weakly_incrementable _OutIter1, weakly_incrementable _OutIter2,
- class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
- requires indirectly_copyable<iterator_t<_Range>, _OutIter1> && indirectly_copyable<iterator_t<_Range>, _OutIter2>
- _LIBCPP_HIDE_FROM_ABI constexpr
- partition_copy_result<borrowed_iterator_t<_Range>, _OutIter1, _OutIter2>
+ template <input_range _Range,
+ weakly_incrementable _OutIter1,
+ weakly_incrementable _OutIter2,
+ class _Proj = identity,
+ indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
+ requires indirectly_copyable<iterator_t<_Range>, _OutIter1> && indirectly_copyable<iterator_t<_Range>, _OutIter2>
+ _LIBCPP_HIDE_FROM_ABI constexpr partition_copy_result<borrowed_iterator_t<_Range>, _OutIter1, _OutIter2>
operator()(_Range&& __range, _OutIter1 __out_true, _OutIter2 __out_false, _Pred __pred, _Proj __proj = {}) const {
return __partition_copy_fn_impl(
ranges::begin(__range), ranges::end(__range), std::move(__out_true), std::move(__out_false), __pred, __proj);
}
-
};
} // namespace __partition_copy
inline namespace __cpo {
- inline constexpr auto partition_copy = __partition_copy::__fn{};
+inline constexpr auto partition_copy = __partition_copy::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PARTITION_COPY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition_point.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition_point.h
index 2bd118d4def..6fc20e7d00e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition_point.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_partition_point.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -35,16 +35,15 @@ namespace ranges {
namespace __partition_point {
struct __fn {
-
// TODO(ranges): delegate to the classic algorithm.
template <class _Iter, class _Sent, class _Proj, class _Pred>
- _LIBCPP_HIDE_FROM_ABI constexpr
- static _Iter __partition_point_fn_impl(_Iter&& __first, _Sent&& __last, _Pred& __pred, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static _Iter
+ __partition_point_fn_impl(_Iter&& __first, _Sent&& __last, _Pred& __pred, _Proj& __proj) {
auto __len = ranges::distance(__first, __last);
while (__len != 0) {
auto __half_len = std::__half_positive(__len);
- auto __mid = ranges::next(__first, __half_len);
+ auto __mid = ranges::next(__first, __half_len);
if (std::invoke(__pred, std::invoke(__proj, *__mid))) {
__first = ++__mid;
@@ -58,31 +57,32 @@ struct __fn {
return __first;
}
- template <forward_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+ template <forward_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iter operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
return __partition_point_fn_impl(std::move(__first), std::move(__last), __pred, __proj);
}
- template <forward_range _Range, class _Proj = identity,
+ template <forward_range _Range,
+ class _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
- _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+ operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
return __partition_point_fn_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
}
-
};
} // namespace __partition_point
inline namespace __cpo {
- inline constexpr auto partition_point = __partition_point::__fn{};
+inline constexpr auto partition_point = __partition_point::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PARTITION_POINT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_pop_heap.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_pop_heap.h
index 65beec88644..364cfe94b16 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_pop_heap.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_pop_heap.h
@@ -32,7 +32,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -41,10 +41,10 @@ namespace __pop_heap {
struct __fn {
template <class _Iter, class _Sent, class _Comp, class _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- _Iter __pop_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static _Iter
+ __pop_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
auto __last_iter = ranges::next(__first, __last);
- auto __len = __last_iter - __first;
+ auto __len = __last_iter - __first;
auto&& __projected_comp = std::__make_projected(__comp, __proj);
std::__pop_heap<_RangeAlgPolicy>(std::move(__first), __last_iter, __projected_comp, __len);
@@ -54,15 +54,15 @@ struct __fn {
template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
return __pop_heap_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
}
template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
requires sortable<iterator_t<_Range>, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+ operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
return __pop_heap_fn_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
}
};
@@ -70,12 +70,12 @@ struct __fn {
} // namespace __pop_heap
inline namespace __cpo {
- inline constexpr auto pop_heap = __pop_heap::__fn{};
+inline constexpr auto pop_heap = __pop_heap::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_POP_HEAP_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_prev_permutation.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_prev_permutation.h
index 6866d90cf48..ae7a68cce5f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_prev_permutation.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_prev_permutation.h
@@ -28,7 +28,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -40,9 +40,7 @@ using prev_permutation_result = in_found_result<_InIter>;
namespace __prev_permutation {
struct __fn {
-
- template <bidirectional_iterator _Iter, sentinel_for<_Iter> _Sent,
- class _Comp = ranges::less, class _Proj = identity>
+ template <bidirectional_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
_LIBCPP_HIDE_FROM_ABI constexpr prev_permutation_result<_Iter>
operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
@@ -51,8 +49,7 @@ struct __fn {
return {std::move(__result.first), std::move(__result.second)};
}
- template <bidirectional_range _Range,
- class _Comp = ranges::less, class _Proj = identity>
+ template <bidirectional_range _Range, class _Comp = ranges::less, class _Proj = identity>
requires sortable<iterator_t<_Range>, _Comp, _Proj>
_LIBCPP_HIDE_FROM_ABI constexpr prev_permutation_result<borrowed_iterator_t<_Range>>
operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
@@ -60,7 +57,6 @@ struct __fn {
ranges::begin(__range), ranges::end(__range), std::__make_projected(__comp, __proj));
return {std::move(__result.first), std::move(__result.second)};
}
-
};
} // namespace __prev_permutation
@@ -72,6 +68,6 @@ constexpr inline auto prev_permutation = __prev_permutation::__fn{};
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PREV_PERMUTATION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_push_heap.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_push_heap.h
index a1f43474176..1ed9c953f54 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_push_heap.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_push_heap.h
@@ -32,7 +32,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -41,8 +41,8 @@ namespace __push_heap {
struct __fn {
template <class _Iter, class _Sent, class _Comp, class _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- _Iter __push_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static _Iter
+ __push_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
auto __last_iter = ranges::next(__first, __last);
auto&& __projected_comp = std::__make_projected(__comp, __proj);
@@ -53,15 +53,15 @@ struct __fn {
template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
return __push_heap_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
}
template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
requires sortable<iterator_t<_Range>, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+ operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
return __push_heap_fn_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
}
};
@@ -69,12 +69,12 @@ struct __fn {
} // namespace __push_heap
inline namespace __cpo {
- inline constexpr auto push_heap = __push_heap::__fn{};
+inline constexpr auto push_heap = __push_heap::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PUSH_HEAP_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove.h
index dd5c5fb4536..bf0928df599 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove.h
@@ -25,27 +25,26 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __remove {
struct __fn {
-
template <permutable _Iter, sentinel_for<_Iter> _Sent, class _Type, class _Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<_Iter, _Proj>, const _Type*>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- subrange<_Iter> operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter>
+ operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) const {
auto __pred = [&](auto&& __other) { return __value == __other; };
return ranges::__remove_if_impl(std::move(__first), std::move(__last), __pred, __proj);
}
template <forward_range _Range, class _Type, class _Proj = identity>
- requires permutable<iterator_t<_Range>>
- && indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type*>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_subrange_t<_Range> operator()(_Range&& __range, const _Type& __value, _Proj __proj = {}) const {
+ requires permutable<iterator_t<_Range>> &&
+ indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type*>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range>
+ operator()(_Range&& __range, const _Type& __value, _Proj __proj = {}) const {
auto __pred = [&](auto&& __other) { return __value == __other; };
return ranges::__remove_if_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
}
@@ -53,12 +52,12 @@ struct __fn {
} // namespace __remove
inline namespace __cpo {
- inline constexpr auto remove = __remove::__fn{};
+inline constexpr auto remove = __remove::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_copy.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_copy.h
index 21022286675..457d593957a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_copy.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_copy.h
@@ -26,7 +26,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -37,40 +37,40 @@ using remove_copy_result = in_out_result<_InIter, _OutIter>;
namespace __remove_copy {
- struct __fn {
- template <input_iterator _InIter,
- sentinel_for<_InIter> _Sent,
- weakly_incrementable _OutIter,
- class _Type,
- class _Proj = identity>
- requires indirectly_copyable<_InIter, _OutIter> &&
- indirect_binary_predicate<ranges::equal_to, projected<_InIter, _Proj>, const _Type*>
- _LIBCPP_HIDE_FROM_ABI constexpr remove_copy_result<_InIter, _OutIter>
- operator()(_InIter __first, _Sent __last, _OutIter __result, const _Type& __value, _Proj __proj = {}) const {
- auto __pred = [&](auto&& __val) { return __value == __val; };
- return ranges::__remove_copy_if_impl(std::move(__first), std::move(__last), std::move(__result), __pred, __proj);
- }
+struct __fn {
+ template <input_iterator _InIter,
+ sentinel_for<_InIter> _Sent,
+ weakly_incrementable _OutIter,
+ class _Type,
+ class _Proj = identity>
+ requires indirectly_copyable<_InIter, _OutIter> &&
+ indirect_binary_predicate<ranges::equal_to, projected<_InIter, _Proj>, const _Type*>
+ _LIBCPP_HIDE_FROM_ABI constexpr remove_copy_result<_InIter, _OutIter>
+ operator()(_InIter __first, _Sent __last, _OutIter __result, const _Type& __value, _Proj __proj = {}) const {
+ auto __pred = [&](auto&& __val) { return __value == __val; };
+ return ranges::__remove_copy_if_impl(std::move(__first), std::move(__last), std::move(__result), __pred, __proj);
+ }
- template <input_range _Range, weakly_incrementable _OutIter, class _Type, class _Proj = identity>
- requires indirectly_copyable<iterator_t<_Range>, _OutIter> &&
- indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type*>
- _LIBCPP_HIDE_FROM_ABI constexpr remove_copy_result<borrowed_iterator_t<_Range>, _OutIter>
- operator()(_Range&& __range, _OutIter __result, const _Type& __value, _Proj __proj = {}) const {
- auto __pred = [&](auto&& __val) { return __value == __val; };
- return ranges::__remove_copy_if_impl(
- ranges::begin(__range), ranges::end(__range), std::move(__result), __pred, __proj);
- }
- };
+ template <input_range _Range, weakly_incrementable _OutIter, class _Type, class _Proj = identity>
+ requires indirectly_copyable<iterator_t<_Range>, _OutIter> &&
+ indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type*>
+ _LIBCPP_HIDE_FROM_ABI constexpr remove_copy_result<borrowed_iterator_t<_Range>, _OutIter>
+ operator()(_Range&& __range, _OutIter __result, const _Type& __value, _Proj __proj = {}) const {
+ auto __pred = [&](auto&& __val) { return __value == __val; };
+ return ranges::__remove_copy_if_impl(
+ ranges::begin(__range), ranges::end(__range), std::move(__result), __pred, __proj);
+ }
+};
} // namespace __remove_copy
inline namespace __cpo {
- inline constexpr auto remove_copy = __remove_copy::__fn{};
+inline constexpr auto remove_copy = __remove_copy::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_copy_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_copy_if.h
index 4fc67454b92..c07b4813d7d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_copy_if.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_copy_if.h
@@ -29,7 +29,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -52,39 +52,39 @@ __remove_copy_if_impl(_InIter __first, _Sent __last, _OutIter __result, _Pred& _
namespace __remove_copy_if {
- struct __fn {
- template <input_iterator _InIter,
- sentinel_for<_InIter> _Sent,
- weakly_incrementable _OutIter,
- class _Proj = identity,
- indirect_unary_predicate<projected<_InIter, _Proj>> _Pred>
- requires indirectly_copyable<_InIter, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr remove_copy_if_result<_InIter, _OutIter>
- operator()(_InIter __first, _Sent __last, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
- return ranges::__remove_copy_if_impl(std::move(__first), std::move(__last), std::move(__result), __pred, __proj);
- }
+struct __fn {
+ template <input_iterator _InIter,
+ sentinel_for<_InIter> _Sent,
+ weakly_incrementable _OutIter,
+ class _Proj = identity,
+ indirect_unary_predicate<projected<_InIter, _Proj>> _Pred>
+ requires indirectly_copyable<_InIter, _OutIter>
+ _LIBCPP_HIDE_FROM_ABI constexpr remove_copy_if_result<_InIter, _OutIter>
+ operator()(_InIter __first, _Sent __last, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
+ return ranges::__remove_copy_if_impl(std::move(__first), std::move(__last), std::move(__result), __pred, __proj);
+ }
- template <input_range _Range,
- weakly_incrementable _OutIter,
- class _Proj = identity,
- indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
- requires indirectly_copyable<iterator_t<_Range>, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr remove_copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
- operator()(_Range&& __range, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
- return ranges::__remove_copy_if_impl(
- ranges::begin(__range), ranges::end(__range), std::move(__result), __pred, __proj);
- }
- };
+ template <input_range _Range,
+ weakly_incrementable _OutIter,
+ class _Proj = identity,
+ indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
+ requires indirectly_copyable<iterator_t<_Range>, _OutIter>
+ _LIBCPP_HIDE_FROM_ABI constexpr remove_copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
+ operator()(_Range&& __range, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
+ return ranges::__remove_copy_if_impl(
+ ranges::begin(__range), ranges::end(__range), std::move(__result), __pred, __proj);
+ }
+};
} // namespace __remove_copy_if
inline namespace __cpo {
- inline constexpr auto remove_copy_if = __remove_copy_if::__fn{};
+inline constexpr auto remove_copy_if = __remove_copy_if::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_IF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_if.h
index 1f17467fc43..4b7aa2d2be7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_if.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_remove_if.h
@@ -27,15 +27,15 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
template <class _Iter, class _Sent, class _Proj, class _Pred>
-_LIBCPP_HIDE_FROM_ABI constexpr
-subrange<_Iter> __remove_if_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
+_LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter>
+__remove_if_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
auto __new_end = ranges::__find_if_impl(__first, __last, __pred, __proj);
if (__new_end == __last)
return {__new_end, __new_end};
@@ -52,12 +52,12 @@ subrange<_Iter> __remove_if_impl(_Iter __first, _Sent __last, _Pred& __pred, _Pr
namespace __remove_if {
struct __fn {
-
- template <permutable _Iter, sentinel_for<_Iter> _Sent,
+ template <permutable _Iter,
+ sentinel_for<_Iter> _Sent,
class _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- subrange<_Iter> operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter>
+ operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
return ranges::__remove_if_impl(std::move(__first), std::move(__last), __pred, __proj);
}
@@ -65,21 +65,20 @@ struct __fn {
class _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
requires permutable<iterator_t<_Range>>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_subrange_t<_Range> operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range>
+ operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
return ranges::__remove_if_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
}
-
};
} // namespace __remove_if
inline namespace __cpo {
- inline constexpr auto remove_if = __remove_if::__fn{};
+inline constexpr auto remove_if = __remove_if::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_IF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace.h
index 8b12beacb71..714fd5c7b08 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace.h
@@ -24,51 +24,40 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __replace {
struct __fn {
-
- template <input_iterator _Iter, sentinel_for<_Iter> _Sent,
- class _Type1,
- class _Type2,
- class _Proj = identity>
- requires indirectly_writable<_Iter, const _Type2&>
- && indirect_binary_predicate<ranges::equal_to, projected<_Iter, _Proj>, const _Type1*>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last,
- const _Type1& __old_value,
- const _Type2& __new_value,
- _Proj __proj = {}) const {
+ template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Type1, class _Type2, class _Proj = identity>
+ requires indirectly_writable<_Iter, const _Type2&> &&
+ indirect_binary_predicate<ranges::equal_to, projected<_Iter, _Proj>, const _Type1*>
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iter operator()(
+ _Iter __first, _Sent __last, const _Type1& __old_value, const _Type2& __new_value, _Proj __proj = {}) const {
auto __pred = [&](const auto& __val) { return __val == __old_value; };
return ranges::__replace_if_impl(std::move(__first), std::move(__last), __pred, __new_value, __proj);
}
- template <input_range _Range,
- class _Type1,
- class _Type2,
- class _Proj = identity>
- requires indirectly_writable<iterator_t<_Range>, const _Type2&>
- && indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type1*>
+ template <input_range _Range, class _Type1, class _Type2, class _Proj = identity>
+ requires indirectly_writable<iterator_t<_Range>, const _Type2&> &&
+ indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type1*>
_LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
operator()(_Range&& __range, const _Type1& __old_value, const _Type2& __new_value, _Proj __proj = {}) const {
auto __pred = [&](auto&& __val) { return __val == __old_value; };
return ranges::__replace_if_impl(ranges::begin(__range), ranges::end(__range), __pred, __new_value, __proj);
}
-
};
} // namespace __replace
inline namespace __cpo {
- inline constexpr auto replace = __replace::__fn{};
+inline constexpr auto replace = __replace::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_copy.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_copy.h
index f87a236fbd0..124ff8f2c55 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_copy.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_copy.h
@@ -26,7 +26,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -37,55 +37,52 @@ using replace_copy_result = in_out_result<_InIter, _OutIter>;
namespace __replace_copy {
- struct __fn {
- template <input_iterator _InIter,
- sentinel_for<_InIter> _Sent,
- class _OldType,
- class _NewType,
- output_iterator<const _NewType&> _OutIter,
- class _Proj = identity>
- requires indirectly_copyable<_InIter, _OutIter> &&
- indirect_binary_predicate<ranges::equal_to, projected<_InIter, _Proj>, const _OldType*>
- _LIBCPP_HIDE_FROM_ABI constexpr replace_copy_result<_InIter, _OutIter>
- operator()(_InIter __first,
- _Sent __last,
- _OutIter __result,
- const _OldType& __old_value,
- const _NewType& __new_value,
- _Proj __proj = {}) const {
- auto __pred = [&](const auto& __value) { return __value == __old_value; };
- return ranges::__replace_copy_if_impl(
- std::move(__first), std::move(__last), std::move(__result), __pred, __new_value, __proj);
- }
+struct __fn {
+ template <input_iterator _InIter,
+ sentinel_for<_InIter> _Sent,
+ class _OldType,
+ class _NewType,
+ output_iterator<const _NewType&> _OutIter,
+ class _Proj = identity>
+ requires indirectly_copyable<_InIter, _OutIter> &&
+ indirect_binary_predicate<ranges::equal_to, projected<_InIter, _Proj>, const _OldType*>
+ _LIBCPP_HIDE_FROM_ABI constexpr replace_copy_result<_InIter, _OutIter>
+ operator()(_InIter __first,
+ _Sent __last,
+ _OutIter __result,
+ const _OldType& __old_value,
+ const _NewType& __new_value,
+ _Proj __proj = {}) const {
+ auto __pred = [&](const auto& __value) { return __value == __old_value; };
+ return ranges::__replace_copy_if_impl(
+ std::move(__first), std::move(__last), std::move(__result), __pred, __new_value, __proj);
+ }
- template <input_range _Range,
- class _OldType,
- class _NewType,
- output_iterator<const _NewType&> _OutIter,
- class _Proj = identity>
- requires indirectly_copyable<iterator_t<_Range>, _OutIter> &&
- indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _OldType*>
- _LIBCPP_HIDE_FROM_ABI constexpr replace_copy_result<borrowed_iterator_t<_Range>, _OutIter>
- operator()(_Range&& __range,
- _OutIter __result,
- const _OldType& __old_value,
- const _NewType& __new_value,
- _Proj __proj = {}) const {
- auto __pred = [&](const auto& __value) { return __value == __old_value; };
- return ranges::__replace_copy_if_impl(
- ranges::begin(__range), ranges::end(__range), std::move(__result), __pred, __new_value, __proj);
- }
- };
+ template <input_range _Range,
+ class _OldType,
+ class _NewType,
+ output_iterator<const _NewType&> _OutIter,
+ class _Proj = identity>
+ requires indirectly_copyable<iterator_t<_Range>, _OutIter> &&
+ indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _OldType*>
+ _LIBCPP_HIDE_FROM_ABI constexpr replace_copy_result<borrowed_iterator_t<_Range>, _OutIter> operator()(
+ _Range&& __range, _OutIter __result, const _OldType& __old_value, const _NewType& __new_value, _Proj __proj = {})
+ const {
+ auto __pred = [&](const auto& __value) { return __value == __old_value; };
+ return ranges::__replace_copy_if_impl(
+ ranges::begin(__range), ranges::end(__range), std::move(__result), __pred, __new_value, __proj);
+ }
+};
} // namespace __replace_copy
inline namespace __cpo {
- inline constexpr auto replace_copy = __replace_copy::__fn{};
+inline constexpr auto replace_copy = __replace_copy::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_copy_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_copy_if.h
index b8741ec7be5..10ed1fda6c5 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_copy_if.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_copy_if.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -51,43 +51,43 @@ _LIBCPP_HIDE_FROM_ABI constexpr replace_copy_if_result<_InIter, _OutIter> __repl
namespace __replace_copy_if {
- struct __fn {
- template <input_iterator _InIter,
- sentinel_for<_InIter> _Sent,
- class _Type,
- output_iterator<const _Type&> _OutIter,
- class _Proj = identity,
- indirect_unary_predicate<projected<_InIter, _Proj>> _Pred>
- requires indirectly_copyable<_InIter, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr replace_copy_if_result<_InIter, _OutIter> operator()(
- _InIter __first, _Sent __last, _OutIter __result, _Pred __pred, const _Type& __new_value, _Proj __proj = {})
- const {
- return ranges::__replace_copy_if_impl(
- std::move(__first), std::move(__last), std::move(__result), __pred, __new_value, __proj);
- }
-
- template <input_range _Range,
- class _Type,
- output_iterator<const _Type&> _OutIter,
- class _Proj = identity,
- indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
- requires indirectly_copyable<iterator_t<_Range>, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr replace_copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
- operator()(_Range&& __range, _OutIter __result, _Pred __pred, const _Type& __new_value, _Proj __proj = {}) const {
- return ranges::__replace_copy_if_impl(
- ranges::begin(__range), ranges::end(__range), std::move(__result), __pred, __new_value, __proj);
- }
- };
+struct __fn {
+ template <input_iterator _InIter,
+ sentinel_for<_InIter> _Sent,
+ class _Type,
+ output_iterator<const _Type&> _OutIter,
+ class _Proj = identity,
+ indirect_unary_predicate<projected<_InIter, _Proj>> _Pred>
+ requires indirectly_copyable<_InIter, _OutIter>
+ _LIBCPP_HIDE_FROM_ABI constexpr replace_copy_if_result<_InIter, _OutIter> operator()(
+ _InIter __first, _Sent __last, _OutIter __result, _Pred __pred, const _Type& __new_value, _Proj __proj = {})
+ const {
+ return ranges::__replace_copy_if_impl(
+ std::move(__first), std::move(__last), std::move(__result), __pred, __new_value, __proj);
+ }
+
+ template <input_range _Range,
+ class _Type,
+ output_iterator<const _Type&> _OutIter,
+ class _Proj = identity,
+ indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
+ requires indirectly_copyable<iterator_t<_Range>, _OutIter>
+ _LIBCPP_HIDE_FROM_ABI constexpr replace_copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
+ operator()(_Range&& __range, _OutIter __result, _Pred __pred, const _Type& __new_value, _Proj __proj = {}) const {
+ return ranges::__replace_copy_if_impl(
+ ranges::begin(__range), ranges::end(__range), std::move(__result), __pred, __new_value, __proj);
+ }
+};
} // namespace __replace_copy_if
inline namespace __cpo {
- inline constexpr auto replace_copy_if = __replace_copy_if::__fn{};
+inline constexpr auto replace_copy_if = __replace_copy_if::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_IF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_if.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_if.h
index 65be3c7d76d..519fa32029a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_if.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_replace_if.h
@@ -23,15 +23,15 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
template <class _Iter, class _Sent, class _Type, class _Proj, class _Pred>
-_LIBCPP_HIDE_FROM_ABI constexpr
-_Iter __replace_if_impl(_Iter __first, _Sent __last, _Pred& __pred, const _Type& __new_value, _Proj& __proj) {
+_LIBCPP_HIDE_FROM_ABI constexpr _Iter
+__replace_if_impl(_Iter __first, _Sent __last, _Pred& __pred, const _Type& __new_value, _Proj& __proj) {
for (; __first != __last; ++__first) {
if (std::invoke(__pred, std::invoke(__proj, *__first)))
*__first = __new_value;
@@ -41,14 +41,14 @@ _Iter __replace_if_impl(_Iter __first, _Sent __last, _Pred& __pred, const _Type&
namespace __replace_if {
struct __fn {
-
- template <input_iterator _Iter, sentinel_for<_Iter> _Sent,
+ template <input_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
class _Type,
class _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
requires indirectly_writable<_Iter, const _Type&>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last, _Pred __pred, const _Type& __new_value, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, _Sent __last, _Pred __pred, const _Type& __new_value, _Proj __proj = {}) const {
return ranges::__replace_if_impl(std::move(__first), std::move(__last), __pred, __new_value, __proj);
}
@@ -61,17 +61,16 @@ struct __fn {
operator()(_Range&& __range, _Pred __pred, const _Type& __new_value, _Proj __proj = {}) const {
return ranges::__replace_if_impl(ranges::begin(__range), ranges::end(__range), __pred, __new_value, __proj);
}
-
};
} // namespace __replace_if
inline namespace __cpo {
- inline constexpr auto replace_if = __replace_if::__fn{};
+inline constexpr auto replace_if = __replace_if::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_IF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_reverse.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_reverse.h
index e2a5d9a8250..9ec865995b4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_reverse.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_reverse.h
@@ -22,18 +22,16 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __reverse {
struct __fn {
-
template <bidirectional_iterator _Iter, sentinel_for<_Iter> _Sent>
requires permutable<_Iter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iter operator()(_Iter __first, _Sent __last) const {
if constexpr (random_access_iterator<_Iter>) {
if (__first == __last)
return __first;
@@ -63,21 +61,19 @@ struct __fn {
template <bidirectional_range _Range>
requires permutable<iterator_t<_Range>>
- _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __range) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> operator()(_Range&& __range) const {
return (*this)(ranges::begin(__range), ranges::end(__range));
}
-
};
} // namespace __reverse
inline namespace __cpo {
- inline constexpr auto reverse = __reverse::__fn{};
+inline constexpr auto reverse = __reverse::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REVERSE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_reverse_copy.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_reverse_copy.h
index a84b1ad7805..35b9edba0bf 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_reverse_copy.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_reverse_copy.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -36,32 +36,30 @@ using reverse_copy_result = in_out_result<_InIter, _OutIter>;
namespace __reverse_copy {
struct __fn {
-
template <bidirectional_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter>
requires indirectly_copyable<_InIter, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- reverse_copy_result<_InIter, _OutIter> operator()(_InIter __first, _Sent __last, _OutIter __result) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr reverse_copy_result<_InIter, _OutIter>
+ operator()(_InIter __first, _Sent __last, _OutIter __result) const {
return (*this)(subrange(std::move(__first), std::move(__last)), std::move(__result));
}
template <bidirectional_range _Range, weakly_incrementable _OutIter>
requires indirectly_copyable<iterator_t<_Range>, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- reverse_copy_result<borrowed_iterator_t<_Range>, _OutIter> operator()(_Range&& __range, _OutIter __result) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr reverse_copy_result<borrowed_iterator_t<_Range>, _OutIter>
+ operator()(_Range&& __range, _OutIter __result) const {
auto __ret = ranges::copy(std::__reverse_range(__range), std::move(__result));
return {ranges::next(ranges::begin(__range), ranges::end(__range)), std::move(__ret.out)};
}
-
};
} // namespace __reverse_copy
inline namespace __cpo {
- inline constexpr auto reverse_copy = __reverse_copy::__fn{};
+inline constexpr auto reverse_copy = __reverse_copy::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REVERSE_COPY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_rotate.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_rotate.h
index 91ed4027df2..ebed9bbd542 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_rotate.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_rotate.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -33,39 +33,34 @@ namespace ranges {
namespace __rotate {
struct __fn {
-
template <class _Iter, class _Sent>
- _LIBCPP_HIDE_FROM_ABI constexpr
- static subrange<_Iter> __rotate_fn_impl(_Iter __first, _Iter __middle, _Sent __last) {
- auto __ret = std::__rotate<_RangeAlgPolicy>(
- std::move(__first), std::move(__middle), std::move(__last));
+ _LIBCPP_HIDE_FROM_ABI constexpr static subrange<_Iter> __rotate_fn_impl(_Iter __first, _Iter __middle, _Sent __last) {
+ auto __ret = std::__rotate<_RangeAlgPolicy>(std::move(__first), std::move(__middle), std::move(__last));
return {std::move(__ret.first), std::move(__ret.second)};
}
template <permutable _Iter, sentinel_for<_Iter> _Sent>
- _LIBCPP_HIDE_FROM_ABI constexpr
- subrange<_Iter> operator()(_Iter __first, _Iter __middle, _Sent __last) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter> operator()(_Iter __first, _Iter __middle, _Sent __last) const {
return __rotate_fn_impl(std::move(__first), std::move(__middle), std::move(__last));
}
template <forward_range _Range>
- requires permutable<iterator_t<_Range>>
- _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_subrange_t<_Range> operator()(_Range&& __range, iterator_t<_Range> __middle) const {
+ requires permutable<iterator_t<_Range>>
+ _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range>
+ operator()(_Range&& __range, iterator_t<_Range> __middle) const {
return __rotate_fn_impl(ranges::begin(__range), std::move(__middle), ranges::end(__range));
}
-
};
} // namespace __rotate
inline namespace __cpo {
- inline constexpr auto rotate = __rotate::__fn{};
+inline constexpr auto rotate = __rotate::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_ROTATE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_rotate_copy.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_rotate_copy.h
index 52f403c16a8..301672707f7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_rotate_copy.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_rotate_copy.h
@@ -23,7 +23,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -34,11 +34,9 @@ using rotate_copy_result = in_out_result<_InIter, _OutIter>;
namespace __rotate_copy {
struct __fn {
-
template <bidirectional_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter>
requires indirectly_copyable<_InIter, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- rotate_copy_result<_InIter, _OutIter>
+ _LIBCPP_HIDE_FROM_ABI constexpr rotate_copy_result<_InIter, _OutIter>
operator()(_InIter __first, _InIter __middle, _Sent __last, _OutIter __result) const {
auto __res1 = ranges::copy(__middle, __last, std::move(__result));
auto __res2 = ranges::copy(__first, __middle, std::move(__res1.out));
@@ -47,22 +45,20 @@ struct __fn {
template <bidirectional_range _Range, weakly_incrementable _OutIter>
requires indirectly_copyable<iterator_t<_Range>, _OutIter>
- _LIBCPP_HIDE_FROM_ABI constexpr
- rotate_copy_result<borrowed_iterator_t<_Range>, _OutIter>
+ _LIBCPP_HIDE_FROM_ABI constexpr rotate_copy_result<borrowed_iterator_t<_Range>, _OutIter>
operator()(_Range&& __range, iterator_t<_Range> __middle, _OutIter __result) const {
return (*this)(ranges::begin(__range), std::move(__middle), ranges::end(__range), std::move(__result));
}
-
};
} // namespace __rotate_copy
inline namespace __cpo {
- inline constexpr auto rotate_copy = __rotate_copy::__fn{};
+inline constexpr auto rotate_copy = __rotate_copy::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_ROTATE_COPY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sample.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sample.h
index a37cb64fa2b..d347d82205a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sample.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sample.h
@@ -19,15 +19,15 @@
#include <__random/uniform_random_bit_generator.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
+#include <__type_traits/remove_reference.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
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -35,40 +35,35 @@ namespace ranges {
namespace __sample {
struct __fn {
-
template <input_iterator _Iter, sentinel_for<_Iter> _Sent, weakly_incrementable _OutIter, class _Gen>
- requires (forward_iterator<_Iter> || random_access_iterator<_OutIter>) &&
- indirectly_copyable<_Iter, _OutIter> &&
- uniform_random_bit_generator<remove_reference_t<_Gen>>
- _LIBCPP_HIDE_FROM_ABI
- _OutIter operator()(_Iter __first, _Sent __last,
- _OutIter __out_first, iter_difference_t<_Iter> __n, _Gen&& __gen) const {
+ requires(forward_iterator<_Iter> || random_access_iterator<_OutIter>) && indirectly_copyable<_Iter, _OutIter> &&
+ uniform_random_bit_generator<remove_reference_t<_Gen>>
+ _LIBCPP_HIDE_FROM_ABI _OutIter
+ operator()(_Iter __first, _Sent __last, _OutIter __out_first, iter_difference_t<_Iter> __n, _Gen&& __gen) const {
_ClassicGenAdaptor<_Gen> __adapted_gen(__gen);
return std::__sample<_RangeAlgPolicy>(
std::move(__first), std::move(__last), std::move(__out_first), __n, __adapted_gen);
}
template <input_range _Range, weakly_incrementable _OutIter, class _Gen>
- requires (forward_range<_Range> || random_access_iterator<_OutIter>) &&
- indirectly_copyable<iterator_t<_Range>, _OutIter> &&
- uniform_random_bit_generator<remove_reference_t<_Gen>>
- _LIBCPP_HIDE_FROM_ABI
- _OutIter operator()(_Range&& __range, _OutIter __out_first, range_difference_t<_Range> __n, _Gen&& __gen) const {
- return (*this)(ranges::begin(__range), ranges::end(__range),
- std::move(__out_first), __n, std::forward<_Gen>(__gen));
+ requires(forward_range<_Range> || random_access_iterator<_OutIter>) &&
+ indirectly_copyable<iterator_t<_Range>, _OutIter> && uniform_random_bit_generator<remove_reference_t<_Gen>>
+ _LIBCPP_HIDE_FROM_ABI _OutIter
+ operator()(_Range&& __range, _OutIter __out_first, range_difference_t<_Range> __n, _Gen&& __gen) const {
+ return (*this)(
+ ranges::begin(__range), ranges::end(__range), std::move(__out_first), __n, std::forward<_Gen>(__gen));
}
-
};
} // namespace __sample
inline namespace __cpo {
- inline constexpr auto sample = __sample::__fn{};
+inline constexpr auto sample = __sample::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SAMPLE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search.h
index 388d5afa499..ca2326e9ab2 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search.h
@@ -28,7 +28,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -69,33 +69,33 @@ struct __fn {
return {__ret.first, __ret.second};
}
- template <forward_iterator _Iter1, sentinel_for<_Iter1> _Sent1,
- forward_iterator _Iter2, sentinel_for<_Iter2> _Sent2,
- class _Pred = ranges::equal_to,
+ template <forward_iterator _Iter1,
+ sentinel_for<_Iter1> _Sent1,
+ forward_iterator _Iter2,
+ sentinel_for<_Iter2> _Sent2,
+ class _Pred = ranges::equal_to,
class _Proj1 = identity,
class _Proj2 = identity>
requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- subrange<_Iter1> operator()(_Iter1 __first1, _Sent1 __last1,
- _Iter2 __first2, _Sent2 __last2,
- _Pred __pred = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter1> operator()(
+ _Iter1 __first1,
+ _Sent1 __last1,
+ _Iter2 __first2,
+ _Sent2 __last2,
+ _Pred __pred = {},
+ _Proj1 __proj1 = {},
+ _Proj2 __proj2 = {}) const {
return __ranges_search_impl(__first1, __last1, __first2, __last2, __pred, __proj1, __proj2);
}
template <forward_range _Range1,
forward_range _Range2,
- class _Pred = ranges::equal_to,
+ class _Pred = ranges::equal_to,
class _Proj1 = identity,
class _Proj2 = identity>
requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_subrange_t<_Range1> operator()(_Range1&& __range1,
- _Range2&& __range2,
- _Pred __pred = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range1> operator()(
+ _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
auto __first1 = ranges::begin(__range1);
if constexpr (sized_range<_Range2>) {
auto __size2 = ranges::size(__range2);
@@ -119,17 +119,16 @@ struct __fn {
__proj1,
__proj2);
}
-
};
} // namespace __search
inline namespace __cpo {
- inline constexpr auto search = __search::__fn{};
+inline constexpr auto search = __search::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SEARCH_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search_n.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search_n.h
index 56ec8f33d43..4e53f30f71f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search_n.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_search_n.h
@@ -31,14 +31,13 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __search_n {
struct __fn {
-
template <class _Iter1, class _Sent1, class _SizeT, class _Type, class _Pred, class _Proj>
_LIBCPP_HIDE_FROM_ABI static constexpr subrange<_Iter1> __ranges_search_n_impl(
_Iter1 __first, _Sent1 __last, _SizeT __count, const _Type& __value, _Pred& __pred, _Proj& __proj) {
@@ -59,36 +58,31 @@ struct __fn {
}
}
- auto __ret = std::__search_n_forward_impl<_RangeAlgPolicy>(__first, __last,
- __count,
- __value,
- __pred,
- __proj);
+ auto __ret = std::__search_n_forward_impl<_RangeAlgPolicy>(__first, __last, __count, __value, __pred, __proj);
return {std::move(__ret.first), std::move(__ret.second)};
}
- template <forward_iterator _Iter, sentinel_for<_Iter> _Sent,
+ template <forward_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
class _Type,
class _Pred = ranges::equal_to,
class _Proj = identity>
requires indirectly_comparable<_Iter, const _Type*, _Pred, _Proj>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- subrange<_Iter> operator()(_Iter __first, _Sent __last,
- iter_difference_t<_Iter> __count,
- const _Type& __value,
- _Pred __pred = {},
- _Proj __proj = _Proj{}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter>
+ operator()(_Iter __first,
+ _Sent __last,
+ iter_difference_t<_Iter> __count,
+ const _Type& __value,
+ _Pred __pred = {},
+ _Proj __proj = _Proj{}) const {
return __ranges_search_n_impl(__first, __last, __count, __value, __pred, __proj);
}
template <forward_range _Range, class _Type, class _Pred = ranges::equal_to, class _Proj = identity>
requires indirectly_comparable<iterator_t<_Range>, const _Type*, _Pred, _Proj>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_subrange_t<_Range> operator()(_Range&& __range,
- range_difference_t<_Range> __count,
- const _Type& __value,
- _Pred __pred = {},
- _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range> operator()(
+ _Range&& __range, range_difference_t<_Range> __count, const _Type& __value, _Pred __pred = {}, _Proj __proj = {})
+ const {
auto __first = ranges::begin(__range);
if (__count <= 0)
return {__first, __first};
@@ -106,12 +100,12 @@ struct __fn {
} // namespace __search_n
inline namespace __cpo {
- inline constexpr auto search_n = __search_n::__fn{};
+inline constexpr auto search_n = __search_n::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SEARCH_N_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_difference.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_difference.h
index 607dd687a5d..a9453ed336f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_difference.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_difference.h
@@ -30,7 +30,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -42,15 +42,14 @@ using set_difference_result = in_out_result<_InIter, _OutIter>;
namespace __set_difference {
struct __fn {
- template <
- input_iterator _InIter1,
- sentinel_for<_InIter1> _Sent1,
- input_iterator _InIter2,
- sentinel_for<_InIter2> _Sent2,
- weakly_incrementable _OutIter,
- class _Comp = less,
- class _Proj1 = identity,
- class _Proj2 = identity>
+ template <input_iterator _InIter1,
+ sentinel_for<_InIter1> _Sent1,
+ input_iterator _InIter2,
+ sentinel_for<_InIter2> _Sent2,
+ weakly_incrementable _OutIter,
+ class _Comp = less,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
requires mergeable<_InIter1, _InIter2, _OutIter, _Comp, _Proj1, _Proj2>
_LIBCPP_HIDE_FROM_ABI constexpr set_difference_result<_InIter1, _OutIter> operator()(
_InIter1 __first1,
@@ -66,22 +65,20 @@ struct __fn {
return {std::move(__ret.first), std::move(__ret.second)};
}
- template <
- input_range _Range1,
- input_range _Range2,
- weakly_incrementable _OutIter,
- class _Comp = less,
- class _Proj1 = identity,
- class _Proj2 = identity>
+ template <input_range _Range1,
+ input_range _Range2,
+ weakly_incrementable _OutIter,
+ class _Comp = less,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
requires mergeable<iterator_t<_Range1>, iterator_t<_Range2>, _OutIter, _Comp, _Proj1, _Proj2>
_LIBCPP_HIDE_FROM_ABI constexpr set_difference_result<borrowed_iterator_t<_Range1>, _OutIter>
- operator()(
- _Range1&& __range1,
- _Range2&& __range2,
- _OutIter __result,
- _Comp __comp = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
+ operator()(_Range1&& __range1,
+ _Range2&& __range2,
+ _OutIter __result,
+ _Comp __comp = {},
+ _Proj1 __proj1 = {},
+ _Proj2 __proj2 = {}) const {
auto __ret = std::__set_difference<_RangeAlgPolicy>(
ranges::begin(__range1),
ranges::end(__range1),
@@ -96,11 +93,11 @@ struct __fn {
} // namespace __set_difference
inline namespace __cpo {
- inline constexpr auto set_difference = __set_difference::__fn{};
+inline constexpr auto set_difference = __set_difference::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SET_DIFFERENCE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_intersection.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_intersection.h
index aa9fd24ced0..4cdcbb75051 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_intersection.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_intersection.h
@@ -28,7 +28,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -40,15 +40,14 @@ using set_intersection_result = in_in_out_result<_InIter1, _InIter2, _OutIter>;
namespace __set_intersection {
struct __fn {
- template <
- input_iterator _InIter1,
- sentinel_for<_InIter1> _Sent1,
- input_iterator _InIter2,
- sentinel_for<_InIter2> _Sent2,
- weakly_incrementable _OutIter,
- class _Comp = less,
- class _Proj1 = identity,
- class _Proj2 = identity>
+ template <input_iterator _InIter1,
+ sentinel_for<_InIter1> _Sent1,
+ input_iterator _InIter2,
+ sentinel_for<_InIter2> _Sent2,
+ weakly_incrementable _OutIter,
+ class _Comp = less,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
requires mergeable<_InIter1, _InIter2, _OutIter, _Comp, _Proj1, _Proj2>
_LIBCPP_HIDE_FROM_ABI constexpr set_intersection_result<_InIter1, _InIter2, _OutIter> operator()(
_InIter1 __first1,
@@ -69,30 +68,22 @@ struct __fn {
return {std::move(__ret.__in1_), std::move(__ret.__in2_), std::move(__ret.__out_)};
}
- template <
- input_range _Range1,
- input_range _Range2,
- weakly_incrementable _OutIter,
- class _Comp = less,
- class _Proj1 = identity,
- class _Proj2 = identity>
- requires mergeable<
- iterator_t<_Range1>,
- iterator_t<_Range2>,
- _OutIter,
- _Comp,
- _Proj1,
- _Proj2>
- _LIBCPP_HIDE_FROM_ABI constexpr set_intersection_result<borrowed_iterator_t<_Range1>,
- borrowed_iterator_t<_Range2>,
- _OutIter>
- operator()(
- _Range1&& __range1,
- _Range2&& __range2,
- _OutIter __result,
- _Comp __comp = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
+ template <input_range _Range1,
+ input_range _Range2,
+ weakly_incrementable _OutIter,
+ class _Comp = less,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
+ requires mergeable<iterator_t<_Range1>, iterator_t<_Range2>, _OutIter, _Comp, _Proj1, _Proj2>
+ _LIBCPP_HIDE_FROM_ABI constexpr set_intersection_result<borrowed_iterator_t<_Range1>,
+ borrowed_iterator_t<_Range2>,
+ _OutIter>
+ operator()(_Range1&& __range1,
+ _Range2&& __range2,
+ _OutIter __result,
+ _Comp __comp = {},
+ _Proj1 __proj1 = {},
+ _Proj2 __proj2 = {}) const {
auto __ret = std::__set_intersection<_RangeAlgPolicy>(
ranges::begin(__range1),
ranges::end(__range1),
@@ -107,11 +98,11 @@ struct __fn {
} // namespace __set_intersection
inline namespace __cpo {
- inline constexpr auto set_intersection = __set_intersection::__fn{};
+inline constexpr auto set_intersection = __set_intersection::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SET_INTERSECTION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_symmetric_difference.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_symmetric_difference.h
index bc4a9065503..d8710a1c47b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_symmetric_difference.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_symmetric_difference.h
@@ -28,7 +28,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -40,15 +40,14 @@ using set_symmetric_difference_result = in_in_out_result<_InIter1, _InIter2, _Ou
namespace __set_symmetric_difference {
struct __fn {
- template <
- input_iterator _InIter1,
- sentinel_for<_InIter1> _Sent1,
- input_iterator _InIter2,
- sentinel_for<_InIter2> _Sent2,
- weakly_incrementable _OutIter,
- class _Comp = ranges::less,
- class _Proj1 = identity,
- class _Proj2 = identity>
+ template <input_iterator _InIter1,
+ sentinel_for<_InIter1> _Sent1,
+ input_iterator _InIter2,
+ sentinel_for<_InIter2> _Sent2,
+ weakly_incrementable _OutIter,
+ class _Comp = ranges::less,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
requires mergeable<_InIter1, _InIter2, _OutIter, _Comp, _Proj1, _Proj2>
_LIBCPP_HIDE_FROM_ABI constexpr set_symmetric_difference_result<_InIter1, _InIter2, _OutIter> operator()(
_InIter1 __first1,
@@ -69,30 +68,22 @@ struct __fn {
return {std::move(__ret.__in1_), std::move(__ret.__in2_), std::move(__ret.__out_)};
}
- template <
- input_range _Range1,
- input_range _Range2,
- weakly_incrementable _OutIter,
- class _Comp = ranges::less,
- class _Proj1 = identity,
- class _Proj2 = identity>
- requires mergeable<
- iterator_t<_Range1>,
- iterator_t<_Range2>,
- _OutIter,
- _Comp,
- _Proj1,
- _Proj2>
+ template <input_range _Range1,
+ input_range _Range2,
+ weakly_incrementable _OutIter,
+ class _Comp = ranges::less,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
+ requires mergeable<iterator_t<_Range1>, iterator_t<_Range2>, _OutIter, _Comp, _Proj1, _Proj2>
_LIBCPP_HIDE_FROM_ABI constexpr set_symmetric_difference_result<borrowed_iterator_t<_Range1>,
borrowed_iterator_t<_Range2>,
_OutIter>
- operator()(
- _Range1&& __range1,
- _Range2&& __range2,
- _OutIter __result,
- _Comp __comp = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
+ operator()(_Range1&& __range1,
+ _Range2&& __range2,
+ _OutIter __result,
+ _Comp __comp = {},
+ _Proj1 __proj1 = {},
+ _Proj2 __proj2 = {}) const {
auto __ret = std::__set_symmetric_difference<_RangeAlgPolicy>(
ranges::begin(__range1),
ranges::end(__range1),
@@ -107,11 +98,11 @@ struct __fn {
} // namespace __set_symmetric_difference
inline namespace __cpo {
- inline constexpr auto set_symmetric_difference = __set_symmetric_difference::__fn{};
+inline constexpr auto set_symmetric_difference = __set_symmetric_difference::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_union.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_union.h
index f8cd45ca0e3..c627166fffe 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_union.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_set_union.h
@@ -31,7 +31,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -43,15 +43,14 @@ using set_union_result = in_in_out_result<_InIter1, _InIter2, _OutIter>;
namespace __set_union {
struct __fn {
- template <
- input_iterator _InIter1,
- sentinel_for<_InIter1> _Sent1,
- input_iterator _InIter2,
- sentinel_for<_InIter2> _Sent2,
- weakly_incrementable _OutIter,
- class _Comp = ranges::less,
- class _Proj1 = identity,
- class _Proj2 = identity>
+ template <input_iterator _InIter1,
+ sentinel_for<_InIter1> _Sent1,
+ input_iterator _InIter2,
+ sentinel_for<_InIter2> _Sent2,
+ weakly_incrementable _OutIter,
+ class _Comp = ranges::less,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
requires mergeable<_InIter1, _InIter2, _OutIter, _Comp, _Proj1, _Proj2>
_LIBCPP_HIDE_FROM_ABI constexpr set_union_result<_InIter1, _InIter2, _OutIter> operator()(
_InIter1 __first1,
@@ -72,30 +71,20 @@ struct __fn {
return {std::move(__ret.__in1_), std::move(__ret.__in2_), std::move(__ret.__out_)};
}
- template <
- input_range _Range1,
- input_range _Range2,
- weakly_incrementable _OutIter,
- class _Comp = ranges::less,
- class _Proj1 = identity,
- class _Proj2 = identity>
- requires mergeable<
- iterator_t<_Range1>,
- iterator_t<_Range2>,
- _OutIter,
- _Comp,
- _Proj1,
- _Proj2>
- _LIBCPP_HIDE_FROM_ABI constexpr set_union_result<borrowed_iterator_t<_Range1>,
- borrowed_iterator_t<_Range2>,
- _OutIter>
- operator()(
- _Range1&& __range1,
- _Range2&& __range2,
- _OutIter __result,
- _Comp __comp = {},
- _Proj1 __proj1 = {},
- _Proj2 __proj2 = {}) const {
+ template <input_range _Range1,
+ input_range _Range2,
+ weakly_incrementable _OutIter,
+ class _Comp = ranges::less,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
+ requires mergeable<iterator_t<_Range1>, iterator_t<_Range2>, _OutIter, _Comp, _Proj1, _Proj2>
+ _LIBCPP_HIDE_FROM_ABI constexpr set_union_result<borrowed_iterator_t<_Range1>, borrowed_iterator_t<_Range2>, _OutIter>
+ operator()(_Range1&& __range1,
+ _Range2&& __range2,
+ _OutIter __result,
+ _Comp __comp = {},
+ _Proj1 __proj1 = {},
+ _Proj2 __proj2 = {}) const {
auto __ret = std::__set_union<_RangeAlgPolicy>(
ranges::begin(__range1),
ranges::end(__range1),
@@ -110,12 +99,12 @@ struct __fn {
} // namespace __set_union
inline namespace __cpo {
- inline constexpr auto set_union = __set_union::__fn{};
+inline constexpr auto set_union = __set_union::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SET_UNION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_shuffle.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_shuffle.h
index a2f2c0edded..fca420058de 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_shuffle.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_shuffle.h
@@ -23,15 +23,15 @@
#include <__ranges/access.h>
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
+#include <__type_traits/remove_reference.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
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -39,33 +39,29 @@ namespace ranges {
namespace __shuffle {
struct __fn {
-
template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Gen>
- requires permutable<_Iter> && uniform_random_bit_generator<remove_reference_t<_Gen>>
- _LIBCPP_HIDE_FROM_ABI
- _Iter operator()(_Iter __first, _Sent __last, _Gen&& __gen) const {
+ requires permutable<_Iter> && uniform_random_bit_generator<remove_reference_t<_Gen>>
+ _LIBCPP_HIDE_FROM_ABI _Iter operator()(_Iter __first, _Sent __last, _Gen&& __gen) const {
_ClassicGenAdaptor<_Gen> __adapted_gen(__gen);
return std::__shuffle<_RangeAlgPolicy>(std::move(__first), std::move(__last), __adapted_gen);
}
- template<random_access_range _Range, class _Gen>
- requires permutable<iterator_t<_Range>> && uniform_random_bit_generator<remove_reference_t<_Gen>>
- _LIBCPP_HIDE_FROM_ABI
- borrowed_iterator_t<_Range> operator()(_Range&& __range, _Gen&& __gen) const {
+ template <random_access_range _Range, class _Gen>
+ requires permutable<iterator_t<_Range>> && uniform_random_bit_generator<remove_reference_t<_Gen>>
+ _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_Range> operator()(_Range&& __range, _Gen&& __gen) const {
return (*this)(ranges::begin(__range), ranges::end(__range), std::forward<_Gen>(__gen));
}
-
};
} // namespace __shuffle
inline namespace __cpo {
- inline constexpr auto shuffle = __shuffle::__fn{};
+inline constexpr auto shuffle = __shuffle::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SHUFFLE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sort.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sort.h
index 32391df5f6d..2ad0e0c233b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sort.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sort.h
@@ -31,7 +31,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -40,8 +40,8 @@ namespace __sort {
struct __fn {
template <class _Iter, class _Sent, class _Comp, class _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- _Iter __sort_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static _Iter
+ __sort_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
auto __last_iter = ranges::next(__first, __last);
auto&& __projected_comp = std::__make_projected(__comp, __proj);
@@ -52,15 +52,15 @@ struct __fn {
template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
return __sort_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
}
template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
requires sortable<iterator_t<_Range>, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+ operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
return __sort_fn_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
}
};
@@ -68,12 +68,12 @@ struct __fn {
} // namespace __sort
inline namespace __cpo {
- inline constexpr auto sort = __sort::__fn{};
+inline constexpr auto sort = __sort::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SORT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sort_heap.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sort_heap.h
index 9feb0f609b2..365c7dba615 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sort_heap.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_sort_heap.h
@@ -32,7 +32,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -41,8 +41,8 @@ namespace __sort_heap {
struct __fn {
template <class _Iter, class _Sent, class _Comp, class _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- _Iter __sort_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI constexpr static _Iter
+ __sort_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
auto __last_iter = ranges::next(__first, __last);
auto&& __projected_comp = std::__make_projected(__comp, __proj);
@@ -53,15 +53,15 @@ struct __fn {
template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
return __sort_heap_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
}
template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
requires sortable<iterator_t<_Range>, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+ operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
return __sort_heap_fn_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
}
};
@@ -69,12 +69,12 @@ struct __fn {
} // namespace __sort_heap
inline namespace __cpo {
- inline constexpr auto sort_heap = __sort_heap::__fn{};
+inline constexpr auto sort_heap = __sort_heap::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SORT_HEAP_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_stable_partition.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_stable_partition.h
index c3469f17c7d..44937fa5899 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_stable_partition.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_stable_partition.h
@@ -26,15 +26,15 @@
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
#include <__ranges/subrange.h>
+#include <__type_traits/remove_cvref.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
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -42,47 +42,46 @@ namespace ranges {
namespace __stable_partition {
struct __fn {
-
template <class _Iter, class _Sent, class _Proj, class _Pred>
- _LIBCPP_HIDE_FROM_ABI static
- subrange<__remove_cvref_t<_Iter>> __stable_partition_fn_impl(
- _Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) {
+ _LIBCPP_HIDE_FROM_ABI static subrange<__remove_cvref_t<_Iter>>
+ __stable_partition_fn_impl(_Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) {
auto __last_iter = ranges::next(__first, __last);
auto&& __projected_pred = std::__make_projected(__pred, __proj);
- auto __result = std::__stable_partition<_RangeAlgPolicy>(
+ auto __result = std::__stable_partition<_RangeAlgPolicy>(
std::move(__first), __last_iter, __projected_pred, __iterator_concept<_Iter>());
return {std::move(__result), std::move(__last_iter)};
}
- template <bidirectional_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
+ template <bidirectional_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
- requires permutable<_Iter>
- _LIBCPP_HIDE_FROM_ABI
- subrange<_Iter> operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
+ requires permutable<_Iter>
+ _LIBCPP_HIDE_FROM_ABI subrange<_Iter> operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
return __stable_partition_fn_impl(__first, __last, __pred, __proj);
}
- template <bidirectional_range _Range, class _Proj = identity,
+ template <bidirectional_range _Range,
+ class _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
- requires permutable<iterator_t<_Range>>
- _LIBCPP_HIDE_FROM_ABI
- borrowed_subrange_t<_Range> operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
+ requires permutable<iterator_t<_Range>>
+ _LIBCPP_HIDE_FROM_ABI borrowed_subrange_t<_Range>
+ operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
return __stable_partition_fn_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
}
-
};
} // namespace __stable_partition
inline namespace __cpo {
- inline constexpr auto stable_partition = __stable_partition::__fn{};
+inline constexpr auto stable_partition = __stable_partition::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_STABLE_PARTITION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_stable_sort.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_stable_sort.h
index d3c48ddb9b8..a4eed383635 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_stable_sort.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_stable_sort.h
@@ -31,7 +31,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -40,8 +40,7 @@ namespace __stable_sort {
struct __fn {
template <class _Iter, class _Sent, class _Comp, class _Proj>
- _LIBCPP_HIDE_FROM_ABI
- static _Iter __stable_sort_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
+ _LIBCPP_HIDE_FROM_ABI static _Iter __stable_sort_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
auto __last_iter = ranges::next(__first, __last);
auto&& __projected_comp = std::__make_projected(__comp, __proj);
@@ -52,15 +51,14 @@ struct __fn {
template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI
- _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
return __stable_sort_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
}
template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
requires sortable<iterator_t<_Range>, _Comp, _Proj>
- _LIBCPP_HIDE_FROM_ABI
- borrowed_iterator_t<_Range> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_Range>
+ operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
return __stable_sort_fn_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
}
};
@@ -68,12 +66,12 @@ struct __fn {
} // namespace __stable_sort
inline namespace __cpo {
- inline constexpr auto stable_sort = __stable_sort::__fn{};
+inline constexpr auto stable_sort = __stable_sort::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_STABLE_SORT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_starts_with.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_starts_with.h
new file mode 100644
index 00000000000..7da78001d81
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_starts_with.h
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_RANGES_STARTS_WITH_H
+#define _LIBCPP___ALGORITHM_RANGES_STARTS_WITH_H
+
+#include <__algorithm/in_in_result.h>
+#include <__algorithm/ranges_mismatch.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/concepts.h>
+#include <__iterator/indirectly_comparable.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER >= 23
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __starts_with {
+struct __fn {
+ template <input_iterator _Iter1,
+ sentinel_for<_Iter1> _Sent1,
+ input_iterator _Iter2,
+ sentinel_for<_Iter2> _Sent2,
+ class _Pred = ranges::equal_to,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
+ requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
+ _Iter1 __first1,
+ _Sent1 __last1,
+ _Iter2 __first2,
+ _Sent2 __last2,
+ _Pred __pred = {},
+ _Proj1 __proj1 = {},
+ _Proj2 __proj2 = {}) const {
+ return __mismatch::__fn::__go(
+ std::move(__first1),
+ std::move(__last1),
+ std::move(__first2),
+ std::move(__last2),
+ __pred,
+ __proj1,
+ __proj2)
+ .in2 == __last2;
+ }
+
+ template <input_range _Range1,
+ input_range _Range2,
+ class _Pred = ranges::equal_to,
+ class _Proj1 = identity,
+ class _Proj2 = identity>
+ requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
+ _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
+ return __mismatch::__fn::__go(
+ ranges::begin(__range1),
+ ranges::end(__range1),
+ ranges::begin(__range2),
+ ranges::end(__range2),
+ __pred,
+ __proj1,
+ __proj2)
+ .in2 == ranges::end(__range2);
+ }
+};
+} // namespace __starts_with
+inline namespace __cpo {
+inline constexpr auto starts_with = __starts_with::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER >= 23
+
+#endif // _LIBCPP___ALGORITHM_RANGES_STARTS_WITH_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_swap_ranges.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_swap_ranges.h
index 552fd55ff88..1d0ebc0d522 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_swap_ranges.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_swap_ranges.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -35,8 +35,7 @@ using swap_ranges_result = in_in_result<_I1, _I2>;
namespace __swap_ranges {
struct __fn {
- template <input_iterator _I1, sentinel_for<_I1> _S1,
- input_iterator _I2, sentinel_for<_I2> _S2>
+ template <input_iterator _I1, sentinel_for<_I1> _S1, input_iterator _I2, sentinel_for<_I2> _S2>
requires indirectly_swappable<_I1, _I2>
_LIBCPP_HIDE_FROM_ABI constexpr swap_ranges_result<_I1, _I2>
operator()(_I1 __first1, _S1 __last1, _I2 __first2, _S2 __last2) const {
@@ -47,22 +46,20 @@ struct __fn {
template <input_range _R1, input_range _R2>
requires indirectly_swappable<iterator_t<_R1>, iterator_t<_R2>>
- _LIBCPP_HIDE_FROM_ABI constexpr
- swap_ranges_result<borrowed_iterator_t<_R1>, borrowed_iterator_t<_R2>>
+ _LIBCPP_HIDE_FROM_ABI constexpr swap_ranges_result<borrowed_iterator_t<_R1>, borrowed_iterator_t<_R2>>
operator()(_R1&& __r1, _R2&& __r2) const {
- return operator()(ranges::begin(__r1), ranges::end(__r1),
- ranges::begin(__r2), ranges::end(__r2));
+ return operator()(ranges::begin(__r1), ranges::end(__r1), ranges::begin(__r2), ranges::end(__r2));
}
};
} // namespace __swap_ranges
inline namespace __cpo {
- inline constexpr auto swap_ranges = __swap_ranges::__fn{};
+inline constexpr auto swap_ranges = __swap_ranges::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SWAP_RANGES_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_transform.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_transform.h
index c0981a04a9b..f66a07ac026 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_transform.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_transform.h
@@ -26,7 +26,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -41,15 +41,9 @@ using binary_transform_result = in_in_out_result<_I1, _I2, _O1>;
namespace __transform {
struct __fn {
private:
- template <class _InIter, class _Sent,
- class _OutIter,
- class _Func,
- class _Proj>
- _LIBCPP_HIDE_FROM_ABI static constexpr
- unary_transform_result<_InIter, _OutIter> __unary(_InIter __first, _Sent __last,
- _OutIter __result,
- _Func& __operation,
- _Proj& __projection) {
+ template <class _InIter, class _Sent, class _OutIter, class _Func, class _Proj>
+ _LIBCPP_HIDE_FROM_ABI static constexpr unary_transform_result<_InIter, _OutIter>
+ __unary(_InIter __first, _Sent __last, _OutIter __result, _Func& __operation, _Proj& __projection) {
while (__first != __last) {
*__result = std::invoke(__operation, std::invoke(__projection, *__first));
++__first;
@@ -59,76 +53,80 @@ private:
return {std::move(__first), std::move(__result)};
}
- template <class _InIter1, class _Sent1,
- class _InIter2, class _Sent2,
+ template <class _InIter1,
+ class _Sent1,
+ class _InIter2,
+ class _Sent2,
class _OutIter,
class _Func,
class _Proj1,
class _Proj2>
_LIBCPP_HIDE_FROM_ABI static constexpr binary_transform_result<_InIter1, _InIter2, _OutIter>
- __binary(_InIter1 __first1, _Sent1 __last1,
- _InIter2 __first2, _Sent2 __last2,
+ __binary(_InIter1 __first1,
+ _Sent1 __last1,
+ _InIter2 __first2,
+ _Sent2 __last2,
_OutIter __result,
_Func& __binary_operation,
_Proj1& __projection1,
_Proj2& __projection2) {
while (__first1 != __last1 && __first2 != __last2) {
- *__result = std::invoke(__binary_operation, std::invoke(__projection1, *__first1),
- std::invoke(__projection2, *__first2));
+ *__result =
+ std::invoke(__binary_operation, std::invoke(__projection1, *__first1), std::invoke(__projection2, *__first2));
++__first1;
++__first2;
++__result;
}
return {std::move(__first1), std::move(__first2), std::move(__result)};
}
+
public:
- template <input_iterator _InIter, sentinel_for<_InIter> _Sent,
+ template <input_iterator _InIter,
+ sentinel_for<_InIter> _Sent,
weakly_incrementable _OutIter,
copy_constructible _Func,
class _Proj = identity>
requires indirectly_writable<_OutIter, indirect_result_t<_Func&, projected<_InIter, _Proj>>>
- _LIBCPP_HIDE_FROM_ABI constexpr
- unary_transform_result<_InIter, _OutIter> operator()(_InIter __first, _Sent __last,
- _OutIter __result,
- _Func __operation,
- _Proj __proj = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr unary_transform_result<_InIter, _OutIter>
+ operator()(_InIter __first, _Sent __last, _OutIter __result, _Func __operation, _Proj __proj = {}) const {
return __unary(std::move(__first), std::move(__last), std::move(__result), __operation, __proj);
}
- template <input_range _Range,
- weakly_incrementable _OutIter,
- copy_constructible _Func,
- class _Proj = identity>
+ template <input_range _Range, weakly_incrementable _OutIter, copy_constructible _Func, class _Proj = identity>
requires indirectly_writable<_OutIter, indirect_result_t<_Func, projected<iterator_t<_Range>, _Proj>>>
- _LIBCPP_HIDE_FROM_ABI constexpr
- unary_transform_result<borrowed_iterator_t<_Range>, _OutIter> operator()(_Range&& __range,
- _OutIter __result,
- _Func __operation,
- _Proj __projection = {}) const {
+ _LIBCPP_HIDE_FROM_ABI constexpr unary_transform_result<borrowed_iterator_t<_Range>, _OutIter>
+ operator()(_Range&& __range, _OutIter __result, _Func __operation, _Proj __projection = {}) const {
return __unary(ranges::begin(__range), ranges::end(__range), std::move(__result), __operation, __projection);
}
- template <input_iterator _InIter1, sentinel_for<_InIter1> _Sent1,
- input_iterator _InIter2, sentinel_for<_InIter2> _Sent2,
+ template <input_iterator _InIter1,
+ sentinel_for<_InIter1> _Sent1,
+ input_iterator _InIter2,
+ sentinel_for<_InIter2> _Sent2,
weakly_incrementable _OutIter,
copy_constructible _Func,
class _Proj1 = identity,
class _Proj2 = identity>
- requires indirectly_writable<_OutIter, indirect_result_t<_Func&, projected<_InIter1, _Proj1>,
- projected<_InIter2, _Proj2>>>
- _LIBCPP_HIDE_FROM_ABI constexpr
- binary_transform_result<_InIter1, _InIter2, _OutIter> operator()(_InIter1 __first1, _Sent1 __last1,
- _InIter2 __first2, _Sent2 __last2,
- _OutIter __result,
- _Func __binary_operation,
- _Proj1 __projection1 = {},
- _Proj2 __projection2 = {}) const {
- return __binary(std::move(__first1), std::move(__last1),
- std::move(__first2), std::move(__last2),
- std::move(__result),
- __binary_operation,
- __projection1,
- __projection2);
+ requires indirectly_writable<_OutIter,
+ indirect_result_t<_Func&, projected<_InIter1, _Proj1>, projected<_InIter2, _Proj2>>>
+ _LIBCPP_HIDE_FROM_ABI constexpr binary_transform_result<_InIter1, _InIter2, _OutIter> operator()(
+ _InIter1 __first1,
+ _Sent1 __last1,
+ _InIter2 __first2,
+ _Sent2 __last2,
+ _OutIter __result,
+ _Func __binary_operation,
+ _Proj1 __projection1 = {},
+ _Proj2 __projection2 = {}) const {
+ return __binary(
+ std::move(__first1),
+ std::move(__last1),
+ std::move(__first2),
+ std::move(__last2),
+ std::move(__result),
+ __binary_operation,
+ __projection1,
+ __projection2);
}
template <input_range _Range1,
@@ -137,34 +135,38 @@ public:
copy_constructible _Func,
class _Proj1 = identity,
class _Proj2 = identity>
- requires indirectly_writable<_OutIter, indirect_result_t<_Func&, projected<iterator_t<_Range1>, _Proj1>,
- projected<iterator_t<_Range2>, _Proj2>>>
- _LIBCPP_HIDE_FROM_ABI constexpr
- binary_transform_result<borrowed_iterator_t<_Range1>, borrowed_iterator_t<_Range2>, _OutIter>
+ requires indirectly_writable<
+ _OutIter,
+ indirect_result_t<_Func&, projected<iterator_t<_Range1>, _Proj1>, projected<iterator_t<_Range2>, _Proj2>>>
+ _LIBCPP_HIDE_FROM_ABI constexpr binary_transform_result<borrowed_iterator_t<_Range1>,
+ borrowed_iterator_t<_Range2>,
+ _OutIter>
operator()(_Range1&& __range1,
_Range2&& __range2,
_OutIter __result,
_Func __binary_operation,
_Proj1 __projection1 = {},
_Proj2 __projection2 = {}) const {
- return __binary(ranges::begin(__range1), ranges::end(__range1),
- ranges::begin(__range2), ranges::end(__range2),
- std::move(__result),
- __binary_operation,
- __projection1,
- __projection2);
+ return __binary(
+ ranges::begin(__range1),
+ ranges::end(__range1),
+ ranges::begin(__range2),
+ ranges::end(__range2),
+ std::move(__result),
+ __binary_operation,
+ __projection1,
+ __projection2);
}
-
};
} // namespace __transform
inline namespace __cpo {
- inline constexpr auto transform = __transform::__fn{};
+inline constexpr auto transform = __transform::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_TRANSFORM_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique.h
index be427ccf7fa..b17e01fc505 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique.h
@@ -32,48 +32,46 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __unique {
- struct __fn {
- template <
- permutable _Iter,
- sentinel_for<_Iter> _Sent,
- class _Proj = identity,
- indirect_equivalence_relation<projected<_Iter, _Proj>> _Comp = ranges::equal_to>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter>
- operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
- auto __ret = std::__unique<_RangeAlgPolicy>(
- std::move(__first), std::move(__last), std::__make_projected(__comp, __proj));
- return {std::move(__ret.first), std::move(__ret.second)};
- }
+struct __fn {
+ template <permutable _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Proj = identity,
+ indirect_equivalence_relation<projected<_Iter, _Proj>> _Comp = ranges::equal_to>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter>
+ operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
+ auto __ret =
+ std::__unique<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::__make_projected(__comp, __proj));
+ return {std::move(__ret.first), std::move(__ret.second)};
+ }
- template <
- forward_range _Range,
- class _Proj = identity,
- indirect_equivalence_relation<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::equal_to>
- requires permutable<iterator_t<_Range>>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range>
- operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
- auto __ret = std::__unique<_RangeAlgPolicy>(
- ranges::begin(__range), ranges::end(__range), std::__make_projected(__comp, __proj));
- return {std::move(__ret.first), std::move(__ret.second)};
- }
- };
+ template <forward_range _Range,
+ class _Proj = identity,
+ indirect_equivalence_relation<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::equal_to>
+ requires permutable<iterator_t<_Range>>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range>
+ operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
+ auto __ret = std::__unique<_RangeAlgPolicy>(
+ ranges::begin(__range), ranges::end(__range), std::__make_projected(__comp, __proj));
+ return {std::move(__ret.first), std::move(__ret.second)};
+ }
+};
} // namespace __unique
inline namespace __cpo {
- inline constexpr auto unique = __unique::__fn{};
+inline constexpr auto unique = __unique::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_UNIQUE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique_copy.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique_copy.h
index 3ad47b06f5d..7e89f9d97af 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique_copy.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_unique_copy.h
@@ -21,7 +21,6 @@
#include <__iterator/concepts.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/projected.h>
-#include <__iterator/readable_traits.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
@@ -33,7 +32,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -87,9 +86,9 @@ struct __fn {
class _Proj = identity,
indirect_equivalence_relation<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::equal_to>
requires indirectly_copyable<iterator_t<_Range>, _OutIter> &&
- (forward_iterator<iterator_t<_Range>> ||
- (input_iterator<_OutIter> && same_as<range_value_t<_Range>, iter_value_t<_OutIter>>) ||
- indirectly_copyable_storable<iterator_t<_Range>, _OutIter>)
+ (forward_iterator<iterator_t<_Range>> ||
+ (input_iterator<_OutIter> && same_as<range_value_t<_Range>, iter_value_t<_OutIter>>) ||
+ indirectly_copyable_storable<iterator_t<_Range>, _OutIter>)
_LIBCPP_HIDE_FROM_ABI constexpr unique_copy_result<borrowed_iterator_t<_Range>, _OutIter>
operator()(_Range&& __range, _OutIter __result, _Comp __comp = {}, _Proj __proj = {}) const {
auto __ret = std::__unique_copy<_RangeAlgPolicy>(
@@ -111,6 +110,6 @@ inline constexpr auto unique_copy = __unique_copy::__fn{};
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_UNIQUE_COPY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_upper_bound.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_upper_bound.h
index a1340809048..a12a0e39b08 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_upper_bound.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/ranges_upper_bound.h
@@ -25,51 +25,50 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __upper_bound {
struct __fn {
- template <forward_iterator _Iter, sentinel_for<_Iter> _Sent, class _Type, class _Proj = identity,
+ template <forward_iterator _Iter,
+ sentinel_for<_Iter> _Sent,
+ class _Type,
+ class _Proj = identity,
indirect_strict_weak_order<const _Type*, projected<_Iter, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- _Iter operator()(_Iter __first, _Sent __last, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Iter
+ operator()(_Iter __first, _Sent __last, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
auto __comp_lhs_rhs_swapped = [&](const auto& __lhs, const auto& __rhs) {
return !std::invoke(__comp, __rhs, __lhs);
};
- return std::__lower_bound_impl<_RangeAlgPolicy>(__first, __last, __value, __comp_lhs_rhs_swapped, __proj);
+ return std::__lower_bound<_RangeAlgPolicy>(__first, __last, __value, __comp_lhs_rhs_swapped, __proj);
}
- template <forward_range _Range, class _Type, class _Proj = identity,
+ template <forward_range _Range,
+ class _Type,
+ class _Proj = identity,
indirect_strict_weak_order<const _Type*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- borrowed_iterator_t<_Range> operator()(_Range&& __r,
- const _Type& __value,
- _Comp __comp = {},
- _Proj __proj = {}) const {
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+ operator()(_Range&& __r, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
auto __comp_lhs_rhs_swapped = [&](const auto& __lhs, const auto& __rhs) {
return !std::invoke(__comp, __rhs, __lhs);
};
- return std::__lower_bound_impl<_RangeAlgPolicy>(ranges::begin(__r),
- ranges::end(__r),
- __value,
- __comp_lhs_rhs_swapped,
- __proj);
+ return std::__lower_bound<_RangeAlgPolicy>(
+ ranges::begin(__r), ranges::end(__r), __value, __comp_lhs_rhs_swapped, __proj);
}
};
} // namespace __upper_bound
inline namespace __cpo {
- inline constexpr auto upper_bound = __upper_bound::__fn{};
+inline constexpr auto upper_bound = __upper_bound::__fn{};
} // namespace __cpo
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_UPPER_BOUND_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/rotate.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/rotate.h
index 8934ce095bb..7ed6f18628c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/rotate.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/rotate.h
@@ -15,9 +15,9 @@
#include <__algorithm/swap_ranges.h>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_trivially_move_assignable.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/sample.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/sample.h
index f403ba61258..c7a1898e530 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/sample.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/sample.h
@@ -16,8 +16,8 @@
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__random/uniform_int_distribution.h>
+#include <__type_traits/common_type.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -77,7 +77,7 @@ _LIBCPP_INLINE_VISIBILITY
_SampleIterator __sample(_PopulationIterator __first,
_PopulationSentinel __last, _SampleIterator __output_iter,
_Distance __n, _UniformRandomNumberGenerator& __g) {
- _LIBCPP_ASSERT(__n >= 0, "N must be a positive number.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n >= 0, "N must be a positive number.");
using _PopIterCategory = typename _IterOps<_AlgPolicy>::template __iterator_category<_PopulationIterator>;
using _Difference = typename _IterOps<_AlgPolicy>::template __difference_type<_PopulationIterator>;
@@ -88,22 +88,22 @@ _SampleIterator __sample(_PopulationIterator __first,
__g, _PopIterCategory());
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _PopulationIterator, class _SampleIterator, class _Distance,
class _UniformRandomNumberGenerator>
inline _LIBCPP_INLINE_VISIBILITY
_SampleIterator sample(_PopulationIterator __first,
_PopulationIterator __last, _SampleIterator __output_iter,
_Distance __n, _UniformRandomNumberGenerator&& __g) {
- static_assert(__is_cpp17_forward_iterator<_PopulationIterator>::value ||
- __is_cpp17_random_access_iterator<_SampleIterator>::value,
+ static_assert(__has_forward_iterator_category<_PopulationIterator>::value ||
+ __has_random_access_iterator_category<_SampleIterator>::value,
"SampleIterator must meet the requirements of RandomAccessIterator");
return std::__sample<_ClassicAlgPolicy>(
std::move(__first), std::move(__last), std::move(__output_iter), __n, __g);
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h
index 93771be39e3..5882a04808b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h
@@ -14,12 +14,13 @@
#include <__algorithm/iterator_operations.h>
#include <__config>
#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/advance.h>
#include <__iterator/concepts.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
#include <__type_traits/is_callable.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -126,8 +127,8 @@ pair<_Iter1, _Iter1> __search_impl(_Iter1 __first1, _Sent1 __last1,
_Pred& __pred,
_Proj1& __proj1,
_Proj2& __proj2,
- __enable_if_t<__is_cpp17_random_access_iterator<_Iter1>::value
- && __is_cpp17_random_access_iterator<_Iter2>::value>* = nullptr) {
+ __enable_if_t<__has_random_access_iterator_category<_Iter1>::value
+ && __has_random_access_iterator_category<_Iter2>::value>* = nullptr) {
auto __size2 = __last2 - __first2;
if (__size2 == 0)
@@ -158,10 +159,10 @@ pair<_Iter1, _Iter1> __search_impl(_Iter1 __first1, _Sent1 __last1,
_Pred& __pred,
_Proj1& __proj1,
_Proj2& __proj2,
- __enable_if_t<__is_cpp17_forward_iterator<_Iter1>::value
- && __is_cpp17_forward_iterator<_Iter2>::value
- && !(__is_cpp17_random_access_iterator<_Iter1>::value
- && __is_cpp17_random_access_iterator<_Iter2>::value)>* = nullptr) {
+ __enable_if_t<__has_forward_iterator_category<_Iter1>::value
+ && __has_forward_iterator_category<_Iter2>::value
+ && !(__has_random_access_iterator_category<_Iter1>::value
+ && __has_random_access_iterator_category<_Iter2>::value)>* = nullptr) {
return std::__search_forward_impl<_ClassicAlgPolicy>(__first1, __last1,
__first2, __last2,
__pred,
@@ -187,7 +188,7 @@ _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
return std::search(__first1, __last1, __first2, __last2, __equal_to());
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _ForwardIterator, class _Searcher>
_LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher& __s) {
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/search_n.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/search_n.h
index 60a07356515..7e3ddf48a2b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/search_n.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/search_n.h
@@ -14,14 +14,15 @@
#include <__algorithm/iterator_operations.h>
#include <__config>
#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/advance.h>
#include <__iterator/concepts.h>
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__ranges/concepts.h>
+#include <__type_traits/is_callable.h>
#include <__utility/convert_to_integral.h>
#include <__utility/pair.h>
-#include <type_traits> // __convert_to_integral
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -129,7 +130,7 @@ pair<_Iter, _Iter> __search_n_impl(_Iter __first, _Sent __last,
const _Type& __value,
_Pred& __pred,
_Proj& __proj,
- __enable_if_t<__is_cpp17_random_access_iterator<_Iter>::value>* = nullptr) {
+ __enable_if_t<__has_random_access_iterator_category<_Iter>::value>* = nullptr) {
return std::__search_n_random_access_impl<_ClassicAlgPolicy>(__first, __last,
__count,
__value,
@@ -149,8 +150,8 @@ pair<_Iter1, _Iter1> __search_n_impl(_Iter1 __first, _Sent1 __last,
const _Type& __value,
_Pred& __pred,
_Proj& __proj,
- __enable_if_t<__is_cpp17_forward_iterator<_Iter1>::value
- && !__is_cpp17_random_access_iterator<_Iter1>::value>* = nullptr) {
+ __enable_if_t<__has_forward_iterator_category<_Iter1>::value
+ && !__has_random_access_iterator_category<_Iter1>::value>* = nullptr) {
return std::__search_n_forward_impl<_ClassicAlgPolicy>(__first, __last,
__count,
__value,
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_difference.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_difference.h
index cffdc8fc4fc..26a300092c9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_difference.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_difference.h
@@ -17,9 +17,9 @@
#include <__functional/identity.h>
#include <__functional/invoke.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -66,14 +66,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator set_d
_InputIterator2 __first2,
_InputIterator2 __last2,
_OutputIterator __result) {
- return std::__set_difference<_ClassicAlgPolicy>(
- __first1,
- __last1,
- __first2,
- __last2,
- __result,
- __less<typename iterator_traits<_InputIterator1>::value_type,
- typename iterator_traits<_InputIterator2>::value_type>()).second;
+ return std::__set_difference<_ClassicAlgPolicy>(__first1, __last1, __first2, __last2, __result, __less<>()).second;
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_intersection.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_intersection.h
index 9fa7799aee6..f2603fe1365 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_intersection.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_intersection.h
@@ -89,8 +89,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator set_i
std::move(__first2),
std::move(__last2),
std::move(__result),
- __less<typename iterator_traits<_InputIterator1>::value_type,
- typename iterator_traits<_InputIterator2>::value_type>())
+ __less<>())
.__out_;
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_symmetric_difference.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_symmetric_difference.h
index bcb09587032..832c3979bfd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_symmetric_difference.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_symmetric_difference.h
@@ -96,8 +96,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator set_symmetri
std::move(__first2),
std::move(__last2),
std::move(__result),
- __less<typename iterator_traits<_InputIterator1>::value_type,
- typename iterator_traits<_InputIterator2>::value_type>());
+ __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_union.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_union.h
index 4d154b81e09..cf48adae03b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_union.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/set_union.h
@@ -92,8 +92,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator set_union(
std::move(__first2),
std::move(__last2),
std::move(__result),
- __less<typename iterator_traits<_InputIterator1>::value_type,
- typename iterator_traits<_InputIterator2>::value_type>());
+ __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/shift_left.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/shift_left.h
index 33f06d57e23..023b56dcfca 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/shift_left.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/shift_left.h
@@ -12,7 +12,6 @@
#include <__algorithm/move.h>
#include <__config>
#include <__iterator/iterator_traits.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -20,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _ForwardIterator>
inline _LIBCPP_INLINE_VISIBILITY constexpr
@@ -33,7 +32,7 @@ shift_left(_ForwardIterator __first, _ForwardIterator __last,
}
_ForwardIterator __m = __first;
- if constexpr (__is_cpp17_random_access_iterator<_ForwardIterator>::value) {
+ if constexpr (__has_random_access_iterator_category<_ForwardIterator>::value) {
if (__n >= __last - __first) {
return __first;
}
@@ -49,7 +48,7 @@ shift_left(_ForwardIterator __first, _ForwardIterator __last,
return _VSTD::move(__m, __last, __first);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/shift_right.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/shift_right.h
index 14bc761598b..70aff45fe57 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/shift_right.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/shift_right.h
@@ -15,7 +15,6 @@
#include <__config>
#include <__iterator/iterator_traits.h>
#include <__utility/swap.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -23,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _ForwardIterator>
inline _LIBCPP_INLINE_VISIBILITY constexpr
@@ -35,14 +34,14 @@ shift_right(_ForwardIterator __first, _ForwardIterator __last,
return __first;
}
- if constexpr (__is_cpp17_random_access_iterator<_ForwardIterator>::value) {
+ if constexpr (__has_random_access_iterator_category<_ForwardIterator>::value) {
decltype(__n) __d = __last - __first;
if (__n >= __d) {
return __last;
}
_ForwardIterator __m = __first + (__d - __n);
return _VSTD::move_backward(__first, __m, __last);
- } else if constexpr (__is_cpp17_bidirectional_iterator<_ForwardIterator>::value) {
+ } else if constexpr (__has_bidirectional_iterator_category<_ForwardIterator>::value) {
_ForwardIterator __m = __last;
for (; __n > 0; --__n) {
if (__m == __first) {
@@ -95,7 +94,7 @@ shift_right(_ForwardIterator __first, _ForwardIterator __last,
}
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/shuffle.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/shuffle.h
index f7bce68697b..6fee88ca6ff 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/shuffle.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/shuffle.h
@@ -11,7 +11,6 @@
#include <__algorithm/iterator_operations.h>
#include <__config>
-#include <__debug>
#include <__iterator/iterator_traits.h>
#include <__random/uniform_int_distribution.h>
#include <__utility/forward.h>
@@ -29,9 +28,9 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_TYPE_VIS __libcpp_debug_randomizer {
+class _LIBCPP_EXPORTED_FROM_ABI __libcpp_debug_randomizer {
public:
- __libcpp_debug_randomizer() {
+ _LIBCPP_HIDE_FROM_ABI __libcpp_debug_randomizer() {
__state_ = __seed();
__inc_ = __state_ + 0xda3e39cb94b95bdbULL;
__inc_ = (__inc_ << 1) | 1;
@@ -65,11 +64,11 @@ private:
#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \
|| defined(_LIBCPP_BUILDING_LIBRARY)
-class _LIBCPP_TYPE_VIS __rs_default;
+class _LIBCPP_EXPORTED_FROM_ABI __rs_default;
-_LIBCPP_FUNC_VIS __rs_default __rs_get();
+_LIBCPP_EXPORTED_FROM_ABI __rs_default __rs_get();
-class _LIBCPP_TYPE_VIS __rs_default
+class _LIBCPP_EXPORTED_FROM_ABI __rs_default
{
static unsigned __c_;
@@ -85,13 +84,13 @@ public:
result_type operator()();
- static _LIBCPP_CONSTEXPR result_type min() {return _Min;}
- static _LIBCPP_CONSTEXPR result_type max() {return _Max;}
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR result_type min() {return _Min;}
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR result_type max() {return _Max;}
- friend _LIBCPP_FUNC_VIS __rs_default __rs_get();
+ friend _LIBCPP_EXPORTED_FROM_ABI __rs_default __rs_get();
};
-_LIBCPP_FUNC_VIS __rs_default __rs_get();
+_LIBCPP_EXPORTED_FROM_ABI __rs_default __rs_get();
template <class _RandomAccessIterator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_IN_CXX14 void
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/sift_down.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/sift_down.h
index e3972fb6f46..20f0b0275dd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/sift_down.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/sift_down.h
@@ -19,6 +19,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
@@ -83,7 +86,7 @@ __floyd_sift_down(_RandomAccessIterator __first, _Compare&& __comp,
typename iterator_traits<_RandomAccessIterator>::difference_type __len)
{
using difference_type = typename iterator_traits<_RandomAccessIterator>::difference_type;
- _LIBCPP_ASSERT(__len >= 2, "shouldn't be called unless __len >= 2");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__len >= 2, "shouldn't be called unless __len >= 2");
_RandomAccessIterator __hole = __first;
_RandomAccessIterator __child_i = __first;
@@ -111,4 +114,6 @@ __floyd_sift_down(_RandomAccessIterator __first, _Compare&& __comp,
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ALGORITHM_SIFT_DOWN_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort.h
index a236be0a4da..40c32442b19 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort.h
@@ -11,23 +11,27 @@
#include <__algorithm/comp.h>
#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/iter_swap.h>
#include <__algorithm/iterator_operations.h>
#include <__algorithm/min_element.h>
#include <__algorithm/partial_sort.h>
#include <__algorithm/unwrap_iter.h>
+#include <__assert>
+#include <__bit/blsr.h>
+#include <__bit/countl.h>
+#include <__bit/countr.h>
#include <__config>
-#include <__debug>
#include <__debug_utils/randomize_range.h>
+#include <__debug_utils/strict_weak_ordering_check.h>
#include <__functional/operations.h>
#include <__functional/ranges_operations.h>
#include <__iterator/iterator_traits.h>
-#include <__memory/destruct_n.h>
-#include <__memory/unique_ptr.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/disjunction.h>
#include <__type_traits/is_arithmetic.h>
-#include <__type_traits/is_trivially_copy_assignable.h>
-#include <__type_traits/is_trivially_copy_constructible.h>
+#include <__type_traits/is_constant_evaluated.h>
#include <__utility/move.h>
-#include <bit>
+#include <__utility/pair.h>
#include <climits>
#include <cstdint>
@@ -37,52 +41,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-// Wraps an algorithm policy tag and a comparator in a single struct, used to pass the policy tag around without
-// changing the number of template arguments (to keep the ABI stable). This is only used for the "range" policy tag.
-//
-// To create an object of this type, use `_WrapAlgPolicy<T, C>::type` -- see the specialization below for the rationale.
-template <class _PolicyT, class _CompT, class = void>
-struct _WrapAlgPolicy {
- using type = _WrapAlgPolicy;
-
- using _AlgPolicy = _PolicyT;
- using _Comp = _CompT;
- _Comp& __comp;
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
- _WrapAlgPolicy(_Comp& __c) : __comp(__c) {}
-};
-
-// Specialization for the "classic" policy tag that avoids creating a struct and simply defines an alias for the
-// comparator. When unwrapping, a pristine comparator is always considered to have the "classic" tag attached. Passing
-// the pristine comparator where possible allows using template instantiations from the dylib.
-template <class _PolicyT, class _CompT>
-struct _WrapAlgPolicy<_PolicyT, _CompT, __enable_if_t<std::is_same<_PolicyT, _ClassicAlgPolicy>::value> > {
- using type = _CompT;
-};
-
-// Unwraps a pristine functor (e.g. `std::less`) as if it were wrapped using `_WrapAlgPolicy`. The policy tag is always
-// set to "classic".
-template <class _CompT>
-struct _UnwrapAlgPolicy {
- using _AlgPolicy = _ClassicAlgPolicy;
- using _Comp = _CompT;
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 static
- _Comp __get_comp(_Comp __comp) { return __comp; }
-};
-
-// Unwraps a `_WrapAlgPolicy` struct.
-template <class... _Ts>
-struct _UnwrapAlgPolicy<_WrapAlgPolicy<_Ts...> > {
- using _Wrapped = _WrapAlgPolicy<_Ts...>;
- using _AlgPolicy = typename _Wrapped::_AlgPolicy;
- using _Comp = typename _Wrapped::_Comp;
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 static
- _Comp __get_comp(_Wrapped& __w) { return __w.__comp; }
-};
-
// stable, 2-3 compares, 0-2 swaps
template <class _AlgPolicy, class _Compare, class _ForwardIterator>
@@ -126,78 +84,53 @@ _LIBCPP_CONSTEXPR_SINCE_CXX14 unsigned __sort3(_ForwardIterator __x, _ForwardIte
template <class _AlgPolicy, class _Compare, class _ForwardIterator>
_LIBCPP_HIDE_FROM_ABI
-unsigned __sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, _ForwardIterator __x4,
+void __sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, _ForwardIterator __x4,
_Compare __c) {
- using _Ops = _IterOps<_AlgPolicy>;
-
- unsigned __r = std::__sort3<_AlgPolicy, _Compare>(__x1, __x2, __x3, __c);
+ using _Ops = _IterOps<_AlgPolicy>;
+ std::__sort3<_AlgPolicy, _Compare>(__x1, __x2, __x3, __c);
if (__c(*__x4, *__x3)) {
_Ops::iter_swap(__x3, __x4);
- ++__r;
if (__c(*__x3, *__x2)) {
_Ops::iter_swap(__x2, __x3);
- ++__r;
if (__c(*__x2, *__x1)) {
_Ops::iter_swap(__x1, __x2);
- ++__r;
}
}
}
- return __r;
}
// stable, 4-10 compares, 0-9 swaps
-template <class _WrappedComp, class _ForwardIterator>
-_LIBCPP_HIDDEN unsigned __sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
- _ForwardIterator __x4, _ForwardIterator __x5, _WrappedComp __wrapped_comp) {
- using _Unwrap = _UnwrapAlgPolicy<_WrappedComp>;
- using _AlgPolicy = typename _Unwrap::_AlgPolicy;
+template <class _AlgPolicy, class _Comp, class _ForwardIterator>
+_LIBCPP_HIDE_FROM_ABI void __sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
+ _ForwardIterator __x4, _ForwardIterator __x5, _Comp __comp) {
using _Ops = _IterOps<_AlgPolicy>;
- using _Compare = typename _Unwrap::_Comp;
- _Compare __c = _Unwrap::__get_comp(__wrapped_comp);
-
- unsigned __r = std::__sort4<_AlgPolicy, _Compare>(__x1, __x2, __x3, __x4, __c);
- if (__c(*__x5, *__x4)) {
+ std::__sort4<_AlgPolicy, _Comp>(__x1, __x2, __x3, __x4, __comp);
+ if (__comp(*__x5, *__x4)) {
_Ops::iter_swap(__x4, __x5);
- ++__r;
- if (__c(*__x4, *__x3)) {
+ if (__comp(*__x4, *__x3)) {
_Ops::iter_swap(__x3, __x4);
- ++__r;
- if (__c(*__x3, *__x2)) {
+ if (__comp(*__x3, *__x2)) {
_Ops::iter_swap(__x2, __x3);
- ++__r;
- if (__c(*__x2, *__x1)) {
+ if (__comp(*__x2, *__x1)) {
_Ops::iter_swap(__x1, __x2);
- ++__r;
}
}
}
}
- return __r;
-}
-
-template <class _AlgPolicy, class _Compare, class _ForwardIterator>
-_LIBCPP_HIDE_FROM_ABI unsigned __sort5_wrap_policy(
- _ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, _ForwardIterator __x4, _ForwardIterator __x5,
- _Compare __c) {
- using _WrappedComp = typename _WrapAlgPolicy<_AlgPolicy, _Compare>::type;
- _WrappedComp __wrapped_comp(__c);
- return std::__sort5<_WrappedComp>(
- std::move(__x1), std::move(__x2), std::move(__x3), std::move(__x4), std::move(__x5), __wrapped_comp);
}
// The comparator being simple is a prerequisite for using the branchless optimization.
template <class _Tp>
struct __is_simple_comparator : false_type {};
-template <class _Tp>
-struct __is_simple_comparator<__less<_Tp>&> : true_type {};
+template <>
+struct __is_simple_comparator<__less<>&> : true_type {};
template <class _Tp>
struct __is_simple_comparator<less<_Tp>&> : true_type {};
template <class _Tp>
struct __is_simple_comparator<greater<_Tp>&> : true_type {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <>
struct __is_simple_comparator<ranges::less&> : true_type {};
template <>
@@ -206,9 +139,16 @@ struct __is_simple_comparator<ranges::greater&> : true_type {};
template <class _Compare, class _Iter, class _Tp = typename iterator_traits<_Iter>::value_type>
using __use_branchless_sort =
- integral_constant<bool, __is_cpp17_contiguous_iterator<_Iter>::value && sizeof(_Tp) <= sizeof(void*) &&
+ integral_constant<bool, __libcpp_is_contiguous_iterator<_Iter>::value && sizeof(_Tp) <= sizeof(void*) &&
is_arithmetic<_Tp>::value && __is_simple_comparator<_Compare>::value>;
+namespace __detail {
+
+// Size in bits for the bitset in use.
+enum { __block_size = sizeof(uint64_t) * 8 };
+
+} // namespace __detail
+
// Ensures that __c(*__x, *__y) is true by swapping *__x and *__y if necessary.
template <class _Compare, class _RandomAccessIterator>
inline _LIBCPP_HIDE_FROM_ABI void __cond_swap(_RandomAccessIterator __x, _RandomAccessIterator __y, _Compare __c) {
@@ -268,10 +208,15 @@ __sort4_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2,
std::__sort4<_AlgPolicy, _Compare>(__x1, __x2, __x3, __x4, __c);
}
-template <class, class _Compare, class _RandomAccessIterator>
+template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
inline _LIBCPP_HIDE_FROM_ABI __enable_if_t<__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
-__sort5_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
- _RandomAccessIterator __x4, _RandomAccessIterator __x5, _Compare __c) {
+__sort5_maybe_branchless(
+ _RandomAccessIterator __x1,
+ _RandomAccessIterator __x2,
+ _RandomAccessIterator __x3,
+ _RandomAccessIterator __x4,
+ _RandomAccessIterator __x5,
+ _Compare __c) {
std::__cond_swap<_Compare>(__x1, __x2, __c);
std::__cond_swap<_Compare>(__x4, __x5, __c);
std::__partially_sorted_swap<_Compare>(__x3, __x4, __x5, __c);
@@ -284,7 +229,8 @@ template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
inline _LIBCPP_HIDE_FROM_ABI __enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
__sort5_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
_RandomAccessIterator __x4, _RandomAccessIterator __x5, _Compare __c) {
- std::__sort5_wrap_policy<_AlgPolicy, _Compare>(__x1, __x2, __x3, __x4, __x5, __c);
+ std::__sort5<_AlgPolicy, _Compare, _RandomAccessIterator>(
+ std::move(__x1), std::move(__x2), std::move(__x3), std::move(__x4), std::move(__x5), __c);
}
// Assumes size > 0
@@ -300,34 +246,49 @@ _LIBCPP_CONSTEXPR_SINCE_CXX14 void __selection_sort(_BidirectionalIterator __fir
}
}
+// Sort the iterator range [__first, __last) using the comparator __comp using
+// the insertion sort algorithm.
template <class _AlgPolicy, class _Compare, class _BidirectionalIterator>
_LIBCPP_HIDE_FROM_ABI
void __insertion_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) {
using _Ops = _IterOps<_AlgPolicy>;
typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
- if (__first != __last) {
- _BidirectionalIterator __i = __first;
- for (++__i; __i != __last; ++__i) {
- _BidirectionalIterator __j = __i;
- value_type __t(_Ops::__iter_move(__j));
- for (_BidirectionalIterator __k = __i; __k != __first && __comp(__t, *--__k); --__j)
+ if (__first == __last)
+ return;
+ _BidirectionalIterator __i = __first;
+ for (++__i; __i != __last; ++__i) {
+ _BidirectionalIterator __j = __i;
+ --__j;
+ if (__comp(*__i, *__j)) {
+ value_type __t(_Ops::__iter_move(__i));
+ _BidirectionalIterator __k = __j;
+ __j = __i;
+ do {
*__j = _Ops::__iter_move(__k);
+ __j = __k;
+ } while (__j != __first && __comp(__t, *--__k));
*__j = std::move(__t);
}
}
}
+// Sort the iterator range [__first, __last) using the comparator __comp using
+// the insertion sort algorithm. Insertion sort has two loops, outer and inner.
+// The implementation below has no bounds check (unguarded) for the inner loop.
+// Assumes that there is an element in the position (__first - 1) and that each
+// element in the input range is greater or equal to the element at __first - 1.
template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
-_LIBCPP_HIDE_FROM_ABI
-void __insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
+_LIBCPP_HIDE_FROM_ABI void
+__insertion_sort_unguarded(_RandomAccessIterator const __first, _RandomAccessIterator __last, _Compare __comp) {
using _Ops = _IterOps<_AlgPolicy>;
-
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
- _RandomAccessIterator __j = __first + difference_type(2);
- std::__sort3_maybe_branchless<_AlgPolicy, _Compare>(__first, __first + difference_type(1), __j, __comp);
- for (_RandomAccessIterator __i = __j + difference_type(1); __i != __last; ++__i) {
+ if (__first == __last)
+ return;
+ const _RandomAccessIterator __leftmost = __first - difference_type(1); (void)__leftmost; // can be unused when assertions are disabled
+ for (_RandomAccessIterator __i = __first + difference_type(1); __i != __last; ++__i) {
+ _RandomAccessIterator __j = __i - difference_type(1);
if (__comp(*__i, *__j)) {
value_type __t(_Ops::__iter_move(__i));
_RandomAccessIterator __k = __j;
@@ -335,23 +296,20 @@ void __insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __l
do {
*__j = _Ops::__iter_move(__k);
__j = __k;
- } while (__j != __first && __comp(__t, *--__k));
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __k != __leftmost,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ } while (__comp(__t, *--__k)); // No need for bounds check due to the assumption stated above.
*__j = std::move(__t);
}
- __j = __i;
}
}
-template <class _WrappedComp, class _RandomAccessIterator>
-_LIBCPP_HIDDEN bool __insertion_sort_incomplete(
- _RandomAccessIterator __first, _RandomAccessIterator __last, _WrappedComp __wrapped_comp) {
- using _Unwrap = _UnwrapAlgPolicy<_WrappedComp>;
- using _AlgPolicy = typename _Unwrap::_AlgPolicy;
+template <class _AlgPolicy, class _Comp, class _RandomAccessIterator>
+_LIBCPP_HIDE_FROM_ABI bool __insertion_sort_incomplete(
+ _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
using _Ops = _IterOps<_AlgPolicy>;
- using _Compare = typename _Unwrap::_Comp;
- _Compare __comp = _Unwrap::__get_comp(__wrapped_comp);
-
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
switch (__last - __first) {
case 0:
@@ -359,24 +317,24 @@ _LIBCPP_HIDDEN bool __insertion_sort_incomplete(
return true;
case 2:
if (__comp(*--__last, *__first))
- _IterOps<_AlgPolicy>::iter_swap(__first, __last);
+ _Ops::iter_swap(__first, __last);
return true;
case 3:
- std::__sort3_maybe_branchless<_AlgPolicy, _Compare>(__first, __first + difference_type(1), --__last, __comp);
+ std::__sort3_maybe_branchless<_AlgPolicy, _Comp>(__first, __first + difference_type(1), --__last, __comp);
return true;
case 4:
- std::__sort4_maybe_branchless<_AlgPolicy, _Compare>(
+ std::__sort4_maybe_branchless<_AlgPolicy, _Comp>(
__first, __first + difference_type(1), __first + difference_type(2), --__last, __comp);
return true;
case 5:
- std::__sort5_maybe_branchless<_AlgPolicy, _Compare>(
+ std::__sort5_maybe_branchless<_AlgPolicy, _Comp>(
__first, __first + difference_type(1), __first + difference_type(2), __first + difference_type(3),
--__last, __comp);
return true;
}
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
_RandomAccessIterator __j = __first + difference_type(2);
- std::__sort3_maybe_branchless<_AlgPolicy, _Compare>(__first, __first + difference_type(1), __j, __comp);
+ std::__sort3_maybe_branchless<_AlgPolicy, _Comp>(__first, __first + difference_type(1), __j, __comp);
const unsigned __limit = 8;
unsigned __count = 0;
for (_RandomAccessIterator __i = __j + difference_type(1); __i != __last; ++__i) {
@@ -397,48 +355,380 @@ _LIBCPP_HIDDEN bool __insertion_sort_incomplete(
return true;
}
-template <class _AlgPolicy, class _Compare, class _BidirectionalIterator>
-_LIBCPP_HIDE_FROM_ABI
-void __insertion_sort_move(_BidirectionalIterator __first1, _BidirectionalIterator __last1,
- typename iterator_traits<_BidirectionalIterator>::value_type* __first2, _Compare __comp) {
+template <class _AlgPolicy, class _RandomAccessIterator>
+inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos(
+ _RandomAccessIterator __first, _RandomAccessIterator __last, uint64_t& __left_bitset, uint64_t& __right_bitset) {
using _Ops = _IterOps<_AlgPolicy>;
+ typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ // Swap one pair on each iteration as long as both bitsets have at least one
+ // element for swapping.
+ while (__left_bitset != 0 && __right_bitset != 0) {
+ difference_type __tz_left = __libcpp_ctz(__left_bitset);
+ __left_bitset = __libcpp_blsr(__left_bitset);
+ difference_type __tz_right = __libcpp_ctz(__right_bitset);
+ __right_bitset = __libcpp_blsr(__right_bitset);
+ _Ops::iter_swap(__first + __tz_left, __last - __tz_right);
+ }
+}
- typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
- if (__first1 != __last1) {
- __destruct_n __d(0);
- unique_ptr<value_type, __destruct_n&> __h(__first2, __d);
- value_type* __last2 = __first2;
- ::new ((void*)__last2) value_type(_Ops::__iter_move(__first1));
- __d.template __incr<value_type>();
- for (++__last2; ++__first1 != __last1; ++__last2) {
- value_type* __j2 = __last2;
- value_type* __i2 = __j2;
- if (__comp(*__first1, *--__i2)) {
- ::new ((void*)__j2) value_type(std::move(*__i2));
- __d.template __incr<value_type>();
- for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2)
- *__j2 = std::move(*__i2);
- *__j2 = _Ops::__iter_move(__first1);
- } else {
- ::new ((void*)__j2) value_type(_Ops::__iter_move(__first1));
- __d.template __incr<value_type>();
+template <class _Compare,
+ class _RandomAccessIterator,
+ class _ValueType = typename iterator_traits<_RandomAccessIterator>::value_type>
+inline _LIBCPP_HIDE_FROM_ABI void
+__populate_left_bitset(_RandomAccessIterator __first, _Compare __comp, _ValueType& __pivot, uint64_t& __left_bitset) {
+ // Possible vectorization. With a proper "-march" flag, the following loop
+ // will be compiled into a set of SIMD instructions.
+ _RandomAccessIterator __iter = __first;
+ for (int __j = 0; __j < __detail::__block_size;) {
+ bool __comp_result = !__comp(*__iter, __pivot);
+ __left_bitset |= (static_cast<uint64_t>(__comp_result) << __j);
+ __j++;
+ ++__iter;
+ }
+}
+
+template <class _Compare,
+ class _RandomAccessIterator,
+ class _ValueType = typename iterator_traits<_RandomAccessIterator>::value_type>
+inline _LIBCPP_HIDE_FROM_ABI void
+__populate_right_bitset(_RandomAccessIterator __lm1, _Compare __comp, _ValueType& __pivot, uint64_t& __right_bitset) {
+ // Possible vectorization. With a proper "-march" flag, the following loop
+ // will be compiled into a set of SIMD instructions.
+ _RandomAccessIterator __iter = __lm1;
+ for (int __j = 0; __j < __detail::__block_size;) {
+ bool __comp_result = __comp(*__iter, __pivot);
+ __right_bitset |= (static_cast<uint64_t>(__comp_result) << __j);
+ __j++;
+ --__iter;
+ }
+}
+
+template <class _AlgPolicy,
+ class _Compare,
+ class _RandomAccessIterator,
+ class _ValueType = typename iterator_traits<_RandomAccessIterator>::value_type>
+inline _LIBCPP_HIDE_FROM_ABI void __bitset_partition_partial_blocks(
+ _RandomAccessIterator& __first,
+ _RandomAccessIterator& __lm1,
+ _Compare __comp,
+ _ValueType& __pivot,
+ uint64_t& __left_bitset,
+ uint64_t& __right_bitset) {
+ typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ difference_type __remaining_len = __lm1 - __first + 1;
+ difference_type __l_size;
+ difference_type __r_size;
+ if (__left_bitset == 0 && __right_bitset == 0) {
+ __l_size = __remaining_len / 2;
+ __r_size = __remaining_len - __l_size;
+ } else if (__left_bitset == 0) {
+ // We know at least one side is a full block.
+ __l_size = __remaining_len - __detail::__block_size;
+ __r_size = __detail::__block_size;
+ } else { // if (__right_bitset == 0)
+ __l_size = __detail::__block_size;
+ __r_size = __remaining_len - __detail::__block_size;
+ }
+ // Record the comparison outcomes for the elements currently on the left side.
+ if (__left_bitset == 0) {
+ _RandomAccessIterator __iter = __first;
+ for (int __j = 0; __j < __l_size; __j++) {
+ bool __comp_result = !__comp(*__iter, __pivot);
+ __left_bitset |= (static_cast<uint64_t>(__comp_result) << __j);
+ ++__iter;
+ }
+ }
+ // Record the comparison outcomes for the elements currently on the right
+ // side.
+ if (__right_bitset == 0) {
+ _RandomAccessIterator __iter = __lm1;
+ for (int __j = 0; __j < __r_size; __j++) {
+ bool __comp_result = __comp(*__iter, __pivot);
+ __right_bitset |= (static_cast<uint64_t>(__comp_result) << __j);
+ --__iter;
+ }
+ }
+ std::__swap_bitmap_pos<_AlgPolicy, _RandomAccessIterator>(__first, __lm1, __left_bitset, __right_bitset);
+ __first += (__left_bitset == 0) ? __l_size : 0;
+ __lm1 -= (__right_bitset == 0) ? __r_size : 0;
+}
+
+template <class _AlgPolicy, class _RandomAccessIterator>
+inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos_within(
+ _RandomAccessIterator& __first, _RandomAccessIterator& __lm1, uint64_t& __left_bitset, uint64_t& __right_bitset) {
+ using _Ops = _IterOps<_AlgPolicy>;
+ typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ if (__left_bitset) {
+ // Swap within the left side. Need to find set positions in the reverse
+ // order.
+ while (__left_bitset != 0) {
+ difference_type __tz_left = __detail::__block_size - 1 - __libcpp_clz(__left_bitset);
+ __left_bitset &= (static_cast<uint64_t>(1) << __tz_left) - 1;
+ _RandomAccessIterator __it = __first + __tz_left;
+ if (__it != __lm1) {
+ _Ops::iter_swap(__it, __lm1);
}
+ --__lm1;
+ }
+ __first = __lm1 + difference_type(1);
+ } else if (__right_bitset) {
+ // Swap within the right side. Need to find set positions in the reverse
+ // order.
+ while (__right_bitset != 0) {
+ difference_type __tz_right = __detail::__block_size - 1 - __libcpp_clz(__right_bitset);
+ __right_bitset &= (static_cast<uint64_t>(1) << __tz_right) - 1;
+ _RandomAccessIterator __it = __lm1 - __tz_right;
+ if (__it != __first) {
+ _Ops::iter_swap(__it, __first);
+ }
+ ++__first;
}
- __h.release();
}
}
-template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
-void __introsort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
- typename iterator_traits<_RandomAccessIterator>::difference_type __depth) {
+// Partition [__first, __last) using the comparator __comp. *__first has the
+// chosen pivot. Elements that are equivalent are kept to the left of the
+// pivot. Returns the iterator for the pivot and a bool value which is true if
+// the provided range is already sorted, false otherwise. We assume that the
+// length of the range is at least three elements.
+//
+// __bitset_partition uses bitsets for storing outcomes of the comparisons
+// between the pivot and other elements.
+template <class _AlgPolicy, class _RandomAccessIterator, class _Compare>
+_LIBCPP_HIDE_FROM_ABI std::pair<_RandomAccessIterator, bool>
+__bitset_partition(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
+ using _Ops = _IterOps<_AlgPolicy>;
+ typedef typename std::iterator_traits<_RandomAccessIterator>::value_type value_type;
+ typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ _LIBCPP_ASSERT_UNCATEGORIZED(__last - __first >= difference_type(3), "");
+ const _RandomAccessIterator __begin = __first; // used for bounds checking, those are not moved around
+ const _RandomAccessIterator __end = __last; (void)__end; //
+
+ value_type __pivot(_Ops::__iter_move(__first));
+ // Find the first element greater than the pivot.
+ if (__comp(__pivot, *(__last - difference_type(1)))) {
+ // Not guarded since we know the last element is greater than the pivot.
+ do {
+ ++__first;
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __first != __end,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ } while (!__comp(__pivot, *__first));
+ } else {
+ while (++__first < __last && !__comp(__pivot, *__first)) {
+ }
+ }
+ // Find the last element less than or equal to the pivot.
+ if (__first < __last) {
+ // It will be always guarded because __introsort will do the median-of-three
+ // before calling this.
+ do {
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __last != __begin,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ --__last;
+ } while (__comp(__pivot, *__last));
+ }
+ // If the first element greater than the pivot is at or after the
+ // last element less than or equal to the pivot, then we have covered the
+ // entire range without swapping elements. This implies the range is already
+ // partitioned.
+ bool __already_partitioned = __first >= __last;
+ if (!__already_partitioned) {
+ _Ops::iter_swap(__first, __last);
+ ++__first;
+ }
+
+ // In [__first, __last) __last is not inclusive. From now on, it uses last
+ // minus one to be inclusive on both sides.
+ _RandomAccessIterator __lm1 = __last - difference_type(1);
+ uint64_t __left_bitset = 0;
+ uint64_t __right_bitset = 0;
+
+ // Reminder: length = __lm1 - __first + 1.
+ while (__lm1 - __first >= 2 * __detail::__block_size - 1) {
+ // Record the comparison outcomes for the elements currently on the left
+ // side.
+ if (__left_bitset == 0)
+ std::__populate_left_bitset<_Compare>(__first, __comp, __pivot, __left_bitset);
+ // Record the comparison outcomes for the elements currently on the right
+ // side.
+ if (__right_bitset == 0)
+ std::__populate_right_bitset<_Compare>(__lm1, __comp, __pivot, __right_bitset);
+ // Swap the elements recorded to be the candidates for swapping in the
+ // bitsets.
+ std::__swap_bitmap_pos<_AlgPolicy, _RandomAccessIterator>(__first, __lm1, __left_bitset, __right_bitset);
+ // Only advance the iterator if all the elements that need to be moved to
+ // other side were moved.
+ __first += (__left_bitset == 0) ? difference_type(__detail::__block_size) : difference_type(0);
+ __lm1 -= (__right_bitset == 0) ? difference_type(__detail::__block_size) : difference_type(0);
+ }
+ // Now, we have a less-than a block worth of elements on at least one of the
+ // sides.
+ std::__bitset_partition_partial_blocks<_AlgPolicy, _Compare>(
+ __first, __lm1, __comp, __pivot, __left_bitset, __right_bitset);
+ // At least one the bitsets would be empty. For the non-empty one, we need to
+ // properly partition the elements that appear within that bitset.
+ std::__swap_bitmap_pos_within<_AlgPolicy>(__first, __lm1, __left_bitset, __right_bitset);
+
+ // Move the pivot to its correct position.
+ _RandomAccessIterator __pivot_pos = __first - difference_type(1);
+ if (__begin != __pivot_pos) {
+ *__begin = _Ops::__iter_move(__pivot_pos);
+ }
+ *__pivot_pos = std::move(__pivot);
+ return std::make_pair(__pivot_pos, __already_partitioned);
+}
+
+// Partition [__first, __last) using the comparator __comp. *__first has the
+// chosen pivot. Elements that are equivalent are kept to the right of the
+// pivot. Returns the iterator for the pivot and a bool value which is true if
+// the provided range is already sorted, false otherwise. We assume that the
+// length of the range is at least three elements.
+template <class _AlgPolicy, class _RandomAccessIterator, class _Compare>
+_LIBCPP_HIDE_FROM_ABI std::pair<_RandomAccessIterator, bool>
+__partition_with_equals_on_right(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
+ using _Ops = _IterOps<_AlgPolicy>;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ typedef typename std::iterator_traits<_RandomAccessIterator>::value_type value_type;
+ _LIBCPP_ASSERT_UNCATEGORIZED(__last - __first >= difference_type(3), "");
+ const _RandomAccessIterator __begin = __first; // used for bounds checking, those are not moved around
+ const _RandomAccessIterator __end = __last; (void)__end; //
+ value_type __pivot(_Ops::__iter_move(__first));
+ // Find the first element greater or equal to the pivot. It will be always
+ // guarded because __introsort will do the median-of-three before calling
+ // this.
+ do {
+ ++__first;
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __first != __end,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ } while (__comp(*__first, __pivot));
+
+ // Find the last element less than the pivot.
+ if (__begin == __first - difference_type(1)) {
+ while (__first < __last && !__comp(*--__last, __pivot))
+ ;
+ } else {
+ // Guarded.
+ do {
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __last != __begin,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ --__last;
+ } while (!__comp(*__last, __pivot));
+ }
+
+ // If the first element greater than or equal to the pivot is at or after the
+ // last element less than the pivot, then we have covered the entire range
+ // without swapping elements. This implies the range is already partitioned.
+ bool __already_partitioned = __first >= __last;
+ // Go through the remaining elements. Swap pairs of elements (one to the
+ // right of the pivot and the other to left of the pivot) that are not on the
+ // correct side of the pivot.
+ while (__first < __last) {
+ _Ops::iter_swap(__first, __last);
+ do {
+ ++__first;
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __first != __end,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ } while (__comp(*__first, __pivot));
+ do {
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __last != __begin,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ --__last;
+ } while (!__comp(*__last, __pivot));
+ }
+ // Move the pivot to its correct position.
+ _RandomAccessIterator __pivot_pos = __first - difference_type(1);
+ if (__begin != __pivot_pos) {
+ *__begin = _Ops::__iter_move(__pivot_pos);
+ }
+ *__pivot_pos = std::move(__pivot);
+ return std::make_pair(__pivot_pos, __already_partitioned);
+}
+
+// Similar to the above function. Elements equivalent to the pivot are put to
+// the left of the pivot. Returns the iterator to the pivot element.
+template <class _AlgPolicy, class _RandomAccessIterator, class _Compare>
+_LIBCPP_HIDE_FROM_ABI _RandomAccessIterator
+__partition_with_equals_on_left(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
using _Ops = _IterOps<_AlgPolicy>;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ typedef typename std::iterator_traits<_RandomAccessIterator>::value_type value_type;
+ // TODO(LLVM18): Make __begin const, see https://reviews.llvm.org/D147089#4349748
+ _RandomAccessIterator __begin = __first; // used for bounds checking, those are not moved around
+ const _RandomAccessIterator __end = __last; (void)__end; //
+ value_type __pivot(_Ops::__iter_move(__first));
+ if (__comp(__pivot, *(__last - difference_type(1)))) {
+ // Guarded.
+ do {
+ ++__first;
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __first != __end,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ } while (!__comp(__pivot, *__first));
+ } else {
+ while (++__first < __last && !__comp(__pivot, *__first)) {
+ }
+ }
+ if (__first < __last) {
+ // It will be always guarded because __introsort will do the
+ // median-of-three before calling this.
+ do {
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __last != __begin,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ --__last;
+ } while (__comp(__pivot, *__last));
+ }
+ while (__first < __last) {
+ _Ops::iter_swap(__first, __last);
+ do {
+ ++__first;
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __first != __end,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ } while (!__comp(__pivot, *__first));
+ do {
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __last != __begin,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ --__last;
+ } while (__comp(__pivot, *__last));
+ }
+ _RandomAccessIterator __pivot_pos = __first - difference_type(1);
+ if (__begin != __pivot_pos) {
+ *__begin = _Ops::__iter_move(__pivot_pos);
+ }
+ *__pivot_pos = std::move(__pivot);
+ return __first;
+}
+
+// The main sorting function. Implements introsort combined with other ideas:
+// - option of using block quick sort for partitioning,
+// - guarded and unguarded insertion sort for small lengths,
+// - Tuckey's ninther technique for computing the pivot,
+// - check on whether partition was not required.
+// The implementation is partly based on Orson Peters' pattern-defeating
+// quicksort, published at: <https://github.com/orlp/pdqsort>.
+template <class _AlgPolicy, class _Compare, class _RandomAccessIterator, bool _UseBitSetPartition>
+void __introsort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Compare __comp,
+ typename iterator_traits<_RandomAccessIterator>::difference_type __depth,
+ bool __leftmost = true) {
+ using _Ops = _IterOps<_AlgPolicy>;
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
- const difference_type __limit =
- is_trivially_copy_constructible<value_type>::value && is_trivially_copy_assignable<value_type>::value ? 30 : 6;
+ using _Comp_ref = __comp_ref_type<_Compare>;
+ // Upper bound for using insertion sort for sorting.
+ _LIBCPP_CONSTEXPR difference_type __limit = 24;
+ // Lower bound for using Tuckey's ninther technique for median computation.
+ _LIBCPP_CONSTEXPR difference_type __ninther_threshold = 128;
while (true) {
- __restart:
difference_type __len = __last - __first;
switch (__len) {
case 0:
@@ -446,7 +736,7 @@ void __introsort(_RandomAccessIterator __first, _RandomAccessIterator __last, _C
return;
case 2:
if (__comp(*--__last, *__first))
- _IterOps<_AlgPolicy>::iter_swap(__first, __last);
+ _Ops::iter_swap(__first, __last);
return;
case 3:
std::__sort3_maybe_branchless<_AlgPolicy, _Compare>(__first, __first + difference_type(1), --__last, __comp);
@@ -461,131 +751,62 @@ void __introsort(_RandomAccessIterator __first, _RandomAccessIterator __last, _C
--__last, __comp);
return;
}
- if (__len <= __limit) {
- std::__insertion_sort_3<_AlgPolicy, _Compare>(__first, __last, __comp);
+ // Use insertion sort if the length of the range is below the specified limit.
+ if (__len < __limit) {
+ if (__leftmost) {
+ std::__insertion_sort<_AlgPolicy, _Compare>(__first, __last, __comp);
+ } else {
+ std::__insertion_sort_unguarded<_AlgPolicy, _Compare>(__first, __last, __comp);
+ }
return;
}
- // __len > 5
if (__depth == 0) {
// Fallback to heap sort as Introsort suggests.
std::__partial_sort<_AlgPolicy, _Compare>(__first, __last, __last, __comp);
return;
}
--__depth;
- _RandomAccessIterator __m = __first;
- _RandomAccessIterator __lm1 = __last;
- --__lm1;
- unsigned __n_swaps;
{
- difference_type __delta;
- if (__len >= 1000) {
- __delta = __len / 2;
- __m += __delta;
- __delta /= 2;
- __n_swaps = std::__sort5_wrap_policy<_AlgPolicy, _Compare>(
- __first, __first + __delta, __m, __m + __delta, __lm1, __comp);
+ difference_type __half_len = __len / 2;
+ // Use Tuckey's ninther technique or median of 3 for pivot selection
+ // depending on the length of the range being sorted.
+ if (__len > __ninther_threshold) {
+ std::__sort3<_AlgPolicy, _Compare>(__first, __first + __half_len, __last - difference_type(1), __comp);
+ std::__sort3<_AlgPolicy, _Compare>(
+ __first + difference_type(1), __first + (__half_len - 1), __last - difference_type(2), __comp);
+ std::__sort3<_AlgPolicy, _Compare>(
+ __first + difference_type(2), __first + (__half_len + 1), __last - difference_type(3), __comp);
+ std::__sort3<_AlgPolicy, _Compare>(
+ __first + (__half_len - 1), __first + __half_len, __first + (__half_len + 1), __comp);
+ _Ops::iter_swap(__first, __first + __half_len);
} else {
- __delta = __len / 2;
- __m += __delta;
- __n_swaps = std::__sort3<_AlgPolicy, _Compare>(__first, __m, __lm1, __comp);
+ std::__sort3<_AlgPolicy, _Compare>(__first + __half_len, __first, __last - difference_type(1), __comp);
}
}
- // *__m is median
- // partition [__first, __m) < *__m and *__m <= [__m, __last)
- // (this inhibits tossing elements equivalent to __m around unnecessarily)
- _RandomAccessIterator __i = __first;
- _RandomAccessIterator __j = __lm1;
- // j points beyond range to be tested, *__m is known to be <= *__lm1
- // The search going up is known to be guarded but the search coming down isn't.
- // Prime the downward search with a guard.
- if (!__comp(*__i, *__m)) // if *__first == *__m
- {
- // *__first == *__m, *__first doesn't go in first part
- // manually guard downward moving __j against __i
- while (true) {
- if (__i == --__j) {
- // *__first == *__m, *__m <= all other elements
- // Parition instead into [__first, __i) == *__first and *__first < [__i, __last)
- ++__i; // __first + 1
- __j = __last;
- if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1)
- {
- while (true) {
- if (__i == __j)
- return; // [__first, __last) all equivalent elements
- if (__comp(*__first, *__i)) {
- _Ops::iter_swap(__i, __j);
- ++__n_swaps;
- ++__i;
- break;
- }
- ++__i;
- }
- }
- // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1
- if (__i == __j)
- return;
- while (true) {
- while (!__comp(*__first, *__i))
- ++__i;
- while (__comp(*__first, *--__j))
- ;
- if (__i >= __j)
- break;
- _Ops::iter_swap(__i, __j);
- ++__n_swaps;
- ++__i;
- }
- // [__first, __i) == *__first and *__first < [__i, __last)
- // The first part is sorted, sort the second part
- // std::__sort<_Compare>(__i, __last, __comp);
- __first = __i;
- goto __restart;
- }
- if (__comp(*__j, *__m)) {
- _Ops::iter_swap(__i, __j);
- ++__n_swaps;
- break; // found guard for downward moving __j, now use unguarded partition
- }
- }
- }
- // It is known that *__i < *__m
- ++__i;
- // j points beyond range to be tested, *__m is known to be <= *__lm1
- // if not yet partitioned...
- if (__i < __j) {
- // known that *(__i - 1) < *__m
- // known that __i <= __m
- while (true) {
- // __m still guards upward moving __i
- while (__comp(*__i, *__m))
- ++__i;
- // It is now known that a guard exists for downward moving __j
- while (!__comp(*--__j, *__m))
- ;
- if (__i > __j)
- break;
- _Ops::iter_swap(__i, __j);
- ++__n_swaps;
- // It is known that __m != __j
- // If __m just moved, follow it
- if (__m == __i)
- __m = __j;
- ++__i;
- }
- }
- // [__first, __i) < *__m and *__m <= [__i, __last)
- if (__i != __m && __comp(*__m, *__i)) {
- _Ops::iter_swap(__i, __m);
- ++__n_swaps;
+ // The elements to the left of the current iterator range are already
+ // sorted. If the current iterator range to be sorted is not the
+ // leftmost part of the entire iterator range and the pivot is same as
+ // the highest element in the range to the left, then we know that all
+ // the elements in the range [first, pivot] would be equal to the pivot,
+ // assuming the equal elements are put on the left side when
+ // partitioned. This also means that we do not need to sort the left
+ // side of the partition.
+ if (!__leftmost && !__comp(*(__first - difference_type(1)), *__first)) {
+ __first = std::__partition_with_equals_on_left<_AlgPolicy, _RandomAccessIterator, _Comp_ref>(
+ __first, __last, _Comp_ref(__comp));
+ continue;
}
+ // Use bitset partition only if asked for.
+ auto __ret =
+ _UseBitSetPartition
+ ? std::__bitset_partition<_AlgPolicy, _RandomAccessIterator, _Compare>(__first, __last, __comp)
+ : std::__partition_with_equals_on_right<_AlgPolicy, _RandomAccessIterator, _Compare>(__first, __last, __comp);
+ _RandomAccessIterator __i = __ret.first;
// [__first, __i) < *__i and *__i <= [__i+1, __last)
// If we were given a perfect partition, see if insertion sort is quick...
- if (__n_swaps == 0) {
- using _WrappedComp = typename _WrapAlgPolicy<_AlgPolicy, _Compare>::type;
- _WrappedComp __wrapped_comp(__comp);
- bool __fs = std::__insertion_sort_incomplete<_WrappedComp>(__first, __i, __wrapped_comp);
- if (std::__insertion_sort_incomplete<_WrappedComp>(__i + difference_type(1), __last, __wrapped_comp)) {
+ if (__ret.second) {
+ bool __fs = std::__insertion_sort_incomplete<_AlgPolicy, _Compare>(__first, __i, __comp);
+ if (std::__insertion_sort_incomplete<_AlgPolicy, _Compare>(__i + difference_type(1), __last, __comp)) {
if (__fs)
return;
__last = __i;
@@ -597,14 +818,11 @@ void __introsort(_RandomAccessIterator __first, _RandomAccessIterator __last, _C
}
}
}
- // sort smaller range with recursive call and larger with tail recursion elimination
- if (__i - __first < __last - __i) {
- std::__introsort<_AlgPolicy, _Compare>(__first, __i, __comp, __depth);
- __first = ++__i;
- } else {
- std::__introsort<_AlgPolicy, _Compare>(__i + difference_type(1), __last, __comp, __depth);
- __last = __i;
- }
+ // Sort the left partiton recursively and the right partition with tail recursion elimination.
+ std::__introsort<_AlgPolicy, _Compare, _RandomAccessIterator, _UseBitSetPartition>(
+ __first, __i, __comp, __depth, __leftmost);
+ __leftmost = false;
+ __first = ++__i;
}
}
@@ -627,89 +845,107 @@ inline _LIBCPP_HIDE_FROM_ABI _Number __log2i(_Number __n) {
return __log2;
}
-template <class _WrappedComp, class _RandomAccessIterator>
-_LIBCPP_HIDDEN void __sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _WrappedComp __wrapped_comp) {
+template <class _Comp, class _RandomAccessIterator>
+void __sort(_RandomAccessIterator, _RandomAccessIterator, _Comp);
+
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
+#endif
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<short>&, short*>(short*, short*, __less<short>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<int>&, int*>(int*, int*, __less<int>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<long>&, long*>(long*, long*, __less<long>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<float>&, float*>(float*, float*, __less<float>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<double>&, double*>(double*, double*, __less<double>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
+
+template <class _AlgPolicy, class _RandomAccessIterator, class _Comp>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
+__sort_dispatch(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
difference_type __depth_limit = 2 * std::__log2i(__last - __first);
- using _Unwrap = _UnwrapAlgPolicy<_WrappedComp>;
- using _AlgPolicy = typename _Unwrap::_AlgPolicy;
- using _Compare = typename _Unwrap::_Comp;
- _Compare __comp = _Unwrap::__get_comp(__wrapped_comp);
- std::__introsort<_AlgPolicy, _Compare>(__first, __last, __comp, __depth_limit);
+ // Only use bitset partitioning for arithmetic types. We should also check
+ // that the default comparator is in use so that we are sure that there are no
+ // branches in the comparator.
+ std::__introsort<_AlgPolicy,
+ _Comp&,
+ _RandomAccessIterator,
+ __use_branchless_sort<_Comp, _RandomAccessIterator>::value>(
+ __first, __last, __comp, __depth_limit);
}
-template <class _Compare, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY void __sort(_Tp** __first, _Tp** __last, __less<_Tp*>&) {
- __less<uintptr_t> __comp;
- std::__sort<__less<uintptr_t>&, uintptr_t*>((uintptr_t*)__first, (uintptr_t*)__last, __comp);
-}
+template <class _Type, class... _Options>
+using __is_any_of = _Or<is_same<_Type, _Options>...>;
-extern template _LIBCPP_FUNC_VIS void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
+template <class _Type>
+using __sort_is_specialized_in_library = __is_any_of<
+ _Type,
+ char,
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template _LIBCPP_FUNC_VIS void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
+ wchar_t,
#endif
-extern template _LIBCPP_FUNC_VIS void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<short>&, short*>(short*, short*, __less<short>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<int>&, int*>(int*, int*, __less<int>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<long>&, long*>(long*, long*, __less<long>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<float>&, float*>(float*, float*, __less<float>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<double>&, double*>(double*, double*, __less<double>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
-
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&);
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
+ signed char,
+ unsigned char,
+ short,
+ unsigned short,
+ int,
+ unsigned int,
+ long,
+ unsigned long,
+ long long,
+ unsigned long long,
+ float,
+ double,
+ long double>;
+
+template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, __less<>&) {
+ __less<_Type> __comp;
+ std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
+}
+
+template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, less<_Type>&) {
+ __less<_Type> __comp;
+ std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
+}
+
+#if _LIBCPP_STD_VER >= 14
+template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, less<>&) {
+ __less<_Type> __comp;
+ std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
+}
+#endif
+
+#if _LIBCPP_STD_VER >= 20
+template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, ranges::less&) {
+ __less<_Type> __comp;
+ std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
+}
#endif
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
-
-extern template _LIBCPP_FUNC_VIS unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&);
template <class _AlgPolicy, class _RandomAccessIterator, class _Comp>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void __sort_impl(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
std::__debug_randomize_range<_AlgPolicy>(__first, __last);
- using _Comp_ref = __comp_ref_type<_Comp>;
if (__libcpp_is_constant_evaluated()) {
- std::__partial_sort<_AlgPolicy>(__first, __last, __last, __comp);
-
+ std::__partial_sort<_AlgPolicy>(
+ std::__unwrap_iter(__first), std::__unwrap_iter(__last), std::__unwrap_iter(__last), __comp);
} else {
- using _WrappedComp = typename _WrapAlgPolicy<_AlgPolicy, _Comp_ref>::type;
- _Comp_ref __comp_ref(__comp);
- _WrappedComp __wrapped_comp(__comp_ref);
- std::__sort<_WrappedComp>(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __wrapped_comp);
+ std::__sort_dispatch<_AlgPolicy>(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __comp);
}
-}
-
-template <class _RandomAccessIterator, class _Comp>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
-void sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
- std::__sort_impl<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __comp);
-}
-
-template <class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
-void sort(_RandomAccessIterator __first, _RandomAccessIterator __last) {
- std::sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+ std::__check_strict_weak_ordering_sorted(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __comp);
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort_heap.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort_heap.h
index 8249407b550..a82926ed1cc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort_heap.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort_heap.h
@@ -14,9 +14,11 @@
#include <__algorithm/iterator_operations.h>
#include <__algorithm/pop_heap.h>
#include <__config>
+#include <__debug_utils/strict_weak_ordering_check.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -27,11 +29,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
void __sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare&& __comp) {
+ _RandomAccessIterator __saved_last = __last;
__comp_ref_type<_Compare> __comp_ref = __comp;
using difference_type = typename iterator_traits<_RandomAccessIterator>::difference_type;
for (difference_type __n = __last - __first; __n > 1; --__last, (void) --__n)
std::__pop_heap<_AlgPolicy>(__first, __last, __comp_ref, __n);
+ std::__check_strict_weak_ordering_sorted(__first, __saved_last, __comp_ref);
}
template <class _RandomAccessIterator, class _Compare>
@@ -46,8 +50,7 @@ void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Com
template <class _RandomAccessIterator>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) {
- std::sort_heap(std::move(__first), std::move(__last),
- __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+ std::sort_heap(std::move(__first), std::move(__last), __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort_old.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort_old.h
new file mode 100644
index 00000000000..88bf7c3fb10
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/sort_old.h
@@ -0,0 +1,720 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_SORT_OLD_H
+#define _LIBCPP___ALGORITHM_SORT_OLD_H
+
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/iterator_operations.h>
+#include <__algorithm/min_element.h>
+#include <__algorithm/partial_sort.h>
+#include <__algorithm/unwrap_iter.h>
+#include <__config>
+#include <__debug_utils/randomize_range.h>
+#include <__functional/operations.h>
+#include <__functional/ranges_operations.h>
+#include <__iterator/iterator_traits.h>
+#include <__memory/destruct_n.h>
+#include <__memory/unique_ptr.h>
+#include <__type_traits/is_arithmetic.h>
+#include <__type_traits/is_trivially_copy_assignable.h>
+#include <__type_traits/is_trivially_copy_constructible.h>
+#include <__utility/move.h>
+#include <bit>
+#include <climits>
+#include <cstdint>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+namespace old_sort {
+
+// Wraps an algorithm policy tag and a comparator in a single struct, used to pass the policy tag around without
+// changing the number of template arguments (to keep the ABI stable). This is only used for the "range" policy tag.
+//
+// To create an object of this type, use `_WrapAlgPolicy<T, C>::type` -- see the specialization below for the rationale.
+template <class _PolicyT, class _CompT, class = void>
+struct _WrapAlgPolicy {
+ using type = _WrapAlgPolicy;
+
+ using _AlgPolicy = _PolicyT;
+ using _Comp = _CompT;
+ _Comp& __comp;
+
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _WrapAlgPolicy(_Comp& __c) : __comp(__c) {}
+};
+
+// Specialization for the "classic" policy tag that avoids creating a struct and simply defines an alias for the
+// comparator. When unwrapping, a pristine comparator is always considered to have the "classic" tag attached. Passing
+// the pristine comparator where possible allows using template instantiations from the dylib.
+template <class _PolicyT, class _CompT>
+struct _WrapAlgPolicy<_PolicyT, _CompT, std::__enable_if_t<std::is_same<_PolicyT, std::_ClassicAlgPolicy>::value> > {
+ using type = _CompT;
+};
+
+// Unwraps a pristine functor (e.g. `std::less`) as if it were wrapped using `_WrapAlgPolicy`. The policy tag is always
+// set to "classic".
+template <class _CompT>
+struct _UnwrapAlgPolicy {
+ using _AlgPolicy = std::_ClassicAlgPolicy;
+ using _Comp = _CompT;
+
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 static
+ _Comp __get_comp(_Comp __comp) { return __comp; }
+};
+
+// Unwraps a `_WrapAlgPolicy` struct.
+template <class... _Ts>
+struct _UnwrapAlgPolicy<_WrapAlgPolicy<_Ts...> > {
+ using _Wrapped = _WrapAlgPolicy<_Ts...>;
+ using _AlgPolicy = typename _Wrapped::_AlgPolicy;
+ using _Comp = typename _Wrapped::_Comp;
+
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 static
+ _Comp __get_comp(_Wrapped& __w) { return __w.__comp; }
+};
+
+// stable, 2-3 compares, 0-2 swaps
+
+template <class _AlgPolicy, class _Compare, class _ForwardIterator>
+_LIBCPP_HIDE_FROM_ABI
+_LIBCPP_CONSTEXPR_SINCE_CXX14 unsigned __sort3(_ForwardIterator __x, _ForwardIterator __y, _ForwardIterator __z,
+ _Compare __c) {
+ using _Ops = std::_IterOps<_AlgPolicy>;
+
+ unsigned __r = 0;
+ if (!__c(*__y, *__x)) // if x <= y
+ {
+ if (!__c(*__z, *__y)) // if y <= z
+ return __r; // x <= y && y <= z
+ // x <= y && y > z
+ _Ops::iter_swap(__y, __z); // x <= z && y < z
+ __r = 1;
+ if (__c(*__y, *__x)) // if x > y
+ {
+ _Ops::iter_swap(__x, __y); // x < y && y <= z
+ __r = 2;
+ }
+ return __r; // x <= y && y < z
+ }
+ if (__c(*__z, *__y)) // x > y, if y > z
+ {
+ _Ops::iter_swap(__x, __z); // x < y && y < z
+ __r = 1;
+ return __r;
+ }
+ _Ops::iter_swap(__x, __y); // x > y && y <= z
+ __r = 1; // x < y && x <= z
+ if (__c(*__z, *__y)) // if y > z
+ {
+ _Ops::iter_swap(__y, __z); // x <= y && y < z
+ __r = 2;
+ }
+ return __r;
+} // x <= y && y <= z
+
+// stable, 3-6 compares, 0-5 swaps
+
+template <class _AlgPolicy, class _Compare, class _ForwardIterator>
+_LIBCPP_HIDE_FROM_ABI
+unsigned __sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, _ForwardIterator __x4,
+ _Compare __c) {
+ using _Ops = std::_IterOps<_AlgPolicy>;
+
+ unsigned __r = old_sort::__sort3<_AlgPolicy, _Compare>(__x1, __x2, __x3, __c);
+ if (__c(*__x4, *__x3)) {
+ _Ops::iter_swap(__x3, __x4);
+ ++__r;
+ if (__c(*__x3, *__x2)) {
+ _Ops::iter_swap(__x2, __x3);
+ ++__r;
+ if (__c(*__x2, *__x1)) {
+ _Ops::iter_swap(__x1, __x2);
+ ++__r;
+ }
+ }
+ }
+ return __r;
+}
+
+// stable, 4-10 compares, 0-9 swaps
+
+template <class _WrappedComp, class _ForwardIterator>
+_LIBCPP_HIDDEN unsigned __sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
+ _ForwardIterator __x4, _ForwardIterator __x5, _WrappedComp __wrapped_comp) {
+ using _Unwrap = _UnwrapAlgPolicy<_WrappedComp>;
+ using _AlgPolicy = typename _Unwrap::_AlgPolicy;
+ using _Ops = std::_IterOps<_AlgPolicy>;
+
+ using _Compare = typename _Unwrap::_Comp;
+ _Compare __c = _Unwrap::__get_comp(__wrapped_comp);
+
+ unsigned __r = old_sort::__sort4<_AlgPolicy, _Compare>(__x1, __x2, __x3, __x4, __c);
+ if (__c(*__x5, *__x4)) {
+ _Ops::iter_swap(__x4, __x5);
+ ++__r;
+ if (__c(*__x4, *__x3)) {
+ _Ops::iter_swap(__x3, __x4);
+ ++__r;
+ if (__c(*__x3, *__x2)) {
+ _Ops::iter_swap(__x2, __x3);
+ ++__r;
+ if (__c(*__x2, *__x1)) {
+ _Ops::iter_swap(__x1, __x2);
+ ++__r;
+ }
+ }
+ }
+ }
+ return __r;
+}
+
+template <class _AlgPolicy, class _Compare, class _ForwardIterator>
+_LIBCPP_HIDE_FROM_ABI unsigned __sort5_wrap_policy(
+ _ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, _ForwardIterator __x4, _ForwardIterator __x5,
+ _Compare __c) {
+ using _WrappedComp = typename _WrapAlgPolicy<_AlgPolicy, _Compare>::type;
+ _WrappedComp __wrapped_comp(__c);
+ return old_sort::__sort5<_WrappedComp>(
+ std::move(__x1), std::move(__x2), std::move(__x3), std::move(__x4), std::move(__x5), __wrapped_comp);
+}
+
+// The comparator being simple is a prerequisite for using the branchless optimization.
+template <class _Tp>
+struct __is_simple_comparator : std::false_type {};
+template <>
+struct __is_simple_comparator<std::__less<>&> : std::true_type {};
+template <class _Tp>
+struct __is_simple_comparator<std::less<_Tp>&> : std::true_type {};
+template <class _Tp>
+struct __is_simple_comparator<std::greater<_Tp>&> : std::true_type {};
+#if _LIBCPP_STD_VER > 17
+template <>
+struct __is_simple_comparator<std::ranges::less&> : std::true_type {};
+template <>
+struct __is_simple_comparator<std::ranges::greater&> : std::true_type {};
+#endif
+
+template <class _Compare, class _Iter, class _Tp = typename std::iterator_traits<_Iter>::value_type>
+using __use_branchless_sort =
+ std::integral_constant<bool, std::__libcpp_is_contiguous_iterator<_Iter>::value && sizeof(_Tp) <= sizeof(void*) &&
+ std::is_arithmetic<_Tp>::value && __is_simple_comparator<_Compare>::value>;
+
+// Ensures that __c(*__x, *__y) is true by swapping *__x and *__y if necessary.
+template <class _Compare, class _RandomAccessIterator>
+inline _LIBCPP_HIDE_FROM_ABI void __cond_swap(_RandomAccessIterator __x, _RandomAccessIterator __y, _Compare __c) {
+ // Note: this function behaves correctly even with proxy iterators (because it relies on `value_type`).
+ using value_type = typename std::iterator_traits<_RandomAccessIterator>::value_type;
+ bool __r = __c(*__x, *__y);
+ value_type __tmp = __r ? *__x : *__y;
+ *__y = __r ? *__y : *__x;
+ *__x = __tmp;
+}
+
+// Ensures that *__x, *__y and *__z are ordered according to the comparator __c,
+// under the assumption that *__y and *__z are already ordered.
+template <class _Compare, class _RandomAccessIterator>
+inline _LIBCPP_HIDE_FROM_ABI void __partially_sorted_swap(_RandomAccessIterator __x, _RandomAccessIterator __y,
+ _RandomAccessIterator __z, _Compare __c) {
+ // Note: this function behaves correctly even with proxy iterators (because it relies on `value_type`).
+ using value_type = typename std::iterator_traits<_RandomAccessIterator>::value_type;
+ bool __r = __c(*__z, *__x);
+ value_type __tmp = __r ? *__z : *__x;
+ *__z = __r ? *__x : *__z;
+ __r = __c(__tmp, *__y);
+ *__x = __r ? *__x : *__y;
+ *__y = __r ? *__y : __tmp;
+}
+
+template <class, class _Compare, class _RandomAccessIterator>
+inline _LIBCPP_HIDE_FROM_ABI std::__enable_if_t<__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
+__sort3_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
+ _Compare __c) {
+ old_sort::__cond_swap<_Compare>(__x2, __x3, __c);
+ old_sort::__partially_sorted_swap<_Compare>(__x1, __x2, __x3, __c);
+}
+
+template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
+inline _LIBCPP_HIDE_FROM_ABI std::__enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
+__sort3_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
+ _Compare __c) {
+ old_sort::__sort3<_AlgPolicy, _Compare>(__x1, __x2, __x3, __c);
+}
+
+template <class, class _Compare, class _RandomAccessIterator>
+inline _LIBCPP_HIDE_FROM_ABI std::__enable_if_t<__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
+__sort4_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
+ _RandomAccessIterator __x4, _Compare __c) {
+ old_sort::__cond_swap<_Compare>(__x1, __x3, __c);
+ old_sort::__cond_swap<_Compare>(__x2, __x4, __c);
+ old_sort::__cond_swap<_Compare>(__x1, __x2, __c);
+ old_sort::__cond_swap<_Compare>(__x3, __x4, __c);
+ old_sort::__cond_swap<_Compare>(__x2, __x3, __c);
+}
+
+template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
+inline _LIBCPP_HIDE_FROM_ABI std::__enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
+__sort4_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
+ _RandomAccessIterator __x4, _Compare __c) {
+ old_sort::__sort4<_AlgPolicy, _Compare>(__x1, __x2, __x3, __x4, __c);
+}
+
+template <class, class _Compare, class _RandomAccessIterator>
+inline _LIBCPP_HIDE_FROM_ABI std::__enable_if_t<__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
+__sort5_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
+ _RandomAccessIterator __x4, _RandomAccessIterator __x5, _Compare __c) {
+ old_sort::__cond_swap<_Compare>(__x1, __x2, __c);
+ old_sort::__cond_swap<_Compare>(__x4, __x5, __c);
+ old_sort::__partially_sorted_swap<_Compare>(__x3, __x4, __x5, __c);
+ old_sort::__cond_swap<_Compare>(__x2, __x5, __c);
+ old_sort::__partially_sorted_swap<_Compare>(__x1, __x3, __x4, __c);
+ old_sort::__partially_sorted_swap<_Compare>(__x2, __x3, __x4, __c);
+}
+
+template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
+inline _LIBCPP_HIDE_FROM_ABI std::__enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
+__sort5_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
+ _RandomAccessIterator __x4, _RandomAccessIterator __x5, _Compare __c) {
+ old_sort::__sort5_wrap_policy<_AlgPolicy, _Compare>(__x1, __x2, __x3, __x4, __x5, __c);
+}
+
+// Assumes size > 0
+template <class _AlgPolicy, class _Compare, class _BidirectionalIterator>
+_LIBCPP_HIDE_FROM_ABI
+_LIBCPP_CONSTEXPR_SINCE_CXX14 void __selection_sort(_BidirectionalIterator __first, _BidirectionalIterator __last,
+ _Compare __comp) {
+ _BidirectionalIterator __lm1 = __last;
+ for (--__lm1; __first != __lm1; ++__first) {
+ _BidirectionalIterator __i = std::__min_element<_Compare>(__first, __last, __comp);
+ if (__i != __first)
+ std::_IterOps<_AlgPolicy>::iter_swap(__first, __i);
+ }
+}
+
+template <class _AlgPolicy, class _Compare, class _BidirectionalIterator>
+_LIBCPP_HIDE_FROM_ABI
+void __insertion_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) {
+ using _Ops = std::_IterOps<_AlgPolicy>;
+
+ typedef typename std::iterator_traits<_BidirectionalIterator>::value_type value_type;
+ if (__first != __last) {
+ _BidirectionalIterator __i = __first;
+ for (++__i; __i != __last; ++__i) {
+ _BidirectionalIterator __j = __i;
+ value_type __t(_Ops::__iter_move(__j));
+ for (_BidirectionalIterator __k = __i; __k != __first && __comp(__t, *--__k); --__j)
+ *__j = _Ops::__iter_move(__k);
+ *__j = std::move(__t);
+ }
+ }
+}
+
+template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
+_LIBCPP_HIDE_FROM_ABI
+void __insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
+ using _Ops = std::_IterOps<_AlgPolicy>;
+
+ typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ typedef typename std::iterator_traits<_RandomAccessIterator>::value_type value_type;
+ _RandomAccessIterator __j = __first + difference_type(2);
+ old_sort::__sort3_maybe_branchless<_AlgPolicy, _Compare>(__first, __first + difference_type(1), __j, __comp);
+ for (_RandomAccessIterator __i = __j + difference_type(1); __i != __last; ++__i) {
+ if (__comp(*__i, *__j)) {
+ value_type __t(_Ops::__iter_move(__i));
+ _RandomAccessIterator __k = __j;
+ __j = __i;
+ do {
+ *__j = _Ops::__iter_move(__k);
+ __j = __k;
+ } while (__j != __first && __comp(__t, *--__k));
+ *__j = std::move(__t);
+ }
+ __j = __i;
+ }
+}
+
+template <class _WrappedComp, class _RandomAccessIterator>
+_LIBCPP_HIDDEN bool __insertion_sort_incomplete(
+ _RandomAccessIterator __first, _RandomAccessIterator __last, _WrappedComp __wrapped_comp) {
+ using _Unwrap = _UnwrapAlgPolicy<_WrappedComp>;
+ using _AlgPolicy = typename _Unwrap::_AlgPolicy;
+ using _Ops = std::_IterOps<_AlgPolicy>;
+
+ using _Compare = typename _Unwrap::_Comp;
+ _Compare __comp = _Unwrap::__get_comp(__wrapped_comp);
+
+ typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ switch (__last - __first) {
+ case 0:
+ case 1:
+ return true;
+ case 2:
+ if (__comp(*--__last, *__first))
+ std::_IterOps<_AlgPolicy>::iter_swap(__first, __last);
+ return true;
+ case 3:
+ old_sort::__sort3_maybe_branchless<_AlgPolicy, _Compare>(__first, __first + difference_type(1), --__last, __comp);
+ return true;
+ case 4:
+ old_sort::__sort4_maybe_branchless<_AlgPolicy, _Compare>(
+ __first, __first + difference_type(1), __first + difference_type(2), --__last, __comp);
+ return true;
+ case 5:
+ old_sort::__sort5_maybe_branchless<_AlgPolicy, _Compare>(
+ __first, __first + difference_type(1), __first + difference_type(2), __first + difference_type(3),
+ --__last, __comp);
+ return true;
+ }
+ typedef typename std::iterator_traits<_RandomAccessIterator>::value_type value_type;
+ _RandomAccessIterator __j = __first + difference_type(2);
+ old_sort::__sort3_maybe_branchless<_AlgPolicy, _Compare>(__first, __first + difference_type(1), __j, __comp);
+ const unsigned __limit = 8;
+ unsigned __count = 0;
+ for (_RandomAccessIterator __i = __j + difference_type(1); __i != __last; ++__i) {
+ if (__comp(*__i, *__j)) {
+ value_type __t(_Ops::__iter_move(__i));
+ _RandomAccessIterator __k = __j;
+ __j = __i;
+ do {
+ *__j = _Ops::__iter_move(__k);
+ __j = __k;
+ } while (__j != __first && __comp(__t, *--__k));
+ *__j = std::move(__t);
+ if (++__count == __limit)
+ return ++__i == __last;
+ }
+ __j = __i;
+ }
+ return true;
+}
+
+template <class _AlgPolicy, class _Compare, class _BidirectionalIterator>
+_LIBCPP_HIDE_FROM_ABI
+void __insertion_sort_move(_BidirectionalIterator __first1, _BidirectionalIterator __last1,
+ typename std::iterator_traits<_BidirectionalIterator>::value_type* __first2, _Compare __comp) {
+ using _Ops = std::_IterOps<_AlgPolicy>;
+
+ typedef typename std::iterator_traits<_BidirectionalIterator>::value_type value_type;
+ if (__first1 != __last1) {
+ std::__destruct_n __d(0);
+ std::unique_ptr<value_type, std::__destruct_n&> __h(__first2, __d);
+ value_type* __last2 = __first2;
+ ::new ((void*)__last2) value_type(_Ops::__iter_move(__first1));
+ __d.template __incr<value_type>();
+ for (++__last2; ++__first1 != __last1; ++__last2) {
+ value_type* __j2 = __last2;
+ value_type* __i2 = __j2;
+ if (__comp(*__first1, *--__i2)) {
+ ::new ((void*)__j2) value_type(std::move(*__i2));
+ __d.template __incr<value_type>();
+ for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2)
+ *__j2 = std::move(*__i2);
+ *__j2 = _Ops::__iter_move(__first1);
+ } else {
+ ::new ((void*)__j2) value_type(_Ops::__iter_move(__first1));
+ __d.template __incr<value_type>();
+ }
+ }
+ __h.release();
+ }
+}
+
+template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
+void __introsort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
+ typename std::iterator_traits<_RandomAccessIterator>::difference_type __depth) {
+ using _Ops = std::_IterOps<_AlgPolicy>;
+
+ typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ typedef typename std::iterator_traits<_RandomAccessIterator>::value_type value_type;
+ const difference_type __limit =
+ std::is_trivially_copy_constructible<value_type>::value && std::is_trivially_copy_assignable<value_type>::value ? 30 : 6;
+ while (true) {
+ __restart:
+ difference_type __len = __last - __first;
+ switch (__len) {
+ case 0:
+ case 1:
+ return;
+ case 2:
+ if (__comp(*--__last, *__first))
+ std::_IterOps<_AlgPolicy>::iter_swap(__first, __last);
+ return;
+ case 3:
+ old_sort::__sort3_maybe_branchless<_AlgPolicy, _Compare>(__first, __first + difference_type(1), --__last, __comp);
+ return;
+ case 4:
+ old_sort::__sort4_maybe_branchless<_AlgPolicy, _Compare>(
+ __first, __first + difference_type(1), __first + difference_type(2), --__last, __comp);
+ return;
+ case 5:
+ old_sort::__sort5_maybe_branchless<_AlgPolicy, _Compare>(
+ __first, __first + difference_type(1), __first + difference_type(2), __first + difference_type(3),
+ --__last, __comp);
+ return;
+ }
+ if (__len <= __limit) {
+ old_sort::__insertion_sort_3<_AlgPolicy, _Compare>(__first, __last, __comp);
+ return;
+ }
+ // __len > 5
+ if (__depth == 0) {
+ // Fallback to heap sort as Introsort suggests.
+ std::__partial_sort<_AlgPolicy, _Compare>(__first, __last, __last, __comp);
+ return;
+ }
+ --__depth;
+ _RandomAccessIterator __m = __first;
+ _RandomAccessIterator __lm1 = __last;
+ --__lm1;
+ unsigned __n_swaps;
+ {
+ difference_type __delta;
+ if (__len >= 1000) {
+ __delta = __len / 2;
+ __m += __delta;
+ __delta /= 2;
+ __n_swaps = old_sort::__sort5_wrap_policy<_AlgPolicy, _Compare>(
+ __first, __first + __delta, __m, __m + __delta, __lm1, __comp);
+ } else {
+ __delta = __len / 2;
+ __m += __delta;
+ __n_swaps = old_sort::__sort3<_AlgPolicy, _Compare>(__first, __m, __lm1, __comp);
+ }
+ }
+ // *__m is median
+ // partition [__first, __m) < *__m and *__m <= [__m, __last)
+ // (this inhibits tossing elements equivalent to __m around unnecessarily)
+ _RandomAccessIterator __i = __first;
+ _RandomAccessIterator __j = __lm1;
+ // j points beyond range to be tested, *__m is known to be <= *__lm1
+ // The search going up is known to be guarded but the search coming down isn't.
+ // Prime the downward search with a guard.
+ if (!__comp(*__i, *__m)) // if *__first == *__m
+ {
+ // *__first == *__m, *__first doesn't go in first part
+ // manually guard downward moving __j against __i
+ while (true) {
+ if (__i == --__j) {
+ // *__first == *__m, *__m <= all other elements
+ // Parition instead into [__first, __i) == *__first and *__first < [__i, __last)
+ ++__i; // __first + 1
+ __j = __last;
+ if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1)
+ {
+ while (true) {
+ if (__i == __j)
+ return; // [__first, __last) all equivalent elements
+ if (__comp(*__first, *__i)) {
+ _Ops::iter_swap(__i, __j);
+ ++__n_swaps;
+ ++__i;
+ break;
+ }
+ ++__i;
+ }
+ }
+ // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1
+ if (__i == __j)
+ return;
+ while (true) {
+ while (!__comp(*__first, *__i))
+ ++__i;
+ while (__comp(*__first, *--__j))
+ ;
+ if (__i >= __j)
+ break;
+ _Ops::iter_swap(__i, __j);
+ ++__n_swaps;
+ ++__i;
+ }
+ // [__first, __i) == *__first and *__first < [__i, __last)
+ // The first part is sorted, sort the second part
+ // old_sort::__sort<_Compare>(__i, __last, __comp);
+ __first = __i;
+ goto __restart;
+ }
+ if (__comp(*__j, *__m)) {
+ _Ops::iter_swap(__i, __j);
+ ++__n_swaps;
+ break; // found guard for downward moving __j, now use unguarded partition
+ }
+ }
+ }
+ // It is known that *__i < *__m
+ ++__i;
+ // j points beyond range to be tested, *__m is known to be <= *__lm1
+ // if not yet partitioned...
+ if (__i < __j) {
+ // known that *(__i - 1) < *__m
+ // known that __i <= __m
+ while (true) {
+ // __m still guards upward moving __i
+ while (__comp(*__i, *__m))
+ ++__i;
+ // It is now known that a guard exists for downward moving __j
+ while (!__comp(*--__j, *__m))
+ ;
+ if (__i > __j)
+ break;
+ _Ops::iter_swap(__i, __j);
+ ++__n_swaps;
+ // It is known that __m != __j
+ // If __m just moved, follow it
+ if (__m == __i)
+ __m = __j;
+ ++__i;
+ }
+ }
+ // [__first, __i) < *__m and *__m <= [__i, __last)
+ if (__i != __m && __comp(*__m, *__i)) {
+ _Ops::iter_swap(__i, __m);
+ ++__n_swaps;
+ }
+ // [__first, __i) < *__i and *__i <= [__i+1, __last)
+ // If we were given a perfect partition, see if insertion sort is quick...
+ if (__n_swaps == 0) {
+ using _WrappedComp = typename _WrapAlgPolicy<_AlgPolicy, _Compare>::type;
+ _WrappedComp __wrapped_comp(__comp);
+ bool __fs = old_sort::__insertion_sort_incomplete<_WrappedComp>(__first, __i, __wrapped_comp);
+ if (old_sort::__insertion_sort_incomplete<_WrappedComp>(__i + difference_type(1), __last, __wrapped_comp)) {
+ if (__fs)
+ return;
+ __last = __i;
+ continue;
+ } else {
+ if (__fs) {
+ __first = ++__i;
+ continue;
+ }
+ }
+ }
+ // sort smaller range with recursive call and larger with tail recursion elimination
+ if (__i - __first < __last - __i) {
+ old_sort::__introsort<_AlgPolicy, _Compare>(__first, __i, __comp, __depth);
+ __first = ++__i;
+ } else {
+ old_sort::__introsort<_AlgPolicy, _Compare>(__i + difference_type(1), __last, __comp, __depth);
+ __last = __i;
+ }
+ }
+}
+
+template <typename _Number>
+inline _LIBCPP_HIDE_FROM_ABI _Number __log2i(_Number __n) {
+ if (__n == 0)
+ return 0;
+ if (sizeof(__n) <= sizeof(unsigned))
+ return sizeof(unsigned) * CHAR_BIT - 1 - std::__libcpp_clz(static_cast<unsigned>(__n));
+ if (sizeof(__n) <= sizeof(unsigned long))
+ return sizeof(unsigned long) * CHAR_BIT - 1 - std::__libcpp_clz(static_cast<unsigned long>(__n));
+ if (sizeof(__n) <= sizeof(unsigned long long))
+ return sizeof(unsigned long long) * CHAR_BIT - 1 - std::__libcpp_clz(static_cast<unsigned long long>(__n));
+
+ _Number __log2 = 0;
+ while (__n > 1) {
+ __log2++;
+ __n >>= 1;
+ }
+ return __log2;
+}
+
+template <class _WrappedComp, class _RandomAccessIterator>
+_LIBCPP_HIDDEN void __sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _WrappedComp __wrapped_comp) {
+ typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ difference_type __depth_limit = 2 * old_sort::__log2i(__last - __first);
+
+ using _Unwrap = _UnwrapAlgPolicy<_WrappedComp>;
+ using _AlgPolicy = typename _Unwrap::_AlgPolicy;
+ using _Compare = typename _Unwrap::_Comp;
+ _Compare __comp = _Unwrap::__get_comp(__wrapped_comp);
+ old_sort::__introsort<_AlgPolicy, _Compare>(__first, __last, __comp, __depth_limit);
+}
+
+template <class _Compare, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY void __sort(_Tp** __first, _Tp** __last, std::__less<>&) {
+ std::__less<> __comp;
+ old_sort::__sort<std::__less<>&, uintptr_t*>((uintptr_t*)__first, (uintptr_t*)__last, __comp);
+}
+
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<>&, char*>(char*, char*, std::__less<>&);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<>&, wchar_t*>(wchar_t*, wchar_t*, std::__less<>&);
+#endif
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<signed char>&, signed char*>(signed char*, signed char*, std::__less<signed char>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, std::__less<unsigned char>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<>&, short*>(short*, short*, std::__less<>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, std::__less<unsigned short>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<>&, int*>(int*, int*, std::__less<>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<>&, unsigned*>(unsigned*, unsigned*, std::__less<>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<>&, long*>(long*, long*, std::__less<>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, std::__less<unsigned long>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<long long>&, long long*>(long long*, long long*, std::__less<long long>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, std::__less<unsigned long long>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<>&, float*>(float*, float*, std::__less<>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<>&, double*>(double*, double*, std::__less<>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<std::__less<long double>&, long double*>(long double*, long double*, std::__less<long double>&);
+
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<>&, char*>(char*, char*, std::__less<>&);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<>&, wchar_t*>(wchar_t*, wchar_t*, std::__less<>&);
+#endif
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<signed char>&, signed char*>(signed char*, signed char*, std::__less<signed char>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, std::__less<unsigned char>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<>&, short*>(short*, short*, std::__less<>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, std::__less<unsigned short>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<>&, int*>(int*, int*, std::__less<>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<>&, unsigned*>(unsigned*, unsigned*, std::__less<>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<>&, long*>(long*, long*, std::__less<>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, std::__less<unsigned long>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<long long>&, long long*>(long long*, long long*, std::__less<long long>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, std::__less<unsigned long long>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<>&, float*>(float*, float*, std::__less<>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<>&, double*>(double*, double*, std::__less<>&);
+extern template _LIBCPP_EXPORTED_FROM_ABI bool __insertion_sort_incomplete<std::__less<long double>&, long double*>(long double*, long double*, std::__less<long double>&);
+
+extern template _LIBCPP_EXPORTED_FROM_ABI unsigned __sort5<std::__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, std::__less<long double>&);
+
+template <class _AlgPolicy, class _RandomAccessIterator, class _Comp>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+void __sort_impl(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
+ std::__debug_randomize_range<_AlgPolicy>(__first, __last);
+
+ using _Comp_ref = std::__comp_ref_type<_Comp>;
+ if (std::__libcpp_is_constant_evaluated()) {
+ std::__partial_sort<_AlgPolicy>(__first, __last, __last, __comp);
+
+ } else {
+ using _WrappedComp = typename _WrapAlgPolicy<_AlgPolicy, _Comp_ref>::type;
+ _Comp_ref __comp_ref(__comp);
+ _WrappedComp __wrapped_comp(__comp_ref);
+ old_sort::__sort<_WrappedComp>(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __wrapped_comp);
+ }
+}
+
+} // namespace old_sort
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _RandomAccessIterator, class _Comp>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+void sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
+ old_sort::__sort_impl<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __comp);
+}
+
+template <class _RandomAccessIterator>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+void sort(_RandomAccessIterator __first, _RandomAccessIterator __last) {
+ std::sort(__first, __last, std::__less<>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ALGORITHM_SORT_OLD_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/stable_partition.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/stable_partition.h
index a49de6dbb0e..38fa9ce37d0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/stable_partition.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/stable_partition.h
@@ -21,7 +21,6 @@
#include <__utility/move.h>
#include <__utility/pair.h>
#include <new>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -123,7 +122,10 @@ _LIBCPP_HIDE_FROM_ABI _ForwardIterator
__stable_partition_impl(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
forward_iterator_tag)
{
- const unsigned __alloc_limit = 3; // might want to make this a function of trivial assignment
+ typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
+ typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
+
+ const difference_type __alloc_limit = 3; // might want to make this a function of trivial assignment
// Either prove all true and return __first or point to first false
while (true)
{
@@ -135,8 +137,6 @@ __stable_partition_impl(_ForwardIterator __first, _ForwardIterator __last, _Pred
}
// We now have a reduced range [__first, __last)
// *__first is known to be false
- typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
- typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
difference_type __len = _IterOps<_AlgPolicy>::distance(__first, __last);
pair<value_type*, ptrdiff_t> __p(0, 0);
unique_ptr<value_type, __return_temporary_buffer> __h;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/stable_sort.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/stable_sort.h
index 8e70978ab61..dc24218b74d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/stable_sort.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/stable_sort.h
@@ -15,14 +15,15 @@
#include <__algorithm/iterator_operations.h>
#include <__algorithm/sort.h>
#include <__config>
+#include <__debug_utils/strict_weak_ordering_check.h>
#include <__iterator/iterator_traits.h>
#include <__memory/destruct_n.h>
#include <__memory/temporary_buffer.h>
#include <__memory/unique_ptr.h>
+#include <__type_traits/is_trivially_copy_assignable.h>
#include <__utility/move.h>
#include <__utility/pair.h>
#include <new>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -30,6 +31,37 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+template <class _AlgPolicy, class _Compare, class _BidirectionalIterator>
+_LIBCPP_HIDE_FROM_ABI
+void __insertion_sort_move(_BidirectionalIterator __first1, _BidirectionalIterator __last1,
+ typename iterator_traits<_BidirectionalIterator>::value_type* __first2, _Compare __comp) {
+ using _Ops = _IterOps<_AlgPolicy>;
+
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
+ if (__first1 != __last1) {
+ __destruct_n __d(0);
+ unique_ptr<value_type, __destruct_n&> __h(__first2, __d);
+ value_type* __last2 = __first2;
+ ::new ((void*)__last2) value_type(_Ops::__iter_move(__first1));
+ __d.template __incr<value_type>();
+ for (++__last2; ++__first1 != __last1; ++__last2) {
+ value_type* __j2 = __last2;
+ value_type* __i2 = __j2;
+ if (__comp(*__first1, *--__i2)) {
+ ::new ((void*)__j2) value_type(std::move(*__i2));
+ __d.template __incr<value_type>();
+ for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2)
+ *__j2 = std::move(*__i2);
+ *__j2 = _Ops::__iter_move(__first1);
+ } else {
+ ::new ((void*)__j2) value_type(_Ops::__iter_move(__first1));
+ __d.template __incr<value_type>();
+ }
+ }
+ __h.release();
+ }
+}
+
template <class _AlgPolicy, class _Compare, class _InputIterator1, class _InputIterator2>
_LIBCPP_HIDE_FROM_ABI void
__merge_move_construct(_InputIterator1 __first1, _InputIterator1 __last1,
@@ -228,6 +260,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
}
std::__stable_sort<_AlgPolicy, __comp_ref_type<_Compare> >(__first, __last, __comp, __len, __buf.first, __buf.second);
+ std::__check_strict_weak_ordering_sorted(__first, __last, __comp);
}
template <class _RandomAccessIterator, class _Compare>
@@ -239,7 +272,7 @@ void stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _C
template <class _RandomAccessIterator>
inline _LIBCPP_HIDE_FROM_ABI
void stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last) {
- std::stable_sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+ std::stable_sort(__first, __last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/three_way_comp_ref_type.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/three_way_comp_ref_type.h
new file mode 100644
index 00000000000..19c102f4c96
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/three_way_comp_ref_type.h
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ALGORITHM_THREE_WAY_COMP_REF_TYPE_H
+#define _LIBCPP___ALGORITHM_THREE_WAY_COMP_REF_TYPE_H
+
+#include <__compare/ordering.h>
+#include <__config>
+#include <__utility/declval.h>
+#include <__utility/forward.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 20
+
+template <class _Comp>
+struct __debug_three_way_comp {
+ _Comp& __comp_;
+ _LIBCPP_HIDE_FROM_ABI constexpr __debug_three_way_comp(_Comp& __c) : __comp_(__c) {}
+
+ template <class _Tp, class _Up>
+ _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(const _Tp& __x, const _Up& __y) {
+ auto __r = __comp_(__x, __y);
+ if constexpr (__comparison_category<decltype(__comp_(__x, __y))>)
+ __do_compare_assert(__y, __x, __r);
+ return __r;
+ }
+
+ template <class _Tp, class _Up>
+ _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp& __x, _Up& __y) {
+ auto __r = __comp_(__x, __y);
+ if constexpr (__comparison_category<decltype(__comp_(__x, __y))>)
+ __do_compare_assert(__y, __x, __r);
+ return __r;
+ }
+
+ template <class _LHS, class _RHS, class _Order>
+ _LIBCPP_HIDE_FROM_ABI constexpr void __do_compare_assert(_LHS& __l, _RHS& __r, _Order __o) {
+ _Order __expected = __o;
+ if (__o == _Order::less)
+ __expected = _Order::greater;
+ if (__o == _Order::greater)
+ __expected = _Order::less;
+ _LIBCPP_ASSERT(__comp_(__l, __r) == __expected, "Comparator does not induce a strict weak ordering");
+ (void)__l;
+ (void)__r;
+ }
+};
+
+// Pass the comparator by lvalue reference. Or in debug mode, using a
+// debugging wrapper that stores a reference.
+# if _LIBCPP_ENABLE_DEBUG_MODE
+template <class _Comp>
+using __three_way_comp_ref_type = __debug_three_way_comp<_Comp>;
+# else
+template <class _Comp>
+using __three_way_comp_ref_type = _Comp&;
+# endif
+
+#endif // _LIBCPP_STD_VER >= 20
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ALGORITHM_THREE_WAY_COMP_REF_TYPE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
index 1e86074b3db..1f2039949d7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
@@ -11,13 +11,13 @@
#include <__config>
#include <__functional/invoke.h>
-#include <type_traits>
+#include <__type_traits/remove_cvref.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
@@ -57,6 +57,6 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_UNIFORM_RANDOM_BIT_GENERATOR_ADAPTOR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h
index 0f661e10a74..91346e3c1bd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h
@@ -21,24 +21,27 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
// TODO: Change the name of __unwrap_iter_impl to something more appropriate
// The job of __unwrap_iter is to remove iterator wrappers (like reverse_iterator or __wrap_iter),
// to reduce the number of template instantiations and to enable pointer-based optimizations e.g. in std::copy.
-// In debug mode, we don't do this.
//
// Some algorithms (e.g. std::copy, but not std::sort) need to convert an
// "unwrapped" result back into the original iterator type. Doing that is the job of __rewrap_iter.
// Default case - we can't unwrap anything
-template <class _Iter, bool = __is_cpp17_contiguous_iterator<_Iter>::value>
+template <class _Iter, bool = __libcpp_is_contiguous_iterator<_Iter>::value>
struct __unwrap_iter_impl {
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Iter __rewrap(_Iter, _Iter __iter) { return __iter; }
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Iter __unwrap(_Iter __i) _NOEXCEPT { return __i; }
};
-#ifndef _LIBCPP_ENABLE_DEBUG_MODE
+// TODO(hardening): make sure that the following unwrapping doesn't unexpectedly turn hardened iterators into raw
+// pointers.
// It's a contiguous iterator, so we can use a raw pointer instead
template <class _Iter>
@@ -54,8 +57,6 @@ struct __unwrap_iter_impl<_Iter, true> {
}
};
-#endif // !_LIBCPP_ENABLE_DEBUG_MODE
-
template<class _Iter,
class _Impl = __unwrap_iter_impl<_Iter>,
__enable_if_t<is_copy_constructible<_Iter>::value, int> = 0>
@@ -64,6 +65,14 @@ decltype(_Impl::__unwrap(std::declval<_Iter>())) __unwrap_iter(_Iter __i) _NOEXC
return _Impl::__unwrap(__i);
}
+// Allow input_iterators to be passed to __unwrap_iter (but not __rewrap_iter)
+#if _LIBCPP_STD_VER >= 20
+template <class _Iter, __enable_if_t<!is_copy_constructible<_Iter>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI constexpr _Iter __unwrap_iter(_Iter __i) noexcept {
+ return __i;
+}
+#endif
+
template <class _OrigIter, class _Iter, class _Impl = __unwrap_iter_impl<_OrigIter> >
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _OrigIter __rewrap_iter(_OrigIter __orig_iter, _Iter __iter) _NOEXCEPT {
return _Impl::__rewrap(std::move(__orig_iter), std::move(__iter));
@@ -71,4 +80,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _OrigIter __rewrap_iter(_OrigIter __orig
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_PUSH_MACROS
+
#endif // _LIBCPP___ALGORITHM_UNWRAP_ITER_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_range.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_range.h
index 2c5d23e69f1..2c75c8f49de 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_range.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_range.h
@@ -28,7 +28,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// __unwrap_iter and __rewrap_iter don't work for this, because they assume that the iterator and sentinel have
// the same type. __unwrap_range tries to get two iterators and then forward to __unwrap_iter.
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter, class _Sent>
struct __unwrap_range_impl {
_LIBCPP_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Sent __sent)
@@ -43,7 +43,7 @@ struct __unwrap_range_impl {
}
_LIBCPP_HIDE_FROM_ABI static constexpr auto
- __rewrap(_Iter __orig_iter, decltype(std::__unwrap_iter(__orig_iter)) __iter)
+ __rewrap(_Iter __orig_iter, decltype(std::__unwrap_iter(std::move(__orig_iter))) __iter)
requires random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>
{
return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
@@ -80,7 +80,7 @@ template <
_LIBCPP_HIDE_FROM_ABI constexpr _Iter __rewrap_range(_Iter __orig_iter, _Unwrapped __iter) {
return __unwrap_range_impl<_Iter, _Sent>::__rewrap(std::move(__orig_iter), std::move(__iter));
}
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCPP_STD_VER >= 20
template <class _Iter, class _Unwrapped = decltype(std::__unwrap_iter(std::declval<_Iter>()))>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR pair<_Unwrapped, _Unwrapped> __unwrap_range(_Iter __first, _Iter __last) {
return std::make_pair(std::__unwrap_iter(std::move(__first)), std::__unwrap_iter(std::move(__last)));
@@ -90,7 +90,7 @@ template <class _Iter, class _Unwrapped = decltype(std::__unwrap_iter(std::declv
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Iter __rewrap_range(_Iter __orig_iter, _Unwrapped __iter) {
return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/upper_bound.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/upper_bound.h
index 96552ce1f8a..f499f7a80aa 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/upper_bound.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/upper_bound.h
@@ -25,6 +25,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _AlgPolicy, class _Compare, class _Iter, class _Sent, class _Tp, class _Proj>
@@ -47,8 +50,7 @@ __upper_bound(_Iter __first, _Sent __last, const _Tp& __value, _Compare&& __comp
template <class _ForwardIterator, class _Tp, class _Compare>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) {
- static_assert(is_copy_constructible<_ForwardIterator>::value,
- "Iterator has to be copy constructible");
+ static_assert(is_copy_constructible<_ForwardIterator>::value, "Iterator has to be copy constructible");
return std::__upper_bound<_ClassicAlgPolicy>(
std::move(__first), std::move(__last), __value, std::move(__comp), std::__identity());
}
@@ -56,13 +58,11 @@ upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu
template <class _ForwardIterator, class _Tp>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
- return std::upper_bound(
- std::move(__first),
- std::move(__last),
- __value,
- __less<_Tp, typename iterator_traits<_ForwardIterator>::value_type>());
+ return std::upper_bound(std::move(__first), std::move(__last), __value, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ALGORITHM_UPPER_BOUND_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__assert b/contrib/libs/cxxsupp/libcxx/include/__assert
index 9bfab8716ec..d4af7e6c719 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__assert
+++ b/contrib/libs/cxxsupp/libcxx/include/__assert
@@ -17,40 +17,21 @@
# pragma GCC system_header
#endif
-// TODO: Remove in LLVM 17.
-#if defined(_LIBCPP_DEBUG)
-# error "Defining _LIBCPP_DEBUG is not supported anymore. Please use _LIBCPP_ENABLE_DEBUG_MODE instead."
-#endif
-
-// Automatically enable assertions when the debug mode is enabled.
-#if defined(_LIBCPP_ENABLE_DEBUG_MODE)
-# ifndef _LIBCPP_ENABLE_ASSERTIONS
-# define _LIBCPP_ENABLE_ASSERTIONS 1
-# endif
-#endif
-
-#ifndef _LIBCPP_ENABLE_ASSERTIONS
-# define _LIBCPP_ENABLE_ASSERTIONS _LIBCPP_ENABLE_ASSERTIONS_DEFAULT
-#endif
-
-#if _LIBCPP_ENABLE_ASSERTIONS != 0 && _LIBCPP_ENABLE_ASSERTIONS != 1
-# error "_LIBCPP_ENABLE_ASSERTIONS must be set to 0 or 1"
-#endif
-
-#if _LIBCPP_ENABLE_ASSERTIONS
-# define _LIBCPP_ASSERT(expression, message) \
- (__builtin_expect(static_cast<bool>(expression), 1) ? \
- (void)0 : \
- _LIBCPP_VERBOSE_ABORT("%s:%d: assertion %s failed: %s", __FILE__, __LINE__, #expression, message))
-// Disable Clang builtins which nvcc does not understand
-#elif !defined(_LIBCPP_ASSERTIONS_DISABLE_ASSUME) && __has_builtin(__builtin_assume) && !defined(__CUDACC__)
-# define _LIBCPP_ASSERT(expression, message) \
- (_LIBCPP_DIAGNOSTIC_PUSH \
- _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wassume") \
- __builtin_assume(static_cast<bool>(expression)) \
- _LIBCPP_DIAGNOSTIC_POP)
+#define _LIBCPP_ASSERT(expression, message) \
+ (__builtin_expect(static_cast<bool>(expression), 1) \
+ ? (void)0 \
+ : _LIBCPP_VERBOSE_ABORT( \
+ "%s:%d: assertion %s failed: %s\n", __builtin_FILE(), __builtin_LINE(), #expression, message))
+
+// TODO: __builtin_assume can currently inhibit optimizations. Until this has been fixed and we can add
+// assumptions without a clear optimization intent, disable that to avoid worsening the code generation.
+// See https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609 for a discussion.
+#if 0 && __has_builtin(__builtin_assume)
+# define _LIBCPP_ASSUME(expression) \
+ (_LIBCPP_DIAGNOSTIC_PUSH _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wassume") \
+ __builtin_assume(static_cast<bool>(expression)) _LIBCPP_DIAGNOSTIC_POP)
#else
-# define _LIBCPP_ASSERT(expression, message) ((void)0)
+# define _LIBCPP_ASSUME(expression) ((void)0)
#endif
#endif // _LIBCPP___ASSERT
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/aliases.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/aliases.h
new file mode 100644
index 00000000000..e2f9fae4094
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/aliases.h
@@ -0,0 +1,116 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_ALIASES_H
+#define _LIBCPP___ATOMIC_ALIASES_H
+
+#include <__atomic/atomic.h>
+#include <__atomic/atomic_lock_free.h>
+#include <__atomic/contention_t.h>
+#include <__atomic/is_always_lock_free.h>
+#include <__config>
+#include <__type_traits/conditional.h>
+#include <cstddef>
+#include <cstdint>
+#include <cstdlib>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+using atomic_bool = atomic<bool>;
+using atomic_char = atomic<char>;
+using atomic_schar = atomic<signed char>;
+using atomic_uchar = atomic<unsigned char>;
+using atomic_short = atomic<short>;
+using atomic_ushort = atomic<unsigned short>;
+using atomic_int = atomic<int>;
+using atomic_uint = atomic<unsigned int>;
+using atomic_long = atomic<long>;
+using atomic_ulong = atomic<unsigned long>;
+using atomic_llong = atomic<long long>;
+using atomic_ullong = atomic<unsigned long long>;
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+using atomic_char8_t = atomic<char8_t>;
+#endif
+using atomic_char16_t = atomic<char16_t>;
+using atomic_char32_t = atomic<char32_t>;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+using atomic_wchar_t = atomic<wchar_t>;
+#endif
+
+using atomic_int_least8_t = atomic<int_least8_t>;
+using atomic_uint_least8_t = atomic<uint_least8_t>;
+using atomic_int_least16_t = atomic<int_least16_t>;
+using atomic_uint_least16_t = atomic<uint_least16_t>;
+using atomic_int_least32_t = atomic<int_least32_t>;
+using atomic_uint_least32_t = atomic<uint_least32_t>;
+using atomic_int_least64_t = atomic<int_least64_t>;
+using atomic_uint_least64_t = atomic<uint_least64_t>;
+
+using atomic_int_fast8_t = atomic<int_fast8_t>;
+using atomic_uint_fast8_t = atomic<uint_fast8_t>;
+using atomic_int_fast16_t = atomic<int_fast16_t>;
+using atomic_uint_fast16_t = atomic<uint_fast16_t>;
+using atomic_int_fast32_t = atomic<int_fast32_t>;
+using atomic_uint_fast32_t = atomic<uint_fast32_t>;
+using atomic_int_fast64_t = atomic<int_fast64_t>;
+using atomic_uint_fast64_t = atomic<uint_fast64_t>;
+
+using atomic_int8_t = atomic< int8_t>;
+using atomic_uint8_t = atomic<uint8_t>;
+using atomic_int16_t = atomic< int16_t>;
+using atomic_uint16_t = atomic<uint16_t>;
+using atomic_int32_t = atomic< int32_t>;
+using atomic_uint32_t = atomic<uint32_t>;
+using atomic_int64_t = atomic< int64_t>;
+using atomic_uint64_t = atomic<uint64_t>;
+
+using atomic_intptr_t = atomic<intptr_t>;
+using atomic_uintptr_t = atomic<uintptr_t>;
+using atomic_size_t = atomic<size_t>;
+using atomic_ptrdiff_t = atomic<ptrdiff_t>;
+using atomic_intmax_t = atomic<intmax_t>;
+using atomic_uintmax_t = atomic<uintmax_t>;
+
+// atomic_*_lock_free : prefer the contention type most highly, then the largest lock-free type
+
+#if _LIBCPP_STD_VER >= 17
+# define _LIBCPP_CONTENTION_LOCK_FREE ::std::__libcpp_is_always_lock_free<__cxx_contention_t>::__value
+#else
+# define _LIBCPP_CONTENTION_LOCK_FREE false
+#endif
+
+#if ATOMIC_LLONG_LOCK_FREE == 2
+using __libcpp_signed_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, long long>;
+using __libcpp_unsigned_lock_free =
+ __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned long long>;
+#elif ATOMIC_INT_LOCK_FREE == 2
+using __libcpp_signed_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, int>;
+using __libcpp_unsigned_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned int>;
+#elif ATOMIC_SHORT_LOCK_FREE == 2
+using __libcpp_signed_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, short>;
+using __libcpp_unsigned_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned short>;
+#elif ATOMIC_CHAR_LOCK_FREE == 2
+using __libcpp_signed_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, char>;
+using __libcpp_unsigned_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned char>;
+#else
+// No signed/unsigned lock-free types
+# define _LIBCPP_NO_LOCK_FREE_TYPES
+#endif
+
+#if !defined(_LIBCPP_NO_LOCK_FREE_TYPES)
+using atomic_signed_lock_free = atomic<__libcpp_signed_lock_free>;
+using atomic_unsigned_lock_free = atomic<__libcpp_unsigned_lock_free>;
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_ALIASES_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic.h
new file mode 100644
index 00000000000..68df7f12c1e
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic.h
@@ -0,0 +1,664 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_ATOMIC_H
+#define _LIBCPP___ATOMIC_ATOMIC_H
+
+#include <__atomic/atomic_base.h>
+#include <__atomic/check_memory_order.h>
+#include <__atomic/cxx_atomic_impl.h>
+#include <__atomic/memory_order.h>
+#include <__config>
+#include <__memory/addressof.h>
+#include <__type_traits/is_function.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/remove_pointer.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct atomic
+ : public __atomic_base<_Tp>
+{
+ using __base = __atomic_base<_Tp>;
+ using value_type = _Tp;
+ using difference_type = value_type;
+
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI
+ atomic() = default;
+#else
+ _LIBCPP_HIDE_FROM_ABI
+ atomic() _NOEXCEPT = default;
+#endif
+
+ _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator=(_Tp __d) volatile _NOEXCEPT
+ {__base::store(__d); return __d;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator=(_Tp __d) _NOEXCEPT
+ {__base::store(__d); return __d;}
+
+ atomic& operator=(const atomic&) = delete;
+ atomic& operator=(const atomic&) volatile = delete;
+};
+
+// atomic<T*>
+
+template <class _Tp>
+struct atomic<_Tp*>
+ : public __atomic_base<_Tp*>
+{
+ using __base = __atomic_base<_Tp*>;
+ using value_type = _Tp*;
+ using difference_type = ptrdiff_t;
+
+ _LIBCPP_HIDE_FROM_ABI
+ atomic() _NOEXCEPT = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {}
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator=(_Tp* __d) volatile _NOEXCEPT
+ {__base::store(__d); return __d;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator=(_Tp* __d) _NOEXCEPT
+ {__base::store(__d); return __d;}
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ // __atomic_fetch_add accepts function pointers, guard against them.
+ static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
+ return std::__cxx_atomic_fetch_add(std::addressof(this->__a_), __op, __m);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ // __atomic_fetch_add accepts function pointers, guard against them.
+ static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
+ return std::__cxx_atomic_fetch_add(std::addressof(this->__a_), __op, __m);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ // __atomic_fetch_add accepts function pointers, guard against them.
+ static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
+ return std::__cxx_atomic_fetch_sub(std::addressof(this->__a_), __op, __m);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ // __atomic_fetch_add accepts function pointers, guard against them.
+ static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
+ return std::__cxx_atomic_fetch_sub(std::addressof(this->__a_), __op, __m);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator++(int) volatile _NOEXCEPT {return fetch_add(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator++(int) _NOEXCEPT {return fetch_add(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator--(int) volatile _NOEXCEPT {return fetch_sub(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator--(int) _NOEXCEPT {return fetch_sub(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator++() volatile _NOEXCEPT {return fetch_add(1) + 1;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator++() _NOEXCEPT {return fetch_add(1) + 1;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator--() volatile _NOEXCEPT {return fetch_sub(1) - 1;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator--() _NOEXCEPT {return fetch_sub(1) - 1;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator+=(ptrdiff_t __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator+=(ptrdiff_t __op) _NOEXCEPT {return fetch_add(__op) + __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator-=(ptrdiff_t __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator-=(ptrdiff_t __op) _NOEXCEPT {return fetch_sub(__op) - __op;}
+
+ atomic& operator=(const atomic&) = delete;
+ atomic& operator=(const atomic&) volatile = delete;
+};
+
+// atomic_is_lock_free
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_is_lock_free(const volatile atomic<_Tp>* __o) _NOEXCEPT
+{
+ return __o->is_lock_free();
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT
+{
+ return __o->is_lock_free();
+}
+
+// atomic_init
+
+template <class _Tp>
+_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_HIDE_FROM_ABI
+void
+atomic_init(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ std::__cxx_atomic_init(std::addressof(__o->__a_), __d);
+}
+
+template <class _Tp>
+_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_HIDE_FROM_ABI
+void
+atomic_init(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ std::__cxx_atomic_init(std::addressof(__o->__a_), __d);
+}
+
+// atomic_store
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void
+atomic_store(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ __o->store(__d);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void
+atomic_store(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ __o->store(__d);
+}
+
+// atomic_store_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void
+atomic_store_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
+{
+ __o->store(__d, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void
+atomic_store_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
+{
+ __o->store(__d, __m);
+}
+
+// atomic_load
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_load(const volatile atomic<_Tp>* __o) _NOEXCEPT
+{
+ return __o->load();
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_load(const atomic<_Tp>* __o) _NOEXCEPT
+{
+ return __o->load();
+}
+
+// atomic_load_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+{
+ return __o->load(__m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+{
+ return __o->load(__m);
+}
+
+// atomic_exchange
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_exchange(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ return __o->exchange(__d);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_exchange(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ return __o->exchange(__d);
+}
+
+// atomic_exchange_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_exchange_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
+{
+ return __o->exchange(__d, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_exchange_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
+{
+ return __o->exchange(__d, __m);
+}
+
+// atomic_compare_exchange_weak
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ return __o->compare_exchange_weak(*__e, __d);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_weak(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ return __o->compare_exchange_weak(*__e, __d);
+}
+
+// atomic_compare_exchange_strong
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ return __o->compare_exchange_strong(*__e, __d);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_strong(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ return __o->compare_exchange_strong(*__e, __d);
+}
+
+// atomic_compare_exchange_weak_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
+ typename atomic<_Tp>::value_type __d,
+ memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+{
+ return __o->compare_exchange_weak(*__e, __d, __s, __f);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
+ memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+{
+ return __o->compare_exchange_weak(*__e, __d, __s, __f);
+}
+
+// atomic_compare_exchange_strong_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o,
+ typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
+ memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+{
+ return __o->compare_exchange_strong(*__e, __d, __s, __f);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
+ typename atomic<_Tp>::value_type __d,
+ memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+{
+ return __o->compare_exchange_strong(*__e, __d, __s, __f);
+}
+
+// atomic_wait
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_wait(const volatile atomic<_Tp>* __o,
+ typename atomic<_Tp>::value_type __v) _NOEXCEPT
+{
+ return __o->wait(__v);
+}
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_wait(const atomic<_Tp>* __o,
+ typename atomic<_Tp>::value_type __v) _NOEXCEPT
+{
+ return __o->wait(__v);
+}
+
+// atomic_wait_explicit
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_wait_explicit(const volatile atomic<_Tp>* __o,
+ typename atomic<_Tp>::value_type __v,
+ memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+{
+ return __o->wait(__v, __m);
+}
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_wait_explicit(const atomic<_Tp>* __o,
+ typename atomic<_Tp>::value_type __v,
+ memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+{
+ return __o->wait(__v, __m);
+}
+
+// atomic_notify_one
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_notify_one(volatile atomic<_Tp>* __o) _NOEXCEPT
+{
+ __o->notify_one();
+}
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT
+{
+ __o->notify_one();
+}
+
+// atomic_notify_all
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_notify_all(volatile atomic<_Tp>* __o) _NOEXCEPT
+{
+ __o->notify_all();
+}
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_notify_all(atomic<_Tp>* __o) _NOEXCEPT
+{
+ __o->notify_all();
+}
+
+// atomic_fetch_add
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_fetch_add(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
+{
+ return __o->fetch_add(__op);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_fetch_add(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
+{
+ return __o->fetch_add(__op);
+}
+
+// atomic_fetch_add_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_add(__op, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp atomic_fetch_add_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_add(__op, __m);
+}
+
+// atomic_fetch_sub
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp atomic_fetch_sub(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
+{
+ return __o->fetch_sub(__op);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp atomic_fetch_sub(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
+{
+ return __o->fetch_sub(__op);
+}
+
+// atomic_fetch_sub_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_sub(__op, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp atomic_fetch_sub_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_sub(__op, __m);
+}
+
+// atomic_fetch_and
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_and(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
+{
+ return __o->fetch_and(__op);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_and(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
+{
+ return __o->fetch_and(__op);
+}
+
+// atomic_fetch_and_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_and(__op, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_and_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_and(__op, __m);
+}
+
+// atomic_fetch_or
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_or(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
+{
+ return __o->fetch_or(__op);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_or(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
+{
+ return __o->fetch_or(__op);
+}
+
+// atomic_fetch_or_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_or(__op, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_or_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_or(__op, __m);
+}
+
+// atomic_fetch_xor
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_xor(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
+{
+ return __o->fetch_xor(__op);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_xor(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
+{
+ return __o->fetch_xor(__op);
+}
+
+// atomic_fetch_xor_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_xor(__op, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_xor_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_xor(__op, __m);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_ATOMIC_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_base.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_base.h
new file mode 100644
index 00000000000..87100ba5d8a
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_base.h
@@ -0,0 +1,232 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_ATOMIC_BASE_H
+#define _LIBCPP___ATOMIC_ATOMIC_BASE_H
+
+#include <__atomic/atomic_sync.h>
+#include <__atomic/check_memory_order.h>
+#include <__atomic/cxx_atomic_impl.h>
+#include <__atomic/is_always_lock_free.h>
+#include <__atomic/memory_order.h>
+#include <__availability>
+#include <__config>
+#include <__memory/addressof.h>
+#include <__type_traits/is_integral.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_same.h>
+#include <version>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value>
+struct __atomic_base // false
+{
+ mutable __cxx_atomic_impl<_Tp> __a_;
+
+#if _LIBCPP_STD_VER >= 17
+ static _LIBCPP_CONSTEXPR bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value;
+#endif
+
+ _LIBCPP_HIDE_FROM_ABI
+ bool is_lock_free() const volatile _NOEXCEPT
+ {return __cxx_atomic_is_lock_free(sizeof(_Tp));}
+ _LIBCPP_HIDE_FROM_ABI
+ bool is_lock_free() const _NOEXCEPT
+ {return static_cast<__atomic_base const volatile*>(this)->is_lock_free();}
+ _LIBCPP_HIDE_FROM_ABI void store(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) {
+ std::__cxx_atomic_store(std::addressof(__a_), __d, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI void store(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) {
+ std::__cxx_atomic_store(std::addressof(__a_), __d, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp load(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {
+ return std::__cxx_atomic_load(std::addressof(__a_), __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp load(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {
+ return std::__cxx_atomic_load(std::addressof(__a_), __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI
+ operator _Tp() const volatile _NOEXCEPT {return load();}
+ _LIBCPP_HIDE_FROM_ABI
+ operator _Tp() const _NOEXCEPT {return load();}
+ _LIBCPP_HIDE_FROM_ABI _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_exchange(std::addressof(__a_), __d, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_exchange(std::addressof(__a_), __d, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool
+ compare_exchange_weak(_Tp& __e, _Tp __d, memory_order __s, memory_order __f) volatile _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f) {
+ return std::__cxx_atomic_compare_exchange_weak(std::addressof(__a_), std::addressof(__e), __d, __s, __f);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool compare_exchange_weak(_Tp& __e, _Tp __d, memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f) {
+ return std::__cxx_atomic_compare_exchange_weak(std::addressof(__a_), std::addressof(__e), __d, __s, __f);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool
+ compare_exchange_strong(_Tp& __e, _Tp __d, memory_order __s, memory_order __f) volatile _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f) {
+ return std::__cxx_atomic_compare_exchange_strong(std::addressof(__a_), std::addressof(__e), __d, __s, __f);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool compare_exchange_strong(_Tp& __e, _Tp __d, memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f) {
+ return std::__cxx_atomic_compare_exchange_strong(std::addressof(__a_), std::addressof(__e), __d, __s, __f);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool
+ compare_exchange_weak(_Tp& __e, _Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_compare_exchange_weak(std::addressof(__a_), std::addressof(__e), __d, __m, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool
+ compare_exchange_weak(_Tp& __e, _Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_compare_exchange_weak(std::addressof(__a_), std::addressof(__e), __d, __m, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool
+ compare_exchange_strong(_Tp& __e, _Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_compare_exchange_strong(std::addressof(__a_), std::addressof(__e), __d, __m, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool
+ compare_exchange_strong(_Tp& __e, _Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_compare_exchange_strong(std::addressof(__a_), std::addressof(__e), __d, __m, __m);
+ }
+
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const
+ volatile _NOEXCEPT {
+ std::__cxx_atomic_wait(std::addressof(__a_), __v, __m);
+ }
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void
+ wait(_Tp __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT {
+ std::__cxx_atomic_wait(std::addressof(__a_), __v, __m);
+ }
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() volatile _NOEXCEPT {
+ std::__cxx_atomic_notify_one(std::addressof(__a_));
+ }
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() _NOEXCEPT {
+ std::__cxx_atomic_notify_one(std::addressof(__a_));
+ }
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() volatile _NOEXCEPT {
+ std::__cxx_atomic_notify_all(std::addressof(__a_));
+ }
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() _NOEXCEPT {
+ std::__cxx_atomic_notify_all(std::addressof(__a_));
+ }
+
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI constexpr
+ __atomic_base() noexcept(is_nothrow_default_constructible_v<_Tp>) : __a_(_Tp()) {}
+#else
+ _LIBCPP_HIDE_FROM_ABI
+ __atomic_base() _NOEXCEPT = default;
+#endif
+
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+ __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
+
+ __atomic_base(const __atomic_base&) = delete;
+};
+
+#if _LIBCPP_STD_VER >= 17
+template <class _Tp, bool __b>
+_LIBCPP_CONSTEXPR bool __atomic_base<_Tp, __b>::is_always_lock_free;
+#endif
+
+// atomic<Integral>
+
+template <class _Tp>
+struct __atomic_base<_Tp, true>
+ : public __atomic_base<_Tp, false>
+{
+ using __base = __atomic_base<_Tp, false>;
+
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ __atomic_base() _NOEXCEPT = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {}
+
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_fetch_add(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_fetch_add(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_fetch_sub(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_fetch_sub(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_fetch_and(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_fetch_and(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_fetch_or(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_fetch_or(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_fetch_xor(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_fetch_xor(std::addressof(this->__a_), __op, __m);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator++(int) volatile _NOEXCEPT {return fetch_add(_Tp(1));}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator++(int) _NOEXCEPT {return fetch_add(_Tp(1));}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator--(int) volatile _NOEXCEPT {return fetch_sub(_Tp(1));}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator--(int) _NOEXCEPT {return fetch_sub(_Tp(1));}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator++() volatile _NOEXCEPT {return fetch_add(_Tp(1)) + _Tp(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator++() _NOEXCEPT {return fetch_add(_Tp(1)) + _Tp(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator--() volatile _NOEXCEPT {return fetch_sub(_Tp(1)) - _Tp(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator--() _NOEXCEPT {return fetch_sub(_Tp(1)) - _Tp(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator+=(_Tp __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator+=(_Tp __op) _NOEXCEPT {return fetch_add(__op) + __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator-=(_Tp __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator-=(_Tp __op) _NOEXCEPT {return fetch_sub(__op) - __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator&=(_Tp __op) volatile _NOEXCEPT {return fetch_and(__op) & __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator&=(_Tp __op) _NOEXCEPT {return fetch_and(__op) & __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator|=(_Tp __op) volatile _NOEXCEPT {return fetch_or(__op) | __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator|=(_Tp __op) _NOEXCEPT {return fetch_or(__op) | __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator^=(_Tp __op) volatile _NOEXCEPT {return fetch_xor(__op) ^ __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator^=(_Tp __op) _NOEXCEPT {return fetch_xor(__op) ^ __op;}
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_ATOMIC_BASE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_flag.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_flag.h
new file mode 100644
index 00000000000..edfa978f993
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_flag.h
@@ -0,0 +1,230 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_ATOMIC_FLAG_H
+#define _LIBCPP___ATOMIC_ATOMIC_FLAG_H
+
+#include <__atomic/atomic_sync.h>
+#include <__atomic/contention_t.h>
+#include <__atomic/cxx_atomic_impl.h>
+#include <__atomic/memory_order.h>
+#include <__chrono/duration.h>
+#include <__config>
+#include <__threading_support>
+#include <cstdint>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+struct atomic_flag
+{
+ __cxx_atomic_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_;
+
+ _LIBCPP_HIDE_FROM_ABI
+ bool test(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
+ {return _LIBCPP_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);}
+ _LIBCPP_HIDE_FROM_ABI
+ bool test(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
+ {return _LIBCPP_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);}
+
+ _LIBCPP_HIDE_FROM_ABI
+ bool test_and_set(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);}
+ _LIBCPP_HIDE_FROM_ABI
+ bool test_and_set(memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);}
+ _LIBCPP_HIDE_FROM_ABI
+ void clear(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {__cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);}
+ _LIBCPP_HIDE_FROM_ABI
+ void clear(memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {__cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);}
+
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+ void wait(bool __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
+ {__cxx_atomic_wait(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);}
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+ void wait(bool __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT
+ {__cxx_atomic_wait(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);}
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+ void notify_one() volatile _NOEXCEPT
+ {__cxx_atomic_notify_one(&__a_);}
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+ void notify_one() _NOEXCEPT
+ {__cxx_atomic_notify_one(&__a_);}
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+ void notify_all() volatile _NOEXCEPT
+ {__cxx_atomic_notify_all(&__a_);}
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+ void notify_all() _NOEXCEPT
+ {__cxx_atomic_notify_all(&__a_);}
+
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI constexpr
+ atomic_flag() _NOEXCEPT : __a_(false) {}
+#else
+ atomic_flag() _NOEXCEPT = default;
+#endif
+
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+ atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION
+
+ atomic_flag(const atomic_flag&) = delete;
+ atomic_flag& operator=(const atomic_flag&) = delete;
+ atomic_flag& operator=(const atomic_flag&) volatile = delete;
+
+};
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test(const volatile atomic_flag* __o) _NOEXCEPT
+{
+ return __o->test();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test(const atomic_flag* __o) _NOEXCEPT
+{
+ return __o->test();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test_explicit(const volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
+{
+ return __o->test(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test_explicit(const atomic_flag* __o, memory_order __m) _NOEXCEPT
+{
+ return __o->test(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test_and_set(volatile atomic_flag* __o) _NOEXCEPT
+{
+ return __o->test_and_set();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test_and_set(atomic_flag* __o) _NOEXCEPT
+{
+ return __o->test_and_set();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test_and_set_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
+{
+ return __o->test_and_set(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test_and_set_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
+{
+ return __o->test_and_set(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+void
+atomic_flag_clear(volatile atomic_flag* __o) _NOEXCEPT
+{
+ __o->clear();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+void
+atomic_flag_clear(atomic_flag* __o) _NOEXCEPT
+{
+ __o->clear();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+void
+atomic_flag_clear_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
+{
+ __o->clear(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+void
+atomic_flag_clear_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
+{
+ __o->clear(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_wait(const volatile atomic_flag* __o, bool __v) _NOEXCEPT
+{
+ __o->wait(__v);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_wait(const atomic_flag* __o, bool __v) _NOEXCEPT
+{
+ __o->wait(__v);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_wait_explicit(const volatile atomic_flag* __o,
+ bool __v, memory_order __m) _NOEXCEPT
+{
+ __o->wait(__v, __m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_wait_explicit(const atomic_flag* __o,
+ bool __v, memory_order __m) _NOEXCEPT
+{
+ __o->wait(__v, __m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_notify_one(volatile atomic_flag* __o) _NOEXCEPT
+{
+ __o->notify_one();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_notify_one(atomic_flag* __o) _NOEXCEPT
+{
+ __o->notify_one();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_notify_all(volatile atomic_flag* __o) _NOEXCEPT
+{
+ __o->notify_all();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_notify_all(atomic_flag* __o) _NOEXCEPT
+{
+ __o->notify_all();
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_ATOMIC_FLAG_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_init.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_init.h
new file mode 100644
index 00000000000..14310aee10c
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_init.h
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_ATOMIC_INIT_H
+#define _LIBCPP___ATOMIC_ATOMIC_INIT_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#define ATOMIC_FLAG_INIT {false}
+#define ATOMIC_VAR_INIT(__v) {__v}
+
+#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
+# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1400
+# pragma clang deprecated(ATOMIC_VAR_INIT)
+# endif
+#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
+
+#endif // _LIBCPP___ATOMIC_ATOMIC_INIT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_lock_free.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_lock_free.h
new file mode 100644
index 00000000000..d607569ed07
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_lock_free.h
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_ATOMIC_LOCK_FREE_H
+#define _LIBCPP___ATOMIC_ATOMIC_LOCK_FREE_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if defined(__CLANG_ATOMIC_BOOL_LOCK_FREE)
+# define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE
+# define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+# define ATOMIC_CHAR8_T_LOCK_FREE __CLANG_ATOMIC_CHAR8_T_LOCK_FREE
+#endif
+# define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
+# define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
+# define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
+# define ATOMIC_SHORT_LOCK_FREE __CLANG_ATOMIC_SHORT_LOCK_FREE
+# define ATOMIC_INT_LOCK_FREE __CLANG_ATOMIC_INT_LOCK_FREE
+# define ATOMIC_LONG_LOCK_FREE __CLANG_ATOMIC_LONG_LOCK_FREE
+# define ATOMIC_LLONG_LOCK_FREE __CLANG_ATOMIC_LLONG_LOCK_FREE
+# define ATOMIC_POINTER_LOCK_FREE __CLANG_ATOMIC_POINTER_LOCK_FREE
+#elif defined(__GCC_ATOMIC_BOOL_LOCK_FREE)
+# define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
+# define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+# define ATOMIC_CHAR8_T_LOCK_FREE __GCC_ATOMIC_CHAR8_T_LOCK_FREE
+#endif
+# define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
+# define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
+# define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
+# define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
+# define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
+# define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
+# define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
+# define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
+#endif
+
+#endif // _LIBCPP___ATOMIC_ATOMIC_LOCK_FREE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_sync.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_sync.h
new file mode 100644
index 00000000000..d55450bb5f9
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/atomic_sync.h
@@ -0,0 +1,112 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_ATOMIC_SYNC_H
+#define _LIBCPP___ATOMIC_ATOMIC_SYNC_H
+
+#include <__atomic/contention_t.h>
+#include <__atomic/cxx_atomic_impl.h>
+#include <__atomic/memory_order.h>
+#include <__availability>
+#include <__chrono/duration.h>
+#include <__config>
+#include <__memory/addressof.h>
+#include <__thread/poll_with_backoff.h>
+#include <__threading_support>
+#include <__type_traits/decay.h>
+#include <cstring>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile*);
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile*);
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(void const volatile*);
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(void const volatile*, __cxx_contention_t);
+
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile*);
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile*);
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile*);
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(__cxx_atomic_contention_t const volatile*, __cxx_contention_t);
+
+template <class _Atp, class _Fn>
+struct __libcpp_atomic_wait_backoff_impl {
+ _Atp* __a;
+ _Fn __test_fn;
+ _LIBCPP_AVAILABILITY_SYNC
+ _LIBCPP_HIDE_FROM_ABI bool operator()(chrono::nanoseconds __elapsed) const
+ {
+ if(__elapsed > chrono::microseconds(64))
+ {
+ auto const __monitor = std::__libcpp_atomic_monitor(__a);
+ if(__test_fn())
+ return true;
+ std::__libcpp_atomic_wait(__a, __monitor);
+ }
+ else if(__elapsed > chrono::microseconds(4))
+ __libcpp_thread_yield();
+ else
+ {} // poll
+ return false;
+ }
+};
+
+template <class _Atp, class _Fn>
+_LIBCPP_AVAILABILITY_SYNC
+_LIBCPP_HIDE_FROM_ABI bool __cxx_atomic_wait(_Atp* __a, _Fn && __test_fn)
+{
+ __libcpp_atomic_wait_backoff_impl<_Atp, __decay_t<_Fn> > __backoff_fn = {__a, __test_fn};
+ return std::__libcpp_thread_poll_with_backoff(__test_fn, __backoff_fn);
+}
+
+#else // _LIBCPP_HAS_NO_THREADS
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_impl<_Tp> const volatile*) { }
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_impl<_Tp> const volatile*) { }
+template <class _Atp, class _Fn>
+_LIBCPP_HIDE_FROM_ABI bool __cxx_atomic_wait(_Atp*, _Fn && __test_fn)
+{
+ return std::__libcpp_thread_poll_with_backoff(__test_fn, __spinning_backoff_policy());
+}
+
+#endif // _LIBCPP_HAS_NO_THREADS
+
+template <typename _Tp> _LIBCPP_HIDE_FROM_ABI
+bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp const& __rhs) {
+ return std::memcmp(std::addressof(__lhs), std::addressof(__rhs), sizeof(_Tp)) == 0;
+}
+
+template <class _Atp, class _Tp>
+struct __cxx_atomic_wait_test_fn_impl {
+ _Atp* __a;
+ _Tp __val;
+ memory_order __order;
+ _LIBCPP_HIDE_FROM_ABI bool operator()() const
+ {
+ return !std::__cxx_nonatomic_compare_equal(std::__cxx_atomic_load(__a, __order), __val);
+ }
+};
+
+template <class _Atp, class _Tp>
+_LIBCPP_AVAILABILITY_SYNC
+_LIBCPP_HIDE_FROM_ABI bool __cxx_atomic_wait(_Atp* __a, _Tp const __val, memory_order __order)
+{
+ __cxx_atomic_wait_test_fn_impl<_Atp, _Tp> __test_fn = {__a, __val, __order};
+ return std::__cxx_atomic_wait(__a, __test_fn);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_ATOMIC_SYNC_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/check_memory_order.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/check_memory_order.h
new file mode 100644
index 00000000000..d744312122b
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/check_memory_order.h
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_CHECK_MEMORY_ORDER_H
+#define _LIBCPP___ATOMIC_CHECK_MEMORY_ORDER_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#define _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) \
+ _LIBCPP_DIAGNOSE_WARNING(__m == memory_order_consume || \
+ __m == memory_order_acquire || \
+ __m == memory_order_acq_rel, \
+ "memory order argument to atomic operation is invalid")
+
+#define _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) \
+ _LIBCPP_DIAGNOSE_WARNING(__m == memory_order_release || \
+ __m == memory_order_acq_rel, \
+ "memory order argument to atomic operation is invalid")
+
+#define _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__m, __f) \
+ _LIBCPP_DIAGNOSE_WARNING(__f == memory_order_release || \
+ __f == memory_order_acq_rel, \
+ "memory order argument to atomic operation is invalid")
+
+#endif // _LIBCPP___ATOMIC_CHECK_MEMORY_ORDER_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/contention_t.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/contention_t.h
new file mode 100644
index 00000000000..1d8d02430b4
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/contention_t.h
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_CONTENTION_T_H
+#define _LIBCPP___ATOMIC_CONTENTION_T_H
+
+#include <__atomic/cxx_atomic_impl.h>
+#include <__config>
+#include <cstdint>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if defined(__linux__) || (defined(_AIX) && !defined(__64BIT__))
+ using __cxx_contention_t = int32_t;
+#else
+ using __cxx_contention_t = int64_t;
+#endif // __linux__ || (_AIX && !__64BIT__)
+
+using __cxx_atomic_contention_t = __cxx_atomic_impl<__cxx_contention_t>;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_CONTENTION_T_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/cxx_atomic_impl.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/cxx_atomic_impl.h
new file mode 100644
index 00000000000..167cee7f0bd
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/cxx_atomic_impl.h
@@ -0,0 +1,831 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_CXX_ATOMIC_IMPL_H
+#define _LIBCPP___ATOMIC_CXX_ATOMIC_IMPL_H
+
+#include <__atomic/is_always_lock_free.h>
+#include <__atomic/memory_order.h>
+#include <__config>
+#include <__memory/addressof.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/is_assignable.h>
+#include <__type_traits/is_trivially_copyable.h>
+#include <__type_traits/remove_const.h>
+#include <cstddef>
+#include <cstring>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) || \
+ defined(_LIBCPP_ATOMIC_ONLY_USE_BUILTINS)
+
+// [atomics.types.generic]p1 guarantees _Tp is trivially copyable. Because
+// the default operator= in an object is not volatile, a byte-by-byte copy
+// is required.
+template <typename _Tp, typename _Tv> _LIBCPP_HIDE_FROM_ABI
+typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
+__cxx_atomic_assign_volatile(_Tp& __a_value, _Tv const& __val) {
+ __a_value = __val;
+}
+template <typename _Tp, typename _Tv> _LIBCPP_HIDE_FROM_ABI
+typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
+__cxx_atomic_assign_volatile(_Tp volatile& __a_value, _Tv volatile const& __val) {
+ volatile char* __to = reinterpret_cast<volatile char*>(std::addressof(__a_value));
+ volatile char* __end = __to + sizeof(_Tp);
+ volatile const char* __from = reinterpret_cast<volatile const char*>(std::addressof(__val));
+ while (__to != __end)
+ *__to++ = *__from++;
+}
+
+#endif
+
+#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)
+
+template <typename _Tp>
+struct __cxx_atomic_base_impl {
+
+ _LIBCPP_HIDE_FROM_ABI
+#ifndef _LIBCPP_CXX03_LANG
+ __cxx_atomic_base_impl() _NOEXCEPT = default;
+#else
+ __cxx_atomic_base_impl() _NOEXCEPT : __a_value() {}
+#endif // _LIBCPP_CXX03_LANG
+ _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp value) _NOEXCEPT
+ : __a_value(value) {}
+ _Tp __a_value;
+};
+
+_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR int __to_gcc_order(memory_order __order) {
+ // Avoid switch statement to make this a constexpr.
+ return __order == memory_order_relaxed ? __ATOMIC_RELAXED:
+ (__order == memory_order_acquire ? __ATOMIC_ACQUIRE:
+ (__order == memory_order_release ? __ATOMIC_RELEASE:
+ (__order == memory_order_seq_cst ? __ATOMIC_SEQ_CST:
+ (__order == memory_order_acq_rel ? __ATOMIC_ACQ_REL:
+ __ATOMIC_CONSUME))));
+}
+
+_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR int __to_gcc_failure_order(memory_order __order) {
+ // Avoid switch statement to make this a constexpr.
+ return __order == memory_order_relaxed ? __ATOMIC_RELAXED:
+ (__order == memory_order_acquire ? __ATOMIC_ACQUIRE:
+ (__order == memory_order_release ? __ATOMIC_RELAXED:
+ (__order == memory_order_seq_cst ? __ATOMIC_SEQ_CST:
+ (__order == memory_order_acq_rel ? __ATOMIC_ACQUIRE:
+ __ATOMIC_CONSUME))));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_init(volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp __val) {
+ __cxx_atomic_assign_volatile(__a->__a_value, __val);
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp>* __a, _Tp __val) {
+ __a->__a_value = __val;
+}
+
+_LIBCPP_HIDE_FROM_ABI inline
+void __cxx_atomic_thread_fence(memory_order __order) {
+ __atomic_thread_fence(__to_gcc_order(__order));
+}
+
+_LIBCPP_HIDE_FROM_ABI inline
+void __cxx_atomic_signal_fence(memory_order __order) {
+ __atomic_signal_fence(__to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_store(volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp __val,
+ memory_order __order) {
+ __atomic_store(std::addressof(__a->__a_value), std::addressof(__val), __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp>* __a, _Tp __val,
+ memory_order __order) {
+ __atomic_store(std::addressof(__a->__a_value), std::addressof(__val), __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_load(const volatile __cxx_atomic_base_impl<_Tp>* __a,
+ memory_order __order) {
+ _Tp __ret;
+ __atomic_load(std::addressof(__a->__a_value), std::addressof(__ret), __to_gcc_order(__order));
+ return __ret;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_load(const __cxx_atomic_base_impl<_Tp>* __a, memory_order __order) {
+ _Tp __ret;
+ __atomic_load(std::addressof(__a->__a_value), std::addressof(__ret), __to_gcc_order(__order));
+ return __ret;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_exchange(volatile __cxx_atomic_base_impl<_Tp>* __a,
+ _Tp __value, memory_order __order) {
+ _Tp __ret;
+ __atomic_exchange(
+ std::addressof(__a->__a_value), std::addressof(__value), std::addressof(__ret), __to_gcc_order(__order));
+ return __ret;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp>* __a, _Tp __value,
+ memory_order __order) {
+ _Tp __ret;
+ __atomic_exchange(
+ std::addressof(__a->__a_value), std::addressof(__value), std::addressof(__ret), __to_gcc_order(__order));
+ return __ret;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_strong(
+ volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value,
+ memory_order __success, memory_order __failure) {
+ return __atomic_compare_exchange(
+ std::addressof(__a->__a_value),
+ __expected,
+ std::addressof(__value),
+ false,
+ __to_gcc_order(__success),
+ __to_gcc_failure_order(__failure));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_strong(
+ __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success,
+ memory_order __failure) {
+ return __atomic_compare_exchange(
+ std::addressof(__a->__a_value),
+ __expected,
+ std::addressof(__value),
+ false,
+ __to_gcc_order(__success),
+ __to_gcc_failure_order(__failure));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_weak(
+ volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value,
+ memory_order __success, memory_order __failure) {
+ return __atomic_compare_exchange(
+ std::addressof(__a->__a_value),
+ __expected,
+ std::addressof(__value),
+ true,
+ __to_gcc_order(__success),
+ __to_gcc_failure_order(__failure));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_weak(
+ __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success,
+ memory_order __failure) {
+ return __atomic_compare_exchange(
+ std::addressof(__a->__a_value),
+ __expected,
+ std::addressof(__value),
+ true,
+ __to_gcc_order(__success),
+ __to_gcc_failure_order(__failure));
+}
+
+template <typename _Tp>
+struct __skip_amt { enum {value = 1}; };
+
+template <typename _Tp>
+struct __skip_amt<_Tp*> { enum {value = sizeof(_Tp)}; };
+
+// FIXME: Haven't figured out what the spec says about using arrays with
+// atomic_fetch_add. Force a failure rather than creating bad behavior.
+template <typename _Tp>
+struct __skip_amt<_Tp[]> { };
+template <typename _Tp, int n>
+struct __skip_amt<_Tp[n]> { };
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_base_impl<_Tp>* __a,
+ _Td __delta, memory_order __order) {
+ return __atomic_fetch_add(std::addressof(__a->__a_value), __delta * __skip_amt<_Tp>::value, __to_gcc_order(__order));
+}
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta,
+ memory_order __order) {
+ return __atomic_fetch_add(std::addressof(__a->__a_value), __delta * __skip_amt<_Tp>::value, __to_gcc_order(__order));
+}
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_base_impl<_Tp>* __a,
+ _Td __delta, memory_order __order) {
+ return __atomic_fetch_sub(std::addressof(__a->__a_value), __delta * __skip_amt<_Tp>::value, __to_gcc_order(__order));
+}
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta,
+ memory_order __order) {
+ return __atomic_fetch_sub(std::addressof(__a->__a_value), __delta * __skip_amt<_Tp>::value, __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_base_impl<_Tp>* __a,
+ _Tp __pattern, memory_order __order) {
+ return __atomic_fetch_and(std::addressof(__a->__a_value), __pattern, __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp>* __a,
+ _Tp __pattern, memory_order __order) {
+ return __atomic_fetch_and(std::addressof(__a->__a_value), __pattern, __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_base_impl<_Tp>* __a,
+ _Tp __pattern, memory_order __order) {
+ return __atomic_fetch_or(std::addressof(__a->__a_value), __pattern, __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern,
+ memory_order __order) {
+ return __atomic_fetch_or(std::addressof(__a->__a_value), __pattern, __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_base_impl<_Tp>* __a,
+ _Tp __pattern, memory_order __order) {
+ return __atomic_fetch_xor(std::addressof(__a->__a_value), __pattern, __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern,
+ memory_order __order) {
+ return __atomic_fetch_xor(std::addressof(__a->__a_value), __pattern, __to_gcc_order(__order));
+}
+
+#define __cxx_atomic_is_lock_free(__s) __atomic_is_lock_free(__s, 0)
+
+#elif defined(_LIBCPP_HAS_C_ATOMIC_IMP)
+
+template <typename _Tp>
+struct __cxx_atomic_base_impl {
+
+ _LIBCPP_HIDE_FROM_ABI
+#ifndef _LIBCPP_CXX03_LANG
+ __cxx_atomic_base_impl() _NOEXCEPT = default;
+#else
+ __cxx_atomic_base_impl() _NOEXCEPT : __a_value() {}
+#endif // _LIBCPP_CXX03_LANG
+ _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp __value) _NOEXCEPT
+ : __a_value(__value) {}
+ _LIBCPP_DISABLE_EXTENSION_WARNING _Atomic(_Tp) __a_value;
+};
+
+#define __cxx_atomic_is_lock_free(__s) __c11_atomic_is_lock_free(__s)
+
+_LIBCPP_HIDE_FROM_ABI inline
+void __cxx_atomic_thread_fence(memory_order __order) _NOEXCEPT {
+ __c11_atomic_thread_fence(static_cast<__memory_order_underlying_t>(__order));
+}
+
+_LIBCPP_HIDE_FROM_ABI inline
+void __cxx_atomic_signal_fence(memory_order __order) _NOEXCEPT {
+ __c11_atomic_signal_fence(static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val) _NOEXCEPT {
+ __c11_atomic_init(std::addressof(__a->__a_value), __val);
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val) _NOEXCEPT {
+ __c11_atomic_init(std::addressof(__a->__a_value), __val);
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val, memory_order __order) _NOEXCEPT {
+ __c11_atomic_store(std::addressof(__a->__a_value), __val, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val, memory_order __order) _NOEXCEPT {
+ __c11_atomic_store(std::addressof(__a->__a_value), __val, static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const volatile* __a, memory_order __order) _NOEXCEPT {
+ using __ptr_type = __remove_const_t<decltype(__a->__a_value)>*;
+ return __c11_atomic_load(
+ const_cast<__ptr_type>(std::addressof(__a->__a_value)), static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const* __a, memory_order __order) _NOEXCEPT {
+ using __ptr_type = __remove_const_t<decltype(__a->__a_value)>*;
+ return __c11_atomic_load(
+ const_cast<__ptr_type>(std::addressof(__a->__a_value)), static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __value, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_exchange(
+ std::addressof(__a->__a_value), __value, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> * __a, _Tp __value, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_exchange(
+ std::addressof(__a->__a_value), __value, static_cast<__memory_order_underlying_t>(__order));
+}
+
+_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR memory_order __to_failure_order(memory_order __order) {
+ // Avoid switch statement to make this a constexpr.
+ return __order == memory_order_release ? memory_order_relaxed:
+ (__order == memory_order_acq_rel ? memory_order_acquire:
+ __order);
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
+ return __c11_atomic_compare_exchange_strong(
+ std::addressof(__a->__a_value),
+ __expected,
+ __value,
+ static_cast<__memory_order_underlying_t>(__success),
+ static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
+ return __c11_atomic_compare_exchange_strong(
+ std::addressof(__a->__a_value),
+ __expected,
+ __value,
+ static_cast<__memory_order_underlying_t>(__success),
+ static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
+ return __c11_atomic_compare_exchange_weak(
+ std::addressof(__a->__a_value),
+ __expected,
+ __value,
+ static_cast<__memory_order_underlying_t>(__success),
+ static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
+ return __c11_atomic_compare_exchange_weak(
+ std::addressof(__a->__a_value),
+ __expected,
+ __value,
+ static_cast<__memory_order_underlying_t>(__success),
+ static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_add(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_add(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_add(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_add(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_sub(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_sub(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_sub(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_sub(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_and(
+ std::addressof(__a->__a_value), __pattern, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_and(
+ std::addressof(__a->__a_value), __pattern, static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_or(
+ std::addressof(__a->__a_value), __pattern, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_or(
+ std::addressof(__a->__a_value), __pattern, static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_xor(
+ std::addressof(__a->__a_value), __pattern, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_xor(
+ std::addressof(__a->__a_value), __pattern, static_cast<__memory_order_underlying_t>(__order));
+}
+
+#endif // _LIBCPP_HAS_GCC_ATOMIC_IMP, _LIBCPP_HAS_C_ATOMIC_IMP
+
+#ifdef _LIBCPP_ATOMIC_ONLY_USE_BUILTINS
+
+template<typename _Tp>
+struct __cxx_atomic_lock_impl {
+
+ _LIBCPP_HIDE_FROM_ABI
+ __cxx_atomic_lock_impl() _NOEXCEPT
+ : __a_value(), __a_lock(0) {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit
+ __cxx_atomic_lock_impl(_Tp value) _NOEXCEPT
+ : __a_value(value), __a_lock(0) {}
+
+ _Tp __a_value;
+ mutable __cxx_atomic_base_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_lock;
+
+ _LIBCPP_HIDE_FROM_ABI void __lock() const volatile {
+ while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(true), memory_order_acquire))
+ /*spin*/;
+ }
+ _LIBCPP_HIDE_FROM_ABI void __lock() const {
+ while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(true), memory_order_acquire))
+ /*spin*/;
+ }
+ _LIBCPP_HIDE_FROM_ABI void __unlock() const volatile {
+ __cxx_atomic_store(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(false), memory_order_release);
+ }
+ _LIBCPP_HIDE_FROM_ABI void __unlock() const {
+ __cxx_atomic_store(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(false), memory_order_release);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp __read() const volatile {
+ __lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a_value);
+ __unlock();
+ return __old;
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp __read() const {
+ __lock();
+ _Tp __old = __a_value;
+ __unlock();
+ return __old;
+ }
+};
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_init(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __val) {
+ __cxx_atomic_assign_volatile(__a->__a_value, __val);
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_init(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __val) {
+ __a->__a_value = __val;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_store(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __val, memory_order) {
+ __a->__lock();
+ __cxx_atomic_assign_volatile(__a->__a_value, __val);
+ __a->__unlock();
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_store(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __val, memory_order) {
+ __a->__lock();
+ __a->__a_value = __val;
+ __a->__unlock();
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_load(const volatile __cxx_atomic_lock_impl<_Tp>* __a, memory_order) {
+ return __a->__read();
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_load(const __cxx_atomic_lock_impl<_Tp>* __a, memory_order) {
+ return __a->__read();
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_exchange(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __value, memory_order) {
+ __a->__lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, __value);
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_exchange(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __value, memory_order) {
+ __a->__lock();
+ _Tp __old = __a->__a_value;
+ __a->__a_value = __value;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_strong(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp* __expected, _Tp __value, memory_order, memory_order) {
+ _Tp __temp;
+ __a->__lock();
+ __cxx_atomic_assign_volatile(__temp, __a->__a_value);
+ bool __ret = (std::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
+ if(__ret)
+ __cxx_atomic_assign_volatile(__a->__a_value, __value);
+ else
+ __cxx_atomic_assign_volatile(*__expected, __a->__a_value);
+ __a->__unlock();
+ return __ret;
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp* __expected, _Tp __value, memory_order, memory_order) {
+ __a->__lock();
+ bool __ret = (std::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
+ if(__ret)
+ std::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
+ else
+ std::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
+ __a->__unlock();
+ return __ret;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_weak(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp* __expected, _Tp __value, memory_order, memory_order) {
+ _Tp __temp;
+ __a->__lock();
+ __cxx_atomic_assign_volatile(__temp, __a->__a_value);
+ bool __ret = (std::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
+ if(__ret)
+ __cxx_atomic_assign_volatile(__a->__a_value, __value);
+ else
+ __cxx_atomic_assign_volatile(*__expected, __a->__a_value);
+ __a->__unlock();
+ return __ret;
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp* __expected, _Tp __value, memory_order, memory_order) {
+ __a->__lock();
+ bool __ret = (std::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
+ if(__ret)
+ std::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
+ else
+ std::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
+ __a->__unlock();
+ return __ret;
+}
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Td __delta, memory_order) {
+ __a->__lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old + __delta));
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Td __delta, memory_order) {
+ __a->__lock();
+ _Tp __old = __a->__a_value;
+ __a->__a_value += __delta;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp* __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp*>* __a,
+ ptrdiff_t __delta, memory_order) {
+ __a->__lock();
+ _Tp* __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, __old + __delta);
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp* __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp*>* __a,
+ ptrdiff_t __delta, memory_order) {
+ __a->__lock();
+ _Tp* __old = __a->__a_value;
+ __a->__a_value += __delta;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Td __delta, memory_order) {
+ __a->__lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old - __delta));
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_sub(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Td __delta, memory_order) {
+ __a->__lock();
+ _Tp __old = __a->__a_value;
+ __a->__a_value -= __delta;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp __pattern, memory_order) {
+ __a->__lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old & __pattern));
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_and(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp __pattern, memory_order) {
+ __a->__lock();
+ _Tp __old = __a->__a_value;
+ __a->__a_value &= __pattern;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp __pattern, memory_order) {
+ __a->__lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old | __pattern));
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_or(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp __pattern, memory_order) {
+ __a->__lock();
+ _Tp __old = __a->__a_value;
+ __a->__a_value |= __pattern;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp __pattern, memory_order) {
+ __a->__lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old ^ __pattern));
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_xor(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp __pattern, memory_order) {
+ __a->__lock();
+ _Tp __old = __a->__a_value;
+ __a->__a_value ^= __pattern;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp,
+ typename _Base = typename conditional<__libcpp_is_always_lock_free<_Tp>::__value,
+ __cxx_atomic_base_impl<_Tp>,
+ __cxx_atomic_lock_impl<_Tp> >::type>
+#else
+template <typename _Tp,
+ typename _Base = __cxx_atomic_base_impl<_Tp> >
+#endif //_LIBCPP_ATOMIC_ONLY_USE_BUILTINS
+struct __cxx_atomic_impl : public _Base {
+ static_assert(is_trivially_copyable<_Tp>::value,
+ "std::atomic<T> requires that 'T' be a trivially copyable type");
+
+ _LIBCPP_HIDE_FROM_ABI __cxx_atomic_impl() _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __cxx_atomic_impl(_Tp __value) _NOEXCEPT
+ : _Base(__value) {}
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_CXX_ATOMIC_IMPL_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/fence.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/fence.h
new file mode 100644
index 00000000000..c62f38f2115
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/fence.h
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_FENCE_H
+#define _LIBCPP___ATOMIC_FENCE_H
+
+#include <__atomic/cxx_atomic_impl.h>
+#include <__atomic/memory_order.h>
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+inline _LIBCPP_HIDE_FROM_ABI
+void
+atomic_thread_fence(memory_order __m) _NOEXCEPT
+{
+ __cxx_atomic_thread_fence(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+void
+atomic_signal_fence(memory_order __m) _NOEXCEPT
+{
+ __cxx_atomic_signal_fence(__m);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_FENCE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/is_always_lock_free.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/is_always_lock_free.h
new file mode 100644
index 00000000000..fbbd4370749
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/is_always_lock_free.h
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_IS_ALWAYS_LOCK_FREE_H
+#define _LIBCPP___ATOMIC_IS_ALWAYS_LOCK_FREE_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct __libcpp_is_always_lock_free {
+ // __atomic_always_lock_free is available in all Standard modes
+ static const bool __value = __atomic_always_lock_free(sizeof(_Tp), 0);
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_IS_ALWAYS_LOCK_FREE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/kill_dependency.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/kill_dependency.h
new file mode 100644
index 00000000000..1bd5c8ca765
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/kill_dependency.h
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_KILL_DEPENDENCY_H
+#define _LIBCPP___ATOMIC_KILL_DEPENDENCY_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp kill_dependency(_Tp __y) _NOEXCEPT
+{
+ return __y;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_KILL_DEPENDENCY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__atomic/memory_order.h b/contrib/libs/cxxsupp/libcxx/include/__atomic/memory_order.h
new file mode 100644
index 00000000000..3671dc3cf9b
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__atomic/memory_order.h
@@ -0,0 +1,72 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ATOMIC_MEMORY_ORDER_H
+#define _LIBCPP___ATOMIC_MEMORY_ORDER_H
+
+#include <__config>
+#include <__type_traits/is_same.h>
+#include <__type_traits/underlying_type.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// Figure out what the underlying type for `memory_order` would be if it were
+// declared as an unscoped enum (accounting for -fshort-enums). Use this result
+// to pin the underlying type in C++20.
+enum __legacy_memory_order {
+ __mo_relaxed,
+ __mo_consume,
+ __mo_acquire,
+ __mo_release,
+ __mo_acq_rel,
+ __mo_seq_cst
+};
+
+using __memory_order_underlying_t = underlying_type<__legacy_memory_order>::type;
+
+#if _LIBCPP_STD_VER >= 20
+
+enum class memory_order : __memory_order_underlying_t {
+ relaxed = __mo_relaxed,
+ consume = __mo_consume,
+ acquire = __mo_acquire,
+ release = __mo_release,
+ acq_rel = __mo_acq_rel,
+ seq_cst = __mo_seq_cst
+};
+
+static_assert((is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value),
+ "unexpected underlying type for std::memory_order");
+
+inline constexpr auto memory_order_relaxed = memory_order::relaxed;
+inline constexpr auto memory_order_consume = memory_order::consume;
+inline constexpr auto memory_order_acquire = memory_order::acquire;
+inline constexpr auto memory_order_release = memory_order::release;
+inline constexpr auto memory_order_acq_rel = memory_order::acq_rel;
+inline constexpr auto memory_order_seq_cst = memory_order::seq_cst;
+
+#else
+
+enum memory_order {
+ memory_order_relaxed = __mo_relaxed,
+ memory_order_consume = __mo_consume,
+ memory_order_acquire = __mo_acquire,
+ memory_order_release = __mo_release,
+ memory_order_acq_rel = __mo_acq_rel,
+ memory_order_seq_cst = __mo_seq_cst,
+};
+
+#endif // _LIBCPP_STD_VER >= 20
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_MEMORY_ORDER_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__availability b/contrib/libs/cxxsupp/libcxx/include/__availability
index 6dfca3fa8b1..7807f22b716 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__availability
+++ b/contrib/libs/cxxsupp/libcxx/include/__availability
@@ -39,17 +39,23 @@
//
// This mechanism is general in nature, and any vendor can add their markup to
// the library (see below). Whenever a new feature is added that requires support
-// in the shared library, a macro should be added below to mark this feature
-// as unavailable. When vendors decide to ship the feature as part of their
-// shared library, they can update the markup appropriately.
+// in the shared library, two macros are added below to allow marking the feature
+// as unavailable:
+// 1. A macro named `_LIBCPP_AVAILABILITY_HAS_NO_<feature>` which must be defined
+// exactly when compiling for a target that doesn't support the feature.
+// 2. A macro named `_LIBCPP_AVAILABILITY_<feature>`, which must always be defined
+// and must expand to the proper availability attribute for the platform.
+//
+// When vendors decide to ship the feature as part of their shared library, they
+// can update these macros appropriately for their platform, and the library will
+// use those to provide an optimal user experience.
//
// Furthermore, many features in the standard library have corresponding
-// feature-test macros. When a feature is made unavailable on some deployment
-// target, a macro should be defined to signal that it is unavailable. That
-// macro can then be picked up when feature-test macros are generated (see
-// generate_feature_test_macro_components.py) to make sure that feature-test
-// macros don't announce a feature as being implemented if it has been marked
-// as unavailable.
+// feature-test macros. The `_LIBCPP_AVAILABILITY_HAS_NO_<feature>` macros
+// are checked by the corresponding feature-test macros generated by
+// generate_feature_test_macro_components.py to ensure that the library
+// doesn't announce a feature as being implemented if it is unavailable on
+// the deployment target.
//
// Note that this mechanism is disabled by default in the "upstream" libc++.
// Availability annotations are only meaningful when shipping libc++ inside
@@ -83,9 +89,8 @@
// This controls the availability of std::shared_mutex and std::shared_timed_mutex,
// which were added to the dylib later.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX
# define _LIBCPP_AVAILABILITY_SHARED_MUTEX
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex
// These macros control the availability of std::bad_optional_access and
// other exception types. These were put in the shared library to prevent
@@ -95,16 +100,23 @@
// Note that when exceptions are disabled, the methods that normally throw
// these exceptions can be used even on older deployment targets, but those
// methods will abort instead of throwing.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_BAD_OPTIONAL_ACCESS
# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+
+// # define _LIBCPP_AVAILABILITY_HAS_NO_BAD_VARIANT_ACCESS
# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
+
+// # define _LIBCPP_AVAILABILITY_HAS_NO_BAD_ANY_CAST
# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
// This controls the availability of std::uncaught_exceptions().
+// # define _LIBCPP_AVAILABILITY_HAS_NO_UNCAUGHT_EXCEPTIONS
# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
// This controls the availability of the sized version of ::operator delete,
// ::operator delete[], and their align_val_t variants, which were all added
// in C++17, and hence not present in early dylibs.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_SIZED_NEW_DELETE
# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
// This controls the availability of the std::future_error exception.
@@ -112,73 +124,83 @@
// Note that when exceptions are disabled, the methods that normally throw
// std::future_error can be used even on older deployment targets, but those
// methods will abort instead of throwing.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_FUTURE_ERROR
# define _LIBCPP_AVAILABILITY_FUTURE_ERROR
// This controls the availability of std::type_info's vtable.
// I can't imagine how using std::type_info can work at all if
// this isn't supported.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_TYPEINFO_VTABLE
# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
// This controls the availability of std::locale::category members
// (e.g. std::locale::collate), which are defined in the dylib.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_LOCALE_CATEGORY
# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
// This controls the availability of atomic operations on std::shared_ptr
// (e.g. `std::atomic_store(std::shared_ptr)`), which require a shared
// lock table located in the dylib.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_ATOMIC_SHARED_PTR
# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
// These macros control the availability of all parts of <filesystem> that
// depend on something in the dylib.
-# define _LIBCPP_AVAILABILITY_FILESYSTEM
-# define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-# define _LIBCPP_AVAILABILITY_FILESYSTEM_POP
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem
+// # define _LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM_LIBRARY
+# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY
+# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
+# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
// This controls the availability of floating-point std::to_chars functions.
// These overloads were added later than the integer overloads.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_TO_CHARS_FLOATING_POINT
# define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT
// This controls the availability of the C++20 synchronization library,
// which requires shared library support for various operations
// (see libcxx/src/atomic.cpp). This includes <barier>, <latch>,
// <semaphore>, and notification functions on std::atomic.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_SYNC
# define _LIBCPP_AVAILABILITY_SYNC
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
-
- // This controls the availability of the C++20 format library.
- // The library is in development and not ABI stable yet. P2216 is
- // retroactively accepted in C++20. This paper contains ABI breaking
- // changes.
-# define _LIBCPP_AVAILABILITY_FORMAT
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format
// This controls whether the library claims to provide a default verbose
// termination function, and consequently whether the headers will try
// to use it when the mechanism isn't overriden at compile-time.
-// # define _LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY
+// # define _LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT
+# define _LIBCPP_AVAILABILITY_VERBOSE_ABORT
+
+ // This controls the availability of the C++17 std::pmr library,
+ // which is implemented in large part in the built library.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_PMR
+# define _LIBCPP_AVAILABILITY_PMR
#elif defined(__APPLE__)
-# define _LIBCPP_AVAILABILITY_SHARED_MUTEX \
- __attribute__((availability(macos,strict,introduced=10.12))) \
- __attribute__((availability(ios,strict,introduced=10.0))) \
- __attribute__((availability(tvos,strict,introduced=10.0))) \
- __attribute__((availability(watchos,strict,introduced=3.0)))
+ // shared_mutex and shared_timed_mutex
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
(defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex
+# define _LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX
# endif
+# define _LIBCPP_AVAILABILITY_SHARED_MUTEX \
+ __attribute__((availability(macos,strict,introduced=10.12))) \
+ __attribute__((availability(ios,strict,introduced=10.0))) \
+ __attribute__((availability(tvos,strict,introduced=10.0))) \
+ __attribute__((availability(watchos,strict,introduced=3.0)))
+ // bad_optional_access, bad_variant_access and bad_any_cast
// Note: bad_optional_access & friends were not introduced in the matching
// macOS and iOS versions, so the version mismatch between macOS and others
// is intended.
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101300) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 120000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 120000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 50000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_OPTIONAL_ACCESS
+# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_VARIANT_ACCESS
+# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_ANY_CAST
+# endif
# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS \
__attribute__((availability(macos,strict,introduced=10.13))) \
__attribute__((availability(ios,strict,introduced=12.0))) \
@@ -189,78 +211,142 @@
# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST \
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+ // uncaught_exceptions
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_UNCAUGHT_EXCEPTIONS
+# endif
# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
__attribute__((availability(macos,strict,introduced=10.12))) \
__attribute__((availability(ios,strict,introduced=10.0))) \
__attribute__((availability(tvos,strict,introduced=10.0))) \
__attribute__((availability(watchos,strict,introduced=3.0)))
+ // sized operator new and sized operator delete
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_SIZED_NEW_DELETE
+# endif
# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE \
__attribute__((availability(macos,strict,introduced=10.12))) \
__attribute__((availability(ios,strict,introduced=10.0))) \
__attribute__((availability(tvos,strict,introduced=10.0))) \
__attribute__((availability(watchos,strict,introduced=3.0)))
+ // future_error
+# if (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 60000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_FUTURE_ERROR
+# endif
# define _LIBCPP_AVAILABILITY_FUTURE_ERROR \
__attribute__((availability(ios,strict,introduced=6.0)))
+ // type_info's vtable
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 100900) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_TYPEINFO_VTABLE
+# endif
# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE \
__attribute__((availability(macos,strict,introduced=10.9))) \
__attribute__((availability(ios,strict,introduced=7.0)))
+ // locale::category
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 100900) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_LOCALE_CATEGORY
+# endif
# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY \
__attribute__((availability(macos,strict,introduced=10.9))) \
__attribute__((availability(ios,strict,introduced=7.0)))
+ // atomic operations on shared_ptr
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 100900) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_ATOMIC_SHARED_PTR
+# endif
# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
__attribute__((availability(macos,strict,introduced=10.9))) \
__attribute__((availability(ios,strict,introduced=7.0)))
-# define _LIBCPP_AVAILABILITY_FILESYSTEM \
+ // <filesystem>
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM_LIBRARY
+# endif
+# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY \
__attribute__((availability(macos,strict,introduced=10.15))) \
__attribute__((availability(ios,strict,introduced=13.0))) \
__attribute__((availability(tvos,strict,introduced=13.0))) \
__attribute__((availability(watchos,strict,introduced=6.0)))
-# define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH \
+# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH \
_Pragma("clang attribute push(__attribute__((availability(macos,strict,introduced=10.15))), apply_to=any(function,record))") \
_Pragma("clang attribute push(__attribute__((availability(ios,strict,introduced=13.0))), apply_to=any(function,record))") \
_Pragma("clang attribute push(__attribute__((availability(tvos,strict,introduced=13.0))), apply_to=any(function,record))") \
_Pragma("clang attribute push(__attribute__((availability(watchos,strict,introduced=6.0))), apply_to=any(function,record))")
-# define _LIBCPP_AVAILABILITY_FILESYSTEM_POP \
+# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP \
_Pragma("clang attribute pop") \
_Pragma("clang attribute pop") \
_Pragma("clang attribute pop") \
_Pragma("clang attribute pop")
-# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \
- (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \
- (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) || \
- (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000)
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem
-# endif
+ // std::to_chars(floating-point)
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 130300) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 160300) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 160300) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 90300)
+# define _LIBCPP_AVAILABILITY_HAS_NO_TO_CHARS_FLOATING_POINT
+# endif
# define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT \
- __attribute__((unavailable))
+ __attribute__((availability(macos,strict,introduced=13.3))) \
+ __attribute__((availability(ios,strict,introduced=16.3))) \
+ __attribute__((availability(tvos,strict,introduced=16.3))) \
+ __attribute__((availability(watchos,strict,introduced=9.3)))
-# define _LIBCPP_AVAILABILITY_SYNC \
- __attribute__((availability(macos,strict,introduced=11.0))) \
- __attribute__((availability(ios,strict,introduced=14.0))) \
- __attribute__((availability(tvos,strict,introduced=14.0))) \
- __attribute__((availability(watchos,strict,introduced=7.0)))
+ // c++20 synchronization library
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000) || \
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000) || \
(defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 140000) || \
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000)
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
+# define _LIBCPP_AVAILABILITY_HAS_NO_SYNC
# endif
+# define _LIBCPP_AVAILABILITY_SYNC \
+ __attribute__((availability(macos,strict,introduced=11.0))) \
+ __attribute__((availability(ios,strict,introduced=14.0))) \
+ __attribute__((availability(tvos,strict,introduced=14.0))) \
+ __attribute__((availability(watchos,strict,introduced=7.0)))
-# define _LIBCPP_AVAILABILITY_FORMAT \
+ // __libcpp_verbose_abort
+# if 1 // TODO: Update once this is released
+# define _LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT
+# endif
+# define _LIBCPP_AVAILABILITY_VERBOSE_ABORT \
__attribute__((unavailable))
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format
-# define _LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY
+ // std::pmr
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 140000) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 170000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 170000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 100000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_PMR
+# endif
+// TODO: Enable std::pmr markup once https://github.com/llvm/llvm-project/issues/40340 has been fixed
+// Until then, it is possible for folks to try to use `std::pmr` when back-deploying to targets that don't support
+// it and it'll be a load-time error, but we don't have a good alternative because the library won't compile if we
+// use availability annotations until that bug has been fixed.
+# if 0
+# define _LIBCPP_AVAILABILITY_PMR \
+ __attribute__((availability(macos, strict, introduced = 14.0))) \
+ __attribute__((availability(ios, strict, introduced = 17.0))) \
+ __attribute__((availability(tvos, strict, introduced = 17.0))) \
+ __attribute__((availability(watchos, strict, introduced = 10.0)))
+# else
+# define _LIBCPP_AVAILABILITY_PMR
+# endif
#else
@@ -270,10 +356,10 @@
#endif
-// Define availability attributes that depend on _LIBCPP_NO_EXCEPTIONS.
+// Define availability attributes that depend on _LIBCPP_HAS_NO_EXCEPTIONS.
// Those are defined in terms of the availability attributes above, and
// should not be vendor-specific.
-#if defined(_LIBCPP_NO_EXCEPTIONS)
+#if defined(_LIBCPP_HAS_NO_EXCEPTIONS)
# define _LIBCPP_AVAILABILITY_FUTURE
# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_cast.h b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_cast.h
index 2ca4120c763..39842465e12 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_cast.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_cast.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _ToType, class _FromType>
requires(sizeof(_ToType) == sizeof(_FromType) &&
@@ -29,7 +29,7 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _ToType bit_cast(const _Fr
return __builtin_bit_cast(_ToType, __from);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_ceil.h b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_ceil.h
index a558d619427..706d446359d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_ceil.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_ceil.h
@@ -24,18 +24,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 20
template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_ceil(_Tp __t) noexcept {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_ceil(_Tp __t) noexcept {
if (__t < 2)
return 1;
const unsigned __n = numeric_limits<_Tp>::digits - std::countl_zero((_Tp)(__t - 1u));
- _LIBCPP_ASSERT(__n != numeric_limits<_Tp>::digits, "Bad input to bit_ceil");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n != numeric_limits<_Tp>::digits, "Bad input to bit_ceil");
if constexpr (sizeof(_Tp) >= sizeof(unsigned))
return _Tp{1} << __n;
else {
const unsigned __extra = numeric_limits<unsigned>::digits - numeric_limits<_Tp>::digits;
- const unsigned __retVal = 1u << (__n + __extra);
- return (_Tp)(__retVal >> __extra);
+ const unsigned __ret_val = 1u << (__n + __extra);
+ return (_Tp)(__ret_val >> __extra);
}
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_floor.h b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_floor.h
index b2e38092f2d..cf5cf5803ad 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_floor.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_floor.h
@@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 20
template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_floor(_Tp __t) noexcept {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_floor(_Tp __t) noexcept {
return __t == 0 ? 0 : _Tp{1} << std::__bit_log2(__t);
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_width.h b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_width.h
index 4381f227f5e..a2020a01421 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__bit/bit_width.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__bit/bit_width.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr int bit_width(_Tp __t) noexcept {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr int bit_width(_Tp __t) noexcept {
return __t == 0 ? 0 : std::__bit_log2(__t) + 1;
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/byteswap.h b/contrib/libs/cxxsupp/libcxx/include/__bit/byteswap.h
index 6fa8d48bafa..a1e1b530975 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__bit/byteswap.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__bit/byteswap.h
@@ -13,7 +13,6 @@
#include <__concepts/arithmetic.h>
#include <__config>
#include <cstdint>
-#include <cstdlib>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -21,10 +20,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <integral _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {
if constexpr (sizeof(_Tp) == 1) {
return __val;
@@ -48,7 +47,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {
}
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/countl.h b/contrib/libs/cxxsupp/libcxx/include/__bit/countl.h
index 86eaee0c1b3..5d5744ac9a6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__bit/countl.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__bit/countl.h
@@ -24,13 +24,13 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
int __libcpp_clz(unsigned __x) _NOEXCEPT { return __builtin_clz(__x); }
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
int __libcpp_clz(unsigned long __x) _NOEXCEPT { return __builtin_clzl(__x); }
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
int __libcpp_clz(unsigned long long __x) _NOEXCEPT { return __builtin_clzll(__x); }
# ifndef _LIBCPP_HAS_NO_INT128
@@ -86,12 +86,12 @@ int __countl_zero(_Tp __t) _NOEXCEPT
#if _LIBCPP_STD_VER >= 20
template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr int countl_zero(_Tp __t) noexcept {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr int countl_zero(_Tp __t) noexcept {
return std::__countl_zero(__t);
}
template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr int countl_one(_Tp __t) noexcept {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr int countl_one(_Tp __t) noexcept {
return __t != numeric_limits<_Tp>::max() ? std::countl_zero(static_cast<_Tp>(~__t)) : numeric_limits<_Tp>::digits;
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/countr.h b/contrib/libs/cxxsupp/libcxx/include/__bit/countr.h
index d3ca5b6c94f..66ca5e7e66f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__bit/countr.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__bit/countr.h
@@ -23,19 +23,19 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
int __libcpp_ctz(unsigned __x) _NOEXCEPT { return __builtin_ctz(__x); }
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
int __libcpp_ctz(unsigned long __x) _NOEXCEPT { return __builtin_ctzl(__x); }
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
int __libcpp_ctz(unsigned long long __x) _NOEXCEPT { return __builtin_ctzll(__x); }
#if _LIBCPP_STD_VER >= 20
template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr int countr_zero(_Tp __t) noexcept {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr int countr_zero(_Tp __t) noexcept {
if (__t == 0)
return numeric_limits<_Tp>::digits;
@@ -57,7 +57,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr int countr_zero(_Tp __t) noexcept {
}
template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr int countr_one(_Tp __t) noexcept {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr int countr_one(_Tp __t) noexcept {
return __t != numeric_limits<_Tp>::max() ? std::countr_zero(static_cast<_Tp>(~__t)) : numeric_limits<_Tp>::digits;
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/has_single_bit.h b/contrib/libs/cxxsupp/libcxx/include/__bit/has_single_bit.h
index b89f5995b32..a4e178060a7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__bit/has_single_bit.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__bit/has_single_bit.h
@@ -24,7 +24,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr bool has_single_bit(_Tp __t) noexcept {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool has_single_bit(_Tp __t) noexcept {
return __t != 0 && (((__t & (__t - 1)) == 0));
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/popcount.h b/contrib/libs/cxxsupp/libcxx/include/__bit/popcount.h
index 33b94cff712..62f4786bcea 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__bit/popcount.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__bit/popcount.h
@@ -35,7 +35,7 @@ int __libcpp_popcount(unsigned long long __x) _NOEXCEPT { return __builtin_popco
#if _LIBCPP_STD_VER >= 20
template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr int popcount(_Tp __t) noexcept {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr int popcount(_Tp __t) noexcept {
if (sizeof(_Tp) <= sizeof(unsigned int))
return std::__libcpp_popcount(static_cast<unsigned int>(__t));
else if (sizeof(_Tp) <= sizeof(unsigned long))
diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit/rotate.h b/contrib/libs/cxxsupp/libcxx/include/__bit/rotate.h
index 5aa7518b3c5..e9f4c8d474b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__bit/rotate.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__bit/rotate.h
@@ -34,7 +34,7 @@ _Tp __rotr(_Tp __t, unsigned int __cnt) _NOEXCEPT
#if _LIBCPP_STD_VER >= 20
template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp rotl(_Tp __t, unsigned int __cnt) noexcept {
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotl(_Tp __t, unsigned int __cnt) noexcept {
const unsigned int __dig = numeric_limits<_Tp>::digits;
if ((__cnt % __dig) == 0)
return __t;
@@ -42,7 +42,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotl(_Tp __t, unsigned int __cnt) noexcept {
}
template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp rotr(_Tp __t, unsigned int __cnt) noexcept {
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotr(_Tp __t, unsigned int __cnt) noexcept {
return std::__rotr(__t, __cnt);
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__bit_reference b/contrib/libs/cxxsupp/libcxx/include/__bit_reference
index 5cfa8ecee12..0563c3e6198 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__bit_reference
+++ b/contrib/libs/cxxsupp/libcxx/include/__bit_reference
@@ -19,8 +19,9 @@
#include <__iterator/iterator_traits.h>
#include <__memory/construct_at.h>
#include <__memory/pointer_traits.h>
+#include <__type_traits/conditional.h>
+#include <__utility/swap.h>
#include <cstring>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -75,7 +76,7 @@ public:
return *this;
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr const __bit_reference& operator=(bool __x) const noexcept {
if (__x)
*__seg_ |= __mask_;
@@ -155,6 +156,8 @@ class __bit_const_reference
friend typename _Cp::__self;
friend class __bit_iterator<_Cp, true>;
public:
+ using __container = typename _Cp::__self;
+
_LIBCPP_INLINE_VISIBILITY
__bit_const_reference(const __bit_const_reference&) = default;
@@ -728,12 +731,12 @@ move_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsCons
// swap_ranges
-template <class __C1, class __C2>
-_LIBCPP_HIDE_FROM_ABI __bit_iterator<__C2, false>
-__swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last,
- __bit_iterator<__C2, false> __result)
+template <class _Cl, class _Cr>
+_LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cr, false>
+__swap_ranges_aligned(__bit_iterator<_Cl, false> __first, __bit_iterator<_Cl, false> __last,
+ __bit_iterator<_Cr, false> __result)
{
- typedef __bit_iterator<__C1, false> _I1;
+ typedef __bit_iterator<_Cl, false> _I1;
typedef typename _I1::difference_type difference_type;
typedef typename _I1::__storage_type __storage_type;
const int __bits_per_word = _I1::__bits_per_word;
@@ -778,12 +781,12 @@ __swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1,
return __result;
}
-template <class __C1, class __C2>
-_LIBCPP_HIDE_FROM_ABI __bit_iterator<__C2, false>
-__swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last,
- __bit_iterator<__C2, false> __result)
+template <class _Cl, class _Cr>
+_LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cr, false>
+__swap_ranges_unaligned(__bit_iterator<_Cl, false> __first, __bit_iterator<_Cl, false> __last,
+ __bit_iterator<_Cr, false> __result)
{
- typedef __bit_iterator<__C1, false> _I1;
+ typedef __bit_iterator<_Cl, false> _I1;
typedef typename _I1::difference_type difference_type;
typedef typename _I1::__storage_type __storage_type;
const int __bits_per_word = _I1::__bits_per_word;
@@ -878,11 +881,11 @@ __swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1
return __result;
}
-template <class __C1, class __C2>
+template <class _Cl, class _Cr>
inline _LIBCPP_INLINE_VISIBILITY
-__bit_iterator<__C2, false>
-swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __last1,
- __bit_iterator<__C2, false> __first2)
+__bit_iterator<_Cr, false>
+swap_ranges(__bit_iterator<_Cl, false> __first1, __bit_iterator<_Cl, false> __last1,
+ __bit_iterator<_Cr, false> __first2)
{
if (__first1.__ctz_ == __first2.__ctz_)
return _VSTD::__swap_ranges_aligned(__first1, __last1, __first2);
@@ -1135,7 +1138,7 @@ private:
public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
: __seg_(nullptr), __ctz_(0)
#endif
{}
@@ -1311,15 +1314,15 @@ private:
friend __bit_iterator<_Dp, false> copy_backward(__bit_iterator<_Dp, _IC> __first,
__bit_iterator<_Dp, _IC> __last,
__bit_iterator<_Dp, false> __result);
- template <class __C1, class __C2>friend __bit_iterator<__C2, false> __swap_ranges_aligned(__bit_iterator<__C1, false>,
- __bit_iterator<__C1, false>,
- __bit_iterator<__C2, false>);
- template <class __C1, class __C2>friend __bit_iterator<__C2, false> __swap_ranges_unaligned(__bit_iterator<__C1, false>,
- __bit_iterator<__C1, false>,
- __bit_iterator<__C2, false>);
- template <class __C1, class __C2>friend __bit_iterator<__C2, false> swap_ranges(__bit_iterator<__C1, false>,
- __bit_iterator<__C1, false>,
- __bit_iterator<__C2, false>);
+ template <class _Cl, class _Cr>friend __bit_iterator<_Cr, false> __swap_ranges_aligned(__bit_iterator<_Cl, false>,
+ __bit_iterator<_Cl, false>,
+ __bit_iterator<_Cr, false>);
+ template <class _Cl, class _Cr>friend __bit_iterator<_Cr, false> __swap_ranges_unaligned(__bit_iterator<_Cl, false>,
+ __bit_iterator<_Cl, false>,
+ __bit_iterator<_Cr, false>);
+ template <class _Cl, class _Cr>friend __bit_iterator<_Cr, false> swap_ranges(__bit_iterator<_Cl, false>,
+ __bit_iterator<_Cl, false>,
+ __bit_iterator<_Cr, false>);
template <class _Dp>
_LIBCPP_CONSTEXPR_SINCE_CXX20
friend __bit_iterator<_Dp, false> rotate(__bit_iterator<_Dp, false>,
diff --git a/contrib/libs/cxxsupp/libcxx/include/__bsd_locale_defaults.h b/contrib/libs/cxxsupp/libcxx/include/__bsd_locale_defaults.h
deleted file mode 100644
index 4d990482d4a..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__bsd_locale_defaults.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// -*- 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
-//
-//===----------------------------------------------------------------------===//
-// The BSDs have lots of *_l functions. We don't want to define those symbols
-// on other platforms though, for fear of conflicts with user code. So here,
-// we will define the mapping from an internal macro to the real BSD symbol.
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___BSD_LOCALE_DEFAULTS_H
-#define _LIBCPP___BSD_LOCALE_DEFAULTS_H
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-#define __libcpp_mb_cur_max_l(loc) MB_CUR_MAX_L(loc)
-#define __libcpp_btowc_l(ch, loc) btowc_l(ch, loc)
-#define __libcpp_wctob_l(wch, loc) wctob_l(wch, loc)
-#define __libcpp_wcsnrtombs_l(dst, src, nwc, len, ps, loc) wcsnrtombs_l(dst, src, nwc, len, ps, loc)
-#define __libcpp_wcrtomb_l(src, wc, ps, loc) wcrtomb_l(src, wc, ps, loc)
-#define __libcpp_mbsnrtowcs_l(dst, src, nms, len, ps, loc) mbsnrtowcs_l(dst, src, nms, len, ps, loc)
-#define __libcpp_mbrtowc_l(pwc, s, n, ps, l) mbrtowc_l(pwc, s, n, ps, l)
-#define __libcpp_mbtowc_l(pwc, pmb, max, l) mbtowc_l(pwc, pmb, max, l)
-#define __libcpp_mbrlen_l(s, n, ps, l) mbrlen_l(s, n, ps, l)
-#define __libcpp_localeconv_l(l) localeconv_l(l)
-#define __libcpp_mbsrtowcs_l(dest, src, len, ps, l) mbsrtowcs_l(dest, src, len, ps, l)
-#define __libcpp_snprintf_l(...) snprintf_l(__VA_ARGS__)
-#define __libcpp_asprintf_l(...) asprintf_l(__VA_ARGS__)
-#define __libcpp_sscanf_l(...) sscanf_l(__VA_ARGS__)
-
-#endif // _LIBCPP___BSD_LOCALE_DEFAULTS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__bsd_locale_fallbacks.h b/contrib/libs/cxxsupp/libcxx/include/__bsd_locale_fallbacks.h
deleted file mode 100644
index 9abd7e7e5ff..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__bsd_locale_fallbacks.h
+++ /dev/null
@@ -1,142 +0,0 @@
-// -*- 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
-//
-//===----------------------------------------------------------------------===//
-// The BSDs have lots of *_l functions. This file provides reimplementations
-// of those functions for non-BSD platforms.
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___BSD_LOCALE_FALLBACKS_H
-#define _LIBCPP___BSD_LOCALE_FALLBACKS_H
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-inline _LIBCPP_INLINE_VISIBILITY
-decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l)
-{
- __libcpp_locale_guard __current(__l);
- return MB_CUR_MAX;
-}
-
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-inline _LIBCPP_INLINE_VISIBILITY
-wint_t __libcpp_btowc_l(int __c, locale_t __l)
-{
- __libcpp_locale_guard __current(__l);
- return btowc(__c);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_wctob_l(wint_t __c, locale_t __l)
-{
- __libcpp_locale_guard __current(__l);
- return wctob(__c);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
- size_t __len, mbstate_t *__ps, locale_t __l)
-{
- __libcpp_locale_guard __current(__l);
- return wcsnrtombs(__dest, __src, __nwc, __len, __ps);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l)
-{
- __libcpp_locale_guard __current(__l);
- return wcrtomb(__s, __wc, __ps);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms,
- size_t __len, mbstate_t *__ps, locale_t __l)
-{
- __libcpp_locale_guard __current(__l);
- return mbsnrtowcs(__dest, __src, __nms, __len, __ps);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
- mbstate_t *__ps, locale_t __l)
-{
- __libcpp_locale_guard __current(__l);
- return mbrtowc(__pwc, __s, __n, __ps);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l)
-{
- __libcpp_locale_guard __current(__l);
- return mbtowc(__pwc, __pmb, __max);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __libcpp_mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l)
-{
- __libcpp_locale_guard __current(__l);
- return mbrlen(__s, __n, __ps);
-}
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
-
-inline _LIBCPP_INLINE_VISIBILITY
-lconv *__libcpp_localeconv_l(locale_t __l)
-{
- __libcpp_locale_guard __current(__l);
- return localeconv();
-}
-
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
- mbstate_t *__ps, locale_t __l)
-{
- __libcpp_locale_guard __current(__l);
- return mbsrtowcs(__dest, __src, __len, __ps);
-}
-#endif
-
-inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 4, 5)
-int __libcpp_snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {
- va_list __va;
- va_start(__va, __format);
- __libcpp_locale_guard __current(__l);
- int __res = vsnprintf(__s, __n, __format, __va);
- va_end(__va);
- return __res;
-}
-
-inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4)
-int __libcpp_asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
- va_list __va;
- va_start(__va, __format);
- __libcpp_locale_guard __current(__l);
- int __res = vasprintf(__s, __format, __va);
- va_end(__va);
- return __res;
-}
-
-inline _LIBCPP_ATTRIBUTE_FORMAT(__scanf__, 3, 4)
-int __libcpp_sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
- va_list __va;
- va_start(__va, __format);
- __libcpp_locale_guard __current(__l);
- int __res = vsscanf(__s, __format, __va);
- va_end(__va);
- return __res;
-}
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP___BSD_LOCALE_FALLBACKS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__charconv/chars_format.h b/contrib/libs/cxxsupp/libcxx/include/__charconv/chars_format.h
index 695bd873189..0e781c047e3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__charconv/chars_format.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__charconv/chars_format.h
@@ -19,58 +19,45 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
-
-enum class _LIBCPP_ENUM_VIS chars_format
-{
- scientific = 0x1,
- fixed = 0x2,
- hex = 0x4,
- general = fixed | scientific
-};
-
-inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
-operator~(chars_format __x) {
- return chars_format(~_VSTD::__to_underlying(__x));
+#if _LIBCPP_STD_VER >= 17
+
+enum class _LIBCPP_ENUM_VIS chars_format { scientific = 0x1, fixed = 0x2, hex = 0x4, general = fixed | scientific };
+
+inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator~(chars_format __x) {
+ return chars_format(~std::__to_underlying(__x));
}
-inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
-operator&(chars_format __x, chars_format __y) {
- return chars_format(_VSTD::__to_underlying(__x) &
- _VSTD::__to_underlying(__y));
+inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator&(chars_format __x, chars_format __y) {
+ return chars_format(std::__to_underlying(__x) & std::__to_underlying(__y));
}
-inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
-operator|(chars_format __x, chars_format __y) {
- return chars_format(_VSTD::__to_underlying(__x) |
- _VSTD::__to_underlying(__y));
+inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator|(chars_format __x, chars_format __y) {
+ return chars_format(std::__to_underlying(__x) | std::__to_underlying(__y));
}
-inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
-operator^(chars_format __x, chars_format __y) {
- return chars_format(_VSTD::__to_underlying(__x) ^
- _VSTD::__to_underlying(__y));
+inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator^(chars_format __x, chars_format __y) {
+ return chars_format(std::__to_underlying(__x) ^ std::__to_underlying(__y));
}
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
operator&=(chars_format& __x, chars_format __y) {
__x = __x & __y;
return __x;
}
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
operator|=(chars_format& __x, chars_format __y) {
__x = __x | __y;
return __x;
}
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
operator^=(chars_format& __x, chars_format __y) {
__x = __x ^ __y;
return __x;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__charconv/from_chars_integral.h b/contrib/libs/cxxsupp/libcxx/include/__charconv/from_chars_integral.h
new file mode 100644
index 00000000000..acfdf4b30da
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__charconv/from_chars_integral.h
@@ -0,0 +1,239 @@
+// -*- 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___CHARCONV_FROM_CHARS_INTEGRAL_H
+#define _LIBCPP___CHARCONV_FROM_CHARS_INTEGRAL_H
+
+#include <__algorithm/copy_n.h>
+#include <__charconv/from_chars_result.h>
+#include <__charconv/traits.h>
+#include <__config>
+#include <__memory/addressof.h>
+#include <__system_error/errc.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_integral.h>
+#include <__type_traits/is_unsigned.h>
+#include <__type_traits/make_unsigned.h>
+#include <limits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 17
+
+from_chars_result from_chars(const char*, const char*, bool, int = 10) = delete;
+
+template <typename _It, typename _Tp, typename _Fn, typename... _Ts>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+__sign_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args) {
+ using __tl = numeric_limits<_Tp>;
+ decltype(std::__to_unsigned_like(__value)) __x;
+
+ bool __neg = (__first != __last && *__first == '-');
+ auto __r = __f(__neg ? __first + 1 : __first, __last, __x, __args...);
+ switch (__r.ec) {
+ case errc::invalid_argument:
+ return {__first, __r.ec};
+ case errc::result_out_of_range:
+ return __r;
+ default:
+ break;
+ }
+
+ if (__neg) {
+ if (__x <= std::__complement(std::__to_unsigned_like(__tl::min()))) {
+ __x = std::__complement(__x);
+ std::copy_n(std::addressof(__x), 1, std::addressof(__value));
+ return __r;
+ }
+ } else {
+ if (__x <= std::__to_unsigned_like(__tl::max())) {
+ __value = __x;
+ return __r;
+ }
+ }
+
+ return {__r.ptr, errc::result_out_of_range};
+}
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool __in_pattern(_Tp __c) {
+ return '0' <= __c && __c <= '9';
+}
+
+struct _LIBCPP_HIDDEN __in_pattern_result {
+ bool __ok;
+ int __val;
+
+ explicit _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI operator bool() const { return __ok; }
+};
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI __in_pattern_result __in_pattern(_Tp __c, int __base) {
+ if (__base <= 10)
+ return {'0' <= __c && __c < '0' + __base, __c - '0'};
+ else if (std::__in_pattern(__c))
+ return {true, __c - '0'};
+ else if ('a' <= __c && __c < 'a' + __base - 10)
+ return {true, __c - 'a' + 10};
+ else
+ return {'A' <= __c && __c < 'A' + __base - 10, __c - 'A' + 10};
+}
+
+template <typename _It, typename _Tp, typename _Fn, typename... _Ts>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+__subject_seq_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args) {
+ auto __find_non_zero = [](_It __firstit, _It __lastit) {
+ for (; __firstit != __lastit; ++__firstit)
+ if (*__firstit != '0')
+ break;
+ return __firstit;
+ };
+
+ auto __p = __find_non_zero(__first, __last);
+ if (__p == __last || !std::__in_pattern(*__p, __args...)) {
+ if (__p == __first)
+ return {__first, errc::invalid_argument};
+ else {
+ __value = 0;
+ return {__p, {}};
+ }
+ }
+
+ auto __r = __f(__p, __last, __value, __args...);
+ if (__r.ec == errc::result_out_of_range) {
+ for (; __r.ptr != __last; ++__r.ptr) {
+ if (!std::__in_pattern(*__r.ptr, __args...))
+ break;
+ }
+ }
+
+ return __r;
+}
+
+template <typename _Tp, typename enable_if<is_unsigned<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+__from_chars_atoi(const char* __first, const char* __last, _Tp& __value) {
+ using __tx = __itoa::__traits<_Tp>;
+ using __output_type = typename __tx::type;
+
+ return std::__subject_seq_combinator(
+ __first, __last, __value, [](const char* __f, const char* __l, _Tp& __val) -> from_chars_result {
+ __output_type __a, __b;
+ auto __p = __tx::__read(__f, __l, __a, __b);
+ if (__p == __l || !std::__in_pattern(*__p)) {
+ __output_type __m = numeric_limits<_Tp>::max();
+ if (__m >= __a && __m - __a >= __b) {
+ __val = __a + __b;
+ return {__p, {}};
+ }
+ }
+ return {__p, errc::result_out_of_range};
+ });
+}
+
+template <typename _Tp, typename enable_if<is_signed<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+__from_chars_atoi(const char* __first, const char* __last, _Tp& __value) {
+ using __t = decltype(std::__to_unsigned_like(__value));
+ return std::__sign_combinator(__first, __last, __value, __from_chars_atoi<__t>);
+}
+
+/*
+// Code used to generate __from_chars_log2f_lut.
+#include <cmath>
+#include <format>
+#include <iostream>
+
+int main() {
+ for (int i = 2; i <= 36; ++i)
+ std::cout << std::format("{},\n", log2f(i));
+}
+*/
+/// log2f table for bases [2, 36].
+inline constexpr float __from_chars_log2f_lut[35] = {
+ 1, 1.5849625, 2, 2.321928, 2.5849626, 2.807355, 3, 3.169925, 3.321928,
+ 3.4594316, 3.5849626, 3.7004397, 3.807355, 3.9068906, 4, 4.087463, 4.169925, 4.2479277,
+ 4.321928, 4.3923173, 4.4594316, 4.523562, 4.5849624, 4.643856, 4.70044, 4.7548876, 4.807355,
+ 4.857981, 4.9068904, 4.9541965, 5, 5.044394, 5.087463, 5.129283, 5.169925};
+
+template <typename _Tp, typename enable_if<is_unsigned<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+__from_chars_integral(const char* __first, const char* __last, _Tp& __value, int __base) {
+ if (__base == 10)
+ return std::__from_chars_atoi(__first, __last, __value);
+
+ return std::__subject_seq_combinator(
+ __first,
+ __last,
+ __value,
+ [](const char* __p, const char* __lastp, _Tp& __val, int __b) -> from_chars_result {
+ using __tl = numeric_limits<_Tp>;
+ // __base is always between 2 and 36 inclusive.
+ auto __digits = __tl::digits / __from_chars_log2f_lut[__b - 2];
+ _Tp __x = __in_pattern(*__p++, __b).__val, __y = 0;
+
+ for (int __i = 1; __p != __lastp; ++__i, ++__p) {
+ if (auto __c = __in_pattern(*__p, __b)) {
+ if (__i < __digits - 1)
+ __x = __x * __b + __c.__val;
+ else {
+ if (!__itoa::__mul_overflowed(__x, __b, __x))
+ ++__p;
+ __y = __c.__val;
+ break;
+ }
+ } else
+ break;
+ }
+
+ if (__p == __lastp || !__in_pattern(*__p, __b)) {
+ if (__tl::max() - __x >= __y) {
+ __val = __x + __y;
+ return {__p, {}};
+ }
+ }
+ return {__p, errc::result_out_of_range};
+ },
+ __base);
+}
+
+template <typename _Tp, typename enable_if<is_signed<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+__from_chars_integral(const char* __first, const char* __last, _Tp& __value, int __base) {
+ using __t = decltype(std::__to_unsigned_like(__value));
+ return std::__sign_combinator(__first, __last, __value, __from_chars_integral<__t>, __base);
+}
+
+template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+from_chars(const char* __first, const char* __last, _Tp& __value) {
+ return std::__from_chars_atoi(__first, __last, __value);
+}
+
+template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+from_chars(const char* __first, const char* __last, _Tp& __value, int __base) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(2 <= __base && __base <= 36, "base not in [2, 36]");
+ return std::__from_chars_integral(__first, __last, __value, __base);
+}
+#endif // _LIBCPP_STD_VER >= 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___CHARCONV_FROM_CHARS_INTEGRAL_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__charconv/from_chars_result.h b/contrib/libs/cxxsupp/libcxx/include/__charconv/from_chars_result.h
index 05ffe1485ca..fa98616a0cb 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__charconv/from_chars_result.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__charconv/from_chars_result.h
@@ -11,7 +11,7 @@
#define _LIBCPP___CHARCONV_FROM_CHARS_RESULT_H
#include <__config>
-#include <__errc>
+#include <__system_error/errc.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -19,18 +19,17 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
-struct _LIBCPP_TYPE_VIS from_chars_result
-{
- const char* ptr;
- errc ec;
-# if _LIBCPP_STD_VER > 17
- _LIBCPP_HIDE_FROM_ABI friend bool operator==(const from_chars_result&, const from_chars_result&) = default;
+struct _LIBCPP_EXPORTED_FROM_ABI from_chars_result {
+ const char* ptr;
+ errc ec;
+# if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI friend bool operator==(const from_chars_result&, const from_chars_result&) = default;
# endif
};
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__charconv/tables.h b/contrib/libs/cxxsupp/libcxx/include/__charconv/tables.h
index 9b82440348b..6b93536b8c1 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__charconv/tables.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__charconv/tables.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
namespace __itoa {
@@ -62,32 +62,41 @@ inline constexpr char __base_16_lut[512] = {
'f', 'd', 'f', 'e', 'f', 'f'};
inline constexpr uint32_t __pow10_32[10] = {
- UINT32_C(0), UINT32_C(10), UINT32_C(100), UINT32_C(1000), UINT32_C(10000),
- UINT32_C(100000), UINT32_C(1000000), UINT32_C(10000000), UINT32_C(100000000), UINT32_C(1000000000)};
-
-inline constexpr uint64_t __pow10_64[20] = {UINT64_C(0),
- UINT64_C(10),
- UINT64_C(100),
- UINT64_C(1000),
- UINT64_C(10000),
- UINT64_C(100000),
- UINT64_C(1000000),
- UINT64_C(10000000),
- UINT64_C(100000000),
- UINT64_C(1000000000),
- UINT64_C(10000000000),
- UINT64_C(100000000000),
- UINT64_C(1000000000000),
- UINT64_C(10000000000000),
- UINT64_C(100000000000000),
- UINT64_C(1000000000000000),
- UINT64_C(10000000000000000),
- UINT64_C(100000000000000000),
- UINT64_C(1000000000000000000),
- UINT64_C(10000000000000000000)};
+ UINT32_C(0),
+ UINT32_C(10),
+ UINT32_C(100),
+ UINT32_C(1000),
+ UINT32_C(10000),
+ UINT32_C(100000),
+ UINT32_C(1000000),
+ UINT32_C(10000000),
+ UINT32_C(100000000),
+ UINT32_C(1000000000)};
+
+inline constexpr uint64_t __pow10_64[20] = {
+ UINT64_C(0),
+ UINT64_C(10),
+ UINT64_C(100),
+ UINT64_C(1000),
+ UINT64_C(10000),
+ UINT64_C(100000),
+ UINT64_C(1000000),
+ UINT64_C(10000000),
+ UINT64_C(100000000),
+ UINT64_C(1000000000),
+ UINT64_C(10000000000),
+ UINT64_C(100000000000),
+ UINT64_C(1000000000000),
+ UINT64_C(10000000000000),
+ UINT64_C(100000000000000),
+ UINT64_C(1000000000000000),
+ UINT64_C(10000000000000000),
+ UINT64_C(100000000000000000),
+ UINT64_C(1000000000000000000),
+ UINT64_C(10000000000000000000)};
# ifndef _LIBCPP_HAS_NO_INT128
-inline constexpr int __pow10_128_offset = 0;
+inline constexpr int __pow10_128_offset = 0;
inline constexpr __uint128_t __pow10_128[40] = {
UINT64_C(0),
UINT64_C(10),
@@ -147,7 +156,7 @@ inline constexpr char __digits_base_10[200] = {
} // namespace __itoa
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars.h b/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars.h
new file mode 100644
index 00000000000..8ef09af7375
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars.h
@@ -0,0 +1,25 @@
+// -*- 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___CHARCONV_TO_CHARS
+#define _LIBCPP___CHARCONV_TO_CHARS
+
+#include <__charconv/to_chars_floating_point.h>
+#include <__charconv/to_chars_integral.h>
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___CHARCONV_TO_CHARS
diff --git a/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_base_10.h b/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_base_10.h
index fc7fb76e3e9..33c512e20f0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_base_10.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_base_10.h
@@ -25,7 +25,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
namespace __itoa {
@@ -72,7 +72,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char* __append10(char* __fir
static_cast<uint32_t>(__value % 100000000));
}
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u32(char* __first, uint32_t __value) noexcept {
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char*
+__base_10_u32(char* __first, uint32_t __value) noexcept {
if (__value < 1000000) {
if (__value < 10000) {
if (__value < 100) {
@@ -107,7 +108,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u32(c
return __itoa::__append10(__first, __value);
}
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u64(char* __buffer, uint64_t __value) noexcept {
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char*
+__base_10_u64(char* __buffer, uint64_t __value) noexcept {
if (__value <= UINT32_MAX)
return __itoa::__base_10_u32(__buffer, static_cast<uint32_t>(__value));
@@ -130,12 +132,13 @@ _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u64(c
/// range that can be used. However the range is sufficient for
/// \ref __base_10_u128.
_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline __uint128_t __pow_10(int __exp) noexcept {
- _LIBCPP_ASSERT(__exp >= __pow10_128_offset, "Index out of bounds");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__exp >= __pow10_128_offset, "Index out of bounds");
return __pow10_128[__exp - __pow10_128_offset];
}
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u128(char* __buffer, __uint128_t __value) noexcept {
- _LIBCPP_ASSERT(
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char*
+__base_10_u128(char* __buffer, __uint128_t __value) noexcept {
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__value > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fail when this isn't true.");
// Unlike the 64 to 32 bit case the 128 bit case the "upper half" can't be
@@ -159,8 +162,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u128(
__value %= __itoa::__pow_10(29);
__buffer = __itoa::__append10(__buffer, static_cast<uint64_t>(__value / __itoa::__pow_10(19)));
__value %= __itoa::__pow_10(19);
- }
- else {
+ } else {
// step 2
// This version needs to determine the position of the leading non-zero digit.
__buffer = __base_10_u64(__buffer, static_cast<uint64_t>(__value / __itoa::__pow_10(19)));
@@ -176,7 +178,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u128(
# endif
} // namespace __itoa
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_floating_point.h b/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_floating_point.h
new file mode 100644
index 00000000000..08720e10788
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_floating_point.h
@@ -0,0 +1,56 @@
+// -*- 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___CHARCONV_TO_CHARS_FLOATING_POINT_H
+#define _LIBCPP___CHARCONV_TO_CHARS_FLOATING_POINT_H
+
+#include <__availability>
+#include <__charconv/chars_format.h>
+#include <__charconv/to_chars_result.h>
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 17
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_EXPORTED_FROM_ABI to_chars_result
+to_chars(char* __first, char* __last, float __value);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_EXPORTED_FROM_ABI to_chars_result
+to_chars(char* __first, char* __last, double __value);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_EXPORTED_FROM_ABI to_chars_result
+to_chars(char* __first, char* __last, long double __value);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_EXPORTED_FROM_ABI to_chars_result
+to_chars(char* __first, char* __last, float __value, chars_format __fmt);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_EXPORTED_FROM_ABI to_chars_result
+to_chars(char* __first, char* __last, double __value, chars_format __fmt);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_EXPORTED_FROM_ABI to_chars_result
+to_chars(char* __first, char* __last, long double __value, chars_format __fmt);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_EXPORTED_FROM_ABI to_chars_result
+to_chars(char* __first, char* __last, float __value, chars_format __fmt, int __precision);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_EXPORTED_FROM_ABI to_chars_result
+to_chars(char* __first, char* __last, double __value, chars_format __fmt, int __precision);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_EXPORTED_FROM_ABI to_chars_result
+to_chars(char* __first, char* __last, long double __value, chars_format __fmt, int __precision);
+#endif // _LIBCPP_STD_VER >= 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___CHARCONV_TO_CHARS_FLOATING_POINT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_integral.h b/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_integral.h
new file mode 100644
index 00000000000..28fac7524cf
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_integral.h
@@ -0,0 +1,326 @@
+// -*- 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___CHARCONV_TO_CHARS_INTEGRAL_H
+#define _LIBCPP___CHARCONV_TO_CHARS_INTEGRAL_H
+
+#include <__algorithm/copy_n.h>
+#include <__bit/countl.h>
+#include <__charconv/tables.h>
+#include <__charconv/to_chars_base_10.h>
+#include <__charconv/to_chars_result.h>
+#include <__charconv/traits.h>
+#include <__config>
+#include <__system_error/errc.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/make_32_64_or_128_bit.h>
+#include <__type_traits/make_unsigned.h>
+#include <__utility/unreachable.h>
+#include <cstddef>
+#include <cstdint>
+#include <limits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 17
+
+to_chars_result to_chars(char*, char*, bool, int = 10) = delete;
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_itoa(char* __first, char* __last, _Tp __value, false_type);
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_itoa(char* __first, char* __last, _Tp __value, true_type) {
+ auto __x = std::__to_unsigned_like(__value);
+ if (__value < 0 && __first != __last) {
+ *__first++ = '-';
+ __x = std::__complement(__x);
+ }
+
+ return std::__to_chars_itoa(__first, __last, __x, false_type());
+}
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_itoa(char* __first, char* __last, _Tp __value, false_type) {
+ using __tx = __itoa::__traits<_Tp>;
+ auto __diff = __last - __first;
+
+ if (__tx::digits <= __diff || __tx::__width(__value) <= __diff)
+ return {__tx::__convert(__first, __value), errc(0)};
+ else
+ return {__last, errc::value_too_large};
+}
+
+# ifndef _LIBCPP_HAS_NO_INT128
+template <>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_itoa(char* __first, char* __last, __uint128_t __value, false_type) {
+ // When the value fits in 64-bits use the 64-bit code path. This reduces
+ // the number of expensive calculations on 128-bit values.
+ //
+ // NOTE the 128-bit code path requires this optimization.
+ if (__value <= numeric_limits<uint64_t>::max())
+ return __to_chars_itoa(__first, __last, static_cast<uint64_t>(__value), false_type());
+
+ using __tx = __itoa::__traits<__uint128_t>;
+ auto __diff = __last - __first;
+
+ if (__tx::digits <= __diff || __tx::__width(__value) <= __diff)
+ return {__tx::__convert(__first, __value), errc(0)};
+ else
+ return {__last, errc::value_too_large};
+}
+# endif
+
+template <class _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_integral(char* __first, char* __last, _Tp __value, int __base, false_type);
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_integral(char* __first, char* __last, _Tp __value, int __base, true_type) {
+ auto __x = std::__to_unsigned_like(__value);
+ if (__value < 0 && __first != __last) {
+ *__first++ = '-';
+ __x = std::__complement(__x);
+ }
+
+ return std::__to_chars_integral(__first, __last, __x, __base, false_type());
+}
+
+namespace __itoa {
+
+template <unsigned _Base>
+struct _LIBCPP_HIDDEN __integral;
+
+template <>
+struct _LIBCPP_HIDDEN __integral<2> {
+ template <typename _Tp>
+ _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
+ // If value == 0 still need one digit. If the value != this has no
+ // effect since the code scans for the most significant bit set. (Note
+ // that __libcpp_clz doesn't work for 0.)
+ return numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1);
+ }
+
+ template <typename _Tp>
+ _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI static to_chars_result
+ __to_chars(char* __first, char* __last, _Tp __value) {
+ ptrdiff_t __cap = __last - __first;
+ int __n = __width(__value);
+ if (__n > __cap)
+ return {__last, errc::value_too_large};
+
+ __last = __first + __n;
+ char* __p = __last;
+ const unsigned __divisor = 16;
+ while (__value > __divisor) {
+ unsigned __c = __value % __divisor;
+ __value /= __divisor;
+ __p -= 4;
+ std::copy_n(&__base_2_lut[4 * __c], 4, __p);
+ }
+ do {
+ unsigned __c = __value % 2;
+ __value /= 2;
+ *--__p = "01"[__c];
+ } while (__value != 0);
+ return {__last, errc(0)};
+ }
+};
+
+template <>
+struct _LIBCPP_HIDDEN __integral<8> {
+ template <typename _Tp>
+ _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
+ // If value == 0 still need one digit. If the value != this has no
+ // effect since the code scans for the most significat bit set. (Note
+ // that __libcpp_clz doesn't work for 0.)
+ return ((numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1)) + 2) / 3;
+ }
+
+ template <typename _Tp>
+ _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI static to_chars_result
+ __to_chars(char* __first, char* __last, _Tp __value) {
+ ptrdiff_t __cap = __last - __first;
+ int __n = __width(__value);
+ if (__n > __cap)
+ return {__last, errc::value_too_large};
+
+ __last = __first + __n;
+ char* __p = __last;
+ unsigned __divisor = 64;
+ while (__value > __divisor) {
+ unsigned __c = __value % __divisor;
+ __value /= __divisor;
+ __p -= 2;
+ std::copy_n(&__base_8_lut[2 * __c], 2, __p);
+ }
+ do {
+ unsigned __c = __value % 8;
+ __value /= 8;
+ *--__p = "01234567"[__c];
+ } while (__value != 0);
+ return {__last, errc(0)};
+ }
+};
+
+template <>
+struct _LIBCPP_HIDDEN __integral<16> {
+ template <typename _Tp>
+ _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
+ // If value == 0 still need one digit. If the value != this has no
+ // effect since the code scans for the most significat bit set. (Note
+ // that __libcpp_clz doesn't work for 0.)
+ return (numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1) + 3) / 4;
+ }
+
+ template <typename _Tp>
+ _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI static to_chars_result
+ __to_chars(char* __first, char* __last, _Tp __value) {
+ ptrdiff_t __cap = __last - __first;
+ int __n = __width(__value);
+ if (__n > __cap)
+ return {__last, errc::value_too_large};
+
+ __last = __first + __n;
+ char* __p = __last;
+ unsigned __divisor = 256;
+ while (__value > __divisor) {
+ unsigned __c = __value % __divisor;
+ __value /= __divisor;
+ __p -= 2;
+ std::copy_n(&__base_16_lut[2 * __c], 2, __p);
+ }
+ if (__first != __last)
+ do {
+ unsigned __c = __value % 16;
+ __value /= 16;
+ *--__p = "0123456789abcdef"[__c];
+ } while (__value != 0);
+ return {__last, errc(0)};
+ }
+};
+
+} // namespace __itoa
+
+template <unsigned _Base, typename _Tp, typename enable_if<(sizeof(_Tp) >= sizeof(unsigned)), int>::type = 0>
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __to_chars_integral_width(_Tp __value) {
+ return __itoa::__integral<_Base>::__width(__value);
+}
+
+template <unsigned _Base, typename _Tp, typename enable_if<(sizeof(_Tp) < sizeof(unsigned)), int>::type = 0>
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __to_chars_integral_width(_Tp __value) {
+ return std::__to_chars_integral_width<_Base>(static_cast<unsigned>(__value));
+}
+
+template <unsigned _Base, typename _Tp, typename enable_if<(sizeof(_Tp) >= sizeof(unsigned)), int>::type = 0>
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_integral(char* __first, char* __last, _Tp __value) {
+ return __itoa::__integral<_Base>::__to_chars(__first, __last, __value);
+}
+
+template <unsigned _Base, typename _Tp, typename enable_if<(sizeof(_Tp) < sizeof(unsigned)), int>::type = 0>
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_integral(char* __first, char* __last, _Tp __value) {
+ return std::__to_chars_integral<_Base>(__first, __last, static_cast<unsigned>(__value));
+}
+
+template <typename _Tp>
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __to_chars_integral_width(_Tp __value, unsigned __base) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__value >= 0, "The function requires a non-negative value.");
+
+ unsigned __base_2 = __base * __base;
+ unsigned __base_3 = __base_2 * __base;
+ unsigned __base_4 = __base_2 * __base_2;
+
+ int __r = 0;
+ while (true) {
+ if (__value < __base)
+ return __r + 1;
+ if (__value < __base_2)
+ return __r + 2;
+ if (__value < __base_3)
+ return __r + 3;
+ if (__value < __base_4)
+ return __r + 4;
+
+ __value /= __base_4;
+ __r += 4;
+ }
+
+ __libcpp_unreachable();
+}
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_integral(char* __first, char* __last, _Tp __value, int __base, false_type) {
+ if (__base == 10) [[likely]]
+ return std::__to_chars_itoa(__first, __last, __value, false_type());
+
+ switch (__base) {
+ case 2:
+ return std::__to_chars_integral<2>(__first, __last, __value);
+ case 8:
+ return std::__to_chars_integral<8>(__first, __last, __value);
+ case 16:
+ return std::__to_chars_integral<16>(__first, __last, __value);
+ }
+
+ ptrdiff_t __cap = __last - __first;
+ int __n = std::__to_chars_integral_width(__value, __base);
+ if (__n > __cap)
+ return {__last, errc::value_too_large};
+
+ __last = __first + __n;
+ char* __p = __last;
+ do {
+ unsigned __c = __value % __base;
+ __value /= __base;
+ *--__p = "0123456789abcdefghijklmnopqrstuvwxyz"[__c];
+ } while (__value != 0);
+ return {__last, errc(0)};
+}
+
+template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+to_chars(char* __first, char* __last, _Tp __value) {
+ using _Type = __make_32_64_or_128_bit_t<_Tp>;
+ static_assert(!is_same<_Type, void>::value, "unsupported integral type used in to_chars");
+ return std::__to_chars_itoa(__first, __last, static_cast<_Type>(__value), is_signed<_Tp>());
+}
+
+template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+to_chars(char* __first, char* __last, _Tp __value, int __base) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(2 <= __base && __base <= 36, "base not in [2, 36]");
+
+ using _Type = __make_32_64_or_128_bit_t<_Tp>;
+ return std::__to_chars_integral(__first, __last, static_cast<_Type>(__value), __base, is_signed<_Tp>());
+}
+
+#endif // _LIBCPP_STD_VER >= 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___CHARCONV_TO_CHARS_INTEGRAL_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_result.h b/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_result.h
index 2eb4098dfc4..aba5e5f06b5 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_result.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__charconv/to_chars_result.h
@@ -11,7 +11,7 @@
#define _LIBCPP___CHARCONV_TO_CHARS_RESULT_H
#include <__config>
-#include <__errc>
+#include <__system_error/errc.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -19,18 +19,17 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
-struct _LIBCPP_TYPE_VIS to_chars_result
-{
- char* ptr;
- errc ec;
-# if _LIBCPP_STD_VER > 17
- _LIBCPP_HIDE_FROM_ABI friend bool operator==(const to_chars_result&, const to_chars_result&) = default;
+struct _LIBCPP_EXPORTED_FROM_ABI to_chars_result {
+ char* ptr;
+ errc ec;
+# if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI friend bool operator==(const to_chars_result&, const to_chars_result&) = default;
# endif
};
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__charconv/traits.h b/contrib/libs/cxxsupp/libcxx/include/__charconv/traits.h
new file mode 100644
index 00000000000..d3884b560df
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__charconv/traits.h
@@ -0,0 +1,199 @@
+// -*- 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___CHARCONV_TRAITS
+#define _LIBCPP___CHARCONV_TRAITS
+
+#include <__bit/countl.h>
+#include <__charconv/tables.h>
+#include <__charconv/to_chars_base_10.h>
+#include <__config>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_unsigned.h>
+#include <cstdint>
+#include <limits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 17
+
+namespace __itoa {
+
+template <typename _Tp, typename = void>
+struct _LIBCPP_HIDDEN __traits_base;
+
+template <typename _Tp>
+struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) <= sizeof(uint32_t)>> {
+ using type = uint32_t;
+
+ /// The width estimation using a log10 algorithm.
+ ///
+ /// The algorithm is based on
+ /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
+ /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
+ /// function requires its input to have at least one bit set the value of
+ /// zero is set to one. This means the first element of the lookup table is
+ /// zero.
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
+ auto __t = (32 - std::__libcpp_clz(static_cast<type>(__v | 1))) * 1233 >> 12;
+ return __t - (__v < __itoa::__pow10_32[__t]) + 1;
+ }
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) {
+ return __itoa::__base_10_u32(__p, __v);
+ }
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI decltype(__pow10_32)& __pow() {
+ return __itoa::__pow10_32;
+ }
+};
+
+template <typename _Tp>
+struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(uint64_t)>> {
+ using type = uint64_t;
+
+ /// The width estimation using a log10 algorithm.
+ ///
+ /// The algorithm is based on
+ /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
+ /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
+ /// function requires its input to have at least one bit set the value of
+ /// zero is set to one. This means the first element of the lookup table is
+ /// zero.
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
+ auto __t = (64 - std::__libcpp_clz(static_cast<type>(__v | 1))) * 1233 >> 12;
+ return __t - (__v < __itoa::__pow10_64[__t]) + 1;
+ }
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) {
+ return __itoa::__base_10_u64(__p, __v);
+ }
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI decltype(__pow10_64)& __pow() {
+ return __itoa::__pow10_64;
+ }
+};
+
+# ifndef _LIBCPP_HAS_NO_INT128
+template <typename _Tp>
+struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(__uint128_t)> > {
+ using type = __uint128_t;
+
+ /// The width estimation using a log10 algorithm.
+ ///
+ /// The algorithm is based on
+ /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
+ /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
+ /// function requires its input to have at least one bit set the value of
+ /// zero is set to one. This means the first element of the lookup table is
+ /// zero.
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __v > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fail when this isn't true.");
+ // There's always a bit set in the upper 64-bits.
+ auto __t = (128 - std::__libcpp_clz(static_cast<uint64_t>(__v >> 64))) * 1233 >> 12;
+ _LIBCPP_ASSERT_UNCATEGORIZED(__t >= __itoa::__pow10_128_offset, "Index out of bounds");
+ // __t is adjusted since the lookup table misses the lower entries.
+ return __t - (__v < __itoa::__pow10_128[__t - __itoa::__pow10_128_offset]) + 1;
+ }
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) {
+ return __itoa::__base_10_u128(__p, __v);
+ }
+
+ // TODO FMT This pow function should get an index.
+ // By moving this to its own header it can be reused by the pow function in to_chars_base_10.
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI decltype(__pow10_128)& __pow() {
+ return __itoa::__pow10_128;
+ }
+};
+# endif
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
+__mul_overflowed(unsigned char __a, _Tp __b, unsigned char& __r) {
+ auto __c = __a * __b;
+ __r = __c;
+ return __c > numeric_limits<unsigned char>::max();
+}
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
+__mul_overflowed(unsigned short __a, _Tp __b, unsigned short& __r) {
+ auto __c = __a * __b;
+ __r = __c;
+ return __c > numeric_limits<unsigned short>::max();
+}
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool __mul_overflowed(_Tp __a, _Tp __b, _Tp& __r) {
+ static_assert(is_unsigned<_Tp>::value, "");
+ return __builtin_mul_overflow(__a, __b, &__r);
+}
+
+template <typename _Tp, typename _Up>
+inline _LIBCPP_HIDE_FROM_ABI bool _LIBCPP_CONSTEXPR_SINCE_CXX23 __mul_overflowed(_Tp __a, _Up __b, _Tp& __r) {
+ return __itoa::__mul_overflowed(__a, static_cast<_Tp>(__b), __r);
+}
+
+template <typename _Tp>
+struct _LIBCPP_HIDDEN __traits : __traits_base<_Tp> {
+ static constexpr int digits = numeric_limits<_Tp>::digits10 + 1;
+ using __traits_base<_Tp>::__pow;
+ using typename __traits_base<_Tp>::type;
+
+ // precondition: at least one non-zero character available
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char const*
+ __read(char const* __p, char const* __ep, type& __a, type& __b) {
+ type __cprod[digits];
+ int __j = digits - 1;
+ int __i = digits;
+ do {
+ if (*__p < '0' || *__p > '9')
+ break;
+ __cprod[--__i] = *__p++ - '0';
+ } while (__p != __ep && __i != 0);
+
+ __a = __inner_product(__cprod + __i + 1, __cprod + __j, __pow() + 1, __cprod[__i]);
+ if (__itoa::__mul_overflowed(__cprod[__j], __pow()[__j - __i], __b))
+ --__p;
+ return __p;
+ }
+
+ template <typename _It1, typename _It2, class _Up>
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _Up
+ __inner_product(_It1 __first1, _It1 __last1, _It2 __first2, _Up __init) {
+ for (; __first1 < __last1; ++__first1, ++__first2)
+ __init = __init + *__first1 * *__first2;
+ return __init;
+ }
+};
+
+} // namespace __itoa
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _Tp __complement(_Tp __x) {
+ static_assert(is_unsigned<_Tp>::value, "cast to unsigned first");
+ return _Tp(~__x + 1);
+}
+
+#endif // _LIBCPP_STD_VER >= 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___CHARCONV_TRAITS
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/calendar.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/calendar.h
index d3762a631c9..91aaf632538 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/calendar.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/calendar.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -26,12 +26,12 @@ namespace chrono
{
struct local_t {};
-template<class Duration>
-using local_time = time_point<local_t, Duration>;
+template<class _Duration>
+using local_time = time_point<local_t, _Duration>;
using local_seconds = local_time<seconds>;
using local_days = local_time<days>;
-struct last_spec { _LIBCPP_HIDE_FROM_ABI explicit last_spec() = default; };
+struct last_spec { explicit last_spec() = default; };
inline constexpr last_spec last{};
@@ -39,6 +39,6 @@ inline constexpr last_spec last{};
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_CALENDAR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/concepts.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/concepts.h
new file mode 100644
index 00000000000..61ec256b23a
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/concepts.h
@@ -0,0 +1,36 @@
+// -*- 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___CHRONO_CONCEPTS_H
+#define _LIBCPP___CHRONO_CONCEPTS_H
+
+#include <__chrono/hh_mm_ss.h>
+#include <__chrono/time_point.h>
+#include <__config>
+#include <__type_traits/is_specialization.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 20
+
+template <class _Tp>
+concept __is_hh_mm_ss = __is_specialization_v<_Tp, chrono::hh_mm_ss>;
+
+template <class _Tp>
+concept __is_time_point = __is_specialization_v<_Tp, chrono::time_point>;
+
+#endif // _LIBCPP_STD_VER >= 20
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___CHRONO_CONCEPTS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_tm.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_tm.h
index 36846b3f714..1301cd6f1f1 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_tm.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_tm.h
@@ -10,8 +10,11 @@
#ifndef _LIBCPP___CHRONO_CONVERT_TO_TM_H
#define _LIBCPP___CHRONO_CONVERT_TO_TM_H
+#include <__chrono/calendar.h>
+#include <__chrono/concepts.h>
#include <__chrono/day.h>
#include <__chrono/duration.h>
+#include <__chrono/file_clock.h>
#include <__chrono/hh_mm_ss.h>
#include <__chrono/month.h>
#include <__chrono/month_weekday.h>
@@ -26,17 +29,23 @@
#include <__chrono/year_month_weekday.h>
#include <__concepts/same_as.h>
#include <__config>
+#include <__format/format_error.h>
#include <__memory/addressof.h>
+#include <__type_traits/is_convertible.h>
#include <cstdint>
#include <ctime>
+#include <limits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// Conerts a chrono date and weekday to a given _Tm type.
//
@@ -67,6 +76,24 @@ _LIBCPP_HIDE_FROM_ABI _Tm __convert_to_tm(const _Date& __date, chrono::weekday _
return __result;
}
+template <class _Tm, class _Duration>
+_LIBCPP_HIDE_FROM_ABI _Tm __convert_to_tm(const chrono::sys_time<_Duration> __tp) {
+ chrono::sys_days __days = chrono::floor<chrono::days>(__tp);
+ chrono::year_month_day __ymd{__days};
+
+ _Tm __result = std::__convert_to_tm<_Tm>(chrono::year_month_day{__ymd}, chrono::weekday{__days});
+
+ uint64_t __sec =
+ chrono::duration_cast<chrono::seconds>(__tp - chrono::time_point_cast<chrono::seconds>(__days)).count();
+ __sec %= 24 * 3600;
+ __result.tm_hour = __sec / 3600;
+ __sec %= 3600;
+ __result.tm_min = __sec / 60;
+ __result.tm_sec = __sec % 60;
+
+ return __result;
+}
+
// Convert a chrono (calendar) time point, or dururation to the given _Tm type,
// which must have the same properties as std::tm.
template <class _Tm, class _ChronoT>
@@ -76,17 +103,37 @@ _LIBCPP_HIDE_FROM_ABI _Tm __convert_to_tm(const _ChronoT& __value) {
__result.tm_zone = "UTC";
# endif
- if constexpr (chrono::__is_duration<_ChronoT>::value) {
+ if constexpr (__is_time_point<_ChronoT>) {
+ if constexpr (same_as<typename _ChronoT::clock, chrono::system_clock>)
+ return std::__convert_to_tm<_Tm>(__value);
+ else if constexpr (same_as<typename _ChronoT::clock, chrono::file_clock>)
+ return std::__convert_to_tm<_Tm>(_ChronoT::clock::to_sys(__value));
+ else if constexpr (same_as<typename _ChronoT::clock, chrono::local_t>)
+ return std::__convert_to_tm<_Tm>(chrono::sys_time<typename _ChronoT::duration>{__value.time_since_epoch()});
+ else
+ static_assert(sizeof(_ChronoT) == 0, "TODO: Add the missing clock specialization");
+ } else if constexpr (chrono::__is_duration<_ChronoT>::value) {
// [time.format]/6
// ... However, if a flag refers to a "time of day" (e.g. %H, %I, %p,
// etc.), then a specialization of duration is interpreted as the time of
// day elapsed since midnight.
- uint64_t __sec = chrono::duration_cast<chrono::seconds>(__value).count();
- __sec %= 24 * 3600;
- __result.tm_hour = __sec / 3600;
- __sec %= 3600;
- __result.tm_min = __sec / 60;
- __result.tm_sec = __sec % 60;
+
+ // Not all values can be converted to hours, it may run into ratio
+ // conversion errors. In that case the conversion to seconds works.
+ if constexpr (is_convertible_v<_ChronoT, chrono::hours>) {
+ auto __hour = chrono::floor<chrono::hours>(__value);
+ auto __sec = chrono::duration_cast<chrono::seconds>(__value - __hour);
+ __result.tm_hour = __hour.count() % 24;
+ __result.tm_min = __sec.count() / 60;
+ __result.tm_sec = __sec.count() % 60;
+ } else {
+ uint64_t __sec = chrono::duration_cast<chrono::seconds>(__value).count();
+ __sec %= 24 * 3600;
+ __result.tm_hour = __sec / 3600;
+ __sec %= 3600;
+ __result.tm_min = __sec / 60;
+ __result.tm_sec = __sec % 60;
+ }
} else if constexpr (same_as<_ChronoT, chrono::day>)
__result.tm_mday = static_cast<unsigned>(__value);
else if constexpr (same_as<_ChronoT, chrono::month>)
@@ -114,14 +161,26 @@ _LIBCPP_HIDE_FROM_ABI _Tm __convert_to_tm(const _ChronoT& __value) {
} else if constexpr (same_as<_ChronoT, chrono::year_month_weekday> ||
same_as<_ChronoT, chrono::year_month_weekday_last>) {
return std::__convert_to_tm<_Tm>(chrono::year_month_day{static_cast<chrono::sys_days>(__value)}, __value.weekday());
+ } else if constexpr (__is_hh_mm_ss<_ChronoT>) {
+ __result.tm_sec = __value.seconds().count();
+ __result.tm_min = __value.minutes().count();
+ // In libc++ hours is stored as a long. The type in std::tm is an int. So
+ // the overflow can only occur when hour uses more bits than an int
+ // provides.
+ if constexpr (sizeof(std::chrono::hours::rep) > sizeof(__result.tm_hour))
+ if (__value.hours().count() > std::numeric_limits<decltype(__result.tm_hour)>::max())
+ std::__throw_format_error("Formatting hh_mm_ss, encountered an hour overflow");
+ __result.tm_hour = __value.hours().count();
} else
static_assert(sizeof(_ChronoT) == 0, "Add the missing type specialization");
return __result;
}
-#endif //if _LIBCPP_STD_VER > 17
+#endif // if _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___CHRONO_CONVERT_TO_TM_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/day.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/day.h
index 35ecfcf9e5b..c907c036c14 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/day.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/day.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -29,7 +29,7 @@ class day {
private:
unsigned char __d_;
public:
- _LIBCPP_HIDE_FROM_ABI day() = default;
+ day() = default;
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr day(unsigned __val) noexcept : __d_(static_cast<unsigned char>(__val)) {}
_LIBCPP_HIDE_FROM_ABI inline constexpr day& operator++() noexcept { ++__d_; return *this; }
_LIBCPP_HIDE_FROM_ABI inline constexpr day operator++(int) noexcept { day __tmp = *this; ++(*this); return __tmp; }
@@ -79,6 +79,6 @@ day& day::operator-=(const days& __dd) noexcept
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_DAY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/duration.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/duration.h
index afcc38b5cfc..96e9671eb5a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/duration.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/duration.h
@@ -10,6 +10,8 @@
#ifndef _LIBCPP___CHRONO_DURATION_H
#define _LIBCPP___CHRONO_DURATION_H
+#include <__compare/ordering.h>
+#include <__compare/three_way_comparable.h>
#include <__config>
#include <__type_traits/common_type.h>
#include <__type_traits/enable_if.h>
@@ -130,7 +132,7 @@ duration_cast(const duration<_Rep, _Period>& __fd)
template <class _Rep>
struct _LIBCPP_TEMPLATE_VIS treat_as_floating_point : is_floating_point<_Rep> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Rep>
inline constexpr bool treat_as_floating_point_v = treat_as_floating_point<_Rep>::value;
#endif
@@ -144,7 +146,7 @@ public:
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep min() _NOEXCEPT {return numeric_limits<_Rep>::lowest();}
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _ToDuration, class _Rep, class _Period>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
typename enable_if
@@ -186,11 +188,11 @@ round(const duration<_Rep, _Period>& __d)
{
_ToDuration __lower = chrono::floor<_ToDuration>(__d);
_ToDuration __upper = __lower + _ToDuration{1};
- auto __lowerDiff = __d - __lower;
- auto __upperDiff = __upper - __d;
- if (__lowerDiff < __upperDiff)
+ auto __lower_diff = __d - __lower;
+ auto __upper_diff = __upper - __d;
+ if (__lower_diff < __upper_diff)
return __lower;
- if (__lowerDiff > __upperDiff)
+ if (__lower_diff > __upper_diff)
return __upper;
return __lower.count() & 1 ? __upper : __lower;
}
@@ -242,11 +244,10 @@ private:
rep __rep_;
public:
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
#ifndef _LIBCPP_CXX03_LANG
- duration() = default;
+ constexpr duration() = default;
#else
- duration() {}
+ _LIBCPP_HIDE_FROM_ABI duration() {}
#endif
template <class _Rep2>
@@ -307,7 +308,7 @@ typedef duration<long long, milli> milliseconds;
typedef duration<long long > seconds;
typedef duration< long, ratio< 60> > minutes;
typedef duration< long, ratio<3600> > hours;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef duration< int, ratio_multiply<ratio<24>, hours::period>> days;
typedef duration< int, ratio_multiply<ratio<7>, days::period>> weeks;
typedef duration< int, ratio_multiply<ratio<146097, 400>, days::period>> years;
@@ -343,6 +344,8 @@ operator==(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
return __duration_eq<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >()(__lhs, __rhs);
}
+#if _LIBCPP_STD_VER <= 17
+
// Duration !=
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
@@ -354,6 +357,8 @@ operator!=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
return !(__lhs == __rhs);
}
+#endif // _LIBCPP_STD_VER <= 17
+
// Duration <
template <class _LhsDuration, class _RhsDuration>
@@ -417,6 +422,20 @@ operator>=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
return !(__lhs < __rhs);
}
+#if _LIBCPP_STD_VER >= 20
+
+template<class _Rep1, class _Period1, class _Rep2, class _Period2>
+ requires three_way_comparable<common_type_t<_Rep1, _Rep2>>
+_LIBCPP_HIDE_FROM_ABI
+constexpr auto operator<=>(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+{
+ using _Ct = common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>;
+ return _Ct(__lhs).count() <=> _Ct(__rhs).count();
+}
+
+#endif // _LIBCPP_STD_VER >= 20
+
// Duration +
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
@@ -530,7 +549,7 @@ operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
} // namespace chrono
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
// Suffixes for duration literals [time.duration.literals]
inline namespace literals
{
@@ -609,7 +628,7 @@ namespace chrono { // hoist the literals into namespace std::chrono
using namespace literals::chrono_literals;
} // namespace chrono
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/file_clock.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/file_clock.h
index ef62b832959..557a880ed45 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/file_clock.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/file_clock.h
@@ -27,7 +27,7 @@ struct _FilesystemClock;
_LIBCPP_END_NAMESPACE_FILESYSTEM
#endif // !_LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -44,7 +44,7 @@ using file_time = time_point<file_clock, _Duration>;
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
@@ -63,9 +63,9 @@ struct _FilesystemClock {
_LIBCPP_EXPORTED_FROM_ABI
static _LIBCPP_CONSTEXPR_SINCE_CXX14 const bool is_steady = false;
- _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_FUNC_VIS static time_point now() noexcept;
+ _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_EXPORTED_FROM_ABI static time_point now() noexcept;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Duration>
_LIBCPP_HIDE_FROM_ABI
static chrono::sys_time<_Duration> to_sys(const chrono::file_time<_Duration>& __t) {
@@ -77,7 +77,7 @@ struct _FilesystemClock {
static chrono::file_time<_Duration> from_sys(const chrono::sys_time<_Duration>& __t) {
return chrono::file_time<_Duration>(__t.time_since_epoch());
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
};
_LIBCPP_END_NAMESPACE_FILESYSTEM
#endif // !_LIBCPP_CXX03_LANG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/formatter.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/formatter.h
index 2015783acbb..30ed360d4ef 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/formatter.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/formatter.h
@@ -11,9 +11,11 @@
#define _LIBCPP___CHRONO_FORMATTER_H
#include <__chrono/calendar.h>
+#include <__chrono/concepts.h>
#include <__chrono/convert_to_tm.h>
#include <__chrono/day.h>
#include <__chrono/duration.h>
+#include <__chrono/file_clock.h>
#include <__chrono/hh_mm_ss.h>
#include <__chrono/month.h>
#include <__chrono/month_weekday.h>
@@ -21,6 +23,7 @@
#include <__chrono/ostream.h>
#include <__chrono/parser_std_format_spec.h>
#include <__chrono/statically_widen.h>
+#include <__chrono/system_clock.h>
#include <__chrono/time_point.h>
#include <__chrono/weekday.h>
#include <__chrono/year.h>
@@ -35,13 +38,12 @@
#include <__format/format_functions.h>
#include <__format/format_parse_context.h>
#include <__format/formatter.h>
-#include <__format/formatter_output.h>
#include <__format/parser_std_format_spec.h>
+#include <__format/write_escaped.h>
#include <__memory/addressof.h>
#include <cmath>
#include <ctime>
#include <sstream>
-#include <string>
#include <string_view>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -50,7 +52,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+#if _LIBCPP_STD_VER >= 20
namespace __formatter {
@@ -75,13 +77,15 @@ namespace __formatter {
// For tiny ratios it's not possible to convert a duration to a hh_mm_ss. This
// fails compile-time due to the limited precision of the ratio (64-bit is too
// small). Therefore a duration uses its own conversion.
-template <class _CharT, class _Tp>
- requires(chrono::__is_duration<_Tp>::value)
-_LIBCPP_HIDE_FROM_ABI void __format_sub_seconds(const _Tp& __value, basic_stringstream<_CharT>& __sstr) {
+template <class _CharT, class _Rep, class _Period>
+_LIBCPP_HIDE_FROM_ABI void
+__format_sub_seconds(const chrono::duration<_Rep, _Period>& __value, basic_stringstream<_CharT>& __sstr) {
__sstr << std::use_facet<numpunct<_CharT>>(__sstr.getloc()).decimal_point();
+ using __duration = chrono::duration<_Rep, _Period>;
+
auto __fraction = __value - chrono::duration_cast<chrono::seconds>(__value);
- if constexpr (chrono::treat_as_floating_point_v<typename _Tp::rep>)
+ if constexpr (chrono::treat_as_floating_point_v<_Rep>)
// When the floating-point value has digits itself they are ignored based
// on the wording in [tab:time.format.spec]
// If the precision of the input cannot be exactly represented with
@@ -96,19 +100,44 @@ _LIBCPP_HIDE_FROM_ABI void __format_sub_seconds(const _Tp& __value, basic_string
// https://godbolt.org/z/6dsbnW8ba
std::format_to(std::ostreambuf_iterator<_CharT>{__sstr},
_LIBCPP_STATICALLY_WIDEN(_CharT, "{:0{}.0f}"),
- __fraction.count(),
- chrono::hh_mm_ss<_Tp>::fractional_width);
+ chrono::duration_cast<typename chrono::hh_mm_ss<__duration>::precision>(__fraction).count(),
+ chrono::hh_mm_ss<__duration>::fractional_width);
+ else
+ std::format_to(std::ostreambuf_iterator<_CharT>{__sstr},
+ _LIBCPP_STATICALLY_WIDEN(_CharT, "{:0{}}"),
+ chrono::duration_cast<typename chrono::hh_mm_ss<__duration>::precision>(__fraction).count(),
+ chrono::hh_mm_ss<__duration>::fractional_width);
+}
+
+template <class _CharT, __is_time_point _Tp>
+_LIBCPP_HIDE_FROM_ABI void __format_sub_seconds(const _Tp& __value, basic_stringstream<_CharT>& __sstr) {
+ __formatter::__format_sub_seconds(__value.time_since_epoch(), __sstr);
+}
+
+template <class _CharT, class _Duration>
+_LIBCPP_HIDE_FROM_ABI void
+__format_sub_seconds(const chrono::hh_mm_ss<_Duration>& __value, basic_stringstream<_CharT>& __sstr) {
+ __sstr << std::use_facet<numpunct<_CharT>>(__sstr.getloc()).decimal_point();
+ if constexpr (chrono::treat_as_floating_point_v<typename _Duration::rep>)
+ std::format_to(std::ostreambuf_iterator<_CharT>{__sstr},
+ _LIBCPP_STATICALLY_WIDEN(_CharT, "{:0{}.0f}"),
+ __value.subseconds().count(),
+ __value.fractional_width);
else
std::format_to(std::ostreambuf_iterator<_CharT>{__sstr},
_LIBCPP_STATICALLY_WIDEN(_CharT, "{:0{}}"),
- __fraction.count(),
- chrono::hh_mm_ss<_Tp>::fractional_width);
+ __value.subseconds().count(),
+ __value.fractional_width);
}
template <class _Tp>
consteval bool __use_fraction() {
- if constexpr (chrono::__is_duration<_Tp>::value)
+ if constexpr (__is_time_point<_Tp>)
+ return chrono::hh_mm_ss<typename _Tp::duration>::fractional_width;
+ else if constexpr (chrono::__is_duration<_Tp>::value)
return chrono::hh_mm_ss<_Tp>::fractional_width;
+ else if constexpr (__is_hh_mm_ss<_Tp>)
+ return _Tp::fractional_width;
else
return false;
}
@@ -169,7 +198,7 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs(
if (__year < 1000 || __year > 9999)
__formatter::__format_century(__year, __sstr);
else
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
+ __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
} break;
case _CharT('j'):
@@ -180,7 +209,7 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs(
// an intemediate step.
__sstr << chrono::duration_cast<chrono::days>(chrono::duration_cast<chrono::seconds>(__value)).count();
else
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
+ __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
break;
case _CharT('q'):
@@ -208,7 +237,7 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs(
case _CharT('S'):
case _CharT('T'):
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
+ __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
if constexpr (__use_fraction<_Tp>())
__formatter::__format_sub_seconds(__value, __sstr);
break;
@@ -240,20 +269,19 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs(
//
// TODO FMT evaluate the comment above.
-# if defined(__GLIBC__) || defined(_AIX)
+# if defined(__GLIBC__) || defined(_AIX) || defined(_WIN32)
case _CharT('y'):
// Glibc fails for negative values, AIX for positive values too.
__sstr << std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:02}"), (std::abs(__t.tm_year + 1900)) % 100);
break;
-# endif // defined(__GLIBC__) || defined(_AIX)
+# endif // defined(__GLIBC__) || defined(_AIX) || defined(_WIN32)
- case _CharT('Y'): {
- int __year = __t.tm_year + 1900;
- if (__year < 1000)
- __formatter::__format_year(__year, __sstr);
- else
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
- } break;
+ case _CharT('Y'):
+ // Depending on the platform's libc the range of supported years is
+ // limited. Intead of of testing all conditions use the internal
+ // implementation unconditionally.
+ __formatter::__format_year(__t.tm_year + 1900, __sstr);
+ break;
case _CharT('F'): {
int __year = __t.tm_year + 1900;
@@ -261,9 +289,14 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs(
__formatter::__format_year(__year, __sstr);
__sstr << std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "-{:02}-{:02}"), __t.tm_mon + 1, __t.tm_mday);
} else
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
+ __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
} break;
+ case _CharT('Z'):
+ // TODO FMT Add proper timezone support.
+ __sstr << _LIBCPP_STATICALLY_WIDEN(_CharT, "UTC");
+ break;
+
case _CharT('O'):
if constexpr (__use_fraction<_Tp>()) {
// Handle OS using the normal representation for the non-fractional
@@ -271,7 +304,7 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs(
// fractional part should be formatted.
if (*(__it + 1) == 'S') {
++__it;
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
+ __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
__formatter::__format_sub_seconds(__value, __sstr);
break;
}
@@ -281,7 +314,7 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs(
++__it;
[[fallthrough]];
default:
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
+ __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
break;
}
} else {
@@ -292,7 +325,9 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs(
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr bool __weekday_ok(const _Tp& __value) {
- if constexpr (same_as<_Tp, chrono::day>)
+ if constexpr (__is_time_point<_Tp>)
+ return true;
+ else if constexpr (same_as<_Tp, chrono::day>)
return true;
else if constexpr (same_as<_Tp, chrono::month>)
return __value.ok();
@@ -322,13 +357,17 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __weekday_ok(const _Tp& __value) {
return __value.weekday().ok();
else if constexpr (same_as<_Tp, chrono::year_month_weekday_last>)
return __value.weekday().ok();
+ else if constexpr (__is_hh_mm_ss<_Tp>)
+ return true;
else
static_assert(sizeof(_Tp) == 0, "Add the missing type specialization");
}
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr bool __weekday_name_ok(const _Tp& __value) {
- if constexpr (same_as<_Tp, chrono::day>)
+ if constexpr (__is_time_point<_Tp>)
+ return true;
+ else if constexpr (same_as<_Tp, chrono::day>)
return true;
else if constexpr (same_as<_Tp, chrono::month>)
return __value.ok();
@@ -358,13 +397,17 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __weekday_name_ok(const _Tp& __value) {
return __value.weekday().ok();
else if constexpr (same_as<_Tp, chrono::year_month_weekday_last>)
return __value.weekday().ok();
+ else if constexpr (__is_hh_mm_ss<_Tp>)
+ return true;
else
static_assert(sizeof(_Tp) == 0, "Add the missing type specialization");
}
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr bool __date_ok(const _Tp& __value) {
- if constexpr (same_as<_Tp, chrono::day>)
+ if constexpr (__is_time_point<_Tp>)
+ return true;
+ else if constexpr (same_as<_Tp, chrono::day>)
return true;
else if constexpr (same_as<_Tp, chrono::month>)
return __value.ok();
@@ -394,13 +437,17 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __date_ok(const _Tp& __value) {
return __value.ok();
else if constexpr (same_as<_Tp, chrono::year_month_weekday_last>)
return __value.ok();
+ else if constexpr (__is_hh_mm_ss<_Tp>)
+ return true;
else
static_assert(sizeof(_Tp) == 0, "Add the missing type specialization");
}
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr bool __month_name_ok(const _Tp& __value) {
- if constexpr (same_as<_Tp, chrono::day>)
+ if constexpr (__is_time_point<_Tp>)
+ return true;
+ else if constexpr (same_as<_Tp, chrono::day>)
return true;
else if constexpr (same_as<_Tp, chrono::month>)
return __value.ok();
@@ -430,16 +477,18 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __month_name_ok(const _Tp& __value) {
return __value.month().ok();
else if constexpr (same_as<_Tp, chrono::year_month_weekday_last>)
return __value.month().ok();
+ else if constexpr (__is_hh_mm_ss<_Tp>)
+ return true;
else
static_assert(sizeof(_Tp) == 0, "Add the missing type specialization");
}
-template <class _CharT, class _Tp>
+template <class _CharT, class _Tp, class _FormatContext>
_LIBCPP_HIDE_FROM_ABI auto
__format_chrono(const _Tp& __value,
- auto& __ctx,
+ _FormatContext& __ctx,
__format_spec::__parsed_specifications<_CharT> __specs,
- basic_string_view<_CharT> __chrono_specs) -> decltype(__ctx.out()) {
+ basic_string_view<_CharT> __chrono_specs) {
basic_stringstream<_CharT> __sstr;
// [time.format]/2
// 2.1 - the "C" locale if the L option is not present in chrono-format-spec, otherwise
@@ -464,42 +513,63 @@ __format_chrono(const _Tp& __value,
} else {
// Test __weekday_name_ before __weekday_ to give a better error.
if (__specs.__chrono_.__weekday_name_ && !__formatter::__weekday_name_ok(__value))
- std::__throw_format_error("formatting a weekday name needs a valid weekday");
+ std::__throw_format_error("Formatting a weekday name needs a valid weekday");
if (__specs.__chrono_.__weekday_ && !__formatter::__weekday_ok(__value))
- std::__throw_format_error("formatting a weekday needs a valid weekday");
+ std::__throw_format_error("Formatting a weekday needs a valid weekday");
if (__specs.__chrono_.__day_of_year_ && !__formatter::__date_ok(__value))
- std::__throw_format_error("formatting a day of year needs a valid date");
+ std::__throw_format_error("Formatting a day of year needs a valid date");
if (__specs.__chrono_.__week_of_year_ && !__formatter::__date_ok(__value))
- std::__throw_format_error("formatting a week of year needs a valid date");
+ std::__throw_format_error("Formatting a week of year needs a valid date");
if (__specs.__chrono_.__month_name_ && !__formatter::__month_name_ok(__value))
- std::__throw_format_error("formatting a month name from an invalid month number");
+ std::__throw_format_error("Formatting a month name from an invalid month number");
+
+ if constexpr (__is_hh_mm_ss<_Tp>) {
+ // Note this is a pedantic intepretation of the Standard. A hh_mm_ss
+ // is no longer a time_of_day and can store an arbitrary number of
+ // hours. A number of hours in a 12 or 24 hour clock can't represent
+ // 24 hours or more. The functions std::chrono::make12 and
+ // std::chrono::make24 reaffirm this view point.
+ //
+ // Interestingly this will be the only output stream function that
+ // throws.
+ //
+ // TODO FMT The wording probably needs to be adapted to
+ // - The displayed hours is hh_mm_ss.hours() % 24
+ // - It should probably allow %j in the same fashion as duration.
+ // - The stream formatter should change its output when hours >= 24
+ // - Write it as not valid,
+ // - or write the number of days.
+ if (__specs.__chrono_.__hour_ && __value.hours().count() > 23)
+ std::__throw_format_error("Formatting a hour needs a valid value");
+
+ if (__value.is_negative())
+ __sstr << _CharT('-');
+ }
__formatter::__format_chrono_using_chrono_specs(__value, __sstr, __chrono_specs);
}
}
- // TODO FMT Use the stringstream's view after P0408R7 has been implemented.
- basic_string<_CharT> __str = __sstr.str();
- return __formatter::__write_string(basic_string_view<_CharT>{__str}, __ctx.out(), __specs);
+ return __formatter::__write_string(__sstr.view(), __ctx.out(), __specs);
}
} // namespace __formatter
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_chrono {
+struct _LIBCPP_TEMPLATE_VIS __formatter_chrono {
public:
- _LIBCPP_HIDE_FROM_ABI constexpr auto __parse(
- basic_format_parse_context<_CharT>& __parse_ctx, __format_spec::__fields __fields, __format_spec::__flags __flags)
- -> decltype(__parse_ctx.begin()) {
- return __parser_.__parse(__parse_ctx, __fields, __flags);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator
+ __parse(_ParseContext& __ctx, __format_spec::__fields __fields, __format_spec::__flags __flags) {
+ return __parser_.__parse(__ctx, __fields, __flags);
}
- template <class _Tp>
- _LIBCPP_HIDE_FROM_ABI auto format(const _Tp& __value, auto& __ctx) const -> decltype(__ctx.out()) const {
+ template <class _Tp, class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(const _Tp& __value, _FormatContext& __ctx) const {
return __formatter::__format_chrono(
__value, __ctx, __parser_.__parser_.__get_parsed_chrono_specifications(__ctx), __parser_.__chrono_specs_);
}
@@ -507,13 +577,47 @@ public:
__format_spec::__parser_chrono<_CharT> __parser_;
};
+template <class _Duration, __fmt_char_type _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::sys_time<_Duration>, _CharT> : public __formatter_chrono<_CharT> {
+public:
+ using _Base = __formatter_chrono<_CharT>;
+
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__clock);
+ }
+};
+
+template <class _Duration, __fmt_char_type _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::file_time<_Duration>, _CharT> : public __formatter_chrono<_CharT> {
+public:
+ using _Base = __formatter_chrono<_CharT>;
+
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__clock);
+ }
+};
+
+template <class _Duration, __fmt_char_type _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::local_time<_Duration>, _CharT> : public __formatter_chrono<_CharT> {
+public:
+ using _Base = __formatter_chrono<_CharT>;
+
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ // The flags are not __clock since there is no associated time-zone.
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__date_time);
+ }
+};
+
template <class _Rep, class _Period, __fmt_char_type _CharT>
struct formatter<chrono::duration<_Rep, _Period>, _CharT> : public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
// [time.format]/1
// Giving a precision specification in the chrono-format-spec is valid only
// for std::chrono::duration types where the representation type Rep is a
@@ -523,193 +627,203 @@ public:
//
// Note this doesn't refer to chrono::treat_as_floating_point_v<_Rep>.
if constexpr (std::floating_point<_Rep>)
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono_fractional, __format_spec::__flags::__duration);
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono_fractional, __format_spec::__flags::__duration);
else
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__duration);
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__duration);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::day, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::day, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__day);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__day);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::month, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::month, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__month);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__month);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::year, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::year, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__year);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__year);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::weekday, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::weekday, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__weekday);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__weekday);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::weekday_indexed, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::weekday_indexed, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__weekday);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__weekday);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::weekday_last, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::weekday_last, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__weekday);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__weekday);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::month_day, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::month_day, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__month_day);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__month_day);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::month_day_last, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::month_day_last, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__month);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__month);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::month_weekday, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::month_weekday, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__month_weekday);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__month_weekday);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::month_weekday_last, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::month_weekday_last, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__month_weekday);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__month_weekday);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::year_month, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::year_month, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__year_month);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__year_month);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::year_month_day, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::year_month_day, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__date);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__date);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::year_month_day_last, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::year_month_day_last, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__date);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__date);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::year_month_weekday, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::year_month_weekday, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__date);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__date);
}
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::year_month_weekday_last, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::year_month_weekday_last, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__date);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__date);
}
};
-#endif // if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+template <class _Duration, __fmt_char_type _CharT>
+struct formatter<chrono::hh_mm_ss<_Duration>, _CharT> : public __formatter_chrono<_CharT> {
+public:
+ using _Base = __formatter_chrono<_CharT>;
+
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__time);
+ }
+};
+#endif // if _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/hh_mm_ss.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/hh_mm_ss.h
index fd61cbe8f84..5bd452e57fa 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/hh_mm_ss.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/hh_mm_ss.h
@@ -13,14 +13,14 @@
#include <__chrono/duration.h>
#include <__chrono/time_point.h>
#include <__config>
+#include <__type_traits/common_type.h>
#include <ratio>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -85,6 +85,7 @@ private:
chrono::seconds __s_;
precision __f_;
};
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(hh_mm_ss);
_LIBCPP_HIDE_FROM_ABI constexpr bool is_am(const hours& __h) noexcept { return __h >= hours( 0) && __h < hours(12); }
_LIBCPP_HIDE_FROM_ABI constexpr bool is_pm(const hours& __h) noexcept { return __h >= hours(12) && __h < hours(24); }
@@ -107,6 +108,6 @@ _LIBCPP_HIDE_FROM_ABI constexpr hours make24(const hours& __h, bool __is_pm) noe
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_HH_MM_SS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/literals.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/literals.h
index 50529bd44ad..28ddc43a2c0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/literals.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/literals.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -44,6 +44,6 @@ namespace chrono { // hoist the literals into namespace std::chrono
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_LITERALS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/month.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/month.h
index e929f248842..7566e4ed299 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/month.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/month.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -29,11 +29,11 @@ class month {
private:
unsigned char __m_;
public:
- _LIBCPP_HIDE_FROM_ABI month() = default;
+ month() = default;
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr month(unsigned __val) noexcept : __m_(static_cast<unsigned char>(__val)) {}
- _LIBCPP_HIDE_FROM_ABI inline constexpr month& operator++() noexcept { ++__m_; return *this; }
+ _LIBCPP_HIDE_FROM_ABI inline constexpr month& operator++() noexcept { *this += months{1}; return *this; }
_LIBCPP_HIDE_FROM_ABI inline constexpr month operator++(int) noexcept { month __tmp = *this; ++(*this); return __tmp; }
- _LIBCPP_HIDE_FROM_ABI inline constexpr month& operator--() noexcept { --__m_; return *this; }
+ _LIBCPP_HIDE_FROM_ABI inline constexpr month& operator--() noexcept { *this -= months{1}; return *this; }
_LIBCPP_HIDE_FROM_ABI inline constexpr month operator--(int) noexcept { month __tmp = *this; --(*this); return __tmp; }
_LIBCPP_HIDE_FROM_ABI constexpr month& operator+=(const months& __m1) noexcept;
_LIBCPP_HIDE_FROM_ABI constexpr month& operator-=(const months& __m1) noexcept;
@@ -98,6 +98,6 @@ inline constexpr month December{12};
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_MONTH_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/month_weekday.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/month_weekday.h
index 01cdf76d84b..eb9e42d01f8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/month_weekday.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/month_weekday.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -42,10 +42,6 @@ bool operator==(const month_weekday& __lhs, const month_weekday& __rhs) noexcept
{ return __lhs.month() == __rhs.month() && __lhs.weekday_indexed() == __rhs.weekday_indexed(); }
_LIBCPP_HIDE_FROM_ABI inline constexpr
-bool operator!=(const month_weekday& __lhs, const month_weekday& __rhs) noexcept
-{ return !(__lhs == __rhs); }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr
month_weekday operator/(const month& __lhs, const weekday_indexed& __rhs) noexcept
{ return month_weekday{__lhs, __rhs}; }
@@ -78,11 +74,6 @@ bool operator==(const month_weekday_last& __lhs, const month_weekday_last& __rhs
{ return __lhs.month() == __rhs.month() && __lhs.weekday_last() == __rhs.weekday_last(); }
_LIBCPP_HIDE_FROM_ABI inline constexpr
-bool operator!=(const month_weekday_last& __lhs, const month_weekday_last& __rhs) noexcept
-{ return !(__lhs == __rhs); }
-
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr
month_weekday_last operator/(const month& __lhs, const weekday_last& __rhs) noexcept
{ return month_weekday_last{__lhs, __rhs}; }
@@ -101,6 +92,6 @@ month_weekday_last operator/(const weekday_last& __lhs, int __rhs) noexcept
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_MONTH_WEEKDAY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/monthday.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/monthday.h
index c0ee3e4a94f..03fd7503a6b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/monthday.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/monthday.h
@@ -20,7 +20,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -32,7 +32,7 @@ private:
chrono::month __m_;
chrono::day __d_;
public:
- _LIBCPP_HIDE_FROM_ABI month_day() = default;
+ month_day() = default;
_LIBCPP_HIDE_FROM_ABI constexpr month_day(const chrono::month& __mval, const chrono::day& __dval) noexcept
: __m_{__mval}, __d_{__dval} {}
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
@@ -124,6 +124,6 @@ month_day_last operator/(last_spec, int __rhs) noexcept
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_MONTHDAY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/ostream.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/ostream.h
index 30a04bd2658..f171944b5ca 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/ostream.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/ostream.h
@@ -10,12 +10,16 @@
#ifndef _LIBCPP___CHRONO_OSTREAM_H
#define _LIBCPP___CHRONO_OSTREAM_H
+#include <__chrono/calendar.h>
#include <__chrono/day.h>
#include <__chrono/duration.h>
+#include <__chrono/file_clock.h>
+#include <__chrono/hh_mm_ss.h>
#include <__chrono/month.h>
#include <__chrono/month_weekday.h>
#include <__chrono/monthday.h>
#include <__chrono/statically_widen.h>
+#include <__chrono/system_clock.h>
#include <__chrono/weekday.h>
#include <__chrono/year.h>
#include <__chrono/year_month.h>
@@ -33,10 +37,28 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+#if _LIBCPP_STD_VER >= 20
namespace chrono {
+template <class _CharT, class _Traits, class _Duration>
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os, const sys_time<_Duration> __tp) {
+ return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%F %T}"), __tp);
+}
+
+template <class _CharT, class _Traits, class _Duration>
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os, const file_time<_Duration> __tp) {
+ return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%F %T}"), __tp);
+}
+
+template <class _CharT, class _Traits, class _Duration>
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os, const local_time<_Duration> __tp) {
+ return __os << sys_time<_Duration>{__tp.time_since_epoch()};
+}
+
// Depending on the type the return is a const _CharT* or a basic_string<_CharT>
template <class _CharT, class _Period>
_LIBCPP_HIDE_FROM_ABI auto __units_suffix() {
@@ -92,7 +114,7 @@ _LIBCPP_HIDE_FROM_ABI auto __units_suffix() {
}
template <class _CharT, class _Traits, class _Rep, class _Period>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const duration<_Rep, _Period>& __d) {
basic_ostringstream<_CharT, _Traits> __s;
__s.flags(__os.flags());
@@ -103,21 +125,19 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const duration<_Rep, _Period>&
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
-operator<<(basic_ostream<_CharT, _Traits>& __os, const day& __d) {
- return __os
- << (__d.ok()
- ? std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%d}"), __d)
- // Note this error differs from the wording of the Standard. The
- // Standard wording doesn't work well on AIX or Windows. There
- // the formatted day seems to be either modulo 100 or completely
- // omitted. Judging by the wording this is valid.
- // TODO FMT Write a paper of file an LWG issue.
- : std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:02} is not a valid day"), static_cast<unsigned>(__d)));
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const day& __d) {
+ return __os << (__d.ok() ? std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%d}"), __d)
+ // Note this error differs from the wording of the Standard. The
+ // Standard wording doesn't work well on AIX or Windows. There
+ // the formatted day seems to be either modulo 100 or completely
+ // omitted. Judging by the wording this is valid.
+ // TODO FMT Write a paper of file an LWG issue.
+ : std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:02} is not a valid day"),
+ static_cast<unsigned>(__d)));
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const month& __m) {
return __os << (__m.ok() ? std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%b}"), __m)
: std::format(__os.getloc(),
@@ -126,14 +146,14 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const month& __m) {
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const year& __y) {
return __os << (__y.ok() ? std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%Y}"), __y)
: std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%Y} is not a valid year"), __y));
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const weekday& __wd) {
return __os << (__wd.ok() ? std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%a}"), __wd)
: std::format(__os.getloc(), // TODO FMT Standard mandated locale isn't used.
@@ -142,7 +162,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const weekday& __wd) {
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const weekday_indexed& __wdi) {
auto __i = __wdi.index();
return __os << (__i >= 1 && __i <= 5
@@ -154,13 +174,13 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const weekday_indexed& __wdi) {
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const weekday_last& __wdl) {
return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}[last]"), __wdl.weekday());
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const month_day& __md) {
// TODO FMT The Standard allows 30th of February to be printed.
// It would be nice to show an error message instead.
@@ -168,47 +188,47 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const month_day& __md) {
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const month_day_last& __mdl) {
return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}/last"), __mdl.month());
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const month_weekday& __mwd) {
return __os << std::format(
__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}/{:L}"), __mwd.month(), __mwd.weekday_indexed());
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const month_weekday_last& __mwdl) {
return __os << std::format(
__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}/{:L}"), __mwdl.month(), __mwdl.weekday_last());
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month& __ym) {
return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{}/{:L}"), __ym.year(), __ym.month());
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_day& __ymd) {
return __os << (__ymd.ok() ? std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%F}"), __ymd)
: std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%F} is not a valid date"), __ymd));
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_day_last& __ymdl) {
return __os << std::format(
__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{}/{:L}"), __ymdl.year(), __ymdl.month_day_last());
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_weekday& __ymwd) {
return __os << std::format(
__os.getloc(),
@@ -219,7 +239,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_weekday& __ymw
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_weekday_last& __ymwdl) {
return __os << std::format(
__os.getloc(),
@@ -229,9 +249,15 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_weekday_last&
__ymwdl.weekday_last());
}
+template <class _CharT, class _Traits, class _Duration>
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os, const hh_mm_ss<_Duration> __hms) {
+ return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%T}"), __hms);
+}
+
} // namespace chrono
-#endif //if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+#endif // if _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/parser_std_format_spec.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/parser_std_format_spec.h
index dbcfe6da608..296be8794ec 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/parser_std_format_spec.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/parser_std_format_spec.h
@@ -24,7 +24,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+#if _LIBCPP_STD_VER >= 20
namespace __format_spec {
@@ -137,17 +137,19 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __validate_time_zone(__flags __flags) {
template <class _CharT>
class _LIBCPP_TEMPLATE_VIS __parser_chrono {
+ using _ConstIterator = typename basic_format_parse_context<_CharT>::const_iterator;
+
public:
- _LIBCPP_HIDE_FROM_ABI constexpr auto
- __parse(basic_format_parse_context<_CharT>& __parse_ctx, __fields __fields, __flags __flags)
- -> decltype(__parse_ctx.begin()) {
- const _CharT* __begin = __parser_.__parse(__parse_ctx, __fields);
- const _CharT* __end = __parse_ctx.end();
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator
+ __parse(_ParseContext& __ctx, __fields __fields, __flags __flags) {
+ _ConstIterator __begin = __parser_.__parse(__ctx, __fields);
+ _ConstIterator __end = __ctx.end();
if (__begin == __end)
return __begin;
- const _CharT* __last = __parse_chrono_specs(__begin, __end, __flags);
- __chrono_specs_ = basic_string_view<_CharT>{__begin, __last};
+ _ConstIterator __last = __parse_chrono_specs(__begin, __end, __flags);
+ __chrono_specs_ = basic_string_view<_CharT>{__begin, __last};
return __last;
}
@@ -156,19 +158,20 @@ public:
basic_string_view<_CharT> __chrono_specs_;
private:
- _LIBCPP_HIDE_FROM_ABI constexpr const _CharT*
- __parse_chrono_specs(const _CharT* __begin, const _CharT* __end, __flags __flags) {
- _LIBCPP_ASSERT(__begin != __end,
- "When called with an empty input the function will cause "
- "undefined behavior by evaluating data not in the input");
+ _LIBCPP_HIDE_FROM_ABI constexpr _ConstIterator
+ __parse_chrono_specs(_ConstIterator __begin, _ConstIterator __end, __flags __flags) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __begin != __end,
+ "When called with an empty input the function will cause "
+ "undefined behavior by evaluating data not in the input");
if (*__begin != _CharT('%') && *__begin != _CharT('}'))
- std::__throw_format_error("Expected '%' or '}' in the chrono format-string");
+ std::__throw_format_error("The format specifier expects a '%' or a '}'");
do {
switch (*__begin) {
case _CharT('{'):
- std::__throw_format_error("The chrono-specs contains a '{'");
+ std::__throw_format_error("The chrono specifiers contain a '{'");
case _CharT('}'):
return __begin;
@@ -190,10 +193,10 @@ private:
/// \pre *__begin == '%'
/// \post __begin points at the end parsed conversion-spec
_LIBCPP_HIDE_FROM_ABI constexpr void
- __parse_conversion_spec(const _CharT*& __begin, const _CharT* __end, __flags __flags) {
+ __parse_conversion_spec(_ConstIterator& __begin, _ConstIterator __end, __flags __flags) {
++__begin;
if (__begin == __end)
- std::__throw_format_error("End of input while parsing the modifier chrono conversion-spec");
+ std::__throw_format_error("End of input while parsing a conversion specifier");
switch (*__begin) {
case _CharT('n'):
@@ -212,6 +215,7 @@ private:
case _CharT('p'): // TODO FMT does the formater require an hour or a time?
case _CharT('H'):
case _CharT('I'):
+ __parser_.__hour_ = true;
__validate_hour(__flags);
break;
@@ -219,6 +223,7 @@ private:
case _CharT('R'):
case _CharT('T'):
case _CharT('X'):
+ __parser_.__hour_ = true;
__format_spec::__validate_time(__flags);
break;
@@ -304,13 +309,14 @@ private:
/// \pre *__begin == 'E'
/// \post __begin is incremented by one.
_LIBCPP_HIDE_FROM_ABI constexpr void
- __parse_modifier_E(const _CharT*& __begin, const _CharT* __end, __flags __flags) {
+ __parse_modifier_E(_ConstIterator& __begin, _ConstIterator __end, __flags __flags) {
++__begin;
if (__begin == __end)
std::__throw_format_error("End of input while parsing the modifier E");
switch (*__begin) {
case _CharT('X'):
+ __parser_.__hour_ = true;
__format_spec::__validate_time(__flags);
break;
@@ -343,7 +349,7 @@ private:
/// \pre *__begin == 'O'
/// \post __begin is incremented by one.
_LIBCPP_HIDE_FROM_ABI constexpr void
- __parse_modifier_O(const _CharT*& __begin, const _CharT* __end, __flags __flags) {
+ __parse_modifier_O(_ConstIterator& __begin, _ConstIterator __end, __flags __flags) {
++__begin;
if (__begin == __end)
std::__throw_format_error("End of input while parsing the modifier O");
@@ -359,6 +365,7 @@ private:
case _CharT('I'):
case _CharT('H'):
+ __parser_.__hour_ = true;
__format_spec::__validate_hour(__flags);
break;
@@ -403,7 +410,7 @@ private:
} // namespace __format_spec
-#endif //_LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/statically_widen.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/statically_widen.h
index 360b6c2c7d5..a18c46f057a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/statically_widen.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/statically_widen.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <__fmt_char_type _CharT>
@@ -33,7 +33,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr const _CharT* __statically_widen(const char* __s
return __wstr;
}
# define _LIBCPP_STATICALLY_WIDEN(_CharT, __str) ::std::__statically_widen<_CharT>(__str, L##__str)
-# else // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+# else // _LIBCPP_HAS_NO_WIDE_CHARACTERS
// Without this indirection the unit test test/libcxx/modules_include.sh.cpp
// fails for the CI build "No wide characters". This seems like a bug.
@@ -45,7 +45,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr const _CharT* __statically_widen(const char* __s
# define _LIBCPP_STATICALLY_WIDEN(_CharT, __str) ::std::__statically_widen<_CharT>(__str)
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/steady_clock.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/steady_clock.h
index ba83351738d..cdcd2fa0d97 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/steady_clock.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/steady_clock.h
@@ -24,7 +24,7 @@ namespace chrono
{
#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
-class _LIBCPP_TYPE_VIS steady_clock
+class _LIBCPP_EXPORTED_FROM_ABI steady_clock
{
public:
typedef nanoseconds duration;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/system_clock.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/system_clock.h
index 331db468013..06fe071df2b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/system_clock.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/system_clock.h
@@ -24,7 +24,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace chrono
{
-class _LIBCPP_TYPE_VIS system_clock
+class _LIBCPP_EXPORTED_FROM_ABI system_clock
{
public:
typedef microseconds duration;
@@ -38,7 +38,7 @@ public:
static time_point from_time_t(time_t __t) _NOEXCEPT;
};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Duration>
using sys_time = time_point<system_clock, _Duration>;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/time_point.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/time_point.h
index 8a8fa2176d6..c14835401fa 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/time_point.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/time_point.h
@@ -11,6 +11,8 @@
#define _LIBCPP___CHRONO_TIME_POINT_H
#include <__chrono/duration.h>
+#include <__compare/ordering.h>
+#include <__compare/three_way_comparable.h>
#include <__config>
#include <__type_traits/common_type.h>
#include <__type_traits/enable_if.h>
@@ -90,7 +92,7 @@ time_point_cast(const time_point<_Clock, _Duration>& __t)
return time_point<_Clock, _ToDuration>(chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _ToDuration, class _Clock, class _Duration>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
typename enable_if
@@ -138,7 +140,7 @@ abs(duration<_Rep, _Period> __d)
{
return __d >= __d.zero() ? +__d : -__d;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
// time_point ==
@@ -150,6 +152,8 @@ operator==(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
return __lhs.time_since_epoch() == __rhs.time_since_epoch();
}
+#if _LIBCPP_STD_VER <= 17
+
// time_point !=
template <class _Clock, class _Duration1, class _Duration2>
@@ -160,6 +164,8 @@ operator!=(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
return !(__lhs == __rhs);
}
+#endif // _LIBCPP_STD_VER <= 17
+
// time_point <
template <class _Clock, class _Duration1, class _Duration2>
@@ -200,6 +206,16 @@ operator>=(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
return !(__lhs < __rhs);
}
+#if _LIBCPP_STD_VER >= 20
+
+template <class _Clock, class _Duration1, three_way_comparable_with<_Duration1> _Duration2>
+_LIBCPP_HIDE_FROM_ABI constexpr auto
+operator<=>(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) {
+ return __lhs.time_since_epoch() <=> __rhs.time_since_epoch();
+}
+
+#endif // _LIBCPP_STD_VER >= 20
+
// time_point operator+(time_point x, duration y);
template <class _Clock, class _Duration1, class _Rep2, class _Period2>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/weekday.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/weekday.h
index e0bc8a4cae2..776d8ed3124 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/weekday.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/weekday.h
@@ -20,7 +20,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -35,7 +35,7 @@ private:
unsigned char __wd_;
_LIBCPP_HIDE_FROM_ABI static constexpr unsigned char __weekday_from_days(int __days) noexcept;
public:
- _LIBCPP_HIDE_FROM_ABI weekday() = default;
+ weekday() = default;
_LIBCPP_HIDE_FROM_ABI inline explicit constexpr weekday(unsigned __val) noexcept : __wd_(static_cast<unsigned char>(__val == 7 ? 0 : __val)) {}
_LIBCPP_HIDE_FROM_ABI inline constexpr weekday(const sys_days& __sysd) noexcept
: __wd_(__weekday_from_days(__sysd.time_since_epoch().count())) {}
@@ -70,10 +70,6 @@ bool operator==(const weekday& __lhs, const weekday& __rhs) noexcept
{ return __lhs.c_encoding() == __rhs.c_encoding(); }
_LIBCPP_HIDE_FROM_ABI inline constexpr
-bool operator!=(const weekday& __lhs, const weekday& __rhs) noexcept
-{ return !(__lhs == __rhs); }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr
bool operator< (const weekday& __lhs, const weekday& __rhs) noexcept
{ return __lhs.c_encoding() < __rhs.c_encoding(); }
@@ -126,7 +122,7 @@ private:
chrono::weekday __wd_;
unsigned char __idx_;
public:
- _LIBCPP_HIDE_FROM_ABI weekday_indexed() = default;
+ weekday_indexed() = default;
_LIBCPP_HIDE_FROM_ABI inline constexpr weekday_indexed(const chrono::weekday& __wdval, unsigned __idxval) noexcept
: __wd_{__wdval}, __idx_(__idxval) {}
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wd_; }
@@ -138,11 +134,6 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr
bool operator==(const weekday_indexed& __lhs, const weekday_indexed& __rhs) noexcept
{ return __lhs.weekday() == __rhs.weekday() && __lhs.index() == __rhs.index(); }
-_LIBCPP_HIDE_FROM_ABI inline constexpr
-bool operator!=(const weekday_indexed& __lhs, const weekday_indexed& __rhs) noexcept
-{ return !(__lhs == __rhs); }
-
-
class weekday_last {
private:
chrono::weekday __wd_;
@@ -158,10 +149,6 @@ bool operator==(const weekday_last& __lhs, const weekday_last& __rhs) noexcept
{ return __lhs.weekday() == __rhs.weekday(); }
_LIBCPP_HIDE_FROM_ABI inline constexpr
-bool operator!=(const weekday_last& __lhs, const weekday_last& __rhs) noexcept
-{ return !(__lhs == __rhs); }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr
weekday_indexed weekday::operator[](unsigned __index) const noexcept { return weekday_indexed{*this, __index}; }
_LIBCPP_HIDE_FROM_ABI inline constexpr
@@ -180,6 +167,6 @@ inline constexpr weekday Saturday{6};
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_WEEKDAY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/year.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/year.h
index 79ee8a02b8f..14bcbdafdd8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/year.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/year.h
@@ -22,7 +22,7 @@
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -33,7 +33,7 @@ class year {
private:
short __y_;
public:
- _LIBCPP_HIDE_FROM_ABI year() = default;
+ year() = default;
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr year(int __val) noexcept : __y_(static_cast<short>(__val)) {}
_LIBCPP_HIDE_FROM_ABI inline constexpr year& operator++() noexcept { ++__y_; return *this; }
@@ -95,7 +95,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool year::ok() const noexcept {
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_POP_MACROS
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/year_month.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/year_month.h
index 9f1e65c8c83..f4eea8427fc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/year_month.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/year_month.h
@@ -20,7 +20,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -31,7 +31,7 @@ class year_month {
chrono::year __y_;
chrono::month __m_;
public:
- _LIBCPP_HIDE_FROM_ABI year_month() = default;
+ year_month() = default;
_LIBCPP_HIDE_FROM_ABI constexpr year_month(const chrono::year& __yval, const chrono::month& __mval) noexcept
: __y_{__yval}, __m_{__mval} {}
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }
@@ -96,6 +96,6 @@ year_month operator-(const year_month& __lhs, const years& __rhs) noexcept
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_YEAR_MONTH_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/year_month_day.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/year_month_day.h
index b74901470c6..ed5903f7d3f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/year_month_day.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/year_month_day.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -42,7 +42,7 @@ private:
chrono::month __m_;
chrono::day __d_;
public:
- _LIBCPP_HIDE_FROM_ABI year_month_day() = default;
+ year_month_day() = default;
_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day(
const chrono::year& __yval, const chrono::month& __mval, const chrono::day& __dval) noexcept
: __y_{__yval}, __m_{__mval}, __d_{__dval} {}
@@ -302,6 +302,6 @@ bool year_month_day::ok() const noexcept
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_YEAR_MONTH_DAY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/year_month_weekday.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/year_month_weekday.h
index 6604deaf12c..4b5cb492a19 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__chrono/year_month_weekday.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/year_month_weekday.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -39,7 +39,7 @@ class year_month_weekday {
chrono::month __m_;
chrono::weekday_indexed __wdi_;
public:
- _LIBCPP_HIDE_FROM_ABI year_month_weekday() = default;
+ year_month_weekday() = default;
_LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday(const chrono::year& __yval, const chrono::month& __mval,
const chrono::weekday_indexed& __wdival) noexcept
: __y_{__yval}, __m_{__mval}, __wdi_{__wdival} {}
@@ -99,10 +99,6 @@ bool operator==(const year_month_weekday& __lhs, const year_month_weekday& __rhs
{ return __lhs.year() == __rhs.year() && __lhs.month() == __rhs.month() && __lhs.weekday_indexed() == __rhs.weekday_indexed(); }
_LIBCPP_HIDE_FROM_ABI inline constexpr
-bool operator!=(const year_month_weekday& __lhs, const year_month_weekday& __rhs) noexcept
-{ return !(__lhs == __rhs); }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr
year_month_weekday operator/(const year_month& __lhs, const weekday_indexed& __rhs) noexcept
{ return year_month_weekday{__lhs.year(), __lhs.month(), __rhs}; }
@@ -192,11 +188,6 @@ bool operator==(const year_month_weekday_last& __lhs, const year_month_weekday_l
{ return __lhs.year() == __rhs.year() && __lhs.month() == __rhs.month() && __lhs.weekday_last() == __rhs.weekday_last(); }
_LIBCPP_HIDE_FROM_ABI inline constexpr
-bool operator!=(const year_month_weekday_last& __lhs, const year_month_weekday_last& __rhs) noexcept
-{ return !(__lhs == __rhs); }
-
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr
year_month_weekday_last operator/(const year_month& __lhs, const weekday_last& __rhs) noexcept
{ return year_month_weekday_last{__lhs.year(), __lhs.month(), __rhs}; }
@@ -250,6 +241,6 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last& year_month_weekd
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_YEAR_MONTH_WEEKDAY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/common_comparison_category.h b/contrib/libs/cxxsupp/libcxx/include/__compare/common_comparison_category.h
index 06c4b28491e..5fad99bf5ce 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__compare/common_comparison_category.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__compare/common_comparison_category.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __comp_detail {
@@ -65,14 +65,14 @@ _LIBCPP_HIDE_FROM_ABI
constexpr auto __get_comp_type() {
using _CCC = _ClassifyCompCategory;
constexpr _CCC __type_kinds[] = {_StrongOrd, __type_to_enum<_Ts>()...};
- constexpr _CCC _Cat = __comp_detail::__compute_comp_type(__type_kinds);
- if constexpr (_Cat == _None)
+ constexpr _CCC __cat = __comp_detail::__compute_comp_type(__type_kinds);
+ if constexpr (__cat == _None)
return void();
- else if constexpr (_Cat == _PartialOrd)
+ else if constexpr (__cat == _PartialOrd)
return partial_ordering::equivalent;
- else if constexpr (_Cat == _WeakOrd)
+ else if constexpr (__cat == _WeakOrd)
return weak_ordering::equivalent;
- else if constexpr (_Cat == _StrongOrd)
+ else if constexpr (__cat == _StrongOrd)
return strong_ordering::equivalent;
else
static_assert(_False, "unhandled case");
@@ -88,7 +88,7 @@ struct _LIBCPP_TEMPLATE_VIS common_comparison_category {
template<class... _Ts>
using common_comparison_category_t = typename common_comparison_category<_Ts...>::type;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/compare_partial_order_fallback.h b/contrib/libs/cxxsupp/libcxx/include/__compare/compare_partial_order_fallback.h
index 06f03fe7ade..fb2921ed52d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__compare/compare_partial_order_fallback.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__compare/compare_partial_order_fallback.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [cmp.alg]
namespace __compare_partial_order_fallback {
@@ -67,7 +67,7 @@ inline namespace __cpo {
inline constexpr auto compare_partial_order_fallback = __compare_partial_order_fallback::__fn{};
} // namespace __cpo
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/compare_strong_order_fallback.h b/contrib/libs/cxxsupp/libcxx/include/__compare/compare_strong_order_fallback.h
index 869386817a1..d84d065e406 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__compare/compare_strong_order_fallback.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__compare/compare_strong_order_fallback.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [cmp.alg]
namespace __compare_strong_order_fallback {
@@ -64,7 +64,7 @@ inline namespace __cpo {
inline constexpr auto compare_strong_order_fallback = __compare_strong_order_fallback::__fn{};
} // namespace __cpo
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/compare_three_way.h b/contrib/libs/cxxsupp/libcxx/include/__compare/compare_three_way.h
index fdbba04a78e..2bc63a00e55 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__compare/compare_three_way.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__compare/compare_three_way.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct _LIBCPP_TEMPLATE_VIS compare_three_way
{
@@ -34,7 +34,7 @@ struct _LIBCPP_TEMPLATE_VIS compare_three_way
using is_transparent = void;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/compare_three_way_result.h b/contrib/libs/cxxsupp/libcxx/include/__compare/compare_three_way_result.h
index 8885d7effad..632ebdce1bc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__compare/compare_three_way_result.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__compare/compare_three_way_result.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class, class, class>
struct _LIBCPP_HIDE_FROM_ABI __compare_three_way_result { };
@@ -37,7 +37,7 @@ struct _LIBCPP_TEMPLATE_VIS compare_three_way_result : __compare_three_way_resul
template<class _Tp, class _Up = _Tp>
using compare_three_way_result_t = typename compare_three_way_result<_Tp, _Up>::type;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/compare_weak_order_fallback.h b/contrib/libs/cxxsupp/libcxx/include/__compare/compare_weak_order_fallback.h
index f434dcb4a31..d3ba04a86bc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__compare/compare_weak_order_fallback.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__compare/compare_weak_order_fallback.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [cmp.alg]
namespace __compare_weak_order_fallback {
@@ -64,7 +64,7 @@ inline namespace __cpo {
inline constexpr auto compare_weak_order_fallback = __compare_weak_order_fallback::__fn{};
} // namespace __cpo
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/is_eq.h b/contrib/libs/cxxsupp/libcxx/include/__compare/is_eq.h
index 49648924e81..9a82df1ebe8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__compare/is_eq.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__compare/is_eq.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_eq(partial_ordering __c) noexcept { return __c == 0; }
_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_neq(partial_ordering __c) noexcept { return __c != 0; }
@@ -27,7 +27,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lteq(partial_ordering __c) noexce
_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gt(partial_ordering __c) noexcept { return __c > 0; }
_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gteq(partial_ordering __c) noexcept { return __c >= 0; }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/ordering.h b/contrib/libs/cxxsupp/libcxx/include/__compare/ordering.h
index ff148abf234..c348f0433a3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__compare/ordering.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__compare/ordering.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// exposition only
enum class _LIBCPP_ENUM_VIS _OrdResult : signed char {
@@ -40,7 +40,7 @@ template<class _Tp, class... _Args>
inline constexpr bool __one_of_v = (is_same_v<_Tp, _Args> || ...);
struct _CmpUnspecifiedParam {
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEVAL
+ _LIBCPP_HIDE_FROM_ABI constexpr
_CmpUnspecifiedParam(int _CmpUnspecifiedParam::*) noexcept {}
template<class _Tp, class = enable_if_t<!__one_of_v<_Tp, int, partial_ordering, weak_ordering, strong_ordering>>>
@@ -319,7 +319,7 @@ inline constexpr strong_ordering strong_ordering::greater(_OrdResult::__greater)
template <class _Tp>
concept __comparison_category = __one_of_v<_Tp, partial_ordering, weak_ordering, strong_ordering>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/partial_order.h b/contrib/libs/cxxsupp/libcxx/include/__compare/partial_order.h
index aee07ebb428..9cb76cc5bdb 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__compare/partial_order.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__compare/partial_order.h
@@ -24,7 +24,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [cmp.alg]
namespace __partial_order {
@@ -67,7 +67,7 @@ inline namespace __cpo {
inline constexpr auto partial_order = __partial_order::__fn{};
} // namespace __cpo
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/strong_order.h b/contrib/libs/cxxsupp/libcxx/include/__compare/strong_order.h
index 05856c20939..b6e0cfaaa57 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__compare/strong_order.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__compare/strong_order.h
@@ -30,7 +30,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [cmp.alg]
namespace __strong_order {
@@ -130,7 +130,7 @@ inline namespace __cpo {
inline constexpr auto strong_order = __strong_order::__fn{};
} // namespace __cpo
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/synth_three_way.h b/contrib/libs/cxxsupp/libcxx/include/__compare/synth_three_way.h
index 7d338987e0d..6420d1362db 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__compare/synth_three_way.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__compare/synth_three_way.h
@@ -21,30 +21,36 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [expos.only.func]
-_LIBCPP_HIDE_FROM_ABI inline constexpr auto __synth_three_way =
- []<class _Tp, class _Up>(const _Tp& __t, const _Up& __u)
- requires requires {
- { __t < __u } -> __boolean_testable;
- { __u < __t } -> __boolean_testable;
- }
- {
- if constexpr (three_way_comparable_with<_Tp, _Up>) {
- return __t <=> __u;
- } else {
- if (__t < __u) return weak_ordering::less;
- if (__u < __t) return weak_ordering::greater;
- return weak_ordering::equivalent;
- }
- };
+// TODO MODULES restore the lamba to match the Standard.
+// See https://github.com/llvm/llvm-project/issues/57222
+//_LIBCPP_HIDE_FROM_ABI inline constexpr auto __synth_three_way =
+// []<class _Tp, class _Up>(const _Tp& __t, const _Up& __u)
+template <class _Tp, class _Up>
+_LIBCPP_HIDE_FROM_ABI constexpr auto __synth_three_way(const _Tp& __t, const _Up& __u)
+ requires requires {
+ { __t < __u } -> __boolean_testable;
+ { __u < __t } -> __boolean_testable;
+ }
+{
+ if constexpr (three_way_comparable_with<_Tp, _Up>) {
+ return __t <=> __u;
+ } else {
+ if (__t < __u)
+ return weak_ordering::less;
+ if (__u < __t)
+ return weak_ordering::greater;
+ return weak_ordering::equivalent;
+ }
+}
template <class _Tp, class _Up = _Tp>
using __synth_three_way_result = decltype(std::__synth_three_way(std::declval<_Tp&>(), std::declval<_Up&>()));
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/three_way_comparable.h b/contrib/libs/cxxsupp/libcxx/include/__compare/three_way_comparable.h
index 6c98916d858..2b77bc3f54e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__compare/three_way_comparable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__compare/three_way_comparable.h
@@ -25,7 +25,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Tp, class _Cat>
concept __compares_as =
@@ -52,7 +52,7 @@ concept three_way_comparable_with =
{ __u <=> __t } -> __compares_as<_Cat>;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/weak_order.h b/contrib/libs/cxxsupp/libcxx/include/__compare/weak_order.h
index abb24e3665b..9cbc1d24aa0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__compare/weak_order.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__compare/weak_order.h
@@ -24,7 +24,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [cmp.alg]
namespace __weak_order {
@@ -95,7 +95,7 @@ inline namespace __cpo {
inline constexpr auto weak_order = __weak_order::__fn{};
} // namespace __cpo
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/arithmetic.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/arithmetic.h
index 215b52aa021..f41e4c9f274 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/arithmetic.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/arithmetic.h
@@ -22,20 +22,20 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concepts.arithmetic], arithmetic concepts
-template<class _Tp>
+template <class _Tp>
concept integral = is_integral_v<_Tp>;
-template<class _Tp>
+template <class _Tp>
concept signed_integral = integral<_Tp> && is_signed_v<_Tp>;
-template<class _Tp>
+template <class _Tp>
concept unsigned_integral = integral<_Tp> && !signed_integral<_Tp>;
-template<class _Tp>
+template <class _Tp>
concept floating_point = is_floating_point_v<_Tp>;
// Concept helpers for the internal type traits for the fundamental types.
@@ -45,7 +45,7 @@ concept __libcpp_unsigned_integer = __libcpp_is_unsigned_integer<_Tp>::value;
template <class _Tp>
concept __libcpp_signed_integer = __libcpp_is_signed_integer<_Tp>::value;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/assignable.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/assignable.h
index 91edd400adf..3f7544c9340 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/assignable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/assignable.h
@@ -22,19 +22,19 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.assignable]
-template<class _Lhs, class _Rhs>
+template <class _Lhs, class _Rhs>
concept assignable_from =
- is_lvalue_reference_v<_Lhs> &&
- common_reference_with<__make_const_lvalue_ref<_Lhs>, __make_const_lvalue_ref<_Rhs>> &&
- requires (_Lhs __lhs, _Rhs&& __rhs) {
- { __lhs = _VSTD::forward<_Rhs>(__rhs) } -> same_as<_Lhs>;
- };
+ is_lvalue_reference_v<_Lhs> &&
+ common_reference_with<__make_const_lvalue_ref<_Lhs>, __make_const_lvalue_ref<_Rhs>> &&
+ requires(_Lhs __lhs, _Rhs&& __rhs) {
+ { __lhs = _VSTD::forward<_Rhs>(__rhs) } -> same_as<_Lhs>;
+ };
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/boolean_testable.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/boolean_testable.h
index a96bde71174..d290e1cf3d8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/boolean_testable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/boolean_testable.h
@@ -19,19 +19,19 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concepts.booleantestable]
-template<class _Tp>
+template <class _Tp>
concept __boolean_testable_impl = convertible_to<_Tp, bool>;
-template<class _Tp>
+template <class _Tp>
concept __boolean_testable = __boolean_testable_impl<_Tp> && requires(_Tp&& __t) {
{ !_VSTD::forward<_Tp>(__t) } -> __boolean_testable_impl;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/class_or_enum.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/class_or_enum.h
index c4d2f98952c..c1b4a8c258f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/class_or_enum.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/class_or_enum.h
@@ -21,19 +21,19 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// Whether a type is a class type or enumeration type according to the Core wording.
-template<class _Tp>
+template <class _Tp>
concept __class_or_enum = is_class_v<_Tp> || is_union_v<_Tp> || is_enum_v<_Tp>;
// Work around Clang bug https://llvm.org/PR52970
// TODO: remove this workaround once libc++ no longer has to support Clang 13 (it was fixed in Clang 14).
-template<class _Tp>
+template <class _Tp>
concept __workaround_52970 = is_class_v<__remove_cvref_t<_Tp>> || is_union_v<__remove_cvref_t<_Tp>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/common_reference_with.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/common_reference_with.h
index cc92762d310..4eb687e071b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/common_reference_with.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/common_reference_with.h
@@ -20,17 +20,16 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.commonref]
-template<class _Tp, class _Up>
+template <class _Tp, class _Up>
concept common_reference_with =
- same_as<common_reference_t<_Tp, _Up>, common_reference_t<_Up, _Tp>> &&
- convertible_to<_Tp, common_reference_t<_Tp, _Up>> &&
- convertible_to<_Up, common_reference_t<_Tp, _Up>>;
+ same_as<common_reference_t<_Tp, _Up>, common_reference_t<_Up, _Tp>> &&
+ convertible_to<_Tp, common_reference_t<_Tp, _Up>> && convertible_to<_Up, common_reference_t<_Tp, _Up>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/common_with.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/common_with.h
index 569a0ee3b76..85abb05efbc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/common_with.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/common_with.h
@@ -23,27 +23,29 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.common]
-template<class _Tp, class _Up>
+// clang-format off
+template <class _Tp, class _Up>
concept common_with =
- same_as<common_type_t<_Tp, _Up>, common_type_t<_Up, _Tp>> &&
- requires {
- static_cast<common_type_t<_Tp, _Up>>(std::declval<_Tp>());
- static_cast<common_type_t<_Tp, _Up>>(std::declval<_Up>());
- } &&
- common_reference_with<
- add_lvalue_reference_t<const _Tp>,
- add_lvalue_reference_t<const _Up>> &&
- common_reference_with<
- add_lvalue_reference_t<common_type_t<_Tp, _Up>>,
- common_reference_t<
- add_lvalue_reference_t<const _Tp>,
- add_lvalue_reference_t<const _Up>>>;
-
-#endif // _LIBCPP_STD_VER > 17
+ same_as<common_type_t<_Tp, _Up>, common_type_t<_Up, _Tp>> &&
+ requires {
+ static_cast<common_type_t<_Tp, _Up>>(std::declval<_Tp>());
+ static_cast<common_type_t<_Tp, _Up>>(std::declval<_Up>());
+ } &&
+ common_reference_with<
+ add_lvalue_reference_t<const _Tp>,
+ add_lvalue_reference_t<const _Up>> &&
+ common_reference_with<
+ add_lvalue_reference_t<common_type_t<_Tp, _Up>>,
+ common_reference_t<
+ add_lvalue_reference_t<const _Tp>,
+ add_lvalue_reference_t<const _Up>>>;
+// clang-format on
+
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/constructible.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/constructible.h
index 1d78eb5fd15..835a44429c0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/constructible.h
@@ -20,36 +20,35 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.constructible]
-template<class _Tp, class... _Args>
-concept constructible_from =
- destructible<_Tp> && is_constructible_v<_Tp, _Args...>;
+template <class _Tp, class... _Args>
+concept constructible_from = destructible<_Tp> && is_constructible_v<_Tp, _Args...>;
// [concept.default.init]
-template<class _Tp>
+template <class _Tp>
concept __default_initializable = requires { ::new _Tp; };
-template<class _Tp>
-concept default_initializable = constructible_from<_Tp> &&
- requires { _Tp{}; } && __default_initializable<_Tp>;
+template <class _Tp>
+concept default_initializable = constructible_from<_Tp> && requires { _Tp{}; } && __default_initializable<_Tp>;
// [concept.moveconstructible]
-template<class _Tp>
-concept move_constructible =
- constructible_from<_Tp, _Tp> && convertible_to<_Tp, _Tp>;
+template <class _Tp>
+concept move_constructible = constructible_from<_Tp, _Tp> && convertible_to<_Tp, _Tp>;
// [concept.copyconstructible]
-template<class _Tp>
+// clang-format off
+template <class _Tp>
concept copy_constructible =
- move_constructible<_Tp> &&
- constructible_from<_Tp, _Tp&> && convertible_to<_Tp&, _Tp> &&
- constructible_from<_Tp, const _Tp&> && convertible_to<const _Tp&, _Tp> &&
- constructible_from<_Tp, const _Tp> && convertible_to<const _Tp, _Tp>;
+ move_constructible<_Tp> &&
+ constructible_from<_Tp, _Tp&> && convertible_to<_Tp&, _Tp> &&
+ constructible_from<_Tp, const _Tp&> && convertible_to<const _Tp&, _Tp> &&
+ constructible_from<_Tp, const _Tp> && convertible_to<const _Tp, _Tp>;
+// clang-format on
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/convertible_to.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/convertible_to.h
index 2c1d2674100..6d5b6c1268d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/convertible_to.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/convertible_to.h
@@ -19,18 +19,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.convertible]
-template<class _From, class _To>
-concept convertible_to =
- is_convertible_v<_From, _To> &&
- requires {
- static_cast<_To>(std::declval<_From>());
- };
+template <class _From, class _To>
+concept convertible_to = is_convertible_v<_From, _To> && requires { static_cast<_To>(std::declval<_From>()); };
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/copyable.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/copyable.h
index c5d8a80b9da..2bf0ad42fc1 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/copyable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/copyable.h
@@ -20,19 +20,21 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concepts.object]
-template<class _Tp>
+// clang-format off
+template <class _Tp>
concept copyable =
- copy_constructible<_Tp> &&
- movable<_Tp> &&
- assignable_from<_Tp&, _Tp&> &&
- assignable_from<_Tp&, const _Tp&> &&
- assignable_from<_Tp&, const _Tp>;
-
-#endif // _LIBCPP_STD_VER > 17
+ copy_constructible<_Tp> &&
+ movable<_Tp> &&
+ assignable_from<_Tp&, _Tp&> &&
+ assignable_from<_Tp&, const _Tp&> &&
+ assignable_from<_Tp&, const _Tp>;
+// clang-format on
+
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/derived_from.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/derived_from.h
index 0d3462df6a6..9875faee81b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/derived_from.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/derived_from.h
@@ -19,16 +19,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.derived]
-template<class _Dp, class _Bp>
-concept derived_from =
- is_base_of_v<_Bp, _Dp> &&
- is_convertible_v<const volatile _Dp*, const volatile _Bp*>;
+template <class _Dp, class _Bp>
+concept derived_from = is_base_of_v<_Bp, _Dp> && is_convertible_v<const volatile _Dp*, const volatile _Bp*>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/destructible.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/destructible.h
index ad3819d5dcf..28b4b1bc24e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/destructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/destructible.h
@@ -18,14 +18,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.destructible]
-template<class _Tp>
+template <class _Tp>
concept destructible = is_nothrow_destructible_v<_Tp>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/different_from.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/different_from.h
index 15fd8f05510..fd31f6e2580 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/different_from.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/different_from.h
@@ -19,12 +19,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
-template<class _Tp, class _Up>
+template <class _Tp, class _Up>
concept __different_from = !same_as<remove_cvref_t<_Tp>, remove_cvref_t<_Up>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/equality_comparable.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/equality_comparable.h
index b865141705f..278fc764092 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/equality_comparable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/equality_comparable.h
@@ -21,33 +21,35 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.equalitycomparable]
-template<class _Tp, class _Up>
+template <class _Tp, class _Up>
concept __weakly_equality_comparable_with =
- requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) {
- { __t == __u } -> __boolean_testable;
- { __t != __u } -> __boolean_testable;
- { __u == __t } -> __boolean_testable;
- { __u != __t } -> __boolean_testable;
- };
-
-template<class _Tp>
+ requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) {
+ { __t == __u } -> __boolean_testable;
+ { __t != __u } -> __boolean_testable;
+ { __u == __t } -> __boolean_testable;
+ { __u != __t } -> __boolean_testable;
+ };
+
+template <class _Tp>
concept equality_comparable = __weakly_equality_comparable_with<_Tp, _Tp>;
-template<class _Tp, class _Up>
+// clang-format off
+template <class _Tp, class _Up>
concept equality_comparable_with =
- equality_comparable<_Tp> && equality_comparable<_Up> &&
- common_reference_with<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>> &&
- equality_comparable<
- common_reference_t<
- __make_const_lvalue_ref<_Tp>,
- __make_const_lvalue_ref<_Up>>> &&
- __weakly_equality_comparable_with<_Tp, _Up>;
-
-#endif // _LIBCPP_STD_VER > 17
+ equality_comparable<_Tp> && equality_comparable<_Up> &&
+ common_reference_with<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>> &&
+ equality_comparable<
+ common_reference_t<
+ __make_const_lvalue_ref<_Tp>,
+ __make_const_lvalue_ref<_Up>>> &&
+ __weakly_equality_comparable_with<_Tp, _Up>;
+// clang-format on
+
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/invocable.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/invocable.h
index ec39b7b817c..e5be514b5c3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/invocable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/invocable.h
@@ -19,21 +19,21 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.invocable]
-template<class _Fn, class... _Args>
+template <class _Fn, class... _Args>
concept invocable = requires(_Fn&& __fn, _Args&&... __args) {
_VSTD::invoke(_VSTD::forward<_Fn>(__fn), _VSTD::forward<_Args>(__args)...); // not required to be equality preserving
};
// [concept.regular.invocable]
-template<class _Fn, class... _Args>
+template <class _Fn, class... _Args>
concept regular_invocable = invocable<_Fn, _Args...>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/movable.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/movable.h
index 749b78ad10b..bc5b9d767c6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/movable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/movable.h
@@ -21,18 +21,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concepts.object]
-template<class _Tp>
-concept movable =
- is_object_v<_Tp> &&
- move_constructible<_Tp> &&
- assignable_from<_Tp&, _Tp> &&
- swappable<_Tp>;
+template <class _Tp>
+concept movable = is_object_v<_Tp> && move_constructible<_Tp> && assignable_from<_Tp&, _Tp> && swappable<_Tp>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/predicate.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/predicate.h
index 7ae97832642..00731efc8fc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/predicate.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/predicate.h
@@ -20,15 +20,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.predicate]
-template<class _Fn, class... _Args>
-concept predicate =
- regular_invocable<_Fn, _Args...> && __boolean_testable<invoke_result_t<_Fn, _Args...>>;
+template <class _Fn, class... _Args>
+concept predicate = regular_invocable<_Fn, _Args...> && __boolean_testable<invoke_result_t<_Fn, _Args...>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/regular.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/regular.h
index d15728d298b..9f3d8bf30be 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/regular.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/regular.h
@@ -19,14 +19,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.object]
-template<class _Tp>
+template <class _Tp>
concept regular = semiregular<_Tp> && equality_comparable<_Tp>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/relation.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/relation.h
index 7d5141cac74..7545a7db93d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/relation.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/relation.h
@@ -18,26 +18,25 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.relation]
-template<class _Rp, class _Tp, class _Up>
+template <class _Rp, class _Tp, class _Up>
concept relation =
- predicate<_Rp, _Tp, _Tp> && predicate<_Rp, _Up, _Up> &&
- predicate<_Rp, _Tp, _Up> && predicate<_Rp, _Up, _Tp>;
+ predicate<_Rp, _Tp, _Tp> && predicate<_Rp, _Up, _Up> && predicate<_Rp, _Tp, _Up> && predicate<_Rp, _Up, _Tp>;
// [concept.equiv]
-template<class _Rp, class _Tp, class _Up>
+template <class _Rp, class _Tp, class _Up>
concept equivalence_relation = relation<_Rp, _Tp, _Up>;
// [concept.strictweakorder]
-template<class _Rp, class _Tp, class _Up>
+template <class _Rp, class _Tp, class _Up>
concept strict_weak_order = relation<_Rp, _Tp, _Up>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/same_as.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/same_as.h
index 554ebc3b074..4241131c70c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/same_as.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/same_as.h
@@ -18,17 +18,17 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.same]
-template<class _Tp, class _Up>
+template <class _Tp, class _Up>
concept __same_as_impl = _IsSame<_Tp, _Up>::value;
-template<class _Tp, class _Up>
+template <class _Tp, class _Up>
concept same_as = __same_as_impl<_Tp, _Up> && __same_as_impl<_Up, _Tp>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/semiregular.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/semiregular.h
index d15bb3ba42b..7a159d17dfc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/semiregular.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/semiregular.h
@@ -19,14 +19,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.object]
-template<class _Tp>
+template <class _Tp>
concept semiregular = copyable<_Tp> && default_initializable<_Tp>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/swappable.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/swappable.h
index d91a7a1dc3c..c1969de3451 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/swappable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/swappable.h
@@ -28,94 +28,96 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.swappable]
namespace ranges {
namespace __swap {
- template<class _Tp>
- void swap(_Tp&, _Tp&) = delete;
+template <class _Tp>
+void swap(_Tp&, _Tp&) = delete;
- template<class _Tp, class _Up>
- concept __unqualified_swappable_with =
+// clang-format off
+template <class _Tp, class _Up>
+concept __unqualified_swappable_with =
(__class_or_enum<remove_cvref_t<_Tp>> || __class_or_enum<remove_cvref_t<_Up>>) &&
requires(_Tp&& __t, _Up&& __u) {
- swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u));
+ swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u));
};
+// clang-format on
- struct __fn;
+struct __fn;
- template<class _Tp, class _Up, size_t _Size>
- concept __swappable_arrays =
- !__unqualified_swappable_with<_Tp(&)[_Size], _Up(&)[_Size]> &&
+// clang-format off
+template <class _Tp, class _Up, size_t _Size>
+concept __swappable_arrays =
+ !__unqualified_swappable_with<_Tp (&)[_Size], _Up (&)[_Size]> &&
extent_v<_Tp> == extent_v<_Up> &&
- requires(_Tp(& __t)[_Size], _Up(& __u)[_Size], const __fn& __swap) {
- __swap(__t[0], __u[0]);
+ requires(_Tp (&__t)[_Size], _Up (&__u)[_Size], const __fn& __swap) {
+ __swap(__t[0], __u[0]);
};
-
- template<class _Tp>
- concept __exchangeable =
- !__unqualified_swappable_with<_Tp&, _Tp&> &&
- move_constructible<_Tp> &&
- assignable_from<_Tp&, _Tp>;
-
- struct __fn {
- // 2.1 `S` is `(void)swap(E1, E2)`* if `E1` or `E2` has class or enumeration type and...
- // *The name `swap` is used here unqualified.
- template<class _Tp, class _Up>
- requires __unqualified_swappable_with<_Tp, _Up>
- constexpr void operator()(_Tp&& __t, _Up&& __u) const
- noexcept(noexcept(swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
- {
- swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u));
- }
-
- // 2.2 Otherwise, if `E1` and `E2` are lvalues of array types with equal extent and...
- template<class _Tp, class _Up, size_t _Size>
- requires __swappable_arrays<_Tp, _Up, _Size>
- constexpr void operator()(_Tp(& __t)[_Size], _Up(& __u)[_Size]) const
- noexcept(noexcept((*this)(*__t, *__u)))
- {
- // TODO(cjdb): replace with `ranges::swap_ranges`.
- for (size_t __i = 0; __i < _Size; ++__i) {
- (*this)(__t[__i], __u[__i]);
- }
+// clang-format on
+
+template <class _Tp>
+concept __exchangeable =
+ !__unqualified_swappable_with<_Tp&, _Tp&> && move_constructible<_Tp> && assignable_from<_Tp&, _Tp>;
+
+struct __fn {
+ // 2.1 `S` is `(void)swap(E1, E2)`* if `E1` or `E2` has class or enumeration type and...
+ // *The name `swap` is used here unqualified.
+ template <class _Tp, class _Up>
+ requires __unqualified_swappable_with<_Tp, _Up>
+ _LIBCPP_HIDE_FROM_ABI constexpr void operator()(_Tp&& __t, _Up&& __u) const
+ noexcept(noexcept(swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))) {
+ swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u));
+ }
+
+ // 2.2 Otherwise, if `E1` and `E2` are lvalues of array types with equal extent and...
+ template <class _Tp, class _Up, size_t _Size>
+ requires __swappable_arrays<_Tp, _Up, _Size>
+ _LIBCPP_HIDE_FROM_ABI constexpr void operator()(_Tp (&__t)[_Size], _Up (&__u)[_Size]) const
+ noexcept(noexcept((*this)(*__t, *__u))) {
+ // TODO(cjdb): replace with `ranges::swap_ranges`.
+ for (size_t __i = 0; __i < _Size; ++__i) {
+ (*this)(__t[__i], __u[__i]);
}
-
- // 2.3 Otherwise, if `E1` and `E2` are lvalues of the same type `T` that models...
- template<__exchangeable _Tp>
- constexpr void operator()(_Tp& __x, _Tp& __y) const
- noexcept(is_nothrow_move_constructible_v<_Tp> && is_nothrow_move_assignable_v<_Tp>)
- {
- __y = _VSTD::exchange(__x, _VSTD::move(__y));
- }
- };
+ }
+
+ // 2.3 Otherwise, if `E1` and `E2` are lvalues of the same type `T` that models...
+ template <__exchangeable _Tp>
+ _LIBCPP_HIDE_FROM_ABI constexpr void operator()(_Tp& __x, _Tp& __y) const
+ noexcept(is_nothrow_move_constructible_v<_Tp>&& is_nothrow_move_assignable_v<_Tp>) {
+ __y = _VSTD::exchange(__x, _VSTD::move(__y));
+ }
+};
} // namespace __swap
inline namespace __cpo {
- inline constexpr auto swap = __swap::__fn{};
+inline constexpr auto swap = __swap::__fn{};
} // namespace __cpo
} // namespace ranges
-template<class _Tp>
+template <class _Tp>
concept swappable = requires(_Tp& __a, _Tp& __b) { ranges::swap(__a, __b); };
-template<class _Tp, class _Up>
-concept swappable_with =
- common_reference_with<_Tp, _Up> &&
- requires(_Tp&& __t, _Up&& __u) {
- ranges::swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Tp>(__t));
- ranges::swap(_VSTD::forward<_Up>(__u), _VSTD::forward<_Up>(__u));
- ranges::swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u));
- ranges::swap(_VSTD::forward<_Up>(__u), _VSTD::forward<_Tp>(__t));
- };
+template <class _Tp, class _Up>
+concept swappable_with = common_reference_with<_Tp, _Up> && requires(_Tp&& __t, _Up&& __u) {
+ ranges::swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Tp>(__t));
+ ranges::swap(_VSTD::forward<_Up>(__u), _VSTD::forward<_Up>(__u));
+ ranges::swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u));
+ ranges::swap(_VSTD::forward<_Up>(__u), _VSTD::forward<_Tp>(__t));
+};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___CONCEPTS_SWAPPABLE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__concepts/totally_ordered.h b/contrib/libs/cxxsupp/libcxx/include/__concepts/totally_ordered.h
index f12d26b1082..186c3b430dd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__concepts/totally_ordered.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__concepts/totally_ordered.h
@@ -21,37 +21,38 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.totallyordered]
-template<class _Tp, class _Up>
-concept __partially_ordered_with =
- requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) {
- { __t < __u } -> __boolean_testable;
- { __t > __u } -> __boolean_testable;
- { __t <= __u } -> __boolean_testable;
- { __t >= __u } -> __boolean_testable;
- { __u < __t } -> __boolean_testable;
- { __u > __t } -> __boolean_testable;
- { __u <= __t } -> __boolean_testable;
- { __u >= __t } -> __boolean_testable;
- };
-
-template<class _Tp>
+template <class _Tp, class _Up>
+concept __partially_ordered_with = requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) {
+ { __t < __u } -> __boolean_testable;
+ { __t > __u } -> __boolean_testable;
+ { __t <= __u } -> __boolean_testable;
+ { __t >= __u } -> __boolean_testable;
+ { __u < __t } -> __boolean_testable;
+ { __u > __t } -> __boolean_testable;
+ { __u <= __t } -> __boolean_testable;
+ { __u >= __t } -> __boolean_testable;
+};
+
+template <class _Tp>
concept totally_ordered = equality_comparable<_Tp> && __partially_ordered_with<_Tp, _Tp>;
-template<class _Tp, class _Up>
+// clang-format off
+template <class _Tp, class _Up>
concept totally_ordered_with =
- totally_ordered<_Tp> && totally_ordered<_Up> &&
- equality_comparable_with<_Tp, _Up> &&
- totally_ordered<
- common_reference_t<
- __make_const_lvalue_ref<_Tp>,
- __make_const_lvalue_ref<_Up>>> &&
- __partially_ordered_with<_Tp, _Up>;
-
-#endif // _LIBCPP_STD_VER > 17
+ totally_ordered<_Tp> && totally_ordered<_Up> &&
+ equality_comparable_with<_Tp, _Up> &&
+ totally_ordered<
+ common_reference_t<
+ __make_const_lvalue_ref<_Tp>,
+ __make_const_lvalue_ref<_Up>>> &&
+ __partially_ordered_with<_Tp, _Up>;
+// clang-format on
+
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__condition_variable/condition_variable.h b/contrib/libs/cxxsupp/libcxx/include/__condition_variable/condition_variable.h
new file mode 100644
index 00000000000..7cbf21fe731
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__condition_variable/condition_variable.h
@@ -0,0 +1,245 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___CONDITION_VARIABLE_CONDITION_VARIABLE_H
+#define _LIBCPP___CONDITION_VARIABLE_CONDITION_VARIABLE_H
+
+#include <__chrono/steady_clock.h>
+#include <__chrono/system_clock.h>
+#include <__chrono/time_point.h>
+#include <__config>
+#include <__mutex/mutex.h>
+#include <__mutex/unique_lock.h>
+#include <__system_error/system_error.h>
+#include <__threading_support>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_floating_point.h>
+#include <__utility/move.h>
+#include <limits>
+#include <ratio>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+// enum class cv_status
+_LIBCPP_DECLARE_STRONG_ENUM(cv_status){no_timeout, timeout};
+_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status)
+
+class _LIBCPP_EXPORTED_FROM_ABI condition_variable {
+ __libcpp_condvar_t __cv_ = _LIBCPP_CONDVAR_INITIALIZER;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR condition_variable() _NOEXCEPT = default;
+
+# ifdef _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION
+ ~condition_variable() = default;
+# else
+ ~condition_variable();
+# endif
+
+ condition_variable(const condition_variable&) = delete;
+ condition_variable& operator=(const condition_variable&) = delete;
+
+ void notify_one() _NOEXCEPT;
+ void notify_all() _NOEXCEPT;
+
+ void wait(unique_lock<mutex>& __lk) _NOEXCEPT;
+ template <class _Predicate>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS void wait(unique_lock<mutex>& __lk, _Predicate __pred);
+
+ template <class _Clock, class _Duration>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS cv_status
+ wait_until(unique_lock<mutex>& __lk, const chrono::time_point<_Clock, _Duration>& __t);
+
+ template <class _Clock, class _Duration, class _Predicate>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool
+ wait_until(unique_lock<mutex>& __lk, const chrono::time_point<_Clock, _Duration>& __t, _Predicate __pred);
+
+ template <class _Rep, class _Period>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS cv_status
+ wait_for(unique_lock<mutex>& __lk, const chrono::duration<_Rep, _Period>& __d);
+
+ template <class _Rep, class _Period, class _Predicate>
+ bool _LIBCPP_HIDE_FROM_ABI
+ wait_for(unique_lock<mutex>& __lk, const chrono::duration<_Rep, _Period>& __d, _Predicate __pred);
+
+ typedef __libcpp_condvar_t* native_handle_type;
+ _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return &__cv_; }
+
+private:
+ void
+ __do_timed_wait(unique_lock<mutex>& __lk, chrono::time_point<chrono::system_clock, chrono::nanoseconds>) _NOEXCEPT;
+# if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
+ _LIBCPP_HIDE_FROM_ABI void
+ __do_timed_wait(unique_lock<mutex>& __lk, chrono::time_point<chrono::steady_clock, chrono::nanoseconds>) _NOEXCEPT;
+# endif
+ template <class _Clock>
+ _LIBCPP_HIDE_FROM_ABI void
+ __do_timed_wait(unique_lock<mutex>& __lk, chrono::time_point<_Clock, chrono::nanoseconds>) _NOEXCEPT;
+};
+#endif // !_LIBCPP_HAS_NO_THREADS
+
+template <class _Rep, class _Period>
+inline _LIBCPP_HIDE_FROM_ABI __enable_if_t<is_floating_point<_Rep>::value, chrono::nanoseconds>
+__safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d) {
+ using namespace chrono;
+ using __ratio = ratio_divide<_Period, nano>;
+ using __ns_rep = nanoseconds::rep;
+ _Rep __result_float = __d.count() * __ratio::num / __ratio::den;
+
+ _Rep __result_max = numeric_limits<__ns_rep>::max();
+ if (__result_float >= __result_max) {
+ return nanoseconds::max();
+ }
+
+ _Rep __result_min = numeric_limits<__ns_rep>::min();
+ if (__result_float <= __result_min) {
+ return nanoseconds::min();
+ }
+
+ return nanoseconds(static_cast<__ns_rep>(__result_float));
+}
+
+template <class _Rep, class _Period>
+inline _LIBCPP_HIDE_FROM_ABI __enable_if_t<!is_floating_point<_Rep>::value, chrono::nanoseconds>
+__safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d) {
+ using namespace chrono;
+ if (__d.count() == 0) {
+ return nanoseconds(0);
+ }
+
+ using __ratio = ratio_divide<_Period, nano>;
+ using __ns_rep = nanoseconds::rep;
+ __ns_rep __result_max = numeric_limits<__ns_rep>::max();
+ if (__d.count() > 0 && __d.count() > __result_max / __ratio::num) {
+ return nanoseconds::max();
+ }
+
+ __ns_rep __result_min = numeric_limits<__ns_rep>::min();
+ if (__d.count() < 0 && __d.count() < __result_min / __ratio::num) {
+ return nanoseconds::min();
+ }
+
+ __ns_rep __result = __d.count() * __ratio::num / __ratio::den;
+ if (__result == 0) {
+ return nanoseconds(1);
+ }
+
+ return nanoseconds(__result);
+}
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+template <class _Predicate>
+void condition_variable::wait(unique_lock<mutex>& __lk, _Predicate __pred) {
+ while (!__pred())
+ wait(__lk);
+}
+
+template <class _Clock, class _Duration>
+cv_status condition_variable::wait_until(unique_lock<mutex>& __lk, const chrono::time_point<_Clock, _Duration>& __t) {
+ using namespace chrono;
+ using __clock_tp_ns = time_point<_Clock, nanoseconds>;
+
+ typename _Clock::time_point __now = _Clock::now();
+ if (__t <= __now)
+ return cv_status::timeout;
+
+ __clock_tp_ns __t_ns = __clock_tp_ns(std::__safe_nanosecond_cast(__t.time_since_epoch()));
+
+ __do_timed_wait(__lk, __t_ns);
+ return _Clock::now() < __t ? cv_status::no_timeout : cv_status::timeout;
+}
+
+template <class _Clock, class _Duration, class _Predicate>
+bool condition_variable::wait_until(
+ unique_lock<mutex>& __lk, const chrono::time_point<_Clock, _Duration>& __t, _Predicate __pred) {
+ while (!__pred()) {
+ if (wait_until(__lk, __t) == cv_status::timeout)
+ return __pred();
+ }
+ return true;
+}
+
+template <class _Rep, class _Period>
+cv_status condition_variable::wait_for(unique_lock<mutex>& __lk, const chrono::duration<_Rep, _Period>& __d) {
+ using namespace chrono;
+ if (__d <= __d.zero())
+ return cv_status::timeout;
+ using __ns_rep = nanoseconds::rep;
+ steady_clock::time_point __c_now = steady_clock::now();
+
+# if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
+ using __clock_tp_ns = time_point<steady_clock, nanoseconds>;
+ __ns_rep __now_count_ns = std::__safe_nanosecond_cast(__c_now.time_since_epoch()).count();
+# else
+ using __clock_tp_ns = time_point<system_clock, nanoseconds>;
+ __ns_rep __now_count_ns = std::__safe_nanosecond_cast(system_clock::now().time_since_epoch()).count();
+# endif
+
+ __ns_rep __d_ns_count = std::__safe_nanosecond_cast(__d).count();
+
+ if (__now_count_ns > numeric_limits<__ns_rep>::max() - __d_ns_count) {
+ __do_timed_wait(__lk, __clock_tp_ns::max());
+ } else {
+ __do_timed_wait(__lk, __clock_tp_ns(nanoseconds(__now_count_ns + __d_ns_count)));
+ }
+
+ return steady_clock::now() - __c_now < __d ? cv_status::no_timeout : cv_status::timeout;
+}
+
+template <class _Rep, class _Period, class _Predicate>
+inline bool
+condition_variable::wait_for(unique_lock<mutex>& __lk, const chrono::duration<_Rep, _Period>& __d, _Predicate __pred) {
+ return wait_until(__lk, chrono::steady_clock::now() + __d, std::move(__pred));
+}
+
+# if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
+inline void condition_variable::__do_timed_wait(
+ unique_lock<mutex>& __lk, chrono::time_point<chrono::steady_clock, chrono::nanoseconds> __tp) _NOEXCEPT {
+ using namespace chrono;
+ if (!__lk.owns_lock())
+ __throw_system_error(EPERM, "condition_variable::timed wait: mutex not locked");
+ nanoseconds __d = __tp.time_since_epoch();
+ timespec __ts;
+ seconds __s = duration_cast<seconds>(__d);
+ using __ts_sec = decltype(__ts.tv_sec);
+ const __ts_sec __ts_sec_max = numeric_limits<__ts_sec>::max();
+ if (__s.count() < __ts_sec_max) {
+ __ts.tv_sec = static_cast<__ts_sec>(__s.count());
+ __ts.tv_nsec = (__d - __s).count();
+ } else {
+ __ts.tv_sec = __ts_sec_max;
+ __ts.tv_nsec = giga::num - 1;
+ }
+ int __ec = pthread_cond_clockwait(&__cv_, __lk.mutex()->native_handle(), CLOCK_MONOTONIC, &__ts);
+ if (__ec != 0 && __ec != ETIMEDOUT)
+ __throw_system_error(__ec, "condition_variable timed_wait failed");
+}
+# endif // _LIBCPP_HAS_COND_CLOCKWAIT
+
+template <class _Clock>
+inline void condition_variable::__do_timed_wait(unique_lock<mutex>& __lk,
+ chrono::time_point<_Clock, chrono::nanoseconds> __tp) _NOEXCEPT {
+ wait_for(__lk, __tp - _Clock::now());
+}
+
+#endif // _LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___CONDITION_VARIABLE_CONDITION_VARIABLE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__config b/contrib/libs/cxxsupp/libcxx/include/__config
index 343a284b1ad..6eca2a86149 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__config
+++ b/contrib/libs/cxxsupp/libcxx/include/__config
@@ -57,22 +57,21 @@
#ifdef __cplusplus
+// The attributes supported by clang are documented at https://clang.llvm.org/docs/AttributeReference.html
+
// _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM.
-// Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 16.0.1 == 16.00.01), _LIBCPP_VERSION is
+// Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 17.0.1 == 17.00.01), _LIBCPP_VERSION is
// defined to XXYYZZ.
-# define _LIBCPP_VERSION 160005
+# define _LIBCPP_VERSION 170006
# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
-// Valid C++ identifier that revs with every libc++ version. This can be used to
-// generate identifiers that must be unique for every released libc++ version.
-# define _LIBCPP_VERSIONED_IDENTIFIER _LIBCPP_CONCAT(v, _LIBCPP_VERSION)
-
# if __STDC_HOSTED__ == 0
# define _LIBCPP_FREESTANDING
# endif
+// NOLINTBEGIN(libcpp-cpp-version-check)
# ifndef _LIBCPP_STD_VER
# if __cplusplus <= 201103L
# define _LIBCPP_STD_VER 11
@@ -82,11 +81,14 @@
# define _LIBCPP_STD_VER 17
# elif __cplusplus <= 202002L
# define _LIBCPP_STD_VER 20
+# elif __cplusplus <= 202302L
+# define _LIBCPP_STD_VER 23
# else
// Expected release year of the next C++ standard
-# define _LIBCPP_STD_VER 23
+# define _LIBCPP_STD_VER 26
# endif
# endif // _LIBCPP_STD_VER
+// NOLINTEND(libcpp-cpp-version-check)
# if defined(__ELF__)
# define _LIBCPP_OBJECT_FORMAT_ELF 1
@@ -102,6 +104,8 @@
// ... add new file formats here ...
# endif
+// ABI {
+
# if _LIBCPP_ABI_VERSION >= 2
// Change short string representation so that string data starts at offset 0,
// improving its alignment in some cases.
@@ -192,6 +196,12 @@
# if defined(__FreeBSD__)
# define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
# endif
+// For XCOFF linkers, we have problems if we see a weak hidden version of a symbol
+// in user code (like you get with -fvisibility-inlines-hidden) and then a strong def
+// in the library, so we need to always rely on the library version.
+# if defined(_AIX)
+# define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
+# endif
# endif
# if defined(_LIBCPP_BUILDING_LIBRARY) || _LIBCPP_ABI_VERSION >= 2
@@ -206,9 +216,151 @@
# define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
# endif
+// Changes the iterator type of select containers (see below) to a bounded iterator that keeps track of whether it's
+// within the bounds of the original container and asserts it on every dereference.
+//
+// ABI impact: changes the iterator type of the relevant containers.
+//
+// Supported containers:
+// - `span`;
+// - `string_view`;
+// - `array`.
+// #define _LIBCPP_ABI_BOUNDED_ITERATORS
+
+// } ABI
+
+// HARDENING {
+
+# ifndef _LIBCPP_ENABLE_ASSERTIONS
+# define _LIBCPP_ENABLE_ASSERTIONS _LIBCPP_ENABLE_ASSERTIONS_DEFAULT
+# endif
+# if _LIBCPP_ENABLE_ASSERTIONS != 0 && _LIBCPP_ENABLE_ASSERTIONS != 1
+# error "_LIBCPP_ENABLE_ASSERTIONS must be set to 0 or 1"
+# endif
+
+// NOTE: These modes are experimental and are not stable yet in LLVM 17. Please refrain from using them and use the
+// documented libc++ "safe" mode instead.
+//
+// Enables the hardened mode which consists of all checks intended to be used in production. Hardened mode prioritizes
+// security-critical checks that can be done with relatively little overhead in constant time. Mutually exclusive with
+// `_LIBCPP_ENABLE_DEBUG_MODE`.
+//
+// #define _LIBCPP_ENABLE_HARDENED_MODE 1
+
+// Enables the debug mode which contains all the checks from the hardened mode and additionally more expensive checks
+// that may affect the complexity of algorithms. The debug mode is intended to be used for testing, not in production.
+// Mutually exclusive with `_LIBCPP_ENABLE_HARDENED_MODE`.
+//
+// #define _LIBCPP_ENABLE_DEBUG_MODE 1
+
+// Inside the library, assertions are categorized so they can be cherry-picked based on the chosen hardening mode. These
+// macros are only for internal use -- users should only pick one of the high-level hardening modes described above.
+//
+// - `_LIBCPP_ASSERT_VALID_INPUT_RANGE` -- checks that ranges (whether expressed as an iterator pair, an iterator and
+// a sentinel, an iterator and a count, or a `std::range`) given as input to library functions are valid:
+// - the sentinel is reachable from the begin iterator;
+// - TODO(hardening): both iterators refer to the same container.
+//
+// - `_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS` -- checks that any attempts to access a container element, whether through
+// the container object or through an iterator, are valid and do not attempt to go out of bounds or otherwise access
+// a non-existent element. For iterator checks to work, bounded iterators must be enabled in the ABI. Types like
+// `optional` and `function` are considered one-element containers for the purposes of this check.
+//
+// - `_LIBCPP_ASSERT_NON_OVERLAPPING_RANGES` -- for functions that take several ranges as arguments, checks that the
+// given ranges do not overlap.
+//
+// - `_LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR` -- checks any operations that exchange nodes between containers to make sure
+// the containers have compatible allocators.
+//
+// - `_LIBCPP_ASSERT_INTERNAL` -- checks that internal invariants of the library hold. These assertions don't depend on
+// user input.
+//
+// - `_LIBCPP_ASSERT_UNCATEGORIZED` -- for assertions that haven't been properly classified yet.
+
+# ifndef _LIBCPP_ENABLE_HARDENED_MODE
+# define _LIBCPP_ENABLE_HARDENED_MODE _LIBCPP_ENABLE_HARDENED_MODE_DEFAULT
+# endif
+# if _LIBCPP_ENABLE_HARDENED_MODE != 0 && _LIBCPP_ENABLE_HARDENED_MODE != 1
+# error "_LIBCPP_ENABLE_HARDENED_MODE must be set to 0 or 1."
+# endif
+
+# ifndef _LIBCPP_ENABLE_DEBUG_MODE
+# define _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_ENABLE_DEBUG_MODE_DEFAULT
+# endif
+# if _LIBCPP_ENABLE_DEBUG_MODE != 0 && _LIBCPP_ENABLE_DEBUG_MODE != 1
+# error "_LIBCPP_ENABLE_DEBUG_MODE must be set to 0 or 1."
+# endif
+
+# if _LIBCPP_ENABLE_HARDENED_MODE && _LIBCPP_ENABLE_DEBUG_MODE
+# error "Only one of _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE can be enabled."
+# endif
+
+# if _LIBCPP_ENABLE_ASSERTIONS && (_LIBCPP_ENABLE_HARDENED_MODE || _LIBCPP_ENABLE_DEBUG_MODE)
+# error \
+ "_LIBCPP_ENABLE_ASSERTIONS is mutually exclusive with _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE."
+# endif
+
+// Hardened mode checks.
+
+// clang-format off
+# if _LIBCPP_ENABLE_HARDENED_MODE
+
+// Enabled checks.
+# define _LIBCPP_ASSERT_VALID_INPUT_RANGE(expression, message) _LIBCPP_ASSERT(expression, message)
+# define _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(expression, message) _LIBCPP_ASSERT(expression, message)
+// Disabled checks.
+// Overlapping ranges will make algorithms produce incorrect results but don't directly lead to a security
+// vulnerability.
+# define _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(expression, message) _LIBCPP_ASSUME(expression)
+# define _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(expression, message) _LIBCPP_ASSUME(expression)
+# define _LIBCPP_ASSERT_INTERNAL(expression, message) _LIBCPP_ASSUME(expression)
+# define _LIBCPP_ASSERT_UNCATEGORIZED(expression, message) _LIBCPP_ASSUME(expression)
+
+// Debug mode checks.
+
+# elif _LIBCPP_ENABLE_DEBUG_MODE
+
+// All checks enabled.
+# define _LIBCPP_ASSERT_VALID_INPUT_RANGE(expression, message) _LIBCPP_ASSERT(expression, message)
+# define _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(expression, message) _LIBCPP_ASSERT(expression, message)
+# define _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(expression, message) _LIBCPP_ASSERT(expression, message)
+# define _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(expression, message) _LIBCPP_ASSERT(expression, message)
+# define _LIBCPP_ASSERT_INTERNAL(expression, message) _LIBCPP_ASSERT(expression, message)
+# define _LIBCPP_ASSERT_UNCATEGORIZED(expression, message) _LIBCPP_ASSERT(expression, message)
+
+// Safe mode checks.
+
+# elif _LIBCPP_ENABLE_ASSERTIONS
+
+// All checks enabled.
+# define _LIBCPP_ASSERT_VALID_INPUT_RANGE(expression, message) _LIBCPP_ASSERT(expression, message)
+# define _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(expression, message) _LIBCPP_ASSERT(expression, message)
+# define _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(expression, message) _LIBCPP_ASSERT(expression, message)
+# define _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(expression, message) _LIBCPP_ASSERT(expression, message)
+# define _LIBCPP_ASSERT_INTERNAL(expression, message) _LIBCPP_ASSERT(expression, message)
+# define _LIBCPP_ASSERT_UNCATEGORIZED(expression, message) _LIBCPP_ASSERT(expression, message)
+
+// Disable all checks if hardening is not enabled.
+
+# else
+
+// All checks disabled.
+# define _LIBCPP_ASSERT_VALID_INPUT_RANGE(expression, message) _LIBCPP_ASSUME(expression)
+# define _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(expression, message) _LIBCPP_ASSUME(expression)
+# define _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(expression, message) _LIBCPP_ASSUME(expression)
+# define _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(expression, message) _LIBCPP_ASSUME(expression)
+# define _LIBCPP_ASSERT_INTERNAL(expression, message) _LIBCPP_ASSUME(expression)
+# define _LIBCPP_ASSERT_UNCATEGORIZED(expression, message) _LIBCPP_ASSUME(expression)
+
+# endif // _LIBCPP_ENABLE_HARDENED_MODE
+// clang-format on
+
+// } HARDENING
+
# define _LIBCPP_TOSTRING2(x) #x
# define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
+// NOLINTNEXTLINE(libcpp-cpp-version-check)
# if __cplusplus < 201103L
# define _LIBCPP_CXX03_LANG
# endif
@@ -289,7 +441,11 @@
// Incomplete features get their own specific disabling flags. This makes it
// easier to grep for target specific flags once the feature is complete.
# if !defined(_LIBCPP_ENABLE_EXPERIMENTAL) && !defined(_LIBCPP_BUILDING_LIBRARY)
-//# define _LIBCPP_HAS_NO_INCOMPLETE_FORMAT
+# define _LIBCPP_HAS_NO_INCOMPLETE_PSTL
+# endif
+
+# if !defined(_LIBCPP_ENABLE_EXPERIMENTAL) && !defined(_LIBCPP_BUILDING_LIBRARY)
+# define _LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN
# endif
// Need to detect which libc we're using if we're on Linux.
@@ -327,8 +483,8 @@
# endif // __BYTE_ORDER__
# ifdef __FreeBSD__
-# include <sys/endian.h>
# include <osreldate.h>
+# include <sys/endian.h>
# if _BYTE_ORDER == _LITTLE_ENDIAN
# define _LIBCPP_LITTLE_ENDIAN
# else // _BYTE_ORDER == _LITTLE_ENDIAN
@@ -362,15 +518,6 @@
# define _LIBCPP_HAS_OPEN_WITH_WCHAR
# endif // defined(_WIN32)
-# ifdef __sun__
-# include <sys/isa_defs.h>
-# ifdef _LITTLE_ENDIAN
-# define _LIBCPP_LITTLE_ENDIAN
-# else
-# define _LIBCPP_BIG_ENDIAN
-# endif
-# endif // __sun__
-
# if defined(_AIX) && !defined(__64BIT__)
// The size of wchar is 2 byte on 32-bit mode on AIX.
# define _LIBCPP_SHORT_WCHAR 1
@@ -415,7 +562,7 @@
// When this option is used, the token passed to `std::random_device`'s
// constructor *must* be "/dev/urandom" -- anything else is an error.
# if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
- defined(__DragonFly__) || defined(__sun__)
+ defined(__DragonFly__)
# define _LIBCPP_USING_ARC4_RANDOM
# elif defined(__wasi__) || defined(__EMSCRIPTEN__)
# define _LIBCPP_USING_GETENTROPY
@@ -476,15 +623,24 @@ typedef __char32_t char32_t;
# endif
# if !defined(__cpp_exceptions) || __cpp_exceptions < 199711L
-# define _LIBCPP_NO_EXCEPTIONS
+# define _LIBCPP_HAS_NO_EXCEPTIONS
# endif
# define _LIBCPP_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp)
# if defined(_LIBCPP_COMPILER_CLANG_BASED)
-# if defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && (!defined(__arm__) || __ARM_ARCH_7K__ >= 2)
-# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+# if defined(__APPLE__)
+# if defined(__i386__) || defined(__x86_64__)
+// use old string layout on x86_64 and i386
+# elif defined(__arm__)
+// use old string layout on arm (which does not include aarch64/arm64), except on watch ABIs
+# if defined(__ARM_ARCH_7K__) && __ARM_ARCH_7K__ >= 2
+# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+# endif
+# else
+# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+# endif
# endif
// Objective-C++ features (opt-in)
@@ -562,9 +718,6 @@ typedef __char32_t char32_t;
# define _LIBCPP_EXPORTED_FROM_ABI __declspec(dllimport)
# endif
-# define _LIBCPP_TYPE_VIS _LIBCPP_DLL_VIS
-# define _LIBCPP_FUNC_VIS _LIBCPP_DLL_VIS
-# define _LIBCPP_EXCEPTION_ABI _LIBCPP_DLL_VIS
# define _LIBCPP_HIDDEN
# define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
# define _LIBCPP_TEMPLATE_VIS
@@ -580,11 +733,8 @@ typedef __char32_t char32_t;
# endif
# define _LIBCPP_HIDDEN _LIBCPP_VISIBILITY("hidden")
-# define _LIBCPP_FUNC_VIS _LIBCPP_VISIBILITY("default")
-# define _LIBCPP_TYPE_VIS _LIBCPP_VISIBILITY("default")
# define _LIBCPP_TEMPLATE_DATA_VIS _LIBCPP_VISIBILITY("default")
# define _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_VISIBILITY("default")
-# define _LIBCPP_EXCEPTION_ABI _LIBCPP_VISIBILITY("default")
# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_VISIBILITY("default")
# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
@@ -627,22 +777,54 @@ typedef __char32_t char32_t;
# define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION _LIBCPP_ALWAYS_INLINE
# endif
+# if _LIBCPP_ENABLE_HARDENED_MODE
+# define _LIBCPP_HARDENING_SIG h
+# elif _LIBCPP_ENABLE_ASSERTIONS
+# define _LIBCPP_HARDENING_SIG s
+# elif _LIBCPP_ENABLE_DEBUG_MODE
+# define _LIBCPP_HARDENING_SIG d
+# else
+# define _LIBCPP_HARDENING_SIG u // for unchecked
+# endif
+
+# ifdef _LIBCPP_HAS_NO_EXCEPTIONS
+# define _LIBCPP_EXCEPTIONS_SIG n
+# else
+# define _LIBCPP_EXCEPTIONS_SIG e
+# endif
+
+# define _LIBCPP_ODR_SIGNATURE \
+ _LIBCPP_CONCAT(_LIBCPP_CONCAT(_LIBCPP_HARDENING_SIG, _LIBCPP_EXCEPTIONS_SIG), _LIBCPP_VERSION)
+
// This macro marks a symbol as being hidden from libc++'s ABI. This is achieved
// on two levels:
// 1. The symbol is given hidden visibility, which ensures that users won't start exporting
// symbols from their dynamic library by means of using the libc++ headers. This ensures
// that those symbols stay private to the dynamic library in which it is defined.
//
-// 2. The symbol is given an ABI tag that changes with each version of libc++. This ensures
-// that no ODR violation can arise from mixing two TUs compiled with different versions
-// of libc++ where we would have changed the definition of a symbol. If the symbols shared
-// the same name, the ODR would require that their definitions be token-by-token equivalent,
-// which basically prevents us from being able to make any change to any function in our
-// headers. Using this ABI tag ensures that the symbol name is "bumped" artificially at
-// each release, which lets us change the definition of these symbols at our leisure.
-// Note that historically, this has been achieved in various ways, including force-inlining
-// all functions or giving internal linkage to all functions. Both these (previous) solutions
-// suffer from drawbacks that lead notably to code bloat.
+// 2. The symbol is given an ABI tag that encodes the ODR-relevant properties of the library.
+// This ensures that no ODR violation can arise from mixing two TUs compiled with different
+// versions or configurations of libc++ (such as exceptions vs no-exceptions). Indeed, if the
+// program contains two definitions of a function, the ODR requires them to be token-by-token
+// equivalent, and the linker is allowed to pick either definition and discard the other one.
+//
+// For example, if a program contains a copy of `vector::at()` compiled with exceptions enabled
+// *and* a copy of `vector::at()` compiled with exceptions disabled (by means of having two TUs
+// compiled with different settings), the two definitions are both visible by the linker and they
+// have the same name, but they have a meaningfully different implementation (one throws an exception
+// and the other aborts the program). This violates the ODR and makes the program ill-formed, and in
+// practice what will happen is that the linker will pick one of the definitions at random and will
+// discard the other one. This can quite clearly lead to incorrect program behavior.
+//
+// A similar reasoning holds for many other properties that are ODR-affecting. Essentially any
+// property that causes the code of a function to differ from the code in another configuration
+// can be considered ODR-affecting. In practice, we don't encode all such properties in the ABI
+// tag, but we encode the ones that we think are most important: library version, exceptions, and
+// hardening mode.
+//
+// Note that historically, solving this problem has been achieved in various ways, including
+// force-inlining all functions or giving internal linkage to all functions. Both these previous
+// solutions suffer from drawbacks that lead notably to code bloat.
//
// Note that we use _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION to ensure that we don't depend
// on _LIBCPP_HIDE_FROM_ABI methods of classes explicitly instantiated in the dynamic library.
@@ -662,7 +844,7 @@ typedef __char32_t char32_t;
# if !defined(_LIBCPP_NO_ABI_TAG) && !defined(__CUDACC__)
# define _LIBCPP_HIDE_FROM_ABI \
_LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION \
- __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_VERSIONED_IDENTIFIER))))
+ __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
# else
# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
# endif
@@ -693,7 +875,7 @@ typedef __char32_t char32_t;
_LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
-# if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
# define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM \
_LIBCPP_BEGIN_NAMESPACE_STD inline namespace __fs { namespace filesystem {
# else
@@ -710,16 +892,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# define _LIBCPP_PREFERRED_OVERLOAD __attribute__((__enable_if__(true, "")))
# endif
-# ifndef __SIZEOF_INT128__
+# if !defined(__SIZEOF_INT128__) || defined(_MSC_VER)
# define _LIBCPP_HAS_NO_INT128
# endif
-# ifndef __cpp_consteval
-# define _LIBCPP_CONSTEVAL _LIBCPP_CONSTEXPR
-# else
-# define _LIBCPP_CONSTEVAL consteval
-# endif
-
# if __has_attribute(__malloc__)
# define _LIBCPP_NOALIAS __attribute__((__malloc__))
# else
@@ -734,7 +910,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# ifdef _LIBCPP_CXX03_LANG
# define _LIBCPP_DECLARE_STRONG_ENUM(x) \
- struct _LIBCPP_TYPE_VIS x { \
+ struct _LIBCPP_EXPORTED_FROM_ABI x { \
enum __lx
// clang-format off
# define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
@@ -750,8 +926,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
# endif // _LIBCPP_CXX03_LANG
-# if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT_LIKE) || defined(__sun__) || \
- defined(__NetBSD__)
+# if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT_LIKE) || defined(__NetBSD__)
# define _LIBCPP_LOCALE__L_EXTENSIONS 1
# endif
@@ -791,7 +966,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# define _LIBCPP_HAS_DEFAULTRUNELOCALE
# endif
-# if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)
+# if defined(__APPLE__) || defined(__FreeBSD__)
# define _LIBCPP_WCTYPE_IS_MASK
# endif
@@ -804,10 +979,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
// Deprecations warnings are always enabled, except when users explicitly opt-out
// by defining _LIBCPP_DISABLE_DEPRECATION_WARNINGS.
# if !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
-# if __has_attribute(deprecated)
-# define _LIBCPP_DEPRECATED __attribute__((deprecated))
-# define _LIBCPP_DEPRECATED_(m) __attribute__((deprecated(m)))
-# elif _LIBCPP_STD_VER > 11
+# if __has_attribute(__deprecated__)
+# define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
+# define _LIBCPP_DEPRECATED_(m) __attribute__((__deprecated__(m)))
+# elif _LIBCPP_STD_VER >= 14
# define _LIBCPP_DEPRECATED [[deprecated]]
# define _LIBCPP_DEPRECATED_(m) [[deprecated(m)]]
# else
@@ -825,29 +1000,29 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# define _LIBCPP_DEPRECATED_IN_CXX11
# endif
-# if _LIBCPP_STD_VER > 11
+# if _LIBCPP_STD_VER >= 14
# define _LIBCPP_DEPRECATED_IN_CXX14 _LIBCPP_DEPRECATED
# else
# define _LIBCPP_DEPRECATED_IN_CXX14
# endif
-# if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
# define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
# else
# define _LIBCPP_DEPRECATED_IN_CXX17
# endif
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
# define _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_DEPRECATED
# else
# define _LIBCPP_DEPRECATED_IN_CXX20
# endif
-#if _LIBCPP_STD_VER >= 23
-# define _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_DEPRECATED
-#else
-# define _LIBCPP_DEPRECATED_IN_CXX23
-#endif
+# if _LIBCPP_STD_VER >= 23
+# define _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_DEPRECATED
+# else
+# define _LIBCPP_DEPRECATED_IN_CXX23
+# endif
# if !defined(_LIBCPP_HAS_NO_CHAR8_T)
# define _LIBCPP_DEPRECATED_WITH_CHAR8_T _LIBCPP_DEPRECATED
@@ -867,37 +1042,43 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# endif
# if _LIBCPP_STD_VER <= 11
-# define _LIBCPP_EXPLICIT_AFTER_CXX11
+# define _LIBCPP_EXPLICIT_SINCE_CXX14
+# else
+# define _LIBCPP_EXPLICIT_SINCE_CXX14 explicit
+# endif
+
+# if _LIBCPP_STD_VER >= 23
+# define _LIBCPP_EXPLICIT_SINCE_CXX23 explicit
# else
-# define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit
+# define _LIBCPP_EXPLICIT_SINCE_CXX23
# endif
-# if _LIBCPP_STD_VER > 11
+# if _LIBCPP_STD_VER >= 14
# define _LIBCPP_CONSTEXPR_SINCE_CXX14 constexpr
# else
# define _LIBCPP_CONSTEXPR_SINCE_CXX14
# endif
-# if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
# define _LIBCPP_CONSTEXPR_SINCE_CXX17 constexpr
# else
# define _LIBCPP_CONSTEXPR_SINCE_CXX17
# endif
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
# define _LIBCPP_CONSTEXPR_SINCE_CXX20 constexpr
# else
# define _LIBCPP_CONSTEXPR_SINCE_CXX20
# endif
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
# define _LIBCPP_CONSTEXPR_SINCE_CXX23 constexpr
# else
# define _LIBCPP_CONSTEXPR_SINCE_CXX23
# endif
# if __has_cpp_attribute(nodiscard)
-# define _LIBCPP_NODISCARD [[nodiscard]]
+# define _LIBCPP_NODISCARD [[__nodiscard__]]
# else
// We can't use GCC's [[gnu::warn_unused_result]] and
// __attribute__((warn_unused_result)), because GCC does not silence them via
@@ -913,7 +1094,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# define _LIBCPP_NODISCARD_EXT
# endif
-# if _LIBCPP_STD_VER > 17 || !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
+# if _LIBCPP_STD_VER >= 20 || !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
# define _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_NODISCARD
# else
# define _LIBCPP_NODISCARD_AFTER_CXX17
@@ -926,8 +1107,14 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# endif
# ifndef _LIBCPP_HAS_NO_ASAN
- extern "C" _LIBCPP_FUNC_VIS void
+ extern "C" _LIBCPP_EXPORTED_FROM_ABI void
__sanitizer_annotate_contiguous_container(const void*, const void*, const void*, const void*);
+# if _LIBCPP_CLANG_VER >= 1600 && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES)
+extern "C" _LIBCPP_EXPORTED_FROM_ABI void __sanitizer_annotate_double_ended_contiguous_container(
+ const void*, const void*, const void*, const void*, const void*, const void*);
+extern "C" _LIBCPP_EXPORTED_FROM_ABI int
+__sanitizer_verify_double_ended_contiguous_container(const void*, const void*, const void*, const void*);
+# endif
# endif
// Try to find out if RTTI is disabled.
@@ -954,7 +1141,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
defined(__linux__) || \
defined(__GNU__) || \
defined(__APPLE__) || \
- defined(__sun__) || \
defined(__MVS__) || \
defined(_AIX) || \
defined(__EMSCRIPTEN__) || \
@@ -1062,6 +1248,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
# endif
+# if defined(__FreeBSD__) && defined(__clang__) && __has_attribute(__no_thread_safety_analysis__)
+# define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS __attribute__((__no_thread_safety_analysis__))
+# else
+# define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
+# endif
+
# if defined(_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS)
# if defined(__clang__) && __has_attribute(acquire_capability)
// Work around the attribute handling in clang. When both __declspec and
@@ -1080,7 +1272,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x)
# endif
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
# define _LIBCPP_CONSTINIT constinit
# elif __has_attribute(__require_constant_initialization__)
# define _LIBCPP_CONSTINIT __attribute__((__require_constant_initialization__))
@@ -1137,6 +1329,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# define _LIBCPP_PREFERRED_NAME(x)
# endif
+# if __has_attribute(__no_sanitize__)
+# define _LIBCPP_NO_SANITIZE(...) __attribute__((__no_sanitize__(__VA_ARGS__)))
+# else
+# define _LIBCPP_NO_SANITIZE(...)
+# endif
+
// We often repeat things just for handling wide characters in the library.
// When wide characters are disabled, it can be useful to have a quick way of
// disabling it without having to resort to #if-#endif, which has a larger
@@ -1174,8 +1372,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# define _LIBCPP_DISABLE_AVAILABILITY
// End of Yandex-specific
-# define _LIBCPP_PUSH_MACROS _Pragma("push_macro(\"min\")") _Pragma("push_macro(\"max\")")
-# define _LIBCPP_POP_MACROS _Pragma("pop_macro(\"min\")") _Pragma("pop_macro(\"max\")")
+// clang-format off
+# define _LIBCPP_PUSH_MACROS _Pragma("push_macro(\"min\")") _Pragma("push_macro(\"max\")") _Pragma("push_macro(\"refresh()\")") _Pragma("push_macro(\"move(int, int)\")") _Pragma("push_macro(\"erase()\")")
+# define _LIBCPP_POP_MACROS _Pragma("pop_macro(\"min\")") _Pragma("pop_macro(\"max\")") _Pragma("pop_macro(\"refresh()\")") _Pragma("pop_macro(\"move(int, int)\")") _Pragma("pop_macro(\"erase()\")")
+// clang-format on
# ifndef _LIBCPP_NO_AUTO_LINK
# if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
@@ -1231,7 +1431,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
// [[msvc::no_unique_address]], this should be preferred though.
# define _LIBCPP_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
# elif __has_cpp_attribute(no_unique_address)
-# define _LIBCPP_NO_UNIQUE_ADDRESS [[no_unique_address]]
+# define _LIBCPP_NO_UNIQUE_ADDRESS [[__no_unique_address__]]
# else
# define _LIBCPP_NO_UNIQUE_ADDRESS /* nothing */
// Note that this can be replaced by #error as soon as clang-cl
@@ -1294,13 +1494,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
// macro is used to mark them as such, which suppresses the
// '-Wctad-maybe-unsupported' compiler warning when CTAD is used in user code
// with these classes.
-#if _LIBCPP_STD_VER >= 17
-# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) \
- template <class ..._Tag> \
- _ClassName(typename _Tag::__allow_ctad...) -> _ClassName<_Tag...>
-#else
-# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) static_assert(true, "")
-#endif
+# if _LIBCPP_STD_VER >= 17
+# ifdef _LIBCPP_COMPILER_CLANG_BASED
+# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) \
+ template <class... _Tag> \
+ [[maybe_unused]] _ClassName(typename _Tag::__allow_ctad...)->_ClassName<_Tag...>
+# else
+# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(ClassName) \
+ template <class... _Tag> \
+ ClassName(typename _Tag::__allow_ctad...)->ClassName<_Tag...>
+# endif
+# else
+# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) static_assert(true, "")
+# endif
// TODO(varconst): currently, there are bugs in Clang's intrinsics when handling Objective-C++ `id`, so don't use
// compiler intrinsics in the Objective-C++ mode.
@@ -1308,6 +1514,43 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# define _LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS
# endif
+# define _PSTL_PRAGMA(x) _Pragma(#x)
+
+// Enable SIMD for compilers that support OpenMP 4.0
+# if (defined(_OPENMP) && _OPENMP >= 201307)
+
+# define _PSTL_UDR_PRESENT
+# define _PSTL_PRAGMA_SIMD _PSTL_PRAGMA(omp simd)
+# define _PSTL_PRAGMA_DECLARE_SIMD _PSTL_PRAGMA(omp declare simd)
+# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM) _PSTL_PRAGMA(omp simd reduction(PRM))
+# define _PSTL_PRAGMA_SIMD_SCAN(PRM) _PSTL_PRAGMA(omp simd reduction(inscan, PRM))
+# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan inclusive(PRM))
+# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan exclusive(PRM))
+
+// Declaration of reduction functor, where
+// NAME - the name of the functor
+// OP - type of the callable object with the reduction operation
+// omp_in - refers to the local partial result
+// omp_out - refers to the final value of the combiner operator
+// omp_priv - refers to the private copy of the initial value
+// omp_orig - refers to the original variable to be reduced
+# define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP) \
+ _PSTL_PRAGMA(omp declare reduction(NAME:OP : omp_out(omp_in)) initializer(omp_priv = omp_orig))
+
+# else // (defined(_OPENMP) && _OPENMP >= 201307)
+
+# define _PSTL_PRAGMA_SIMD
+# define _PSTL_PRAGMA_DECLARE_SIMD
+# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM)
+# define _PSTL_PRAGMA_SIMD_SCAN(PRM)
+# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM)
+# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM)
+# define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP)
+
+# endif // (defined(_OPENMP) && _OPENMP >= 201307)
+
+# define _PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED
+
#endif // __cplusplus
#endif // _LIBCPP___CONFIG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__config_site b/contrib/libs/cxxsupp/libcxx/include/__config_site
index 99cd2c3ccf2..83ccfdaf204 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__config_site
+++ b/contrib/libs/cxxsupp/libcxx/include/__config_site
@@ -4,6 +4,7 @@
#define _LIBCPP_ABI_NAMESPACE __y1
#define _LIBCPP_DISABLE_NODISCARD_EXT
+#define _LIBCPP_PSTL_CPU_BACKEND_THREAD
#ifndef _YNDX_LIBCPP_ENABLE_EXTENSIONS
# define _YNDX_LIBCPP_ENABLE_EXTENSIONS 1
@@ -44,6 +45,8 @@
#define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS
#define _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#define _LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES
+
#ifdef _musl_
# define _LIBCPP_HAS_MUSL_LIBC
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_handle.h b/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_handle.h
index 0a6cc1cab69..7a4eff745eb 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_handle.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_handle.h
@@ -21,7 +21,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -33,7 +33,6 @@ template <>
struct _LIBCPP_TEMPLATE_VIS coroutine_handle<void> {
public:
// [coroutine.handle.con], construct/reset
- _LIBCPP_HIDE_FROM_ABI
constexpr coroutine_handle() noexcept = default;
_LIBCPP_HIDE_FROM_ABI
@@ -64,7 +63,7 @@ public:
_LIBCPP_HIDE_FROM_ABI
bool done() const {
- _LIBCPP_ASSERT(__is_suspended(), "done() can be called only on suspended coroutines");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_suspended(), "done() can be called only on suspended coroutines");
return __builtin_coro_done(__handle_);
}
@@ -74,19 +73,19 @@ public:
_LIBCPP_HIDE_FROM_ABI
void resume() const {
- _LIBCPP_ASSERT(__is_suspended(), "resume() can be called only on suspended coroutines");
- _LIBCPP_ASSERT(!done(), "resume() has undefined behavior when the coroutine is done");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_suspended(), "resume() can be called only on suspended coroutines");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!done(), "resume() has undefined behavior when the coroutine is done");
__builtin_coro_resume(__handle_);
}
_LIBCPP_HIDE_FROM_ABI
void destroy() const {
- _LIBCPP_ASSERT(__is_suspended(), "destroy() can be called only on suspended coroutines");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_suspended(), "destroy() can be called only on suspended coroutines");
__builtin_coro_destroy(__handle_);
}
private:
- bool __is_suspended() const {
+ _LIBCPP_HIDE_FROM_ABI bool __is_suspended() const {
// FIXME actually implement a check for if the coro is suspended.
return __handle_ != nullptr;
}
@@ -108,7 +107,6 @@ template <class _Promise>
struct _LIBCPP_TEMPLATE_VIS coroutine_handle {
public:
// [coroutine.handle.con], construct/reset
- _LIBCPP_HIDE_FROM_ABI
constexpr coroutine_handle() noexcept = default;
_LIBCPP_HIDE_FROM_ABI
@@ -154,7 +152,7 @@ public:
_LIBCPP_HIDE_FROM_ABI
bool done() const {
- _LIBCPP_ASSERT(__is_suspended(), "done() can be called only on suspended coroutines");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_suspended(), "done() can be called only on suspended coroutines");
return __builtin_coro_done(__handle_);
}
@@ -164,14 +162,14 @@ public:
_LIBCPP_HIDE_FROM_ABI
void resume() const {
- _LIBCPP_ASSERT(__is_suspended(), "resume() can be called only on suspended coroutines");
- _LIBCPP_ASSERT(!done(), "resume() has undefined behavior when the coroutine is done");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_suspended(), "resume() can be called only on suspended coroutines");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!done(), "resume() has undefined behavior when the coroutine is done");
__builtin_coro_resume(__handle_);
}
_LIBCPP_HIDE_FROM_ABI
void destroy() const {
- _LIBCPP_ASSERT(__is_suspended(), "destroy() can be called only on suspended coroutines");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_suspended(), "destroy() can be called only on suspended coroutines");
__builtin_coro_destroy(__handle_);
}
@@ -182,7 +180,7 @@ public:
}
private:
- bool __is_suspended() const {
+ _LIBCPP_HIDE_FROM_ABI bool __is_suspended() const {
// FIXME actually implement a check for if the coro is suspended.
return __handle_ != nullptr;
}
@@ -198,6 +196,6 @@ struct hash<coroutine_handle<_Tp>> {
_LIBCPP_END_NAMESPACE_STD
-#endif // __LIBCPP_STD_VER > 17
+#endif // __LIBCPP_STD_VER >= 20
#endif // _LIBCPP___COROUTINE_COROUTINE_HANDLE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_traits.h b/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_traits.h
index d513075098c..7122cc8ea8f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_traits.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_traits.h
@@ -16,7 +16,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -48,6 +48,6 @@ struct coroutine_traits
_LIBCPP_END_NAMESPACE_STD
-#endif // __LIBCPP_STD_VER > 17
+#endif // __LIBCPP_STD_VER >= 20
#endif // _LIBCPP___COROUTINE_COROUTINE_TRAITS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__coroutine/noop_coroutine_handle.h b/contrib/libs/cxxsupp/libcxx/include/__coroutine/noop_coroutine_handle.h
index 299304794cc..9b7802d1e28 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__coroutine/noop_coroutine_handle.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__coroutine/noop_coroutine_handle.h
@@ -16,7 +16,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -107,6 +107,6 @@ noop_coroutine_handle noop_coroutine() noexcept { return noop_coroutine_handle()
_LIBCPP_END_NAMESPACE_STD
-#endif // __LIBCPP_STD_VER > 17
+#endif // __LIBCPP_STD_VER >= 20
#endif // _LIBCPP___COROUTINE_NOOP_COROUTINE_HANDLE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__coroutine/trivial_awaitables.h b/contrib/libs/cxxsupp/libcxx/include/__coroutine/trivial_awaitables.h
index bbbae7a47f2..0e4b08e377c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__coroutine/trivial_awaitables.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__coroutine/trivial_awaitables.h
@@ -16,7 +16,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -41,6 +41,6 @@ struct suspend_always {
_LIBCPP_END_NAMESPACE_STD
-#endif // __LIBCPP_STD_VER > 17
+#endif // __LIBCPP_STD_VER >= 20
#endif // __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__debug b/contrib/libs/cxxsupp/libcxx/include/__debug
deleted file mode 100644
index 140cc9142a8..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__debug
+++ /dev/null
@@ -1,266 +0,0 @@
-// -*- 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___DEBUG
-#define _LIBCPP___DEBUG
-
-#include <__assert>
-#include <__config>
-#include <__type_traits/is_constant_evaluated.h>
-#include <cstddef>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-#if defined(_LIBCPP_ENABLE_DEBUG_MODE) && !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY)
-# define _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY
-#endif
-
-#if defined(_LIBCPP_ENABLE_DEBUG_MODE) && !defined(_LIBCPP_DEBUG_ITERATOR_BOUNDS_CHECKING)
-# define _LIBCPP_DEBUG_ITERATOR_BOUNDS_CHECKING
-#endif
-
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-# define _LIBCPP_DEBUG_ASSERT(x, m) _LIBCPP_ASSERT(::std::__libcpp_is_constant_evaluated() || (x), m)
-#else
-# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)
-#endif
-
-#if defined(_LIBCPP_ENABLE_DEBUG_MODE) || defined(_LIBCPP_BUILDING_LIBRARY)
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-struct _LIBCPP_TYPE_VIS __c_node;
-
-struct _LIBCPP_TYPE_VIS __i_node
-{
- void* __i_;
- __i_node* __next_;
- __c_node* __c_;
-
- __i_node(const __i_node&) = delete;
- __i_node& operator=(const __i_node&) = delete;
-
- _LIBCPP_INLINE_VISIBILITY
- __i_node(void* __i, __i_node* __next, __c_node* __c)
- : __i_(__i), __next_(__next), __c_(__c) {}
- ~__i_node();
-};
-
-struct _LIBCPP_TYPE_VIS __c_node
-{
- void* __c_;
- __c_node* __next_;
- __i_node** beg_;
- __i_node** end_;
- __i_node** cap_;
-
- __c_node(const __c_node&) = delete;
- __c_node& operator=(const __c_node&) = delete;
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __c_node(void* __c, __c_node* __next)
- : __c_(__c), __next_(__next), beg_(nullptr), end_(nullptr), cap_(nullptr) {}
- virtual ~__c_node();
-
- virtual bool __dereferenceable(const void*) const = 0;
- virtual bool __decrementable(const void*) const = 0;
- virtual bool __addable(const void*, ptrdiff_t) const = 0;
- virtual bool __subscriptable(const void*, ptrdiff_t) const = 0;
-
- void __add(__i_node* __i);
- _LIBCPP_HIDDEN void __remove(__i_node* __i);
-};
-
-template <class _Cont>
-struct _C_node
- : public __c_node
-{
- explicit _C_node(void* __c, __c_node* __n)
- : __c_node(__c, __n) {}
-
- bool __dereferenceable(const void*) const override;
- bool __decrementable(const void*) const override;
- bool __addable(const void*, ptrdiff_t) const override;
- bool __subscriptable(const void*, ptrdiff_t) const override;
-};
-
-template <class _Cont>
-inline bool
-_C_node<_Cont>::__dereferenceable(const void* __i) const
-{
- typedef typename _Cont::const_iterator iterator;
- const iterator* __j = static_cast<const iterator*>(__i);
- _Cont* _Cp = static_cast<_Cont*>(__c_);
- return _Cp->__dereferenceable(__j);
-}
-
-template <class _Cont>
-inline bool
-_C_node<_Cont>::__decrementable(const void* __i) const
-{
- typedef typename _Cont::const_iterator iterator;
- const iterator* __j = static_cast<const iterator*>(__i);
- _Cont* _Cp = static_cast<_Cont*>(__c_);
- return _Cp->__decrementable(__j);
-}
-
-template <class _Cont>
-inline bool
-_C_node<_Cont>::__addable(const void* __i, ptrdiff_t __n) const
-{
- typedef typename _Cont::const_iterator iterator;
- const iterator* __j = static_cast<const iterator*>(__i);
- _Cont* _Cp = static_cast<_Cont*>(__c_);
- return _Cp->__addable(__j, __n);
-}
-
-template <class _Cont>
-inline bool
-_C_node<_Cont>::__subscriptable(const void* __i, ptrdiff_t __n) const
-{
- typedef typename _Cont::const_iterator iterator;
- const iterator* __j = static_cast<const iterator*>(__i);
- _Cont* _Cp = static_cast<_Cont*>(__c_);
- return _Cp->__subscriptable(__j, __n);
-}
-
-class _LIBCPP_TYPE_VIS __libcpp_db
-{
- __c_node** __cbeg_;
- __c_node** __cend_;
- size_t __csz_;
- __i_node** __ibeg_;
- __i_node** __iend_;
- size_t __isz_;
-
- explicit __libcpp_db();
-public:
- __libcpp_db(const __libcpp_db&) = delete;
- __libcpp_db& operator=(const __libcpp_db&) = delete;
-
- ~__libcpp_db();
-
- class __db_c_iterator;
- class __db_c_const_iterator;
- class __db_i_iterator;
- class __db_i_const_iterator;
-
- __db_c_const_iterator __c_end() const;
- __db_i_const_iterator __i_end() const;
-
- typedef __c_node*(_InsertConstruct)(void*, void*, __c_node*);
-
- template <class _Cont>
- _LIBCPP_INLINE_VISIBILITY static __c_node* __create_C_node(void *__mem, void *__c, __c_node *__next) {
- return ::new (__mem) _C_node<_Cont>(__c, __next);
- }
-
- template <class _Cont>
- _LIBCPP_INLINE_VISIBILITY
- void __insert_c(_Cont* __c)
- {
- __insert_c(static_cast<void*>(__c), &__create_C_node<_Cont>);
- }
-
- void __insert_i(void* __i);
- void __insert_c(void* __c, _InsertConstruct* __fn);
- void __erase_c(void* __c);
-
- void __insert_ic(void* __i, const void* __c);
- void __iterator_copy(void* __i, const void* __i0);
- void __erase_i(void* __i);
-
- void* __find_c_from_i(void* __i) const;
- void __invalidate_all(void* __c);
- __c_node* __find_c_and_lock(void* __c) const;
- __c_node* __find_c(void* __c) const;
- void unlock() const;
-
- void swap(void* __c1, void* __c2);
-
-
- bool __dereferenceable(const void* __i) const;
- bool __decrementable(const void* __i) const;
- bool __addable(const void* __i, ptrdiff_t __n) const;
- bool __subscriptable(const void* __i, ptrdiff_t __n) const;
- bool __less_than_comparable(const void* __i, const void* __j) const;
-private:
- _LIBCPP_HIDDEN
- __i_node* __insert_iterator(void* __i);
- _LIBCPP_HIDDEN
- __i_node* __find_iterator(const void* __i) const;
-
- friend _LIBCPP_FUNC_VIS __libcpp_db* __get_db();
-};
-
-_LIBCPP_FUNC_VIS __libcpp_db* __get_db();
-_LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db();
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // defined(_LIBCPP_ENABLE_DEBUG_MODE) || defined(_LIBCPP_BUILDING_LIBRARY)
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 inline void __debug_db_insert_c(_Tp* __c) {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- if (!__libcpp_is_constant_evaluated())
- __get_db()->__insert_c(__c);
-#else
- (void)(__c);
-#endif
-}
-
-template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 inline void __debug_db_insert_i(_Tp* __i) {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- if (!__libcpp_is_constant_evaluated())
- __get_db()->__insert_i(__i);
-#else
- (void)(__i);
-#endif
-}
-
-template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 inline void __debug_db_erase_c(_Tp* __c) {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- if (!__libcpp_is_constant_evaluated())
- __get_db()->__erase_c(__c);
-#else
- (void)(__c);
-#endif
-}
-
-template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 inline void __debug_db_swap(_Tp* __lhs, _Tp* __rhs) {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- if (!__libcpp_is_constant_evaluated())
- __get_db()->swap(__lhs, __rhs);
-#else
- (void)(__lhs);
- (void)(__rhs);
-#endif
-}
-
-template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 inline void __debug_db_invalidate_all(_Tp* __c) {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- if (!__libcpp_is_constant_evaluated())
- __get_db()->__invalidate_all(__c);
-#else
- (void)(__c);
-#endif
-}
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP___DEBUG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__debug_utils/strict_weak_ordering_check.h b/contrib/libs/cxxsupp/libcxx/include/__debug_utils/strict_weak_ordering_check.h
new file mode 100644
index 00000000000..99200ad65ea
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__debug_utils/strict_weak_ordering_check.h
@@ -0,0 +1,77 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___LIBCXX_DEBUG_STRICT_WEAK_ORDERING_CHECK
+#define _LIBCPP___LIBCXX_DEBUG_STRICT_WEAK_ORDERING_CHECK
+
+#include <__config>
+
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/is_sorted.h>
+#include <__assert>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_constant_evaluated.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _RandomAccessIterator, class _Comp>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
+__check_strict_weak_ordering_sorted(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
+#ifdef _LIBCPP_DEBUG_STRICT_WEAK_ORDERING_CHECK
+ using __diff_t = __iter_diff_t<_RandomAccessIterator>;
+ using _Comp_ref = __comp_ref_type<_Comp>;
+ if (!__libcpp_is_constant_evaluated()) {
+ // Check if the range is actually sorted.
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ (std::is_sorted<_RandomAccessIterator, _Comp_ref>(__first, __last, _Comp_ref(__comp))),
+ "The range is not sorted after the sort, your comparator is not a valid strict-weak ordering");
+ // Limit the number of elements we need to check.
+ __diff_t __size = __last - __first > __diff_t(100) ? __diff_t(100) : __last - __first;
+ __diff_t __p = 0;
+ while (__p < __size) {
+ __diff_t __q = __p + __diff_t(1);
+ // Find first element that is greater than *(__first+__p).
+ while (__q < __size && !__comp(*(__first + __p), *(__first + __q))) {
+ ++__q;
+ }
+ // Check that the elements from __p to __q are equal between each other.
+ for (__diff_t __b = __p; __b < __q; ++__b) {
+ for (__diff_t __a = __p; __a <= __b; ++__a) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ !__comp(*(__first + __a), *(__first + __b)), "Your comparator is not a valid strict-weak ordering");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ !__comp(*(__first + __b), *(__first + __a)), "Your comparator is not a valid strict-weak ordering");
+ }
+ }
+ // Check that elements between __p and __q are less than between __q and __size.
+ for (__diff_t __a = __p; __a < __q; ++__a) {
+ for (__diff_t __b = __q; __b < __size; ++__b) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __comp(*(__first + __a), *(__first + __b)), "Your comparator is not a valid strict-weak ordering");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ !__comp(*(__first + __b), *(__first + __a)), "Your comparator is not a valid strict-weak ordering");
+ }
+ }
+ // Skip these equal elements.
+ __p = __q;
+ }
+ }
+#else
+ (void)__first;
+ (void)__last;
+ (void)__comp;
+#endif
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___LIBCXX_DEBUG_STRICT_WEAK_ORDERING_CHECK
diff --git a/contrib/libs/cxxsupp/libcxx/include/__exception/exception.h b/contrib/libs/cxxsupp/libcxx/include/__exception/exception.h
new file mode 100644
index 00000000000..3db0126da29
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__exception/exception.h
@@ -0,0 +1,91 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___EXCEPTION_EXCEPTION_H
+#define _LIBCPP___EXCEPTION_EXCEPTION_H
+
+#include <__config>
+
+// <vcruntime_exception.h> defines its own std::exception and std::bad_exception types,
+// which we use in order to be ABI-compatible with other STLs on Windows.
+#if defined(_LIBCPP_ABI_VCRUNTIME)
+# include <vcruntime_exception.h>
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+namespace std { // purposefully not using versioning namespace
+
+#if defined(_LIBCPP_ABI_VCRUNTIME) && (!defined(_HAS_EXCEPTIONS) || _HAS_EXCEPTIONS != 0)
+// The std::exception class was already included above, but we're explicit about this condition here for clarity.
+
+#elif defined(_LIBCPP_ABI_VCRUNTIME) && _HAS_EXCEPTIONS == 0
+// However, <vcruntime_exception.h> does not define std::exception and std::bad_exception
+// when _HAS_EXCEPTIONS == 0.
+//
+// Since libc++ still wants to provide the std::exception hierarchy even when _HAS_EXCEPTIONS == 0
+// (after all those are simply types like any other), we define an ABI-compatible version
+// of the VCRuntime std::exception and std::bad_exception types in that mode.
+
+struct __std_exception_data {
+ char const* _What;
+ bool _DoFree;
+};
+
+class exception { // base of all library exceptions
+public:
+ exception() _NOEXCEPT : __data_() {}
+
+ explicit exception(char const* __message) _NOEXCEPT : __data_() {
+ __data_._What = __message;
+ __data_._DoFree = true;
+ }
+
+ exception(exception const&) _NOEXCEPT {}
+
+ exception& operator=(exception const&) _NOEXCEPT { return *this; }
+
+ virtual ~exception() _NOEXCEPT {}
+
+ virtual char const* what() const _NOEXCEPT { return __data_._What ? __data_._What : "Unknown exception"; }
+
+private:
+ __std_exception_data __data_;
+};
+
+class bad_exception : public exception {
+public:
+ bad_exception() _NOEXCEPT : exception("bad exception") {}
+};
+
+#else // !defined(_LIBCPP_ABI_VCRUNTIME)
+// On all other platforms, we define our own std::exception and std::bad_exception types
+// regardless of whether exceptions are turned on as a language feature.
+
+class _LIBCPP_EXPORTED_FROM_ABI exception {
+public:
+ _LIBCPP_HIDE_FROM_ABI exception() _NOEXCEPT {}
+ _LIBCPP_HIDE_FROM_ABI exception(const exception&) _NOEXCEPT = default;
+
+ virtual ~exception() _NOEXCEPT;
+ virtual const char* what() const _NOEXCEPT;
+};
+
+class _LIBCPP_EXPORTED_FROM_ABI bad_exception : public exception {
+public:
+ _LIBCPP_HIDE_FROM_ABI bad_exception() _NOEXCEPT {}
+ ~bad_exception() _NOEXCEPT override;
+ const char* what() const _NOEXCEPT override;
+};
+#endif // !_LIBCPP_ABI_VCRUNTIME
+
+} // namespace std
+
+#endif // _LIBCPP___EXCEPTION_EXCEPTION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__exception/exception_ptr.h b/contrib/libs/cxxsupp/libcxx/include/__exception/exception_ptr.h
new file mode 100644
index 00000000000..03d3843f96b
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__exception/exception_ptr.h
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___EXCEPTION_EXCEPTION_PTR_H
+#define _LIBCPP___EXCEPTION_EXCEPTION_PTR_H
+
+#include <__config>
+#include <__exception/operations.h>
+#include <__memory/addressof.h>
+#include <cstddef>
+#include <cstdlib>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+namespace std { // purposefully not using versioning namespace
+
+
+class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
+ void* __ptr_;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI exception_ptr() _NOEXCEPT : __ptr_() {}
+ _LIBCPP_HIDE_FROM_ABI exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
+
+ exception_ptr(const exception_ptr&) _NOEXCEPT;
+ exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
+ ~exception_ptr() _NOEXCEPT;
+
+ _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __ptr_ != nullptr; }
+
+ friend _LIBCPP_HIDE_FROM_ABI bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT {
+ return __x.__ptr_ == __y.__ptr_;
+ }
+
+ friend _LIBCPP_HIDE_FROM_ABI bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT {
+ return !(__x == __y);
+ }
+
+ friend _LIBCPP_HIDE_FROM_ABI void swap(exception_ptr& __x, exception_ptr& __y) _NOEXCEPT
+ {
+ void* __tmp = __x.__ptr_;
+ __x.__ptr_ = __y.__ptr_;
+ __y.__ptr_ = __tmp;
+ }
+
+ friend _LIBCPP_EXPORTED_FROM_ABI exception_ptr current_exception() _NOEXCEPT;
+ friend _LIBCPP_EXPORTED_FROM_ABI void rethrow_exception(exception_ptr);
+};
+
+#ifndef _LIBCPP_ABI_MICROSOFT
+
+template <class _Ep>
+_LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
+# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ try {
+ throw __e;
+ } catch (...) {
+ return current_exception();
+ }
+# else
+ ((void)__e);
+ std::abort();
+# endif
+}
+
+#else // _LIBCPP_ABI_MICROSOFT
+
+_LIBCPP_HIDE_FROM_ABI exception_ptr __copy_exception_ptr(void *__exception, const void* __ptr);
+
+// This is a built-in template function which automagically extracts the required
+// information.
+template <class _E>
+void* __GetExceptionInfo(_E);
+
+template <class _Ep>
+exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
+ return __copy_exception_ptr(std::addressof(__e), __GetExceptionInfo(__e));
+}
+
+#endif // _LIBCPP_ABI_MICROSOFT
+} // namespace std
+
+#endif // _LIBCPP___EXCEPTION_EXCEPTION_PTR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__exception/nested_exception.h b/contrib/libs/cxxsupp/libcxx/include/__exception/nested_exception.h
new file mode 100644
index 00000000000..1136c927488
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__exception/nested_exception.h
@@ -0,0 +1,101 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___EXCEPTION_NESTED_EXCEPTION_H
+#define _LIBCPP___EXCEPTION_NESTED_EXCEPTION_H
+
+#include <__config>
+#include <__exception/exception_ptr.h>
+#include <__memory/addressof.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_base_of.h>
+#include <__type_traits/is_class.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_copy_constructible.h>
+#include <__type_traits/is_final.h>
+#include <__type_traits/is_polymorphic.h>
+#include <__utility/forward.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+namespace std { // purposefully not using versioning namespace
+
+class _LIBCPP_EXPORTED_FROM_ABI nested_exception {
+ exception_ptr __ptr_;
+
+public:
+ nested_exception() _NOEXCEPT;
+ // nested_exception(const nested_exception&) noexcept = default;
+ // nested_exception& operator=(const nested_exception&) noexcept = default;
+ virtual ~nested_exception() _NOEXCEPT;
+
+ // access functions
+ _LIBCPP_NORETURN void rethrow_nested() const;
+ _LIBCPP_HIDE_FROM_ABI exception_ptr nested_ptr() const _NOEXCEPT { return __ptr_; }
+};
+
+template <class _Tp>
+struct __nested : public _Tp, public nested_exception {
+ _LIBCPP_HIDE_FROM_ABI explicit __nested(const _Tp& __t) : _Tp(__t) {}
+};
+
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+template <class _Tp, class _Up, bool>
+struct __throw_with_nested;
+
+template <class _Tp, class _Up>
+struct __throw_with_nested<_Tp, _Up, true> {
+ _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void __do_throw(_Tp&& __t) {
+ throw __nested<_Up>(std::forward<_Tp>(__t));
+ }
+};
+
+template <class _Tp, class _Up>
+struct __throw_with_nested<_Tp, _Up, false> {
+ _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void __do_throw(_Tp&& __t) { throw std::forward<_Tp>(__t); }
+};
+#endif
+
+template <class _Tp>
+_LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI void throw_with_nested(_Tp&& __t) {
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ using _Up = __decay_t<_Tp>;
+ static_assert(is_copy_constructible<_Up>::value, "type thrown must be CopyConstructible");
+ __throw_with_nested<_Tp,
+ _Up,
+ is_class<_Up>::value && !is_base_of<nested_exception, _Up>::value &&
+ !__libcpp_is_final<_Up>::value>::__do_throw(std::forward<_Tp>(__t));
+#else
+ ((void)__t);
+ // FIXME: Make this abort
+#endif
+}
+
+template <class _From, class _To>
+struct __can_dynamic_cast
+ : _BoolConstant< is_polymorphic<_From>::value &&
+ (!is_base_of<_To, _From>::value || is_convertible<const _From*, const _To*>::value)> {};
+
+template <class _Ep>
+inline _LIBCPP_HIDE_FROM_ABI void
+rethrow_if_nested(const _Ep& __e, __enable_if_t< __can_dynamic_cast<_Ep, nested_exception>::value>* = 0) {
+ const nested_exception* __nep = dynamic_cast<const nested_exception*>(std::addressof(__e));
+ if (__nep)
+ __nep->rethrow_nested();
+}
+
+template <class _Ep>
+inline _LIBCPP_HIDE_FROM_ABI void
+rethrow_if_nested(const _Ep&, __enable_if_t<!__can_dynamic_cast<_Ep, nested_exception>::value>* = 0) {}
+
+} // namespace std
+
+#endif // _LIBCPP___EXCEPTION_NESTED_EXCEPTION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__exception/operations.h b/contrib/libs/cxxsupp/libcxx/include/__exception/operations.h
new file mode 100644
index 00000000000..78e7c7a5d0b
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__exception/operations.h
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___EXCEPTION_OPERATIONS_H
+#define _LIBCPP___EXCEPTION_OPERATIONS_H
+
+#include <__availability>
+#include <__config>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+namespace std { // purposefully not using versioning namespace
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) || \
+ defined(_LIBCPP_BUILDING_LIBRARY)
+using unexpected_handler = void (*)();
+_LIBCPP_EXPORTED_FROM_ABI unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
+_LIBCPP_EXPORTED_FROM_ABI unexpected_handler get_unexpected() _NOEXCEPT;
+_LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void unexpected();
+#endif
+
+using terminate_handler = void (*)();
+_LIBCPP_EXPORTED_FROM_ABI terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
+_LIBCPP_EXPORTED_FROM_ABI terminate_handler get_terminate() _NOEXCEPT;
+
+_LIBCPP_EXPORTED_FROM_ABI bool uncaught_exception() _NOEXCEPT;
+_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS int uncaught_exceptions() _NOEXCEPT;
+
+class _LIBCPP_EXPORTED_FROM_ABI exception_ptr;
+
+_LIBCPP_EXPORTED_FROM_ABI exception_ptr current_exception() _NOEXCEPT;
+_LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void rethrow_exception(exception_ptr);
+} // namespace std
+
+#endif // _LIBCPP___EXCEPTION_OPERATIONS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__exception/terminate.h b/contrib/libs/cxxsupp/libcxx/include/__exception/terminate.h
new file mode 100644
index 00000000000..e672471dc52
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__exception/terminate.h
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___EXCEPTION_TERMINATE_H
+#define _LIBCPP___EXCEPTION_TERMINATE_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+namespace std { // purposefully not using versioning namespace
+_LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void terminate() _NOEXCEPT;
+} // namespace std
+
+#endif // _LIBCPP___EXCEPTION_TERMINATE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/copy_options.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/copy_options.h
index 96c7535812e..11962e494c9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/copy_options.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/copy_options.h
@@ -21,8 +21,6 @@
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-
enum class _LIBCPP_ENUM_VIS copy_options : unsigned short {
none = 0,
skip_existing = 1,
@@ -75,8 +73,6 @@ inline copy_options& operator^=(copy_options& __lhs, copy_options __rhs) {
return __lhs = __lhs ^ __rhs;
}
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
-
_LIBCPP_END_NAMESPACE_FILESYSTEM
#endif // _LIBCPP_CXX03_LANG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h
index b17eaaab4c5..bb7a061db4c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h
@@ -12,8 +12,8 @@
#include <__availability>
#include <__chrono/time_point.h>
+#include <__compare/ordering.h>
#include <__config>
-#include <__errc>
#include <__filesystem/file_status.h>
#include <__filesystem/file_time_type.h>
#include <__filesystem/file_type.h>
@@ -21,11 +21,12 @@
#include <__filesystem/operations.h>
#include <__filesystem/path.h>
#include <__filesystem/perms.h>
+#include <__system_error/errc.h>
+#include <__system_error/error_code.h>
+#include <__utility/move.h>
#include <__utility/unreachable.h>
#include <cstdint>
-#include <cstdlib>
#include <iosfwd>
-#include <system_error>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -34,21 +35,20 @@
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
-#ifndef _LIBCPP_CXX03_LANG
+#if !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
class directory_entry {
typedef _VSTD_FS::path _Path;
public:
// constructors and destructors
- directory_entry() noexcept = default;
- directory_entry(directory_entry const&) = default;
- directory_entry(directory_entry&&) noexcept = default;
+ _LIBCPP_HIDE_FROM_ABI directory_entry() noexcept = default;
+ _LIBCPP_HIDE_FROM_ABI directory_entry(directory_entry const&) = default;
+ _LIBCPP_HIDE_FROM_ABI directory_entry(directory_entry&&) noexcept = default;
_LIBCPP_INLINE_VISIBILITY
explicit directory_entry(_Path const& __p) : __p_(__p) {
@@ -61,10 +61,10 @@ public:
__refresh(&__ec);
}
- ~directory_entry() {}
+ _LIBCPP_HIDE_FROM_ABI ~directory_entry() {}
- directory_entry& operator=(directory_entry const&) = default;
- directory_entry& operator=(directory_entry&&) noexcept = default;
+ _LIBCPP_HIDE_FROM_ABI directory_entry& operator=(directory_entry const&) = default;
+ _LIBCPP_HIDE_FROM_ABI directory_entry& operator=(directory_entry&&) noexcept = default;
_LIBCPP_INLINE_VISIBILITY
void assign(_Path const& __p) {
@@ -321,8 +321,7 @@ private:
__data_ = __dt;
}
- _LIBCPP_FUNC_VIS
- error_code __do_refresh() noexcept;
+ _LIBCPP_EXPORTED_FROM_ABI error_code __do_refresh() noexcept;
_LIBCPP_INLINE_VISIBILITY
static bool __is_dne_error(error_code const& __ec) {
@@ -510,17 +509,17 @@ public:
private:
friend class directory_iterator;
friend class recursive_directory_iterator;
- explicit __dir_element_proxy(directory_entry const& __e) : __elem_(__e) {}
- __dir_element_proxy(__dir_element_proxy&& __o)
+ _LIBCPP_HIDE_FROM_ABI explicit __dir_element_proxy(directory_entry const& __e) : __elem_(__e) {}
+ _LIBCPP_HIDE_FROM_ABI __dir_element_proxy(__dir_element_proxy&& __o)
: __elem_(_VSTD::move(__o.__elem_)) {}
directory_entry __elem_;
};
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
_LIBCPP_END_NAMESPACE_FILESYSTEM
-#endif // _LIBCPP_CXX03_LANG
+#endif // !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
_LIBCPP_POP_MACROS
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_iterator.h
index 5ff2f01ac7b..632c2c80636 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_iterator.h
@@ -16,22 +16,24 @@
#include <__filesystem/directory_entry.h>
#include <__filesystem/directory_options.h>
#include <__filesystem/path.h>
+#include <__iterator/default_sentinel.h>
#include <__iterator/iterator_traits.h>
#include <__memory/shared_ptr.h>
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/enable_view.h>
+#include <__system_error/error_code.h>
+#include <__utility/move.h>
#include <cstddef>
-#include <system_error>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#ifndef _LIBCPP_CXX03_LANG
+#if !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
class _LIBCPP_HIDDEN __dir_stream;
class directory_iterator {
@@ -81,7 +83,7 @@ public:
_LIBCPP_HIDE_FROM_ABI
const directory_entry& operator*() const {
- _LIBCPP_ASSERT(__imp_, "The end iterator cannot be dereferenced");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__imp_, "The end iterator cannot be dereferenced");
return __dereference();
}
@@ -101,21 +103,23 @@ public:
_LIBCPP_HIDE_FROM_ABI
directory_iterator& increment(error_code& __ec) { return __increment(&__ec); }
+# if _LIBCPP_STD_VER >= 20
+
+ _LIBCPP_HIDE_FROM_ABI bool operator==(default_sentinel_t) const noexcept { return *this == directory_iterator(); }
+
+# endif
+
private:
inline _LIBCPP_HIDE_FROM_ABI friend bool
operator==(const directory_iterator& __lhs,
const directory_iterator& __rhs) noexcept;
// construct the dir_stream
- _LIBCPP_FUNC_VIS
- directory_iterator(const path&, error_code*,
- directory_options = directory_options::none);
+ _LIBCPP_EXPORTED_FROM_ABI directory_iterator(const path&, error_code*, directory_options = directory_options::none);
- _LIBCPP_FUNC_VIS
- directory_iterator& __increment(error_code* __ec = nullptr);
+ _LIBCPP_EXPORTED_FROM_ABI directory_iterator& __increment(error_code* __ec = nullptr);
- _LIBCPP_FUNC_VIS
- const directory_entry& __dereference() const;
+ _LIBCPP_EXPORTED_FROM_ABI const directory_entry& __dereference() const;
private:
shared_ptr<__dir_stream> __imp_;
@@ -144,22 +148,22 @@ end(directory_iterator) noexcept {
return directory_iterator();
}
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
_LIBCPP_END_NAMESPACE_FILESYSTEM
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <>
-_LIBCPP_AVAILABILITY_FILESYSTEM
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY
inline constexpr bool _VSTD::ranges::enable_borrowed_range<_VSTD_FS::directory_iterator> = true;
template <>
-_LIBCPP_AVAILABILITY_FILESYSTEM
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY
inline constexpr bool _VSTD::ranges::enable_view<_VSTD_FS::directory_iterator> = true;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#endif // _LIBCPP_CXX03_LANG
+#endif // !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
#endif // _LIBCPP___FILESYSTEM_DIRECTORY_ITERATOR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_options.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_options.h
index c5c031a567c..4c323ccb0cf 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_options.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_options.h
@@ -21,8 +21,6 @@
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-
enum class _LIBCPP_ENUM_VIS directory_options : unsigned char {
none = 0,
follow_directory_symlink = 1,
@@ -73,8 +71,6 @@ inline directory_options& operator^=(directory_options& __lhs,
return __lhs = __lhs ^ __rhs;
}
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
-
_LIBCPP_END_NAMESPACE_FILESYSTEM
#endif // _LIBCPP_CXX03_LANG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/file_status.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/file_status.h
index ac3f6cbed9d..0cf405b9c29 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/file_status.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/file_status.h
@@ -23,9 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-
-class _LIBCPP_TYPE_VIS file_status {
+class _LIBCPP_EXPORTED_FROM_ABI file_status {
public:
// constructors
_LIBCPP_INLINE_VISIBILITY
@@ -35,14 +33,14 @@ public:
: __ft_(__ft),
__prms_(__prms) {}
- file_status(const file_status&) noexcept = default;
- file_status(file_status&&) noexcept = default;
+ _LIBCPP_HIDE_FROM_ABI file_status(const file_status&) noexcept = default;
+ _LIBCPP_HIDE_FROM_ABI file_status(file_status&&) noexcept = default;
_LIBCPP_INLINE_VISIBILITY
~file_status() {}
- file_status& operator=(const file_status&) noexcept = default;
- file_status& operator=(file_status&&) noexcept = default;
+ _LIBCPP_HIDE_FROM_ABI file_status& operator=(const file_status&) noexcept = default;
+ _LIBCPP_HIDE_FROM_ABI file_status& operator=(file_status&&) noexcept = default;
// observers
_LIBCPP_INLINE_VISIBILITY
@@ -58,13 +56,19 @@ public:
_LIBCPP_INLINE_VISIBILITY
void permissions(perms __p) noexcept { __prms_ = __p; }
+# if _LIBCPP_STD_VER >= 20
+
+ _LIBCPP_HIDE_FROM_ABI friend bool operator==(const file_status& __lhs, const file_status& __rhs) noexcept {
+ return __lhs.type() == __rhs.type() && __lhs.permissions() == __rhs.permissions();
+ }
+
+# endif
+
private:
file_type __ft_;
perms __prms_;
};
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
-
_LIBCPP_END_NAMESPACE_FILESYSTEM
#endif // _LIBCPP_CXX03_LANG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h
index effe6998338..713cc357ee8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h
@@ -14,11 +14,13 @@
#include <__config>
#include <__filesystem/path.h>
#include <__memory/shared_ptr.h>
+#include <__system_error/error_code.h>
+#include <__system_error/system_error.h>
#include <__utility/forward.h>
+#include <__verbose_abort>
#include <iosfwd>
#include <new>
-#include <system_error>
-#include <type_traits>
+#include <string>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -28,50 +30,38 @@
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-class _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_EXCEPTION_ABI filesystem_error : public system_error {
+class _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_EXPORTED_FROM_ABI filesystem_error : public system_error {
public:
- _LIBCPP_INLINE_VISIBILITY
- filesystem_error(const string& __what, error_code __ec)
- : system_error(__ec, __what),
- __storage_(make_shared<_Storage>(path(), path())) {
+ _LIBCPP_HIDE_FROM_ABI filesystem_error(const string& __what, error_code __ec)
+ : system_error(__ec, __what), __storage_(make_shared<_Storage>(path(), path())) {
__create_what(0);
}
- _LIBCPP_INLINE_VISIBILITY
- filesystem_error(const string& __what, const path& __p1, error_code __ec)
- : system_error(__ec, __what),
- __storage_(make_shared<_Storage>(__p1, path())) {
+ _LIBCPP_HIDE_FROM_ABI filesystem_error(const string& __what, const path& __p1, error_code __ec)
+ : system_error(__ec, __what), __storage_(make_shared<_Storage>(__p1, path())) {
__create_what(1);
}
- _LIBCPP_INLINE_VISIBILITY
- filesystem_error(const string& __what, const path& __p1, const path& __p2,
- error_code __ec)
- : system_error(__ec, __what),
- __storage_(make_shared<_Storage>(__p1, __p2)) {
+ _LIBCPP_HIDE_FROM_ABI filesystem_error(const string& __what, const path& __p1, const path& __p2, error_code __ec)
+ : system_error(__ec, __what), __storage_(make_shared<_Storage>(__p1, __p2)) {
__create_what(2);
}
- _LIBCPP_INLINE_VISIBILITY
- const path& path1() const noexcept { return __storage_->__p1_; }
+ _LIBCPP_HIDE_FROM_ABI const path& path1() const noexcept { return __storage_->__p1_; }
- _LIBCPP_INLINE_VISIBILITY
- const path& path2() const noexcept { return __storage_->__p2_; }
+ _LIBCPP_HIDE_FROM_ABI const path& path2() const noexcept { return __storage_->__p2_; }
- filesystem_error(const filesystem_error&) = default;
+ _LIBCPP_HIDE_FROM_ABI filesystem_error(const filesystem_error&) = default;
~filesystem_error() override; // key function
_LIBCPP_HIDE_FROM_ABI_VIRTUAL
- const char* what() const noexcept override {
- return __storage_->__what_.c_str();
- }
+ const char* what() const noexcept override { return __storage_->__what_.c_str(); }
void __create_what(int __num_paths);
private:
struct _LIBCPP_HIDDEN _Storage {
- _LIBCPP_INLINE_VISIBILITY
- _Storage(const path& __p1, const path& __p2) : __p1_(__p1), __p2_(__p2) {}
+ _LIBCPP_HIDE_FROM_ABI _Storage(const path& __p1, const path& __p2) : __p1_(__p1), __p2_(__p2) {}
path __p1_;
path __p2_;
@@ -80,22 +70,19 @@ private:
shared_ptr<_Storage> __storage_;
};
-// TODO(ldionne): We need to pop the pragma and push it again after
-// filesystem_error to work around PR41078.
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-
+# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
template <class... _Args>
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_NO_EXCEPTIONS
-void __throw_filesystem_error(_Args&&... __args) {
+_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY void
+__throw_filesystem_error(_Args&&... __args) {
throw filesystem_error(_VSTD::forward<_Args>(__args)...);
}
-#else
-void __throw_filesystem_error(_Args&&...) {
- _VSTD::abort();
+# else
+template <class... _Args>
+_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY void
+__throw_filesystem_error(_Args&&...) {
+ _LIBCPP_VERBOSE_ABORT("filesystem_error was thrown in -fno-exceptions mode");
}
-#endif
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+# endif
_LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/operations.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/operations.h
index f48d301d090..71b3fb859d4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/operations.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/operations.h
@@ -21,46 +21,46 @@
#include <__filesystem/perm_options.h>
#include <__filesystem/perms.h>
#include <__filesystem/space_info.h>
+#include <__system_error/error_code.h>
#include <cstdint>
-#include <system_error>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#ifndef _LIBCPP_CXX03_LANG
+#if !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-
-_LIBCPP_FUNC_VIS path __absolute(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS path __canonical(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS bool __copy_file(const path& __from, const path& __to, copy_options __opt, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __copy_symlink(const path& __existing_symlink, const path& __new_symlink, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __copy(const path& __from, const path& __to, copy_options __opt, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS bool __create_directories(const path&, error_code* = nullptr);
-_LIBCPP_FUNC_VIS void __create_directory_symlink(const path& __to, const path& __new_symlink, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS bool __create_directory(const path&, error_code* = nullptr);
-_LIBCPP_FUNC_VIS bool __create_directory(const path&, const path& __attributes, error_code* = nullptr);
-_LIBCPP_FUNC_VIS void __create_hard_link(const path& __to, const path& __new_hard_link, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __create_symlink(const path& __to, const path& __new_symlink, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS path __current_path(error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __current_path(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS bool __equivalent(const path&, const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS file_status __status(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS uintmax_t __file_size(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS uintmax_t __hard_link_count(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS file_status __symlink_status(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS file_time_type __last_write_time(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __last_write_time(const path&, file_time_type __new_time, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS path __weakly_canonical(path const& __p, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS path __read_symlink(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS uintmax_t __remove_all(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS bool __remove(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __rename(const path& __from, const path& __to, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __resize_file(const path&, uintmax_t __size, error_code* = nullptr);
-_LIBCPP_FUNC_VIS path __temp_directory_path(error_code* __ec = nullptr);
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
+
+_LIBCPP_EXPORTED_FROM_ABI path __absolute(const path&, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI path __canonical(const path&, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI bool __copy_file(const path& __from, const path& __to, copy_options __opt, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI void __copy_symlink(const path& __existing_symlink, const path& __new_symlink, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI void __copy(const path& __from, const path& __to, copy_options __opt, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI bool __create_directories(const path&, error_code* = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI void __create_directory_symlink(const path& __to, const path& __new_symlink, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI bool __create_directory(const path&, error_code* = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI bool __create_directory(const path&, const path& __attributes, error_code* = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI void __create_hard_link(const path& __to, const path& __new_hard_link, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI void __create_symlink(const path& __to, const path& __new_symlink, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI path __current_path(error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI void __current_path(const path&, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI bool __equivalent(const path&, const path&, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI file_status __status(const path&, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI uintmax_t __file_size(const path&, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI uintmax_t __hard_link_count(const path&, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI file_status __symlink_status(const path&, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI file_time_type __last_write_time(const path&, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI void __last_write_time(const path&, file_time_type __new_time, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI path __weakly_canonical(path const& __p, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI path __read_symlink(const path&, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI uintmax_t __remove_all(const path&, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI bool __remove(const path&, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI void __rename(const path& __from, const path& __to, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI void __resize_file(const path&, uintmax_t __size, error_code* = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI path __temp_directory_path(error_code* __ec = nullptr);
inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p) { return __absolute(__p); }
inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p, error_code& __ec) { return __absolute(__p, &__ec); }
@@ -118,7 +118,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool is_character_file(const path& __p, error_code&
inline _LIBCPP_HIDE_FROM_ABI bool is_directory(file_status __s) noexcept { return __s.type() == file_type::directory; }
inline _LIBCPP_HIDE_FROM_ABI bool is_directory(const path& __p) { return is_directory(__status(__p)); }
inline _LIBCPP_HIDE_FROM_ABI bool is_directory(const path& __p, error_code& __ec) noexcept { return is_directory(__status(__p, &__ec)); }
-_LIBCPP_FUNC_VIS bool __fs_is_empty(const path& __p, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI bool __fs_is_empty(const path& __p, error_code* __ec = nullptr);
inline _LIBCPP_HIDE_FROM_ABI bool is_empty(const path& __p) { return __fs_is_empty(__p); }
inline _LIBCPP_HIDE_FROM_ABI bool is_empty(const path& __p, error_code& __ec) { return __fs_is_empty(__p, &__ec); }
inline _LIBCPP_HIDE_FROM_ABI bool is_fifo(file_status __s) noexcept { return __s.type() == file_type::fifo; }
@@ -140,7 +140,7 @@ inline _LIBCPP_HIDE_FROM_ABI file_time_type last_write_time(const path& __p) { r
inline _LIBCPP_HIDE_FROM_ABI file_time_type last_write_time(const path& __p, error_code& __ec) noexcept { return __last_write_time(__p, &__ec); }
inline _LIBCPP_HIDE_FROM_ABI void last_write_time(const path& __p, file_time_type __t) { __last_write_time(__p, __t); }
inline _LIBCPP_HIDE_FROM_ABI void last_write_time(const path& __p, file_time_type __t, error_code& __ec) noexcept { __last_write_time(__p, __t, &__ec); }
-_LIBCPP_FUNC_VIS void __permissions(const path&, perms, perm_options, error_code* = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI void __permissions(const path&, perms, perm_options, error_code* = nullptr);
inline _LIBCPP_HIDE_FROM_ABI void permissions(const path& __p, perms __prms, perm_options __opts = perm_options::replace) { __permissions(__p, __prms, __opts); }
inline _LIBCPP_HIDE_FROM_ABI void permissions(const path& __p, perms __prms, error_code& __ec) noexcept { __permissions(__p, __prms, perm_options::replace, &__ec); }
inline _LIBCPP_HIDE_FROM_ABI void permissions(const path& __p, perms __prms, perm_options __opts, error_code& __ec) { __permissions(__p, __prms, __opts, &__ec); }
@@ -180,7 +180,7 @@ inline _LIBCPP_HIDE_FROM_ABI void rename(const path& __from, const path& __to) {
inline _LIBCPP_HIDE_FROM_ABI void rename(const path& __from, const path& __to, error_code& __ec) noexcept { return __rename(__from, __to, &__ec); }
inline _LIBCPP_HIDE_FROM_ABI void resize_file(const path& __p, uintmax_t __ns) { return __resize_file(__p, __ns); }
inline _LIBCPP_HIDE_FROM_ABI void resize_file(const path& __p, uintmax_t __ns, error_code& __ec) noexcept { return __resize_file(__p, __ns, &__ec); }
-_LIBCPP_FUNC_VIS space_info __space(const path&, error_code* __ec = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI space_info __space(const path&, error_code* __ec = nullptr);
inline _LIBCPP_HIDE_FROM_ABI space_info space(const path& __p) { return __space(__p); }
inline _LIBCPP_HIDE_FROM_ABI space_info space(const path& __p, error_code& __ec) noexcept { return __space(__p, &__ec); }
inline _LIBCPP_HIDE_FROM_ABI file_status status(const path& __p) { return __status(__p); }
@@ -192,10 +192,10 @@ inline _LIBCPP_HIDE_FROM_ABI path temp_directory_path(error_code& __ec) { return
inline _LIBCPP_HIDE_FROM_ABI path weakly_canonical(path const& __p) { return __weakly_canonical(__p); }
inline _LIBCPP_HIDE_FROM_ABI path weakly_canonical(path const& __p, error_code& __ec) { return __weakly_canonical(__p, &__ec); }
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
_LIBCPP_END_NAMESPACE_FILESYSTEM
-#endif // _LIBCPP_CXX03_LANG
+#endif // !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
#endif // _LIBCPP___FILESYSTEM_OPERATIONS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/path.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/path.h
index 4e6912fcf3e..77699c5ae47 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/path.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/path.h
@@ -14,12 +14,18 @@
#include <__algorithm/replace_copy.h>
#include <__availability>
#include <__config>
+#include <__functional/hash.h>
+#include <__functional/unary_function.h>
+#include <__fwd/hash.h>
#include <__iterator/back_insert_iterator.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_pointer.h>
+#include <__type_traits/remove_const.h>
+#include <__type_traits/remove_pointer.h>
#include <cstddef>
#include <string>
#include <string_view>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
# include <iomanip> // for quoted
@@ -34,7 +40,7 @@
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
template <class _Tp>
struct __can_convert_char {
@@ -139,7 +145,7 @@ struct __is_pathable_string<
}
};
-template <class _Source, class _DS = typename decay<_Source>::type,
+template <class _Source, class _DS = __decay_t<_Source>,
class _UnqualPtrType =
__remove_const_t<__remove_pointer_t<_DS> >,
bool _IsCharPtr = is_pointer<_DS>::value&&
@@ -168,7 +174,7 @@ struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true>
static _ECharT __first_or_null(const _ECharT* __b) { return *__b; }
};
-template <class _Iter, bool _IsIt = __is_cpp17_input_iterator<_Iter>::value,
+template <class _Iter, bool _IsIt = __has_input_iterator_category<_Iter>::value,
class = void>
struct __is_pathable_iter : false_type {};
@@ -217,10 +223,8 @@ typedef char __path_value;
#endif
#if defined(_LIBCPP_WIN32API)
-_LIBCPP_FUNC_VIS
-size_t __wide_to_char(const wstring&, char*, size_t);
-_LIBCPP_FUNC_VIS
-size_t __char_to_wide(const string&, wchar_t*, size_t);
+_LIBCPP_EXPORTED_FROM_ABI size_t __wide_to_char(const wstring&, char*, size_t);
+_LIBCPP_EXPORTED_FROM_ABI size_t __char_to_wide(const string&, wchar_t*, size_t);
#endif
template <class _ECharT>
@@ -303,7 +307,7 @@ struct _PathCVT<__path_value> {
template <class _Iter>
_LIBCPP_HIDE_FROM_ABI
- static typename enable_if<__is_exactly_cpp17_input_iterator<_Iter>::value>::type
+ static typename enable_if<__has_exactly_input_iterator_category<_Iter>::value>::type
__append_range(__path_string& __dest, _Iter __b, _Iter __e) {
for (; __b != __e; ++__b)
__dest.push_back(*__b);
@@ -311,7 +315,7 @@ struct _PathCVT<__path_value> {
template <class _Iter>
_LIBCPP_HIDE_FROM_ABI
- static typename enable_if<__is_cpp17_forward_iterator<_Iter>::value>::type
+ static typename enable_if<__has_forward_iterator_category<_Iter>::value>::type
__append_range(__path_string& __dest, _Iter __b, _Iter __e) {
__dest.append(__b, __e);
}
@@ -348,7 +352,7 @@ struct _PathCVT<char> {
template <class _Iter>
_LIBCPP_HIDE_FROM_ABI
- static typename enable_if<__is_exactly_cpp17_input_iterator<_Iter>::value>::type
+ static typename enable_if<__has_exactly_input_iterator_category<_Iter>::value>::type
__append_range(__path_string& __dest, _Iter __b, _Iter __e) {
basic_string<char> __tmp(__b, __e);
__append_string(__dest, __tmp);
@@ -356,7 +360,7 @@ struct _PathCVT<char> {
template <class _Iter>
_LIBCPP_HIDE_FROM_ABI
- static typename enable_if<__is_cpp17_forward_iterator<_Iter>::value>::type
+ static typename enable_if<__has_forward_iterator_category<_Iter>::value>::type
__append_range(__path_string& __dest, _Iter __b, _Iter __e) {
basic_string<char> __tmp(__b, __e);
__append_string(__dest, __tmp);
@@ -439,7 +443,7 @@ struct _PathExport<char8_t> {
#endif /* !_LIBCPP_HAS_NO_CHAR8_T */
#endif /* _LIBCPP_WIN32API */
-class _LIBCPP_TYPE_VIS path {
+class _LIBCPP_EXPORTED_FROM_ABI path {
template <class _SourceOrIter, class _Tp = path&>
using _EnableIfPathable =
typename enable_if<__is_pathable<_SourceOrIter>::value, _Tp>::type;
@@ -1029,7 +1033,7 @@ public:
}
// iterators
- class _LIBCPP_TYPE_VIS iterator;
+ class _LIBCPP_EXPORTED_FROM_ABI iterator;
typedef iterator const_iterator;
iterator begin() const;
@@ -1079,13 +1083,23 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(path& __lhs, path& __rhs) noexcept {
__lhs.swap(__rhs);
}
-_LIBCPP_FUNC_VIS
-size_t hash_value(const path& __p) noexcept;
+_LIBCPP_EXPORTED_FROM_ABI size_t hash_value(const path& __p) noexcept;
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <>
+struct _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY hash<_VSTD_FS::path> : __unary_function<_VSTD_FS::path, size_t> {
+ _LIBCPP_HIDE_FROM_ABI size_t operator()(_VSTD_FS::path const& __p) const noexcept {
+ return _VSTD_FS::hash_value(__p);
+ }
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
#endif // _LIBCPP_CXX03_LANG
#endif // _LIBCPP___FILESYSTEM_PATH_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/path_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/path_iterator.h
index 6f2baf8f7a2..9961b46cf81 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/path_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/path_iterator.h
@@ -27,9 +27,7 @@
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-
-class _LIBCPP_TYPE_VIS path::iterator {
+class _LIBCPP_EXPORTED_FROM_ABI path::iterator {
public:
enum _ParserState : unsigned char {
_Singular,
@@ -56,10 +54,10 @@ public:
: __stashed_elem_(), __path_ptr_(nullptr), __entry_(),
__state_(_Singular) {}
- iterator(const iterator&) = default;
- ~iterator() = default;
+ _LIBCPP_HIDE_FROM_ABI iterator(const iterator&) = default;
+ _LIBCPP_HIDE_FROM_ABI ~iterator() = default;
- iterator& operator=(const iterator&) = default;
+ _LIBCPP_HIDE_FROM_ABI iterator& operator=(const iterator&) = default;
_LIBCPP_INLINE_VISIBILITY
reference operator*() const { return __stashed_elem_; }
@@ -69,10 +67,10 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator& operator++() {
- _LIBCPP_ASSERT(__state_ != _Singular,
- "attempting to increment a singular iterator");
- _LIBCPP_ASSERT(__state_ != _AtEnd,
- "attempting to increment the end iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__state_ != _Singular,
+ "attempting to increment a singular iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__state_ != _AtEnd,
+ "attempting to increment the end iterator");
return __increment();
}
@@ -85,10 +83,10 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator& operator--() {
- _LIBCPP_ASSERT(__state_ != _Singular,
- "attempting to decrement a singular iterator");
- _LIBCPP_ASSERT(__entry_.data() != __path_ptr_->native().data(),
- "attempting to decrement the begin iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__state_ != _Singular,
+ "attempting to decrement a singular iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__entry_.data() != __path_ptr_->native().data(),
+ "attempting to decrement the begin iterator");
return __decrement();
}
@@ -114,19 +112,19 @@ private:
_ParserState __state_;
};
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY
inline _LIBCPP_INLINE_VISIBILITY bool operator==(const path::iterator& __lhs,
const path::iterator& __rhs) {
return __lhs.__path_ptr_ == __rhs.__path_ptr_ &&
__lhs.__entry_.data() == __rhs.__entry_.data();
}
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY
inline _LIBCPP_INLINE_VISIBILITY bool operator!=(const path::iterator& __lhs,
const path::iterator& __rhs) {
return !(__lhs == __rhs);
}
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
-
_LIBCPP_END_NAMESPACE_FILESYSTEM
#endif // _LIBCPP_CXX03_LANG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/perm_options.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/perm_options.h
index 4aba302edfb..e77af9ef97e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/perm_options.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/perm_options.h
@@ -21,8 +21,6 @@
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-
enum class _LIBCPP_ENUM_VIS perm_options : unsigned char {
replace = 1,
add = 2,
@@ -68,8 +66,6 @@ inline perm_options& operator^=(perm_options& __lhs, perm_options __rhs) {
return __lhs = __lhs ^ __rhs;
}
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
-
_LIBCPP_END_NAMESPACE_FILESYSTEM
#endif // _LIBCPP_CXX03_LANG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/perms.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/perms.h
index df4590057ee..77bc6521034 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/perms.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/perms.h
@@ -21,8 +21,6 @@
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-
// On Windows, these permission bits map to one single readonly flag per
// file, and the executable bit is always returned as set. When setting
// permissions, as long as the write bit is set for either owner, group or
@@ -86,8 +84,6 @@ inline perms& operator|=(perms& __lhs, perms __rhs) { return __lhs = __lhs | __r
_LIBCPP_INLINE_VISIBILITY
inline perms& operator^=(perms& __lhs, perms __rhs) { return __lhs = __lhs ^ __rhs; }
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
-
_LIBCPP_END_NAMESPACE_FILESYSTEM
#endif // _LIBCPP_CXX03_LANG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/recursive_directory_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/recursive_directory_iterator.h
index b20d201f583..c38d58e5021 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/recursive_directory_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/recursive_directory_iterator.h
@@ -15,22 +15,24 @@
#include <__filesystem/directory_entry.h>
#include <__filesystem/directory_options.h>
#include <__filesystem/path.h>
+#include <__iterator/default_sentinel.h>
#include <__iterator/iterator_traits.h>
#include <__memory/shared_ptr.h>
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/enable_view.h>
+#include <__system_error/error_code.h>
+#include <__utility/move.h>
#include <cstddef>
-#include <system_error>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#ifndef _LIBCPP_CXX03_LANG
+#if !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
class recursive_directory_iterator {
public:
@@ -59,10 +61,10 @@ public:
recursive_directory_iterator(const path& __p, error_code& __ec)
: recursive_directory_iterator(__p, directory_options::none, &__ec) {}
- recursive_directory_iterator(const recursive_directory_iterator&) = default;
- recursive_directory_iterator(recursive_directory_iterator&&) = default;
+ _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator(const recursive_directory_iterator&) = default;
+ _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator(recursive_directory_iterator&&) = default;
- recursive_directory_iterator&
+ _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator&
operator=(const recursive_directory_iterator&) = default;
_LIBCPP_INLINE_VISIBILITY
@@ -76,7 +78,7 @@ public:
return *this;
}
- ~recursive_directory_iterator() = default;
+ _LIBCPP_HIDE_FROM_ABI ~recursive_directory_iterator() = default;
_LIBCPP_INLINE_VISIBILITY
const directory_entry& operator*() const { return __dereference(); }
@@ -84,7 +86,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const directory_entry* operator->() const { return &__dereference(); }
- recursive_directory_iterator& operator++() { return __increment(); }
+ _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator& operator++() { return __increment(); }
_LIBCPP_INLINE_VISIBILITY
__dir_element_proxy operator++(int) {
@@ -98,8 +100,8 @@ public:
return __increment(&__ec);
}
- _LIBCPP_FUNC_VIS directory_options options() const;
- _LIBCPP_FUNC_VIS int depth() const;
+ _LIBCPP_EXPORTED_FROM_ABI directory_options options() const;
+ _LIBCPP_EXPORTED_FROM_ABI int depth() const;
_LIBCPP_INLINE_VISIBILITY
void pop() { __pop(); }
@@ -113,25 +115,21 @@ public:
_LIBCPP_INLINE_VISIBILITY
void disable_recursion_pending() { __rec_ = false; }
-private:
- _LIBCPP_FUNC_VIS
- recursive_directory_iterator(const path& __p, directory_options __opt,
- error_code* __ec);
-
- _LIBCPP_FUNC_VIS
- const directory_entry& __dereference() const;
+# if _LIBCPP_STD_VER >= 20
- _LIBCPP_FUNC_VIS
- bool __try_recursion(error_code* __ec);
-
- _LIBCPP_FUNC_VIS
- void __advance(error_code* __ec = nullptr);
+ _LIBCPP_HIDE_FROM_ABI bool operator==(default_sentinel_t) const noexcept {
+ return *this == recursive_directory_iterator();
+ }
- _LIBCPP_FUNC_VIS
- recursive_directory_iterator& __increment(error_code* __ec = nullptr);
+# endif
- _LIBCPP_FUNC_VIS
- void __pop(error_code* __ec = nullptr);
+private:
+ _LIBCPP_EXPORTED_FROM_ABI recursive_directory_iterator(const path& __p, directory_options __opt, error_code* __ec);
+ _LIBCPP_EXPORTED_FROM_ABI const directory_entry& __dereference() const;
+ _LIBCPP_EXPORTED_FROM_ABI bool __try_recursion(error_code* __ec);
+ _LIBCPP_EXPORTED_FROM_ABI void __advance(error_code* __ec = nullptr);
+ _LIBCPP_EXPORTED_FROM_ABI recursive_directory_iterator& __increment(error_code* __ec = nullptr);
+ _LIBCPP_EXPORTED_FROM_ABI void __pop(error_code* __ec = nullptr);
inline _LIBCPP_INLINE_VISIBILITY friend bool
operator==(const recursive_directory_iterator&,
@@ -164,22 +162,22 @@ end(recursive_directory_iterator) noexcept {
return recursive_directory_iterator();
}
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
_LIBCPP_END_NAMESPACE_FILESYSTEM
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <>
-_LIBCPP_AVAILABILITY_FILESYSTEM
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY
inline constexpr bool _VSTD::ranges::enable_borrowed_range<_VSTD_FS::recursive_directory_iterator> = true;
template <>
-_LIBCPP_AVAILABILITY_FILESYSTEM
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY
inline constexpr bool _VSTD::ranges::enable_view<_VSTD_FS::recursive_directory_iterator> = true;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#endif // _LIBCPP_CXX03_LANG
+#endif // !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
#endif // _LIBCPP___FILESYSTEM_RECURSIVE_DIRECTORY_ITERATOR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/space_info.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/space_info.h
index d0747e35ebf..929f5146642 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/space_info.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/space_info.h
@@ -22,20 +22,16 @@
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-
-struct _LIBCPP_TYPE_VIS space_info {
+struct _LIBCPP_EXPORTED_FROM_ABI space_info {
uintmax_t capacity;
uintmax_t free;
uintmax_t available;
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const space_info&, const space_info&) = default;
# endif
};
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
-
_LIBCPP_END_NAMESPACE_FILESYSTEM
#endif // _LIBCPP_CXX03_LANG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/u8path.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/u8path.h
index d35faa14bb8..90b879aec28 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/u8path.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/u8path.h
@@ -15,7 +15,6 @@
#include <__config>
#include <__filesystem/path.h>
#include <string>
-#include <type_traits>
// Only required on Windows for __widen_from_utf8, and included conservatively
// because it requires support for localization.
@@ -31,7 +30,7 @@
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
template <class _InputIt>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
@@ -99,7 +98,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
#endif
}
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
_LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/buffer.h b/contrib/libs/cxxsupp/libcxx/include/__format/buffer.h
index ddfe76728e9..45f9da80172 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/buffer.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/buffer.h
@@ -27,11 +27,18 @@
#include <__iterator/incrementable_traits.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/wrap_iter.h>
+#include <__memory/addressof.h>
+#include <__memory/allocate_at_least.h>
+#include <__memory/allocator_traits.h>
+#include <__memory/construct_at.h>
+#include <__memory/ranges_construct_at.h>
+#include <__memory/uninitialized_algorithms.h>
+#include <__type_traits/add_pointer.h>
+#include <__type_traits/conditional.h>
+#include <__utility/exception_guard.h>
#include <__utility/move.h>
#include <cstddef>
#include <string_view>
-#include <type_traits>
-#include <vector>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -42,7 +49,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __format {
@@ -100,7 +107,7 @@ public:
size_t __n = __str.size();
__flush_on_overflow(__n);
- if (__n <= __capacity_) {
+ if (__n < __capacity_) { // push_back requires the buffer to have room for at least one character (so use <).
_VSTD::copy_n(__str.data(), __n, _VSTD::addressof(__ptr_[__size_]));
__size_ += __n;
return;
@@ -108,7 +115,7 @@ public:
// The output doesn't fit in the internal buffer.
// Copy the data in "__capacity_" sized chunks.
- _LIBCPP_ASSERT(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
const _InCharT* __first = __str.data();
do {
size_t __chunk = _VSTD::min(__n, __capacity_);
@@ -125,11 +132,11 @@ public:
/// Like @ref __copy it may need to do type conversion.
template <__fmt_char_type _InCharT, class _UnaryOperation>
_LIBCPP_HIDE_FROM_ABI void __transform(const _InCharT* __first, const _InCharT* __last, _UnaryOperation __operation) {
- _LIBCPP_ASSERT(__first <= __last, "not a valid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "not a valid range");
size_t __n = static_cast<size_t>(__last - __first);
__flush_on_overflow(__n);
- if (__n <= __capacity_) {
+ if (__n < __capacity_) { // push_back requires the buffer to have room for at least one character (so use <).
_VSTD::transform(__first, __last, _VSTD::addressof(__ptr_[__size_]), _VSTD::move(__operation));
__size_ += __n;
return;
@@ -137,7 +144,7 @@ public:
// The output doesn't fit in the internal buffer.
// Transform the data in "__capacity_" sized chunks.
- _LIBCPP_ASSERT(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
do {
size_t __chunk = _VSTD::min(__n, __capacity_);
_VSTD::transform(__first, __first + __chunk, _VSTD::addressof(__ptr_[__size_]), __operation);
@@ -151,7 +158,7 @@ public:
/// A \c fill_n wrapper.
_LIBCPP_HIDE_FROM_ABI void __fill(size_t __n, _CharT __value) {
__flush_on_overflow(__n);
- if (__n <= __capacity_) {
+ if (__n < __capacity_) { // push_back requires the buffer to have room for at least one character (so use <).
_VSTD::fill_n(_VSTD::addressof(__ptr_[__size_]), __n, __value);
__size_ += __n;
return;
@@ -159,7 +166,7 @@ public:
// The output doesn't fit in the internal buffer.
// Fill the buffer in "__capacity_" sized chunks.
- _LIBCPP_ASSERT(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
do {
size_t __chunk = _VSTD::min(__n, __capacity_);
_VSTD::fill_n(_VSTD::addressof(__ptr_[__size_]), __chunk, __value);
@@ -246,9 +253,9 @@ class _LIBCPP_TEMPLATE_VIS __direct_storage {};
template <class _OutIt, class _CharT>
concept __enable_direct_output = __fmt_char_type<_CharT> &&
(same_as<_OutIt, _CharT*>
-#ifndef _LIBCPP_ENABLE_DEBUG_MODE
+ // TODO(hardening): the following check might not apply to hardened iterators and might need to be wrapped in an
+ // `#ifdef`.
|| same_as<_OutIt, __wrap_iter<_CharT*>>
-#endif
);
/// Write policy for directly writing to the underlying output.
@@ -510,13 +517,19 @@ public:
// context and the format arguments need to be retargeted to the new context.
// This retargeting is done by a basic_format_context specialized for the
// __iterator of this container.
+//
+// This class uses its own buffer management, since using vector
+// would lead to a circular include with formatter for vector<bool>.
template <__fmt_char_type _CharT>
class _LIBCPP_TEMPLATE_VIS __retarget_buffer {
+ using _Alloc = allocator<_CharT>;
+
public:
using value_type = _CharT;
struct __iterator {
using difference_type = ptrdiff_t;
+ using value_type = _CharT;
_LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(__retarget_buffer& __buffer)
: __buffer_(std::addressof(__buffer)) {}
@@ -535,36 +548,101 @@ public:
__retarget_buffer* __buffer_;
};
- _LIBCPP_HIDE_FROM_ABI explicit __retarget_buffer(size_t __size_hint) { __buffer_.reserve(__size_hint); }
+ __retarget_buffer(const __retarget_buffer&) = delete;
+ __retarget_buffer& operator=(const __retarget_buffer&) = delete;
+
+ _LIBCPP_HIDE_FROM_ABI explicit __retarget_buffer(size_t __size_hint) {
+ // When the initial size is very small a lot of resizes happen
+ // when elements added. So use a hard-coded minimum size.
+ //
+ // Note a size < 2 will not work
+ // - 0 there is no buffer, while push_back requires 1 empty element.
+ // - 1 multiplied by the grow factor is 1 and thus the buffer never
+ // grows.
+ auto __result = std::__allocate_at_least(__alloc_, std::max(__size_hint, 256 / sizeof(_CharT)));
+ __ptr_ = __result.ptr;
+ __capacity_ = __result.count;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI ~__retarget_buffer() {
+ ranges::destroy_n(__ptr_, __size_);
+ allocator_traits<_Alloc>::deallocate(__alloc_, __ptr_, __capacity_);
+ }
_LIBCPP_HIDE_FROM_ABI __iterator __make_output_iterator() { return __iterator{*this}; }
- _LIBCPP_HIDE_FROM_ABI void push_back(_CharT __c) { __buffer_.push_back(__c); }
+ _LIBCPP_HIDE_FROM_ABI void push_back(_CharT __c) {
+ std::construct_at(__ptr_ + __size_, __c);
+ ++__size_;
+
+ if (__size_ == __capacity_)
+ __grow_buffer();
+ }
template <__fmt_char_type _InCharT>
_LIBCPP_HIDE_FROM_ABI void __copy(basic_string_view<_InCharT> __str) {
- __buffer_.insert(__buffer_.end(), __str.begin(), __str.end());
+ size_t __n = __str.size();
+ if (__size_ + __n >= __capacity_)
+ // Push_back requires the buffer to have room for at least one character.
+ __grow_buffer(__size_ + __n + 1);
+
+ std::uninitialized_copy_n(__str.data(), __n, __ptr_ + __size_);
+ __size_ += __n;
}
template <__fmt_char_type _InCharT, class _UnaryOperation>
_LIBCPP_HIDE_FROM_ABI void __transform(const _InCharT* __first, const _InCharT* __last, _UnaryOperation __operation) {
- _LIBCPP_ASSERT(__first <= __last, "not a valid range");
- std::transform(__first, __last, std::back_inserter(__buffer_), std::move(__operation));
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "not a valid range");
+
+ size_t __n = static_cast<size_t>(__last - __first);
+ if (__size_ + __n >= __capacity_)
+ // Push_back requires the buffer to have room for at least one character.
+ __grow_buffer(__size_ + __n + 1);
+
+ std::uninitialized_default_construct_n(__ptr_ + __size_, __n);
+ std::transform(__first, __last, __ptr_ + __size_, std::move(__operation));
+ __size_ += __n;
}
- _LIBCPP_HIDE_FROM_ABI void __fill(size_t __n, _CharT __value) { __buffer_.insert(__buffer_.end(), __n, __value); }
+ _LIBCPP_HIDE_FROM_ABI void __fill(size_t __n, _CharT __value) {
+ if (__size_ + __n >= __capacity_)
+ // Push_back requires the buffer to have room for at least one character.
+ __grow_buffer(__size_ + __n + 1);
+
+ std::uninitialized_fill_n(__ptr_ + __size_, __n, __value);
+ __size_ += __n;
+ }
- _LIBCPP_HIDE_FROM_ABI basic_string_view<_CharT> __view() { return {__buffer_.data(), __buffer_.size()}; }
+ _LIBCPP_HIDE_FROM_ABI basic_string_view<_CharT> __view() { return {__ptr_, __size_}; }
private:
- // Use vector instead of string to avoid adding zeros after every append
- // operation. The buffer is exposed as a string_view and not as a c-string.
- vector<_CharT> __buffer_;
+ _LIBCPP_HIDE_FROM_ABI void __grow_buffer() { __grow_buffer(__capacity_ * 1.6); }
+
+ _LIBCPP_HIDE_FROM_ABI void __grow_buffer(size_t __capacity) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__capacity > __capacity_, "the buffer must grow");
+ auto __result = std::__allocate_at_least(__alloc_, __capacity);
+ auto __guard = std::__make_exception_guard([&] {
+ allocator_traits<_Alloc>::deallocate(__alloc_, __result.ptr, __result.count);
+ });
+ // This shouldn't throw, but just to be safe. Note that at -O1 this
+ // guard is optimized away so there is no runtime overhead.
+ std::uninitialized_move_n(__ptr_, __size_, __result.ptr);
+ __guard.__complete();
+ ranges::destroy_n(__ptr_, __size_);
+ allocator_traits<_Alloc>::deallocate(__alloc_, __ptr_, __capacity_);
+
+ __ptr_ = __result.ptr;
+ __capacity_ = __result.count;
+ }
+ _LIBCPP_NO_UNIQUE_ADDRESS _Alloc __alloc_;
+ _CharT* __ptr_;
+ size_t __capacity_;
+ size_t __size_{0};
};
} // namespace __format
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/concepts.h b/contrib/libs/cxxsupp/libcxx/include/__format/concepts.h
index ba8d8e31622..ae96b6a1981 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/concepts.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/concepts.h
@@ -16,9 +16,9 @@
#include <__format/format_fwd.h>
#include <__format/format_parse_context.h>
#include <__type_traits/is_specialization.h>
+#include <__type_traits/remove_const.h>
#include <__utility/pair.h>
#include <tuple>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -26,7 +26,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
/// The character type specializations of \ref formatter.
template <class _CharT>
@@ -44,19 +44,23 @@ concept __fmt_char_type =
template <class _CharT>
using __fmt_iter_for = _CharT*;
+template <class _Tp, class _Context, class _Formatter = typename _Context::template formatter_type<remove_const_t<_Tp>>>
+concept __formattable_with =
+ semiregular<_Formatter> &&
+ requires(_Formatter& __f,
+ const _Formatter& __cf,
+ _Tp&& __t,
+ _Context __fc,
+ basic_format_parse_context<typename _Context::char_type> __pc) {
+ { __f.parse(__pc) } -> same_as<typename decltype(__pc)::iterator>;
+ { __cf.format(__t, __fc) } -> same_as<typename _Context::iterator>;
+ };
+
template <class _Tp, class _CharT>
concept __formattable =
- (semiregular<formatter<remove_cvref_t<_Tp>, _CharT>>) &&
- requires(formatter<remove_cvref_t<_Tp>, _CharT> __f,
- const formatter<remove_cvref_t<_Tp>, _CharT> __cf,
- _Tp __t,
- basic_format_context<__fmt_iter_for<_CharT>, _CharT> __fc,
- basic_format_parse_context<_CharT> __pc) {
- { __f.parse(__pc) } -> same_as<typename basic_format_parse_context<_CharT>::iterator>;
- { __cf.format(__t, __fc) } -> same_as<__fmt_iter_for<_CharT>>;
- };
+ __formattable_with<remove_reference_t<_Tp>, basic_format_context<__fmt_iter_for<_CharT>, _CharT>>;
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
template <class _Tp, class _CharT>
concept formattable = __formattable<_Tp, _CharT>;
@@ -69,8 +73,8 @@ template <class _Tp>
concept __fmt_pair_like =
__is_specialization_v<_Tp, pair> || (__is_specialization_v<_Tp, tuple> && tuple_size_v<_Tp> == 2);
-# endif //_LIBCPP_STD_VER > 20
-#endif //_LIBCPP_STD_VER > 17
+# endif //_LIBCPP_STD_VER >= 23
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/container_adaptor.h b/contrib/libs/cxxsupp/libcxx/include/__format/container_adaptor.h
index 62b698186ea..ec806ef16bf 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/container_adaptor.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/container_adaptor.h
@@ -14,17 +14,19 @@
# pragma GCC system_header
#endif
-#include <__availability>
#include <__config>
#include <__format/concepts.h>
#include <__format/formatter.h>
#include <__format/range_default_formatter.h>
+#include <__ranges/ref_view.h>
+#include <__type_traits/is_const.h>
+#include <__type_traits/maybe_const.h>
#include <queue>
#include <stack>
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
// [container.adaptors.format] only specifies the library should provide the
// formatter specializations, not which header should provide them.
@@ -33,10 +35,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// adaptor headers. To use the format functions users already include <format>.
template <class _Adaptor, class _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_container_adaptor {
+struct _LIBCPP_TEMPLATE_VIS __formatter_container_adaptor {
private:
- using __maybe_const_adaptor = __fmt_maybe_const<_Adaptor, _CharT>;
- formatter<typename _Adaptor::container_type, _CharT> __underlying_;
+ using __maybe_const_container = __fmt_maybe_const<typename _Adaptor::container_type, _CharT>;
+ using __maybe_const_adaptor = __maybe_const<is_const_v<__maybe_const_container>, _Adaptor>;
+ formatter<ranges::ref_view<__maybe_const_container>, _CharT> __underlying_;
public:
template <class _ParseContext>
@@ -52,18 +55,18 @@ public:
};
template <class _CharT, class _Tp, formattable<_CharT> _Container>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<queue<_Tp, _Container>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<queue<_Tp, _Container>, _CharT>
: public __formatter_container_adaptor<queue<_Tp, _Container>, _CharT> {};
template <class _CharT, class _Tp, class _Container, class _Compare>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<priority_queue<_Tp, _Container, _Compare>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<priority_queue<_Tp, _Container, _Compare>, _CharT>
: public __formatter_container_adaptor<priority_queue<_Tp, _Container, _Compare>, _CharT> {};
template <class _CharT, class _Tp, formattable<_CharT> _Container>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<stack<_Tp, _Container>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<stack<_Tp, _Container>, _CharT>
: public __formatter_container_adaptor<stack<_Tp, _Container>, _CharT> {};
-#endif //_LIBCPP_STD_VER > 20
+#endif //_LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/enable_insertable.h b/contrib/libs/cxxsupp/libcxx/include/__format/enable_insertable.h
index 71b4252930d..86ef94a325b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/enable_insertable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/enable_insertable.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __format {
@@ -28,7 +28,7 @@ inline constexpr bool __enable_insertable = false;
} // namespace __format
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/escaped_output_table.h b/contrib/libs/cxxsupp/libcxx/include/__format/escaped_output_table.h
index bd2994bdc66..222847e6af6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/escaped_output_table.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/escaped_output_table.h
@@ -72,7 +72,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
namespace __escaped_output_table {
@@ -1031,7 +1031,7 @@ inline constexpr uint32_t __unallocated_region_lower_bound = 0x000323b0;
} // namespace __escaped_output_table
-#endif //_LIBCPP_STD_VER > 20
+#endif //_LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/extended_grapheme_cluster_table.h b/contrib/libs/cxxsupp/libcxx/include/__format/extended_grapheme_cluster_table.h
index 1ffcfeb5496..bd6d39fdc7c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/extended_grapheme_cluster_table.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/extended_grapheme_cluster_table.h
@@ -73,7 +73,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __extended_grapheme_custer_property_boundary {
@@ -1654,7 +1654,7 @@ inline constexpr uint32_t __entries[1496] = {
} // namespace __extended_grapheme_custer_property_boundary
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/format_arg.h b/contrib/libs/cxxsupp/libcxx/include/__format/format_arg.h
index 771a03ff2fa..5cbfe812341 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/format_arg.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/format_arg.h
@@ -13,15 +13,17 @@
#include <__assert>
#include <__concepts/arithmetic.h>
#include <__config>
-#include <__format/format_error.h>
+#include <__format/concepts.h>
#include <__format/format_fwd.h>
#include <__format/format_parse_context.h>
#include <__functional/invoke.h>
#include <__memory/addressof.h>
+#include <__type_traits/conditional.h>
#include <__utility/forward.h>
+#include <__utility/move.h>
#include <__utility/unreachable.h>
#include <__variant/monostate.h>
-#include <string>
+#include <cstdint>
#include <string_view>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -30,7 +32,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __format {
/// The type stored in @ref basic_format_arg.
@@ -81,7 +83,7 @@ constexpr bool __use_packed_format_arg_store(size_t __size) { return __size <= _
_LIBCPP_HIDE_FROM_ABI
constexpr __arg_t __get_packed_type(uint64_t __types, size_t __id) {
- _LIBCPP_ASSERT(__id <= __packed_types_max, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__id <= __packed_types_max, "");
if (__id > 0)
__types >>= __id * __packed_arg_t_bits;
@@ -94,7 +96,7 @@ constexpr __arg_t __get_packed_type(uint64_t __types, size_t __id) {
// This function is not user obervable, so it can directly use the non-standard
// types of the "variant". See __arg_t for more details.
template <class _Visitor, class _Context>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT decltype(auto)
+_LIBCPP_HIDE_FROM_ABI decltype(auto)
__visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
switch (__arg.__type_) {
case __format::__arg_t::__none:
@@ -155,18 +157,14 @@ public:
/// Contains the implementation for basic_format_arg::handle.
struct __handle {
template <class _Tp>
- _LIBCPP_HIDE_FROM_ABI explicit __handle(_Tp&& __v) noexcept
+ _LIBCPP_HIDE_FROM_ABI explicit __handle(_Tp& __v) noexcept
: __ptr_(_VSTD::addressof(__v)),
__format_([](basic_format_parse_context<_CharT>& __parse_ctx, _Context& __ctx, const void* __ptr) {
- using _Dp = remove_cvref_t<_Tp>;
- using _Formatter = typename _Context::template formatter_type<_Dp>;
- constexpr bool __const_formattable =
- requires { _Formatter().format(std::declval<const _Dp&>(), std::declval<_Context&>()); };
- using _Qp = conditional_t<__const_formattable, const _Dp, _Dp>;
+ using _Dp = remove_const_t<_Tp>;
+ using _Qp = conditional_t<__formattable_with<const _Dp, _Context>, const _Dp, _Dp>;
+ static_assert(__formattable_with<_Qp, _Context>, "Mandated by [format.arg]/10");
- static_assert(__const_formattable || !is_const_v<remove_reference_t<_Tp>>, "Mandated by [format.arg]/18");
-
- _Formatter __f;
+ typename _Context::template formatter_type<_Dp> __f;
__parse_ctx.advance_to(__f.parse(__parse_ctx));
__ctx.advance_to(__f.format(*const_cast<_Qp*>(static_cast<const _Dp*>(__ptr)), __ctx));
}) {}
@@ -218,13 +216,11 @@ public:
_LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(basic_string_view<_CharT> __value) noexcept
: __string_view_(__value) {}
_LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(const void* __value) noexcept : __ptr_(__value) {}
- _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(__handle __value) noexcept
- // TODO FMT Investigate why it doesn't work without the forward.
- : __handle_(std::forward<__handle>(__value)) {}
+ _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(__handle&& __value) noexcept : __handle_(std::move(__value)) {}
};
template <class _Context>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_arg {
+class _LIBCPP_TEMPLATE_VIS basic_format_arg {
public:
class _LIBCPP_TEMPLATE_VIS handle;
@@ -276,7 +272,7 @@ private:
// This function is user facing, so it must wrap the non-standard types of
// the "variant" in a handle to stay conforming. See __arg_t for more details.
template <class _Visitor, class _Context>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT decltype(auto)
+_LIBCPP_HIDE_FROM_ABI decltype(auto)
visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
switch (__arg.__type_) {
# ifndef _LIBCPP_HAS_NO_INT128
@@ -295,7 +291,7 @@ visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
}
}
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/format_arg_store.h b/contrib/libs/cxxsupp/libcxx/include/__format/format_arg_store.h
index 6f4f4c3617a..15ec8eb0a7d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/format_arg_store.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/format_arg_store.h
@@ -19,15 +19,15 @@
#include <__config>
#include <__format/concepts.h>
#include <__format/format_arg.h>
-#include <__utility/forward.h>
-#include <cstring>
+#include <__type_traits/conditional.h>
+#include <__type_traits/extent.h>
+#include <__type_traits/remove_const.h>
#include <string>
#include <string_view>
-#include <type_traits>
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __format {
@@ -142,21 +142,31 @@ consteval __arg_t __determine_arg_t() {
//
// Note this version can't be constrained avoiding ambiguous overloads.
// That means it can be instantiated by disabled formatters. To solve this, a
-// constrained version for not formattable formatters is added. That overload
-// is marked as deleted to fail creating a storage type for disabled formatters.
+// constrained version for not formattable formatters is added.
template <class _Context, class _Tp>
consteval __arg_t __determine_arg_t() {
return __arg_t::__handle;
}
+// The overload for not formattable types allows triggering the static
+// assertion below.
template <class _Context, class _Tp>
requires(!__formattable<_Tp, typename _Context::char_type>)
-consteval __arg_t __determine_arg_t() = delete;
+consteval __arg_t __determine_arg_t() {
+ return __arg_t::__none;
+}
+// Pseudo constuctor for basic_format_arg
+//
+// Modeled after template<class T> explicit basic_format_arg(T& v) noexcept;
+// [format.arg]/4-6
template <class _Context, class _Tp>
-_LIBCPP_HIDE_FROM_ABI basic_format_arg<_Context> __create_format_arg(_Tp&& __value) noexcept {
- constexpr __arg_t __arg = __determine_arg_t<_Context, remove_cvref_t<_Tp>>();
- static_assert(__arg != __arg_t::__none);
+_LIBCPP_HIDE_FROM_ABI basic_format_arg<_Context> __create_format_arg(_Tp& __value) noexcept {
+ using _Dp = remove_const_t<_Tp>;
+ constexpr __arg_t __arg = __determine_arg_t<_Context, _Dp>();
+ static_assert(__arg != __arg_t::__none, "the supplied type is not formattable");
+
+ static_assert(__formattable_with<_Tp, _Context>);
// Not all types can be used to directly initialize the
// __basic_format_arg_value. First handle all types needing adjustment, the
@@ -175,9 +185,9 @@ _LIBCPP_HIDE_FROM_ABI basic_format_arg<_Context> __create_format_arg(_Tp&& __val
return basic_format_arg<_Context>{__arg, static_cast<unsigned long long>(__value)};
else if constexpr (__arg == __arg_t::__string_view)
// Using std::size on a character array will add the NUL-terminator to the size.
- if constexpr (is_array_v<remove_cvref_t<_Tp>>)
+ if constexpr (is_array_v<_Dp>)
return basic_format_arg<_Context>{
- __arg, basic_string_view<typename _Context::char_type>{__value, extent_v<remove_cvref_t<_Tp>> - 1}};
+ __arg, basic_string_view<typename _Context::char_type>{__value, extent_v<_Dp> - 1}};
else
// When the _Traits or _Allocator are different an implicit conversion will
// fail.
@@ -186,8 +196,7 @@ _LIBCPP_HIDE_FROM_ABI basic_format_arg<_Context> __create_format_arg(_Tp&& __val
else if constexpr (__arg == __arg_t::__ptr)
return basic_format_arg<_Context>{__arg, static_cast<const void*>(__value)};
else if constexpr (__arg == __arg_t::__handle)
- return basic_format_arg<_Context>{
- __arg, typename __basic_format_arg_value<_Context>::__handle{_VSTD::forward<_Tp>(__value)}};
+ return basic_format_arg<_Context>{__arg, typename __basic_format_arg_value<_Context>::__handle{__value}};
else
return basic_format_arg<_Context>{__arg, __value};
}
@@ -218,7 +227,7 @@ _LIBCPP_HIDE_FROM_ABI void __store_basic_format_arg(basic_format_arg<_Context>*
template <class _Context, size_t N>
struct __packed_format_arg_store {
__basic_format_arg_value<_Context> __values_[N];
- uint64_t __types_;
+ uint64_t __types_ = 0;
};
template <class _Context, size_t N>
@@ -247,7 +256,7 @@ struct _LIBCPP_TEMPLATE_VIS __format_arg_store {
_Storage __storage;
};
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/format_args.h b/contrib/libs/cxxsupp/libcxx/include/__format/format_args.h
index 8b8fbde92fe..defb42a4ab0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/format_args.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/format_args.h
@@ -24,12 +24,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Context>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_args {
+class _LIBCPP_TEMPLATE_VIS basic_format_args {
public:
- _LIBCPP_HIDE_FROM_ABI basic_format_args() noexcept = default;
+ basic_format_args() noexcept = default;
template <class... _Args>
_LIBCPP_HIDE_FROM_ABI basic_format_args(const __format_arg_store<_Context, _Args...>& __store) noexcept
@@ -71,9 +71,11 @@ private:
const basic_format_arg<_Context>* __args_;
};
};
-_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(basic_format_args);
-#endif //_LIBCPP_STD_VER > 17
+template <class _Context, class... _Args>
+basic_format_args(__format_arg_store<_Context, _Args...>) -> basic_format_args<_Context>;
+
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/format_context.h b/contrib/libs/cxxsupp/libcxx/include/__format/format_context.h
index 85e00eb222c..9d50cee2483 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/format_context.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/format_context.h
@@ -37,11 +37,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _OutIt, class _CharT>
requires output_iterator<_OutIt, const _CharT&>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_context;
+class _LIBCPP_TEMPLATE_VIS basic_format_context;
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
/**
@@ -80,7 +80,6 @@ requires output_iterator<_OutIt, const _CharT&>
class
// clang-format off
_LIBCPP_TEMPLATE_VIS
- _LIBCPP_AVAILABILITY_FORMAT
_LIBCPP_PREFERRED_NAME(format_context)
_LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wformat_context))
// clang-format on
@@ -121,9 +120,9 @@ private:
// TODO FMT Validate whether lazy creation is the best solution.
optional<_VSTD::locale> __loc_;
- template <class __OutIt, class __CharT>
- friend _LIBCPP_HIDE_FROM_ABI basic_format_context<__OutIt, __CharT>
- __format_context_create(__OutIt, basic_format_args<basic_format_context<__OutIt, __CharT>>,
+ template <class _OtherOutIt, class _OtherCharT>
+ friend _LIBCPP_HIDE_FROM_ABI basic_format_context<_OtherOutIt, _OtherCharT>
+ __format_context_create(_OtherOutIt, basic_format_args<basic_format_context<_OtherOutIt, _OtherCharT>>,
optional<_VSTD::locale>&&);
// Note: the Standard doesn't specify the required constructors.
@@ -134,9 +133,9 @@ private:
: __out_it_(_VSTD::move(__out_it)), __args_(__args),
__loc_(_VSTD::move(__loc)) {}
#else
- template <class __OutIt, class __CharT>
- friend _LIBCPP_HIDE_FROM_ABI basic_format_context<__OutIt, __CharT>
- __format_context_create(__OutIt, basic_format_args<basic_format_context<__OutIt, __CharT>>);
+ template <class _OtherOutIt, class _OtherCharT>
+ friend _LIBCPP_HIDE_FROM_ABI basic_format_context<_OtherOutIt, _OtherCharT>
+ __format_context_create(_OtherOutIt, basic_format_args<basic_format_context<_OtherOutIt, _OtherCharT>>);
_LIBCPP_HIDE_FROM_ABI
explicit basic_format_context(_OutIt __out_it,
@@ -162,7 +161,7 @@ private:
// Here the width of an element in input is determined dynamically.
// Note when the top-level element has no width the retargeting is not needed.
template <class _CharT>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT
+class _LIBCPP_TEMPLATE_VIS
basic_format_context<typename __format::__retarget_buffer<_CharT>::__iterator, _CharT> {
public:
using iterator = typename __format::__retarget_buffer<_CharT>::__iterator;
@@ -216,7 +215,7 @@ private:
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(basic_format_context);
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/format_error.h b/contrib/libs/cxxsupp/libcxx/include/__format/format_error.h
index 002d1a40a22..f22cb0b81ec 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/format_error.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/format_error.h
@@ -11,7 +11,7 @@
#define _LIBCPP___FORMAT_FORMAT_ERROR_H
#include <__config>
-#include <cstdlib>
+#include <__verbose_abort>
#include <stdexcept>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -20,35 +20,31 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
-class _LIBCPP_EXCEPTION_ABI format_error : public runtime_error {
+_LIBCPP_DIAGNOSTIC_PUSH
+_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables")
+class _LIBCPP_EXPORTED_FROM_ABI format_error : public runtime_error {
public:
_LIBCPP_HIDE_FROM_ABI explicit format_error(const string& __s)
: runtime_error(__s) {}
_LIBCPP_HIDE_FROM_ABI explicit format_error(const char* __s)
: runtime_error(__s) {}
- // TODO FMT Remove when format is no longer experimental.
- // Avoids linker errors when building the Clang-cl Windows DLL which doesn't
- // support the experimental library.
-# ifndef _LIBCPP_INLINE_FORMAT_ERROR_DTOR
- ~format_error() noexcept override;
-# else
- ~format_error() noexcept override {}
-# endif
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL
+ ~format_error() noexcept override = default;
};
+_LIBCPP_DIAGNOSTIC_POP
_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI void
__throw_format_error(const char* __s) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw format_error(__s);
#else
- (void)__s;
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("format_error was thrown in -fno-exceptions mode with message \"%s\"", __s);
#endif
}
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/format_functions.h b/contrib/libs/cxxsupp/libcxx/include/__format/format_functions.h
index 0f0001272d4..bb62c1ce10c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/format_functions.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/format_functions.h
@@ -10,16 +10,10 @@
#ifndef _LIBCPP___FORMAT_FORMAT_FUNCTIONS
#define _LIBCPP___FORMAT_FORMAT_FUNCTIONS
-// TODO FMT This is added to fix Apple back-deployment.
-#include <version>
-#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
-
#include <__algorithm/clamp.h>
-#include <__availability>
#include <__concepts/convertible_to.h>
#include <__concepts/same_as.h>
#include <__config>
-#include <__debug>
#include <__format/buffer.h>
#include <__format/format_arg.h>
#include <__format/format_arg_store.h>
@@ -38,7 +32,9 @@
#include <__format/formatter_string.h>
#include <__format/parser_std_format_spec.h>
#include <__iterator/back_insert_iterator.h>
+#include <__iterator/concepts.h>
#include <__iterator/incrementable_traits.h>
+#include <__iterator/iterator_traits.h> // iter_value_t
#include <__variant/monostate.h>
#include <array>
#include <string>
@@ -54,7 +50,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// TODO FMT Evaluate which templates should be external templates. This
// improves the efficiency of the header. However since the header is still
@@ -67,16 +63,17 @@ using wformat_args = basic_format_args<wformat_context>;
#endif
template <class _Context = format_context, class... _Args>
-_LIBCPP_HIDE_FROM_ABI __format_arg_store<_Context, _Args...> make_format_args(_Args&&... __args) {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI __format_arg_store<_Context, _Args...> make_format_args(_Args&&... __args) {
return _VSTD::__format_arg_store<_Context, _Args...>(__args...);
}
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
-_LIBCPP_HIDE_FROM_ABI __format_arg_store<wformat_context, _Args...> make_wformat_args(_Args&&... __args) {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI __format_arg_store<wformat_context, _Args...>
+make_wformat_args(_Args&&... __args) {
return _VSTD::__format_arg_store<wformat_context, _Args...>(__args...);
}
-#endif
+# endif
namespace __format {
@@ -87,14 +84,16 @@ namespace __format {
template <class _CharT>
class _LIBCPP_TEMPLATE_VIS __compile_time_handle {
public:
- _LIBCPP_HIDE_FROM_ABI
- constexpr void __parse(basic_format_parse_context<_CharT>& __parse_ctx) const { __parse_(__parse_ctx); }
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr void __parse(_ParseContext& __ctx) const {
+ __parse_(__ctx);
+ }
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr void __enable() {
- __parse_ = [](basic_format_parse_context<_CharT>& __parse_ctx) {
+ __parse_ = [](basic_format_parse_context<_CharT>& __ctx) {
formatter<_Tp, _CharT> __f;
- __parse_ctx.advance_to(__f.parse(__parse_ctx));
+ __ctx.advance_to(__f.parse(__ctx));
};
}
@@ -128,13 +127,13 @@ public:
_LIBCPP_HIDE_FROM_ABI constexpr __arg_t arg(size_t __id) const {
if (__id >= __size_)
- std::__throw_format_error("Argument index out of bounds");
+ std::__throw_format_error("The argument index value is too large for the number of arguments supplied");
return __args_[__id];
}
_LIBCPP_HIDE_FROM_ABI constexpr const __compile_time_handle<_CharT>& __handle(size_t __id) const {
if (__id >= __size_)
- std::__throw_format_error("Argument index out of bounds");
+ std::__throw_format_error("The argument index value is too large for the number of arguments supplied");
return __handles_[__id];
}
@@ -147,41 +146,44 @@ private:
size_t __size_;
};
-_LIBCPP_HIDE_FROM_ABI
-constexpr void __compile_time_validate_integral(__arg_t __type) {
- switch (__type) {
- case __arg_t::__int:
- case __arg_t::__long_long:
- case __arg_t::__i128:
- case __arg_t::__unsigned:
- case __arg_t::__unsigned_long_long:
- case __arg_t::__u128:
- return;
-
- default:
- std::__throw_format_error("Argument isn't an integral type");
- }
-}
-
+// [format.string.std]/8
+// If { arg-idopt } is used in a width or precision, the value of the
+// corresponding formatting argument is used in its place. If the
+// corresponding formatting argument is not of standard signed or unsigned
+// integer type, or its value is negative for precision or non-positive for
+// width, an exception of type format_error is thrown.
+//
// _HasPrecision does the formatter have a precision?
template <class _CharT, class _Tp, bool _HasPrecision = false>
-_LIBCPP_HIDE_FROM_ABI constexpr void
-__compile_time_validate_argument(basic_format_parse_context<_CharT>& __parse_ctx,
- __compile_time_basic_format_context<_CharT>& __ctx) {
+_LIBCPP_HIDE_FROM_ABI constexpr void __compile_time_validate_argument(
+ basic_format_parse_context<_CharT>& __parse_ctx, __compile_time_basic_format_context<_CharT>& __ctx) {
+ auto __validate_type = [](__arg_t __type) {
+ // LWG3720 originally allowed "signed or unsigned integer types", however
+ // the final version explicitly changed it to "*standard* signed or unsigned
+ // integer types". It's trivial to use 128-bit integrals in libc++'s
+ // implementation, but other implementations may not implement it.
+ // (Using a width or precision, that does not fit in 64-bits, sounds very
+ // unlikely in real world code.)
+ switch (__type) {
+ case __arg_t::__int:
+ case __arg_t::__long_long:
+ case __arg_t::__unsigned:
+ case __arg_t::__unsigned_long_long:
+ return;
+
+ default:
+ std::__throw_format_error("Replacement argument isn't a standard signed or unsigned integer type");
+ }
+ };
+
formatter<_Tp, _CharT> __formatter;
__parse_ctx.advance_to(__formatter.parse(__parse_ctx));
- // [format.string.std]/7
- // ... If the corresponding formatting argument is not of integral type, or
- // its value is negative for precision or non-positive for width, an
- // exception of type format_error is thrown.
- //
- // Validate whether the arguments are integrals.
if (__formatter.__parser_.__width_as_arg_)
- __format::__compile_time_validate_integral(__ctx.arg(__formatter.__parser_.__width_));
+ __validate_type(__ctx.arg(__formatter.__parser_.__width_));
if constexpr (_HasPrecision)
if (__formatter.__parser_.__precision_as_arg_)
- __format::__compile_time_validate_integral(__ctx.arg(__formatter.__parser_.__precision_));
+ __validate_type(__ctx.arg(__formatter.__parser_.__precision_));
}
// This function is not user facing, so it can directly use the non-standard types of the "variant".
@@ -236,30 +238,34 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __compile_time_visit_format_arg(basic_forma
std::__throw_format_error("Invalid argument");
}
-template <class _CharT, class _ParseCtx, class _Ctx>
-_LIBCPP_HIDE_FROM_ABI constexpr const _CharT*
-__handle_replacement_field(const _CharT* __begin, const _CharT* __end,
+template <contiguous_iterator _Iterator, class _ParseCtx, class _Ctx>
+_LIBCPP_HIDE_FROM_ABI constexpr _Iterator
+__handle_replacement_field(_Iterator __begin, _Iterator __end,
_ParseCtx& __parse_ctx, _Ctx& __ctx) {
+ using _CharT = iter_value_t<_Iterator>;
__format::__parse_number_result __r = __format::__parse_arg_id(__begin, __end, __parse_ctx);
- bool __parse = *__r.__ptr == _CharT(':');
- switch (*__r.__ptr) {
+ if (__r.__last == __end)
+ std::__throw_format_error("The argument index should end with a ':' or a '}'");
+
+ bool __parse = *__r.__last == _CharT(':');
+ switch (*__r.__last) {
case _CharT(':'):
// The arg-id has a format-specifier, advance the input to the format-spec.
- __parse_ctx.advance_to(__r.__ptr + 1);
+ __parse_ctx.advance_to(__r.__last + 1);
break;
case _CharT('}'):
// The arg-id has no format-specifier.
- __parse_ctx.advance_to(__r.__ptr);
+ __parse_ctx.advance_to(__r.__last);
break;
default:
- std::__throw_format_error("The replacement field arg-id should terminate at a ':' or '}'");
+ std::__throw_format_error("The argument index should end with a ':' or a '}'");
}
if constexpr (same_as<_Ctx, __compile_time_basic_format_context<_CharT>>) {
__arg_t __type = __ctx.arg(__r.__value);
if (__type == __arg_t::__none)
- std::__throw_format_error("Argument index out of bounds");
+ std::__throw_format_error("The argument index value is too large for the number of arguments supplied");
else if (__type == __arg_t::__handle)
__ctx.__handle(__r.__value).__parse(__parse_ctx);
else if (__parse)
@@ -268,7 +274,7 @@ __handle_replacement_field(const _CharT* __begin, const _CharT* __end,
_VSTD::__visit_format_arg(
[&](auto __arg) {
if constexpr (same_as<decltype(__arg), monostate>)
- std::__throw_format_error("Argument index out of bounds");
+ std::__throw_format_error("The argument index value is too large for the number of arguments supplied");
else if constexpr (same_as<decltype(__arg), typename basic_format_arg<_Ctx>::handle>)
__arg.format(__parse_ctx, __ctx);
else {
@@ -293,8 +299,8 @@ __vformat_to(_ParseCtx&& __parse_ctx, _Ctx&& __ctx) {
using _CharT = typename _ParseCtx::char_type;
static_assert(same_as<typename _Ctx::char_type, _CharT>);
- const _CharT* __begin = __parse_ctx.begin();
- const _CharT* __end = __parse_ctx.end();
+ auto __begin = __parse_ctx.begin();
+ auto __end = __parse_ctx.end();
typename _Ctx::iterator __out_it = __ctx.out();
while (__begin != __end) {
switch (*__begin) {
@@ -341,7 +347,7 @@ struct _LIBCPP_TEMPLATE_VIS basic_format_string {
_Context{__types_.data(), __handles_.data(), sizeof...(_Args)});
}
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr basic_string_view<_CharT> get() const noexcept {
+ _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<_CharT> get() const noexcept {
return __str_;
}
@@ -353,20 +359,6 @@ private:
static constexpr array<__format::__arg_t, sizeof...(_Args)> __types_{
__format::__determine_arg_t<_Context, remove_cvref_t<_Args>>()...};
- // TODO FMT remove this work-around when the AIX ICE has been resolved.
-# if defined(_AIX) && defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER < 1400
- template <class _Tp>
- static constexpr __format::__compile_time_handle<_CharT> __get_handle() {
- __format::__compile_time_handle<_CharT> __handle;
- if (__format::__determine_arg_t<_Context, _Tp>() == __format::__arg_t::__handle)
- __handle.template __enable<_Tp>();
-
- return __handle;
- }
-
- static constexpr array<__format::__compile_time_handle<_CharT>, sizeof...(_Args)> __handles_{
- __get_handle<_Args>()...};
-# else
static constexpr array<__format::__compile_time_handle<_CharT>, sizeof...(_Args)> __handles_{[] {
using _Tp = remove_cvref_t<_Args>;
__format::__compile_time_handle<_CharT> __handle;
@@ -375,7 +367,6 @@ private:
return __handle;
}()...};
-# endif
};
template <class... _Args>
@@ -406,21 +397,21 @@ requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt
// https://reviews.llvm.org/D110499#inline-1180704
// TODO FMT Evaluate whether we want to file a Clang bug report regarding this.
template <output_iterator<const char&> _OutIt>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
vformat_to(_OutIt __out_it, string_view __fmt, format_args __args) {
return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args);
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
vformat_to(_OutIt __out_it, wstring_view __fmt, wformat_args __args) {
return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args);
}
#endif
template <output_iterator<const char&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, format_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat_to(_VSTD::move(__out_it), __fmt.get(),
_VSTD::make_format_args(__args...));
@@ -428,42 +419,48 @@ format_to(_OutIt __out_it, format_string<_Args...> __fmt, _Args&&... __args) {
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, wformat_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat_to(_VSTD::move(__out_it), __fmt.get(),
_VSTD::make_wformat_args(__args...));
}
#endif
-_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string
+// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup
+// fires too eagerly, see http://llvm.org/PR61563.
+template <class = void>
+_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI string
vformat(string_view __fmt, format_args __args) {
string __res;
_VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args);
return __res;
}
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup
+// fires too eagerly, see http://llvm.org/PR61563.
+template <class = void>
+_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI wstring
vformat(wstring_view __fmt, wformat_args __args) {
wstring __res;
_VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args);
return __res;
}
-#endif
+# endif
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string format(format_string<_Args...> __fmt,
- _Args&&... __args) {
+_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI string
+format(format_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat(__fmt.get(), _VSTD::make_format_args(__args...));
}
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
+_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI wstring
format(wformat_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat(__fmt.get(), _VSTD::make_wformat_args(__args...));
}
-#endif
+# endif
template <class _Context, class _OutIt, class _CharT>
_LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> __vformat_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n,
@@ -476,14 +473,14 @@ _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> __vformat_to_n(_OutIt __out_it,
}
template <output_iterator<const char&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt>
format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, format_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::__vformat_to_n<format_context>(_VSTD::move(__out_it), __n, __fmt.get(), _VSTD::make_format_args(__args...));
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
+_LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt>
format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, wformat_string<_Args...> __fmt,
_Args&&... __args) {
return _VSTD::__vformat_to_n<wformat_context>(_VSTD::move(__out_it), __n, __fmt.get(), _VSTD::make_wformat_args(__args...));
@@ -499,20 +496,20 @@ _LIBCPP_HIDE_FROM_ABI size_t __vformatted_size(basic_string_view<_CharT> __fmt,
}
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
+_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(format_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::__vformatted_size(__fmt.get(), basic_format_args{_VSTD::make_format_args(__args...)});
}
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
+_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(wformat_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::__vformatted_size(__fmt.get(), basic_format_args{_VSTD::make_wformat_args(__args...)});
}
-#endif
+# endif
-#ifndef _LIBCPP_HAS_NO_LOCALIZATION
+# ifndef _LIBCPP_HAS_NO_LOCALIZATION
template <class _OutIt, class _CharT, class _FormatOutIt>
requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt
@@ -533,7 +530,7 @@ requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt
}
template <output_iterator<const char&> _OutIt>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt vformat_to(
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt vformat_to(
_OutIt __out_it, locale __loc, string_view __fmt, format_args __args) {
return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt,
__args);
@@ -541,7 +538,7 @@ _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt v
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt vformat_to(
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt vformat_to(
_OutIt __out_it, locale __loc, wstring_view __fmt, wformat_args __args) {
return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt,
__args);
@@ -549,7 +546,7 @@ _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt v
#endif
template <output_iterator<const char&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, locale __loc, format_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt.get(),
_VSTD::make_format_args(__args...));
@@ -557,14 +554,17 @@ format_to(_OutIt __out_it, locale __loc, format_string<_Args...> __fmt, _Args&&.
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt.get(),
_VSTD::make_wformat_args(__args...));
}
#endif
-_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string
+// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup
+// fires too eagerly, see http://llvm.org/PR61563.
+template <class = void>
+_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI string
vformat(locale __loc, string_view __fmt, format_args __args) {
string __res;
_VSTD::vformat_to(_VSTD::back_inserter(__res), _VSTD::move(__loc), __fmt,
@@ -572,32 +572,34 @@ vformat(locale __loc, string_view __fmt, format_args __args) {
return __res;
}
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup
+// fires too eagerly, see http://llvm.org/PR61563.
+template <class = void>
+_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI wstring
vformat(locale __loc, wstring_view __fmt, wformat_args __args) {
wstring __res;
_VSTD::vformat_to(_VSTD::back_inserter(__res), _VSTD::move(__loc), __fmt,
__args);
return __res;
}
-#endif
+# endif
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string format(locale __loc,
- format_string<_Args...> __fmt,
- _Args&&... __args) {
+_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI string
+format(locale __loc, format_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat(_VSTD::move(__loc), __fmt.get(),
_VSTD::make_format_args(__args...));
}
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
+_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI wstring
format(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat(_VSTD::move(__loc), __fmt.get(),
_VSTD::make_wformat_args(__args...));
}
-#endif
+# endif
template <class _Context, class _OutIt, class _CharT>
_LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> __vformat_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n,
@@ -611,7 +613,7 @@ _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> __vformat_to_n(_OutIt __out_it,
}
template <output_iterator<const char&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt>
format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, locale __loc, format_string<_Args...> __fmt,
_Args&&... __args) {
return _VSTD::__vformat_to_n<format_context>(_VSTD::move(__out_it), __n, _VSTD::move(__loc), __fmt.get(),
@@ -620,7 +622,7 @@ format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, locale __loc, format
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt>
format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, locale __loc, wformat_string<_Args...> __fmt,
_Args&&... __args) {
return _VSTD::__vformat_to_n<wformat_context>(_VSTD::move(__out_it), __n, _VSTD::move(__loc), __fmt.get(),
@@ -638,26 +640,23 @@ _LIBCPP_HIDE_FROM_ABI size_t __vformatted_size(locale __loc, basic_string_view<_
}
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
+_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(locale __loc, format_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::__vformatted_size(_VSTD::move(__loc), __fmt.get(), basic_format_args{_VSTD::make_format_args(__args...)});
}
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
+_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::__vformatted_size(_VSTD::move(__loc), __fmt.get(), basic_format_args{_VSTD::make_wformat_args(__args...)});
}
-#endif
-
-#endif // _LIBCPP_HAS_NO_LOCALIZATION
+# endif
+# endif // _LIBCPP_HAS_NO_LOCALIZATION
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
-#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
-
#endif // _LIBCPP___FORMAT_FORMAT_FUNCTIONS
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/format_fwd.h b/contrib/libs/cxxsupp/libcxx/include/__format/format_fwd.h
index f7c72e21211..120b2fc8d47 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/format_fwd.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/format_fwd.h
@@ -20,19 +20,19 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Context>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_arg;
+class _LIBCPP_TEMPLATE_VIS basic_format_arg;
template <class _OutIt, class _CharT>
requires output_iterator<_OutIt, const _CharT&>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_context;
+class _LIBCPP_TEMPLATE_VIS basic_format_context;
template <class _Tp, class _CharT = char>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter;
+struct _LIBCPP_TEMPLATE_VIS formatter;
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/format_parse_context.h b/contrib/libs/cxxsupp/libcxx/include/__format/format_parse_context.h
index 30e3a7dfdaf..79f53f77d4a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/format_parse_context.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/format_parse_context.h
@@ -12,6 +12,7 @@
#include <__config>
#include <__format/format_error.h>
+#include <__type_traits/is_constant_evaluated.h>
#include <string_view>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -20,10 +21,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _CharT>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_parse_context {
+class _LIBCPP_TEMPLATE_VIS basic_format_parse_context {
public:
using char_type = _CharT;
using const_iterator = typename basic_string_view<_CharT>::const_iterator;
@@ -58,6 +59,18 @@ public:
if (__indexing_ == __unknown)
__indexing_ = __automatic;
+
+ // Throws an exception to make the expression a non core constant
+ // expression as required by:
+ // [format.parse.ctx]/8
+ // Remarks: Let cur-arg-id be the value of next_arg_id_ prior to this
+ // call. Call expressions where cur-arg-id >= num_args_ is true are not
+ // core constant expressions (7.7 [expr.const]).
+ // Note: the Throws clause [format.parse.ctx]/9 doesn't specify the
+ // behavior when id >= num_args_.
+ if (is_constant_evaluated() && __next_arg_id_ >= __num_args_)
+ std::__throw_format_error("Argument index outside the valid range");
+
return __next_arg_id_++;
}
_LIBCPP_HIDE_FROM_ABI constexpr void check_arg_id(size_t __id) {
@@ -93,7 +106,7 @@ using format_parse_context = basic_format_parse_context<char>;
using wformat_parse_context = basic_format_parse_context<wchar_t>;
#endif
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/format_string.h b/contrib/libs/cxxsupp/libcxx/include/__format/format_string.h
index d9caf866a17..2e1c71b3d01 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/format_string.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/format_string.h
@@ -13,6 +13,8 @@
#include <__assert>
#include <__config>
#include <__format/format_error.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h> // iter_value_t
#include <cstddef>
#include <cstdint>
@@ -22,22 +24,22 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __format {
-template <class _CharT>
+template <contiguous_iterator _Iterator>
struct _LIBCPP_TEMPLATE_VIS __parse_number_result {
- const _CharT* __ptr;
+ _Iterator __last;
uint32_t __value;
};
-template <class _CharT>
-__parse_number_result(const _CharT*, uint32_t) -> __parse_number_result<_CharT>;
+template <contiguous_iterator _Iterator>
+__parse_number_result(_Iterator, uint32_t) -> __parse_number_result<_Iterator>;
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
-__parse_number(const _CharT* __begin, const _CharT* __end);
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_Iterator>
+__parse_number(_Iterator __begin, _Iterator __end);
/**
* The maximum value of a numeric argument.
@@ -53,27 +55,28 @@ __parse_number(const _CharT* __begin, const _CharT* __end);
inline constexpr uint32_t __number_max = INT32_MAX;
namespace __detail {
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
-__parse_zero(const _CharT* __begin, const _CharT*, auto& __parse_ctx) {
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_Iterator>
+__parse_zero(_Iterator __begin, _Iterator, auto& __parse_ctx) {
__parse_ctx.check_arg_id(0);
return {++__begin, 0}; // can never be larger than the maximum.
}
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
-__parse_automatic(const _CharT* __begin, const _CharT*, auto& __parse_ctx) {
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_Iterator>
+__parse_automatic(_Iterator __begin, _Iterator, auto& __parse_ctx) {
size_t __value = __parse_ctx.next_arg_id();
- _LIBCPP_ASSERT(__value <= __number_max,
- "Compilers don't support this number of arguments");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __value <= __number_max,
+ "Compilers don't support this number of arguments");
return {__begin, uint32_t(__value)};
}
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
-__parse_manual(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
- __parse_number_result<_CharT> __r = __format::__parse_number(__begin, __end);
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_Iterator>
+__parse_manual(_Iterator __begin, _Iterator __end, auto& __parse_ctx) {
+ __parse_number_result<_Iterator> __r = __format::__parse_number(__begin, __end);
__parse_ctx.check_arg_id(__r.__value);
return __r;
}
@@ -86,9 +89,10 @@ __parse_manual(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
* The number is used for the 31-bit values @em width and @em precision. This
* allows a maximum value of 2147483647.
*/
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
-__parse_number(const _CharT* __begin, const _CharT* __end_input) {
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_Iterator>
+__parse_number(_Iterator __begin, _Iterator __end_input) {
+ using _CharT = iter_value_t<_Iterator>;
static_assert(__format::__number_max == INT32_MAX,
"The algorithm is implemented based on this value.");
/*
@@ -98,7 +102,7 @@ __parse_number(const _CharT* __begin, const _CharT* __end_input) {
* - Does the value exceed width of an uint32_t? (Switching to uint64_t would
* have the same issue, but with a higher maximum.)
*/
- const _CharT* __end = __end_input - __begin > 9 ? __begin + 9 : __end_input;
+ _Iterator __end = __end_input - __begin > 9 ? __begin + 9 : __end_input;
uint32_t __value = *__begin - _CharT('0');
while (++__begin != __end) {
if (*__begin < _CharT('0') || *__begin > _CharT('9'))
@@ -120,7 +124,7 @@ __parse_number(const _CharT* __begin, const _CharT* __end_input) {
if (__v > __number_max ||
(__begin != __end_input && *__begin >= _CharT('0') &&
*__begin <= _CharT('9')))
- std::__throw_format_error("The numeric value of the format-spec is too large");
+ std::__throw_format_error("The numeric value of the format specifier is too large");
__value = __v;
}
@@ -134,9 +138,10 @@ __parse_number(const _CharT* __begin, const _CharT* __end_input) {
* The parser will return a pointer beyond the last consumed character. This
* should be the closing '}' of the arg-id.
*/
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
-__parse_arg_id(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_Iterator>
+__parse_arg_id(_Iterator __begin, _Iterator __end, auto& __parse_ctx) {
+ using _CharT = iter_value_t<_Iterator>;
switch (*__begin) {
case _CharT('0'):
return __detail::__parse_zero(__begin, __end, __parse_ctx);
@@ -149,14 +154,14 @@ __parse_arg_id(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
return __detail::__parse_automatic(__begin, __end, __parse_ctx);
}
if (*__begin < _CharT('0') || *__begin > _CharT('9'))
- std::__throw_format_error("The arg-id of the format-spec starts with an invalid character");
+ std::__throw_format_error("The argument index starts with an invalid character");
return __detail::__parse_manual(__begin, __end, __parse_ctx);
}
} // namespace __format
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/format_to_n_result.h b/contrib/libs/cxxsupp/libcxx/include/__format/format_to_n_result.h
index f1ed9a0982a..6f30546dec0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/format_to_n_result.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/format_to_n_result.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _OutIt>
struct _LIBCPP_TEMPLATE_VIS format_to_n_result {
@@ -28,7 +28,7 @@ struct _LIBCPP_TEMPLATE_VIS format_to_n_result {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(format_to_n_result);
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/formatter.h b/contrib/libs/cxxsupp/libcxx/include/__format/formatter.h
index 900a09af4e9..172b2d5f7b8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/formatter.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/formatter.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
/// The default formatter template.
///
@@ -32,13 +32,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
/// - is_copy_assignable<F>, and
/// - is_move_assignable<F>.
template <class _Tp, class _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter {
+struct _LIBCPP_TEMPLATE_VIS formatter {
formatter() = delete;
formatter(const formatter&) = delete;
formatter& operator=(const formatter&) = delete;
};
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr void __set_debug_format(_Tp& __formatter) {
@@ -46,8 +46,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __set_debug_format(_Tp& __formatter) {
__formatter.set_debug_format();
}
-# endif // _LIBCPP_STD_VER > 20
-#endif // _LIBCPP_STD_VER > 17
+# endif // _LIBCPP_STD_VER >= 23
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_bool.h b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_bool.h
index 0d005a1bee2..3c8ae95f55f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_bool.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_bool.h
@@ -11,17 +11,15 @@
#define _LIBCPP___FORMAT_FORMATTER_BOOL_H
#include <__algorithm/copy.h>
+#include <__assert>
#include <__availability>
#include <__config>
-#include <__debug>
#include <__format/concepts.h>
-#include <__format/format_error.h>
#include <__format/format_parse_context.h>
#include <__format/formatter.h>
#include <__format/formatter_integral.h>
#include <__format/parser_std_format_spec.h>
#include <__utility/unreachable.h>
-#include <string_view>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <locale>
@@ -33,19 +31,20 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<bool, _CharT> {
+struct _LIBCPP_TEMPLATE_VIS formatter<bool, _CharT> {
public:
- _LIBCPP_HIDE_FROM_ABI constexpr auto
- parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) {
- auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_integral);
- __format_spec::__process_parsed_bool(__parser_);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ typename _ParseContext::iterator __result = __parser_.__parse(__ctx, __format_spec::__fields_integral);
+ __format_spec::__process_parsed_bool(__parser_, "a bool");
return __result;
}
- _LIBCPP_HIDE_FROM_ABI auto format(bool __value, auto& __ctx) const -> decltype(__ctx.out()) {
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(bool __value, _FormatContext& __ctx) const {
switch (__parser_.__type_) {
case __format_spec::__type::__default:
case __format_spec::__type::__string:
@@ -63,7 +62,7 @@ public:
static_cast<unsigned>(__value), __ctx, __parser_.__get_parsed_std_specifications(__ctx));
default:
- _LIBCPP_ASSERT(false, "The parse function should have validated the type");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "The parse function should have validated the type");
__libcpp_unreachable();
}
}
@@ -71,7 +70,7 @@ public:
__format_spec::__parser<_CharT> __parser_;
};
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_char.h b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_char.h
index 8a92e7445b4..d6e61e86544 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_char.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_char.h
@@ -19,6 +19,7 @@
#include <__format/formatter_integral.h>
#include <__format/formatter_output.h>
#include <__format/parser_std_format_spec.h>
+#include <__format/write_escaped.h>
#include <__type_traits/conditional.h>
#include <__type_traits/is_signed.h>
@@ -28,23 +29,24 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_char {
+struct _LIBCPP_TEMPLATE_VIS __formatter_char {
public:
- _LIBCPP_HIDE_FROM_ABI constexpr auto
- parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) {
- auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_integral);
- __format_spec::__process_parsed_char(__parser_);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ typename _ParseContext::iterator __result = __parser_.__parse(__ctx, __format_spec::__fields_integral);
+ __format_spec::__process_parsed_char(__parser_, "a character");
return __result;
}
- _LIBCPP_HIDE_FROM_ABI auto format(_CharT __value, auto& __ctx) const -> decltype(__ctx.out()) {
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(_CharT __value, _FormatContext& __ctx) const {
if (__parser_.__type_ == __format_spec::__type::__default || __parser_.__type_ == __format_spec::__type::__char)
return __formatter::__format_char(__value, __ctx.out(), __parser_.__get_parsed_std_specifications(__ctx));
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
if (__parser_.__type_ == __format_spec::__type::__debug)
return __formatter::__format_escaped_char(__value, __ctx.out(), __parser_.__get_parsed_std_specifications(__ctx));
# endif
@@ -60,13 +62,14 @@ public:
return __formatter::__format_integer(__value, __ctx, __parser_.__get_parsed_std_specifications(__ctx));
}
- _LIBCPP_HIDE_FROM_ABI auto format(char __value, auto& __ctx) const -> decltype(__ctx.out())
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(char __value, _FormatContext& __ctx) const
requires(same_as<_CharT, wchar_t>)
{
return format(static_cast<wchar_t>(__value), __ctx);
}
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr void set_debug_format() { __parser_.__type_ = __format_spec::__type::__debug; }
# endif
@@ -74,19 +77,19 @@ public:
};
template <>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<char, char> : public __formatter_char<char> {};
+struct _LIBCPP_TEMPLATE_VIS formatter<char, char> : public __formatter_char<char> {};
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<char, wchar_t> : public __formatter_char<wchar_t> {};
+struct _LIBCPP_TEMPLATE_VIS formatter<char, wchar_t> : public __formatter_char<wchar_t> {};
template <>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<wchar_t, wchar_t> : public __formatter_char<wchar_t> {
+struct _LIBCPP_TEMPLATE_VIS formatter<wchar_t, wchar_t> : public __formatter_char<wchar_t> {
};
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_floating_point.h b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_floating_point.h
index ca065723e19..fbb8aa9200a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_floating_point.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_floating_point.h
@@ -16,6 +16,9 @@
#include <__algorithm/min.h>
#include <__algorithm/rotate.h>
#include <__algorithm/transform.h>
+#include <__charconv/chars_format.h>
+#include <__charconv/to_chars_floating_point.h>
+#include <__charconv/to_chars_result.h>
#include <__concepts/arithmetic.h>
#include <__concepts/same_as.h>
#include <__config>
@@ -25,10 +28,14 @@
#include <__format/formatter_integral.h>
#include <__format/formatter_output.h>
#include <__format/parser_std_format_spec.h>
+#include <__iterator/concepts.h>
#include <__memory/allocator.h>
+#include <__system_error/errc.h>
+#include <__type_traits/conditional.h>
#include <__utility/move.h>
#include <__utility/unreachable.h>
-#include <charconv>
+#include <cmath>
+#include <cstddef>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <locale>
@@ -43,28 +50,28 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __formatter {
template <floating_point _Tp>
_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value) {
to_chars_result __r = _VSTD::to_chars(__first, __last, __value);
- _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
return __r.ptr;
}
template <floating_point _Tp>
_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, chars_format __fmt) {
to_chars_result __r = _VSTD::to_chars(__first, __last, __value, __fmt);
- _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
return __r.ptr;
}
template <floating_point _Tp>
_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, chars_format __fmt, int __precision) {
to_chars_result __r = _VSTD::to_chars(__first, __last, __value, __fmt, __precision);
- _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
return __r.ptr;
}
@@ -246,10 +253,10 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_default(const __float_buffe
__result.__radix_point = __result.__last;
// clang-format off
- _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
- (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
- (__result.__exponent == __result.__last || *__result.__exponent == 'e'),
- "Post-condition failure.");
+ _LIBCPP_ASSERT_UNCATEGORIZED((__result.__integral != __result.__last) &&
+ (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
+ (__result.__exponent == __result.__last || *__result.__exponent == 'e'),
+ "Post-condition failure.");
// clang-format on
return __result;
@@ -299,10 +306,10 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_hexadecimal_lower_case(cons
}
// clang-format off
- _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
- (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
- (__result.__exponent != __result.__last && *__result.__exponent == 'p'),
- "Post-condition failure.");
+ _LIBCPP_ASSERT_UNCATEGORIZED((__result.__integral != __result.__last) &&
+ (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
+ (__result.__exponent != __result.__last && *__result.__exponent == 'p'),
+ "Post-condition failure.");
// clang-format on
return __result;
@@ -329,7 +336,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_scientific_lower_case(const
__formatter::__to_buffer(__integral, __buffer.end(), __value, chars_format::scientific, __precision);
char* __first = __integral + 1;
- _LIBCPP_ASSERT(__first != __result.__last, "No exponent present");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first != __result.__last, "No exponent present");
if (*__first == '.') {
__result.__radix_point = __first;
__result.__exponent = __formatter::__find_exponent(__first + 1, __result.__last);
@@ -339,10 +346,10 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_scientific_lower_case(const
}
// clang-format off
- _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
- (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
- (__result.__exponent != __result.__last && *__result.__exponent == 'e'),
- "Post-condition failure.");
+ _LIBCPP_ASSERT_UNCATEGORIZED((__result.__integral != __result.__last) &&
+ (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
+ (__result.__exponent != __result.__last && *__result.__exponent == 'e'),
+ "Post-condition failure.");
// clang-format on
return __result;
}
@@ -372,10 +379,10 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_fixed(const __float_buffer<
__result.__exponent = __result.__last;
// clang-format off
- _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
- (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
- (__result.__exponent == __result.__last),
- "Post-condition failure.");
+ _LIBCPP_ASSERT_UNCATEGORIZED((__result.__integral != __result.__last) &&
+ (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
+ (__result.__exponent == __result.__last),
+ "Post-condition failure.");
// clang-format on
return __result;
}
@@ -409,10 +416,10 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_general_lower_case(__float_
}
// clang-format off
- _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
- (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
- (__result.__exponent == __result.__last || *__result.__exponent == 'e'),
- "Post-condition failure.");
+ _LIBCPP_ASSERT_UNCATEGORIZED((__result.__integral != __result.__last) &&
+ (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
+ (__result.__exponent == __result.__last || *__result.__exponent == 'e'),
+ "Post-condition failure.");
// clang-format on
return __result;
@@ -484,7 +491,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer(
return __formatter::__format_buffer_general_upper_case(__buffer, __value, __buffer.__precision(), __first);
default:
- _LIBCPP_ASSERT(false, "The parser should have validated the type");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "The parser should have validated the type");
__libcpp_unreachable();
}
}
@@ -522,7 +529,7 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_locale_specific_form(
if (__size < __specs.__width_) {
if (__zero_padding) {
__specs.__alignment_ = __format_spec::__alignment::__right;
- __specs.__fill_ = _CharT('0');
+ __specs.__fill_.__data[0] = _CharT('0');
}
__padding = __formatter::__padding_size(__size, __specs.__width_, __specs.__alignment_);
@@ -602,10 +609,40 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_floating_point_non_finite(
return __formatter::__write(__buffer, __last, _VSTD::move(__out_it), __specs);
}
-template <floating_point _Tp, class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto
-__format_floating_point(_Tp __value, auto& __ctx, __format_spec::__parsed_specifications<_CharT> __specs)
- -> decltype(__ctx.out()) {
+/// Writes additional zero's for the precision before the exponent.
+/// This is used when the precision requested in the format string is larger
+/// than the maximum precision of the floating-point type. These precision
+/// digits are always 0.
+///
+/// \param __exponent The location of the exponent character.
+/// \param __num_trailing_zeros The number of 0's to write before the exponent
+/// character.
+template <class _CharT, class _ParserCharT>
+_LIBCPP_HIDE_FROM_ABI auto __write_using_trailing_zeros(
+ const _CharT* __first,
+ const _CharT* __last,
+ output_iterator<const _CharT&> auto __out_it,
+ __format_spec::__parsed_specifications<_ParserCharT> __specs,
+ size_t __size,
+ const _CharT* __exponent,
+ size_t __num_trailing_zeros) -> decltype(__out_it) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "Not a valid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__num_trailing_zeros > 0,
+ "The overload not writing trailing zeros should have been used");
+
+ __padding_size_result __padding =
+ __formatter::__padding_size(__size + __num_trailing_zeros, __specs.__width_, __specs.__alignment_);
+ __out_it = __formatter::__fill(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
+ __out_it = __formatter::__copy(__first, __exponent, _VSTD::move(__out_it));
+ __out_it = __formatter::__fill(_VSTD::move(__out_it), __num_trailing_zeros, _CharT('0'));
+ __out_it = __formatter::__copy(__exponent, __last, _VSTD::move(__out_it));
+ return __formatter::__fill(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
+}
+
+
+template <floating_point _Tp, class _CharT, class _FormatContext>
+_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
+__format_floating_point(_Tp __value, _FormatContext& __ctx, __format_spec::__parsed_specifications<_CharT> __specs) {
bool __negative = _VSTD::signbit(__value);
if (!_VSTD::isfinite(__value)) [[unlikely]]
@@ -707,7 +744,7 @@ __format_floating_point(_Tp __value, auto& __ctx, __format_spec::__parsed_specif
// After the sign is written, zero padding is the same a right alignment
// with '0'.
__specs.__alignment_ = __format_spec::__alignment::__right;
- __specs.__fill_ = _CharT('0');
+ __specs.__fill_.__data[0] = _CharT('0');
}
if (__num_trailing_zeros)
@@ -722,15 +759,15 @@ __format_floating_point(_Tp __value, auto& __ctx, __format_spec::__parsed_specif
template <__fmt_char_type _CharT>
struct _LIBCPP_TEMPLATE_VIS __formatter_floating_point {
public:
- _LIBCPP_HIDE_FROM_ABI constexpr auto
- parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) {
- auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_floating_point);
- __format_spec::__process_parsed_floating_point(__parser_);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ typename _ParseContext::iterator __result = __parser_.__parse(__ctx, __format_spec::__fields_floating_point);
+ __format_spec::__process_parsed_floating_point(__parser_, "a floating-point");
return __result;
}
- template <floating_point _Tp>
- _LIBCPP_HIDE_FROM_ABI auto format(_Tp __value, auto& __ctx) const -> decltype(__ctx.out()) {
+ template <floating_point _Tp, class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(_Tp __value, _FormatContext& __ctx) const {
return __formatter::__format_floating_point(__value, __ctx, __parser_.__get_parsed_std_specifications(__ctx));
}
@@ -738,16 +775,16 @@ public:
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<float, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<float, _CharT>
: public __formatter_floating_point<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<double, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<double, _CharT>
: public __formatter_floating_point<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<long double, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<long double, _CharT>
: public __formatter_floating_point<_CharT> {};
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_integer.h b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_integer.h
index b4be9f9a07c..5590bff5aa9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_integer.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_integer.h
@@ -19,8 +19,8 @@
#include <__format/formatter_integral.h>
#include <__format/formatter_output.h>
#include <__format/parser_std_format_spec.h>
+#include <__type_traits/is_void.h>
#include <__type_traits/make_32_64_or_128_bit.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -28,28 +28,28 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <__fmt_char_type _CharT>
- struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_integer {
+ struct _LIBCPP_TEMPLATE_VIS __formatter_integer {
public:
- _LIBCPP_HIDE_FROM_ABI constexpr auto
- parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) {
- auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_integral);
- __format_spec::__process_parsed_integer(__parser_);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ typename _ParseContext::iterator __result = __parser_.__parse(__ctx, __format_spec::__fields_integral);
+ __format_spec::__process_parsed_integer(__parser_, "an integer");
return __result;
}
- template <integral _Tp>
- _LIBCPP_HIDE_FROM_ABI auto format(_Tp __value, auto& __ctx) const -> decltype(__ctx.out()) {
+ template <integral _Tp, class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(_Tp __value, _FormatContext& __ctx) const {
__format_spec::__parsed_specifications<_CharT> __specs = __parser_.__get_parsed_std_specifications(__ctx);
if (__specs.__std_.__type_ == __format_spec::__type::__char)
return __formatter::__format_char(__value, __ctx.out(), __specs);
using _Type = __make_32_64_or_128_bit_t<_Tp>;
- static_assert(!is_same<_Type, void>::value, "unsupported integral type used in __formatter_integer::__format");
+ static_assert(!is_void<_Type>::value, "unsupported integral type used in __formatter_integer::__format");
// Reduce the number of instantiation of the integer formatter
return __formatter::__format_integer(static_cast<_Type>(__value), __ctx, __specs);
@@ -60,47 +60,47 @@ public:
// Signed integral types.
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<signed char, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<signed char, _CharT>
: public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<short, _CharT> : public __formatter_integer<_CharT> {
+struct _LIBCPP_TEMPLATE_VIS formatter<short, _CharT> : public __formatter_integer<_CharT> {
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<int, _CharT> : public __formatter_integer<_CharT> {};
+struct _LIBCPP_TEMPLATE_VIS formatter<int, _CharT> : public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<long, _CharT> : public __formatter_integer<_CharT> {};
+struct _LIBCPP_TEMPLATE_VIS formatter<long, _CharT> : public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<long long, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<long long, _CharT>
: public __formatter_integer<_CharT> {};
# ifndef _LIBCPP_HAS_NO_INT128
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<__int128_t, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<__int128_t, _CharT>
: public __formatter_integer<_CharT> {};
# endif
// Unsigned integral types.
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned char, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<unsigned char, _CharT>
: public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned short, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<unsigned short, _CharT>
: public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<unsigned, _CharT>
: public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned long, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<unsigned long, _CharT>
: public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned long long, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<unsigned long long, _CharT>
: public __formatter_integer<_CharT> {};
# ifndef _LIBCPP_HAS_NO_INT128
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<__uint128_t, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<__uint128_t, _CharT>
: public __formatter_integer<_CharT> {};
# endif
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_integral.h b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_integral.h
index fe3a06311be..54246aa0271 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_integral.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_integral.h
@@ -10,6 +10,9 @@
#ifndef _LIBCPP___FORMAT_FORMATTER_INTEGRAL_H
#define _LIBCPP___FORMAT_FORMATTER_INTEGRAL_H
+#include <__charconv/to_chars_integral.h>
+#include <__charconv/to_chars_result.h>
+#include <__charconv/traits.h>
#include <__concepts/arithmetic.h>
#include <__concepts/same_as.h>
#include <__config>
@@ -17,11 +20,13 @@
#include <__format/format_error.h>
#include <__format/formatter_output.h>
#include <__format/parser_std_format_spec.h>
+#include <__system_error/errc.h>
+#include <__type_traits/make_unsigned.h>
#include <__utility/unreachable.h>
#include <array>
-#include <charconv>
#include <limits>
#include <string>
+#include <string_view>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <locale>
@@ -36,7 +41,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __formatter {
@@ -80,9 +85,9 @@ _LIBCPP_HIDE_FROM_ABI inline char* __insert_sign(char* __buf, bool __negative, _
* regardless whether the @c std::numpunct's type is @c char or @c wchar_t.
*/
_LIBCPP_HIDE_FROM_ABI inline string __determine_grouping(ptrdiff_t __size, const string& __grouping) {
- _LIBCPP_ASSERT(!__grouping.empty() && __size > __grouping[0],
- "The slow grouping formatting is used while there will be no "
- "separators written");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__grouping.empty() && __size > __grouping[0],
+ "The slow grouping formatting is used while there will be no "
+ "separators written");
string __r;
auto __end = __grouping.end() - 1;
auto __ptr = __grouping.begin();
@@ -149,7 +154,7 @@ _LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value
// TODO FMT Evaluate code overhead due to not calling the internal function
// directly. (Should be zero overhead.)
to_chars_result __r = _VSTD::to_chars(__first, __last, __value, __base);
- _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
return __r.ptr;
}
@@ -198,16 +203,82 @@ consteval size_t __buffer_size() noexcept
+ 1; // Reserve space for the sign.
}
-template <unsigned_integral _Tp, class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto __format_integer(
+template <class _OutIt, class _CharT>
+_LIBCPP_HIDE_FROM_ABI _OutIt __write_using_decimal_separators(_OutIt __out_it, const char* __begin, const char* __first,
+ const char* __last, string&& __grouping, _CharT __sep,
+ __format_spec::__parsed_specifications<_CharT> __specs) {
+ int __size = (__first - __begin) + // [sign][prefix]
+ (__last - __first) + // data
+ (__grouping.size() - 1); // number of separator characters
+
+ __padding_size_result __padding = {0, 0};
+ if (__specs.__alignment_ == __format_spec::__alignment::__zero_padding) {
+ // Write [sign][prefix].
+ __out_it = __formatter::__copy(__begin, __first, _VSTD::move(__out_it));
+
+ if (__specs.__width_ > __size) {
+ // Write zero padding.
+ __padding.__before_ = __specs.__width_ - __size;
+ __out_it = __formatter::__fill(_VSTD::move(__out_it), __specs.__width_ - __size, _CharT('0'));
+ }
+ } else {
+ if (__specs.__width_ > __size) {
+ // Determine padding and write padding.
+ __padding = __formatter::__padding_size(__size, __specs.__width_, __specs.__alignment_);
+
+ __out_it = __formatter::__fill(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
+ }
+ // Write [sign][prefix].
+ __out_it = __formatter::__copy(__begin, __first, _VSTD::move(__out_it));
+ }
+
+ auto __r = __grouping.rbegin();
+ auto __e = __grouping.rend() - 1;
+ _LIBCPP_ASSERT_UNCATEGORIZED(__r != __e, "The slow grouping formatting is used while "
+ "there will be no separators written.");
+ // The output is divided in small groups of numbers to write:
+ // - A group before the first separator.
+ // - A separator and a group, repeated for the number of separators.
+ // - A group after the last separator.
+ // This loop achieves that process by testing the termination condition
+ // midway in the loop.
+ //
+ // TODO FMT This loop evaluates the loop invariant `__parser.__type !=
+ // _Flags::_Type::__hexadecimal_upper_case` for every iteration. (This test
+ // happens in the __write call.) Benchmark whether making two loops and
+ // hoisting the invariant is worth the effort.
+ while (true) {
+ if (__specs.__std_.__type_ == __format_spec::__type::__hexadecimal_upper_case) {
+ __last = __first + *__r;
+ __out_it = __formatter::__transform(__first, __last, _VSTD::move(__out_it), __hex_to_upper);
+ __first = __last;
+ } else {
+ __out_it = __formatter::__copy(__first, *__r, _VSTD::move(__out_it));
+ __first += *__r;
+ }
+
+ if (__r == __e)
+ break;
+
+ ++__r;
+ *__out_it++ = __sep;
+ }
+
+ return __formatter::__fill(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
+}
+
+
+
+template <unsigned_integral _Tp, class _CharT, class _FormatContext>
+_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator __format_integer(
_Tp __value,
- auto& __ctx,
+ _FormatContext& __ctx,
__format_spec::__parsed_specifications<_CharT> __specs,
bool __negative,
char* __begin,
char* __end,
const char* __prefix,
- int __base) -> decltype(__ctx.out()) {
+ int __base) {
char* __first = __formatter::__insert_sign(__begin, __negative, __specs.__std_.__sign_);
if (__specs.__std_.__alternate_form_ && __prefix)
while (*__prefix)
@@ -246,7 +317,7 @@ _LIBCPP_HIDE_FROM_ABI auto __format_integer(
// - Write data right aligned with '0' as fill character.
__out_it = __formatter::__copy(__begin, __first, _VSTD::move(__out_it));
__specs.__alignment_ = __format_spec::__alignment::__right;
- __specs.__fill_ = _CharT('0');
+ __specs.__fill_.__data[0] = _CharT('0');
int32_t __size = __first - __begin;
__specs.__width_ -= _VSTD::min(__size, __specs.__width_);
@@ -258,10 +329,12 @@ _LIBCPP_HIDE_FROM_ABI auto __format_integer(
return __formatter::__write_transformed(__first, __last, __ctx.out(), __specs, __formatter::__hex_to_upper);
}
-template <unsigned_integral _Tp, class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto __format_integer(
- _Tp __value, auto& __ctx, __format_spec::__parsed_specifications<_CharT> __specs, bool __negative = false)
- -> decltype(__ctx.out()) {
+template <unsigned_integral _Tp, class _CharT, class _FormatContext>
+_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
+__format_integer(_Tp __value,
+ _FormatContext& __ctx,
+ __format_spec::__parsed_specifications<_CharT> __specs,
+ bool __negative = false) {
switch (__specs.__std_.__type_) {
case __format_spec::__type::__binary_lower_case: {
array<char, __formatter::__buffer_size<decltype(__value), 2>()> __array;
@@ -292,15 +365,14 @@ _LIBCPP_HIDE_FROM_ABI auto __format_integer(
return __formatter::__format_integer(__value, __ctx, __specs, __negative, __array.begin(), __array.end(), "0X", 16);
}
default:
- _LIBCPP_ASSERT(false, "The parse function should have validated the type");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "The parse function should have validated the type");
__libcpp_unreachable();
}
}
-template <signed_integral _Tp, class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto
-__format_integer(_Tp __value, auto& __ctx, __format_spec::__parsed_specifications<_CharT> __specs)
- -> decltype(__ctx.out()) {
+template <signed_integral _Tp, class _CharT, class _FormatContext>
+_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
+__format_integer(_Tp __value, _FormatContext& __ctx, __format_spec::__parsed_specifications<_CharT> __specs) {
// Depending on the std-format-spec string the sign and the value
// might not be outputted together:
// - alternate form may insert a prefix string.
@@ -336,10 +408,9 @@ struct _LIBCPP_TEMPLATE_VIS __bool_strings<wchar_t> {
};
# endif
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto
-__format_bool(bool __value, auto& __ctx, __format_spec::__parsed_specifications<_CharT> __specs)
- -> decltype(__ctx.out()) {
+template <class _CharT, class _FormatContext>
+_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
+__format_bool(bool __value, _FormatContext& __ctx, __format_spec::__parsed_specifications<_CharT> __specs) {
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
if (__specs.__std_.__locale_specific_form_) {
const auto& __np = std::use_facet<numpunct<_CharT>>(__ctx.locale());
@@ -354,7 +425,7 @@ __format_bool(bool __value, auto& __ctx, __format_spec::__parsed_specifications<
} // namespace __formatter
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_output.h b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_output.h
index 467692559ce..072305b6dbc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_output.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_output.h
@@ -13,22 +13,21 @@
#include <__algorithm/ranges_copy.h>
#include <__algorithm/ranges_fill_n.h>
#include <__algorithm/ranges_transform.h>
-#include <__chrono/statically_widen.h>
+#include <__bit/countl.h>
#include <__concepts/same_as.h>
#include <__config>
#include <__format/buffer.h>
#include <__format/concepts.h>
-#include <__format/escaped_output_table.h>
#include <__format/formatter.h>
#include <__format/parser_std_format_spec.h>
#include <__format/unicode.h>
#include <__iterator/back_insert_iterator.h>
-#include <__type_traits/make_unsigned.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h> // iter_value_t
+#include <__memory/addressof.h>
#include <__utility/move.h>
#include <__utility/unreachable.h>
-#include <charconv>
#include <cstddef>
-#include <string>
#include <string_view>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -37,7 +36,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __formatter {
@@ -59,15 +58,15 @@ _LIBCPP_HIDE_FROM_ABI constexpr char __hex_to_upper(char __c) {
return __c;
}
-struct _LIBCPP_TYPE_VIS __padding_size_result {
+struct _LIBCPP_EXPORTED_FROM_ABI __padding_size_result {
size_t __before_;
size_t __after_;
};
_LIBCPP_HIDE_FROM_ABI constexpr __padding_size_result
__padding_size(size_t __size, size_t __width, __format_spec::__alignment __align) {
- _LIBCPP_ASSERT(__width > __size, "don't call this function when no padding is required");
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(__width > __size, "don't call this function when no padding is required");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__align != __format_spec::__alignment::__zero_padding, "the caller should have handled the zero-padding");
size_t __fill = __width - __size;
@@ -161,69 +160,45 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, _CharT __value)
}
}
-template <class _OutIt, class _CharT>
-_LIBCPP_HIDE_FROM_ABI _OutIt __write_using_decimal_separators(_OutIt __out_it, const char* __begin, const char* __first,
- const char* __last, string&& __grouping, _CharT __sep,
- __format_spec::__parsed_specifications<_CharT> __specs) {
- int __size = (__first - __begin) + // [sign][prefix]
- (__last - __first) + // data
- (__grouping.size() - 1); // number of separator characters
-
- __padding_size_result __padding = {0, 0};
- if (__specs.__alignment_ == __format_spec::__alignment::__zero_padding) {
- // Write [sign][prefix].
- __out_it = __formatter::__copy(__begin, __first, _VSTD::move(__out_it));
-
- if (__specs.__width_ > __size) {
- // Write zero padding.
- __padding.__before_ = __specs.__width_ - __size;
- __out_it = __formatter::__fill(_VSTD::move(__out_it), __specs.__width_ - __size, _CharT('0'));
- }
- } else {
- if (__specs.__width_ > __size) {
- // Determine padding and write padding.
- __padding = __formatter::__padding_size(__size, __specs.__width_, __specs.__alignment_);
-
- __out_it = __formatter::__fill(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
- }
- // Write [sign][prefix].
- __out_it = __formatter::__copy(__begin, __first, _VSTD::move(__out_it));
- }
+# ifndef _LIBCPP_HAS_NO_UNICODE
+template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>
+ requires(same_as<_CharT, char>)
+_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::__code_point<_CharT> __value) {
+ std::size_t __bytes = std::countl_one(static_cast<unsigned char>(__value.__data[0]));
+ if (__bytes == 0)
+ return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);
+
+ for (size_t __i = 0; __i < __n; ++__i)
+ __out_it = __formatter::__copy(
+ std::addressof(__value.__data[0]), std::addressof(__value.__data[0]) + __bytes, std::move(__out_it));
+ return __out_it;
+}
- auto __r = __grouping.rbegin();
- auto __e = __grouping.rend() - 1;
- _LIBCPP_ASSERT(__r != __e, "The slow grouping formatting is used while "
- "there will be no separators written.");
- // The output is divided in small groups of numbers to write:
- // - A group before the first separator.
- // - A separator and a group, repeated for the number of separators.
- // - A group after the last separator.
- // This loop achieves that process by testing the termination condition
- // midway in the loop.
- //
- // TODO FMT This loop evaluates the loop invariant `__parser.__type !=
- // _Flags::_Type::__hexadecimal_upper_case` for every iteration. (This test
- // happens in the __write call.) Benchmark whether making two loops and
- // hoisting the invariant is worth the effort.
- while (true) {
- if (__specs.__std_.__type_ == __format_spec::__type::__hexadecimal_upper_case) {
- __last = __first + *__r;
- __out_it = __formatter::__transform(__first, __last, _VSTD::move(__out_it), __hex_to_upper);
- __first = __last;
- } else {
- __out_it = __formatter::__copy(__first, *__r, _VSTD::move(__out_it));
- __first += *__r;
- }
-
- if (__r == __e)
- break;
-
- ++__r;
- *__out_it++ = __sep;
- }
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>
+ requires(same_as<_CharT, wchar_t> && sizeof(wchar_t) == 2)
+_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::__code_point<_CharT> __value) {
+ if (!__unicode::__is_high_surrogate(__value.__data[0]))
+ return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);
+
+ for (size_t __i = 0; __i < __n; ++__i)
+ __out_it = __formatter::__copy(
+ std::addressof(__value.__data[0]), std::addressof(__value.__data[0]) + 2, std::move(__out_it));
+ return __out_it;
+}
- return __formatter::__fill(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
+template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>
+ requires(same_as<_CharT, wchar_t> && sizeof(wchar_t) == 4)
+_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::__code_point<_CharT> __value) {
+ return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);
}
+# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+# else // _LIBCPP_HAS_NO_UNICODE
+template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>
+_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::__code_point<_CharT> __value) {
+ return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);
+}
+# endif // _LIBCPP_HAS_NO_UNICODE
/// Writes the input to the output with the required padding.
///
@@ -261,27 +236,27 @@ __write(basic_string_view<_CharT> __str,
return __formatter::__fill(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
}
-template <class _CharT, class _ParserCharT>
+template <contiguous_iterator _Iterator, class _ParserCharT>
_LIBCPP_HIDE_FROM_ABI auto
-__write(const _CharT* __first,
- const _CharT* __last,
- output_iterator<const _CharT&> auto __out_it,
+__write(_Iterator __first,
+ _Iterator __last,
+ output_iterator<const iter_value_t<_Iterator>&> auto __out_it,
__format_spec::__parsed_specifications<_ParserCharT> __specs,
ptrdiff_t __size) -> decltype(__out_it) {
- _LIBCPP_ASSERT(__first <= __last, "Not a valid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "Not a valid range");
return __formatter::__write(basic_string_view{__first, __last}, _VSTD::move(__out_it), __specs, __size);
}
/// \overload
///
/// Calls the function above where \a __size = \a __last - \a __first.
-template <class _CharT, class _ParserCharT>
+template <contiguous_iterator _Iterator, class _ParserCharT>
_LIBCPP_HIDE_FROM_ABI auto
-__write(const _CharT* __first,
- const _CharT* __last,
- output_iterator<const _CharT&> auto __out_it,
+__write(_Iterator __first,
+ _Iterator __last,
+ output_iterator<const iter_value_t<_Iterator>&> auto __out_it,
__format_spec::__parsed_specifications<_ParserCharT> __specs) -> decltype(__out_it) {
- _LIBCPP_ASSERT(__first <= __last, "Not a valid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "Not a valid range");
return __formatter::__write(__first, __last, _VSTD::move(__out_it), __specs, __last - __first);
}
@@ -290,7 +265,7 @@ _LIBCPP_HIDE_FROM_ABI auto __write_transformed(const _CharT* __first, const _Cha
output_iterator<const _CharT&> auto __out_it,
__format_spec::__parsed_specifications<_ParserCharT> __specs,
_UnaryOperation __op) -> decltype(__out_it) {
- _LIBCPP_ASSERT(__first <= __last, "Not a valid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "Not a valid range");
ptrdiff_t __size = __last - __first;
if (__size >= __specs.__width_)
@@ -302,35 +277,6 @@ _LIBCPP_HIDE_FROM_ABI auto __write_transformed(const _CharT* __first, const _Cha
return __formatter::__fill(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
}
-/// Writes additional zero's for the precision before the exponent.
-/// This is used when the precision requested in the format string is larger
-/// than the maximum precision of the floating-point type. These precision
-/// digits are always 0.
-///
-/// \param __exponent The location of the exponent character.
-/// \param __num_trailing_zeros The number of 0's to write before the exponent
-/// character.
-template <class _CharT, class _ParserCharT>
-_LIBCPP_HIDE_FROM_ABI auto __write_using_trailing_zeros(
- const _CharT* __first,
- const _CharT* __last,
- output_iterator<const _CharT&> auto __out_it,
- __format_spec::__parsed_specifications<_ParserCharT> __specs,
- size_t __size,
- const _CharT* __exponent,
- size_t __num_trailing_zeros) -> decltype(__out_it) {
- _LIBCPP_ASSERT(__first <= __last, "Not a valid range");
- _LIBCPP_ASSERT(__num_trailing_zeros > 0, "The overload not writing trailing zeros should have been used");
-
- __padding_size_result __padding =
- __formatter::__padding_size(__size + __num_trailing_zeros, __specs.__width_, __specs.__alignment_);
- __out_it = __formatter::__fill(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
- __out_it = __formatter::__copy(__first, __exponent, _VSTD::move(__out_it));
- __out_it = __formatter::__fill(_VSTD::move(__out_it), __num_trailing_zeros, _CharT('0'));
- __out_it = __formatter::__copy(__exponent, __last, _VSTD::move(__out_it));
- return __formatter::__fill(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
-}
-
/// Writes a string using format's width estimation algorithm.
///
/// \pre !__specs.__has_precision()
@@ -342,7 +288,7 @@ _LIBCPP_HIDE_FROM_ABI auto __write_string_no_precision(
basic_string_view<_CharT> __str,
output_iterator<const _CharT&> auto __out_it,
__format_spec::__parsed_specifications<_CharT> __specs) -> decltype(__out_it) {
- _LIBCPP_ASSERT(!__specs.__has_precision(), "use __write_string");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__specs.__has_precision(), "use __write_string");
// No padding -> copy the string
if (!__specs.__has_width())
@@ -359,211 +305,15 @@ _LIBCPP_HIDE_FROM_ABI auto __write_string_no_precision(
template <class _CharT>
_LIBCPP_HIDE_FROM_ABI int __truncate(basic_string_view<_CharT>& __str, int __precision) {
- __format_spec::__column_width_result<_CharT> __result =
+ __format_spec::__column_width_result __result =
__format_spec::__estimate_column_width(__str, __precision, __format_spec::__column_width_rounding::__down);
__str = basic_string_view<_CharT>{__str.begin(), __result.__last_};
return __result.__width_;
}
-/// Writes a string using format's width estimation algorithm.
-///
-/// \note When \c _LIBCPP_HAS_NO_UNICODE is defined the function assumes the
-/// input is ASCII.
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto __write_string(
- basic_string_view<_CharT> __str,
- output_iterator<const _CharT&> auto __out_it,
- __format_spec::__parsed_specifications<_CharT> __specs) -> decltype(__out_it) {
- if (!__specs.__has_precision())
- return __formatter::__write_string_no_precision(__str, _VSTD::move(__out_it), __specs);
-
- int __size = __formatter::__truncate(__str, __specs.__precision_);
-
- return __formatter::__write(__str.begin(), __str.end(), _VSTD::move(__out_it), __specs, __size);
-}
-
-# if _LIBCPP_STD_VER > 20
-
-struct __nul_terminator {};
-
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI bool operator==(const _CharT* __cstr, __nul_terminator) {
- return *__cstr == _CharT('\0');
-}
-
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI void
-__write_escaped_code_unit(basic_string<_CharT>& __str, char32_t __value, const _CharT* __prefix) {
- back_insert_iterator __out_it{__str};
- std::ranges::copy(__prefix, __nul_terminator{}, __out_it);
-
- char __buffer[8];
- to_chars_result __r = std::to_chars(std::begin(__buffer), std::end(__buffer), __value, 16);
- _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
- std::ranges::copy(std::begin(__buffer), __r.ptr, __out_it);
-
- __str += _CharT('}');
-}
-
-// [format.string.escaped]/2.2.1.2
-// ...
-// then the sequence \u{hex-digit-sequence} is appended to E, where
-// hex-digit-sequence is the shortest hexadecimal representation of C using
-// lower-case hexadecimal digits.
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI void __write_well_formed_escaped_code_unit(basic_string<_CharT>& __str, char32_t __value) {
- __formatter::__write_escaped_code_unit(__str, __value, _LIBCPP_STATICALLY_WIDEN(_CharT, "\\u{"));
-}
-
-// [format.string.escaped]/2.2.3
-// Otherwise (X is a sequence of ill-formed code units), each code unit U is
-// appended to E in order as the sequence \x{hex-digit-sequence}, where
-// hex-digit-sequence is the shortest hexadecimal representation of U using
-// lower-case hexadecimal digits.
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI void __write_escape_ill_formed_code_unit(basic_string<_CharT>& __str, char32_t __value) {
- __formatter::__write_escaped_code_unit(__str, __value, _LIBCPP_STATICALLY_WIDEN(_CharT, "\\x{"));
-}
-
-template <class _CharT>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool __is_escaped_sequence_written(basic_string<_CharT>& __str, char32_t __value) {
-# ifdef _LIBCPP_HAS_NO_UNICODE
- // For ASCII assume everything above 127 is printable.
- if (__value > 127)
- return false;
-# endif
-
- if (!__escaped_output_table::__needs_escape(__value))
- return false;
-
- __formatter::__write_well_formed_escaped_code_unit(__str, __value);
- return true;
-}
-
-template <class _CharT>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr char32_t __to_char32(_CharT __value) {
- return static_cast<make_unsigned_t<_CharT>>(__value);
-}
-
-enum class _LIBCPP_ENUM_VIS __escape_quotation_mark { __apostrophe, __double_quote };
-
-// [format.string.escaped]/2
-template <class _CharT>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool
-__is_escaped_sequence_written(basic_string<_CharT>& __str, char32_t __value, __escape_quotation_mark __mark) {
- // 2.2.1.1 - Mapped character in [tab:format.escape.sequences]
- switch (__value) {
- case _CharT('\t'):
- __str += _LIBCPP_STATICALLY_WIDEN(_CharT, "\\t");
- return true;
- case _CharT('\n'):
- __str += _LIBCPP_STATICALLY_WIDEN(_CharT, "\\n");
- return true;
- case _CharT('\r'):
- __str += _LIBCPP_STATICALLY_WIDEN(_CharT, "\\r");
- return true;
- case _CharT('\''):
- if (__mark == __escape_quotation_mark::__apostrophe)
- __str += _LIBCPP_STATICALLY_WIDEN(_CharT, R"(\')");
- else
- __str += __value;
- return true;
- case _CharT('"'):
- if (__mark == __escape_quotation_mark::__double_quote)
- __str += _LIBCPP_STATICALLY_WIDEN(_CharT, R"(\")");
- else
- __str += __value;
- return true;
- case _CharT('\\'):
- __str += _LIBCPP_STATICALLY_WIDEN(_CharT, R"(\\)");
- return true;
-
- // 2.2.1.2 - Space
- case _CharT(' '):
- __str += __value;
- return true;
- }
-
- // 2.2.2
- // Otherwise, if X is a shift sequence, the effect on E and further
- // decoding of S is unspecified.
- // For now shift sequences are ignored and treated as Unicode. Other parts
- // of the format library do the same. It's unknown how ostream treats them.
- // TODO FMT determine what to do with shift sequences.
-
- // 2.2.1.2.1 and 2.2.1.2.2 - Escape
- return __formatter::__is_escaped_sequence_written(__str, __formatter::__to_char32(__value));
-}
-
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI void
-__escape(basic_string<_CharT>& __str, basic_string_view<_CharT> __values, __escape_quotation_mark __mark) {
- __unicode::__code_point_view<_CharT> __view{__values.begin(), __values.end()};
-
- while (!__view.__at_end()) {
- const _CharT* __first = __view.__position();
- typename __unicode::__consume_p2286_result __result = __view.__consume_p2286();
- if (__result.__ill_formed_size == 0) {
- if (!__formatter::__is_escaped_sequence_written(__str, __result.__value, __mark))
- // 2.2.1.3 - Add the character
- ranges::copy(__first, __view.__position(), std::back_insert_iterator(__str));
-
- } else {
- // 2.2.3 sequence of ill-formed code units
- // The number of code-units in __result.__value depends on the character type being used.
- if constexpr (sizeof(_CharT) == 1) {
- _LIBCPP_ASSERT(__result.__ill_formed_size == 1 || __result.__ill_formed_size == 4,
- "illegal number of invalid code units.");
- if (__result.__ill_formed_size == 1) // ill-formed, one code unit
- __formatter::__write_escape_ill_formed_code_unit(__str, __result.__value & 0xff);
- else { // out of valid range, four code units
- // The code point was properly encoded, decode the value.
- __formatter::__write_escape_ill_formed_code_unit(__str, __result.__value >> 18 | 0xf0);
- __formatter::__write_escape_ill_formed_code_unit(__str, (__result.__value >> 12 & 0x3f) | 0x80);
- __formatter::__write_escape_ill_formed_code_unit(__str, (__result.__value >> 6 & 0x3f) | 0x80);
- __formatter::__write_escape_ill_formed_code_unit(__str, (__result.__value & 0x3f) | 0x80);
- }
- } else if constexpr (sizeof(_CharT) == 2) {
- _LIBCPP_ASSERT(__result.__ill_formed_size == 1, "for UTF-16 at most one invalid code unit");
- __formatter::__write_escape_ill_formed_code_unit(__str, __result.__value & 0xffff);
- } else {
- static_assert(sizeof(_CharT) == 4, "unsupported character width");
- _LIBCPP_ASSERT(__result.__ill_formed_size == 1, "for UTF-32 one code unit is one code point");
- __formatter::__write_escape_ill_formed_code_unit(__str, __result.__value);
- }
- }
- }
-}
-
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto
-__format_escaped_char(_CharT __value,
- output_iterator<const _CharT&> auto __out_it,
- __format_spec::__parsed_specifications<_CharT> __specs) -> decltype(__out_it) {
- basic_string<_CharT> __str;
- __str += _CharT('\'');
- __formatter::__escape(__str, basic_string_view{std::addressof(__value), 1}, __escape_quotation_mark::__apostrophe);
- __str += _CharT('\'');
- return __formatter::__write(__str.data(), __str.data() + __str.size(), _VSTD::move(__out_it), __specs, __str.size());
-}
-
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto
-__format_escaped_string(basic_string_view<_CharT> __values,
- output_iterator<const _CharT&> auto __out_it,
- __format_spec::__parsed_specifications<_CharT> __specs) -> decltype(__out_it) {
- basic_string<_CharT> __str;
- __str += _CharT('"');
- __formatter::__escape(__str, __values, __escape_quotation_mark::__double_quote);
- __str += _CharT('"');
- return __formatter::__write_string(basic_string_view{__str}, _VSTD::move(__out_it), __specs);
-}
-
-# endif // _LIBCPP_STD_VER > 20
-
} // namespace __formatter
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_pointer.h b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_pointer.h
index 31b49e17ab4..a2212611df4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_pointer.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_pointer.h
@@ -27,24 +27,27 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <__fmt_char_type _CharT>
struct _LIBCPP_TEMPLATE_VIS __formatter_pointer {
public:
- constexpr __formatter_pointer() { __parser_.__alignment_ = __format_spec::__alignment::__right; }
-
- _LIBCPP_HIDE_FROM_ABI constexpr auto
- parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) {
- auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_pointer);
- __format_spec::__process_display_type_pointer(__parser_.__type_);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ typename _ParseContext::iterator __result = __parser_.__parse(__ctx, __format_spec::__fields_pointer);
+ __format_spec::__process_display_type_pointer(__parser_.__type_, "a pointer");
return __result;
}
- _LIBCPP_HIDE_FROM_ABI auto format(const void* __ptr, auto& __ctx) const -> decltype(__ctx.out()) {
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(const void* __ptr, _FormatContext& __ctx) const {
__format_spec::__parsed_specifications<_CharT> __specs = __parser_.__get_parsed_std_specifications(__ctx);
__specs.__std_.__alternate_form_ = true;
- __specs.__std_.__type_ = __format_spec::__type::__hexadecimal_lower_case;
+ __specs.__std_.__type_ =
+ __specs.__std_.__type_ == __format_spec::__type::__pointer_upper_case
+ ? __format_spec::__type::__hexadecimal_upper_case
+ : __format_spec::__type::__hexadecimal_lower_case;
+
return __formatter::__format_integer(reinterpret_cast<uintptr_t>(__ptr), __ctx, __specs);
}
@@ -57,16 +60,16 @@ public:
// - template<> struct formatter<void*, charT>;
// - template<> struct formatter<const void*, charT>;
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<nullptr_t, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<nullptr_t, _CharT>
: public __formatter_pointer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<void*, _CharT> : public __formatter_pointer<_CharT> {
+struct _LIBCPP_TEMPLATE_VIS formatter<void*, _CharT> : public __formatter_pointer<_CharT> {
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<const void*, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<const void*, _CharT>
: public __formatter_pointer<_CharT> {};
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_string.h b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_string.h
index 606fb792499..ba64a64af80 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_string.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_string.h
@@ -17,7 +17,7 @@
#include <__format/formatter.h>
#include <__format/formatter_output.h>
#include <__format/parser_std_format_spec.h>
-#include <__utility/move.h>
+#include <__format/write_escaped.h>
#include <string>
#include <string_view>
@@ -27,20 +27,22 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <__fmt_char_type _CharT>
struct _LIBCPP_TEMPLATE_VIS __formatter_string {
public:
- _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
- -> decltype(__parse_ctx.begin()) {
- auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_string);
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ typename _ParseContext::iterator __result = __parser_.__parse(__ctx, __format_spec::__fields_string);
__format_spec::__process_display_type_string(__parser_.__type_);
return __result;
}
- _LIBCPP_HIDE_FROM_ABI auto format(basic_string_view<_CharT> __str, auto& __ctx) const -> decltype(__ctx.out()) {
-# if _LIBCPP_STD_VER > 20
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
+ format(basic_string_view<_CharT> __str, _FormatContext& __ctx) const {
+# if _LIBCPP_STD_VER >= 23
if (__parser_.__type_ == __format_spec::__type::__debug)
return __formatter::__format_escaped_string(__str, __ctx.out(), __parser_.__get_parsed_std_specifications(__ctx));
# endif
@@ -48,7 +50,7 @@ public:
return __formatter::__write_string(__str, __ctx.out(), __parser_.__get_parsed_std_specifications(__ctx));
}
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr void set_debug_format() { __parser_.__type_ = __format_spec::__type::__debug; }
# endif
@@ -57,16 +59,17 @@ public:
// Formatter const char*.
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<const _CharT*, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<const _CharT*, _CharT>
: public __formatter_string<_CharT> {
using _Base = __formatter_string<_CharT>;
- _LIBCPP_HIDE_FROM_ABI auto format(const _CharT* __str, auto& __ctx) const -> decltype(__ctx.out()) {
- _LIBCPP_ASSERT(__str, "The basic_format_arg constructor should have "
- "prevented an invalid pointer.");
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(const _CharT* __str, _FormatContext& __ctx) const {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__str, "The basic_format_arg constructor should have "
+ "prevented an invalid pointer.");
__format_spec::__parsed_specifications<_CharT> __specs = _Base::__parser_.__get_parsed_std_specifications(__ctx);
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
if (_Base::__parser_.__type_ == __format_spec::__type::__debug)
return __formatter::__format_escaped_string(basic_string_view<_CharT>{__str}, __ctx.out(), __specs);
# endif
@@ -95,45 +98,38 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<const _CharT*,
// Formatter char*.
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<_CharT*, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<_CharT*, _CharT>
: public formatter<const _CharT*, _CharT> {
using _Base = formatter<const _CharT*, _CharT>;
- _LIBCPP_HIDE_FROM_ABI auto format(_CharT* __str, auto& __ctx) const -> decltype(__ctx.out()) {
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(_CharT* __str, _FormatContext& __ctx) const {
return _Base::format(__str, __ctx);
}
};
// Formatter char[].
template <__fmt_char_type _CharT, size_t _Size>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<_CharT[_Size], _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<_CharT[_Size], _CharT>
: public __formatter_string<_CharT> {
using _Base = __formatter_string<_CharT>;
- _LIBCPP_HIDE_FROM_ABI auto format(_CharT __str[_Size], auto& __ctx) const -> decltype(__ctx.out()) {
- return _Base::format(basic_string_view<_CharT>(__str, _Size), __ctx);
- }
-};
-
-// Formatter const char[].
-template <__fmt_char_type _CharT, size_t _Size>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<const _CharT[_Size], _CharT>
- : public __formatter_string<_CharT> {
- using _Base = __formatter_string<_CharT>;
-
- _LIBCPP_HIDE_FROM_ABI auto format(const _CharT __str[_Size], auto& __ctx) const -> decltype(__ctx.out()) {
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
+ format(const _CharT (&__str)[_Size], _FormatContext& __ctx) const {
return _Base::format(basic_string_view<_CharT>(__str, _Size), __ctx);
}
};
// Formatter std::string.
template <__fmt_char_type _CharT, class _Traits, class _Allocator>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<basic_string<_CharT, _Traits, _Allocator>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<basic_string<_CharT, _Traits, _Allocator>, _CharT>
: public __formatter_string<_CharT> {
using _Base = __formatter_string<_CharT>;
- _LIBCPP_HIDE_FROM_ABI auto format(const basic_string<_CharT, _Traits, _Allocator>& __str, auto& __ctx) const
- -> decltype(__ctx.out()) {
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
+ format(const basic_string<_CharT, _Traits, _Allocator>& __str, _FormatContext& __ctx) const {
// Drop _Traits and _Allocator to have one std::basic_string formatter.
return _Base::format(basic_string_view<_CharT>(__str.data(), __str.size()), __ctx);
}
@@ -141,18 +137,19 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<basic_string<_
// Formatter std::string_view.
template <__fmt_char_type _CharT, class _Traits>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<basic_string_view<_CharT, _Traits>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<basic_string_view<_CharT, _Traits>, _CharT>
: public __formatter_string<_CharT> {
using _Base = __formatter_string<_CharT>;
- _LIBCPP_HIDE_FROM_ABI auto format(basic_string_view<_CharT, _Traits> __str, auto& __ctx) const
- -> decltype(__ctx.out()) {
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
+ format(basic_string_view<_CharT, _Traits> __str, _FormatContext& __ctx) const {
// Drop _Traits to have one std::basic_string_view formatter.
return _Base::format(basic_string_view<_CharT>(__str.data(), __str.size()), __ctx);
}
};
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_tuple.h b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_tuple.h
index 82f5ada6e01..030097a8797 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/formatter_tuple.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/formatter_tuple.h
@@ -11,18 +11,16 @@
#define _LIBCPP___FORMAT_FORMATTER_TUPLE_H
#include <__algorithm/ranges_copy.h>
-#include <__availability>
#include <__chrono/statically_widen.h>
#include <__config>
+#include <__format/buffer.h>
#include <__format/concepts.h>
-#include <__format/format_args.h>
#include <__format/format_context.h>
#include <__format/format_error.h>
#include <__format/format_parse_context.h>
#include <__format/formatter.h>
#include <__format/formatter_output.h>
#include <__format/parser_std_format_spec.h>
-#include <__iterator/back_insert_iterator.h>
#include <__type_traits/remove_cvref.h>
#include <__utility/integer_sequence.h>
#include <__utility/pair.h>
@@ -35,49 +33,52 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <__fmt_char_type _CharT, class _Tuple, formattable<_CharT>... _Args>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_tuple {
- _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) {
+struct _LIBCPP_TEMPLATE_VIS __formatter_tuple {
+ _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) noexcept {
__separator_ = __separator;
}
_LIBCPP_HIDE_FROM_ABI constexpr void
- set_brackets(basic_string_view<_CharT> __opening_bracket, basic_string_view<_CharT> __closing_bracket) {
+ set_brackets(basic_string_view<_CharT> __opening_bracket, basic_string_view<_CharT> __closing_bracket) noexcept {
__opening_bracket_ = __opening_bracket;
__closing_bracket_ = __closing_bracket;
}
template <class _ParseContext>
- _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __parse_ctx) {
- const _CharT* __begin = __parser_.__parse(__parse_ctx, __format_spec::__fields_tuple);
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ auto __begin = __parser_.__parse(__ctx, __format_spec::__fields_tuple);
- // [format.tuple]/7
- // ... For each element e in underlying_, if e.set_debug_format()
- // is a valid expression, calls e.set_debug_format().
- // TODO FMT this can be removed when P2733 is accepted.
- std::__for_each_index_sequence(make_index_sequence<sizeof...(_Args)>(), [&]<size_t _Index> {
- std::__set_debug_format(std::get<_Index>(__underlying_));
- });
-
- const _CharT* __end = __parse_ctx.end();
- if (__begin == __end)
- return __begin;
-
- if (*__begin == _CharT('m')) {
+ auto __end = __ctx.end();
+ // Note 'n' is part of the type here
+ if (__parser_.__clear_brackets_)
+ set_brackets({}, {});
+ else if (__begin != __end && *__begin == _CharT('m')) {
if constexpr (sizeof...(_Args) == 2) {
set_separator(_LIBCPP_STATICALLY_WIDEN(_CharT, ": "));
set_brackets({}, {});
++__begin;
} else
- std::__throw_format_error("The format specifier m requires a pair or a two-element tuple");
- } else if (*__begin == _CharT('n')) {
- set_brackets({}, {});
- ++__begin;
+ std::__throw_format_error("Type m requires a pair or a tuple with two elements");
}
if (__begin != __end && *__begin != _CharT('}'))
- std::__throw_format_error("The format-spec should consume the input or end with a '}'");
+ std::__throw_format_error("The format specifier should consume the input or end with a '}'");
+
+ __ctx.advance_to(__begin);
+
+ // [format.tuple]/7
+ // ... For each element e in underlying_, if e.set_debug_format()
+ // is a valid expression, calls e.set_debug_format().
+ std::__for_each_index_sequence(make_index_sequence<sizeof...(_Args)>(), [&]<size_t _Index> {
+ auto& __formatter = std::get<_Index>(__underlying_);
+ __formatter.parse(__ctx);
+ // Unlike the range_formatter we don't guard against evil parsers. Since
+ // this format-spec never has a format-spec for the underlying type
+ // adding the test would give additional overhead.
+ std::__set_debug_format(__formatter);
+ });
return __begin;
}
@@ -91,26 +92,25 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_tuple {
if (!__specs.__has_width())
return __format_tuple(__tuple, __ctx);
- basic_string<_CharT> __str;
-
- // Since the output is written to a different iterator a new context is
- // created. Since the underlying formatter uses the default formatting it
- // doesn't need a locale or the formatting arguments. So creating a new
- // context works.
- //
- // This solution works for this formatter, but it will not work for the
- // range_formatter. In that patch a generic solution is work in progress.
- // Once that is finished it can be used here. (The range_formatter will use
- // these features so it's easier to add it there and then port it.)
- //
- // TODO FMT Use formatting wrapping used in the range_formatter.
- basic_format_context __c = std::__format_context_create(
- back_insert_iterator{__str},
- basic_format_args<basic_format_context<back_insert_iterator<basic_string<_CharT>>, _CharT>>{});
+ // The size of the buffer needed is:
+ // - open bracket characters
+ // - close bracket character
+ // - n elements where every element may have a different size
+ // - (n -1) separators
+ // The size of the element is hard to predict, knowing the type helps but
+ // it depends on the format-spec. As an initial estimate we guess 6
+ // characters.
+ // Typically both brackets are 1 character and the separator is 2
+ // characters. Which means there will be
+ // (n - 1) * 2 + 1 + 1 = n * 2 character
+ // So estimate 8 times the range size as buffer.
+ __format::__retarget_buffer<_CharT> __buffer{8 * tuple_size_v<_Tuple>};
+ basic_format_context<typename __format::__retarget_buffer<_CharT>::__iterator, _CharT> __c{
+ __buffer.__make_output_iterator(), __ctx};
__format_tuple(__tuple, __c);
- return __formatter::__write_string_no_precision(basic_string_view{__str}, __ctx.out(), __specs);
+ return __formatter::__write_string_no_precision(basic_string_view{__buffer.__view()}, __ctx.out(), __specs);
}
template <class _FormatContext>
@@ -120,35 +120,7 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_tuple {
std::__for_each_index_sequence(make_index_sequence<sizeof...(_Args)>(), [&]<size_t _Index> {
if constexpr (_Index)
__ctx.advance_to(std::ranges::copy(__separator_, __ctx.out()).out);
-
- // During review Victor suggested to make the exposition only
- // __underlying_ member a local variable. Currently the Standard
- // requires nested debug-enabled formatter specializations not to
- // output escaped output. P2733 fixes that bug, once accepted the
- // code below can be used.
- // (Note when a paper allows parsing a tuple-underlying-spec the
- // exposition only member needs to be a class member. Earlier
- // revisions of P2286 proposed that, but this was not pursued,
- // due to time constrains and complexity of the matter.)
- // TODO FMT This can be updated after P2733 is accepted.
-# if 0
- // P2286 uses an exposition only member in the formatter
- // tuple<formatter<remove_cvref_t<_Args>, _CharT>...> __underlying_;
- // This was used in earlier versions of the paper since
- // __underlying_.parse(...) was called. This is no longer the case
- // so we can reduce the scope of the formatter.
- //
- // It does require the underlying's parse effect to be moved here too.
- using _Arg = tuple_element<_Index, decltype(__tuple)>;
- formatter<remove_cvref_t<_Args>, _CharT> __underlying;
-
- // [format.tuple]/7
- // ... For each element e in underlying_, if e.set_debug_format()
- // is a valid expression, calls e.set_debug_format().
- std::__set_debug_format(__underlying);
-# else
__ctx.advance_to(std::get<_Index>(__underlying_).format(std::get<_Index>(__tuple), __ctx));
-# endif
});
return std::ranges::copy(__closing_bracket_, __ctx.out()).out;
@@ -164,14 +136,14 @@ private:
};
template <__fmt_char_type _CharT, formattable<_CharT>... _Args>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<pair<_Args...>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<pair<_Args...>, _CharT>
: public __formatter_tuple<_CharT, pair<_Args...>, _Args...> {};
template <__fmt_char_type _CharT, formattable<_CharT>... _Args>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<tuple<_Args...>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<tuple<_Args...>, _CharT>
: public __formatter_tuple<_CharT, tuple<_Args...>, _Args...> {};
-#endif //_LIBCPP_STD_VER > 20
+#endif //_LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/parser_std_format_spec.h b/contrib/libs/cxxsupp/libcxx/include/__format/parser_std_format_spec.h
index c03cec97963..c01e5866a43 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/parser_std_format_spec.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/parser_std_format_spec.h
@@ -16,23 +16,28 @@
/// This header has some support for the chrono-format-spec since it doesn't
/// affect the std-format-spec.
-#include <__algorithm/find_if.h>
+#include <__algorithm/copy_n.h>
#include <__algorithm/min.h>
#include <__assert>
#include <__concepts/arithmetic.h>
#include <__concepts/same_as.h>
#include <__config>
-#include <__debug>
#include <__format/format_arg.h>
#include <__format/format_error.h>
#include <__format/format_parse_context.h>
#include <__format/format_string.h>
#include <__format/unicode.h>
+#include <__format/width_estimation_table.h>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h> // iter_value_t
+#include <__memory/addressof.h>
+#include <__type_traits/common_type.h>
+#include <__type_traits/is_constant_evaluated.h>
+#include <__type_traits/is_trivially_copyable.h>
#include <__variant/monostate.h>
-#include <bit>
#include <cstdint>
+#include <string>
#include <string_view>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -43,24 +48,36 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __format_spec {
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __format::__parse_number_result< _CharT>
-__parse_arg_id(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
+_LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI inline void
+__throw_invalid_option_format_error(const char* __id, const char* __option) {
+ std::__throw_format_error(
+ (string("The format specifier for ") + __id + " does not allow the " + __option + " option").c_str());
+}
+
+_LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI inline void __throw_invalid_type_format_error(const char* __id) {
+ std::__throw_format_error(
+ (string("The type option contains an invalid value for ") + __id + " formatting argument").c_str());
+}
+
+template <contiguous_iterator _Iterator, class _ParseContext>
+_LIBCPP_HIDE_FROM_ABI constexpr __format::__parse_number_result<_Iterator>
+__parse_arg_id(_Iterator __begin, _Iterator __end, _ParseContext& __ctx) {
+ using _CharT = iter_value_t<_Iterator>;
// This function is a wrapper to call the real parser. But it does the
// validation for the pre-conditions and post-conditions.
if (__begin == __end)
- std::__throw_format_error("End of input while parsing format-spec arg-id");
+ std::__throw_format_error("End of input while parsing an argument index");
- __format::__parse_number_result __r = __format::__parse_arg_id(__begin, __end, __parse_ctx);
+ __format::__parse_number_result __r = __format::__parse_arg_id(__begin, __end, __ctx);
- if (__r.__ptr == __end || *__r.__ptr != _CharT('}'))
- std::__throw_format_error("Invalid arg-id");
+ if (__r.__last == __end || *__r.__last != _CharT('}'))
+ std::__throw_format_error("The argument index is invalid");
- ++__r.__ptr;
+ ++__r.__last;
return __r;
}
@@ -78,22 +95,33 @@ __substitute_arg_id(basic_format_arg<_Context> __format_arg) {
return _VSTD::__visit_format_arg(
[](auto __arg) -> uint32_t {
using _Type = decltype(__arg);
- if constexpr (integral<_Type>) {
+ if constexpr (same_as<_Type, monostate>)
+ std::__throw_format_error("The argument index value is too large for the number of arguments supplied");
+
+ // [format.string.std]/8
+ // If { arg-idopt } is used in a width or precision, the value of the
+ // corresponding formatting argument is used in its place. If the
+ // corresponding formatting argument is not of standard signed or unsigned
+ // integer type, or its value is negative for precision or non-positive for
+ // width, an exception of type format_error is thrown.
+ //
+ // When an integral is used in a format function, it is stored as one of
+ // the types checked below. Other integral types are promoted. For example,
+ // a signed char is stored as an int.
+ if constexpr (same_as<_Type, int> || same_as<_Type, unsigned int> || //
+ same_as<_Type, long long> || same_as<_Type, unsigned long long>) {
if constexpr (signed_integral<_Type>) {
if (__arg < 0)
- std::__throw_format_error("A format-spec arg-id replacement shouldn't have a negative value");
+ std::__throw_format_error("An argument index may not have a negative value");
}
using _CT = common_type_t<_Type, decltype(__format::__number_max)>;
- if (static_cast<_CT>(__arg) >
- static_cast<_CT>(__format::__number_max))
- std::__throw_format_error("A format-spec arg-id replacement exceeds the maximum supported value");
+ if (static_cast<_CT>(__arg) > static_cast<_CT>(__format::__number_max))
+ std::__throw_format_error("The value of the argument index exceeds its maximum value");
return __arg;
- } else if constexpr (same_as<_Type, monostate>)
- std::__throw_format_error("Argument index out of bounds");
- else
- std::__throw_format_error("A format-spec arg-id replacement argument isn't an integral type");
+ } else
+ std::__throw_format_error("Replacement argument isn't a standard signed or unsigned integer type");
},
__format_arg);
}
@@ -104,42 +132,48 @@ __substitute_arg_id(basic_format_arg<_Context> __format_arg) {
/// explicitly.
// TODO FMT Use an ABI tag for this struct.
struct __fields {
- uint8_t __sign_ : 1 {false};
- uint8_t __alternate_form_ : 1 {false};
- uint8_t __zero_padding_ : 1 {false};
- uint8_t __precision_ : 1 {false};
- uint8_t __locale_specific_form_ : 1 {false};
- uint8_t __type_ : 1 {false};
+ uint16_t __sign_ : 1 {false};
+ uint16_t __alternate_form_ : 1 {false};
+ uint16_t __zero_padding_ : 1 {false};
+ uint16_t __precision_ : 1 {false};
+ uint16_t __locale_specific_form_ : 1 {false};
+ uint16_t __type_ : 1 {false};
// Determines the valid values for fill.
//
// Originally the fill could be any character except { and }. Range-based
// formatters use the colon to mark the beginning of the
// underlying-format-spec. To avoid parsing ambiguities these formatter
// specializations prohibit the use of the colon as a fill character.
- uint8_t __allow_colon_in_fill_ : 1 {false};
+ uint16_t __use_range_fill_ : 1 {false};
+ uint16_t __clear_brackets_ : 1 {false};
+ uint16_t __consume_all_ : 1 {false};
};
// By not placing this constant in the formatter class it's not duplicated for
// char and wchar_t.
+inline constexpr __fields __fields_bool{.__locale_specific_form_ = true, .__type_ = true, .__consume_all_ = true};
inline constexpr __fields __fields_integral{
.__sign_ = true,
.__alternate_form_ = true,
.__zero_padding_ = true,
.__locale_specific_form_ = true,
- .__type_ = true};
+ .__type_ = true,
+ .__consume_all_ = true};
inline constexpr __fields __fields_floating_point{
.__sign_ = true,
.__alternate_form_ = true,
.__zero_padding_ = true,
.__precision_ = true,
.__locale_specific_form_ = true,
- .__type_ = true};
-inline constexpr __fields __fields_string{.__precision_ = true, .__type_ = true};
-inline constexpr __fields __fields_pointer{.__type_ = true};
-
-# if _LIBCPP_STD_VER > 20
-inline constexpr __fields __fields_tuple{.__type_ = false, .__allow_colon_in_fill_ = true};
-inline constexpr __fields __fields_range{.__type_ = false, .__allow_colon_in_fill_ = true};
+ .__type_ = true,
+ .__consume_all_ = true};
+inline constexpr __fields __fields_string{.__precision_ = true, .__type_ = true, .__consume_all_ = true};
+inline constexpr __fields __fields_pointer{.__zero_padding_ = true, .__type_ = true, .__consume_all_ = true};
+
+# if _LIBCPP_STD_VER >= 23
+inline constexpr __fields __fields_tuple{.__use_range_fill_ = true, .__clear_brackets_ = true};
+inline constexpr __fields __fields_range{.__use_range_fill_ = true, .__clear_brackets_ = true};
+inline constexpr __fields __fields_fill_align_width{};
# endif
enum class _LIBCPP_ENUM_VIS __alignment : uint8_t {
@@ -164,7 +198,7 @@ enum class _LIBCPP_ENUM_VIS __sign : uint8_t {
};
enum class _LIBCPP_ENUM_VIS __type : uint8_t {
- __default,
+ __default = 0,
__string,
__binary_lower_case,
__binary_upper_case,
@@ -172,7 +206,8 @@ enum class _LIBCPP_ENUM_VIS __type : uint8_t {
__decimal,
__hexadecimal_lower_case,
__hexadecimal_upper_case,
- __pointer,
+ __pointer_lower_case,
+ __pointer_upper_case,
__char,
__hexfloat_lower_case,
__hexfloat_upper_case,
@@ -185,6 +220,25 @@ enum class _LIBCPP_ENUM_VIS __type : uint8_t {
__debug
};
+_LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __create_type_mask(__type __t) {
+ uint32_t __shift = static_cast<uint32_t>(__t);
+ if (__shift == 0)
+ return 1;
+
+ if (__shift > 31)
+ std::__throw_format_error("The type does not fit in the mask");
+
+ return 1 << __shift;
+}
+
+inline constexpr uint32_t __type_mask_integer =
+ __create_type_mask(__type::__binary_lower_case) | //
+ __create_type_mask(__type::__binary_upper_case) | //
+ __create_type_mask(__type::__decimal) | //
+ __create_type_mask(__type::__octal) | //
+ __create_type_mask(__type::__hexadecimal_lower_case) | //
+ __create_type_mask(__type::__hexadecimal_upper_case);
+
struct __std {
__alignment __alignment_ : 3;
__sign __sign_ : 2;
@@ -196,6 +250,7 @@ struct __std {
struct __chrono {
__alignment __alignment_ : 3;
bool __locale_specific_form_ : 1;
+ bool __hour_ : 1;
bool __weekday_name_ : 1;
bool __weekday_ : 1;
bool __day_of_year_ : 1;
@@ -203,6 +258,25 @@ struct __chrono {
bool __month_name_ : 1;
};
+// The fill UCS scalar value.
+//
+// This is always an array, with 1, 2, or 4 elements.
+// The size of the data structure is always 32-bits.
+template <class _CharT>
+struct __code_point;
+
+template <>
+struct __code_point<char> {
+ char __data[4] = {' '};
+};
+
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+template <>
+struct __code_point<wchar_t> {
+ wchar_t __data[4 / sizeof(wchar_t)] = {L' '};
+};
+# endif
+
/// Contains the parsed formatting specifications.
///
/// This contains information for both the std-format-spec and the
@@ -238,7 +312,7 @@ struct __parsed_specifications {
/// replaced with the value of that arg-id.
int32_t __precision_;
- _CharT __fill_;
+ __code_point<_CharT> __fill_;
_LIBCPP_HIDE_FROM_ABI constexpr bool __has_width() const { return __width_ > 0; }
@@ -265,48 +339,161 @@ static_assert(is_trivially_copyable_v<__parsed_specifications<wchar_t>>);
template <class _CharT>
class _LIBCPP_TEMPLATE_VIS __parser {
public:
- _LIBCPP_HIDE_FROM_ABI constexpr auto __parse(basic_format_parse_context<_CharT>& __parse_ctx, __fields __fields)
- -> decltype(__parse_ctx.begin()) {
-
- const _CharT* __begin = __parse_ctx.begin();
- const _CharT* __end = __parse_ctx.end();
+ // Parses the format specification.
+ //
+ // Depending on whether the parsing is done compile-time or run-time
+ // the method slightly differs.
+ // - Only parses a field when it is in the __fields. Accepting all
+ // fields and then validating the valid ones has a performance impact.
+ // This is faster but gives slighly worse error messages.
+ // - At compile-time when a field is not accepted the parser will still
+ // parse it and give an error when it's present. This gives a more
+ // accurate error.
+ // The idea is that most times the format instead of the vformat
+ // functions are used. In that case the error will be detected during
+ // compilation and there is no need to pay for the run-time overhead.
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator __parse(_ParseContext& __ctx, __fields __fields) {
+ auto __begin = __ctx.begin();
+ auto __end = __ctx.end();
if (__begin == __end)
return __begin;
- if (__parse_fill_align(__begin, __end, __fields.__allow_colon_in_fill_) && __begin == __end)
+ if (__parse_fill_align(__begin, __end, __fields.__use_range_fill_) && __begin == __end)
return __begin;
- if (__fields.__sign_ && __parse_sign(__begin) && __begin == __end)
- return __begin;
+ if (__fields.__sign_) {
+ if (__parse_sign(__begin) && __begin == __end)
+ return __begin;
+ } else if (std::is_constant_evaluated() && __parse_sign(__begin)) {
+ std::__throw_format_error("The format specification does not allow the sign option");
+ }
- if (__fields.__alternate_form_ && __parse_alternate_form(__begin) && __begin == __end)
- return __begin;
+ if (__fields.__alternate_form_) {
+ if (__parse_alternate_form(__begin) && __begin == __end)
+ return __begin;
+ } else if (std::is_constant_evaluated() && __parse_alternate_form(__begin)) {
+ std::__throw_format_error("The format specifier does not allow the alternate form option");
+ }
- if (__fields.__zero_padding_ && __parse_zero_padding(__begin) && __begin == __end)
- return __begin;
+ if (__fields.__zero_padding_) {
+ if (__parse_zero_padding(__begin) && __begin == __end)
+ return __begin;
+ } else if (std::is_constant_evaluated() && __parse_zero_padding(__begin)) {
+ std::__throw_format_error("The format specifier does not allow the zero-padding option");
+ }
- if (__parse_width(__begin, __end, __parse_ctx) && __begin == __end)
+ if (__parse_width(__begin, __end, __ctx) && __begin == __end)
return __begin;
- if (__fields.__precision_ && __parse_precision(__begin, __end, __parse_ctx) && __begin == __end)
- return __begin;
+ if (__fields.__precision_) {
+ if (__parse_precision(__begin, __end, __ctx) && __begin == __end)
+ return __begin;
+ } else if (std::is_constant_evaluated() && __parse_precision(__begin, __end, __ctx)) {
+ std::__throw_format_error("The format specifier does not allow the precision option");
+ }
- if (__fields.__locale_specific_form_ && __parse_locale_specific_form(__begin) && __begin == __end)
- return __begin;
+ if (__fields.__locale_specific_form_) {
+ if (__parse_locale_specific_form(__begin) && __begin == __end)
+ return __begin;
+ } else if (std::is_constant_evaluated() && __parse_locale_specific_form(__begin)) {
+ std::__throw_format_error("The format specifier does not allow the locale-specific form option");
+ }
+
+ if (__fields.__clear_brackets_) {
+ if (__parse_clear_brackets(__begin) && __begin == __end)
+ return __begin;
+ } else if (std::is_constant_evaluated() && __parse_clear_brackets(__begin)) {
+ std::__throw_format_error("The format specifier does not allow the n option");
+ }
- if (__fields.__type_) {
+ if (__fields.__type_)
__parse_type(__begin);
- // When __type_ is false the calling parser is expected to do additional
- // parsing. In that case that parser should do the end of format string
- // validation.
- if (__begin != __end && *__begin != _CharT('}'))
- std::__throw_format_error("The format-spec should consume the input or end with a '}'");
- }
+ if (!__fields.__consume_all_)
+ return __begin;
+
+ if (__begin != __end && *__begin != _CharT('}'))
+ std::__throw_format_error("The format specifier should consume the input or end with a '}'");
return __begin;
}
+ // Validates the selected the parsed data.
+ //
+ // The valid fields in the parser may depend on the display type
+ // selected. But the type is the last optional field, so by the time
+ // it's known an option can't be used, it already has been parsed.
+ // This does the validation again.
+ //
+ // For example an integral may have a sign, zero-padding, or alternate
+ // form when the type option is not 'c'. So the generic approach is:
+ //
+ // typename _ParseContext::iterator __result = __parser_.__parse(__ctx, __format_spec::__fields_integral);
+ // if (__parser.__type_ == __format_spec::__type::__char) {
+ // __parser.__validate((__format_spec::__fields_bool, "an integer");
+ // ... // more char adjustments
+ // } else {
+ // ... // validate an integral type.
+ // }
+ //
+ // For some types all valid options need a second validation run, like
+ // boolean types.
+ //
+ // Depending on whether the validation is done at compile-time or
+ // run-time the error differs
+ // - run-time the exception is thrown and contains the type of field
+ // being validated.
+ // - at compile-time the line with `std::__throw_format_error` is shown
+ // in the output. In that case it's important for the error to be on one
+ // line.
+ // Note future versions of C++ may allow better compile-time error
+ // reporting.
+ _LIBCPP_HIDE_FROM_ABI constexpr void
+ __validate(__fields __fields, const char* __id, uint32_t __type_mask = -1) const {
+ if (!__fields.__sign_ && __sign_ != __sign::__default) {
+ if (std::is_constant_evaluated())
+ std::__throw_format_error("The format specifier does not allow the sign option");
+ else
+ __format_spec::__throw_invalid_option_format_error(__id, "sign");
+ }
+
+ if (!__fields.__alternate_form_ && __alternate_form_) {
+ if (std::is_constant_evaluated())
+ std::__throw_format_error("The format specifier does not allow the alternate form option");
+ else
+ __format_spec::__throw_invalid_option_format_error(__id, "alternate form");
+ }
+
+ if (!__fields.__zero_padding_ && __alignment_ == __alignment::__zero_padding) {
+ if (std::is_constant_evaluated())
+ std::__throw_format_error("The format specifier does not allow the zero-padding option");
+ else
+ __format_spec::__throw_invalid_option_format_error(__id, "zero-padding");
+ }
+
+ if (!__fields.__precision_ && __precision_ != -1) { // Works both when the precision has a value or an arg-id.
+ if (std::is_constant_evaluated())
+ std::__throw_format_error("The format specifier does not allow the precision option");
+ else
+ __format_spec::__throw_invalid_option_format_error(__id, "precision");
+ }
+
+ if (!__fields.__locale_specific_form_ && __locale_specific_form_) {
+ if (std::is_constant_evaluated())
+ std::__throw_format_error("The format specifier does not allow the locale-specific form option");
+ else
+ __format_spec::__throw_invalid_option_format_error(__id, "locale-specific form");
+ }
+
+ if ((__create_type_mask(__type_) & __type_mask) == 0) {
+ if (std::is_constant_evaluated())
+ std::__throw_format_error("The format specifier uses an invalid value for the type option");
+ else
+ __format_spec::__throw_invalid_type_format_error(__id);
+ }
+ }
+
/// \returns the `__parsed_specifications` with the resolved dynamic sizes..
_LIBCPP_HIDE_FROM_ABI
__parsed_specifications<_CharT> __get_parsed_std_specifications(auto& __ctx) const {
@@ -326,6 +513,7 @@ public:
.__chrono_ =
__chrono{.__alignment_ = __alignment_,
.__locale_specific_form_ = __locale_specific_form_,
+ .__hour_ = __hour_,
.__weekday_name_ = __weekday_name_,
.__weekday_ = __weekday_,
.__day_of_year_ = __day_of_year_,
@@ -340,11 +528,13 @@ public:
__sign __sign_ : 2 {__sign::__default};
bool __alternate_form_ : 1 {false};
bool __locale_specific_form_ : 1 {false};
- bool __reserved_0_ : 1 {false};
+ bool __clear_brackets_ : 1 {false};
__type __type_{__type::__default};
// These flags are only used for formatting chrono. Since the struct has
// padding space left it's added to this structure.
+ bool __hour_ : 1 {false};
+
bool __weekday_name_ : 1 {false};
bool __weekday_ : 1 {false};
@@ -353,8 +543,8 @@ public:
bool __month_name_ : 1 {false};
- uint8_t __reserved_1_ : 3 {0};
- uint8_t __reserved_2_ : 6 {0};
+ uint8_t __reserved_0_ : 2 {0};
+ uint8_t __reserved_1_ : 6 {0};
// These two flags are only used internally and not part of the
// __parsed_specifications. Therefore put them at the end.
bool __width_as_arg_ : 1 {false};
@@ -366,11 +556,7 @@ public:
/// The requested precision, either the value or the arg-id.
int32_t __precision_{-1};
- // LWG 3576 will probably change this to always accept a Unicode code point
- // To avoid changing the size with that change align the field so when it
- // becomes 32-bit its alignment will remain the same. That also means the
- // size will remain the same. (D2572 addresses the solution for LWG 3576.)
- _CharT __fill_{_CharT(' ')};
+ __code_point<_CharT> __fill_{};
private:
_LIBCPP_HIDE_FROM_ABI constexpr bool __parse_alignment(_CharT __c) {
@@ -390,19 +576,90 @@ private:
return false;
}
+ _LIBCPP_HIDE_FROM_ABI constexpr void __validate_fill_character(_CharT __fill, bool __use_range_fill) {
+ // The forbidden fill characters all code points formed from a single code unit, thus the
+ // check can be omitted when more code units are used.
+ if (__use_range_fill && (__fill == _CharT('{') || __fill == _CharT('}') || __fill == _CharT(':')))
+ std::__throw_format_error("The fill option contains an invalid value");
+ else if (__fill == _CharT('{') || __fill == _CharT('}'))
+ std::__throw_format_error("The fill option contains an invalid value");
+ }
+
+# ifndef _LIBCPP_HAS_NO_UNICODE
+ // range-fill and tuple-fill are identical
+ template <contiguous_iterator _Iterator>
+ requires same_as<_CharT, char>
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+ || (same_as<_CharT, wchar_t> && sizeof(wchar_t) == 2)
+# endif
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_fill_align(_Iterator& __begin, _Iterator __end, bool __use_range_fill) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__begin != __end,
+ "when called with an empty input the function will cause "
+ "undefined behavior by evaluating data not in the input");
+ __unicode::__code_point_view<_CharT> __view{__begin, __end};
+ __unicode::__consume_result __consumed = __view.__consume();
+ if (__consumed.__status != __unicode::__consume_result::__ok)
+ std::__throw_format_error("The format specifier contains malformed Unicode characters");
+
+ if (__view.__position() < __end && __parse_alignment(*__view.__position())) {
+ ptrdiff_t __code_units = __view.__position() - __begin;
+ if (__code_units == 1)
+ // The forbidden fill characters all are code points encoded
+ // in one code unit, thus the check can be omitted when more
+ // code units are used.
+ __validate_fill_character(*__begin, __use_range_fill);
+
+ std::copy_n(__begin, __code_units, std::addressof(__fill_.__data[0]));
+ __begin += __code_units + 1;
+ return true;
+ }
+
+ if (!__parse_alignment(*__begin))
+ return false;
+
+ ++__begin;
+ return true;
+ }
+
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+ template <contiguous_iterator _Iterator>
+ requires(same_as<_CharT, wchar_t> && sizeof(wchar_t) == 4)
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_fill_align(_Iterator& __begin, _Iterator __end, bool __use_range_fill) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__begin != __end,
+ "when called with an empty input the function will cause "
+ "undefined behavior by evaluating data not in the input");
+ if (__begin + 1 != __end && __parse_alignment(*(__begin + 1))) {
+ if (!__unicode::__is_scalar_value(*__begin))
+ std::__throw_format_error("The fill option contains an invalid value");
+
+ __validate_fill_character(*__begin, __use_range_fill);
+
+ __fill_.__data[0] = *__begin;
+ __begin += 2;
+ return true;
+ }
+
+ if (!__parse_alignment(*__begin))
+ return false;
+
+ ++__begin;
+ return true;
+ }
+
+# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+
+# else // _LIBCPP_HAS_NO_UNICODE
// range-fill and tuple-fill are identical
- _LIBCPP_HIDE_FROM_ABI constexpr bool
- __parse_fill_align(const _CharT*& __begin, const _CharT* __end, bool __use_range_fill) {
- _LIBCPP_ASSERT(__begin != __end, "when called with an empty input the function will cause "
- "undefined behavior by evaluating data not in the input");
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_fill_align(_Iterator& __begin, _Iterator __end, bool __use_range_fill) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__begin != __end,
+ "when called with an empty input the function will cause "
+ "undefined behavior by evaluating data not in the input");
if (__begin + 1 != __end) {
if (__parse_alignment(*(__begin + 1))) {
- if (__use_range_fill && (*__begin == _CharT('{') || *__begin == _CharT('}') || *__begin == _CharT(':')))
- std::__throw_format_error("The format-spec range-fill field contains an invalid character");
- else if (*__begin == _CharT('{') || *__begin == _CharT('}'))
- std::__throw_format_error("The format-spec fill field contains an invalid character");
+ __validate_fill_character(*__begin, __use_range_fill);
- __fill_ = *__begin;
+ __fill_.__data[0] = *__begin;
__begin += 2;
return true;
}
@@ -415,7 +672,10 @@ private:
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_sign(const _CharT*& __begin) {
+# endif // _LIBCPP_HAS_NO_UNICODE
+
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_sign(_Iterator& __begin) {
switch (*__begin) {
case _CharT('-'):
__sign_ = __sign::__minus;
@@ -433,7 +693,8 @@ private:
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_alternate_form(const _CharT*& __begin) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_alternate_form(_Iterator& __begin) {
if (*__begin != _CharT('#'))
return false;
@@ -442,7 +703,8 @@ private:
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_zero_padding(const _CharT*& __begin) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_zero_padding(_Iterator& __begin) {
if (*__begin != _CharT('0'))
return false;
@@ -452,15 +714,16 @@ private:
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_width(const _CharT*& __begin, const _CharT* __end, auto& __parse_ctx) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_width(_Iterator& __begin, _Iterator __end, auto& __ctx) {
if (*__begin == _CharT('0'))
- std::__throw_format_error("A format-spec width field shouldn't have a leading zero");
+ std::__throw_format_error("The width option should not have a leading zero");
if (*__begin == _CharT('{')) {
- __format::__parse_number_result __r = __format_spec::__parse_arg_id(++__begin, __end, __parse_ctx);
+ __format::__parse_number_result __r = __format_spec::__parse_arg_id(++__begin, __end, __ctx);
__width_as_arg_ = true;
__width_ = __r.__value;
- __begin = __r.__ptr;
+ __begin = __r.__last;
return true;
}
@@ -469,40 +732,41 @@ private:
__format::__parse_number_result __r = __format::__parse_number(__begin, __end);
__width_ = __r.__value;
- _LIBCPP_ASSERT(__width_ != 0, "A zero value isn't allowed and should be impossible, "
- "due to validations in this function");
- __begin = __r.__ptr;
+ _LIBCPP_ASSERT_UNCATEGORIZED(__width_ != 0, "A zero value isn't allowed and should be impossible, "
+ "due to validations in this function");
+ __begin = __r.__last;
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_precision(const _CharT*& __begin, const _CharT* __end,
- auto& __parse_ctx) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_precision(_Iterator& __begin, _Iterator __end, auto& __ctx) {
if (*__begin != _CharT('.'))
return false;
++__begin;
if (__begin == __end)
- std::__throw_format_error("End of input while parsing format-spec precision");
+ std::__throw_format_error("End of input while parsing format specifier precision");
if (*__begin == _CharT('{')) {
- __format::__parse_number_result __arg_id = __format_spec::__parse_arg_id(++__begin, __end, __parse_ctx);
+ __format::__parse_number_result __arg_id = __format_spec::__parse_arg_id(++__begin, __end, __ctx);
__precision_as_arg_ = true;
__precision_ = __arg_id.__value;
- __begin = __arg_id.__ptr;
+ __begin = __arg_id.__last;
return true;
}
if (*__begin < _CharT('0') || *__begin > _CharT('9'))
- std::__throw_format_error("The format-spec precision field doesn't contain a value or arg-id");
+ std::__throw_format_error("The precision option does not contain a value or an argument index");
__format::__parse_number_result __r = __format::__parse_number(__begin, __end);
__precision_ = __r.__value;
__precision_as_arg_ = false;
- __begin = __r.__ptr;
+ __begin = __r.__last;
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_locale_specific_form(const _CharT*& __begin) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_locale_specific_form(_Iterator& __begin) {
if (*__begin != _CharT('L'))
return false;
@@ -511,7 +775,18 @@ private:
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr void __parse_type(const _CharT*& __begin) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_clear_brackets(_Iterator& __begin) {
+ if (*__begin != _CharT('n'))
+ return false;
+
+ __clear_brackets_ = true;
+ ++__begin;
+ return true;
+ }
+
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr void __parse_type(_Iterator& __begin) {
// Determines the type. It does not validate whether the selected type is
// valid. Most formatters have optional fields that are only allowed for
// certain types. These parsers need to do validation after the type has
@@ -561,7 +836,10 @@ private:
__type_ = __type::__octal;
break;
case 'p':
- __type_ = __type::__pointer;
+ __type_ = __type::__pointer_lower_case;
+ break;
+ case 'P':
+ __type_ = __type::__pointer_upper_case;
break;
case 's':
__type_ = __type::__string;
@@ -569,7 +847,7 @@ private:
case 'x':
__type_ = __type::__hexadecimal_lower_case;
break;
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
case '?':
__type_ = __type::__debug;
break;
@@ -611,36 +889,28 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_string(__format_spec
break;
default:
- std::__throw_format_error("The format-spec type has a type not supported for a string argument");
+ std::__throw_format_error("The type option contains an invalid value for a string formatting argument");
}
}
template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_bool_string(__parser<_CharT>& __parser) {
- if (__parser.__sign_ != __sign::__default)
- std::__throw_format_error("A sign field isn't allowed in this format-spec");
-
- if (__parser.__alternate_form_)
- std::__throw_format_error("An alternate form field isn't allowed in this format-spec");
-
- if (__parser.__alignment_ == __alignment::__zero_padding)
- std::__throw_format_error("A zero-padding field isn't allowed in this format-spec");
-
+_LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_bool_string(__parser<_CharT>& __parser, const char* __id) {
+ __parser.__validate(__format_spec::__fields_bool, __id);
if (__parser.__alignment_ == __alignment::__default)
__parser.__alignment_ = __alignment::__left;
}
template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_char(__parser<_CharT>& __parser) {
- __format_spec::__process_display_type_bool_string(__parser);
+_LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_char(__parser<_CharT>& __parser, const char* __id) {
+ __format_spec::__process_display_type_bool_string(__parser, __id);
}
template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_bool(__parser<_CharT>& __parser) {
+_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_bool(__parser<_CharT>& __parser, const char* __id) {
switch (__parser.__type_) {
case __format_spec::__type::__default:
case __format_spec::__type::__string:
- __format_spec::__process_display_type_bool_string(__parser);
+ __format_spec::__process_display_type_bool_string(__parser, __id);
break;
case __format_spec::__type::__binary_lower_case:
@@ -652,17 +922,17 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_bool(__parser<_CharT>& __p
break;
default:
- std::__throw_format_error("The format-spec type has a type not supported for a bool argument");
+ __format_spec::__throw_invalid_type_format_error(__id);
}
}
template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_char(__parser<_CharT>& __parser) {
+_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_char(__parser<_CharT>& __parser, const char* __id) {
switch (__parser.__type_) {
case __format_spec::__type::__default:
case __format_spec::__type::__char:
case __format_spec::__type::__debug:
- __format_spec::__process_display_type_char(__parser);
+ __format_spec::__process_display_type_char(__parser, __id);
break;
case __format_spec::__type::__binary_lower_case:
@@ -674,12 +944,12 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_char(__parser<_CharT>& __p
break;
default:
- std::__throw_format_error("The format-spec type has a type not supported for a char argument");
+ __format_spec::__throw_invalid_type_format_error(__id);
}
}
template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_integer(__parser<_CharT>& __parser) {
+_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_integer(__parser<_CharT>& __parser, const char* __id) {
switch (__parser.__type_) {
case __format_spec::__type::__default:
case __format_spec::__type::__binary_lower_case:
@@ -691,16 +961,16 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_integer(__parser<_CharT>&
break;
case __format_spec::__type::__char:
- __format_spec::__process_display_type_char(__parser);
+ __format_spec::__process_display_type_char(__parser, __id);
break;
default:
- std::__throw_format_error("The format-spec type has a type not supported for an integer argument");
+ __format_spec::__throw_invalid_type_format_error(__id);
}
}
template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_floating_point(__parser<_CharT>& __parser) {
+_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_floating_point(__parser<_CharT>& __parser, const char* __id) {
switch (__parser.__type_) {
case __format_spec::__type::__default:
case __format_spec::__type::__hexfloat_lower_case:
@@ -719,33 +989,34 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_floating_point(__parser<_C
break;
default:
- std::__throw_format_error("The format-spec type has a type not supported for a floating-point argument");
+ __format_spec::__throw_invalid_type_format_error(__id);
}
}
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_pointer(__format_spec::__type __type) {
+_LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_pointer(__format_spec::__type __type, const char* __id) {
switch (__type) {
case __format_spec::__type::__default:
- case __format_spec::__type::__pointer:
+ case __format_spec::__type::__pointer_lower_case:
+ case __format_spec::__type::__pointer_upper_case:
break;
default:
- std::__throw_format_error("The format-spec type has a type not supported for a pointer argument");
+ __format_spec::__throw_invalid_type_format_error(__id);
}
}
-template <class _CharT>
+template <contiguous_iterator _Iterator>
struct __column_width_result {
/// The number of output columns.
size_t __width_;
/// One beyond the last code unit used in the estimation.
///
/// This limits the original output to fit in the wanted number of columns.
- const _CharT* __last_;
+ _Iterator __last_;
};
-template <class _CharT>
-__column_width_result(size_t, const _CharT*) -> __column_width_result<_CharT>;
+template <contiguous_iterator _Iterator>
+__column_width_result(size_t, _Iterator) -> __column_width_result<_Iterator>;
/// Since a column width can be two it's possible that the requested column
/// width can't be achieved. Depending on the intended usage the policy can be
@@ -761,66 +1032,16 @@ enum class __column_width_rounding { __down, __up };
# ifndef _LIBCPP_HAS_NO_UNICODE
namespace __detail {
-
-/// Converts a code point to the column width.
-///
-/// The estimations are conforming to [format.string.general]/11
-///
-/// This version expects a value less than 0x1'0000, which is a 3-byte UTF-8
-/// character.
-_LIBCPP_HIDE_FROM_ABI constexpr int __column_width_3(uint32_t __c) noexcept {
- _LIBCPP_ASSERT(__c < 0x10000, "Use __column_width_4 or __column_width for larger values");
-
- // clang-format off
- return 1 + (__c >= 0x1100 && (__c <= 0x115f ||
- (__c >= 0x2329 && (__c <= 0x232a ||
- (__c >= 0x2e80 && (__c <= 0x303e ||
- (__c >= 0x3040 && (__c <= 0xa4cf ||
- (__c >= 0xac00 && (__c <= 0xd7a3 ||
- (__c >= 0xf900 && (__c <= 0xfaff ||
- (__c >= 0xfe10 && (__c <= 0xfe19 ||
- (__c >= 0xfe30 && (__c <= 0xfe6f ||
- (__c >= 0xff00 && (__c <= 0xff60 ||
- (__c >= 0xffe0 && (__c <= 0xffe6
- ))))))))))))))))))));
- // clang-format on
-}
-
-/// @overload
-///
-/// This version expects a value greater than or equal to 0x1'0000, which is a
-/// 4-byte UTF-8 character.
-_LIBCPP_HIDE_FROM_ABI constexpr int __column_width_4(uint32_t __c) noexcept {
- _LIBCPP_ASSERT(__c >= 0x10000, "Use __column_width_3 or __column_width for smaller values");
-
- // clang-format off
- return 1 + (__c >= 0x1'f300 && (__c <= 0x1'f64f ||
- (__c >= 0x1'f900 && (__c <= 0x1'f9ff ||
- (__c >= 0x2'0000 && (__c <= 0x2'fffd ||
- (__c >= 0x3'0000 && (__c <= 0x3'fffd
- ))))))));
- // clang-format on
-}
-
-/// @overload
-///
-/// The general case, accepting all values.
-_LIBCPP_HIDE_FROM_ABI constexpr int __column_width(uint32_t __c) noexcept {
- if (__c < 0x10000)
- return __detail::__column_width_3(__c);
-
- return __detail::__column_width_4(__c);
-}
-
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_width_grapheme_clustering(
- const _CharT* __first, const _CharT* __last, size_t __maximum, __column_width_rounding __rounding) noexcept {
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_Iterator> __estimate_column_width_grapheme_clustering(
+ _Iterator __first, _Iterator __last, size_t __maximum, __column_width_rounding __rounding) noexcept {
+ using _CharT = iter_value_t<_Iterator>;
__unicode::__extended_grapheme_cluster_view<_CharT> __view{__first, __last};
- __column_width_result<_CharT> __result{0, __first};
+ __column_width_result<_Iterator> __result{0, __first};
while (__result.__last_ != __last && __result.__width_ <= __maximum) {
typename __unicode::__extended_grapheme_cluster_view<_CharT>::__cluster __cluster = __view.__consume();
- int __width = __detail::__column_width(__cluster.__code_point_);
+ int __width = __width_estimation_table::__estimated_width(__cluster.__code_point_);
// When the next entry would exceed the maximum width the previous width
// might be returned. For example when a width of 100 is requested the
@@ -884,8 +1105,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __is_ascii(char32_t __c) { return __c < 0x8
/// \param __rounding Selects the rounding method.
/// \c __down result.__width_ <= __maximum
/// \c __up result.__width_ <= __maximum + 1
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_width(
+template <class _CharT, class _Iterator = typename basic_string_view<_CharT>::const_iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_Iterator> __estimate_column_width(
basic_string_view<_CharT> __str, size_t __maximum, __column_width_rounding __rounding) noexcept {
// The width estimation is done in two steps:
// - Quickly process for the ASCII part. ASCII has the following properties
@@ -904,7 +1125,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_
// need to scan one code unit beyond the requested precision. When this code
// unit is non-ASCII we omit the current code unit and let the Grapheme
// clustering algorithm do its work.
- const _CharT* __it = __str.begin();
+ auto __it = __str.begin();
if (__format_spec::__is_ascii(*__it)) {
do {
--__maximum;
@@ -932,7 +1153,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_
}
# else // !defined(_LIBCPP_HAS_NO_UNICODE)
template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT>
+_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<typename basic_string_view<_CharT>::const_iterator>
__estimate_column_width(basic_string_view<_CharT> __str, size_t __maximum, __column_width_rounding) noexcept {
// When Unicode isn't supported assume ASCII and every code unit is one code
// point. In ASCII the estimated column width is always one. Thus there's no
@@ -945,7 +1166,7 @@ __estimate_column_width(basic_string_view<_CharT> __str, size_t __maximum, __col
} // namespace __format_spec
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/range_default_formatter.h b/contrib/libs/cxxsupp/libcxx/include/__format/range_default_formatter.h
index 774887b0530..bcab5d6afdd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/range_default_formatter.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/range_default_formatter.h
@@ -14,22 +14,25 @@
# pragma GCC system_header
#endif
-#include <__availability>
+#include <__algorithm/ranges_copy.h>
#include <__chrono/statically_widen.h>
#include <__concepts/same_as.h>
#include <__config>
#include <__format/concepts.h>
#include <__format/formatter.h>
#include <__format/range_formatter.h>
+#include <__iterator/back_insert_iterator.h>
#include <__ranges/concepts.h>
+#include <__ranges/data.h>
+#include <__ranges/size.h>
+#include <__type_traits/conditional.h>
#include <__type_traits/remove_cvref.h>
#include <__utility/pair.h>
#include <string_view>
-#include <tuple>
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Rp, class _CharT>
concept __const_formattable_range =
@@ -83,40 +86,23 @@ inline constexpr range_format format_kind<_Rp> = [] {
return range_format::sequence;
}();
-// This is a non-standard work-around to fix instantiation of
-// formatter<const _CharT[N], _CharT>
-// const _CharT[N] satisfies the ranges::input_range concept.
-// remove_cvref_t<const _CharT[N]> is _CharT[N] so it does not satisfy the
-// requirement of the above specialization. Instead it will instantiate the
-// primary template, which is ill-formed.
-//
-// An alternative solution is to remove the offending formatter.
-//
-// https://godbolt.org/z/bqjhhaexx
-//
-// The removal is proposed in LWG3833, but use the work-around until the issue
-// has been adopted.
-// TODO FMT Implement LWG3833.
-template <class _CharT, size_t N>
-inline constexpr range_format format_kind<const _CharT[N]> = range_format::disabled;
-
template <range_format _Kp, ranges::input_range _Rp, class _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __range_default_formatter;
+struct _LIBCPP_TEMPLATE_VIS __range_default_formatter;
// Required specializations
template <ranges::input_range _Rp, class _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __range_default_formatter<range_format::sequence, _Rp, _CharT> {
+struct _LIBCPP_TEMPLATE_VIS __range_default_formatter<range_format::sequence, _Rp, _CharT> {
private:
using __maybe_const_r = __fmt_maybe_const<_Rp, _CharT>;
range_formatter<remove_cvref_t<ranges::range_reference_t<__maybe_const_r>>, _CharT> __underlying_;
public:
- _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) {
+ _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) noexcept {
__underlying_.set_separator(__separator);
}
_LIBCPP_HIDE_FROM_ABI constexpr void
- set_brackets(basic_string_view<_CharT> __opening_bracket, basic_string_view<_CharT> __closing_bracket) {
+ set_brackets(basic_string_view<_CharT> __opening_bracket, basic_string_view<_CharT> __closing_bracket) noexcept {
__underlying_.set_brackets(__opening_bracket, __closing_bracket);
}
@@ -125,14 +111,15 @@ public:
return __underlying_.parse(__ctx);
}
- template <class FormatContext>
- _LIBCPP_HIDE_FROM_ABI typename FormatContext::iterator format(__maybe_const_r& __range, FormatContext& __ctx) const {
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
+ format(__maybe_const_r& __range, _FormatContext& __ctx) const {
return __underlying_.format(__range, __ctx);
}
};
template <ranges::input_range _Rp, class _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __range_default_formatter<range_format::map, _Rp, _CharT> {
+struct _LIBCPP_TEMPLATE_VIS __range_default_formatter<range_format::map, _Rp, _CharT> {
private:
using __maybe_const_map = __fmt_maybe_const<_Rp, _CharT>;
using __element_type = remove_cvref_t<ranges::range_reference_t<__maybe_const_map>>;
@@ -160,7 +147,7 @@ public:
};
template <ranges::input_range _Rp, class _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __range_default_formatter<range_format::set, _Rp, _CharT> {
+struct _LIBCPP_TEMPLATE_VIS __range_default_formatter<range_format::set, _Rp, _CharT> {
private:
using __maybe_const_set = __fmt_maybe_const<_Rp, _CharT>;
using __element_type = remove_cvref_t<ranges::range_reference_t<__maybe_const_set>>;
@@ -185,16 +172,48 @@ public:
template <range_format _Kp, ranges::input_range _Rp, class _CharT>
requires(_Kp == range_format::string || _Kp == range_format::debug_string)
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __range_default_formatter<_Kp, _Rp, _CharT> {
- __range_default_formatter() = delete; // TODO FMT Implement
+struct _LIBCPP_TEMPLATE_VIS __range_default_formatter<_Kp, _Rp, _CharT> {
+private:
+ // This deviates from the Standard, there the exposition only type is
+ // formatter<basic_string<charT>, charT> underlying_;
+ // Using a string_view allows the format function to avoid a copy of the
+ // input range when it is a contigious range.
+ formatter<basic_string_view<_CharT>, _CharT> __underlying_;
+
+public:
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ typename _ParseContext::iterator __i = __underlying_.parse(__ctx);
+ if constexpr (_Kp == range_format::debug_string)
+ __underlying_.set_debug_format();
+ return __i;
+ }
+
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
+ format(conditional_t<ranges::input_range<const _Rp>, const _Rp&, _Rp&> __range, _FormatContext& __ctx) const {
+ // When the range is contiguous use a basic_string_view instead to avoid a
+ // copy of the underlying data. The basic_string_view formatter
+ // specialization is the "basic" string formatter in libc++.
+ if constexpr (ranges::contiguous_range<_Rp> && std::ranges::sized_range<_Rp>)
+ return __underlying_.format(basic_string_view<_CharT>{ranges::data(__range), ranges::size(__range)}, __ctx);
+ else {
+ // P2106's from_range has not been implemented yet. Instead use a simple
+ // copy operation.
+ // TODO FMT use basic_string's "from_range" constructor.
+ // return __underlying_.format(basic_string<_CharT>{from_range, __range}, __ctx);
+ basic_string<_CharT> __str;
+ std::ranges::copy(__range, back_insert_iterator{__str});
+ return __underlying_.format(static_cast<basic_string_view<_CharT>>(__str), __ctx);
+ }
+ }
};
template <ranges::input_range _Rp, class _CharT>
requires(format_kind<_Rp> != range_format::disabled && formattable<ranges::range_reference_t<_Rp>, _CharT>)
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<_Rp, _CharT>
- : __range_default_formatter<format_kind<_Rp>, _Rp, _CharT> {};
+struct _LIBCPP_TEMPLATE_VIS formatter<_Rp, _CharT> : __range_default_formatter<format_kind<_Rp>, _Rp, _CharT> {};
-#endif //_LIBCPP_STD_VER > 20
+#endif //_LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/range_formatter.h b/contrib/libs/cxxsupp/libcxx/include/__format/range_formatter.h
index 9ea61a70350..27870972c9d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/range_formatter.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/range_formatter.h
@@ -15,13 +15,11 @@
#endif
#include <__algorithm/ranges_copy.h>
-#include <__availability>
#include <__chrono/statically_widen.h>
#include <__concepts/same_as.h>
#include <__config>
#include <__format/buffer.h>
#include <__format/concepts.h>
-#include <__format/format_args.h>
#include <__format/format_context.h>
#include <__format/format_error.h>
#include <__format/formatter.h>
@@ -36,54 +34,73 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Tp, class _CharT = char>
requires same_as<remove_cvref_t<_Tp>, _Tp> && formattable<_Tp, _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT range_formatter {
- _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) {
+struct _LIBCPP_TEMPLATE_VIS range_formatter {
+ _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) noexcept {
__separator_ = __separator;
}
_LIBCPP_HIDE_FROM_ABI constexpr void
- set_brackets(basic_string_view<_CharT> __opening_bracket, basic_string_view<_CharT> __closing_bracket) {
+ set_brackets(basic_string_view<_CharT> __opening_bracket, basic_string_view<_CharT> __closing_bracket) noexcept {
__opening_bracket_ = __opening_bracket;
__closing_bracket_ = __closing_bracket;
}
- _LIBCPP_HIDE_FROM_ABI constexpr formatter<_Tp, _CharT>& underlying() { return __underlying_; }
- _LIBCPP_HIDE_FROM_ABI constexpr const formatter<_Tp, _CharT>& underlying() const { return __underlying_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr formatter<_Tp, _CharT>& underlying() noexcept { return __underlying_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr const formatter<_Tp, _CharT>& underlying() const noexcept { return __underlying_; }
template <class _ParseContext>
- _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __parse_ctx) {
- const _CharT* __begin = __parser_.__parse(__parse_ctx, __format_spec::__fields_range);
- const _CharT* __end = __parse_ctx.end();
- if (__begin == __end)
- return __begin;
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ auto __begin = __parser_.__parse(__ctx, __format_spec::__fields_range);
+ auto __end = __ctx.end();
+ // Note the cases where __begin == __end in this code only happens when the
+ // replacement-field has no terminating }, or when the parse is manually
+ // called with a format-spec. The former is an error and the latter means
+ // using a formatter without the format functions or print.
+ if (__begin == __end) [[unlikely]]
+ return __parse_empty_range_underlying_spec(__ctx, __begin);
// The n field overrides a possible m type, therefore delay applying the
// effect of n until the type has been procesed.
- bool __clear_brackets = (*__begin == _CharT('n'));
- if (__clear_brackets) {
- ++__begin;
- if (__begin == __end) {
- // Since there is no more data, clear the brackets before returning.
- set_brackets({}, {});
- return __begin;
- }
- }
-
__parse_type(__begin, __end);
- if (__clear_brackets)
+ if (__parser_.__clear_brackets_)
set_brackets({}, {});
- if (__begin == __end)
- return __begin;
+ if (__begin == __end) [[unlikely]]
+ return __parse_empty_range_underlying_spec(__ctx, __begin);
bool __has_range_underlying_spec = *__begin == _CharT(':');
+ if (__has_range_underlying_spec) {
+ // range-underlying-spec:
+ // : format-spec
+ ++__begin;
+ } else if (__begin != __end && *__begin != _CharT('}'))
+ // When there is no underlaying range the current parse should have
+ // consumed the format-spec. If not, the not consumed input will be
+ // processed by the underlying. For example {:-} for a range in invalid,
+ // the sign field is not present. Without this check the underlying_ will
+ // get -} as input which my be valid.
+ std::__throw_format_error("The format specifier should consume the input or end with a '}'");
+
+ __ctx.advance_to(__begin);
+ __begin = __underlying_.parse(__ctx);
+
+ // This test should not be required if __has_range_underlying_spec is false.
+ // However this test makes sure the underlying formatter left the parser in
+ // a valid state. (Note this is not a full protection against evil parsers.
+ // For example
+ // } this is test for the next argument {}
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
+ // could consume more than it should.
+ if (__begin != __end && *__begin != _CharT('}'))
+ std::__throw_format_error("The format specifier should consume the input or end with a '}'");
+
if (__parser_.__type_ != __format_spec::__type::__default) {
// [format.range.formatter]/6
// If the range-type is s or ?s, then there shall be no n option and no
// range-underlying-spec.
- if (__clear_brackets) {
+ if (__parser_.__clear_brackets_) {
if (__parser_.__type_ == __format_spec::__type::__string)
std::__throw_format_error("The n option and type s can't be used together");
std::__throw_format_error("The n option and type ?s can't be used together");
@@ -96,20 +113,6 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT range_formatter {
} else if (!__has_range_underlying_spec)
std::__set_debug_format(__underlying_);
- if (__has_range_underlying_spec) {
- // range-underlying-spec:
- // : format-spec
- ++__begin;
- if (__begin == __end)
- return __begin;
-
- __parse_ctx.advance_to(__begin);
- __begin = __underlying_.parse(__parse_ctx);
- }
-
- if (__begin != __end && *__begin != _CharT('}'))
- std::__throw_format_error("The format-spec should consume the input or end with a '}'");
-
return __begin;
}
@@ -211,7 +214,8 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT range_formatter {
__format_spec::__parser<_CharT> __parser_{.__alignment_ = __format_spec::__alignment::__left};
private:
- _LIBCPP_HIDE_FROM_ABI constexpr void __parse_type(const _CharT*& __begin, const _CharT* __end) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr void __parse_type(_Iterator& __begin, _Iterator __end) {
switch (*__begin) {
case _CharT('m'):
if constexpr (__fmt_pair_like<_Tp>) {
@@ -219,7 +223,7 @@ private:
set_separator(_LIBCPP_STATICALLY_WIDEN(_CharT, ", "));
++__begin;
} else
- std::__throw_format_error("The range-format-spec type m requires two elements for a pair or tuple");
+ std::__throw_format_error("Type m requires a pair or a tuple with two elements");
break;
case _CharT('s'):
@@ -227,28 +231,39 @@ private:
__parser_.__type_ = __format_spec::__type::__string;
++__begin;
} else
- std::__throw_format_error("The range-format-spec type s requires formatting a character type");
+ std::__throw_format_error("Type s requires character type as formatting argument");
break;
case _CharT('?'):
++__begin;
if (__begin == __end || *__begin != _CharT('s'))
- std::__throw_format_error("The format-spec should consume the input or end with a '}'");
+ std::__throw_format_error("The format specifier should consume the input or end with a '}'");
if constexpr (same_as<_Tp, _CharT>) {
__parser_.__type_ = __format_spec::__type::__debug;
++__begin;
} else
- std::__throw_format_error("The range-format-spec type ?s requires formatting a character type");
+ std::__throw_format_error("Type ?s requires character type as formatting argument");
}
}
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator
+ __parse_empty_range_underlying_spec(_ParseContext& __ctx, typename _ParseContext::iterator __begin) {
+ __ctx.advance_to(__begin);
+ [[maybe_unused]] typename _ParseContext::iterator __result = __underlying_.parse(__ctx);
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __result == __begin,
+ "the underlying's parse function should not advance the input beyond the end of the input");
+ return __begin;
+ }
+
formatter<_Tp, _CharT> __underlying_;
basic_string_view<_CharT> __separator_ = _LIBCPP_STATICALLY_WIDEN(_CharT, ", ");
basic_string_view<_CharT> __opening_bracket_ = _LIBCPP_STATICALLY_WIDEN(_CharT, "[");
basic_string_view<_CharT> __closing_bracket_ = _LIBCPP_STATICALLY_WIDEN(_CharT, "]");
};
-#endif //_LIBCPP_STD_VER > 20
+#endif //_LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/unicode.h b/contrib/libs/cxxsupp/libcxx/include/__format/unicode.h
index 43272587608..8666f80c78a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__format/unicode.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/unicode.h
@@ -11,11 +11,13 @@
#define _LIBCPP___FORMAT_UNICODE_H
#include <__assert>
+#include <__bit/countl.h>
+#include <__concepts/same_as.h>
#include <__config>
#include <__format/extended_grapheme_cluster_table.h>
-#include <__type_traits/make_unsigned.h>
-#include <__utility/unreachable.h>
-#include <bit>
+#include <__iterator/concepts.h>
+#include <__iterator/readable_traits.h> // iter_value_t
+#include <string_view>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -23,27 +25,32 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __unicode {
-# if _LIBCPP_STD_VER > 20
-
-/// The result of consuming a code point using P2286' semantics
-///
-/// TODO FMT Combine __consume and __consume_p2286 in one function.
-struct __consume_p2286_result {
- // A size of 0 means well formed. This to differenciate between
- // a valid code point and a code unit that's invalid like 0b11111xxx.
- int __ill_formed_size;
-
- // If well formed the consumed code point.
- // Otherwise the ill-formed code units as unsigned 8-bit values. They are
- // stored in reverse order, to make it easier to extract the values.
- char32_t __value;
+// Helper struct for the result of a consume operation.
+//
+// The status value for a correct code point is 0. This allows a valid value to
+// be used without masking.
+// When the decoding fails it know the number of code units affected. For the
+// current use-cases that value is not needed, therefore it is not stored.
+// The escape routine needs the number of code units for both a valid and
+// invalid character and keeps track of it itself. Doing it in this result
+// unconditionally would give some overhead when the value is unneeded.
+struct __consume_result {
+ // When __status == __ok it contains the decoded code point.
+ // Else it contains the replacement character U+FFFD
+ char32_t __code_point : 31;
+
+ enum : char32_t {
+ // Consumed a well-formed code point.
+ __ok = 0,
+ // Encountered invalid UTF-8
+ __error = 1
+ } __status : 1 {__ok};
};
-
-# endif // _LIBCPP_STD_VER > 20
+static_assert(sizeof(__consume_result) == sizeof(char32_t));
# ifndef _LIBCPP_HAS_NO_UNICODE
@@ -62,9 +69,41 @@ struct __consume_p2286_result {
inline constexpr char32_t __replacement_character = U'\ufffd';
-_LIBCPP_HIDE_FROM_ABI constexpr bool __is_continuation(const char* __char, int __count) {
+// The error of a consume operation.
+//
+// This sets the code point to the replacement character. This code point does
+// not participate in the grapheme clustering, so grapheme clustering code can
+// ignore the error status and always use the code point.
+inline constexpr __consume_result __consume_result_error{__replacement_character, __consume_result::__error};
+
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool __is_high_surrogate(char32_t __value) {
+ return __value >= 0xd800 && __value <= 0xdbff;
+}
+
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool __is_low_surrogate(char32_t __value) {
+ return __value >= 0xdc00 && __value <= 0xdfff;
+}
+
+// https://www.unicode.org/glossary/#surrogate_code_point
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool __is_surrogate(char32_t __value) {
+ return __value >= 0xd800 && __value <= 0xdfff;
+}
+
+// https://www.unicode.org/glossary/#code_point
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool __is_code_point(char32_t __value) {
+ return __value <= 0x10ffff;
+}
+
+// https://www.unicode.org/glossary/#unicode_scalar_value
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool __is_scalar_value(char32_t __value) {
+ return __unicode::__is_code_point(__value) && !__unicode::__is_surrogate(__value);
+}
+
+template <contiguous_iterator _Iterator>
+ requires same_as<iter_value_t<_Iterator>, char>
+_LIBCPP_HIDE_FROM_ABI constexpr bool __is_continuation(_Iterator __char, int __count) {
do {
- if ((*__char & 0b1000'0000) != 0b1000'0000)
+ if ((*__char & 0b1100'0000) != 0b1000'0000)
return false;
--__count;
++__char;
@@ -82,133 +121,116 @@ class __code_point_view;
/// UTF-8 specialization.
template <>
class __code_point_view<char> {
+ using _Iterator = basic_string_view<char>::const_iterator;
+
public:
- _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(const char* __first, const char* __last)
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(_Iterator __first, _Iterator __last)
: __first_(__first), __last_(__last) {}
_LIBCPP_HIDE_FROM_ABI constexpr bool __at_end() const noexcept { return __first_ == __last_; }
- _LIBCPP_HIDE_FROM_ABI constexpr const char* __position() const noexcept { return __first_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iterator __position() const noexcept { return __first_; }
- _LIBCPP_HIDE_FROM_ABI constexpr char32_t __consume() noexcept {
- _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
+ // https://www.unicode.org/versions/latest/ch03.pdf#G7404
+ // Based on Table 3-7, Well-Formed UTF-8 Byte Sequences
+ //
+ // Code Points First Byte Second Byte Third Byte Fourth Byte Remarks
+ // U+0000..U+007F 00..7F U+0000..U+007F 1 code unit range
+ // C0..C1 80..BF invalid overlong encoding
+ // U+0080..U+07FF C2..DF 80..BF U+0080..U+07FF 2 code unit range
+ // E0 80..9F 80..BF invalid overlong encoding
+ // U+0800..U+0FFF E0 A0..BF 80..BF U+0800..U+FFFF 3 code unit range
+ // U+1000..U+CFFF E1..EC 80..BF 80..BF
+ // U+D000..U+D7FF ED 80..9F 80..BF
+ // U+D800..U+DFFF ED A0..BF 80..BF invalid encoding of surrogate code point
+ // U+E000..U+FFFF EE..EF 80..BF 80..BF
+ // F0 80..8F 80..BF 80..BF invalid overlong encoding
+ // U+10000..U+3FFFF F0 90..BF 80..BF 80..BF U+10000..U+10FFFF 4 code unit range
+ // U+40000..U+FFFFF F1..F3 80..BF 80..BF 80..BF
+ // U+100000..U+10FFFF F4 80..8F 80..BF 80..BF
+ // F4 90..BF 80..BF 80..BF U+110000.. invalid code point range
+ //
+ // Unlike other parsers, these invalid entries are tested after decoding.
+ // - The parser always needs to consume these code units
+ // - The code is optimized for well-formed UTF-8
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __consume_result __consume() noexcept {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first_ != __last_, "can't move beyond the end of input");
// Based on the number of leading 1 bits the number of code units in the
// code point can be determined. See
// https://en.wikipedia.org/wiki/UTF-8#Encoding
- switch (_VSTD::countl_one(static_cast<unsigned char>(*__first_))) {
+ switch (std::countl_one(static_cast<unsigned char>(*__first_))) {
case 0:
- return *__first_++;
+ return {static_cast<unsigned char>(*__first_++)};
- case 2:
+ case 2: {
if (__last_ - __first_ < 2 || !__unicode::__is_continuation(__first_ + 1, 1)) [[unlikely]]
break;
- else {
- char32_t __value = static_cast<unsigned char>(*__first_++) & 0x1f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- return __value;
- }
- case 3:
- if (__last_ - __first_ < 3 || !__unicode::__is_continuation(__first_ + 1, 2)) [[unlikely]]
- break;
- else {
- char32_t __value = static_cast<unsigned char>(*__first_++) & 0x0f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- return __value;
- }
+ char32_t __value = static_cast<unsigned char>(*__first_++) & 0x1f;
+ __value <<= 6;
+ __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- case 4:
- if (__last_ - __first_ < 4 || !__unicode::__is_continuation(__first_ + 1, 3)) [[unlikely]]
- break;
- else {
- char32_t __value = static_cast<unsigned char>(*__first_++) & 0x07;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- return __value;
- }
- }
- // An invalid number of leading ones can be garbage or a code unit in the
- // middle of a code point. By consuming one code unit the parser may get
- // "in sync" after a few code units.
- ++__first_;
- return __replacement_character;
- }
-
-# if _LIBCPP_STD_VER > 20
- _LIBCPP_HIDE_FROM_ABI constexpr __consume_p2286_result __consume_p2286() noexcept {
- _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
+ // These values should be encoded in 1 UTF-8 code unit.
+ if (__value < 0x0080) [[unlikely]]
+ return __consume_result_error;
- // Based on the number of leading 1 bits the number of code units in the
- // code point can be determined. See
- // https://en.wikipedia.org/wiki/UTF-8#Encoding
- switch (std::countl_one(static_cast<unsigned char>(*__first_))) {
- case 0:
- return {0, static_cast<unsigned char>(*__first_++)};
+ return {__value};
+ }
- case 2:
- if (__last_ - __first_ < 2) [[unlikely]]
+ case 3: {
+ if (__last_ - __first_ < 3 || !__unicode::__is_continuation(__first_ + 1, 2)) [[unlikely]]
break;
- if (__unicode::__is_continuation(__first_ + 1, 1)) {
- char32_t __value = static_cast<unsigned char>(*__first_++) & 0x1f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- return {0, __value};
- }
- break;
+ char32_t __value = static_cast<unsigned char>(*__first_++) & 0x0f;
+ __value <<= 6;
+ __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
+ __value <<= 6;
+ __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- case 3:
- if (__last_ - __first_ < 3) [[unlikely]]
- break;
+ // These values should be encoded in 1 or 2 UTF-8 code units.
+ if (__value < 0x0800) [[unlikely]]
+ return __consume_result_error;
- if (__unicode::__is_continuation(__first_ + 1, 2)) {
- char32_t __value = static_cast<unsigned char>(*__first_++) & 0x0f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- return {0, __value};
- }
- break;
+ // A surrogate value is always encoded in 3 UTF-8 code units.
+ if (__unicode::__is_surrogate(__value)) [[unlikely]]
+ return __consume_result_error;
+
+ return {__value};
+ }
- case 4:
- if (__last_ - __first_ < 4) [[unlikely]]
+ case 4: {
+ if (__last_ - __first_ < 4 || !__unicode::__is_continuation(__first_ + 1, 3)) [[unlikely]]
break;
- if (__unicode::__is_continuation(__first_ + 1, 3)) {
- char32_t __value = static_cast<unsigned char>(*__first_++) & 0x07;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
+ char32_t __value = static_cast<unsigned char>(*__first_++) & 0x07;
+ __value <<= 6;
+ __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
+ __value <<= 6;
+ __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
+ __value <<= 6;
+ __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- if (__value > 0x10FFFF) // Outside the valid Unicode range?
- return {4, __value};
+ // These values should be encoded in 1, 2, or 3 UTF-8 code units.
+ if (__value < 0x10000) [[unlikely]]
+ return __consume_result_error;
- return {0, __value};
- }
- break;
+ // A value too large is always encoded in 4 UTF-8 code units.
+ if (!__unicode::__is_code_point(__value)) [[unlikely]]
+ return __consume_result_error;
+
+ return {__value};
+ }
}
// An invalid number of leading ones can be garbage or a code unit in the
// middle of a code point. By consuming one code unit the parser may get
// "in sync" after a few code units.
- return {1, static_cast<unsigned char>(*__first_++)};
+ ++__first_;
+ return __consume_result_error;
}
-# endif // _LIBCPP_STD_VER > 20
private:
- const char* __first_;
- const char* __last_;
+ _Iterator __first_;
+ _Iterator __last_;
};
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -225,75 +247,48 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __is_surrogate_pair_low(wchar_t __value) {
/// - 4 UTF-32 (for example Linux)
template <>
class __code_point_view<wchar_t> {
+ using _Iterator = typename basic_string_view<wchar_t>::const_iterator;
+
public:
static_assert(sizeof(wchar_t) == 2 || sizeof(wchar_t) == 4, "sizeof(wchar_t) has a not implemented value");
- _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(const wchar_t* __first, const wchar_t* __last)
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(_Iterator __first, _Iterator __last)
: __first_(__first), __last_(__last) {}
- _LIBCPP_HIDE_FROM_ABI constexpr const wchar_t* __position() const noexcept { return __first_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iterator __position() const noexcept { return __first_; }
_LIBCPP_HIDE_FROM_ABI constexpr bool __at_end() const noexcept { return __first_ == __last_; }
- _LIBCPP_HIDE_FROM_ABI constexpr char32_t __consume() noexcept {
- _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __consume_result __consume() noexcept {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first_ != __last_, "can't move beyond the end of input");
+ char32_t __value = static_cast<char32_t>(*__first_++);
if constexpr (sizeof(wchar_t) == 2) {
- char32_t __result = *__first_++;
- // Is the code unit part of a surrogate pair? See
- // https://en.wikipedia.org/wiki/UTF-16#U+D800_to_U+DFFF
- if (__result >= 0xd800 && __result <= 0xDfff) {
- // Malformed Unicode.
- if (__first_ == __last_) [[unlikely]]
- return __replacement_character;
-
- __result -= 0xd800;
- __result <<= 10;
- __result += *__first_++ - 0xdc00;
- __result += 0x10000;
- }
- return __result;
+ if (__unicode::__is_low_surrogate(__value)) [[unlikely]]
+ return __consume_result_error;
- } else if constexpr (sizeof(wchar_t) == 4) {
- char32_t __result = *__first_++;
- if (__result > 0x10FFFF) [[unlikely]]
- return __replacement_character;
- return __result;
- } else {
- __libcpp_unreachable();
- }
- }
+ if (__unicode::__is_high_surrogate(__value)) {
+ if (__first_ == __last_ || !__unicode::__is_low_surrogate(static_cast<char32_t>(*__first_))) [[unlikely]]
+ return __consume_result_error;
-# if _LIBCPP_STD_VER > 20
- _LIBCPP_HIDE_FROM_ABI constexpr __consume_p2286_result __consume_p2286() noexcept {
- _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
+ __value -= 0xd800;
+ __value <<= 10;
+ __value += static_cast<char32_t>(*__first_++) - 0xdc00;
+ __value += 0x10000;
- char32_t __result = *__first_++;
- if constexpr (sizeof(wchar_t) == 2) {
- // https://en.wikipedia.org/wiki/UTF-16#U+D800_to_U+DFFF
- if (__is_surrogate_pair_high(__result)) {
- // Malformed Unicode.
- if (__first_ == __last_ || !__is_surrogate_pair_low(*(__first_ + 1))) [[unlikely]]
- return {1, __result};
-
- __result -= 0xd800;
- __result <<= 10;
- __result += *__first_++ - 0xdc00;
- __result += 0x10000;
- } else if (__is_surrogate_pair_low(__result))
- // A code point shouldn't start with the low surrogate pair
- return {1, __result};
+ if (!__unicode::__is_code_point(__value)) [[unlikely]]
+ return __consume_result_error;
+ }
} else {
- if (__result > 0x10FFFF) [[unlikely]]
- return {1, __result};
+ if (!__unicode::__is_scalar_value(__value)) [[unlikely]]
+ return __consume_result_error;
}
- return {0, __result};
+ return {__value};
}
-# endif // _LIBCPP_STD_VER > 20
private:
- const wchar_t* __first_;
- const wchar_t* __last_;
+ _Iterator __first_;
+ _Iterator __last_;
};
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -310,8 +305,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __at_extended_grapheme_cluster_break(
// *** Break at the start and end of text, unless the text is empty. ***
- _LIBCPP_ASSERT(__prev != __property::__sot, "should be handled in the constructor"); // GB1
- _LIBCPP_ASSERT(__prev != __property::__eot, "should be handled by our caller"); // GB2
+ _LIBCPP_ASSERT_UNCATEGORIZED(__prev != __property::__sot, "should be handled in the constructor"); // GB1
+ _LIBCPP_ASSERT_UNCATEGORIZED(__prev != __property::__eot, "should be handled by our caller"); // GB2
// *** Do not break between a CR and LF. Otherwise, break before and after controls. ***
if (__prev == __property::__CR && __next == __property::__LF) // GB3
@@ -384,10 +379,12 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __at_extended_grapheme_cluster_break(
/// Therefore only this code point is extracted.
template <class _CharT>
class __extended_grapheme_cluster_view {
+ using _Iterator = typename basic_string_view<_CharT>::const_iterator;
+
public:
- _LIBCPP_HIDE_FROM_ABI constexpr explicit __extended_grapheme_cluster_view(const _CharT* __first, const _CharT* __last)
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __extended_grapheme_cluster_view(_Iterator __first, _Iterator __last)
: __code_point_view_(__first, __last),
- __next_code_point_(__code_point_view_.__consume()),
+ __next_code_point_(__code_point_view_.__consume().__code_point),
__next_prop_(__extended_grapheme_custer_property_boundary::__get_property(__next_code_point_)) {}
struct __cluster {
@@ -401,13 +398,14 @@ public:
///
/// It's expected the caller has the start position and thus can determine
/// the code unit range of the extended grapheme cluster.
- const _CharT* __last_;
+ _Iterator __last_;
};
_LIBCPP_HIDE_FROM_ABI constexpr __cluster __consume() {
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__next_prop_ != __extended_grapheme_custer_property_boundary::__property::__eot,
"can't move beyond the end of input");
+
char32_t __code_point = __next_code_point_;
if (!__code_point_view_.__at_end())
return {__code_point, __get_break()};
@@ -422,17 +420,17 @@ private:
char32_t __next_code_point_;
__extended_grapheme_custer_property_boundary::__property __next_prop_;
- _LIBCPP_HIDE_FROM_ABI constexpr const _CharT* __get_break() {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iterator __get_break() {
bool __ri_break_allowed = true;
bool __has_extened_pictographic = false;
while (true) {
- const _CharT* __result = __code_point_view_.__position();
+ _Iterator __result = __code_point_view_.__position();
__extended_grapheme_custer_property_boundary::__property __prev = __next_prop_;
if (__code_point_view_.__at_end()) {
__next_prop_ = __extended_grapheme_custer_property_boundary::__property::__eot;
return __result;
}
- __next_code_point_ = __code_point_view_.__consume();
+ __next_code_point_ = __code_point_view_.__consume().__code_point;
__next_prop_ = __extended_grapheme_custer_property_boundary::__get_property(__next_code_point_);
__has_extened_pictographic |=
@@ -444,8 +442,8 @@ private:
}
};
-template <class _CharT>
-__extended_grapheme_cluster_view(const _CharT*, const _CharT*) -> __extended_grapheme_cluster_view<_CharT>;
+template <contiguous_iterator _Iterator>
+__extended_grapheme_cluster_view(_Iterator, _Iterator) -> __extended_grapheme_cluster_view<iter_value_t<_Iterator>>;
# else // _LIBCPP_HAS_NO_UNICODE
@@ -453,36 +451,30 @@ __extended_grapheme_cluster_view(const _CharT*, const _CharT*) -> __extended_gra
// This makes it easier to write code agnostic of the _LIBCPP_HAS_NO_UNICODE define.
template <class _CharT>
class __code_point_view {
+ using _Iterator = typename basic_string_view<_CharT>::const_iterator;
+
public:
- _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(const _CharT* __first, const _CharT* __last)
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(_Iterator __first, _Iterator __last)
: __first_(__first), __last_(__last) {}
_LIBCPP_HIDE_FROM_ABI constexpr bool __at_end() const noexcept { return __first_ == __last_; }
- _LIBCPP_HIDE_FROM_ABI constexpr const _CharT* __position() const noexcept { return __first_; }
-
- _LIBCPP_HIDE_FROM_ABI constexpr char32_t __consume() noexcept {
- _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
- return *__first_++;
- }
-
-# if _LIBCPP_STD_VER > 20
- _LIBCPP_HIDE_FROM_ABI constexpr __consume_p2286_result __consume_p2286() noexcept {
- _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iterator __position() const noexcept { return __first_; }
- return {0, std::make_unsigned_t<_CharT>(*__first_++)};
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __consume_result __consume() noexcept {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first_ != __last_, "can't move beyond the end of input");
+ return {static_cast<char32_t>(*__first_++)};
}
-# endif // _LIBCPP_STD_VER > 20
private:
- const _CharT* __first_;
- const _CharT* __last_;
+ _Iterator __first_;
+ _Iterator __last_;
};
# endif // _LIBCPP_HAS_NO_UNICODE
} // namespace __unicode
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/width_estimation_table.h b/contrib/libs/cxxsupp/libcxx/include/__format/width_estimation_table.h
new file mode 100644
index 00000000000..cfb488975d5
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/width_estimation_table.h
@@ -0,0 +1,271 @@
+// -*- 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
+//
+//===----------------------------------------------------------------------===//
+
+// WARNING, this entire header is generated by
+// utils/generate_width_estimation_table.py
+// DO NOT MODIFY!
+
+// UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
+//
+// See Terms of Use <https://www.unicode.org/copyright.html>
+// for definitions of Unicode Inc.'s Data Files and Software.
+//
+// NOTICE TO USER: Carefully read the following legal agreement.
+// BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
+// DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
+// YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
+// TERMS AND CONDITIONS OF THIS AGREEMENT.
+// IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
+// THE DATA FILES OR SOFTWARE.
+//
+// COPYRIGHT AND PERMISSION NOTICE
+//
+// Copyright (c) 1991-2022 Unicode, Inc. All rights reserved.
+// Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of the Unicode data files and any associated documentation
+// (the "Data Files") or Unicode software and any associated documentation
+// (the "Software") to deal in the Data Files or Software
+// without restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, and/or sell copies of
+// the Data Files or Software, and to permit persons to whom the Data Files
+// or Software are furnished to do so, provided that either
+// (a) this copyright and permission notice appear with all copies
+// of the Data Files or Software, or
+// (b) this copyright and permission notice appear in associated
+// Documentation.
+//
+// THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+// NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
+// DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+//
+// Except as contained in this notice, the name of a copyright holder
+// shall not be used in advertising or otherwise to promote the sale,
+// use or other dealings in these Data Files or Software without prior
+// written authorization of the copyright holder.
+
+#ifndef _LIBCPP___FORMAT_WIDTH_ESTIMATION_TABLE_H
+#define _LIBCPP___FORMAT_WIDTH_ESTIMATION_TABLE_H
+
+#include <__algorithm/ranges_upper_bound.h>
+#include <__config>
+#include <cstddef>
+#include <cstdint>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 20
+
+namespace __width_estimation_table {
+
+/// The entries of the characters with an estimated width of 2.
+///
+/// Contains the entries for [format.string.std]/12
+/// - Any code point with the East_Asian_Width="W" or East_Asian_Width="F"
+/// Derived Extracted Property as described by UAX #44
+/// - U+4DC0 - U+4DFF (Yijing Hexagram Symbols)
+/// - U+1F300 - U+1F5FF (Miscellaneous Symbols and Pictographs)
+/// - U+1F900 - U+1F9FF (Supplemental Symbols and Pictographs)
+///
+/// The data is generated from
+/// - https://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt
+/// - The "overrides" in [format.string.std]/12
+///
+/// The format of EastAsianWidth.txt is two fields separated by a semicolon.
+/// Field 0: Unicode code point value or range of code point values
+/// Field 1: East_Asian_Width property, consisting of one of the following values:
+/// "A", "F", "H", "N", "Na", "W"
+/// - All code points, assigned or unassigned, that are not listed
+/// explicitly are given the value "N".
+/// - The unassigned code points in the following blocks default to "W":
+/// CJK Unified Ideographs Extension A: U+3400..U+4DBF
+/// CJK Unified Ideographs: U+4E00..U+9FFF
+/// CJK Compatibility Ideographs: U+F900..U+FAFF
+/// - All undesignated code points in Planes 2 and 3, whether inside or
+/// outside of allocated blocks, default to "W":
+/// Plane 2: U+20000..U+2FFFD
+/// Plane 3: U+30000..U+3FFFD
+///
+/// The table is similar to the table
+/// __extended_grapheme_custer_property_boundary::__entries
+/// which explains the details of these classes. The only difference is this
+/// table lacks a property, thus having more bits available for the size.
+///
+/// The maximum code point that has an estimated width of 2 is U+3FFFD. This
+/// value can be encoded in 18 bits. Thus the upper 3 bits of the code point
+/// are always 0. These 3 bits are used to enlarge the offset range. This
+/// optimization reduces the table in Unicode 15 from 184 to 104 entries,
+/// saving 320 bytes.
+///
+/// The data has 2 values:
+/// - bits [0, 13] The size of the range, allowing 16384 elements.
+/// - bits [14, 31] The lower bound code point of the range. The upper bound of
+/// the range is lower bound + size.
+inline constexpr uint32_t __entries[108] = {
+ 0x0440005f /* 00001100 - 0000115f [ 96] */, //
+ 0x08c68001 /* 0000231a - 0000231b [ 2] */, //
+ 0x08ca4001 /* 00002329 - 0000232a [ 2] */, //
+ 0x08fa4003 /* 000023e9 - 000023ec [ 4] */, //
+ 0x08fc0000 /* 000023f0 - 000023f0 [ 1] */, //
+ 0x08fcc000 /* 000023f3 - 000023f3 [ 1] */, //
+ 0x097f4001 /* 000025fd - 000025fe [ 2] */, //
+ 0x09850001 /* 00002614 - 00002615 [ 2] */, //
+ 0x0992000b /* 00002648 - 00002653 [ 12] */, //
+ 0x099fc000 /* 0000267f - 0000267f [ 1] */, //
+ 0x09a4c000 /* 00002693 - 00002693 [ 1] */, //
+ 0x09a84000 /* 000026a1 - 000026a1 [ 1] */, //
+ 0x09aa8001 /* 000026aa - 000026ab [ 2] */, //
+ 0x09af4001 /* 000026bd - 000026be [ 2] */, //
+ 0x09b10001 /* 000026c4 - 000026c5 [ 2] */, //
+ 0x09b38000 /* 000026ce - 000026ce [ 1] */, //
+ 0x09b50000 /* 000026d4 - 000026d4 [ 1] */, //
+ 0x09ba8000 /* 000026ea - 000026ea [ 1] */, //
+ 0x09bc8001 /* 000026f2 - 000026f3 [ 2] */, //
+ 0x09bd4000 /* 000026f5 - 000026f5 [ 1] */, //
+ 0x09be8000 /* 000026fa - 000026fa [ 1] */, //
+ 0x09bf4000 /* 000026fd - 000026fd [ 1] */, //
+ 0x09c14000 /* 00002705 - 00002705 [ 1] */, //
+ 0x09c28001 /* 0000270a - 0000270b [ 2] */, //
+ 0x09ca0000 /* 00002728 - 00002728 [ 1] */, //
+ 0x09d30000 /* 0000274c - 0000274c [ 1] */, //
+ 0x09d38000 /* 0000274e - 0000274e [ 1] */, //
+ 0x09d4c002 /* 00002753 - 00002755 [ 3] */, //
+ 0x09d5c000 /* 00002757 - 00002757 [ 1] */, //
+ 0x09e54002 /* 00002795 - 00002797 [ 3] */, //
+ 0x09ec0000 /* 000027b0 - 000027b0 [ 1] */, //
+ 0x09efc000 /* 000027bf - 000027bf [ 1] */, //
+ 0x0ac6c001 /* 00002b1b - 00002b1c [ 2] */, //
+ 0x0ad40000 /* 00002b50 - 00002b50 [ 1] */, //
+ 0x0ad54000 /* 00002b55 - 00002b55 [ 1] */, //
+ 0x0ba00019 /* 00002e80 - 00002e99 [ 26] */, //
+ 0x0ba6c058 /* 00002e9b - 00002ef3 [ 89] */, //
+ 0x0bc000d5 /* 00002f00 - 00002fd5 [ 214] */, //
+ 0x0bfc000b /* 00002ff0 - 00002ffb [ 12] */, //
+ 0x0c00003e /* 00003000 - 0000303e [ 63] */, //
+ 0x0c104055 /* 00003041 - 00003096 [ 86] */, //
+ 0x0c264066 /* 00003099 - 000030ff [ 103] */, //
+ 0x0c41402a /* 00003105 - 0000312f [ 43] */, //
+ 0x0c4c405d /* 00003131 - 0000318e [ 94] */, //
+ 0x0c640053 /* 00003190 - 000031e3 [ 84] */, //
+ 0x0c7c002e /* 000031f0 - 0000321e [ 47] */, //
+ 0x0c880027 /* 00003220 - 00003247 [ 40] */, //
+ 0x0c943fff /* 00003250 - 0000724f [16384] */, //
+ 0x1c94323c /* 00007250 - 0000a48c [12861] */, //
+ 0x29240036 /* 0000a490 - 0000a4c6 [ 55] */, //
+ 0x2a58001c /* 0000a960 - 0000a97c [ 29] */, //
+ 0x2b002ba3 /* 0000ac00 - 0000d7a3 [11172] */, //
+ 0x3e4001ff /* 0000f900 - 0000faff [ 512] */, //
+ 0x3f840009 /* 0000fe10 - 0000fe19 [ 10] */, //
+ 0x3f8c0022 /* 0000fe30 - 0000fe52 [ 35] */, //
+ 0x3f950012 /* 0000fe54 - 0000fe66 [ 19] */, //
+ 0x3f9a0003 /* 0000fe68 - 0000fe6b [ 4] */, //
+ 0x3fc0405f /* 0000ff01 - 0000ff60 [ 96] */, //
+ 0x3ff80006 /* 0000ffe0 - 0000ffe6 [ 7] */, //
+ 0x5bf80004 /* 00016fe0 - 00016fe4 [ 5] */, //
+ 0x5bfc0001 /* 00016ff0 - 00016ff1 [ 2] */, //
+ 0x5c0017f7 /* 00017000 - 000187f7 [ 6136] */, //
+ 0x620004d5 /* 00018800 - 00018cd5 [ 1238] */, //
+ 0x63400008 /* 00018d00 - 00018d08 [ 9] */, //
+ 0x6bfc0003 /* 0001aff0 - 0001aff3 [ 4] */, //
+ 0x6bfd4006 /* 0001aff5 - 0001affb [ 7] */, //
+ 0x6bff4001 /* 0001affd - 0001affe [ 2] */, //
+ 0x6c000122 /* 0001b000 - 0001b122 [ 291] */, //
+ 0x6c4c8000 /* 0001b132 - 0001b132 [ 1] */, //
+ 0x6c540002 /* 0001b150 - 0001b152 [ 3] */, //
+ 0x6c554000 /* 0001b155 - 0001b155 [ 1] */, //
+ 0x6c590003 /* 0001b164 - 0001b167 [ 4] */, //
+ 0x6c5c018b /* 0001b170 - 0001b2fb [ 396] */, //
+ 0x7c010000 /* 0001f004 - 0001f004 [ 1] */, //
+ 0x7c33c000 /* 0001f0cf - 0001f0cf [ 1] */, //
+ 0x7c638000 /* 0001f18e - 0001f18e [ 1] */, //
+ 0x7c644009 /* 0001f191 - 0001f19a [ 10] */, //
+ 0x7c800002 /* 0001f200 - 0001f202 [ 3] */, //
+ 0x7c84002b /* 0001f210 - 0001f23b [ 44] */, //
+ 0x7c900008 /* 0001f240 - 0001f248 [ 9] */, //
+ 0x7c940001 /* 0001f250 - 0001f251 [ 2] */, //
+ 0x7c980005 /* 0001f260 - 0001f265 [ 6] */, //
+ 0x7cc0034f /* 0001f300 - 0001f64f [ 848] */, //
+ 0x7da00045 /* 0001f680 - 0001f6c5 [ 70] */, //
+ 0x7db30000 /* 0001f6cc - 0001f6cc [ 1] */, //
+ 0x7db40002 /* 0001f6d0 - 0001f6d2 [ 3] */, //
+ 0x7db54002 /* 0001f6d5 - 0001f6d7 [ 3] */, //
+ 0x7db70003 /* 0001f6dc - 0001f6df [ 4] */, //
+ 0x7dbac001 /* 0001f6eb - 0001f6ec [ 2] */, //
+ 0x7dbd0008 /* 0001f6f4 - 0001f6fc [ 9] */, //
+ 0x7df8000b /* 0001f7e0 - 0001f7eb [ 12] */, //
+ 0x7dfc0000 /* 0001f7f0 - 0001f7f0 [ 1] */, //
+ 0x7e4000ff /* 0001f900 - 0001f9ff [ 256] */, //
+ 0x7e9c000c /* 0001fa70 - 0001fa7c [ 13] */, //
+ 0x7ea00008 /* 0001fa80 - 0001fa88 [ 9] */, //
+ 0x7ea4002d /* 0001fa90 - 0001fabd [ 46] */, //
+ 0x7eafc006 /* 0001fabf - 0001fac5 [ 7] */, //
+ 0x7eb3800d /* 0001face - 0001fadb [ 14] */, //
+ 0x7eb80008 /* 0001fae0 - 0001fae8 [ 9] */, //
+ 0x7ebc0008 /* 0001faf0 - 0001faf8 [ 9] */, //
+ 0x80003fff /* 00020000 - 00023fff [16384] */, //
+ 0x90003fff /* 00024000 - 00027fff [16384] */, //
+ 0xa0003fff /* 00028000 - 0002bfff [16384] */, //
+ 0xb0003ffd /* 0002c000 - 0002fffd [16382] */, //
+ 0xc0003fff /* 00030000 - 00033fff [16384] */, //
+ 0xd0003fff /* 00034000 - 00037fff [16384] */, //
+ 0xe0003fff /* 00038000 - 0003bfff [16384] */, //
+ 0xf0003ffd /* 0003c000 - 0003fffd [16382] */};
+
+/// The upper bound entry of EastAsianWidth.txt.
+///
+/// Values greater than this value may have more than 18 significant bits.
+/// They always have a width of 1. This property makes it possible to store
+/// the table in its compact form.
+inline constexpr uint32_t __table_upper_bound = 0x0003fffd;
+
+/// Returns the estimated width of a Unicode code point.
+///
+/// \pre The code point is a valid Unicode code point.
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int __estimated_width(const char32_t __code_point) noexcept {
+ // Since __table_upper_bound contains the unshifted range do the
+ // comparison without shifting.
+ if (__code_point > __table_upper_bound) [[unlikely]]
+ return 1;
+
+ // When the code-point is less than the first element in the table
+ // the lookup is quite expensive. Since quite some scripts are in
+ // that range, it makes sense to validate that first.
+ // The std_format_spec_string_unicode benchmark gives a measurable
+ // improvement.
+ if (__code_point < (__entries[0] >> 14))
+ return 1;
+
+ ptrdiff_t __i = std::ranges::upper_bound(__entries, (__code_point << 14) | 0x3fffu) - __entries;
+ if (__i == 0)
+ return 1;
+
+ --__i;
+ uint32_t __upper_bound = (__entries[__i] >> 14) + (__entries[__i] & 0x3fffu);
+ return 1 + (__code_point <= __upper_bound);
+}
+
+} // namespace __width_estimation_table
+
+#endif //_LIBCPP_STD_VER >= 20
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FORMAT_WIDTH_ESTIMATION_TABLE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__format/write_escaped.h b/contrib/libs/cxxsupp/libcxx/include/__format/write_escaped.h
new file mode 100644
index 00000000000..8c51d0b1f14
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__format/write_escaped.h
@@ -0,0 +1,222 @@
+// -*- 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___FORMAT_WRITE_ESCAPED_H
+#define _LIBCPP___FORMAT_WRITE_ESCAPED_H
+
+#include <__algorithm/ranges_copy.h>
+#include <__algorithm/ranges_for_each.h>
+#include <__charconv/to_chars_integral.h>
+#include <__charconv/to_chars_result.h>
+#include <__chrono/statically_widen.h>
+#include <__format/escaped_output_table.h>
+#include <__format/formatter_output.h>
+#include <__format/parser_std_format_spec.h>
+#include <__format/unicode.h>
+#include <__iterator/back_insert_iterator.h>
+#include <__memory/addressof.h>
+#include <__system_error/errc.h>
+#include <__type_traits/make_unsigned.h>
+#include <__utility/move.h>
+#include <string_view>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+
+namespace __formatter {
+
+#if _LIBCPP_STD_VER >= 20
+
+/// Writes a string using format's width estimation algorithm.
+///
+/// \note When \c _LIBCPP_HAS_NO_UNICODE is defined the function assumes the
+/// input is ASCII.
+template <class _CharT>
+_LIBCPP_HIDE_FROM_ABI auto __write_string(
+ basic_string_view<_CharT> __str,
+ output_iterator<const _CharT&> auto __out_it,
+ __format_spec::__parsed_specifications<_CharT> __specs) -> decltype(__out_it) {
+ if (!__specs.__has_precision())
+ return __formatter::__write_string_no_precision(__str, _VSTD::move(__out_it), __specs);
+
+ int __size = __formatter::__truncate(__str, __specs.__precision_);
+
+ return __formatter::__write(__str.begin(), __str.end(), _VSTD::move(__out_it), __specs, __size);
+}
+
+# endif // _LIBCPP_STD_VER >= 20
+# if _LIBCPP_STD_VER >= 23
+
+struct __nul_terminator {};
+
+template <class _CharT>
+_LIBCPP_HIDE_FROM_ABI bool operator==(const _CharT* __cstr, __nul_terminator) {
+ return *__cstr == _CharT('\0');
+}
+
+template <class _CharT>
+_LIBCPP_HIDE_FROM_ABI void
+__write_escaped_code_unit(basic_string<_CharT>& __str, char32_t __value, const _CharT* __prefix) {
+ back_insert_iterator __out_it{__str};
+ std::ranges::copy(__prefix, __nul_terminator{}, __out_it);
+
+ char __buffer[8];
+ to_chars_result __r = std::to_chars(std::begin(__buffer), std::end(__buffer), __value, 16);
+ _LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
+ std::ranges::copy(std::begin(__buffer), __r.ptr, __out_it);
+
+ __str += _CharT('}');
+}
+
+// [format.string.escaped]/2.2.1.2
+// ...
+// then the sequence \u{hex-digit-sequence} is appended to E, where
+// hex-digit-sequence is the shortest hexadecimal representation of C using
+// lower-case hexadecimal digits.
+template <class _CharT>
+_LIBCPP_HIDE_FROM_ABI void __write_well_formed_escaped_code_unit(basic_string<_CharT>& __str, char32_t __value) {
+ __formatter::__write_escaped_code_unit(__str, __value, _LIBCPP_STATICALLY_WIDEN(_CharT, "\\u{"));
+}
+
+// [format.string.escaped]/2.2.3
+// Otherwise (X is a sequence of ill-formed code units), each code unit U is
+// appended to E in order as the sequence \x{hex-digit-sequence}, where
+// hex-digit-sequence is the shortest hexadecimal representation of U using
+// lower-case hexadecimal digits.
+template <class _CharT>
+_LIBCPP_HIDE_FROM_ABI void __write_escape_ill_formed_code_unit(basic_string<_CharT>& __str, char32_t __value) {
+ __formatter::__write_escaped_code_unit(__str, __value, _LIBCPP_STATICALLY_WIDEN(_CharT, "\\x{"));
+}
+
+template <class _CharT>
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool __is_escaped_sequence_written(basic_string<_CharT>& __str, char32_t __value) {
+# ifdef _LIBCPP_HAS_NO_UNICODE
+ // For ASCII assume everything above 127 is printable.
+ if (__value > 127)
+ return false;
+# endif
+
+ if (!__escaped_output_table::__needs_escape(__value))
+ return false;
+
+ __formatter::__write_well_formed_escaped_code_unit(__str, __value);
+ return true;
+}
+
+template <class _CharT>
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr char32_t __to_char32(_CharT __value) {
+ return static_cast<make_unsigned_t<_CharT>>(__value);
+}
+
+enum class _LIBCPP_ENUM_VIS __escape_quotation_mark { __apostrophe, __double_quote };
+
+// [format.string.escaped]/2
+template <class _CharT>
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool
+__is_escaped_sequence_written(basic_string<_CharT>& __str, char32_t __value, __escape_quotation_mark __mark) {
+ // 2.2.1.1 - Mapped character in [tab:format.escape.sequences]
+ switch (__value) {
+ case _CharT('\t'):
+ __str += _LIBCPP_STATICALLY_WIDEN(_CharT, "\\t");
+ return true;
+ case _CharT('\n'):
+ __str += _LIBCPP_STATICALLY_WIDEN(_CharT, "\\n");
+ return true;
+ case _CharT('\r'):
+ __str += _LIBCPP_STATICALLY_WIDEN(_CharT, "\\r");
+ return true;
+ case _CharT('\''):
+ if (__mark == __escape_quotation_mark::__apostrophe)
+ __str += _LIBCPP_STATICALLY_WIDEN(_CharT, R"(\')");
+ else
+ __str += __value;
+ return true;
+ case _CharT('"'):
+ if (__mark == __escape_quotation_mark::__double_quote)
+ __str += _LIBCPP_STATICALLY_WIDEN(_CharT, R"(\")");
+ else
+ __str += __value;
+ return true;
+ case _CharT('\\'):
+ __str += _LIBCPP_STATICALLY_WIDEN(_CharT, R"(\\)");
+ return true;
+
+ // 2.2.1.2 - Space
+ case _CharT(' '):
+ __str += __value;
+ return true;
+ }
+
+ // 2.2.2
+ // Otherwise, if X is a shift sequence, the effect on E and further
+ // decoding of S is unspecified.
+ // For now shift sequences are ignored and treated as Unicode. Other parts
+ // of the format library do the same. It's unknown how ostream treats them.
+ // TODO FMT determine what to do with shift sequences.
+
+ // 2.2.1.2.1 and 2.2.1.2.2 - Escape
+ return __formatter::__is_escaped_sequence_written(__str, __formatter::__to_char32(__value));
+}
+
+template <class _CharT>
+_LIBCPP_HIDE_FROM_ABI void
+__escape(basic_string<_CharT>& __str, basic_string_view<_CharT> __values, __escape_quotation_mark __mark) {
+ __unicode::__code_point_view<_CharT> __view{__values.begin(), __values.end()};
+
+ while (!__view.__at_end()) {
+ auto __first = __view.__position();
+ typename __unicode::__consume_result __result = __view.__consume();
+ if (__result.__status == __unicode::__consume_result::__ok) {
+ if (!__formatter::__is_escaped_sequence_written(__str, __result.__code_point, __mark))
+ // 2.2.1.3 - Add the character
+ ranges::copy(__first, __view.__position(), std::back_insert_iterator(__str));
+ } else {
+ // 2.2.3 sequence of ill-formed code units
+ ranges::for_each(__first, __view.__position(), [&](_CharT __value) {
+ __formatter::__write_escape_ill_formed_code_unit(__str, __formatter::__to_char32(__value));
+ });
+ }
+ }
+}
+
+template <class _CharT>
+_LIBCPP_HIDE_FROM_ABI auto
+__format_escaped_char(_CharT __value,
+ output_iterator<const _CharT&> auto __out_it,
+ __format_spec::__parsed_specifications<_CharT> __specs) -> decltype(__out_it) {
+ basic_string<_CharT> __str;
+ __str += _CharT('\'');
+ __formatter::__escape(__str, basic_string_view{std::addressof(__value), 1}, __escape_quotation_mark::__apostrophe);
+ __str += _CharT('\'');
+ return __formatter::__write(__str.data(), __str.data() + __str.size(), _VSTD::move(__out_it), __specs, __str.size());
+}
+
+template <class _CharT>
+_LIBCPP_HIDE_FROM_ABI auto
+__format_escaped_string(basic_string_view<_CharT> __values,
+ output_iterator<const _CharT&> auto __out_it,
+ __format_spec::__parsed_specifications<_CharT> __specs) -> decltype(__out_it) {
+ basic_string<_CharT> __str;
+ __str += _CharT('"');
+ __formatter::__escape(__str, __values, __escape_quotation_mark::__double_quote);
+ __str += _CharT('"');
+ return __formatter::__write_string(basic_string_view{__str}, _VSTD::move(__out_it), __specs);
+}
+
+# endif // _LIBCPP_STD_VER >= 23
+
+} // namespace __formatter
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FORMAT_WRITE_ESCAPED_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/bind.h b/contrib/libs/cxxsupp/libcxx/include/__functional/bind.h
index 3d50ffa4391..69b13df8ab4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/bind.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/bind.h
@@ -13,9 +13,11 @@
#include <__config>
#include <__functional/invoke.h>
#include <__functional/weak_result_type.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_reference_wrapper.h>
+#include <__type_traits/is_void.h>
#include <cstddef>
#include <tuple>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -30,9 +32,9 @@ struct is_bind_expression : _If<
is_bind_expression<__remove_cvref_t<_Tp> >
> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
-inline constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value;
+inline constexpr bool is_bind_expression_v = is_bind_expression<_Tp>::value;
#endif
template<class _Tp>
@@ -42,9 +44,9 @@ struct is_placeholder : _If<
is_placeholder<__remove_cvref_t<_Tp> >
> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
-inline constexpr size_t is_placeholder_v = is_placeholder<_Tp>::value;
+inline constexpr int is_placeholder_v = is_placeholder<_Tp>::value;
#endif
namespace placeholders
@@ -52,29 +54,24 @@ namespace placeholders
template <int _Np> struct __ph {};
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
-_LIBCPP_FUNC_VIS extern const __ph<1> _1;
-_LIBCPP_FUNC_VIS extern const __ph<2> _2;
-_LIBCPP_FUNC_VIS extern const __ph<3> _3;
-_LIBCPP_FUNC_VIS extern const __ph<4> _4;
-_LIBCPP_FUNC_VIS extern const __ph<5> _5;
-_LIBCPP_FUNC_VIS extern const __ph<6> _6;
-_LIBCPP_FUNC_VIS extern const __ph<7> _7;
-_LIBCPP_FUNC_VIS extern const __ph<8> _8;
-_LIBCPP_FUNC_VIS extern const __ph<9> _9;
-_LIBCPP_FUNC_VIS extern const __ph<10> _10;
-#else
-/* inline */ constexpr __ph<1> _1{};
-/* inline */ constexpr __ph<2> _2{};
-/* inline */ constexpr __ph<3> _3{};
-/* inline */ constexpr __ph<4> _4{};
-/* inline */ constexpr __ph<5> _5{};
-/* inline */ constexpr __ph<6> _6{};
-/* inline */ constexpr __ph<7> _7{};
-/* inline */ constexpr __ph<8> _8{};
-/* inline */ constexpr __ph<9> _9{};
-/* inline */ constexpr __ph<10> _10{};
-#endif // defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
+// C++17 recommends that we implement placeholders as `inline constexpr`, but allows
+// implementing them as `extern <implementation-defined>`. Libc++ implements them as
+// `extern const` in all standard modes to avoid an ABI break in C++03: making them
+// `inline constexpr` requires removing their definition in the shared library to
+// avoid ODR violations, which is an ABI break.
+//
+// In practice, since placeholders are empty, `extern const` is almost impossible
+// to distinguish from `inline constexpr` from a usage stand point.
+_LIBCPP_EXPORTED_FROM_ABI extern const __ph<1> _1;
+_LIBCPP_EXPORTED_FROM_ABI extern const __ph<2> _2;
+_LIBCPP_EXPORTED_FROM_ABI extern const __ph<3> _3;
+_LIBCPP_EXPORTED_FROM_ABI extern const __ph<4> _4;
+_LIBCPP_EXPORTED_FROM_ABI extern const __ph<5> _5;
+_LIBCPP_EXPORTED_FROM_ABI extern const __ph<6> _6;
+_LIBCPP_EXPORTED_FROM_ABI extern const __ph<7> _7;
+_LIBCPP_EXPORTED_FROM_ABI extern const __ph<8> _8;
+_LIBCPP_EXPORTED_FROM_ABI extern const __ph<9> _9;
+_LIBCPP_EXPORTED_FROM_ABI extern const __ph<10> _10;
} // namespace placeholders
@@ -86,7 +83,7 @@ struct is_placeholder<placeholders::__ph<_Np> >
#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Uj>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
_Tp&
__mu(reference_wrapper<_Tp> __t, _Uj&)
{
@@ -94,7 +91,7 @@ __mu(reference_wrapper<_Tp> __t, _Uj&)
}
template <class _Ti, class ..._Uj, size_t ..._Indx>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
typename __invoke_of<_Ti&, _Uj...>::type
__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>)
{
@@ -102,7 +99,7 @@ __mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>)
}
template <class _Ti, class ..._Uj>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
typename __enable_if_t
<
is_bind_expression<_Ti>::value,
@@ -124,7 +121,7 @@ struct __mu_return2<true, _Ti, _Uj>
};
template <class _Ti, class _Uj>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
typename enable_if
<
0 < is_placeholder<_Ti>::value,
@@ -132,12 +129,12 @@ typename enable_if
>::type
__mu(_Ti&, _Uj& __uj)
{
- const size_t _Indx = is_placeholder<_Ti>::value - 1;
- return _VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(_VSTD::get<_Indx>(__uj));
+ const size_t __indx = is_placeholder<_Ti>::value - 1;
+ return _VSTD::forward<typename tuple_element<__indx, _Uj>::type>(_VSTD::get<__indx>(__uj));
}
template <class _Ti, class _Uj>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
typename enable_if
<
!is_bind_expression<_Ti>::value &&
@@ -255,7 +252,7 @@ struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj, true>
};
template <class _Fp, class _BoundArgs, size_t ..._Indx, class _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
typename __bind_return<_Fp, _BoundArgs, _Args>::type
__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
_Args&& __args)
@@ -264,11 +261,11 @@ __apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
}
template<class _Fp, class ..._BoundArgs>
-class __bind : public __weak_result_type<typename decay<_Fp>::type>
+class __bind : public __weak_result_type<__decay_t<_Fp> >
{
protected:
- typedef typename decay<_Fp>::type _Fd;
- typedef tuple<typename decay<_BoundArgs>::type...> _Td;
+ using _Fd = __decay_t<_Fp>;
+ typedef tuple<__decay_t<_BoundArgs>...> _Td;
private:
_Fd __f_;
_Td __bound_args_;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/bind_back.h b/contrib/libs/cxxsupp/libcxx/include/__functional/bind_back.h
index f0a6e49875a..71dc63c86bd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/bind_back.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/bind_back.h
@@ -13,10 +13,10 @@
#include <__config>
#include <__functional/invoke.h>
#include <__functional/perfect_forward.h>
+#include <__type_traits/decay.h>
#include <__utility/forward.h>
#include <__utility/integer_sequence.h>
#include <tuple>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -24,7 +24,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <size_t _NBound, class = make_index_sequence<_NBound>>
struct __bind_back_op;
@@ -57,7 +57,7 @@ constexpr auto __bind_back(_Fn&& __f, _Args&&... __args)
-> decltype( __bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(_VSTD::forward<_Fn>(__f), _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)))
{ return __bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(_VSTD::forward<_Fn>(__f), _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/bind_front.h b/contrib/libs/cxxsupp/libcxx/include/__functional/bind_front.h
index 22fb3a69dc7..72bb6648095 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/bind_front.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/bind_front.h
@@ -13,8 +13,12 @@
#include <__config>
#include <__functional/invoke.h>
#include <__functional/perfect_forward.h>
+#include <__type_traits/conjunction.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_move_constructible.h>
#include <__utility/forward.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -22,7 +26,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct __bind_front_op {
template <class ..._Args>
@@ -51,7 +55,7 @@ constexpr auto bind_front(_Fn&& __f, _Args&&... __args) {
return __bind_front_t<decay_t<_Fn>, decay_t<_Args>...>(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/binder1st.h b/contrib/libs/cxxsupp/libcxx/include/__functional/binder1st.h
index dea22c70e1f..78049d13f92 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/binder1st.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/binder1st.h
@@ -21,30 +21,30 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
-template <class __Operation>
+template <class _Operation>
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder1st
- : public __unary_function<typename __Operation::second_argument_type, typename __Operation::result_type>
+ : public __unary_function<typename _Operation::second_argument_type, typename _Operation::result_type>
{
protected:
- __Operation op;
- typename __Operation::first_argument_type value;
+ _Operation op;
+ typename _Operation::first_argument_type value;
public:
- _LIBCPP_INLINE_VISIBILITY binder1st(const __Operation& __x,
- const typename __Operation::first_argument_type __y)
+ _LIBCPP_INLINE_VISIBILITY binder1st(const _Operation& __x,
+ const typename _Operation::first_argument_type __y)
: op(__x), value(__y) {}
- _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
- (typename __Operation::second_argument_type& __x) const
+ _LIBCPP_INLINE_VISIBILITY typename _Operation::result_type operator()
+ (typename _Operation::second_argument_type& __x) const
{return op(value, __x);}
- _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
- (const typename __Operation::second_argument_type& __x) const
+ _LIBCPP_INLINE_VISIBILITY typename _Operation::result_type operator()
+ (const typename _Operation::second_argument_type& __x) const
{return op(value, __x);}
};
-template <class __Operation, class _Tp>
+template <class _Operation, class _Tp>
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-binder1st<__Operation>
-bind1st(const __Operation& __op, const _Tp& __x)
- {return binder1st<__Operation>(__op, __x);}
+binder1st<_Operation>
+bind1st(const _Operation& __op, const _Tp& __x)
+ {return binder1st<_Operation>(__op, __x);}
#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/binder2nd.h b/contrib/libs/cxxsupp/libcxx/include/__functional/binder2nd.h
index c98a146b6a6..a3227745bcb 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/binder2nd.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/binder2nd.h
@@ -21,30 +21,30 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
-template <class __Operation>
+template <class _Operation>
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder2nd
- : public __unary_function<typename __Operation::first_argument_type, typename __Operation::result_type>
+ : public __unary_function<typename _Operation::first_argument_type, typename _Operation::result_type>
{
protected:
- __Operation op;
- typename __Operation::second_argument_type value;
+ _Operation op;
+ typename _Operation::second_argument_type value;
public:
_LIBCPP_INLINE_VISIBILITY
- binder2nd(const __Operation& __x, const typename __Operation::second_argument_type __y)
+ binder2nd(const _Operation& __x, const typename _Operation::second_argument_type __y)
: op(__x), value(__y) {}
- _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
- ( typename __Operation::first_argument_type& __x) const
+ _LIBCPP_INLINE_VISIBILITY typename _Operation::result_type operator()
+ ( typename _Operation::first_argument_type& __x) const
{return op(__x, value);}
- _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
- (const typename __Operation::first_argument_type& __x) const
+ _LIBCPP_INLINE_VISIBILITY typename _Operation::result_type operator()
+ (const typename _Operation::first_argument_type& __x) const
{return op(__x, value);}
};
-template <class __Operation, class _Tp>
+template <class _Operation, class _Tp>
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-binder2nd<__Operation>
-bind2nd(const __Operation& __op, const _Tp& __x)
- {return binder2nd<__Operation>(__op, __x);}
+binder2nd<_Operation>
+bind2nd(const _Operation& __op, const _Tp& __x)
+ {return binder2nd<_Operation>(__op, __x);}
#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/boyer_moore_searcher.h b/contrib/libs/cxxsupp/libcxx/include/__functional/boyer_moore_searcher.h
index a6750893ee5..0165e062810 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/boyer_moore_searcher.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/boyer_moore_searcher.h
@@ -20,12 +20,13 @@
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__memory/shared_ptr.h>
+#include <__type_traits/make_unsigned.h>
#include <__utility/pair.h>
#include <array>
#include <unordered_map>
#include <vector>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
@@ -113,6 +114,7 @@ private:
&& is_same_v<_BinaryPredicate, equal_to<>>>;
public:
+ _LIBCPP_HIDE_FROM_ABI
boyer_moore_searcher(_RandomAccessIterator1 __first,
_RandomAccessIterator1 __last,
_Hash __hash = _Hash(),
@@ -134,7 +136,7 @@ public:
}
template <class _RandomAccessIterator2>
- pair<_RandomAccessIterator2, _RandomAccessIterator2>
+ _LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2>
operator()(_RandomAccessIterator2 __first, _RandomAccessIterator2 __last) const {
static_assert(__is_same_uncvref<typename iterator_traits<_RandomAccessIterator1>::value_type,
typename iterator_traits<_RandomAccessIterator2>::value_type>::value,
@@ -158,7 +160,7 @@ private:
shared_ptr<difference_type[]> __suffix_;
template <class _RandomAccessIterator2>
- pair<_RandomAccessIterator2, _RandomAccessIterator2>
+ _LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2>
__search(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const {
_RandomAccessIterator2 __current = __f;
const _RandomAccessIterator2 __last = __l - __pattern_length_;
@@ -183,7 +185,8 @@ private:
}
template <class _Iterator, class _Container>
- void __compute_bm_prefix(_Iterator __first, _Iterator __last, _BinaryPredicate __pred, _Container& __prefix) {
+ _LIBCPP_HIDE_FROM_ABI void
+ __compute_bm_prefix(_Iterator __first, _Iterator __last, _BinaryPredicate __pred, _Container& __prefix) {
const size_t __count = __last - __first;
__prefix[0] = 0;
@@ -199,7 +202,8 @@ private:
}
}
- void __build_suffix_table(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _BinaryPredicate __pred) {
+ _LIBCPP_HIDE_FROM_ABI void
+ __build_suffix_table(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _BinaryPredicate __pred) {
const size_t __count = __last - __first;
if (__count == 0)
@@ -241,6 +245,7 @@ private:
&& is_same_v<_Hash, hash<value_type>>
&& is_same_v<_BinaryPredicate, equal_to<>>>;
public:
+ _LIBCPP_HIDE_FROM_ABI
boyer_moore_horspool_searcher(_RandomAccessIterator1 __first,
_RandomAccessIterator1 __last,
_Hash __hash = _Hash(),
@@ -262,7 +267,7 @@ public:
}
template <class _RandomAccessIterator2>
- pair<_RandomAccessIterator2, _RandomAccessIterator2>
+ _LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2>
operator()(_RandomAccessIterator2 __first, _RandomAccessIterator2 __last) const {
static_assert(__is_same_uncvref<typename std::iterator_traits<_RandomAccessIterator1>::value_type,
typename std::iterator_traits<_RandomAccessIterator2>::value_type>::value,
@@ -286,7 +291,7 @@ private:
shared_ptr<__skip_table_type> __skip_table_;
template <class _RandomAccessIterator2>
- pair<_RandomAccessIterator2, _RandomAccessIterator2>
+ _LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2>
__search(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const {
_RandomAccessIterator2 __current = __f;
const _RandomAccessIterator2 __last = __l - __pattern_length_;
@@ -310,6 +315,6 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // _LIBCPP___FUNCTIONAL_BOYER_MOORE_SEARCHER_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/compose.h b/contrib/libs/cxxsupp/libcxx/include/__functional/compose.h
index 25213f28b1f..80fcd7076c8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/compose.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/compose.h
@@ -13,8 +13,8 @@
#include <__config>
#include <__functional/invoke.h>
#include <__functional/perfect_forward.h>
+#include <__type_traits/decay.h>
#include <__utility/forward.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct __compose_op {
template<class _Fn1, class _Fn2, class ..._Args>
@@ -45,7 +45,7 @@ constexpr auto __compose(_Fn1&& __f1, _Fn2&& __f2)
-> decltype( __compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(_VSTD::forward<_Fn1>(__f1), _VSTD::forward<_Fn2>(__f2)))
{ return __compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(_VSTD::forward<_Fn1>(__f1), _VSTD::forward<_Fn2>(__f2)); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/default_searcher.h b/contrib/libs/cxxsupp/libcxx/include/__functional/default_searcher.h
index e4151e589f7..222b4c66e6c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/default_searcher.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/default_searcher.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
// default searcher
template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
@@ -50,7 +50,7 @@ private:
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(default_searcher);
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/function.h b/contrib/libs/cxxsupp/libcxx/include/__functional/function.h
index 9f92f618146..3c6e3f450d8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/function.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/function.h
@@ -12,6 +12,7 @@
#include <__assert>
#include <__config>
+#include <__exception/exception.h>
#include <__functional/binary_function.h>
#include <__functional/invoke.h>
#include <__functional/unary_function.h>
@@ -23,15 +24,21 @@
#include <__memory/builtin_new_allocator.h>
#include <__memory/compressed_pair.h>
#include <__memory/unique_ptr.h>
+#include <__type_traits/aligned_storage.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_core_convertible.h>
+#include <__type_traits/is_scalar.h>
+#include <__type_traits/is_trivially_copy_constructible.h>
+#include <__type_traits/is_trivially_destructible.h>
+#include <__type_traits/is_void.h>
#include <__type_traits/strip_signature.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/piecewise_construct.h>
#include <__utility/swap.h>
-#include <exception>
+#include <__verbose_abort>
#include <new>
#include <tuple>
-#include <type_traits>
#include <typeinfo>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -46,7 +53,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_DIAGNOSTIC_PUSH
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables")
-class _LIBCPP_EXCEPTION_ABI bad_function_call
+class _LIBCPP_EXPORTED_FROM_ABI bad_function_call
: public exception
{
public:
@@ -56,7 +63,7 @@ public:
#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
~bad_function_call() _NOEXCEPT override;
#else
- ~bad_function_call() _NOEXCEPT override {}
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~bad_function_call() _NOEXCEPT override {}
#endif
#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE
@@ -68,10 +75,10 @@ _LIBCPP_DIAGNOSTIC_POP
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_function_call()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_function_call();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_function_call was thrown in -fno-exceptions mode");
#endif
}
@@ -201,7 +208,7 @@ class __alloc_func<_Fp, _Ap, _Rp(_ArgTypes...)>
_LIBCPP_INLINE_VISIBILITY
void destroy() _NOEXCEPT { __f_.~__compressed_pair<_Target, _Alloc>(); }
- static void __destroy_and_delete(__alloc_func* __f) {
+ _LIBCPP_HIDE_FROM_ABI static void __destroy_and_delete(__alloc_func* __f) {
typedef allocator_traits<_Alloc> __alloc_traits;
typedef __rebind_alloc<__alloc_traits, __alloc_func> _FunAlloc;
_FunAlloc __a(__f->__get_allocator());
@@ -245,7 +252,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void destroy() _NOEXCEPT { __f_.~_Target(); }
- static void __destroy_and_delete(__default_alloc_func* __f) {
+ _LIBCPP_HIDE_FROM_ABI static void __destroy_and_delete(__default_alloc_func* __f) {
__f->destroy();
__builtin_new_allocator::__deallocate_type<__default_alloc_func>(__f, 1);
}
@@ -300,14 +307,14 @@ public:
explicit __func(_Fp&& __f, _Alloc&& __a)
: __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
- virtual __base<_Rp(_ArgTypes...)>* __clone() const;
- virtual void __clone(__base<_Rp(_ArgTypes...)>*) const;
- virtual void destroy() _NOEXCEPT;
- virtual void destroy_deallocate() _NOEXCEPT;
- virtual _Rp operator()(_ArgTypes&&... __arg);
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual __base<_Rp(_ArgTypes...)>* __clone() const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __clone(__base<_Rp(_ArgTypes...)>*) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void destroy() _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void destroy_deallocate() _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual _Rp operator()(_ArgTypes&&... __arg);
#ifndef _LIBCPP_HAS_NO_RTTI
- virtual const void* target(const type_info&) const _NOEXCEPT;
- virtual const std::type_info& target_type() const _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual const void* target(const type_info&) const _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual const std::type_info& target_type() const _NOEXCEPT;
#endif // _LIBCPP_HAS_NO_RTTI
};
@@ -389,7 +396,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
typedef __base<_Rp(_ArgTypes...)> __func;
__func* __f_;
- _LIBCPP_NO_CFI static __func* __as_base(void* __p)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI static __func* __as_base(void* __p)
{
return reinterpret_cast<__func*>(__p);
}
@@ -427,7 +434,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
}
template <class _Fp,
- class = typename enable_if<!is_same<typename decay<_Fp>::type, __value_func>::value>::type>
+ class = typename enable_if<!is_same<__decay_t<_Fp>, __value_func>::value>::type>
_LIBCPP_INLINE_VISIBILITY explicit __value_func(_Fp&& __f)
: __value_func(_VSTD::forward<_Fp>(__f), allocator<_Fp>()) {}
@@ -614,33 +621,34 @@ struct __policy
_LIBCPP_INLINE_VISIBILITY
static const __policy* __create_empty()
{
- static const _LIBCPP_CONSTEXPR __policy __policy_ = {nullptr, nullptr,
- true,
+ static const _LIBCPP_CONSTEXPR __policy __policy = {nullptr, nullptr,
+ true,
#ifndef _LIBCPP_HAS_NO_RTTI
- &typeid(void)
+ &typeid(void)
#else
- nullptr
+ nullptr
#endif
};
- return &__policy_;
+ return &__policy;
}
private:
- template <typename _Fun> static void* __large_clone(const void* __s)
+ template <typename _Fun>
+ _LIBCPP_HIDE_FROM_ABI static void* __large_clone(const void* __s)
{
const _Fun* __f = static_cast<const _Fun*>(__s);
return __f->__clone();
}
template <typename _Fun>
- static void __large_destroy(void* __s) {
+ _LIBCPP_HIDE_FROM_ABI static void __large_destroy(void* __s) {
_Fun::__destroy_and_delete(static_cast<_Fun*>(__s));
}
template <typename _Fun>
_LIBCPP_INLINE_VISIBILITY static const __policy*
__choose_policy(/* is_small = */ false_type) {
- static const _LIBCPP_CONSTEXPR __policy __policy_ = {
+ static const _LIBCPP_CONSTEXPR __policy __policy = {
&__large_clone<_Fun>, &__large_destroy<_Fun>, false,
#ifndef _LIBCPP_HAS_NO_RTTI
&typeid(typename _Fun::_Target)
@@ -648,14 +656,14 @@ struct __policy
nullptr
#endif
};
- return &__policy_;
+ return &__policy;
}
template <typename _Fun>
_LIBCPP_INLINE_VISIBILITY static const __policy*
__choose_policy(/* is_small = */ true_type)
{
- static const _LIBCPP_CONSTEXPR __policy __policy_ = {
+ static const _LIBCPP_CONSTEXPR __policy __policy = {
nullptr, nullptr, false,
#ifndef _LIBCPP_HAS_NO_RTTI
&typeid(typename _Fun::_Target)
@@ -663,7 +671,7 @@ struct __policy
nullptr
#endif
};
- return &__policy_;
+ return &__policy;
}
};
@@ -699,14 +707,14 @@ struct __policy_invoker<_Rp(_ArgTypes...)>
_LIBCPP_INLINE_VISIBILITY
explicit __policy_invoker(__Call __c) : __call_(__c) {}
- static _Rp __call_empty(const __policy_storage*,
+ _LIBCPP_HIDE_FROM_ABI static _Rp __call_empty(const __policy_storage*,
__fast_forward<_ArgTypes>...)
{
__throw_bad_function_call();
}
template <typename _Fun>
- static _Rp __call_impl(const __policy_storage* __buf,
+ _LIBCPP_HIDE_FROM_ABI static _Rp __call_impl(const __policy_storage* __buf,
__fast_forward<_ArgTypes>... __args)
{
_Fun* __f = reinterpret_cast<_Fun*>(__use_small_storage<_Fun>::value
@@ -770,7 +778,7 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
}
}
- template <class _Fp, class = typename enable_if<!is_same<typename decay<_Fp>::type, __policy_func>::value>::type>
+ template <class _Fp, class = typename enable_if<!is_same<__decay_t<_Fp>, __policy_func>::value>::type>
_LIBCPP_INLINE_VISIBILITY explicit __policy_func(_Fp&& __f)
: __policy_(__policy::__create_empty()) {
typedef __default_alloc_func<_Fp, _Rp(_ArgTypes...)> _Fun;
@@ -915,7 +923,7 @@ public:
{ }
virtual __base<_Rp(_ArgTypes...)>* __clone() const {
- _LIBCPP_ASSERT(false,
+ _LIBCPP_ASSERT_INTERNAL(false,
"Block pointers are just pointers, so they should always fit into "
"std::function's small buffer optimization. This function should "
"never be invoked.");
@@ -935,7 +943,7 @@ public:
}
virtual void destroy_deallocate() _NOEXCEPT {
- _LIBCPP_ASSERT(false,
+ _LIBCPP_ASSERT_INTERNAL(false,
"Block pointers are just pointers, so they should always fit into "
"std::function's small buffer optimization. This function should "
"never be invoked.");
@@ -1002,11 +1010,11 @@ public:
_LIBCPP_INLINE_VISIBILITY
function() _NOEXCEPT { }
_LIBCPP_INLINE_VISIBILITY
- function(nullptr_t) _NOEXCEPT {}
- function(const function&);
- function(function&&) _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI function(nullptr_t) _NOEXCEPT {}
+ _LIBCPP_HIDE_FROM_ABI function(const function&);
+ _LIBCPP_HIDE_FROM_ABI function(function&&) _NOEXCEPT;
template<class _Fp, class = _EnableIfLValueCallable<_Fp>>
- function(_Fp);
+ _LIBCPP_HIDE_FROM_ABI function(_Fp);
#if _LIBCPP_STD_VER <= 14
template<class _Alloc>
@@ -1016,23 +1024,23 @@ public:
_LIBCPP_INLINE_VISIBILITY
function(allocator_arg_t, const _Alloc&, nullptr_t) _NOEXCEPT {}
template<class _Alloc>
- function(allocator_arg_t, const _Alloc&, const function&);
+ _LIBCPP_HIDE_FROM_ABI function(allocator_arg_t, const _Alloc&, const function&);
template<class _Alloc>
- function(allocator_arg_t, const _Alloc&, function&&);
+ _LIBCPP_HIDE_FROM_ABI function(allocator_arg_t, const _Alloc&, function&&);
template<class _Fp, class _Alloc, class = _EnableIfLValueCallable<_Fp>>
- function(allocator_arg_t, const _Alloc& __a, _Fp __f);
+ _LIBCPP_HIDE_FROM_ABI function(allocator_arg_t, const _Alloc& __a, _Fp __f);
#endif
- function& operator=(const function&);
- function& operator=(function&&) _NOEXCEPT;
- function& operator=(nullptr_t) _NOEXCEPT;
- template<class _Fp, class = _EnableIfLValueCallable<typename decay<_Fp>::type>>
- function& operator=(_Fp&&);
+ _LIBCPP_HIDE_FROM_ABI function& operator=(const function&);
+ _LIBCPP_HIDE_FROM_ABI function& operator=(function&&) _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI function& operator=(nullptr_t) _NOEXCEPT;
+ template<class _Fp, class = _EnableIfLValueCallable<__decay_t<_Fp>>>
+ _LIBCPP_HIDE_FROM_ABI function& operator=(_Fp&&);
- ~function();
+ _LIBCPP_HIDE_FROM_ABI ~function();
// function modifiers:
- void swap(function&) _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI void swap(function&) _NOEXCEPT;
#if _LIBCPP_STD_VER <= 14
template<class _Fp, class _Alloc>
@@ -1050,17 +1058,21 @@ public:
// deleted overloads close possible hole in the type system
template<class _R2, class... _ArgTypes2>
bool operator==(const function<_R2(_ArgTypes2...)>&) const = delete;
+#if _LIBCPP_STD_VER <= 17
template<class _R2, class... _ArgTypes2>
bool operator!=(const function<_R2(_ArgTypes2...)>&) const = delete;
+#endif
public:
// function invocation:
- _Rp operator()(_ArgTypes...) const;
+ _LIBCPP_HIDE_FROM_ABI _Rp operator()(_ArgTypes...) const;
#ifndef _LIBCPP_HAS_NO_RTTI
// function target access:
- const std::type_info& target_type() const _NOEXCEPT;
- template <typename _Tp> _Tp* target() _NOEXCEPT;
- template <typename _Tp> const _Tp* target() const _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI const std::type_info& target_type() const _NOEXCEPT;
+ template <typename _Tp>
+ _LIBCPP_HIDE_FROM_ABI _Tp* target() _NOEXCEPT;
+ template <typename _Tp>
+ _LIBCPP_HIDE_FROM_ABI const _Tp* target() const _NOEXCEPT;
#endif // _LIBCPP_HAS_NO_RTTI
};
@@ -1188,6 +1200,8 @@ inline _LIBCPP_INLINE_VISIBILITY
bool
operator==(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return !__f;}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Rp, class... _ArgTypes>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -1203,6 +1217,8 @@ inline _LIBCPP_INLINE_VISIBILITY
bool
operator!=(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return (bool)__f;}
+#endif // _LIBCPP_STD_VER <= 17
+
template <class _Rp, class... _ArgTypes>
inline _LIBCPP_INLINE_VISIBILITY
void
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/hash.h b/contrib/libs/cxxsupp/libcxx/include/__functional/hash.h
index 39382aa9bff..fa09748b145 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/hash.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/hash.h
@@ -13,7 +13,7 @@
#include <__functional/invoke.h>
#include <__functional/unary_function.h>
#include <__fwd/hash.h>
-#include <__tuple_dir/sfinae_helpers.h>
+#include <__tuple/sfinae_helpers.h>
#include <__type_traits/is_copy_constructible.h>
#include <__type_traits/is_default_constructible.h>
#include <__type_traits/is_enum.h>
@@ -35,7 +35,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
_Size
__loadword(const void* __p)
{
@@ -53,73 +53,113 @@ struct __murmur2_or_cityhash;
template <class _Size>
struct __murmur2_or_cityhash<_Size, 32>
{
- inline _Size operator()(const void* __key, _Size __len)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ _Size operator()(const void* __key, _Size __len) const {
+ // murmur2
+ const _Size __m = 0x5bd1e995;
+ const _Size __r = 24;
+ _Size __h = __len;
+ const unsigned char* __data = static_cast<const unsigned char*>(__key);
+ for (; __len >= 4; __data += 4, __len -= 4)
+ {
+ _Size __k = std::__loadword<_Size>(__data);
+ __k *= __m;
+ __k ^= __k >> __r;
+ __k *= __m;
+ __h *= __m;
+ __h ^= __k;
+ }
+ switch (__len)
+ {
+ case 3:
+ __h ^= static_cast<_Size>(__data[2] << 16);
+ _LIBCPP_FALLTHROUGH();
+ case 2:
+ __h ^= static_cast<_Size>(__data[1] << 8);
+ _LIBCPP_FALLTHROUGH();
+ case 1:
+ __h ^= __data[0];
+ __h *= __m;
+ }
+ __h ^= __h >> 13;
+ __h *= __m;
+ __h ^= __h >> 15;
+ return __h;
+ }
};
-// murmur2
template <class _Size>
-_Size
-__murmur2_or_cityhash<_Size, 32>::operator()(const void* __key, _Size __len)
+struct __murmur2_or_cityhash<_Size, 64>
{
- const _Size __m = 0x5bd1e995;
- const _Size __r = 24;
- _Size __h = __len;
- const unsigned char* __data = static_cast<const unsigned char*>(__key);
- for (; __len >= 4; __data += 4, __len -= 4)
- {
- _Size __k = std::__loadword<_Size>(__data);
- __k *= __m;
- __k ^= __k >> __r;
- __k *= __m;
- __h *= __m;
- __h ^= __k;
- }
- switch (__len)
- {
- case 3:
- __h ^= static_cast<_Size>(__data[2] << 16);
- _LIBCPP_FALLTHROUGH();
- case 2:
- __h ^= static_cast<_Size>(__data[1] << 8);
- _LIBCPP_FALLTHROUGH();
- case 1:
- __h ^= __data[0];
- __h *= __m;
+ // cityhash64
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ _Size operator()(const void* __key, _Size __len) const {
+ const char* __s = static_cast<const char*>(__key);
+ if (__len <= 32) {
+ if (__len <= 16) {
+ return __hash_len_0_to_16(__s, __len);
+ } else {
+ return __hash_len_17_to_32(__s, __len);
+ }
+ } else if (__len <= 64) {
+ return __hash_len_33_to_64(__s, __len);
}
- __h ^= __h >> 13;
- __h *= __m;
- __h ^= __h >> 15;
- return __h;
-}
-template <class _Size>
-struct __murmur2_or_cityhash<_Size, 64>
-{
- inline _Size operator()(const void* __key, _Size __len) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
+ // For strings over 64 bytes we hash the end first, and then as we
+ // loop we keep 56 bytes of state: v, w, x, y, and z.
+ _Size __x = std::__loadword<_Size>(__s + __len - 40);
+ _Size __y = std::__loadword<_Size>(__s + __len - 16) +
+ std::__loadword<_Size>(__s + __len - 56);
+ _Size __z = __hash_len_16(std::__loadword<_Size>(__s + __len - 48) + __len,
+ std::__loadword<_Size>(__s + __len - 24));
+ pair<_Size, _Size> __v = __weak_hash_len_32_with_seeds(__s + __len - 64, __len, __z);
+ pair<_Size, _Size> __w = __weak_hash_len_32_with_seeds(__s + __len - 32, __y + __k1, __x);
+ __x = __x * __k1 + std::__loadword<_Size>(__s);
+
+ // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
+ __len = (__len - 1) & ~static_cast<_Size>(63);
+ do {
+ __x = __rotate(__x + __y + __v.first + std::__loadword<_Size>(__s + 8), 37) * __k1;
+ __y = __rotate(__y + __v.second + std::__loadword<_Size>(__s + 48), 42) * __k1;
+ __x ^= __w.second;
+ __y += __v.first + std::__loadword<_Size>(__s + 40);
+ __z = __rotate(__z + __w.first, 33) * __k1;
+ __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first);
+ __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second,
+ __y + std::__loadword<_Size>(__s + 16));
+ _VSTD::swap(__z, __x);
+ __s += 64;
+ __len -= 64;
+ } while (__len != 0);
+ return __hash_len_16(
+ __hash_len_16(__v.first, __w.first) + __shift_mix(__y) * __k1 + __z,
+ __hash_len_16(__v.second, __w.second) + __x);
+ }
- private:
- // Some primes between 2^63 and 2^64.
- static const _Size __k0 = 0xc3a5c85c97cb3127ULL;
- static const _Size __k1 = 0xb492b66fbe98f273ULL;
- static const _Size __k2 = 0x9ae16a3b2f90404fULL;
- static const _Size __k3 = 0xc949d7c7509e6557ULL;
+ private:
+ // Some primes between 2^63 and 2^64.
+ static const _Size __k0 = 0xc3a5c85c97cb3127ULL;
+ static const _Size __k1 = 0xb492b66fbe98f273ULL;
+ static const _Size __k2 = 0x9ae16a3b2f90404fULL;
+ static const _Size __k3 = 0xc949d7c7509e6557ULL;
+ _LIBCPP_HIDE_FROM_ABI
static _Size __rotate(_Size __val, int __shift) {
return __shift == 0 ? __val : ((__val >> __shift) | (__val << (64 - __shift)));
}
+ _LIBCPP_HIDE_FROM_ABI
static _Size __rotate_by_at_least_1(_Size __val, int __shift) {
return (__val >> __shift) | (__val << (64 - __shift));
}
+ _LIBCPP_HIDE_FROM_ABI
static _Size __shift_mix(_Size __val) {
return __val ^ (__val >> 47);
}
- static _Size __hash_len_16(_Size __u, _Size __v)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ static _Size __hash_len_16(_Size __u, _Size __v) {
const _Size __mul = 0x9ddfea08eb382d69ULL;
_Size __a = (__u ^ __v) * __mul;
__a ^= (__a >> 47);
@@ -129,9 +169,8 @@ struct __murmur2_or_cityhash<_Size, 64>
return __b;
}
- static _Size __hash_len_0_to_16(const char* __s, _Size __len)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ static _Size __hash_len_0_to_16(const char* __s, _Size __len) {
if (__len > 8) {
const _Size __a = std::__loadword<_Size>(__s);
const _Size __b = std::__loadword<_Size>(__s + __len - 8);
@@ -158,9 +197,8 @@ struct __murmur2_or_cityhash<_Size, 64>
return __k2;
}
- static _Size __hash_len_17_to_32(const char *__s, _Size __len)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ static _Size __hash_len_17_to_32(const char *__s, _Size __len) {
const _Size __a = std::__loadword<_Size>(__s) * __k1;
const _Size __b = std::__loadword<_Size>(__s + 8);
const _Size __c = std::__loadword<_Size>(__s + __len - 8) * __k2;
@@ -171,9 +209,9 @@ struct __murmur2_or_cityhash<_Size, 64>
// Return a 16-byte hash for 48 bytes. Quick and dirty.
// Callers do best to use "random-looking" values for a and b.
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
_Size __w, _Size __x, _Size __y, _Size __z, _Size __a, _Size __b)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
{
__a += __w;
__b = __rotate(__b + __a + __z, 21);
@@ -185,9 +223,9 @@ struct __murmur2_or_cityhash<_Size, 64>
}
// Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty.
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
const char* __s, _Size __a, _Size __b)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
{
return __weak_hash_len_32_with_seeds(std::__loadword<_Size>(__s),
std::__loadword<_Size>(__s + 8),
@@ -198,9 +236,8 @@ struct __murmur2_or_cityhash<_Size, 64>
}
// Return an 8-byte hash for 33 to 64 bytes.
- static _Size __hash_len_33_to_64(const char *__s, size_t __len)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ static _Size __hash_len_33_to_64(const char *__s, size_t __len) {
_Size __z = std::__loadword<_Size>(__s + 24);
_Size __a = std::__loadword<_Size>(__s) +
(__len + std::__loadword<_Size>(__s + __len - 16)) * __k0;
@@ -225,53 +262,6 @@ struct __murmur2_or_cityhash<_Size, 64>
}
};
-// cityhash64
-template <class _Size>
-_Size
-__murmur2_or_cityhash<_Size, 64>::operator()(const void* __key, _Size __len)
-{
- const char* __s = static_cast<const char*>(__key);
- if (__len <= 32) {
- if (__len <= 16) {
- return __hash_len_0_to_16(__s, __len);
- } else {
- return __hash_len_17_to_32(__s, __len);
- }
- } else if (__len <= 64) {
- return __hash_len_33_to_64(__s, __len);
- }
-
- // For strings over 64 bytes we hash the end first, and then as we
- // loop we keep 56 bytes of state: v, w, x, y, and z.
- _Size __x = std::__loadword<_Size>(__s + __len - 40);
- _Size __y = std::__loadword<_Size>(__s + __len - 16) +
- std::__loadword<_Size>(__s + __len - 56);
- _Size __z = __hash_len_16(std::__loadword<_Size>(__s + __len - 48) + __len,
- std::__loadword<_Size>(__s + __len - 24));
- pair<_Size, _Size> __v = __weak_hash_len_32_with_seeds(__s + __len - 64, __len, __z);
- pair<_Size, _Size> __w = __weak_hash_len_32_with_seeds(__s + __len - 32, __y + __k1, __x);
- __x = __x * __k1 + std::__loadword<_Size>(__s);
-
- // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
- __len = (__len - 1) & ~static_cast<_Size>(63);
- do {
- __x = __rotate(__x + __y + __v.first + std::__loadword<_Size>(__s + 8), 37) * __k1;
- __y = __rotate(__y + __v.second + std::__loadword<_Size>(__s + 48), 42) * __k1;
- __x ^= __w.second;
- __y += __v.first + std::__loadword<_Size>(__s + 40);
- __z = __rotate(__z + __w.first, 33) * __k1;
- __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first);
- __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second,
- __y + std::__loadword<_Size>(__s + 16));
- _VSTD::swap(__z, __x);
- __s += 64;
- __len -= 64;
- } while (__len != 0);
- return __hash_len_16(
- __hash_len_16(__v.first, __w.first) + __shift_mix(__y) * __k1 + __z,
- __hash_len_16(__v.second, __w.second) + __x);
-}
-
template <class _Tp, size_t = sizeof(_Tp) / sizeof(size_t)>
struct __scalar_hash;
@@ -279,7 +269,7 @@ template <class _Tp>
struct __scalar_hash<_Tp, 0>
: public __unary_function<_Tp, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp __v) const _NOEXCEPT
{
union
@@ -297,7 +287,7 @@ template <class _Tp>
struct __scalar_hash<_Tp, 1>
: public __unary_function<_Tp, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp __v) const _NOEXCEPT
{
union
@@ -314,7 +304,7 @@ template <class _Tp>
struct __scalar_hash<_Tp, 2>
: public __unary_function<_Tp, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp __v) const _NOEXCEPT
{
union
@@ -335,7 +325,7 @@ template <class _Tp>
struct __scalar_hash<_Tp, 3>
: public __unary_function<_Tp, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp __v) const _NOEXCEPT
{
union
@@ -357,7 +347,7 @@ template <class _Tp>
struct __scalar_hash<_Tp, 4>
: public __unary_function<_Tp, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp __v) const _NOEXCEPT
{
union
@@ -381,7 +371,7 @@ struct _PairT {
size_t second;
};
-_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_HIDE_FROM_ABI
inline size_t __hash_combine(size_t __lhs, size_t __rhs) _NOEXCEPT {
typedef __scalar_hash<_PairT> _HashT;
const _PairT __p = {__lhs, __rhs};
@@ -392,7 +382,7 @@ template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS hash<_Tp*>
: public __unary_function<_Tp*, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp* __v) const _NOEXCEPT
{
union
@@ -409,7 +399,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<bool>
: public __unary_function<bool, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(bool __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -417,7 +407,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<char>
: public __unary_function<char, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -425,7 +415,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<signed char>
: public __unary_function<signed char, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(signed char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -433,7 +423,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<unsigned char>
: public __unary_function<unsigned char, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(unsigned char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -442,7 +432,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<char8_t>
: public __unary_function<char8_t, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(char8_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
#endif // !_LIBCPP_HAS_NO_CHAR8_T
@@ -451,7 +441,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<char16_t>
: public __unary_function<char16_t, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(char16_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -459,7 +449,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<char32_t>
: public __unary_function<char32_t, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(char32_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -468,7 +458,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<wchar_t>
: public __unary_function<wchar_t, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(wchar_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -477,7 +467,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<short>
: public __unary_function<short, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -485,7 +475,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<unsigned short>
: public __unary_function<unsigned short, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(unsigned short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -493,7 +483,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<int>
: public __unary_function<int, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -501,7 +491,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<unsigned int>
: public __unary_function<unsigned int, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(unsigned int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -509,7 +499,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<long>
: public __unary_function<long, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -517,7 +507,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<unsigned long>
: public __unary_function<unsigned long, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(unsigned long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -553,7 +543,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<float>
: public __scalar_hash<float>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(float __v) const _NOEXCEPT
{
// -0.0 and 0.0 should return same hash
@@ -567,7 +557,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<double>
: public __scalar_hash<double>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(double __v) const _NOEXCEPT
{
// -0.0 and 0.0 should return same hash
@@ -581,7 +571,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS hash<long double>
: public __scalar_hash<long double>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(long double __v) const _NOEXCEPT
{
// -0.0 and 0.0 should return same hash
@@ -631,7 +621,7 @@ template <class _Tp, bool = is_enum<_Tp>::value>
struct _LIBCPP_TEMPLATE_VIS __enum_hash
: public __unary_function<_Tp, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp __v) const _NOEXCEPT
{
typedef typename underlying_type<_Tp>::type type;
@@ -650,13 +640,13 @@ struct _LIBCPP_TEMPLATE_VIS hash : public __enum_hash<_Tp>
{
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <>
struct _LIBCPP_TEMPLATE_VIS hash<nullptr_t>
: public __unary_function<nullptr_t, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(nullptr_t) const _NOEXCEPT {
return 662607004ull;
}
@@ -677,7 +667,7 @@ using __has_enabled_hash _LIBCPP_NODEBUG = integral_constant<bool,
is_default_constructible<_Hash>::value
>;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Type, class>
using __enable_hash_helper_imp _LIBCPP_NODEBUG = _Type;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/identity.h b/contrib/libs/cxxsupp/libcxx/include/__functional/identity.h
index 2fe3acca089..5dffedf677f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/identity.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/identity.h
@@ -11,6 +11,7 @@
#define _LIBCPP___FUNCTIONAL_IDENTITY_H
#include <__config>
+#include <__type_traits/integral_constant.h>
#include <__utility/forward.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -19,27 +20,37 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+template <class _Tp>
+struct __is_identity : false_type {};
+
struct __identity {
template <class _Tp>
- _LIBCPP_NODISCARD _LIBCPP_CONSTEXPR _Tp&& operator()(_Tp&& __t) const _NOEXCEPT {
+ _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp&& operator()(_Tp&& __t) const _NOEXCEPT {
return std::forward<_Tp>(__t);
}
using is_transparent = void;
};
-#if _LIBCPP_STD_VER > 17
+template <>
+struct __is_identity<__identity> : true_type {};
+
+#if _LIBCPP_STD_VER >= 20
struct identity {
template<class _Tp>
- _LIBCPP_NODISCARD_EXT constexpr _Tp&& operator()(_Tp&& __t) const noexcept
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& operator()(_Tp&& __t) const noexcept
{
return _VSTD::forward<_Tp>(__t);
}
using is_transparent = void;
};
-#endif // _LIBCPP_STD_VER > 17
+
+template <>
+struct __is_identity<identity> : true_type {};
+
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/invoke.h b/contrib/libs/cxxsupp/libcxx/include/__functional/invoke.h
index 48e6eac3ce9..a7dd311074d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/invoke.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/invoke.h
@@ -11,525 +11,16 @@
#define _LIBCPP___FUNCTIONAL_INVOKE_H
#include <__config>
-#include <__type_traits/add_lvalue_reference.h>
-#include <__type_traits/apply_cv.h>
-#include <__type_traits/conditional.h>
-#include <__type_traits/decay.h>
-#include <__type_traits/enable_if.h>
-#include <__type_traits/integral_constant.h>
-#include <__type_traits/is_base_of.h>
-#include <__type_traits/is_core_convertible.h>
-#include <__type_traits/is_member_function_pointer.h>
-#include <__type_traits/is_member_object_pointer.h>
-#include <__type_traits/is_reference_wrapper.h>
-#include <__type_traits/is_same.h>
-#include <__type_traits/is_void.h>
-#include <__type_traits/nat.h>
-#include <__type_traits/remove_cv.h>
-#include <__utility/declval.h>
+#include <__type_traits/invoke.h>
#include <__utility/forward.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-// TODO: Disentangle the type traits and std::invoke properly
-
_LIBCPP_BEGIN_NAMESPACE_STD
-struct __any
-{
- __any(...);
-};
-
-template <class _MP, bool _IsMemberFunctionPtr, bool _IsMemberObjectPtr>
-struct __member_pointer_traits_imp
-{
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false>
-{
- typedef _Class _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...), true, false>
-{
- typedef _Class _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param..., ...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const, true, false>
-{
- typedef _Class const _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const, true, false>
-{
- typedef _Class const _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param..., ...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile, true, false>
-{
- typedef _Class volatile _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile, true, false>
-{
- typedef _Class volatile _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param..., ...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile, true, false>
-{
- typedef _Class const volatile _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile, true, false>
-{
- typedef _Class const volatile _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param..., ...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &, true, false>
-{
- typedef _Class& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) &, true, false>
-{
- typedef _Class& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param..., ...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&, true, false>
-{
- typedef _Class const& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const&, true, false>
-{
- typedef _Class const& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param..., ...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&, true, false>
-{
- typedef _Class volatile& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile&, true, false>
-{
- typedef _Class volatile& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param..., ...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&, true, false>
-{
- typedef _Class const volatile& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile&, true, false>
-{
- typedef _Class const volatile& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param..., ...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &&, true, false>
-{
- typedef _Class&& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) &&, true, false>
-{
- typedef _Class&& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param..., ...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&&, true, false>
-{
- typedef _Class const&& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const&&, true, false>
-{
- typedef _Class const&& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param..., ...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&&, true, false>
-{
- typedef _Class volatile&& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile&&, true, false>
-{
- typedef _Class volatile&& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param..., ...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&&, true, false>
-{
- typedef _Class const volatile&& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param...);
-};
-
-template <class _Rp, class _Class, class ..._Param>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile&&, true, false>
-{
- typedef _Class const volatile&& _ClassType;
- typedef _Rp _ReturnType;
- typedef _Rp (_FnType) (_Param..., ...);
-};
-
-template <class _Rp, class _Class>
-struct __member_pointer_traits_imp<_Rp _Class::*, false, true>
-{
- typedef _Class _ClassType;
- typedef _Rp _ReturnType;
-};
-
-template <class _MP>
-struct __member_pointer_traits
- : public __member_pointer_traits_imp<__remove_cv_t<_MP>,
- is_member_function_pointer<_MP>::value,
- is_member_object_pointer<_MP>::value>
-{
-// typedef ... _ClassType;
-// typedef ... _ReturnType;
-// typedef ... _FnType;
-};
-
-template <class _DecayedFp>
-struct __member_pointer_class_type {};
-
-template <class _Ret, class _ClassType>
-struct __member_pointer_class_type<_Ret _ClassType::*> {
- typedef _ClassType type;
-};
-
-template <class _Fp, class _A0,
- class _DecayFp = typename decay<_Fp>::type,
- class _DecayA0 = typename decay<_A0>::type,
- class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
-using __enable_if_bullet1 = typename enable_if
- <
- is_member_function_pointer<_DecayFp>::value
- && is_base_of<_ClassT, _DecayA0>::value
- >::type;
-
-template <class _Fp, class _A0,
- class _DecayFp = typename decay<_Fp>::type,
- class _DecayA0 = typename decay<_A0>::type>
-using __enable_if_bullet2 = typename enable_if
- <
- is_member_function_pointer<_DecayFp>::value
- && __is_reference_wrapper<_DecayA0>::value
- >::type;
-
-template <class _Fp, class _A0,
- class _DecayFp = typename decay<_Fp>::type,
- class _DecayA0 = typename decay<_A0>::type,
- class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
-using __enable_if_bullet3 = typename enable_if
- <
- is_member_function_pointer<_DecayFp>::value
- && !is_base_of<_ClassT, _DecayA0>::value
- && !__is_reference_wrapper<_DecayA0>::value
- >::type;
-
-template <class _Fp, class _A0,
- class _DecayFp = typename decay<_Fp>::type,
- class _DecayA0 = typename decay<_A0>::type,
- class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
-using __enable_if_bullet4 = typename enable_if
- <
- is_member_object_pointer<_DecayFp>::value
- && is_base_of<_ClassT, _DecayA0>::value
- >::type;
-
-template <class _Fp, class _A0,
- class _DecayFp = typename decay<_Fp>::type,
- class _DecayA0 = typename decay<_A0>::type>
-using __enable_if_bullet5 = typename enable_if
- <
- is_member_object_pointer<_DecayFp>::value
- && __is_reference_wrapper<_DecayA0>::value
- >::type;
-
-template <class _Fp, class _A0,
- class _DecayFp = typename decay<_Fp>::type,
- class _DecayA0 = typename decay<_A0>::type,
- class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
-using __enable_if_bullet6 = typename enable_if
- <
- is_member_object_pointer<_DecayFp>::value
- && !is_base_of<_ClassT, _DecayA0>::value
- && !__is_reference_wrapper<_DecayA0>::value
- >::type;
-
-// __invoke forward declarations
-
-// fall back - none of the bullets
-
-template <class ..._Args>
-__nat __invoke(__any, _Args&& ...__args);
-
-// bullets 1, 2 and 3
-
-template <class _Fp, class _A0, class ..._Args,
- class = __enable_if_bullet1<_Fp, _A0> >
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype((std::declval<_A0>().*std::declval<_Fp>())(std::declval<_Args>()...))
-__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
- _NOEXCEPT_(noexcept((static_cast<_A0&&>(__a0).*__f)(static_cast<_Args&&>(__args)...)))
- { return (static_cast<_A0&&>(__a0).*__f)(static_cast<_Args&&>(__args)...); }
-
-template <class _Fp, class _A0, class ..._Args,
- class = __enable_if_bullet2<_Fp, _A0> >
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype((std::declval<_A0>().get().*std::declval<_Fp>())(std::declval<_Args>()...))
-__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
- _NOEXCEPT_(noexcept((__a0.get().*__f)(static_cast<_Args&&>(__args)...)))
- { return (__a0.get().*__f)(static_cast<_Args&&>(__args)...); }
-
-template <class _Fp, class _A0, class ..._Args,
- class = __enable_if_bullet3<_Fp, _A0> >
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype(((*std::declval<_A0>()).*std::declval<_Fp>())(std::declval<_Args>()...))
-__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
- _NOEXCEPT_(noexcept(((*static_cast<_A0&&>(__a0)).*__f)(static_cast<_Args&&>(__args)...)))
- { return ((*static_cast<_A0&&>(__a0)).*__f)(static_cast<_Args&&>(__args)...); }
-
-// bullets 4, 5 and 6
-
-template <class _Fp, class _A0,
- class = __enable_if_bullet4<_Fp, _A0> >
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype(std::declval<_A0>().*std::declval<_Fp>())
-__invoke(_Fp&& __f, _A0&& __a0)
- _NOEXCEPT_(noexcept(static_cast<_A0&&>(__a0).*__f))
- { return static_cast<_A0&&>(__a0).*__f; }
-
-template <class _Fp, class _A0,
- class = __enable_if_bullet5<_Fp, _A0> >
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype(std::declval<_A0>().get().*std::declval<_Fp>())
-__invoke(_Fp&& __f, _A0&& __a0)
- _NOEXCEPT_(noexcept(__a0.get().*__f))
- { return __a0.get().*__f; }
-
-template <class _Fp, class _A0,
- class = __enable_if_bullet6<_Fp, _A0> >
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype((*std::declval<_A0>()).*std::declval<_Fp>())
-__invoke(_Fp&& __f, _A0&& __a0)
- _NOEXCEPT_(noexcept((*static_cast<_A0&&>(__a0)).*__f))
- { return (*static_cast<_A0&&>(__a0)).*__f; }
-
-// bullet 7
-
-template <class _Fp, class ..._Args>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype(std::declval<_Fp>()(std::declval<_Args>()...))
-__invoke(_Fp&& __f, _Args&& ...__args)
- _NOEXCEPT_(noexcept(static_cast<_Fp&&>(__f)(static_cast<_Args&&>(__args)...)))
- { return static_cast<_Fp&&>(__f)(static_cast<_Args&&>(__args)...); }
-
-// __invokable
-template <class _Ret, class _Fp, class ..._Args>
-struct __invokable_r
-{
- template <class _XFp, class ..._XArgs>
- static decltype(std::__invoke(std::declval<_XFp>(), std::declval<_XArgs>()...)) __try_call(int);
- template <class _XFp, class ..._XArgs>
- static __nat __try_call(...);
-
- // FIXME: Check that _Ret, _Fp, and _Args... are all complete types, cv void,
- // or incomplete array types as required by the standard.
- using _Result = decltype(__try_call<_Fp, _Args...>(0));
-
- using type = __conditional_t<
- _IsNotSame<_Result, __nat>::value,
- __conditional_t<is_void<_Ret>::value, true_type, __is_core_convertible<_Result, _Ret> >,
- false_type>;
- static const bool value = type::value;
-};
-template <class _Fp, class ..._Args>
-using __invokable = __invokable_r<void, _Fp, _Args...>;
-
-template <bool _IsInvokable, bool _IsCVVoid, class _Ret, class _Fp, class ..._Args>
-struct __nothrow_invokable_r_imp {
- static const bool value = false;
-};
-
-template <class _Ret, class _Fp, class ..._Args>
-struct __nothrow_invokable_r_imp<true, false, _Ret, _Fp, _Args...>
-{
- typedef __nothrow_invokable_r_imp _ThisT;
-
- template <class _Tp>
- static void __test_noexcept(_Tp) _NOEXCEPT;
-
-#ifdef _LIBCPP_CXX03_LANG
- static const bool value = false;
-#else
- static const bool value = noexcept(_ThisT::__test_noexcept<_Ret>(
- _VSTD::__invoke(std::declval<_Fp>(), std::declval<_Args>()...)));
-#endif
-};
-
-template <class _Ret, class _Fp, class ..._Args>
-struct __nothrow_invokable_r_imp<true, true, _Ret, _Fp, _Args...>
-{
-#ifdef _LIBCPP_CXX03_LANG
- static const bool value = false;
-#else
- static const bool value = noexcept(
- _VSTD::__invoke(std::declval<_Fp>(), std::declval<_Args>()...));
-#endif
-};
-
-template <class _Ret, class _Fp, class ..._Args>
-using __nothrow_invokable_r =
- __nothrow_invokable_r_imp<
- __invokable_r<_Ret, _Fp, _Args...>::value,
- is_void<_Ret>::value,
- _Ret, _Fp, _Args...
- >;
-
-template <class _Fp, class ..._Args>
-using __nothrow_invokable =
- __nothrow_invokable_r_imp<
- __invokable<_Fp, _Args...>::value,
- true, void, _Fp, _Args...
- >;
-
-template <class _Fp, class ..._Args>
-struct __invoke_of
- : public enable_if<
- __invokable<_Fp, _Args...>::value,
- typename __invokable_r<void, _Fp, _Args...>::_Result>
-{
-};
-
-template <class _Ret, bool = is_void<_Ret>::value>
-struct __invoke_void_return_wrapper
-{
- template <class ..._Args>
- static _Ret __call(_Args&&... __args) {
- return std::__invoke(std::forward<_Args>(__args)...);
- }
-};
-
-template <class _Ret>
-struct __invoke_void_return_wrapper<_Ret, true>
-{
- template <class ..._Args>
- static void __call(_Args&&... __args) {
- std::__invoke(std::forward<_Args>(__args)...);
- }
-};
-
-#if _LIBCPP_STD_VER > 14
-
-// is_invocable
-
-template <class _Fn, class ..._Args>
-struct _LIBCPP_TEMPLATE_VIS is_invocable
- : integral_constant<bool, __invokable<_Fn, _Args...>::value> {};
-
-template <class _Ret, class _Fn, class ..._Args>
-struct _LIBCPP_TEMPLATE_VIS is_invocable_r
- : integral_constant<bool, __invokable_r<_Ret, _Fn, _Args...>::value> {};
-
-template <class _Fn, class ..._Args>
-inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
-
-template <class _Ret, class _Fn, class ..._Args>
-inline constexpr bool is_invocable_r_v = is_invocable_r<_Ret, _Fn, _Args...>::value;
-
-// is_nothrow_invocable
-
-template <class _Fn, class ..._Args>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable
- : integral_constant<bool, __nothrow_invokable<_Fn, _Args...>::value> {};
-
-template <class _Ret, class _Fn, class ..._Args>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable_r
- : integral_constant<bool, __nothrow_invokable_r<_Ret, _Fn, _Args...>::value> {};
-
-template <class _Fn, class ..._Args>
-inline constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<_Fn, _Args...>::value;
-
-template <class _Ret, class _Fn, class ..._Args>
-inline constexpr bool is_nothrow_invocable_r_v = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
-
-template <class _Fn, class... _Args>
-struct _LIBCPP_TEMPLATE_VIS invoke_result
- : __invoke_of<_Fn, _Args...>
-{
-};
-
-template <class _Fn, class... _Args>
-using invoke_result_t = typename invoke_result<_Fn, _Args...>::type;
+#if _LIBCPP_STD_VER >= 17
template <class _Fn, class ..._Args>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 invoke_result_t<_Fn, _Args...>
@@ -539,7 +30,26 @@ invoke(_Fn&& __f, _Args&&... __args)
return _VSTD::__invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...);
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
+
+#if _LIBCPP_STD_VER >= 23
+template <class _Result, class _Fn, class... _Args>
+ requires is_invocable_r_v<_Result, _Fn, _Args...>
+_LIBCPP_HIDE_FROM_ABI constexpr _Result
+invoke_r(_Fn&& __f, _Args&&... __args) noexcept(is_nothrow_invocable_r_v<_Result, _Fn, _Args...>) {
+ if constexpr (is_void_v<_Result>) {
+ static_cast<void>(std::invoke(std::forward<_Fn>(__f), std::forward<_Args>(__args)...));
+ } else {
+ // TODO: Use reference_converts_from_temporary_v once implemented
+ // using _ImplicitInvokeResult = invoke_result_t<_Fn, _Args...>;
+ // static_assert(!reference_converts_from_temporary_v<_Result, _ImplicitInvokeResult>,
+ static_assert(true,
+ "Returning from invoke_r would bind a temporary object to the reference return type, "
+ "which would result in a dangling reference.");
+ return std::invoke(std::forward<_Fn>(__f), std::forward<_Args>(__args)...);
+ }
+}
+#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/is_transparent.h b/contrib/libs/cxxsupp/libcxx/include/__functional/is_transparent.h
index c7a0ee9ee7b..c539a07d696 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/is_transparent.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/is_transparent.h
@@ -11,7 +11,8 @@
#define _LIBCPP___FUNCTIONAL_IS_TRANSPARENT
#include <__config>
-#include <type_traits>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/void_t.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -19,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp, class, class = void>
struct __is_transparent : false_type {};
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/mem_fn.h b/contrib/libs/cxxsupp/libcxx/include/__functional/mem_fn.h
index 8b51627079c..fe221dd128f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/mem_fn.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/mem_fn.h
@@ -15,7 +15,6 @@
#include <__functional/invoke.h>
#include <__functional/weak_result_type.h>
#include <__utility/forward.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/not_fn.h b/contrib/libs/cxxsupp/libcxx/include/__functional/not_fn.h
index 79d9a8710bd..0cdb1b7e238 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/not_fn.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/not_fn.h
@@ -13,8 +13,11 @@
#include <__config>
#include <__functional/invoke.h>
#include <__functional/perfect_forward.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_move_constructible.h>
#include <__utility/forward.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -22,7 +25,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
struct __not_fn_op {
template <class... _Args>
@@ -47,7 +50,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 auto not_fn(_Fn&& __f) {
return __not_fn_t<decay_t<_Fn>>(_VSTD::forward<_Fn>(__f));
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/operations.h b/contrib/libs/cxxsupp/libcxx/include/__functional/operations.h
index 8a781efbdbb..6cdb89d6b44 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/operations.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/operations.h
@@ -13,6 +13,9 @@
#include <__config>
#include <__functional/binary_function.h>
#include <__functional/unary_function.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/operation_traits.h>
+#include <__type_traits/predicate_traits.h>
#include <__utility/forward.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -23,7 +26,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// Arithmetic operations
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -38,7 +41,15 @@ struct _LIBCPP_TEMPLATE_VIS plus
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(plus);
-#if _LIBCPP_STD_VER > 11
+template <class _Tp>
+struct __is_trivial_plus_operation<plus<_Tp>, _Tp, _Tp> : true_type {};
+
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp, class _Up>
+struct __is_trivial_plus_operation<plus<>, _Tp, _Up> : true_type {};
+#endif
+
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS plus<void>
{
@@ -52,7 +63,7 @@ struct _LIBCPP_TEMPLATE_VIS plus<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -67,7 +78,7 @@ struct _LIBCPP_TEMPLATE_VIS minus
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(minus);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS minus<void>
{
@@ -81,7 +92,7 @@ struct _LIBCPP_TEMPLATE_VIS minus<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -96,7 +107,7 @@ struct _LIBCPP_TEMPLATE_VIS multiplies
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(multiplies);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS multiplies<void>
{
@@ -110,7 +121,7 @@ struct _LIBCPP_TEMPLATE_VIS multiplies<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -125,7 +136,7 @@ struct _LIBCPP_TEMPLATE_VIS divides
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(divides);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS divides<void>
{
@@ -139,7 +150,7 @@ struct _LIBCPP_TEMPLATE_VIS divides<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -154,7 +165,7 @@ struct _LIBCPP_TEMPLATE_VIS modulus
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(modulus);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS modulus<void>
{
@@ -168,7 +179,7 @@ struct _LIBCPP_TEMPLATE_VIS modulus<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -183,7 +194,7 @@ struct _LIBCPP_TEMPLATE_VIS negate
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(negate);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS negate<void>
{
@@ -199,7 +210,7 @@ struct _LIBCPP_TEMPLATE_VIS negate<void>
// Bitwise operations
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -214,7 +225,7 @@ struct _LIBCPP_TEMPLATE_VIS bit_and
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_and);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS bit_and<void>
{
@@ -228,7 +239,7 @@ struct _LIBCPP_TEMPLATE_VIS bit_and<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
struct _LIBCPP_TEMPLATE_VIS bit_not
: __unary_function<_Tp, _Tp>
@@ -252,7 +263,7 @@ struct _LIBCPP_TEMPLATE_VIS bit_not<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -267,7 +278,7 @@ struct _LIBCPP_TEMPLATE_VIS bit_or
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_or);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS bit_or<void>
{
@@ -281,7 +292,7 @@ struct _LIBCPP_TEMPLATE_VIS bit_or<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -296,7 +307,7 @@ struct _LIBCPP_TEMPLATE_VIS bit_xor
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_xor);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS bit_xor<void>
{
@@ -312,7 +323,7 @@ struct _LIBCPP_TEMPLATE_VIS bit_xor<void>
// Comparison operations
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -327,7 +338,7 @@ struct _LIBCPP_TEMPLATE_VIS equal_to
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(equal_to);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS equal_to<void>
{
@@ -341,7 +352,15 @@ struct _LIBCPP_TEMPLATE_VIS equal_to<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+template <class _Tp>
+struct __is_trivial_equality_predicate<equal_to<_Tp>, _Tp, _Tp> : true_type {};
+
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+struct __is_trivial_equality_predicate<equal_to<>, _Tp, _Tp> : true_type {};
+#endif
+
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -356,7 +375,7 @@ struct _LIBCPP_TEMPLATE_VIS not_equal_to
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(not_equal_to);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS not_equal_to<void>
{
@@ -370,7 +389,7 @@ struct _LIBCPP_TEMPLATE_VIS not_equal_to<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -385,7 +404,7 @@ struct _LIBCPP_TEMPLATE_VIS less
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(less);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS less<void>
{
@@ -399,7 +418,7 @@ struct _LIBCPP_TEMPLATE_VIS less<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -414,7 +433,7 @@ struct _LIBCPP_TEMPLATE_VIS less_equal
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(less_equal);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS less_equal<void>
{
@@ -428,7 +447,7 @@ struct _LIBCPP_TEMPLATE_VIS less_equal<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -443,7 +462,7 @@ struct _LIBCPP_TEMPLATE_VIS greater_equal
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(greater_equal);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS greater_equal<void>
{
@@ -457,7 +476,7 @@ struct _LIBCPP_TEMPLATE_VIS greater_equal<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -472,7 +491,7 @@ struct _LIBCPP_TEMPLATE_VIS greater
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(greater);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS greater<void>
{
@@ -488,7 +507,7 @@ struct _LIBCPP_TEMPLATE_VIS greater<void>
// Logical operations
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -503,7 +522,7 @@ struct _LIBCPP_TEMPLATE_VIS logical_and
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_and);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS logical_and<void>
{
@@ -517,7 +536,7 @@ struct _LIBCPP_TEMPLATE_VIS logical_and<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -532,7 +551,7 @@ struct _LIBCPP_TEMPLATE_VIS logical_not
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_not);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS logical_not<void>
{
@@ -546,7 +565,7 @@ struct _LIBCPP_TEMPLATE_VIS logical_not<void>
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -561,7 +580,7 @@ struct _LIBCPP_TEMPLATE_VIS logical_or
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_or);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS logical_or<void>
{
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/perfect_forward.h b/contrib/libs/cxxsupp/libcxx/include/__functional/perfect_forward.h
index 9ffea1a8c75..b848fbf6963 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/perfect_forward.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/perfect_forward.h
@@ -11,19 +11,25 @@
#define _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H
#include <__config>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/invoke.h>
+#include <__type_traits/is_constructible.h>
#include <__utility/declval.h>
#include <__utility/forward.h>
+#include <__utility/integer_sequence.h>
#include <__utility/move.h>
#include <tuple>
-#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 _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Op, class _Indices, class... _BoundArgs>
struct __perfect_forward_impl;
@@ -37,14 +43,14 @@ public:
template <class... _Args, class = enable_if_t<
is_constructible_v<tuple<_BoundArgs...>, _Args&&...>
>>
- explicit constexpr __perfect_forward_impl(_Args&&... __bound_args)
+ _LIBCPP_HIDE_FROM_ABI explicit constexpr __perfect_forward_impl(_Args&&... __bound_args)
: __bound_args_(_VSTD::forward<_Args>(__bound_args)...) {}
- __perfect_forward_impl(__perfect_forward_impl const&) = default;
- __perfect_forward_impl(__perfect_forward_impl&&) = default;
+ _LIBCPP_HIDE_FROM_ABI __perfect_forward_impl(__perfect_forward_impl const&) = default;
+ _LIBCPP_HIDE_FROM_ABI __perfect_forward_impl(__perfect_forward_impl&&) = default;
- __perfect_forward_impl& operator=(__perfect_forward_impl const&) = default;
- __perfect_forward_impl& operator=(__perfect_forward_impl&&) = default;
+ _LIBCPP_HIDE_FROM_ABI __perfect_forward_impl& operator=(__perfect_forward_impl const&) = default;
+ _LIBCPP_HIDE_FROM_ABI __perfect_forward_impl& operator=(__perfect_forward_impl&&) = default;
template <class... _Args, class = enable_if_t<is_invocable_v<_Op, _BoundArgs&..., _Args...>>>
_LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) &
@@ -87,8 +93,10 @@ public:
template <class _Op, class ..._Args>
using __perfect_forward = __perfect_forward_impl<_Op, index_sequence_for<_Args...>, _Args...>;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/ranges_operations.h b/contrib/libs/cxxsupp/libcxx/include/__functional/ranges_operations.h
index 87081dd56a0..c344fc38f98 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/ranges_operations.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/ranges_operations.h
@@ -13,6 +13,8 @@
#include <__concepts/equality_comparable.h>
#include <__concepts/totally_ordered.h>
#include <__config>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/predicate_traits.h>
#include <__utility/forward.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -21,14 +23,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
struct equal_to {
template <class _Tp, class _Up>
requires equality_comparable_with<_Tp, _Up>
- [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp &&__t, _Up &&__u) const
noexcept(noexcept(bool(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u)))) {
return _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u);
}
@@ -39,7 +41,7 @@ struct equal_to {
struct not_equal_to {
template <class _Tp, class _Up>
requires equality_comparable_with<_Tp, _Up>
- [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp &&__t, _Up &&__u) const
noexcept(noexcept(bool(!(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u))))) {
return !(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u));
}
@@ -50,7 +52,7 @@ struct not_equal_to {
struct less {
template <class _Tp, class _Up>
requires totally_ordered_with<_Tp, _Up>
- [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp &&__t, _Up &&__u) const
noexcept(noexcept(bool(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u)))) {
return _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u);
}
@@ -61,7 +63,7 @@ struct less {
struct less_equal {
template <class _Tp, class _Up>
requires totally_ordered_with<_Tp, _Up>
- [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp &&__t, _Up &&__u) const
noexcept(noexcept(bool(!(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t))))) {
return !(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t));
}
@@ -72,7 +74,7 @@ struct less_equal {
struct greater {
template <class _Tp, class _Up>
requires totally_ordered_with<_Tp, _Up>
- [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp &&__t, _Up &&__u) const
noexcept(noexcept(bool(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t)))) {
return _VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t);
}
@@ -83,7 +85,7 @@ struct greater {
struct greater_equal {
template <class _Tp, class _Up>
requires totally_ordered_with<_Tp, _Up>
- [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp &&__t, _Up &&__u) const
noexcept(noexcept(bool(!(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u))))) {
return !(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u));
}
@@ -93,7 +95,10 @@ struct greater_equal {
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+template <class _Lhs, class _Rhs>
+struct __is_trivial_equality_predicate<ranges::equal_to, _Lhs, _Rhs> : true_type {};
+
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/reference_wrapper.h b/contrib/libs/cxxsupp/libcxx/include/__functional/reference_wrapper.h
index c377b643770..2d382a34f6a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/reference_wrapper.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__functional/reference_wrapper.h
@@ -55,12 +55,18 @@ public:
template <class... _ArgTypes>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
typename __invoke_of<type&, _ArgTypes...>::type
- operator() (_ArgTypes&&... __args) const {
+ operator() (_ArgTypes&&... __args) const
+#if _LIBCPP_STD_VER >= 17
+ // Since is_nothrow_invocable requires C++17 LWG3764 is not backported
+ // to earlier versions.
+ noexcept(is_nothrow_invocable_v<_Tp&, _ArgTypes...>)
+#endif
+ {
return std::__invoke(get(), std::forward<_ArgTypes>(__args)...);
}
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
reference_wrapper(_Tp&) -> reference_wrapper<_Tp>;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__functional/unwrap_ref.h b/contrib/libs/cxxsupp/libcxx/include/__functional/unwrap_ref.h
deleted file mode 100644
index da000d80b8c..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__functional/unwrap_ref.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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___FUNCTIONAL_UNWRAP_REF_H
-#define _LIBCPP___FUNCTIONAL_UNWRAP_REF_H
-
-#include <__config>
-#include <__type_traits/decay.h>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <class _Tp>
-struct __unwrap_reference { typedef _LIBCPP_NODEBUG _Tp type; };
-
-template <class _Tp>
-class reference_wrapper;
-
-template <class _Tp>
-struct __unwrap_reference<reference_wrapper<_Tp> > { typedef _LIBCPP_NODEBUG _Tp& type; };
-
-template <class _Tp>
-struct decay;
-
-#if _LIBCPP_STD_VER > 17
-template <class _Tp>
-struct unwrap_reference : __unwrap_reference<_Tp> { };
-
-template <class _Tp>
-using unwrap_reference_t = typename unwrap_reference<_Tp>::type;
-
-template <class _Tp>
-struct unwrap_ref_decay : unwrap_reference<typename decay<_Tp>::type> { };
-
-template <class _Tp>
-using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type;
-#endif // > C++17
-
-template <class _Tp>
-struct __unwrap_ref_decay
-#if _LIBCPP_STD_VER > 17
- : unwrap_ref_decay<_Tp>
-#else
- : __unwrap_reference<typename decay<_Tp>::type>
-#endif
-{ };
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP___FUNCTIONAL_UNWRAP_REF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__fwd/fstream.h b/contrib/libs/cxxsupp/libcxx/include/__fwd/fstream.h
new file mode 100644
index 00000000000..b4a112bfd4d
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__fwd/fstream.h
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___FWD_FSTREAM_H
+#define _LIBCPP___FWD_FSTREAM_H
+
+#include <__config>
+#include <__fwd/string.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _CharT, class _Traits = char_traits<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_filebuf;
+template <class _CharT, class _Traits = char_traits<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_ifstream;
+template <class _CharT, class _Traits = char_traits<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_ofstream;
+template <class _CharT, class _Traits = char_traits<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_fstream;
+
+using filebuf = basic_filebuf<char>;
+using ifstream = basic_ifstream<char>;
+using ofstream = basic_ofstream<char>;
+using fstream = basic_fstream<char>;
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+using wfilebuf = basic_filebuf<wchar_t>;
+using wifstream = basic_ifstream<wchar_t>;
+using wofstream = basic_ofstream<wchar_t>;
+using wfstream = basic_fstream<wchar_t>;
+#endif
+
+template <class _CharT, class _Traits>
+class _LIBCPP_PREFERRED_NAME(filebuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfilebuf)) basic_filebuf;
+template <class _CharT, class _Traits>
+class _LIBCPP_PREFERRED_NAME(ifstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wifstream)) basic_ifstream;
+template <class _CharT, class _Traits>
+class _LIBCPP_PREFERRED_NAME(ofstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wofstream)) basic_ofstream;
+template <class _CharT, class _Traits>
+class _LIBCPP_PREFERRED_NAME(fstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfstream)) basic_fstream;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FWD_FSTREAM_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__fwd/get.h b/contrib/libs/cxxsupp/libcxx/include/__fwd/get.h
index ec1fab4602d..d04341496c6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__fwd/get.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__fwd/get.h
@@ -15,7 +15,7 @@
#include <__fwd/pair.h>
#include <__fwd/subrange.h>
#include <__fwd/tuple.h>
-#include <__tuple_dir/tuple_element.h>
+#include <__tuple/tuple_element.h>
#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__fwd/ios.h b/contrib/libs/cxxsupp/libcxx/include/__fwd/ios.h
new file mode 100644
index 00000000000..82c865d58cc
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__fwd/ios.h
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___FWD_IOS_H
+#define _LIBCPP___FWD_IOS_H
+
+#include <__config>
+#include <__fwd/string.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _CharT, class _Traits = char_traits<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_ios;
+
+using ios = basic_ios<char>;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+using wios = basic_ios<wchar_t>;
+#endif
+
+template <class _CharT, class _Traits>
+class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wios)) basic_ios;
+
+#if defined(_NEWLIB_VERSION)
+// On newlib, off_t is 'long int'
+using streamoff = long int; // for char_traits in <string>
+#else
+using streamoff = long long; // for char_traits in <string>
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FWD_IOS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__fwd/istream.h b/contrib/libs/cxxsupp/libcxx/include/__fwd/istream.h
new file mode 100644
index 00000000000..a06907a6c8e
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__fwd/istream.h
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___FWD_ISTREAM_H
+#define _LIBCPP___FWD_ISTREAM_H
+
+#include <__config>
+#include <__fwd/string.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _CharT, class _Traits = char_traits<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_istream;
+
+template <class _CharT, class _Traits = char_traits<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_iostream;
+
+using istream = basic_istream<char>;
+using iostream = basic_iostream<char>;
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+using wistream = basic_istream<wchar_t>;
+using wiostream = basic_iostream<wchar_t>;
+#endif
+
+template <class _CharT, class _Traits>
+class _LIBCPP_PREFERRED_NAME(istream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistream)) basic_istream;
+
+template <class _CharT, class _Traits>
+class _LIBCPP_PREFERRED_NAME(iostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wiostream)) basic_iostream;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FWD_ISTREAM_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__fwd/memory_resource.h b/contrib/libs/cxxsupp/libcxx/include/__fwd/memory_resource.h
index 718a9078d3c..03b78ad2bd3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__fwd/memory_resource.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__fwd/memory_resource.h
@@ -9,6 +9,7 @@
#ifndef _LIBCPP___FWD_MEMORY_RESOURCE_H
#define _LIBCPP___FWD_MEMORY_RESOURCE_H
+#include <__availability>
#include <__config>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -19,7 +20,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueType>
-class _LIBCPP_TEMPLATE_VIS polymorphic_allocator;
+class _LIBCPP_AVAILABILITY_PMR _LIBCPP_TEMPLATE_VIS polymorphic_allocator;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__fwd/ostream.h b/contrib/libs/cxxsupp/libcxx/include/__fwd/ostream.h
new file mode 100644
index 00000000000..3347e0f71d7
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__fwd/ostream.h
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___FWD_OSTREAM_H
+#define _LIBCPP___FWD_OSTREAM_H
+
+#include <__config>
+#include <__fwd/string.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _CharT, class _Traits = char_traits<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_ostream;
+
+using ostream = basic_ostream<char>;
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+using wostream = basic_ostream<wchar_t>;
+#endif
+
+template <class _CharT, class _Traits>
+class _LIBCPP_PREFERRED_NAME(ostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostream)) basic_ostream;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FWD_OSTREAM_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__fwd/span.h b/contrib/libs/cxxsupp/libcxx/include/__fwd/span.h
index 943cb13fa1b..e9fa70382f5 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__fwd/span.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__fwd/span.h
@@ -23,7 +23,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max();
template <typename _Tp, size_t _Extent = dynamic_extent> class span;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__fwd/sstream.h b/contrib/libs/cxxsupp/libcxx/include/__fwd/sstream.h
new file mode 100644
index 00000000000..e2d46fbe1d9
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__fwd/sstream.h
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___FWD_SSTREAM_H
+#define _LIBCPP___FWD_SSTREAM_H
+
+#include <__config>
+#include <__fwd/string.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_stringbuf;
+
+template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_istringstream;
+template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_ostringstream;
+template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_stringstream;
+
+using stringbuf = basic_stringbuf<char>;
+using istringstream = basic_istringstream<char>;
+using ostringstream = basic_ostringstream<char>;
+using stringstream = basic_stringstream<char>;
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+using wstringbuf = basic_stringbuf<wchar_t>;
+using wistringstream = basic_istringstream<wchar_t>;
+using wostringstream = basic_ostringstream<wchar_t>;
+using wstringstream = basic_stringstream<wchar_t>;
+#endif
+
+template <class _CharT, class _Traits, class _Allocator>
+class _LIBCPP_PREFERRED_NAME(stringbuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringbuf)) basic_stringbuf;
+template <class _CharT, class _Traits, class _Allocator>
+class _LIBCPP_PREFERRED_NAME(istringstream)
+ _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistringstream)) basic_istringstream;
+template <class _CharT, class _Traits, class _Allocator>
+class _LIBCPP_PREFERRED_NAME(ostringstream)
+ _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostringstream)) basic_ostringstream;
+template <class _CharT, class _Traits, class _Allocator>
+class _LIBCPP_PREFERRED_NAME(stringstream)
+ _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringstream)) basic_stringstream;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FWD_SSTREAM_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__fwd/streambuf.h b/contrib/libs/cxxsupp/libcxx/include/__fwd/streambuf.h
new file mode 100644
index 00000000000..b35afa6afe3
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__fwd/streambuf.h
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___FWD_STREAMBUF_H
+#define _LIBCPP___FWD_STREAMBUF_H
+
+#include <__config>
+#include <__fwd/string.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _CharT, class _Traits = char_traits<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_streambuf;
+
+using streambuf = basic_streambuf<char>;
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+using wstreambuf = basic_streambuf<wchar_t>;
+#endif
+
+template <class _CharT, class _Traits>
+class _LIBCPP_PREFERRED_NAME(streambuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstreambuf)) basic_streambuf;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FWD_STREAMBUF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__fwd/string.h b/contrib/libs/cxxsupp/libcxx/include/__fwd/string.h
index 7ab5561b758..032132374de 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__fwd/string.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__fwd/string.h
@@ -9,6 +9,7 @@
#ifndef _LIBCPP___FWD_STRING_H
#define _LIBCPP___FWD_STRING_H
+#include <__availability>
#include <__config>
#include <__fwd/memory_resource.h>
@@ -61,21 +62,20 @@ using u32string = basic_string<char32_t>;
namespace pmr {
template <class _CharT, class _Traits = char_traits<_CharT>>
-using basic_string = std::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
+using basic_string _LIBCPP_AVAILABILITY_PMR = std::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
-using string = basic_string<char>;
+using string _LIBCPP_AVAILABILITY_PMR = basic_string<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-using wstring = basic_string<wchar_t>;
+using wstring _LIBCPP_AVAILABILITY_PMR = basic_string<wchar_t>;
# endif
# ifndef _LIBCPP_HAS_NO_CHAR8_T
-using u8string = basic_string<char8_t>;
+using u8string _LIBCPP_AVAILABILITY_PMR = basic_string<char8_t>;
# endif
-using u16string = basic_string<char16_t>;
-using u32string = basic_string<char32_t>;
-
+using u16string _LIBCPP_AVAILABILITY_PMR = basic_string<char16_t>;
+using u32string _LIBCPP_AVAILABILITY_PMR = basic_string<char32_t>;
} // namespace pmr
#endif // _LIBCPP_STD_VER >= 17
diff --git a/contrib/libs/cxxsupp/libcxx/include/__hash_table b/contrib/libs/cxxsupp/libcxx/include/__hash_table
index f8896c8664e..2ae7afdc10d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__hash_table
+++ b/contrib/libs/cxxsupp/libcxx/include/__hash_table
@@ -15,8 +15,8 @@
#include <__assert>
#include <__bit/countl.h>
#include <__config>
-#include <__debug>
#include <__functional/hash.h>
+#include <__functional/invoke.h>
#include <__iterator/iterator_traits.h>
#include <__memory/addressof.h>
#include <__memory/allocator_traits.h>
@@ -25,6 +25,19 @@
#include <__memory/swap_allocator.h>
#include <__memory/unique_ptr.h>
#include <__type_traits/can_extract_key.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/is_const.h>
+#include <__type_traits/is_copy_constructible.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_nothrow_copy_constructible.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_pointer.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/is_swappable.h>
+#include <__type_traits/remove_const.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/pair.h>
@@ -32,7 +45,6 @@
#include <cmath>
#include <cstring>
#include <initializer_list>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -59,8 +71,7 @@ struct __is_hash_value_type : false_type {};
template <class _One>
struct __is_hash_value_type<_One> : __is_hash_value_type_imp<__remove_cvref_t<_One> > {};
-_LIBCPP_FUNC_VIS
-size_t __next_prime(size_t __n);
+_LIBCPP_EXPORTED_FROM_ABI size_t __next_prime(size_t __n);
template <class _NodePtr>
struct __hash_node_base
@@ -296,53 +307,20 @@ public:
typedef typename _NodeTypes::__node_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT : __node_(nullptr) {
- _VSTD::__debug_db_insert_i(this);
}
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- _LIBCPP_INLINE_VISIBILITY
- __hash_iterator(const __hash_iterator& __i)
- : __node_(__i.__node_)
- {
- __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
- }
-
- _LIBCPP_INLINE_VISIBILITY
- ~__hash_iterator()
- {
- __get_db()->__erase_i(this);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __hash_iterator& operator=(const __hash_iterator& __i)
- {
- if (this != _VSTD::addressof(__i))
- {
- __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
- __node_ = __i.__node_;
- }
- return *this;
- }
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
_LIBCPP_INLINE_VISIBILITY
reference operator*() const {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable unordered container iterator");
return __node_->__upcast()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable unordered container iterator");
return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
}
_LIBCPP_INLINE_VISIBILITY
__hash_iterator& operator++() {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment a non-incrementable unordered container iterator");
__node_ = __node_->__next_;
return *this;
}
@@ -366,14 +344,11 @@ public:
private:
_LIBCPP_INLINE_VISIBILITY
- explicit __hash_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
+ explicit __hash_iterator(__next_pointer __node) _NOEXCEPT
: __node_(__node)
{
- (void)__c;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __get_db()->__insert_ic(this, __c);
-#endif
}
+
template <class, class, class, class> friend class __hash_table;
template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_iterator;
template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_iterator;
@@ -402,61 +377,25 @@ public:
_LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT : __node_(nullptr) {
- _VSTD::__debug_db_insert_i(this);
}
_LIBCPP_INLINE_VISIBILITY
__hash_const_iterator(const __non_const_iterator& __x) _NOEXCEPT
: __node_(__x.__node_)
{
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __get_db()->__iterator_copy(this, _VSTD::addressof(__x));
-#endif
}
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- _LIBCPP_INLINE_VISIBILITY
- __hash_const_iterator(const __hash_const_iterator& __i)
- : __node_(__i.__node_)
- {
- __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
- }
-
- _LIBCPP_INLINE_VISIBILITY
- ~__hash_const_iterator()
- {
- __get_db()->__erase_i(this);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __hash_const_iterator& operator=(const __hash_const_iterator& __i)
- {
- if (this != _VSTD::addressof(__i))
- {
- __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
- __node_ = __i.__node_;
- }
- return *this;
- }
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
_LIBCPP_INLINE_VISIBILITY
reference operator*() const {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable unordered container const_iterator");
return __node_->__upcast()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable unordered container const_iterator");
return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
}
_LIBCPP_INLINE_VISIBILITY
__hash_const_iterator& operator++() {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment a non-incrementable unordered container const_iterator");
__node_ = __node_->__next_;
return *this;
}
@@ -480,14 +419,11 @@ public:
private:
_LIBCPP_INLINE_VISIBILITY
- explicit __hash_const_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
+ explicit __hash_const_iterator(__next_pointer __node) _NOEXCEPT
: __node_(__node)
{
- (void)__c;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __get_db()->__insert_ic(this, __c);
-#endif
}
+
template <class, class, class, class> friend class __hash_table;
template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator;
template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_map;
@@ -513,57 +449,20 @@ public:
typedef typename _NodeTypes::__node_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT : __node_(nullptr) {
- _VSTD::__debug_db_insert_i(this);
- }
-
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- _LIBCPP_INLINE_VISIBILITY
- __hash_local_iterator(const __hash_local_iterator& __i)
- : __node_(__i.__node_),
- __bucket_(__i.__bucket_),
- __bucket_count_(__i.__bucket_count_)
- {
- __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
- }
-
- _LIBCPP_INLINE_VISIBILITY
- ~__hash_local_iterator()
- {
- __get_db()->__erase_i(this);
}
_LIBCPP_INLINE_VISIBILITY
- __hash_local_iterator& operator=(const __hash_local_iterator& __i)
- {
- if (this != _VSTD::addressof(__i))
- {
- __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
- __node_ = __i.__node_;
- __bucket_ = __i.__bucket_;
- __bucket_count_ = __i.__bucket_count_;
- }
- return *this;
- }
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
- _LIBCPP_INLINE_VISIBILITY
reference operator*() const {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable unordered container local_iterator");
return __node_->__upcast()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable unordered container local_iterator");
return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
}
_LIBCPP_INLINE_VISIBILITY
__hash_local_iterator& operator++() {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment a non-incrementable unordered container local_iterator");
__node_ = __node_->__next_;
if (__node_ != nullptr && std::__constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
__node_ = nullptr;
@@ -590,18 +489,15 @@ public:
private:
_LIBCPP_INLINE_VISIBILITY
explicit __hash_local_iterator(__next_pointer __node, size_t __bucket,
- size_t __bucket_count, const void* __c) _NOEXCEPT
+ size_t __bucket_count) _NOEXCEPT
: __node_(__node),
__bucket_(__bucket),
__bucket_count_(__bucket_count)
{
- (void)__c;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __get_db()->__insert_ic(this, __c);
-#endif
if (__node_ != nullptr)
__node_ = __node_->__next_;
}
+
template <class, class, class, class> friend class __hash_table;
template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator;
template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_iterator;
@@ -635,7 +531,6 @@ public:
_LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT : __node_(nullptr) {
- _VSTD::__debug_db_insert_i(this);
}
_LIBCPP_INLINE_VISIBILITY
@@ -644,59 +539,20 @@ public:
__bucket_(__x.__bucket_),
__bucket_count_(__x.__bucket_count_)
{
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __get_db()->__iterator_copy(this, _VSTD::addressof(__x));
-#endif
}
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- _LIBCPP_INLINE_VISIBILITY
- __hash_const_local_iterator(const __hash_const_local_iterator& __i)
- : __node_(__i.__node_),
- __bucket_(__i.__bucket_),
- __bucket_count_(__i.__bucket_count_)
- {
- __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
- }
-
- _LIBCPP_INLINE_VISIBILITY
- ~__hash_const_local_iterator()
- {
- __get_db()->__erase_i(this);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __hash_const_local_iterator& operator=(const __hash_const_local_iterator& __i)
- {
- if (this != _VSTD::addressof(__i))
- {
- __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
- __node_ = __i.__node_;
- __bucket_ = __i.__bucket_;
- __bucket_count_ = __i.__bucket_count_;
- }
- return *this;
- }
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
_LIBCPP_INLINE_VISIBILITY
reference operator*() const {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
return __node_->__upcast()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
}
_LIBCPP_INLINE_VISIBILITY
__hash_const_local_iterator& operator++() {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment a non-incrementable unordered container const_local_iterator");
__node_ = __node_->__next_;
if (__node_ != nullptr && std::__constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
__node_ = nullptr;
@@ -723,18 +579,15 @@ public:
private:
_LIBCPP_INLINE_VISIBILITY
explicit __hash_const_local_iterator(__next_pointer __node_ptr, size_t __bucket,
- size_t __bucket_count, const void* __c) _NOEXCEPT
+ size_t __bucket_count) _NOEXCEPT
: __node_(__node_ptr),
__bucket_(__bucket),
__bucket_count_(__bucket_count)
{
- (void)__c;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __get_db()->__insert_ic(this, __c);
-#endif
if (__node_ != nullptr)
__node_ = __node_->__next_;
}
+
template <class, class, class, class> friend class __hash_table;
template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator;
};
@@ -803,8 +656,8 @@ private:
public:
bool __value_constructed;
- __hash_node_destructor(__hash_node_destructor const&) = default;
- __hash_node_destructor& operator=(const __hash_node_destructor&) = delete;
+ _LIBCPP_HIDE_FROM_ABI __hash_node_destructor(__hash_node_destructor const&) = default;
+ _LIBCPP_HIDE_FROM_ABI __hash_node_destructor& operator=(const __hash_node_destructor&) = delete;
_LIBCPP_INLINE_VISIBILITY
@@ -826,7 +679,7 @@ public:
template <class> friend class __hash_map_node_destructor;
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _NodeType, class _Alloc>
struct __generic_container_node_destructor;
@@ -976,22 +829,22 @@ public:
is_nothrow_default_constructible<key_equal>::value);
_LIBCPP_INLINE_VISIBILITY
__hash_table(const hasher& __hf, const key_equal& __eql);
- __hash_table(const hasher& __hf, const key_equal& __eql,
+ _LIBCPP_HIDE_FROM_ABI __hash_table(const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
- explicit __hash_table(const allocator_type& __a);
- __hash_table(const __hash_table& __u);
- __hash_table(const __hash_table& __u, const allocator_type& __a);
- __hash_table(__hash_table&& __u)
+ _LIBCPP_HIDE_FROM_ABI explicit __hash_table(const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI __hash_table(const __hash_table& __u);
+ _LIBCPP_HIDE_FROM_ABI __hash_table(const __hash_table& __u, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI __hash_table(__hash_table&& __u)
_NOEXCEPT_(
is_nothrow_move_constructible<__bucket_list>::value &&
is_nothrow_move_constructible<__first_node>::value &&
is_nothrow_move_constructible<__node_allocator>::value &&
is_nothrow_move_constructible<hasher>::value &&
is_nothrow_move_constructible<key_equal>::value);
- __hash_table(__hash_table&& __u, const allocator_type& __a);
- ~__hash_table();
+ _LIBCPP_HIDE_FROM_ABI __hash_table(__hash_table&& __u, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI ~__hash_table();
- __hash_table& operator=(const __hash_table& __u);
+ _LIBCPP_HIDE_FROM_ABI __hash_table& operator=(const __hash_table& __u);
_LIBCPP_INLINE_VISIBILITY
__hash_table& operator=(__hash_table&& __u)
_NOEXCEPT_(
@@ -1000,9 +853,9 @@ public:
is_nothrow_move_assignable<hasher>::value &&
is_nothrow_move_assignable<key_equal>::value);
template <class _InputIterator>
- void __assign_unique(_InputIterator __first, _InputIterator __last);
+ _LIBCPP_HIDE_FROM_ABI void __assign_unique(_InputIterator __first, _InputIterator __last);
template <class _InputIterator>
- void __assign_multi(_InputIterator __first, _InputIterator __last);
+ _LIBCPP_HIDE_FROM_ABI void __assign_multi(_InputIterator __first, _InputIterator __last);
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT
@@ -1121,7 +974,7 @@ public:
return __emplace_unique_key_args(_NodeTypes::__get_key(__x), __x);
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _NodeHandle, class _InsertReturnType>
_LIBCPP_INLINE_VISIBILITY
_InsertReturnType __node_handle_insert_unique(_NodeHandle&& __nh);
@@ -1151,7 +1004,7 @@ public:
_NodeHandle __node_handle_extract(const_iterator __it);
#endif
- void clear() _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY void __rehash_unique(size_type __n) { __rehash<true>(__n); }
_LIBCPP_INLINE_VISIBILITY void __rehash_multi(size_type __n) { __rehash<false>(__n); }
_LIBCPP_INLINE_VISIBILITY void __reserve_unique(size_type __n)
@@ -1182,48 +1035,48 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type bucket(const _Key& __k) const
{
- _LIBCPP_ASSERT(bucket_count() > 0,
+ _LIBCPP_ASSERT_UNCATEGORIZED(bucket_count() > 0,
"unordered container::bucket(key) called when bucket_count() == 0");
return std::__constrain_hash(hash_function()(__k), bucket_count());
}
template <class _Key>
- iterator find(const _Key& __x);
+ _LIBCPP_HIDE_FROM_ABI iterator find(const _Key& __x);
template <class _Key>
- const_iterator find(const _Key& __x) const;
+ _LIBCPP_HIDE_FROM_ABI const_iterator find(const _Key& __x) const;
typedef __hash_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _Dp> __node_holder;
- iterator erase(const_iterator __p);
- iterator erase(const_iterator __first, const_iterator __last);
+ _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p);
+ _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last);
template <class _Key>
- size_type __erase_unique(const _Key& __k);
+ _LIBCPP_HIDE_FROM_ABI size_type __erase_unique(const _Key& __k);
template <class _Key>
- size_type __erase_multi(const _Key& __k);
- __node_holder remove(const_iterator __p) _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI size_type __erase_multi(const _Key& __k);
+ _LIBCPP_HIDE_FROM_ABI __node_holder remove(const_iterator __p) _NOEXCEPT;
template <class _Key>
_LIBCPP_INLINE_VISIBILITY
size_type __count_unique(const _Key& __k) const;
template <class _Key>
- size_type __count_multi(const _Key& __k) const;
+ _LIBCPP_HIDE_FROM_ABI size_type __count_multi(const _Key& __k) const;
template <class _Key>
- pair<iterator, iterator>
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator>
__equal_range_unique(const _Key& __k);
template <class _Key>
- pair<const_iterator, const_iterator>
+ _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator>
__equal_range_unique(const _Key& __k) const;
template <class _Key>
- pair<iterator, iterator>
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator>
__equal_range_multi(const _Key& __k);
template <class _Key>
- pair<const_iterator, const_iterator>
+ _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator>
__equal_range_multi(const _Key& __k) const;
- void swap(__hash_table& __u)
+ _LIBCPP_HIDE_FROM_ABI void swap(__hash_table& __u)
#if _LIBCPP_STD_VER <= 11
_NOEXCEPT_(
__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value
@@ -1239,7 +1092,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type max_bucket_count() const _NOEXCEPT
{return max_size(); }
- size_type bucket_size(size_type __n) const;
+ _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const;
_LIBCPP_INLINE_VISIBILITY float load_factor() const _NOEXCEPT
{
size_type __bc = bucket_count();
@@ -1247,7 +1100,7 @@ public:
}
_LIBCPP_INLINE_VISIBILITY void max_load_factor(float __mlf) _NOEXCEPT
{
- _LIBCPP_ASSERT(__mlf > 0,
+ _LIBCPP_ASSERT_UNCATEGORIZED(__mlf > 0,
"unordered container::max_load_factor(lf) called with lf <= 0");
max_load_factor() = _VSTD::max(__mlf, load_factor());
}
@@ -1256,68 +1109,61 @@ public:
local_iterator
begin(size_type __n)
{
- _LIBCPP_ASSERT(__n < bucket_count(),
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < bucket_count(),
"unordered container::begin(n) called with n >= bucket_count()");
- return local_iterator(__bucket_list_[__n], __n, bucket_count(), this);
+ return local_iterator(__bucket_list_[__n], __n, bucket_count());
}
_LIBCPP_INLINE_VISIBILITY
local_iterator
end(size_type __n)
{
- _LIBCPP_ASSERT(__n < bucket_count(),
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < bucket_count(),
"unordered container::end(n) called with n >= bucket_count()");
- return local_iterator(nullptr, __n, bucket_count(), this);
+ return local_iterator(nullptr, __n, bucket_count());
}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator
cbegin(size_type __n) const
{
- _LIBCPP_ASSERT(__n < bucket_count(),
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < bucket_count(),
"unordered container::cbegin(n) called with n >= bucket_count()");
- return const_local_iterator(__bucket_list_[__n], __n, bucket_count(), this);
+ return const_local_iterator(__bucket_list_[__n], __n, bucket_count());
}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator
cend(size_type __n) const
{
- _LIBCPP_ASSERT(__n < bucket_count(),
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < bucket_count(),
"unordered container::cend(n) called with n >= bucket_count()");
- return const_local_iterator(nullptr, __n, bucket_count(), this);
+ return const_local_iterator(nullptr, __n, bucket_count());
}
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
- bool __dereferenceable(const const_iterator* __i) const;
- bool __decrementable(const const_iterator* __i) const;
- bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
- bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
-
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
private:
- template <bool _UniqueKeys> void __rehash(size_type __n);
- template <bool _UniqueKeys> void __do_rehash(size_type __n);
+ template <bool _UniqueKeys>
+ _LIBCPP_HIDE_FROM_ABI void __rehash(size_type __n);
+ template <bool _UniqueKeys>
+ _LIBCPP_HIDE_FROM_ABI void __do_rehash(size_type __n);
template <class ..._Args>
- __node_holder __construct_node(_Args&& ...__args);
+ _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node(_Args&& ...__args);
template <class _First, class ..._Rest>
- __node_holder __construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest);
+ _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest);
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __hash_table& __u)
{__copy_assign_alloc(__u, integral_constant<bool,
__node_traits::propagate_on_container_copy_assignment::value>());}
- void __copy_assign_alloc(const __hash_table& __u, true_type);
+ _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const __hash_table& __u, true_type);
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __hash_table&, false_type) {}
- void __move_assign(__hash_table& __u, false_type);
- void __move_assign(__hash_table& __u, true_type)
+ _LIBCPP_HIDE_FROM_ABI void __move_assign(__hash_table& __u, false_type);
+ _LIBCPP_HIDE_FROM_ABI void __move_assign(__hash_table& __u, true_type)
_NOEXCEPT_(
is_nothrow_move_assignable<__node_allocator>::value &&
is_nothrow_move_assignable<hasher>::value &&
@@ -1343,8 +1189,8 @@ private:
_LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}
- void __deallocate_node(__next_pointer __np) _NOEXCEPT;
- __next_pointer __detach() _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI void __deallocate_node(__next_pointer __np) _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI __next_pointer __detach() _NOEXCEPT;
template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_map;
template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_multimap;
@@ -1476,7 +1322,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table()
#endif
__deallocate_node(__p1_.first().__next_);
- std::__debug_db_erase_c(this);
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -1518,21 +1363,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate_node(__next_pointer __np)
while (__np != nullptr)
{
__next_pointer __next = __np->__next_;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __p = __c->end_; __p != __c->beg_; )
- {
- --__p;
- iterator* __i = static_cast<iterator*>((*__p)->__i_);
- if (__i->__node_ == __np)
- {
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
- }
- }
- __get_db()->unlock();
-#endif
__node_pointer __real_np = __np->__upcast();
__node_traits::destroy(__na, _NodeTypes::__get_ptr(__real_np->__value_));
__node_traits::deallocate(__na, __real_np, 1);
@@ -1579,7 +1409,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
__u.__p1_.first().__next_ = nullptr;
__u.size() = 0;
}
- std::__debug_db_swap(this, std::addressof(__u));
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -1597,10 +1426,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
if (bucket_count() != 0)
{
__next_pointer __cache = __detach();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
const_iterator __i = __u.begin();
while (__cache != nullptr && __u.size() != 0)
{
@@ -1610,14 +1439,14 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
__node_insert_multi(__cache->__upcast());
__cache = __next;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__deallocate_node(__cache);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__deallocate_node(__cache);
}
const_iterator __i = __u.begin();
@@ -1659,10 +1488,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __first
if (bucket_count() != 0)
{
__next_pointer __cache = __detach();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __cache != nullptr && __first != __last; ++__first)
{
__cache->__upcast()->__value_ = *__first;
@@ -1670,14 +1499,14 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __first
__node_insert_unique(__cache->__upcast());
__cache = __next;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__deallocate_node(__cache);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__deallocate_node(__cache);
}
for (; __first != __last; ++__first)
@@ -1699,10 +1528,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first,
if (bucket_count() != 0)
{
__next_pointer __cache = __detach();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __cache != nullptr && __first != __last; ++__first)
{
__cache->__upcast()->__value_ = *__first;
@@ -1710,14 +1539,14 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first,
__node_insert_multi(__cache->__upcast());
__cache = __next;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__deallocate_node(__cache);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__deallocate_node(__cache);
}
for (; __first != __last; ++__first)
@@ -1729,7 +1558,7 @@ inline
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() _NOEXCEPT
{
- return iterator(__p1_.first().__next_, this);
+ return iterator(__p1_.first().__next_);
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -1737,7 +1566,7 @@ inline
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() _NOEXCEPT
{
- return iterator(nullptr, this);
+ return iterator(nullptr);
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -1745,7 +1574,7 @@ inline
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() const _NOEXCEPT
{
- return const_iterator(__p1_.first().__next_, this);
+ return const_iterator(__p1_.first().__next_);
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -1753,7 +1582,7 @@ inline
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() const _NOEXCEPT
{
- return const_iterator(nullptr, this);
+ return const_iterator(nullptr);
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -1794,10 +1623,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique_prepare(
if (__ndptr != nullptr)
{
for (__ndptr = __ndptr->__next_; __ndptr != nullptr &&
- std::__constrain_hash(__ndptr->__hash(), __bc) == __chash;
+ (__ndptr->__hash() == __hash ||
+ std::__constrain_hash(__ndptr->__hash(), __bc) == __chash);
__ndptr = __ndptr->__next_)
{
- if (key_eq()(__ndptr->__upcast()->__value_, __value))
+ if ((__ndptr->__hash() == __hash) &&
+ key_eq()(__ndptr->__upcast()->__value_, __value))
return __ndptr;
}
}
@@ -1858,7 +1689,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
__existing_node = __nd->__ptr();
__inserted = true;
}
- return pair<iterator, bool>(iterator(__existing_node, this), __inserted);
+ return pair<iterator, bool>(iterator(__existing_node), __inserted);
}
// Prepare the container for an insertion of the value __cp_val with the hash
@@ -1952,7 +1783,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
__next_pointer __pn = __node_insert_multi_prepare(__cp->__hash(), __cp->__value_);
__node_insert_multi_perform(__cp, __pn);
- return iterator(__cp->__ptr(), this);
+ return iterator(__cp->__ptr());
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -1960,9 +1791,6 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
const_iterator __p, __node_pointer __cp)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "unordered container::emplace_hint(const_iterator, args...) called with an iterator not"
- " referring to this unordered container");
if (__p != end() && key_eq()(*__p, __cp->__value_))
{
__next_pointer __np = __p.__node_;
@@ -1981,7 +1809,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
__cp->__next_ = __np;
__pp->__next_ = static_cast<__next_pointer>(__cp);
++size();
- return iterator(static_cast<__next_pointer>(__cp), this);
+ return iterator(static_cast<__next_pointer>(__cp));
}
return __node_insert_multi(__cp);
}
@@ -2009,7 +1837,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const&
(__nd->__hash() == __hash || std::__constrain_hash(__nd->__hash(), __bc) == __chash);
__nd = __nd->__next_)
{
- if (key_eq()(__nd->__upcast()->__value_, __k))
+ if ((__nd->__hash() == __hash) &&
+ key_eq()(__nd->__upcast()->__value_, __k))
goto __done;
}
}
@@ -2047,7 +1876,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const&
__inserted = true;
}
__done:
- return pair<iterator, bool>(iterator(__nd, this), __inserted);
+ return pair<iterator, bool>(iterator(__nd), __inserted);
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -2079,16 +1908,13 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(
const_iterator __p, _Args&&... __args)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "unordered container::emplace_hint(const_iterator, args...) called with an iterator not"
- " referring to this unordered container");
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
iterator __r = __node_insert_multi(__p, __h.get());
__h.release();
return __r;
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _NodeHandle, class _InsertReturnType>
_LIBCPP_INLINE_VISIBILITY
@@ -2218,7 +2044,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_merge_multi(
__node_insert_multi_perform(__src_ptr, __pn);
}
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <bool _UniqueKeys>
@@ -2251,7 +2077,6 @@ template <bool _UniqueKeys>
void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__do_rehash(size_type __nbc)
{
- std::__debug_db_invalidate_all(this);
__pointer_allocator& __npa = __bucket_list_.get_deleter().__alloc();
__bucket_list_.reset(__nbc > 0 ?
__pointer_alloc_traits::allocate(__npa, __nbc) : nullptr);
@@ -2323,7 +2148,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k)
{
if ((__nd->__hash() == __hash)
&& key_eq()(__nd->__upcast()->__value_, __k))
- return iterator(__nd, this);
+ return iterator(__nd);
}
}
}
@@ -2350,7 +2175,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const
{
if ((__nd->__hash() == __hash)
&& key_eq()(__nd->__upcast()->__value_, __k))
- return const_iterator(__nd, this);
+ return const_iterator(__nd);
}
}
@@ -2398,12 +2223,9 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p)
{
__next_pointer __np = __p.__node_;
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "unordered container erase(iterator) called with an iterator not"
- " referring to this container");
- _LIBCPP_ASSERT(__p != end(),
- "unordered container erase(iterator) called with a non-dereferenceable iterator");
- iterator __r(__np, this);
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__p != end(),
+ "unordered container::erase(iterator) called with a non-dereferenceable iterator");
+ iterator __r(__np);
++__r;
remove(__p);
return __r;
@@ -2414,19 +2236,13 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first,
const_iterator __last)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__first)) == this,
- "unordered container::erase(iterator, iterator) called with an iterator not"
- " referring to this container");
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__last)) == this,
- "unordered container::erase(iterator, iterator) called with an iterator not"
- " referring to this container");
for (const_iterator __p = __first; __first != __last; __p = __first)
{
++__first;
erase(__p);
}
__next_pointer __np = __last.__node_;
- return iterator (__np, this);
+ return iterator (__np);
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -2493,21 +2309,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
__pn->__next_ = __cn->__next_;
__cn->__next_ = nullptr;
--size();
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __dp = __c->end_; __dp != __c->beg_; )
- {
- --__dp;
- iterator* __i = static_cast<iterator*>((*__dp)->__i_);
- if (__i->__node_ == __cn)
- {
- (*__dp)->__c_ = nullptr;
- if (--__c->end_ != __dp)
- _VSTD::memmove(__dp, __dp+1, (__c->end_ - __dp)*sizeof(__i_node*));
- }
- }
- __get_db()->unlock();
-#endif
return __node_holder(__cn->__upcast(), _Dp(__node_alloc(), true));
}
@@ -2622,10 +2423,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
_NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value)
#endif
{
- _LIBCPP_ASSERT(__node_traits::propagate_on_container_swap::value ||
- this->__node_alloc() == __u.__node_alloc(),
- "list::swap: Either propagate_on_container_swap must be true"
- " or the allocators must compare equal");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__node_traits::propagate_on_container_swap::value ||
+ this->__node_alloc() == __u.__node_alloc(),
+ "unordered container::swap: Either propagate_on_container_swap "
+ "must be true or the allocators must compare equal");
{
__node_pointer_pointer __npp = __bucket_list_.release();
__bucket_list_.reset(__u.__bucket_list_.release());
@@ -2644,14 +2445,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
if (__u.size() > 0)
__u.__bucket_list_[std::__constrain_hash(__u.__p1_.first().__next_->__hash(), __u.bucket_count())] =
__u.__p1_.first().__ptr();
- std::__debug_db_swap(this, std::addressof(__u));
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::size_type
__hash_table<_Tp, _Hash, _Equal, _Alloc>::bucket_size(size_type __n) const
{
- _LIBCPP_ASSERT(__n < bucket_count(),
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < bucket_count(),
"unordered container::bucket_size(n) called with n >= bucket_count()");
__next_pointer __np = __bucket_list_[__n];
size_type __bc = bucket_count();
@@ -2676,38 +2476,6 @@ swap(__hash_table<_Tp, _Hash, _Equal, _Alloc>& __x,
__x.swap(__y);
}
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-bool
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__dereferenceable(const const_iterator* __i) const
-{
- return __i->__node_ != nullptr;
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-bool
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__decrementable(const const_iterator*) const
-{
- return false;
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-bool
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__addable(const const_iterator*, ptrdiff_t) const
-{
- return false;
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-bool
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__subscriptable(const const_iterator*, ptrdiff_t) const
-{
- return false;
-}
-
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/access.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/access.h
index 0b8d5230171..d7bcb3378d5 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/access.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/access.h
@@ -69,7 +69,7 @@ end(const _Cp& __c) -> decltype(__c.end())
return __c.end();
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Cp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/advance.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/advance.h
index 870778061b9..4188e6fe2cd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/advance.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/advance.h
@@ -23,13 +23,15 @@
#include <__utility/declval.h>
#include <__utility/move.h>
#include <__utility/unreachable.h>
-#include <cstdlib>
#include <limits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _InputIter>
@@ -64,12 +66,12 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
void advance(_InputIter& __i, _Distance __orig_n) {
typedef typename iterator_traits<_InputIter>::difference_type _Difference;
_Difference __n = static_cast<_Difference>(_VSTD::__convert_to_integral(__orig_n));
- _LIBCPP_ASSERT(__n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
- "Attempt to advance(it, n) with negative n on a non-bidirectional iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n >= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
+ "Attempt to advance(it, n) with negative n on a non-bidirectional iterator");
_VSTD::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.iter.op.advance]
@@ -101,8 +103,8 @@ public:
template <input_or_output_iterator _Ip>
_LIBCPP_HIDE_FROM_ABI
constexpr void operator()(_Ip& __i, iter_difference_t<_Ip> __n) const {
- _LIBCPP_ASSERT(__n >= 0 || bidirectional_iterator<_Ip>,
- "If `n < 0`, then `bidirectional_iterator<I>` must be true.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n >= 0 || bidirectional_iterator<_Ip>,
+ "If `n < 0`, then `bidirectional_iterator<I>` must be true.");
// If `I` models `random_access_iterator`, equivalent to `i += n`.
if constexpr (random_access_iterator<_Ip>) {
@@ -148,8 +150,8 @@ public:
template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
_LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip& __i, iter_difference_t<_Ip> __n,
_Sp ___bound_sentinel) const {
- _LIBCPP_ASSERT((__n >= 0) || (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>),
- "If `n < 0`, then `bidirectional_iterator<I> && same_as<I, S>` must be true.");
+ _LIBCPP_ASSERT_UNCATEGORIZED((__n >= 0) || (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>),
+ "If `n < 0`, then `bidirectional_iterator<I> && same_as<I, S>` must be true.");
// If `S` and `I` model `sized_sentinel_for<S, I>`:
if constexpr (sized_sentinel_for<_Sp, _Ip>) {
// If |n| >= |bound_sentinel - i|, equivalent to `ranges::advance(i, bound_sentinel)`.
@@ -159,9 +161,9 @@ public:
__a > 0 ? __a >= __b :
__a <= __b;
};
- if (const auto __M = ___bound_sentinel - __i; __magnitude_geq(__n, __M)) {
+ if (const auto __m = ___bound_sentinel - __i; __magnitude_geq(__n, __m)) {
(*this)(__i, ___bound_sentinel);
- return __n - __M;
+ return __n - __m;
}
// Otherwise, equivalent to `ranges::advance(i, n)`.
@@ -196,8 +198,10 @@ inline namespace __cpo {
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ITERATOR_ADVANCE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/back_insert_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/back_insert_iterator.h
index 4c00a7e3979..a0083da1519 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/back_insert_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/back_insert_iterator.h
@@ -21,6 +21,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -36,7 +39,7 @@ protected:
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef ptrdiff_t difference_type;
#else
typedef void difference_type;
@@ -70,4 +73,6 @@ back_inserter(_Container& __x)
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ITERATOR_BACK_INSERT_ITERATOR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/bounded_iter.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/bounded_iter.h
index 96d311faa30..183fd8d417f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/bounded_iter.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/bounded_iter.h
@@ -23,6 +23,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
// Iterator wrapper that carries the valid range it is allowed to access.
@@ -35,14 +38,14 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// Arithmetic operations are allowed and the bounds of the resulting iterator
// are not checked. Hence, it is possible to create an iterator pointing outside
// its range, but it is not possible to dereference it.
-template <class _Iterator, class = __enable_if_t< __is_cpp17_contiguous_iterator<_Iterator>::value > >
+template <class _Iterator, class = __enable_if_t< __libcpp_is_contiguous_iterator<_Iterator>::value > >
struct ___bounded_iter {
using value_type = typename iterator_traits<_Iterator>::value_type;
using difference_type = typename iterator_traits<_Iterator>::difference_type;
using pointer = typename iterator_traits<_Iterator>::pointer;
using reference = typename iterator_traits<_Iterator>::reference;
using iterator_category = typename iterator_traits<_Iterator>::iterator_category;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using iterator_concept = contiguous_iterator_tag;
#endif
@@ -78,7 +81,7 @@ private:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit ___bounded_iter(
_Iterator __current, _Iterator __begin, _Iterator __end)
: __current_(__current), __begin_(__begin), __end_(__end) {
- _LIBCPP_ASSERT(__begin <= __end, "___bounded_iter(current, begin, end): [begin, end) is not a valid range");
+ _LIBCPP_ASSERT_INTERNAL(__begin <= __end, "___bounded_iter(current, begin, end): [begin, end) is not a valid range");
}
template <class _It>
@@ -89,19 +92,19 @@ public:
//
// These operations check that the iterator is dereferenceable, that is within [begin, end).
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator*() const _NOEXCEPT {
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
__in_bounds(__current_), "___bounded_iter::operator*: Attempt to dereference an out-of-range iterator");
return *__current_;
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pointer operator->() const _NOEXCEPT {
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
__in_bounds(__current_), "___bounded_iter::operator->: Attempt to dereference an out-of-range iterator");
return std::__to_address(__current_);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT {
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
__in_bounds(__current_ + __n), "___bounded_iter::operator[]: Attempt to index an iterator out-of-range");
return __current_[__n];
}
@@ -212,7 +215,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR ___bounded_iter<_It> __make_bounded_iter
#if _LIBCPP_STD_VER <= 17
template <class _Iterator>
-struct __is_cpp17_contiguous_iterator<___bounded_iter<_Iterator> > : true_type {};
+struct __libcpp_is_contiguous_iterator<___bounded_iter<_Iterator> > : true_type {};
#endif
template <class _Iterator>
@@ -228,4 +231,6 @@ struct pointer_traits<___bounded_iter<_Iterator> > {
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ITERATOR_BOUNDED_ITER_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/common_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/common_iterator.h
index f7883e2c372..95e248d83f4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/common_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/common_iterator.h
@@ -25,6 +25,7 @@
#include <__iterator/iter_swap.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/readable_traits.h>
+#include <__memory/addressof.h>
#include <__type_traits/is_pointer.h>
#include <__utility/declval.h>
#include <variant>
@@ -33,9 +34,12 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Iter>
concept __can_use_postfix_proxy =
@@ -46,14 +50,14 @@ template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent>
requires (!same_as<_Iter, _Sent> && copyable<_Iter>)
class common_iterator {
struct __proxy {
- constexpr const iter_value_t<_Iter>* operator->() const noexcept {
+ _LIBCPP_HIDE_FROM_ABI constexpr const iter_value_t<_Iter>* operator->() const noexcept {
return _VSTD::addressof(__value_);
}
iter_value_t<_Iter> __value_;
};
struct __postfix_proxy {
- constexpr const iter_value_t<_Iter>& operator*() const noexcept {
+ _LIBCPP_HIDE_FROM_ABI constexpr const iter_value_t<_Iter>& operator*() const noexcept {
return __value_;
}
iter_value_t<_Iter> __value_;
@@ -62,16 +66,17 @@ class common_iterator {
public:
variant<_Iter, _Sent> __hold_;
- common_iterator() requires default_initializable<_Iter> = default;
+ _LIBCPP_HIDE_FROM_ABI common_iterator() requires default_initializable<_Iter> = default;
- constexpr common_iterator(_Iter __i) : __hold_(in_place_type<_Iter>, _VSTD::move(__i)) {}
- constexpr common_iterator(_Sent __s) : __hold_(in_place_type<_Sent>, _VSTD::move(__s)) {}
+ _LIBCPP_HIDE_FROM_ABI constexpr common_iterator(_Iter __i) : __hold_(in_place_type<_Iter>, _VSTD::move(__i)) {}
+ _LIBCPP_HIDE_FROM_ABI constexpr common_iterator(_Sent __s) : __hold_(in_place_type<_Sent>, _VSTD::move(__s)) {}
template<class _I2, class _S2>
requires convertible_to<const _I2&, _Iter> && convertible_to<const _S2&, _Sent>
- constexpr common_iterator(const common_iterator<_I2, _S2>& __other)
+ _LIBCPP_HIDE_FROM_ABI constexpr common_iterator(const common_iterator<_I2, _S2>& __other)
: __hold_([&]() -> variant<_Iter, _Sent> {
- _LIBCPP_ASSERT(!__other.__hold_.valueless_by_exception(), "Attempted to construct from a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__other.__hold_.valueless_by_exception(),
+ "Attempted to construct from a valueless common_iterator");
if (__other.__hold_.index() == 0)
return variant<_Iter, _Sent>{in_place_index<0>, _VSTD::__unchecked_get<0>(__other.__hold_)};
return variant<_Iter, _Sent>{in_place_index<1>, _VSTD::__unchecked_get<1>(__other.__hold_)};
@@ -80,8 +85,9 @@ public:
template<class _I2, class _S2>
requires convertible_to<const _I2&, _Iter> && convertible_to<const _S2&, _Sent> &&
assignable_from<_Iter&, const _I2&> && assignable_from<_Sent&, const _S2&>
- common_iterator& operator=(const common_iterator<_I2, _S2>& __other) {
- _LIBCPP_ASSERT(!__other.__hold_.valueless_by_exception(), "Attempted to assign from a valueless common_iterator");
+ _LIBCPP_HIDE_FROM_ABI common_iterator& operator=(const common_iterator<_I2, _S2>& __other) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__other.__hold_.valueless_by_exception(),
+ "Attempted to assign from a valueless common_iterator");
auto __idx = __hold_.index();
auto __other_idx = __other.__hold_.index();
@@ -101,27 +107,30 @@ public:
return *this;
}
- constexpr decltype(auto) operator*()
+ _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*()
{
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__hold_),
+ "Attempted to dereference a non-dereferenceable common_iterator");
return *_VSTD::__unchecked_get<_Iter>(__hold_);
}
- constexpr decltype(auto) operator*() const
+ _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const
requires __dereferenceable<const _Iter>
{
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__hold_),
+ "Attempted to dereference a non-dereferenceable common_iterator");
return *_VSTD::__unchecked_get<_Iter>(__hold_);
}
template<class _I2 = _Iter>
- decltype(auto) operator->() const
+ _LIBCPP_HIDE_FROM_ABI decltype(auto) operator->() const
requires indirectly_readable<const _I2> &&
(requires(const _I2& __i) { __i.operator->(); } ||
is_reference_v<iter_reference_t<_I2>> ||
constructible_from<iter_value_t<_I2>, iter_reference_t<_I2>>)
{
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__hold_),
+ "Attempted to dereference a non-dereferenceable common_iterator");
if constexpr (is_pointer_v<_Iter> || requires(const _Iter& __i) { __i.operator->(); }) {
return _VSTD::__unchecked_get<_Iter>(__hold_);
} else if constexpr (is_reference_v<iter_reference_t<_Iter>>) {
@@ -132,13 +141,15 @@ public:
}
}
- common_iterator& operator++() {
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to increment a non-dereferenceable common_iterator");
+ _LIBCPP_HIDE_FROM_ABI common_iterator& operator++() {
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__hold_),
+ "Attempted to increment a non-dereferenceable common_iterator");
++_VSTD::__unchecked_get<_Iter>(__hold_); return *this;
}
- decltype(auto) operator++(int) {
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to increment a non-dereferenceable common_iterator");
+ _LIBCPP_HIDE_FROM_ABI decltype(auto) operator++(int) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__hold_),
+ "Attempted to increment a non-dereferenceable common_iterator");
if constexpr (forward_iterator<_Iter>) {
auto __tmp = *this;
++*this;
@@ -157,8 +168,10 @@ public:
requires sentinel_for<_Sent, _I2>
_LIBCPP_HIDE_FROM_ABI
friend constexpr bool operator==(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) {
- _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
- _LIBCPP_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__x.__hold_.valueless_by_exception(),
+ "Attempted to compare a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__y.__hold_.valueless_by_exception(),
+ "Attempted to compare a valueless common_iterator");
auto __x_index = __x.__hold_.index();
auto __y_index = __y.__hold_.index();
@@ -176,8 +189,10 @@ public:
requires sentinel_for<_Sent, _I2> && equality_comparable_with<_Iter, _I2>
_LIBCPP_HIDE_FROM_ABI
friend constexpr bool operator==(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) {
- _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
- _LIBCPP_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__x.__hold_.valueless_by_exception(),
+ "Attempted to compare a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__y.__hold_.valueless_by_exception(),
+ "Attempted to compare a valueless common_iterator");
auto __x_index = __x.__hold_.index();
auto __y_index = __y.__hold_.index();
@@ -198,8 +213,10 @@ public:
requires sized_sentinel_for<_Sent, _I2>
_LIBCPP_HIDE_FROM_ABI
friend constexpr iter_difference_t<_I2> operator-(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) {
- _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to subtract from a valueless common_iterator");
- _LIBCPP_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to subtract a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__x.__hold_.valueless_by_exception(),
+ "Attempted to subtract from a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__y.__hold_.valueless_by_exception(),
+ "Attempted to subtract a valueless common_iterator");
auto __x_index = __x.__hold_.index();
auto __y_index = __y.__hold_.index();
@@ -220,7 +237,8 @@ public:
noexcept(noexcept(ranges::iter_move(std::declval<const _Iter&>())))
requires input_iterator<_Iter>
{
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__i.__hold_), "Attempted to iter_move a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__i.__hold_),
+ "Attempted to iter_move a non-dereferenceable common_iterator");
return ranges::iter_move( _VSTD::__unchecked_get<_Iter>(__i.__hold_));
}
@@ -228,8 +246,10 @@ public:
_LIBCPP_HIDE_FROM_ABI friend constexpr void iter_swap(const common_iterator& __x, const common_iterator<_I2, _S2>& __y)
noexcept(noexcept(ranges::iter_swap(std::declval<const _Iter&>(), std::declval<const _I2&>())))
{
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__x.__hold_), "Attempted to iter_swap a non-dereferenceable common_iterator");
- _LIBCPP_ASSERT(std::holds_alternative<_I2>(__y.__hold_), "Attempted to iter_swap a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__x.__hold_),
+ "Attempted to iter_swap a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_I2>(__y.__hold_),
+ "Attempted to iter_swap a non-dereferenceable common_iterator");
return ranges::iter_swap(_VSTD::__unchecked_get<_Iter>(__x.__hold_), _VSTD::__unchecked_get<_I2>(__y.__hold_));
}
};
@@ -274,8 +294,10 @@ struct iterator_traits<common_iterator<_Iter, _Sent>> {
using reference = iter_reference_t<_Iter>;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ITERATOR_COMMON_ITERATOR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/concepts.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/concepts.h
index d9d40a4249f..dd9e8d6ac5f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/concepts.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/concepts.h
@@ -46,7 +46,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [iterator.concept.readable]
template<class _In>
@@ -293,7 +293,7 @@ concept indirectly_copyable_storable =
// Note: indirectly_swappable is located in iter_swap.h to prevent a dependency cycle
// (both iter_swap and indirectly_swappable require indirectly_readable).
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/counted_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/counted_iterator.h
index 5fdbff4b486..41b7e57d28c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/counted_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/counted_iterator.h
@@ -34,9 +34,12 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class>
struct __counted_iterator_concept {};
@@ -83,7 +86,7 @@ public:
_LIBCPP_HIDE_FROM_ABI
constexpr counted_iterator(_Iter __iter, iter_difference_t<_Iter> __n)
: __current_(_VSTD::move(__iter)), __count_(__n) {
- _LIBCPP_ASSERT(__n >= 0, "__n must not be negative.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n >= 0, "__n must not be negative.");
}
template<class _I2>
@@ -112,7 +115,7 @@ public:
_LIBCPP_HIDE_FROM_ABI
constexpr decltype(auto) operator*() {
- _LIBCPP_ASSERT(__count_ > 0, "Iterator is equal to or past end.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count_ > 0, "Iterator is equal to or past end.");
return *__current_;
}
@@ -120,7 +123,7 @@ public:
constexpr decltype(auto) operator*() const
requires __dereferenceable<const _Iter>
{
- _LIBCPP_ASSERT(__count_ > 0, "Iterator is equal to or past end.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count_ > 0, "Iterator is equal to or past end.");
return *__current_;
}
@@ -133,7 +136,7 @@ public:
_LIBCPP_HIDE_FROM_ABI
constexpr counted_iterator& operator++() {
- _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count_ > 0, "Iterator already at or past end.");
++__current_;
--__count_;
return *this;
@@ -141,21 +144,21 @@ public:
_LIBCPP_HIDE_FROM_ABI
decltype(auto) operator++(int) {
- _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count_ > 0, "Iterator already at or past end.");
--__count_;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try { return __current_++; }
catch(...) { ++__count_; throw; }
#else
return __current_++;
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
_LIBCPP_HIDE_FROM_ABI
constexpr counted_iterator operator++(int)
requires forward_iterator<_Iter>
{
- _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count_ > 0, "Iterator already at or past end.");
counted_iterator __tmp = *this;
++*this;
return __tmp;
@@ -198,7 +201,7 @@ public:
constexpr counted_iterator& operator+=(iter_difference_t<_Iter> __n)
requires random_access_iterator<_Iter>
{
- _LIBCPP_ASSERT(__n <= __count_, "Cannot advance iterator past end.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n <= __count_, "Cannot advance iterator past end.");
__current_ += __n;
__count_ -= __n;
return *this;
@@ -237,9 +240,10 @@ public:
constexpr counted_iterator& operator-=(iter_difference_t<_Iter> __n)
requires random_access_iterator<_Iter>
{
- _LIBCPP_ASSERT(-__n <= __count_, "Attempt to subtract too large of a size: "
- "counted_iterator would be decremented before the "
- "first element of its range.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(-__n <= __count_,
+ "Attempt to subtract too large of a size: "
+ "counted_iterator would be decremented before the "
+ "first element of its range.");
__current_ -= __n;
__count_ += __n;
return *this;
@@ -249,7 +253,7 @@ public:
constexpr decltype(auto) operator[](iter_difference_t<_Iter> __n) const
requires random_access_iterator<_Iter>
{
- _LIBCPP_ASSERT(__n < __count_, "Subscript argument must be less than size.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n < __count_, "Subscript argument must be less than size.");
return __current_[__n];
}
@@ -280,7 +284,7 @@ public:
noexcept(noexcept(ranges::iter_move(__i.__current_)))
requires input_iterator<_Iter>
{
- _LIBCPP_ASSERT(__i.__count_ > 0, "Iterator must not be past end of range.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__i.__count_ > 0, "Iterator must not be past end of range.");
return ranges::iter_move(__i.__current_);
}
@@ -289,8 +293,8 @@ public:
friend constexpr void iter_swap(const counted_iterator& __x, const counted_iterator<_I2>& __y)
noexcept(noexcept(ranges::iter_swap(__x.__current_, __y.__current_)))
{
- _LIBCPP_ASSERT(__x.__count_ > 0 && __y.__count_ > 0,
- "Iterators must not be past end of range.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x.__count_ > 0 && __y.__count_ > 0,
+ "Iterators must not be past end of range.");
return ranges::iter_swap(__x.__current_, __y.__current_);
}
};
@@ -303,8 +307,10 @@ struct iterator_traits<counted_iterator<_Iter>> : iterator_traits<_Iter> {
add_pointer_t<iter_reference_t<_Iter>>, void>;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ITERATOR_COUNTED_ITERATOR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/cpp17_iterator_concepts.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/cpp17_iterator_concepts.h
new file mode 100644
index 00000000000..c4f49fe7422
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/cpp17_iterator_concepts.h
@@ -0,0 +1,185 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___ITERATOR_CPP17_ITERATOR_CONCEPTS_H
+#define _LIBCPP___ITERATOR_CPP17_ITERATOR_CONCEPTS_H
+
+#include <__concepts/boolean_testable.h>
+#include <__concepts/convertible_to.h>
+#include <__concepts/same_as.h>
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_copy_constructible.h>
+#include <__type_traits/is_default_constructible.h>
+#include <__type_traits/is_move_constructible.h>
+#include <__type_traits/is_signed.h>
+#include <__type_traits/is_void.h>
+#include <__utility/as_const.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+#include <__utility/swap.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER >= 20
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+concept __cpp17_move_constructible = is_move_constructible_v<_Tp>;
+
+template <class _Tp>
+concept __cpp17_copy_constructible = __cpp17_move_constructible<_Tp> && is_copy_constructible_v<_Tp>;
+
+template <class _Tp>
+concept __cpp17_move_assignable = requires(_Tp __lhs, _Tp __rhs) {
+ { __lhs = std::move(__rhs) } -> same_as<_Tp&>;
+};
+
+template <class _Tp>
+concept __cpp17_copy_assignable = __cpp17_move_assignable<_Tp> && requires(_Tp __lhs, _Tp __rhs) {
+ { __lhs = __rhs } -> same_as<_Tp&>;
+ { __lhs = std::as_const(__rhs) } -> same_as<_Tp&>;
+};
+
+template <class _Tp>
+concept __cpp17_destructible = requires(_Tp __v) { __v.~_Tp(); };
+
+template <class _Tp>
+concept __cpp17_equality_comparable = requires(_Tp __lhs, _Tp __rhs) {
+ { __lhs == __rhs } -> __boolean_testable;
+ { std::as_const(__lhs) == __rhs } -> __boolean_testable;
+ { __lhs == std::as_const(__rhs) } -> __boolean_testable;
+ { std::as_const(__lhs) == std::as_const(__rhs) } -> __boolean_testable;
+};
+
+template <class _Tp>
+concept __cpp17_default_constructible = is_default_constructible_v<_Tp>;
+
+template <class _Iter>
+concept __cpp17_iterator =
+ __cpp17_copy_constructible<_Iter> && __cpp17_copy_assignable<_Iter> && __cpp17_destructible<_Iter> &&
+ (is_signed_v<__iter_diff_t<_Iter>> || is_void_v<__iter_diff_t<_Iter>>)&&requires(_Iter __iter) {
+ { *__iter };
+ { ++__iter } -> same_as<_Iter&>;
+ };
+
+template <class _Iter>
+concept __cpp17_input_iterator =
+ __cpp17_iterator<_Iter> && __cpp17_equality_comparable<_Iter> && requires(_Iter __lhs, _Iter __rhs) {
+ { __lhs != __rhs } -> __boolean_testable;
+ { std::as_const(__lhs) != __rhs } -> __boolean_testable;
+ { __lhs != std::as_const(__rhs) } -> __boolean_testable;
+ { std::as_const(__lhs) != std::as_const(__rhs) } -> __boolean_testable;
+
+ { *__lhs } -> same_as<__iter_reference<_Iter>>;
+ { *std::as_const(__lhs) } -> same_as<__iter_reference<_Iter>>;
+
+ { ++__lhs } -> same_as<_Iter&>;
+ { (void)__lhs++ };
+ { *__lhs++ };
+ };
+
+template <class _Iter, class _WriteTo>
+concept __cpp17_output_iterator = __cpp17_iterator<_Iter> && requires(_Iter __iter, _WriteTo __write) {
+ { *__iter = std::forward<_WriteTo>(__write) };
+ { ++__iter } -> same_as<_Iter&>;
+ { __iter++ } -> convertible_to<const _Iter&>;
+ { *__iter++ = std::forward<_WriteTo>(__write) };
+};
+
+template <class _Iter>
+concept __cpp17_forward_iterator =
+ __cpp17_input_iterator<_Iter> && __cpp17_default_constructible<_Iter> && requires(_Iter __iter) {
+ { __iter++ } -> convertible_to<const _Iter&>;
+ { *__iter++ } -> same_as<__iter_reference<_Iter>>;
+ };
+
+template <class _Iter>
+concept __cpp17_bidirectional_iterator = __cpp17_forward_iterator<_Iter> && requires(_Iter __iter) {
+ { --__iter } -> same_as<_Iter&>;
+ { __iter-- } -> convertible_to<const _Iter&>;
+ { *__iter-- } -> same_as<__iter_reference<_Iter>>;
+};
+
+template <class _Iter>
+concept __cpp17_random_access_iterator =
+ __cpp17_bidirectional_iterator<_Iter> && requires(_Iter __iter, __iter_diff_t<_Iter> __n) {
+ { __iter += __n } -> same_as<_Iter&>;
+
+ { __iter + __n } -> same_as<_Iter>;
+ { __n + __iter } -> same_as<_Iter>;
+ { std::as_const(__iter) + __n } -> same_as<_Iter>;
+ { __n + std::as_const(__iter) } -> same_as<_Iter>;
+
+ { __iter -= __n } -> same_as<_Iter&>;
+ { __iter - __n } -> same_as<_Iter>;
+ { std::as_const(__iter) - __n } -> same_as<_Iter>;
+
+ { __iter - __iter } -> same_as<__iter_diff_t<_Iter>>;
+ { std::as_const(__iter) - __iter } -> same_as<__iter_diff_t<_Iter>>;
+ { __iter - std::as_const(__iter) } -> same_as<__iter_diff_t<_Iter>>;
+ { std::as_const(__iter) - std::as_const(__iter) } -> same_as<__iter_diff_t<_Iter>>;
+
+ { __iter[__n] } -> convertible_to<__iter_reference<_Iter>>;
+ { std::as_const(__iter)[__n] } -> convertible_to<__iter_reference<_Iter>>;
+
+ { __iter < __iter } -> __boolean_testable;
+ { std::as_const(__iter) < __iter } -> __boolean_testable;
+ { __iter < std::as_const(__iter) } -> __boolean_testable;
+ { std::as_const(__iter) < std::as_const(__iter) } -> __boolean_testable;
+
+ { __iter > __iter } -> __boolean_testable;
+ { std::as_const(__iter) > __iter } -> __boolean_testable;
+ { __iter > std::as_const(__iter) } -> __boolean_testable;
+ { std::as_const(__iter) > std::as_const(__iter) } -> __boolean_testable;
+
+ { __iter >= __iter } -> __boolean_testable;
+ { std::as_const(__iter) >= __iter } -> __boolean_testable;
+ { __iter >= std::as_const(__iter) } -> __boolean_testable;
+ { std::as_const(__iter) >= std::as_const(__iter) } -> __boolean_testable;
+
+ { __iter <= __iter } -> __boolean_testable;
+ { std::as_const(__iter) <= __iter } -> __boolean_testable;
+ { __iter <= std::as_const(__iter) } -> __boolean_testable;
+ { std::as_const(__iter) <= std::as_const(__iter) } -> __boolean_testable;
+ };
+
+_LIBCPP_END_NAMESPACE_STD
+
+# ifndef _LIBCPP_DISABLE_ITERATOR_CHECKS
+# define _LIBCPP_REQUIRE_CPP17_INPUT_ITERATOR(iter_t) static_assert(::std::__cpp17_input_iterator<iter_t>);
+# define _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(iter_t, write_t) \
+ static_assert(::std::__cpp17_output_iterator<iter_t, write_t>);
+# define _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(iter_t) static_assert(::std::__cpp17_forward_iterator<iter_t>);
+# define _LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(iter_t) \
+ static_assert(::std::__cpp17_bidirectional_iterator<iter_t>);
+# define _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(iter_t) \
+ static_assert(::std::__cpp17_random_access_iterator<iter_t>);
+# else
+# define _LIBCPP_REQUIRE_CPP17_INPUT_ITERATOR(iter_t)
+# define _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(iter_t, write_t)
+# define _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(iter_t)
+# define _LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(iter_t)
+# define _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(iter_t)
+# endif
+
+#else // _LIBCPP_STD_VER >= 20
+
+# define _LIBCPP_REQUIRE_CPP17_INPUT_ITERATOR(iter_t)
+# define _LIBCPP_REQUIRE_CPP17_OUTPUT_ITERATOR(iter_t, write_t)
+# define _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(iter_t)
+# define _LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(iter_t)
+# define _LIBCPP_REQUIRE_CPP17_RANDOM_ACCESS_ITERATOR(iter_t)
+
+#endif // _LIBCPP_STD_VER >= 20
+
+#endif // _LIBCPP___ITERATOR_CPP17_ITERATOR_CONCEPTS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/data.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/data.h
index 88eb752b642..f10680744fc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/data.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/data.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Cont> constexpr
_LIBCPP_INLINE_VISIBILITY
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/default_sentinel.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/default_sentinel.h
index 669032aa972..d5fb2b699ad 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/default_sentinel.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/default_sentinel.h
@@ -18,12 +18,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct default_sentinel_t { };
inline constexpr default_sentinel_t default_sentinel{};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/distance.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/distance.h
index 681e20d045b..ebe5473371f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/distance.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/distance.h
@@ -53,7 +53,7 @@ distance(_InputIter __first, _InputIter __last)
return _VSTD::__distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.iter.op.distance]
@@ -101,7 +101,7 @@ inline namespace __cpo {
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/empty.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/empty.h
index 748ca9ecbd5..2cd4c7abf48 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/empty.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/empty.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Cont>
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
@@ -37,7 +37,7 @@ template <class _Ep>
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; }
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/erase_if_container.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/erase_if_container.h
index d7c71a947a2..532ec9c1de0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/erase_if_container.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/erase_if_container.h
@@ -16,6 +16,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Container, class _Predicate>
@@ -37,4 +40,6 @@ __libcpp_erase_if_container(_Container& __c, _Predicate& __pred) {
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ITERATOR_ERASE_IF_CONTAINER_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/front_insert_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/front_insert_iterator.h
index e278359d870..7c77daebb29 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/front_insert_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/front_insert_iterator.h
@@ -21,6 +21,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -36,7 +39,7 @@ protected:
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef ptrdiff_t difference_type;
#else
typedef void difference_type;
@@ -68,4 +71,6 @@ front_inserter(_Container& __x)
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ITERATOR_FRONT_INSERT_ITERATOR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/incrementable_traits.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/incrementable_traits.h
index 3d06dc05359..604e9580ef7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/incrementable_traits.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/incrementable_traits.h
@@ -26,7 +26,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [incrementable.traits]
template<class> struct incrementable_traits {};
@@ -71,7 +71,7 @@ using iter_difference_t = typename conditional_t<__is_primary_template<iterator_
incrementable_traits<remove_cvref_t<_Ip> >,
iterator_traits<remove_cvref_t<_Ip> > >::difference_type;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/indirectly_comparable.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/indirectly_comparable.h
index 868190fc48d..e60ba25ca76 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/indirectly_comparable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/indirectly_comparable.h
@@ -21,13 +21,13 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _I1, class _I2, class _Rp, class _P1 = identity, class _P2 = identity>
concept indirectly_comparable =
indirect_binary_predicate<_Rp, projected<_I1, _P1>, projected<_I2, _P2>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/insert_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/insert_iterator.h
index ecaea61c61e..4e833733d20 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/insert_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/insert_iterator.h
@@ -22,9 +22,12 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Container>
using __insert_iterator_iter_t = ranges::iterator_t<_Container>;
#else
@@ -46,7 +49,7 @@ protected:
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef ptrdiff_t difference_type;
#else
typedef void difference_type;
@@ -78,4 +81,6 @@ inserter(_Container& __x, __insert_iterator_iter_t<_Container> __i)
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ITERATOR_INSERT_ITERATOR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/istream_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/istream_iterator.h
index a056961c10a..989902f212b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/istream_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/istream_iterator.h
@@ -47,9 +47,9 @@ private:
_Tp __value_;
public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(nullptr), __value_() {}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI constexpr istream_iterator(default_sentinel_t) : istream_iterator() {}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_VSTD::addressof(__s))
{
if (!(*__in_stream_ >> __value_))
@@ -73,11 +73,11 @@ public:
operator==(const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __x,
const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __y);
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const istream_iterator& __i, default_sentinel_t) {
return __i.__in_stream_ == nullptr;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
};
template <class _Tp, class _CharT, class _Traits, class _Distance>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/istreambuf_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/istreambuf_iterator.h
index bc53a6a1c80..e39fec6d72d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/istreambuf_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/istreambuf_iterator.h
@@ -67,10 +67,10 @@ private:
}
public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(nullptr) {}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY constexpr istreambuf_iterator(default_sentinel_t) noexcept
: istreambuf_iterator() {}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT
: __sbuf_(__s.rdbuf()) {}
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT
@@ -93,11 +93,11 @@ public:
_LIBCPP_INLINE_VISIBILITY bool equal(const istreambuf_iterator& __b) const
{return __test_for_eof() == __b.__test_for_eof();}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const istreambuf_iterator& __i, default_sentinel_t) {
return __i.__test_for_eof();
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
};
template <class _CharT, class _Traits>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/iter_move.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/iter_move.h
index a7d9413fb84..d9ff90bf654 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/iter_move.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/iter_move.h
@@ -23,9 +23,12 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [iterator.cust.move]
@@ -97,8 +100,10 @@ template<__dereferenceable _Tp>
requires requires(_Tp& __t) { { ranges::iter_move(__t) } -> __can_reference; }
using iter_rvalue_reference_t = decltype(ranges::iter_move(std::declval<_Tp&>()));
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ITERATOR_ITER_MOVE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/iter_swap.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/iter_swap.h
index d4c0dca1f63..2fa92f6ef23 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/iter_swap.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/iter_swap.h
@@ -26,9 +26,12 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [iter.cust.swap]
@@ -106,8 +109,10 @@ concept indirectly_swappable =
ranges::iter_swap(__i2, __i1);
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ITERATOR_ITER_SWAP_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/iterator_traits.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/iterator_traits.h
index c9d8944bfee..248987e9b56 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/iterator_traits.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/iterator_traits.h
@@ -43,7 +43,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp>
using __with_reference = _Tp&;
@@ -62,7 +62,7 @@ concept __dereferenceable = requires(_Tp& __t) {
template<__dereferenceable _Tp>
using iter_reference_t = decltype(*std::declval<_Tp&>());
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template <class _Iter>
struct _LIBCPP_TEMPLATE_VIS iterator_traits;
@@ -72,7 +72,7 @@ struct _LIBCPP_TEMPLATE_VIS output_iterator_tag {};
struct _LIBCPP_TEMPLATE_VIS forward_iterator_tag : public input_iterator_tag {};
struct _LIBCPP_TEMPLATE_VIS bidirectional_iterator_tag : public forward_iterator_tag {};
struct _LIBCPP_TEMPLATE_VIS random_access_iterator_tag : public bidirectional_iterator_tag {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct _LIBCPP_TEMPLATE_VIS contiguous_iterator_tag : public random_access_iterator_tag {};
#endif
@@ -157,7 +157,7 @@ public:
static const bool value = decltype(__test<_Tp>(nullptr))::value;
};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// The `cpp17-*-iterator` exposition-only concepts have very similar names to the `Cpp17*Iterator` named requirements
// from `[iterator.cpp17]`. To avoid confusion between the two, the exposition-only concepts have been banished to
@@ -190,7 +190,7 @@ template<class _Ip>
concept __cpp17_forward_iterator =
__cpp17_input_iterator<_Ip> &&
constructible_from<_Ip> &&
- is_lvalue_reference_v<iter_reference_t<_Ip>> &&
+ is_reference_v<iter_reference_t<_Ip>> &&
same_as<remove_cvref_t<iter_reference_t<_Ip>>,
typename indirectly_readable_traits<_Ip>::value_type> &&
requires(_Ip __i) {
@@ -381,7 +381,7 @@ struct iterator_traits : __iterator_traits<_Ip> {
using __primary_template = iterator_traits;
};
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCPP_STD_VER >= 20
template <class _Iter, bool> struct __iterator_traits {};
@@ -418,10 +418,10 @@ struct _LIBCPP_TEMPLATE_VIS iterator_traits
using __primary_template = iterator_traits;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template<class _Tp>
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires is_object_v<_Tp>
#endif
struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*>
@@ -431,7 +431,7 @@ struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*>
typedef _Tp* pointer;
typedef _Tp& reference;
typedef random_access_iterator_tag iterator_category;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef contiguous_iterator_tag iterator_concept;
#endif
};
@@ -453,60 +453,60 @@ template <class _Tp, class _Up>
struct __has_iterator_concept_convertible_to<_Tp, _Up, false> : false_type {};
template <class _Tp>
-struct __is_cpp17_input_iterator : public __has_iterator_category_convertible_to<_Tp, input_iterator_tag> {};
+using __has_input_iterator_category = __has_iterator_category_convertible_to<_Tp, input_iterator_tag>;
template <class _Tp>
-struct __is_cpp17_forward_iterator : public __has_iterator_category_convertible_to<_Tp, forward_iterator_tag> {};
+using __has_forward_iterator_category = __has_iterator_category_convertible_to<_Tp, forward_iterator_tag>;
template <class _Tp>
-struct __is_cpp17_bidirectional_iterator : public __has_iterator_category_convertible_to<_Tp, bidirectional_iterator_tag> {};
+using __has_bidirectional_iterator_category = __has_iterator_category_convertible_to<_Tp, bidirectional_iterator_tag>;
template <class _Tp>
-struct __is_cpp17_random_access_iterator : public __has_iterator_category_convertible_to<_Tp, random_access_iterator_tag> {};
+using __has_random_access_iterator_category = __has_iterator_category_convertible_to<_Tp, random_access_iterator_tag>;
-// __is_cpp17_contiguous_iterator determines if an iterator is known by
+// __libcpp_is_contiguous_iterator determines if an iterator is known by
// libc++ to be contiguous, either because it advertises itself as such
// (in C++20) or because it is a pointer type or a known trivial wrapper
// around a (possibly fancy) pointer type, such as __wrap_iter<T*>.
// Such iterators receive special "contiguous" optimizations in
// std::copy and std::sort.
//
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp>
-struct __is_cpp17_contiguous_iterator : _Or<
+struct __libcpp_is_contiguous_iterator : _Or<
__has_iterator_category_convertible_to<_Tp, contiguous_iterator_tag>,
__has_iterator_concept_convertible_to<_Tp, contiguous_iterator_tag>
> {};
#else
template <class _Tp>
-struct __is_cpp17_contiguous_iterator : false_type {};
+struct __libcpp_is_contiguous_iterator : false_type {};
#endif
// Any native pointer which is an iterator is also a contiguous iterator.
template <class _Up>
-struct __is_cpp17_contiguous_iterator<_Up*> : true_type {};
+struct __libcpp_is_contiguous_iterator<_Up*> : true_type {};
template <class _Iter>
class __wrap_iter;
template <class _Tp>
-struct __is_exactly_cpp17_input_iterator
- : public integral_constant<bool,
+using __has_exactly_input_iterator_category
+ = integral_constant<bool,
__has_iterator_category_convertible_to<_Tp, input_iterator_tag>::value &&
- !__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value> {};
+ !__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value>;
template <class _Tp>
-struct __is_exactly_cpp17_forward_iterator
- : public integral_constant<bool,
+using __has_exactly_forward_iterator_category
+ = integral_constant<bool,
__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value &&
- !__has_iterator_category_convertible_to<_Tp, bidirectional_iterator_tag>::value> {};
+ !__has_iterator_category_convertible_to<_Tp, bidirectional_iterator_tag>::value>;
template <class _Tp>
-struct __is_exactly_cpp17_bidirectional_iterator
- : public integral_constant<bool,
+using __has_exactly_bidirectional_iterator_category
+ = integral_constant<bool,
__has_iterator_category_convertible_to<_Tp, bidirectional_iterator_tag>::value &&
- !__has_iterator_category_convertible_to<_Tp, random_access_iterator_tag>::value> {};
+ !__has_iterator_category_convertible_to<_Tp, random_access_iterator_tag>::value>;
template<class _InputIterator>
using __iter_value_type = typename iterator_traits<_InputIterator>::value_type;
@@ -531,8 +531,23 @@ using __iterator_pointer_type = typename iterator_traits<_Iter>::pointer;
template <class _Iter>
using __iter_diff_t = typename iterator_traits<_Iter>::difference_type;
-template<class _InputIterator>
-using __iter_value_type = typename iterator_traits<_InputIterator>::value_type;
+template <class _Iter>
+using __iter_reference = typename iterator_traits<_Iter>::reference;
+
+#if _LIBCPP_STD_VER >= 20
+
+// [readable.traits]
+
+// Let `RI` be `remove_cvref_t<I>`. The type `iter_value_t<I>` denotes
+// `indirectly_readable_traits<RI>::value_type` if `iterator_traits<RI>` names a specialization
+// generated from the primary template, and `iterator_traits<RI>::value_type` otherwise.
+// This has to be in this file and not readable_traits.h to break the include cycle between the two.
+template <class _Ip>
+using iter_value_t = typename conditional_t<__is_primary_template<iterator_traits<remove_cvref_t<_Ip> > >::value,
+ indirectly_readable_traits<remove_cvref_t<_Ip> >,
+ iterator_traits<remove_cvref_t<_Ip> > >::value_type;
+
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/mergeable.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/mergeable.h
index b9f2d081dc7..494fda956e2 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/mergeable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/mergeable.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Input1, class _Input2, class _Output,
class _Comp = ranges::less, class _Proj1 = identity, class _Proj2 = identity>
@@ -34,7 +34,7 @@ concept mergeable =
indirectly_copyable<_Input2, _Output> &&
indirect_strict_weak_order<_Comp, projected<_Input1, _Proj1>, projected<_Input2, _Proj2>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/move_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/move_iterator.h
index fa806dbaf70..2f79d9a3d26 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/move_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/move_iterator.h
@@ -39,9 +39,12 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Iter, class = void>
struct __move_iter_category_base {};
@@ -59,18 +62,33 @@ template<class _Iter, class _Sent>
concept __move_iter_comparable = requires {
{ std::declval<const _Iter&>() == std::declval<_Sent>() } -> convertible_to<bool>;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template <class _Iter>
class _LIBCPP_TEMPLATE_VIS move_iterator
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
: public __move_iter_category_base<_Iter>
#endif
{
+ #if _LIBCPP_STD_VER >= 20
+private:
+ _LIBCPP_HIDE_FROM_ABI
+ static constexpr auto __get_iter_concept() {
+ if constexpr (random_access_iterator<_Iter>) {
+ return random_access_iterator_tag{};
+ } else if constexpr (bidirectional_iterator<_Iter>) {
+ return bidirectional_iterator_tag{};
+ } else if constexpr (forward_iterator<_Iter>) {
+ return forward_iterator_tag{};
+ } else {
+ return input_iterator_tag{};
+ }
+ }
+#endif // _LIBCPP_STD_VER >= 20
public:
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using iterator_type = _Iter;
- using iterator_concept = input_iterator_tag;
+ using iterator_concept = decltype(__get_iter_concept());
// iterator_category is inherited and not always present
using value_type = iter_value_t<_Iter>;
using difference_type = iter_difference_t<_Iter>;
@@ -79,7 +97,7 @@ public:
#else
typedef _Iter iterator_type;
typedef _If<
- __is_cpp17_random_access_iterator<_Iter>::value,
+ __has_random_access_iterator_category<_Iter>::value,
random_access_iterator_tag,
typename iterator_traits<_Iter>::iterator_category
> iterator_category;
@@ -93,7 +111,7 @@ public:
__libcpp_remove_reference_t<__reference>&&,
__reference
>::type reference;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
explicit move_iterator(_Iter __i) : __current_(std::move(__i)) {}
@@ -104,7 +122,7 @@ public:
_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
pointer operator->() const { return __current_; }
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI constexpr
move_iterator() requires is_constructible_v<_Iter> : __current_() {}
@@ -171,7 +189,7 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
move_iterator operator++(int) { move_iterator __tmp(*this); ++__current_; return __tmp; }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
move_iterator& operator--() { --__current_; return *this; }
@@ -186,7 +204,7 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
move_iterator& operator-=(difference_type __n) { __current_ -= __n; return *this; }
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<sentinel_for<_Iter> _Sent>
friend _LIBCPP_HIDE_FROM_ABI constexpr
bool operator==(const move_iterator& __x, const move_sentinel<_Sent>& __y)
@@ -223,7 +241,7 @@ public:
{
return ranges::iter_swap(__x.__current_, __y.__current_);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
private:
template<class _It2> friend class move_iterator;
@@ -276,7 +294,7 @@ bool operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& _
return __x.base() >= __y.base();
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter1, three_way_comparable_with<_Iter1> _Iter2>
inline _LIBCPP_HIDE_FROM_ABI constexpr
auto operator<=>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
@@ -284,7 +302,7 @@ auto operator<=>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>&
{
return __x.base() <=> __y.base();
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#ifndef _LIBCPP_CXX03_LANG
template <class _Iter1, class _Iter2>
@@ -304,7 +322,7 @@ operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
}
#endif // !_LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter>
inline _LIBCPP_HIDE_FROM_ABI constexpr
move_iterator<_Iter> operator+(iter_difference_t<_Iter> __n, const move_iterator<_Iter>& __x)
@@ -320,7 +338,7 @@ operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterato
{
return move_iterator<_Iter>(__x.base() + __n);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template <class _Iter>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
@@ -332,4 +350,6 @@ make_move_iterator(_Iter __i)
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ITERATOR_MOVE_ITERATOR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/move_sentinel.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/move_sentinel.h
index 0d7336a1dc2..34b3c25417c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/move_sentinel.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/move_sentinel.h
@@ -19,9 +19,12 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <semiregular _Sent>
class _LIBCPP_TEMPLATE_VIS move_sentinel
@@ -44,7 +47,7 @@ public:
move_sentinel& operator=(const move_sentinel<_S2>& __s)
{ __last_ = __s.base(); return *this; }
- constexpr _Sent base() const { return __last_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr _Sent base() const { return __last_; }
private:
_Sent __last_ = _Sent();
@@ -52,8 +55,10 @@ private:
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(move_sentinel);
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___ITERATOR_MOVE_SENTINEL_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/next.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/next.h
index 44e129e106d..07fcd565091 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/next.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/next.h
@@ -26,16 +26,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _InputIter>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
- typename enable_if<__is_cpp17_input_iterator<_InputIter>::value, _InputIter>::type
+ typename enable_if<__has_input_iterator_category<_InputIter>::value, _InputIter>::type
next(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n = 1) {
- _LIBCPP_ASSERT(__n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
- "Attempt to next(it, n) with negative n on a non-bidirectional iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n >= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
+ "Attempt to next(it, n) with negative n on a non-bidirectional iterator");
_VSTD::advance(__x, __n);
return __x;
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.iter.op.next]
@@ -77,7 +77,7 @@ inline namespace __cpo {
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/ostream_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/ostream_iterator.h
index d16f5a26eba..025712bb1ca 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/ostream_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/ostream_iterator.h
@@ -34,7 +34,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef ptrdiff_t difference_type;
#else
typedef void difference_type;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/ostreambuf_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/ostreambuf_iterator.h
index b75f7b6e846..898ef90e7e8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/ostreambuf_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/ostreambuf_iterator.h
@@ -33,7 +33,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef ptrdiff_t difference_type;
#else
typedef void difference_type;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/permutable.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/permutable.h
index 28d193eaae2..adf88f50652 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/permutable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/permutable.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iterator>
concept permutable =
@@ -28,7 +28,7 @@ concept permutable =
indirectly_movable_storable<_Iterator, _Iterator> &&
indirectly_swappable<_Iterator, _Iterator>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/prev.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/prev.h
index cdd1b8ecf63..2406558a157 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/prev.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/prev.h
@@ -26,15 +26,15 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _InputIter>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
- typename enable_if<__is_cpp17_input_iterator<_InputIter>::value, _InputIter>::type
+ typename enable_if<__has_input_iterator_category<_InputIter>::value, _InputIter>::type
prev(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n = 1) {
- _LIBCPP_ASSERT(__n <= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
- "Attempt to prev(it, n) with a positive n on a non-bidirectional iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n <= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
+ "Attempt to prev(it, n) with a positive n on a non-bidirectional iterator");
_VSTD::advance(__x, -__n);
return __x;
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.iter.op.prev]
@@ -70,7 +70,7 @@ inline namespace __cpo {
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/projected.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/projected.h
index 19c076b2e56..e74e56d6fb7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/projected.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/projected.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<indirectly_readable _It, indirectly_regular_unary_invocable<_It> _Proj>
struct projected {
@@ -34,7 +34,7 @@ struct incrementable_traits<projected<_It, _Proj>> {
using difference_type = iter_difference_t<_It>;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/ranges_iterator_traits.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/ranges_iterator_traits.h
new file mode 100644
index 00000000000..a30864199df
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/ranges_iterator_traits.h
@@ -0,0 +1,42 @@
+// -*- 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___ITERATOR_RANGES_ITERATOR_TRAITS_H
+#define _LIBCPP___ITERATOR_RANGES_ITERATOR_TRAITS_H
+
+#include <__config>
+#include <__fwd/pair.h>
+#include <__ranges/concepts.h>
+#include <__type_traits/add_const.h>
+#include <__type_traits/remove_const.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 23
+
+template <ranges::input_range _Range>
+using __range_key_type = __remove_const_t<typename ranges::range_value_t<_Range>::first_type>;
+
+template <ranges::input_range _Range>
+using __range_mapped_type = typename ranges::range_value_t<_Range>::second_type;
+
+template <ranges::input_range _Range>
+using __range_to_alloc_type =
+ pair<add_const_t<typename ranges::range_value_t<_Range>::first_type>,
+ typename ranges::range_value_t<_Range>::second_type>;
+
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ITERATOR_RANGES_ITERATOR_TRAITS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/readable_traits.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/readable_traits.h
index 8f17757c5a3..9e101fc28a6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/readable_traits.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/readable_traits.h
@@ -26,7 +26,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [readable.traits]
template<class> struct __cond_value_type {};
@@ -74,18 +74,7 @@ template<__has_member_value_type _Tp>
struct indirectly_readable_traits<_Tp>
: __cond_value_type<typename _Tp::value_type> {};
-template <class>
-struct iterator_traits;
-
-// Let `RI` be `remove_cvref_t<I>`. The type `iter_value_t<I>` denotes
-// `indirectly_readable_traits<RI>::value_type` if `iterator_traits<RI>` names a specialization
-// generated from the primary template, and `iterator_traits<RI>::value_type` otherwise.
-template <class _Ip>
-using iter_value_t = typename conditional_t<__is_primary_template<iterator_traits<remove_cvref_t<_Ip> > >::value,
- indirectly_readable_traits<remove_cvref_t<_Ip> >,
- iterator_traits<remove_cvref_t<_Ip> > >::value_type;
-
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_access.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_access.h
index 79b599c47c1..b8c5a071cc6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_access.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_access.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp, size_t _Np>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
@@ -93,7 +93,7 @@ auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c))
return _VSTD::rend(__c);
}
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h
index f272e03c17a..beb10f7f4f2 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h
@@ -63,21 +63,21 @@ private:
_Iter __t_; // no longer used as of LWG #2360, not removed due to ABI break
#endif
-#if _LIBCPP_STD_VER > 17
- static_assert(__is_cpp17_bidirectional_iterator<_Iter>::value || bidirectional_iterator<_Iter>,
+#if _LIBCPP_STD_VER >= 20
+ static_assert(__has_bidirectional_iterator_category<_Iter>::value || bidirectional_iterator<_Iter>,
"reverse_iterator<It> requires It to be a bidirectional iterator.");
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
protected:
_Iter current;
public:
using iterator_type = _Iter;
- using iterator_category = _If<__is_cpp17_random_access_iterator<_Iter>::value,
+ using iterator_category = _If<__has_random_access_iterator_category<_Iter>::value,
random_access_iterator_tag,
typename iterator_traits<_Iter>::iterator_category>;
using pointer = typename iterator_traits<_Iter>::pointer;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using iterator_concept = _If<random_access_iterator<_Iter>, random_access_iterator_tag, bidirectional_iterator_tag>;
using value_type = iter_value_t<_Iter>;
using difference_type = iter_difference_t<_Iter>;
@@ -144,7 +144,7 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reference operator*() const {_Iter __tmp = current; return *--__tmp;}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
constexpr pointer operator->() const
requires is_pointer_v<_Iter> || requires(const _Iter __i) { __i.operator->(); }
@@ -160,7 +160,7 @@ public:
pointer operator->() const {
return std::addressof(operator*());
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reverse_iterator& operator++() {--current; return *this;}
@@ -181,7 +181,7 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reference operator[](difference_type __n) const {return *(*this + __n);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI friend constexpr
iter_rvalue_reference_t<_Iter> iter_move(const reverse_iterator& __i)
noexcept(is_nothrow_copy_constructible_v<_Iter> &&
@@ -200,18 +200,18 @@ public:
auto __ytmp = __y.base();
ranges::iter_swap(--__xtmp, --__ytmp);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
};
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
bool
operator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires requires {
{ __x.base() == __y.base() } -> convertible_to<bool>;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() == __y.base();
}
@@ -220,11 +220,11 @@ template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
bool
operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires requires {
{ __x.base() > __y.base() } -> convertible_to<bool>;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() > __y.base();
}
@@ -233,11 +233,11 @@ template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
bool
operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires requires {
{ __x.base() != __y.base() } -> convertible_to<bool>;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() != __y.base();
}
@@ -246,11 +246,11 @@ template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
bool
operator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires requires {
{ __x.base() < __y.base() } -> convertible_to<bool>;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() < __y.base();
}
@@ -259,11 +259,11 @@ template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
bool
operator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires requires {
{ __x.base() <= __y.base() } -> convertible_to<bool>;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() <= __y.base();
}
@@ -272,16 +272,16 @@ template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
bool
operator<=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires requires {
{ __x.base() >= __y.base() } -> convertible_to<bool>;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() >= __y.base();
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter1, three_way_comparable_with<_Iter1> _Iter2>
_LIBCPP_HIDE_FROM_ABI constexpr
compare_three_way_result_t<_Iter1, _Iter2>
@@ -289,7 +289,7 @@ operator<=>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&
{
return __y.base() <=> __x.base();
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#ifndef _LIBCPP_CXX03_LANG
template <class _Iter1, class _Iter2>
@@ -318,13 +318,13 @@ operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_i
return reverse_iterator<_Iter>(__x.base() - __n);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter1, class _Iter2>
requires (!sized_sentinel_for<_Iter1, _Iter2>)
inline constexpr bool disable_sized_sentinel_for<reverse_iterator<_Iter1>, reverse_iterator<_Iter2>> = true;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Iter>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reverse_iterator<_Iter> make_reverse_iterator(_Iter __i)
@@ -365,11 +365,11 @@ class __unconstrained_reverse_iterator {
_Iter __iter_;
public:
- static_assert(__is_cpp17_bidirectional_iterator<_Iter>::value || bidirectional_iterator<_Iter>);
+ static_assert(__has_bidirectional_iterator_category<_Iter>::value || bidirectional_iterator<_Iter>);
using iterator_type = _Iter;
using iterator_category =
- _If<__is_cpp17_random_access_iterator<_Iter>::value, random_access_iterator_tag, __iterator_category_type<_Iter>>;
+ _If<__has_random_access_iterator_category<_Iter>::value, random_access_iterator_tag, __iterator_category_type<_Iter>>;
using pointer = __iterator_pointer_type<_Iter>;
using value_type = iter_value_t<_Iter>;
using difference_type = iter_difference_t<_Iter>;
@@ -498,7 +498,7 @@ struct __unwrap_reverse_iter_impl {
}
};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <ranges::bidirectional_range _Range>
_LIBCPP_HIDE_FROM_ABI constexpr ranges::
subrange<reverse_iterator<ranges::iterator_t<_Range>>, reverse_iterator<ranges::iterator_t<_Range>>>
@@ -512,7 +512,7 @@ template <class _Iter, bool __b>
struct __unwrap_iter_impl<reverse_iterator<reverse_iterator<_Iter> >, __b>
: __unwrap_reverse_iter_impl<reverse_iterator, reverse_iterator, _Iter> {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter, bool __b>
struct __unwrap_iter_impl<reverse_iterator<__unconstrained_reverse_iterator<_Iter>>, __b>
@@ -526,7 +526,7 @@ template <class _Iter, bool __b>
struct __unwrap_iter_impl<__unconstrained_reverse_iterator<__unconstrained_reverse_iterator<_Iter>>, __b>
: __unwrap_reverse_iter_impl<__unconstrained_reverse_iterator, __unconstrained_reverse_iterator, _Iter> {};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/size.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/size.h
index 1452bd1d55c..625eeb165bf 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/size.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/size.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Cont>
_LIBCPP_INLINE_VISIBILITY
@@ -34,7 +34,7 @@ template <class _Tp, size_t _Sz>
_LIBCPP_INLINE_VISIBILITY
constexpr size_t size(const _Tp (&)[_Sz]) noexcept { return _Sz; }
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Cont>
_LIBCPP_INLINE_VISIBILITY
constexpr auto ssize(const _Cont& __c)
@@ -52,7 +52,7 @@ constexpr ptrdiff_t ssize(const _Tp (&)[_Sz]) noexcept { return _Sz; }
_LIBCPP_DIAGNOSTIC_POP
#endif
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/sortable.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/sortable.h
index bcf934f87be..d4d77d6cf33 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/sortable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/sortable.h
@@ -23,14 +23,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter, class _Comp = ranges::less, class _Proj = identity>
concept sortable =
permutable<_Iter> &&
indirect_strict_weak_order<_Comp, projected<_Iter, _Proj>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/unreachable_sentinel.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/unreachable_sentinel.h
index d77cc99f02f..91fd0a57ab3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/unreachable_sentinel.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/unreachable_sentinel.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct unreachable_sentinel_t {
template<weakly_incrementable _Iter>
@@ -31,7 +31,7 @@ struct unreachable_sentinel_t {
inline constexpr unreachable_sentinel_t unreachable_sentinel{};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h
index 16defc1d8b0..774276baa81 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h
@@ -11,12 +11,12 @@
#define _LIBCPP___ITERATOR_WRAP_ITER_H
#include <__config>
-#include <__debug>
#include <__iterator/iterator_traits.h>
#include <__memory/addressof.h>
#include <__memory/pointer_traits.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/is_convertible.h>
+#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -34,7 +34,7 @@ public:
typedef typename iterator_traits<iterator_type>::pointer pointer;
typedef typename iterator_traits<iterator_type>::reference reference;
typedef typename iterator_traits<iterator_type>::iterator_category iterator_category;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef contiguous_iterator_tag iterator_concept;
#endif
@@ -44,60 +44,23 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter() _NOEXCEPT
: __i_()
{
- _VSTD::__debug_db_insert_i(this);
}
template <class _Up> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
__wrap_iter(const __wrap_iter<_Up>& __u,
typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = nullptr) _NOEXCEPT
: __i_(__u.base())
{
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- if (!__libcpp_is_constant_evaluated())
- __get_db()->__iterator_copy(this, _VSTD::addressof(__u));
-#endif
- }
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
- __wrap_iter(const __wrap_iter& __x)
- : __i_(__x.base())
- {
- if (!__libcpp_is_constant_evaluated())
- __get_db()->__iterator_copy(this, _VSTD::addressof(__x));
- }
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
- __wrap_iter& operator=(const __wrap_iter& __x)
- {
- if (this != _VSTD::addressof(__x))
- {
- if (!__libcpp_is_constant_evaluated())
- __get_db()->__iterator_copy(this, _VSTD::addressof(__x));
- __i_ = __x.__i_;
- }
- return *this;
- }
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- ~__wrap_iter()
- {
- if (!__libcpp_is_constant_evaluated())
- __get_db()->__erase_i(this);
}
-#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator*() const _NOEXCEPT
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable iterator");
return *__i_;
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pointer operator->() const _NOEXCEPT
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable iterator");
return _VSTD::__to_address(__i_);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter& operator++() _NOEXCEPT
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment a non-incrementable iterator");
++__i_;
return *this;
}
@@ -106,8 +69,6 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter& operator--() _NOEXCEPT
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__decrementable(this),
- "Attempted to decrement a non-decrementable iterator");
--__i_;
return *this;
}
@@ -117,8 +78,6 @@ public:
{__wrap_iter __w(*this); __w += __n; return __w;}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter& operator+=(difference_type __n) _NOEXCEPT
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__addable(this, __n),
- "Attempted to add/subtract an iterator outside its valid range");
__i_ += __n;
return *this;
}
@@ -128,8 +87,6 @@ public:
{*this += -__n; return *this;}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__subscriptable(this, __n),
- "Attempted to subscript an iterator outside its valid range");
return __i_[__n];
}
@@ -137,13 +94,8 @@ public:
private:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
- explicit __wrap_iter(const void* __p, iterator_type __x) _NOEXCEPT : __i_(__x)
+ explicit __wrap_iter(iterator_type __x) _NOEXCEPT : __i_(__x)
{
- (void)__p;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- if (!__libcpp_is_constant_evaluated())
- __get_db()->__insert_ic(this, __p);
-#endif
}
template <class _Up> friend class __wrap_iter;
@@ -170,8 +122,6 @@ template <class _Iter1>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__less_than_comparable(_VSTD::addressof(__x), _VSTD::addressof(__y)),
- "Attempted to compare incomparable iterators");
return __x.base() < __y.base();
}
@@ -179,8 +129,6 @@ template <class _Iter1, class _Iter2>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
- "Attempted to compare incomparable iterators");
return __x.base() < __y.base();
}
@@ -250,8 +198,6 @@ typename __wrap_iter<_Iter1>::difference_type
operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
#endif // C++03
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__less_than_comparable(_VSTD::addressof(__x), _VSTD::addressof(__y)),
- "Attempted to subtract incompatible iterators");
return __x.base() - __y.base();
}
@@ -265,7 +211,7 @@ __wrap_iter<_Iter1> operator+(typename __wrap_iter<_Iter1>::difference_type __n,
#if _LIBCPP_STD_VER <= 17
template <class _It>
-struct __is_cpp17_contiguous_iterator<__wrap_iter<_It> > : true_type {};
+struct __libcpp_is_contiguous_iterator<__wrap_iter<_It> > : true_type {};
#endif
template <class _It>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale b/contrib/libs/cxxsupp/libcxx/include/__locale
index 334a8fd0524..d28ad500992 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__locale
+++ b/contrib/libs/cxxsupp/libcxx/include/__locale
@@ -12,10 +12,13 @@
#include <__availability>
#include <__config>
+#include <__memory/shared_ptr.h> // __shared_count
+#include <__type_traits/make_unsigned.h>
#include <atomic>
#include <cctype>
+#include <clocale>
#include <cstdint>
-#include <locale.h>
+#include <cstdlib>
#include <mutex>
#include <string>
@@ -23,15 +26,18 @@
#include <cstddef>
#include <cstring>
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+# include <cwchar>
+#else
+# include <__std_mbstate_t.h>
+#endif
+
#if defined(_LIBCPP_MSVCRT_LIKE)
# include <__support/win32/locale_win32.h>
#elif defined(_AIX) || defined(__MVS__)
# include <__support/ibm/xlocale.h>
#elif defined(__ANDROID__)
# include <__support/android/locale_bionic.h>
-#elif defined(__sun__)
-# include <__support/solaris/xlocale.h>
-# include <xlocale.h>
#elif defined(_NEWLIB_VERSION)
# include <__support/newlib/xlocale.h>
#elif defined(__OpenBSD__)
@@ -53,64 +59,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if !defined(_LIBCPP_LOCALE__L_EXTENSIONS)
-struct __libcpp_locale_guard {
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_locale_guard(locale_t& __loc) : __old_loc_(uselocale(__loc)) {}
-
- _LIBCPP_INLINE_VISIBILITY
- ~__libcpp_locale_guard() {
- if (__old_loc_)
- uselocale(__old_loc_);
- }
-
- locale_t __old_loc_;
-private:
- __libcpp_locale_guard(__libcpp_locale_guard const&);
- __libcpp_locale_guard& operator=(__libcpp_locale_guard const&);
-};
-#elif defined(_LIBCPP_MSVCRT_LIKE)
-struct __libcpp_locale_guard {
- __libcpp_locale_guard(locale_t __l) :
- __status(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)) {
- // Setting the locale can be expensive even when the locale given is
- // already the current locale, so do an explicit check to see if the
- // current locale is already the one we want.
- const char* __lc = __setlocale(nullptr);
- // If every category is the same, the locale string will simply be the
- // locale name, otherwise it will be a semicolon-separated string listing
- // each category. In the second case, we know at least one category won't
- // be what we want, so we only have to check the first case.
- if (_VSTD::strcmp(__l.__get_locale(), __lc) != 0) {
- __locale_all = _strdup(__lc);
- if (__locale_all == nullptr)
- __throw_bad_alloc();
- __setlocale(__l.__get_locale());
- }
- }
- ~__libcpp_locale_guard() {
- // The CRT documentation doesn't explicitly say, but setlocale() does the
- // right thing when given a semicolon-separated list of locale settings
- // for the different categories in the same format as returned by
- // setlocale(LC_ALL, nullptr).
- if (__locale_all != nullptr) {
- __setlocale(__locale_all);
- free(__locale_all);
- }
- _configthreadlocale(__status);
- }
- static const char* __setlocale(const char* __locale) {
- const char* __new_locale = setlocale(LC_ALL, __locale);
- if (__new_locale == nullptr)
- __throw_bad_alloc();
- return __new_locale;
- }
- int __status;
- char* __locale_all = nullptr;
-};
-#endif
-
-class _LIBCPP_TYPE_VIS locale;
+class _LIBCPP_EXPORTED_FROM_ABI locale;
template <class _Facet>
_LIBCPP_INLINE_VISIBILITY
@@ -122,12 +71,12 @@ _LIBCPP_INLINE_VISIBILITY
const _Facet&
use_facet(const locale&);
-class _LIBCPP_TYPE_VIS locale
+class _LIBCPP_EXPORTED_FROM_ABI locale
{
public:
// types:
- class _LIBCPP_TYPE_VIS facet;
- class _LIBCPP_TYPE_VIS id;
+ class _LIBCPP_EXPORTED_FROM_ABI facet;
+ class _LIBCPP_EXPORTED_FROM_ABI id;
typedef int category;
_LIBCPP_AVAILABILITY_LOCALE_CATEGORY
@@ -163,7 +112,9 @@ public:
// locale operations:
string name() const;
bool operator==(const locale&) const;
- bool operator!=(const locale& __y) const {return !(*this == __y);}
+#if _LIBCPP_STD_VER <= 17
+ _LIBCPP_HIDE_FROM_ABI bool operator!=(const locale& __y) const {return !(*this == __y);}
+#endif
template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
bool operator()(const basic_string<_CharT, _Traits, _Allocator>&,
@@ -186,7 +137,7 @@ private:
template <class _Facet> friend const _Facet& use_facet(const locale&);
};
-class _LIBCPP_TYPE_VIS locale::facet
+class _LIBCPP_EXPORTED_FROM_ABI locale::facet
: public __shared_count
{
protected:
@@ -202,7 +153,7 @@ private:
void __on_zero_shared() _NOEXCEPT override;
};
-class _LIBCPP_TYPE_VIS locale::id
+class _LIBCPP_EXPORTED_FROM_ABI locale::id
{
std::atomic<int32_t> __id_;
@@ -347,7 +298,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>;
template <class _CharT> class _LIBCPP_TEMPLATE_VIS collate_byname;
template <>
-class _LIBCPP_TYPE_VIS collate_byname<char>
+class _LIBCPP_EXPORTED_FROM_ABI collate_byname<char>
: public collate<char>
{
locale_t __l_;
@@ -367,7 +318,7 @@ protected:
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <>
-class _LIBCPP_TYPE_VIS collate_byname<wchar_t>
+class _LIBCPP_EXPORTED_FROM_ABI collate_byname<wchar_t>
: public collate<wchar_t>
{
locale_t __l_;
@@ -399,7 +350,7 @@ locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
// template <class charT> class ctype
-class _LIBCPP_TYPE_VIS ctype_base
+class _LIBCPP_EXPORTED_FROM_ABI ctype_base
{
public:
#if defined(_LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE)
@@ -480,7 +431,7 @@ public:
static const mask blank = _CTYPE_B;
static const mask __regex_word = 0x80;
# endif
-#elif defined(__sun__) || defined(_AIX)
+#elif defined(_AIX)
typedef unsigned int mask;
static const mask space = _ISSPACE;
static const mask print = _ISPRINT;
@@ -492,11 +443,7 @@ public:
static const mask punct = _ISPUNCT;
static const mask xdigit = _ISXDIGIT;
static const mask blank = _ISBLANK;
-# if defined(_AIX)
static const mask __regex_word = 0x8000;
-# else
- static const mask __regex_word = 0x80;
-# endif
#elif defined(_NEWLIB_VERSION)
// Same type as Newlib's _ctype_ array in newlib/libc/include/ctype.h.
typedef char mask;
@@ -559,7 +506,7 @@ template <class _CharT> class _LIBCPP_TEMPLATE_VIS ctype;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <>
-class _LIBCPP_TYPE_VIS ctype<wchar_t>
+class _LIBCPP_EXPORTED_FROM_ABI ctype<wchar_t>
: public locale::facet,
public ctype_base
{
@@ -662,7 +609,7 @@ protected:
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <>
-class _LIBCPP_TYPE_VIS ctype<char>
+class _LIBCPP_EXPORTED_FROM_ABI ctype<char>
: public locale::facet, public ctype_base
{
const mask* __tab_;
@@ -791,7 +738,7 @@ protected:
template <class _CharT> class _LIBCPP_TEMPLATE_VIS ctype_byname;
template <>
-class _LIBCPP_TYPE_VIS ctype_byname<char>
+class _LIBCPP_EXPORTED_FROM_ABI ctype_byname<char>
: public ctype<char>
{
locale_t __l_;
@@ -810,7 +757,7 @@ protected:
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <>
-class _LIBCPP_TYPE_VIS ctype_byname<wchar_t>
+class _LIBCPP_EXPORTED_FROM_ABI ctype_byname<wchar_t>
: public ctype<wchar_t>
{
locale_t __l_;
@@ -925,6 +872,11 @@ isgraph(_CharT __c, const locale& __loc)
}
template <class _CharT>
+_LIBCPP_HIDE_FROM_ABI bool isblank(_CharT __c, const locale& __loc) {
+ return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::blank, __c);
+}
+
+template <class _CharT>
inline _LIBCPP_INLINE_VISIBILITY
_CharT
toupper(_CharT __c, const locale& __loc)
@@ -942,7 +894,7 @@ tolower(_CharT __c, const locale& __loc)
// codecvt_base
-class _LIBCPP_TYPE_VIS codecvt_base
+class _LIBCPP_EXPORTED_FROM_ABI codecvt_base
{
public:
_LIBCPP_INLINE_VISIBILITY codecvt_base() {}
@@ -956,7 +908,7 @@ template <class _InternT, class _ExternT, class _StateT> class _LIBCPP_TEMPLATE_
// template <> class codecvt<char, char, mbstate_t>
template <>
-class _LIBCPP_TYPE_VIS codecvt<char, char, mbstate_t>
+class _LIBCPP_EXPORTED_FROM_ABI codecvt<char, char, mbstate_t>
: public locale::facet,
public codecvt_base
{
@@ -1043,7 +995,7 @@ protected:
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <>
-class _LIBCPP_TYPE_VIS codecvt<wchar_t, char, mbstate_t>
+class _LIBCPP_EXPORTED_FROM_ABI codecvt<wchar_t, char, mbstate_t>
: public locale::facet,
public codecvt_base
{
@@ -1127,7 +1079,7 @@ protected:
// template <> class codecvt<char16_t, char, mbstate_t> // deprecated in C++20
template <>
-class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_TYPE_VIS codecvt<char16_t, char, mbstate_t>
+class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXPORTED_FROM_ABI codecvt<char16_t, char, mbstate_t>
: public locale::facet,
public codecvt_base
{
@@ -1215,7 +1167,7 @@ protected:
// template <> class codecvt<char16_t, char8_t, mbstate_t> // C++20
template <>
-class _LIBCPP_TYPE_VIS codecvt<char16_t, char8_t, mbstate_t>
+class _LIBCPP_EXPORTED_FROM_ABI codecvt<char16_t, char8_t, mbstate_t>
: public locale::facet,
public codecvt_base
{
@@ -1303,7 +1255,7 @@ protected:
// template <> class codecvt<char32_t, char, mbstate_t> // deprecated in C++20
template <>
-class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_TYPE_VIS codecvt<char32_t, char, mbstate_t>
+class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXPORTED_FROM_ABI codecvt<char32_t, char, mbstate_t>
: public locale::facet,
public codecvt_base
{
@@ -1391,7 +1343,7 @@ protected:
// template <> class codecvt<char32_t, char8_t, mbstate_t> // C++20
template <>
-class _LIBCPP_TYPE_VIS codecvt<char32_t, char8_t, mbstate_t>
+class _LIBCPP_EXPORTED_FROM_ABI codecvt<char32_t, char8_t, mbstate_t>
: public locale::facet,
public codecvt_base
{
@@ -1535,7 +1487,7 @@ struct __narrow_to_utf8<8>
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
-struct _LIBCPP_TYPE_VIS __narrow_to_utf8<16>
+struct _LIBCPP_EXPORTED_FROM_ABI __narrow_to_utf8<16>
: public codecvt<char16_t, char, mbstate_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1571,7 +1523,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
-struct _LIBCPP_TYPE_VIS __narrow_to_utf8<32>
+struct _LIBCPP_EXPORTED_FROM_ABI __narrow_to_utf8<32>
: public codecvt<char32_t, char, mbstate_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1629,7 +1581,7 @@ struct __widen_from_utf8<8>
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
-struct _LIBCPP_TYPE_VIS __widen_from_utf8<16>
+struct _LIBCPP_EXPORTED_FROM_ABI __widen_from_utf8<16>
: public codecvt<char16_t, char, mbstate_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1665,7 +1617,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
-struct _LIBCPP_TYPE_VIS __widen_from_utf8<32>
+struct _LIBCPP_EXPORTED_FROM_ABI __widen_from_utf8<32>
: public codecvt<char32_t, char, mbstate_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -1704,7 +1656,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
template <class _CharT> class _LIBCPP_TEMPLATE_VIS numpunct;
template <>
-class _LIBCPP_TYPE_VIS numpunct<char>
+class _LIBCPP_EXPORTED_FROM_ABI numpunct<char>
: public locale::facet
{
public:
@@ -1736,7 +1688,7 @@ protected:
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <>
-class _LIBCPP_TYPE_VIS numpunct<wchar_t>
+class _LIBCPP_EXPORTED_FROM_ABI numpunct<wchar_t>
: public locale::facet
{
public:
@@ -1772,7 +1724,7 @@ protected:
template <class _CharT> class _LIBCPP_TEMPLATE_VIS numpunct_byname;
template <>
-class _LIBCPP_TYPE_VIS numpunct_byname<char>
+class _LIBCPP_EXPORTED_FROM_ABI numpunct_byname<char>
: public numpunct<char>
{
public:
@@ -1791,7 +1743,7 @@ private:
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <>
-class _LIBCPP_TYPE_VIS numpunct_byname<wchar_t>
+class _LIBCPP_EXPORTED_FROM_ABI numpunct_byname<wchar_t>
: public numpunct<wchar_t>
{
public:
diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/bsd_locale_defaults.h b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/bsd_locale_defaults.h
new file mode 100644
index 00000000000..38d36f0aa8f
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/bsd_locale_defaults.h
@@ -0,0 +1,36 @@
+// -*- 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
+//
+//===----------------------------------------------------------------------===//
+// The BSDs have lots of *_l functions. We don't want to define those symbols
+// on other platforms though, for fear of conflicts with user code. So here,
+// we will define the mapping from an internal macro to the real BSD symbol.
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___LOCALE_LOCALE_BASE_API_BSD_LOCALE_DEFAULTS_H
+#define _LIBCPP___LOCALE_LOCALE_BASE_API_BSD_LOCALE_DEFAULTS_H
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#define __libcpp_mb_cur_max_l(loc) MB_CUR_MAX_L(loc)
+#define __libcpp_btowc_l(ch, loc) btowc_l(ch, loc)
+#define __libcpp_wctob_l(wch, loc) wctob_l(wch, loc)
+#define __libcpp_wcsnrtombs_l(dst, src, nwc, len, ps, loc) wcsnrtombs_l(dst, src, nwc, len, ps, loc)
+#define __libcpp_wcrtomb_l(src, wc, ps, loc) wcrtomb_l(src, wc, ps, loc)
+#define __libcpp_mbsnrtowcs_l(dst, src, nms, len, ps, loc) mbsnrtowcs_l(dst, src, nms, len, ps, loc)
+#define __libcpp_mbrtowc_l(pwc, s, n, ps, l) mbrtowc_l(pwc, s, n, ps, l)
+#define __libcpp_mbtowc_l(pwc, pmb, max, l) mbtowc_l(pwc, pmb, max, l)
+#define __libcpp_mbrlen_l(s, n, ps, l) mbrlen_l(s, n, ps, l)
+#define __libcpp_localeconv_l(l) localeconv_l(l)
+#define __libcpp_mbsrtowcs_l(dest, src, len, ps, l) mbsrtowcs_l(dest, src, len, ps, l)
+#define __libcpp_snprintf_l(...) snprintf_l(__VA_ARGS__)
+#define __libcpp_asprintf_l(...) asprintf_l(__VA_ARGS__)
+#define __libcpp_sscanf_l(...) sscanf_l(__VA_ARGS__)
+
+#endif // _LIBCPP___LOCALE_LOCALE_BASE_API_BSD_LOCALE_DEFAULTS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h
new file mode 100644
index 00000000000..7776a744d91
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h
@@ -0,0 +1,148 @@
+// -*- 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
+//
+//===----------------------------------------------------------------------===//
+// The BSDs have lots of *_l functions. This file provides reimplementations
+// of those functions for non-BSD platforms.
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___LOCALE_LOCALE_BASE_API_BSD_LOCALE_FALLBACKS_H
+#define _LIBCPP___LOCALE_LOCALE_BASE_API_BSD_LOCALE_FALLBACKS_H
+
+#include <__locale_dir/locale_base_api/locale_guard.h>
+#include <cstdio>
+#include <stdarg.h>
+#include <stdlib.h>
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+# include <cwchar>
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+inline _LIBCPP_INLINE_VISIBILITY
+decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return MB_CUR_MAX;
+}
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+inline _LIBCPP_INLINE_VISIBILITY
+wint_t __libcpp_btowc_l(int __c, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return btowc(__c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+int __libcpp_wctob_l(wint_t __c, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return wctob(__c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
+ size_t __len, mbstate_t *__ps, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return wcsnrtombs(__dest, __src, __nwc, __len, __ps);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return wcrtomb(__s, __wc, __ps);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms,
+ size_t __len, mbstate_t *__ps, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return mbsnrtowcs(__dest, __src, __nms, __len, __ps);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
+ mbstate_t *__ps, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return mbrtowc(__pwc, __s, __n, __ps);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+int __libcpp_mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return mbtowc(__pwc, __pmb, __max);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+size_t __libcpp_mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return mbrlen(__s, __n, __ps);
+}
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+
+inline _LIBCPP_INLINE_VISIBILITY
+lconv *__libcpp_localeconv_l(locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return localeconv();
+}
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+inline _LIBCPP_INLINE_VISIBILITY
+size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
+ mbstate_t *__ps, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return mbsrtowcs(__dest, __src, __len, __ps);
+}
+#endif
+
+inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 4, 5)
+int __libcpp_snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {
+ va_list __va;
+ va_start(__va, __format);
+ __libcpp_locale_guard __current(__l);
+ int __res = vsnprintf(__s, __n, __format, __va);
+ va_end(__va);
+ return __res;
+}
+
+inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4)
+int __libcpp_asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
+ va_list __va;
+ va_start(__va, __format);
+ __libcpp_locale_guard __current(__l);
+ int __res = vasprintf(__s, __format, __va);
+ va_end(__va);
+ return __res;
+}
+
+inline _LIBCPP_ATTRIBUTE_FORMAT(__scanf__, 3, 4)
+int __libcpp_sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
+ va_list __va;
+ va_start(__va, __format);
+ __libcpp_locale_guard __current(__l);
+ int __res = vsscanf(__s, __format, __va);
+ va_end(__va);
+ return __res;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___LOCALE_LOCALE_BASE_API_BSD_LOCALE_FALLBACKS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/locale_guard.h b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/locale_guard.h
new file mode 100644
index 00000000000..5946ed698e0
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__locale_dir/locale_base_api/locale_guard.h
@@ -0,0 +1,80 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___LOCALE_LOCALE_BASE_API_LOCALE_GUARD_H
+#define _LIBCPP___LOCALE_LOCALE_BASE_API_LOCALE_GUARD_H
+
+#include <__config>
+#include <__locale> // for locale_t
+#include <clocale>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_LOCALE__L_EXTENSIONS)
+struct __libcpp_locale_guard {
+ _LIBCPP_INLINE_VISIBILITY __libcpp_locale_guard(locale_t& __loc) : __old_loc_(uselocale(__loc)) {}
+
+ _LIBCPP_INLINE_VISIBILITY ~__libcpp_locale_guard() {
+ if (__old_loc_)
+ uselocale(__old_loc_);
+ }
+
+ locale_t __old_loc_;
+
+private:
+ __libcpp_locale_guard(__libcpp_locale_guard const&);
+ __libcpp_locale_guard& operator=(__libcpp_locale_guard const&);
+};
+#elif defined(_LIBCPP_MSVCRT_LIKE)
+struct __libcpp_locale_guard {
+ __libcpp_locale_guard(locale_t __l) :
+ __status(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)) {
+ // Setting the locale can be expensive even when the locale given is
+ // already the current locale, so do an explicit check to see if the
+ // current locale is already the one we want.
+ const char* __lc = __setlocale(nullptr);
+ // If every category is the same, the locale string will simply be the
+ // locale name, otherwise it will be a semicolon-separated string listing
+ // each category. In the second case, we know at least one category won't
+ // be what we want, so we only have to check the first case.
+ if (_VSTD::strcmp(__l.__get_locale(), __lc) != 0) {
+ __locale_all = _strdup(__lc);
+ if (__locale_all == nullptr)
+ __throw_bad_alloc();
+ __setlocale(__l.__get_locale());
+ }
+ }
+ ~__libcpp_locale_guard() {
+ // The CRT documentation doesn't explicitly say, but setlocale() does the
+ // right thing when given a semicolon-separated list of locale settings
+ // for the different categories in the same format as returned by
+ // setlocale(LC_ALL, nullptr).
+ if (__locale_all != nullptr) {
+ __setlocale(__locale_all);
+ free(__locale_all);
+ }
+ _configthreadlocale(__status);
+ }
+ static const char* __setlocale(const char* __locale) {
+ const char* __new_locale = setlocale(LC_ALL, __locale);
+ if (__new_locale == nullptr)
+ __throw_bad_alloc();
+ return __new_locale;
+ }
+ int __status;
+ char* __locale_all = nullptr;
+};
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___LOCALE_LOCALE_BASE_API_LOCALE_GUARD_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__mbstate_t.h b/contrib/libs/cxxsupp/libcxx/include/__mbstate_t.h
index 487a6d092c7..2b9e719b1f2 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__mbstate_t.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__mbstate_t.h
@@ -16,29 +16,39 @@
# pragma GCC system_header
#endif
-// TODO(ldionne):
-// The goal of this header is to provide mbstate_t without having to pull in
-// <wchar.h> or <uchar.h>. This is necessary because we need that type even
-// when we don't have (or try to provide) support for wchar_t, because several
-// types like std::fpos are defined in terms of mbstate_t.
+// The goal of this header is to provide mbstate_t without requiring all of
+// <uchar.h> or <wchar.h>. It's also used by the libc++ versions of <uchar.h>
+// and <wchar.h> to get mbstate_t when the C library doesn't provide <uchar.h>
+// or <wchar.h>, hence the #include_next of those headers instead of #include.
+// (e.g. if <wchar.h> isn't present in the C library, the libc++ <wchar.h>
+// will include this header. This header needs to not turn around and cyclically
+// include <wchar.h>, but fall through to <uchar.h>.)
//
-// This is a gruesome hack, but I don't know how to make it cleaner for
-// the time being.
+// This does not define std::mbstate_t -- this only brings in the declaration
+// in the global namespace.
+
+// We define this here to support older versions of glibc <wchar.h> that do
+// not define this for clang. This is also set in libc++'s <wchar.h> header,
+// and we need to do so here too to avoid a different function signature given
+// a different include order.
+#ifdef __cplusplus
+# define __CORRECT_ISO_CPP_WCHAR_H_PROTO
+#endif
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-# include <wchar.h> // for mbstate_t
+#if defined(_LIBCPP_HAS_MUSL_LIBC)
+# define __NEED_mbstate_t
+# include <bits/alltypes.h>
+# undef __NEED_mbstate_t
#elif __has_include(<bits/types/mbstate_t.h>)
# include <bits/types/mbstate_t.h> // works on most Unixes
#elif __has_include(<sys/_types/_mbstate_t.h>)
# include <sys/_types/_mbstate_t.h> // works on Darwin
+#elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) && __has_include_next(<wchar.h>)
+# include_next <wchar.h> // fall back to the C standard provider of mbstate_t
+#elif __has_include_next(<uchar.h>)
+# include_next <uchar.h> // <uchar.h> is also required to make mbstate_t visible
#else
-# error "The library was configured without support for wide-characters, but we don't know how to get the definition of mbstate_t without <wchar.h> on your platform."
+# error "We don't know how to get the definition of mbstate_t without <wchar.h> on your platform."
#endif
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
-
-_LIBCPP_END_NAMESPACE_STD
-
#endif // _LIBCPP___MBSTATE_T_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/align.h b/contrib/libs/cxxsupp/libcxx/include/__memory/align.h
index c6792206b07..bbb995f4a8c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/align.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/align.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-_LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space);
+_LIBCPP_EXPORTED_FROM_ABI void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space);
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/aligned_alloc.h b/contrib/libs/cxxsupp/libcxx/include/__memory/aligned_alloc.h
new file mode 100644
index 00000000000..bdcd5089a01
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/aligned_alloc.h
@@ -0,0 +1,67 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___MEMORY_ALIGNED_ALLOC_H
+#define _LIBCPP___MEMORY_ALIGNED_ALLOC_H
+
+#include <__config>
+#include <cstddef>
+#include <cstdlib>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
+
+// Low-level helpers to call the aligned allocation and deallocation functions
+// on the target platform. This is used to implement libc++'s own memory
+// allocation routines -- if you need to allocate memory inside the library,
+// chances are that you want to use `__libcpp_allocate` instead.
+//
+// Returns the allocated memory, or `nullptr` on failure.
+inline _LIBCPP_HIDE_FROM_ABI
+void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) {
+# if defined(_LIBCPP_MSVCRT_LIKE)
+ return ::_aligned_malloc(__size, __alignment);
+// Use posix_memalign instead of ::aligned_alloc to fix the musl and some of the tests
+# elif _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC) && false
+ // aligned_alloc() requires that __size is a multiple of __alignment,
+ // but for C++ [new.delete.general], only states "if the value of an
+ // alignment argument passed to any of these functions is not a valid
+ // alignment value, the behavior is undefined".
+ // To handle calls such as ::operator new(1, std::align_val_t(128)), we
+ // round __size up to the next multiple of __alignment.
+ size_t __rounded_size = (__size + __alignment - 1) & ~(__alignment - 1);
+ // Rounding up could have wrapped around to zero, so we have to add another
+ // max() ternary to the actual call site to avoid succeeded in that case.
+ return ::aligned_alloc(__alignment, __size > __rounded_size ? __size : __rounded_size);
+# else
+ void* __result = nullptr;
+ (void)::posix_memalign(&__result, __alignment, __size);
+ // If posix_memalign fails, __result is unmodified so we still return `nullptr`.
+ return __result;
+# endif
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+void __libcpp_aligned_free(void* __ptr) {
+#if defined(_LIBCPP_MSVCRT_LIKE)
+ ::_aligned_free(__ptr);
+#else
+ ::free(__ptr);
+#endif
+}
+
+#endif // !_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___MEMORY_ALIGNED_ALLOC_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/allocate_at_least.h b/contrib/libs/cxxsupp/libcxx/include/__memory/allocate_at_least.h
index ef205f855cb..8d8ad071e2c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/allocate_at_least.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/allocate_at_least.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Pointer>
struct allocation_result {
_Pointer ptr;
@@ -55,7 +55,7 @@ __allocation_result<typename allocator_traits<_Alloc>::pointer> __allocate_at_le
return {__alloc.allocate(__n), __n};
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/allocation_guard.h b/contrib/libs/cxxsupp/libcxx/include/__memory/allocation_guard.h
index 424598cc815..f63b17430ed 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/allocation_guard.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/allocation_guard.h
@@ -11,6 +11,7 @@
#define _LIBCPP___MEMORY_ALLOCATION_GUARD_H
#include <__config>
+#include <__memory/addressof.h>
#include <__memory/allocator_traits.h>
#include <__utility/move.h>
#include <cstddef>
@@ -19,6 +20,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
// Helper class to allocate memory using an Allocator in an exception safe
@@ -55,9 +59,29 @@ struct __allocation_guard {
_LIBCPP_HIDE_FROM_ABI
~__allocation_guard() _NOEXCEPT {
- if (__ptr_ != nullptr) {
- allocator_traits<_Alloc>::deallocate(__alloc_, __ptr_, __n_);
+ __destroy();
+ }
+
+ _LIBCPP_HIDE_FROM_ABI __allocation_guard(const __allocation_guard&) = delete;
+ _LIBCPP_HIDE_FROM_ABI __allocation_guard(__allocation_guard&& __other) _NOEXCEPT
+ : __alloc_(std::move(__other.__alloc_))
+ , __n_(__other.__n_)
+ , __ptr_(__other.__ptr_) {
+ __other.__ptr_ = nullptr;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI __allocation_guard& operator=(const __allocation_guard& __other) = delete;
+ _LIBCPP_HIDE_FROM_ABI __allocation_guard& operator=(__allocation_guard&& __other) _NOEXCEPT {
+ if (std::addressof(__other) != this) {
+ __destroy();
+
+ __alloc_ = std::move(__other.__alloc_);
+ __n_ = __other.__n_;
+ __ptr_ = __other.__ptr_;
+ __other.__ptr_ = nullptr;
}
+
+ return *this;
}
_LIBCPP_HIDE_FROM_ABI
@@ -73,6 +97,13 @@ struct __allocation_guard {
}
private:
+ _LIBCPP_HIDE_FROM_ABI
+ void __destroy() _NOEXCEPT {
+ if (__ptr_ != nullptr) {
+ allocator_traits<_Alloc>::deallocate(__alloc_, __ptr_, __n_);
+ }
+ }
+
_Alloc __alloc_;
_Size __n_;
_Pointer __ptr_;
@@ -80,4 +111,6 @@ private:
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___MEMORY_ALLOCATION_GUARD_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/allocator.h b/contrib/libs/cxxsupp/libcxx/include/__memory/allocator.h
index 54c9b78d524..47e1ef926a4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/allocator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/allocator.h
@@ -11,6 +11,7 @@
#define _LIBCPP___MEMORY_ALLOCATOR_H
#include <__config>
+#include <__memory/addressof.h>
#include <__memory/allocate_at_least.h>
#include <__memory/allocator_traits.h>
#include <__type_traits/is_constant_evaluated.h>
@@ -20,7 +21,6 @@
#include <__utility/forward.h>
#include <cstddef>
#include <new>
-#include <stdexcept>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -98,8 +98,7 @@ public:
typedef true_type propagate_on_container_move_assignment;
typedef true_type is_always_equal;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
- allocator() _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator() _NOEXCEPT = default;
template <class _Up>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -116,7 +115,7 @@ public:
}
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr
allocation_result<_Tp*> allocate_at_least(size_t __n) {
return {allocate(__n), __n};
@@ -187,8 +186,7 @@ public:
typedef true_type propagate_on_container_move_assignment;
typedef true_type is_always_equal;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
- allocator() _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator() _NOEXCEPT = default;
template <class _Up>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -205,7 +203,7 @@ public:
}
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr
allocation_result<const _Tp*> allocate_at_least(size_t __n) {
return {allocate(__n), __n};
@@ -264,10 +262,14 @@ template <class _Tp, class _Up>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
bool operator==(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return true;}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_INLINE_VISIBILITY
bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;}
+#endif
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___MEMORY_ALLOCATOR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/allocator_arg_t.h b/contrib/libs/cxxsupp/libcxx/include/__memory/allocator_arg_t.h
index 15f8c98c4c9..4d9c115f729 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/allocator_arg_t.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/allocator_arg_t.h
@@ -25,10 +25,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { explicit allocator_arg_t() = default; };
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
-extern _LIBCPP_EXPORTED_FROM_ABI const allocator_arg_t allocator_arg;
-#else
-/* inline */ constexpr allocator_arg_t allocator_arg = allocator_arg_t();
+#if _LIBCPP_STD_VER >= 17
+inline constexpr allocator_arg_t allocator_arg = allocator_arg_t();
+#elif !defined(_LIBCPP_CXX03_LANG)
+constexpr allocator_arg_t allocator_arg = allocator_arg_t();
#endif
#ifndef _LIBCPP_CXX03_LANG
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/allocator_traits.h b/contrib/libs/cxxsupp/libcxx/include/__memory/allocator_traits.h
index 3a23b47c74b..4658098d64c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/allocator_traits.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/allocator_traits.h
@@ -300,7 +300,7 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits
__enable_if_t<!__has_construct<allocator_type, _Tp*, _Args...>::value> >
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
static void construct(allocator_type&, _Tp* __p, _Args&&... __args) {
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_VSTD::construct_at(__p, _VSTD::forward<_Args>(__args)...);
#else
::new ((void*)__p) _Tp(_VSTD::forward<_Args>(__args)...);
@@ -319,7 +319,7 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits
__enable_if_t<!__has_destroy<allocator_type, _Tp*>::value> >
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
static void destroy(allocator_type&, _Tp* __p) {
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_VSTD::destroy_at(__p);
#else
__p->~_Tp();
@@ -401,6 +401,25 @@ struct __is_cpp17_copy_insertable<_Alloc, __enable_if_t<
: __is_cpp17_move_insertable<_Alloc>
{ };
+// ASan choices
+#ifndef _LIBCPP_HAS_NO_ASAN
+# define _LIBCPP_HAS_ASAN_CONTAINER_ANNOTATIONS_FOR_ALL_ALLOCATORS 1
+#endif
+
+#ifdef _LIBCPP_HAS_ASAN_CONTAINER_ANNOTATIONS_FOR_ALL_ALLOCATORS
+template <class _Alloc>
+struct __asan_annotate_container_with_allocator
+# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1600
+ : true_type {};
+# else
+ // TODO(LLVM-18): Remove the special-casing
+ : false_type {};
+# endif
+
+template <class _Tp>
+struct __asan_annotate_container_with_allocator<allocator<_Tp> > : true_type {};
+#endif
+
#undef _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/assume_aligned.h b/contrib/libs/cxxsupp/libcxx/include/__memory/assume_aligned.h
index a1fd2441f9a..00c2928dcce 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/assume_aligned.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/assume_aligned.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <size_t _Np, class _Tp>
[[nodiscard]]
@@ -34,12 +34,12 @@ constexpr _Tp* assume_aligned(_Tp* __ptr) {
if (is_constant_evaluated()) {
return __ptr;
} else {
- _LIBCPP_ASSERT(reinterpret_cast<uintptr_t>(__ptr) % _Np == 0, "Alignment assumption is violated");
+ _LIBCPP_ASSERT_UNCATEGORIZED(reinterpret_cast<uintptr_t>(__ptr) % _Np == 0, "Alignment assumption is violated");
return static_cast<_Tp*>(__builtin_assume_aligned(__ptr, _Np));
}
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/builtin_new_allocator.h b/contrib/libs/cxxsupp/libcxx/include/__memory/builtin_new_allocator.h
index cd1a866ca61..ab449ad2998 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/builtin_new_allocator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/builtin_new_allocator.h
@@ -28,10 +28,10 @@ struct __builtin_new_allocator {
struct __builtin_new_deleter {
typedef void* pointer_type;
- _LIBCPP_CONSTEXPR explicit __builtin_new_deleter(size_t __size, size_t __align)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __builtin_new_deleter(size_t __size, size_t __align)
: __size_(__size), __align_(__align) {}
- void operator()(void* __p) const _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI void operator()(void* __p) const _NOEXCEPT {
_VSTD::__libcpp_deallocate(__p, __size_, __align_);
}
@@ -42,25 +42,25 @@ struct __builtin_new_allocator {
typedef unique_ptr<void, __builtin_new_deleter> __holder_t;
- static __holder_t __allocate_bytes(size_t __s, size_t __align) {
+ _LIBCPP_HIDE_FROM_ABI static __holder_t __allocate_bytes(size_t __s, size_t __align) {
return __holder_t(_VSTD::__libcpp_allocate(__s, __align),
__builtin_new_deleter(__s, __align));
}
- static void __deallocate_bytes(void* __p, size_t __s,
+ _LIBCPP_HIDE_FROM_ABI static void __deallocate_bytes(void* __p, size_t __s,
size_t __align) _NOEXCEPT {
_VSTD::__libcpp_deallocate(__p, __s, __align);
}
template <class _Tp>
_LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE
- static __holder_t __allocate_type(size_t __n) {
+ _LIBCPP_HIDE_FROM_ABI static __holder_t __allocate_type(size_t __n) {
return __allocate_bytes(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
}
template <class _Tp>
_LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE
- static void __deallocate_type(void* __p, size_t __n) _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI static void __deallocate_type(void* __p, size_t __n) _NOEXCEPT {
__deallocate_bytes(__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
}
};
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/compressed_pair.h b/contrib/libs/cxxsupp/libcxx/include/__memory/compressed_pair.h
index 8093d7c9315..f24b2bac566 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/compressed_pair.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/compressed_pair.h
@@ -13,7 +13,7 @@
#include <__config>
#include <__fwd/get.h>
#include <__fwd/tuple.h>
-#include <__tuple_dir/tuple_indices.h>
+#include <__tuple/tuple_indices.h>
#include <__type_traits/decay.h>
#include <__type_traits/dependent_type.h>
#include <__type_traits/enable_if.h>
@@ -31,6 +31,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
// Tag used to default initialize one or both of the pair's elements.
@@ -46,7 +49,7 @@ struct __compressed_pair_elem {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__default_init_tag) {}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__value_init_tag) : __value_() {}
- template <class _Up, class = __enable_if_t<!is_same<__compressed_pair_elem, typename decay<_Up>::type>::value> >
+ template <class _Up, class = __enable_if_t<!is_same<__compressed_pair_elem, __decay_t<_Up> >::value> >
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
explicit __compressed_pair_elem(_Up&& __u) : __value_(std::forward<_Up>(__u)) {}
@@ -75,7 +78,7 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__default_init_tag) {}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__value_init_tag) : __value_type() {}
- template <class _Up, class = __enable_if_t<!is_same<__compressed_pair_elem, typename decay<_Up>::type>::value> >
+ template <class _Up, class = __enable_if_t<!is_same<__compressed_pair_elem, __decay_t<_Up> >::value> >
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
explicit __compressed_pair_elem(_Up&& __u) : __value_type(std::forward<_Up>(__u)) {}
@@ -174,4 +177,6 @@ void swap(__compressed_pair<_T1, _T2>& __x, __compressed_pair<_T1, _T2>& __y)
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___MEMORY_COMPRESSED_PAIR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/concepts.h b/contrib/libs/cxxsupp/libcxx/include/__memory/concepts.h
index 12d7bf85ed9..97cc3583ec9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/concepts.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/concepts.h
@@ -19,6 +19,7 @@
#include <__ranges/concepts.h>
#include <__type_traits/is_reference.h>
#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h> // TODO(modules): This should not be required
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -26,7 +27,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -62,7 +63,7 @@ concept __nothrow_forward_range =
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/construct_at.h b/contrib/libs/cxxsupp/libcxx/include/__memory/construct_at.h
index 14484dd6aa0..a032c33b47a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/construct_at.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/construct_at.h
@@ -26,26 +26,29 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
// construct_at
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, class... _Args, class = decltype(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))>
_LIBCPP_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* __location, _Args&&... __args) {
- _LIBCPP_ASSERT(__location != nullptr, "null pointer given to construct_at");
- return ::new (_VSTD::__voidify(*__location)) _Tp(_VSTD::forward<_Args>(__args)...);
+ _LIBCPP_ASSERT_UNCATEGORIZED(__location != nullptr, "null pointer given to construct_at");
+ return ::new (std::__voidify(*__location)) _Tp(std::forward<_Args>(__args)...);
}
#endif
template <class _Tp, class... _Args, class = decltype(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __construct_at(_Tp* __location, _Args&&... __args) {
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
return std::construct_at(__location, std::forward<_Args>(__args)...);
#else
- return _LIBCPP_ASSERT(__location != nullptr, "null pointer given to construct_at"),
+ return _LIBCPP_ASSERT_UNCATEGORIZED(__location != nullptr, "null pointer given to construct_at"),
::new (std::__voidify(*__location)) _Tp(std::forward<_Args>(__args)...);
#endif
}
@@ -62,16 +65,16 @@ _ForwardIterator __destroy(_ForwardIterator, _ForwardIterator);
template <class _Tp, typename enable_if<!is_array<_Tp>::value, int>::type = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void __destroy_at(_Tp* __loc) {
- _LIBCPP_ASSERT(__loc != nullptr, "null pointer given to destroy_at");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__loc != nullptr, "null pointer given to destroy_at");
__loc->~_Tp();
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, typename enable_if<is_array<_Tp>::value, int>::type = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void __destroy_at(_Tp* __loc) {
- _LIBCPP_ASSERT(__loc != nullptr, "null pointer given to destroy_at");
- _VSTD::__destroy(_VSTD::begin(*__loc), _VSTD::end(*__loc));
+ _LIBCPP_ASSERT_UNCATEGORIZED(__loc != nullptr, "null pointer given to destroy_at");
+ std::__destroy(std::begin(*__loc), std::end(*__loc));
}
#endif
@@ -79,7 +82,7 @@ template <class _ForwardIterator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
_ForwardIterator __destroy(_ForwardIterator __first, _ForwardIterator __last) {
for (; __first != __last; ++__first)
- _VSTD::__destroy_at(_VSTD::addressof(*__first));
+ std::__destroy_at(std::addressof(*__first));
return __first;
}
@@ -93,38 +96,40 @@ _BidirectionalIterator __reverse_destroy(_BidirectionalIterator __first, _Bidire
return __last;
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, enable_if_t<!is_array_v<_Tp>, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void destroy_at(_Tp* __loc) {
- _VSTD::__destroy_at(__loc);
+ std::__destroy_at(__loc);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, enable_if_t<is_array_v<_Tp>, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void destroy_at(_Tp* __loc) {
- _VSTD::__destroy_at(__loc);
+ std::__destroy_at(__loc);
}
#endif
template <class _ForwardIterator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void destroy(_ForwardIterator __first, _ForwardIterator __last) {
- (void)_VSTD::__destroy(_VSTD::move(__first), _VSTD::move(__last));
+ (void)std::__destroy(std::move(__first), std::move(__last));
}
template <class _ForwardIterator, class _Size>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
_ForwardIterator destroy_n(_ForwardIterator __first, _Size __n) {
for (; __n > 0; (void)++__first, --__n)
- _VSTD::__destroy_at(_VSTD::addressof(*__first));
+ std::__destroy_at(std::addressof(*__first));
return __first;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___MEMORY_CONSTRUCT_AT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/pointer_traits.h b/contrib/libs/cxxsupp/libcxx/include/__memory/pointer_traits.h
index c4f20def454..c33e7bd43f2 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/pointer_traits.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/pointer_traits.h
@@ -200,7 +200,7 @@ template <class _Pointer, class = __enable_if_t<
_And<is_class<_Pointer>, _IsFancyPointer<_Pointer> >::value
> >
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename decay<decltype(__to_address_helper<_Pointer>::__call(std::declval<const _Pointer&>()))>::type
+__decay_t<decltype(__to_address_helper<_Pointer>::__call(std::declval<const _Pointer&>()))>
__to_address(const _Pointer& __p) _NOEXCEPT {
return __to_address_helper<_Pointer>::__call(__p);
}
@@ -223,7 +223,7 @@ struct __to_address_helper<_Pointer, decltype((void)pointer_traits<_Pointer>::to
}
};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY constexpr
auto to_address(_Tp *__p) noexcept {
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_construct_at.h b/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_construct_at.h
index e63585d1ab6..ed800f4a75b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_construct_at.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_construct_at.h
@@ -13,7 +13,7 @@
#include <__concepts/destructible.h>
#include <__config>
#include <__iterator/incrementable_traits.h>
-#include <__iterator/readable_traits.h>
+#include <__iterator/iterator_traits.h>
#include <__memory/concepts.h>
#include <__memory/construct_at.h>
#include <__ranges/access.h>
@@ -28,9 +28,12 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
// construct_at
@@ -118,8 +121,10 @@ inline namespace __cpo {
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___MEMORY_RANGES_CONSTRUCT_AT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_uninitialized_algorithms.h b/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_uninitialized_algorithms.h
index 15c78e20baf..01c3e01003d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_uninitialized_algorithms.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_uninitialized_algorithms.h
@@ -33,7 +33,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -45,7 +45,7 @@ struct __fn {
template <__nothrow_forward_iterator _ForwardIterator,
__nothrow_sentinel_for<_ForwardIterator> _Sentinel>
requires default_initializable<iter_value_t<_ForwardIterator>>
- _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last) const {
+ _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last) const {
using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
return _VSTD::__uninitialized_default_construct<_ValueType>(
_VSTD::move(__first), _VSTD::move(__last));
@@ -53,7 +53,7 @@ struct __fn {
template <__nothrow_forward_range _ForwardRange>
requires default_initializable<range_value_t<_ForwardRange>>
- borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range) const {
+ _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range) const {
return (*this)(ranges::begin(__range), ranges::end(__range));
}
};
@@ -71,7 +71,7 @@ namespace __uninitialized_default_construct_n {
struct __fn {
template <__nothrow_forward_iterator _ForwardIterator>
requires default_initializable<iter_value_t<_ForwardIterator>>
- _ForwardIterator operator()(_ForwardIterator __first,
+ _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first,
iter_difference_t<_ForwardIterator> __n) const {
using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
return _VSTD::__uninitialized_default_construct_n<_ValueType>(_VSTD::move(__first), __n);
@@ -92,7 +92,7 @@ struct __fn {
template <__nothrow_forward_iterator _ForwardIterator,
__nothrow_sentinel_for<_ForwardIterator> _Sentinel>
requires default_initializable<iter_value_t<_ForwardIterator>>
- _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last) const {
+ _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last) const {
using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
return _VSTD::__uninitialized_value_construct<_ValueType>(
_VSTD::move(__first), _VSTD::move(__last));
@@ -100,7 +100,7 @@ struct __fn {
template <__nothrow_forward_range _ForwardRange>
requires default_initializable<range_value_t<_ForwardRange>>
- borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range) const {
+ _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range) const {
return (*this)(ranges::begin(__range), ranges::end(__range));
}
};
@@ -118,7 +118,7 @@ namespace __uninitialized_value_construct_n {
struct __fn {
template <__nothrow_forward_iterator _ForwardIterator>
requires default_initializable<iter_value_t<_ForwardIterator>>
- _ForwardIterator operator()(_ForwardIterator __first,
+ _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first,
iter_difference_t<_ForwardIterator> __n) const {
using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
return _VSTD::__uninitialized_value_construct_n<_ValueType>(_VSTD::move(__first), __n);
@@ -140,14 +140,14 @@ struct __fn {
__nothrow_sentinel_for<_ForwardIterator> _Sentinel,
class _Tp>
requires constructible_from<iter_value_t<_ForwardIterator>, const _Tp&>
- _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last, const _Tp& __x) const {
+ _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last, const _Tp& __x) const {
using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
return _VSTD::__uninitialized_fill<_ValueType>(_VSTD::move(__first), _VSTD::move(__last), __x);
}
template <__nothrow_forward_range _ForwardRange, class _Tp>
requires constructible_from<range_value_t<_ForwardRange>, const _Tp&>
- borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range, const _Tp& __x) const {
+ _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range, const _Tp& __x) const {
return (*this)(ranges::begin(__range), ranges::end(__range), __x);
}
};
@@ -165,7 +165,7 @@ namespace __uninitialized_fill_n {
struct __fn {
template <__nothrow_forward_iterator _ForwardIterator, class _Tp>
requires constructible_from<iter_value_t<_ForwardIterator>, const _Tp&>
- _ForwardIterator operator()(_ForwardIterator __first,
+ _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first,
iter_difference_t<_ForwardIterator> __n,
const _Tp& __x) const {
using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
@@ -192,7 +192,7 @@ struct __fn {
__nothrow_forward_iterator _OutputIterator,
__nothrow_sentinel_for<_OutputIterator> _Sentinel2>
requires constructible_from<iter_value_t<_OutputIterator>, iter_reference_t<_InputIterator>>
- uninitialized_copy_result<_InputIterator, _OutputIterator>
+ _LIBCPP_HIDE_FROM_ABI uninitialized_copy_result<_InputIterator, _OutputIterator>
operator()(_InputIterator __ifirst, _Sentinel1 __ilast, _OutputIterator __ofirst, _Sentinel2 __olast) const {
using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;
@@ -203,7 +203,7 @@ struct __fn {
template <input_range _InputRange, __nothrow_forward_range _OutputRange>
requires constructible_from<range_value_t<_OutputRange>, range_reference_t<_InputRange>>
- uninitialized_copy_result<borrowed_iterator_t<_InputRange>, borrowed_iterator_t<_OutputRange>>
+ _LIBCPP_HIDE_FROM_ABI uninitialized_copy_result<borrowed_iterator_t<_InputRange>, borrowed_iterator_t<_OutputRange>>
operator()( _InputRange&& __in_range, _OutputRange&& __out_range) const {
return (*this)(ranges::begin(__in_range), ranges::end(__in_range),
ranges::begin(__out_range), ranges::end(__out_range));
@@ -228,7 +228,7 @@ struct __fn {
__nothrow_forward_iterator _OutputIterator,
__nothrow_sentinel_for<_OutputIterator> _Sentinel>
requires constructible_from<iter_value_t<_OutputIterator>, iter_reference_t<_InputIterator>>
- uninitialized_copy_n_result<_InputIterator, _OutputIterator>
+ _LIBCPP_HIDE_FROM_ABI uninitialized_copy_n_result<_InputIterator, _OutputIterator>
operator()(_InputIterator __ifirst, iter_difference_t<_InputIterator> __n,
_OutputIterator __ofirst, _Sentinel __olast) const {
using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;
@@ -257,7 +257,7 @@ struct __fn {
__nothrow_forward_iterator _OutputIterator,
__nothrow_sentinel_for<_OutputIterator> _Sentinel2>
requires constructible_from<iter_value_t<_OutputIterator>, iter_rvalue_reference_t<_InputIterator>>
- uninitialized_move_result<_InputIterator, _OutputIterator>
+ _LIBCPP_HIDE_FROM_ABI uninitialized_move_result<_InputIterator, _OutputIterator>
operator()(_InputIterator __ifirst, _Sentinel1 __ilast, _OutputIterator __ofirst, _Sentinel2 __olast) const {
using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;
auto __iter_move = [](auto&& __iter) -> decltype(auto) { return ranges::iter_move(__iter); };
@@ -268,7 +268,7 @@ struct __fn {
template <input_range _InputRange, __nothrow_forward_range _OutputRange>
requires constructible_from<range_value_t<_OutputRange>, range_rvalue_reference_t<_InputRange>>
- uninitialized_move_result<borrowed_iterator_t<_InputRange>, borrowed_iterator_t<_OutputRange>>
+ _LIBCPP_HIDE_FROM_ABI uninitialized_move_result<borrowed_iterator_t<_InputRange>, borrowed_iterator_t<_OutputRange>>
operator()(_InputRange&& __in_range, _OutputRange&& __out_range) const {
return (*this)(ranges::begin(__in_range), ranges::end(__in_range),
ranges::begin(__out_range), ranges::end(__out_range));
@@ -293,7 +293,7 @@ struct __fn {
__nothrow_forward_iterator _OutputIterator,
__nothrow_sentinel_for<_OutputIterator> _Sentinel>
requires constructible_from<iter_value_t<_OutputIterator>, iter_rvalue_reference_t<_InputIterator>>
- uninitialized_move_n_result<_InputIterator, _OutputIterator>
+ _LIBCPP_HIDE_FROM_ABI uninitialized_move_n_result<_InputIterator, _OutputIterator>
operator()(_InputIterator __ifirst, iter_difference_t<_InputIterator> __n,
_OutputIterator __ofirst, _Sentinel __olast) const {
using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;
@@ -312,7 +312,7 @@ inline namespace __cpo {
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/raw_storage_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__memory/raw_storage_iterator.h
index 11971de0fa4..df7ef5afe7d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/raw_storage_iterator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/raw_storage_iterator.h
@@ -39,7 +39,7 @@ private:
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef ptrdiff_t difference_type;
#else
typedef void difference_type;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/shared_ptr.h b/contrib/libs/cxxsupp/libcxx/include/__memory/shared_ptr.h
index 46c0534c3d6..d8395dc735f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/shared_ptr.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/shared_ptr.h
@@ -29,11 +29,26 @@
#include <__memory/pointer_traits.h>
#include <__memory/uninitialized_algorithms.h>
#include <__memory/unique_ptr.h>
+#include <__type_traits/add_lvalue_reference.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/conjunction.h>
+#include <__type_traits/disjunction.h>
+#include <__type_traits/is_array.h>
+#include <__type_traits/is_bounded_array.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_move_constructible.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/is_unbounded_array.h>
+#include <__type_traits/nat.h>
+#include <__type_traits/negation.h>
+#include <__type_traits/remove_extent.h>
+#include <__type_traits/remove_reference.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/swap.h>
+#include <__verbose_abort>
#include <cstddef>
-#include <cstdlib> // abort
#include <iosfwd>
#include <new>
#include <stdexcept>
@@ -105,12 +120,12 @@ __libcpp_atomic_refcount_decrement(_Tp& __t) _NOEXCEPT
#endif
}
-class _LIBCPP_EXCEPTION_ABI bad_weak_ptr
+class _LIBCPP_EXPORTED_FROM_ABI bad_weak_ptr
: public std::exception
{
public:
- bad_weak_ptr() _NOEXCEPT = default;
- bad_weak_ptr(const bad_weak_ptr&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI bad_weak_ptr() _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI bad_weak_ptr(const bad_weak_ptr&) _NOEXCEPT = default;
~bad_weak_ptr() _NOEXCEPT override;
const char* what() const _NOEXCEPT override;
};
@@ -118,16 +133,16 @@ public:
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_weak_ptr()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_weak_ptr();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_weak_ptr was thrown in -fno-exceptions mode");
#endif
}
template<class _Tp> class _LIBCPP_TEMPLATE_VIS weak_ptr;
-class _LIBCPP_TYPE_VIS __shared_count
+class _LIBCPP_EXPORTED_FROM_ABI __shared_count
{
__shared_count(const __shared_count&);
__shared_count& operator=(const __shared_count&);
@@ -183,7 +198,7 @@ public:
}
};
-class _LIBCPP_TYPE_VIS __shared_weak_count
+class _LIBCPP_EXPORTED_FROM_ABI __shared_weak_count
: private __shared_count
{
#ifdef _LIBCPP_HAS_NO_THREADS
@@ -246,12 +261,12 @@ public:
: __data_(__compressed_pair<_Tp, _Dp>(__p, _VSTD::move(__d)), _VSTD::move(__a)) {}
#ifndef _LIBCPP_HAS_NO_RTTI
- const void* __get_deleter(const type_info&) const _NOEXCEPT override;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL const void* __get_deleter(const type_info&) const _NOEXCEPT override;
#endif
private:
- void __on_zero_shared() _NOEXCEPT override;
- void __on_zero_shared_weak() _NOEXCEPT override;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override;
};
#ifndef _LIBCPP_HAS_NO_RTTI
@@ -321,8 +336,8 @@ struct __shared_ptr_emplace
_Tp* __get_elem() _NOEXCEPT { return __storage_.__get_elem(); }
private:
- void __on_zero_shared() _NOEXCEPT override {
-#if _LIBCPP_STD_VER > 17
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override {
+#if _LIBCPP_STD_VER >= 20
if constexpr (is_same_v<typename _Alloc::value_type, __for_overwrite_tag>) {
__get_elem()->~_Tp();
} else {
@@ -335,7 +350,7 @@ private:
#endif
}
- void __on_zero_shared_weak() _NOEXCEPT override {
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override {
using _ControlBlockAlloc = typename __allocator_traits_rebind<_Alloc, __shared_ptr_emplace>::type;
using _ControlBlockPointer = typename allocator_traits<_ControlBlockAlloc>::pointer;
_ControlBlockAlloc __tmp(*__get_alloc());
@@ -362,13 +377,13 @@ private:
_LIBCPP_HIDE_FROM_ABI ~_Storage() {
__get_alloc()->~_Alloc();
}
- _Alloc* __get_alloc() _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI _Alloc* __get_alloc() _NOEXCEPT {
_CompressedPair *__as_pair = reinterpret_cast<_CompressedPair*>(__blob_);
typename _CompressedPair::_Base1* __first = _CompressedPair::__get_first_base(__as_pair);
_Alloc *__alloc = reinterpret_cast<_Alloc*>(__first);
return __alloc;
}
- _LIBCPP_NO_CFI _Tp* __get_elem() _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _Tp* __get_elem() _NOEXCEPT {
_CompressedPair *__as_pair = reinterpret_cast<_CompressedPair*>(__blob_);
typename _CompressedPair::_Base2* __second = _CompressedPair::__get_second_base(__as_pair);
_Tp *__elem = reinterpret_cast<_Tp*>(__second);
@@ -459,10 +474,10 @@ struct __is_array_deletable<_Ptr, decltype(delete[] std::declval<_Ptr>())> : tru
template <class _Dp, class _Pt,
class = decltype(std::declval<_Dp>()(std::declval<_Pt>()))>
-static true_type __well_formed_deleter_test(int);
+true_type __well_formed_deleter_test(int);
template <class, class>
-static false_type __well_formed_deleter_test(...);
+false_type __well_formed_deleter_test(...);
template <class _Dp, class _Pt>
struct __well_formed_deleter : decltype(std::__well_formed_deleter_test<_Dp, _Pt>(0)) {};
@@ -476,7 +491,7 @@ struct __shared_ptr_deleter_ctor_reqs
};
#if defined(_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI)
-# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI __attribute__((trivial_abi))
+# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI __attribute__((__trivial_abi__))
#else
# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI
#endif
@@ -485,7 +500,7 @@ template<class _Tp>
class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
{
public:
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef weak_ptr<_Tp> weak_type;
typedef remove_extent_t<_Tp> element_type;
#else
@@ -520,7 +535,7 @@ public:
#endif
>::value
> >
- explicit shared_ptr(_Yp* __p) : __ptr_(__p) {
+ _LIBCPP_HIDE_FROM_ABI explicit shared_ptr(_Yp* __p) : __ptr_(__p) {
unique_ptr<_Yp> __hold(__p);
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
typedef __shared_ptr_pointer<_Yp*, __shared_ptr_default_delete<_Tp, _Yp>, _AllocT> _CntrlBlk;
@@ -534,10 +549,10 @@ public:
shared_ptr(_Yp* __p, _Dp __d)
: __ptr_(__p)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT> _CntrlBlk;
#ifndef _LIBCPP_CXX03_LANG
@@ -546,14 +561,14 @@ public:
__cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
#endif // not _LIBCPP_CXX03_LANG
__enable_weak_this(__p, __p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__d(__p);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Yp, class _Dp, class _Alloc, class = __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value> >
@@ -561,10 +576,10 @@ public:
shared_ptr(_Yp* __p, _Dp __d, _Alloc __a)
: __ptr_(__p)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef __shared_ptr_pointer<_Yp*, _Dp, _Alloc> _CntrlBlk;
typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
typedef __allocator_destructor<_A2> _D2;
@@ -578,14 +593,14 @@ public:
#endif // not _LIBCPP_CXX03_LANG
__cntrl_ = _VSTD::addressof(*__hold2.release());
__enable_weak_this(__p, __p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__d(__p);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Dp>
@@ -593,10 +608,10 @@ public:
shared_ptr(nullptr_t __p, _Dp __d)
: __ptr_(nullptr)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT;
typedef __shared_ptr_pointer<nullptr_t, _Dp, _AllocT> _CntrlBlk;
#ifndef _LIBCPP_CXX03_LANG
@@ -604,14 +619,14 @@ public:
#else
__cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
#endif // not _LIBCPP_CXX03_LANG
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__d(__p);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Dp, class _Alloc>
@@ -619,10 +634,10 @@ public:
shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)
: __ptr_(nullptr)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef __shared_ptr_pointer<nullptr_t, _Dp, _Alloc> _CntrlBlk;
typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
typedef __allocator_destructor<_A2> _D2;
@@ -635,14 +650,14 @@ public:
_CntrlBlk(__p, __d, __a);
#endif // not _LIBCPP_CXX03_LANG
__cntrl_ = _VSTD::addressof(*__hold2.release());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__d(__p);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Yp>
@@ -655,6 +670,18 @@ public:
__cntrl_->__add_shared();
}
+// LWG-2996
+// We don't backport because it is an evolutionary change.
+#if _LIBCPP_STD_VER >= 20
+ template <class _Yp>
+ _LIBCPP_HIDE_FROM_ABI shared_ptr(shared_ptr<_Yp>&& __r, element_type* __p) noexcept
+ : __ptr_(__p),
+ __cntrl_(__r.__cntrl_) {
+ __r.__ptr_ = nullptr;
+ __r.__cntrl_ = nullptr;
+ }
+#endif
+
_LIBCPP_HIDE_FROM_ABI
shared_ptr(const shared_ptr& __r) _NOEXCEPT
: __ptr_(__r.__ptr_),
@@ -725,7 +752,7 @@ public:
shared_ptr(unique_ptr<_Yp, _Dp>&& __r)
: __ptr_(__r.get())
{
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
if (__ptr_ == nullptr)
__cntrl_ = nullptr;
else
@@ -748,7 +775,7 @@ public:
shared_ptr(unique_ptr<_Yp, _Dp>&& __r)
: __ptr_(__r.get())
{
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
if (__ptr_ == nullptr)
__cntrl_ = nullptr;
else
@@ -921,7 +948,7 @@ public:
return __cntrl_ == __p.__cntrl_;
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_HIDE_FROM_ABI
__add_lvalue_reference_t<element_type> operator[](ptrdiff_t __i) const
{
@@ -1001,7 +1028,7 @@ private:
template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Tp>
shared_ptr(weak_ptr<_Tp>) -> shared_ptr<_Tp>;
template<class _Tp, class _Dp>
@@ -1050,7 +1077,7 @@ shared_ptr<_Tp> make_shared_for_overwrite()
#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <size_t _Alignment>
struct __sp_aligned_storage {
@@ -1110,7 +1137,7 @@ struct __unbounded_array_control_block<_Tp[], _Alloc> : __shared_weak_count
~__unbounded_array_control_block() override { } // can't be `= default` because of the sometimes-non-trivial union member __data_
private:
- void __on_zero_shared() _NOEXCEPT override {
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override {
#if _LIBCPP_STD_VER >= 20
if constexpr (is_same_v<typename _Alloc::value_type, __for_overwrite_tag>) {
std::__reverse_destroy(__data_, __data_ + __count_);
@@ -1124,7 +1151,7 @@ private:
#endif
}
- void __on_zero_shared_weak() _NOEXCEPT override {
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override {
using _AlignedStorage = __sp_aligned_storage<alignof(__unbounded_array_control_block)>;
using _StorageAlloc = __allocator_traits_rebind_t<_Alloc, _AlignedStorage>;
using _PointerTraits = pointer_traits<typename allocator_traits<_StorageAlloc>::pointer>;
@@ -1133,7 +1160,8 @@ private:
__alloc_.~_Alloc();
size_t __size = __unbounded_array_control_block::__bytes_for(__count_);
_AlignedStorage* __storage = reinterpret_cast<_AlignedStorage*>(this);
- allocator_traits<_StorageAlloc>::deallocate(__tmp, _PointerTraits::pointer_to(*__storage), __size);
+ allocator_traits<_StorageAlloc>::deallocate(
+ __tmp, _PointerTraits::pointer_to(*__storage), __size / sizeof(_AlignedStorage));
}
_LIBCPP_NO_UNIQUE_ADDRESS _Alloc __alloc_;
@@ -1196,7 +1224,7 @@ struct __bounded_array_control_block<_Tp[_Count], _Alloc>
~__bounded_array_control_block() override { } // can't be `= default` because of the sometimes-non-trivial union member __data_
private:
- void __on_zero_shared() _NOEXCEPT override {
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override {
#if _LIBCPP_STD_VER >= 20
if constexpr (is_same_v<typename _Alloc::value_type, __for_overwrite_tag>) {
std::__reverse_destroy(__data_, __data_ + _Count);
@@ -1210,13 +1238,13 @@ private:
#endif
}
- void __on_zero_shared_weak() _NOEXCEPT override {
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override {
using _ControlBlockAlloc = __allocator_traits_rebind_t<_Alloc, __bounded_array_control_block>;
using _PointerTraits = pointer_traits<typename allocator_traits<_ControlBlockAlloc>::pointer>;
_ControlBlockAlloc __tmp(__alloc_);
__alloc_.~_Alloc();
- allocator_traits<_ControlBlockAlloc>::deallocate(__tmp, _PointerTraits::pointer_to(*this), sizeof(*this));
+ allocator_traits<_ControlBlockAlloc>::deallocate(__tmp, _PointerTraits::pointer_to(*this), 1);
}
_LIBCPP_NO_UNIQUE_ADDRESS _Alloc __alloc_;
@@ -1240,9 +1268,9 @@ shared_ptr<_Array> __allocate_shared_bounded_array(const _Alloc& __a, _Arg&& ...
return shared_ptr<_Array>::__create_with_control_block(__control_block->__get_data(), __control_block);
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// bounded array variants
template<class _Tp, class _Alloc, class = __enable_if_t<is_bounded_array<_Tp>::value>>
@@ -1334,7 +1362,7 @@ shared_ptr<_Tp> make_shared_for_overwrite(size_t __n)
return std::__allocate_shared_unbounded_array<_Tp>(allocator<__for_overwrite_tag>(), __n);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template<class _Tp, class _Up>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1394,7 +1422,7 @@ operator>=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
#endif // _LIBCPP_STD_VER <= 17
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Tp, class _Up>
_LIBCPP_HIDE_FROM_ABI strong_ordering
operator<=>(shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) noexcept
@@ -1503,7 +1531,7 @@ operator>=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
#endif // _LIBCPP_STD_VER <= 17
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Tp>
_LIBCPP_HIDE_FROM_ABI strong_ordering
operator<=>(shared_ptr<_Tp> const& __x, nullptr_t) noexcept
@@ -1530,6 +1558,15 @@ static_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
typename shared_ptr<_Tp>::element_type*>(__r.get()));
}
+// LWG-2996
+// We don't backport because it is an evolutionary change.
+#if _LIBCPP_STD_VER >= 20
+template <class _Tp, class _Up>
+_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> static_pointer_cast(shared_ptr<_Up>&& __r) noexcept {
+ return shared_ptr<_Tp>(std::move(__r), static_cast<typename shared_ptr<_Tp>::element_type*>(__r.get()));
+}
+#endif
+
template<class _Tp, class _Up>
inline _LIBCPP_INLINE_VISIBILITY
shared_ptr<_Tp>
@@ -1540,6 +1577,16 @@ dynamic_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
return __p ? shared_ptr<_Tp>(__r, __p) : shared_ptr<_Tp>();
}
+// LWG-2996
+// We don't backport because it is an evolutionary change.
+#if _LIBCPP_STD_VER >= 20
+template <class _Tp, class _Up>
+_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> dynamic_pointer_cast(shared_ptr<_Up>&& __r) noexcept {
+ auto* __p = dynamic_cast<typename shared_ptr<_Tp>::element_type*>(__r.get());
+ return __p ? shared_ptr<_Tp>(std::move(__r), __p) : shared_ptr<_Tp>();
+}
+#endif
+
template<class _Tp, class _Up>
_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp>
const_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
@@ -1548,6 +1595,15 @@ const_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
return shared_ptr<_Tp>(__r, const_cast<_RTp*>(__r.get()));
}
+// LWG-2996
+// We don't backport because it is an evolutionary change.
+#if _LIBCPP_STD_VER >= 20
+template <class _Tp, class _Up>
+_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> const_pointer_cast(shared_ptr<_Up>&& __r) noexcept {
+ return shared_ptr<_Tp>(std::move(__r), const_cast<typename shared_ptr<_Tp>::element_type*>(__r.get()));
+}
+#endif
+
template<class _Tp, class _Up>
_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp>
reinterpret_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
@@ -1557,6 +1613,15 @@ reinterpret_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
typename shared_ptr<_Tp>::element_type*>(__r.get()));
}
+// LWG-2996
+// We don't backport because it is an evolutionary change.
+#if _LIBCPP_STD_VER >= 20
+template <class _Tp, class _Up>
+_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> reinterpret_pointer_cast(shared_ptr<_Up>&& __r) noexcept {
+ return shared_ptr<_Tp>(std::move(__r), reinterpret_cast<typename shared_ptr<_Tp>::element_type*>(__r.get()));
+}
+#endif
+
#ifndef _LIBCPP_HAS_NO_RTTI
template<class _Dp, class _Tp>
@@ -1573,7 +1638,7 @@ template<class _Tp>
class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr
{
public:
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef remove_extent_t<_Tp> element_type;
#else
typedef _Tp element_type;
@@ -1600,7 +1665,7 @@ public:
template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r,
typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type = 0)
_NOEXCEPT;
- ~weak_ptr();
+ _LIBCPP_HIDE_FROM_ABI ~weak_ptr();
_LIBCPP_INLINE_VISIBILITY
weak_ptr& operator=(weak_ptr const& __r) _NOEXCEPT;
@@ -1644,7 +1709,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
bool expired() const _NOEXCEPT
{return __cntrl_ == nullptr || __cntrl_->use_count() == 0;}
- shared_ptr<_Tp> lock() const _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> lock() const _NOEXCEPT;
template<class _Up>
_LIBCPP_INLINE_VISIBILITY
bool owner_before(const shared_ptr<_Up>& __r) const _NOEXCEPT
@@ -1658,7 +1723,7 @@ public:
template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Tp>
weak_ptr(shared_ptr<_Tp>) -> weak_ptr<_Tp>;
#endif
@@ -1834,7 +1899,7 @@ weak_ptr<_Tp>::lock() const _NOEXCEPT
return __r;
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp = void> struct owner_less;
#else
template <class _Tp> struct owner_less;
@@ -1871,7 +1936,7 @@ struct _LIBCPP_TEMPLATE_VIS owner_less<weak_ptr<_Tp> >
{return __x.owner_before(__y);}
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <>
struct _LIBCPP_TEMPLATE_VIS owner_less<void>
{
@@ -1917,7 +1982,7 @@ public:
shared_ptr<_Tp const> shared_from_this() const
{return shared_ptr<const _Tp>(__weak_this_);}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
weak_ptr<_Tp> weak_from_this() _NOEXCEPT
{ return __weak_this_; }
@@ -1925,7 +1990,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
weak_ptr<const _Tp> weak_from_this() const _NOEXCEPT
{ return __weak_this_; }
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
template <class _Up> friend class shared_ptr;
};
@@ -1955,7 +2020,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
#if !defined(_LIBCPP_HAS_NO_THREADS)
-class _LIBCPP_TYPE_VIS __sp_mut
+class _LIBCPP_EXPORTED_FROM_ABI __sp_mut
{
void* __lx_;
public:
@@ -1967,10 +2032,10 @@ private:
__sp_mut(const __sp_mut&);
__sp_mut& operator=(const __sp_mut&);
- friend _LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
+ friend _LIBCPP_EXPORTED_FROM_ABI __sp_mut& __get_sp_mut(const void*);
};
-_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
__sp_mut& __get_sp_mut(const void*);
template <class _Tp>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/swap_allocator.h b/contrib/libs/cxxsupp/libcxx/include/__memory/swap_allocator.h
index c6e1751f4dd..90851cb79cf 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/swap_allocator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/swap_allocator.h
@@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <typename _Alloc>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __swap_allocator(_Alloc& __a1, _Alloc& __a2, true_type)
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_NOEXCEPT
#else
_NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
@@ -39,7 +39,7 @@ __swap_allocator(_Alloc&, _Alloc&, false_type) _NOEXCEPT {}
template <typename _Alloc>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __swap_allocator(_Alloc& __a1, _Alloc& __a2)
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_NOEXCEPT
#else
_NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/temp_value.h b/contrib/libs/cxxsupp/libcxx/include/__memory/temp_value.h
index 164688b15f8..3ce8b4bcbb3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/temp_value.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/temp_value.h
@@ -32,7 +32,7 @@ struct __temp_value {
#endif
_Alloc &__a;
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp *__addr() {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp *__addr() {
#ifdef _LIBCPP_CXX03_LANG
return reinterpret_cast<_Tp*>(std::addressof(__v));
#else
@@ -40,15 +40,15 @@ struct __temp_value {
#endif
}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp & get() { return *__addr(); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp & get() { return *__addr(); }
template<class... _Args>
- _LIBCPP_NO_CFI
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI
_LIBCPP_CONSTEXPR_SINCE_CXX20 __temp_value(_Alloc &__alloc, _Args&& ... __args) : __a(__alloc) {
_Traits::construct(__a, __addr(), std::forward<_Args>(__args)...);
}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__temp_value() { _Traits::destroy(__a, __addr()); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__temp_value() { _Traits::destroy(__a, __addr()); }
};
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/uninitialized_algorithms.h b/contrib/libs/cxxsupp/libcxx/include/__memory/uninitialized_algorithms.h
index fa4881e0be9..058ff463b49 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/uninitialized_algorithms.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/uninitialized_algorithms.h
@@ -12,6 +12,8 @@
#include <__algorithm/copy.h>
#include <__algorithm/move.h>
+#include <__algorithm/unwrap_iter.h>
+#include <__algorithm/unwrap_range.h>
#include <__config>
#include <__iterator/iterator_traits.h>
#include <__iterator/reverse_iterator.h>
@@ -58,12 +60,12 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
__uninitialized_copy(_InputIterator __ifirst, _Sentinel1 __ilast,
_ForwardIterator __ofirst, _Sentinel2 __olast) {
_ForwardIterator __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __ifirst != __ilast && __idx != __olast; ++__ifirst, (void)++__idx)
::new (_VSTD::__voidify(*__idx)) _ValueType(*__ifirst);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__ofirst, __idx);
throw;
@@ -90,12 +92,12 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
__uninitialized_copy_n(_InputIterator __ifirst, _Size __n,
_ForwardIterator __ofirst, _Sentinel __olast) {
_ForwardIterator __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __n > 0 && __idx != __olast; ++__ifirst, (void)++__idx, (void)--__n)
::new (_VSTD::__voidify(*__idx)) _ValueType(*__ifirst);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__ofirst, __idx);
throw;
@@ -121,13 +123,13 @@ inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_fill(_ForwardIterator __first, _Sentinel __last, const _Tp& __x)
{
_ForwardIterator __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
for (; __idx != __last; ++__idx)
::new (_VSTD::__voidify(*__idx)) _ValueType(__x);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -154,13 +156,13 @@ inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
{
_ForwardIterator __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
for (; __n > 0; ++__idx, (void) --__n)
::new (_VSTD::__voidify(*__idx)) _ValueType(__x);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -180,7 +182,7 @@ _ForwardIterator uninitialized_fill_n(_ForwardIterator __first, _Size __n, const
return _VSTD::__uninitialized_fill_n<_ValueType>(__first, __n, __x);
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
// uninitialized_default_construct
@@ -188,12 +190,12 @@ template <class _ValueType, class _ForwardIterator, class _Sentinel>
inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_default_construct(_ForwardIterator __first, _Sentinel __last) {
auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __idx != __last; ++__idx)
::new (_VSTD::__voidify(*__idx)) _ValueType;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__first, __idx);
throw;
@@ -217,12 +219,12 @@ template <class _ValueType, class _ForwardIterator, class _Size>
inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __n > 0; ++__idx, (void) --__n)
::new (_VSTD::__voidify(*__idx)) _ValueType;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__first, __idx);
throw;
@@ -245,12 +247,12 @@ template <class _ValueType, class _ForwardIterator, class _Sentinel>
inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_value_construct(_ForwardIterator __first, _Sentinel __last) {
auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __idx != __last; ++__idx)
::new (_VSTD::__voidify(*__idx)) _ValueType();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__first, __idx);
throw;
@@ -274,12 +276,12 @@ template <class _ValueType, class _ForwardIterator, class _Size>
inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __n > 0; ++__idx, (void) --__n)
::new (_VSTD::__voidify(*__idx)) _ValueType();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__first, __idx);
throw;
@@ -304,13 +306,13 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
__uninitialized_move(_InputIterator __ifirst, _Sentinel1 __ilast,
_ForwardIterator __ofirst, _Sentinel2 __olast, _IterMove __iter_move) {
auto __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __ifirst != __ilast && __idx != __olast; ++__idx, (void)++__ifirst) {
::new (_VSTD::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__ofirst, __idx);
throw;
@@ -338,12 +340,12 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
__uninitialized_move_n(_InputIterator __ifirst, _Size __n,
_ForwardIterator __ofirst, _Sentinel __olast, _IterMove __iter_move) {
auto __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __n > 0 && __idx != __olast; ++__idx, (void)++__ifirst, --__n)
::new (_VSTD::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__ofirst, __idx);
throw;
@@ -371,7 +373,7 @@ uninitialized_move_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __ofir
// This function assumes that destructors do not throw, and that the allocator is bound to
// the correct type.
template<class _Alloc, class _BidirIter, class = __enable_if_t<
- __is_cpp17_bidirectional_iterator<_BidirIter>::value
+ __has_bidirectional_iterator_category<_BidirIter>::value
>>
_LIBCPP_HIDE_FROM_ABI
constexpr void __allocator_destroy_multidimensional(_Alloc& __alloc, _BidirIter __first, _BidirIter __last) noexcept {
@@ -512,7 +514,7 @@ __uninitialized_allocator_value_construct_n_multidimensional(_Alloc& __alloc, _B
__guard.__complete();
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
// Destroy all elements in [__first, __last) from left to right using allocator destruction.
template <class _Alloc, class _Iter, class _Sent>
@@ -545,7 +547,7 @@ private:
// already copied elements are destroyed in reverse order of their construction.
template <class _Alloc, class _Iter1, class _Sent1, class _Iter2>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter2
-__uninitialized_allocator_copy(_Alloc& __alloc, _Iter1 __first1, _Sent1 __last1, _Iter2 __first2) {
+__uninitialized_allocator_copy_impl(_Alloc& __alloc, _Iter1 __first1, _Sent1 __last1, _Iter2 __first2) {
auto __destruct_first = __first2;
auto __guard =
std::__make_exception_guard(_AllocatorDestroyRangeReverse<_Alloc, _Iter2>(__alloc, __destruct_first, __first2));
@@ -566,14 +568,16 @@ struct __allocator_has_trivial_copy_construct<allocator<_Type>, _Type> : true_ty
#ifndef __CUDACC__
template <class _Alloc,
- class _Type,
- class _RawType = __remove_const_t<_Type>,
+ class _In,
+ class _RawTypeIn = __remove_const_t<_In>,
+ class _Out,
__enable_if_t<
- // using _RawType because of the allocator<T const> extension
- is_trivially_copy_constructible<_RawType>::value && is_trivially_copy_assignable<_RawType>::value &&
- __allocator_has_trivial_copy_construct<_Alloc, _RawType>::value>* = nullptr>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Type*
-__uninitialized_allocator_copy(_Alloc&, const _Type* __first1, const _Type* __last1, _Type* __first2) {
+ // using _RawTypeIn because of the allocator<T const> extension
+ is_trivially_copy_constructible<_RawTypeIn>::value && is_trivially_copy_assignable<_RawTypeIn>::value &&
+ is_same<__remove_const_t<_In>, __remove_const_t<_Out> >::value &&
+ __allocator_has_trivial_copy_construct<_Alloc, _RawTypeIn>::value>* = nullptr>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Out*
+__uninitialized_allocator_copy_impl(_Alloc&, _In* __first1, _In* __last1, _Out* __first2) {
// TODO: Remove the const_cast once we drop support for std::allocator<T const>
if (__libcpp_is_constant_evaluated()) {
while (__first1 != __last1) {
@@ -583,10 +587,17 @@ __uninitialized_allocator_copy(_Alloc&, const _Type* __first1, const _Type* __la
}
return __first2;
} else {
- return std::copy(__first1, __last1, const_cast<_RawType*>(__first2));
+ return std::copy(__first1, __last1, const_cast<_RawTypeIn*>(__first2));
}
}
-#endif // !__CUDACC__
+#endif // __CUDACC__
+
+template <class _Alloc, class _Iter1, class _Sent1, class _Iter2>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter2 __uninitialized_allocator_copy(_Alloc& __alloc, _Iter1 __first1, _Sent1 __last1, _Iter2 __first2) {
+ auto __unwrapped_range = std::__unwrap_range(__first1, __last1);
+ auto __result = std::__uninitialized_allocator_copy_impl(__alloc, __unwrapped_range.first, __unwrapped_range.second, std::__unwrap_iter(__first2));
+ return std::__rewrap_iter(__first2, __result);
+}
// Move-construct the elements [__first1, __last1) into [__first2, __first2 + N)
// if the move constructor is noexcept, where N is distance(__first1, __last1).
@@ -602,7 +613,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter2 __uninitialized_alloc
auto __guard =
std::__make_exception_guard(_AllocatorDestroyRangeReverse<_Alloc, _Iter2>(__alloc, __destruct_first, __first2));
while (__first1 != __last1) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
allocator_traits<_Alloc>::construct(__alloc, std::__to_address(__first2), std::move_if_noexcept(*__first1));
#else
allocator_traits<_Alloc>::construct(__alloc, std::__to_address(__first2), std::move(*__first1));
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/unique_ptr.h b/contrib/libs/cxxsupp/libcxx/include/__memory/unique_ptr.h
index 333691f7158..e554d1a857f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/unique_ptr.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/unique_ptr.h
@@ -45,6 +45,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
@@ -116,7 +119,7 @@ struct __unique_ptr_deleter_sfinae<_Deleter&> {
};
#if defined(_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI)
-# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI __attribute__((trivial_abi))
+# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI __attribute__((__trivial_abi__))
#else
# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI
#endif
@@ -557,7 +560,7 @@ bool
operator>=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x < __y);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _T1, class _D1, class _T2, class _D2>
requires three_way_comparable_with<typename unique_ptr<_T1, _D1>::pointer,
typename unique_ptr<_T2, _D2>::pointer>
@@ -651,7 +654,7 @@ operator>=(nullptr_t, const unique_ptr<_T1, _D1>& __x) {
return !(nullptr < __x);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _T1, class _D1>
requires three_way_comparable<
typename unique_ptr<_T1, _D1>::pointer> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
@@ -661,7 +664,7 @@ operator<=>(const unique_ptr<_T1, _D1>& __x, nullptr_t) {
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template<class _Tp>
struct __unique_if
@@ -698,7 +701,7 @@ template<class _Tp, class... _Args>
typename __unique_if<_Tp>::__unique_array_known_bound
make_unique(_Args&&...) = delete;
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
#if _LIBCPP_STD_VER >= 20
@@ -744,4 +747,6 @@ struct _LIBCPP_TEMPLATE_VIS hash<__enable_hash_helper<
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___MEMORY_UNIQUE_PTR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator.h b/contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator.h
index fe89704027a..f82ac179638 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator.h
@@ -49,9 +49,9 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator
{
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Alloc>
-inline constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
+inline constexpr bool uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator_construction.h b/contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator_construction.h
index 0f63b080daf..a2e4f6e26f4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator_construction.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/uses_allocator_construction.h
@@ -23,6 +23,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 17
@@ -83,7 +86,7 @@ __uses_allocator_construction_args(const _Alloc& __alloc, _Up&& __u, _Vp&& __v)
std::forward_as_tuple(std::forward<_Vp>(__v)));
}
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
template <class _Pair, class _Alloc, class _Up, class _Vp, __enable_if_t<__is_std_pair<_Pair>, int> = 0>
_LIBCPP_HIDE_FROM_ABI constexpr auto
__uses_allocator_construction_args(const _Alloc& __alloc, pair<_Up, _Vp>& __pair) noexcept {
@@ -109,7 +112,7 @@ __uses_allocator_construction_args(const _Alloc& __alloc, pair<_Up, _Vp>&& __pai
std::forward_as_tuple(std::get<1>(std::move(__pair))));
}
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
template <class _Pair, class _Alloc, class _Up, class _Vp, __enable_if_t<__is_std_pair<_Pair>, int> = 0>
_LIBCPP_HIDE_FROM_ABI constexpr auto
__uses_allocator_construction_args(const _Alloc& __alloc, const pair<_Up, _Vp>&& __pair) noexcept {
@@ -218,4 +221,6 @@ uninitialized_construct_using_allocator(_Type* __ptr, const _Alloc& __alloc, _Ar
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___MEMORY_USES_ALLOCATOR_CONSTRUCTION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/memory_resource.h b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/memory_resource.h
index 02fdd081cce..418f36dc9b3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/memory_resource.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/memory_resource.h
@@ -9,14 +9,16 @@
#ifndef _LIBCPP___MEMORY_RESOURCE_MEMORY_RESOURCE_H
#define _LIBCPP___MEMORY_RESOURCE_MEMORY_RESOURCE_H
+#include <__availability>
#include <__config>
+#include <__fwd/memory_resource.h>
#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -24,7 +26,7 @@ namespace pmr {
// [mem.res.class]
-class _LIBCPP_TYPE_VIS memory_resource {
+class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource {
static const size_t __max_align = alignof(max_align_t);
public:
@@ -51,25 +53,38 @@ private:
// [mem.res.eq]
-inline _LIBCPP_HIDE_FROM_ABI bool operator==(const memory_resource& __lhs, const memory_resource& __rhs) noexcept {
+inline _LIBCPP_AVAILABILITY_PMR _LIBCPP_HIDE_FROM_ABI bool
+operator==(const memory_resource& __lhs, const memory_resource& __rhs) noexcept {
return &__lhs == &__rhs || __lhs.is_equal(__rhs);
}
-inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const memory_resource& __lhs, const memory_resource& __rhs) noexcept {
+# if _LIBCPP_STD_VER <= 17
+
+inline _LIBCPP_AVAILABILITY_PMR _LIBCPP_HIDE_FROM_ABI bool
+operator!=(const memory_resource& __lhs, const memory_resource& __rhs) noexcept {
return !(__lhs == __rhs);
}
+# endif
+
// [mem.res.global]
-[[__gnu__::__returns_nonnull__]] _LIBCPP_FUNC_VIS memory_resource* get_default_resource() noexcept;
-[[__gnu__::__returns_nonnull__]] _LIBCPP_FUNC_VIS memory_resource* set_default_resource(memory_resource*) noexcept;
-[[using __gnu__: __returns_nonnull__, __const__]] _LIBCPP_FUNC_VIS memory_resource* new_delete_resource() noexcept;
-[[using __gnu__: __returns_nonnull__, __const__]] _LIBCPP_FUNC_VIS memory_resource* null_memory_resource() noexcept;
+[[__gnu__::__returns_nonnull__]] _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource*
+get_default_resource() noexcept;
+
+[[__gnu__::__returns_nonnull__]] _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource*
+set_default_resource(memory_resource*) noexcept;
+
+[[using __gnu__: __returns_nonnull__, __const__]] _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource*
+new_delete_resource() noexcept;
+
+[[using __gnu__: __returns_nonnull__, __const__]] _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource*
+null_memory_resource() noexcept;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // _LIBCPP___MEMORY_RESOURCE_MEMORY_RESOURCE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/monotonic_buffer_resource.h b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/monotonic_buffer_resource.h
index 5b0d2462582..0c83f1ebc8d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/monotonic_buffer_resource.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/monotonic_buffer_resource.h
@@ -9,6 +9,7 @@
#ifndef _LIBCPP___MEMORY_RESOURCE_MONOTONIC_BUFFER_RESOURCE_H
#define _LIBCPP___MEMORY_RESOURCE_MONOTONIC_BUFFER_RESOURCE_H
+#include <__availability>
#include <__config>
#include <__memory/addressof.h>
#include <__memory_resource/memory_resource.h>
@@ -18,7 +19,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -26,7 +27,7 @@ namespace pmr {
// [mem.res.monotonic.buffer]
-class _LIBCPP_TYPE_VIS monotonic_buffer_resource : public memory_resource {
+class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI monotonic_buffer_resource : public memory_resource {
static const size_t __default_buffer_capacity = 1024;
static const size_t __default_buffer_alignment = 16;
@@ -35,7 +36,9 @@ class _LIBCPP_TYPE_VIS monotonic_buffer_resource : public memory_resource {
char* __start_;
char* __cur_;
size_t __align_;
- size_t __allocation_size() { return (reinterpret_cast<char*>(this) - __start_) + sizeof(*this); }
+ _LIBCPP_HIDE_FROM_ABI size_t __allocation_size() {
+ return (reinterpret_cast<char*>(this) - __start_) + sizeof(*this);
+ }
void* __try_allocate_from_chunk(size_t, size_t);
};
@@ -115,6 +118,6 @@ private:
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // _LIBCPP___MEMORY_RESOURCE_MONOTONIC_BUFFER_RESOURCE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/polymorphic_allocator.h b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/polymorphic_allocator.h
index f7b9a0b408c..8fcce65ad2f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/polymorphic_allocator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/polymorphic_allocator.h
@@ -10,6 +10,7 @@
#define _LIBCPP___MEMORY_RESOURCE_POLYMORPHIC_ALLOCATOR_H
#include <__assert>
+#include <__availability>
#include <__config>
#include <__memory_resource/memory_resource.h>
#include <__utility/exception_guard.h>
@@ -26,7 +27,7 @@
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -39,7 +40,7 @@ template <class _ValueType
= byte
# endif
>
-class _LIBCPP_TEMPLATE_VIS polymorphic_allocator {
+class _LIBCPP_AVAILABILITY_PMR _LIBCPP_TEMPLATE_VIS polymorphic_allocator {
public:
using value_type = _ValueType;
@@ -50,7 +51,7 @@ public:
_LIBCPP_HIDE_FROM_ABI polymorphic_allocator(memory_resource* __r) noexcept : __res_(__r) {}
- polymorphic_allocator(const polymorphic_allocator&) = default;
+ _LIBCPP_HIDE_FROM_ABI polymorphic_allocator(const polymorphic_allocator&) = default;
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI polymorphic_allocator(const polymorphic_allocator<_Tp>& __other) noexcept
@@ -68,35 +69,35 @@ public:
}
_LIBCPP_HIDE_FROM_ABI void deallocate(_ValueType* __p, size_t __n) {
- _LIBCPP_ASSERT(__n <= __max_size(), "deallocate called for size which exceeds max_size()");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n <= __max_size(), "deallocate called for size which exceeds max_size()");
__res_->deallocate(__p, __n * sizeof(_ValueType), alignof(_ValueType));
}
# if _LIBCPP_STD_VER >= 20
- [[nodiscard]] [[using __gnu__: __alloc_size__(2), __alloc_align__(3)]] void*
+ [[nodiscard]] [[using __gnu__: __alloc_size__(2), __alloc_align__(3)]] _LIBCPP_HIDE_FROM_ABI void*
allocate_bytes(size_t __nbytes, size_t __alignment = alignof(max_align_t)) {
return __res_->allocate(__nbytes, __alignment);
}
- void deallocate_bytes(void* __ptr, size_t __nbytes, size_t __alignment = alignof(max_align_t)) {
+ _LIBCPP_HIDE_FROM_ABI void deallocate_bytes(void* __ptr, size_t __nbytes, size_t __alignment = alignof(max_align_t)) {
__res_->deallocate(__ptr, __nbytes, __alignment);
}
template <class _Type>
- [[nodiscard]] _Type* allocate_object(size_t __n = 1) {
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Type* allocate_object(size_t __n = 1) {
if (numeric_limits<size_t>::max() / sizeof(_Type) < __n)
std::__throw_bad_array_new_length();
return static_cast<_Type*>(allocate_bytes(__n * sizeof(_Type), alignof(_Type)));
}
template <class _Type>
- void deallocate_object(_Type* __ptr, size_t __n = 1) {
+ _LIBCPP_HIDE_FROM_ABI void deallocate_object(_Type* __ptr, size_t __n = 1) {
deallocate_bytes(__ptr, __n * sizeof(_Type), alignof(_Type));
}
template <class _Type, class... _CtorArgs>
- [[nodiscard]] _Type* new_object(_CtorArgs&&... __ctor_args) {
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Type* new_object(_CtorArgs&&... __ctor_args) {
_Type* __ptr = allocate_object<_Type>();
auto __guard = std::__make_exception_guard([&] { deallocate_object(__ptr); });
construct(__ptr, std::forward<_CtorArgs>(__ctor_args)...);
@@ -105,7 +106,7 @@ public:
}
template <class _Type>
- void delete_object(_Type* __ptr) {
+ _LIBCPP_HIDE_FROM_ABI void delete_object(_Type* __ptr) {
destroy(__ptr);
deallocate_object(__ptr);
}
@@ -207,17 +208,21 @@ operator==(const polymorphic_allocator<_Tp>& __lhs, const polymorphic_allocator<
return *__lhs.resource() == *__rhs.resource();
}
+# if _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Up>
inline _LIBCPP_HIDE_FROM_ABI bool
operator!=(const polymorphic_allocator<_Tp>& __lhs, const polymorphic_allocator<_Up>& __rhs) noexcept {
return !(__lhs == __rhs);
}
+# endif
+
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_POP_MACROS
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/pool_options.h b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/pool_options.h
index 11585a0e3bc..442959836c7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/pool_options.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/pool_options.h
@@ -16,7 +16,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -24,7 +24,7 @@ namespace pmr {
// [mem.res.pool.options]
-struct _LIBCPP_TYPE_VIS pool_options {
+struct _LIBCPP_EXPORTED_FROM_ABI pool_options {
size_t max_blocks_per_chunk = 0;
size_t largest_required_pool_block = 0;
};
@@ -33,6 +33,6 @@ struct _LIBCPP_TYPE_VIS pool_options {
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // _LIBCPP___MEMORY_RESOURCE_POOL_OPTIONS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/synchronized_pool_resource.h b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/synchronized_pool_resource.h
index 1877147ca16..b261fb0b194 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/synchronized_pool_resource.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/synchronized_pool_resource.h
@@ -9,20 +9,19 @@
#ifndef _LIBCPP___MEMORY_RESOURCE_SYNCHRONIZED_POOL_RESOURCE_H
#define _LIBCPP___MEMORY_RESOURCE_SYNCHRONIZED_POOL_RESOURCE_H
+#include <__availability>
#include <__config>
#include <__memory_resource/memory_resource.h>
#include <__memory_resource/pool_options.h>
#include <__memory_resource/unsynchronized_pool_resource.h>
#include <cstddef>
-#if !defined(_LIBCPP_HAS_NO_THREADS)
-# include <mutex>
-#endif
+#include <mutex>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -30,7 +29,7 @@ namespace pmr {
// [mem.res.pool.overview]
-class _LIBCPP_TYPE_VIS synchronized_pool_resource : public memory_resource {
+class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI synchronized_pool_resource : public memory_resource {
public:
_LIBCPP_HIDE_FROM_ABI synchronized_pool_resource(const pool_options& __opts, memory_resource* __upstream)
: __unsync_(__opts, __upstream) {}
@@ -46,7 +45,7 @@ public:
synchronized_pool_resource(const synchronized_pool_resource&) = delete;
- ~synchronized_pool_resource() override = default;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~synchronized_pool_resource() override = default;
synchronized_pool_resource& operator=(const synchronized_pool_resource&) = delete;
@@ -89,6 +88,6 @@ private:
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // _LIBCPP___MEMORY_RESOURCE_SYNCHRONIZED_POOL_RESOURCE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/unsynchronized_pool_resource.h b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
index 91d38aac0df..81d5f9ec4da 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
@@ -9,6 +9,7 @@
#ifndef _LIBCPP___MEMORY_RESOURCE_UNSYNCHRONIZED_POOL_RESOURCE_H
#define _LIBCPP___MEMORY_RESOURCE_UNSYNCHRONIZED_POOL_RESOURCE_H
+#include <__availability>
#include <__config>
#include <__memory_resource/memory_resource.h>
#include <__memory_resource/pool_options.h>
@@ -19,7 +20,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -27,7 +28,7 @@ namespace pmr {
// [mem.res.pool.overview]
-class _LIBCPP_TYPE_VIS unsynchronized_pool_resource : public memory_resource {
+class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI unsynchronized_pool_resource : public memory_resource {
class __fixed_pool;
class __adhoc_pool {
@@ -101,6 +102,6 @@ private:
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // _LIBCPP___MEMORY_RESOURCE_UNSYNCHRONIZED_POOL_RESOURCE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__mutex/lock_guard.h b/contrib/libs/cxxsupp/libcxx/include/__mutex/lock_guard.h
new file mode 100644
index 00000000000..c075512fb97
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__mutex/lock_guard.h
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___MUTEX_LOCK_GUARD_H
+#define _LIBCPP___MUTEX_LOCK_GUARD_H
+
+#include <__config>
+#include <__mutex/tag_types.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Mutex>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(scoped_lockable) lock_guard {
+public:
+ typedef _Mutex mutex_type;
+
+private:
+ mutex_type& __m_;
+
+public:
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI explicit lock_guard(mutex_type& __m)
+ _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
+ : __m_(__m) {
+ __m_.lock();
+ }
+
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI lock_guard(mutex_type& __m, adopt_lock_t)
+ _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
+ : __m_(__m) {}
+ _LIBCPP_HIDE_FROM_ABI ~lock_guard() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) { __m_.unlock(); }
+
+private:
+ lock_guard(lock_guard const&) = delete;
+ lock_guard& operator=(lock_guard const&) = delete;
+};
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(lock_guard);
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_HAS_NO_THREADS
+
+#endif // _LIBCPP___MUTEX_LOCK_GUARD_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__mutex/mutex.h b/contrib/libs/cxxsupp/libcxx/include/__mutex/mutex.h
new file mode 100644
index 00000000000..4423abf62b8
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__mutex/mutex.h
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___MUTEX_MUTEX_H
+#define _LIBCPP___MUTEX_MUTEX_H
+
+#include <__config>
+#include <__threading_support>
+#include <__type_traits/is_nothrow_default_constructible.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex {
+ __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR mutex() = default;
+
+ mutex(const mutex&) = delete;
+ mutex& operator=(const mutex&) = delete;
+
+# if defined(_LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION)
+ _LIBCPP_HIDE_FROM_ABI ~mutex() = default;
+# else
+ ~mutex() _NOEXCEPT;
+# endif
+
+ void lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability());
+ bool try_lock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(try_acquire_capability(true));
+ void unlock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability());
+
+ typedef __libcpp_mutex_t* native_handle_type;
+ _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return &__m_; }
+};
+
+static_assert(is_nothrow_default_constructible<mutex>::value, "the default constructor for std::mutex must be nothrow");
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_HAS_NO_THREADS
+
+#endif // _LIBCPP___MUTEX_MUTEX_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__mutex/tag_types.h b/contrib/libs/cxxsupp/libcxx/include/__mutex/tag_types.h
new file mode 100644
index 00000000000..05ccb8b23a6
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__mutex/tag_types.h
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___MUTEX_TAG_TYPES_H
+#define _LIBCPP___MUTEX_TAG_TYPES_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+struct _LIBCPP_EXPORTED_FROM_ABI defer_lock_t {
+ explicit defer_lock_t() = default;
+};
+
+struct _LIBCPP_EXPORTED_FROM_ABI try_to_lock_t {
+ explicit try_to_lock_t() = default;
+};
+
+struct _LIBCPP_EXPORTED_FROM_ABI adopt_lock_t {
+ explicit adopt_lock_t() = default;
+};
+
+# if _LIBCPP_STD_VER >= 17
+inline constexpr defer_lock_t defer_lock = defer_lock_t();
+inline constexpr try_to_lock_t try_to_lock = try_to_lock_t();
+inline constexpr adopt_lock_t adopt_lock = adopt_lock_t();
+# elif !defined(_LIBCPP_CXX03_LANG)
+constexpr defer_lock_t defer_lock = defer_lock_t();
+constexpr try_to_lock_t try_to_lock = try_to_lock_t();
+constexpr adopt_lock_t adopt_lock = adopt_lock_t();
+# endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_HAS_NO_THREADS
+
+#endif // _LIBCPP___MUTEX_TAG_TYPES_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__mutex/unique_lock.h b/contrib/libs/cxxsupp/libcxx/include/__mutex/unique_lock.h
new file mode 100644
index 00000000000..c27ce4b24c1
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__mutex/unique_lock.h
@@ -0,0 +1,173 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___MUTEX_UNIQUE_LOCK_H
+#define _LIBCPP___MUTEX_UNIQUE_LOCK_H
+
+#include <__chrono/duration.h>
+#include <__chrono/time_point.h>
+#include <__config>
+#include <__memory/addressof.h>
+#include <__mutex/tag_types.h>
+#include <__system_error/system_error.h>
+#include <__utility/swap.h>
+#include <cerrno>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Mutex>
+class _LIBCPP_TEMPLATE_VIS unique_lock {
+public:
+ typedef _Mutex mutex_type;
+
+private:
+ mutex_type* __m_;
+ bool __owns_;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {}
+ _LIBCPP_HIDE_FROM_ABI explicit unique_lock(mutex_type& __m) : __m_(std::addressof(__m)), __owns_(true) {
+ __m_->lock();
+ }
+
+ _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
+ : __m_(std::addressof(__m)),
+ __owns_(false) {}
+
+ _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, try_to_lock_t)
+ : __m_(std::addressof(__m)), __owns_(__m.try_lock()) {}
+
+ _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, adopt_lock_t) : __m_(std::addressof(__m)), __owns_(true) {}
+
+ template <class _Clock, class _Duration>
+ _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t)
+ : __m_(std::addressof(__m)), __owns_(__m.try_lock_until(__t)) {}
+
+ template <class _Rep, class _Period>
+ _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d)
+ : __m_(std::addressof(__m)), __owns_(__m.try_lock_for(__d)) {}
+
+ _LIBCPP_HIDE_FROM_ABI ~unique_lock() {
+ if (__owns_)
+ __m_->unlock();
+ }
+
+ unique_lock(unique_lock const&) = delete;
+ unique_lock& operator=(unique_lock const&) = delete;
+
+ _LIBCPP_HIDE_FROM_ABI unique_lock(unique_lock&& __u) _NOEXCEPT : __m_(__u.__m_), __owns_(__u.__owns_) {
+ __u.__m_ = nullptr;
+ __u.__owns_ = false;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI unique_lock& operator=(unique_lock&& __u) _NOEXCEPT {
+ if (__owns_)
+ __m_->unlock();
+
+ __m_ = __u.__m_;
+ __owns_ = __u.__owns_;
+ __u.__m_ = nullptr;
+ __u.__owns_ = false;
+ return *this;
+ }
+
+ void lock();
+ bool try_lock();
+
+ template <class _Rep, class _Period>
+ bool try_lock_for(const chrono::duration<_Rep, _Period>& __d);
+
+ template <class _Clock, class _Duration>
+ bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
+
+ void unlock();
+
+ _LIBCPP_HIDE_FROM_ABI void swap(unique_lock& __u) _NOEXCEPT {
+ std::swap(__m_, __u.__m_);
+ std::swap(__owns_, __u.__owns_);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI mutex_type* release() _NOEXCEPT {
+ mutex_type* __m = __m_;
+ __m_ = nullptr;
+ __owns_ = false;
+ return __m;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI bool owns_lock() const _NOEXCEPT { return __owns_; }
+ _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __owns_; }
+ _LIBCPP_HIDE_FROM_ABI mutex_type* mutex() const _NOEXCEPT { return __m_; }
+};
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(unique_lock);
+
+template <class _Mutex>
+void unique_lock<_Mutex>::lock() {
+ if (__m_ == nullptr)
+ __throw_system_error(EPERM, "unique_lock::lock: references null mutex");
+ if (__owns_)
+ __throw_system_error(EDEADLK, "unique_lock::lock: already locked");
+ __m_->lock();
+ __owns_ = true;
+}
+
+template <class _Mutex>
+bool unique_lock<_Mutex>::try_lock() {
+ if (__m_ == nullptr)
+ __throw_system_error(EPERM, "unique_lock::try_lock: references null mutex");
+ if (__owns_)
+ __throw_system_error(EDEADLK, "unique_lock::try_lock: already locked");
+ __owns_ = __m_->try_lock();
+ return __owns_;
+}
+
+template <class _Mutex>
+template <class _Rep, class _Period>
+bool unique_lock<_Mutex>::try_lock_for(const chrono::duration<_Rep, _Period>& __d) {
+ if (__m_ == nullptr)
+ __throw_system_error(EPERM, "unique_lock::try_lock_for: references null mutex");
+ if (__owns_)
+ __throw_system_error(EDEADLK, "unique_lock::try_lock_for: already locked");
+ __owns_ = __m_->try_lock_for(__d);
+ return __owns_;
+}
+
+template <class _Mutex>
+template <class _Clock, class _Duration>
+bool unique_lock<_Mutex>::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t) {
+ if (__m_ == nullptr)
+ __throw_system_error(EPERM, "unique_lock::try_lock_until: references null mutex");
+ if (__owns_)
+ __throw_system_error(EDEADLK, "unique_lock::try_lock_until: already locked");
+ __owns_ = __m_->try_lock_until(__t);
+ return __owns_;
+}
+
+template <class _Mutex>
+void unique_lock<_Mutex>::unlock() {
+ if (!__owns_)
+ __throw_system_error(EPERM, "unique_lock::unlock: not locked");
+ __m_->unlock();
+ __owns_ = false;
+}
+
+template <class _Mutex>
+inline _LIBCPP_HIDE_FROM_ABI void swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) _NOEXCEPT {
+ __x.swap(__y);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_HAS_NO_THREADS
+
+#endif // _LIBCPP___MUTEX_UNIQUE_LOCK_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__mutex_base b/contrib/libs/cxxsupp/libcxx/include/__mutex_base
deleted file mode 100644
index 82d9fa6ecba..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__mutex_base
+++ /dev/null
@@ -1,523 +0,0 @@
-// -*- 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___MUTEX_BASE
-#define _LIBCPP___MUTEX_BASE
-
-#include <__chrono/duration.h>
-#include <__chrono/steady_clock.h>
-#include <__chrono/system_clock.h>
-#include <__chrono/time_point.h>
-#include <__config>
-#include <__threading_support>
-#include <ratio>
-#include <system_error>
-#include <time.h>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-
-class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex
-{
- __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER;
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR mutex() = default;
-
- mutex(const mutex&) = delete;
- mutex& operator=(const mutex&) = delete;
-
-#if defined(_LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION)
- ~mutex() = default;
-#else
- ~mutex() _NOEXCEPT;
-#endif
-
- void lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability());
- bool try_lock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(try_acquire_capability(true));
- void unlock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability());
-
- typedef __libcpp_mutex_t* native_handle_type;
- _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
-};
-
-static_assert(is_nothrow_default_constructible<mutex>::value,
- "the default constructor for std::mutex must be nothrow");
-
-struct _LIBCPP_TYPE_VIS defer_lock_t { explicit defer_lock_t() = default; };
-struct _LIBCPP_TYPE_VIS try_to_lock_t { explicit try_to_lock_t() = default; };
-struct _LIBCPP_TYPE_VIS adopt_lock_t { explicit adopt_lock_t() = default; };
-
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
-
-extern _LIBCPP_EXPORTED_FROM_ABI const defer_lock_t defer_lock;
-extern _LIBCPP_EXPORTED_FROM_ABI const try_to_lock_t try_to_lock;
-extern _LIBCPP_EXPORTED_FROM_ABI const adopt_lock_t adopt_lock;
-
-#else
-
-/* inline */ constexpr defer_lock_t defer_lock = defer_lock_t();
-/* inline */ constexpr try_to_lock_t try_to_lock = try_to_lock_t();
-/* inline */ constexpr adopt_lock_t adopt_lock = adopt_lock_t();
-
-#endif
-
-template <class _Mutex>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(scoped_lockable)
-lock_guard
-{
-public:
- typedef _Mutex mutex_type;
-
-private:
- mutex_type& __m_;
-public:
-
- _LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY
- explicit lock_guard(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
- : __m_(__m) {__m_.lock();}
-
- _LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY
- lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
- : __m_(__m) {}
- _LIBCPP_INLINE_VISIBILITY
- ~lock_guard() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) {__m_.unlock();}
-
-private:
- lock_guard(lock_guard const&) = delete;
- lock_guard& operator=(lock_guard const&) = delete;
-};
-_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(lock_guard);
-
-template <class _Mutex>
-class _LIBCPP_TEMPLATE_VIS unique_lock
-{
-public:
- typedef _Mutex mutex_type;
-
-private:
- mutex_type* __m_;
- bool __owns_;
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {}
- _LIBCPP_INLINE_VISIBILITY
- explicit unique_lock(mutex_type& __m)
- : __m_(_VSTD::addressof(__m)), __owns_(true) {__m_->lock();}
- _LIBCPP_INLINE_VISIBILITY
- unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
- : __m_(_VSTD::addressof(__m)), __owns_(false) {}
- _LIBCPP_INLINE_VISIBILITY
- unique_lock(mutex_type& __m, try_to_lock_t)
- : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock()) {}
- _LIBCPP_INLINE_VISIBILITY
- unique_lock(mutex_type& __m, adopt_lock_t)
- : __m_(_VSTD::addressof(__m)), __owns_(true) {}
- template <class _Clock, class _Duration>
- _LIBCPP_INLINE_VISIBILITY
- unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t)
- : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_until(__t)) {}
- template <class _Rep, class _Period>
- _LIBCPP_INLINE_VISIBILITY
- unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d)
- : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_for(__d)) {}
- _LIBCPP_INLINE_VISIBILITY
- ~unique_lock()
- {
- if (__owns_)
- __m_->unlock();
- }
-
- unique_lock(unique_lock const&) = delete;
- unique_lock& operator=(unique_lock const&) = delete;
-
- _LIBCPP_INLINE_VISIBILITY
- unique_lock(unique_lock&& __u) _NOEXCEPT
- : __m_(__u.__m_), __owns_(__u.__owns_)
- {__u.__m_ = nullptr; __u.__owns_ = false;}
- _LIBCPP_INLINE_VISIBILITY
- unique_lock& operator=(unique_lock&& __u) _NOEXCEPT
- {
- if (__owns_)
- __m_->unlock();
- __m_ = __u.__m_;
- __owns_ = __u.__owns_;
- __u.__m_ = nullptr;
- __u.__owns_ = false;
- return *this;
- }
-
- void lock();
- bool try_lock();
-
- template <class _Rep, class _Period>
- bool try_lock_for(const chrono::duration<_Rep, _Period>& __d);
- template <class _Clock, class _Duration>
- bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
-
- void unlock();
-
- _LIBCPP_INLINE_VISIBILITY
- void swap(unique_lock& __u) _NOEXCEPT
- {
- _VSTD::swap(__m_, __u.__m_);
- _VSTD::swap(__owns_, __u.__owns_);
- }
- _LIBCPP_INLINE_VISIBILITY
- mutex_type* release() _NOEXCEPT
- {
- mutex_type* __m = __m_;
- __m_ = nullptr;
- __owns_ = false;
- return __m;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- bool owns_lock() const _NOEXCEPT {return __owns_;}
- _LIBCPP_INLINE_VISIBILITY
- explicit operator bool() const _NOEXCEPT {return __owns_;}
- _LIBCPP_INLINE_VISIBILITY
- mutex_type* mutex() const _NOEXCEPT {return __m_;}
-};
-_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(unique_lock);
-
-template <class _Mutex>
-void
-unique_lock<_Mutex>::lock()
-{
- if (__m_ == nullptr)
- __throw_system_error(EPERM, "unique_lock::lock: references null mutex");
- if (__owns_)
- __throw_system_error(EDEADLK, "unique_lock::lock: already locked");
- __m_->lock();
- __owns_ = true;
-}
-
-template <class _Mutex>
-bool
-unique_lock<_Mutex>::try_lock()
-{
- if (__m_ == nullptr)
- __throw_system_error(EPERM, "unique_lock::try_lock: references null mutex");
- if (__owns_)
- __throw_system_error(EDEADLK, "unique_lock::try_lock: already locked");
- __owns_ = __m_->try_lock();
- return __owns_;
-}
-
-template <class _Mutex>
-template <class _Rep, class _Period>
-bool
-unique_lock<_Mutex>::try_lock_for(const chrono::duration<_Rep, _Period>& __d)
-{
- if (__m_ == nullptr)
- __throw_system_error(EPERM, "unique_lock::try_lock_for: references null mutex");
- if (__owns_)
- __throw_system_error(EDEADLK, "unique_lock::try_lock_for: already locked");
- __owns_ = __m_->try_lock_for(__d);
- return __owns_;
-}
-
-template <class _Mutex>
-template <class _Clock, class _Duration>
-bool
-unique_lock<_Mutex>::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t)
-{
- if (__m_ == nullptr)
- __throw_system_error(EPERM, "unique_lock::try_lock_until: references null mutex");
- if (__owns_)
- __throw_system_error(EDEADLK, "unique_lock::try_lock_until: already locked");
- __owns_ = __m_->try_lock_until(__t);
- return __owns_;
-}
-
-template <class _Mutex>
-void
-unique_lock<_Mutex>::unlock()
-{
- if (!__owns_)
- __throw_system_error(EPERM, "unique_lock::unlock: not locked");
- __m_->unlock();
- __owns_ = false;
-}
-
-template <class _Mutex>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) _NOEXCEPT
- {__x.swap(__y);}
-
-//enum class cv_status
-_LIBCPP_DECLARE_STRONG_ENUM(cv_status)
-{
- no_timeout,
- timeout
-};
-_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status)
-
-class _LIBCPP_TYPE_VIS condition_variable
-{
- __libcpp_condvar_t __cv_ = _LIBCPP_CONDVAR_INITIALIZER;
-public:
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR condition_variable() _NOEXCEPT = default;
-
-#ifdef _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION
- ~condition_variable() = default;
-#else
- ~condition_variable();
-#endif
-
- condition_variable(const condition_variable&) = delete;
- condition_variable& operator=(const condition_variable&) = delete;
-
- void notify_one() _NOEXCEPT;
- void notify_all() _NOEXCEPT;
-
- void wait(unique_lock<mutex>& __lk) _NOEXCEPT;
- template <class _Predicate>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- void wait(unique_lock<mutex>& __lk, _Predicate __pred);
-
- template <class _Clock, class _Duration>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- cv_status
- wait_until(unique_lock<mutex>& __lk,
- const chrono::time_point<_Clock, _Duration>& __t);
-
- template <class _Clock, class _Duration, class _Predicate>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- bool
- wait_until(unique_lock<mutex>& __lk,
- const chrono::time_point<_Clock, _Duration>& __t,
- _Predicate __pred);
-
- template <class _Rep, class _Period>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- cv_status
- wait_for(unique_lock<mutex>& __lk,
- const chrono::duration<_Rep, _Period>& __d);
-
- template <class _Rep, class _Period, class _Predicate>
- bool
- _LIBCPP_INLINE_VISIBILITY
- wait_for(unique_lock<mutex>& __lk,
- const chrono::duration<_Rep, _Period>& __d,
- _Predicate __pred);
-
- typedef __libcpp_condvar_t* native_handle_type;
- _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__cv_;}
-
-private:
- void __do_timed_wait(unique_lock<mutex>& __lk,
- chrono::time_point<chrono::system_clock, chrono::nanoseconds>) _NOEXCEPT;
-#if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
- void __do_timed_wait(unique_lock<mutex>& __lk,
- chrono::time_point<chrono::steady_clock, chrono::nanoseconds>) _NOEXCEPT;
-#endif
- template <class _Clock>
- void __do_timed_wait(unique_lock<mutex>& __lk,
- chrono::time_point<_Clock, chrono::nanoseconds>) _NOEXCEPT;
-};
-#endif // !_LIBCPP_HAS_NO_THREADS
-
-template <class _Rep, class _Period>
-inline _LIBCPP_INLINE_VISIBILITY
-__enable_if_t<is_floating_point<_Rep>::value, chrono::nanoseconds>
-__safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d)
-{
- using namespace chrono;
- using __ratio = ratio_divide<_Period, nano>;
- using __ns_rep = nanoseconds::rep;
- _Rep __result_float = __d.count() * __ratio::num / __ratio::den;
-
- _Rep __result_max = numeric_limits<__ns_rep>::max();
- if (__result_float >= __result_max) {
- return nanoseconds::max();
- }
-
- _Rep __result_min = numeric_limits<__ns_rep>::min();
- if (__result_float <= __result_min) {
- return nanoseconds::min();
- }
-
- return nanoseconds(static_cast<__ns_rep>(__result_float));
-}
-
-template <class _Rep, class _Period>
-inline _LIBCPP_INLINE_VISIBILITY
-__enable_if_t<!is_floating_point<_Rep>::value, chrono::nanoseconds>
-__safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d)
-{
- using namespace chrono;
- if (__d.count() == 0) {
- return nanoseconds(0);
- }
-
- using __ratio = ratio_divide<_Period, nano>;
- using __ns_rep = nanoseconds::rep;
- __ns_rep __result_max = numeric_limits<__ns_rep>::max();
- if (__d.count() > 0 && __d.count() > __result_max / __ratio::num) {
- return nanoseconds::max();
- }
-
- __ns_rep __result_min = numeric_limits<__ns_rep>::min();
- if (__d.count() < 0 && __d.count() < __result_min / __ratio::num) {
- return nanoseconds::min();
- }
-
- __ns_rep __result = __d.count() * __ratio::num / __ratio::den;
- if (__result == 0) {
- return nanoseconds(1);
- }
-
- return nanoseconds(__result);
-}
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-template <class _Predicate>
-void
-condition_variable::wait(unique_lock<mutex>& __lk, _Predicate __pred)
-{
- while (!__pred())
- wait(__lk);
-}
-
-template <class _Clock, class _Duration>
-cv_status
-condition_variable::wait_until(unique_lock<mutex>& __lk,
- const chrono::time_point<_Clock, _Duration>& __t)
-{
- using namespace chrono;
- using __clock_tp_ns = time_point<_Clock, nanoseconds>;
-
- typename _Clock::time_point __now = _Clock::now();
- if (__t <= __now)
- return cv_status::timeout;
-
- __clock_tp_ns __t_ns = __clock_tp_ns(_VSTD::__safe_nanosecond_cast(__t.time_since_epoch()));
-
- __do_timed_wait(__lk, __t_ns);
- return _Clock::now() < __t ? cv_status::no_timeout : cv_status::timeout;
-}
-
-template <class _Clock, class _Duration, class _Predicate>
-bool
-condition_variable::wait_until(unique_lock<mutex>& __lk,
- const chrono::time_point<_Clock, _Duration>& __t,
- _Predicate __pred)
-{
- while (!__pred())
- {
- if (wait_until(__lk, __t) == cv_status::timeout)
- return __pred();
- }
- return true;
-}
-
-template <class _Rep, class _Period>
-cv_status
-condition_variable::wait_for(unique_lock<mutex>& __lk,
- const chrono::duration<_Rep, _Period>& __d)
-{
- using namespace chrono;
- if (__d <= __d.zero())
- return cv_status::timeout;
- using __ns_rep = nanoseconds::rep;
- steady_clock::time_point __c_now = steady_clock::now();
-
-#if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
- using __clock_tp_ns = time_point<steady_clock, nanoseconds>;
- __ns_rep __now_count_ns = _VSTD::__safe_nanosecond_cast(__c_now.time_since_epoch()).count();
-#else
- using __clock_tp_ns = time_point<system_clock, nanoseconds>;
- __ns_rep __now_count_ns = _VSTD::__safe_nanosecond_cast(system_clock::now().time_since_epoch()).count();
-#endif
-
- __ns_rep __d_ns_count = _VSTD::__safe_nanosecond_cast(__d).count();
-
- if (__now_count_ns > numeric_limits<__ns_rep>::max() - __d_ns_count) {
- __do_timed_wait(__lk, __clock_tp_ns::max());
- } else {
- __do_timed_wait(__lk, __clock_tp_ns(nanoseconds(__now_count_ns + __d_ns_count)));
- }
-
- return steady_clock::now() - __c_now < __d ? cv_status::no_timeout :
- cv_status::timeout;
-}
-
-template <class _Rep, class _Period, class _Predicate>
-inline
-bool
-condition_variable::wait_for(unique_lock<mutex>& __lk,
- const chrono::duration<_Rep, _Period>& __d,
- _Predicate __pred)
-{
- return wait_until(__lk, chrono::steady_clock::now() + __d,
- _VSTD::move(__pred));
-}
-
-#if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
-inline
-void
-condition_variable::__do_timed_wait(unique_lock<mutex>& __lk,
- chrono::time_point<chrono::steady_clock, chrono::nanoseconds> __tp) _NOEXCEPT
-{
- using namespace chrono;
- if (!__lk.owns_lock())
- __throw_system_error(EPERM,
- "condition_variable::timed wait: mutex not locked");
- nanoseconds __d = __tp.time_since_epoch();
- timespec __ts;
- seconds __s = duration_cast<seconds>(__d);
- using __ts_sec = decltype(__ts.tv_sec);
- const __ts_sec __ts_sec_max = numeric_limits<__ts_sec>::max();
- if (__s.count() < __ts_sec_max)
- {
- __ts.tv_sec = static_cast<__ts_sec>(__s.count());
- __ts.tv_nsec = (__d - __s).count();
- }
- else
- {
- __ts.tv_sec = __ts_sec_max;
- __ts.tv_nsec = giga::num - 1;
- }
- int __ec = pthread_cond_clockwait(&__cv_, __lk.mutex()->native_handle(), CLOCK_MONOTONIC, &__ts);
- if (__ec != 0 && __ec != ETIMEDOUT)
- __throw_system_error(__ec, "condition_variable timed_wait failed");
-}
-#endif // _LIBCPP_HAS_COND_CLOCKWAIT
-
-template <class _Clock>
-inline
-void
-condition_variable::__do_timed_wait(unique_lock<mutex>& __lk,
- chrono::time_point<_Clock, chrono::nanoseconds> __tp) _NOEXCEPT
-{
- wait_for(__lk, __tp - _Clock::now());
-}
-
-#endif // !_LIBCPP_HAS_NO_THREADS
-
-_LIBCPP_END_NAMESPACE_STD
-
-_LIBCPP_POP_MACROS
-
-#endif // _LIBCPP___MUTEX_BASE
diff --git a/contrib/libs/cxxsupp/libcxx/include/__node_handle b/contrib/libs/cxxsupp/libcxx/include/__node_handle
index bc49272b9f1..cc4eaf73c0b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__node_handle
+++ b/contrib/libs/cxxsupp/libcxx/include/__node_handle
@@ -68,9 +68,12 @@ public:
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
// Specialized in __tree & __hash_table for their _NodeType.
template <class _NodeType, class _Alloc>
@@ -146,7 +149,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
__basic_node_handle& operator=(__basic_node_handle&& __other)
{
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
__alloc_ == _VSTD::nullopt ||
__alloc_traits::propagate_on_container_move_assignment::value ||
__alloc_ == __other.__alloc_,
@@ -247,8 +250,10 @@ struct _LIBCPP_TEMPLATE_VIS __insert_return_type
_NodeType node;
};
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___NODE_HANDLE
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/accumulate.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/accumulate.h
index 81fc0c2943d..d75c16ead2f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__numeric/accumulate.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/accumulate.h
@@ -17,6 +17,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _InputIterator, class _Tp>
@@ -25,7 +28,7 @@ _Tp
accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
{
for (; __first != __last; ++__first)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__init = _VSTD::move(__init) + *__first;
#else
__init = __init + *__first;
@@ -39,7 +42,7 @@ _Tp
accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op)
{
for (; __first != __last; ++__first)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__init = __binary_op(_VSTD::move(__init), *__first);
#else
__init = __binary_op(__init, *__first);
@@ -49,4 +52,6 @@ accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOpe
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___NUMERIC_ACCUMULATE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/adjacent_difference.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/adjacent_difference.h
index 57e2f5b2803..4b06f9f29f8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__numeric/adjacent_difference.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/adjacent_difference.h
@@ -18,6 +18,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _InputIterator, class _OutputIterator>
@@ -32,7 +35,7 @@ adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterat
for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
typename iterator_traits<_InputIterator>::value_type __val(*__first);
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
*__result = __val - _VSTD::move(__acc);
#else
*__result = __val - __acc;
@@ -56,7 +59,7 @@ adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterat
for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
typename iterator_traits<_InputIterator>::value_type __val(*__first);
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
*__result = __binary_op(__val, _VSTD::move(__acc));
#else
*__result = __binary_op(__val, __acc);
@@ -69,4 +72,6 @@ adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterat
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___NUMERIC_ADJACENT_DIFFERENCE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/exclusive_scan.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/exclusive_scan.h
index d02e126b531..b6091f153a4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__numeric/exclusive_scan.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/exclusive_scan.h
@@ -18,9 +18,12 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
@@ -46,8 +49,10 @@ exclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __
return _VSTD::exclusive_scan(__first, __last, __result, __init, _VSTD::plus<>());
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___NUMERIC_EXCLUSIVE_SCAN_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/gcd_lcm.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/gcd_lcm.h
index 5a3f81b695e..1e5ab5713d7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__numeric/gcd_lcm.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/gcd_lcm.h
@@ -28,7 +28,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <typename _Result, typename _Source, bool _IsSigned = is_signed<_Source>::value> struct __ct_abs;
@@ -87,7 +87,7 @@ lcm(_Tp __m, _Up __n)
using _Rp = common_type_t<_Tp,_Up>;
_Rp __val1 = __ct_abs<_Rp, _Tp>()(__m) / _VSTD::gcd(__m, __n);
_Rp __val2 = __ct_abs<_Rp, _Up>()(__n);
- _LIBCPP_ASSERT((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm");
+ _LIBCPP_ASSERT_UNCATEGORIZED((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm");
return __val1 * __val2;
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/inclusive_scan.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/inclusive_scan.h
index e5bf5ac5b7d..bd963446027 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__numeric/inclusive_scan.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/inclusive_scan.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
@@ -53,7 +53,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator inclusiv
return _VSTD::inclusive_scan(__first, __last, __result, _VSTD::plus<>());
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/inner_product.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/inner_product.h
index e3d68c04c28..14144257ea9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__numeric/inner_product.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/inner_product.h
@@ -17,6 +17,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _InputIterator1, class _InputIterator2, class _Tp>
@@ -25,7 +28,7 @@ _Tp
inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init)
{
for (; __first1 != __last1; ++__first1, (void) ++__first2)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__init = _VSTD::move(__init) + *__first1 * *__first2;
#else
__init = __init + *__first1 * *__first2;
@@ -40,7 +43,7 @@ inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2
_Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2)
{
for (; __first1 != __last1; ++__first1, (void) ++__first2)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__init = __binary_op1(_VSTD::move(__init), __binary_op2(*__first1, *__first2));
#else
__init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
@@ -50,4 +53,6 @@ inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___NUMERIC_INNER_PRODUCT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/midpoint.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/midpoint.h
index bac3642cbd2..5325f5e6b32 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__numeric/midpoint.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/midpoint.h
@@ -33,7 +33,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
enable_if_t<is_integral_v<_Tp> && !is_same_v<bool, _Tp> && !is_null_pointer_v<_Tp>, _Tp>
@@ -86,7 +86,7 @@ midpoint(_Fp __a, _Fp __b) noexcept
__a/2 + __b/2; // otherwise correctly rounded
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/partial_sum.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/partial_sum.h
index 97cca582c07..76349750b62 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__numeric/partial_sum.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/partial_sum.h
@@ -18,6 +18,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _InputIterator, class _OutputIterator>
@@ -31,7 +34,7 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
*__result = __t;
for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__t = _VSTD::move(__t) + *__first;
#else
__t = __t + *__first;
@@ -54,7 +57,7 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
*__result = __t;
for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__t = __binary_op(_VSTD::move(__t), *__first);
#else
__t = __binary_op(__t, *__first);
@@ -67,4 +70,6 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___NUMERIC_PARTIAL_SUM_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_reduce.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_reduce.h
new file mode 100644
index 00000000000..163e0078e10
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_reduce.h
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___NUMERIC_PSTL_REDUCE_H
+#define _LIBCPP___NUMERIC_PSTL_REDUCE_H
+
+#include <__algorithm/pstl_frontend_dispatch.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__iterator/iterator_traits.h>
+#include <__numeric/pstl_transform_reduce.h>
+#include <__type_traits/is_execution_policy.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class>
+void __pstl_reduce();
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Tp,
+ class _BinaryOperation = plus<>,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _Tp
+reduce(_ExecutionPolicy&& __policy,
+ _ForwardIterator __first,
+ _ForwardIterator __last,
+ _Tp __init,
+ _BinaryOperation __op = {}) {
+ return std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_reduce),
+ [&__policy](_ForwardIterator __g_first, _ForwardIterator __g_last, _Tp __g_init, _BinaryOperation __g_op) {
+ return std::transform_reduce(
+ __policy, std::move(__g_first), std::move(__g_last), std::move(__g_init), std::move(__g_op), __identity{});
+ },
+ std::move(__first),
+ std::move(__last),
+ std::move(__init),
+ std::move(__op));
+}
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI __iter_value_type<_ForwardIterator>
+reduce(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last) {
+ return std::__pstl_frontend_dispatch(
+ _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_reduce),
+ [&__policy](_ForwardIterator __g_first, _ForwardIterator __g_last) {
+ return std::reduce(__policy, __g_first, __g_last, __iter_value_type<_ForwardIterator>());
+ },
+ std::move(__first),
+ std::move(__last));
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___NUMERIC_PSTL_REDUCE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_transform_reduce.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_transform_reduce.h
new file mode 100644
index 00000000000..b7c9d8d288f
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_transform_reduce.h
@@ -0,0 +1,100 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___NUMERIC_PSTL_TRANSFORM_REDUCE_H
+#define _LIBCPP___NUMERIC_PSTL_TRANSFORM_REDUCE_H
+
+#include <__algorithm/pstl_backend.h>
+#include <__algorithm/pstl_frontend_dispatch.h>
+#include <__config>
+#include <__functional/operations.h>
+#include <__numeric/transform_reduce.h>
+#include <__type_traits/is_execution_policy.h>
+#include <__utility/move.h>
+#include <__utility/terminate_on_exception.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator1,
+ class _ForwardIterator2,
+ class _Tp,
+ class _BinaryOperation1,
+ class _BinaryOperation2,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce(
+ _ExecutionPolicy&&,
+ _ForwardIterator1 __first1,
+ _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2,
+ _Tp __init,
+ _BinaryOperation1 __reduce,
+ _BinaryOperation2 __transform) {
+ using _Backend = typename __select_backend<_RawPolicy>::type;
+ return std::__pstl_transform_reduce<_RawPolicy>(
+ _Backend{},
+ std::move(__first1),
+ std::move(__last1),
+ std::move(__first2),
+ std::move(__init),
+ std::move(__reduce),
+ std::move(__transform));
+}
+
+// This overload doesn't get a customization point because it's trivial to detect (through e.g.
+// __is_trivial_plus_operation) when specializing the more general variant, which should always be preferred
+template <class _ExecutionPolicy,
+ class _ForwardIterator1,
+ class _ForwardIterator2,
+ class _Tp,
+ enable_if_t<is_execution_policy_v<__remove_cvref_t<_ExecutionPolicy>>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce(
+ _ExecutionPolicy&& __policy,
+ _ForwardIterator1 __first1,
+ _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2,
+ _Tp __init) {
+ return std::transform_reduce(__policy, __first1, __last1, __first2, __init, plus{}, multiplies{});
+}
+
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _Tp,
+ class _BinaryOperation,
+ class _UnaryOperation,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce(
+ _ExecutionPolicy&&,
+ _ForwardIterator __first,
+ _ForwardIterator __last,
+ _Tp __init,
+ _BinaryOperation __reduce,
+ _UnaryOperation __transform) {
+ using _Backend = typename __select_backend<_RawPolicy>::type;
+ return std::__pstl_transform_reduce<_RawPolicy>(
+ _Backend{},
+ std::move(__first),
+ std::move(__last),
+ std::move(__init),
+ std::move(__reduce),
+ std::move(__transform));
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___NUMERIC_PSTL_TRANSFORM_REDUCE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/reduce.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/reduce.h
index b64df05bc80..8daa7cf60e2 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__numeric/reduce.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/reduce.h
@@ -13,6 +13,7 @@
#include <__config>
#include <__functional/operations.h>
#include <__iterator/iterator_traits.h>
+#include <__utility/move.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -20,12 +21,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _Tp, class _BinaryOp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp reduce(_InputIterator __first, _InputIterator __last,
_Tp __init, _BinaryOp __b) {
for (; __first != __last; ++__first)
- __init = __b(__init, *__first);
+ __init = __b(std::move(__init), *__first);
return __init;
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_exclusive_scan.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_exclusive_scan.h
index afbcdb8db83..3d5574c7d0a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_exclusive_scan.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_exclusive_scan.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _OutputIterator, class _Tp,
class _BinaryOp, class _UnaryOp>
@@ -42,7 +42,7 @@ transform_exclusive_scan(_InputIterator __first, _InputIterator __last,
return __result;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_inclusive_scan.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_inclusive_scan.h
index c050041bc15..ee9168928ae 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_inclusive_scan.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_inclusive_scan.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp, class _UnaryOp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -51,7 +51,7 @@ transform_inclusive_scan(_InputIterator __first, _InputIterator __last,
return __result;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_reduce.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_reduce.h
index d997521a95e..7e47f34d374 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_reduce.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_reduce.h
@@ -20,13 +20,13 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _Tp, class _BinaryOp, class _UnaryOp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp transform_reduce(_InputIterator __first,
_InputIterator __last, _Tp __init,
_BinaryOp __b, _UnaryOp __u) {
for (; __first != __last; ++__first)
- __init = __b(__init, __u(*__first));
+ __init = __b(std::move(__init), __u(*__first));
return __init;
}
@@ -36,7 +36,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp transform_reduce(_In
_InputIterator2 __first2, _Tp __init,
_BinaryOp1 __b1, _BinaryOp2 __b2) {
for (; __first1 != __last1; ++__first1, (void)++__first2)
- __init = __b1(__init, __b2(*__first1, *__first2));
+ __init = __b1(std::move(__init), __b2(*__first1, *__first2));
return __init;
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/binomial_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/binomial_distribution.h
index 6e55167873a..7da71ad3de6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/binomial_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/binomial_distribution.h
@@ -42,7 +42,7 @@ public:
public:
typedef binomial_distribution distribution_type;
- explicit param_type(result_type __t = 1, double __p = 0.5);
+ _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __t = 1, double __p = 0.5);
_LIBCPP_INLINE_VISIBILITY
result_type t() const {return __t_;}
@@ -85,7 +85,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/clamp_to_integral.h b/contrib/libs/cxxsupp/libcxx/include/__random/clamp_to_integral.h
index 7d44ff9cfca..c67d76d6e9b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/clamp_to_integral.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/clamp_to_integral.h
@@ -12,7 +12,6 @@
#include <__config>
#include <cmath>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -44,8 +43,8 @@ template <class _IntT, class _RealT>
_LIBCPP_INLINE_VISIBILITY
_IntT __clamp_to_integral(_RealT __r) _NOEXCEPT {
using _Lim = numeric_limits<_IntT>;
- const _IntT _MaxVal = __max_representable_int_for_float<_IntT, _RealT>();
- if (__r >= ::nextafter(static_cast<_RealT>(_MaxVal), INFINITY)) {
+ const _IntT __max_val = __max_representable_int_for_float<_IntT, _RealT>();
+ if (__r >= ::nextafter(static_cast<_RealT>(__max_val), INFINITY)) {
return _Lim::max();
} else if (__r <= _Lim::lowest()) {
return _Lim::min();
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/discard_block_engine.h b/contrib/libs/cxxsupp/libcxx/include/__random/discard_block_engine.h
index db33623d948..7bdcb6555cd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/discard_block_engine.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/discard_block_engine.h
@@ -11,10 +11,12 @@
#include <__config>
#include <__random/is_seed_sequence.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_convertible.h>
#include <__utility/move.h>
+#include <cstddef>
#include <iosfwd>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -90,7 +92,7 @@ public:
seed(_Sseq& __q) {__e_.seed(__q); __n_ = 0;}
// generating functions
- result_type operator()();
+ _LIBCPP_HIDE_FROM_ABI result_type operator()();
_LIBCPP_INLINE_VISIBILITY
void discard(unsigned long long __z) {for (; __z; --__z) operator()();}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/discrete_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/discrete_distribution.h
index 03f49ba8723..a6546faae85 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/discrete_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/discrete_distribution.h
@@ -53,10 +53,10 @@ public:
: __p_(__wl.begin(), __wl.end()) {__init();}
#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
- param_type(size_t __nw, double __xmin, double __xmax,
+ _LIBCPP_HIDE_FROM_ABI param_type(size_t __nw, double __xmin, double __xmax,
_UnaryOperation __fw);
- vector<double> probabilities() const;
+ _LIBCPP_HIDE_FROM_ABI vector<double> probabilities() const;
friend _LIBCPP_INLINE_VISIBILITY
bool operator==(const param_type& __x, const param_type& __y)
@@ -66,7 +66,7 @@ public:
{return !(__x == __y);}
private:
- void __init();
+ _LIBCPP_HIDE_FROM_ABI void __init();
friend class discrete_distribution;
@@ -115,7 +115,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/exponential_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/exponential_distribution.h
index 8edf1ac3f68..b33b072eca0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/exponential_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/exponential_distribution.h
@@ -79,7 +79,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/extreme_value_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/extreme_value_distribution.h
index b3cba392490..c583ec06a31 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/extreme_value_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/extreme_value_distribution.h
@@ -84,7 +84,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/fisher_f_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/fisher_f_distribution.h
index b5479acb47c..b757607bc46 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/fisher_f_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/fisher_f_distribution.h
@@ -82,7 +82,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/gamma_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/gamma_distribution.h
index 0d7fc3f8280..777f6b5c76d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/gamma_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/gamma_distribution.h
@@ -85,7 +85,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/generate_canonical.h b/contrib/libs/cxxsupp/libcxx/include/__random/generate_canonical.h
index 5fada6df590..5f0aa6fd850 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/generate_canonical.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/generate_canonical.h
@@ -30,20 +30,20 @@ template<class _RealType, size_t __bits, class _URNG>
_LIBCPP_HIDE_FROM_ABI _RealType
generate_canonical(_URNG& __g)
{
- const size_t _Dt = numeric_limits<_RealType>::digits;
- const size_t __b = _Dt < __bits ? _Dt : __bits;
+ const size_t __dt = numeric_limits<_RealType>::digits;
+ const size_t __b = __dt < __bits ? __dt : __bits;
#ifdef _LIBCPP_CXX03_LANG
- const size_t __logR = __log2<uint64_t, _URNG::_Max - _URNG::_Min + uint64_t(1)>::value;
+ const size_t __log_r = __log2<uint64_t, _URNG::_Max - _URNG::_Min + uint64_t(1)>::value;
#else
- const size_t __logR = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value;
+ const size_t __log_r = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value;
#endif
- const size_t __k = __b / __logR + (__b % __logR != 0) + (__b == 0);
- const _RealType _Rp = static_cast<_RealType>(_URNG::max() - _URNG::min()) + _RealType(1);
- _RealType __base = _Rp;
- _RealType _Sp = __g() - _URNG::min();
- for (size_t __i = 1; __i < __k; ++__i, __base *= _Rp)
- _Sp += (__g() - _URNG::min()) * __base;
- return _Sp / __base;
+ const size_t __k = __b / __log_r + (__b % __log_r != 0) + (__b == 0);
+ const _RealType __rp = static_cast<_RealType>(_URNG::max() - _URNG::min()) + _RealType(1);
+ _RealType __base = __rp;
+ _RealType __sp = __g() - _URNG::min();
+ for (size_t __i = 1; __i < __k; ++__i, __base *= __rp)
+ __sp += (__g() - _URNG::min()) * __base;
+ return __sp / __base;
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/independent_bits_engine.h b/contrib/libs/cxxsupp/libcxx/include/__random/independent_bits_engine.h
index 151492a81bd..a86c22157d0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/independent_bits_engine.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/independent_bits_engine.h
@@ -12,10 +12,13 @@
#include <__config>
#include <__random/is_seed_sequence.h>
#include <__random/log2.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_convertible.h>
#include <__utility/move.h>
+#include <cstddef>
#include <iosfwd>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -161,7 +164,7 @@ public:
private:
_LIBCPP_INLINE_VISIBILITY
result_type __eval(false_type);
- result_type __eval(true_type);
+ _LIBCPP_HIDE_FROM_ABI result_type __eval(true_type);
template <size_t __count>
_LIBCPP_INLINE_VISIBILITY
@@ -196,7 +199,7 @@ template<class _Engine, size_t __w, class _UIntType>
_UIntType
independent_bits_engine<_Engine, __w, _UIntType>::__eval(true_type)
{
- result_type _Sp = 0;
+ result_type __sp = 0;
for (size_t __k = 0; __k < __n0; ++__k)
{
_Engine_result_type __u;
@@ -204,7 +207,7 @@ independent_bits_engine<_Engine, __w, _UIntType>::__eval(true_type)
{
__u = __e_() - _Engine::min();
} while (__u >= __y0);
- _Sp = static_cast<result_type>(__lshift<__w0>(_Sp) + (__u & __mask0));
+ __sp = static_cast<result_type>(__lshift<__w0>(__sp) + (__u & __mask0));
}
for (size_t __k = __n0; __k < __n; ++__k)
{
@@ -213,9 +216,9 @@ independent_bits_engine<_Engine, __w, _UIntType>::__eval(true_type)
{
__u = __e_() - _Engine::min();
} while (__u >= __y1);
- _Sp = static_cast<result_type>(__lshift<__w0+1>(_Sp) + (__u & __mask1));
+ __sp = static_cast<result_type>(__lshift<__w0+1>(__sp) + (__u & __mask1));
}
- return _Sp;
+ return __sp;
}
template<class _Eng, size_t _Wp, class _UInt>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/is_seed_sequence.h b/contrib/libs/cxxsupp/libcxx/include/__random/is_seed_sequence.h
index 3c82b2790b0..06621c3cee0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/is_seed_sequence.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/is_seed_sequence.h
@@ -10,7 +10,9 @@
#define _LIBCPP___RANDOM_IS_SEED_SEQUENCE_H
#include <__config>
-#include <type_traits>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/remove_cv.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/is_valid.h b/contrib/libs/cxxsupp/libcxx/include/__random/is_valid.h
index 1d65de00fbb..113452bc5d3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/is_valid.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/is_valid.h
@@ -10,8 +10,12 @@
#define _LIBCPP___RANDOM_IS_VALID_H
#include <__config>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_unsigned.h>
+#include <__utility/declval.h>
#include <cstdint>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/linear_congruential_engine.h b/contrib/libs/cxxsupp/libcxx/include/__random/linear_congruential_engine.h
index 0d91f14120b..2c2276eccf0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/linear_congruential_engine.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/linear_congruential_engine.h
@@ -11,9 +11,11 @@
#include <__config>
#include <__random/is_seed_sequence.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_unsigned.h>
#include <cstdint>
#include <iosfwd>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -294,9 +296,9 @@ private:
void seed(false_type, false_type, result_type __s) {__x_ = __s % __m;}
template<class _Sseq>
- void __seed(_Sseq& __q, integral_constant<unsigned, 1>);
+ _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 1>);
template<class _Sseq>
- void __seed(_Sseq& __q, integral_constant<unsigned, 2>);
+ _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 2>);
template <class _CharT, class _Traits,
class _Up, _Up _Ap, _Up _Cp, _Up _Np>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/log2.h b/contrib/libs/cxxsupp/libcxx/include/__random/log2.h
index 72bf0759eea..4ccd1ddc9bf 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/log2.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/log2.h
@@ -10,8 +10,8 @@
#define _LIBCPP___RANDOM_LOG2_H
#include <__config>
+#include <__type_traits/conditional.h>
#include <cstddef>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/lognormal_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/lognormal_distribution.h
index 048d7dade9e..1e8ac39dbac 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/lognormal_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/lognormal_distribution.h
@@ -24,142 +24,6 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#ifdef _LIBCPP_ABI_OLD_LOGNORMAL_DISTRIBUTION
-
-template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS lognormal_distribution
-{
-public:
- // types
- typedef _RealType result_type;
-
- class _LIBCPP_TEMPLATE_VIS param_type
- {
- normal_distribution<result_type> __nd_;
- public:
- typedef lognormal_distribution distribution_type;
-
- _LIBCPP_INLINE_VISIBILITY
- explicit param_type(result_type __m = 0, result_type __s = 1)
- : __nd_(__m, __s) {}
-
- _LIBCPP_INLINE_VISIBILITY
- result_type m() const {return __nd_.mean();}
- _LIBCPP_INLINE_VISIBILITY
- result_type s() const {return __nd_.stddev();}
-
- friend _LIBCPP_INLINE_VISIBILITY
- bool operator==(const param_type& __x, const param_type& __y)
- {return __x.__nd_ == __y.__nd_;}
- friend _LIBCPP_INLINE_VISIBILITY
- bool operator!=(const param_type& __x, const param_type& __y)
- {return !(__x == __y);}
- friend class lognormal_distribution;
-
- template <class _CharT, class _Traits, class _RT>
- friend
- basic_ostream<_CharT, _Traits>&
- operator<<(basic_ostream<_CharT, _Traits>& __os,
- const lognormal_distribution<_RT>& __x);
-
- template <class _CharT, class _Traits, class _RT>
- friend
- basic_istream<_CharT, _Traits>&
- operator>>(basic_istream<_CharT, _Traits>& __is,
- lognormal_distribution<_RT>& __x);
- };
-
-private:
- param_type __p_;
-
-public:
- // constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY
- lognormal_distribution() : lognormal_distribution(0) {}
- _LIBCPP_INLINE_VISIBILITY
- explicit lognormal_distribution(result_type __m, result_type __s = 1)
- : __p_(param_type(__m, __s)) {}
-#else
- _LIBCPP_INLINE_VISIBILITY
- explicit lognormal_distribution(result_type __m = 0,
- result_type __s = 1)
- : __p_(param_type(__m, __s)) {}
-#endif
- _LIBCPP_INLINE_VISIBILITY
- explicit lognormal_distribution(const param_type& __p)
- : __p_(__p) {}
- _LIBCPP_INLINE_VISIBILITY
- void reset() {__p_.__nd_.reset();}
-
- // generating functions
- template<class _URNG>
- _LIBCPP_INLINE_VISIBILITY
- result_type operator()(_URNG& __g)
- {return (*this)(__g, __p_);}
- template<class _URNG>
- _LIBCPP_INLINE_VISIBILITY
- result_type operator()(_URNG& __g, const param_type& __p)
- {return _VSTD::exp(const_cast<normal_distribution<result_type>&>(__p.__nd_)(__g));}
-
- // property functions
- _LIBCPP_INLINE_VISIBILITY
- result_type m() const {return __p_.m();}
- _LIBCPP_INLINE_VISIBILITY
- result_type s() const {return __p_.s();}
-
- _LIBCPP_INLINE_VISIBILITY
- param_type param() const {return __p_;}
- _LIBCPP_INLINE_VISIBILITY
- void param(const param_type& __p) {__p_ = __p;}
-
- _LIBCPP_INLINE_VISIBILITY
- result_type min() const {return 0;}
- _LIBCPP_INLINE_VISIBILITY
- result_type max() const {return numeric_limits<result_type>::infinity();}
-
- friend _LIBCPP_INLINE_VISIBILITY
- bool operator==(const lognormal_distribution& __x,
- const lognormal_distribution& __y)
- {return __x.__p_ == __y.__p_;}
- friend _LIBCPP_INLINE_VISIBILITY
- bool operator!=(const lognormal_distribution& __x,
- const lognormal_distribution& __y)
- {return !(__x == __y);}
-
- template <class _CharT, class _Traits, class _RT>
- friend
- basic_ostream<_CharT, _Traits>&
- operator<<(basic_ostream<_CharT, _Traits>& __os,
- const lognormal_distribution<_RT>& __x);
-
- template <class _CharT, class _Traits, class _RT>
- friend
- basic_istream<_CharT, _Traits>&
- operator>>(basic_istream<_CharT, _Traits>& __is,
- lognormal_distribution<_RT>& __x);
-};
-
-template <class _CharT, class _Traits, class _RT>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_ostream<_CharT, _Traits>&
-operator<<(basic_ostream<_CharT, _Traits>& __os,
- const lognormal_distribution<_RT>& __x)
-{
- return __os << __x.__p_.__nd_;
-}
-
-template <class _CharT, class _Traits, class _RT>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_istream<_CharT, _Traits>&
-operator>>(basic_istream<_CharT, _Traits>& __is,
- lognormal_distribution<_RT>& __x)
-{
- return __is >> __x.__p_.__nd_;
-}
-
-#else // _LIBCPP_ABI_OLD_LOGNORMAL_DISTRIBUTION
-
template<class _RealType = double>
class _LIBCPP_TEMPLATE_VIS lognormal_distribution
{
@@ -290,8 +154,6 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
return __is >> __x.__nd_;
}
-#endif // _LIBCPP_ABI_OLD_LOGNORMAL_DISTRIBUTION
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/mersenne_twister_engine.h b/contrib/libs/cxxsupp/libcxx/include/__random/mersenne_twister_engine.h
index 3a58e311b00..663a6c704b7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/mersenne_twister_engine.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/mersenne_twister_engine.h
@@ -17,7 +17,6 @@
#include <cstdint>
#include <iosfwd>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -141,7 +140,7 @@ public:
explicit mersenne_twister_engine(_Sseq& __q,
typename enable_if<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value>::type* = 0)
{seed(__q);}
- void seed(result_type __sd = default_seed);
+ _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd = default_seed);
template<class _Sseq>
_LIBCPP_INLINE_VISIBILITY
typename enable_if
@@ -153,7 +152,7 @@ public:
{__seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());}
// generating functions
- result_type operator()();
+ _LIBCPP_HIDE_FROM_ABI result_type operator()();
_LIBCPP_INLINE_VISIBILITY
void discard(unsigned long long __z) {for (; __z; --__z) operator()();}
@@ -199,9 +198,9 @@ public:
private:
template<class _Sseq>
- void __seed(_Sseq& __q, integral_constant<unsigned, 1>);
+ _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 1>);
template<class _Sseq>
- void __seed(_Sseq& __q, integral_constant<unsigned, 2>);
+ _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 2>);
template <size_t __count>
_LIBCPP_INLINE_VISIBILITY
@@ -403,9 +402,9 @@ mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b,
const size_t __j = (__i_ + 1) % __n;
const result_type __mask = __r == _Dt ? result_type(~0) :
(result_type(1) << __r) - result_type(1);
- const result_type _Yp = (__x_[__i_] & ~__mask) | (__x_[__j] & __mask);
+ const result_type __yp = (__x_[__i_] & ~__mask) | (__x_[__j] & __mask);
const size_t __k = (__i_ + __m) % __n;
- __x_[__i_] = __x_[__k] ^ __rshift<1>(_Yp) ^ (__a * (_Yp & 1));
+ __x_[__i_] = __x_[__k] ^ __rshift<1>(__yp) ^ (__a * (__yp & 1));
result_type __z = __x_[__i_] ^ (__rshift<__u>(__x_[__i_]) & __d);
__i_ = __j;
__z ^= __lshift<__s>(__z) & __b;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/negative_binomial_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/negative_binomial_distribution.h
index 333c9350cd7..21942710feb 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/negative_binomial_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/negative_binomial_distribution.h
@@ -85,7 +85,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
@@ -135,8 +136,9 @@ negative_binomial_distribution<_IntType>::operator()(_URNG& __urng, const param_
else
++__f;
}
- _LIBCPP_ASSERT(__f >= 0, "std::negative_binomial_distribution should never produce negative values. "
- "This is almost certainly a signed integer overflow issue on __f.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__f >= 0,
+ "std::negative_binomial_distribution should never produce negative values. "
+ "This is almost certainly a signed integer overflow issue on __f.");
return __f;
}
return poisson_distribution<result_type>(gamma_distribution<double>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/normal_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/normal_distribution.h
index b2ed47e6af4..e2bf041b71f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/normal_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/normal_distribution.h
@@ -86,7 +86,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
@@ -133,30 +134,30 @@ _RealType
normal_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
{
static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
- result_type _Up;
+ result_type __up;
if (__v_hot_)
{
__v_hot_ = false;
- _Up = __v_;
+ __up = __v_;
}
else
{
- uniform_real_distribution<result_type> _Uni(-1, 1);
+ uniform_real_distribution<result_type> __uni(-1, 1);
result_type __u;
result_type __v;
result_type __s;
do
{
- __u = _Uni(__g);
- __v = _Uni(__g);
+ __u = __uni(__g);
+ __v = __uni(__g);
__s = __u * __u + __v * __v;
} while (__s > 1 || __s == 0);
- result_type _Fp = _VSTD::sqrt(-2 * _VSTD::log(__s) / __s);
- __v_ = __v * _Fp;
+ result_type __fp = _VSTD::sqrt(-2 * _VSTD::log(__s) / __s);
+ __v_ = __v * __fp;
__v_hot_ = true;
- _Up = __u * _Fp;
+ __up = __u * __fp;
}
- return _Up * __p.stddev() + __p.mean();
+ return __up * __p.stddev() + __p.mean();
}
template <class _CharT, class _Traits, class _RT>
@@ -189,16 +190,16 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
__is.flags(_Istream::dec | _Istream::skipws);
result_type __mean;
result_type __stddev;
- result_type _Vp = 0;
- bool _V_hot = false;
- __is >> __mean >> __stddev >> _V_hot;
- if (_V_hot)
- __is >> _Vp;
+ result_type __vp = 0;
+ bool __v_hot = false;
+ __is >> __mean >> __stddev >> __v_hot;
+ if (__v_hot)
+ __is >> __vp;
if (!__is.fail())
{
__x.param(param_type(__mean, __stddev));
- __x.__v_hot_ = _V_hot;
- __x.__v_ = _Vp;
+ __x.__v_hot_ = __v_hot;
+ __x.__v_ = __vp;
}
return __is;
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/piecewise_constant_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/piecewise_constant_distribution.h
index a1f3ef9df50..5b26ab65e63 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/piecewise_constant_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/piecewise_constant_distribution.h
@@ -41,19 +41,19 @@ public:
public:
typedef piecewise_constant_distribution distribution_type;
- param_type();
+ _LIBCPP_HIDE_FROM_ABI param_type();
template<class _InputIteratorB, class _InputIteratorW>
- param_type(_InputIteratorB __f_b, _InputIteratorB __l_b,
+ _LIBCPP_HIDE_FROM_ABI param_type(_InputIteratorB __f_b, _InputIteratorB __l_b,
_InputIteratorW __f_w);
#ifndef _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
- param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
+ _LIBCPP_HIDE_FROM_ABI param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
- param_type(size_t __nw, result_type __xmin, result_type __xmax,
+ _LIBCPP_HIDE_FROM_ABI param_type(size_t __nw, result_type __xmin, result_type __xmax,
_UnaryOperation __fw);
- param_type(param_type const&) = default;
- param_type & operator=(const param_type& __rhs);
+ _LIBCPP_HIDE_FROM_ABI param_type(param_type const&) = default;
+ _LIBCPP_HIDE_FROM_ABI param_type & operator=(const param_type& __rhs);
_LIBCPP_INLINE_VISIBILITY
vector<result_type> intervals() const {return __b_;}
@@ -68,7 +68,7 @@ public:
{return !(__x == __y);}
private:
- void __init();
+ _LIBCPP_HIDE_FROM_ABI void __init();
friend class piecewise_constant_distribution;
@@ -125,7 +125,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/piecewise_linear_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/piecewise_linear_distribution.h
index fc2eb47c7b0..6be44b29fcc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/piecewise_linear_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/piecewise_linear_distribution.h
@@ -41,19 +41,19 @@ public:
public:
typedef piecewise_linear_distribution distribution_type;
- param_type();
+ _LIBCPP_HIDE_FROM_ABI param_type();
template<class _InputIteratorB, class _InputIteratorW>
- param_type(_InputIteratorB __f_b, _InputIteratorB __l_b,
+ _LIBCPP_HIDE_FROM_ABI param_type(_InputIteratorB __f_b, _InputIteratorB __l_b,
_InputIteratorW __f_w);
#ifndef _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
- param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
+ _LIBCPP_HIDE_FROM_ABI param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
- param_type(size_t __nw, result_type __xmin, result_type __xmax,
+ _LIBCPP_HIDE_FROM_ABI param_type(size_t __nw, result_type __xmin, result_type __xmax,
_UnaryOperation __fw);
- param_type(param_type const&) = default;
- param_type & operator=(const param_type& __rhs);
+ _LIBCPP_HIDE_FROM_ABI param_type(param_type const&) = default;
+ _LIBCPP_HIDE_FROM_ABI param_type & operator=(const param_type& __rhs);
_LIBCPP_INLINE_VISIBILITY
vector<result_type> intervals() const {return __b_;}
@@ -68,7 +68,7 @@ public:
{return !(__x == __y);}
private:
- void __init();
+ _LIBCPP_HIDE_FROM_ABI void __init();
friend class piecewise_linear_distribution;
@@ -125,7 +125,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
@@ -188,23 +189,23 @@ void
piecewise_linear_distribution<_RealType>::param_type::__init()
{
__areas_.assign(__densities_.size() - 1, result_type());
- result_type _Sp = 0;
+ result_type __sp = 0;
for (size_t __i = 0; __i < __areas_.size(); ++__i)
{
__areas_[__i] = (__densities_[__i+1] + __densities_[__i]) *
(__b_[__i+1] - __b_[__i]) * .5;
- _Sp += __areas_[__i];
+ __sp += __areas_[__i];
}
for (size_t __i = __areas_.size(); __i > 1;)
{
--__i;
- __areas_[__i] = __areas_[__i-1] / _Sp;
+ __areas_[__i] = __areas_[__i-1] / __sp;
}
__areas_[0] = 0;
for (size_t __i = 1; __i < __areas_.size(); ++__i)
__areas_[__i] += __areas_[__i-1];
for (size_t __i = 0; __i < __densities_.size(); ++__i)
- __densities_[__i] /= _Sp;
+ __densities_[__i] /= __sp;
}
template<class _RealType>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/poisson_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/poisson_distribution.h
index 334c6102b34..eed120ebb7a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/poisson_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/poisson_distribution.h
@@ -52,7 +52,7 @@ public:
public:
typedef poisson_distribution distribution_type;
- explicit param_type(double __mean = 1.0);
+ _LIBCPP_HIDE_FROM_ABI explicit param_type(double __mean = 1.0);
_LIBCPP_INLINE_VISIBILITY
double mean() const {return __mean_;}
@@ -93,7 +93,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
@@ -144,12 +145,12 @@ poisson_distribution<_IntType>::param_type::param_type(double __mean)
__d_ = 6 * __mean_ * __mean_;
__l_ = _VSTD::trunc(__mean_ - 1.1484);
__omega_ = .3989423 / __s_;
- double __b1_ = .4166667E-1 / __mean_;
- double __b2_ = .3 * __b1_ * __b1_;
- __c3_ = .1428571 * __b1_ * __b2_;
- __c2_ = __b2_ - 15. * __c3_;
- __c1_ = __b1_ - 6. * __b2_ + 45. * __c3_;
- __c0_ = 1. - __b1_ + 3. * __b2_ - 15. * __c3_;
+ double __b1 = .4166667E-1 / __mean_;
+ double __b2 = .3 * __b1 * __b1;
+ __c3_ = .1428571 * __b1 * __b2;
+ __c2_ = __b2 - 15. * __c3_;
+ __c1_ = __b1 - 6. * __b2 + 45. * __c3_;
+ __c0_ = 1. - __b1 + 3. * __b2 - 15. * __c3_;
__c_ = .1069 / __mean_;
}
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/random_device.h b/contrib/libs/cxxsupp/libcxx/include/__random/random_device.h
index e82b437a3b5..e7c37241a72 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/random_device.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/random_device.h
@@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if !defined(_LIBCPP_HAS_NO_RANDOM_DEVICE)
-class _LIBCPP_TYPE_VIS random_device
+class _LIBCPP_EXPORTED_FROM_ABI random_device
{
#ifdef _LIBCPP_USING_DEV_RANDOM
int __f_;
@@ -58,7 +58,7 @@ public:
// constructors
#ifndef _LIBCPP_CXX03_LANG
- random_device() : random_device("/dev/urandom") {}
+ _LIBCPP_HIDE_FROM_ABI random_device() : random_device("/dev/urandom") {}
explicit random_device(const string& __token);
#else
explicit random_device(const string& __token = "/dev/urandom");
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/seed_seq.h b/contrib/libs/cxxsupp/libcxx/include/__random/seed_seq.h
index 330537fa002..506b979cf81 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/seed_seq.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/seed_seq.h
@@ -13,6 +13,8 @@
#include <__algorithm/fill.h>
#include <__algorithm/max.h>
#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <cstdint>
#include <initializer_list>
#include <vector>
@@ -52,7 +54,7 @@ public:
// generating functions
template<class _RandomAccessIterator>
- void generate(_RandomAccessIterator __first, _RandomAccessIterator __last);
+ _LIBCPP_HIDE_FROM_ABI void generate(_RandomAccessIterator __first, _RandomAccessIterator __last);
// property functions
_LIBCPP_INLINE_VISIBILITY
@@ -70,7 +72,7 @@ public:
private:
template<class _InputIterator>
- void __init(_InputIterator __first, _InputIterator __last);
+ _LIBCPP_HIDE_FROM_ABI void __init(_InputIterator __first, _InputIterator __last);
vector<result_type> __v_;
};
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/shuffle_order_engine.h b/contrib/libs/cxxsupp/libcxx/include/__random/shuffle_order_engine.h
index 4a27289c2f8..e07f230d21c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/shuffle_order_engine.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/shuffle_order_engine.h
@@ -12,10 +12,13 @@
#include <__algorithm/equal.h>
#include <__config>
#include <__random/is_seed_sequence.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_convertible.h>
#include <__utility/move.h>
+#include <cstddef>
#include <cstdint>
#include <iosfwd>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -201,10 +204,10 @@ private:
_LIBCPP_INLINE_VISIBILITY
result_type __evalf()
{
- const double _Fp = __d == 0 ?
+ const double __fp = __d == 0 ?
__n / (2. * 0x8000000000000000ull) :
__n / (double)__d;
- const size_t __j = static_cast<size_t>(_Fp * (__y_ - _Min));
+ const size_t __j = static_cast<size_t>(__fp * (__y_ - _Min));
__y_ = __v_[__j];
__v_[__j] = __e_();
return __y_;
@@ -262,16 +265,16 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
typedef basic_istream<_CharT, _Traits> _Istream;
__is.flags(_Istream::dec | _Istream::skipws);
_Eng __e;
- result_type _Vp[_Kp+1];
+ result_type __vp[_Kp+1];
__is >> __e;
for (size_t __i = 0; __i < _Kp+1; ++__i)
- __is >> _Vp[__i];
+ __is >> __vp[__i];
if (!__is.fail())
{
__x.__e_ = __e;
for (size_t __i = 0; __i < _Kp; ++__i)
- __x.__v_[__i] = _Vp[__i];
- __x.__y_ = _Vp[_Kp];
+ __x.__v_[__i] = __vp[__i];
+ __x.__y_ = __vp[_Kp];
}
return __is;
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/student_t_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/student_t_distribution.h
index 64847aa66ae..2d2be23657a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/student_t_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/student_t_distribution.h
@@ -81,7 +81,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/subtract_with_carry_engine.h b/contrib/libs/cxxsupp/libcxx/include/__random/subtract_with_carry_engine.h
index b25ca84e3af..c8954ca1119 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/subtract_with_carry_engine.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/subtract_with_carry_engine.h
@@ -18,7 +18,6 @@
#include <cstdint>
#include <iosfwd>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -121,7 +120,7 @@ public:
{__seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());}
// generating functions
- result_type operator()();
+ _LIBCPP_HIDE_FROM_ABI result_type operator()();
_LIBCPP_INLINE_VISIBILITY
void discard(unsigned long long __z) {for (; __z; --__z) operator()();}
@@ -155,12 +154,12 @@ public:
private:
- void seed(result_type __sd, integral_constant<unsigned, 1>);
- void seed(result_type __sd, integral_constant<unsigned, 2>);
+ _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd, integral_constant<unsigned, 1>);
+ _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd, integral_constant<unsigned, 2>);
template<class _Sseq>
- void __seed(_Sseq& __q, integral_constant<unsigned, 1>);
+ _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 1>);
template<class _Sseq>
- void __seed(_Sseq& __q, integral_constant<unsigned, 2>);
+ _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 2>);
};
template<class _UIntType, size_t __w, size_t __s, size_t __r>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/uniform_int_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/uniform_int_distribution.h
index b7db8a3f9cb..3a2b95c035b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/uniform_int_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/uniform_int_distribution.h
@@ -9,15 +9,16 @@
#ifndef _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H
#define _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H
+#include <__bit/countl.h>
#include <__config>
#include <__random/is_valid.h>
#include <__random/log2.h>
-#include <bit>
+#include <__type_traits/conditional.h>
+#include <__type_traits/make_unsigned.h>
#include <cstddef>
#include <cstdint>
#include <iosfwd>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -63,14 +64,14 @@ private:
public:
// constructors and seeding functions
- __independent_bits_engine(_Engine& __e, size_t __w);
+ _LIBCPP_HIDE_FROM_ABI __independent_bits_engine(_Engine& __e, size_t __w);
// generating functions
- result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());}
+ _LIBCPP_HIDE_FROM_ABI result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());}
private:
- result_type __eval(false_type);
- result_type __eval(true_type);
+ _LIBCPP_HIDE_FROM_ABI result_type __eval(false_type);
+ _LIBCPP_HIDE_FROM_ABI result_type __eval(true_type);
};
template<class _Engine, class _UIntType>
@@ -120,8 +121,8 @@ template<class _Engine, class _UIntType>
_UIntType
__independent_bits_engine<_Engine, _UIntType>::__eval(true_type)
{
- const size_t _WRt = numeric_limits<result_type>::digits;
- result_type _Sp = 0;
+ const size_t __w_rt = numeric_limits<result_type>::digits;
+ result_type __sp = 0;
for (size_t __k = 0; __k < __n0_; ++__k)
{
_Engine_result_type __u;
@@ -129,11 +130,11 @@ __independent_bits_engine<_Engine, _UIntType>::__eval(true_type)
{
__u = __e_() - _Engine::min();
} while (__u >= __y0_);
- if (__w0_ < _WRt)
- _Sp <<= __w0_;
+ if (__w0_ < __w_rt)
+ __sp <<= __w0_;
else
- _Sp = 0;
- _Sp += __u & __mask0_;
+ __sp = 0;
+ __sp += __u & __mask0_;
}
for (size_t __k = __n0_; __k < __n_; ++__k)
{
@@ -142,13 +143,13 @@ __independent_bits_engine<_Engine, _UIntType>::__eval(true_type)
{
__u = __e_() - _Engine::min();
} while (__u >= __y1_);
- if (__w0_ < _WRt - 1)
- _Sp <<= __w0_ + 1;
+ if (__w0_ < __w_rt - 1)
+ __sp <<= __w0_ + 1;
else
- _Sp = 0;
- _Sp += __u & __mask1_;
+ __sp = 0;
+ __sp += __u & __mask1_;
}
- return _Sp;
+ return __sp;
}
template<class _IntType = int>
@@ -166,12 +167,12 @@ public:
public:
typedef uniform_int_distribution distribution_type;
- explicit param_type(result_type __a = 0,
+ _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0,
result_type __b = numeric_limits<result_type>::max())
: __a_(__a), __b_(__b) {}
- result_type a() const {return __a_;}
- result_type b() const {return __b_;}
+ _LIBCPP_HIDE_FROM_ABI result_type a() const {return __a_;}
+ _LIBCPP_HIDE_FROM_ABI result_type b() const {return __b_;}
_LIBCPP_HIDE_FROM_ABI
friend bool operator==(const param_type& __x, const param_type& __y)
@@ -187,8 +188,8 @@ private:
public:
// constructors and reset functions
#ifndef _LIBCPP_CXX03_LANG
- uniform_int_distribution() : uniform_int_distribution(0) {}
- explicit uniform_int_distribution(
+ _LIBCPP_HIDE_FROM_ABI uniform_int_distribution() : uniform_int_distribution(0) {}
+ _LIBCPP_HIDE_FROM_ABI explicit uniform_int_distribution(
result_type __a, result_type __b = numeric_limits<result_type>::max())
: __p_(param_type(__a, __b)) {}
#else
@@ -197,23 +198,25 @@ public:
result_type __b = numeric_limits<result_type>::max())
: __p_(param_type(__a, __b)) {}
#endif
- explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {}
- void reset() {}
+ _LIBCPP_HIDE_FROM_ABI explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {}
+ _LIBCPP_HIDE_FROM_ABI void reset() {}
// generating functions
- template<class _URNG> result_type operator()(_URNG& __g)
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG>
+ _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
// property functions
- result_type a() const {return __p_.a();}
- result_type b() const {return __p_.b();}
+ _LIBCPP_HIDE_FROM_ABI result_type a() const {return __p_.a();}
+ _LIBCPP_HIDE_FROM_ABI result_type b() const {return __p_.b();}
- param_type param() const {return __p_;}
- void param(const param_type& __p) {__p_ = __p;}
+ _LIBCPP_HIDE_FROM_ABI param_type param() const {return __p_;}
+ _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) {__p_ = __p;}
- result_type min() const {return a();}
- result_type max() const {return b();}
+ _LIBCPP_HIDE_FROM_ABI result_type min() const {return a();}
+ _LIBCPP_HIDE_FROM_ABI result_type max() const {return b();}
_LIBCPP_HIDE_FROM_ABI
friend bool operator==(const uniform_int_distribution& __x,
@@ -234,22 +237,22 @@ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
typedef __conditional_t<sizeof(result_type) <= sizeof(uint32_t), uint32_t, __make_unsigned_t<result_type> >
_UIntType;
- const _UIntType _Rp = _UIntType(__p.b()) - _UIntType(__p.a()) + _UIntType(1);
- if (_Rp == 1)
+ const _UIntType __rp = _UIntType(__p.b()) - _UIntType(__p.a()) + _UIntType(1);
+ if (__rp == 1)
return __p.a();
- const size_t _Dt = numeric_limits<_UIntType>::digits;
+ const size_t __dt = numeric_limits<_UIntType>::digits;
typedef __independent_bits_engine<_URNG, _UIntType> _Eng;
- if (_Rp == 0)
- return static_cast<result_type>(_Eng(__g, _Dt)());
- size_t __w = _Dt - std::__countl_zero(_Rp) - 1;
- if ((_Rp & (numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0)
+ if (__rp == 0)
+ return static_cast<result_type>(_Eng(__g, __dt)());
+ size_t __w = __dt - std::__countl_zero(__rp) - 1;
+ if ((__rp & (numeric_limits<_UIntType>::max() >> (__dt - __w))) != 0)
++__w;
_Eng __e(__g, __w);
_UIntType __u;
do
{
__u = __e();
- } while (__u >= _Rp);
+ } while (__u >= __rp);
return static_cast<result_type>(__u + __p.a());
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/uniform_random_bit_generator.h b/contrib/libs/cxxsupp/libcxx/include/__random/uniform_random_bit_generator.h
index 84a30b0ebe1..ddb3158eead 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/uniform_random_bit_generator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/uniform_random_bit_generator.h
@@ -13,7 +13,8 @@
#include <__concepts/invocable.h>
#include <__concepts/same_as.h>
#include <__config>
-#include <type_traits>
+#include <__functional/invoke.h>
+#include <__type_traits/integral_constant.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -24,7 +25,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [rand.req.urng]
template<class _Gen>
@@ -36,7 +37,7 @@ concept uniform_random_bit_generator =
requires bool_constant<(_Gen::min() < _Gen::max())>::value;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/uniform_real_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/uniform_real_distribution.h
index b52b68977f8..1388cef95f3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__random/uniform_real_distribution.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__random/uniform_real_distribution.h
@@ -14,7 +14,6 @@
#include <__random/is_valid.h>
#include <iosfwd>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -65,7 +64,7 @@ public:
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
uniform_real_distribution() : uniform_real_distribution(0) {}
- explicit uniform_real_distribution(result_type __a, result_type __b = 1)
+ _LIBCPP_HIDE_FROM_ABI explicit uniform_real_distribution(result_type __a, result_type __b = 1)
: __p_(param_type(__a, __b)) {}
#else
_LIBCPP_INLINE_VISIBILITY
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/access.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/access.h
index e48a71adf7e..502bd5e951c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/access.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/access.h
@@ -29,7 +29,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template <class _Tp>
@@ -223,7 +223,7 @@ inline namespace __cpo {
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h
index 511f7b3b46f..2c88f51b664 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h
@@ -11,6 +11,8 @@
#define _LIBCPP___RANGES_ALL_H
#include <__config>
+#include <__functional/compose.h> // TODO(modules): Those should not be required
+#include <__functional/perfect_forward.h> //
#include <__iterator/concepts.h>
#include <__iterator/iterator_traits.h>
#include <__ranges/access.h>
@@ -18,10 +20,10 @@
#include <__ranges/owning_view.h>
#include <__ranges/range_adaptor.h>
#include <__ranges/ref_view.h>
+#include <__type_traits/decay.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
@@ -29,7 +31,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges::views {
@@ -77,7 +79,7 @@ using all_t = decltype(views::all(std::declval<_Range>()));
} // namespace ranges::views
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/as_rvalue_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/as_rvalue_view.h
index 422d8a8e083..295aa94ed9f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/as_rvalue_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/as_rvalue_view.h
@@ -28,6 +28,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
#if _LIBCPP_STD_VER >= 23
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -125,7 +128,7 @@ struct __fn : __range_adaptor_closure<__fn> {
} // namespace __as_rvalue
inline namespace __cpo {
-constexpr auto as_rvalue = __as_rvalue::__fn{};
+inline constexpr auto as_rvalue = __as_rvalue::__fn{};
} // namespace __cpo
} // namespace views
} // namespace ranges
@@ -134,4 +137,6 @@ _LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_STD_VER >= 23
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___RANGES_AS_RVALUE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h
index 8d7ae584157..f4cd1807490 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h
@@ -24,15 +24,17 @@
#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_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -130,8 +132,10 @@ inline namespace __cpo {
} // namespace views
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___RANGES_COMMON_VIEW_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h
index e34c545578a..b87a7146061 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h
@@ -37,7 +37,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -73,6 +73,9 @@ namespace ranges {
template <range _Rp>
using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<_Rp>>;
+ template <range _Rp>
+ using range_common_reference_t = iter_common_reference_t<iterator_t<_Rp>>;
+
// [range.sized]
template <class _Tp>
concept sized_range = range<_Tp> && requires(_Tp& __t) { ranges::size(__t); };
@@ -140,7 +143,7 @@ namespace ranges {
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/container_compatible_range.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/container_compatible_range.h
new file mode 100644
index 00000000000..a58f1119885
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/container_compatible_range.h
@@ -0,0 +1,33 @@
+// -*- 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_CONTAINER_COMPATIBLE_RANGE_H
+#define _LIBCPP___RANGES_CONTAINER_COMPATIBLE_RANGE_H
+
+#include <__concepts/convertible_to.h>
+#include <__config>
+#include <__ranges/concepts.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 23
+
+template <class _Range, class _Tp>
+concept _ContainerCompatibleRange =
+ ranges::input_range<_Range> && convertible_to<ranges::range_reference_t<_Range>, _Tp>;
+
+#endif // _LIBCPP_STD_VER >= 23
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___RANGES_CONTAINER_COMPATIBLE_RANGE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/copyable_box.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/copyable_box.h
deleted file mode 100644
index fb3d6e409c8..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/copyable_box.h
+++ /dev/null
@@ -1,180 +0,0 @@
-// -*- 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 <__concepts/constructible.h>
-#include <__concepts/copyable.h>
-#include <__concepts/movable.h>
-#include <__config>
-#include <__memory/addressof.h>
-#include <__memory/construct_at.h>
-#include <__utility/move.h>
-#include <optional>
-#include <type_traits>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-#if _LIBCPP_STD_VER > 17
-
-// __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 // _LIBCPP_STD_VER > 17
-
-_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
index 138aa0e1dde..882f90b1ed8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h
@@ -19,10 +19,11 @@
#include <__iterator/iterator_traits.h>
#include <__memory/pointer_traits.h>
#include <__ranges/subrange.h>
+#include <__type_traits/decay.h>
#include <__utility/forward.h>
#include <__utility/move.h>
+#include <cstddef>
#include <span>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -30,7 +31,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges::views {
@@ -75,7 +76,7 @@ inline namespace __cpo {
} // namespace ranges::views
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/dangling.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/dangling.h
index c10453454dc..613084d5fb9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/dangling.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/dangling.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
struct dangling {
@@ -35,7 +35,7 @@ using borrowed_iterator_t = _If<borrowed_range<_Rp>, iterator_t<_Rp>, dangling>;
// borrowed_subrange_t defined in <__ranges/subrange.h>
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/data.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/data.h
index 0ac25b52c72..6c099085af3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/data.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/data.h
@@ -30,7 +30,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.prim.data]
@@ -105,7 +105,7 @@ inline namespace __cpo {
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h
index 8f3564a8c76..f10476f0011 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h
@@ -30,13 +30,19 @@
#include <__ranges/iota_view.h>
#include <__ranges/non_propagating_cache.h>
#include <__ranges/range_adaptor.h>
+#include <__ranges/repeat_view.h>
#include <__ranges/size.h>
#include <__ranges/subrange.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/make_unsigned.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/auto_cast.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
+#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -47,7 +53,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<view _View>
@@ -66,14 +72,14 @@ namespace ranges {
_View __base_ = _View();
public:
- drop_view() requires default_initializable<_View> = default;
+ _LIBCPP_HIDE_FROM_ABI drop_view() requires default_initializable<_View> = default;
_LIBCPP_HIDE_FROM_ABI
- constexpr drop_view(_View __base, range_difference_t<_View> __count)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 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_ASSERT_UNCATEGORIZED(__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_; }
@@ -255,13 +261,39 @@ struct __fn {
{
// Introducing local variables avoids calculating `min` and `distance` twice (at the cost of diverging from the
// expression used in the `noexcept` clause and the return statement).
- auto dist = ranges::distance(__rng);
- auto clamped = std::min<_Dist>(dist, std::forward<_Np>(__n));
+ auto __dist = ranges::distance(__rng);
+ auto __clamped = std::min<_Dist>(__dist, std::forward<_Np>(__n));
return _RawRange(
- ranges::begin(__rng) + clamped,
+ ranges::begin(__rng) + __clamped,
ranges::end(__rng),
- std::__to_unsigned_like(dist - clamped)
+ std::__to_unsigned_like(__dist - __clamped)
);}
+// clang-format off
+#if _LIBCPP_STD_VER >= 23
+ // [range.drop.overview]: the `repeat_view` "_RawRange models sized_range" case.
+ template <class _Range,
+ convertible_to<range_difference_t<_Range>> _Np,
+ class _RawRange = remove_cvref_t<_Range>,
+ class _Dist = range_difference_t<_Range>>
+ requires (__is_repeat_specialization<_RawRange> && sized_range<_RawRange>)
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Np&& __n) const
+ noexcept(noexcept(views::repeat(*__range.__value_, ranges::distance(__range) - std::min<_Dist>(ranges::distance(__range), std::forward<_Np>(__n)))))
+ -> decltype( views::repeat(*__range.__value_, ranges::distance(__range) - std::min<_Dist>(ranges::distance(__range), std::forward<_Np>(__n))))
+ { return views::repeat(*__range.__value_, ranges::distance(__range) - std::min<_Dist>(ranges::distance(__range), std::forward<_Np>(__n))); }
+
+ // [range.drop.overview]: the `repeat_view` "otherwise" case.
+ template <class _Range,
+ convertible_to<range_difference_t<_Range>> _Np,
+ class _RawRange = remove_cvref_t<_Range>,
+ class _Dist = range_difference_t<_Range>>
+ requires (__is_repeat_specialization<_RawRange> && !sized_range<_RawRange>)
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI
+ constexpr auto operator()(_Range&& __range, _Np&&) const
+ noexcept(noexcept(_LIBCPP_AUTO_CAST(std::forward<_Range>(__range))))
+ -> decltype( _LIBCPP_AUTO_CAST(std::forward<_Range>(__range)))
+ { return _LIBCPP_AUTO_CAST(std::forward<_Range>(__range)); }
+#endif
+// clang-format on
// [range.drop.overview]: the "otherwise" case.
template <class _Range, convertible_to<range_difference_t<_Range>> _Np,
@@ -269,6 +301,9 @@ struct __fn {
// Note: without specifically excluding the other cases, GCC sees this overload as ambiguous with the other
// overloads.
requires (!(__is_empty_view<_RawRange> ||
+#if _LIBCPP_STD_VER >= 23
+ __is_repeat_specialization<_RawRange> ||
+#endif
(__is_subrange_specialization_with_store_size<_RawRange> &&
sized_range<_RawRange> &&
random_access_range<_RawRange>) ||
@@ -299,7 +334,7 @@ inline namespace __cpo {
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_while_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_while_view.h
index 7c28992f187..677b5bc66d4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_while_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_while_view.h
@@ -20,8 +20,8 @@
#include <__ranges/access.h>
#include <__ranges/all.h>
#include <__ranges/concepts.h>
-#include <__ranges/copyable_box.h>
#include <__ranges/enable_borrowed_range.h>
+#include <__ranges/movable_box.h>
#include <__ranges/non_propagating_cache.h>
#include <__ranges/range_adaptor.h>
#include <__ranges/view_interface.h>
@@ -51,7 +51,7 @@ public:
requires default_initializable<_View> && default_initializable<_Pred>
= default;
- _LIBCPP_HIDE_FROM_ABI constexpr drop_while_view(_View __base, _Pred __pred)
+ _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 drop_while_view(_View __base, _Pred __pred)
: __base_(std::move(__base)), __pred_(std::in_place, std::move(__pred)) {}
_LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
@@ -65,9 +65,10 @@ public:
_LIBCPP_HIDE_FROM_ABI constexpr const _Pred& pred() const { return *__pred_; }
_LIBCPP_HIDE_FROM_ABI constexpr auto begin() {
- _LIBCPP_ASSERT(__pred_.__has_value(),
- "drop_while_view needs to have a non-empty predicate before calling begin() -- did a previous "
- "assignment to this drop_while_view fail?");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __pred_.__has_value(),
+ "drop_while_view needs to have a non-empty predicate before calling begin() -- did a previous "
+ "assignment to this drop_while_view fail?");
if constexpr (_UseCache) {
if (!__cached_begin_.__has_value()) {
__cached_begin_.__emplace(ranges::find_if_not(__base_, std::cref(*__pred_)));
@@ -82,7 +83,7 @@ public:
private:
_LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
- _LIBCPP_NO_UNIQUE_ADDRESS __copyable_box<_Pred> __pred_;
+ _LIBCPP_NO_UNIQUE_ADDRESS __movable_box<_Pred> __pred_;
static constexpr bool _UseCache = forward_range<_View>;
using _Cache = _If<_UseCache, __non_propagating_cache<iterator_t<_View>>, __empty_cache>;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/elements_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/elements_view.h
index 997380ee9c6..325e4c9dca6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/elements_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/elements_view.h
@@ -26,9 +26,9 @@
#include <__ranges/range_adaptor.h>
#include <__ranges/size.h>
#include <__ranges/view_interface.h>
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_like.h>
-#include <__tuple_dir/tuple_size.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_like.h>
+#include <__tuple/tuple_size.h>
#include <__type_traits/is_reference.h>
#include <__type_traits/maybe_const.h>
#include <__type_traits/remove_cv.h>
@@ -224,9 +224,9 @@ public:
_LIBCPP_HIDE_FROM_ABI constexpr __iterator operator++(int)
requires forward_range<_Base>
{
- auto temp = *this;
+ auto __temp = *this;
++__current_;
- return temp;
+ return __temp;
}
_LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator--()
@@ -239,9 +239,9 @@ public:
_LIBCPP_HIDE_FROM_ABI constexpr __iterator operator--(int)
requires bidirectional_range<_Base>
{
- auto temp = *this;
+ auto __temp = *this;
--__current_;
- return temp;
+ return __temp;
}
_LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator+=(difference_type __n)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/empty.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/empty.h
index 8a1c75c0bae..64996f4a6f7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/empty.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/empty.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.prim.empty]
@@ -75,7 +75,7 @@ inline namespace __cpo {
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/empty_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/empty_view.h
index 58e69ac19f2..bb445b4e6f9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/empty_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/empty_view.h
@@ -13,7 +13,8 @@
#include <__config>
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/view_interface.h>
-#include <type_traits>
+#include <__type_traits/is_object.h>
+#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -21,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<class _Tp>
@@ -46,7 +47,7 @@ namespace ranges {
} // namespace views
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/enable_borrowed_range.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/enable_borrowed_range.h
index 833d266403c..1d068335e20 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/enable_borrowed_range.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/enable_borrowed_range.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -33,7 +33,7 @@ inline constexpr bool enable_borrowed_range = false;
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/enable_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/enable_view.h
index c85064b915a..0c1dff3821e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/enable_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/enable_view.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -43,7 +43,7 @@ inline constexpr bool enable_view = derived_from<_Tp, view_base> ||
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/filter_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/filter_view.h
index e14a9abeb9e..1cef94ca674 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/filter_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/filter_view.h
@@ -11,12 +11,12 @@
#define _LIBCPP___RANGES_FILTER_VIEW_H
#include <__algorithm/ranges_find_if.h>
+#include <__assert>
#include <__concepts/constructible.h>
#include <__concepts/copyable.h>
#include <__concepts/derived_from.h>
#include <__concepts/equality_comparable.h>
#include <__config>
-#include <__debug>
#include <__functional/bind_back.h>
#include <__functional/invoke.h>
#include <__functional/reference_wrapper.h>
@@ -28,14 +28,17 @@
#include <__ranges/access.h>
#include <__ranges/all.h>
#include <__ranges/concepts.h>
-#include <__ranges/copyable_box.h>
+#include <__ranges/movable_box.h>
#include <__ranges/non_propagating_cache.h>
#include <__ranges/range_adaptor.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_object.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
@@ -43,14 +46,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<input_range _View, indirect_unary_predicate<iterator_t<_View>> _Pred>
requires view<_View> && is_object_v<_Pred>
class filter_view : public view_interface<filter_view<_View, _Pred>> {
_LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
- _LIBCPP_NO_UNIQUE_ADDRESS __copyable_box<_Pred> __pred_;
+ _LIBCPP_NO_UNIQUE_ADDRESS __movable_box<_Pred> __pred_;
// We cache the result of begin() to allow providing an amortized O(1) begin() whenever
// the underlying range is at least a forward_range.
@@ -65,10 +68,8 @@ namespace ranges {
_LIBCPP_HIDE_FROM_ABI
filter_view() requires default_initializable<_View> && default_initializable<_Pred> = default;
- _LIBCPP_HIDE_FROM_ABI
- constexpr filter_view(_View __base, _Pred __pred)
- : __base_(std::move(__base)), __pred_(in_place, std::move(__pred))
- { }
+ _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 filter_view(_View __base, _Pred __pred)
+ : __base_(std::move(__base)), __pred_(in_place, std::move(__pred)) {}
template<class _Vp = _View>
_LIBCPP_HIDE_FROM_ABI
@@ -81,7 +82,9 @@ namespace ranges {
_LIBCPP_HIDE_FROM_ABI
constexpr __iterator begin() {
- _LIBCPP_ASSERT(__pred_.__has_value(), "Trying to call begin() on a filter_view that does not have a valid predicate.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __pred_.__has_value(),
+ "Trying to call begin() on a filter_view that does not have a valid predicate.");
if constexpr (_UseCache) {
if (!__cached_begin_.__has_value()) {
__cached_begin_.__emplace(ranges::find_if(__base_, std::ref(*__pred_)));
@@ -180,9 +183,9 @@ namespace ranges {
}
_LIBCPP_HIDE_FROM_ABI
constexpr __iterator operator--(int) requires bidirectional_range<_View> {
- auto tmp = *this;
+ auto __tmp = *this;
--*this;
- return tmp;
+ return __tmp;
}
_LIBCPP_HIDE_FROM_ABI
@@ -257,7 +260,7 @@ inline namespace __cpo {
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/from_range.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/from_range.h
new file mode 100644
index 00000000000..a6cb9e3d439
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/from_range.h
@@ -0,0 +1,33 @@
+// -*- 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_FROM_RANGE_H
+#define _LIBCPP___RANGES_FROM_RANGE_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 23
+
+struct from_range_t {
+ explicit from_range_t() = default;
+};
+
+inline constexpr from_range_t from_range{};
+
+#endif // _LIBCPP_STD_VER >= 23
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___RANGES_FROM_RANGE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h
index 8f9148a6849..f372688abfd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h
@@ -27,12 +27,15 @@
#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/movable_box.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/is_nothrow_copy_constructible.h>
+#include <__type_traits/make_unsigned.h>
+#include <__type_traits/type_identity.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -40,12 +43,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<class _Int>
struct __get_wider_signed {
- static auto __call() {
+ consteval 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>{};
@@ -278,7 +281,8 @@ namespace ranges {
public:
_LIBCPP_HIDE_FROM_ABI
__sentinel() = default;
- constexpr explicit __sentinel(_BoundSentinel __bound_sentinel) : __bound_sentinel_(std::move(__bound_sentinel)) {}
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(_BoundSentinel __bound_sentinel)
+ : __bound_sentinel_(std::move(__bound_sentinel)) {}
_LIBCPP_HIDE_FROM_ABI
friend constexpr bool operator==(const __iterator& __x, const __sentinel& __y) {
@@ -311,28 +315,28 @@ namespace ranges {
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<_BoundSentinel> __bound_sentinel)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(type_identity_t<_Start> __value, type_identity_t<_BoundSentinel> __bound_sentinel)
: __value_(std::move(__value)), __bound_sentinel_(std::move(__bound_sentinel)) {
// Validate the precondition if possible.
if constexpr (totally_ordered_with<_Start, _BoundSentinel>) {
- _LIBCPP_ASSERT(ranges::less_equal()(__value_, __bound_sentinel_),
- "Precondition violated: value is greater than bound.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ranges::less_equal()(__value_, __bound_sentinel_),
+ "Precondition violated: value is greater than bound.");
}
}
_LIBCPP_HIDE_FROM_ABI
- constexpr iota_view(__iterator __first, __iterator __last)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(__iterator __first, __iterator __last)
requires same_as<_Start, _BoundSentinel>
: iota_view(std::move(__first.__value_), std::move(__last.__value_)) {}
_LIBCPP_HIDE_FROM_ABI
- constexpr iota_view(__iterator __first, _BoundSentinel __last)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(__iterator __first, _BoundSentinel __last)
requires same_as<_BoundSentinel, 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, _BoundSentinel> && !same_as<_Start, unreachable_sentinel_t>)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(__iterator __first, __sentinel __last)
+ requires(!same_as<_Start, _BoundSentinel> && !same_as<_BoundSentinel, unreachable_sentinel_t>)
: iota_view(std::move(__first.__value_), std::move(__last.__bound_sentinel_)) {}
_LIBCPP_HIDE_FROM_ABI
@@ -403,7 +407,7 @@ inline namespace __cpo {
} // namespace views
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/join_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/join_view.h
index b5a4c4e7339..94fa0deb7e8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/join_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/join_view.h
@@ -22,6 +22,7 @@
#include <__iterator/iterator_traits.h>
#include <__iterator/iterator_with_data.h>
#include <__iterator/segmented_iterator.h>
+#include <__memory/addressof.h>
#include <__ranges/access.h>
#include <__ranges/all.h>
#include <__ranges/concepts.h>
@@ -29,10 +30,10 @@
#include <__ranges/non_propagating_cache.h>
#include <__ranges/range_adaptor.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/common_type.h>
#include <__type_traits/maybe_const.h>
#include <__utility/forward.h>
#include <optional>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -43,7 +44,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// Note: `join_view` is still marked experimental because there is an ABI-breaking change that affects `join_view` in
// the pipeline (https://isocpp.org/files/papers/D2770R0.html).
// TODO: make `join_view` non-experimental once D2770 is implemented.
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<class>
@@ -394,8 +395,8 @@ inline namespace __cpo {
template <class _JoinViewIterator>
requires(_JoinViewIterator::__is_join_view_iterator &&
ranges::common_range<typename _JoinViewIterator::_Parent> &&
- __is_cpp17_random_access_iterator<typename _JoinViewIterator::_Outer>::value &&
- __is_cpp17_random_access_iterator<typename _JoinViewIterator::_Inner>::value)
+ __has_random_access_iterator_category<typename _JoinViewIterator::_Outer>::value &&
+ __has_random_access_iterator_category<typename _JoinViewIterator::_Inner>::value)
struct __segmented_iterator_traits<_JoinViewIterator> {
using __segment_iterator =
@@ -435,7 +436,7 @@ struct __segmented_iterator_traits<_JoinViewIterator> {
}
};
-#endif // #if _LIBCPP_STD_VER > 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
+#endif // #if _LIBCPP_STD_VER >= 20 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h
index 3a95075884b..04182a530fc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h
@@ -12,6 +12,7 @@
#include <__algorithm/ranges_find.h>
#include <__algorithm/ranges_mismatch.h>
+#include <__assert>
#include <__concepts/constructible.h>
#include <__concepts/convertible_to.h>
#include <__concepts/derived_from.h>
@@ -34,10 +35,13 @@
#include <__ranges/single_view.h>
#include <__ranges/subrange.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
#include <__type_traits/maybe_const.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -45,7 +49,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -78,14 +82,14 @@ public:
requires default_initializable<_View> && default_initializable<_Pattern> = default;
_LIBCPP_HIDE_FROM_ABI
- constexpr lazy_split_view(_View __base, _Pattern __pattern)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 lazy_split_view(_View __base, _Pattern __pattern)
: __base_(std::move(__base)), __pattern_(std::move(__pattern)) {}
template <input_range _Range>
requires constructible_from<_View, views::all_t<_Range>> &&
constructible_from<_Pattern, single_view<range_value_t<_Range>>>
_LIBCPP_HIDE_FROM_ABI
- constexpr lazy_split_view(_Range&& __r, range_value_t<_Range> __e)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 lazy_split_view(_Range&& __r, range_value_t<_Range> __e)
: __base_(views::all(std::forward<_Range>(__r)))
, __pattern_(views::single(std::move(__e))) {}
@@ -276,7 +280,7 @@ private:
_LIBCPP_HIDE_FROM_ABI
friend constexpr bool operator==(const __outer_iterator& __x, default_sentinel_t) {
- _LIBCPP_ASSERT(__x.__parent_, "Cannot call comparison on a default-constructed iterator.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x.__parent_, "Cannot call comparison on a default-constructed iterator.");
return __x.__current() == ranges::end(__x.__parent_base()) && !__x.__trailing_empty_;
}
};
@@ -307,7 +311,7 @@ private:
_LIBCPP_HIDE_FROM_ABI
constexpr bool __is_done() const {
- _LIBCPP_ASSERT(__i_.__parent_, "Cannot call comparison on a default-constructed iterator.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__i_.__parent_, "Cannot call comparison on a default-constructed iterator.");
auto [__pcur, __pend] = ranges::subrange{__i_.__parent_->__pattern_};
auto __end = ranges::end(__i_.__parent_->__base_);
@@ -458,7 +462,7 @@ inline namespace __cpo {
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/movable_box.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/movable_box.h
new file mode 100644
index 00000000000..8b3716a06c5
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/movable_box.h
@@ -0,0 +1,206 @@
+// -*- 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_MOVABLE_BOX_H
+#define _LIBCPP___RANGES_MOVABLE_BOX_H
+
+#include <__concepts/constructible.h>
+#include <__concepts/copyable.h>
+#include <__concepts/movable.h>
+#include <__config>
+#include <__memory/addressof.h>
+#include <__memory/construct_at.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_nothrow_copy_constructible.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__utility/move.h>
+#include <optional>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 20
+
+// __movable_box allows turning a type that is move-constructible (but maybe not move-assignable) into
+// a type that is both move-constructible and move-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
+// __movable_box that does this, see below for the details.
+
+// until C++23, `__movable_box` was named `__copyable_box` and required the stored type to be copy-constructible, not
+// just move-constructible; we preserve the old behavior in pre-C++23 modes.
+template <class _Tp>
+concept __movable_box_object =
+# if _LIBCPP_STD_VER >= 23
+ move_constructible<_Tp>
+# else
+ copy_constructible<_Tp>
+# endif
+ && is_object_v<_Tp>;
+
+namespace ranges {
+// Primary template - uses std::optional and introduces an empty state in case assignment fails.
+template <__movable_box_object _Tp>
+class __movable_box {
+ _LIBCPP_NO_UNIQUE_ADDRESS optional<_Tp> __val_;
+
+public:
+ template <class... _Args>
+ requires is_constructible_v<_Tp, _Args...>
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __movable_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 __movable_box() noexcept(is_nothrow_default_constructible_v<_Tp>)
+ requires default_initializable<_Tp>
+ : __val_(in_place) {}
+
+ _LIBCPP_HIDE_FROM_ABI __movable_box(__movable_box const&) = default;
+ _LIBCPP_HIDE_FROM_ABI __movable_box(__movable_box&&) = default;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __movable_box&
+ operator=(__movable_box const& __other) noexcept(is_nothrow_copy_constructible_v<_Tp>)
+# if _LIBCPP_STD_VER >= 23
+ requires copy_constructible<_Tp>
+# endif
+ {
+ if (this != std::addressof(__other)) {
+ if (__other.__has_value())
+ __val_.emplace(*__other);
+ else
+ __val_.reset();
+ }
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI __movable_box& operator=(__movable_box&&)
+ requires movable<_Tp>
+ = default;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __movable_box&
+ operator=(__movable_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.
+
+# if _LIBCPP_STD_VER >= 23
+template <class _Tp>
+concept __doesnt_need_empty_state =
+ (copy_constructible<_Tp>
+ // 1. If copy_constructible<T> is true, movable-box<T> should store only a T if either T models
+ // copyable, or is_nothrow_move_constructible_v<T> && is_nothrow_copy_constructible_v<T> is true.
+ ? copyable<_Tp> || (is_nothrow_move_constructible_v<_Tp> && is_nothrow_copy_constructible_v<_Tp>)
+ // 2. Otherwise, movable-box<T> should store only a T if either T models movable or
+ // is_nothrow_move_constructible_v<T> is true.
+ : movable<_Tp> || is_nothrow_move_constructible_v<_Tp>);
+# else
+
+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 <class _Tp>
+concept __doesnt_need_empty_state = __doesnt_need_empty_state_for_copy<_Tp> && __doesnt_need_empty_state_for_move<_Tp>;
+# endif
+
+template <__movable_box_object _Tp>
+ requires __doesnt_need_empty_state<_Tp>
+class __movable_box<_Tp> {
+ _LIBCPP_NO_UNIQUE_ADDRESS _Tp __val_;
+
+public:
+ template <class... _Args>
+ requires is_constructible_v<_Tp, _Args...>
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __movable_box(in_place_t, _Args&&... __args) noexcept(
+ is_nothrow_constructible_v<_Tp, _Args...>)
+ : __val_(std::forward<_Args>(__args)...) {}
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __movable_box() noexcept(is_nothrow_default_constructible_v<_Tp>)
+ requires default_initializable<_Tp>
+ : __val_() {}
+
+ _LIBCPP_HIDE_FROM_ABI __movable_box(__movable_box const&) = default;
+ _LIBCPP_HIDE_FROM_ABI __movable_box(__movable_box&&) = default;
+
+ // Implementation of assignment operators in case we perform optimization (1)
+ _LIBCPP_HIDE_FROM_ABI __movable_box& operator=(__movable_box const&)
+ requires copyable<_Tp>
+ = default;
+ _LIBCPP_HIDE_FROM_ABI __movable_box& operator=(__movable_box&&)
+ requires movable<_Tp>
+ = default;
+
+ // Implementation of assignment operators in case we perform optimization (2)
+ _LIBCPP_HIDE_FROM_ABI constexpr __movable_box& operator=(__movable_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 __movable_box& operator=(__movable_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 // _LIBCPP_STD_VER >= 20
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___RANGES_MOVABLE_BOX_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
index d50c577fc30..f5223962049 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/non_propagating_cache.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/non_propagating_cache.h
@@ -16,7 +16,6 @@
#include <__memory/addressof.h>
#include <__utility/forward.h>
#include <optional>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -24,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
// __non_propagating_cache is a helper type that allows storing an optional value in it,
@@ -44,10 +43,11 @@ namespace ranges {
// 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()) { }
+ template <class... _Args>
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __wrapper(__forward_tag, _Args&&... __args)
+ : __t_(std::forward<_Args>(__args)...) {}
+ template <class _Fn>
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __wrapper(__from_tag, _Fn const& __f) : __t_(__f()) {}
_Tp __t_;
};
@@ -107,7 +107,7 @@ namespace ranges {
struct __empty_cache { };
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/owning_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/owning_view.h
index e150f6d9f24..c846de899b3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/owning_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/owning_view.h
@@ -20,16 +20,19 @@
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/size.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/move.h>
-#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 _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<range _Rp>
@@ -38,11 +41,11 @@ namespace ranges {
_Rp __r_ = _Rp();
public:
- owning_view() requires default_initializable<_Rp> = default;
+ _LIBCPP_HIDE_FROM_ABI 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 owning_view(owning_view&&) = default;
+ _LIBCPP_HIDE_FROM_ABI 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_; }
@@ -76,8 +79,10 @@ public:
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#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
index 37e48179e37..2688e4cd043 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h
@@ -18,17 +18,22 @@
#include <__functional/compose.h>
#include <__functional/invoke.h>
#include <__ranges/concepts.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/remove_cvref.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_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// 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
@@ -42,7 +47,7 @@ struct __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)) { }
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __range_adaptor_closure_t(_Fn&& __f) : _Fn(std::move(__f)) { }
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__range_adaptor_closure_t);
@@ -70,8 +75,10 @@ struct __range_adaptor_closure {
{ return __range_adaptor_closure_t(std::__compose(std::forward<_OtherClosure>(__c2), std::forward<_Closure>(__c1))); }
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#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
index 26b47321de9..1ceb1116d69 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/rbegin.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/rbegin.h
@@ -17,8 +17,11 @@
#include <__iterator/readable_traits.h>
#include <__iterator/reverse_iterator.h>
#include <__ranges/access.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/auto_cast.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -26,7 +29,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [ranges.access.rbegin]
@@ -124,7 +127,7 @@ inline namespace __cpo {
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h
index 1e5f7466f32..be32b812420 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h
@@ -24,8 +24,9 @@
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/size.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/is_object.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -33,7 +34,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<range _Range>
@@ -81,7 +82,7 @@ public:
inline constexpr bool enable_borrowed_range<ref_view<_Tp>> = true;
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h
index d2987e9fa8c..7ee574ccfa6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h
@@ -18,8 +18,11 @@
#include <__iterator/reverse_iterator.h>
#include <__ranges/access.h>
#include <__ranges/rbegin.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/auto_cast.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -27,7 +30,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.access.rend]
@@ -128,7 +131,7 @@ inline namespace __cpo {
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/repeat_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/repeat_view.h
new file mode 100644
index 00000000000..fddf4baac89
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/repeat_view.h
@@ -0,0 +1,260 @@
+// -*- 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_REPEAT_VIEW_H
+#define _LIBCPP___RANGES_REPEAT_VIEW_H
+
+#include <__concepts/constructible.h>
+#include <__concepts/same_as.h>
+#include <__concepts/semiregular.h>
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/unreachable_sentinel.h>
+#include <__memory/addressof.h>
+#include <__ranges/iota_view.h>
+#include <__ranges/movable_box.h>
+#include <__ranges/view_interface.h>
+#include <__type_traits/is_object.h>
+#include <__type_traits/make_unsigned.h>
+#include <__type_traits/remove_cv.h>
+#include <__utility/forward.h>
+#include <__utility/in_place.h>
+#include <__utility/move.h>
+#include <__utility/piecewise_construct.h>
+#include <tuple>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 23
+
+namespace ranges {
+
+template <class _Tp>
+concept __integer_like_with_usable_difference_type =
+ __signed_integer_like<_Tp> || (__integer_like<_Tp> && weakly_incrementable<_Tp>);
+
+template <class _Tp>
+struct __repeat_view_iterator_difference {
+ using type = _IotaDiffT<_Tp>;
+};
+
+template <__signed_integer_like _Tp>
+struct __repeat_view_iterator_difference<_Tp> {
+ using type = _Tp;
+};
+
+template <class _Tp>
+using __repeat_view_iterator_difference_t = typename __repeat_view_iterator_difference<_Tp>::type;
+
+namespace views::__drop {
+struct __fn;
+} // namespace views::__drop
+
+namespace views::__take {
+struct __fn;
+} // namespace views::__take
+
+template <move_constructible _Tp, semiregular _Bound = unreachable_sentinel_t>
+ requires(is_object_v<_Tp> && same_as<_Tp, remove_cv_t<_Tp>> &&
+ (__integer_like_with_usable_difference_type<_Bound> || same_as<_Bound, unreachable_sentinel_t>))
+class repeat_view : public view_interface<repeat_view<_Tp, _Bound>> {
+ friend struct views::__take::__fn;
+ friend struct views::__drop::__fn;
+ class __iterator;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI repeat_view()
+ requires default_initializable<_Tp>
+ = default;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit repeat_view(const _Tp& __value, _Bound __bound_sentinel = _Bound())
+ requires copy_constructible<_Tp>
+ : __value_(in_place, __value), __bound_(__bound_sentinel) {
+ if constexpr (!same_as<_Bound, unreachable_sentinel_t>)
+ _LIBCPP_ASSERT(__bound_ >= 0, "The value of bound must be greater than or equal to 0");
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit repeat_view(_Tp&& __value, _Bound __bound_sentinel = _Bound())
+ : __value_(in_place, std::move(__value)), __bound_(__bound_sentinel) {
+ if constexpr (!same_as<_Bound, unreachable_sentinel_t>)
+ _LIBCPP_ASSERT(__bound_ >= 0, "The value of bound must be greater than or equal to 0");
+ }
+
+ template <class... _TpArgs, class... _BoundArgs>
+ requires(constructible_from<_Tp, _TpArgs...> && constructible_from<_Bound, _BoundArgs...>)
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit repeat_view(
+ piecewise_construct_t, tuple<_TpArgs...> __value_args, tuple<_BoundArgs...> __bound_args = tuple<>{})
+ : __value_(in_place, std::make_from_tuple<_Tp>(std::move(__value_args))),
+ __bound_(std::make_from_tuple<_Bound>(std::move(__bound_args))) {
+ if constexpr (!same_as<_Bound, unreachable_sentinel_t>)
+ _LIBCPP_ASSERT(
+ __bound_ >= 0, "The behavior is undefined if Bound is not unreachable_sentinel_t and bound is negative");
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() const { return __iterator(std::addressof(*__value_)); }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator end() const
+ requires(!same_as<_Bound, unreachable_sentinel_t>)
+ {
+ return __iterator(std::addressof(*__value_), __bound_);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr unreachable_sentinel_t end() const noexcept { return unreachable_sentinel; }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
+ requires(!same_as<_Bound, unreachable_sentinel_t>)
+ {
+ return std::__to_unsigned_like(__bound_);
+ }
+
+private:
+ __movable_box<_Tp> __value_;
+ _LIBCPP_NO_UNIQUE_ADDRESS _Bound __bound_ = _Bound();
+};
+
+template <class _Tp, class _Bound>
+repeat_view(_Tp, _Bound) -> repeat_view<_Tp, _Bound>;
+
+// [range.repeat.iterator]
+template <move_constructible _Tp, semiregular _Bound>
+ requires(is_object_v<_Tp> && same_as<_Tp, remove_cv_t<_Tp>> &&
+ (__integer_like_with_usable_difference_type<_Bound> || same_as<_Bound, unreachable_sentinel_t>))
+class repeat_view<_Tp, _Bound>::__iterator {
+ friend class repeat_view;
+
+ using _IndexT = conditional_t<same_as<_Bound, unreachable_sentinel_t>, ptrdiff_t, _Bound>;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(const _Tp* __value, _IndexT __bound_sentinel = _IndexT())
+ : __value_(__value), __current_(__bound_sentinel) {}
+
+public:
+ using iterator_concept = random_access_iterator_tag;
+ using iterator_category = random_access_iterator_tag;
+ using value_type = _Tp;
+ using difference_type = __repeat_view_iterator_difference_t<_IndexT>;
+
+ _LIBCPP_HIDE_FROM_ABI __iterator() = default;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator*() const noexcept { return *__value_; }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
+ ++__current_;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator++(int) {
+ auto __tmp = *this;
+ ++*this;
+ return __tmp;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator--() {
+ if constexpr (!same_as<_Bound, unreachable_sentinel_t>)
+ _LIBCPP_ASSERT(__current_ > 0, "The value of bound must be greater than or equal to 0");
+ --__current_;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator--(int) {
+ auto __tmp = *this;
+ --*this;
+ return __tmp;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator+=(difference_type __n) {
+ if constexpr (!same_as<_Bound, unreachable_sentinel_t>)
+ _LIBCPP_ASSERT(__current_ + __n >= 0, "The value of bound must be greater than or equal to 0");
+ __current_ += __n;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator-=(difference_type __n) {
+ if constexpr (!same_as<_Bound, unreachable_sentinel_t>)
+ _LIBCPP_ASSERT(__current_ - __n >= 0, "The value of bound must be greater than or equal to 0");
+ __current_ -= __n;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](difference_type __n) const noexcept { return *(*this + __n); }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) {
+ return __x.__current_ == __y.__current_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y) {
+ return __x.__current_ <=> __y.__current_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(__iterator __i, difference_type __n) {
+ __i += __n;
+ return __i;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, __iterator __i) {
+ __i += __n;
+ return __i;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(__iterator __i, difference_type __n) {
+ __i -= __n;
+ return __i;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y) {
+ return static_cast<difference_type>(__x.__current_) - static_cast<difference_type>(__y.__current_);
+ }
+
+private:
+ const _Tp* __value_ = nullptr;
+ _IndexT __current_ = _IndexT();
+};
+
+// clang-format off
+namespace views {
+namespace __repeat {
+struct __fn {
+ template <class _Tp>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __value) const
+ noexcept(noexcept(ranges::repeat_view(std::forward<_Tp>(__value))))
+ -> decltype( ranges::repeat_view(std::forward<_Tp>(__value)))
+ { return ranges::repeat_view(std::forward<_Tp>(__value)); }
+
+
+ template <class _Tp, class _Bound>
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __value, _Bound&& __bound_sentinel) const
+ noexcept(noexcept(ranges::repeat_view(std::forward<_Tp>(__value), std::forward<_Bound>(__bound_sentinel))))
+ -> decltype( ranges::repeat_view(std::forward<_Tp>(__value), std::forward<_Bound>(__bound_sentinel)))
+ { return ranges::repeat_view(std::forward<_Tp>(__value), std::forward<_Bound>(__bound_sentinel)); }
+};
+} // namespace __repeat
+// clang-format on
+
+inline namespace __cpo {
+inline constexpr auto repeat = __repeat::__fn{};
+} // namespace __cpo
+} // namespace views
+
+template <class _Tp>
+inline constexpr bool __is_repeat_specialization = false;
+
+template <class _Tp, class _Bound>
+inline constexpr bool __is_repeat_specialization<repeat_view<_Tp, _Bound>> = true;
+
+} // namespace ranges
+
+#endif // _LIBCPP_STD_VER >= 23
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___RANGES_REPEAT_VIEW_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h
index d7b13780544..01d1b97b3ce 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h
@@ -24,9 +24,10 @@
#include <__ranges/size.h>
#include <__ranges/subrange.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -34,7 +35,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<view _View>
@@ -184,7 +185,7 @@ namespace ranges {
} // namespace views
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/single_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/single_view.h
index 5c4b91869c1..5724e2d1b6d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/single_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/single_view.h
@@ -12,13 +12,15 @@
#include <__concepts/constructible.h>
#include <__config>
-#include <__ranges/copyable_box.h>
+#include <__ranges/movable_box.h>
#include <__ranges/range_adaptor.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_object.h>
#include <__utility/forward.h>
#include <__utility/in_place.h>
#include <__utility/move.h>
-#include <type_traits>
+#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -26,51 +28,51 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
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)
+# if _LIBCPP_STD_VER >= 23
+template <move_constructible _Tp>
+# else
+template <copy_constructible _Tp>
+# endif
+ requires is_object_v<_Tp>
+class single_view : public view_interface<single_view<_Tp>> {
+ __movable_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)
+# if _LIBCPP_STD_VER >= 23
+ requires copy_constructible<_Tp>
+# endif
+ : __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 _Tp* begin() noexcept { return data(); }
- _LIBCPP_HIDE_FROM_ABI
- constexpr const _Tp* begin() const 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 _Tp* end() noexcept { return data() + 1; }
- _LIBCPP_HIDE_FROM_ABI
- constexpr const _Tp* end() const 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 static constexpr size_t size() noexcept { return 1; }
- _LIBCPP_HIDE_FROM_ABI
- constexpr _Tp* data() noexcept { return __value_.operator->(); }
+ _LIBCPP_HIDE_FROM_ABI constexpr _Tp* data() noexcept { return __value_.operator->(); }
- _LIBCPP_HIDE_FROM_ABI
- constexpr const _Tp* data() const 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>;
@@ -95,7 +97,7 @@ inline namespace __cpo {
} // namespace views
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/size.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/size.h
index 0ac8d63063d..f22dd1ff7b7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/size.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/size.h
@@ -30,7 +30,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<class>
@@ -141,7 +141,7 @@ inline namespace __cpo {
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/split_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/split_view.h
index 6ebe5a43ed2..a27ac4ef7a1 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/split_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/split_view.h
@@ -75,13 +75,14 @@ public:
requires default_initializable<_View> && default_initializable<_Pattern>
= default;
- _LIBCPP_HIDE_FROM_ABI constexpr split_view(_View __base, _Pattern __pattern)
+ _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 split_view(_View __base, _Pattern __pattern)
: __base_(std::move(__base)), __pattern_(std::move((__pattern))) {}
template <forward_range _Range>
requires constructible_from<_View, views::all_t<_Range>> &&
constructible_from<_Pattern, single_view<range_value_t<_Range>>>
- _LIBCPP_HIDE_FROM_ABI constexpr split_view(_Range&& __range, range_value_t<_Range> __elem)
+ _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23
+ split_view(_Range&& __range, range_value_t<_Range> __elem)
: __base_(views::all(std::forward<_Range>(__range))), __pattern_(views::single(std::move(__elem))) {}
_LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h
index 2d9e4cc7e55..75f9284a582 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h
@@ -29,9 +29,9 @@
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/size.h>
#include <__ranges/view_interface.h>
-#include <__tuple_dir/pair_like.h>
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_size.h>
+#include <__tuple/pair_like.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_size.h>
#include <__type_traits/conditional.h>
#include <__type_traits/decay.h>
#include <__type_traits/is_pointer.h>
@@ -46,9 +46,12 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<class _From, class _To>
@@ -82,7 +85,7 @@ namespace ranges {
private:
static constexpr bool _MustProvideSizeAtConstruction = !_StoreSize; // just to improve compiler diagnostics
- struct _Empty { constexpr _Empty(auto) noexcept { } };
+ struct _Empty { _LIBCPP_HIDE_FROM_ABI 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();
@@ -105,7 +108,7 @@ namespace ranges {
: __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),
+ _LIBCPP_ASSERT_UNCATEGORIZED((__end_ - __begin_) == static_cast<iter_difference_t<_Iter>>(__n),
"std::ranges::subrange was passed an invalid size hint");
}
@@ -284,8 +287,10 @@ struct tuple_element<1, const ranges::subrange<_Ip, _Sp, _Kp>> {
using type = _Sp;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#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
index bea3862cd7c..4204017d924 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h
@@ -31,14 +31,18 @@
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/iota_view.h>
#include <__ranges/range_adaptor.h>
+#include <__ranges/repeat_view.h>
#include <__ranges/size.h>
#include <__ranges/subrange.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
#include <__type_traits/maybe_const.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/auto_cast.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
+#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -49,7 +53,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -64,9 +68,10 @@ 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)
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 take_view(_View __base, range_difference_t<_View> __count)
: __base_(std::move(__base)), __count_(__count) {
- _LIBCPP_ASSERT(__count >= 0, "count has to be greater than or equal to zero");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count >= 0, "count has to be greater than or equal to zero");
}
_LIBCPP_HIDE_FROM_ABI
@@ -297,6 +302,31 @@ struct __fn {
*ranges::begin(__rng),
*ranges::begin(__rng) + std::min<_Dist>(ranges::distance(__rng), std::forward<_Np>(__n))
); }
+// clang-format off
+#if _LIBCPP_STD_VER >= 23
+ // [range.take.overview]: the `repeat_view` "_RawRange models sized_range" case.
+ template <class _Range,
+ convertible_to<range_difference_t<_Range>> _Np,
+ class _RawRange = remove_cvref_t<_Range>,
+ class _Dist = range_difference_t<_Range>>
+ requires(__is_repeat_specialization<_RawRange> && sized_range<_RawRange>)
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Np&& __n) const
+ noexcept(noexcept(views::repeat(*__range.__value_, std::min<_Dist>(ranges::distance(__range), std::forward<_Np>(__n)))))
+ -> decltype( views::repeat(*__range.__value_, std::min<_Dist>(ranges::distance(__range), std::forward<_Np>(__n))))
+ { return views::repeat(*__range.__value_, std::min<_Dist>(ranges::distance(__range), std::forward<_Np>(__n))); }
+
+ // [range.take.overview]: the `repeat_view` "otherwise" case.
+ template <class _Range,
+ convertible_to<range_difference_t<_Range>> _Np,
+ class _RawRange = remove_cvref_t<_Range>,
+ class _Dist = range_difference_t<_Range>>
+ requires(__is_repeat_specialization<_RawRange> && !sized_range<_RawRange>)
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Range&& __range, _Np&& __n) const
+ noexcept(noexcept(views::repeat(*__range.__value_, static_cast<_Dist>(__n))))
+ -> decltype( views::repeat(*__range.__value_, static_cast<_Dist>(__n)))
+ { return views::repeat(*__range.__value_, static_cast<_Dist>(__n)); }
+#endif
+// clang-format on
// [range.take.overview]: the "otherwise" case.
template <class _Range, convertible_to<range_difference_t<_Range>> _Np,
@@ -304,6 +334,9 @@ struct __fn {
// Note: without specifically excluding the other cases, GCC sees this overload as ambiguous with the other
// overloads.
requires (!(__is_empty_view<_RawRange> ||
+#if _LIBCPP_STD_VER >= 23
+ __is_repeat_specialization<_RawRange> ||
+#endif
(__is_iota_specialization<_RawRange> &&
sized_range<_RawRange> &&
random_access_range<_RawRange>) ||
@@ -334,7 +367,7 @@ inline namespace __cpo {
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/take_while_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/take_while_view.h
index 77d7390dceb..b4bdd1865de 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/take_while_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/take_while_view.h
@@ -20,7 +20,7 @@
#include <__ranges/access.h>
#include <__ranges/all.h>
#include <__ranges/concepts.h>
-#include <__ranges/copyable_box.h>
+#include <__ranges/movable_box.h>
#include <__ranges/range_adaptor.h>
#include <__ranges/view_interface.h>
#include <__type_traits/decay.h>
@@ -60,14 +60,14 @@ class take_while_view : public view_interface<take_while_view<_View, _Pred>> {
class __sentinel;
_LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
- _LIBCPP_NO_UNIQUE_ADDRESS __copyable_box<_Pred> __pred_;
+ _LIBCPP_NO_UNIQUE_ADDRESS __movable_box<_Pred> __pred_;
public:
_LIBCPP_HIDE_FROM_ABI take_while_view()
requires default_initializable<_View> && default_initializable<_Pred>
= default;
- _LIBCPP_HIDE_FROM_ABI constexpr take_while_view(_View __base, _Pred __pred)
+ _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 take_while_view(_View __base, _Pred __pred)
: __base_(std::move(__base)), __pred_(std::in_place, std::move(__pred)) {}
_LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/to.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/to.h
new file mode 100644
index 00000000000..95c300bfa6f
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/to.h
@@ -0,0 +1,247 @@
+// -*- 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_TO_H
+#define _LIBCPP___RANGES_TO_H
+
+#include <__algorithm/ranges_copy.h>
+#include <__concepts/constructible.h>
+#include <__concepts/convertible_to.h>
+#include <__concepts/derived_from.h>
+#include <__concepts/same_as.h>
+#include <__config>
+#include <__functional/bind_back.h>
+#include <__iterator/back_insert_iterator.h>
+#include <__iterator/insert_iterator.h>
+#include <__iterator/iterator_traits.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/from_range.h>
+#include <__ranges/range_adaptor.h>
+#include <__ranges/size.h>
+#include <__ranges/transform_view.h>
+#include <__type_traits/add_pointer.h>
+#include <__type_traits/is_const.h>
+#include <__type_traits/is_volatile.h>
+#include <__type_traits/type_identity.h>
+#include <__utility/declval.h>
+#include <__utility/forward.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 23
+
+namespace ranges {
+
+// TODO(clang-15): in the Standard, it's a `constexpr bool` variable, not a concept, but constexpr variables don't
+// short-circuit properly on Clang 15 (fixed in later versions), so use a concept as a workaround.
+template <class _Container>
+concept __reservable_container = sized_range<_Container> && requires(_Container& __c, range_size_t<_Container> __n) {
+ __c.reserve(__n);
+ { __c.capacity() } -> same_as<decltype(__n)>;
+ { __c.max_size() } -> same_as<decltype(__n)>;
+};
+
+template <class _Container, class _Ref>
+constexpr bool __container_insertable = requires(_Container& __c, _Ref&& __ref) {
+ requires(
+ requires { __c.push_back(std::forward<_Ref>(__ref)); } ||
+ requires { __c.insert(__c.end(), std::forward<_Ref>(__ref)); });
+};
+
+template <class _Ref, class _Container>
+_LIBCPP_HIDE_FROM_ABI constexpr auto __container_inserter(_Container& __c) {
+ if constexpr (requires { __c.push_back(std::declval<_Ref>()); }) {
+ return std::back_inserter(__c);
+ } else {
+ return std::inserter(__c, __c.end());
+ }
+}
+
+// Note: making this a concept allows short-circuiting the second condition.
+template <class _Container, class _Range>
+concept __try_non_recursive_conversion =
+ !input_range<_Container> || convertible_to<range_reference_t<_Range>, range_value_t<_Container>>;
+
+template <class _Container, class _Range, class... _Args>
+concept __constructible_from_iter_pair =
+ common_range<_Range> && requires { typename iterator_traits<iterator_t<_Range>>::iterator_category; } &&
+ derived_from<typename iterator_traits<iterator_t<_Range>>::iterator_category, input_iterator_tag> &&
+ constructible_from<_Container, iterator_t<_Range>, sentinel_t<_Range>, _Args...>;
+
+template <class>
+concept __always_false = false;
+
+// `ranges::to` base template -- the `_Container` type is a simple type template parameter.
+template <class _Container, input_range _Range, class... _Args>
+ requires(!view<_Container>)
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Container to(_Range&& __range, _Args&&... __args) {
+ // Mandates: C is a cv-unqualified class type.
+ static_assert(!is_const_v<_Container>, "The target container cannot be const-qualified, please remove the const");
+ static_assert(
+ !is_volatile_v<_Container>, "The target container cannot be volatile-qualified, please remove the volatile");
+
+ // First see if the non-recursive case applies -- the conversion target is either:
+ // - a range with a convertible value type;
+ // - a non-range type which might support being created from the input argument(s) (e.g. an `optional`).
+ if constexpr (__try_non_recursive_conversion<_Container, _Range>) {
+ // Case 1 -- construct directly from the given range.
+ if constexpr (constructible_from<_Container, _Range, _Args...>) {
+ return _Container(std::forward<_Range>(__range), std::forward<_Args>(__args)...);
+ }
+
+ // Case 2 -- construct using the `from_range_t` tagged constructor.
+ else if constexpr (constructible_from<_Container, from_range_t, _Range, _Args...>) {
+ return _Container(from_range, std::forward<_Range>(__range), std::forward<_Args>(__args)...);
+ }
+
+ // Case 3 -- construct from a begin-end iterator pair.
+ else if constexpr (__constructible_from_iter_pair<_Container, _Range, _Args...>) {
+ return _Container(ranges::begin(__range), ranges::end(__range), std::forward<_Args>(__args)...);
+ }
+
+ // Case 4 -- default-construct (or construct from the extra arguments) and insert, reserving the size if possible.
+ else if constexpr (constructible_from<_Container, _Args...> &&
+ __container_insertable<_Container, range_reference_t<_Range>>) {
+ _Container __result(std::forward<_Args>(__args)...);
+ if constexpr (sized_range<_Range> && __reservable_container<_Container>) {
+ __result.reserve(static_cast<range_size_t<_Container>>(ranges::size(__range)));
+ }
+
+ ranges::copy(__range, ranges::__container_inserter<range_reference_t<_Range>>(__result));
+
+ return __result;
+
+ } else {
+ static_assert(__always_false<_Container>, "ranges::to: unable to convert to the given container type.");
+ }
+
+ // Try the recursive case.
+ } else if constexpr (input_range<range_reference_t<_Range>>) {
+ return ranges::to<_Container>(
+ __range | views::transform([](auto&& __elem) {
+ return ranges::to<range_value_t<_Container>>(std::forward<decltype(__elem)>(__elem));
+ }),
+ std::forward<_Args>(__args)...);
+
+ } else {
+ static_assert(__always_false<_Container>, "ranges::to: unable to convert to the given container type.");
+ }
+}
+
+template <class _Range>
+struct __minimal_input_iterator {
+ using iterator_category = input_iterator_tag;
+ using value_type = range_value_t<_Range>;
+ using difference_type = ptrdiff_t;
+ using pointer = add_pointer_t<range_reference_t<_Range>>;
+ using reference = range_reference_t<_Range>;
+
+ reference operator*() const;
+ pointer operator->() const;
+ __minimal_input_iterator& operator++();
+ __minimal_input_iterator operator++(int);
+ bool operator==(const __minimal_input_iterator&) const;
+};
+
+// Deduces the full type of the container from the given template template parameter.
+template <template <class...> class _Container, input_range _Range, class... _Args>
+struct _Deducer {
+ _LIBCPP_HIDE_FROM_ABI static constexpr auto __deduce_func() {
+ using _InputIter = __minimal_input_iterator<_Range>;
+
+ // Case 1 -- can construct directly from the given range.
+ if constexpr (requires { _Container(std::declval<_Range>(), std::declval<_Args>()...); }) {
+ using _Result = decltype( //
+ _Container(std::declval<_Range>(), std::declval<_Args>()...));
+ return type_identity<_Result>{};
+
+ // Case 2 -- can construct from the given range using the `from_range_t` tagged constructor.
+ } else if constexpr ( //
+ requires { _Container(from_range, std::declval<_Range>(), std::declval<_Args>()...); }) {
+ using _Result = //
+ decltype(_Container(from_range, std::declval<_Range>(), std::declval<_Args>()...));
+ return type_identity<_Result>{};
+
+ // Case 3 -- can construct from a begin-end iterator pair.
+ } else if constexpr ( //
+ requires { _Container(std::declval<_InputIter>(), std::declval<_InputIter>(), std::declval<_Args>()...); }) {
+ using _Result =
+ decltype(_Container(std::declval<_InputIter>(), std::declval<_InputIter>(), std::declval<_Args>()...));
+ return type_identity<_Result>{};
+
+ } else {
+ static_assert(__always_false<_Range>,
+ "ranges::to: unable to deduce the container type from the template template argument.");
+ }
+ }
+
+ using type = typename decltype(__deduce_func())::type;
+};
+
+// `ranges::to` specialization -- `_Container` is a template template parameter requiring deduction to figure out the
+// container element type.
+template <template <class...> class _Container, input_range _Range, class... _Args>
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto to(_Range&& __range, _Args&&... __args) {
+ using _DeduceExpr = typename _Deducer<_Container, _Range, _Args...>::type;
+ return ranges::to<_DeduceExpr>(std::forward<_Range>(__range), std::forward<_Args>(__args)...);
+}
+
+// Range adaptor closure object 1 -- wrapping the `ranges::to` version where `_Container` is a simple type template
+// parameter.
+template <class _Container, class... _Args>
+ requires(!view<_Container>)
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto to(_Args&&... __args) {
+ // Mandates: C is a cv-unqualified class type.
+ static_assert(!is_const_v<_Container>, "The target container cannot be const-qualified, please remove the const");
+ static_assert(
+ !is_volatile_v<_Container>, "The target container cannot be volatile-qualified, please remove the volatile");
+
+ auto __to_func = []<input_range _Range, class... _Tail>(_Range && __range, _Tail && ... __tail)
+ requires requires { //
+ /**/ ranges::to<_Container>(std::forward<_Range>(__range), std::forward<_Tail>(__tail)...);
+ }
+ {
+ return ranges::to<_Container>(std::forward<_Range>(__range), std::forward<_Tail>(__tail)...);
+ };
+
+ return __range_adaptor_closure_t(std::__bind_back(__to_func, std::forward<_Args>(__args)...));
+}
+
+// Range adaptor closure object 2 -- wrapping the `ranges::to` version where `_Container` is a template template
+// parameter.
+template <template <class...> class _Container, class... _Args>
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto to(_Args&&... __args) {
+ // clang-format off
+ auto __to_func = []<input_range _Range, class... _Tail,
+ class _DeducedExpr = typename _Deducer<_Container, _Range, _Tail...>::type>
+ (_Range&& __range, _Tail&& ... __tail)
+ requires requires { //
+ /**/ ranges::to<_DeducedExpr>(std::forward<_Range>(__range), std::forward<_Tail>(__tail)...);
+ }
+ {
+ return ranges::to<_DeducedExpr>(std::forward<_Range>(__range), std::forward<_Tail>(__tail)...);
+ };
+ // clang-format on
+
+ return __range_adaptor_closure_t(std::__bind_back(__to_func, std::forward<_Args>(__args)...));
+}
+
+} // namespace ranges
+
+#endif // _LIBCPP_STD_VER >= 23
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___RANGES_TO_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/transform_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/transform_view.h
index 0b5ced3df42..3678f9d64f7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/transform_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/transform_view.h
@@ -20,22 +20,28 @@
#include <__config>
#include <__functional/bind_back.h>
#include <__functional/invoke.h>
+#include <__functional/perfect_forward.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/movable_box.h>
#include <__ranges/range_adaptor.h>
#include <__ranges/size.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_object.h>
+#include <__type_traits/is_reference.h>
#include <__type_traits/maybe_const.h>
+#include <__type_traits/remove_cvref.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
@@ -43,7 +49,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -57,13 +63,17 @@ concept __transform_view_constraints =
regular_invocable<_Fn&, range_reference_t<_View>> &&
__can_reference<invoke_result_t<_Fn&, range_reference_t<_View>>>;
-template<input_range _View, copy_constructible _Fn>
+# if _LIBCPP_STD_VER >= 23
+template <input_range _View, move_constructible _Fn>
+# else
+template <input_range _View, copy_constructible _Fn>
+# endif
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 __movable_box<_Fn> __func_;
_LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
public:
@@ -72,7 +82,7 @@ public:
requires default_initializable<_View> && default_initializable<_Fn> = default;
_LIBCPP_HIDE_FROM_ABI
- constexpr transform_view(_View __base, _Fn __func)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 transform_view(_View __base, _Fn __func)
: __func_(std::in_place, std::move(__func)), __base_(std::move(__base)) {}
_LIBCPP_HIDE_FROM_ABI
@@ -146,7 +156,7 @@ 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>>>,
+ is_reference_v<invoke_result_t<_Fn&, range_reference_t<_View>>>,
conditional_t<
derived_from<_Cat, contiguous_iterator_tag>,
random_access_iterator_tag,
@@ -156,11 +166,14 @@ struct __transform_view_iterator_category_base<_View, _Fn> {
>;
};
-template<input_range _View, copy_constructible _Fn>
+# if _LIBCPP_STD_VER >= 23
+template <input_range _View, move_constructible _Fn>
+# else
+template <input_range _View, copy_constructible _Fn>
+# endif
requires __transform_view_constraints<_View, _Fn>
-template<bool _Const>
-class transform_view<_View, _Fn>::__iterator
- : public __transform_view_iterator_category_base<_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>;
@@ -352,9 +365,13 @@ public:
}
};
-template<input_range _View, copy_constructible _Fn>
+# if _LIBCPP_STD_VER >= 23
+template <input_range _View, move_constructible _Fn>
+# else
+template <input_range _View, copy_constructible _Fn>
+# endif
requires __transform_view_constraints<_View, _Fn>
-template<bool _Const>
+template <bool _Const>
class transform_view<_View, _Fn>::__sentinel {
using _Parent = __maybe_const<_Const, transform_view>;
using _Base = __maybe_const<_Const, _View>;
@@ -435,7 +452,7 @@ inline namespace __cpo {
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/view_interface.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/view_interface.h
index 5581eb9c732..e548355d29a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/view_interface.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/view_interface.h
@@ -31,7 +31,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -118,7 +118,7 @@ public:
constexpr decltype(auto) front()
requires forward_range<_D2>
{
- _LIBCPP_ASSERT(!empty(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(),
"Precondition `!empty()` not satisfied. `.front()` called on an empty view.");
return *ranges::begin(__derived());
}
@@ -128,7 +128,7 @@ public:
constexpr decltype(auto) front() const
requires forward_range<const _D2>
{
- _LIBCPP_ASSERT(!empty(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(),
"Precondition `!empty()` not satisfied. `.front()` called on an empty view.");
return *ranges::begin(__derived());
}
@@ -138,7 +138,7 @@ public:
constexpr decltype(auto) back()
requires bidirectional_range<_D2> && common_range<_D2>
{
- _LIBCPP_ASSERT(!empty(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(),
"Precondition `!empty()` not satisfied. `.back()` called on an empty view.");
return *ranges::prev(ranges::end(__derived()));
}
@@ -148,7 +148,7 @@ public:
constexpr decltype(auto) back() const
requires bidirectional_range<const _D2> && common_range<const _D2>
{
- _LIBCPP_ASSERT(!empty(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(),
"Precondition `!empty()` not satisfied. `.back()` called on an empty view.");
return *ranges::prev(ranges::end(__derived()));
}
@@ -170,7 +170,7 @@ public:
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/views.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/views.h
index d40c64ad8c0..906c4e46c34 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/views.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/views.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -28,7 +28,7 @@ namespace views { }
namespace views = ranges::views;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/zip_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/zip_view.h
index 5624726e13e..2fd1fb30475 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/zip_view.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/zip_view.h
@@ -30,11 +30,13 @@
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/size.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/make_unsigned.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/integer_sequence.h>
#include <__utility/move.h>
#include <tuple>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -45,7 +47,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
namespace ranges {
@@ -77,7 +79,9 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto __tuple_transform(_Fun&& __f, _Tuple&& __tu
template <class _Fun, class _Tuple>
_LIBCPP_HIDE_FROM_ABI constexpr void __tuple_for_each(_Fun&& __f, _Tuple&& __tuple) {
std::apply(
- [&]<class... _Types>(_Types&&... __elements) { (std::invoke(__f, std::forward<_Types>(__elements)), ...); },
+ [&]<class... _Types>(_Types&&... __elements) {
+ (static_cast<void>(std::invoke(__f, std::forward<_Types>(__elements))), ...);
+ },
std::forward<_Tuple>(__tuple));
}
@@ -503,7 +507,7 @@ inline namespace __cpo {
} // namespace views
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__split_buffer b/contrib/libs/cxxsupp/libcxx/include/__split_buffer
index 4855089bcf6..4e702564505 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__split_buffer
+++ b/contrib/libs/cxxsupp/libcxx/include/__split_buffer
@@ -23,9 +23,18 @@
#include <__memory/compressed_pair.h>
#include <__memory/pointer_traits.h>
#include <__memory/swap_allocator.h>
+#include <__type_traits/add_lvalue_reference.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_swappable.h>
+#include <__type_traits/is_trivially_destructible.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
+#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -44,139 +53,173 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _Allocator = allocator<_Tp> >
struct __split_buffer
{
-private:
- __split_buffer(const __split_buffer&);
- __split_buffer& operator=(const __split_buffer&);
public:
- typedef _Tp value_type;
- typedef _Allocator allocator_type;
- typedef __libcpp_remove_reference_t<allocator_type> __alloc_rr;
- typedef allocator_traits<__alloc_rr> __alloc_traits;
- typedef value_type& reference;
- typedef const value_type& const_reference;
- typedef typename __alloc_traits::size_type size_type;
- typedef typename __alloc_traits::difference_type difference_type;
- typedef typename __alloc_traits::pointer pointer;
- typedef typename __alloc_traits::const_pointer const_pointer;
- typedef pointer iterator;
- typedef const_pointer const_iterator;
-
- pointer __first_;
- pointer __begin_;
- pointer __end_;
- __compressed_pair<pointer, allocator_type> __end_cap_;
-
- typedef __add_lvalue_reference_t<allocator_type> __alloc_ref;
- typedef __add_lvalue_reference_t<allocator_type> __alloc_const_ref;
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __alloc_rr& __alloc() _NOEXCEPT {return __end_cap_.second();}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const __alloc_rr& __alloc() const _NOEXCEPT {return __end_cap_.second();}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer& __end_cap() _NOEXCEPT {return __end_cap_.first();}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const pointer& __end_cap() const _NOEXCEPT {return __end_cap_.first();}
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- __split_buffer()
- _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- explicit __split_buffer(__alloc_rr& __a);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- explicit __split_buffer(const __alloc_rr& __a);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~__split_buffer();
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c)
- _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer& operator=(__split_buffer&& __c)
- _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value) ||
- !__alloc_traits::propagate_on_container_move_assignment::value);
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {return __begin_;}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {return __begin_;}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {return __end_;}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {return __end_;}
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void clear() _NOEXCEPT
- {__destruct_at_end(__begin_);}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const {return static_cast<size_type>(__end_ - __begin_);}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const {return __end_ == __begin_;}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const {return static_cast<size_type>(__end_cap() - __first_);}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __front_spare() const {return static_cast<size_type>(__begin_ - __first_);}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __back_spare() const {return static_cast<size_type>(__end_cap() - __end_);}
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() {return *__begin_;}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const {return *__begin_;}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() {return *(__end_ - 1);}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const {return *(__end_ - 1);}
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_front(const_reference __x);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_back(const_reference __x);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __x);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __x);
- template <class... _Args>
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_front() {__destruct_at_begin(__begin_+1);}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_back() {__destruct_at_end(__end_-1);}
- void __uninitialized_at_end(size_type __n);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n, const_reference __x);
- template <class _InputIter>
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIter>::value>
- __construct_at_end(_InputIter __first, _InputIter __last);
- template <class _ForwardIterator>
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value>
- __construct_at_end(_ForwardIterator __first, _ForwardIterator __last);
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_begin(pointer __new_begin)
- {__destruct_at_begin(__new_begin, is_trivially_destructible<value_type>());}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __destruct_at_begin(pointer __new_begin, false_type);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __destruct_at_begin(pointer __new_begin, true_type);
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __destruct_at_end(pointer __new_last) _NOEXCEPT
- {__destruct_at_end(__new_last, false_type());}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT;
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer& __x)
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
- __is_nothrow_swappable<__alloc_rr>::value);
+ using value_type = _Tp;
+ using allocator_type = _Allocator;
+ using __alloc_rr = __libcpp_remove_reference_t<allocator_type>;
+ using __alloc_traits = allocator_traits<__alloc_rr>;
+ using reference = value_type&;
+ using const_reference = const value_type&;
+ using size_type = typename __alloc_traits::size_type;
+ using difference_type = typename __alloc_traits::difference_type;
+ using pointer = typename __alloc_traits::pointer;
+ using const_pointer = typename __alloc_traits::const_pointer;
+ using iterator = pointer;
+ using const_iterator = const_pointer;
+
+ pointer __first_;
+ pointer __begin_;
+ pointer __end_;
+ __compressed_pair<pointer, allocator_type> __end_cap_;
+
+ using __alloc_ref = __add_lvalue_reference_t<allocator_type>;
+ using __alloc_const_ref = __add_lvalue_reference_t<allocator_type>;
+
+ __split_buffer(const __split_buffer&) = delete;
+ __split_buffer& operator=(const __split_buffer&) = delete;
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer()
+ _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
+ : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __default_init_tag()) {}
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer(__alloc_rr& __a)
+ : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a) {}
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer(const __alloc_rr& __a)
+ : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a) {}
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c)
+ _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer& operator=(__split_buffer&& __c)
+ _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
+ is_nothrow_move_assignable<allocator_type>::value) ||
+ !__alloc_traits::propagate_on_container_move_assignment::value);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~__split_buffer();
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __alloc_rr& __alloc() _NOEXCEPT { return __end_cap_.second(); }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const __alloc_rr& __alloc() const _NOEXCEPT {
+ return __end_cap_.second();
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer& __end_cap() _NOEXCEPT { return __end_cap_.first(); }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const pointer& __end_cap() const _NOEXCEPT {
+ return __end_cap_.first();
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __begin_; }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __begin_; }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __end_; }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __end_; }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __destruct_at_end(__begin_); }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const {
+ return static_cast<size_type>(__end_ - __begin_);
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const { return __end_ == __begin_; }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const {
+ return static_cast<size_type>(__end_cap() - __first_);
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __front_spare() const {
+ return static_cast<size_type>(__begin_ - __first_);
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __back_spare() const {
+ return static_cast<size_type>(__end_cap() - __end_);
+ }
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const;
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() { return *__begin_; }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const { return *__begin_; }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() { return *(__end_ - 1); }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const { return *(__end_ - 1); }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_front(const_reference __x);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_back(const_reference __x);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __x);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __x);
+
+ template <class... _Args>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_front() { __destruct_at_begin(__begin_ + 1); }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_back() { __destruct_at_end(__end_ - 1); }
+ void __uninitialized_at_end(size_type __n);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n, const_reference __x);
+
+ template <class _InputIter>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value>
+ __construct_at_end(_InputIter __first, _InputIter __last);
+
+ template <class _ForwardIterator>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value>
+ __construct_at_end(_ForwardIterator __first, _ForwardIterator __last);
+
+ template <class _Iterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ void __construct_at_end_with_sentinel(_Iterator __first, _Sentinel __last);
+
+ template <class _Iterator>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ void __construct_at_end_with_size(_Iterator __first, size_type __n);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_begin(pointer __new_begin) {
+ __destruct_at_begin(__new_begin, is_trivially_destructible<value_type>());
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_begin(pointer __new_begin, false_type);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_begin(pointer __new_begin, true_type);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last) _NOEXCEPT {
+ __destruct_at_end(__new_last, false_type());
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT;
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer& __x)
+ _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<__alloc_rr>::value);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const;
private:
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __move_assign_alloc(__split_buffer& __c, true_type)
- _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
- {
- __alloc() = _VSTD::move(__c.__alloc());
- }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer& __c, true_type)
+ _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
+ __alloc() = _VSTD::move(__c.__alloc());
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT {}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT
- {}
-
- struct _ConstructTransaction {
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit _ConstructTransaction(pointer* __p, size_type __n) _NOEXCEPT
- : __pos_(*__p), __end_(*__p + __n), __dest_(__p) {
- }
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~_ConstructTransaction() {
- *__dest_ = __pos_;
- }
- pointer __pos_;
- const pointer __end_;
- private:
- pointer *__dest_;
- };
+ struct _ConstructTransaction {
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit _ConstructTransaction(
+ pointer* __p, size_type __n) _NOEXCEPT
+ : __pos_(*__p),
+ __end_(*__p + __n),
+ __dest_(__p) {}
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~_ConstructTransaction() { *__dest_ = __pos_; }
+
+ pointer __pos_;
+ const pointer __end_;
+
+ private:
+ pointer* __dest_;
+ };
};
template <class _Tp, class _Allocator>
@@ -248,9 +291,16 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n, const_referen
template <class _Tp, class _Allocator>
template <class _InputIter>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIter>::value>
+_LIBCPP_CONSTEXPR_SINCE_CXX20 __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value>
__split_buffer<_Tp, _Allocator>::__construct_at_end(_InputIter __first, _InputIter __last)
{
+ __construct_at_end_with_sentinel(__first, __last);
+}
+
+template <class _Tp, class _Allocator>
+template <class _Iterator, class _Sentinel>
+_LIBCPP_CONSTEXPR_SINCE_CXX20
+void __split_buffer<_Tp, _Allocator>::__construct_at_end_with_sentinel(_Iterator __first, _Sentinel __last) {
__alloc_rr& __a = this->__alloc();
for (; __first != __last; ++__first)
{
@@ -268,13 +318,19 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(_InputIter __first, _InputIt
++this->__end_;
}
}
-
template <class _Tp, class _Allocator>
template <class _ForwardIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value>
+_LIBCPP_CONSTEXPR_SINCE_CXX20 __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value>
__split_buffer<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last)
{
- _ConstructTransaction __tx(&this->__end_, _VSTD::distance(__first, __last));
+ __construct_at_end_with_size(__first, std::distance(__first, __last));
+}
+
+template <class _Tp, class _Allocator>
+template <class _ForwardIterator>
+_LIBCPP_CONSTEXPR_SINCE_CXX20
+void __split_buffer<_Tp, _Allocator>::__construct_at_end_with_size(_ForwardIterator __first, size_type __n) {
+ _ConstructTransaction __tx(&this->__end_, __n);
for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, (void) ++__first) {
__alloc_traits::construct(this->__alloc(),
_VSTD::__to_address(__tx.__pos_), *__first);
@@ -337,31 +393,6 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __sta
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
-inline
-__split_buffer<_Tp, _Allocator>::__split_buffer()
- _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
- : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __default_init_tag())
-{
-}
-
-template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-inline
-__split_buffer<_Tp, _Allocator>::__split_buffer(__alloc_rr& __a)
- : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
-{
-}
-
-template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-inline
-__split_buffer<_Tp, _Allocator>::__split_buffer(const __alloc_rr& __a)
- : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
-{
-}
-
-template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
__split_buffer<_Tp, _Allocator>::~__split_buffer()
{
clear();
@@ -470,10 +501,10 @@ __split_buffer<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
{
if (capacity() > size())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__split_buffer<value_type, __alloc_rr&> __t(size(), 0, __alloc());
__t.__construct_at_end(move_iterator<pointer>(__begin_),
move_iterator<pointer>(__end_));
@@ -482,12 +513,12 @@ __split_buffer<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
_VSTD::swap(__begin_, __t.__begin_);
_VSTD::swap(__end_, __t.__end_);
_VSTD::swap(__end_cap(), __t.__end_cap());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__std_mbstate_t.h b/contrib/libs/cxxsupp/libcxx/include/__std_mbstate_t.h
new file mode 100644
index 00000000000..e79cc789fdd
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__std_mbstate_t.h
@@ -0,0 +1,29 @@
+// -*- 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___STD_MBSTATE_T_H
+#define _LIBCPP___STD_MBSTATE_T_H
+
+#include <__config>
+#include <__mbstate_t.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+// The goal of this header is to provide std::mbstate_t without requiring all
+// of <cuchar> or <cwchar>.
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___STD_MBSTATE_T_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__std_stream b/contrib/libs/cxxsupp/libcxx/include/__std_stream
deleted file mode 100644
index e419e8c03af..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__std_stream
+++ /dev/null
@@ -1,361 +0,0 @@
-// -*- 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___STD_STREAM
-#define _LIBCPP___STD_STREAM
-
-#include <__config>
-#include <__locale>
-#include <cstdio>
-#include <istream>
-#include <ostream>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-static const int __limit = 8;
-
-// __stdinbuf
-
-template <class _CharT>
-class _LIBCPP_HIDDEN __stdinbuf
- : public basic_streambuf<_CharT, char_traits<_CharT> >
-{
-public:
- typedef _CharT char_type;
- typedef char_traits<char_type> traits_type;
- typedef typename traits_type::int_type int_type;
- typedef typename traits_type::pos_type pos_type;
- typedef typename traits_type::off_type off_type;
- typedef typename traits_type::state_type state_type;
-
- __stdinbuf(FILE* __fp, state_type* __st);
-
-protected:
- virtual int_type underflow();
- virtual int_type uflow();
- virtual int_type pbackfail(int_type __c = traits_type::eof());
- virtual void imbue(const locale& __loc);
-
-private:
-
- FILE* __file_;
- const codecvt<char_type, char, state_type>* __cv_;
- state_type* __st_;
- int __encoding_;
- int_type __last_consumed_;
- bool __last_consumed_is_next_;
- bool __always_noconv_;
-
- __stdinbuf(const __stdinbuf&);
- __stdinbuf& operator=(const __stdinbuf&);
-
- int_type __getchar(bool __consume);
-};
-
-template <class _CharT>
-__stdinbuf<_CharT>::__stdinbuf(FILE* __fp, state_type* __st)
- : __file_(__fp),
- __st_(__st),
- __last_consumed_(traits_type::eof()),
- __last_consumed_is_next_(false)
-{
- imbue(this->getloc());
-}
-
-template <class _CharT>
-void
-__stdinbuf<_CharT>::imbue(const locale& __loc)
-{
- __cv_ = &use_facet<codecvt<char_type, char, state_type> >(__loc);
- __encoding_ = __cv_->encoding();
- __always_noconv_ = __cv_->always_noconv();
- if (__encoding_ > __limit)
- __throw_runtime_error("unsupported locale for standard input");
-}
-
-template <class _CharT>
-typename __stdinbuf<_CharT>::int_type
-__stdinbuf<_CharT>::underflow()
-{
- return __getchar(false);
-}
-
-template <class _CharT>
-typename __stdinbuf<_CharT>::int_type
-__stdinbuf<_CharT>::uflow()
-{
- return __getchar(true);
-}
-
-template <class _CharT>
-typename __stdinbuf<_CharT>::int_type
-__stdinbuf<_CharT>::__getchar(bool __consume)
-{
- if (__last_consumed_is_next_)
- {
- int_type __result = __last_consumed_;
- if (__consume)
- {
- __last_consumed_ = traits_type::eof();
- __last_consumed_is_next_ = false;
- }
- return __result;
- }
- char __extbuf[__limit];
- int __nread = _VSTD::max(1, __encoding_);
- for (int __i = 0; __i < __nread; ++__i)
- {
- int __c = getc(__file_);
- if (__c == EOF)
- return traits_type::eof();
- __extbuf[__i] = static_cast<char>(__c);
- }
- char_type __1buf;
- if (__always_noconv_)
- __1buf = static_cast<char_type>(__extbuf[0]);
- else
- {
- const char* __enxt;
- char_type* __inxt;
- codecvt_base::result __r;
- do
- {
- state_type __sv_st = *__st_;
- __r = __cv_->in(*__st_, __extbuf, __extbuf + __nread, __enxt,
- &__1buf, &__1buf + 1, __inxt);
- switch (__r)
- {
- case _VSTD::codecvt_base::ok:
- break;
- case codecvt_base::partial:
- *__st_ = __sv_st;
- if (__nread == sizeof(__extbuf))
- return traits_type::eof();
- {
- int __c = getc(__file_);
- if (__c == EOF)
- return traits_type::eof();
- __extbuf[__nread] = static_cast<char>(__c);
- }
- ++__nread;
- break;
- case codecvt_base::error:
- return traits_type::eof();
- case _VSTD::codecvt_base::noconv:
- __1buf = static_cast<char_type>(__extbuf[0]);
- break;
- }
- } while (__r == _VSTD::codecvt_base::partial);
- }
- if (!__consume)
- {
- for (int __i = __nread; __i > 0;)
- {
- if (ungetc(traits_type::to_int_type(__extbuf[--__i]), __file_) == EOF)
- return traits_type::eof();
- }
- }
- else
- __last_consumed_ = traits_type::to_int_type(__1buf);
- return traits_type::to_int_type(__1buf);
-}
-
-template <class _CharT>
-typename __stdinbuf<_CharT>::int_type
-__stdinbuf<_CharT>::pbackfail(int_type __c)
-{
- if (traits_type::eq_int_type(__c, traits_type::eof()))
- {
- if (!__last_consumed_is_next_)
- {
- __c = __last_consumed_;
- __last_consumed_is_next_ = !traits_type::eq_int_type(__last_consumed_,
- traits_type::eof());
- }
- return __c;
- }
- if (__last_consumed_is_next_)
- {
- char __extbuf[__limit];
- char* __enxt;
- const char_type __ci = traits_type::to_char_type(__last_consumed_);
- const char_type* __inxt;
- switch (__cv_->out(*__st_, &__ci, &__ci + 1, __inxt,
- __extbuf, __extbuf + sizeof(__extbuf), __enxt))
- {
- case _VSTD::codecvt_base::ok:
- break;
- case _VSTD::codecvt_base::noconv:
- __extbuf[0] = static_cast<char>(__last_consumed_);
- __enxt = __extbuf + 1;
- break;
- case codecvt_base::partial:
- case codecvt_base::error:
- return traits_type::eof();
- }
- while (__enxt > __extbuf)
- if (ungetc(*--__enxt, __file_) == EOF)
- return traits_type::eof();
- }
- __last_consumed_ = __c;
- __last_consumed_is_next_ = true;
- return __c;
-}
-
-// __stdoutbuf
-
-template <class _CharT>
-class _LIBCPP_HIDDEN __stdoutbuf
- : public basic_streambuf<_CharT, char_traits<_CharT> >
-{
-public:
- typedef _CharT char_type;
- typedef char_traits<char_type> traits_type;
- typedef typename traits_type::int_type int_type;
- typedef typename traits_type::pos_type pos_type;
- typedef typename traits_type::off_type off_type;
- typedef typename traits_type::state_type state_type;
-
- __stdoutbuf(FILE* __fp, state_type* __st);
-
-protected:
- virtual int_type overflow (int_type __c = traits_type::eof());
- virtual streamsize xsputn(const char_type* __s, streamsize __n);
- virtual int sync();
- virtual void imbue(const locale& __loc);
-
-private:
- FILE* __file_;
- const codecvt<char_type, char, state_type>* __cv_;
- state_type* __st_;
- bool __always_noconv_;
-
- __stdoutbuf(const __stdoutbuf&);
- __stdoutbuf& operator=(const __stdoutbuf&);
-};
-
-template <class _CharT>
-__stdoutbuf<_CharT>::__stdoutbuf(FILE* __fp, state_type* __st)
- : __file_(__fp),
- __cv_(&use_facet<codecvt<char_type, char, state_type> >(this->getloc())),
- __st_(__st),
- __always_noconv_(__cv_->always_noconv())
-{
-}
-
-template <class _CharT>
-typename __stdoutbuf<_CharT>::int_type
-__stdoutbuf<_CharT>::overflow(int_type __c)
-{
- char __extbuf[__limit];
- char_type __1buf;
- if (!traits_type::eq_int_type(__c, traits_type::eof()))
- {
- __1buf = traits_type::to_char_type(__c);
- if (__always_noconv_)
- {
- if (fwrite(&__1buf, sizeof(char_type), 1, __file_) != 1)
- return traits_type::eof();
- }
- else
- {
- char* __extbe = __extbuf;
- codecvt_base::result __r;
- char_type* pbase = &__1buf;
- char_type* pptr = pbase + 1;
- do
- {
- const char_type* __e;
- __r = __cv_->out(*__st_, pbase, pptr, __e,
- __extbuf,
- __extbuf + sizeof(__extbuf),
- __extbe);
- if (__e == pbase)
- return traits_type::eof();
- if (__r == codecvt_base::noconv)
- {
- if (fwrite(pbase, 1, 1, __file_) != 1)
- return traits_type::eof();
- }
- else if (__r == codecvt_base::ok || __r == codecvt_base::partial)
- {
- size_t __nmemb = static_cast<size_t>(__extbe - __extbuf);
- if (fwrite(__extbuf, 1, __nmemb, __file_) != __nmemb)
- return traits_type::eof();
- if (__r == codecvt_base::partial)
- {
- pbase = const_cast<char_type*>(__e);
- }
- }
- else
- return traits_type::eof();
- } while (__r == codecvt_base::partial);
- }
- }
- return traits_type::not_eof(__c);
-}
-
-template <class _CharT>
-streamsize
-__stdoutbuf<_CharT>::xsputn(const char_type* __s, streamsize __n)
-{
- if (__always_noconv_)
- return fwrite(__s, sizeof(char_type), __n, __file_);
- streamsize __i = 0;
- for (; __i < __n; ++__i, ++__s)
- if (overflow(traits_type::to_int_type(*__s)) == traits_type::eof())
- break;
- return __i;
-}
-
-template <class _CharT>
-int
-__stdoutbuf<_CharT>::sync()
-{
- char __extbuf[__limit];
- codecvt_base::result __r;
- do
- {
- char* __extbe;
- __r = __cv_->unshift(*__st_, __extbuf,
- __extbuf + sizeof(__extbuf),
- __extbe);
- size_t __nmemb = static_cast<size_t>(__extbe - __extbuf);
- if (fwrite(__extbuf, 1, __nmemb, __file_) != __nmemb)
- return -1;
- } while (__r == codecvt_base::partial);
- if (__r == codecvt_base::error)
- return -1;
- if (fflush(__file_))
- return -1;
- return 0;
-}
-
-template <class _CharT>
-void
-__stdoutbuf<_CharT>::imbue(const locale& __loc)
-{
- sync();
- __cv_ = &use_facet<codecvt<char_type, char, state_type> >(__loc);
- __always_noconv_ = __cv_->always_noconv();
-}
-
-_LIBCPP_END_NAMESPACE_STD
-
-_LIBCPP_POP_MACROS
-
-#endif // _LIBCPP___STD_STREAM
diff --git a/contrib/libs/cxxsupp/libcxx/include/__string/char_traits.h b/contrib/libs/cxxsupp/libcxx/include/__string/char_traits.h
index 622ee224f1a..c201fc9a1cd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__string/char_traits.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__string/char_traits.h
@@ -18,11 +18,11 @@
#include <__config>
#include <__functional/hash.h>
#include <__iterator/iterator_traits.h>
+#include <__string/constexpr_c_functions.h>
#include <__type_traits/is_constant_evaluated.h>
#include <cstddef>
#include <cstdint>
#include <cstdio>
-#include <cstring>
#include <iosfwd>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -73,7 +73,7 @@ exposition-only to document what members a char_traits specialization should pro
//
// Temporary extension to provide a base template for std::char_traits.
-// TODO: Remove in LLVM 18.
+// TODO(LLVM-18): Remove this class.
//
template <class _CharT>
struct _LIBCPP_DEPRECATED_("char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 18, so please migrate off of it.")
@@ -85,14 +85,14 @@ struct _LIBCPP_DEPRECATED_("char_traits<T> for T not equal to char, wchar_t, cha
using pos_type = streampos;
using state_type = mbstate_t;
- static inline void _LIBCPP_CONSTEXPR_SINCE_CXX17
+ static inline void _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_HIDE_FROM_ABI
assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 < __c2;}
- static _LIBCPP_CONSTEXPR_SINCE_CXX17
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
int compare(const char_type* __s1, const char_type* __s2, size_t __n) {
for (; __n; --__n, ++__s1, ++__s2)
{
@@ -120,7 +120,7 @@ struct _LIBCPP_DEPRECATED_("char_traits<T> for T not equal to char, wchar_t, cha
}
return nullptr;
}
- static _LIBCPP_CONSTEXPR_SINCE_CXX20
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* move(char_type* __s1, const char_type* __s2, size_t __n) {
if (__n == 0) return __s1;
char_type* __r = __s1;
@@ -142,7 +142,8 @@ struct _LIBCPP_DEPRECATED_("char_traits<T> for T not equal to char, wchar_t, cha
static _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) {
if (!__libcpp_is_constant_evaluated()) {
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(
+ __s2 < __s1 || __s2 >= __s1 + __n, "char_traits::copy overlapped range");
}
char_type* __r = __s1;
for (; __n; --__n, ++__s1, ++__s2)
@@ -158,37 +159,18 @@ struct _LIBCPP_DEPRECATED_("char_traits<T> for T not equal to char, wchar_t, cha
return __r;
}
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
{return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
{return int_type(__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
{return int_type(EOF);}
};
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI static inline _LIBCPP_CONSTEXPR_SINCE_CXX20
-_CharT* __char_traits_move(_CharT* __dest, const _CharT* __source, size_t __n) _NOEXCEPT
-{
-#ifdef _LIBCPP_COMPILER_GCC
- if (__libcpp_is_constant_evaluated()) {
- if (__n == 0)
- return __dest;
- _CharT* __allocation = new _CharT[__n];
- std::copy_n(__source, __n, __allocation);
- std::copy_n(static_cast<const _CharT*>(__allocation), __n, __dest);
- delete[] __allocation;
- return __dest;
- }
-#endif
- ::__builtin_memmove(__dest, __source, __n * sizeof(_CharT));
- return __dest;
-}
-
// char_traits<char>
template <>
@@ -199,62 +181,83 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char>
using off_type = streamoff;
using pos_type = streampos;
using state_type = mbstate_t;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using comparison_category = strong_ordering;
#endif
- static inline _LIBCPP_CONSTEXPR_SINCE_CXX17
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+
+ // TODO: Make this _LIBCPP_HIDE_FROM_ABI
+ static inline _LIBCPP_HIDDEN _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
{return (unsigned char)__c1 < (unsigned char)__c2;}
- static _LIBCPP_CONSTEXPR_SINCE_CXX17 int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
- if (__n == 0)
- return 0;
- return std::__constexpr_memcmp(__s1, __s2, __n);
- }
+ // __constexpr_memcmp requires a trivially lexicographically comparable type, but char is not when char is a signed type
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 int
+ compare(const char_type* __lhs, const char_type* __rhs, size_t __count) _NOEXCEPT {
+ if (__libcpp_is_constant_evaluated()) {
+#ifdef _LIBCPP_COMPILER_CLANG_BASED
+ return __builtin_memcmp(__lhs, __rhs, __count);
+#else
+ while (__count != 0) {
+ if (lt(*__lhs, *__rhs))
+ return -1;
+ if (lt(*__rhs, *__lhs))
+ return 1;
- static inline size_t _LIBCPP_CONSTEXPR_SINCE_CXX17 length(const char_type* __s) _NOEXCEPT {
- return std::__constexpr_strlen(__s);
- }
+ __count -= sizeof(char_type);
+ ++__lhs;
+ ++__rhs;
+ }
+ return 0;
+#endif // _LIBCPP_COMPILER_CLANG_BASED
+ } else {
+ return __builtin_memcmp(__lhs, __rhs, __count);
+ }
+ }
- static _LIBCPP_CONSTEXPR_SINCE_CXX17
- const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {
- if (__n == 0)
- return nullptr;
- return std::__constexpr_char_memchr(__s, static_cast<int>(__a), __n);
- }
+ static inline _LIBCPP_HIDE_FROM_ABI size_t _LIBCPP_CONSTEXPR_SINCE_CXX17 length(const char_type* __s) _NOEXCEPT {
+ return std::__constexpr_strlen(__s);
+ }
- static inline _LIBCPP_CONSTEXPR_SINCE_CXX20
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
+ const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {
+ if (__n == 0)
+ return nullptr;
+ return std::__constexpr_memchr(__s, __a, __n);
+ }
+
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
- return std::__char_traits_move(__s1, __s2, __n);
+ return std::__constexpr_memmove(__s1, __s2, __element_count(__n));
}
- static inline _LIBCPP_CONSTEXPR_SINCE_CXX20
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
if (!__libcpp_is_constant_evaluated())
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(
+ __s2 < __s1 || __s2 >= __s1 + __n, "char_traits::copy overlapped range");
std::copy_n(__s2, __n, __s1);
return __s1;
}
- static inline _LIBCPP_CONSTEXPR_SINCE_CXX20
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT {
std::fill_n(__s, __n, __a);
return __s;
}
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
{return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
{return int_type((unsigned char)__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
{return int_type(EOF);}
};
@@ -269,62 +272,64 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t>
using off_type = streamoff;
using pos_type = streampos;
using state_type = mbstate_t;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using comparison_category = strong_ordering;
#endif
- static inline _LIBCPP_CONSTEXPR_SINCE_CXX17
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 < __c2;}
- static _LIBCPP_CONSTEXPR_SINCE_CXX17 int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
if (__n == 0)
- return 0;
+ return 0;
return std::__constexpr_wmemcmp(__s1, __s2, __n);
}
- static _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t length(const char_type* __s) _NOEXCEPT {
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t length(const char_type* __s) _NOEXCEPT {
return std::__constexpr_wcslen(__s);
}
- static _LIBCPP_CONSTEXPR_SINCE_CXX17
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {
if (__n == 0)
return nullptr;
return std::__constexpr_wmemchr(__s, __a, __n);
}
- static inline _LIBCPP_CONSTEXPR_SINCE_CXX20
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
- return std::__char_traits_move(__s1, __s2, __n);
+ return std::__constexpr_memmove(__s1, __s2, __element_count(__n));
}
- static inline _LIBCPP_CONSTEXPR_SINCE_CXX20
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
if (!__libcpp_is_constant_evaluated())
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(
+ __s2 < __s1 || __s2 >= __s1 + __n, "char_traits::copy overlapped range");
std::copy_n(__s2, __n, __s1);
return __s1;
}
- static inline _LIBCPP_CONSTEXPR_SINCE_CXX20
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT {
std::fill_n(__s, __n, __a);
return __s;
}
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
{return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
{return int_type(__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
{return int_type(WEOF);}
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -339,56 +344,57 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char8_t>
using off_type = streamoff;
using pos_type = u8streampos;
using state_type = mbstate_t;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using comparison_category = strong_ordering;
#endif
- static inline constexpr void assign(char_type& __c1, const char_type& __c2) noexcept
+ static inline _LIBCPP_HIDE_FROM_ABI constexpr void assign(char_type& __c1, const char_type& __c2) noexcept
{__c1 = __c2;}
- static inline constexpr bool eq(char_type __c1, char_type __c2) noexcept
+ static inline _LIBCPP_HIDE_FROM_ABI constexpr bool eq(char_type __c1, char_type __c2) noexcept
{return __c1 == __c2;}
- static inline constexpr bool lt(char_type __c1, char_type __c2) noexcept
+ static inline _LIBCPP_HIDE_FROM_ABI constexpr bool lt(char_type __c1, char_type __c2) noexcept
{return __c1 < __c2;}
static _LIBCPP_HIDE_FROM_ABI constexpr int
compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
- return std::__constexpr_memcmp(__s1, __s2, __n);
+ return std::__constexpr_memcmp(__s1, __s2, __element_count(__n));
}
- static constexpr
+ static _LIBCPP_HIDE_FROM_ABI constexpr
size_t length(const char_type* __s) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY static constexpr
const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
- static _LIBCPP_CONSTEXPR_SINCE_CXX20
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
- return std::__char_traits_move(__s1, __s2, __n);
+ return std::__constexpr_memmove(__s1, __s2, __element_count(__n));
}
- static _LIBCPP_CONSTEXPR_SINCE_CXX20
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
if (!__libcpp_is_constant_evaluated())
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(
+ __s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
std::copy_n(__s2, __n, __s1);
return __s1;
}
- static _LIBCPP_CONSTEXPR_SINCE_CXX20
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT {
std::fill_n(__s, __n, __a);
return __s;
}
- static inline constexpr int_type not_eof(int_type __c) noexcept
+ static inline _LIBCPP_HIDE_FROM_ABI constexpr int_type not_eof(int_type __c) noexcept
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline constexpr char_type to_char_type(int_type __c) noexcept
+ static inline _LIBCPP_HIDE_FROM_ABI constexpr char_type to_char_type(int_type __c) noexcept
{return char_type(__c);}
- static inline constexpr int_type to_int_type(char_type __c) noexcept
+ static inline _LIBCPP_HIDE_FROM_ABI constexpr int_type to_int_type(char_type __c) noexcept
{return int_type(__c);}
- static inline constexpr bool eq_int_type(int_type __c1, int_type __c2) noexcept
+ static inline _LIBCPP_HIDE_FROM_ABI constexpr bool eq_int_type(int_type __c1, int_type __c2) noexcept
{return __c1 == __c2;}
- static inline constexpr int_type eof() noexcept
+ static inline _LIBCPP_HIDE_FROM_ABI constexpr int_type eof() noexcept
{return int_type(EOF);}
};
@@ -427,15 +433,15 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char16_t>
using off_type = streamoff;
using pos_type = u16streampos;
using state_type = mbstate_t;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using comparison_category = strong_ordering;
#endif
- static inline _LIBCPP_CONSTEXPR_SINCE_CXX17
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 < __c2;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_SINCE_CXX17
@@ -447,13 +453,14 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char16_t>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
- return std::__char_traits_move(__s1, __s2, __n);
+ return std::__constexpr_memmove(__s1, __s2, __element_count(__n));
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
if (!__libcpp_is_constant_evaluated())
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(
+ __s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
std::copy_n(__s2, __n, __s1);
return __s1;
}
@@ -464,15 +471,15 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char16_t>
return __s;
}
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
{return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
{return int_type(__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
{return int_type(0xFFFF);}
};
@@ -521,15 +528,15 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char32_t>
using off_type = streamoff;
using pos_type = u32streampos;
using state_type = mbstate_t;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using comparison_category = strong_ordering;
#endif
- static inline _LIBCPP_CONSTEXPR_SINCE_CXX17
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 < __c2;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_SINCE_CXX17
@@ -541,7 +548,7 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char32_t>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
- return std::__char_traits_move(__s1, __s2, __n);
+ return std::__constexpr_memmove(__s1, __s2, __element_count(__n));
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -556,15 +563,15 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char32_t>
return __s;
}
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
{return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
{return int_type(__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
{return int_type(0xFFFFFFFF);}
};
diff --git a/contrib/libs/cxxsupp/libcxx/include/__string/constexpr_c_functions.h b/contrib/libs/cxxsupp/libcxx/include/__string/constexpr_c_functions.h
new file mode 100644
index 00000000000..198f0f5e680
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__string/constexpr_c_functions.h
@@ -0,0 +1,219 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___STRING_CONSTEXPR_C_FUNCTIONS_H
+#define _LIBCPP___STRING_CONSTEXPR_C_FUNCTIONS_H
+
+#include <__config>
+#include <__memory/addressof.h>
+#include <__memory/construct_at.h>
+#include <__type_traits/datasizeof.h>
+#include <__type_traits/is_always_bitcastable.h>
+#include <__type_traits/is_assignable.h>
+#include <__type_traits/is_constant_evaluated.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_equality_comparable.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_trivially_copyable.h>
+#include <__type_traits/is_trivially_lexicographically_comparable.h>
+#include <__type_traits/remove_cv.h>
+#include <__utility/is_pointer_in_range.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// Type used to encode that a function takes an integer that represents a number
+// of elements as opposed to a number of bytes.
+enum class __element_count : size_t {};
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t __constexpr_strlen(const char* __str) {
+ // GCC currently doesn't support __builtin_strlen for heap-allocated memory during constant evaluation.
+ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70816
+#ifdef _LIBCPP_COMPILER_GCC
+ if (__libcpp_is_constant_evaluated()) {
+ size_t __i = 0;
+ for (; __str[__i] != '\0'; ++__i)
+ ;
+ return __i;
+ }
+#endif
+ return __builtin_strlen(__str);
+}
+
+// Because of __libcpp_is_trivially_lexicographically_comparable we know that comparing the object representations is
+// equivalent to a std::memcmp. Since we have multiple objects contiguously in memory, we can call memcmp once instead
+// of invoking it on every object individually.
+template <class _Tp, class _Up>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int
+__constexpr_memcmp(const _Tp* __lhs, const _Up* __rhs, __element_count __n) {
+ static_assert(__libcpp_is_trivially_lexicographically_comparable<_Tp, _Up>::value,
+ "_Tp and _Up have to be trivially lexicographically comparable");
+
+ auto __count = static_cast<size_t>(__n);
+
+ if (__libcpp_is_constant_evaluated()) {
+#ifdef _LIBCPP_COMPILER_CLANG_BASED
+ if (sizeof(_Tp) == 1 && !is_same<_Tp, bool>::value)
+ return __builtin_memcmp(__lhs, __rhs, __count * sizeof(_Tp));
+#endif
+
+ while (__count != 0) {
+ if (*__lhs < *__rhs)
+ return -1;
+ if (*__rhs < *__lhs)
+ return 1;
+
+ --__count;
+ ++__lhs;
+ ++__rhs;
+ }
+ return 0;
+ } else {
+ return __builtin_memcmp(__lhs, __rhs, __count * sizeof(_Tp));
+ }
+}
+
+// Because of __libcpp_is_trivially_equality_comparable we know that comparing the object representations is equivalent
+// to a std::memcmp(...) == 0. Since we have multiple objects contiguously in memory, we can call memcmp once instead
+// of invoking it on every object individually.
+template <class _Tp, class _Up>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
+__constexpr_memcmp_equal(const _Tp* __lhs, const _Up* __rhs, __element_count __n) {
+ static_assert(__libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
+ "_Tp and _Up have to be trivially equality comparable");
+
+ auto __count = static_cast<size_t>(__n);
+
+ if (__libcpp_is_constant_evaluated()) {
+#ifdef _LIBCPP_COMPILER_CLANG_BASED
+ if (sizeof(_Tp) == 1 && is_integral<_Tp>::value && !is_same<_Tp, bool>::value)
+ return __builtin_memcmp(__lhs, __rhs, __count * sizeof(_Tp)) == 0;
+#endif
+ while (__count != 0) {
+ if (*__lhs != *__rhs)
+ return false;
+
+ --__count;
+ ++__lhs;
+ ++__rhs;
+ }
+ return true;
+ } else {
+ return __builtin_memcmp(__lhs, __rhs, __count * sizeof(_Tp)) == 0;
+ }
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_memchr(_Tp* __str, _Up __value, size_t __count) {
+ static_assert(sizeof(_Tp) == 1 && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
+ "Calling memchr on non-trivially equality comparable types is unsafe.");
+
+ if (__libcpp_is_constant_evaluated()) {
+// use __builtin_char_memchr to optimize constexpr evaluation if we can
+#if _LIBCPP_STD_VER >= 17 && __has_builtin(__builtin_char_memchr)
+ if constexpr (is_same_v<remove_cv_t<_Tp>, char> && is_same_v<remove_cv_t<_Up>, char>)
+ return __builtin_char_memchr(__str, __value, __count);
+#endif
+
+ for (; __count; --__count) {
+ if (*__str == __value)
+ return __str;
+ ++__str;
+ }
+ return nullptr;
+ } else {
+ char __value_buffer = 0;
+ __builtin_memcpy(&__value_buffer, &__value, sizeof(char));
+ return static_cast<_Tp*>(__builtin_memchr(__str, __value_buffer, __count));
+ }
+}
+
+// This function performs an assignment to an existing, already alive TriviallyCopyable object
+// from another TriviallyCopyable object.
+//
+// It basically works around the fact that TriviallyCopyable objects are not required to be
+// syntactically copy/move constructible or copy/move assignable. Technically, only one of the
+// four operations is required to be syntactically valid -- but at least one definitely has to
+// be valid.
+//
+// This is necessary in order to implement __constexpr_memmove below in a way that mirrors as
+// closely as possible what the compiler's __builtin_memmove is able to do.
+template <class _Tp, class _Up, __enable_if_t<is_assignable<_Tp&, _Up const&>::value, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp& __assign_trivially_copyable(_Tp& __dest, _Up const& __src) {
+ __dest = __src;
+ return __dest;
+}
+
+// clang-format off
+template <class _Tp, class _Up, __enable_if_t<!is_assignable<_Tp&, _Up const&>::value &&
+ is_assignable<_Tp&, _Up&&>::value, int> = 0>
+// clang-format on
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp& __assign_trivially_copyable(_Tp& __dest, _Up& __src) {
+ __dest =
+ static_cast<_Up&&>(__src); // this is safe, we're not actually moving anything since the assignment is trivial
+ return __dest;
+}
+
+// clang-format off
+template <class _Tp, class _Up, __enable_if_t<!is_assignable<_Tp&, _Up const&>::value &&
+ !is_assignable<_Tp&, _Up&&>::value &&
+ is_constructible<_Tp, _Up const&>::value, int> = 0>
+// clang-format on
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& __assign_trivially_copyable(_Tp& __dest, _Up const& __src) {
+ // _Tp is trivially destructible, so we don't need to call its destructor to end the lifetime of the object
+ // that was there previously
+ std::__construct_at(std::addressof(__dest), __src);
+ return __dest;
+}
+
+// clang-format off
+template <class _Tp, class _Up, __enable_if_t<!is_assignable<_Tp&, _Up const&>::value &&
+ !is_assignable<_Tp&, _Up&&>::value &&
+ !is_constructible<_Tp, _Up const&>::value &&
+ is_constructible<_Tp, _Up&&>::value, int> = 0>
+// clang-format on
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& __assign_trivially_copyable(_Tp& __dest, _Up& __src) {
+ // _Tp is trivially destructible, so we don't need to call its destructor to end the lifetime of the object
+ // that was there previously
+ std::__construct_at(
+ std::addressof(__dest),
+ static_cast<_Up&&>(__src)); // this is safe, we're not actually moving anything since the constructor is trivial
+ return __dest;
+}
+
+template <class _Tp, class _Up, __enable_if_t<__is_always_bitcastable<_Up, _Tp>::value, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp*
+__constexpr_memmove(_Tp* __dest, _Up* __src, __element_count __n) {
+ size_t __count = static_cast<size_t>(__n);
+ if (__libcpp_is_constant_evaluated()) {
+#ifdef _LIBCPP_COMPILER_CLANG_BASED
+ if (is_same<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >::value) {
+ ::__builtin_memmove(__dest, __src, __count * sizeof(_Tp));
+ return __dest;
+ }
+#endif
+ if (std::__is_pointer_in_range(__src, __src + __count, __dest)) {
+ for (; __count > 0; --__count)
+ std::__assign_trivially_copyable(__dest[__count - 1], __src[__count - 1]);
+ } else {
+ for (size_t __i = 0; __i != __count; ++__i)
+ std::__assign_trivially_copyable(__dest[__i], __src[__i]);
+ }
+ } else if (__count > 0) {
+ ::__builtin_memmove(__dest, __src, (__count - 1) * sizeof(_Tp) + __libcpp_datasizeof<_Tp>::value);
+ }
+ return __dest;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___STRING_CONSTEXPR_C_FUNCTIONS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__string/extern_template_lists.h b/contrib/libs/cxxsupp/libcxx/include/__string/extern_template_lists.h
index e56d1bf623b..078c7c7b390 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__string/extern_template_lists.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__string/extern_template_lists.h
@@ -28,103 +28,102 @@
// functions supporting new c++ version / API changes. Typically entries
// must never be removed from the stable list.
#define _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_Func, _CharType) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type const*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, allocator<_CharType> const&)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_not_of(value_type const*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::~basic_string()) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_not_of(value_type const*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, size_type, value_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::operator=(value_type)) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type)) \
- _Func(_LIBCPP_FUNC_VIS const _CharType& basic_string<_CharType>::at(size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_of(value_type const*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, size_type, value_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(value_type const*, size_type)) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::reserve(size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_of(value_type const*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__grow_by(size_type, size_type, size_type, size_type, size_type, size_type)) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__grow_by_and_replace(size_type, size_type, size_type, size_type, size_type, size_type, value_type const*)) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::push_back(value_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(size_type, value_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(size_type, value_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::erase(size_type, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(basic_string const&, size_type, size_type)) \
- _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(value_type const*) const) \
- _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, value_type const*) const) \
- _Func(_LIBCPP_FUNC_VIS _CharType& basic_string<_CharType>::at(size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(value_type const*)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type const*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, basic_string const&, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, value_type const*, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::operator=(basic_string const&)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, basic_string const&, size_type, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::iterator basic_string<_CharType>::insert(basic_string::const_iterator, value_type)) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::resize(size_type, value_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, basic_string const&, size_type, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type const*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::__init(value_type const*, size_type, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::basic_string(basic_string const&)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::basic_string(basic_string const&, allocator<_CharType> const&)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::find_last_not_of(value_type const*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::~basic_string()) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::find_first_not_of(value_type const*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::insert(size_type, size_type, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::operator=(value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::__init(value_type const*, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI const _CharType& basic_string<_CharType>::at(size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::find_first_of(value_type const*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, size_type, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::assign(value_type const*, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::reserve(size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::__init(size_type, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::find_last_of(value_type const*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::__grow_by(size_type, size_type, size_type, size_type, size_type, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::__grow_by_and_replace(size_type, size_type, size_type, size_type, size_type, size_type, value_type const*)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::push_back(value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::append(size_type, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::assign(size_type, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::erase(size_type, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::append(basic_string const&, size_type, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI int basic_string<_CharType>::compare(value_type const*) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI int basic_string<_CharType>::compare(size_type, size_type, value_type const*) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI _CharType& basic_string<_CharType>::at(size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::assign(value_type const*)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type const*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI int basic_string<_CharType>::compare(size_type, size_type, basic_string const&, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI int basic_string<_CharType>::compare(size_type, size_type, value_type const*, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::operator=(basic_string const&)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::append(value_type const*)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, basic_string const&, size_type, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::iterator basic_string<_CharType>::insert(basic_string::const_iterator, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::resize(size_type, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::insert(size_type, basic_string const&, size_type, size_type)) \
_LIBCPP_STRING_EXTERN_TEMPLATE_VARIABLE_LIST(_Func, _CharType)
#define _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_Func, _CharType) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type const*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_not_of(value_type const*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::~basic_string()) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_not_of(value_type const*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, size_type, value_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::operator=(value_type)) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type)) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init_copy_ctor_external(value_type const*, size_type)) \
- _Func(_LIBCPP_FUNC_VIS const _CharType& basic_string<_CharType>::at(size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_of(value_type const*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, size_type, value_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::__assign_external(value_type const*, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::__assign_external(value_type const*)) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::reserve(size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_of(value_type const*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__grow_by(size_type, size_type, size_type, size_type, size_type, size_type)) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__grow_by_and_replace(size_type, size_type, size_type, size_type, size_type, size_type, value_type const*)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::__assign_no_alias<false>(value_type const*, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::__assign_no_alias<true>(value_type const*, size_type)) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::push_back(value_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(size_type, value_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(size_type, value_type)) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__erase_external_with_move(size_type, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(basic_string const&, size_type, size_type)) \
- _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(value_type const*) const) \
- _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, value_type const*) const) \
- _Func(_LIBCPP_FUNC_VIS _CharType& basic_string<_CharType>::at(size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type const*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, basic_string const&, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, value_type const*, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, basic_string const&, size_type, size_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::iterator basic_string<_CharType>::insert(basic_string::const_iterator, value_type)) \
- _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::resize(size_type, value_type)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, basic_string const&, size_type, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type const*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::__init(value_type const*, size_type, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::find_last_not_of(value_type const*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::~basic_string()) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::find_first_not_of(value_type const*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::insert(size_type, size_type, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::operator=(value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::__init(value_type const*, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::__init_copy_ctor_external(value_type const*, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI const _CharType& basic_string<_CharType>::at(size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::find_first_of(value_type const*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, size_type, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::__assign_external(value_type const*, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::__assign_external(value_type const*)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::reserve(size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::__init(size_type, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::find_last_of(value_type const*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::__grow_by_and_replace(size_type, size_type, size_type, size_type, size_type, size_type, value_type const*)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::__assign_no_alias<false>(value_type const*, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::__assign_no_alias<true>(value_type const*, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::push_back(value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::append(size_type, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::assign(size_type, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::__erase_external_with_move(size_type, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::append(basic_string const&, size_type, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI int basic_string<_CharType>::compare(value_type const*) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI int basic_string<_CharType>::compare(size_type, size_type, value_type const*) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI _CharType& basic_string<_CharType>::at(size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type const*, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI int basic_string<_CharType>::compare(size_type, size_type, basic_string const&, size_type, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI int basic_string<_CharType>::compare(size_type, size_type, value_type const*, size_type) const) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::append(value_type const*)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, basic_string const&, size_type, size_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>::iterator basic_string<_CharType>::insert(basic_string::const_iterator, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI void basic_string<_CharType>::resize(size_type, value_type)) \
+ _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::insert(size_type, basic_string const&, size_type, size_type)) \
_LIBCPP_STRING_EXTERN_TEMPLATE_VARIABLE_LIST(_Func, _CharType)
// Workaround for CUDA which doesn't like extern templates for variables.
@@ -132,7 +131,7 @@
#define _LIBCPP_STRING_EXTERN_TEMPLATE_VARIABLE_LIST(_Func, _CharType)
#else
#define _LIBCPP_STRING_EXTERN_TEMPLATE_VARIABLE_LIST(_Func, _CharType) \
- _Func(_LIBCPP_FUNC_VIS const basic_string<_CharType>::size_type basic_string<_CharType>::npos)
+ _Func(_LIBCPP_EXPORTED_FROM_ABI const basic_string<_CharType>::size_type basic_string<_CharType>::npos)
#endif
#endif // _LIBCPP___STRING_EXTERN_TEMPLATE_LISTS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__support/musl/xlocale.h b/contrib/libs/cxxsupp/libcxx/include/__support/musl/xlocale.h
index fe1dcf61a59..9b0a50b04f8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__support/musl/xlocale.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__support/musl/xlocale.h
@@ -37,7 +37,8 @@ inline _LIBCPP_HIDE_FROM_ABI_C long long wcstoll_l(const wchar_t* __nptr, wchar_
return ::wcstoll(__nptr, __endptr, __base);
}
-inline _LIBCPP_HIDE_FROM_ABI_C long long wcstoull_l(const wchar_t* __nptr, wchar_t** __endptr, int __base, locale_t) {
+inline _LIBCPP_HIDE_FROM_ABI_C unsigned long long
+wcstoull_l(const wchar_t* __nptr, wchar_t** __endptr, int __base, locale_t) {
return ::wcstoull(__nptr, __endptr, __base);
}
diff --git a/contrib/libs/cxxsupp/libcxx/include/__support/solaris/xlocale.h b/contrib/libs/cxxsupp/libcxx/include/__support/solaris/xlocale.h
deleted file mode 100644
index 373fbfbd608..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__support/solaris/xlocale.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-////////////////////////////////////////////////////////////////////////////////
-// Minimal xlocale implementation for Solaris. This implements the subset of
-// the xlocale APIs that libc++ depends on.
-////////////////////////////////////////////////////////////////////////////////
-#ifndef __XLOCALE_H_INCLUDED
-#define __XLOCALE_H_INCLUDED
-
-#include <stdlib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-int snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...);
-int asprintf_l(char **__s, locale_t __l, const char *__format, ...);
-
-int sscanf_l(const char *__s, locale_t __l, const char *__format, ...);
-
-int toupper_l(int __c, locale_t __l);
-int tolower_l(int __c, locale_t __l);
-
-struct lconv *localeconv(void);
-struct lconv *localeconv_l(locale_t __l);
-
-// FIXME: These are quick-and-dirty hacks to make things pretend to work
-inline _LIBCPP_HIDE_FROM_ABI long long
-strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t __loc) {
- return ::strtoll(__nptr, __endptr, __base);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI long
-strtol_l(const char *__nptr, char **__endptr, int __base, locale_t __loc) {
- return ::strtol(__nptr, __endptr, __base);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
-strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t __loc)
- return ::strtoull(__nptr, __endptr, __base);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI unsigned long
-strtoul_l(const char *__nptr, char **__endptr, int __base, locale_t __loc) {
- return ::strtoul(__nptr, __endptr, __base);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI float
-strtof_l(const char *__nptr, char **__endptr, locale_t __loc) {
- return ::strtof(__nptr, __endptr);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI double
-strtod_l(const char *__nptr, char **__endptr, locale_t __loc) {
- return ::strtod(__nptr, __endptr);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI long double
-strtold_l(const char *__nptr, char **__endptr, locale_t __loc) {
- return ::strtold(__nptr, __endptr);
-}
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__support/win32/locale_win32.h b/contrib/libs/cxxsupp/libcxx/include/__support/win32/locale_win32.h
index d92ea87c826..1c6b4b5f143 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__support/win32/locale_win32.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__support/win32/locale_win32.h
@@ -217,8 +217,8 @@ decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l );
#define strtof_l _strtof_l
#define strtold_l _strtod_l
#else
-_LIBCPP_FUNC_VIS float strtof_l(const char*, char**, locale_t);
-_LIBCPP_FUNC_VIS long double strtold_l(const char*, char**, locale_t);
+_LIBCPP_EXPORTED_FROM_ABI float strtof_l(const char*, char**, locale_t);
+_LIBCPP_EXPORTED_FROM_ABI long double strtold_l(const char*, char**, locale_t);
#endif
inline _LIBCPP_HIDE_FROM_ABI int
islower_l(int __c, _locale_t __loc)
@@ -252,7 +252,7 @@ isupper_l(int __c, _locale_t __loc)
#define towupper_l _towupper_l
#define towlower_l _towlower_l
#if defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x0800
-_LIBCPP_FUNC_VIS size_t strftime_l(char *ret, size_t n, const char *format,
+_LIBCPP_EXPORTED_FROM_ABI size_t strftime_l(char *ret, size_t n, const char *format,
const struct tm *tm, locale_t loc);
#else
#define strftime_l _strftime_l
@@ -261,9 +261,9 @@ _LIBCPP_FUNC_VIS size_t strftime_l(char *ret, size_t n, const char *format,
#define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ )
#define vsprintf_l( __s, __l, __f, ... ) _vsprintf_l( __s, __f, __l, __VA_ARGS__ )
#define vsnprintf_l( __s, __n, __l, __f, ... ) _vsnprintf_l( __s, __n, __f, __l, __VA_ARGS__ )
-_LIBCPP_FUNC_VIS int snprintf_l(char *__ret, size_t __n, locale_t __loc, const char *__format, ...);
-_LIBCPP_FUNC_VIS int asprintf_l( char **__ret, locale_t __loc, const char *__format, ... );
-_LIBCPP_FUNC_VIS int vasprintf_l( char **__ret, locale_t __loc, const char *__format, va_list __ap );
+_LIBCPP_EXPORTED_FROM_ABI int snprintf_l(char *__ret, size_t __n, locale_t __loc, const char *__format, ...);
+_LIBCPP_EXPORTED_FROM_ABI int asprintf_l( char **__ret, locale_t __loc, const char *__format, ... );
+_LIBCPP_EXPORTED_FROM_ABI int vasprintf_l( char **__ret, locale_t __loc, const char *__format, va_list __ap );
// not-so-pressing FIXME: use locale to determine blank characters
inline int isblank_l( int __c, locale_t /*loc*/ )
diff --git a/contrib/libs/cxxsupp/libcxx/include/__errc b/contrib/libs/cxxsupp/libcxx/include/__system_error/errc.h
index 17bbe0e2afc..17bbe0e2afc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__errc
+++ b/contrib/libs/cxxsupp/libcxx/include/__system_error/errc.h
diff --git a/contrib/libs/cxxsupp/libcxx/include/__system_error/error_category.h b/contrib/libs/cxxsupp/libcxx/include/__system_error/error_category.h
new file mode 100644
index 00000000000..11c920e3265
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__system_error/error_category.h
@@ -0,0 +1,75 @@
+// -*- 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___SYSTEM_ERROR_ERROR_CATEGORY_H
+#define _LIBCPP___SYSTEM_ERROR_ERROR_CATEGORY_H
+
+#include <__compare/ordering.h>
+#include <__config>
+#include <string>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+class _LIBCPP_EXPORTED_FROM_ABI error_condition;
+class _LIBCPP_EXPORTED_FROM_ABI error_code;
+
+class _LIBCPP_HIDDEN __do_message;
+
+class _LIBCPP_EXPORTED_FROM_ABI error_category {
+public:
+ virtual ~error_category() _NOEXCEPT;
+
+#if defined(_LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS)
+ error_category() noexcept;
+#else
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 error_category() _NOEXCEPT = default;
+#endif
+ error_category(const error_category&) = delete;
+ error_category& operator=(const error_category&) = delete;
+
+ virtual const char* name() const _NOEXCEPT = 0;
+ virtual error_condition default_error_condition(int __ev) const _NOEXCEPT;
+ virtual bool equivalent(int __code, const error_condition& __condition) const _NOEXCEPT;
+ virtual bool equivalent(const error_code& __code, int __condition) const _NOEXCEPT;
+ virtual string message(int __ev) const = 0;
+
+ _LIBCPP_HIDE_FROM_ABI bool operator==(const error_category& __rhs) const _NOEXCEPT { return this == &__rhs; }
+
+#if _LIBCPP_STD_VER >= 20
+
+ _LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(const error_category& __rhs) const noexcept {
+ return compare_three_way()(this, std::addressof(__rhs));
+ }
+
+#else // _LIBCPP_STD_VER >= 20
+
+ _LIBCPP_HIDE_FROM_ABI bool operator!=(const error_category& __rhs) const _NOEXCEPT { return !(*this == __rhs); }
+
+ _LIBCPP_HIDE_FROM_ABI bool operator<(const error_category& __rhs) const _NOEXCEPT { return this < &__rhs; }
+
+#endif // _LIBCPP_STD_VER >= 20
+
+ friend class _LIBCPP_HIDDEN __do_message;
+};
+
+class _LIBCPP_HIDDEN __do_message : public error_category {
+public:
+ string message(int __ev) const override;
+};
+
+_LIBCPP_EXPORTED_FROM_ABI const error_category& generic_category() _NOEXCEPT;
+_LIBCPP_EXPORTED_FROM_ABI const error_category& system_category() _NOEXCEPT;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___SYSTEM_ERROR_ERROR_CATEGORY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__system_error/error_code.h b/contrib/libs/cxxsupp/libcxx/include/__system_error/error_code.h
new file mode 100644
index 00000000000..d05e68529fa
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__system_error/error_code.h
@@ -0,0 +1,145 @@
+// -*- 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___SYSTEM_ERROR_ERROR_CODE_H
+#define _LIBCPP___SYSTEM_ERROR_ERROR_CODE_H
+
+#include <__compare/ordering.h>
+#include <__config>
+#include <__functional/hash.h>
+#include <__functional/unary_function.h>
+#include <__system_error/errc.h>
+#include <__system_error/error_category.h>
+#include <__system_error/error_condition.h>
+#include <cstddef>
+#include <string>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_error_code_enum : public false_type {};
+
+#if _LIBCPP_STD_VER >= 17
+template <class _Tp>
+inline constexpr bool is_error_code_enum_v = is_error_code_enum<_Tp>::value;
+#endif
+
+namespace __adl_only {
+// Those cause ADL to trigger but they are not viable candidates,
+// so they are never actually selected.
+void make_error_code() = delete;
+} // namespace __adl_only
+
+class _LIBCPP_EXPORTED_FROM_ABI error_code {
+ int __val_;
+ const error_category* __cat_;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI error_code() _NOEXCEPT : __val_(0), __cat_(&system_category()) {}
+
+ _LIBCPP_HIDE_FROM_ABI error_code(int __val, const error_category& __cat) _NOEXCEPT : __val_(__val), __cat_(&__cat) {}
+
+ template <class _Ep>
+ _LIBCPP_HIDE_FROM_ABI
+ error_code(_Ep __e, typename enable_if<is_error_code_enum<_Ep>::value>::type* = nullptr) _NOEXCEPT {
+ using __adl_only::make_error_code;
+ *this = make_error_code(__e);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI void assign(int __val, const error_category& __cat) _NOEXCEPT {
+ __val_ = __val;
+ __cat_ = &__cat;
+ }
+
+ template <class _Ep>
+ _LIBCPP_HIDE_FROM_ABI typename enable_if< is_error_code_enum<_Ep>::value, error_code& >::type
+ operator=(_Ep __e) _NOEXCEPT {
+ using __adl_only::make_error_code;
+ *this = make_error_code(__e);
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT {
+ __val_ = 0;
+ __cat_ = &system_category();
+ }
+
+ _LIBCPP_HIDE_FROM_ABI int value() const _NOEXCEPT { return __val_; }
+
+ _LIBCPP_HIDE_FROM_ABI const error_category& category() const _NOEXCEPT { return *__cat_; }
+
+ _LIBCPP_HIDE_FROM_ABI error_condition default_error_condition() const _NOEXCEPT {
+ return __cat_->default_error_condition(__val_);
+ }
+
+ string message() const;
+
+ _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __val_ != 0; }
+};
+
+inline _LIBCPP_HIDE_FROM_ABI error_code make_error_code(errc __e) _NOEXCEPT {
+ return error_code(static_cast<int>(__e), generic_category());
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator==(const error_code& __x, const error_code& __y) _NOEXCEPT {
+ return __x.category() == __y.category() && __x.value() == __y.value();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator==(const error_code& __x, const error_condition& __y) _NOEXCEPT {
+ return __x.category().equivalent(__x.value(), __y) || __y.category().equivalent(__x, __y.value());
+}
+
+#if _LIBCPP_STD_VER <= 17
+inline _LIBCPP_HIDE_FROM_ABI bool operator==(const error_condition& __x, const error_code& __y) _NOEXCEPT {
+ return __y == __x;
+}
+#endif
+
+#if _LIBCPP_STD_VER <= 17
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const error_code& __x, const error_code& __y) _NOEXCEPT {
+ return !(__x == __y);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const error_code& __x, const error_condition& __y) _NOEXCEPT {
+ return !(__x == __y);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const error_condition& __x, const error_code& __y) _NOEXCEPT {
+ return !(__x == __y);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator<(const error_code& __x, const error_code& __y) _NOEXCEPT {
+ return __x.category() < __y.category() || (__x.category() == __y.category() && __x.value() < __y.value());
+}
+
+#else // _LIBCPP_STD_VER <= 17
+
+inline _LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(const error_code& __x, const error_code& __y) noexcept {
+ if (auto __c = __x.category() <=> __y.category(); __c != 0)
+ return __c;
+ return __x.value() <=> __y.value();
+}
+
+#endif // _LIBCPP_STD_VER <= 17
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<error_code> : public __unary_function<error_code, size_t> {
+ _LIBCPP_HIDE_FROM_ABI size_t operator()(const error_code& __ec) const _NOEXCEPT {
+ return static_cast<size_t>(__ec.value());
+ }
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___SYSTEM_ERROR_ERROR_CODE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__system_error/error_condition.h b/contrib/libs/cxxsupp/libcxx/include/__system_error/error_condition.h
new file mode 100644
index 00000000000..a43a73cdc26
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__system_error/error_condition.h
@@ -0,0 +1,132 @@
+// -*- 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___SYSTEM_ERROR_ERROR_CONDITION_H
+#define _LIBCPP___SYSTEM_ERROR_ERROR_CONDITION_H
+
+#include <__compare/ordering.h>
+#include <__config>
+#include <__functional/hash.h>
+#include <__functional/unary_function.h>
+#include <__system_error/errc.h>
+#include <__system_error/error_category.h>
+#include <cstddef>
+#include <string>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum : public false_type {};
+
+#if _LIBCPP_STD_VER >= 17
+template <class _Tp>
+inline constexpr bool is_error_condition_enum_v = is_error_condition_enum<_Tp>::value;
+#endif
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum<errc> : true_type {};
+
+#ifdef _LIBCPP_CXX03_LANG
+template <>
+struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum<errc::__lx> : true_type {};
+#endif
+
+namespace __adl_only {
+// Those cause ADL to trigger but they are not viable candidates,
+// so they are never actually selected.
+void make_error_condition() = delete;
+} // namespace __adl_only
+
+class _LIBCPP_EXPORTED_FROM_ABI error_condition {
+ int __val_;
+ const error_category* __cat_;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI error_condition() _NOEXCEPT : __val_(0), __cat_(&generic_category()) {}
+
+ _LIBCPP_HIDE_FROM_ABI error_condition(int __val, const error_category& __cat) _NOEXCEPT
+ : __val_(__val),
+ __cat_(&__cat) {}
+
+ template <class _Ep>
+ _LIBCPP_HIDE_FROM_ABI
+ error_condition(_Ep __e, typename enable_if<is_error_condition_enum<_Ep>::value>::type* = nullptr) _NOEXCEPT {
+ using __adl_only::make_error_condition;
+ *this = make_error_condition(__e);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI void assign(int __val, const error_category& __cat) _NOEXCEPT {
+ __val_ = __val;
+ __cat_ = &__cat;
+ }
+
+ template <class _Ep>
+ _LIBCPP_HIDE_FROM_ABI typename enable_if< is_error_condition_enum<_Ep>::value, error_condition& >::type
+ operator=(_Ep __e) _NOEXCEPT {
+ using __adl_only::make_error_condition;
+ *this = make_error_condition(__e);
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT {
+ __val_ = 0;
+ __cat_ = &generic_category();
+ }
+
+ _LIBCPP_HIDE_FROM_ABI int value() const _NOEXCEPT { return __val_; }
+
+ _LIBCPP_HIDE_FROM_ABI const error_category& category() const _NOEXCEPT { return *__cat_; }
+ string message() const;
+
+ _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __val_ != 0; }
+};
+
+inline _LIBCPP_HIDE_FROM_ABI error_condition make_error_condition(errc __e) _NOEXCEPT {
+ return error_condition(static_cast<int>(__e), generic_category());
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator==(const error_condition& __x, const error_condition& __y) _NOEXCEPT {
+ return __x.category() == __y.category() && __x.value() == __y.value();
+}
+
+#if _LIBCPP_STD_VER <= 17
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const error_condition& __x, const error_condition& __y) _NOEXCEPT {
+ return !(__x == __y);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator<(const error_condition& __x, const error_condition& __y) _NOEXCEPT {
+ return __x.category() < __y.category() || (__x.category() == __y.category() && __x.value() < __y.value());
+}
+
+#else // _LIBCPP_STD_VER <= 17
+
+inline _LIBCPP_HIDE_FROM_ABI strong_ordering
+operator<=>(const error_condition& __x, const error_condition& __y) noexcept {
+ if (auto __c = __x.category() <=> __y.category(); __c != 0)
+ return __c;
+ return __x.value() <=> __y.value();
+}
+
+#endif // _LIBCPP_STD_VER <= 17
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<error_condition> : public __unary_function<error_condition, size_t> {
+ _LIBCPP_HIDE_FROM_ABI size_t operator()(const error_condition& __ec) const _NOEXCEPT {
+ return static_cast<size_t>(__ec.value());
+ }
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___SYSTEM_ERROR_ERROR_CONDITION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__system_error/system_error.h b/contrib/libs/cxxsupp/libcxx/include/__system_error/system_error.h
new file mode 100644
index 00000000000..bc829491a49
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__system_error/system_error.h
@@ -0,0 +1,48 @@
+// -*- 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___SYSTEM_ERROR_SYSTEM_ERROR_H
+#define _LIBCPP___SYSTEM_ERROR_SYSTEM_ERROR_H
+
+#include <__config>
+#include <__system_error/error_category.h>
+#include <__system_error/error_code.h>
+#include <stdexcept>
+#include <string>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+class _LIBCPP_EXPORTED_FROM_ABI system_error : public runtime_error {
+ error_code __ec_;
+
+public:
+ system_error(error_code __ec, const string& __what_arg);
+ system_error(error_code __ec, const char* __what_arg);
+ system_error(error_code __ec);
+ system_error(int __ev, const error_category& __ecat, const string& __what_arg);
+ system_error(int __ev, const error_category& __ecat, const char* __what_arg);
+ system_error(int __ev, const error_category& __ecat);
+ _LIBCPP_HIDE_FROM_ABI system_error(const system_error&) _NOEXCEPT = default;
+ ~system_error() _NOEXCEPT override;
+
+ _LIBCPP_HIDE_FROM_ABI const error_code& code() const _NOEXCEPT { return __ec_; }
+
+private:
+ static string __init(const error_code&, string);
+};
+
+_LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void __throw_system_error(int __ev, const char* __what_arg);
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___SYSTEM_ERROR_SYSTEM_ERROR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__thread/formatter.h b/contrib/libs/cxxsupp/libcxx/include/__thread/formatter.h
new file mode 100644
index 00000000000..0e3a11c514e
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__thread/formatter.h
@@ -0,0 +1,80 @@
+// -*- 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___THREAD_FORMATTER_H
+#define _LIBCPP___THREAD_FORMATTER_H
+
+#include <__concepts/arithmetic.h>
+#include <__config>
+#include <__format/concepts.h>
+#include <__format/format_parse_context.h>
+#include <__format/formatter.h>
+#include <__format/formatter_integral.h>
+#include <__format/parser_std_format_spec.h>
+#include <__thread/id.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/is_pointer.h>
+#include <__type_traits/is_same.h>
+#include <cstdint>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER >= 23
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+template <__fmt_char_type _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<__thread_id, _CharT> {
+ public:
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ return __parser_.__parse(__ctx, __format_spec::__fields_fill_align_width);
+ }
+
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(__thread_id __id, _FormatContext& __ctx) const {
+ // In __threading_support __libcpp_thread_id is either a
+ // unsigned long long or a pthread_t.
+ //
+ // The type of pthread_t is left unspecified in POSIX so it can be any
+ // type. The most logical types are an integral or pointer.
+ // On Linux systems pthread_t is an unsigned long long.
+ // On Apple systems pthread_t is a pointer type.
+ //
+ // Note the output should match what the stream operator does. Since
+ // the ostream operator has been shipped years before this formatter
+ // was added to the Standard, this formatter does what the stream
+ // operator does. This may require platform specific changes.
+
+ using _Tp = decltype(__get_underlying_id(__id));
+ using _Cp = conditional_t<integral<_Tp>, _Tp, conditional_t<is_pointer_v<_Tp>, uintptr_t, void>>;
+ static_assert(!is_same_v<_Cp, void>, "unsupported thread::id type, please file a bug report");
+
+ __format_spec::__parsed_specifications<_CharT> __specs = __parser_.__get_parsed_std_specifications(__ctx);
+ if constexpr (is_pointer_v<_Tp>) {
+ __specs.__std_.__alternate_form_ = true;
+ __specs.__std_.__type_ = __format_spec::__type::__hexadecimal_lower_case;
+ }
+ return __formatter::__format_integer(reinterpret_cast<_Cp>(__get_underlying_id(__id)), __ctx, __specs);
+ }
+
+ __format_spec::__parser<_CharT> __parser_{.__alignment_ = __format_spec::__alignment::__right};
+};
+
+#endif // !_LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER >= 23
+
+#endif // _LIBCPP___THREAD_FORMATTER_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__thread/id.h b/contrib/libs/cxxsupp/libcxx/include/__thread/id.h
new file mode 100644
index 00000000000..fd6e6dffafa
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__thread/id.h
@@ -0,0 +1,121 @@
+// -*- 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___THREAD_ID_H
+#define _LIBCPP___THREAD_ID_H
+
+#include <__compare/ordering.h>
+#include <__config>
+#include <__fwd/hash.h>
+#include <__threading_support>
+#include <iosfwd>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+class _LIBCPP_EXPORTED_FROM_ABI __thread_id;
+
+namespace this_thread {
+
+_LIBCPP_HIDE_FROM_ABI __thread_id get_id() _NOEXCEPT;
+
+} // namespace this_thread
+
+template <>
+struct hash<__thread_id>;
+
+class _LIBCPP_TEMPLATE_VIS __thread_id {
+ // FIXME: pthread_t is a pointer on Darwin but a long on Linux.
+ // NULL is the no-thread value on Darwin. Someone needs to check
+ // on other platforms. We assume 0 works everywhere for now.
+ __libcpp_thread_id __id_;
+
+ static _LIBCPP_HIDE_FROM_ABI bool
+ __lt_impl(__thread_id __x, __thread_id __y) _NOEXCEPT { // id==0 is always less than any other thread_id
+ if (__x.__id_ == 0)
+ return __y.__id_ != 0;
+ if (__y.__id_ == 0)
+ return false;
+ return __libcpp_thread_id_less(__x.__id_, __y.__id_);
+ }
+
+public:
+ _LIBCPP_HIDE_FROM_ABI __thread_id() _NOEXCEPT : __id_(0) {}
+
+ _LIBCPP_HIDE_FROM_ABI void __reset() { __id_ = 0; }
+
+ friend _LIBCPP_HIDE_FROM_ABI bool operator==(__thread_id __x, __thread_id __y) _NOEXCEPT;
+# if _LIBCPP_STD_VER <= 17
+ friend _LIBCPP_HIDE_FROM_ABI bool operator<(__thread_id __x, __thread_id __y) _NOEXCEPT;
+# else // _LIBCPP_STD_VER <= 17
+ friend _LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(__thread_id __x, __thread_id __y) noexcept;
+# endif // _LIBCPP_STD_VER <= 17
+
+ template <class _CharT, class _Traits>
+ friend _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id);
+
+private:
+ _LIBCPP_HIDE_FROM_ABI __thread_id(__libcpp_thread_id __id) : __id_(__id) {}
+
+ _LIBCPP_HIDE_FROM_ABI friend __libcpp_thread_id __get_underlying_id(const __thread_id __id) { return __id.__id_; }
+
+ friend __thread_id this_thread::get_id() _NOEXCEPT;
+ friend class _LIBCPP_EXPORTED_FROM_ABI thread;
+ friend struct _LIBCPP_TEMPLATE_VIS hash<__thread_id>;
+};
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator==(__thread_id __x, __thread_id __y) _NOEXCEPT {
+ // Don't pass id==0 to underlying routines
+ if (__x.__id_ == 0)
+ return __y.__id_ == 0;
+ if (__y.__id_ == 0)
+ return false;
+ return __libcpp_thread_id_equal(__x.__id_, __y.__id_);
+}
+
+# if _LIBCPP_STD_VER <= 17
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator!=(__thread_id __x, __thread_id __y) _NOEXCEPT { return !(__x == __y); }
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator<(__thread_id __x, __thread_id __y) _NOEXCEPT {
+ return __thread_id::__lt_impl(__x.__id_, __y.__id_);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator<=(__thread_id __x, __thread_id __y) _NOEXCEPT { return !(__y < __x); }
+inline _LIBCPP_HIDE_FROM_ABI bool operator>(__thread_id __x, __thread_id __y) _NOEXCEPT { return __y < __x; }
+inline _LIBCPP_HIDE_FROM_ABI bool operator>=(__thread_id __x, __thread_id __y) _NOEXCEPT { return !(__x < __y); }
+
+# else // _LIBCPP_STD_VER <= 17
+
+inline _LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(__thread_id __x, __thread_id __y) noexcept {
+ if (__x == __y)
+ return strong_ordering::equal;
+ if (__thread_id::__lt_impl(__x, __y))
+ return strong_ordering::less;
+ return strong_ordering::greater;
+}
+
+# endif // _LIBCPP_STD_VER <= 17
+
+namespace this_thread {
+
+inline _LIBCPP_HIDE_FROM_ABI __thread_id get_id() _NOEXCEPT { return __libcpp_thread_get_current_id(); }
+
+} // namespace this_thread
+
+#endif // !_LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___THREAD_ID_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__thread/this_thread.h b/contrib/libs/cxxsupp/libcxx/include/__thread/this_thread.h
new file mode 100644
index 00000000000..b79065eeeda
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__thread/this_thread.h
@@ -0,0 +1,87 @@
+// -*- 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___THREAD_THIS_THREAD_H
+#define _LIBCPP___THREAD_THIS_THREAD_H
+
+#include <__chrono/steady_clock.h>
+#include <__chrono/time_point.h>
+#include <__condition_variable/condition_variable.h>
+#include <__config>
+#include <__mutex/mutex.h>
+#include <__mutex/unique_lock.h>
+#include <__threading_support>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace this_thread
+{
+
+_LIBCPP_EXPORTED_FROM_ABI void sleep_for(const chrono::nanoseconds& __ns);
+
+template <class _Rep, class _Period>
+_LIBCPP_HIDE_FROM_ABI void
+sleep_for(const chrono::duration<_Rep, _Period>& __d)
+{
+ if (__d > chrono::duration<_Rep, _Period>::zero())
+ {
+ // The standard guarantees a 64bit signed integer resolution for nanoseconds,
+ // so use INT64_MAX / 1e9 as cut-off point. Use a constant to avoid <climits>
+ // and issues with long double folding on PowerPC with GCC.
+ _LIBCPP_CONSTEXPR chrono::duration<long double> __max =
+ chrono::duration<long double>(9223372036.0L);
+ chrono::nanoseconds __ns;
+ if (__d < __max)
+ {
+ __ns = chrono::duration_cast<chrono::nanoseconds>(__d);
+ if (__ns < __d)
+ ++__ns;
+ }
+ else
+ __ns = chrono::nanoseconds::max();
+ this_thread::sleep_for(__ns);
+ }
+}
+
+template <class _Clock, class _Duration>
+_LIBCPP_HIDE_FROM_ABI void
+sleep_until(const chrono::time_point<_Clock, _Duration>& __t)
+{
+ mutex __mut;
+ condition_variable __cv;
+ unique_lock<mutex> __lk(__mut);
+ while (_Clock::now() < __t)
+ __cv.wait_until(__lk, __t);
+}
+
+template <class _Duration>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+sleep_until(const chrono::time_point<chrono::steady_clock, _Duration>& __t)
+{
+ this_thread::sleep_for(__t - chrono::steady_clock::now());
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void yield() _NOEXCEPT {__libcpp_thread_yield();}
+
+} // namespace this_thread
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___THREAD_THIS_THREAD_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__thread/thread.h b/contrib/libs/cxxsupp/libcxx/include/__thread/thread.h
new file mode 100644
index 00000000000..a1861e49488
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__thread/thread.h
@@ -0,0 +1,297 @@
+// -*- 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___THREAD_THREAD_H
+#define _LIBCPP___THREAD_THREAD_H
+
+#include <__condition_variable/condition_variable.h>
+#include <__config>
+#include <__exception/terminate.h>
+#include <__functional/hash.h>
+#include <__functional/unary_function.h>
+#include <__memory/unique_ptr.h>
+#include <__mutex/mutex.h>
+#include <__system_error/system_error.h>
+#include <__thread/id.h>
+#include <__threading_support>
+#include <__utility/forward.h>
+#include <iosfwd>
+#include <tuple>
+
+#ifndef _LIBCPP_HAS_NO_LOCALIZATION
+# include <locale>
+# include <sstream>
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp> class __thread_specific_ptr;
+class _LIBCPP_EXPORTED_FROM_ABI __thread_struct;
+class _LIBCPP_HIDDEN __thread_struct_imp;
+class __assoc_sub_state;
+
+_LIBCPP_EXPORTED_FROM_ABI __thread_specific_ptr<__thread_struct>& __thread_local_data();
+
+class _LIBCPP_EXPORTED_FROM_ABI __thread_struct
+{
+ __thread_struct_imp* __p_;
+
+ __thread_struct(const __thread_struct&);
+ __thread_struct& operator=(const __thread_struct&);
+public:
+ __thread_struct();
+ ~__thread_struct();
+
+ void notify_all_at_thread_exit(condition_variable*, mutex*);
+ void __make_ready_at_thread_exit(__assoc_sub_state*);
+};
+
+template <class _Tp>
+class __thread_specific_ptr
+{
+ __libcpp_tls_key __key_;
+
+ // Only __thread_local_data() may construct a __thread_specific_ptr
+ // and only with _Tp == __thread_struct.
+ static_assert((is_same<_Tp, __thread_struct>::value), "");
+ __thread_specific_ptr();
+ friend _LIBCPP_EXPORTED_FROM_ABI __thread_specific_ptr<__thread_struct>& __thread_local_data();
+
+ __thread_specific_ptr(const __thread_specific_ptr&);
+ __thread_specific_ptr& operator=(const __thread_specific_ptr&);
+
+ _LIBCPP_HIDDEN static void _LIBCPP_TLS_DESTRUCTOR_CC __at_thread_exit(void*);
+
+public:
+ typedef _Tp* pointer;
+
+ ~__thread_specific_ptr();
+
+ _LIBCPP_INLINE_VISIBILITY
+ pointer get() const {return static_cast<_Tp*>(__libcpp_tls_get(__key_));}
+ _LIBCPP_INLINE_VISIBILITY
+ pointer operator*() const {return *get();}
+ _LIBCPP_INLINE_VISIBILITY
+ pointer operator->() const {return get();}
+ void set_pointer(pointer __p);
+};
+
+template <class _Tp>
+void _LIBCPP_TLS_DESTRUCTOR_CC
+__thread_specific_ptr<_Tp>::__at_thread_exit(void* __p)
+{
+ delete static_cast<pointer>(__p);
+}
+
+template <class _Tp>
+__thread_specific_ptr<_Tp>::__thread_specific_ptr()
+{
+ int __ec =
+ __libcpp_tls_create(&__key_, &__thread_specific_ptr::__at_thread_exit);
+ if (__ec)
+ __throw_system_error(__ec, "__thread_specific_ptr construction failed");
+}
+
+template <class _Tp>
+__thread_specific_ptr<_Tp>::~__thread_specific_ptr()
+{
+ // __thread_specific_ptr is only created with a static storage duration
+ // so this destructor is only invoked during program termination. Invoking
+ // pthread_key_delete(__key_) may prevent other threads from deleting their
+ // thread local data. For this reason we leak the key.
+}
+
+template <class _Tp>
+void
+__thread_specific_ptr<_Tp>::set_pointer(pointer __p)
+{
+ _LIBCPP_ASSERT_UNCATEGORIZED(get() == nullptr,
+ "Attempting to overwrite thread local data");
+ std::__libcpp_tls_set(__key_, __p);
+}
+
+template<>
+struct _LIBCPP_TEMPLATE_VIS hash<__thread_id>
+ : public __unary_function<__thread_id, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(__thread_id __v) const _NOEXCEPT
+ {
+ return hash<__libcpp_thread_id>()(__v.__id_);
+ }
+};
+
+#ifndef _LIBCPP_HAS_NO_LOCALIZATION
+template <class _CharT, class _Traits>
+_LIBCPP_INLINE_VISIBILITY basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id) {
+ // [thread.thread.id]/9
+ // Effects: Inserts the text representation for charT of id into out.
+ //
+ // [thread.thread.id]/2
+ // The text representation for the character type charT of an
+ // object of type thread::id is an unspecified sequence of charT
+ // such that, for two objects of type thread::id x and y, if
+ // x == y is true, the thread::id objects have the same text
+ // representation, and if x != y is true, the thread::id objects
+ // have distinct text representations.
+ //
+ // Since various flags in the output stream can affect how the
+ // thread id is represented (e.g. numpunct or showbase), we
+ // use a temporary stream instead and just output the thread
+ // id representation as a string.
+
+ basic_ostringstream<_CharT, _Traits> __sstr;
+ __sstr.imbue(locale::classic());
+ __sstr << __id.__id_;
+ return __os << __sstr.str();
+}
+#endif // _LIBCPP_HAS_NO_LOCALIZATION
+
+class _LIBCPP_EXPORTED_FROM_ABI thread
+{
+ __libcpp_thread_t __t_;
+
+ thread(const thread&);
+ thread& operator=(const thread&);
+public:
+ typedef __thread_id id;
+ typedef __libcpp_thread_t native_handle_type;
+
+ _LIBCPP_INLINE_VISIBILITY
+ thread() _NOEXCEPT : __t_(_LIBCPP_NULL_THREAD) {}
+#ifndef _LIBCPP_CXX03_LANG
+ template <class _Fp, class ..._Args,
+ class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, thread>::value> >
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ explicit thread(_Fp&& __f, _Args&&... __args);
+#else // _LIBCPP_CXX03_LANG
+ template <class _Fp>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ explicit thread(_Fp __f);
+#endif
+ ~thread();
+
+ _LIBCPP_INLINE_VISIBILITY
+ thread(thread&& __t) _NOEXCEPT : __t_(__t.__t_) {
+ __t.__t_ = _LIBCPP_NULL_THREAD;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ thread& operator=(thread&& __t) _NOEXCEPT {
+ if (!__libcpp_thread_isnull(&__t_))
+ terminate();
+ __t_ = __t.__t_;
+ __t.__t_ = _LIBCPP_NULL_THREAD;
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(thread& __t) _NOEXCEPT {_VSTD::swap(__t_, __t.__t_);}
+
+ _LIBCPP_INLINE_VISIBILITY
+ bool joinable() const _NOEXCEPT {return !__libcpp_thread_isnull(&__t_);}
+ void join();
+ void detach();
+ _LIBCPP_INLINE_VISIBILITY
+ id get_id() const _NOEXCEPT {return __libcpp_thread_get_id(&__t_);}
+ _LIBCPP_INLINE_VISIBILITY
+ native_handle_type native_handle() _NOEXCEPT {return __t_;}
+
+ static unsigned hardware_concurrency() _NOEXCEPT;
+};
+
+#ifndef _LIBCPP_CXX03_LANG
+
+template <class _TSp, class _Fp, class ..._Args, size_t ..._Indices>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+__thread_execute(tuple<_TSp, _Fp, _Args...>& __t, __tuple_indices<_Indices...>)
+{
+ _VSTD::__invoke(_VSTD::move(_VSTD::get<1>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
+}
+
+template <class _Fp>
+_LIBCPP_INLINE_VISIBILITY
+void* __thread_proxy(void* __vp)
+{
+ // _Fp = tuple< unique_ptr<__thread_struct>, Functor, Args...>
+ unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
+ __thread_local_data().set_pointer(_VSTD::get<0>(*__p.get()).release());
+ typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 2>::type _Index;
+ _VSTD::__thread_execute(*__p.get(), _Index());
+ return nullptr;
+}
+
+template <class _Fp, class ..._Args,
+ class
+ >
+thread::thread(_Fp&& __f, _Args&&... __args)
+{
+ typedef unique_ptr<__thread_struct> _TSPtr;
+ _TSPtr __tsp(new __thread_struct);
+ typedef tuple<_TSPtr, __decay_t<_Fp>, __decay_t<_Args>...> _Gp;
+ unique_ptr<_Gp> __p(
+ new _Gp(_VSTD::move(__tsp),
+ _VSTD::forward<_Fp>(__f),
+ _VSTD::forward<_Args>(__args)...));
+ int __ec = _VSTD::__libcpp_thread_create(&__t_, &__thread_proxy<_Gp>, __p.get());
+ if (__ec == 0)
+ __p.release();
+ else
+ __throw_system_error(__ec, "thread constructor failed");
+}
+
+#else // _LIBCPP_CXX03_LANG
+
+template <class _Fp>
+struct __thread_invoke_pair {
+ // This type is used to pass memory for thread local storage and a functor
+ // to a newly created thread because std::pair doesn't work with
+ // std::unique_ptr in C++03.
+ _LIBCPP_HIDE_FROM_ABI __thread_invoke_pair(_Fp& __f) : __tsp_(new __thread_struct), __fn_(__f) {}
+ unique_ptr<__thread_struct> __tsp_;
+ _Fp __fn_;
+};
+
+template <class _Fp>
+_LIBCPP_HIDE_FROM_ABI void* __thread_proxy_cxx03(void* __vp)
+{
+ unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
+ __thread_local_data().set_pointer(__p->__tsp_.release());
+ (__p->__fn_)();
+ return nullptr;
+}
+
+template <class _Fp>
+thread::thread(_Fp __f)
+{
+
+ typedef __thread_invoke_pair<_Fp> _InvokePair;
+ typedef unique_ptr<_InvokePair> _PairPtr;
+ _PairPtr __pp(new _InvokePair(__f));
+ int __ec = _VSTD::__libcpp_thread_create(&__t_, &__thread_proxy_cxx03<_InvokePair>, __pp.get());
+ if (__ec == 0)
+ __pp.release();
+ else
+ __throw_system_error(__ec, "thread constructor failed");
+}
+
+#endif // _LIBCPP_CXX03_LANG
+
+inline _LIBCPP_INLINE_VISIBILITY
+void swap(thread& __x, thread& __y) _NOEXCEPT {__x.swap(__y);}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___THREAD_THREAD_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__threading_support b/contrib/libs/cxxsupp/libcxx/include/__threading_support
index 07d684146df..1dc5017476c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__threading_support
+++ b/contrib/libs/cxxsupp/libcxx/include/__threading_support
@@ -13,13 +13,9 @@
#include <__availability>
#include <__chrono/convert_to_timespec.h>
#include <__chrono/duration.h>
-#include <__compare/ordering.h>
#include <__config>
-#include <__fwd/hash.h>
#include <__thread/poll_with_backoff.h>
#include <errno.h>
-#include <iosfwd>
-#include <limits>
#ifdef __MVS__
# include <__support/ibm/nanosleep.h>
@@ -34,26 +30,26 @@
#elif !defined(_LIBCPP_HAS_NO_THREADS)
#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+// Some platforms require <bits/atomic_wide_counter.h> in order for
+// PTHREAD_COND_INITIALIZER to be expanded. Normally that would come
+// in via <pthread.h>, but it's a non-modular header on those platforms,
+// so libc++'s <math.h> usually absorbs atomic_wide_counter.h into the
+// module with <math.h> and makes atomic_wide_counter.h invisible.
+// Include <math.h> here to work around that.
+# include <math.h>
+
# include <pthread.h>
# include <sched.h>
#elif defined(_LIBCPP_HAS_THREAD_API_C11)
# include <threads.h>
#endif
-#if defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \
- defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL) || \
- defined(_LIBCPP_HAS_THREAD_API_WIN32)
-#define _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_FUNC_VIS
+#if defined(_LIBCPP_HAS_THREAD_API_WIN32)
+#define _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_EXPORTED_FROM_ABI
#else
#define _LIBCPP_THREAD_ABI_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
#endif
-#if defined(__FreeBSD__) && defined(__clang__) && __has_attribute(no_thread_safety_analysis)
-#define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS __attribute__((no_thread_safety_analysis))
-#else
-#define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
-#endif
-
typedef ::timespec __libcpp_timespec_t;
#endif // !defined(_LIBCPP_HAS_NO_THREADS)
@@ -252,28 +248,25 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void *__p);
#endif // !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
-#if (!defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \
- defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL))
-
#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m)
{
- pthread_mutexattr_t attr;
- int __ec = pthread_mutexattr_init(&attr);
+ pthread_mutexattr_t __attr;
+ int __ec = pthread_mutexattr_init(&__attr);
if (__ec)
return __ec;
- __ec = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ __ec = pthread_mutexattr_settype(&__attr, PTHREAD_MUTEX_RECURSIVE);
if (__ec) {
- pthread_mutexattr_destroy(&attr);
+ pthread_mutexattr_destroy(&__attr);
return __ec;
}
- __ec = pthread_mutex_init(__m, &attr);
+ __ec = pthread_mutex_init(__m, &__attr);
if (__ec) {
- pthread_mutexattr_destroy(&attr);
+ pthread_mutexattr_destroy(&__attr);
return __ec;
}
- __ec = pthread_mutexattr_destroy(&attr);
+ __ec = pthread_mutexattr_destroy(&__attr);
if (__ec) {
pthread_mutex_destroy(__m);
return __ec;
@@ -380,8 +373,8 @@ int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
__libcpp_thread_id __libcpp_thread_get_current_id()
{
- const __libcpp_thread_t thread = pthread_self();
- return __libcpp_thread_get_id(&thread);
+ const __libcpp_thread_t __current_thread = pthread_self();
+ return __libcpp_thread_get_id(&__current_thread);
}
__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t)
@@ -589,116 +582,6 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void *__p)
#endif
-
-#endif // !_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL || _LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL
-
-class _LIBCPP_TYPE_VIS thread;
-class _LIBCPP_TYPE_VIS __thread_id;
-
-namespace this_thread
-{
-
-_LIBCPP_INLINE_VISIBILITY __thread_id get_id() _NOEXCEPT;
-
-} // namespace this_thread
-
-template<> struct hash<__thread_id>;
-
-class _LIBCPP_TEMPLATE_VIS __thread_id
-{
- // FIXME: pthread_t is a pointer on Darwin but a long on Linux.
- // NULL is the no-thread value on Darwin. Someone needs to check
- // on other platforms. We assume 0 works everywhere for now.
- __libcpp_thread_id __id_;
-
- static _LIBCPP_HIDE_FROM_ABI
- bool __lt_impl(__thread_id __x, __thread_id __y) _NOEXCEPT
- { // id==0 is always less than any other thread_id
- if (__x.__id_ == 0) return __y.__id_ != 0;
- if (__y.__id_ == 0) return false;
- return __libcpp_thread_id_less(__x.__id_, __y.__id_);
- }
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- __thread_id() _NOEXCEPT : __id_(0) {}
-
- _LIBCPP_INLINE_VISIBILITY
- void __reset() { __id_ = 0; }
-
- friend _LIBCPP_HIDE_FROM_ABI bool operator==(__thread_id __x, __thread_id __y) _NOEXCEPT;
-#if _LIBCPP_STD_VER <= 17
- friend _LIBCPP_HIDE_FROM_ABI bool operator<(__thread_id __x, __thread_id __y) _NOEXCEPT;
-#else // _LIBCPP_STD_VER <= 17
- friend _LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(__thread_id __x, __thread_id __y) noexcept;
-#endif // _LIBCPP_STD_VER <= 17
-
- template<class _CharT, class _Traits>
- friend
- _LIBCPP_INLINE_VISIBILITY
- basic_ostream<_CharT, _Traits>&
- operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id);
-
-private:
- _LIBCPP_INLINE_VISIBILITY
- __thread_id(__libcpp_thread_id __id) : __id_(__id) {}
-
- friend __thread_id this_thread::get_id() _NOEXCEPT;
- friend class _LIBCPP_TYPE_VIS thread;
- friend struct _LIBCPP_TEMPLATE_VIS hash<__thread_id>;
-};
-
-inline _LIBCPP_HIDE_FROM_ABI
-bool operator==(__thread_id __x, __thread_id __y) _NOEXCEPT {
- // Don't pass id==0 to underlying routines
- if (__x.__id_ == 0)
- return __y.__id_ == 0;
- if (__y.__id_ == 0)
- return false;
- return __libcpp_thread_id_equal(__x.__id_, __y.__id_);
-}
-
-#if _LIBCPP_STD_VER <= 17
-
-inline _LIBCPP_HIDE_FROM_ABI
-bool operator!=(__thread_id __x, __thread_id __y) _NOEXCEPT {
- return !(__x == __y);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI
-bool operator<(__thread_id __x, __thread_id __y) _NOEXCEPT {
- return __thread_id::__lt_impl(__x.__id_, __y.__id_);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI bool operator<=(__thread_id __x, __thread_id __y) _NOEXCEPT { return !(__y < __x); }
-inline _LIBCPP_HIDE_FROM_ABI bool operator>(__thread_id __x, __thread_id __y) _NOEXCEPT { return __y < __x; }
-inline _LIBCPP_HIDE_FROM_ABI bool operator>=(__thread_id __x, __thread_id __y) _NOEXCEPT { return !(__x < __y); }
-
-#else // _LIBCPP_STD_VER <= 17
-
-inline _LIBCPP_HIDE_FROM_ABI
-strong_ordering operator<=>(__thread_id __x, __thread_id __y) noexcept {
- if (__x == __y)
- return strong_ordering::equal;
- if (__thread_id::__lt_impl(__x, __y))
- return strong_ordering::less;
- return strong_ordering::greater;
-}
-
-#endif // _LIBCPP_STD_VER <= 17
-
-namespace this_thread
-{
-
-inline _LIBCPP_INLINE_VISIBILITY
-__thread_id
-get_id() _NOEXCEPT
-{
- return __libcpp_thread_get_current_id();
-}
-
-} // namespace this_thread
-
#endif // !_LIBCPP_HAS_NO_THREADS
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tree b/contrib/libs/cxxsupp/libcxx/include/__tree
index f5d9d595b4b..58d4a97c040 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__tree
+++ b/contrib/libs/cxxsupp/libcxx/include/__tree
@@ -13,11 +13,11 @@
#include <__algorithm/min.h>
#include <__assert>
#include <__config>
-#include <__debug>
#include <__functional/invoke.h>
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/next.h>
+#include <__memory/addressof.h>
#include <__memory/allocator_traits.h>
#include <__memory/compressed_pair.h>
#include <__memory/pointer_traits.h>
@@ -26,6 +26,7 @@
#include <__type_traits/can_extract_key.h>
#include <__type_traits/conditional.h>
#include <__type_traits/is_const.h>
+#include <__type_traits/is_copy_constructible.h>
#include <__type_traits/is_nothrow_copy_constructible.h>
#include <__type_traits/is_nothrow_default_constructible.h>
#include <__type_traits/is_nothrow_move_assignable.h>
@@ -167,7 +168,7 @@ inline _LIBCPP_INLINE_VISIBILITY
_NodePtr
__tree_min(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "Root node shouldn't be null");
+ _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "Root node shouldn't be null");
while (__x->__left_ != nullptr)
__x = __x->__left_;
return __x;
@@ -179,7 +180,7 @@ inline _LIBCPP_INLINE_VISIBILITY
_NodePtr
__tree_max(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "Root node shouldn't be null");
+ _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "Root node shouldn't be null");
while (__x->__right_ != nullptr)
__x = __x->__right_;
return __x;
@@ -190,7 +191,7 @@ template <class _NodePtr>
_LIBCPP_HIDE_FROM_ABI _NodePtr
__tree_next(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
+ _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
if (__x->__right_ != nullptr)
return _VSTD::__tree_min(__x->__right_);
while (!_VSTD::__tree_is_left_child(__x))
@@ -203,7 +204,7 @@ inline _LIBCPP_INLINE_VISIBILITY
_EndNodePtr
__tree_next_iter(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
+ _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
if (__x->__right_ != nullptr)
return static_cast<_EndNodePtr>(_VSTD::__tree_min(__x->__right_));
while (!_VSTD::__tree_is_left_child(__x))
@@ -218,7 +219,7 @@ inline _LIBCPP_INLINE_VISIBILITY
_NodePtr
__tree_prev_iter(_EndNodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
+ _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
if (__x->__left_ != nullptr)
return _VSTD::__tree_max(__x->__left_);
_NodePtr __xx = static_cast<_NodePtr>(__x);
@@ -232,7 +233,7 @@ template <class _NodePtr>
_LIBCPP_HIDE_FROM_ABI _NodePtr
__tree_leaf(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
+ _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
while (true)
{
if (__x->__left_ != nullptr)
@@ -256,8 +257,8 @@ template <class _NodePtr>
_LIBCPP_HIDE_FROM_ABI void
__tree_left_rotate(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
- _LIBCPP_ASSERT(__x->__right_ != nullptr, "node should have a right child");
+ _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
+ _LIBCPP_ASSERT_INTERNAL(__x->__right_ != nullptr, "node should have a right child");
_NodePtr __y = __x->__right_;
__x->__right_ = __y->__left_;
if (__x->__right_ != nullptr)
@@ -277,8 +278,8 @@ template <class _NodePtr>
_LIBCPP_HIDE_FROM_ABI void
__tree_right_rotate(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
- _LIBCPP_ASSERT(__x->__left_ != nullptr, "node should have a left child");
+ _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
+ _LIBCPP_ASSERT_INTERNAL(__x->__left_ != nullptr, "node should have a left child");
_NodePtr __y = __x->__left_;
__x->__left_ = __y->__right_;
if (__x->__left_ != nullptr)
@@ -303,8 +304,8 @@ template <class _NodePtr>
_LIBCPP_HIDE_FROM_ABI void
__tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__root != nullptr, "Root of the tree shouldn't be null");
- _LIBCPP_ASSERT(__x != nullptr, "Can't attach null node to a leaf");
+ _LIBCPP_ASSERT_INTERNAL(__root != nullptr, "Root of the tree shouldn't be null");
+ _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "Can't attach null node to a leaf");
__x->__is_black_ = __x == __root;
while (__x != __root && !__x->__parent_unsafe()->__is_black_)
{
@@ -373,9 +374,9 @@ template <class _NodePtr>
_LIBCPP_HIDE_FROM_ABI void
__tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
{
- _LIBCPP_ASSERT(__root != nullptr, "Root node should not be null");
- _LIBCPP_ASSERT(__z != nullptr, "The node to remove should not be null");
- _LIBCPP_DEBUG_ASSERT(__tree_invariant(__root), "The tree invariants should hold");
+ _LIBCPP_ASSERT_INTERNAL(__root != nullptr, "Root node should not be null");
+ _LIBCPP_ASSERT_INTERNAL(__z != nullptr, "The node to remove should not be null");
+ _LIBCPP_ASSERT_INTERNAL(std::__tree_invariant(__root), "The tree invariants should hold");
// __z will be removed from the tree. Client still needs to destruct/deallocate it
// __y is either __z, or if __z has two children, __tree_next(__z).
// __y will have at most one child.
@@ -797,7 +798,7 @@ public:
bool __value_constructed;
- __tree_node_destructor(const __tree_node_destructor &) = default;
+ _LIBCPP_HIDE_FROM_ABI __tree_node_destructor(const __tree_node_destructor &) = default;
__tree_node_destructor& operator=(const __tree_node_destructor&) = delete;
_LIBCPP_INLINE_VISIBILITY
@@ -818,7 +819,7 @@ public:
template <class> friend class __map_node_destructor;
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _NodeType, class _Alloc>
struct __generic_container_node_destructor;
template <class _Tp, class _VoidPtr, class _Alloc>
@@ -849,7 +850,7 @@ public:
typedef typename _NodeTypes::__node_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY __tree_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
: __ptr_(nullptr)
#endif
{}
@@ -922,7 +923,7 @@ public:
typedef typename _NodeTypes::__const_node_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY __tree_const_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
: __ptr_(nullptr)
#endif
{}
@@ -1100,36 +1101,36 @@ public:
__node_pointer __root() const _NOEXCEPT
{return static_cast<__node_pointer>(__end_node()->__left_);}
- __node_base_pointer* __root_ptr() const _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI __node_base_pointer* __root_ptr() const _NOEXCEPT {
return _VSTD::addressof(__end_node()->__left_);
}
typedef __tree_iterator<value_type, __node_pointer, difference_type> iterator;
typedef __tree_const_iterator<value_type, __node_pointer, difference_type> const_iterator;
- explicit __tree(const value_compare& __comp)
+ _LIBCPP_HIDE_FROM_ABI explicit __tree(const value_compare& __comp)
_NOEXCEPT_(
is_nothrow_default_constructible<__node_allocator>::value &&
is_nothrow_copy_constructible<value_compare>::value);
- explicit __tree(const allocator_type& __a);
- __tree(const value_compare& __comp, const allocator_type& __a);
- __tree(const __tree& __t);
- __tree& operator=(const __tree& __t);
+ _LIBCPP_HIDE_FROM_ABI explicit __tree(const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI __tree(const value_compare& __comp, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI __tree(const __tree& __t);
+ _LIBCPP_HIDE_FROM_ABI __tree& operator=(const __tree& __t);
template <class _ForwardIterator>
- void __assign_unique(_ForwardIterator __first, _ForwardIterator __last);
+ _LIBCPP_HIDE_FROM_ABI void __assign_unique(_ForwardIterator __first, _ForwardIterator __last);
template <class _InputIterator>
- void __assign_multi(_InputIterator __first, _InputIterator __last);
- __tree(__tree&& __t)
+ _LIBCPP_HIDE_FROM_ABI void __assign_multi(_InputIterator __first, _InputIterator __last);
+ _LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t)
_NOEXCEPT_(
is_nothrow_move_constructible<__node_allocator>::value &&
is_nothrow_move_constructible<value_compare>::value);
- __tree(__tree&& __t, const allocator_type& __a);
- __tree& operator=(__tree&& __t)
+ _LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI __tree& operator=(__tree&& __t)
_NOEXCEPT_(
__node_traits::propagate_on_container_move_assignment::value &&
is_nothrow_move_assignable<value_compare>::value &&
is_nothrow_move_assignable<__node_allocator>::value);
- ~__tree();
+ _LIBCPP_HIDE_FROM_ABI ~__tree();
_LIBCPP_INLINE_VISIBILITY
iterator begin() _NOEXCEPT {return iterator(__begin_node());}
@@ -1146,9 +1147,9 @@ public:
__node_traits::max_size(__node_alloc()),
numeric_limits<difference_type >::max());}
- void clear() _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
- void swap(__tree& __t)
+ _LIBCPP_HIDE_FROM_ABI void swap(__tree& __t)
#if _LIBCPP_STD_VER <= 11
_NOEXCEPT_(
__is_nothrow_swappable<value_compare>::value
@@ -1160,23 +1161,23 @@ public:
#endif
template <class _Key, class ..._Args>
- pair<iterator, bool>
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, bool>
__emplace_unique_key_args(_Key const&, _Args&&... __args);
template <class _Key, class ..._Args>
- pair<iterator, bool>
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, bool>
__emplace_hint_unique_key_args(const_iterator, _Key const&, _Args&&...);
template <class... _Args>
- pair<iterator, bool> __emplace_unique_impl(_Args&&... __args);
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique_impl(_Args&&... __args);
template <class... _Args>
- iterator __emplace_hint_unique_impl(const_iterator __p, _Args&&... __args);
+ _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint_unique_impl(const_iterator __p, _Args&&... __args);
template <class... _Args>
- iterator __emplace_multi(_Args&&... __args);
+ _LIBCPP_HIDE_FROM_ABI iterator __emplace_multi(_Args&&... __args);
template <class... _Args>
- iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);
+ _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);
template <class _Pp>
_LIBCPP_INLINE_VISIBILITY
@@ -1331,7 +1332,7 @@ public:
_LIBCPP_INLINE_VISIBILITY iterator
__remove_node_pointer(__node_pointer) _NOEXCEPT;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _NodeHandle, class _InsertReturnType>
_LIBCPP_INLINE_VISIBILITY
_InsertReturnType __node_handle_insert_unique(_NodeHandle&&);
@@ -1361,33 +1362,33 @@ public:
_NodeHandle __node_handle_extract(const_iterator);
#endif
- iterator erase(const_iterator __p);
- iterator erase(const_iterator __f, const_iterator __l);
+ _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p);
+ _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l);
template <class _Key>
- size_type __erase_unique(const _Key& __k);
+ _LIBCPP_HIDE_FROM_ABI size_type __erase_unique(const _Key& __k);
template <class _Key>
- size_type __erase_multi(const _Key& __k);
+ _LIBCPP_HIDE_FROM_ABI size_type __erase_multi(const _Key& __k);
- void __insert_node_at(__parent_pointer __parent,
+ _LIBCPP_HIDE_FROM_ABI void __insert_node_at(__parent_pointer __parent,
__node_base_pointer& __child,
__node_base_pointer __new_node) _NOEXCEPT;
template <class _Key>
- iterator find(const _Key& __v);
+ _LIBCPP_HIDE_FROM_ABI iterator find(const _Key& __v);
template <class _Key>
- const_iterator find(const _Key& __v) const;
+ _LIBCPP_HIDE_FROM_ABI const_iterator find(const _Key& __v) const;
template <class _Key>
- size_type __count_unique(const _Key& __k) const;
+ _LIBCPP_HIDE_FROM_ABI size_type __count_unique(const _Key& __k) const;
template <class _Key>
- size_type __count_multi(const _Key& __k) const;
+ _LIBCPP_HIDE_FROM_ABI size_type __count_multi(const _Key& __k) const;
template <class _Key>
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const _Key& __v)
{return __lower_bound(__v, __root(), __end_node());}
template <class _Key>
- iterator __lower_bound(const _Key& __v,
+ _LIBCPP_HIDE_FROM_ABI iterator __lower_bound(const _Key& __v,
__node_pointer __root,
__iter_pointer __result);
template <class _Key>
@@ -1395,7 +1396,7 @@ public:
const_iterator lower_bound(const _Key& __v) const
{return __lower_bound(__v, __root(), __end_node());}
template <class _Key>
- const_iterator __lower_bound(const _Key& __v,
+ _LIBCPP_HIDE_FROM_ABI const_iterator __lower_bound(const _Key& __v,
__node_pointer __root,
__iter_pointer __result) const;
template <class _Key>
@@ -1403,7 +1404,7 @@ public:
iterator upper_bound(const _Key& __v)
{return __upper_bound(__v, __root(), __end_node());}
template <class _Key>
- iterator __upper_bound(const _Key& __v,
+ _LIBCPP_HIDE_FROM_ABI iterator __upper_bound(const _Key& __v,
__node_pointer __root,
__iter_pointer __result);
template <class _Key>
@@ -1411,55 +1412,52 @@ public:
const_iterator upper_bound(const _Key& __v) const
{return __upper_bound(__v, __root(), __end_node());}
template <class _Key>
- const_iterator __upper_bound(const _Key& __v,
+ _LIBCPP_HIDE_FROM_ABI const_iterator __upper_bound(const _Key& __v,
__node_pointer __root,
__iter_pointer __result) const;
template <class _Key>
- pair<iterator, iterator>
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator>
__equal_range_unique(const _Key& __k);
template <class _Key>
- pair<const_iterator, const_iterator>
+ _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator>
__equal_range_unique(const _Key& __k) const;
template <class _Key>
- pair<iterator, iterator>
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator>
__equal_range_multi(const _Key& __k);
template <class _Key>
- pair<const_iterator, const_iterator>
+ _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator>
__equal_range_multi(const _Key& __k) const;
typedef __tree_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _Dp> __node_holder;
- __node_holder remove(const_iterator __p) _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI __node_holder remove(const_iterator __p) _NOEXCEPT;
private:
- __node_base_pointer&
- __find_leaf_low(__parent_pointer& __parent, const key_type& __v);
- __node_base_pointer&
- __find_leaf_high(__parent_pointer& __parent, const key_type& __v);
- __node_base_pointer&
- __find_leaf(const_iterator __hint,
- __parent_pointer& __parent, const key_type& __v);
+ _LIBCPP_HIDE_FROM_ABI __node_base_pointer& __find_leaf_low(__parent_pointer& __parent, const key_type& __v);
+ _LIBCPP_HIDE_FROM_ABI __node_base_pointer& __find_leaf_high(__parent_pointer& __parent, const key_type& __v);
+ _LIBCPP_HIDE_FROM_ABI __node_base_pointer&
+ __find_leaf(const_iterator __hint, __parent_pointer& __parent, const key_type& __v);
// FIXME: Make this function const qualified. Unfortunately doing so
// breaks existing code which uses non-const callable comparators.
template <class _Key>
- __node_base_pointer&
- __find_equal(__parent_pointer& __parent, const _Key& __v);
+ _LIBCPP_HIDE_FROM_ABI __node_base_pointer& __find_equal(__parent_pointer& __parent, const _Key& __v);
template <class _Key>
_LIBCPP_INLINE_VISIBILITY __node_base_pointer&
__find_equal(__parent_pointer& __parent, const _Key& __v) const {
return const_cast<__tree*>(this)->__find_equal(__parent, __v);
}
template <class _Key>
- __node_base_pointer&
+ _LIBCPP_HIDE_FROM_ABI __node_base_pointer&
__find_equal(const_iterator __hint, __parent_pointer& __parent,
__node_base_pointer& __dummy,
const _Key& __v);
template <class ..._Args>
- __node_holder __construct_node(_Args&& ...__args);
+ _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node(_Args&& ...__args);
- void destroy(__node_pointer __nd) _NOEXCEPT;
+ // TODO: Make this _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_HIDDEN void destroy(__node_pointer __nd) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __tree& __t)
@@ -1476,8 +1474,8 @@ private:
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __tree&, false_type) {}
- void __move_assign(__tree& __t, false_type);
- void __move_assign(__tree& __t, true_type)
+ _LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, false_type);
+ _LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, true_type)
_NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value &&
is_nothrow_move_assignable<__node_allocator>::value);
@@ -1640,7 +1638,7 @@ __tree<_Tp, _Compare, _Allocator>::__assign_unique(_ForwardIterator __first, _Fo
typedef typename _ITraits::value_type _ItValueType;
static_assert((is_same<_ItValueType, __container_value_type>::value),
"__assign_unique may only be called with the containers value type");
- static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
+ static_assert(__has_forward_iterator_category<_ForwardIterator>::value,
"__assign_unique requires a forward iterator");
if (size() != 0)
{
@@ -2265,7 +2263,7 @@ __tree<_Tp, _Compare, _Allocator>::__remove_node_pointer(__node_pointer __ptr) _
return __r;
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Compare, class _Allocator>
template <class _NodeHandle, class _InsertReturnType>
_LIBCPP_INLINE_VISIBILITY
@@ -2422,7 +2420,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_merge_multi(_Tree& __source)
}
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::iterator
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple/make_tuple_types.h b/contrib/libs/cxxsupp/libcxx/include/__tuple/make_tuple_types.h
new file mode 100644
index 00000000000..aee2bde89c7
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__tuple/make_tuple_types.h
@@ -0,0 +1,80 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___TUPLE_MAKE_TUPLE_TYPES_H
+#define _LIBCPP___TUPLE_MAKE_TUPLE_TYPES_H
+
+#include <__config>
+#include <__fwd/array.h>
+#include <__fwd/tuple.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_indices.h>
+#include <__tuple/tuple_size.h>
+#include <__tuple/tuple_types.h>
+#include <__type_traits/apply_cv.h>
+#include <__type_traits/remove_cv.h>
+#include <__type_traits/remove_reference.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#ifndef _LIBCPP_CXX03_LANG
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// __make_tuple_types<_Tuple<_Types...>, _Ep, _Sp>::type is a
+// __tuple_types<_Types...> using only those _Types in the range [_Sp, _Ep).
+// _Sp defaults to 0 and _Ep defaults to tuple_size<_Tuple>. If _Tuple is a
+// lvalue_reference type, then __tuple_types<_Types&...> is the result.
+
+template <class _TupleTypes, class _TupleIndices>
+struct __make_tuple_types_flat;
+
+template <template <class...> class _Tuple, class ..._Types, size_t ..._Idx>
+struct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> {
+ // Specialization for pair, tuple, and __tuple_types
+ template <class _Tp>
+ using __apply_quals _LIBCPP_NODEBUG = __tuple_types<__apply_cv_t<_Tp, __type_pack_element<_Idx, _Types...>>...>;
+};
+
+template <class _Vt, size_t _Np, size_t ..._Idx>
+struct __make_tuple_types_flat<array<_Vt, _Np>, __tuple_indices<_Idx...>> {
+ template <size_t>
+ using __value_type = _Vt;
+ template <class _Tp>
+ using __apply_quals = __tuple_types<__apply_cv_t<_Tp, __value_type<_Idx>>...>;
+};
+
+template <class _Tp, size_t _Ep = tuple_size<__libcpp_remove_reference_t<_Tp> >::value,
+ size_t _Sp = 0,
+ bool _SameSize = (_Ep == tuple_size<__libcpp_remove_reference_t<_Tp> >::value)>
+struct __make_tuple_types
+{
+ static_assert(_Sp <= _Ep, "__make_tuple_types input error");
+ using _RawTp = __remove_cv_t<__libcpp_remove_reference_t<_Tp> >;
+ using _Maker = __make_tuple_types_flat<_RawTp, typename __make_tuple_indices<_Ep, _Sp>::type>;
+ using type = typename _Maker::template __apply_quals<_Tp>;
+};
+
+template <class ..._Types, size_t _Ep>
+struct __make_tuple_types<tuple<_Types...>, _Ep, 0, true> {
+ typedef _LIBCPP_NODEBUG __tuple_types<_Types...> type;
+};
+
+template <class ..._Types, size_t _Ep>
+struct __make_tuple_types<__tuple_types<_Types...>, _Ep, 0, true> {
+ typedef _LIBCPP_NODEBUG __tuple_types<_Types...> type;
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_CXX03_LANG
+
+#endif // _LIBCPP___TUPLE_MAKE_TUPLE_TYPES_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple/pair_like.h b/contrib/libs/cxxsupp/libcxx/include/__tuple/pair_like.h
new file mode 100644
index 00000000000..192682dc7eb
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__tuple/pair_like.h
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___TUPLE_PAIR_LIKE_H
+#define _LIBCPP___TUPLE_PAIR_LIKE_H
+
+#include <__config>
+#include <__tuple/tuple_like.h>
+#include <__tuple/tuple_size.h>
+#include <__type_traits/remove_cvref.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 20
+
+template <class _Tp>
+concept __pair_like = __tuple_like<_Tp> && tuple_size<remove_cvref_t<_Tp>>::value == 2;
+
+#endif // _LIBCPP_STD_VER >= 20
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TUPLE_PAIR_LIKE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple/sfinae_helpers.h b/contrib/libs/cxxsupp/libcxx/include/__tuple/sfinae_helpers.h
new file mode 100644
index 00000000000..ee5557633cd
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__tuple/sfinae_helpers.h
@@ -0,0 +1,185 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___TUPLE_SFINAE_HELPERS_H
+#define _LIBCPP___TUPLE_SFINAE_HELPERS_H
+
+#include <__config>
+#include <__fwd/tuple.h>
+#include <__tuple/make_tuple_types.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_like_ext.h>
+#include <__tuple/tuple_size.h>
+#include <__tuple/tuple_types.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_assignable.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_CXX03_LANG
+
+template <bool ..._Preds>
+struct __all_dummy;
+
+template <bool ..._Pred>
+struct __all : _IsSame<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...>> {};
+
+struct __tuple_sfinae_base {
+ template <template <class, class...> class _Trait,
+ class ..._LArgs, class ..._RArgs>
+ static auto __do_test(__tuple_types<_LArgs...>, __tuple_types<_RArgs...>)
+ -> __all<__enable_if_t<_Trait<_LArgs, _RArgs>::value, bool>{true}...>;
+ template <template <class...> class>
+ static auto __do_test(...) -> false_type;
+
+ template <class _FromArgs, class _ToArgs>
+ using __constructible = decltype(__do_test<is_constructible>(declval<_ToArgs>(), declval<_FromArgs>()));
+ template <class _FromArgs, class _ToArgs>
+ using __convertible = decltype(__do_test<is_convertible>(declval<_FromArgs>(), declval<_ToArgs>()));
+ template <class _FromArgs, class _ToArgs>
+ using __assignable = decltype(__do_test<is_assignable>(declval<_ToArgs>(), declval<_FromArgs>()));
+};
+
+// __tuple_convertible
+
+template <class _Tp, class _Up, bool = __tuple_like_ext<__libcpp_remove_reference_t<_Tp> >::value,
+ bool = __tuple_like_ext<_Up>::value,
+ class = void>
+struct __tuple_convertible
+ : public false_type {};
+
+template <class _Tp, class _Up>
+struct __tuple_convertible<_Tp, _Up, true, true,
+ typename enable_if<(tuple_size<typename remove_reference<_Tp>::type>::value == tuple_size<_Up>::value)>::type>
+ : public __tuple_sfinae_base::__convertible<
+ typename __make_tuple_types<_Tp>::type
+ , typename __make_tuple_types<_Up>::type
+ >
+{};
+
+// __tuple_constructible
+
+template <class _Tp, class _Up, bool = __tuple_like_ext<__libcpp_remove_reference_t<_Tp> >::value,
+ bool = __tuple_like_ext<_Up>::value>
+struct __tuple_constructible
+ : public false_type {};
+
+template <class _Tp, class _Up>
+struct __tuple_constructible<_Tp, _Up, true, true>
+ : public __tuple_sfinae_base::__constructible<
+ typename __make_tuple_types<_Tp>::type
+ , typename __make_tuple_types<_Up>::type
+ >
+{};
+
+// __tuple_assignable
+
+template <class _Tp, class _Up, bool = __tuple_like_ext<__libcpp_remove_reference_t<_Tp> >::value,
+ bool = __tuple_like_ext<_Up>::value>
+struct __tuple_assignable
+ : public false_type {};
+
+template <class _Tp, class _Up>
+struct __tuple_assignable<_Tp, _Up, true, true>
+ : public __tuple_sfinae_base::__assignable<
+ typename __make_tuple_types<_Tp>::type
+ , typename __make_tuple_types<_Up&>::type
+ >
+{};
+
+
+template <size_t _Ip, class ..._Tp>
+struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> >
+{
+ typedef _LIBCPP_NODEBUG typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
+};
+
+struct _LIBCPP_EXPORTED_FROM_ABI __check_tuple_constructor_fail {
+
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit_default() { return false; }
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit_default() { return false; }
+ template <class ...>
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit() { return false; }
+ template <class ...>
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit() { return false; }
+ template <class ...>
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_assign() { return false; }
+};
+#endif // !defined(_LIBCPP_CXX03_LANG)
+
+#if _LIBCPP_STD_VER >= 17
+
+template <bool _CanCopy, bool _CanMove>
+struct __sfinae_ctor_base {};
+template <>
+struct __sfinae_ctor_base<false, false> {
+ __sfinae_ctor_base() = default;
+ __sfinae_ctor_base(__sfinae_ctor_base const&) = delete;
+ __sfinae_ctor_base(__sfinae_ctor_base &&) = delete;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
+};
+template <>
+struct __sfinae_ctor_base<true, false> {
+ __sfinae_ctor_base() = default;
+ __sfinae_ctor_base(__sfinae_ctor_base const&) = default;
+ __sfinae_ctor_base(__sfinae_ctor_base &&) = delete;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
+};
+template <>
+struct __sfinae_ctor_base<false, true> {
+ __sfinae_ctor_base() = default;
+ __sfinae_ctor_base(__sfinae_ctor_base const&) = delete;
+ __sfinae_ctor_base(__sfinae_ctor_base &&) = default;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
+};
+
+template <bool _CanCopy, bool _CanMove>
+struct __sfinae_assign_base {};
+template <>
+struct __sfinae_assign_base<false, false> {
+ __sfinae_assign_base() = default;
+ __sfinae_assign_base(__sfinae_assign_base const&) = default;
+ __sfinae_assign_base(__sfinae_assign_base &&) = default;
+ __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
+ __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete;
+};
+template <>
+struct __sfinae_assign_base<true, false> {
+ __sfinae_assign_base() = default;
+ __sfinae_assign_base(__sfinae_assign_base const&) = default;
+ __sfinae_assign_base(__sfinae_assign_base &&) = default;
+ __sfinae_assign_base& operator=(__sfinae_assign_base const&) = default;
+ __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete;
+};
+template <>
+struct __sfinae_assign_base<false, true> {
+ __sfinae_assign_base() = default;
+ __sfinae_assign_base(__sfinae_assign_base const&) = default;
+ __sfinae_assign_base(__sfinae_assign_base &&) = default;
+ __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
+ __sfinae_assign_base& operator=(__sfinae_assign_base&&) = default;
+};
+#endif // _LIBCPP_STD_VER >= 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TUPLE_SFINAE_HELPERS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_element.h b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_element.h
new file mode 100644
index 00000000000..5d2c38fd3bb
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_element.h
@@ -0,0 +1,108 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___TUPLE_TUPLE_ELEMENT_H
+#define _LIBCPP___TUPLE_TUPLE_ELEMENT_H
+
+#include <__config>
+#include <__tuple/tuple_indices.h>
+#include <__tuple/tuple_types.h>
+#include <__type_traits/add_const.h>
+#include <__type_traits/add_cv.h>
+#include <__type_traits/add_volatile.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <size_t _Ip, class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_element;
+
+template <size_t _Ip, class _Tp>
+struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const _Tp>
+{
+ typedef _LIBCPP_NODEBUG typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type;
+};
+
+template <size_t _Ip, class _Tp>
+struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, volatile _Tp>
+{
+ typedef _LIBCPP_NODEBUG typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type;
+};
+
+template <size_t _Ip, class _Tp>
+struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp>
+{
+ typedef _LIBCPP_NODEBUG typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type;
+};
+
+#ifndef _LIBCPP_CXX03_LANG
+
+#if !__has_builtin(__type_pack_element)
+
+namespace __indexer_detail {
+
+template <size_t _Idx, class _Tp>
+struct __indexed { using type _LIBCPP_NODEBUG = _Tp; };
+
+template <class _Types, class _Indexes> struct __indexer;
+
+template <class ..._Types, size_t ..._Idx>
+struct __indexer<__tuple_types<_Types...>, __tuple_indices<_Idx...>>
+ : __indexed<_Idx, _Types>...
+{};
+
+template <size_t _Idx, class _Tp>
+__indexed<_Idx, _Tp> __at_index(__indexed<_Idx, _Tp> const&);
+
+} // namespace __indexer_detail
+
+#if !defined(__CUDACC__) || !defined(_MSC_VER)
+template <size_t _Idx, class ..._Types>
+using __type_pack_element _LIBCPP_NODEBUG = typename decltype(
+ __indexer_detail::__at_index<_Idx>(
+ __indexer_detail::__indexer<
+ __tuple_types<_Types...>,
+ typename __make_tuple_indices<sizeof...(_Types)>::type
+ >{})
+ )::type;
+#else // !defined(__CUDACC__) || !defined(_MSC_VER)
+template <size_t _Idx, class ..._Types>
+struct __y_type_pack_element {
+ using __t1 = typename __make_tuple_indices<sizeof...(_Types)>::type;
+ using __t2 = __indexer_detail::__indexer<__tuple_types<_Types...>, __t1>;
+ using __t3 = decltype(__indexer_detail::__at_index<_Idx>(__t2{}));
+ using __t4 = typename __t3::type;
+};
+
+template <size_t _Idx, class ..._Types>
+using __type_pack_element = typename __y_type_pack_element<_Idx, _Types...>::__t4;
+
+#endif // !defined(__CUDACC__) || !defined(_MSC_VER)
+
+#endif // __has_builtin(__type_pack_element)
+
+template <size_t _Ip, class ..._Types>
+struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...> >
+{
+ static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range");
+ typedef _LIBCPP_NODEBUG __type_pack_element<_Ip, _Types...> type;
+};
+
+#if _LIBCPP_STD_VER >= 14
+template <size_t _Ip, class ..._Tp>
+using tuple_element_t _LIBCPP_NODEBUG = typename tuple_element <_Ip, _Tp...>::type;
+#endif
+
+#endif // _LIBCPP_CXX03_LANG
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TUPLE_TUPLE_ELEMENT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_indices.h b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_indices.h
index 18666d5948c..18666d5948c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_indices.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_indices.h
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_like.h b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_like.h
index dab395be616..dab395be616 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_like.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_like.h
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_like_ext.h b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_like_ext.h
new file mode 100644
index 00000000000..36f5c4896ff
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_like_ext.h
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___TUPLE_TUPLE_LIKE_EXT_H
+#define _LIBCPP___TUPLE_TUPLE_LIKE_EXT_H
+
+#include <__config>
+#include <__fwd/array.h>
+#include <__fwd/pair.h>
+#include <__fwd/tuple.h>
+#include <__tuple/tuple_types.h>
+#include <__type_traits/integral_constant.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp> struct __tuple_like_ext : false_type {};
+
+template <class _Tp> struct __tuple_like_ext<const _Tp> : public __tuple_like_ext<_Tp> {};
+template <class _Tp> struct __tuple_like_ext<volatile _Tp> : public __tuple_like_ext<_Tp> {};
+template <class _Tp> struct __tuple_like_ext<const volatile _Tp> : public __tuple_like_ext<_Tp> {};
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class... _Tp> struct __tuple_like_ext<tuple<_Tp...> > : true_type {};
+#endif
+
+template <class _T1, class _T2> struct __tuple_like_ext<pair<_T1, _T2> > : true_type {};
+
+template <class _Tp, size_t _Size> struct __tuple_like_ext<array<_Tp, _Size> > : true_type {};
+
+template <class... _Tp> struct __tuple_like_ext<__tuple_types<_Tp...> > : true_type {};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TUPLE_TUPLE_LIKE_EXT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_size.h b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_size.h
new file mode 100644
index 00000000000..26f9d9725d3
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_size.h
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___TUPLE_TUPLE_SIZE_H
+#define _LIBCPP___TUPLE_TUPLE_SIZE_H
+
+#include <__config>
+#include <__fwd/tuple.h>
+#include <__tuple/tuple_types.h>
+#include <__type_traits/is_const.h>
+#include <__type_traits/is_volatile.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size;
+
+#if !defined(_LIBCPP_CXX03_LANG)
+template <class _Tp, class...>
+using __enable_if_tuple_size_imp = _Tp;
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
+ const _Tp,
+ __enable_if_t<!is_volatile<_Tp>::value>,
+ integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
+ : public integral_constant<size_t, tuple_size<_Tp>::value> {};
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
+ volatile _Tp,
+ __enable_if_t<!is_const<_Tp>::value>,
+ integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
+ : public integral_constant<size_t, tuple_size<_Tp>::value> {};
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
+ const volatile _Tp,
+ integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
+ : public integral_constant<size_t, tuple_size<_Tp>::value> {};
+
+#else
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<const _Tp> : public tuple_size<_Tp> {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<volatile _Tp> : public tuple_size<_Tp> {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<const volatile _Tp> : public tuple_size<_Tp> {};
+#endif
+
+#ifndef _LIBCPP_CXX03_LANG
+
+template <class ..._Tp>
+struct _LIBCPP_TEMPLATE_VIS tuple_size<tuple<_Tp...> >
+ : public integral_constant<size_t, sizeof...(_Tp)>
+{
+};
+
+template <class ..._Tp>
+struct _LIBCPP_TEMPLATE_VIS tuple_size<__tuple_types<_Tp...> >
+ : public integral_constant<size_t, sizeof...(_Tp)>
+{
+};
+
+#endif // _LIBCPP_CXX03_LANG
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TUPLE_TUPLE_SIZE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_types.h b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_types.h
index c5be81cce80..c5be81cce80 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_types.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__tuple/tuple_types.h
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/apply_cv.h b/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/apply_cv.h
deleted file mode 100644
index 296755a1d52..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/apply_cv.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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___TUPLE_APPLY_CV_H
-#define _LIBCPP___TUPLE_APPLY_CV_H
-
-#include <__config>
-#include <__type_traits/is_const.h>
-#include <__type_traits/is_reference.h>
-#include <__type_traits/is_volatile.h>
-#include <__type_traits/remove_reference.h>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <bool _ApplyLV, bool _ApplyConst, bool _ApplyVolatile>
-struct __apply_cv_mf;
-template <>
-struct __apply_cv_mf<false, false, false> {
- template <class _Tp> using __apply = _Tp;
-};
-template <>
-struct __apply_cv_mf<false, true, false> {
- template <class _Tp> using __apply _LIBCPP_NODEBUG = const _Tp;
-};
-template <>
-struct __apply_cv_mf<false, false, true> {
- template <class _Tp> using __apply _LIBCPP_NODEBUG = volatile _Tp;
-};
-template <>
-struct __apply_cv_mf<false, true, true> {
- template <class _Tp> using __apply _LIBCPP_NODEBUG = const volatile _Tp;
-};
-template <>
-struct __apply_cv_mf<true, false, false> {
- template <class _Tp> using __apply _LIBCPP_NODEBUG = _Tp&;
-};
-template <>
-struct __apply_cv_mf<true, true, false> {
- template <class _Tp> using __apply _LIBCPP_NODEBUG = const _Tp&;
-};
-template <>
-struct __apply_cv_mf<true, false, true> {
- template <class _Tp> using __apply _LIBCPP_NODEBUG = volatile _Tp&;
-};
-template <>
-struct __apply_cv_mf<true, true, true> {
- template <class _Tp> using __apply _LIBCPP_NODEBUG = const volatile _Tp&;
-};
-template <class _Tp, class _RawTp = __libcpp_remove_reference_t<_Tp> >
-using __apply_cv_t _LIBCPP_NODEBUG = __apply_cv_mf<
- is_lvalue_reference<_Tp>::value,
- is_const<_RawTp>::value,
- is_volatile<_RawTp>::value>;
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_CXX03_LANG
-
-#endif // _LIBCPP___TUPLE_APPLY_CV_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/make_tuple_types.h b/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/make_tuple_types.h
deleted file mode 100644
index 913ff9bbd60..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/make_tuple_types.h
+++ /dev/null
@@ -1,84 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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___TUPLE_MAKE_TUPLE_TYPES_H
-#define _LIBCPP___TUPLE_MAKE_TUPLE_TYPES_H
-
-#include <__config>
-#include <__fwd/array.h>
-#include <__fwd/tuple.h>
-#include <__tuple_dir/apply_cv.h>
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_indices.h>
-#include <__tuple_dir/tuple_size.h>
-#include <__tuple_dir/tuple_types.h>
-#include <__type_traits/remove_cv.h>
-#include <__type_traits/remove_reference.h>
-#include <cstddef>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-// __make_tuple_types<_Tuple<_Types...>, _Ep, _Sp>::type is a
-// __tuple_types<_Types...> using only those _Types in the range [_Sp, _Ep).
-// _Sp defaults to 0 and _Ep defaults to tuple_size<_Tuple>. If _Tuple is a
-// lvalue_reference type, then __tuple_types<_Types&...> is the result.
-
-template <class _TupleTypes, class _TupleIndices>
-struct __make_tuple_types_flat;
-
-template <template <class...> class _Tuple, class ..._Types, size_t ..._Idx>
-struct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> {
- // Specialization for pair, tuple, and __tuple_types
- template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>>
- using __apply_quals _LIBCPP_NODEBUG = __tuple_types<
- typename _ApplyFn::template __apply<__type_pack_element<_Idx, _Types...>>...
- >;
-};
-
-template <class _Vt, size_t _Np, size_t ..._Idx>
-struct __make_tuple_types_flat<array<_Vt, _Np>, __tuple_indices<_Idx...>> {
- template <size_t>
- using __value_type = _Vt;
- template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>>
- using __apply_quals = __tuple_types<
- typename _ApplyFn::template __apply<__value_type<_Idx>>...
- >;
-};
-
-template <class _Tp, size_t _Ep = tuple_size<__libcpp_remove_reference_t<_Tp> >::value,
- size_t _Sp = 0,
- bool _SameSize = (_Ep == tuple_size<__libcpp_remove_reference_t<_Tp> >::value)>
-struct __make_tuple_types
-{
- static_assert(_Sp <= _Ep, "__make_tuple_types input error");
- using _RawTp = __remove_cv_t<__libcpp_remove_reference_t<_Tp> >;
- using _Maker = __make_tuple_types_flat<_RawTp, typename __make_tuple_indices<_Ep, _Sp>::type>;
- using type = typename _Maker::template __apply_quals<_Tp>;
-};
-
-template <class ..._Types, size_t _Ep>
-struct __make_tuple_types<tuple<_Types...>, _Ep, 0, true> {
- typedef _LIBCPP_NODEBUG __tuple_types<_Types...> type;
-};
-
-template <class ..._Types, size_t _Ep>
-struct __make_tuple_types<__tuple_types<_Types...>, _Ep, 0, true> {
- typedef _LIBCPP_NODEBUG __tuple_types<_Types...> type;
-};
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_CXX03_LANG
-
-#endif // _LIBCPP___TUPLE_MAKE_TUPLE_TYPES_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/pair_like.h b/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/pair_like.h
deleted file mode 100644
index 87407ad95b6..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/pair_like.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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___TUPLE_PAIR_LIKE_H
-#define _LIBCPP___TUPLE_PAIR_LIKE_H
-
-#include <__config>
-#include <__tuple_dir/tuple_like.h>
-#include <__tuple_dir/tuple_size.h>
-#include <__type_traits/remove_cvref.h>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-#if _LIBCPP_STD_VER >= 20
-
-template <class _Tp>
-concept __pair_like = __tuple_like<_Tp> && tuple_size<remove_cvref_t<_Tp>>::value == 2;
-
-#endif // _LIBCPP_STD_VER >= 20
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP___TUPLE_PAIR_LIKE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/sfinae_helpers.h b/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/sfinae_helpers.h
deleted file mode 100644
index bedb62b6c70..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/sfinae_helpers.h
+++ /dev/null
@@ -1,198 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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___TUPLE_SFINAE_HELPERS_H
-#define _LIBCPP___TUPLE_SFINAE_HELPERS_H
-
-#include <__config>
-#include <__fwd/tuple.h>
-#include <__tuple_dir/make_tuple_types.h>
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_like_ext.h>
-#include <__tuple_dir/tuple_size.h>
-#include <__tuple_dir/tuple_types.h>
-#include <__type_traits/enable_if.h>
-#include <__type_traits/integral_constant.h>
-#include <__type_traits/is_assignable.h>
-#include <__type_traits/is_constructible.h>
-#include <__type_traits/is_convertible.h>
-#include <__type_traits/is_same.h>
-#include <__type_traits/remove_cvref.h>
-#include <__type_traits/remove_reference.h>
-#include <cstddef>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <bool ..._Preds>
-struct __all_dummy;
-
-template <bool ..._Pred>
-struct __all : _IsSame<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...>> {};
-
-struct __tuple_sfinae_base {
- template <template <class, class...> class _Trait,
- class ..._LArgs, class ..._RArgs>
- static auto __do_test(__tuple_types<_LArgs...>, __tuple_types<_RArgs...>)
- -> __all<__enable_if_t<_Trait<_LArgs, _RArgs>::value, bool>{true}...>;
- template <template <class...> class>
- static auto __do_test(...) -> false_type;
-
- template <class _FromArgs, class _ToArgs>
- using __constructible = decltype(__do_test<is_constructible>(declval<_ToArgs>(), declval<_FromArgs>()));
- template <class _FromArgs, class _ToArgs>
- using __convertible = decltype(__do_test<is_convertible>(declval<_FromArgs>(), declval<_ToArgs>()));
- template <class _FromArgs, class _ToArgs>
- using __assignable = decltype(__do_test<is_assignable>(declval<_ToArgs>(), declval<_FromArgs>()));
-};
-
-// __tuple_convertible
-
-template <class _Tp, class _Up, bool = __tuple_like_ext<__libcpp_remove_reference_t<_Tp> >::value,
- bool = __tuple_like_ext<_Up>::value,
- class = void>
-struct __tuple_convertible
- : public false_type {};
-
-template <class _Tp, class _Up>
-struct __tuple_convertible<_Tp, _Up, true, true,
- typename enable_if<(tuple_size<typename remove_reference<_Tp>::type>::value == tuple_size<_Up>::value)>::type>
- : public __tuple_sfinae_base::__convertible<
- typename __make_tuple_types<_Tp>::type
- , typename __make_tuple_types<_Up>::type
- >
-{};
-
-// __tuple_constructible
-
-template <class _Tp, class _Up, bool = __tuple_like_ext<__libcpp_remove_reference_t<_Tp> >::value,
- bool = __tuple_like_ext<_Up>::value>
-struct __tuple_constructible
- : public false_type {};
-
-template <class _Tp, class _Up>
-struct __tuple_constructible<_Tp, _Up, true, true>
- : public __tuple_sfinae_base::__constructible<
- typename __make_tuple_types<_Tp>::type
- , typename __make_tuple_types<_Up>::type
- >
-{};
-
-// __tuple_assignable
-
-template <class _Tp, class _Up, bool = __tuple_like_ext<__libcpp_remove_reference_t<_Tp> >::value,
- bool = __tuple_like_ext<_Up>::value>
-struct __tuple_assignable
- : public false_type {};
-
-template <class _Tp, class _Up>
-struct __tuple_assignable<_Tp, _Up, true, true>
- : public __tuple_sfinae_base::__assignable<
- typename __make_tuple_types<_Tp>::type
- , typename __make_tuple_types<_Up&>::type
- >
-{};
-
-
-template <size_t _Ip, class ..._Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> >
-{
- typedef _LIBCPP_NODEBUG typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
-};
-
-template <bool _IsTuple, class _SizeTrait, size_t _Expected>
-struct __tuple_like_with_size_imp : false_type {};
-
-template <class _SizeTrait, size_t _Expected>
-struct __tuple_like_with_size_imp<true, _SizeTrait, _Expected>
- : integral_constant<bool, _SizeTrait::value == _Expected> {};
-
-template <class _Tuple, size_t _ExpectedSize, class _RawTuple = __libcpp_remove_reference_t<_Tuple> >
-using __tuple_like_with_size _LIBCPP_NODEBUG = __tuple_like_with_size_imp<
- __tuple_like_ext<_RawTuple>::value,
- tuple_size<_RawTuple>, _ExpectedSize
- >;
-
-struct _LIBCPP_TYPE_VIS __check_tuple_constructor_fail {
-
- static constexpr bool __enable_explicit_default() { return false; }
- static constexpr bool __enable_implicit_default() { return false; }
- template <class ...>
- static constexpr bool __enable_explicit() { return false; }
- template <class ...>
- static constexpr bool __enable_implicit() { return false; }
- template <class ...>
- static constexpr bool __enable_assign() { return false; }
-};
-#endif // !defined(_LIBCPP_CXX03_LANG)
-
-#if _LIBCPP_STD_VER > 14
-
-template <bool _CanCopy, bool _CanMove>
-struct __sfinae_ctor_base {};
-template <>
-struct __sfinae_ctor_base<false, false> {
- __sfinae_ctor_base() = default;
- __sfinae_ctor_base(__sfinae_ctor_base const&) = delete;
- __sfinae_ctor_base(__sfinae_ctor_base &&) = delete;
- __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
- __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
-};
-template <>
-struct __sfinae_ctor_base<true, false> {
- __sfinae_ctor_base() = default;
- __sfinae_ctor_base(__sfinae_ctor_base const&) = default;
- __sfinae_ctor_base(__sfinae_ctor_base &&) = delete;
- __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
- __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
-};
-template <>
-struct __sfinae_ctor_base<false, true> {
- __sfinae_ctor_base() = default;
- __sfinae_ctor_base(__sfinae_ctor_base const&) = delete;
- __sfinae_ctor_base(__sfinae_ctor_base &&) = default;
- __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
- __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
-};
-
-template <bool _CanCopy, bool _CanMove>
-struct __sfinae_assign_base {};
-template <>
-struct __sfinae_assign_base<false, false> {
- __sfinae_assign_base() = default;
- __sfinae_assign_base(__sfinae_assign_base const&) = default;
- __sfinae_assign_base(__sfinae_assign_base &&) = default;
- __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
- __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete;
-};
-template <>
-struct __sfinae_assign_base<true, false> {
- __sfinae_assign_base() = default;
- __sfinae_assign_base(__sfinae_assign_base const&) = default;
- __sfinae_assign_base(__sfinae_assign_base &&) = default;
- __sfinae_assign_base& operator=(__sfinae_assign_base const&) = default;
- __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete;
-};
-template <>
-struct __sfinae_assign_base<false, true> {
- __sfinae_assign_base() = default;
- __sfinae_assign_base(__sfinae_assign_base const&) = default;
- __sfinae_assign_base(__sfinae_assign_base &&) = default;
- __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
- __sfinae_assign_base& operator=(__sfinae_assign_base&&) = default;
-};
-#endif // _LIBCPP_STD_VER > 14
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP___TUPLE_SFINAE_HELPERS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_element.h b/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_element.h
deleted file mode 100644
index 1ed996e80fe..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_element.h
+++ /dev/null
@@ -1,108 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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___TUPLE_TUPLE_ELEMENT_H
-#define _LIBCPP___TUPLE_TUPLE_ELEMENT_H
-
-#include <__config>
-#include <__tuple_dir/tuple_indices.h>
-#include <__tuple_dir/tuple_types.h>
-#include <__type_traits/add_const.h>
-#include <__type_traits/add_cv.h>
-#include <__type_traits/add_volatile.h>
-#include <cstddef>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <size_t _Ip, class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_element;
-
-template <size_t _Ip, class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const _Tp>
-{
- typedef _LIBCPP_NODEBUG typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type;
-};
-
-template <size_t _Ip, class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, volatile _Tp>
-{
- typedef _LIBCPP_NODEBUG typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type;
-};
-
-template <size_t _Ip, class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp>
-{
- typedef _LIBCPP_NODEBUG typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type;
-};
-
-#ifndef _LIBCPP_CXX03_LANG
-
-#if !__has_builtin(__type_pack_element)
-
-namespace __indexer_detail {
-
-template <size_t _Idx, class _Tp>
-struct __indexed { using type _LIBCPP_NODEBUG = _Tp; };
-
-template <class _Types, class _Indexes> struct __indexer;
-
-template <class ..._Types, size_t ..._Idx>
-struct __indexer<__tuple_types<_Types...>, __tuple_indices<_Idx...>>
- : __indexed<_Idx, _Types>...
-{};
-
-template <size_t _Idx, class _Tp>
-__indexed<_Idx, _Tp> __at_index(__indexed<_Idx, _Tp> const&);
-
-} // namespace __indexer_detail
-
-#if !defined(__CUDACC__) || !defined(_MSC_VER)
-template <size_t _Idx, class ..._Types>
-using __type_pack_element _LIBCPP_NODEBUG = typename decltype(
- __indexer_detail::__at_index<_Idx>(
- __indexer_detail::__indexer<
- __tuple_types<_Types...>,
- typename __make_tuple_indices<sizeof...(_Types)>::type
- >{})
- )::type;
-#else // !defined(__CUDACC__) || !defined(_MSC_VER)
-template <size_t _Idx, class ..._Types>
-struct __y_type_pack_element {
- using __t1 = typename __make_tuple_indices<sizeof...(_Types)>::type;
- using __t2 = __indexer_detail::__indexer<__tuple_types<_Types...>, __t1>;
- using __t3 = decltype(__indexer_detail::__at_index<_Idx>(__t2{}));
- using __t4 = typename __t3::type;
-};
-
-template <size_t _Idx, class ..._Types>
-using __type_pack_element = typename __y_type_pack_element<_Idx, _Types...>::__t4;
-
-#endif // !defined(__CUDACC__) || !defined(_MSC_VER)
-
-#endif // __has_builtin(__type_pack_element)
-
-template <size_t _Ip, class ..._Types>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...> >
-{
- static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range");
- typedef _LIBCPP_NODEBUG __type_pack_element<_Ip, _Types...> type;
-};
-
-#if _LIBCPP_STD_VER > 11
-template <size_t _Ip, class ..._Tp>
-using tuple_element_t _LIBCPP_NODEBUG = typename tuple_element <_Ip, _Tp...>::type;
-#endif
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP___TUPLE_TUPLE_ELEMENT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_like_ext.h b/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_like_ext.h
deleted file mode 100644
index bf986961127..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_like_ext.h
+++ /dev/null
@@ -1,44 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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___TUPLE_TUPLE_LIKE_EXT_H
-#define _LIBCPP___TUPLE_TUPLE_LIKE_EXT_H
-
-#include <__config>
-#include <__fwd/array.h>
-#include <__fwd/pair.h>
-#include <__fwd/tuple.h>
-#include <__tuple_dir/tuple_types.h>
-#include <__type_traits/integral_constant.h>
-#include <cstddef>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <class _Tp> struct __tuple_like_ext : false_type {};
-
-template <class _Tp> struct __tuple_like_ext<const _Tp> : public __tuple_like_ext<_Tp> {};
-template <class _Tp> struct __tuple_like_ext<volatile _Tp> : public __tuple_like_ext<_Tp> {};
-template <class _Tp> struct __tuple_like_ext<const volatile _Tp> : public __tuple_like_ext<_Tp> {};
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class... _Tp> struct __tuple_like_ext<tuple<_Tp...> > : true_type {};
-#endif
-
-template <class _T1, class _T2> struct __tuple_like_ext<pair<_T1, _T2> > : true_type {};
-
-template <class _Tp, size_t _Size> struct __tuple_like_ext<array<_Tp, _Size> > : true_type {};
-
-template <class... _Tp> struct __tuple_like_ext<__tuple_types<_Tp...> > : true_type {};
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP___TUPLE_TUPLE_LIKE_EXT_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_size.h b/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_size.h
deleted file mode 100644
index d551b2258cb..00000000000
--- a/contrib/libs/cxxsupp/libcxx/include/__tuple_dir/tuple_size.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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___TUPLE_TUPLE_SIZE_H
-#define _LIBCPP___TUPLE_TUPLE_SIZE_H
-
-#include <__config>
-#include <__fwd/tuple.h>
-#include <__tuple_dir/tuple_types.h>
-#include <__type_traits/is_const.h>
-#include <__type_traits/is_volatile.h>
-#include <cstddef>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size;
-
-#if !defined(_LIBCPP_CXX03_LANG)
-template <class _Tp, class...>
-using __enable_if_tuple_size_imp = _Tp;
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
- const _Tp,
- __enable_if_t<!is_volatile<_Tp>::value>,
- integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
- : public integral_constant<size_t, tuple_size<_Tp>::value> {};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
- volatile _Tp,
- __enable_if_t<!is_const<_Tp>::value>,
- integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
- : public integral_constant<size_t, tuple_size<_Tp>::value> {};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
- const volatile _Tp,
- integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
- : public integral_constant<size_t, tuple_size<_Tp>::value> {};
-
-#else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<const _Tp> : public tuple_size<_Tp> {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<volatile _Tp> : public tuple_size<_Tp> {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<const volatile _Tp> : public tuple_size<_Tp> {};
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class ..._Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<tuple<_Tp...> >
- : public integral_constant<size_t, sizeof...(_Tp)>
-{
-};
-
-template <class ..._Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<__tuple_types<_Tp...> >
- : public integral_constant<size_t, sizeof...(_Tp)>
-{
-};
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP___TUPLE_TUPLE_SIZE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_const.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_const.h
index c616a13f840..9a6f1c10299 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_const.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_const.h
@@ -17,12 +17,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_const {
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS add_const {
typedef _LIBCPP_NODEBUG const _Tp type;
};
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using add_const_t = typename add_const<_Tp>::type;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using add_const_t = typename add_const<_Tp>::type;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_cv.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_cv.h
index 8a85353f16c..9e23e5ceb7a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_cv.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_cv.h
@@ -17,12 +17,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_cv {
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS add_cv {
typedef _LIBCPP_NODEBUG const volatile _Tp type;
};
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using add_cv_t = typename add_cv<_Tp>::type;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using add_cv_t = typename add_cv<_Tp>::type;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_lvalue_reference.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_lvalue_reference.h
index daa5cb9e7df..a633e390453 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_lvalue_reference.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_lvalue_reference.h
@@ -44,8 +44,9 @@ struct add_lvalue_reference {
using type _LIBCPP_NODEBUG = __add_lvalue_reference_t<_Tp>;
};
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using add_lvalue_reference_t = __add_lvalue_reference_t<_Tp>;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using add_lvalue_reference_t = __add_lvalue_reference_t<_Tp>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_pointer.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_pointer.h
index 1af5eca65c6..358e3cbd238 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_pointer.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_pointer.h
@@ -28,13 +28,14 @@ template <class _Tp>
using __add_pointer_t = __add_pointer(_Tp);
#else
-template <class _Tp,
- bool = __libcpp_is_referenceable<_Tp>::value || is_void<_Tp>::value>
+template <class _Tp, bool = __libcpp_is_referenceable<_Tp>::value || is_void<_Tp>::value>
struct __add_pointer_impl {
typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tp>* type;
};
-template <class _Tp> struct __add_pointer_impl<_Tp, false>
- {typedef _LIBCPP_NODEBUG _Tp type;};
+template <class _Tp>
+struct __add_pointer_impl<_Tp, false> {
+ typedef _LIBCPP_NODEBUG _Tp type;
+};
template <class _Tp>
using __add_pointer_t = typename __add_pointer_impl<_Tp>::type;
@@ -46,8 +47,9 @@ struct add_pointer {
using type _LIBCPP_NODEBUG = __add_pointer_t<_Tp>;
};
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using add_pointer_t = __add_pointer_t<_Tp>;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using add_pointer_t = __add_pointer_t<_Tp>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_rvalue_reference.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_rvalue_reference.h
index 098e84c0722..a54aae7ec8d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_rvalue_reference.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_rvalue_reference.h
@@ -44,7 +44,7 @@ struct add_rvalue_reference {
using type = __add_rvalue_reference_t<_Tp>;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp>
using add_rvalue_reference_t = __add_rvalue_reference_t<_Tp>;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_volatile.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_volatile.h
index 73b1cb8418f..56b7dfaac02 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_volatile.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/add_volatile.h
@@ -17,12 +17,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_volatile {
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS add_volatile {
typedef _LIBCPP_NODEBUG volatile _Tp type;
};
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using add_volatile_t = typename add_volatile<_Tp>::type;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using add_volatile_t = typename add_volatile<_Tp>::type;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/aligned_storage.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/aligned_storage.h
index c564d582452..46aae12832f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/aligned_storage.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/aligned_storage.h
@@ -23,59 +23,63 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
-struct __align_type
-{
- static const size_t value = _LIBCPP_PREFERRED_ALIGNOF(_Tp);
- typedef _Tp type;
+struct __align_type {
+ static const size_t value = _LIBCPP_PREFERRED_ALIGNOF(_Tp);
+ typedef _Tp type;
};
-struct __struct_double {long double __lx;};
-struct __struct_double4 {double __lx[4];};
-
-typedef
- __type_list<__align_type<unsigned char>,
- __type_list<__align_type<unsigned short>,
- __type_list<__align_type<unsigned int>,
- __type_list<__align_type<unsigned long>,
- __type_list<__align_type<unsigned long long>,
- __type_list<__align_type<double>,
- __type_list<__align_type<long double>,
- __type_list<__align_type<__struct_double>,
- __type_list<__align_type<__struct_double4>,
- __type_list<__align_type<int*>,
- __nat
- > > > > > > > > > > __all_types;
+struct __struct_double {
+ long double __lx;
+};
+struct __struct_double4 {
+ double __lx[4];
+};
+
+// clang-format off
+typedef __type_list<__align_type<unsigned char>,
+ __type_list<__align_type<unsigned short>,
+ __type_list<__align_type<unsigned int>,
+ __type_list<__align_type<unsigned long>,
+ __type_list<__align_type<unsigned long long>,
+ __type_list<__align_type<double>,
+ __type_list<__align_type<long double>,
+ __type_list<__align_type<__struct_double>,
+ __type_list<__align_type<__struct_double4>,
+ __type_list<__align_type<int*>,
+ __nat
+ > > > > > > > > > > __all_types;
+// clang-format on
template <size_t _Align>
struct _ALIGNAS(_Align) __fallback_overaligned {};
-template <class _TL, size_t _Align> struct __find_pod;
+template <class _TL, size_t _Align>
+struct __find_pod;
template <class _Hp, size_t _Align>
-struct __find_pod<__type_list<_Hp, __nat>, _Align>
-{
- typedef __conditional_t<_Align == _Hp::value, typename _Hp::type, __fallback_overaligned<_Align> > type;
+struct __find_pod<__type_list<_Hp, __nat>, _Align> {
+ typedef __conditional_t<_Align == _Hp::value, typename _Hp::type, __fallback_overaligned<_Align> > type;
};
template <class _Hp, class _Tp, size_t _Align>
-struct __find_pod<__type_list<_Hp, _Tp>, _Align>
-{
- typedef __conditional_t<_Align == _Hp::value, typename _Hp::type, typename __find_pod<_Tp, _Align>::type> type;
+struct __find_pod<__type_list<_Hp, _Tp>, _Align> {
+ typedef __conditional_t<_Align == _Hp::value, typename _Hp::type, typename __find_pod<_Tp, _Align>::type> type;
};
-template <class _TL, size_t _Len> struct __find_max_align;
+template <class _TL, size_t _Len>
+struct __find_max_align;
template <class _Hp, size_t _Len>
struct __find_max_align<__type_list<_Hp, __nat>, _Len> : public integral_constant<size_t, _Hp::value> {};
template <size_t _Len, size_t _A1, size_t _A2>
-struct __select_align
-{
+struct __select_align {
private:
- static const size_t __min = _A2 < _A1 ? _A2 : _A1;
- static const size_t __max = _A1 < _A2 ? _A2 : _A1;
+ static const size_t __min = _A2 < _A1 ? _A2 : _A1;
+ static const size_t __max = _A1 < _A2 ? _A2 : _A1;
+
public:
- static const size_t value = _Len < __max ? __min : __max;
+ static const size_t value = _Len < __max ? __min : __max;
};
template <class _Hp, class _Tp, size_t _Len>
@@ -83,34 +87,30 @@ struct __find_max_align<__type_list<_Hp, _Tp>, _Len>
: public integral_constant<size_t, __select_align<_Len, _Hp::value, __find_max_align<_Tp, _Len>::value>::value> {};
template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
-struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_TEMPLATE_VIS aligned_storage
-{
- typedef typename __find_pod<__all_types, _Align>::type _Aligner;
- union type
- {
- _Aligner __align;
- unsigned char __data[(_Len + _Align - 1)/_Align * _Align];
- };
+struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_TEMPLATE_VIS aligned_storage {
+ typedef typename __find_pod<__all_types, _Align>::type _Aligner;
+ union type {
+ _Aligner __align;
+ unsigned char __data[(_Len + _Align - 1) / _Align * _Align];
+ };
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
- _LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
- using aligned_storage_t _LIBCPP_DEPRECATED_IN_CXX23 = typename aligned_storage<_Len, _Align>::type;
- _LIBCPP_SUPPRESS_DEPRECATED_POP
+using aligned_storage_t _LIBCPP_DEPRECATED_IN_CXX23 = typename aligned_storage<_Len, _Align>::type;
+_LIBCPP_SUPPRESS_DEPRECATED_POP
#endif
-#define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \
-template <size_t _Len>\
-struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_TEMPLATE_VIS aligned_storage<_Len, n>\
-{\
- struct _ALIGNAS(n) type\
- {\
- unsigned char __lx[(_Len + n - 1)/n * n];\
- };\
-}
+#define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \
+ template <size_t _Len> \
+ struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_TEMPLATE_VIS aligned_storage<_Len, n> { \
+ struct _ALIGNAS(n) type { \
+ unsigned char __lx[(_Len + n - 1) / n * n]; \
+ }; \
+ }
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1);
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x2);
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/aligned_union.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/aligned_union.h
index 2c64130da30..005ed9a096e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/aligned_union.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/aligned_union.h
@@ -20,33 +20,28 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <size_t _I0, size_t ..._In>
+template <size_t _I0, size_t... _In>
struct __static_max;
template <size_t _I0>
-struct __static_max<_I0>
-{
- static const size_t value = _I0;
+struct __static_max<_I0> {
+ static const size_t value = _I0;
};
-template <size_t _I0, size_t _I1, size_t ..._In>
-struct __static_max<_I0, _I1, _In...>
-{
- static const size_t value = _I0 >= _I1 ? __static_max<_I0, _In...>::value :
- __static_max<_I1, _In...>::value;
+template <size_t _I0, size_t _I1, size_t... _In>
+struct __static_max<_I0, _I1, _In...> {
+ static const size_t value = _I0 >= _I1 ? __static_max<_I0, _In...>::value : __static_max<_I1, _In...>::value;
};
-template <size_t _Len, class _Type0, class ..._Types>
-struct _LIBCPP_DEPRECATED_IN_CXX23 aligned_union
-{
- static const size_t alignment_value = __static_max<_LIBCPP_PREFERRED_ALIGNOF(_Type0),
- _LIBCPP_PREFERRED_ALIGNOF(_Types)...>::value;
- static const size_t __len = __static_max<_Len, sizeof(_Type0),
- sizeof(_Types)...>::value;
- typedef typename aligned_storage<__len, alignment_value>::type type;
+template <size_t _Len, class _Type0, class... _Types>
+struct _LIBCPP_DEPRECATED_IN_CXX23 aligned_union {
+ static const size_t alignment_value =
+ __static_max<_LIBCPP_PREFERRED_ALIGNOF(_Type0), _LIBCPP_PREFERRED_ALIGNOF(_Types)...>::value;
+ static const size_t __len = __static_max<_Len, sizeof(_Type0), sizeof(_Types)...>::value;
+ typedef typename aligned_storage<__len, alignment_value>::type type;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <size_t _Len, class... _Types>
using aligned_union_t _LIBCPP_DEPRECATED_IN_CXX23 = typename aligned_union<_Len, _Types...>::type;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/alignment_of.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/alignment_of.h
index 45b4cbcc2d7..f2d069bf248 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/alignment_of.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/alignment_of.h
@@ -19,10 +19,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS alignment_of
- : public integral_constant<size_t, _LIBCPP_ALIGNOF(_Tp)> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS alignment_of : public integral_constant<size_t, _LIBCPP_ALIGNOF(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr size_t alignment_of_v = _LIBCPP_ALIGNOF(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/apply_cv.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/apply_cv.h
index 680ff6ac7d9..7c6aabec834 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/apply_cv.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/apply_cv.h
@@ -13,7 +13,6 @@
#include <__type_traits/is_const.h>
#include <__type_traits/is_volatile.h>
#include <__type_traits/remove_reference.h>
-#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -21,55 +20,59 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp, class _Up, bool = is_const<__libcpp_remove_reference_t<_Tp> >::value,
- bool = is_volatile<__libcpp_remove_reference_t<_Tp> >::value>
-struct __apply_cv
-{
- typedef _LIBCPP_NODEBUG _Up type;
+template <class _Tp,
+ bool = is_const<__libcpp_remove_reference_t<_Tp> >::value,
+ bool = is_volatile<__libcpp_remove_reference_t<_Tp> >::value>
+struct __apply_cv_impl {
+ template <class _Up>
+ using __apply _LIBCPP_NODEBUG = _Up;
};
-template <class _Tp, class _Up>
-struct __apply_cv<_Tp, _Up, true, false>
-{
- typedef _LIBCPP_NODEBUG const _Up type;
+template <class _Tp>
+struct __apply_cv_impl<_Tp, true, false> {
+ template <class _Up>
+ using __apply _LIBCPP_NODEBUG = const _Up;
};
-template <class _Tp, class _Up>
-struct __apply_cv<_Tp, _Up, false, true>
-{
- typedef volatile _Up type;
+template <class _Tp>
+struct __apply_cv_impl<_Tp, false, true> {
+ template <class _Up>
+ using __apply _LIBCPP_NODEBUG = volatile _Up;
};
-template <class _Tp, class _Up>
-struct __apply_cv<_Tp, _Up, true, true>
-{
- typedef const volatile _Up type;
+template <class _Tp>
+struct __apply_cv_impl<_Tp, true, true> {
+ template <class _Up>
+ using __apply _LIBCPP_NODEBUG = const volatile _Up;
};
-template <class _Tp, class _Up>
-struct __apply_cv<_Tp&, _Up, false, false>
-{
- typedef _Up& type;
+template <class _Tp>
+struct __apply_cv_impl<_Tp&, false, false> {
+ template <class _Up>
+ using __apply _LIBCPP_NODEBUG = _Up&;
};
-template <class _Tp, class _Up>
-struct __apply_cv<_Tp&, _Up, true, false>
-{
- typedef const _Up& type;
+template <class _Tp>
+struct __apply_cv_impl<_Tp&, true, false> {
+ template <class _Up>
+ using __apply _LIBCPP_NODEBUG = const _Up&;
};
-template <class _Tp, class _Up>
-struct __apply_cv<_Tp&, _Up, false, true>
-{
- typedef volatile _Up& type;
+template <class _Tp>
+struct __apply_cv_impl<_Tp&, false, true> {
+ template <class _Up>
+ using __apply _LIBCPP_NODEBUG = volatile _Up&;
};
-template <class _Tp, class _Up>
-struct __apply_cv<_Tp&, _Up, true, true>
-{
- typedef const volatile _Up& type;
+template <class _Tp>
+struct __apply_cv_impl<_Tp&, true, true> {
+ template <class _Up>
+ using __apply _LIBCPP_NODEBUG = const volatile _Up&;
};
+template <class _Tp, class _Up>
+using __apply_cv_t _LIBCPP_NODEBUG = typename __apply_cv_impl<_Tp>::template __apply<_Up>;
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___TYPE_TRAITS_APPLY_CV_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/can_extract_key.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/can_extract_key.h
index 454c56bfae9..b8359d07088 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/can_extract_key.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/can_extract_key.h
@@ -40,16 +40,13 @@ struct __can_extract_key<_Pair, _Key, pair<_First, _Second> >
// __can_extract_map_key uses true_type/false_type instead of the tags.
// It returns true if _Key != _ContainerValueTy (the container is a map not a set)
// and _ValTy == _Key.
-template <class _ValTy, class _Key, class _ContainerValueTy,
- class _RawValTy = __remove_const_ref_t<_ValTy> >
-struct __can_extract_map_key
- : integral_constant<bool, _IsSame<_RawValTy, _Key>::value> {};
+template <class _ValTy, class _Key, class _ContainerValueTy, class _RawValTy = __remove_const_ref_t<_ValTy> >
+struct __can_extract_map_key : integral_constant<bool, _IsSame<_RawValTy, _Key>::value> {};
// This specialization returns __extract_key_fail_tag for non-map containers
// because _Key == _ContainerValueTy
template <class _ValTy, class _Key, class _RawValTy>
-struct __can_extract_map_key<_ValTy, _Key, _Key, _RawValTy>
- : false_type {};
+struct __can_extract_map_key<_ValTy, _Key, _Key, _RawValTy> : false_type {};
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/common_reference.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/common_reference.h
index f9195865c89..c802902eb19 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/common_reference.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/common_reference.h
@@ -27,11 +27,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
// common_reference
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// Let COND_RES(X, Y) be:
template <class _Xp, class _Yp>
-using __cond_res =
- decltype(false ? std::declval<_Xp(&)()>()() : std::declval<_Yp(&)()>()());
+using __cond_res = decltype(false ? std::declval<_Xp (&)()>()() : std::declval<_Yp (&)()>()());
// Let `XREF(A)` denote a unary alias template `T` such that `T<U>` denotes the same type as `U`
// with the addition of `A`'s cv and reference qualifiers, for a non-reference cv-unqualified type
@@ -39,47 +38,49 @@ using __cond_res =
// [Note: `XREF(A)` is `__xref<A>::template __apply`]
template <class _Tp>
struct __xref {
- template<class _Up>
+ template <class _Up>
using __apply = __copy_cvref_t<_Tp, _Up>;
};
// Given types A and B, let X be remove_reference_t<A>, let Y be remove_reference_t<B>,
// and let COMMON-REF(A, B) be:
-template<class _Ap, class _Bp, class _Xp = remove_reference_t<_Ap>, class _Yp = remove_reference_t<_Bp>>
+template <class _Ap, class _Bp, class _Xp = remove_reference_t<_Ap>, class _Yp = remove_reference_t<_Bp>>
struct __common_ref;
-template<class _Xp, class _Yp>
+template <class _Xp, class _Yp>
using __common_ref_t = typename __common_ref<_Xp, _Yp>::__type;
-template<class _Xp, class _Yp>
+template <class _Xp, class _Yp>
using __cv_cond_res = __cond_res<__copy_cv_t<_Xp, _Yp>&, __copy_cv_t<_Yp, _Xp>&>;
-
// If A and B are both lvalue reference types, COMMON-REF(A, B) is
// COND-RES(COPYCV(X, Y)&, COPYCV(Y, X)&) if that type exists and is a reference type.
-template<class _Ap, class _Bp, class _Xp, class _Yp>
-requires requires { typename __cv_cond_res<_Xp, _Yp>; } && is_reference_v<__cv_cond_res<_Xp, _Yp>>
-struct __common_ref<_Ap&, _Bp&, _Xp, _Yp>
-{
- using __type = __cv_cond_res<_Xp, _Yp>;
+// clang-format off
+template <class _Ap, class _Bp, class _Xp, class _Yp>
+ requires
+ requires { typename __cv_cond_res<_Xp, _Yp>; } &&
+ is_reference_v<__cv_cond_res<_Xp, _Yp>>
+struct __common_ref<_Ap&, _Bp&, _Xp, _Yp> {
+ using __type = __cv_cond_res<_Xp, _Yp>;
};
+// clang-format on
// Otherwise, let C be remove_reference_t<COMMON-REF(X&, Y&)>&&. ...
template <class _Xp, class _Yp>
using __common_ref_C = remove_reference_t<__common_ref_t<_Xp&, _Yp&>>&&;
-
// .... If A and B are both rvalue reference types, C is well-formed, and
// is_convertible_v<A, C> && is_convertible_v<B, C> is true, then COMMON-REF(A, B) is C.
-template<class _Ap, class _Bp, class _Xp, class _Yp>
-requires
- requires { typename __common_ref_C<_Xp, _Yp>; } &&
- is_convertible_v<_Ap&&, __common_ref_C<_Xp, _Yp>> &&
- is_convertible_v<_Bp&&, __common_ref_C<_Xp, _Yp>>
-struct __common_ref<_Ap&&, _Bp&&, _Xp, _Yp>
-{
- using __type = __common_ref_C<_Xp, _Yp>;
+// clang-format off
+template <class _Ap, class _Bp, class _Xp, class _Yp>
+ requires
+ requires { typename __common_ref_C<_Xp, _Yp>; } &&
+ is_convertible_v<_Ap&&, __common_ref_C<_Xp, _Yp>> &&
+ is_convertible_v<_Bp&&, __common_ref_C<_Xp, _Yp>>
+struct __common_ref<_Ap&&, _Bp&&, _Xp, _Yp> {
+ using __type = __common_ref_C<_Xp, _Yp>;
};
+// clang-format on
// Otherwise, let D be COMMON-REF(const X&, Y&). ...
template <class _Tp, class _Up>
@@ -87,21 +88,23 @@ using __common_ref_D = __common_ref_t<const _Tp&, _Up&>;
// ... If A is an rvalue reference and B is an lvalue reference and D is well-formed and
// is_convertible_v<A, D> is true, then COMMON-REF(A, B) is D.
-template<class _Ap, class _Bp, class _Xp, class _Yp>
-requires requires { typename __common_ref_D<_Xp, _Yp>; } &&
- is_convertible_v<_Ap&&, __common_ref_D<_Xp, _Yp>>
-struct __common_ref<_Ap&&, _Bp&, _Xp, _Yp>
-{
- using __type = __common_ref_D<_Xp, _Yp>;
+// clang-format off
+template <class _Ap, class _Bp, class _Xp, class _Yp>
+ requires
+ requires { typename __common_ref_D<_Xp, _Yp>; } &&
+ is_convertible_v<_Ap&&, __common_ref_D<_Xp, _Yp>>
+struct __common_ref<_Ap&&, _Bp&, _Xp, _Yp> {
+ using __type = __common_ref_D<_Xp, _Yp>;
};
+// clang-format on
// Otherwise, if A is an lvalue reference and B is an rvalue reference, then
// COMMON-REF(A, B) is COMMON-REF(B, A).
-template<class _Ap, class _Bp, class _Xp, class _Yp>
+template <class _Ap, class _Bp, class _Xp, class _Yp>
struct __common_ref<_Ap&, _Bp&&, _Xp, _Yp> : __common_ref<_Bp&&, _Ap&> {};
// Otherwise, COMMON-REF(A, B) is ill-formed.
-template<class _Ap, class _Bp, class _Xp, class _Yp>
+template <class _Ap, class _Bp, class _Xp, class _Yp>
struct __common_ref {};
// Note C: For the common_reference trait applied to a parameter pack [...]
@@ -113,75 +116,77 @@ template <class... _Types>
using common_reference_t = typename common_reference<_Types...>::type;
// bullet 1 - sizeof...(T) == 0
-template<>
+template <>
struct common_reference<> {};
// bullet 2 - sizeof...(T) == 1
template <class _Tp>
-struct common_reference<_Tp>
-{
- using type = _Tp;
+struct common_reference<_Tp> {
+ using type = _Tp;
};
// bullet 3 - sizeof...(T) == 2
-template <class _Tp, class _Up> struct __common_reference_sub_bullet3;
-template <class _Tp, class _Up> struct __common_reference_sub_bullet2 : __common_reference_sub_bullet3<_Tp, _Up> {};
-template <class _Tp, class _Up> struct __common_reference_sub_bullet1 : __common_reference_sub_bullet2<_Tp, _Up> {};
+template <class _Tp, class _Up>
+struct __common_reference_sub_bullet3;
+template <class _Tp, class _Up>
+struct __common_reference_sub_bullet2 : __common_reference_sub_bullet3<_Tp, _Up> {};
+template <class _Tp, class _Up>
+struct __common_reference_sub_bullet1 : __common_reference_sub_bullet2<_Tp, _Up> {};
// sub-bullet 1 - If T1 and T2 are reference types and COMMON-REF(T1, T2) is well-formed, then
// the member typedef `type` denotes that type.
-template <class _Tp, class _Up> struct common_reference<_Tp, _Up> : __common_reference_sub_bullet1<_Tp, _Up> {};
+template <class _Tp, class _Up>
+struct common_reference<_Tp, _Up> : __common_reference_sub_bullet1<_Tp, _Up> {};
template <class _Tp, class _Up>
-requires is_reference_v<_Tp> && is_reference_v<_Up> && requires { typename __common_ref_t<_Tp, _Up>; }
-struct __common_reference_sub_bullet1<_Tp, _Up>
-{
- using type = __common_ref_t<_Tp, _Up>;
+ requires is_reference_v<_Tp> && is_reference_v<_Up> && requires { typename __common_ref_t<_Tp, _Up>; }
+struct __common_reference_sub_bullet1<_Tp, _Up> {
+ using type = __common_ref_t<_Tp, _Up>;
};
// sub-bullet 2 - Otherwise, if basic_common_reference<remove_cvref_t<T1>, remove_cvref_t<T2>, XREF(T1), XREF(T2)>::type
// is well-formed, then the member typedef `type` denotes that type.
-template <class, class, template <class> class, template <class> class> struct basic_common_reference {};
+template <class, class, template <class> class, template <class> class>
+struct basic_common_reference {};
template <class _Tp, class _Up>
-using __basic_common_reference_t = typename basic_common_reference<
- remove_cvref_t<_Tp>, remove_cvref_t<_Up>,
- __xref<_Tp>::template __apply, __xref<_Up>::template __apply>::type;
+using __basic_common_reference_t =
+ typename basic_common_reference<remove_cvref_t<_Tp>,
+ remove_cvref_t<_Up>,
+ __xref<_Tp>::template __apply,
+ __xref<_Up>::template __apply>::type;
template <class _Tp, class _Up>
-requires requires { typename __basic_common_reference_t<_Tp, _Up>; }
-struct __common_reference_sub_bullet2<_Tp, _Up>
-{
- using type = __basic_common_reference_t<_Tp, _Up>;
+ requires requires { typename __basic_common_reference_t<_Tp, _Up>; }
+struct __common_reference_sub_bullet2<_Tp, _Up> {
+ using type = __basic_common_reference_t<_Tp, _Up>;
};
// sub-bullet 3 - Otherwise, if COND-RES(T1, T2) is well-formed,
// then the member typedef `type` denotes that type.
template <class _Tp, class _Up>
-requires requires { typename __cond_res<_Tp, _Up>; }
-struct __common_reference_sub_bullet3<_Tp, _Up>
-{
- using type = __cond_res<_Tp, _Up>;
+ requires requires { typename __cond_res<_Tp, _Up>; }
+struct __common_reference_sub_bullet3<_Tp, _Up> {
+ using type = __cond_res<_Tp, _Up>;
};
-
// sub-bullet 4 & 5 - Otherwise, if common_type_t<T1, T2> is well-formed,
// then the member typedef `type` denotes that type.
// - Otherwise, there shall be no member `type`.
-template <class _Tp, class _Up> struct __common_reference_sub_bullet3 : common_type<_Tp, _Up> {};
+template <class _Tp, class _Up>
+struct __common_reference_sub_bullet3 : common_type<_Tp, _Up> {};
// bullet 4 - If there is such a type `C`, the member typedef type shall denote the same type, if
// any, as `common_reference_t<C, Rest...>`.
template <class _Tp, class _Up, class _Vp, class... _Rest>
-requires requires { typename common_reference_t<_Tp, _Up>; }
-struct common_reference<_Tp, _Up, _Vp, _Rest...>
- : common_reference<common_reference_t<_Tp, _Up>, _Vp, _Rest...>
-{};
+ requires requires { typename common_reference_t<_Tp, _Up>; }
+struct common_reference<_Tp, _Up, _Vp, _Rest...> : common_reference<common_reference_t<_Tp, _Up>, _Vp, _Rest...> {};
// bullet 5 - Otherwise, there shall be no member `type`.
-template <class...> struct common_reference {};
+template <class...>
+struct common_reference {};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/common_type.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/common_type.h
index 6d2df6c9b3e..7f86fcaaace 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/common_type.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/common_type.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// Let COND_RES(X, Y) be:
template <class _Tp, class _Up>
using __cond_type = decltype(false ? std::declval<_Tp>() : std::declval<_Up>());
@@ -33,9 +33,8 @@ struct __common_type3 {};
// sub-bullet 4 - "if COND_RES(CREF(D1), CREF(D2)) denotes a type..."
template <class _Tp, class _Up>
-struct __common_type3<_Tp, _Up, void_t<__cond_type<const _Tp&, const _Up&>>>
-{
- using type = remove_cvref_t<__cond_type<const _Tp&, const _Up&>>;
+struct __common_type3<_Tp, _Up, void_t<__cond_type<const _Tp&, const _Up&>>> {
+ using type = remove_cvref_t<__cond_type<const _Tp&, const _Up&>>;
};
template <class _Tp, class _Up, class = void>
@@ -47,50 +46,26 @@ struct __common_type2_imp {};
// sub-bullet 3 - "if decay_t<decltype(false ? declval<D1>() : declval<D2>())> ..."
template <class _Tp, class _Up>
-struct __common_type2_imp<_Tp, _Up, __void_t<decltype(true ? std::declval<_Tp>() : std::declval<_Up>())> >
-{
- typedef _LIBCPP_NODEBUG typename decay<decltype(
- true ? std::declval<_Tp>() : std::declval<_Up>()
- )>::type type;
+struct __common_type2_imp<_Tp, _Up, __void_t<decltype(true ? std::declval<_Tp>() : std::declval<_Up>())> > {
+ typedef _LIBCPP_NODEBUG __decay_t<decltype(true ? std::declval<_Tp>() : std::declval<_Up>())> type;
};
template <class, class = void>
struct __common_type_impl {};
-// Clang provides variadic templates in C++03 as an extension.
-#if !defined(_LIBCPP_CXX03_LANG) || defined(__clang__)
-# define _LIBCPP_OPTIONAL_PACK(...) , __VA_ARGS__
template <class... _Tp>
struct __common_types;
template <class... _Tp>
struct _LIBCPP_TEMPLATE_VIS common_type;
-#else
-# define _LIBCPP_OPTIONAL_PACK(...)
-struct __no_arg;
-template <class _Tp, class _Up, class = __no_arg>
-struct __common_types;
-template <class _Tp = __no_arg, class _Up = __no_arg, class _Vp = __no_arg,
- class _Unused = __no_arg>
-struct common_type {
- static_assert(sizeof(_Unused) == 0,
- "common_type accepts at most 3 arguments in C++03");
-};
-#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Up>
-struct __common_type_impl<
- __common_types<_Tp, _Up>, __void_t<typename common_type<_Tp, _Up>::type> >
-{
+struct __common_type_impl< __common_types<_Tp, _Up>, __void_t<typename common_type<_Tp, _Up>::type> > {
typedef typename common_type<_Tp, _Up>::type type;
};
-template <class _Tp, class _Up, class _Vp _LIBCPP_OPTIONAL_PACK(class... _Rest)>
-struct __common_type_impl<
- __common_types<_Tp, _Up, _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)>,
- __void_t<typename common_type<_Tp, _Up>::type> >
- : __common_type_impl<__common_types<typename common_type<_Tp, _Up>::type,
- _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)> > {
-};
+template <class _Tp, class _Up, class _Vp, class... _Rest>
+struct __common_type_impl<__common_types<_Tp, _Up, _Vp, _Rest...>, __void_t<typename common_type<_Tp, _Up>::type> >
+ : __common_type_impl<__common_types<typename common_type<_Tp, _Up>::type, _Vp, _Rest...> > {};
// bullet 1 - sizeof...(Tp) == 0
@@ -100,33 +75,26 @@ struct _LIBCPP_TEMPLATE_VIS common_type<> {};
// bullet 2 - sizeof...(Tp) == 1
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS common_type<_Tp>
- : public common_type<_Tp, _Tp> {};
+struct _LIBCPP_TEMPLATE_VIS common_type<_Tp> : public common_type<_Tp, _Tp> {};
// bullet 3 - sizeof...(Tp) == 2
// sub-bullet 1 - "If is_same_v<T1, D1> is false or ..."
template <class _Tp, class _Up>
struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up>
- : conditional<
- _IsSame<_Tp, typename decay<_Tp>::type>::value && _IsSame<_Up, typename decay<_Up>::type>::value,
- __common_type2_imp<_Tp, _Up>,
- common_type<typename decay<_Tp>::type, typename decay<_Up>::type>
- >::type
-{};
+ : conditional<_IsSame<_Tp, __decay_t<_Tp> >::value && _IsSame<_Up, __decay_t<_Up> >::value,
+ __common_type2_imp<_Tp, _Up>,
+ common_type<__decay_t<_Tp>, __decay_t<_Up> > >::type {};
// bullet 4 - sizeof...(Tp) > 2
-template <class _Tp, class _Up, class _Vp _LIBCPP_OPTIONAL_PACK(class... _Rest)>
-struct _LIBCPP_TEMPLATE_VIS
- common_type<_Tp, _Up, _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)>
- : __common_type_impl<
- __common_types<_Tp, _Up, _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)> > {};
-
-#undef _LIBCPP_OPTIONAL_PACK
+template <class _Tp, class _Up, class _Vp, class... _Rest>
+struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up, _Vp, _Rest...>
+ : __common_type_impl<__common_types<_Tp, _Up, _Vp, _Rest...> > {};
-#if _LIBCPP_STD_VER > 11
-template <class ..._Tp> using common_type_t = typename common_type<_Tp...>::type;
+#if _LIBCPP_STD_VER >= 14
+template <class... _Tp>
+using common_type_t = typename common_type<_Tp...>::type;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/conditional.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/conditional.h
index 6249812a111..5b5445a8374 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/conditional.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/conditional.h
@@ -44,7 +44,7 @@ struct _LIBCPP_TEMPLATE_VIS conditional<false, _If, _Then> {
using type _LIBCPP_NODEBUG = _Then;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <bool _Bp, class _IfRes, class _ElseRes>
using conditional_t _LIBCPP_NODEBUG = typename conditional<_Bp, _IfRes, _ElseRes>::type;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/conjunction.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/conjunction.h
index 0d95347e998..4bfa5a27300 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/conjunction.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/conjunction.h
@@ -37,7 +37,7 @@ false_type __and_helper(...);
template <class... _Pred>
using _And _LIBCPP_NODEBUG = decltype(std::__and_helper<_Pred...>(0));
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class...>
struct conjunction : true_type {};
@@ -51,7 +51,7 @@ struct conjunction<_Arg, _Args...> : conditional_t<!bool(_Arg::value), _Arg, con
template <class... _Args>
inline constexpr bool conjunction_v = conjunction<_Args...>::value;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cv.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cv.h
index 8e9bfe0a522..3c4ee857f7b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cv.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cv.h
@@ -23,27 +23,23 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// Let COPYCV(FROM, TO) be an alias for type TO with the addition of FROM's
// top-level cv-qualifiers.
template <class _From, class _To>
-struct __copy_cv
-{
- using type = _To;
+struct __copy_cv {
+ using type = _To;
};
template <class _From, class _To>
-struct __copy_cv<const _From, _To>
-{
- using type = typename add_const<_To>::type;
+struct __copy_cv<const _From, _To> {
+ using type = typename add_const<_To>::type;
};
template <class _From, class _To>
-struct __copy_cv<volatile _From, _To>
-{
- using type = typename add_volatile<_To>::type;
+struct __copy_cv<volatile _From, _To> {
+ using type = typename add_volatile<_To>::type;
};
template <class _From, class _To>
-struct __copy_cv<const volatile _From, _To>
-{
- using type = typename add_cv<_To>::type;
+struct __copy_cv<const volatile _From, _To> {
+ using type = typename add_cv<_To>::type;
};
template <class _From, class _To>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cvref.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cvref.h
index 8ec59b95a0a..8bbf8efdf44 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cvref.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/copy_cvref.h
@@ -21,21 +21,18 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _From, class _To>
-struct __copy_cvref
-{
- using type = __copy_cv_t<_From, _To>;
+struct __copy_cvref {
+ using type = __copy_cv_t<_From, _To>;
};
template <class _From, class _To>
-struct __copy_cvref<_From&, _To>
-{
- using type = __add_lvalue_reference_t<__copy_cv_t<_From, _To> >;
+struct __copy_cvref<_From&, _To> {
+ using type = __add_lvalue_reference_t<__copy_cv_t<_From, _To> >;
};
template <class _From, class _To>
-struct __copy_cvref<_From&&, _To>
-{
- using type = __add_rvalue_reference_t<__copy_cv_t<_From, _To> >;
+struct __copy_cvref<_From&&, _To> {
+ using type = __add_rvalue_reference_t<__copy_cv_t<_From, _To> >;
};
template <class _From, class _To>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/datasizeof.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/datasizeof.h
new file mode 100644
index 00000000000..019099a9cf1
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/datasizeof.h
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___TYPE_TRAITS_DATASIZEOF_H
+#define _LIBCPP___TYPE_TRAITS_DATASIZEOF_H
+
+#include <__config>
+#include <__type_traits/is_class.h>
+#include <__type_traits/is_final.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+// This trait provides the size of a type excluding any tail padding.
+//
+// It is useful in contexts where performing an operation using the full size of the class (including padding) may
+// have unintended side effects, such as overwriting a derived class' member when writing the tail padding of a class
+// through a pointer-to-base.
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct __libcpp_datasizeof {
+#if __has_cpp_attribute(__no_unique_address__)
+ template <class = char>
+ struct _FirstPaddingByte {
+ [[__no_unique_address__]] _Tp __v_;
+ char __first_padding_byte_;
+ };
+#else
+ template <bool = __libcpp_is_final<_Tp>::value || !is_class<_Tp>::value>
+ struct _FirstPaddingByte : _Tp {
+ char __first_padding_byte_;
+ };
+
+ template <>
+ struct _FirstPaddingByte<true> {
+ _Tp __v_;
+ char __first_padding_byte_;
+ };
+#endif
+
+ static const size_t value = offsetof(_FirstPaddingByte<>, __first_padding_byte_);
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TYPE_TRAITS_DATASIZEOF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/decay.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/decay.h
index f45d33b8fb4..95dccaa29cb 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/decay.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/decay.h
@@ -27,43 +27,45 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__decay)
template <class _Tp>
+using __decay_t _LIBCPP_NODEBUG = __decay(_Tp);
+
+template <class _Tp>
struct decay {
- using type _LIBCPP_NODEBUG = __decay(_Tp);
+ using type _LIBCPP_NODEBUG = __decay_t<_Tp>;
};
+
#else
template <class _Up, bool>
struct __decay {
- typedef _LIBCPP_NODEBUG __remove_cv_t<_Up> type;
+ typedef _LIBCPP_NODEBUG __remove_cv_t<_Up> type;
};
template <class _Up>
struct __decay<_Up, true> {
public:
- typedef _LIBCPP_NODEBUG typename conditional
- <
- is_array<_Up>::value,
- __add_pointer_t<__remove_extent_t<_Up> >,
- typename conditional
- <
- is_function<_Up>::value,
- typename add_pointer<_Up>::type,
- __remove_cv_t<_Up>
- >::type
- >::type type;
+ typedef _LIBCPP_NODEBUG typename conditional<
+ is_array<_Up>::value,
+ __add_pointer_t<__remove_extent_t<_Up> >,
+ typename conditional<is_function<_Up>::value, typename add_pointer<_Up>::type, __remove_cv_t<_Up> >::type >::type
+ type;
};
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS decay
-{
+struct _LIBCPP_TEMPLATE_VIS decay {
private:
- typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tp> _Up;
+ typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tp> _Up;
+
public:
typedef _LIBCPP_NODEBUG typename __decay<_Up, __libcpp_is_referenceable<_Up>::value>::type type;
};
+
+template <class _Tp>
+using __decay_t = typename decay<_Tp>::type;
#endif // __has_builtin(__decay)
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using decay_t = typename decay<_Tp>::type;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using decay_t = __decay_t<_Tp>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/disjunction.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/disjunction.h
index 125f168acc3..2c89528d9f2 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/disjunction.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/disjunction.h
@@ -43,7 +43,7 @@ struct _OrImpl<false> {
template <class... _Args>
using _Or _LIBCPP_NODEBUG = typename _OrImpl<sizeof...(_Args) != 0>::template _Result<false_type, _Args...>;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class... _Args>
struct disjunction : _Or<_Args...> {};
@@ -51,7 +51,7 @@ struct disjunction : _Or<_Args...> {};
template <class... _Args>
inline constexpr bool disjunction_v = _Or<_Args...>::value;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/enable_if.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/enable_if.h
index 706386deb16..c1d88965f74 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/enable_if.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/enable_if.h
@@ -17,13 +17,19 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <bool, class _Tp = void> struct _LIBCPP_TEMPLATE_VIS enable_if {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS enable_if<true, _Tp> {typedef _Tp type;};
-
-template <bool _Bp, class _Tp = void> using __enable_if_t _LIBCPP_NODEBUG = typename enable_if<_Bp, _Tp>::type;
-
-#if _LIBCPP_STD_VER > 11
-template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
+template <bool, class _Tp = void>
+struct _LIBCPP_TEMPLATE_VIS enable_if {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS enable_if<true, _Tp> {
+ typedef _Tp type;
+};
+
+template <bool _Bp, class _Tp = void>
+using __enable_if_t _LIBCPP_NODEBUG = typename enable_if<_Bp, _Tp>::type;
+
+#if _LIBCPP_STD_VER >= 14
+template <bool _Bp, class _Tp = void>
+using enable_if_t = typename enable_if<_Bp, _Tp>::type;
#endif
// CUDA headers use libc++ internals.
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/extent.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/extent.h
index 8186c979a39..8f281b36f70 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/extent.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/extent.h
@@ -21,32 +21,31 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__array_extent) && !defined(__CUDACC__)
-template<class _Tp, size_t _Dim = 0>
-struct _LIBCPP_TEMPLATE_VIS extent
- : integral_constant<size_t, __array_extent(_Tp, _Dim)> { };
+template <class _Tp, size_t _Dim = 0>
+struct _LIBCPP_TEMPLATE_VIS extent : integral_constant<size_t, __array_extent(_Tp, _Dim)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp, unsigned _Ip = 0>
inline constexpr size_t extent_v = __array_extent(_Tp, _Ip);
-#endif
+# endif
#else // __has_builtin(__array_extent)
-template <class _Tp, unsigned _Ip = 0> struct _LIBCPP_TEMPLATE_VIS extent
- : public integral_constant<size_t, 0> {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[], 0>
- : public integral_constant<size_t, 0> {};
-template <class _Tp, unsigned _Ip> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[], _Ip>
- : public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[_Np], 0>
- : public integral_constant<size_t, _Np> {};
-template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[_Np], _Ip>
- : public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
-
-#if _LIBCPP_STD_VER > 14
+template <class _Tp, unsigned _Ip = 0>
+struct _LIBCPP_TEMPLATE_VIS extent : public integral_constant<size_t, 0> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS extent<_Tp[], 0> : public integral_constant<size_t, 0> {};
+template <class _Tp, unsigned _Ip>
+struct _LIBCPP_TEMPLATE_VIS extent<_Tp[], _Ip> : public integral_constant<size_t, extent<_Tp, _Ip - 1>::value> {};
+template <class _Tp, size_t _Np>
+struct _LIBCPP_TEMPLATE_VIS extent<_Tp[_Np], 0> : public integral_constant<size_t, _Np> {};
+template <class _Tp, size_t _Np, unsigned _Ip>
+struct _LIBCPP_TEMPLATE_VIS extent<_Tp[_Np], _Ip> : public integral_constant<size_t, extent<_Tp, _Ip - 1>::value> {};
+
+# if _LIBCPP_STD_VER >= 17
template <class _Tp, unsigned _Ip = 0>
inline constexpr size_t extent_v = extent<_Tp, _Ip>::value;
-#endif
+# endif
#endif // __has_builtin(__array_extent)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/has_unique_object_representation.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/has_unique_object_representation.h
index d6f75c9ce5c..c0ada5618f0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/has_unique_object_representation.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/has_unique_object_representation.h
@@ -20,11 +20,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations
- : public integral_constant<bool,
- __has_unique_object_representations(remove_cv_t<remove_all_extents_t<_Tp>>)> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations
+ : public integral_constant<bool, __has_unique_object_representations(remove_cv_t<remove_all_extents_t<_Tp>>)> {};
template <class _Tp>
inline constexpr bool has_unique_object_representations_v = has_unique_object_representations<_Tp>::value;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/has_virtual_destructor.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/has_virtual_destructor.h
index e73a2b280cb..4ce96e649e6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/has_virtual_destructor.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/has_virtual_destructor.h
@@ -18,10 +18,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor
- : public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor : public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool has_virtual_destructor_v = __has_virtual_destructor(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/integral_constant.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/integral_constant.h
index 2449d1a906e..a3f4fd34057 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/integral_constant.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/integral_constant.h
@@ -18,29 +18,26 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, _Tp __v>
-struct _LIBCPP_TEMPLATE_VIS integral_constant
-{
- static _LIBCPP_CONSTEXPR const _Tp value = __v;
- typedef _Tp value_type;
+struct _LIBCPP_TEMPLATE_VIS integral_constant {
+ static _LIBCPP_CONSTEXPR const _Tp value = __v;
+ typedef _Tp value_type;
typedef integral_constant type;
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR operator value_type() const _NOEXCEPT {return value;}
-#if _LIBCPP_STD_VER > 11
- _LIBCPP_INLINE_VISIBILITY
- constexpr value_type operator ()() const _NOEXCEPT {return value;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR operator value_type() const _NOEXCEPT { return value; }
+#if _LIBCPP_STD_VER >= 14
+ _LIBCPP_INLINE_VISIBILITY constexpr value_type operator()() const _NOEXCEPT { return value; }
#endif
};
template <class _Tp, _Tp __v>
_LIBCPP_CONSTEXPR const _Tp integral_constant<_Tp, __v>::value;
-typedef integral_constant<bool, true> true_type;
+typedef integral_constant<bool, true> true_type;
typedef integral_constant<bool, false> false_type;
template <bool _Val>
using _BoolConstant _LIBCPP_NODEBUG = integral_constant<bool, _Val>;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <bool __b>
using bool_constant = integral_constant<bool, __b>;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/invoke.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/invoke.h
new file mode 100644
index 00000000000..f3c00e7ede7
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/invoke.h
@@ -0,0 +1,461 @@
+// -*- 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___TYPE_TRAITS_INVOKE_H
+#define _LIBCPP___TYPE_TRAITS_INVOKE_H
+
+#include <__config>
+#include <__type_traits/add_lvalue_reference.h>
+#include <__type_traits/apply_cv.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_base_of.h>
+#include <__type_traits/is_core_convertible.h>
+#include <__type_traits/is_member_function_pointer.h>
+#include <__type_traits/is_member_object_pointer.h>
+#include <__type_traits/is_reference_wrapper.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_void.h>
+#include <__type_traits/nat.h>
+#include <__type_traits/remove_cv.h>
+#include <__utility/declval.h>
+#include <__utility/forward.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+struct __any {
+ __any(...);
+};
+
+template <class _MP, bool _IsMemberFunctionPtr, bool _IsMemberObjectPtr>
+struct __member_pointer_traits_imp {};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false> {
+ typedef _Class _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...), true, false> {
+ typedef _Class _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param..., ...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const, true, false> {
+ typedef _Class const _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const, true, false> {
+ typedef _Class const _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param..., ...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile, true, false> {
+ typedef _Class volatile _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile, true, false> {
+ typedef _Class volatile _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param..., ...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile, true, false> {
+ typedef _Class const volatile _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile, true, false> {
+ typedef _Class const volatile _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param..., ...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...)&, true, false> {
+ typedef _Class& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...)&, true, false> {
+ typedef _Class& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param..., ...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&, true, false> {
+ typedef _Class const& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const&, true, false> {
+ typedef _Class const& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param..., ...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&, true, false> {
+ typedef _Class volatile& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile&, true, false> {
+ typedef _Class volatile& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param..., ...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&, true, false> {
+ typedef _Class const volatile& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile&, true, false> {
+ typedef _Class const volatile& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param..., ...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...)&&, true, false> {
+ typedef _Class&& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...)&&, true, false> {
+ typedef _Class&& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param..., ...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&&, true, false> {
+ typedef _Class const&& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const&&, true, false> {
+ typedef _Class const&& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param..., ...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&&, true, false> {
+ typedef _Class volatile&& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile&&, true, false> {
+ typedef _Class volatile&& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param..., ...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&&, true, false> {
+ typedef _Class const volatile&& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param...);
+};
+
+template <class _Rp, class _Class, class... _Param>
+struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile&&, true, false> {
+ typedef _Class const volatile&& _ClassType;
+ typedef _Rp _ReturnType;
+ typedef _Rp(_FnType)(_Param..., ...);
+};
+
+template <class _Rp, class _Class>
+struct __member_pointer_traits_imp<_Rp _Class::*, false, true> {
+ typedef _Class _ClassType;
+ typedef _Rp _ReturnType;
+};
+
+template <class _MP>
+struct __member_pointer_traits
+ : public __member_pointer_traits_imp<__remove_cv_t<_MP>,
+ is_member_function_pointer<_MP>::value,
+ is_member_object_pointer<_MP>::value> {
+ // typedef ... _ClassType;
+ // typedef ... _ReturnType;
+ // typedef ... _FnType;
+};
+
+template <class _DecayedFp>
+struct __member_pointer_class_type {};
+
+template <class _Ret, class _ClassType>
+struct __member_pointer_class_type<_Ret _ClassType::*> {
+ typedef _ClassType type;
+};
+
+template <class _Fp,
+ class _A0,
+ class _DecayFp = __decay_t<_Fp>,
+ class _DecayA0 = __decay_t<_A0>,
+ class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
+using __enable_if_bullet1 =
+ typename enable_if<is_member_function_pointer<_DecayFp>::value && is_base_of<_ClassT, _DecayA0>::value >::type;
+
+template <class _Fp, class _A0, class _DecayFp = __decay_t<_Fp>, class _DecayA0 = __decay_t<_A0> >
+using __enable_if_bullet2 =
+ typename enable_if<is_member_function_pointer<_DecayFp>::value && __is_reference_wrapper<_DecayA0>::value >::type;
+
+template <class _Fp,
+ class _A0,
+ class _DecayFp = __decay_t<_Fp>,
+ class _DecayA0 = __decay_t<_A0>,
+ class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
+using __enable_if_bullet3 =
+ typename enable_if<is_member_function_pointer<_DecayFp>::value && !is_base_of<_ClassT, _DecayA0>::value &&
+ !__is_reference_wrapper<_DecayA0>::value >::type;
+
+template <class _Fp,
+ class _A0,
+ class _DecayFp = __decay_t<_Fp>,
+ class _DecayA0 = __decay_t<_A0>,
+ class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
+using __enable_if_bullet4 =
+ typename enable_if<is_member_object_pointer<_DecayFp>::value && is_base_of<_ClassT, _DecayA0>::value >::type;
+
+template <class _Fp, class _A0, class _DecayFp = __decay_t<_Fp>, class _DecayA0 = __decay_t<_A0> >
+using __enable_if_bullet5 =
+ typename enable_if<is_member_object_pointer<_DecayFp>::value && __is_reference_wrapper<_DecayA0>::value >::type;
+
+template <class _Fp,
+ class _A0,
+ class _DecayFp = __decay_t<_Fp>,
+ class _DecayA0 = __decay_t<_A0>,
+ class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
+using __enable_if_bullet6 =
+ typename enable_if<is_member_object_pointer<_DecayFp>::value && !is_base_of<_ClassT, _DecayA0>::value &&
+ !__is_reference_wrapper<_DecayA0>::value >::type;
+
+// __invoke forward declarations
+
+// fall back - none of the bullets
+
+template <class... _Args>
+__nat __invoke(__any, _Args&&... __args);
+
+// bullets 1, 2 and 3
+
+// clang-format off
+template <class _Fp, class _A0, class... _Args, class = __enable_if_bullet1<_Fp, _A0> >
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+decltype((std::declval<_A0>().*std::declval<_Fp>())(std::declval<_Args>()...))
+__invoke(_Fp&& __f, _A0&& __a0, _Args&&... __args)
+ _NOEXCEPT_(noexcept((static_cast<_A0&&>(__a0).*__f)(static_cast<_Args&&>(__args)...)))
+ { return (static_cast<_A0&&>(__a0).*__f)(static_cast<_Args&&>(__args)...); }
+
+template <class _Fp, class _A0, class... _Args, class = __enable_if_bullet2<_Fp, _A0> >
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+decltype((std::declval<_A0>().get().*std::declval<_Fp>())(std::declval<_Args>()...))
+__invoke(_Fp&& __f, _A0&& __a0, _Args&&... __args)
+ _NOEXCEPT_(noexcept((__a0.get().*__f)(static_cast<_Args&&>(__args)...)))
+ { return (__a0.get().*__f)(static_cast<_Args&&>(__args)...); }
+
+template <class _Fp, class _A0, class... _Args, class = __enable_if_bullet3<_Fp, _A0> >
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+decltype(((*std::declval<_A0>()).*std::declval<_Fp>())(std::declval<_Args>()...))
+__invoke(_Fp&& __f, _A0&& __a0, _Args&&... __args)
+ _NOEXCEPT_(noexcept(((*static_cast<_A0&&>(__a0)).*__f)(static_cast<_Args&&>(__args)...)))
+ { return ((*static_cast<_A0&&>(__a0)).*__f)(static_cast<_Args&&>(__args)...); }
+
+// bullets 4, 5 and 6
+
+template <class _Fp, class _A0, class = __enable_if_bullet4<_Fp, _A0> >
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+decltype(std::declval<_A0>().*std::declval<_Fp>())
+__invoke(_Fp&& __f, _A0&& __a0)
+ _NOEXCEPT_(noexcept(static_cast<_A0&&>(__a0).*__f))
+ { return static_cast<_A0&&>(__a0).*__f; }
+
+template <class _Fp, class _A0, class = __enable_if_bullet5<_Fp, _A0> >
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+decltype(std::declval<_A0>().get().*std::declval<_Fp>())
+__invoke(_Fp&& __f, _A0&& __a0)
+ _NOEXCEPT_(noexcept(__a0.get().*__f))
+ { return __a0.get().*__f; }
+
+template <class _Fp, class _A0, class = __enable_if_bullet6<_Fp, _A0> >
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+decltype((*std::declval<_A0>()).*std::declval<_Fp>())
+__invoke(_Fp&& __f, _A0&& __a0)
+ _NOEXCEPT_(noexcept((*static_cast<_A0&&>(__a0)).*__f))
+ { return (*static_cast<_A0&&>(__a0)).*__f; }
+
+// bullet 7
+
+template <class _Fp, class... _Args>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+decltype(std::declval<_Fp>()(std::declval<_Args>()...))
+__invoke(_Fp&& __f, _Args&&... __args)
+ _NOEXCEPT_(noexcept(static_cast<_Fp&&>(__f)(static_cast<_Args&&>(__args)...)))
+ { return static_cast<_Fp&&>(__f)(static_cast<_Args&&>(__args)...); }
+// clang-format on
+
+// __invokable
+template <class _Ret, class _Fp, class... _Args>
+struct __invokable_r {
+ template <class _XFp, class... _XArgs>
+ static decltype(std::__invoke(std::declval<_XFp>(), std::declval<_XArgs>()...)) __try_call(int);
+ template <class _XFp, class... _XArgs>
+ static __nat __try_call(...);
+
+ // FIXME: Check that _Ret, _Fp, and _Args... are all complete types, cv void,
+ // or incomplete array types as required by the standard.
+ using _Result = decltype(__try_call<_Fp, _Args...>(0));
+
+ using type = __conditional_t<_IsNotSame<_Result, __nat>::value,
+ __conditional_t<is_void<_Ret>::value, true_type, __is_core_convertible<_Result, _Ret> >,
+ false_type>;
+ static const bool value = type::value;
+};
+template <class _Fp, class... _Args>
+using __invokable = __invokable_r<void, _Fp, _Args...>;
+
+template <bool _IsInvokable, bool _IsCVVoid, class _Ret, class _Fp, class... _Args>
+struct __nothrow_invokable_r_imp {
+ static const bool value = false;
+};
+
+template <class _Ret, class _Fp, class... _Args>
+struct __nothrow_invokable_r_imp<true, false, _Ret, _Fp, _Args...> {
+ typedef __nothrow_invokable_r_imp _ThisT;
+
+ template <class _Tp>
+ static void __test_noexcept(_Tp) _NOEXCEPT;
+
+#ifdef _LIBCPP_CXX03_LANG
+ static const bool value = false;
+#else
+ static const bool value =
+ noexcept(_ThisT::__test_noexcept<_Ret>(_VSTD::__invoke(std::declval<_Fp>(), std::declval<_Args>()...)));
+#endif
+};
+
+template <class _Ret, class _Fp, class... _Args>
+struct __nothrow_invokable_r_imp<true, true, _Ret, _Fp, _Args...> {
+#ifdef _LIBCPP_CXX03_LANG
+ static const bool value = false;
+#else
+ static const bool value = noexcept(_VSTD::__invoke(std::declval<_Fp>(), std::declval<_Args>()...));
+#endif
+};
+
+template <class _Ret, class _Fp, class... _Args>
+using __nothrow_invokable_r =
+ __nothrow_invokable_r_imp<__invokable_r<_Ret, _Fp, _Args...>::value, is_void<_Ret>::value, _Ret, _Fp, _Args...>;
+
+template <class _Fp, class... _Args>
+using __nothrow_invokable = __nothrow_invokable_r_imp<__invokable<_Fp, _Args...>::value, true, void, _Fp, _Args...>;
+
+template <class _Fp, class... _Args>
+struct __invoke_of
+ : public enable_if<__invokable<_Fp, _Args...>::value, typename __invokable_r<void, _Fp, _Args...>::_Result> {};
+
+template <class _Ret, bool = is_void<_Ret>::value>
+struct __invoke_void_return_wrapper {
+ template <class... _Args>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static _Ret __call(_Args&&... __args) {
+ return std::__invoke(std::forward<_Args>(__args)...);
+ }
+};
+
+template <class _Ret>
+struct __invoke_void_return_wrapper<_Ret, true> {
+ template <class... _Args>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static void __call(_Args&&... __args) {
+ std::__invoke(std::forward<_Args>(__args)...);
+ }
+};
+
+#if _LIBCPP_STD_VER >= 17
+
+// is_invocable
+
+template <class _Fn, class... _Args>
+struct _LIBCPP_TEMPLATE_VIS is_invocable : integral_constant<bool, __invokable<_Fn, _Args...>::value> {};
+
+template <class _Ret, class _Fn, class... _Args>
+struct _LIBCPP_TEMPLATE_VIS is_invocable_r : integral_constant<bool, __invokable_r<_Ret, _Fn, _Args...>::value> {};
+
+template <class _Fn, class... _Args>
+inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
+
+template <class _Ret, class _Fn, class... _Args>
+inline constexpr bool is_invocable_r_v = is_invocable_r<_Ret, _Fn, _Args...>::value;
+
+// is_nothrow_invocable
+
+template <class _Fn, class... _Args>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable : integral_constant<bool, __nothrow_invokable<_Fn, _Args...>::value> {
+};
+
+template <class _Ret, class _Fn, class... _Args>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable_r
+ : integral_constant<bool, __nothrow_invokable_r<_Ret, _Fn, _Args...>::value> {};
+
+template <class _Fn, class... _Args>
+inline constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<_Fn, _Args...>::value;
+
+template <class _Ret, class _Fn, class... _Args>
+inline constexpr bool is_nothrow_invocable_r_v = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
+
+template <class _Fn, class... _Args>
+struct _LIBCPP_TEMPLATE_VIS invoke_result : __invoke_of<_Fn, _Args...> {};
+
+template <class _Fn, class... _Args>
+using invoke_result_t = typename invoke_result<_Fn, _Args...>::type;
+
+#endif // _LIBCPP_STD_VER >= 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TYPE_TRAITS_INVOKE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_abstract.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_abstract.h
index c74b3284f75..4aa456be1c4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_abstract.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_abstract.h
@@ -18,10 +18,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_abstract
- : public integral_constant<bool, __is_abstract(_Tp)> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_abstract : public integral_constant<bool, __is_abstract(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_abstract_v = __is_abstract(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_aggregate.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_aggregate.h
index ea9de84f96d..4e0988071ad 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_aggregate.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_aggregate.h
@@ -18,15 +18,15 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
-is_aggregate : public integral_constant<bool, __is_aggregate(_Tp)> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_aggregate : public integral_constant<bool, __is_aggregate(_Tp)> {};
template <class _Tp>
inline constexpr bool is_aggregate_v = __is_aggregate(_Tp);
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_allocator.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_allocator.h
index ee4154d7e4a..144ffac4d7c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_allocator.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_allocator.h
@@ -21,15 +21,13 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template<typename _Alloc, typename = void, typename = void>
+template <typename _Alloc, typename = void, typename = void>
struct __is_allocator : false_type {};
-template<typename _Alloc>
+template <typename _Alloc>
struct __is_allocator<_Alloc,
- __void_t<typename _Alloc::value_type>,
- __void_t<decltype(std::declval<_Alloc&>().allocate(size_t(0)))>
- >
- : true_type {};
+ __void_t<typename _Alloc::value_type>,
+ __void_t<decltype(std::declval<_Alloc&>().allocate(size_t(0)))> > : true_type {};
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_always_bitcastable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_always_bitcastable.h
index 63304eb492b..5bc650b4135 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_always_bitcastable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_always_bitcastable.h
@@ -32,49 +32,52 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _From, class _To>
struct __is_always_bitcastable {
using _UnqualFrom = __remove_cv_t<_From>;
- using _UnqualTo = __remove_cv_t<_To>;
+ using _UnqualTo = __remove_cv_t<_To>;
+ // clang-format off
static const bool value =
- // First, the simple case -- `From` and `To` are the same object type.
- (is_same<_UnqualFrom, _UnqualTo>::value && is_trivially_copyable<_UnqualFrom>::value) ||
+ // First, the simple case -- `From` and `To` are the same object type.
+ (is_same<_UnqualFrom, _UnqualTo>::value && is_trivially_copyable<_UnqualFrom>::value) ||
- // Beyond the simple case, we say that one type is "always bit-castable" to another if:
- // - (1) `From` and `To` have the same value representation, and in addition every possible value of `From` has
- // a corresponding value in the `To` type (in other words, the set of values of `To` is a superset of the set of
- // values of `From`);
- // - (2) When the corresponding values are not the same value (as, for example, between an unsigned and a signed
- // integer, where a large positive value of the unsigned integer corresponds to a negative value in the signed
- // integer type), the value of `To` that results from a bitwise copy of `From` is the same what would be produced
- // by the built-in assignment (if it were defined for the two types, to which there are minor exceptions, e.g.
- // built-in arrays).
- //
- // In practice, that means:
- // - all integral types (except `bool`, see below) -- that is, character types and `int` types, both signed and
- // unsigned...
- // - as well as arrays of such types...
- // - ...that have the same size.
- //
- // Other trivially-copyable types can't be validly bit-cast outside of their own type:
- // - floating-point types normally have different sizes and thus aren't bit-castable between each other (fails #1);
- // - integral types and floating-point types use different representations, so for example bit-casting an integral
- // `1` to `float` results in a very small less-than-one value, unlike built-in assignment that produces `1.0`
- // (fails #2);
- // - booleans normally use only a single bit of their object representation; bit-casting an integer to a boolean
- // will result in a boolean object with an incorrect representation, which is undefined behavior (fails #2).
- // Bit-casting from a boolean into an integer, however, is valid;
- // - enumeration types may have different ranges of possible values (fails #1);
- // - for pointers, it is not guaranteed that pointers to different types use the same set of values to represent
- // addresses, and the conversion results are explicitly unspecified for types with different alignments
- // (fails #1);
- // - for structs and unions it is impossible to determine whether the set of values of one of them is a subset of
- // the other (fails #1);
- // - there is no need to consider `nullptr_t` for practical purposes.
- (
- sizeof(_From) == sizeof(_To) &&
- is_integral<_From>::value &&
- is_integral<_To>::value &&
- !is_same<_UnqualTo, bool>::value
- );
+ // Beyond the simple case, we say that one type is "always bit-castable" to another if:
+ // - (1) `From` and `To` have the same value representation, and in addition every possible value of `From` has
+ // a corresponding value in the `To` type (in other words, the set of values of `To` is a superset of the set of
+ // values of `From`);
+ // - (2) When the corresponding values are not the same value (as, for example, between an unsigned and a signed
+ // integer, where a large positive value of the unsigned integer corresponds to a negative value in the signed
+ // integer type), the value of `To` that results from a bitwise copy of `From` is the same what would be
+ // produced by the built-in assignment (if it were defined for the two types, to which there are minor
+ // exceptions, e.g. built-in arrays).
+ //
+ // In practice, that means:
+ // - all integral types (except `bool`, see below) -- that is, character types and `int` types, both signed and
+ // unsigned...
+ // - as well as arrays of such types...
+ // - ...that have the same size.
+ //
+ // Other trivially-copyable types can't be validly bit-cast outside of their own type:
+ // - floating-point types normally have different sizes and thus aren't bit-castable between each other (fails
+ // #1);
+ // - integral types and floating-point types use different representations, so for example bit-casting an integral
+ // `1` to `float` results in a very small less-than-one value, unlike built-in assignment that produces `1.0`
+ // (fails #2);
+ // - booleans normally use only a single bit of their object representation; bit-casting an integer to a boolean
+ // will result in a boolean object with an incorrect representation, which is undefined behavior (fails #2).
+ // Bit-casting from a boolean into an integer, however, is valid;
+ // - enumeration types may have different ranges of possible values (fails #1);
+ // - for pointers, it is not guaranteed that pointers to different types use the same set of values to represent
+ // addresses, and the conversion results are explicitly unspecified for types with different alignments
+ // (fails #1);
+ // - for structs and unions it is impossible to determine whether the set of values of one of them is a subset of
+ // the other (fails #1);
+ // - there is no need to consider `nullptr_t` for practical purposes.
+ (
+ sizeof(_From) == sizeof(_To) &&
+ is_integral<_From>::value &&
+ is_integral<_To>::value &&
+ !is_same<_UnqualTo, bool>::value
+ );
+ // clang-format on
};
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_arithmetic.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_arithmetic.h
index 6d631f41c7d..c9713e1840a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_arithmetic.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_arithmetic.h
@@ -20,11 +20,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_arithmetic
- : public integral_constant<bool, is_integral<_Tp>::value ||
- is_floating_point<_Tp>::value> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_arithmetic
+ : public integral_constant<bool, is_integral<_Tp>::value || is_floating_point<_Tp>::value> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_array.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_array.h
index bc105908982..5b0e0e6f46b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_array.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_array.h
@@ -24,26 +24,26 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_array) && 0
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_array : _BoolConstant<__is_array(_Tp)> { };
+struct _LIBCPP_TEMPLATE_VIS is_array : _BoolConstant<__is_array(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_array_v = __is_array(_Tp);
-#endif
+# endif
#else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_array
- : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[]>
- : public true_type {};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[_Np]>
- : public true_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_array : public false_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[]> : public true_type {};
+template <class _Tp, size_t _Np>
+struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[_Np]> : public true_type {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_array_v = is_array<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_array)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_assignable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_assignable.h
index 13cd682f53c..11134b1c1ab 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_assignable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_assignable.h
@@ -18,10 +18,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template<class _Tp, class _Up>
-struct _LIBCPP_TEMPLATE_VIS is_assignable : _BoolConstant<__is_assignable(_Tp, _Up)> { };
+template <class _Tp, class _Up>
+struct _LIBCPP_TEMPLATE_VIS is_assignable : _BoolConstant<__is_assignable(_Tp, _Up)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Arg>
inline constexpr bool is_assignable_v = __is_assignable(_Tp, _Arg);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_base_of.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_base_of.h
index 0e6dec0b5ee..090abeeb54d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_base_of.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_base_of.h
@@ -19,10 +19,9 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Bp, class _Dp>
-struct _LIBCPP_TEMPLATE_VIS is_base_of
- : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
+struct _LIBCPP_TEMPLATE_VIS is_base_of : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Bp, class _Dp>
inline constexpr bool is_base_of_v = __is_base_of(_Bp, _Dp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_bounded_array.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_bounded_array.h
index 27de9dfd386..211403d638d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_bounded_array.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_bounded_array.h
@@ -19,17 +19,20 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class> struct _LIBCPP_TEMPLATE_VIS __libcpp_is_bounded_array : false_type {};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS __libcpp_is_bounded_array<_Tp[_Np]> : true_type {};
+template <class>
+struct _LIBCPP_TEMPLATE_VIS __libcpp_is_bounded_array : false_type {};
+template <class _Tp, size_t _Np>
+struct _LIBCPP_TEMPLATE_VIS __libcpp_is_bounded_array<_Tp[_Np]> : true_type {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
-template <class> struct _LIBCPP_TEMPLATE_VIS is_bounded_array : false_type {};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS is_bounded_array<_Tp[_Np]> : true_type {};
+template <class>
+struct _LIBCPP_TEMPLATE_VIS is_bounded_array : false_type {};
+template <class _Tp, size_t _Np>
+struct _LIBCPP_TEMPLATE_VIS is_bounded_array<_Tp[_Np]> : true_type {};
template <class _Tp>
-inline constexpr
-bool is_bounded_array_v = is_bounded_array<_Tp>::value;
+inline constexpr bool is_bounded_array_v = is_bounded_array<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_callable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_callable.h
index 445373c43b9..49724fe892e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_callable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_callable.h
@@ -19,12 +19,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template<class _Func, class... _Args, class = decltype(std::declval<_Func>()(std::declval<_Args>()...))>
+template <class _Func, class... _Args, class = decltype(std::declval<_Func>()(std::declval<_Args>()...))>
true_type __is_callable_helper(int);
-template<class...>
+template <class...>
false_type __is_callable_helper(...);
-template<class _Func, class... _Args>
+template <class _Func, class... _Args>
struct __is_callable : decltype(std::__is_callable_helper<_Func, _Args...>(0)) {};
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_class.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_class.h
index 031430f6654..034f76a7865 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_class.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_class.h
@@ -18,10 +18,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_class
- : public integral_constant<bool, __is_class(_Tp)> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_class : public integral_constant<bool, __is_class(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_class_v = __is_class(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_compound.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_compound.h
index 38776e1d6dd..60cce342811 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_compound.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_compound.h
@@ -21,23 +21,23 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_compound) && !defined(__CUDACC__)
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_compound : _BoolConstant<__is_compound(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_compound : _BoolConstant<__is_compound(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_compound_v = __is_compound(_Tp);
-#endif
+# endif
#else // __has_builtin(__is_compound)
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_compound
- : public integral_constant<bool, !is_fundamental<_Tp>::value> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_compound : public integral_constant<bool, !is_fundamental<_Tp>::value> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_compound_v = is_compound<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_compound)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_const.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_const.h
index ef51eebc7de..0aeceec5ed5 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_const.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_const.h
@@ -21,22 +21,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_const) && !defined(__CUDACC__)
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_const : _BoolConstant<__is_const(_Tp)> { };
+struct _LIBCPP_TEMPLATE_VIS is_const : _BoolConstant<__is_const(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_const_v = __is_const(_Tp);
-#endif
+# endif
#else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_const : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_const<_Tp const> : public true_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_const : public false_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_const<_Tp const> : public true_type {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_const_v = is_const<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_const)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_constant_evaluated.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_constant_evaluated.h
index ae1683b97de..713ccfc1313 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_constant_evaluated.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_constant_evaluated.h
@@ -18,15 +18,15 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED
-#if _LIBCPP_STD_VER > 17
-_LIBCPP_INLINE_VISIBILITY
-inline constexpr bool is_constant_evaluated() noexcept {
+#if _LIBCPP_STD_VER >= 20
+_LIBCPP_INLINE_VISIBILITY inline constexpr bool is_constant_evaluated() noexcept {
return __builtin_is_constant_evaluated();
}
#endif
-_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR
-bool __libcpp_is_constant_evaluated() _NOEXCEPT { return __builtin_is_constant_evaluated(); }
+_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR bool __libcpp_is_constant_evaluated() _NOEXCEPT {
+ return __builtin_is_constant_evaluated();
+}
#else
inline _LIBCPP_CONSTEXPR
bool __libcpp_is_constant_evaluated() _NOEXCEPT { return false; }
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_constructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_constructible.h
index cbe61b4329e..4e62eb061fd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_constructible.h
@@ -18,13 +18,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp, class ..._Args>
-struct _LIBCPP_TEMPLATE_VIS is_constructible
- : public integral_constant<bool, __is_constructible(_Tp, _Args...)>
-{ };
+template <class _Tp, class... _Args>
+struct _LIBCPP_TEMPLATE_VIS is_constructible : public integral_constant<bool, __is_constructible(_Tp, _Args...)> {};
-#if _LIBCPP_STD_VER > 14
-template <class _Tp, class ..._Args>
+#if _LIBCPP_STD_VER >= 17
+template <class _Tp, class... _Args>
inline constexpr bool is_constructible_v = __is_constructible(_Tp, _Args...);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_convertible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_convertible.h
index 5f77fd4d706..4b189f03273 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_convertible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_convertible.h
@@ -24,81 +24,87 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if __has_builtin(__is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
+#if __has_builtin(__is_convertible) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) && !defined(__CUDACC__)
-template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS is_convertible
- : public integral_constant<bool, __is_convertible_to(_T1, _T2)> {};
+template <class _T1, class _T2>
+struct _LIBCPP_TEMPLATE_VIS is_convertible : public integral_constant<bool, __is_convertible(_T1, _T2)> {};
-#else // __has_builtin(__is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
+#elif __has_builtin(__is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) && !defined(__CUDACC__)
-namespace __is_convertible_imp
-{
-template <class _Tp> void __test_convert(_Tp);
+template <class _T1, class _T2>
+struct _LIBCPP_TEMPLATE_VIS is_convertible : public integral_constant<bool, __is_convertible_to(_T1, _T2)> {};
+
+// TODO: Remove this fallback when GCC < 13 support is no longer required.
+// GCC 13 has the __is_convertible built-in.
+#else // __has_builtin(__is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
+
+namespace __is_convertible_imp {
+template <class _Tp>
+void __test_convert(_Tp);
template <class _From, class _To, class = void>
struct __is_convertible_test : public false_type {};
template <class _From, class _To>
-struct __is_convertible_test<_From, _To,
- decltype(__is_convertible_imp::__test_convert<_To>(std::declval<_From>()))> : public true_type
-{};
-
-template <class _Tp, bool _IsArray = is_array<_Tp>::value,
- bool _IsFunction = is_function<_Tp>::value,
- bool _IsVoid = is_void<_Tp>::value>
- struct __is_array_function_or_void {enum {value = 0};};
-template <class _Tp> struct __is_array_function_or_void<_Tp, true, false, false> {enum {value = 1};};
-template <class _Tp> struct __is_array_function_or_void<_Tp, false, true, false> {enum {value = 2};};
-template <class _Tp> struct __is_array_function_or_void<_Tp, false, false, true> {enum {value = 3};};
-}
+struct __is_convertible_test<_From, _To, decltype(__is_convertible_imp::__test_convert<_To>(std::declval<_From>()))>
+ : public true_type {};
+
+// clang-format off
+template <class _Tp,
+ bool _IsArray = is_array<_Tp>::value,
+ bool _IsFunction = is_function<_Tp>::value,
+ bool _IsVoid = is_void<_Tp>::value>
+ struct __is_array_function_or_void { enum { value = 0 }; };
+template <class _Tp> struct __is_array_function_or_void<_Tp, true, false, false> { enum { value = 1 }; };
+template <class _Tp> struct __is_array_function_or_void<_Tp, false, true, false> { enum { value = 2 }; };
+template <class _Tp> struct __is_array_function_or_void<_Tp, false, false, true> { enum { value = 3 }; };
+// clang-format on
+} // namespace __is_convertible_imp
template <class _Tp,
- unsigned = __is_convertible_imp::__is_array_function_or_void<__libcpp_remove_reference_t<_Tp> >::value>
-struct __is_convertible_check
-{
- static const size_t __v = 0;
+ unsigned = __is_convertible_imp::__is_array_function_or_void<__libcpp_remove_reference_t<_Tp> >::value>
+struct __is_convertible_check {
+ static const size_t __v = 0;
};
template <class _Tp>
-struct __is_convertible_check<_Tp, 0>
-{
- static const size_t __v = sizeof(_Tp);
+struct __is_convertible_check<_Tp, 0> {
+ static const size_t __v = sizeof(_Tp);
};
-template <class _T1, class _T2,
- unsigned _T1_is_array_function_or_void = __is_convertible_imp::__is_array_function_or_void<_T1>::value,
- unsigned _T2_is_array_function_or_void = __is_convertible_imp::__is_array_function_or_void<_T2>::value>
+template <class _T1,
+ class _T2,
+ unsigned _T1_is_array_function_or_void = __is_convertible_imp::__is_array_function_or_void<_T1>::value,
+ unsigned _T2_is_array_function_or_void = __is_convertible_imp::__is_array_function_or_void<_T2>::value>
struct __is_convertible
- : public integral_constant<bool,
- __is_convertible_imp::__is_convertible_test<_T1, _T2>::value
- >
-{};
-
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 0, 1> : public false_type {};
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 1> : public false_type {};
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 1> : public false_type {};
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 1> : public false_type {};
-
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 0, 2> : public false_type {};
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 2> : public false_type {};
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 2> : public false_type {};
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 2> : public false_type {};
-
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 0, 3> : public false_type {};
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 3> : public false_type {};
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 3> : public false_type {};
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 3> : public true_type {};
-
-template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS is_convertible
- : public __is_convertible<_T1, _T2>
-{
- static const size_t __complete_check1 = __is_convertible_check<_T1>::__v;
- static const size_t __complete_check2 = __is_convertible_check<_T2>::__v;
+ : public integral_constant<bool, __is_convertible_imp::__is_convertible_test<_T1, _T2>::value >{};
+
+// clang-format off
+template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 0, 1> : public false_type{};
+template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 1> : public false_type{};
+template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 1> : public false_type{};
+template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 1> : public false_type{};
+
+template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 0, 2> : public false_type{};
+template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 2> : public false_type{};
+template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 2> : public false_type{};
+template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 2> : public false_type{};
+
+template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 0, 3> : public false_type{};
+template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 3> : public false_type{};
+template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 3> : public false_type{};
+template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 3> : public true_type{};
+// clang-format on
+
+template <class _T1, class _T2>
+struct _LIBCPP_TEMPLATE_VIS is_convertible : public __is_convertible<_T1, _T2> {
+ static const size_t __complete_check1 = __is_convertible_check<_T1>::__v;
+ static const size_t __complete_check2 = __is_convertible_check<_T2>::__v;
};
#endif // __has_builtin(__is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _From, class _To>
inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_copy_assignable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_copy_assignable.h
index b3a965ff372..e607ace5404 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_copy_assignable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_copy_assignable.h
@@ -24,10 +24,9 @@ template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_copy_assignable
: public integral_constant<
bool,
- __is_assignable(__add_lvalue_reference_t<_Tp>,
- __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
+ __is_assignable(__add_lvalue_reference_t<_Tp>, __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_copy_assignable_v = is_copy_assignable<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_copy_constructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_copy_constructible.h
index 053e15911b9..402f2b89875 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_copy_constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_copy_constructible.h
@@ -22,11 +22,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_copy_constructible
- : public integral_constant<
- bool,
- __is_constructible(_Tp, __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
+ : public integral_constant<bool, __is_constructible(_Tp, __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {
+};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_copy_constructible_v = is_copy_constructible<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_core_convertible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_core_convertible.h
index 1ce40791305..0de177c7771 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_core_convertible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_core_convertible.h
@@ -27,9 +27,8 @@ template <class _Tp, class _Up, class = void>
struct __is_core_convertible : public false_type {};
template <class _Tp, class _Up>
-struct __is_core_convertible<_Tp, _Up, decltype(
- static_cast<void(*)(_Up)>(0) ( static_cast<_Tp(*)()>(0)() )
-)> : public true_type {};
+struct __is_core_convertible<_Tp, _Up, decltype(static_cast<void (*)(_Up)>(0)(static_cast<_Tp (*)()>(0)()))>
+ : public true_type {};
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_default_constructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_default_constructible.h
index d2180c6a855..e73e9b98f5d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_default_constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_default_constructible.h
@@ -19,11 +19,9 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_default_constructible
- : public integral_constant<bool, __is_constructible(_Tp)>
- {};
+struct _LIBCPP_TEMPLATE_VIS is_default_constructible : public integral_constant<bool, __is_constructible(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_default_constructible_v = __is_constructible(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_destructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_destructible.h
index 87a68bfce2e..b3e9bfe6a05 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_destructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_destructible.h
@@ -24,13 +24,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_destructible) && !defined(__CUDACC__)
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_destructible : _BoolConstant<__is_destructible(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_destructible : _BoolConstant<__is_destructible(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_destructible_v = __is_destructible(_Tp);
-#endif
+# endif
#else // __has_builtin(__is_destructible)
@@ -42,19 +42,19 @@ inline constexpr bool is_destructible_v = __is_destructible(_Tp);
// where _Up is remove_all_extents<_Tp>::type
template <class>
-struct __is_destructible_apply { typedef int type; };
+struct __is_destructible_apply {
+ typedef int type;
+};
template <typename _Tp>
struct __is_destructor_wellformed {
- template <typename _Tp1>
- static true_type __test (
- typename __is_destructible_apply<decltype(std::declval<_Tp1&>().~_Tp1())>::type
- );
+ template <typename _Tp1>
+ static true_type __test(typename __is_destructible_apply<decltype(std::declval<_Tp1&>().~_Tp1())>::type);
- template <typename _Tp1>
- static false_type __test (...);
+ template <typename _Tp1>
+ static false_type __test(...);
- static const bool value = decltype(__test<_Tp>(12))::value;
+ static const bool value = decltype(__test<_Tp>(12))::value;
};
template <class _Tp, bool>
@@ -62,12 +62,10 @@ struct __destructible_imp;
template <class _Tp>
struct __destructible_imp<_Tp, false>
- : public integral_constant<bool,
- __is_destructor_wellformed<__remove_all_extents_t<_Tp> >::value> {};
+ : public integral_constant<bool, __is_destructor_wellformed<__remove_all_extents_t<_Tp> >::value> {};
template <class _Tp>
-struct __destructible_imp<_Tp, true>
- : public true_type {};
+struct __destructible_imp<_Tp, true> : public true_type {};
template <class _Tp, bool>
struct __destructible_false;
@@ -79,21 +77,18 @@ template <class _Tp>
struct __destructible_false<_Tp, true> : public false_type {};
template <class _Tp>
-struct is_destructible
- : public __destructible_false<_Tp, is_function<_Tp>::value> {};
+struct is_destructible : public __destructible_false<_Tp, is_function<_Tp>::value> {};
template <class _Tp>
-struct is_destructible<_Tp[]>
- : public false_type {};
+struct is_destructible<_Tp[]> : public false_type {};
template <>
-struct is_destructible<void>
- : public false_type {};
+struct is_destructible<void> : public false_type {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_destructible_v = is_destructible<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_destructible)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_empty.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_empty.h
index 042b4e68074..951d93b5a2f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_empty.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_empty.h
@@ -19,10 +19,9 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_empty
- : public integral_constant<bool, __is_empty(_Tp)> {};
+struct _LIBCPP_TEMPLATE_VIS is_empty : public integral_constant<bool, __is_empty(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_empty_v = __is_empty(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_enum.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_enum.h
index 4c1db415d5a..77ca3ea1087 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_enum.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_enum.h
@@ -18,10 +18,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_enum
- : public integral_constant<bool, __is_enum(_Tp)> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_enum : public integral_constant<bool, __is_enum(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_enum_v = __is_enum(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_equality_comparable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_equality_comparable.h
new file mode 100644
index 00000000000..e8d3ce87961
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_equality_comparable.h
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___TYPE_TRAITS_IS_EQUALITY_COMPARABLE_H
+#define _LIBCPP___TYPE_TRAITS_IS_EQUALITY_COMPARABLE_H
+
+#include <__config>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_integral.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_void.h>
+#include <__type_traits/remove_cv.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/void_t.h>
+#include <__utility/declval.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, class _Up, class = void>
+struct __is_equality_comparable : false_type {};
+
+template <class _Tp, class _Up>
+struct __is_equality_comparable<_Tp, _Up, __void_t<decltype(std::declval<_Tp>() == std::declval<_Up>())> > : true_type {
+};
+
+// A type is_trivially_equality_comparable if the expression `a == b` is equivalent to `std::memcmp(&a, &b, sizeof(T))`
+// (with `a` and `b` being of type `T`). For the case where we compare two object of the same type, we can use
+// __is_trivially_equality_comparable. We have special-casing for pointers which point to the same type ignoring
+// cv-qualifications and comparing to void-pointers.
+//
+// The following types are not trivially equality comparable:
+// floating-point types: different bit-patterns can compare equal. (e.g 0.0 and -0.0)
+// enums: The user is allowed to specialize operator== for enums
+// pointers that don't have the same type (ignoring cv-qualifiers): pointers to virtual bases are equality comparable,
+// but don't have the same bit-pattern. An exception to this is comparing to a void-pointer. There the bit-pattern is
+// always compared.
+
+template <class _Tp, class _Up>
+struct __libcpp_is_trivially_equality_comparable_impl : false_type {};
+
+template <class _Tp>
+struct __libcpp_is_trivially_equality_comparable_impl<_Tp, _Tp>
+#if __has_builtin(__is_trivially_equality_comparable)
+ : integral_constant<bool, __is_trivially_equality_comparable(_Tp) && __is_equality_comparable<_Tp, _Tp>::value> {
+};
+#else
+ : is_integral<_Tp> {
+};
+#endif // __has_builtin(__is_trivially_equality_comparable)
+
+template <class _Tp>
+struct __libcpp_is_trivially_equality_comparable_impl<_Tp*, _Tp*> : true_type {};
+
+// TODO: Use is_pointer_inverconvertible_base_of
+template <class _Tp, class _Up>
+struct __libcpp_is_trivially_equality_comparable_impl<_Tp*, _Up*>
+ : integral_constant<
+ bool,
+ __is_equality_comparable<_Tp*, _Up*>::value &&
+ (is_same<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >::value || is_void<_Tp>::value || is_void<_Up>::value)> {
+};
+
+template <class _Tp, class _Up>
+using __libcpp_is_trivially_equality_comparable =
+ __libcpp_is_trivially_equality_comparable_impl<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TYPE_TRAITS_IS_EQUALITY_COMPARABLE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_execution_policy.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_execution_policy.h
new file mode 100644
index 00000000000..6884f17ba16
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_execution_policy.h
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___TYPE_TRAITS_IS_EXECUTION_POLICY_H
+#define _LIBCPP___TYPE_TRAITS_IS_EXECUTION_POLICY_H
+
+#include <__config>
+#include <__type_traits/remove_cvref.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class>
+inline constexpr bool is_execution_policy_v = false;
+
+template <class>
+inline constexpr bool __is_unsequenced_execution_policy_impl = false;
+
+template <class _Tp>
+inline constexpr bool __is_unsequenced_execution_policy_v =
+ __is_unsequenced_execution_policy_impl<__remove_cvref_t<_Tp>>;
+
+template <class>
+inline constexpr bool __is_parallel_execution_policy_impl = false;
+
+template <class _Tp>
+inline constexpr bool __is_parallel_execution_policy_v = __is_parallel_execution_policy_impl<__remove_cvref_t<_Tp>>;
+
+namespace execution {
+struct __disable_user_instantiations_tag {
+ explicit __disable_user_instantiations_tag() = default;
+};
+} // namespace execution
+
+// TODO: Remove default argument once algorithms are using the new backend dispatching
+template <class _ExecutionPolicy>
+_LIBCPP_HIDE_FROM_ABI auto
+__remove_parallel_policy(const _ExecutionPolicy& = _ExecutionPolicy{execution::__disable_user_instantiations_tag{}});
+
+// Removes the "parallel" part of an execution policy.
+// For example, turns par_unseq into unseq, and par into seq.
+template <class _ExecutionPolicy>
+using __remove_parallel_policy_t = decltype(std::__remove_parallel_policy<_ExecutionPolicy>());
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___TYPE_TRAITS_IS_EXECUTION_POLICY_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_final.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_final.h
index 74ced23a14e..499c5e3a1ed 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_final.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_final.h
@@ -18,15 +18,15 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
-__libcpp_is_final : public integral_constant<bool, __is_final(_Tp)> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS __libcpp_is_final : public integral_constant<bool, __is_final(_Tp)> {};
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
-is_final : public integral_constant<bool, __is_final(_Tp)> {};
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_final : public integral_constant<bool, __is_final(_Tp)> {};
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_final_v = __is_final(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_floating_point.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_floating_point.h
index 392844814b6..add34782dfa 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_floating_point.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_floating_point.h
@@ -19,15 +19,17 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+// clang-format off
template <class _Tp> struct __libcpp_is_floating_point : public false_type {};
template <> struct __libcpp_is_floating_point<float> : public true_type {};
template <> struct __libcpp_is_floating_point<double> : public true_type {};
template <> struct __libcpp_is_floating_point<long double> : public true_type {};
+// clang-format on
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_floating_point
- : public __libcpp_is_floating_point<__remove_cv_t<_Tp> > {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_floating_point : public __libcpp_is_floating_point<__remove_cv_t<_Tp> > {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_floating_point_v = is_floating_point<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_function.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_function.h
index d7afb15b5b7..580d1b6b7db 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_function.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_function.h
@@ -33,7 +33,7 @@ struct _LIBCPP_TEMPLATE_VIS is_function
#endif // __has_builtin(__is_function)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_function_v = is_function<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_fundamental.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_fundamental.h
index b2fc6d637dd..417739f9dc8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_fundamental.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_fundamental.h
@@ -22,25 +22,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_fundamental) && !defined(__CUDACC__)
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_fundamental : _BoolConstant<__is_fundamental(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_fundamental : _BoolConstant<__is_fundamental(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_fundamental_v = __is_fundamental(_Tp);
-#endif
+# endif
#else // __has_builtin(__is_fundamental)
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_fundamental
- : public integral_constant<bool, is_void<_Tp>::value ||
- __is_nullptr_t<_Tp>::value ||
- is_arithmetic<_Tp>::value> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_fundamental
+ : public integral_constant<bool, is_void<_Tp>::value || __is_nullptr_t<_Tp>::value || is_arithmetic<_Tp>::value> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_fundamental_v = is_fundamental<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_fundamental)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_implicitly_default_constructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_implicitly_default_constructible.h
index b77f94845fd..576166e5269 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_implicitly_default_constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_implicitly_default_constructible.h
@@ -28,19 +28,17 @@ template <class _Tp>
void __test_implicit_default_constructible(_Tp);
template <class _Tp, class = void, class = typename is_default_constructible<_Tp>::type>
-struct __is_implicitly_default_constructible
- : false_type
-{ };
+struct __is_implicitly_default_constructible : false_type {};
template <class _Tp>
-struct __is_implicitly_default_constructible<_Tp, decltype(std::__test_implicit_default_constructible<_Tp const&>({})), true_type>
- : true_type
-{ };
+struct __is_implicitly_default_constructible<_Tp,
+ decltype(std::__test_implicit_default_constructible<_Tp const&>({})),
+ true_type> : true_type {};
template <class _Tp>
-struct __is_implicitly_default_constructible<_Tp, decltype(std::__test_implicit_default_constructible<_Tp const&>({})), false_type>
- : false_type
-{ };
+struct __is_implicitly_default_constructible<_Tp,
+ decltype(std::__test_implicit_default_constructible<_Tp const&>({})),
+ false_type> : false_type {};
#endif // !C++03
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_integral.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_integral.h
index a13947fbecc..a099f7fac70 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_integral.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_integral.h
@@ -19,6 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+// clang-format off
template <class _Tp> struct __libcpp_is_integral { enum { value = 0 }; };
template <> struct __libcpp_is_integral<bool> { enum { value = 1 }; };
template <> struct __libcpp_is_integral<char> { enum { value = 1 }; };
@@ -44,26 +45,27 @@ template <> struct __libcpp_is_integral<unsigned long long> { enum { va
template <> struct __libcpp_is_integral<__int128_t> { enum { value = 1 }; };
template <> struct __libcpp_is_integral<__uint128_t> { enum { value = 1 }; };
#endif
+// clang-format on
#if __has_builtin(__is_integral) && !defined(__CUDACC__)
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_integral : _BoolConstant<__is_integral(_Tp)> { };
+struct _LIBCPP_TEMPLATE_VIS is_integral : _BoolConstant<__is_integral(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_integral_v = __is_integral(_Tp);
-#endif
+# endif
#else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_integral
- : public _BoolConstant<__libcpp_is_integral<__remove_cv_t<_Tp> >::value> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_integral : public _BoolConstant<__libcpp_is_integral<__remove_cv_t<_Tp> >::value> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_integral_v = is_integral<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_integral)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_literal_type.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_literal_type.h
index be017455059..81da34572c7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_literal_type.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_literal_type.h
@@ -19,15 +19,15 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 is_literal_type
- : public integral_constant<bool, __is_literal_type(_Tp)>
- {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 is_literal_type
+ : public integral_constant<bool, __is_literal_type(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
_LIBCPP_DEPRECATED_IN_CXX17 inline constexpr bool is_literal_type_v = __is_literal_type(_Tp);
-#endif // _LIBCPP_STD_VER > 14
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
+# endif // _LIBCPP_STD_VER >= 17
+#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_function_pointer.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_function_pointer.h
index 9e831797180..af2c3e2d83b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_function_pointer.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_function_pointer.h
@@ -21,41 +21,39 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct __libcpp_is_member_pointer {
- enum {
- __is_member = false,
- __is_func = false,
- __is_obj = false
- };
+template <class _Tp>
+struct __libcpp_is_member_pointer {
+ enum { __is_member = false, __is_func = false, __is_obj = false };
};
-template <class _Tp, class _Up> struct __libcpp_is_member_pointer<_Tp _Up::*> {
+template <class _Tp, class _Up>
+struct __libcpp_is_member_pointer<_Tp _Up::*> {
enum {
__is_member = true,
- __is_func = is_function<_Tp>::value,
- __is_obj = !__is_func,
+ __is_func = is_function<_Tp>::value,
+ __is_obj = !__is_func,
};
};
#if __has_builtin(__is_member_function_pointer) && !defined(__CUDACC__)
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer
- : _BoolConstant<__is_member_function_pointer(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer : _BoolConstant<__is_member_function_pointer(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_member_function_pointer_v = __is_member_function_pointer(_Tp);
-#endif
+# endif
#else // __has_builtin(__is_member_function_pointer)
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer
- : public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_func > {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer
+ : public _BoolConstant<__libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_func> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_member_function_pointer_v = is_member_function_pointer<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_member_function_pointer)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_object_pointer.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_object_pointer.h
index 66585042052..645488edebe 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_object_pointer.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_object_pointer.h
@@ -20,24 +20,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_member_object_pointer) && !defined(__CUDACC__)
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer
- : _BoolConstant<__is_member_object_pointer(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer : _BoolConstant<__is_member_object_pointer(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_member_object_pointer_v = __is_member_object_pointer(_Tp);
-#endif
+# endif
#else // __has_builtin(__is_member_object_pointer)
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer
- : public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_obj > {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer
+ : public _BoolConstant<__libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_obj> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_member_object_pointer_v = is_member_object_pointer<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_member_object_pointer)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_pointer.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_pointer.h
index 23b2288fda6..429f2affcb4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_pointer.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_member_pointer.h
@@ -21,23 +21,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_member_pointer) && !defined(__CUDACC__)
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_member_pointer : _BoolConstant<__is_member_pointer(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_member_pointer : _BoolConstant<__is_member_pointer(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
-#endif
+# endif
#else // __has_builtin(__is_member_pointer)
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_pointer
- : public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_member > {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_member_pointer
+ : public _BoolConstant<__libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_member> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_member_pointer_v = is_member_pointer<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_member_pointer)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_move_assignable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_move_assignable.h
index 3c7158b2ae0..867bc00d824 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_move_assignable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_move_assignable.h
@@ -22,11 +22,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_move_assignable
- : public integral_constant<
- bool,
- __is_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {};
+ : public integral_constant<bool, __is_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_move_assignable_v = is_move_assignable<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_move_constructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_move_constructible.h
index 667d10494ff..40ec4a07081 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_move_constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_move_constructible.h
@@ -21,10 +21,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_move_constructible
- : public integral_constant<bool, __is_constructible(_Tp, __add_rvalue_reference_t<_Tp>)>
- {};
+ : public integral_constant<bool, __is_constructible(_Tp, __add_rvalue_reference_t<_Tp>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_move_constructible_v = is_move_constructible<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_assignable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_assignable.h
index 0cd9d5d7341..cc574933138 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_assignable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_assignable.h
@@ -19,10 +19,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _Arg>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable
- : public integral_constant<bool, __is_nothrow_assignable(_Tp, _Arg)> {};
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable : public integral_constant<bool, __is_nothrow_assignable(_Tp, _Arg)> {
+};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Arg>
inline constexpr bool is_nothrow_assignable_v = __is_nothrow_assignable(_Tp, _Arg);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_constructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_constructible.h
index 20c61995215..456c760650d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_constructible.h
@@ -22,54 +22,47 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if __has_builtin(__is_nothrow_constructible) && !defined(__CUDACC__)
+// GCC is disabled due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106611
+#if __has_builtin(__is_nothrow_constructible) && !defined(_LIBCPP_COMPILER_GCC) && !defined(__CUDACC__)
-template <
- class _Tp, class... _Args>
+template < class _Tp, class... _Args>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
: public integral_constant<bool, __is_nothrow_constructible(_Tp, _Args...)> {};
#else
-template <bool, bool, class _Tp, class... _Args> struct __libcpp_is_nothrow_constructible;
+template <bool, bool, class _Tp, class... _Args>
+struct __libcpp_is_nothrow_constructible;
template <class _Tp, class... _Args>
-struct __libcpp_is_nothrow_constructible</*is constructible*/true, /*is reference*/false, _Tp, _Args...>
- : public integral_constant<bool, noexcept(_Tp(std::declval<_Args>()...))>
-{
-};
+struct __libcpp_is_nothrow_constructible</*is constructible*/ true, /*is reference*/ false, _Tp, _Args...>
+ : public integral_constant<bool, noexcept(_Tp(std::declval<_Args>()...))> {};
template <class _Tp>
-void __implicit_conversion_to(_Tp) noexcept { }
+void __implicit_conversion_to(_Tp) noexcept {}
template <class _Tp, class _Arg>
-struct __libcpp_is_nothrow_constructible</*is constructible*/true, /*is reference*/true, _Tp, _Arg>
- : public integral_constant<bool, noexcept(_VSTD::__implicit_conversion_to<_Tp>(std::declval<_Arg>()))>
-{
-};
+struct __libcpp_is_nothrow_constructible</*is constructible*/ true, /*is reference*/ true, _Tp, _Arg>
+ : public integral_constant<bool, noexcept(_VSTD::__implicit_conversion_to<_Tp>(std::declval<_Arg>()))> {};
template <class _Tp, bool _IsReference, class... _Args>
-struct __libcpp_is_nothrow_constructible</*is constructible*/false, _IsReference, _Tp, _Args...>
- : public false_type
-{
+struct __libcpp_is_nothrow_constructible</*is constructible*/ false, _IsReference, _Tp, _Args...> : public false_type {
};
template <class _Tp, class... _Args>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
- : __libcpp_is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, is_reference<_Tp>::value, _Tp, _Args...>
-{
-};
+ : __libcpp_is_nothrow_constructible<is_constructible<_Tp, _Args...>::value,
+ is_reference<_Tp>::value,
+ _Tp,
+ _Args...> {};
template <class _Tp, size_t _Ns>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp[_Ns]>
- : __libcpp_is_nothrow_constructible<is_constructible<_Tp>::value, is_reference<_Tp>::value, _Tp>
-{
-};
+ : __libcpp_is_nothrow_constructible<is_constructible<_Tp>::value, is_reference<_Tp>::value, _Tp> {};
#endif // __has_builtin(__is_nothrow_constructible)
-
-#if _LIBCPP_STD_VER > 14
-template <class _Tp, class ..._Args>
+#if _LIBCPP_STD_VER >= 17
+template <class _Tp, class... _Args>
inline constexpr bool is_nothrow_constructible_v = is_nothrow_constructible<_Tp, _Args...>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_convertible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_convertible.h
index a8ca1c4c413..a8f8b4d063a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_convertible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_convertible.h
@@ -24,29 +24,26 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _Tp>
-static void __test_noexcept(_Tp) noexcept;
+void __test_noexcept(_Tp) noexcept;
-template<typename _Fm, typename _To>
-static bool_constant<noexcept(_VSTD::__test_noexcept<_To>(std::declval<_Fm>()))>
-__is_nothrow_convertible_test();
+template <typename _Fm, typename _To>
+bool_constant<noexcept(_VSTD::__test_noexcept<_To>(std::declval<_Fm>()))> __is_nothrow_convertible_test();
template <typename _Fm, typename _To>
-struct __is_nothrow_convertible_helper: decltype(__is_nothrow_convertible_test<_Fm, _To>())
-{ };
+struct __is_nothrow_convertible_helper : decltype(__is_nothrow_convertible_test<_Fm, _To>()) {};
template <typename _Fm, typename _To>
-struct is_nothrow_convertible : _Or<
- _And<is_void<_To>, is_void<_Fm>>,
- _Lazy<_And, is_convertible<_Fm, _To>, __is_nothrow_convertible_helper<_Fm, _To>>
->::type { };
+struct is_nothrow_convertible
+ : _Or<_And<is_void<_To>, is_void<_Fm>>,
+ _Lazy<_And, is_convertible<_Fm, _To>, __is_nothrow_convertible_helper<_Fm, _To> > >::type {};
template <typename _Fm, typename _To>
inline constexpr bool is_nothrow_convertible_v = is_nothrow_convertible<_Fm, _To>::value;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_copy_assignable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_copy_assignable.h
index 58f7d97a557..a97e962b308 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_copy_assignable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_copy_assignable.h
@@ -22,13 +22,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_assignable
- : public integral_constant<
- bool,
- __is_nothrow_assignable(
- __add_lvalue_reference_t<_Tp>,
- __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
+ : public integral_constant<bool,
+ __is_nothrow_assignable(__add_lvalue_reference_t<_Tp>,
+ __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_nothrow_copy_assignable_v = is_nothrow_copy_assignable<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_copy_constructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_copy_constructible.h
index ce17334b3f8..dd7f1d5ef62 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_copy_constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_copy_constructible.h
@@ -24,9 +24,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// TODO: remove this implementation once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106611 is fixed
#ifdef _LIBCPP_COMPILER_GCC
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible
- : public is_nothrow_constructible<_Tp,
- __add_lvalue_reference_t<typename add_const<_Tp>::type> > {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible
+ : public is_nothrow_constructible<_Tp, __add_lvalue_reference_t<typename add_const<_Tp>::type> > {};
#else // _LIBCPP_COMPILER_GCC
@@ -38,7 +38,7 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible
#endif // _LIBCPP_COMPILER_GCC
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_nothrow_copy_constructible_v = is_nothrow_copy_constructible<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_default_constructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_default_constructible.h
index 91bffa5e466..58f31f21b02 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_default_constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_default_constructible.h
@@ -18,11 +18,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_default_constructible
- : public integral_constant<bool, __is_nothrow_constructible(_Tp)>
- {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_default_constructible
+ : public integral_constant<bool, __is_nothrow_constructible(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_nothrow_default_constructible_v = __is_nothrow_constructible(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_destructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_destructible.h
index 03ebf440492..370ba27ecd1 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_destructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_destructible.h
@@ -26,60 +26,45 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if !defined(_LIBCPP_CXX03_LANG)
-template <bool, class _Tp> struct __libcpp_is_nothrow_destructible;
+template <bool, class _Tp>
+struct __libcpp_is_nothrow_destructible;
template <class _Tp>
-struct __libcpp_is_nothrow_destructible<false, _Tp>
- : public false_type
-{
-};
+struct __libcpp_is_nothrow_destructible<false, _Tp> : public false_type {};
template <class _Tp>
struct __libcpp_is_nothrow_destructible<true, _Tp>
- : public integral_constant<bool, noexcept(std::declval<_Tp>().~_Tp()) >
-{
-};
+ : public integral_constant<bool, noexcept(std::declval<_Tp>().~_Tp()) > {};
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible
- : public __libcpp_is_nothrow_destructible<is_destructible<_Tp>::value, _Tp>
-{
-};
+ : public __libcpp_is_nothrow_destructible<is_destructible<_Tp>::value, _Tp> {};
template <class _Tp, size_t _Ns>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[_Ns]>
- : public is_nothrow_destructible<_Tp>
-{
-};
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[_Ns]> : public is_nothrow_destructible<_Tp> {};
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&>
- : public true_type
-{
-};
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&> : public true_type {};
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&&>
- : public true_type
-{
-};
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&&> : public true_type {};
#else
-template <class _Tp> struct __libcpp_nothrow_destructor
- : public integral_constant<bool, is_scalar<_Tp>::value ||
- is_reference<_Tp>::value> {};
+template <class _Tp>
+struct __libcpp_nothrow_destructor : public integral_constant<bool, is_scalar<_Tp>::value || is_reference<_Tp>::value> {
+};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible
- : public __libcpp_nothrow_destructor<__remove_all_extents_t<_Tp> > {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible : public __libcpp_nothrow_destructor<__remove_all_extents_t<_Tp> > {
+};
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[]>
- : public false_type {};
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[]> : public false_type {};
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_nothrow_destructible_v = is_nothrow_destructible<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_move_assignable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_move_assignable.h
index 18dcc9b232c..aa87e369cd5 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_move_assignable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_move_assignable.h
@@ -22,12 +22,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_assignable
- : public integral_constant<
- bool,
- __is_nothrow_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {
+ : public integral_constant<bool,
+ __is_nothrow_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_nothrow_move_assignable_v = is_nothrow_move_assignable<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_move_constructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_move_constructible.h
index ad8222a0e4c..dab5a019b33 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_move_constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_nothrow_move_constructible.h
@@ -23,19 +23,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// TODO: remove this implementation once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106611 is fixed
#ifndef _LIBCPP_COMPILER_GCC
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible
- : public integral_constant<bool, __is_nothrow_constructible(_Tp, __add_rvalue_reference_t<_Tp>)>
- {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible
+ : public integral_constant<bool, __is_nothrow_constructible(_Tp, __add_rvalue_reference_t<_Tp>)> {};
#else // _LIBCPP_COMPILER_GCC
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible
- : public is_nothrow_constructible<_Tp, __add_rvalue_reference_t<_Tp> >
- {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible
+ : public is_nothrow_constructible<_Tp, __add_rvalue_reference_t<_Tp> > {};
#endif // _LIBCPP_COMPILER_GCC
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_nothrow_move_constructible_v = is_nothrow_move_constructible<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_null_pointer.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_null_pointer.h
index 4864cee11a1..c666f5f2475 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_null_pointer.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_null_pointer.h
@@ -20,21 +20,23 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct __is_nullptr_t_impl : public false_type {};
-template <> struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
+template <class _Tp>
+struct __is_nullptr_t_impl : public false_type {};
+template <>
+struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS __is_nullptr_t
- : public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS __is_nullptr_t : public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {};
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_null_pointer
- : public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {};
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_null_pointer : public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value;
-#endif
-#endif // _LIBCPP_STD_VER > 11
+# endif
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_object.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_object.h
index ac3f78ccc17..cdfe4838e6e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_object.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_object.h
@@ -24,26 +24,26 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_object) && !defined(__CUDACC__)
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_object : _BoolConstant<__is_object(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_object : _BoolConstant<__is_object(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_object_v = __is_object(_Tp);
-#endif
+# endif
#else // __has_builtin(__is_object)
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_object
- : public integral_constant<bool, is_scalar<_Tp>::value ||
- is_array<_Tp>::value ||
- is_union<_Tp>::value ||
- is_class<_Tp>::value > {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_object
+ : public integral_constant<bool,
+ is_scalar<_Tp>::value || is_array<_Tp>::value || is_union<_Tp>::value ||
+ is_class<_Tp>::value > {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_object_v = is_object<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_object)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_pod.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_pod.h
index c1d00b269f0..5888fbf457d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_pod.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_pod.h
@@ -18,10 +18,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pod
- : public integral_constant<bool, __is_pod(_Tp)> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_pod : public integral_constant<bool, __is_pod(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_pod_v = __is_pod(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_pointer.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_pointer.h
index b7bc14f2af3..5b52619bfad 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_pointer.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_pointer.h
@@ -21,34 +21,42 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_pointer) && !defined(__CUDACC__)
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_pointer : _BoolConstant<__is_pointer(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_pointer : _BoolConstant<__is_pointer(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_pointer_v = __is_pointer(_Tp);
-#endif
+# endif
#else // __has_builtin(__is_pointer)
-template <class _Tp> struct __libcpp_is_pointer : public false_type {};
-template <class _Tp> struct __libcpp_is_pointer<_Tp*> : public true_type {};
+template <class _Tp>
+struct __libcpp_is_pointer : public false_type {};
+template <class _Tp>
+struct __libcpp_is_pointer<_Tp*> : public true_type {};
-template <class _Tp> struct __libcpp_remove_objc_qualifiers { typedef _Tp type; };
-#if defined(_LIBCPP_HAS_OBJC_ARC)
+template <class _Tp>
+struct __libcpp_remove_objc_qualifiers {
+ typedef _Tp type;
+};
+# if defined(_LIBCPP_HAS_OBJC_ARC)
+// clang-format off
template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __strong> { typedef _Tp type; };
template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __weak> { typedef _Tp type; };
template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __autoreleasing> { typedef _Tp type; };
template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __unsafe_unretained> { typedef _Tp type; };
-#endif
+// clang-format on
+# endif
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pointer
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_pointer
: public __libcpp_is_pointer<typename __libcpp_remove_objc_qualifiers<__remove_cv_t<_Tp> >::type> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_pointer_v = is_pointer<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_pointer)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_polymorphic.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_polymorphic.h
index 96da48abeee..d122e1c8777 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_polymorphic.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_polymorphic.h
@@ -19,10 +19,9 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_polymorphic
- : public integral_constant<bool, __is_polymorphic(_Tp)> {};
+struct _LIBCPP_TEMPLATE_VIS is_polymorphic : public integral_constant<bool, __is_polymorphic(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_polymorphic_v = __is_polymorphic(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_primary_template.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_primary_template.h
index a9bebcf7e64..f308dfadc8e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_primary_template.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_primary_template.h
@@ -21,13 +21,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
-using __test_for_primary_template = __enable_if_t<
- _IsSame<_Tp, typename _Tp::__primary_template>::value
- >;
+using __test_for_primary_template = __enable_if_t<_IsSame<_Tp, typename _Tp::__primary_template>::value>;
+
template <class _Tp>
-using __is_primary_template = _IsValidExpansion<
- __test_for_primary_template, _Tp
- >;
+using __is_primary_template = _IsValidExpansion<__test_for_primary_template, _Tp>;
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_reference.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_reference.h
index 5e54b5817a4..277300b2e5e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_reference.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_reference.h
@@ -18,41 +18,46 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if __has_builtin(__is_lvalue_reference) && \
- __has_builtin(__is_rvalue_reference) && \
- __has_builtin(__is_reference) && !defined(__CUDACC__)
+#if __has_builtin(__is_lvalue_reference) && __has_builtin(__is_rvalue_reference) && __has_builtin(__is_reference) && !defined(__CUDACC__)
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> {};
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference : _BoolConstant<__is_rvalue_reference(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference : _BoolConstant<__is_rvalue_reference(_Tp)> {};
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_reference : _BoolConstant<__is_reference(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_reference : _BoolConstant<__is_reference(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_reference_v = __is_reference(_Tp);
template <class _Tp>
inline constexpr bool is_lvalue_reference_v = __is_lvalue_reference(_Tp);
template <class _Tp>
inline constexpr bool is_rvalue_reference_v = __is_rvalue_reference(_Tp);
-#endif
+# endif
#else // __has_builtin(__is_lvalue_reference) && etc...
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference<_Tp&> : public true_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : public false_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference<_Tp&> : public true_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference<_Tp&&> : public true_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference : public false_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference<_Tp&&> : public true_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&> : public true_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&&> : public true_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_reference : public false_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&> : public true_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&&> : public true_type {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_reference_v = is_reference<_Tp>::value;
@@ -61,7 +66,7 @@ inline constexpr bool is_lvalue_reference_v = is_lvalue_reference<_Tp>::value;
template <class _Tp>
inline constexpr bool is_rvalue_reference_v = is_rvalue_reference<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_lvalue_reference) && etc...
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_reference_wrapper.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_reference_wrapper.h
index d187eec1e13..b638e7046b7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_reference_wrapper.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_reference_wrapper.h
@@ -19,12 +19,15 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> class _LIBCPP_TEMPLATE_VIS reference_wrapper;
-
-template <class _Tp> struct __is_reference_wrapper_impl : public false_type {};
-template <class _Tp> struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : public true_type {};
-template <class _Tp> struct __is_reference_wrapper
- : public __is_reference_wrapper_impl<__remove_cv_t<_Tp> > {};
+template <class _Tp>
+class _LIBCPP_TEMPLATE_VIS reference_wrapper;
+
+template <class _Tp>
+struct __is_reference_wrapper_impl : public false_type {};
+template <class _Tp>
+struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : public true_type {};
+template <class _Tp>
+struct __is_reference_wrapper : public __is_reference_wrapper_impl<__remove_cv_t<_Tp> > {};
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_same.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_same.h
index 30087cc151a..00a191a1262 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_same.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_same.h
@@ -21,9 +21,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_keyword(__is_same) && !defined(__CUDACC__)
template <class _Tp, class _Up>
-struct _LIBCPP_TEMPLATE_VIS is_same : _BoolConstant<__is_same(_Tp, _Up)> { };
+struct _LIBCPP_TEMPLATE_VIS is_same : _BoolConstant<__is_same(_Tp, _Up)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Up>
inline constexpr bool is_same_v = __is_same(_Tp, _Up);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_scalar.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_scalar.h
index 6bd80ed3f26..e6f8e87f184 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_scalar.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_scalar.h
@@ -25,35 +25,42 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_scalar) && !defined(__CUDACC__)
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_scalar : _BoolConstant<__is_scalar(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_scalar : _BoolConstant<__is_scalar(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_scalar_v = __is_scalar(_Tp);
-#endif
+# endif
#else // __has_builtin(__is_scalar)
-template <class _Tp> struct __is_block : false_type {};
-#if defined(_LIBCPP_HAS_EXTENSION_BLOCKS)
-template <class _Rp, class ..._Args> struct __is_block<_Rp (^)(_Args...)> : true_type {};
-#endif
+template <class _Tp>
+struct __is_block : false_type {};
+# if defined(_LIBCPP_HAS_EXTENSION_BLOCKS)
+template <class _Rp, class... _Args>
+struct __is_block<_Rp (^)(_Args...)> : true_type {};
+# endif
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_scalar
- : public integral_constant<bool, is_arithmetic<_Tp>::value ||
- is_member_pointer<_Tp>::value ||
- is_pointer<_Tp>::value ||
- __is_nullptr_t<_Tp>::value ||
- __is_block<_Tp>::value ||
- is_enum<_Tp>::value > {};
+// clang-format off
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_scalar
+ : public integral_constant<
+ bool, is_arithmetic<_Tp>::value ||
+ is_member_pointer<_Tp>::value ||
+ is_pointer<_Tp>::value ||
+ __is_nullptr_t<_Tp>::value ||
+ __is_block<_Tp>::value ||
+ is_enum<_Tp>::value> {};
+// clang-format on
-template <> struct _LIBCPP_TEMPLATE_VIS is_scalar<nullptr_t> : public true_type {};
+template <>
+struct _LIBCPP_TEMPLATE_VIS is_scalar<nullptr_t> : public true_type {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_scalar)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_scoped_enum.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_scoped_enum.h
index 85a41281330..43b3a6b66b1 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_scoped_enum.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_scoped_enum.h
@@ -21,17 +21,15 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Tp, bool = is_enum_v<_Tp> >
struct __is_scoped_enum_helper : false_type {};
template <class _Tp>
-struct __is_scoped_enum_helper<_Tp, true>
- : public bool_constant<!is_convertible_v<_Tp, underlying_type_t<_Tp> > > {};
+struct __is_scoped_enum_helper<_Tp, true> : public bool_constant<!is_convertible_v<_Tp, underlying_type_t<_Tp> > > {};
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_scoped_enum
- : public __is_scoped_enum_helper<_Tp> {};
+struct _LIBCPP_TEMPLATE_VIS is_scoped_enum : public __is_scoped_enum_helper<_Tp> {};
template <class _Tp>
inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value;
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_signed.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_signed.h
index 99e5ea00c04..2f355e5a3c4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_signed.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_signed.h
@@ -22,13 +22,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_signed) && !defined(__CUDACC__)
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_signed : _BoolConstant<__is_signed(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_signed : _BoolConstant<__is_signed(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_signed_v = __is_signed(_Tp);
-#endif
+# endif
#else // __has_builtin(__is_signed)
@@ -36,19 +36,21 @@ template <class _Tp, bool = is_integral<_Tp>::value>
struct __libcpp_is_signed_impl : public _BoolConstant<(_Tp(-1) < _Tp(0))> {};
template <class _Tp>
-struct __libcpp_is_signed_impl<_Tp, false> : public true_type {}; // floating point
+struct __libcpp_is_signed_impl<_Tp, false> : public true_type {}; // floating point
template <class _Tp, bool = is_arithmetic<_Tp>::value>
struct __libcpp_is_signed : public __libcpp_is_signed_impl<_Tp> {};
-template <class _Tp> struct __libcpp_is_signed<_Tp, false> : public false_type {};
+template <class _Tp>
+struct __libcpp_is_signed<_Tp, false> : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_signed : public __libcpp_is_signed<_Tp> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_signed : public __libcpp_is_signed<_Tp> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_signed_v = is_signed<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_signed)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_signed_integer.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_signed_integer.h
index 95aa11bfa1b..467548d0aaa 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_signed_integer.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_signed_integer.h
@@ -18,15 +18,17 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct __libcpp_is_signed_integer : public false_type {};
-template <> struct __libcpp_is_signed_integer<signed char> : public true_type {};
-template <> struct __libcpp_is_signed_integer<signed short> : public true_type {};
-template <> struct __libcpp_is_signed_integer<signed int> : public true_type {};
-template <> struct __libcpp_is_signed_integer<signed long> : public true_type {};
-template <> struct __libcpp_is_signed_integer<signed long long> : public true_type {};
+// clang-format off
+template <class _Tp> struct __libcpp_is_signed_integer : public false_type {};
+template <> struct __libcpp_is_signed_integer<signed char> : public true_type {};
+template <> struct __libcpp_is_signed_integer<signed short> : public true_type {};
+template <> struct __libcpp_is_signed_integer<signed int> : public true_type {};
+template <> struct __libcpp_is_signed_integer<signed long> : public true_type {};
+template <> struct __libcpp_is_signed_integer<signed long long> : public true_type {};
#ifndef _LIBCPP_HAS_NO_INT128
-template <> struct __libcpp_is_signed_integer<__int128_t> : public true_type {};
+template <> struct __libcpp_is_signed_integer<__int128_t> : public true_type {};
#endif
+// clang-format on
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_specialization.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_specialization.h
index 0cc36674257..9b75636b1a5 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_specialization.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_specialization.h
@@ -30,7 +30,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, template <class...> class _Template>
inline constexpr bool __is_specialization_v = false; // true if and only if _Tp is a specialization of _Template
@@ -38,7 +38,7 @@ inline constexpr bool __is_specialization_v = false; // true if and only if _Tp
template <template <class...> class _Template, class... _Args>
inline constexpr bool __is_specialization_v<_Template<_Args...>, _Template> = true;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_standard_layout.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_standard_layout.h
index 12c17127482..76484f3e2a3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_standard_layout.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_standard_layout.h
@@ -18,11 +18,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_standard_layout
- : public integral_constant<bool, __is_standard_layout(_Tp)>
- {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_standard_layout : public integral_constant<bool, __is_standard_layout(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_standard_layout_v = __is_standard_layout(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_swappable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_swappable.h
index 3821de17f66..07c56619856 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_swappable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_swappable.h
@@ -30,9 +30,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct __is_swappable;
-template <class _Tp> struct __is_nothrow_swappable;
-
+template <class _Tp>
+struct __is_swappable;
+template <class _Tp>
+struct __is_nothrow_swappable;
#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
@@ -43,49 +44,40 @@ using __swap_result_t = void;
#endif
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_SINCE_CXX20 __swap_result_t<_Tp>
-swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value &&
- is_nothrow_move_assignable<_Tp>::value);
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __swap_result_t<_Tp> swap(_Tp& __x, _Tp& __y)
+ _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value&& is_nothrow_move_assignable<_Tp>::value);
-template<class _Tp, size_t _Np>
+template <class _Tp, size_t _Np>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
-typename enable_if<
- __is_swappable<_Tp>::value
->::type
-swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value);
+ typename enable_if<__is_swappable<_Tp>::value>::type swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np])
+ _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value);
-namespace __detail
-{
+namespace __detail {
// ALL generic swap overloads MUST already have a declaration available at this point.
-template <class _Tp, class _Up = _Tp,
- bool _NotVoid = !is_void<_Tp>::value && !is_void<_Up>::value>
-struct __swappable_with
-{
- template <class _LHS, class _RHS>
- static decltype(swap(std::declval<_LHS>(), std::declval<_RHS>()))
- __test_swap(int);
- template <class, class>
- static __nat __test_swap(long);
-
- // Extra parens are needed for the C++03 definition of decltype.
- typedef decltype((__test_swap<_Tp, _Up>(0))) __swap1;
- typedef decltype((__test_swap<_Up, _Tp>(0))) __swap2;
-
- static const bool value = _IsNotSame<__swap1, __nat>::value
- && _IsNotSame<__swap2, __nat>::value;
+template <class _Tp, class _Up = _Tp, bool _NotVoid = !is_void<_Tp>::value && !is_void<_Up>::value>
+struct __swappable_with {
+ template <class _LHS, class _RHS>
+ static decltype(swap(std::declval<_LHS>(), std::declval<_RHS>())) __test_swap(int);
+ template <class, class>
+ static __nat __test_swap(long);
+
+ // Extra parens are needed for the C++03 definition of decltype.
+ typedef decltype((__test_swap<_Tp, _Up>(0))) __swap1;
+ typedef decltype((__test_swap<_Up, _Tp>(0))) __swap2;
+
+ static const bool value = _IsNotSame<__swap1, __nat>::value && _IsNotSame<__swap2, __nat>::value;
};
template <class _Tp, class _Up>
-struct __swappable_with<_Tp, _Up, false> : false_type {};
+struct __swappable_with<_Tp, _Up, false> : false_type {};
template <class _Tp, class _Up = _Tp, bool _Swappable = __swappable_with<_Tp, _Up>::value>
struct __nothrow_swappable_with {
static const bool value =
#ifndef _LIBCPP_HAS_NO_NOEXCEPT
- noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))
- && noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()));
+ noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))&& noexcept(
+ swap(std::declval<_Up>(), std::declval<_Tp>()));
#else
false;
#endif
@@ -97,54 +89,32 @@ struct __nothrow_swappable_with<_Tp, _Up, false> : false_type {};
} // namespace __detail
template <class _Tp>
-struct __is_swappable
- : public integral_constant<bool, __detail::__swappable_with<_Tp&>::value>
-{
-};
+struct __is_swappable : public integral_constant<bool, __detail::__swappable_with<_Tp&>::value> {};
template <class _Tp>
-struct __is_nothrow_swappable
- : public integral_constant<bool, __detail::__nothrow_swappable_with<_Tp&>::value>
-{
-};
+struct __is_nothrow_swappable : public integral_constant<bool, __detail::__nothrow_swappable_with<_Tp&>::value> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Up>
struct _LIBCPP_TEMPLATE_VIS is_swappable_with
- : public integral_constant<bool, __detail::__swappable_with<_Tp, _Up>::value>
-{
-};
+ : public integral_constant<bool, __detail::__swappable_with<_Tp, _Up>::value> {};
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_swappable
- : public __conditional_t<
- __libcpp_is_referenceable<_Tp>::value,
- is_swappable_with<
- __add_lvalue_reference_t<_Tp>,
- __add_lvalue_reference_t<_Tp> >,
- false_type
- >
-{
-};
+ : public __conditional_t<__libcpp_is_referenceable<_Tp>::value,
+ is_swappable_with<__add_lvalue_reference_t<_Tp>, __add_lvalue_reference_t<_Tp> >,
+ false_type> {};
template <class _Tp, class _Up>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable_with
- : public integral_constant<bool, __detail::__nothrow_swappable_with<_Tp, _Up>::value>
-{
-};
+ : public integral_constant<bool, __detail::__nothrow_swappable_with<_Tp, _Up>::value> {};
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable
- : public __conditional_t<
- __libcpp_is_referenceable<_Tp>::value,
- is_nothrow_swappable_with<
- __add_lvalue_reference_t<_Tp>,
- __add_lvalue_reference_t<_Tp> >,
- false_type
- >
-{
-};
+ : public __conditional_t<__libcpp_is_referenceable<_Tp>::value,
+ is_nothrow_swappable_with<__add_lvalue_reference_t<_Tp>, __add_lvalue_reference_t<_Tp> >,
+ false_type> {};
template <class _Tp, class _Up>
inline constexpr bool is_swappable_with_v = is_swappable_with<_Tp, _Up>::value;
@@ -158,7 +128,7 @@ inline constexpr bool is_nothrow_swappable_with_v = is_nothrow_swappable_with<_T
template <class _Tp>
inline constexpr bool is_nothrow_swappable_v = is_nothrow_swappable<_Tp>::value;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivial.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivial.h
index 840770d7b7e..0007c7446d5 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivial.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivial.h
@@ -18,11 +18,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivial
- : public integral_constant<bool, __is_trivial(_Tp)>
- {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_trivial : public integral_constant<bool, __is_trivial(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivial_v = __is_trivial(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_assignable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_assignable.h
index 9ef101f04ea..19169d13d6d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_assignable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_assignable.h
@@ -19,11 +19,9 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _Arg>
-struct is_trivially_assignable
- : integral_constant<bool, __is_trivially_assignable(_Tp, _Arg)>
-{ };
+struct is_trivially_assignable : integral_constant<bool, __is_trivially_assignable(_Tp, _Arg)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Arg>
inline constexpr bool is_trivially_assignable_v = __is_trivially_assignable(_Tp, _Arg);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_constructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_constructible.h
index 4173e3b4cf6..4faaf9323cd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_constructible.h
@@ -20,11 +20,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class... _Args>
struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
- : integral_constant<bool, __is_trivially_constructible(_Tp, _Args...)>
-{
-};
+ : integral_constant<bool, __is_trivially_constructible(_Tp, _Args...)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class... _Args>
inline constexpr bool is_trivially_constructible_v = __is_trivially_constructible(_Tp, _Args...);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copy_assignable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copy_assignable.h
index e6a4a35dbfb..b6b3c119746 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copy_assignable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copy_assignable.h
@@ -22,13 +22,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_assignable
- : public integral_constant<
- bool,
- __is_trivially_assignable(
- __add_lvalue_reference_t<_Tp>,
- __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
+ : public integral_constant<bool,
+ __is_trivially_assignable(__add_lvalue_reference_t<_Tp>,
+ __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_copy_assignable_v = is_trivially_copy_assignable<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copy_constructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copy_constructible.h
index 4bbb803a55c..8e71fd1fbf8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copy_constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copy_constructible.h
@@ -19,11 +19,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_constructible
- : public integral_constant<bool, __is_trivially_constructible(_Tp, __add_lvalue_reference_t<const _Tp>)>
- {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_constructible
+ : public integral_constant<bool, __is_trivially_constructible(_Tp, __add_lvalue_reference_t<const _Tp>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_copy_constructible_v = is_trivially_copy_constructible<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copyable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copyable.h
index ef118bf9c49..e92af126ee9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copyable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_copyable.h
@@ -11,6 +11,7 @@
#include <__config>
#include <__type_traits/integral_constant.h>
+#include <cstdint>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -18,15 +19,19 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copyable
- : public integral_constant<bool, __is_trivially_copyable(_Tp)>
- {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_trivially_copyable : public integral_constant<bool, __is_trivially_copyable(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Tp);
#endif
+#if _LIBCPP_STD_VER >= 20
+template <class _Tp>
+inline constexpr bool __is_cheap_to_copy = is_trivially_copyable_v<_Tp> && sizeof(_Tp) <= sizeof(std::intmax_t);
+#endif
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_default_constructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_default_constructible.h
index 5c53bd55d90..c3b6152a9fc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_default_constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_default_constructible.h
@@ -18,11 +18,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_default_constructible
- : public integral_constant<bool, __is_trivially_constructible(_Tp)>
- {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_trivially_default_constructible
+ : public integral_constant<bool, __is_trivially_constructible(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_default_constructible_v = __is_trivially_constructible(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_destructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_destructible.h
index 2a79840e3c0..e50819f87f3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_destructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_destructible.h
@@ -21,21 +21,23 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_trivially_destructible) && !defined(__CUDACC__)
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible
: public integral_constant<bool, __is_trivially_destructible(_Tp)> {};
#elif __has_builtin(__has_trivial_destructor)
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible
- : public integral_constant<bool, is_destructible<_Tp>::value && __has_trivial_destructor(_Tp)> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible
+ : public integral_constant<bool, is_destructible<_Tp>::value&& __has_trivial_destructor(_Tp)> {};
#else
-#error is_trivially_destructible is not implemented
+# error is_trivially_destructible is not implemented
#endif // __has_builtin(__is_trivially_destructible)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_destructible_v = is_trivially_destructible<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_lexicographically_comparable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_lexicographically_comparable.h
new file mode 100644
index 00000000000..a310ea1b87e
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_lexicographically_comparable.h
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___TYPE_TRAITS_IS_TRIVIALLY_LEXICOGRAPHICALLY_COMPARABLE_H
+#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_LEXICOGRAPHICALLY_COMPARABLE_H
+
+#include <__config>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_unsigned.h>
+#include <__type_traits/remove_cv.h>
+#include <__type_traits/void_t.h>
+#include <__utility/declval.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// A type is_trivially_lexicographically_comparable if the expression `a <=> b` (or their pre-C++20 equivalents) is
+// equivalent to `std::memcmp(&a, &b, sizeof(T))` (with `a` and `b` being of type `T`). There is currently no builtin to
+// tell us whether that's the case for arbitrary types, so we can only do this for known types. Specifically, these are
+// currently unsigned integer types with a sizeof(T) == 1.
+//
+// bool is trivially lexicographically comparable, because e.g. false <=> true is valid code. Furthermore, the standard
+// says that [basic.fundamental] "Type bool is a distinct type that has the same object representation, value
+// representation, and alignment requirements as an implementation-defined unsigned integer type. The values of type
+// bool are true and false."
+// This means that bool has to be unsigned and has exactly two values. This means that having anything other than the
+// `true` or `false` value representations in a bool is UB.
+//
+// The following types are not trivially lexicographically comparable:
+// signed integer types: `char(-1) < char(1)`, but memcmp compares `unsigned char`s
+// unsigned integer types with sizeof(T) > 1: depending on the endianness, the LSB might be the first byte to be
+// compared. This means that when comparing unsigned(129) and unsigned(2)
+// using memcmp(), the result would be that 2 > 129.
+// TODO: Do we want to enable this on big-endian systems?
+
+template <class _Tp, class _Up>
+struct __libcpp_is_trivially_lexicographically_comparable
+ : integral_constant<bool,
+ is_same<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >::value && sizeof(_Tp) == 1 &&
+ is_unsigned<_Tp>::value> {};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_LEXICOGRAPHICALLY_COMPARABLE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_move_assignable.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_move_assignable.h
index 8f8876f45aa..daf890b26c7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_move_assignable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_move_assignable.h
@@ -26,7 +26,7 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_move_assignable
bool,
__is_trivially_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_move_assignable_v = is_trivially_move_assignable<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_move_constructible.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_move_constructible.h
index 151bb256b95..71e6f898fb3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_move_constructible.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_trivially_move_constructible.h
@@ -23,7 +23,7 @@ template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible
: public integral_constant<bool, __is_trivially_constructible(_Tp, __add_rvalue_reference_t<_Tp>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_move_constructible_v = is_trivially_move_constructible<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unbounded_array.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unbounded_array.h
index 11a12607e1e..d58bb09e104 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unbounded_array.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unbounded_array.h
@@ -18,17 +18,20 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class> struct _LIBCPP_TEMPLATE_VIS __libcpp_is_unbounded_array : false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS __libcpp_is_unbounded_array<_Tp[]> : true_type {};
+template <class>
+struct _LIBCPP_TEMPLATE_VIS __libcpp_is_unbounded_array : false_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS __libcpp_is_unbounded_array<_Tp[]> : true_type {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
-template <class> struct _LIBCPP_TEMPLATE_VIS is_unbounded_array : false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_unbounded_array<_Tp[]> : true_type {};
+template <class>
+struct _LIBCPP_TEMPLATE_VIS is_unbounded_array : false_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_unbounded_array<_Tp[]> : true_type {};
template <class _Tp>
-inline constexpr
-bool is_unbounded_array_v = is_unbounded_array<_Tp>::value;
+inline constexpr bool is_unbounded_array_v = is_unbounded_array<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_union.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_union.h
index 998aedd1428..1f009d99354 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_union.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_union.h
@@ -18,10 +18,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_union
- : public integral_constant<bool, __is_union(_Tp)> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_union : public integral_constant<bool, __is_union(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_union_v = __is_union(_Tp);
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unsigned.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unsigned.h
index ee834d76e37..44f61523858 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unsigned.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unsigned.h
@@ -22,13 +22,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_unsigned) && !defined(__CUDACC__)
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_unsigned : _BoolConstant<__is_unsigned(_Tp)> { };
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_unsigned : _BoolConstant<__is_unsigned(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_unsigned_v = __is_unsigned(_Tp);
-#endif
+# endif
#else // __has_builtin(__is_unsigned)
@@ -36,19 +36,21 @@ template <class _Tp, bool = is_integral<_Tp>::value>
struct __libcpp_is_unsigned_impl : public _BoolConstant<(_Tp(0) < _Tp(-1))> {};
template <class _Tp>
-struct __libcpp_is_unsigned_impl<_Tp, false> : public false_type {}; // floating point
+struct __libcpp_is_unsigned_impl<_Tp, false> : public false_type {}; // floating point
template <class _Tp, bool = is_arithmetic<_Tp>::value>
struct __libcpp_is_unsigned : public __libcpp_is_unsigned_impl<_Tp> {};
-template <class _Tp> struct __libcpp_is_unsigned<_Tp, false> : public false_type {};
+template <class _Tp>
+struct __libcpp_is_unsigned<_Tp, false> : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_unsigned : public __libcpp_is_unsigned<_Tp> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_unsigned : public __libcpp_is_unsigned<_Tp> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_unsigned_v = is_unsigned<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_unsigned)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unsigned_integer.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unsigned_integer.h
index 54b29acd9ea..265894b32d4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unsigned_integer.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_unsigned_integer.h
@@ -18,15 +18,17 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> struct __libcpp_is_unsigned_integer : public false_type {};
-template <> struct __libcpp_is_unsigned_integer<unsigned char> : public true_type {};
-template <> struct __libcpp_is_unsigned_integer<unsigned short> : public true_type {};
-template <> struct __libcpp_is_unsigned_integer<unsigned int> : public true_type {};
-template <> struct __libcpp_is_unsigned_integer<unsigned long> : public true_type {};
-template <> struct __libcpp_is_unsigned_integer<unsigned long long> : public true_type {};
+// clang-format off
+template <class _Tp> struct __libcpp_is_unsigned_integer : public false_type {};
+template <> struct __libcpp_is_unsigned_integer<unsigned char> : public true_type {};
+template <> struct __libcpp_is_unsigned_integer<unsigned short> : public true_type {};
+template <> struct __libcpp_is_unsigned_integer<unsigned int> : public true_type {};
+template <> struct __libcpp_is_unsigned_integer<unsigned long> : public true_type {};
+template <> struct __libcpp_is_unsigned_integer<unsigned long long> : public true_type {};
#ifndef _LIBCPP_HAS_NO_INT128
-template <> struct __libcpp_is_unsigned_integer<__uint128_t> : public true_type {};
+template <> struct __libcpp_is_unsigned_integer<__uint128_t> : public true_type {};
#endif
+// clang-format on
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_valid_expansion.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_valid_expansion.h
index db7d7e5f1d0..346bc98b110 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_valid_expansion.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_valid_expansion.h
@@ -18,12 +18,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <template <class...> class _Templ, class ..._Args, class = _Templ<_Args...> >
+template <template <class...> class _Templ, class... _Args, class = _Templ<_Args...> >
true_type __sfinae_test_impl(int);
-template <template <class...> class, class ...>
+template <template <class...> class, class...>
false_type __sfinae_test_impl(...);
-template <template <class ...> class _Templ, class ..._Args>
+template <template <class...> class _Templ, class... _Args>
using _IsValidExpansion _LIBCPP_NODEBUG = decltype(std::__sfinae_test_impl<_Templ, _Args...>(0));
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_void.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_void.h
index c626a19814e..69eea76488f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_void.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_void.h
@@ -23,22 +23,22 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_void) && !defined(__CUDACC__)
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_void : _BoolConstant<__is_void(_Tp)> { };
+struct _LIBCPP_TEMPLATE_VIS is_void : _BoolConstant<__is_void(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_void_v = __is_void(_Tp);
-#endif
+# endif
#else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_void
- : public is_same<__remove_cv_t<_Tp>, void> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_void : public is_same<__remove_cv_t<_Tp>, void> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_void_v = is_void<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_void)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_volatile.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_volatile.h
index 5ca8e1d5810..cefadcb3340 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_volatile.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/is_volatile.h
@@ -21,22 +21,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_volatile) && !defined(__CUDACC__)
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_volatile : _BoolConstant<__is_volatile(_Tp)> { };
+struct _LIBCPP_TEMPLATE_VIS is_volatile : _BoolConstant<__is_volatile(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_volatile_v = __is_volatile(_Tp);
-#endif
+# endif
#else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_volatile : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_volatile<_Tp volatile> : public true_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_volatile : public false_type {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_volatile<_Tp volatile> : public true_type {};
-#if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_volatile_v = is_volatile<_Tp>::value;
-#endif
+# endif
#endif // __has_builtin(__is_volatile)
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/lazy.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/lazy.h
index 6874b06f3c5..80826f1d64f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/lazy.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/lazy.h
@@ -17,7 +17,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <template <class...> class _Func, class ..._Args>
+template <template <class...> class _Func, class... _Args>
struct _Lazy : _Func<_Args...> {};
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_32_64_or_128_bit.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_32_64_or_128_bit.h
index 87340eac7fb..f7f2e81735d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_32_64_or_128_bit.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_32_64_or_128_bit.h
@@ -27,21 +27,22 @@ _LIBCPP_BEGIN_NAMESPACE_STD
///
/// The restriction is the same as the integral version of to_char.
template <class _Tp>
-#if _LIBCPP_STD_VER > 17
- requires (is_signed_v<_Tp> || is_unsigned_v<_Tp> || is_same_v<_Tp, char>)
+#if _LIBCPP_STD_VER >= 20
+ requires(is_signed_v<_Tp> || is_unsigned_v<_Tp> || is_same_v<_Tp, char>)
#endif
+// clang-format off
using __make_32_64_or_128_bit_t =
- __copy_unsigned_t<_Tp,
- __conditional_t<sizeof(_Tp) <= sizeof(int32_t), int32_t,
- __conditional_t<sizeof(_Tp) <= sizeof(int64_t), int64_t,
+ __copy_unsigned_t<_Tp,
+ __conditional_t<sizeof(_Tp) <= sizeof(int32_t), int32_t,
+ __conditional_t<sizeof(_Tp) <= sizeof(int64_t), int64_t,
#ifndef _LIBCPP_HAS_NO_INT128
- __conditional_t<sizeof(_Tp) <= sizeof(__int128_t), __int128_t,
- /* else */ void>
+ __conditional_t<sizeof(_Tp) <= sizeof(__int128_t), __int128_t,
+ /* else */ void>
#else
- /* else */ void
+ /* else */ void
#endif
- > >
- >;
+ > > >;
+// clang-format on
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_const_lvalue_ref.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_const_lvalue_ref.h
index deea40d5e61..469d4cb31ef 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_const_lvalue_ref.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_const_lvalue_ref.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template<class _Tp>
+template <class _Tp>
using __make_const_lvalue_ref = const __libcpp_remove_reference_t<_Tp>&;
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_signed.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_signed.h
index bff8744845f..1a8a35f3859 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_signed.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_signed.h
@@ -29,30 +29,31 @@ template <class _Tp>
using __make_signed_t = __make_signed(_Tp);
#else
-typedef
- __type_list<signed char,
- __type_list<signed short,
- __type_list<signed int,
- __type_list<signed long,
- __type_list<signed long long,
+// clang-format off
+typedef __type_list<signed char,
+ __type_list<signed short,
+ __type_list<signed int,
+ __type_list<signed long,
+ __type_list<signed long long,
# ifndef _LIBCPP_HAS_NO_INT128
- __type_list<__int128_t,
+ __type_list<__int128_t,
# endif
- __nat
+ __nat
# ifndef _LIBCPP_HAS_NO_INT128
- >
+ >
# endif
- > > > > > __signed_types;
+ > > > > > __signed_types;
+// clang-format on
template <class _Tp, bool = is_integral<_Tp>::value || is_enum<_Tp>::value>
-struct __make_signed {};
+struct __make_signed{};
template <class _Tp>
-struct __make_signed<_Tp, true>
-{
- typedef typename __find_first<__signed_types, sizeof(_Tp)>::type type;
+struct __make_signed<_Tp, true> {
+ typedef typename __find_first<__signed_types, sizeof(_Tp)>::type type;
};
+// clang-format off
template <> struct __make_signed<bool, true> {};
template <> struct __make_signed< signed short, true> {typedef short type;};
template <> struct __make_signed<unsigned short, true> {typedef short type;};
@@ -66,9 +67,10 @@ template <> struct __make_signed<unsigned long long, true> {typedef long long ty
template <> struct __make_signed<__int128_t, true> {typedef __int128_t type;};
template <> struct __make_signed<__uint128_t, true> {typedef __int128_t type;};
# endif
+// clang-format on
template <class _Tp>
-using __make_signed_t = typename __apply_cv<_Tp, typename __make_signed<__remove_cv_t<_Tp> >::type>::type;
+using __make_signed_t = __apply_cv_t<_Tp, typename __make_signed<__remove_cv_t<_Tp> >::type>;
#endif // __has_builtin(__make_signed)
@@ -77,8 +79,9 @@ struct make_signed {
using type _LIBCPP_NODEBUG = __make_signed_t<_Tp>;
};
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using make_signed_t = __make_signed_t<_Tp>;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using make_signed_t = __make_signed_t<_Tp>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_unsigned.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_unsigned.h
index 33c30147a61..98967371e77 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_unsigned.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/make_unsigned.h
@@ -31,30 +31,31 @@ template <class _Tp>
using __make_unsigned_t = __make_unsigned(_Tp);
#else
-typedef
- __type_list<unsigned char,
- __type_list<unsigned short,
- __type_list<unsigned int,
- __type_list<unsigned long,
- __type_list<unsigned long long,
+// clang-format off
+typedef __type_list<unsigned char,
+ __type_list<unsigned short,
+ __type_list<unsigned int,
+ __type_list<unsigned long,
+ __type_list<unsigned long long,
# ifndef _LIBCPP_HAS_NO_INT128
- __type_list<__uint128_t,
+ __type_list<__uint128_t,
# endif
- __nat
+ __nat
# ifndef _LIBCPP_HAS_NO_INT128
- >
+ >
# endif
- > > > > > __unsigned_types;
+ > > > > > __unsigned_types;
+// clang-format on
template <class _Tp, bool = is_integral<_Tp>::value || is_enum<_Tp>::value>
-struct __make_unsigned {};
+struct __make_unsigned{};
template <class _Tp>
-struct __make_unsigned<_Tp, true>
-{
- typedef typename __find_first<__unsigned_types, sizeof(_Tp)>::type type;
+struct __make_unsigned<_Tp, true> {
+ typedef typename __find_first<__unsigned_types, sizeof(_Tp)>::type type;
};
+// clang-format off
template <> struct __make_unsigned<bool, true> {};
template <> struct __make_unsigned< signed short, true> {typedef unsigned short type;};
template <> struct __make_unsigned<unsigned short, true> {typedef unsigned short type;};
@@ -68,9 +69,10 @@ template <> struct __make_unsigned<unsigned long long, true> {typedef unsigned l
template <> struct __make_unsigned<__int128_t, true> {typedef __uint128_t type;};
template <> struct __make_unsigned<__uint128_t, true> {typedef __uint128_t type;};
# endif
+// clang-format on
template <class _Tp>
-using __make_unsigned_t = typename __apply_cv<_Tp, typename __make_unsigned<__remove_cv_t<_Tp> >::type>::type;
+using __make_unsigned_t = __apply_cv_t<_Tp, typename __make_unsigned<__remove_cv_t<_Tp> >::type>;
#endif // __has_builtin(__make_unsigned)
@@ -79,15 +81,15 @@ struct make_unsigned {
using type _LIBCPP_NODEBUG = __make_unsigned_t<_Tp>;
};
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using make_unsigned_t = __make_unsigned_t<_Tp>;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using make_unsigned_t = __make_unsigned_t<_Tp>;
#endif
#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr
-__make_unsigned_t<_Tp> __to_unsigned_like(_Tp __x) noexcept {
- return static_cast<__make_unsigned_t<_Tp> >(__x);
+_LIBCPP_HIDE_FROM_ABI constexpr __make_unsigned_t<_Tp> __to_unsigned_like(_Tp __x) noexcept {
+ return static_cast<__make_unsigned_t<_Tp> >(__x);
}
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/maybe_const.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/maybe_const.h
index 8403f6aba74..25fba58fb77 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/maybe_const.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/maybe_const.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template<bool _Const, class _Tp>
+template <bool _Const, class _Tp>
using __maybe_const = __conditional_t<_Const, const _Tp, _Tp>;
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/nat.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/nat.h
index 5216ef52042..9f39b806814 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/nat.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/nat.h
@@ -17,13 +17,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-struct __nat
-{
+struct __nat {
#ifndef _LIBCPP_CXX03_LANG
- __nat() = delete;
- __nat(const __nat&) = delete;
- __nat& operator=(const __nat&) = delete;
- ~__nat() = delete;
+ __nat() = delete;
+ __nat(const __nat&) = delete;
+ __nat& operator=(const __nat&) = delete;
+ ~__nat() = delete;
#endif
};
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/negation.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/negation.h
index b72f285a4d5..a72e62d3f96 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/negation.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/negation.h
@@ -21,12 +21,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Pred>
struct _Not : _BoolConstant<!_Pred::value> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
struct negation : _Not<_Tp> {};
-template<class _Tp>
+template <class _Tp>
inline constexpr bool negation_v = !_Tp::value;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/noexcept_move_assign_container.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/noexcept_move_assign_container.h
index 35b0e51ba40..1d6c07e8cf9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/noexcept_move_assign_container.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/noexcept_move_assign_container.h
@@ -20,15 +20,17 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >
-struct __noexcept_move_assign_container : public integral_constant<bool,
- _Traits::propagate_on_container_move_assignment::value
-#if _LIBCPP_STD_VER > 14
- || _Traits::is_always_equal::value
+template <typename _Alloc, typename _Traits = allocator_traits<_Alloc> >
+struct __noexcept_move_assign_container
+ : public integral_constant<bool,
+ _Traits::propagate_on_container_move_assignment::value
+#if _LIBCPP_STD_VER >= 17
+ || _Traits::is_always_equal::value
#else
- && is_nothrow_move_assignable<_Alloc>::value
+ && is_nothrow_move_assignable<_Alloc>::value
#endif
- > {};
+ > {
+};
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/operation_traits.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/operation_traits.h
new file mode 100644
index 00000000000..7dda93e9083
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/operation_traits.h
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___TYPE_TRAITS_OPERATION_TRAITS_H
+#define _LIBCPP___TYPE_TRAITS_OPERATION_TRAITS_H
+
+#include <__config>
+#include <__type_traits/integral_constant.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Pred, class _Lhs, class _Rhs>
+struct __is_trivial_plus_operation : false_type {};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TYPE_TRAITS_OPERATION_TRAITS_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/predicate_traits.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/predicate_traits.h
new file mode 100644
index 00000000000..872608e6ac3
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/predicate_traits.h
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___TYPE_TRAITS_PREDICATE_TRAITS
+#define _LIBCPP___TYPE_TRAITS_PREDICATE_TRAITS
+
+#include <__config>
+#include <__type_traits/integral_constant.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Pred, class _Lhs, class _Rhs>
+struct __is_trivial_equality_predicate : false_type {};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TYPE_TRAITS_PREDICATE_TRAITS
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/promote.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/promote.h
index c2af327c64f..018bd69df26 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/promote.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/promote.h
@@ -13,7 +13,6 @@
#include <__type_traits/integral_constant.h>
#include <__type_traits/is_same.h>
#include <__utility/declval.h>
-#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -22,73 +21,69 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
-struct __numeric_type
-{
- static void __test(...);
- static float __test(float);
- static double __test(char);
- static double __test(int);
- static double __test(unsigned);
- static double __test(long);
- static double __test(unsigned long);
- static double __test(long long);
- static double __test(unsigned long long);
+struct __numeric_type {
+ static void __test(...);
+ static float __test(float);
+ static double __test(char);
+ static double __test(int);
+ static double __test(unsigned);
+ static double __test(long);
+ static double __test(unsigned long);
+ static double __test(long long);
+ static double __test(unsigned long long);
#ifndef _LIBCPP_HAS_NO_INT128
- static double __test(__int128_t);
- static double __test(__uint128_t);
+ static double __test(__int128_t);
+ static double __test(__uint128_t);
#endif
- static double __test(double);
- static long double __test(long double);
+ static double __test(double);
+ static long double __test(long double);
- typedef decltype(__test(std::declval<_Tp>())) type;
- static const bool value = _IsNotSame<type, void>::value;
+ typedef decltype(__test(std::declval<_Tp>())) type;
+ static const bool value = _IsNotSame<type, void>::value;
};
template <>
-struct __numeric_type<void>
-{
- static const bool value = true;
+struct __numeric_type<void> {
+ static const bool value = true;
};
-template <class _A1, class _A2 = void, class _A3 = void,
- bool = __numeric_type<_A1>::value &&
- __numeric_type<_A2>::value &&
- __numeric_type<_A3>::value>
-class __promote_imp
-{
+template <class _A1,
+ class _A2 = void,
+ class _A3 = void,
+ bool = __numeric_type<_A1>::value&& __numeric_type<_A2>::value&& __numeric_type<_A3>::value>
+class __promote_imp {
public:
- static const bool value = false;
+ static const bool value = false;
};
template <class _A1, class _A2, class _A3>
-class __promote_imp<_A1, _A2, _A3, true>
-{
+class __promote_imp<_A1, _A2, _A3, true> {
private:
- typedef typename __promote_imp<_A1>::type __type1;
- typedef typename __promote_imp<_A2>::type __type2;
- typedef typename __promote_imp<_A3>::type __type3;
+ typedef typename __promote_imp<_A1>::type __type1;
+ typedef typename __promote_imp<_A2>::type __type2;
+ typedef typename __promote_imp<_A3>::type __type3;
+
public:
- typedef decltype(__type1() + __type2() + __type3()) type;
- static const bool value = true;
+ typedef decltype(__type1() + __type2() + __type3()) type;
+ static const bool value = true;
};
template <class _A1, class _A2>
-class __promote_imp<_A1, _A2, void, true>
-{
+class __promote_imp<_A1, _A2, void, true> {
private:
- typedef typename __promote_imp<_A1>::type __type1;
- typedef typename __promote_imp<_A2>::type __type2;
+ typedef typename __promote_imp<_A1>::type __type1;
+ typedef typename __promote_imp<_A2>::type __type2;
+
public:
- typedef decltype(__type1() + __type2()) type;
- static const bool value = true;
+ typedef decltype(__type1() + __type2()) type;
+ static const bool value = true;
};
template <class _A1>
-class __promote_imp<_A1, void, void, true>
-{
+class __promote_imp<_A1, void, void, true> {
public:
- typedef typename __numeric_type<_A1>::type type;
- static const bool value = true;
+ typedef typename __numeric_type<_A1>::type type;
+ static const bool value = true;
};
template <class _A1, class _A2 = void, class _A3 = void>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/rank.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/rank.h
index 9950907b227..7f6fad1c540 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/rank.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/rank.h
@@ -27,16 +27,16 @@ struct rank : integral_constant<size_t, __array_rank(_Tp)> {};
#else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS rank
- : public integral_constant<size_t, 0> {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS rank<_Tp[]>
- : public integral_constant<size_t, rank<_Tp>::value + 1> {};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS rank<_Tp[_Np]>
- : public integral_constant<size_t, rank<_Tp>::value + 1> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS rank : public integral_constant<size_t, 0> {};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS rank<_Tp[]> : public integral_constant<size_t, rank<_Tp>::value + 1> {};
+template <class _Tp, size_t _Np>
+struct _LIBCPP_TEMPLATE_VIS rank<_Tp[_Np]> : public integral_constant<size_t, rank<_Tp>::value + 1> {};
#endif // __has_builtin(__array_rank)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr size_t rank_v = rank<_Tp>::value;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_all_extents.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_all_extents.h
index 868cf1039f6..d5373b51f52 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_all_extents.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_all_extents.h
@@ -27,19 +27,26 @@ struct remove_all_extents {
template <class _Tp>
using __remove_all_extents_t = __remove_all_extents(_Tp);
#else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_all_extents
- {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[]>
- {typedef typename remove_all_extents<_Tp>::type type;};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[_Np]>
- {typedef typename remove_all_extents<_Tp>::type type;};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS remove_all_extents {
+ typedef _Tp type;
+};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[]> {
+ typedef typename remove_all_extents<_Tp>::type type;
+};
+template <class _Tp, size_t _Np>
+struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[_Np]> {
+ typedef typename remove_all_extents<_Tp>::type type;
+};
template <class _Tp>
using __remove_all_extents_t = typename remove_all_extents<_Tp>::type;
#endif // __has_builtin(__remove_all_extents)
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_all_extents_t = __remove_all_extents_t<_Tp>;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using remove_all_extents_t = __remove_all_extents_t<_Tp>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_const.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_const.h
index dc565338548..a3f0648c478 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_const.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_const.h
@@ -26,15 +26,22 @@ struct remove_const {
template <class _Tp>
using __remove_const_t = __remove_const(_Tp);
#else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_const {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_const<const _Tp> {typedef _Tp type;};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS remove_const {
+ typedef _Tp type;
+};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS remove_const<const _Tp> {
+ typedef _Tp type;
+};
template <class _Tp>
using __remove_const_t = typename remove_const<_Tp>::type;
#endif // __has_builtin(__remove_const)
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_const_t = __remove_const_t<_Tp>;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using remove_const_t = __remove_const_t<_Tp>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_cv.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_cv.h
index ea85e23b806..c4bf612794b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_cv.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_cv.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if __has_builtin(__remove_cv)
+#if __has_builtin(__remove_cv) && !defined(_LIBCPP_COMPILER_GCC)
template <class _Tp>
struct remove_cv {
using type _LIBCPP_NODEBUG = __remove_cv(_Tp);
@@ -28,15 +28,18 @@ struct remove_cv {
template <class _Tp>
using __remove_cv_t = __remove_cv(_Tp);
#else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
-{typedef __remove_volatile_t<__remove_const_t<_Tp> > type;};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS remove_cv {
+ typedef __remove_volatile_t<__remove_const_t<_Tp> > type;
+};
template <class _Tp>
using __remove_cv_t = __remove_volatile_t<__remove_const_t<_Tp> >;
#endif // __has_builtin(__remove_cv)
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_cv_t = __remove_cv_t<_Tp>;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using remove_cv_t = __remove_cv_t<_Tp>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_cvref.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_cvref.h
index a654398592e..3ec17b4dded 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_cvref.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_cvref.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if __has_builtin(__remove_cvref) && !defined(__CUDACC__)
+#if __has_builtin(__remove_cvref) && !defined(_LIBCPP_COMPILER_GCC) && !defined(__CUDACC__)
template <class _Tp>
using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp);
#else
@@ -31,14 +31,14 @@ using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cv_t<__libcpp_remove_reference
template <class _Tp, class _Up>
struct __is_same_uncvref : _IsSame<__remove_cvref_t<_Tp>, __remove_cvref_t<_Up> > {};
-// C++20, enabled for C++17 in Arcadia
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 20
template <class _Tp>
struct remove_cvref {
- using type _LIBCPP_NODEBUG = __remove_cvref_t<_Tp>;
+ using type _LIBCPP_NODEBUG = __remove_cvref_t<_Tp>;
};
-template <class _Tp> using remove_cvref_t = __remove_cvref_t<_Tp>;
+template <class _Tp>
+using remove_cvref_t = __remove_cvref_t<_Tp>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_extent.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_extent.h
index 79d6e573ddd..fe37b5c7266 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_extent.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_extent.h
@@ -27,19 +27,26 @@ struct remove_extent {
template <class _Tp>
using __remove_extent_t = __remove_extent(_Tp);
#else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_extent
- {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[]>
- {typedef _Tp type;};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[_Np]>
- {typedef _Tp type;};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS remove_extent {
+ typedef _Tp type;
+};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[]> {
+ typedef _Tp type;
+};
+template <class _Tp, size_t _Np>
+struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[_Np]> {
+ typedef _Tp type;
+};
template <class _Tp>
using __remove_extent_t = typename remove_extent<_Tp>::type;
#endif // __has_builtin(__remove_extent)
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_extent_t = __remove_extent_t<_Tp>;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using remove_extent_t = __remove_extent_t<_Tp>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_pointer.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_pointer.h
index 2f810ba666b..54390a1939f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_pointer.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_pointer.h
@@ -26,18 +26,21 @@ struct remove_pointer {
template <class _Tp>
using __remove_pointer_t = __remove_pointer(_Tp);
#else
+// clang-format off
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer {typedef _LIBCPP_NODEBUG _Tp type;};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp*> {typedef _LIBCPP_NODEBUG _Tp type;};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const> {typedef _LIBCPP_NODEBUG _Tp type;};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* volatile> {typedef _LIBCPP_NODEBUG _Tp type;};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const volatile> {typedef _LIBCPP_NODEBUG _Tp type;};
+// clang-format on
template <class _Tp>
using __remove_pointer_t = typename remove_pointer<_Tp>::type;
#endif // !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__remove_pointer)
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_pointer_t = __remove_pointer_t<_Tp>;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using remove_pointer_t = __remove_pointer_t<_Tp>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_reference.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_reference.h
index b9a69749b3b..fd66417bd84 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_reference.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_reference.h
@@ -27,16 +27,19 @@ struct remove_reference {
template <class _Tp>
using __libcpp_remove_reference_t = __remove_reference_t(_Tp);
#else
+// clang-format off
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference {typedef _LIBCPP_NODEBUG _Tp type;};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&> {typedef _LIBCPP_NODEBUG _Tp type;};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG _Tp type;};
+// clang-format on
template <class _Tp>
using __libcpp_remove_reference_t = typename remove_reference<_Tp>::type;
#endif // __has_builtin(__remove_reference_t)
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_reference_t = __libcpp_remove_reference_t<_Tp>;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using remove_reference_t = __libcpp_remove_reference_t<_Tp>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_volatile.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_volatile.h
index ed6d63b4174..7600ae0ec51 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_volatile.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/remove_volatile.h
@@ -26,15 +26,22 @@ struct remove_volatile {
template <class _Tp>
using __remove_volatile_t = __remove_volatile(_Tp);
#else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_volatile<volatile _Tp> {typedef _Tp type;};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS remove_volatile {
+ typedef _Tp type;
+};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS remove_volatile<volatile _Tp> {
+ typedef _Tp type;
+};
template <class _Tp>
using __remove_volatile_t = typename remove_volatile<_Tp>::type;
#endif // __has_builtin(__remove_volatile)
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_volatile_t = __remove_volatile_t<_Tp>;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using remove_volatile_t = __remove_volatile_t<_Tp>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/result_of.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/result_of.h
index 804173e15e2..f00fa8e9be7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/result_of.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/result_of.h
@@ -21,18 +21,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// result_of
#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
-template <class _Callable> class _LIBCPP_DEPRECATED_IN_CXX17 result_of;
-
-template <class _Fp, class ..._Args>
-class _LIBCPP_TEMPLATE_VIS result_of<_Fp(_Args...)>
- : public __invoke_of<_Fp, _Args...>
-{
-};
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using result_of_t _LIBCPP_DEPRECATED_IN_CXX17 = typename result_of<_Tp>::type;
-#endif // _LIBCPP_STD_VER > 11
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
+template <class _Callable>
+class _LIBCPP_DEPRECATED_IN_CXX17 result_of;
+
+template <class _Fp, class... _Args>
+class _LIBCPP_TEMPLATE_VIS result_of<_Fp(_Args...)> : public __invoke_of<_Fp, _Args...> {};
+
+# if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using result_of_t _LIBCPP_DEPRECATED_IN_CXX17 = typename result_of<_Tp>::type;
+# endif // _LIBCPP_STD_VER >= 14
+#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/strip_signature.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/strip_signature.h
index 2bb7393c1ee..3fe79592f55 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/strip_signature.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/strip_signature.h
@@ -19,23 +19,24 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template<class _Fp>
+template <class _Fp>
struct __strip_signature;
# if defined(__cpp_static_call_operator) && __cpp_static_call_operator >= 202207L
template <class _Rp, class... _Args>
-struct __strip_signature<_Rp(*)(_Args...)> {
+struct __strip_signature<_Rp (*)(_Args...)> {
using type = _Rp(_Args...);
};
template <class _Rp, class... _Args>
-struct __strip_signature<_Rp(*)(_Args...) noexcept> {
+struct __strip_signature<_Rp (*)(_Args...) noexcept> {
using type = _Rp(_Args...);
};
# endif // defined(__cpp_static_call_operator) && __cpp_static_call_operator >= 202207L
+// clang-format off
template<class _Rp, class _Gp, class ..._Ap>
struct __strip_signature<_Rp (_Gp::*) (_Ap...)> { using type = _Rp(_Ap...); };
template<class _Rp, class _Gp, class ..._Ap>
@@ -71,6 +72,7 @@ template<class _Rp, class _Gp, class ..._Ap>
struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile & noexcept> { using type = _Rp(_Ap...); };
template<class _Rp, class _Gp, class ..._Ap>
struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { using type = _Rp(_Ap...); };
+// clang-format on
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/type_identity.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/type_identity.h
index 42e52b16725..b0b5a1277d5 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/type_identity.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/type_identity.h
@@ -18,14 +18,20 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
-struct __type_identity { typedef _Tp type; };
+struct __type_identity {
+ typedef _Tp type;
+};
template <class _Tp>
using __type_identity_t _LIBCPP_NODEBUG = typename __type_identity<_Tp>::type;
-#if _LIBCPP_STD_VER > 17
-template<class _Tp> struct type_identity { typedef _Tp type; };
-template<class _Tp> using type_identity_t = typename type_identity<_Tp>::type;
+#if _LIBCPP_STD_VER >= 20
+template <class _Tp>
+struct type_identity {
+ typedef _Tp type;
+};
+template <class _Tp>
+using type_identity_t = typename type_identity<_Tp>::type;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/type_list.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/type_list.h
index 5a9e3319a1d..02905707ee3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/type_list.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/type_list.h
@@ -19,24 +19,22 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Hp, class _Tp>
-struct __type_list
-{
- typedef _Hp _Head;
- typedef _Tp _Tail;
+struct __type_list {
+ typedef _Hp _Head;
+ typedef _Tp _Tail;
};
-template <class _TypeList, size_t _Size, bool = _Size <= sizeof(typename _TypeList::_Head)> struct __find_first;
+template <class _TypeList, size_t _Size, bool = _Size <= sizeof(typename _TypeList::_Head)>
+struct __find_first;
template <class _Hp, class _Tp, size_t _Size>
-struct __find_first<__type_list<_Hp, _Tp>, _Size, true>
-{
- typedef _LIBCPP_NODEBUG _Hp type;
+struct __find_first<__type_list<_Hp, _Tp>, _Size, true> {
+ typedef _LIBCPP_NODEBUG _Hp type;
};
template <class _Hp, class _Tp, size_t _Size>
-struct __find_first<__type_list<_Hp, _Tp>, _Size, false>
-{
- typedef _LIBCPP_NODEBUG typename __find_first<_Tp, _Size>::type type;
+struct __find_first<__type_list<_Hp, _Tp>, _Size, false> {
+ typedef _LIBCPP_NODEBUG typename __find_first<_Tp, _Size>::type type;
};
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/underlying_type.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/underlying_type.h
index 1c8db643237..16e7501dee1 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/underlying_type.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/underlying_type.h
@@ -18,22 +18,23 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp, bool = is_enum<_Tp>::value> struct __underlying_type_impl;
+template <class _Tp, bool = is_enum<_Tp>::value>
+struct __underlying_type_impl;
template <class _Tp>
struct __underlying_type_impl<_Tp, false> {};
template <class _Tp>
-struct __underlying_type_impl<_Tp, true>
-{
- typedef __underlying_type(_Tp) type;
+struct __underlying_type_impl<_Tp, true> {
+ typedef __underlying_type(_Tp) type;
};
template <class _Tp>
struct underlying_type : __underlying_type_impl<_Tp, is_enum<_Tp>::value> {};
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using underlying_type_t = typename underlying_type<_Tp>::type;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+using underlying_type_t = typename underlying_type<_Tp>::type;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/unwrap_ref.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/unwrap_ref.h
new file mode 100644
index 00000000000..5fed08f7ddd
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/unwrap_ref.h
@@ -0,0 +1,63 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___TYPE_TRAITS_UNWRAP_REF_H
+#define _LIBCPP___TYPE_TRAITS_UNWRAP_REF_H
+
+#include <__config>
+#include <__type_traits/decay.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct __unwrap_reference {
+ typedef _LIBCPP_NODEBUG _Tp type;
+};
+
+template <class _Tp>
+class reference_wrapper;
+
+template <class _Tp>
+struct __unwrap_reference<reference_wrapper<_Tp> > {
+ typedef _LIBCPP_NODEBUG _Tp& type;
+};
+
+template <class _Tp>
+struct decay;
+
+#if _LIBCPP_STD_VER >= 20
+template <class _Tp>
+struct unwrap_reference : __unwrap_reference<_Tp> {};
+
+template <class _Tp>
+using unwrap_reference_t = typename unwrap_reference<_Tp>::type;
+
+template <class _Tp>
+struct unwrap_ref_decay : unwrap_reference<__decay_t<_Tp> > {};
+
+template <class _Tp>
+using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type;
+#endif // _LIBCPP_STD_VER >= 20
+
+template <class _Tp>
+struct __unwrap_ref_decay
+#if _LIBCPP_STD_VER >= 20
+ : unwrap_ref_decay<_Tp>
+#else
+ : __unwrap_reference<__decay_t<_Tp> >
+#endif
+{
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TYPE_TRAITS_UNWRAP_REF_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__type_traits/void_t.h b/contrib/libs/cxxsupp/libcxx/include/__type_traits/void_t.h
index 1ed4e435487..985bba02e72 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__type_traits/void_t.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__type_traits/void_t.h
@@ -17,8 +17,9 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
-template <class...> using void_t = void;
+#if _LIBCPP_STD_VER >= 17
+template <class...>
+using void_t = void;
#endif
template <class...>
diff --git a/contrib/libs/cxxsupp/libcxx/include/__undef_macros b/contrib/libs/cxxsupp/libcxx/include/__undef_macros
index 3bacbbacb50..29ab327e1c3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__undef_macros
+++ b/contrib/libs/cxxsupp/libcxx/include/__undef_macros
@@ -14,3 +14,15 @@
#ifdef max
# undef max
#endif
+
+#ifdef refresh
+# undef refresh
+#endif
+
+#ifdef move
+# undef move
+#endif
+
+#ifdef erase
+# undef erase
+#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/as_const.h b/contrib/libs/cxxsupp/libcxx/include/__utility/as_const.h
index d4a72f43d4f..b5c6091ecfe 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/as_const.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/as_const.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { return __t; }
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/auto_cast.h b/contrib/libs/cxxsupp/libcxx/include/__utility/auto_cast.h
index 381ed0c205b..06715b3438f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/auto_cast.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/auto_cast.h
@@ -17,6 +17,6 @@
# pragma GCC system_header
#endif
-#define _LIBCPP_AUTO_CAST(expr) static_cast<typename decay<decltype((expr))>::type>(expr)
+#define _LIBCPP_AUTO_CAST(expr) static_cast<::std::__decay_t<decltype((expr))> >(expr)
#endif // _LIBCPP___UTILITY_AUTO_CAST_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/cmp.h b/contrib/libs/cxxsupp/libcxx/include/__utility/cmp.h
index d448a1d084b..7b7b90136e1 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/cmp.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/cmp.h
@@ -28,7 +28,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Tp, class... _Up>
struct _IsSameAsAny : _Or<_IsSame<_Tp, _Up>...> {};
@@ -102,7 +102,7 @@ bool in_range(_Up __u) noexcept
return _VSTD::cmp_less_equal(__u, numeric_limits<_Tp>::max()) &&
_VSTD::cmp_greater_equal(__u, numeric_limits<_Tp>::min());
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h b/contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h
index 46f9359a5c0..389fca6c710 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h
@@ -19,6 +19,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
// __exception_guard is a helper class for writing code with the strong exception guarantee.
@@ -41,7 +44,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// less common, especially one that tries to catch an exception through -fno-exceptions code.
//
// __exception_guard can help greatly simplify code that would normally be cluttered by
-// `#if _LIBCPP_NO_EXCEPTIONS`. For example:
+// `#if _LIBCPP_HAS_NO_EXCEPTIONS`. For example:
//
// template <class Iterator, class Size, class OutputIterator>
// Iterator uninitialized_copy_n(Iterator iter, Size n, OutputIterator out) {
@@ -58,7 +61,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// }
//
-#ifndef _LIBCPP_NO_EXCEPTIONS
template <class _Rollback>
struct __exception_guard_exceptions {
__exception_guard_exceptions() = delete;
@@ -92,9 +94,6 @@ private:
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__exception_guard_exceptions);
template <class _Rollback>
-using __exception_guard = __exception_guard_exceptions<_Rollback>;
-#else // _LIBCPP_NO_EXCEPTIONS
-template <class _Rollback>
struct __exception_guard_noexceptions {
__exception_guard_noexceptions() = delete;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -116,7 +115,7 @@ struct __exception_guard_noexceptions {
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NODEBUG ~__exception_guard_noexceptions() {
- _LIBCPP_ASSERT(__completed_, "__exception_guard not completed with exceptions disabled");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__completed_, "__exception_guard not completed with exceptions disabled");
}
private:
@@ -125,9 +124,13 @@ private:
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__exception_guard_noexceptions);
+#ifdef _LIBCPP_HAS_NO_EXCEPTIONS
template <class _Rollback>
using __exception_guard = __exception_guard_noexceptions<_Rollback>;
-#endif // _LIBCPP_NO_EXCEPTIONS
+#else
+template <class _Rollback>
+using __exception_guard = __exception_guard_exceptions<_Rollback>;
+#endif
template <class _Rollback>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __exception_guard<_Rollback> __make_exception_guard(_Rollback __rollback) {
@@ -136,4 +139,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __exception_guard<_Rollback> __make_exce
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___UTILITY_TRANSACTION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/exchange.h b/contrib/libs/cxxsupp/libcxx/include/__utility/exchange.h
index 8df71a17b1c..4cbc921b739 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/exchange.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/exchange.h
@@ -19,9 +19,12 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template<class _T1, class _T2 = _T1>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
_T1 exchange(_T1& __obj, _T2&& __new_value)
@@ -31,8 +34,10 @@ _T1 exchange(_T1& __obj, _T2&& __new_value)
__obj = _VSTD::forward<_T2>(__new_value);
return __old_value;
}
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___UTILITY_EXCHANGE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/forward_like.h b/contrib/libs/cxxsupp/libcxx/include/__utility/forward_like.h
index 7bb0d7d2033..ce11b640fc4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/forward_like.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/forward_like.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Ap, class _Bp>
using _CopyConst = _If<is_const_v<_Ap>, const _Bp, _Bp>;
@@ -39,7 +39,7 @@ template <class _Tp, class _Up>
return static_cast<_ForwardLike<_Tp, _Up>>(__ux);
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/in_place.h b/contrib/libs/cxxsupp/libcxx/include/__utility/in_place.h
index a3518455e25..5b878529fb2 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/in_place.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/in_place.h
@@ -19,23 +19,23 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
-struct _LIBCPP_TYPE_VIS in_place_t {
- explicit in_place_t() = default;
+struct _LIBCPP_EXPORTED_FROM_ABI in_place_t {
+ explicit in_place_t() = default;
};
inline constexpr in_place_t in_place{};
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS in_place_type_t {
- explicit in_place_type_t() = default;
+ _LIBCPP_HIDE_FROM_ABI explicit in_place_type_t() = default;
};
template <class _Tp>
inline constexpr in_place_type_t<_Tp> in_place_type{};
template <size_t _Idx>
struct _LIBCPP_TEMPLATE_VIS in_place_index_t {
- explicit in_place_index_t() = default;
+ _LIBCPP_HIDE_FROM_ABI explicit in_place_index_t() = default;
};
template <size_t _Idx>
inline constexpr in_place_index_t<_Idx> in_place_index{};
@@ -52,7 +52,7 @@ template <size_t _Idx> struct __is_inplace_index_imp<in_place_index_t<_Idx>> : t
template <class _Tp>
using __is_inplace_index = __is_inplace_index_imp<__remove_cvref_t<_Tp>>;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/integer_sequence.h b/contrib/libs/cxxsupp/libcxx/include/__utility/integer_sequence.h
index 257b4301c08..633b387d02e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/integer_sequence.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/integer_sequence.h
@@ -85,7 +85,7 @@ using __make_indices_imp =
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template<class _Tp, _Tp... _Ip>
struct _LIBCPP_TEMPLATE_VIS integer_sequence
@@ -138,15 +138,15 @@ template<size_t _Np>
template<class... _Tp>
using index_sequence_for = make_index_sequence<sizeof...(_Tp)>;
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
// Executes __func for every element in an index_sequence.
template <size_t... _Index, class _Function>
_LIBCPP_HIDE_FROM_ABI constexpr void __for_each_index_sequence(index_sequence<_Index...>, _Function __func) {
(__func.template operator()<_Index>(), ...);
}
-# endif // _LIBCPP_STD_VER > 17
+# endif // _LIBCPP_STD_VER >= 20
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/is_pointer_in_range.h b/contrib/libs/cxxsupp/libcxx/include/__utility/is_pointer_in_range.h
new file mode 100644
index 00000000000..e859562e745
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/is_pointer_in_range.h
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___UTILITY_IS_POINTER_IN_RANGE_H
+#define _LIBCPP___UTILITY_IS_POINTER_IN_RANGE_H
+
+#include <__algorithm/comp.h>
+#include <__assert>
+#include <__config>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_constant_evaluated.h>
+#include <__type_traits/void_t.h>
+#include <__utility/declval.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, class _Up, class = void>
+struct __is_less_than_comparable : false_type {};
+
+template <class _Tp, class _Up>
+struct __is_less_than_comparable<_Tp, _Up, __void_t<decltype(std::declval<_Tp>() < std::declval<_Up>())> > : true_type {
+};
+
+template <class _Tp, class _Up, __enable_if_t<__is_less_than_comparable<const _Tp*, const _Up*>::value, int> = 0>
+_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool __is_pointer_in_range(
+ const _Tp* __begin, const _Tp* __end, const _Up* __ptr) {
+ if (__libcpp_is_constant_evaluated()) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__builtin_constant_p(__begin <= __end), "__begin and __end do not form a range");
+
+ // If this is not a constant during constant evaluation we know that __ptr is not part of the allocation where
+ // [__begin, __end) is.
+ if (!__builtin_constant_p(__begin <= __ptr && __ptr < __end))
+ return false;
+ }
+
+ // Checking this for unrelated pointers is technically UB, but no compiler optimizes based on it (currently).
+ return !__less<>()(__ptr, __begin) && __less<>()(__ptr, __end);
+}
+
+template <class _Tp, class _Up, __enable_if_t<!__is_less_than_comparable<const _Tp*, const _Up*>::value, int> = 0>
+_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool __is_pointer_in_range(
+ const _Tp* __begin, const _Tp* __end, const _Up* __ptr) {
+ if (__libcpp_is_constant_evaluated())
+ return false;
+
+ return reinterpret_cast<const char*>(__begin) <= reinterpret_cast<const char*>(__ptr) &&
+ reinterpret_cast<const char*>(__ptr) < reinterpret_cast<const char*>(__end);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___UTILITY_IS_POINTER_IN_RANGE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/move.h b/contrib/libs/cxxsupp/libcxx/include/__utility/move.h
index 4859c39e8bd..86d7fc88473 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/move.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/move.h
@@ -20,6 +20,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
@@ -41,4 +44,6 @@ move_if_noexcept(_LIBCPP_LIFETIMEBOUND _Tp& __x) _NOEXCEPT {
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___UTILITY_MOVE_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h b/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h
index 8151674bcc5..6b8c43dbe6e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h
@@ -11,17 +11,23 @@
#include <__compare/common_comparison_category.h>
#include <__compare/synth_three_way.h>
+#include <__concepts/different_from.h>
#include <__config>
-#include <__functional/unwrap_ref.h>
+#include <__fwd/array.h>
#include <__fwd/get.h>
+#include <__fwd/pair.h>
+#include <__fwd/subrange.h>
#include <__fwd/tuple.h>
-#include <__tuple_dir/sfinae_helpers.h>
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_indices.h>
-#include <__tuple_dir/tuple_size.h>
+#include <__tuple/pair_like.h>
+#include <__tuple/sfinae_helpers.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_indices.h>
+#include <__tuple/tuple_size.h>
#include <__type_traits/common_reference.h>
#include <__type_traits/common_type.h>
#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/integral_constant.h>
#include <__type_traits/is_assignable.h>
#include <__type_traits/is_constructible.h>
#include <__type_traits/is_convertible.h>
@@ -38,6 +44,9 @@
#include <__type_traits/is_same.h>
#include <__type_traits/is_swappable.h>
#include <__type_traits/nat.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/unwrap_ref.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/piecewise_construct.h>
@@ -47,16 +56,25 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
template <class, class>
struct __non_trivially_copyable_base {
- _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI
__non_trivially_copyable_base() _NOEXCEPT {}
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI
__non_trivially_copyable_base(__non_trivially_copyable_base const&) _NOEXCEPT {}
};
+
+#if _LIBCPP_STD_VER >= 23
+template <class _Tp>
+struct __is_specialization_of_subrange : false_type {};
+
+template <class _Iter, class _Sent, ranges::subrange_kind _Kind>
+struct __is_specialization_of_subrange<ranges::subrange<_Iter, _Sent, _Kind>> : true_type {};
#endif
template <class _T1, class _T2>
@@ -65,66 +83,80 @@ struct _LIBCPP_TEMPLATE_VIS pair
: private __non_trivially_copyable_base<_T1, _T2>
#endif
{
- typedef _T1 first_type;
- typedef _T2 second_type;
+ using first_type = _T1;
+ using second_type = _T2;
_T1 first;
_T2 second;
- pair(pair const&) = default;
- pair(pair&&) = default;
+ _LIBCPP_HIDE_FROM_ABI pair(pair const&) = default;
+ _LIBCPP_HIDE_FROM_ABI pair(pair&&) = default;
#ifdef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
pair() : first(), second() {}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
pair(_T1 const& __t1, _T2 const& __t2) : first(__t1), second(__t2) {}
template <class _U1, class _U2>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
pair& operator=(pair const& __p) {
first = __p.first;
second = __p.second;
return *this;
}
+
+ // Extension: This is provided in C++03 because it allows properly handling the
+ // assignment to a pair containing references, which would be a hard
+ // error otherwise.
+ template <class _U1, class _U2, class = __enable_if_t<
+ is_assignable<first_type&, _U1 const&>::value &&
+ is_assignable<second_type&, _U2 const&>::value
+ > >
+ _LIBCPP_HIDE_FROM_ABI
+ pair& operator=(pair<_U1, _U2> const& __p) {
+ first = __p.first;
+ second = __p.second;
+ return *this;
+ }
#else
struct _CheckArgs {
template <int&...>
- static constexpr bool __enable_explicit_default() {
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit_default() {
return is_default_constructible<_T1>::value
&& is_default_constructible<_T2>::value
&& !__enable_implicit_default<>();
}
template <int&...>
- static constexpr bool __enable_implicit_default() {
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit_default() {
return __is_implicitly_default_constructible<_T1>::value
&& __is_implicitly_default_constructible<_T2>::value;
}
template <class _U1, class _U2>
- static constexpr bool __is_pair_constructible() {
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __is_pair_constructible() {
return is_constructible<first_type, _U1>::value
&& is_constructible<second_type, _U2>::value;
}
template <class _U1, class _U2>
- static constexpr bool __is_implicit() {
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __is_implicit() {
return is_convertible<_U1, first_type>::value
&& is_convertible<_U2, second_type>::value;
}
template <class _U1, class _U2>
- static constexpr bool __enable_explicit() {
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit() {
return __is_pair_constructible<_U1, _U2>() && !__is_implicit<_U1, _U2>();
}
template <class _U1, class _U2>
- static constexpr bool __enable_implicit() {
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit() {
return __is_pair_constructible<_U1, _U2>() && __is_implicit<_U1, _U2>();
}
};
@@ -133,36 +165,10 @@ struct _LIBCPP_TEMPLATE_VIS pair
using _CheckArgsDep _LIBCPP_NODEBUG = typename conditional<
_MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type;
- struct _CheckTupleLikeConstructor {
- template <class _Tuple>
- static constexpr bool __enable_implicit() {
- return __tuple_convertible<_Tuple, pair>::value;
- }
-
- template <class _Tuple>
- static constexpr bool __enable_explicit() {
- return __tuple_constructible<_Tuple, pair>::value
- && !__tuple_convertible<_Tuple, pair>::value;
- }
-
- template <class _Tuple>
- static constexpr bool __enable_assign() {
- return __tuple_assignable<_Tuple, pair>::value;
- }
- };
-
- template <class _Tuple>
- using _CheckTLC _LIBCPP_NODEBUG = __conditional_t<
- __tuple_like_with_size<_Tuple, 2>::value
- && !is_same<typename decay<_Tuple>::type, pair>::value,
- _CheckTupleLikeConstructor,
- __check_tuple_constructor_fail
- >;
-
template<bool _Dummy = true, typename enable_if<
_CheckArgsDep<_Dummy>::__enable_explicit_default()
>::type* = nullptr>
- explicit _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value &&
is_nothrow_default_constructible<second_type>::value)
: first(), second() {}
@@ -170,7 +176,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
template<bool _Dummy = true, typename enable_if<
_CheckArgsDep<_Dummy>::__enable_implicit_default()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value &&
is_nothrow_default_constructible<second_type>::value)
: first(), second() {}
@@ -178,7 +184,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
template <bool _Dummy = true, typename enable_if<
_CheckArgsDep<_Dummy>::template __enable_explicit<_T1 const&, _T2 const&>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
explicit pair(_T1 const& __t1, _T2 const& __t2)
_NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
is_nothrow_copy_constructible<second_type>::value)
@@ -187,41 +193,41 @@ struct _LIBCPP_TEMPLATE_VIS pair
template<bool _Dummy = true, typename enable_if<
_CheckArgsDep<_Dummy>::template __enable_implicit<_T1 const&, _T2 const&>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair(_T1 const& __t1, _T2 const& __t2)
_NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
is_nothrow_copy_constructible<second_type>::value)
: first(__t1), second(__t2) {}
template <
-#if _LIBCPP_STD_VER > 20 // http://wg21.link/P1951
+#if _LIBCPP_STD_VER >= 23 // http://wg21.link/P1951
class _U1 = _T1, class _U2 = _T2,
#else
class _U1, class _U2,
#endif
typename enable_if<_CheckArgs::template __enable_explicit<_U1, _U2>()>::type* = nullptr
>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
explicit pair(_U1&& __u1, _U2&& __u2)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value &&
is_nothrow_constructible<second_type, _U2>::value))
- : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
+ : first(std::forward<_U1>(__u1)), second(std::forward<_U2>(__u2)) {}
template <
-#if _LIBCPP_STD_VER > 20 // http://wg21.link/P1951
+#if _LIBCPP_STD_VER >= 23 // http://wg21.link/P1951
class _U1 = _T1, class _U2 = _T2,
#else
class _U1, class _U2,
#endif
typename enable_if<_CheckArgs::template __enable_implicit<_U1, _U2>()>::type* = nullptr
>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair(_U1&& __u1, _U2&& __u2)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value &&
is_nothrow_constructible<second_type, _U2>::value))
- : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
+ : first(std::forward<_U1>(__u1)), second(std::forward<_U2>(__u2)) {}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template<class _U1, class _U2, __enable_if_t<
_CheckArgs::template __is_pair_constructible<_U1&, _U2&>()
>* = nullptr>
@@ -235,7 +241,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
template<class _U1, class _U2, typename enable_if<
_CheckArgs::template __enable_explicit<_U1 const&, _U2 const&>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
explicit pair(pair<_U1, _U2> const& __p)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
is_nothrow_constructible<second_type, _U2 const&>::value))
@@ -244,7 +250,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
template<class _U1, class _U2, typename enable_if<
_CheckArgs::template __enable_implicit<_U1 const&, _U2 const&>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair(pair<_U1, _U2> const& __p)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
is_nothrow_constructible<second_type, _U2 const&>::value))
@@ -253,22 +259,22 @@ struct _LIBCPP_TEMPLATE_VIS pair
template<class _U1, class _U2, typename enable_if<
_CheckArgs::template __enable_explicit<_U1, _U2>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
explicit pair(pair<_U1, _U2>&&__p)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
is_nothrow_constructible<second_type, _U2&&>::value))
- : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
+ : first(std::forward<_U1>(__p.first)), second(std::forward<_U2>(__p.second)) {}
template<class _U1, class _U2, typename enable_if<
_CheckArgs::template __enable_implicit<_U1, _U2>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair(pair<_U1, _U2>&& __p)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
is_nothrow_constructible<second_type, _U2&&>::value))
- : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
+ : first(std::forward<_U1>(__p.first)), second(std::forward<_U2>(__p.second)) {}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template<class _U1, class _U2, __enable_if_t<
_CheckArgs::template __is_pair_constructible<const _U1&&, const _U2&&>()
>* = nullptr>
@@ -280,24 +286,27 @@ struct _LIBCPP_TEMPLATE_VIS pair
: first(std::move(__p.first)), second(std::move(__p.second)) {}
#endif
- template<class _Tuple, typename enable_if<
- _CheckTLC<_Tuple>::template __enable_explicit<_Tuple>()
- >::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
- explicit pair(_Tuple&& __p)
- : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
- second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
+# if _LIBCPP_STD_VER >= 23
+ // This is a workaround for http://llvm.org/PR60710. We should be able to remove it once Clang is fixed.
+ template <class _PairLike>
+ _LIBCPP_HIDE_FROM_ABI static constexpr bool __pair_like_explicit_wknd() {
+ if constexpr (__pair_like<_PairLike>) {
+ return !is_convertible_v<decltype(std::get<0>(std::declval<_PairLike&&>())), first_type> ||
+ !is_convertible_v<decltype(std::get<1>(std::declval<_PairLike&&>())), second_type>;
+ }
+ return false;
+ }
- template<class _Tuple, typename enable_if<
- _CheckTLC<_Tuple>::template __enable_implicit<_Tuple>()
- >::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
- pair(_Tuple&& __p)
- : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
- second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
+ template <__pair_like _PairLike>
+ requires(is_constructible_v<first_type, decltype(std::get<0>(std::declval<_PairLike&&>()))> &&
+ is_constructible_v<second_type, decltype(std::get<1>(std::declval<_PairLike&&>()))>)
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit(__pair_like_explicit_wknd<_PairLike>())
+ pair(_PairLike&& __p)
+ : first(std::get<0>(std::forward<_PairLike>(__p))), second(std::get<1>(std::forward<_PairLike>(__p))) {}
+# endif
template <class... _Args1, class... _Args2>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
pair(piecewise_construct_t __pc,
tuple<_Args1...> __first_args, tuple<_Args2...> __second_args)
_NOEXCEPT_((is_nothrow_constructible<first_type, _Args1...>::value &&
@@ -306,7 +315,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
typename __make_tuple_indices<sizeof...(_Args1)>::type(),
typename __make_tuple_indices<sizeof...(_Args2) >::type()) {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
pair& operator=(__conditional_t<
is_copy_assignable<first_type>::value &&
is_copy_assignable<second_type>::value,
@@ -319,7 +328,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
return *this;
}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
pair& operator=(__conditional_t<
is_move_assignable<first_type>::value &&
is_move_assignable<second_type>::value,
@@ -327,12 +336,34 @@ struct _LIBCPP_TEMPLATE_VIS pair
_NOEXCEPT_(is_nothrow_move_assignable<first_type>::value &&
is_nothrow_move_assignable<second_type>::value)
{
- first = _VSTD::forward<first_type>(__p.first);
- second = _VSTD::forward<second_type>(__p.second);
+ first = std::forward<first_type>(__p.first);
+ second = std::forward<second_type>(__p.second);
return *this;
}
-#if _LIBCPP_STD_VER > 20
+ template <class _U1, class _U2, __enable_if_t<
+ is_assignable<first_type&, _U1 const&>::value &&
+ is_assignable<second_type&, _U2 const&>::value
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ pair& operator=(pair<_U1, _U2> const& __p) {
+ first = __p.first;
+ second = __p.second;
+ return *this;
+ }
+
+ template <class _U1, class _U2, __enable_if_t<
+ is_assignable<first_type&, _U1>::value &&
+ is_assignable<second_type&, _U2>::value
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ pair& operator=(pair<_U1, _U2>&& __p) {
+ first = std::forward<_U1>(__p.first);
+ second = std::forward<_U2>(__p.second);
+ return *this;
+ }
+
+# if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr
const pair& operator=(pair const& __p) const
noexcept(is_nothrow_copy_assignable_v<const first_type> &&
@@ -374,30 +405,178 @@ struct _LIBCPP_TEMPLATE_VIS pair
second = std::forward<_U2>(__p.second);
return *this;
}
-#endif // _LIBCPP_STD_VER > 20
-
- template <class _Tuple, typename enable_if<
- _CheckTLC<_Tuple>::template __enable_assign<_Tuple>()
- >::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
- pair& operator=(_Tuple&& __p) {
- first = _VSTD::get<0>(_VSTD::forward<_Tuple>(__p));
- second = _VSTD::get<1>(_VSTD::forward<_Tuple>(__p));
+
+ template <__pair_like _PairLike>
+ requires(__different_from<_PairLike, pair> &&
+ !__is_specialization_of_subrange<remove_cvref_t<_PairLike>>::value &&
+ is_assignable_v<first_type&, decltype(std::get<0>(std::declval<_PairLike>()))> &&
+ is_assignable_v<second_type&, decltype(std::get<1>(std::declval<_PairLike>()))>)
+ _LIBCPP_HIDE_FROM_ABI constexpr pair& operator=(_PairLike&& __p) {
+ first = std::get<0>(std::forward<_PairLike>(__p));
+ second = std::get<1>(std::forward<_PairLike>(__p));
return *this;
}
-#endif
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ template <__pair_like _PairLike>
+ requires(__different_from<_PairLike, pair> &&
+ !__is_specialization_of_subrange<remove_cvref_t<_PairLike>>::value &&
+ is_assignable_v<first_type const&, decltype(std::get<0>(std::declval<_PairLike>()))> &&
+ is_assignable_v<second_type const&, decltype(std::get<1>(std::declval<_PairLike>()))>)
+ _LIBCPP_HIDE_FROM_ABI constexpr pair const& operator=(_PairLike&& __p) const {
+ first = std::get<0>(std::forward<_PairLike>(__p));
+ second = std::get<1>(std::forward<_PairLike>(__p));
+ return *this;
+ }
+# endif // _LIBCPP_STD_VER >= 23
+
+ // Prior to C++23, we provide an approximation of constructors and assignment operators from
+ // pair-like types. This was historically provided as an extension.
+#if _LIBCPP_STD_VER < 23
+ // from std::tuple
+ template<class _U1, class _U2, __enable_if_t<
+ is_convertible<_U1 const&, _T1>::value &&
+ is_convertible<_U2 const&, _T2>::value
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
+ pair(tuple<_U1, _U2> const& __p)
+ : first(std::get<0>(__p)),
+ second(std::get<1>(__p)) {}
+
+ template<class _U1, class _U2, __enable_if_t<
+ is_constructible<_T1, _U1 const&>::value &&
+ is_constructible<_T2, _U2 const&>::value &&
+ !(is_convertible<_U1 const&, _T1>::value &&
+ is_convertible<_U2 const&, _T2>::value)
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
+ explicit
+ pair(tuple<_U1, _U2> const& __p)
+ : first(std::get<0>(__p)),
+ second(std::get<1>(__p)) {}
+
+ template<class _U1, class _U2, __enable_if_t<
+ is_convertible<_U1, _T1>::value &&
+ is_convertible<_U2, _T2>::value
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
+ pair(tuple<_U1, _U2>&& __p)
+ : first(std::get<0>(std::move(__p))),
+ second(std::get<1>(std::move(__p))) {}
+
+ template<class _U1, class _U2, __enable_if_t<
+ is_constructible<_T1, _U1>::value &&
+ is_constructible<_T2, _U2>::value &&
+ !(is_convertible<_U1, _T1>::value &&
+ is_convertible<_U2, _T2>::value)
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
+ explicit
+ pair(tuple<_U1, _U2>&& __p)
+ : first(std::get<0>(std::move(__p))),
+ second(std::get<1>(std::move(__p))) {}
+
+
+ template<class _U1, class _U2, __enable_if_t<
+ is_assignable<_T1&, _U1 const&>::value &&
+ is_assignable<_T2&, _U2 const&>::value
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
+ pair& operator=(tuple<_U1, _U2> const& __p) {
+ first = std::get<0>(__p);
+ second = std::get<1>(__p);
+ return *this;
+ }
+
+ template<class _U1, class _U2, __enable_if_t<
+ is_assignable<_T1&, _U1&&>::value &&
+ is_assignable<_T2&, _U2&&>::value
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
+ pair& operator=(tuple<_U1, _U2>&& __p) {
+ first = std::get<0>(std::move(__p));
+ second = std::get<1>(std::move(__p));
+ return *this;
+ }
+
+ // from std::array
+ template<class _Up, __enable_if_t<
+ is_convertible<_Up const&, _T1>::value &&
+ is_convertible<_Up const&, _T2>::value
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
+ pair(array<_Up, 2> const& __p)
+ : first(__p[0]),
+ second(__p[1]) {}
+
+ template<class _Up, __enable_if_t<
+ is_constructible<_T1, _Up const&>::value &&
+ is_constructible<_T2, _Up const&>::value &&
+ !(is_convertible<_Up const&, _T1>::value &&
+ is_convertible<_Up const&, _T2>::value)
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
+ explicit
+ pair(array<_Up, 2> const& __p)
+ : first(__p[0]),
+ second(__p[1]) {}
+
+ template<class _Up, __enable_if_t<
+ is_convertible<_Up, _T1>::value &&
+ is_convertible<_Up, _T2>::value
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
+ pair(array<_Up, 2>&& __p)
+ : first(std::move(__p)[0]),
+ second(std::move(__p)[1]) {}
+
+ template<class _Up, __enable_if_t<
+ is_constructible<_T1, _Up>::value &&
+ is_constructible<_T2, _Up>::value &&
+ !(is_convertible<_Up, _T1>::value &&
+ is_convertible<_Up, _T2>::value)
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
+ explicit
+ pair(array<_Up, 2>&& __p)
+ : first(std::move(__p)[0]),
+ second(std::move(__p)[1]) {}
+
+
+ template<class _Up, __enable_if_t<
+ is_assignable<_T1&, _Up const&>::value &&
+ is_assignable<_T2&, _Up const&>::value
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
+ pair& operator=(array<_Up, 2> const& __p) {
+ first = std::get<0>(__p);
+ second = std::get<1>(__p);
+ return *this;
+ }
+
+ template<class _Up, __enable_if_t<
+ is_assignable<_T1&, _Up>::value &&
+ is_assignable<_T2&, _Up>::value
+ >* = nullptr>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
+ pair& operator=(array<_Up, 2>&& __p) {
+ first = std::get<0>(std::move(__p));
+ second = std::get<1>(std::move(__p));
+ return *this;
+ }
+#endif // _LIBCPP_STD_VER < 23
+#endif // _LIBCPP_CXX03_LANG
+
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void
swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
__is_nothrow_swappable<second_type>::value)
{
- using _VSTD::swap;
+ using std::swap;
swap(first, __p.first);
swap(second, __p.second);
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr
void swap(const pair& __p) const
noexcept(__is_nothrow_swappable<const first_type>::value &&
@@ -412,88 +591,88 @@ private:
#ifndef _LIBCPP_CXX03_LANG
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
pair(piecewise_construct_t,
tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
__tuple_indices<_I1...>, __tuple_indices<_I2...>);
#endif
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _T1, class _T2>
pair(_T1, _T2) -> pair<_T1, _T2>;
#endif
// [pairs.spec], specialized algorithms
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+template <class _T1, class _T2, class _U1, class _U2>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool
-operator==(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+operator==(const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
return __x.first == __y.first && __x.second == __y.second;
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
-template <class _T1, class _T2>
+template <class _T1, class _T2, class _U1, class _U2>
_LIBCPP_HIDE_FROM_ABI constexpr
common_comparison_category_t<
- __synth_three_way_result<_T1>,
- __synth_three_way_result<_T2> >
-operator<=>(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+ __synth_three_way_result<_T1, _U1>,
+ __synth_three_way_result<_T2, _U2> >
+operator<=>(const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
- if (auto __c = _VSTD::__synth_three_way(__x.first, __y.first); __c != 0) {
+ if (auto __c = std::__synth_three_way(__x.first, __y.first); __c != 0) {
return __c;
}
- return _VSTD::__synth_three_way(__x.second, __y.second);
+ return std::__synth_three_way(__x.second, __y.second);
}
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCPP_STD_VER >= 20
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+template <class _T1, class _T2, class _U1, class _U2>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool
-operator!=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+operator!=(const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
return !(__x == __y);
}
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+template <class _T1, class _T2, class _U1, class _U2>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool
-operator< (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+operator< (const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
return __x.first < __y.first || (!(__y.first < __x.first) && __x.second < __y.second);
}
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+template <class _T1, class _T2, class _U1, class _U2>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool
-operator> (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+operator> (const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
return __y < __x;
}
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+template <class _T1, class _T2, class _U1, class _U2>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool
-operator>=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+operator>=(const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
return !(__x < __y);
}
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+template <class _T1, class _T2, class _U1, class _U2>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool
-operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+operator<=(const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
return !(__y < __x);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _T1, class _T2, class _U1, class _U2, template<class> class _TQual, template<class> class _UQual>
requires requires { typename pair<common_reference_t<_TQual<_T1>, _UQual<_U1>>,
common_reference_t<_TQual<_T2>, _UQual<_U2>>>; }
@@ -507,10 +686,10 @@ template <class _T1, class _T2, class _U1, class _U2>
struct common_type<pair<_T1, _T2>, pair<_U1, _U2>> {
using type = pair<common_type_t<_T1, _U1>, common_type_t<_T2, _U2>>;
};
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
typename enable_if
<
__is_swappable<_T1>::value &&
@@ -524,7 +703,7 @@ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _T1, class _T2>
requires (__is_swappable<const _T1>::value &&
__is_swappable<const _T2>::value)
@@ -537,12 +716,12 @@ void swap(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
#endif
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>
make_pair(_T1&& __t1, _T2&& __t2)
{
return pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>
- (_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));
+ (std::forward<_T1>(__t1), std::forward<_T2>(__t2));
}
template <class _T1, class _T2>
@@ -558,13 +737,13 @@ struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, pair<_T1, _T2> >
template <class _T1, class _T2>
struct _LIBCPP_TEMPLATE_VIS tuple_element<0, pair<_T1, _T2> >
{
- typedef _LIBCPP_NODEBUG _T1 type;
+ using type _LIBCPP_NODEBUG = _T1;
};
template <class _T1, class _T2>
struct _LIBCPP_TEMPLATE_VIS tuple_element<1, pair<_T1, _T2> >
{
- typedef _LIBCPP_NODEBUG _T2 type;
+ using type _LIBCPP_NODEBUG = _T2;
};
template <size_t _Ip> struct __get_pair;
@@ -574,27 +753,27 @@ struct __get_pair<0>
{
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
_T1&
get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
const _T1&
get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
_T1&&
- get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T1>(__p.first);}
+ get(pair<_T1, _T2>&& __p) _NOEXCEPT {return std::forward<_T1>(__p.first);}
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
const _T1&&
- get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T1>(__p.first);}
+ get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return std::forward<const _T1>(__p.first);}
};
template <>
@@ -602,31 +781,31 @@ struct __get_pair<1>
{
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
_T2&
get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
const _T2&
get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
_T2&&
- get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T2>(__p.second);}
+ get(pair<_T1, _T2>&& __p) _NOEXCEPT {return std::forward<_T2>(__p.second);}
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
const _T2&&
- get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T2>(__p.second);}
+ get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return std::forward<const _T2>(__p.second);}
};
template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
typename tuple_element<_Ip, pair<_T1, _T2> >::type&
get(pair<_T1, _T2>& __p) _NOEXCEPT
{
@@ -634,7 +813,7 @@ get(pair<_T1, _T2>& __p) _NOEXCEPT
}
template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
get(const pair<_T1, _T2>& __p) _NOEXCEPT
{
@@ -642,80 +821,82 @@ get(const pair<_T1, _T2>& __p) _NOEXCEPT
}
template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
get(pair<_T1, _T2>&& __p) _NOEXCEPT
{
- return __get_pair<_Ip>::get(_VSTD::move(__p));
+ return __get_pair<_Ip>::get(std::move(__p));
}
template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
get(const pair<_T1, _T2>&& __p) _NOEXCEPT
{
- return __get_pair<_Ip>::get(_VSTD::move(__p));
+ return __get_pair<_Ip>::get(std::move(__p));
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 & get(pair<_T1, _T2>& __p) _NOEXCEPT
{
return __get_pair<0>::get(__p);
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 const & get(pair<_T1, _T2> const& __p) _NOEXCEPT
{
return __get_pair<0>::get(__p);
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 && get(pair<_T1, _T2>&& __p) _NOEXCEPT
{
- return __get_pair<0>::get(_VSTD::move(__p));
+ return __get_pair<0>::get(std::move(__p));
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 const && get(pair<_T1, _T2> const&& __p) _NOEXCEPT
{
- return __get_pair<0>::get(_VSTD::move(__p));
+ return __get_pair<0>::get(std::move(__p));
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 & get(pair<_T2, _T1>& __p) _NOEXCEPT
{
return __get_pair<1>::get(__p);
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 const & get(pair<_T2, _T1> const& __p) _NOEXCEPT
{
return __get_pair<1>::get(__p);
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 && get(pair<_T2, _T1>&& __p) _NOEXCEPT
{
- return __get_pair<1>::get(_VSTD::move(__p));
+ return __get_pair<1>::get(std::move(__p));
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 const && get(pair<_T2, _T1> const&& __p) _NOEXCEPT
{
- return __get_pair<1>::get(_VSTD::move(__p));
+ return __get_pair<1>::get(std::move(__p));
}
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___UTILITY_PAIR_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/piecewise_construct.h b/contrib/libs/cxxsupp/libcxx/include/__utility/piecewise_construct.h
index 3cc86fef2a0..ad86badb66c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/piecewise_construct.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/piecewise_construct.h
@@ -18,10 +18,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { explicit piecewise_construct_t() = default; };
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
-extern _LIBCPP_EXPORTED_FROM_ABI const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
-#else
-/* inline */ constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
+
+#if _LIBCPP_STD_VER >= 17
+inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
+#elif !defined(_LIBCPP_CXX03_LANG)
+constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/swap.h b/contrib/libs/cxxsupp/libcxx/include/__utility/swap.h
index 0843b35a8b5..767f69cc2ff 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/swap.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/swap.h
@@ -23,6 +23,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_CXX03_LANG
@@ -51,4 +54,6 @@ swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::v
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___UTILITY_SWAP_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/terminate_on_exception.h b/contrib/libs/cxxsupp/libcxx/include/__utility/terminate_on_exception.h
new file mode 100644
index 00000000000..e035ec3409a
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/terminate_on_exception.h
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___UTILITY_TERMINATE_ON_EXCEPTION_H
+#define _LIBCPP___UTILITY_TERMINATE_ON_EXCEPTION_H
+
+#include <__config>
+#include <__exception/terminate.h>
+#include <new>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+
+template <class _Func>
+_LIBCPP_HIDE_FROM_ABI auto __terminate_on_exception(_Func __func) {
+ try {
+ return __func();
+ } catch (...) {
+ std::terminate();
+ }
+}
+
+# else // _LIBCPP_HAS_NO_EXCEPTIONS
+
+template <class _Func>
+_LIBCPP_HIDE_FROM_ABI auto __terminate_on_exception(_Func __func) {
+ return __func();
+}
+
+# endif // _LIBCPP_HAS_NO_EXCEPTIONS
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP___UTILITY_TERMINATE_ON_EXCEPTION_H
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/to_underlying.h b/contrib/libs/cxxsupp/libcxx/include/__utility/to_underlying.h
index a194d3ef28c..b70f70a74be 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/to_underlying.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/to_underlying.h
@@ -27,7 +27,7 @@ __to_underlying(_Tp __val) noexcept {
}
#endif // !_LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Tp>
_LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY constexpr underlying_type_t<_Tp>
to_underlying(_Tp __val) noexcept {
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/unreachable.h b/contrib/libs/cxxsupp/libcxx/include/__utility/unreachable.h
index d93e60b10b8..4a21b74b197 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/unreachable.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/unreachable.h
@@ -19,11 +19,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI inline void __libcpp_unreachable() {
- _LIBCPP_ASSERT(false, "std::unreachable() was reached");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "std::unreachable() was reached");
__builtin_unreachable();
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
[[noreturn]] _LIBCPP_HIDE_FROM_ABI inline void unreachable() { __libcpp_unreachable(); }
diff --git a/contrib/libs/cxxsupp/libcxx/include/__variant/monostate.h b/contrib/libs/cxxsupp/libcxx/include/__variant/monostate.h
index b3b4597dd98..8fec34008f2 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__variant/monostate.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__variant/monostate.h
@@ -21,19 +21,19 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
struct _LIBCPP_TEMPLATE_VIS monostate {};
_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(monostate, monostate) noexcept { return true; }
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI constexpr strong_ordering operator<=>(monostate, monostate) noexcept {
return strong_ordering::equal;
}
-# else // _LIBCPP_STD_VER > 17
+# else // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(monostate, monostate) noexcept { return false; }
@@ -45,7 +45,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(monostate, monostate) noexcept {
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(monostate, monostate) noexcept { return true; }
-# endif // _LIBCPP_STD_VER > 17
+# endif // _LIBCPP_STD_VER >= 20
template <>
struct _LIBCPP_TEMPLATE_VIS hash<monostate> {
@@ -57,7 +57,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<monostate> {
}
};
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/__verbose_abort b/contrib/libs/cxxsupp/libcxx/include/__verbose_abort
index a16d75d5ac4..a38284b711f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__verbose_abort
+++ b/contrib/libs/cxxsupp/libcxx/include/__verbose_abort
@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// This function should never be called directly from the code -- it should only be called through
// the _LIBCPP_VERBOSE_ABORT macro.
-_LIBCPP_NORETURN _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2)
+_LIBCPP_NORETURN _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2)
void __libcpp_verbose_abort(const char *__format, ...);
// _LIBCPP_VERBOSE_ABORT(format, args...)
@@ -40,16 +40,19 @@ void __libcpp_verbose_abort(const char *__format, ...);
// Support _LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED until LLVM 18, but tell people
// to move to customizing _LIBCPP_VERBOSE_ABORT instead.
-# if defined(_LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY) && defined(_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED)
-# undef _LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY
+# if defined(_LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT) && defined(_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED)
+# undef _LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT
# warning _LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED is deprecated, please customize _LIBCPP_VERBOSE_ABORT instead
# endif
-# if defined(_LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY)
-# define _LIBCPP_VERBOSE_ABORT(...) __builtin_abort()
+# if defined(_LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT)
+// The decltype is there to suppress -Wunused warnings in this configuration.
+void __use(const char*, ...);
+# define _LIBCPP_VERBOSE_ABORT(...) (decltype(::std::__use(__VA_ARGS__))(), __builtin_abort())
# else
# define _LIBCPP_VERBOSE_ABORT(...) ::std::__libcpp_verbose_abort(__VA_ARGS__)
# endif
+
#endif // !defined(_LIBCPP_VERBOSE_ABORT)
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/algorithm b/contrib/libs/cxxsupp/libcxx/include/algorithm
index a4351eaf9cf..7813f67f2c3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/algorithm
+++ b/contrib/libs/cxxsupp/libcxx/include/algorithm
@@ -22,41 +22,41 @@ namespace ranges {
// [algorithms.results], algorithm result types
template <class I, class F>
- struct in_fun_result; // since C++20
+ struct in_fun_result; // since C++20
template <class I1, class I2>
- struct in_in_result; // since C++20
+ struct in_in_result; // since C++20
template <class I, class O>
- struct in_out_result; // since C++20
+ struct in_out_result; // since C++20
template <class I1, class I2, class O>
- struct in_in_out_result; // since C++20
+ struct in_in_out_result; // since C++20
template <class I, class O1, class O2>
- struct in_out_out_result; // since C++20
+ struct in_out_out_result; // since C++20
template <class I1, class I2>
- struct min_max_result; // since C++20
+ struct min_max_result; // since C++20
template <class I>
- struct in_found_result; // since C++20
+ struct in_found_result; // since C++20
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
- indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> // since C++20
+ indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> // since C++20
constexpr I min_element(I first, S last, Comp comp = {}, Proj proj = {});
template<forward_range R, class Proj = identity,
- indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> // since C++20
+ indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> // since C++20
constexpr borrowed_iterator_t<R> min_element(R&& r, Comp comp = {}, Proj proj = {});
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
- constexpr I ranges::max_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
+ constexpr I ranges::max_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<forward_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
- constexpr borrowed_iterator_t<R> ranges::max_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
+ constexpr borrowed_iterator_t<R> ranges::max_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<class I1, class I2>
using mismatch_result = in_in_result<I1, I2>;
@@ -64,86 +64,86 @@ namespace ranges {
template <input_iterator I1, sentinel_for<_I1> S1, input_iterator I2, sentinel_for<_I2> S2,
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
- constexpr mismatch_result<_I1, _I2>
- mismatch()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) // since C++20
+ constexpr mismatch_result<_I1, _I2> // since C++20
+ mismatch()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {})
template <input_range R1, input_range R2,
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
constexpr mismatch_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
- mismatch(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) // since C++20
+ mismatch(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) // since C++20
requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
- constexpr I find(I first, S last, const T& value, Proj proj = {}); // since C++20
+ constexpr I find(I first, S last, const T& value, Proj proj = {}); // since C++20
template<input_range R, class T, class Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
constexpr borrowed_iterator_t<R>
- find(R&& r, const T& value, Proj proj = {}); // since C++20
+ find(R&& r, const T& value, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
- constexpr I find_if(I first, S last, Pred pred, Proj proj = {}); // since C++20
+ constexpr I find_if(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
constexpr borrowed_iterator_t<R>
- find_if(R&& r, Pred pred, Proj proj = {}); // since C++20
+ find_if(R&& r, Pred pred, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
- constexpr I find_if_not(I first, S last, Pred pred, Proj proj = {}); // since C++20
+ constexpr I find_if_not(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
constexpr borrowed_iterator_t<R>
- find_if_not(R&& r, Pred pred, Proj proj = {}); // since C++20
+ find_if_not(R&& r, Pred pred, Proj proj = {}); // since C++20
template<class T, class Proj = identity,
indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less>
- constexpr const T& min(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20
+ constexpr const T& min(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20
template<copyable T, class Proj = identity,
indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less>
- constexpr T min(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20
+ constexpr T min(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
constexpr range_value_t<R>
- min(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
+ min(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<class T, class Proj = identity,
indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less>
- constexpr const T& max(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20
+ constexpr const T& max(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20
template<copyable T, class Proj = identity,
indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less>
- constexpr T max(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20
+ constexpr T max(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
constexpr range_value_t<R>
- max(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
+ max(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<class I, class O>
- using unary_transform_result = in_out_result<I, O>; // since C++20
+ using unary_transform_result = in_out_result<I, O>; // since C++20
template<class I1, class I2, class O>
- using binary_transform_result = in_in_out_result<I1, I2, O>; // since C++20
+ using binary_transform_result = in_in_out_result<I1, I2, O>; // since C++20
template<input_iterator I, sentinel_for<I> S, weakly_incrementable O,
copy_constructible F, class Proj = identity>
requires indirectly_writable<O, indirect_result_t<F&, projected<I, Proj>>>
constexpr ranges::unary_transform_result<I, O>
- transform(I first1, S last1, O result, F op, Proj proj = {}); // since C++20
+ transform(I first1, S last1, O result, F op, Proj proj = {}); // since C++20
template<input_range R, weakly_incrementable O, copy_constructible F,
class Proj = identity>
requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R>, Proj>>>
constexpr ranges::unary_transform_result<borrowed_iterator_t<R>, O>
- transform(R&& r, O result, F op, Proj proj = {}); // since C++20
+ transform(R&& r, O result, F op, Proj proj = {}); // since C++20
template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
weakly_incrementable O, copy_constructible F, class Proj1 = identity,
@@ -152,7 +152,7 @@ namespace ranges {
projected<I2, Proj2>>>
constexpr ranges::binary_transform_result<I1, I2, O>
transform(I1 first1, S1 last1, I2 first2, S2 last2, O result,
- F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
+ F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<input_range R1, input_range R2, weakly_incrementable O,
copy_constructible F, class Proj1 = identity, class Proj2 = identity>
@@ -160,27 +160,27 @@ namespace ranges {
projected<iterator_t<R2>, Proj2>>>
constexpr ranges::binary_transform_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>
transform(R1&& r1, R2&& r2, O result,
- F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
+ F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
constexpr iter_difference_t<I>
- count(I first, S last, const T& value, Proj proj = {}); // since C++20
+ count(I first, S last, const T& value, Proj proj = {}); // since C++20
template<input_range R, class T, class Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
constexpr range_difference_t<R>
- count(R&& r, const T& value, Proj proj = {}); // since C++20
+ count(R&& r, const T& value, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
constexpr iter_difference_t<I>
- count_if(I first, S last, Pred pred, Proj proj = {}); // since C++20
+ count_if(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
constexpr range_difference_t<R>
- count_if(R&& r, Pred pred, Proj proj = {}); // since C++20
+ count_if(R&& r, Pred pred, Proj proj = {}); // since C++20
template<class T>
using minmax_result = min_max_result<T>;
@@ -188,18 +188,18 @@ namespace ranges {
template<class T, class Proj = identity,
indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less>
constexpr ranges::minmax_result<const T&>
- minmax(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20
+ minmax(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20
template<copyable T, class Proj = identity,
indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less>
constexpr ranges::minmax_result<T>
- minmax(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20
+ minmax(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
constexpr ranges::minmax_result<range_value_t<R>>
- minmax(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
+ minmax(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<class I>
using minmax_element_result = min_max_result<I>;
@@ -207,18 +207,18 @@ namespace ranges {
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
constexpr ranges::minmax_element_result<I>
- minmax_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
+ minmax_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<forward_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
constexpr ranges::minmax_element_result<borrowed_iterator_t<R>>
- minmax_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
+ minmax_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<class I, class O>
- using copy_result = in_out_result<I, O>; // since C++20
+ using copy_result = in_out_result<I, O>; // since C++20
template<class I, class O>
- using copy_n_result = in_out_result<I, O>; // since C++20
+ using copy_n_result = in_out_result<I, O>; // since C++20
template<class I, class O>
using copy_if_result = in_out_result<I, O>; // since C++20
@@ -333,20 +333,20 @@ namespace ranges {
template<random_access_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
- constexpr bool is_heap(I first, S last, Comp comp = {}, Proj proj = {}); // Since C++20
+ constexpr bool is_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<random_access_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
- constexpr bool is_heap(R&& r, Comp comp = {}, Proj proj = {}); // Since C++20
+ constexpr bool is_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<random_access_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
- constexpr I is_heap_until(I first, S last, Comp comp = {}, Proj proj = {}); // Since C++20
+ constexpr I is_heap_until(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<random_access_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
constexpr borrowed_iterator_t<R>
- is_heap_until(R&& r, Comp comp = {}, Proj proj = {}); // Since C++20
+ is_heap_until(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<bidirectional_iterator I, sentinel_for<I> S>
requires permutable<I>
@@ -399,15 +399,24 @@ namespace ranges {
template<input_or_output_iterator O, sentinel_for<O> S, copy_constructible F>
requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
- constexpr O generate(O first, S last, F gen); // Since C++20
+ constexpr O generate(O first, S last, F gen); // since C++20
+
+ template<class ExecutionPolicy, class ForwardIterator, class Generator>
+ void generate(ExecutionPolicy&& exec,
+ ForwardIterator first, ForwardIterator last,
+ Generator gen); // since C++17
template<class R, copy_constructible F>
requires invocable<F&> && output_range<R, invoke_result_t<F&>>
- constexpr borrowed_iterator_t<R> generate(R&& r, F gen); // Since C++20
+ constexpr borrowed_iterator_t<R> generate(R&& r, F gen); // since C++20
template<input_or_output_iterator O, copy_constructible F>
requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
- constexpr O generate_n(O first, iter_difference_t<O> n, F gen); // Since C++20
+ constexpr O generate_n(O first, iter_difference_t<O> n, F gen); // since C++20
+
+ template<class ExecutionPolicy, class ForwardIterator, class Size, class Generator>
+ ForwardIterator generate_n(ExecutionPolicy&& exec,
+ ForwardIterator first, Size n, Generator gen); // since C++17
template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
@@ -424,27 +433,39 @@ namespace ranges {
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
- constexpr bool ranges::all_of(I first, S last, Pred pred, Proj proj = {}); // since C++20
+ constexpr bool ranges::all_of(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
- constexpr bool ranges::all_of(R&& r, Pred pred, Proj proj = {}); // since C++20
+ constexpr bool ranges::all_of(R&& r, Pred pred, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
- constexpr bool ranges::any_of(I first, S last, Pred pred, Proj proj = {}); // since C++20
+ constexpr bool ranges::any_of(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
- constexpr bool ranges::any_of(R&& r, Pred pred, Proj proj = {}); // since C++20
+ constexpr bool ranges::any_of(R&& r, Pred pred, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
- constexpr bool ranges::none_of(I first, S last, Pred pred, Proj proj = {}); // since C++20
+ constexpr bool ranges::none_of(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
- constexpr bool ranges::none_of(R&& r, Pred pred, Proj proj = {}); // since C++20
+ constexpr bool ranges::none_of(R&& r, Pred pred, Proj proj = {}); // since C++20
+
+ template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
+ requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
+ constexpr bool ranges::starts_with(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {},
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23
+
+ template<input_range R1, input_range R2, class Pred = ranges::equal_to, class Proj1 = identity,
+ class Proj2 = identity>
+ requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
+ constexpr bool ranges::starts_with(R1&& r1, R2&& r2, Pred pred = {},
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23
template<input_iterator I1, sentinel_for<I1> S1,
random_access_iterator I2, sentinel_for<I2> S2,
@@ -453,7 +474,7 @@ namespace ranges {
indirect_strict_weak_order<Comp, projected<I1, Proj1>, projected<I2, Proj2>>
constexpr partial_sort_copy_result<I1, I2>
partial_sort_copy(I1 first, S1 last, I2 result_first, S2 result_last,
- Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+ Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<input_range R1, random_access_range R2, class Comp = ranges::less,
class Proj1 = identity, class Proj2 = identity>
@@ -463,7 +484,7 @@ namespace ranges {
projected<iterator_t<R2>, Proj2>>
constexpr partial_sort_copy_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
partial_sort_copy(R1&& r, R2&& result_r, Comp comp = {},
- Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
@@ -486,64 +507,64 @@ namespace ranges {
class Proj = identity>
requires sortable<I, Comp, Proj>
constexpr I
- ranges::nth_element(I first, I nth, S last, Comp comp = {}, Proj proj = {}); // since C++20
+ ranges::nth_element(I first, I nth, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<random_access_range R, class Comp = ranges::less, class Proj = identity>
requires sortable<iterator_t<R>, Comp, Proj>
constexpr borrowed_iterator_t<R>
- ranges::nth_element(R&& r, iterator_t<R> nth, Comp comp = {}, Proj proj = {}); // since C++20
+ ranges::nth_element(R&& r, iterator_t<R> nth, Comp comp = {}, Proj proj = {}); // since C++20
template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity,
- indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
- constexpr I upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); // since C++20
+ indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> // since C++20
+ constexpr I upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {});
template<forward_range R, class T, class Proj = identity,
indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
ranges::less>
constexpr borrowed_iterator_t<R>
- upper_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20
+ upper_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20
template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity,
indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
constexpr I lower_bound(I first, S last, const T& value, Comp comp = {},
- Proj proj = {}); // since C++20
+ Proj proj = {}); // since C++20
template<forward_range R, class T, class Proj = identity,
indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
ranges::less>
constexpr borrowed_iterator_t<R>
- lower_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20
+ lower_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20
template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity,
indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
constexpr bool binary_search(I first, S last, const T& value, Comp comp = {},
- Proj proj = {}); // since C++20
+ Proj proj = {}); // since C++20
template<forward_range R, class T, class Proj = identity,
indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
ranges::less>
constexpr bool binary_search(R&& r, const T& value, Comp comp = {},
- Proj proj = {}); // since C++20
+ Proj proj = {}); // since C++20
template<permutable I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
constexpr subrange<I>
- partition(I first, S last, Pred pred, Proj proj = {}); // Since C++20
+ partition(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<forward_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
requires permutable<iterator_t<R>>
constexpr borrowed_subrange_t<R>
- partition(R&& r, Pred pred, Proj proj = {}); // Since C++20
+ partition(R&& r, Pred pred, Proj proj = {}); // since C++20
template<bidirectional_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
requires permutable<I>
- subrange<I> stable_partition(I first, S last, Pred pred, Proj proj = {}); // Since C++20
+ subrange<I> stable_partition(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<bidirectional_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
requires permutable<iterator_t<R>>
- borrowed_subrange_t<R> stable_partition(R&& r, Pred pred, Proj proj = {}); // Since C++20
+ borrowed_subrange_t<R> stable_partition(R&& r, Pred pred, Proj proj = {}); // since C++20
template<input_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2,
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
@@ -563,7 +584,7 @@ namespace ranges {
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_binary_predicate<projected<I, Proj>,
projected<I, Proj>> Pred = ranges::equal_to>
- constexpr I ranges::adjacent_find(I first, S last, Pred pred = {}, Proj proj = {}); // since C+20
+ constexpr I ranges::adjacent_find(I first, S last, Pred pred = {}, Proj proj = {}); // since C++20
template<forward_range R, class Proj = identity,
indirect_binary_predicate<projected<iterator_t<R>, Proj>,
@@ -604,7 +625,7 @@ namespace ranges {
projected<I2, Proj2>> Comp = ranges::less>
constexpr bool
ranges::lexicographical_compare(I1 first1, S1 last1, I2 first2, S2 last2,
- Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
+ Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<input_range R1, input_range R2, class Proj1 = identity,
class Proj2 = identity,
@@ -612,7 +633,7 @@ namespace ranges {
projected<iterator_t<R2>, Proj2>> Comp = ranges::less>
constexpr bool
ranges::lexicographical_compare(R1&& r1, R2&& r2, Comp comp = {},
- Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<bidirectional_iterator I1, sentinel_for<I1> S1, bidirectional_iterator I2>
requires indirectly_movable<I1, I2>
@@ -643,7 +664,7 @@ namespace ranges {
requires indirectly_copyable<I, O1> && indirectly_copyable<I, O2>
constexpr partition_copy_result<I, O1, O2>
partition_copy(I first, S last, O1 out_true, O2 out_false, Pred pred,
- Proj proj = {}); // Since C++20
+ Proj proj = {}); // since C++20
template<input_range R, weakly_incrementable O1, weakly_incrementable O2,
class Proj = identity,
@@ -651,16 +672,16 @@ namespace ranges {
requires indirectly_copyable<iterator_t<R>, O1> &&
indirectly_copyable<iterator_t<R>, O2>
constexpr partition_copy_result<borrowed_iterator_t<R>, O1, O2>
- partition_copy(R&& r, O1 out_true, O2 out_false, Pred pred, Proj proj = {}); // Since C++20
+ partition_copy(R&& r, O1 out_true, O2 out_false, Pred pred, Proj proj = {}); // since C++20
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
- constexpr I partition_point(I first, S last, Pred pred, Proj proj = {}); // Since C++20
+ constexpr I partition_point(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<forward_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
constexpr borrowed_iterator_t<R>
- partition_point(R&& r, Pred pred, Proj proj = {}); // Since C++20
+ partition_point(R&& r, Pred pred, Proj proj = {}); // since C++20
template<class I1, class I2, class O>
using merge_result = in_in_out_result<I1, I2, O>; // since C++20
@@ -755,7 +776,7 @@ namespace ranges {
template<forward_range R>
requires permutable<iterator_t<R>>
- constexpr borrowed_subrange_t<R> rotate(R&& r, iterator_t<R> middle); // Since C++20
+ constexpr borrowed_subrange_t<R> rotate(R&& r, iterator_t<R> middle); // since C++20
template <class _InIter, class _OutIter>
using rotate_copy_result = in_out_result<_InIter, _OutIter>; // since C++20
@@ -774,23 +795,23 @@ namespace ranges {
requires (forward_iterator<I> || random_access_iterator<O>) &&
indirectly_copyable<I, O> &&
uniform_random_bit_generator<remove_reference_t<Gen>>
- O sample(I first, S last, O out, iter_difference_t<I> n, Gen&& g); // Since C++20
+ O sample(I first, S last, O out, iter_difference_t<I> n, Gen&& g); // since C++20
template<input_range R, weakly_incrementable O, class Gen>
requires (forward_range<R> || random_access_iterator<O>) &&
indirectly_copyable<iterator_t<R>, O> &&
uniform_random_bit_generator<remove_reference_t<Gen>>
- O sample(R&& r, O out, range_difference_t<R> n, Gen&& g); // Since C++20
+ O sample(R&& r, O out, range_difference_t<R> n, Gen&& g); // since C++20
template<random_access_iterator I, sentinel_for<I> S, class Gen>
requires permutable<I> &&
uniform_random_bit_generator<remove_reference_t<Gen>>
- I shuffle(I first, S last, Gen&& g); // Since C++20
+ I shuffle(I first, S last, Gen&& g); // since C++20
template<random_access_range R, class Gen>
requires permutable<iterator_t<R>> &&
uniform_random_bit_generator<remove_reference_t<Gen>>
- borrowed_iterator_t<R> shuffle(R&& r, Gen&& g); // Since C++20
+ borrowed_iterator_t<R> shuffle(R&& r, Gen&& g); // since C++20
template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2,
sentinel_for<I2> S2, class Proj1 = identity, class Proj2 = identity,
@@ -798,14 +819,14 @@ namespace ranges {
projected<I2, Proj2>> Pred = ranges::equal_to>
constexpr bool ranges::is_permutation(I1 first1, S1 last1, I2 first2, S2 last2,
Pred pred = {},
- Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<forward_range R1, forward_range R2,
class Proj1 = identity, class Proj2 = identity,
indirect_equivalence_relation<projected<iterator_t<R1>, Proj1>,
projected<iterator_t<R2>, Proj2>> Pred = ranges::equal_to>
constexpr bool ranges::is_permutation(R1&& r1, R2&& r2, Pred pred = {},
- Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2,
sentinel_for<I2> S2, class Pred = ranges::equal_to,
@@ -904,35 +925,35 @@ namespace ranges {
indirect_strict_weak_order<projected<I1, Proj1>, projected<I2, Proj2>> Comp =
ranges::less>
constexpr bool includes(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = {},
- Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<input_range R1, input_range R2, class Proj1 = identity,
class Proj2 = identity,
indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>,
projected<iterator_t<R2>, Proj2>> Comp = ranges::less>
constexpr bool includes(R1&& r1, R2&& r2, Comp comp = {},
- Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less,
class Proj = identity>
requires sortable<I, Comp, Proj>
- I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // Since C++20
+ I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<bidirectional_range R, class Comp = ranges::less, class Proj = identity>
requires sortable<iterator_t<R>, Comp, Proj>
borrowed_iterator_t<R>
inplace_merge(R&& r, iterator_t<R> middle, Comp comp = {},
- Proj proj = {}); // Since C++20
+ Proj proj = {}); // since C++20
template<permutable I, sentinel_for<I> S, class Proj = identity,
indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to>
- constexpr subrange<I> unique(I first, S last, C comp = {}, Proj proj = {}); // Since C++20
+ constexpr subrange<I> unique(I first, S last, C comp = {}, Proj proj = {}); // since C++20
template<forward_range R, class Proj = identity,
indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to>
requires permutable<iterator_t<R>>
constexpr borrowed_subrange_t<R>
- unique(R&& r, C comp = {}, Proj proj = {}); // Since C++20
+ unique(R&& r, C comp = {}, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class Proj = identity,
indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to>
@@ -941,7 +962,7 @@ namespace ranges {
(input_iterator<O> && same_as<iter_value_t<I>, iter_value_t<O>>) ||
indirectly_copyable_storable<I, O>)
constexpr unique_copy_result<I, O>
- unique_copy(I first, S last, O result, C comp = {}, Proj proj = {}); // Since C++20
+ unique_copy(I first, S last, O result, C comp = {}, Proj proj = {}); // since C++20
template<input_range R, weakly_incrementable O, class Proj = identity,
indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to>
@@ -950,41 +971,41 @@ namespace ranges {
(input_iterator<O> && same_as<range_value_t<R>, iter_value_t<O>>) ||
indirectly_copyable_storable<iterator_t<R>, O>)
constexpr unique_copy_result<borrowed_iterator_t<R>, O>
- unique_copy(R&& r, O result, C comp = {}, Proj proj = {}); // Since C++20
+ unique_copy(R&& r, O result, C comp = {}, Proj proj = {}); // since C++20
template<class I, class O>
- using remove_copy_result = in_out_result<I, O>; // Since C++20
+ using remove_copy_result = in_out_result<I, O>; // since C++20
template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class T,
class Proj = identity>
indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
constexpr remove_copy_result<I, O>
- remove_copy(I first, S last, O result, const T& value, Proj proj = {}); // Since C++20
+ remove_copy(I first, S last, O result, const T& value, Proj proj = {}); // since C++20
template<input_range R, weakly_incrementable O, class T, class Proj = identity>
requires indirectly_copyable<iterator_t<R>, O> &&
indirect_binary_predicate<ranges::equal_to,
projected<iterator_t<R>, Proj>, const T*>
constexpr remove_copy_result<borrowed_iterator_t<R>, O>
- remove_copy(R&& r, O result, const T& value, Proj proj = {}); // Since C++20
+ remove_copy(R&& r, O result, const T& value, Proj proj = {}); // since C++20
template<class I, class O>
- using remove_copy_if_result = in_out_result<I, O>; // Since C++20
+ using remove_copy_if_result = in_out_result<I, O>; // since C++20
template<input_iterator I, sentinel_for<I> S, weakly_incrementable O,
class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
requires indirectly_copyable<I, O>
constexpr remove_copy_if_result<I, O>
- remove_copy_if(I first, S last, O result, Pred pred, Proj proj = {}); // Since C++20
+ remove_copy_if(I first, S last, O result, Pred pred, Proj proj = {}); // since C++20
template<input_range R, weakly_incrementable O, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
requires indirectly_copyable<iterator_t<R>, O>
constexpr remove_copy_if_result<borrowed_iterator_t<R>, O>
- remove_copy_if(R&& r, O result, Pred pred, Proj proj = {}); // Since C++20
+ remove_copy_if(R&& r, O result, Pred pred, Proj proj = {}); // since C++20
template<class I, class O>
- using replace_copy_result = in_out_result<I, O>; // Since C++20
+ using replace_copy_result = in_out_result<I, O>; // since C++20
template<input_iterator I, sentinel_for<I> S, class T1, class T2,
output_iterator<const T2&> O, class Proj = identity>
@@ -992,7 +1013,7 @@ namespace ranges {
indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*>
constexpr replace_copy_result<I, O>
replace_copy(I first, S last, O result, const T1& old_value, const T2& new_value,
- Proj proj = {}); // Since C++20
+ Proj proj = {}); // since C++20
template<input_range R, class T1, class T2, output_iterator<const T2&> O,
class Proj = identity>
@@ -1001,54 +1022,54 @@ namespace ranges {
projected<iterator_t<R>, Proj>, const T1*>
constexpr replace_copy_result<borrowed_iterator_t<R>, O>
replace_copy(R&& r, O result, const T1& old_value, const T2& new_value,
- Proj proj = {}); // Since C++20
+ Proj proj = {}); // since C++20
template<class I, class O>
- using replace_copy_if_result = in_out_result<I, O>; // Since C++20
+ using replace_copy_if_result = in_out_result<I, O>; // since C++20
template<input_iterator I, sentinel_for<I> S, class T, output_iterator<const T&> O,
class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
requires indirectly_copyable<I, O>
constexpr replace_copy_if_result<I, O>
replace_copy_if(I first, S last, O result, Pred pred, const T& new_value,
- Proj proj = {}); // Since C++20
+ Proj proj = {}); // since C++20
template<input_range R, class T, output_iterator<const T&> O, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
requires indirectly_copyable<iterator_t<R>, O>
constexpr replace_copy_if_result<borrowed_iterator_t<R>, O>
replace_copy_if(R&& r, O result, Pred pred, const T& new_value,
- Proj proj = {}); // Since C++20
+ Proj proj = {}); // since C++20
template<class I>
- using prev_permutation_result = in_found_result<I>; // Since C++20
+ using prev_permutation_result = in_found_result<I>; // since C++20
template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less,
class Proj = identity>
requires sortable<I, Comp, Proj>
constexpr ranges::prev_permutation_result<I>
- ranges::prev_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // Since C++20
+ ranges::prev_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<bidirectional_range R, class Comp = ranges::less,
class Proj = identity>
requires sortable<iterator_t<R>, Comp, Proj>
constexpr ranges::prev_permutation_result<borrowed_iterator_t<R>>
- ranges::prev_permutation(R&& r, Comp comp = {}, Proj proj = {}); // Since C++20
+ ranges::prev_permutation(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<class I>
- using next_permutation_result = in_found_result<I>; // Since C++20
+ using next_permutation_result = in_found_result<I>; // since C++20
template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less,
class Proj = identity>
requires sortable<I, Comp, Proj>
constexpr ranges::next_permutation_result<I>
- ranges::next_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // Since C++20
+ ranges::next_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<bidirectional_range R, class Comp = ranges::less,
class Proj = identity>
requires sortable<iterator_t<R>, Comp, Proj>
constexpr ranges::next_permutation_result<borrowed_iterator_t<R>>
- ranges::next_permutation(R&& r, Comp comp = {}, Proj proj = {}); // Since C++20
+ ranges::next_permutation(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
}
@@ -1684,6 +1705,18 @@ template <class InputIterator1, class InputIterator2, class Compare>
lexicographical_compare(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2, Compare comp);
+template<class InputIterator1, class InputIterator2, class Cmp>
+ constexpr auto
+ lexicographical_compare_three_way(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, InputIterator2 last2,
+ Cmp comp)
+ -> decltype(comp(*b1, *b2)); // since C++20
+
+template<class InputIterator1, class InputIterator2>
+ constexpr auto
+ lexicographical_compare_three_way(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, InputIterator2 last2); // since C++20
+
template <class BidirectionalIterator>
constexpr bool // constexpr in C++20
next_permutation(BidirectionalIterator first, BidirectionalIterator last);
@@ -1705,9 +1738,7 @@ template <class BidirectionalIterator, class Compare>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
-#include <__debug>
#include <cstddef>
-#include <type_traits>
#include <version>
#include <__algorithm/adjacent_find.h>
@@ -1753,6 +1784,7 @@ template <class BidirectionalIterator, class Compare>
#include <__algorithm/is_sorted_until.h>
#include <__algorithm/iter_swap.h>
#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lexicographical_compare_three_way.h>
#include <__algorithm/lower_bound.h>
#include <__algorithm/make_heap.h>
#include <__algorithm/max.h>
@@ -1776,6 +1808,19 @@ template <class BidirectionalIterator, class Compare>
#include <__algorithm/partition_point.h>
#include <__algorithm/pop_heap.h>
#include <__algorithm/prev_permutation.h>
+#include <__algorithm/pstl_any_all_none_of.h>
+#include <__algorithm/pstl_copy.h>
+#include <__algorithm/pstl_count.h>
+#include <__algorithm/pstl_fill.h>
+#include <__algorithm/pstl_find.h>
+#include <__algorithm/pstl_for_each.h>
+#include <__algorithm/pstl_generate.h>
+#include <__algorithm/pstl_is_partitioned.h>
+#include <__algorithm/pstl_merge.h>
+#include <__algorithm/pstl_replace.h>
+#include <__algorithm/pstl_sort.h>
+#include <__algorithm/pstl_stable_sort.h>
+#include <__algorithm/pstl_transform.h>
#include <__algorithm/push_heap.h>
#include <__algorithm/ranges_adjacent_find.h>
#include <__algorithm/ranges_all_of.h>
@@ -1857,6 +1902,7 @@ template <class BidirectionalIterator, class Compare>
#include <__algorithm/ranges_sort_heap.h>
#include <__algorithm/ranges_stable_partition.h>
#include <__algorithm/ranges_stable_sort.h>
+#include <__algorithm/ranges_starts_with.h>
#include <__algorithm/ranges_swap_ranges.h>
#include <__algorithm/ranges_transform.h>
#include <__algorithm/ranges_unique.h>
@@ -1886,6 +1932,7 @@ template <class BidirectionalIterator, class Compare>
#include <__algorithm/shuffle.h>
#include <__algorithm/sift_down.h>
#include <__algorithm/sort.h>
+#include <__algorithm/sort_old.h>
#include <__algorithm/sort_heap.h>
#include <__algorithm/stable_partition.h>
#include <__algorithm/stable_sort.h>
@@ -1905,21 +1952,16 @@ template <class BidirectionalIterator, class Compare>
# pragma GCC system_header
#endif
-#if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17
-#error # include <__pstl_algorithm>
-#endif
-
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
-# include <chrono>
-#endif
-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
+# include <bit>
# include <concepts>
+# include <cstdlib>
# include <cstring>
# include <iterator>
# include <memory>
# include <stdexcept>
+# include <type_traits>
# include <utility>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/any b/contrib/libs/cxxsupp/libcxx/include/any
index 50a44d7f4d7..b3ac5871c42 100644
--- a/contrib/libs/cxxsupp/libcxx/include/any
+++ b/contrib/libs/cxxsupp/libcxx/include/any
@@ -87,13 +87,27 @@ namespace std {
#include <__memory/allocator_destructor.h>
#include <__memory/allocator_traits.h>
#include <__memory/unique_ptr.h>
+#include <__type_traits/add_const.h>
+#include <__type_traits/add_pointer.h>
+#include <__type_traits/aligned_storage.h>
+#include <__type_traits/alignment_of.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_copy_constructible.h>
+#include <__type_traits/is_function.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/remove_cv.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/forward.h>
#include <__utility/in_place.h>
#include <__utility/move.h>
#include <__utility/unreachable.h>
-#include <cstdlib>
+#include <__verbose_abort>
#include <initializer_list>
-#include <type_traits>
#include <typeinfo>
#include <version>
@@ -101,8 +115,11 @@ namespace std {
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
namespace std {
-class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
+class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
{
public:
const char* what() const _NOEXCEPT override;
@@ -111,16 +128,16 @@ public:
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
void __throw_bad_any_cast()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_any_cast();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_any_cast was thrown in -fno-exceptions mode");
#endif
}
@@ -311,7 +328,7 @@ private:
const void* __fallback_info);
union _Storage {
- constexpr _Storage() : __ptr(nullptr) {}
+ _LIBCPP_HIDE_FROM_ABI constexpr _Storage() : __ptr(nullptr) {}
void * __ptr;
__any_imp::_Buffer __buf;
};
@@ -692,10 +709,12 @@ any_cast(any * __any) _NOEXCEPT
return nullptr;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
# include <chrono>
#endif
@@ -703,9 +722,12 @@ _LIBCPP_END_NAMESPACE_STD
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <iosfwd>
# include <iterator>
# include <memory>
+# include <stdexcept>
+# include <type_traits>
# include <variant>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/array b/contrib/libs/cxxsupp/libcxx/include/array
index 068a6bd4cc4..3fc25d4c306 100644
--- a/contrib/libs/cxxsupp/libcxx/include/array
+++ b/contrib/libs/cxxsupp/libcxx/include/array
@@ -77,15 +77,18 @@ template <class T, class... U>
template <class T, size_t N>
bool operator==(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20
template <class T, size_t N>
- bool operator!=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20
+ bool operator!=(const array<T,N>& x, const array<T,N>& y); // removed in C++20
template <class T, size_t N>
- bool operator<(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20
+ bool operator<(const array<T,N>& x, const array<T,N>& y); // removed in C++20
template <class T, size_t N>
- bool operator>(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20
+ bool operator>(const array<T,N>& x, const array<T,N>& y); // removed in C++20
template <class T, size_t N>
- bool operator<=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20
+ bool operator<=(const array<T,N>& x, const array<T,N>& y); // removed in C++20
template <class T, size_t N>
- bool operator>=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20
+ bool operator>=(const array<T,N>& x, const array<T,N>& y); // removed in C++20
+template<class T, size_t N>
+ constexpr synth-three-way-result<T>
+ operator<=>(const array<T, N>& x, const array<T, N>& y); // since C++20
template <class T, size_t N >
void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y))); // constexpr in C++20
@@ -111,16 +114,27 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
#include <__algorithm/equal.h>
#include <__algorithm/fill_n.h>
#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lexicographical_compare_three_way.h>
#include <__algorithm/swap_ranges.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
+#include <__fwd/array.h>
#include <__iterator/reverse_iterator.h>
-#include <__tuple_dir/sfinae_helpers.h>
+#include <__tuple/sfinae_helpers.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/is_array.h>
+#include <__type_traits/is_const.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_move_constructible.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_swappable.h>
+#include <__type_traits/remove_cv.h>
#include <__utility/integer_sequence.h>
#include <__utility/move.h>
#include <__utility/unreachable.h>
#include <stdexcept>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -137,8 +151,8 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
#include <initializer_list>
// [tuple.helper]
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_size.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_size.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -215,23 +229,23 @@ struct _LIBCPP_TEMPLATE_VIS array
// element access:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reference operator[](size_type __n) _NOEXCEPT {
- _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < _Size, "out-of-bounds access in std::array<T, N>");
return __elems_[__n];
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const_reference operator[](size_type __n) const _NOEXCEPT {
- _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < _Size, "out-of-bounds access in std::array<T, N>");
return __elems_[__n];
}
- _LIBCPP_CONSTEXPR_SINCE_CXX17 reference at(size_type __n)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference at(size_type __n)
{
if (__n >= _Size)
__throw_out_of_range("array::at");
return __elems_[__n];
}
- _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference at(size_type __n) const
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference at(size_type __n) const
{
if (__n >= _Size)
__throw_out_of_range("array::at");
@@ -328,13 +342,13 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0>
// element access:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reference operator[](size_type) _NOEXCEPT {
- _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
__libcpp_unreachable();
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const_reference operator[](size_type) const _NOEXCEPT {
- _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
__libcpp_unreachable();
}
@@ -352,31 +366,31 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reference front() _NOEXCEPT {
- _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::front() on a zero-sized array");
__libcpp_unreachable();
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const_reference front() const _NOEXCEPT {
- _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::front() on a zero-sized array");
__libcpp_unreachable();
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reference back() _NOEXCEPT {
- _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::back() on a zero-sized array");
__libcpp_unreachable();
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const_reference back() const _NOEXCEPT {
- _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::back() on a zero-sized array");
__libcpp_unreachable();
}
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Tp, class... _Args,
class = enable_if_t<__all<_IsSame<_Tp, _Args>::value...>::value>
>
@@ -392,47 +406,44 @@ operator==(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
return _VSTD::equal(__x.begin(), __x.end(), __y.begin());
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_SINCE_CXX20 bool
-operator!=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
-{
+inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) {
return !(__x == __y);
}
template <class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_SINCE_CXX20 bool
-operator<(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
-{
- return _VSTD::lexicographical_compare(__x.begin(), __x.end(),
- __y.begin(), __y.end());
+inline _LIBCPP_HIDE_FROM_ABI bool operator<(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) {
+ return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
}
template <class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_SINCE_CXX20 bool
-operator>(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
-{
+inline _LIBCPP_HIDE_FROM_ABI bool operator>(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) {
return __y < __x;
}
template <class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_SINCE_CXX20 bool
-operator<=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
-{
+inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) {
return !(__y < __x);
}
template <class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_SINCE_CXX20 bool
-operator>=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
-{
+inline _LIBCPP_HIDE_FROM_ABI bool operator>=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) {
return !(__x < __y);
}
+#else // _LIBCPP_STD_VER <= 17
+
+template <class _Tp, size_t _Size>
+_LIBCPP_HIDE_FROM_ABI constexpr __synth_three_way_result<_Tp>
+operator<=>(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) {
+ return std::lexicographical_compare_three_way(
+ __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>);
+}
+
+#endif // _LIBCPP_STD_VER <= 17
+
template <class _Tp, size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
__enable_if_t<_Size == 0 || __is_swappable<_Tp>::value, void>
@@ -489,7 +500,7 @@ get(const array<_Tp, _Size>&& __a) _NOEXCEPT
return _VSTD::move(__a.__elems_[_Ip]);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _Tp, size_t _Size, size_t... _Index>
_LIBCPP_INLINE_VISIBILITY constexpr array<remove_cv_t<_Tp>, _Size>
@@ -528,14 +539,16 @@ to_array(_Tp(&&__arr)[_Size]) noexcept(is_nothrow_move_constructible_v<_Tp>) {
make_index_sequence<_Size>());
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <concepts>
+# include <cstdlib>
# include <iterator>
+# include <type_traits>
# include <utility>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/atomic b/contrib/libs/cxxsupp/libcxx/include/atomic
index d0d682da623..2f122a707bd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/atomic
+++ b/contrib/libs/cxxsupp/libcxx/include/atomic
@@ -519,2154 +519,39 @@ template <class T>
*/
#include <__assert> // all public C++ headers provide the assertion handler
-#include <__availability>
-#include <__chrono/duration.h>
+#include <__atomic/aliases.h>
+#include <__atomic/atomic.h>
+#include <__atomic/atomic_base.h>
+#include <__atomic/atomic_flag.h>
+#include <__atomic/atomic_init.h>
+#include <__atomic/atomic_lock_free.h>
+#include <__atomic/atomic_sync.h>
+#include <__atomic/check_memory_order.h>
+#include <__atomic/contention_t.h>
+#include <__atomic/cxx_atomic_impl.h>
+#include <__atomic/fence.h>
+#include <__atomic/is_always_lock_free.h>
+#include <__atomic/kill_dependency.h>
+#include <__atomic/memory_order.h>
#include <__config>
-#include <__thread/poll_with_backoff.h>
-#include <__thread/timed_backoff_policy.h>
-#include <__type_traits/conditional.h>
-#include <__type_traits/decay.h>
-#include <__type_traits/is_assignable.h>
-#include <__type_traits/is_function.h>
-#include <__type_traits/is_nothrow_default_constructible.h>
-#include <__type_traits/is_same.h>
-#include <__type_traits/is_trivially_copyable.h>
-#include <__type_traits/remove_const.h>
-#include <__type_traits/remove_pointer.h>
-#include <__type_traits/underlying_type.h>
-#include <cstddef>
-#include <cstdint>
-#include <cstring>
#include <version>
-#ifndef _LIBCPP_HAS_NO_THREADS
-# include <__threading_support>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#ifdef _LIBCPP_HAS_NO_ATOMIC_HEADER
-# error <atomic> is not implemented
-#endif
-#ifdef kill_dependency
-# error <atomic> is incompatible with <stdatomic.h> before C++23. Please compile with -std=c++23.
+# error <atomic> is not implemented
#endif
-#define _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) \
- _LIBCPP_DIAGNOSE_WARNING(__m == memory_order_consume || \
- __m == memory_order_acquire || \
- __m == memory_order_acq_rel, \
- "memory order argument to atomic operation is invalid")
-
-#define _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) \
- _LIBCPP_DIAGNOSE_WARNING(__m == memory_order_release || \
- __m == memory_order_acq_rel, \
- "memory order argument to atomic operation is invalid")
-
-#define _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__m, __f) \
- _LIBCPP_DIAGNOSE_WARNING(__f == memory_order_release || \
- __f == memory_order_acq_rel, \
- "memory order argument to atomic operation is invalid")
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-// Figure out what the underlying type for `memory_order` would be if it were
-// declared as an unscoped enum (accounting for -fshort-enums). Use this result
-// to pin the underlying type in C++20.
-enum __legacy_memory_order {
- __mo_relaxed,
- __mo_consume,
- __mo_acquire,
- __mo_release,
- __mo_acq_rel,
- __mo_seq_cst
-};
-
-typedef underlying_type<__legacy_memory_order>::type __memory_order_underlying_t;
-
-#if _LIBCPP_STD_VER > 17
-
-enum class memory_order : __memory_order_underlying_t {
- relaxed = __mo_relaxed,
- consume = __mo_consume,
- acquire = __mo_acquire,
- release = __mo_release,
- acq_rel = __mo_acq_rel,
- seq_cst = __mo_seq_cst
-};
-
-inline constexpr auto memory_order_relaxed = memory_order::relaxed;
-inline constexpr auto memory_order_consume = memory_order::consume;
-inline constexpr auto memory_order_acquire = memory_order::acquire;
-inline constexpr auto memory_order_release = memory_order::release;
-inline constexpr auto memory_order_acq_rel = memory_order::acq_rel;
-inline constexpr auto memory_order_seq_cst = memory_order::seq_cst;
-
-#else
-
-typedef enum memory_order {
- memory_order_relaxed = __mo_relaxed,
- memory_order_consume = __mo_consume,
- memory_order_acquire = __mo_acquire,
- memory_order_release = __mo_release,
- memory_order_acq_rel = __mo_acq_rel,
- memory_order_seq_cst = __mo_seq_cst,
-} memory_order;
-
-#endif // _LIBCPP_STD_VER > 17
-
-template <typename _Tp> _LIBCPP_INLINE_VISIBILITY
-bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp const& __rhs) {
- return _VSTD::memcmp(&__lhs, &__rhs, sizeof(_Tp)) == 0;
-}
-
-static_assert((is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value),
- "unexpected underlying type for std::memory_order");
-
-#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) || \
- defined(_LIBCPP_ATOMIC_ONLY_USE_BUILTINS)
-
-// [atomics.types.generic]p1 guarantees _Tp is trivially copyable. Because
-// the default operator= in an object is not volatile, a byte-by-byte copy
-// is required.
-template <typename _Tp, typename _Tv> _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
-__cxx_atomic_assign_volatile(_Tp& __a_value, _Tv const& __val) {
- __a_value = __val;
-}
-template <typename _Tp, typename _Tv> _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
-__cxx_atomic_assign_volatile(_Tp volatile& __a_value, _Tv volatile const& __val) {
- volatile char* __to = reinterpret_cast<volatile char*>(&__a_value);
- volatile char* __end = __to + sizeof(_Tp);
- volatile const char* __from = reinterpret_cast<volatile const char*>(&__val);
- while (__to != __end)
- *__to++ = *__from++;
-}
-
-#endif
-
-#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)
-
-template <typename _Tp>
-struct __cxx_atomic_base_impl {
-
- _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_CXX03_LANG
- __cxx_atomic_base_impl() _NOEXCEPT = default;
-#else
- __cxx_atomic_base_impl() _NOEXCEPT : __a_value() {}
-#endif // _LIBCPP_CXX03_LANG
- _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp value) _NOEXCEPT
- : __a_value(value) {}
- _Tp __a_value;
-};
-
-_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR int __to_gcc_order(memory_order __order) {
- // Avoid switch statement to make this a constexpr.
- return __order == memory_order_relaxed ? __ATOMIC_RELAXED:
- (__order == memory_order_acquire ? __ATOMIC_ACQUIRE:
- (__order == memory_order_release ? __ATOMIC_RELEASE:
- (__order == memory_order_seq_cst ? __ATOMIC_SEQ_CST:
- (__order == memory_order_acq_rel ? __ATOMIC_ACQ_REL:
- __ATOMIC_CONSUME))));
-}
-
-_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR int __to_gcc_failure_order(memory_order __order) {
- // Avoid switch statement to make this a constexpr.
- return __order == memory_order_relaxed ? __ATOMIC_RELAXED:
- (__order == memory_order_acquire ? __ATOMIC_ACQUIRE:
- (__order == memory_order_release ? __ATOMIC_RELAXED:
- (__order == memory_order_seq_cst ? __ATOMIC_SEQ_CST:
- (__order == memory_order_acq_rel ? __ATOMIC_ACQUIRE:
- __ATOMIC_CONSUME))));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_init(volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp __val) {
- __cxx_atomic_assign_volatile(__a->__a_value, __val);
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp>* __a, _Tp __val) {
- __a->__a_value = __val;
-}
-
-_LIBCPP_INLINE_VISIBILITY inline
-void __cxx_atomic_thread_fence(memory_order __order) {
- __atomic_thread_fence(__to_gcc_order(__order));
-}
-
-_LIBCPP_INLINE_VISIBILITY inline
-void __cxx_atomic_signal_fence(memory_order __order) {
- __atomic_signal_fence(__to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_store(volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp __val,
- memory_order __order) {
- __atomic_store(&__a->__a_value, &__val,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp>* __a, _Tp __val,
- memory_order __order) {
- __atomic_store(&__a->__a_value, &__val,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_load(const volatile __cxx_atomic_base_impl<_Tp>* __a,
- memory_order __order) {
- _Tp __ret;
- __atomic_load(&__a->__a_value, &__ret,
- __to_gcc_order(__order));
- return __ret;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_load(const __cxx_atomic_base_impl<_Tp>* __a, memory_order __order) {
- _Tp __ret;
- __atomic_load(&__a->__a_value, &__ret,
- __to_gcc_order(__order));
- return __ret;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_exchange(volatile __cxx_atomic_base_impl<_Tp>* __a,
- _Tp __value, memory_order __order) {
- _Tp __ret;
- __atomic_exchange(&__a->__a_value, &__value, &__ret,
- __to_gcc_order(__order));
- return __ret;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp>* __a, _Tp __value,
- memory_order __order) {
- _Tp __ret;
- __atomic_exchange(&__a->__a_value, &__value, &__ret,
- __to_gcc_order(__order));
- return __ret;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_strong(
- volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value,
- memory_order __success, memory_order __failure) {
- return __atomic_compare_exchange(&__a->__a_value, __expected, &__value,
- false,
- __to_gcc_order(__success),
- __to_gcc_failure_order(__failure));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_strong(
- __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success,
- memory_order __failure) {
- return __atomic_compare_exchange(&__a->__a_value, __expected, &__value,
- false,
- __to_gcc_order(__success),
- __to_gcc_failure_order(__failure));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_weak(
- volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value,
- memory_order __success, memory_order __failure) {
- return __atomic_compare_exchange(&__a->__a_value, __expected, &__value,
- true,
- __to_gcc_order(__success),
- __to_gcc_failure_order(__failure));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_weak(
- __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success,
- memory_order __failure) {
- return __atomic_compare_exchange(&__a->__a_value, __expected, &__value,
- true,
- __to_gcc_order(__success),
- __to_gcc_failure_order(__failure));
-}
-
-template <typename _Tp>
-struct __skip_amt { enum {value = 1}; };
-
-template <typename _Tp>
-struct __skip_amt<_Tp*> { enum {value = sizeof(_Tp)}; };
-
-// FIXME: Haven't figured out what the spec says about using arrays with
-// atomic_fetch_add. Force a failure rather than creating bad behavior.
-template <typename _Tp>
-struct __skip_amt<_Tp[]> { };
-template <typename _Tp, int n>
-struct __skip_amt<_Tp[n]> { };
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_base_impl<_Tp>* __a,
- _Td __delta, memory_order __order) {
- return __atomic_fetch_add(&__a->__a_value, __delta * __skip_amt<_Tp>::value,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta,
- memory_order __order) {
- return __atomic_fetch_add(&__a->__a_value, __delta * __skip_amt<_Tp>::value,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_base_impl<_Tp>* __a,
- _Td __delta, memory_order __order) {
- return __atomic_fetch_sub(&__a->__a_value, __delta * __skip_amt<_Tp>::value,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta,
- memory_order __order) {
- return __atomic_fetch_sub(&__a->__a_value, __delta * __skip_amt<_Tp>::value,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_base_impl<_Tp>* __a,
- _Tp __pattern, memory_order __order) {
- return __atomic_fetch_and(&__a->__a_value, __pattern,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp>* __a,
- _Tp __pattern, memory_order __order) {
- return __atomic_fetch_and(&__a->__a_value, __pattern,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_base_impl<_Tp>* __a,
- _Tp __pattern, memory_order __order) {
- return __atomic_fetch_or(&__a->__a_value, __pattern,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern,
- memory_order __order) {
- return __atomic_fetch_or(&__a->__a_value, __pattern,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_base_impl<_Tp>* __a,
- _Tp __pattern, memory_order __order) {
- return __atomic_fetch_xor(&__a->__a_value, __pattern,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern,
- memory_order __order) {
- return __atomic_fetch_xor(&__a->__a_value, __pattern,
- __to_gcc_order(__order));
-}
-
-#define __cxx_atomic_is_lock_free(__s) __atomic_is_lock_free(__s, 0)
-
-#elif defined(_LIBCPP_HAS_C_ATOMIC_IMP)
-
-template <typename _Tp>
-struct __cxx_atomic_base_impl {
-
- _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_CXX03_LANG
- __cxx_atomic_base_impl() _NOEXCEPT = default;
-#else
- __cxx_atomic_base_impl() _NOEXCEPT : __a_value() {}
-#endif // _LIBCPP_CXX03_LANG
- _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp __value) _NOEXCEPT
- : __a_value(__value) {}
- _LIBCPP_DISABLE_EXTENSION_WARNING _Atomic(_Tp) __a_value;
-};
-
-#define __cxx_atomic_is_lock_free(__s) __c11_atomic_is_lock_free(__s)
-
-_LIBCPP_INLINE_VISIBILITY inline
-void __cxx_atomic_thread_fence(memory_order __order) _NOEXCEPT {
- __c11_atomic_thread_fence(static_cast<__memory_order_underlying_t>(__order));
-}
-
-_LIBCPP_INLINE_VISIBILITY inline
-void __cxx_atomic_signal_fence(memory_order __order) _NOEXCEPT {
- __c11_atomic_signal_fence(static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val) _NOEXCEPT {
- __c11_atomic_init(&__a->__a_value, __val);
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val) _NOEXCEPT {
- __c11_atomic_init(&__a->__a_value, __val);
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val, memory_order __order) _NOEXCEPT {
- __c11_atomic_store(&__a->__a_value, __val, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val, memory_order __order) _NOEXCEPT {
- __c11_atomic_store(&__a->__a_value, __val, static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const volatile* __a, memory_order __order) _NOEXCEPT {
- using __ptr_type = __remove_const_t<decltype(__a->__a_value)>*;
- return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const* __a, memory_order __order) _NOEXCEPT {
- using __ptr_type = __remove_const_t<decltype(__a->__a_value)>*;
- return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __value, memory_order __order) _NOEXCEPT {
- return __c11_atomic_exchange(&__a->__a_value, __value, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> * __a, _Tp __value, memory_order __order) _NOEXCEPT {
- return __c11_atomic_exchange(&__a->__a_value, __value, static_cast<__memory_order_underlying_t>(__order));
-}
-
-_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR memory_order __to_failure_order(memory_order __order) {
- // Avoid switch statement to make this a constexpr.
- return __order == memory_order_release ? memory_order_relaxed:
- (__order == memory_order_acq_rel ? memory_order_acquire:
- __order);
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
- return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
- return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
- return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
- return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_and(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_and(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_or(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_or(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_xor(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_xor(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
-}
-
-#endif // _LIBCPP_HAS_GCC_ATOMIC_IMP, _LIBCPP_HAS_C_ATOMIC_IMP
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp kill_dependency(_Tp __y) _NOEXCEPT
-{
- return __y;
-}
-
-#if defined(__CLANG_ATOMIC_BOOL_LOCK_FREE)
-# define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE
-# define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
-# define ATOMIC_CHAR8_T_LOCK_FREE __CLANG_ATOMIC_CHAR8_T_LOCK_FREE
-#endif
-# define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
-# define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
-# define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
-# define ATOMIC_SHORT_LOCK_FREE __CLANG_ATOMIC_SHORT_LOCK_FREE
-# define ATOMIC_INT_LOCK_FREE __CLANG_ATOMIC_INT_LOCK_FREE
-# define ATOMIC_LONG_LOCK_FREE __CLANG_ATOMIC_LONG_LOCK_FREE
-# define ATOMIC_LLONG_LOCK_FREE __CLANG_ATOMIC_LLONG_LOCK_FREE
-# define ATOMIC_POINTER_LOCK_FREE __CLANG_ATOMIC_POINTER_LOCK_FREE
-#elif defined(__GCC_ATOMIC_BOOL_LOCK_FREE)
-# define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
-# define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
-# define ATOMIC_CHAR8_T_LOCK_FREE __GCC_ATOMIC_CHAR8_T_LOCK_FREE
-#endif
-# define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
-# define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
-# define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
-# define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
-# define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
-# define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
-# define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
-# define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
-#endif
-
-template <class _Tp>
-struct __libcpp_is_always_lock_free {
- // __atomic_always_lock_free is available in all Standard modes
- static const bool __value = __atomic_always_lock_free(sizeof(_Tp), 0);
-};
-
-#ifdef _LIBCPP_ATOMIC_ONLY_USE_BUILTINS
-
-template<typename _Tp>
-struct __cxx_atomic_lock_impl {
-
- _LIBCPP_INLINE_VISIBILITY
- __cxx_atomic_lock_impl() _NOEXCEPT
- : __a_value(), __a_lock(0) {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR explicit
- __cxx_atomic_lock_impl(_Tp value) _NOEXCEPT
- : __a_value(value), __a_lock(0) {}
-
- _Tp __a_value;
- mutable __cxx_atomic_base_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_lock;
-
- _LIBCPP_INLINE_VISIBILITY void __lock() const volatile {
- while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(true), memory_order_acquire))
- /*spin*/;
- }
- _LIBCPP_INLINE_VISIBILITY void __lock() const {
- while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(true), memory_order_acquire))
- /*spin*/;
- }
- _LIBCPP_INLINE_VISIBILITY void __unlock() const volatile {
- __cxx_atomic_store(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(false), memory_order_release);
- }
- _LIBCPP_INLINE_VISIBILITY void __unlock() const {
- __cxx_atomic_store(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(false), memory_order_release);
- }
- _LIBCPP_INLINE_VISIBILITY _Tp __read() const volatile {
- __lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a_value);
- __unlock();
- return __old;
- }
- _LIBCPP_INLINE_VISIBILITY _Tp __read() const {
- __lock();
- _Tp __old = __a_value;
- __unlock();
- return __old;
- }
-};
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_init(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __val) {
- __cxx_atomic_assign_volatile(__a->__a_value, __val);
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_init(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __val) {
- __a->__a_value = __val;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_store(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __val, memory_order) {
- __a->__lock();
- __cxx_atomic_assign_volatile(__a->__a_value, __val);
- __a->__unlock();
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_store(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __val, memory_order) {
- __a->__lock();
- __a->__a_value = __val;
- __a->__unlock();
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_load(const volatile __cxx_atomic_lock_impl<_Tp>* __a, memory_order) {
- return __a->__read();
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_load(const __cxx_atomic_lock_impl<_Tp>* __a, memory_order) {
- return __a->__read();
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_exchange(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __value, memory_order) {
- __a->__lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, __value);
- __a->__unlock();
- return __old;
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_exchange(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __value, memory_order) {
- __a->__lock();
- _Tp __old = __a->__a_value;
- __a->__a_value = __value;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_strong(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Tp* __expected, _Tp __value, memory_order, memory_order) {
- _Tp __temp;
- __a->__lock();
- __cxx_atomic_assign_volatile(__temp, __a->__a_value);
- bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
- if(__ret)
- __cxx_atomic_assign_volatile(__a->__a_value, __value);
- else
- __cxx_atomic_assign_volatile(*__expected, __a->__a_value);
- __a->__unlock();
- return __ret;
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_lock_impl<_Tp>* __a,
- _Tp* __expected, _Tp __value, memory_order, memory_order) {
- __a->__lock();
- bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
- if(__ret)
- _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
- else
- _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
- __a->__unlock();
- return __ret;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_weak(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Tp* __expected, _Tp __value, memory_order, memory_order) {
- _Tp __temp;
- __a->__lock();
- __cxx_atomic_assign_volatile(__temp, __a->__a_value);
- bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
- if(__ret)
- __cxx_atomic_assign_volatile(__a->__a_value, __value);
- else
- __cxx_atomic_assign_volatile(*__expected, __a->__a_value);
- __a->__unlock();
- return __ret;
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_lock_impl<_Tp>* __a,
- _Tp* __expected, _Tp __value, memory_order, memory_order) {
- __a->__lock();
- bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
- if(__ret)
- _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
- else
- _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
- __a->__unlock();
- return __ret;
-}
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Td __delta, memory_order) {
- __a->__lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old + __delta));
- __a->__unlock();
- return __old;
-}
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp>* __a,
- _Td __delta, memory_order) {
- __a->__lock();
- _Tp __old = __a->__a_value;
- __a->__a_value += __delta;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp* __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp*>* __a,
- ptrdiff_t __delta, memory_order) {
- __a->__lock();
- _Tp* __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, __old + __delta);
- __a->__unlock();
- return __old;
-}
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp* __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp*>* __a,
- ptrdiff_t __delta, memory_order) {
- __a->__lock();
- _Tp* __old = __a->__a_value;
- __a->__a_value += __delta;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Td __delta, memory_order) {
- __a->__lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old - __delta));
- __a->__unlock();
- return __old;
-}
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_sub(__cxx_atomic_lock_impl<_Tp>* __a,
- _Td __delta, memory_order) {
- __a->__lock();
- _Tp __old = __a->__a_value;
- __a->__a_value -= __delta;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Tp __pattern, memory_order) {
- __a->__lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old & __pattern));
- __a->__unlock();
- return __old;
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_and(__cxx_atomic_lock_impl<_Tp>* __a,
- _Tp __pattern, memory_order) {
- __a->__lock();
- _Tp __old = __a->__a_value;
- __a->__a_value &= __pattern;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Tp __pattern, memory_order) {
- __a->__lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old | __pattern));
- __a->__unlock();
- return __old;
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_or(__cxx_atomic_lock_impl<_Tp>* __a,
- _Tp __pattern, memory_order) {
- __a->__lock();
- _Tp __old = __a->__a_value;
- __a->__a_value |= __pattern;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Tp __pattern, memory_order) {
- __a->__lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old ^ __pattern));
- __a->__unlock();
- return __old;
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_xor(__cxx_atomic_lock_impl<_Tp>* __a,
- _Tp __pattern, memory_order) {
- __a->__lock();
- _Tp __old = __a->__a_value;
- __a->__a_value ^= __pattern;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp,
- typename _Base = typename conditional<__libcpp_is_always_lock_free<_Tp>::__value,
- __cxx_atomic_base_impl<_Tp>,
- __cxx_atomic_lock_impl<_Tp> >::type>
-#else
-template <typename _Tp,
- typename _Base = __cxx_atomic_base_impl<_Tp> >
-#endif //_LIBCPP_ATOMIC_ONLY_USE_BUILTINS
-struct __cxx_atomic_impl : public _Base {
- static_assert(is_trivially_copyable<_Tp>::value,
- "std::atomic<T> requires that 'T' be a trivially copyable type");
-
- _LIBCPP_INLINE_VISIBILITY __cxx_atomic_impl() _NOEXCEPT = default;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR explicit __cxx_atomic_impl(_Tp __value) _NOEXCEPT
- : _Base(__value) {}
-};
-
-#if defined(__linux__) || (defined(_AIX) && !defined(__64BIT__))
- using __cxx_contention_t = int32_t;
-#else
- using __cxx_contention_t = int64_t;
-#endif // __linux__ || (_AIX && !__64BIT__)
-
-using __cxx_atomic_contention_t = __cxx_atomic_impl<__cxx_contention_t>;
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(void const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(void const volatile*, __cxx_contention_t);
-
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(__cxx_atomic_contention_t const volatile*, __cxx_contention_t);
-
-template <class _Atp, class _Fn>
-struct __libcpp_atomic_wait_backoff_impl {
- _Atp* __a;
- _Fn __test_fn;
- _LIBCPP_AVAILABILITY_SYNC
- _LIBCPP_INLINE_VISIBILITY bool operator()(chrono::nanoseconds __elapsed) const
- {
- if(__elapsed > chrono::microseconds(64))
- {
- auto const __monitor = std::__libcpp_atomic_monitor(__a);
- if(__test_fn())
- return true;
- std::__libcpp_atomic_wait(__a, __monitor);
- }
- else if(__elapsed > chrono::microseconds(4))
- __libcpp_thread_yield();
- else
- {} // poll
- return false;
- }
-};
-
-template <class _Atp, class _Fn>
-_LIBCPP_AVAILABILITY_SYNC
-_LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp* __a, _Fn && __test_fn)
-{
- __libcpp_atomic_wait_backoff_impl<_Atp, typename decay<_Fn>::type> __backoff_fn = {__a, __test_fn};
- return std::__libcpp_thread_poll_with_backoff(__test_fn, __backoff_fn);
-}
-
-#else // _LIBCPP_HAS_NO_THREADS
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY void __cxx_atomic_notify_all(__cxx_atomic_impl<_Tp> const volatile*) { }
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY void __cxx_atomic_notify_one(__cxx_atomic_impl<_Tp> const volatile*) { }
-template <class _Atp, class _Fn>
-_LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp*, _Fn && __test_fn)
-{
- return __libcpp_thread_poll_with_backoff(__test_fn, __spinning_backoff_policy());
-}
-
-#endif // _LIBCPP_HAS_NO_THREADS
-
-template <class _Atp, class _Tp>
-struct __cxx_atomic_wait_test_fn_impl {
- _Atp* __a;
- _Tp __val;
- memory_order __order;
- _LIBCPP_INLINE_VISIBILITY bool operator()() const
- {
- return !std::__cxx_nonatomic_compare_equal(std::__cxx_atomic_load(__a, __order), __val);
- }
-};
-
-template <class _Atp, class _Tp>
-_LIBCPP_AVAILABILITY_SYNC
-_LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp* __a, _Tp const __val, memory_order __order)
-{
- __cxx_atomic_wait_test_fn_impl<_Atp, _Tp> __test_fn = {__a, __val, __order};
- return std::__cxx_atomic_wait(__a, __test_fn);
-}
-
-// general atomic<T>
-
-template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value>
-struct __atomic_base // false
-{
- mutable __cxx_atomic_impl<_Tp> __a_;
-
-#if defined(__cpp_lib_atomic_is_always_lock_free)
- static _LIBCPP_CONSTEXPR bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value;
-#endif
-
- _LIBCPP_INLINE_VISIBILITY
- bool is_lock_free() const volatile _NOEXCEPT
- {return __cxx_atomic_is_lock_free(sizeof(_Tp));}
- _LIBCPP_INLINE_VISIBILITY
- bool is_lock_free() const _NOEXCEPT
- {return static_cast<__atomic_base const volatile*>(this)->is_lock_free();}
- _LIBCPP_INLINE_VISIBILITY
- void store(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
- {std::__cxx_atomic_store(&__a_, __d, __m);}
- _LIBCPP_INLINE_VISIBILITY
- void store(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
- {std::__cxx_atomic_store(&__a_, __d, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp load(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
- _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
- {return std::__cxx_atomic_load(&__a_, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp load(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
- _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
- {return std::__cxx_atomic_load(&__a_, __m);}
- _LIBCPP_INLINE_VISIBILITY
- operator _Tp() const volatile _NOEXCEPT {return load();}
- _LIBCPP_INLINE_VISIBILITY
- operator _Tp() const _NOEXCEPT {return load();}
- _LIBCPP_INLINE_VISIBILITY
- _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_exchange(&__a_, __d, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_exchange(&__a_, __d, __m);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_weak(_Tp& __e, _Tp __d,
- memory_order __s, memory_order __f) volatile _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
- {return std::__cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_weak(_Tp& __e, _Tp __d,
- memory_order __s, memory_order __f) _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
- {return std::__cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_strong(_Tp& __e, _Tp __d,
- memory_order __s, memory_order __f) volatile _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
- {return std::__cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_strong(_Tp& __e, _Tp __d,
- memory_order __s, memory_order __f) _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
- {return std::__cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_weak(_Tp& __e, _Tp __d,
- memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_weak(_Tp& __e, _Tp __d,
- memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_strong(_Tp& __e, _Tp __d,
- memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_strong(_Tp& __e, _Tp __d,
- memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
-
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
- {std::__cxx_atomic_wait(&__a_, __v, __m);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT
- {std::__cxx_atomic_wait(&__a_, __v, __m);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_one() volatile _NOEXCEPT
- {std::__cxx_atomic_notify_one(&__a_);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_one() _NOEXCEPT
- {std::__cxx_atomic_notify_one(&__a_);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_all() volatile _NOEXCEPT
- {std::__cxx_atomic_notify_all(&__a_);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_all() _NOEXCEPT
- {std::__cxx_atomic_notify_all(&__a_);}
-
-#if _LIBCPP_STD_VER > 17
- _LIBCPP_INLINE_VISIBILITY constexpr
- __atomic_base() noexcept(is_nothrow_default_constructible_v<_Tp>) : __a_(_Tp()) {}
-#else
- _LIBCPP_INLINE_VISIBILITY
- __atomic_base() _NOEXCEPT = default;
-#endif
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
-
- __atomic_base(const __atomic_base&) = delete;
-};
-
-#if defined(__cpp_lib_atomic_is_always_lock_free)
-template <class _Tp, bool __b>
-_LIBCPP_CONSTEXPR bool __atomic_base<_Tp, __b>::is_always_lock_free;
-#endif
-
-// atomic<Integral>
-
-template <class _Tp>
-struct __atomic_base<_Tp, true>
- : public __atomic_base<_Tp, false>
-{
- typedef __atomic_base<_Tp, false> __base;
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
- __atomic_base() _NOEXCEPT = default;
-
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {}
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_fetch_add(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_fetch_add(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_fetch_sub(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_fetch_sub(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_fetch_and(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_fetch_and(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_fetch_or(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_fetch_or(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_fetch_xor(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_fetch_xor(&this->__a_, __op, __m);}
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator++(int) volatile _NOEXCEPT {return fetch_add(_Tp(1));}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator++(int) _NOEXCEPT {return fetch_add(_Tp(1));}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator--(int) volatile _NOEXCEPT {return fetch_sub(_Tp(1));}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator--(int) _NOEXCEPT {return fetch_sub(_Tp(1));}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator++() volatile _NOEXCEPT {return fetch_add(_Tp(1)) + _Tp(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator++() _NOEXCEPT {return fetch_add(_Tp(1)) + _Tp(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator--() volatile _NOEXCEPT {return fetch_sub(_Tp(1)) - _Tp(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator--() _NOEXCEPT {return fetch_sub(_Tp(1)) - _Tp(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator+=(_Tp __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator+=(_Tp __op) _NOEXCEPT {return fetch_add(__op) + __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator-=(_Tp __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator-=(_Tp __op) _NOEXCEPT {return fetch_sub(__op) - __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator&=(_Tp __op) volatile _NOEXCEPT {return fetch_and(__op) & __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator&=(_Tp __op) _NOEXCEPT {return fetch_and(__op) & __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator|=(_Tp __op) volatile _NOEXCEPT {return fetch_or(__op) | __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator|=(_Tp __op) _NOEXCEPT {return fetch_or(__op) | __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator^=(_Tp __op) volatile _NOEXCEPT {return fetch_xor(__op) ^ __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator^=(_Tp __op) _NOEXCEPT {return fetch_xor(__op) ^ __op;}
-};
-
-// atomic<T>
-
-template <class _Tp>
-struct atomic
- : public __atomic_base<_Tp>
-{
- typedef __atomic_base<_Tp> __base;
- typedef _Tp value_type;
- typedef value_type difference_type;
-
-#if _LIBCPP_STD_VER > 17
- _LIBCPP_INLINE_VISIBILITY
- atomic() = default;
-#else
- _LIBCPP_INLINE_VISIBILITY
- atomic() _NOEXCEPT = default;
-#endif
-
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator=(_Tp __d) volatile _NOEXCEPT
- {__base::store(__d); return __d;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator=(_Tp __d) _NOEXCEPT
- {__base::store(__d); return __d;}
-
- atomic& operator=(const atomic&) = delete;
- atomic& operator=(const atomic&) volatile = delete;
-};
-
-// atomic<T*>
-
-template <class _Tp>
-struct atomic<_Tp*>
- : public __atomic_base<_Tp*>
-{
- typedef __atomic_base<_Tp*> __base;
- typedef _Tp* value_type;
- typedef ptrdiff_t difference_type;
-
- _LIBCPP_INLINE_VISIBILITY
- atomic() _NOEXCEPT = default;
-
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {}
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator=(_Tp* __d) volatile _NOEXCEPT
- {__base::store(__d); return __d;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator=(_Tp* __d) _NOEXCEPT
- {__base::store(__d); return __d;}
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
- // __atomic_fetch_add accepts function pointers, guard against them.
- static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
- return std::__cxx_atomic_fetch_add(&this->__a_, __op, __m);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
- // __atomic_fetch_add accepts function pointers, guard against them.
- static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
- return std::__cxx_atomic_fetch_add(&this->__a_, __op, __m);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
- // __atomic_fetch_add accepts function pointers, guard against them.
- static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
- return std::__cxx_atomic_fetch_sub(&this->__a_, __op, __m);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
- // __atomic_fetch_add accepts function pointers, guard against them.
- static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
- return std::__cxx_atomic_fetch_sub(&this->__a_, __op, __m);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator++(int) volatile _NOEXCEPT {return fetch_add(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator++(int) _NOEXCEPT {return fetch_add(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator--(int) volatile _NOEXCEPT {return fetch_sub(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator--(int) _NOEXCEPT {return fetch_sub(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator++() volatile _NOEXCEPT {return fetch_add(1) + 1;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator++() _NOEXCEPT {return fetch_add(1) + 1;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator--() volatile _NOEXCEPT {return fetch_sub(1) - 1;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator--() _NOEXCEPT {return fetch_sub(1) - 1;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator+=(ptrdiff_t __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator+=(ptrdiff_t __op) _NOEXCEPT {return fetch_add(__op) + __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator-=(ptrdiff_t __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator-=(ptrdiff_t __op) _NOEXCEPT {return fetch_sub(__op) - __op;}
-
- atomic& operator=(const atomic&) = delete;
- atomic& operator=(const atomic&) volatile = delete;
-};
-
-// atomic_is_lock_free
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_is_lock_free(const volatile atomic<_Tp>* __o) _NOEXCEPT
-{
- return __o->is_lock_free();
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT
-{
- return __o->is_lock_free();
-}
-
-// atomic_init
-
-template <class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_INLINE_VISIBILITY
-void
-atomic_init(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- std::__cxx_atomic_init(&__o->__a_, __d);
-}
-
-template <class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_INLINE_VISIBILITY
-void
-atomic_init(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- std::__cxx_atomic_init(&__o->__a_, __d);
-}
-
-// atomic_store
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void
-atomic_store(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- __o->store(__d);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void
-atomic_store(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- __o->store(__d);
-}
-
-// atomic_store_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void
-atomic_store_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
- _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
-{
- __o->store(__d, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void
-atomic_store_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
- _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
-{
- __o->store(__d, __m);
-}
-
-// atomic_load
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_load(const volatile atomic<_Tp>* __o) _NOEXCEPT
-{
- return __o->load();
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_load(const atomic<_Tp>* __o) _NOEXCEPT
-{
- return __o->load();
-}
-
-// atomic_load_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
- _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
-{
- return __o->load(__m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
- _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
-{
- return __o->load(__m);
-}
-
-// atomic_exchange
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_exchange(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- return __o->exchange(__d);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_exchange(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- return __o->exchange(__d);
-}
-
-// atomic_exchange_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_exchange_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
-{
- return __o->exchange(__d, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_exchange_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
-{
- return __o->exchange(__d, __m);
-}
-
-// atomic_compare_exchange_weak
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- return __o->compare_exchange_weak(*__e, __d);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_weak(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- return __o->compare_exchange_weak(*__e, __d);
-}
-
-// atomic_compare_exchange_strong
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- return __o->compare_exchange_strong(*__e, __d);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_strong(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- return __o->compare_exchange_strong(*__e, __d);
-}
-
-// atomic_compare_exchange_weak_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
- typename atomic<_Tp>::value_type __d,
- memory_order __s, memory_order __f) _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
-{
- return __o->compare_exchange_weak(*__e, __d, __s, __f);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
- memory_order __s, memory_order __f) _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
-{
- return __o->compare_exchange_weak(*__e, __d, __s, __f);
-}
-
-// atomic_compare_exchange_strong_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o,
- typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
- memory_order __s, memory_order __f) _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
-{
- return __o->compare_exchange_strong(*__e, __d, __s, __f);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
- typename atomic<_Tp>::value_type __d,
- memory_order __s, memory_order __f) _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
-{
- return __o->compare_exchange_strong(*__e, __d, __s, __f);
-}
-
-// atomic_wait
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_wait(const volatile atomic<_Tp>* __o,
- typename atomic<_Tp>::value_type __v) _NOEXCEPT
-{
- return __o->wait(__v);
-}
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_wait(const atomic<_Tp>* __o,
- typename atomic<_Tp>::value_type __v) _NOEXCEPT
-{
- return __o->wait(__v);
-}
-
-// atomic_wait_explicit
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_wait_explicit(const volatile atomic<_Tp>* __o,
- typename atomic<_Tp>::value_type __v,
- memory_order __m) _NOEXCEPT
- _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
-{
- return __o->wait(__v, __m);
-}
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_wait_explicit(const atomic<_Tp>* __o,
- typename atomic<_Tp>::value_type __v,
- memory_order __m) _NOEXCEPT
- _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
-{
- return __o->wait(__v, __m);
-}
-
-// atomic_notify_one
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_notify_one(volatile atomic<_Tp>* __o) _NOEXCEPT
-{
- __o->notify_one();
-}
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT
-{
- __o->notify_one();
-}
-
-// atomic_notify_all
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_notify_all(volatile atomic<_Tp>* __o) _NOEXCEPT
-{
- __o->notify_all();
-}
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_notify_all(atomic<_Tp>* __o) _NOEXCEPT
-{
- __o->notify_all();
-}
-
-// atomic_fetch_add
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_fetch_add(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
-{
- return __o->fetch_add(__op);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_fetch_add(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
-{
- return __o->fetch_add(__op);
-}
-
-// atomic_fetch_add_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_add(__op, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp atomic_fetch_add_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_add(__op, __m);
-}
-
-// atomic_fetch_sub
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp atomic_fetch_sub(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
-{
- return __o->fetch_sub(__op);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp atomic_fetch_sub(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
-{
- return __o->fetch_sub(__op);
-}
-
-// atomic_fetch_sub_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_sub(__op, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp atomic_fetch_sub_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_sub(__op, __m);
-}
-
-// atomic_fetch_and
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_and(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
-{
- return __o->fetch_and(__op);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_and(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
-{
- return __o->fetch_and(__op);
-}
-
-// atomic_fetch_and_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_and(__op, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_and_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_and(__op, __m);
-}
-
-// atomic_fetch_or
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_or(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
-{
- return __o->fetch_or(__op);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_or(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
-{
- return __o->fetch_or(__op);
-}
-
-// atomic_fetch_or_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_or(__op, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_or_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_or(__op, __m);
-}
-
-// atomic_fetch_xor
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_xor(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
-{
- return __o->fetch_xor(__op);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_xor(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
-{
- return __o->fetch_xor(__op);
-}
-
-// atomic_fetch_xor_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_xor(__op, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_xor_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_xor(__op, __m);
-}
-
-// flag type and operations
-
-typedef struct atomic_flag
-{
- __cxx_atomic_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_;
-
- _LIBCPP_INLINE_VISIBILITY
- bool test(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
- {return _LIBCPP_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);}
- _LIBCPP_INLINE_VISIBILITY
- bool test(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
- {return _LIBCPP_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);}
-
- _LIBCPP_INLINE_VISIBILITY
- bool test_and_set(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);}
- _LIBCPP_INLINE_VISIBILITY
- bool test_and_set(memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);}
- _LIBCPP_INLINE_VISIBILITY
- void clear(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {__cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);}
- _LIBCPP_INLINE_VISIBILITY
- void clear(memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {__cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);}
-
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- void wait(bool __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
- {__cxx_atomic_wait(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- void wait(bool __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT
- {__cxx_atomic_wait(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- void notify_one() volatile _NOEXCEPT
- {__cxx_atomic_notify_one(&__a_);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- void notify_one() _NOEXCEPT
- {__cxx_atomic_notify_one(&__a_);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- void notify_all() volatile _NOEXCEPT
- {__cxx_atomic_notify_all(&__a_);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- void notify_all() _NOEXCEPT
- {__cxx_atomic_notify_all(&__a_);}
-
-#if _LIBCPP_STD_VER > 17
- _LIBCPP_INLINE_VISIBILITY constexpr
- atomic_flag() _NOEXCEPT : __a_(false) {}
-#else
- _LIBCPP_INLINE_VISIBILITY
- atomic_flag() _NOEXCEPT = default;
-#endif
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION
-
- atomic_flag(const atomic_flag&) = delete;
- atomic_flag& operator=(const atomic_flag&) = delete;
- atomic_flag& operator=(const atomic_flag&) volatile = delete;
-
-} atomic_flag;
-
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test(const volatile atomic_flag* __o) _NOEXCEPT
-{
- return __o->test();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test(const atomic_flag* __o) _NOEXCEPT
-{
- return __o->test();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test_explicit(const volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
-{
- return __o->test(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test_explicit(const atomic_flag* __o, memory_order __m) _NOEXCEPT
-{
- return __o->test(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test_and_set(volatile atomic_flag* __o) _NOEXCEPT
-{
- return __o->test_and_set();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test_and_set(atomic_flag* __o) _NOEXCEPT
-{
- return __o->test_and_set();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test_and_set_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
-{
- return __o->test_and_set(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test_and_set_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
-{
- return __o->test_and_set(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-void
-atomic_flag_clear(volatile atomic_flag* __o) _NOEXCEPT
-{
- __o->clear();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-void
-atomic_flag_clear(atomic_flag* __o) _NOEXCEPT
-{
- __o->clear();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-void
-atomic_flag_clear_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
-{
- __o->clear(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-void
-atomic_flag_clear_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
-{
- __o->clear(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_wait(const volatile atomic_flag* __o, bool __v) _NOEXCEPT
-{
- __o->wait(__v);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_wait(const atomic_flag* __o, bool __v) _NOEXCEPT
-{
- __o->wait(__v);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_wait_explicit(const volatile atomic_flag* __o,
- bool __v, memory_order __m) _NOEXCEPT
-{
- __o->wait(__v, __m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_wait_explicit(const atomic_flag* __o,
- bool __v, memory_order __m) _NOEXCEPT
-{
- __o->wait(__v, __m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_notify_one(volatile atomic_flag* __o) _NOEXCEPT
-{
- __o->notify_one();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_notify_one(atomic_flag* __o) _NOEXCEPT
-{
- __o->notify_one();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_notify_all(volatile atomic_flag* __o) _NOEXCEPT
-{
- __o->notify_all();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_notify_all(atomic_flag* __o) _NOEXCEPT
-{
- __o->notify_all();
-}
-
-// fences
-
-inline _LIBCPP_INLINE_VISIBILITY
-void
-atomic_thread_fence(memory_order __m) _NOEXCEPT
-{
- __cxx_atomic_thread_fence(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-void
-atomic_signal_fence(memory_order __m) _NOEXCEPT
-{
- __cxx_atomic_signal_fence(__m);
-}
-
-// Atomics for standard typedef types
-
-typedef atomic<bool> atomic_bool;
-typedef atomic<char> atomic_char;
-typedef atomic<signed char> atomic_schar;
-typedef atomic<unsigned char> atomic_uchar;
-typedef atomic<short> atomic_short;
-typedef atomic<unsigned short> atomic_ushort;
-typedef atomic<int> atomic_int;
-typedef atomic<unsigned int> atomic_uint;
-typedef atomic<long> atomic_long;
-typedef atomic<unsigned long> atomic_ulong;
-typedef atomic<long long> atomic_llong;
-typedef atomic<unsigned long long> atomic_ullong;
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
-typedef atomic<char8_t> atomic_char8_t;
-#endif
-typedef atomic<char16_t> atomic_char16_t;
-typedef atomic<char32_t> atomic_char32_t;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-typedef atomic<wchar_t> atomic_wchar_t;
-#endif
-
-typedef atomic<int_least8_t> atomic_int_least8_t;
-typedef atomic<uint_least8_t> atomic_uint_least8_t;
-typedef atomic<int_least16_t> atomic_int_least16_t;
-typedef atomic<uint_least16_t> atomic_uint_least16_t;
-typedef atomic<int_least32_t> atomic_int_least32_t;
-typedef atomic<uint_least32_t> atomic_uint_least32_t;
-typedef atomic<int_least64_t> atomic_int_least64_t;
-typedef atomic<uint_least64_t> atomic_uint_least64_t;
-
-typedef atomic<int_fast8_t> atomic_int_fast8_t;
-typedef atomic<uint_fast8_t> atomic_uint_fast8_t;
-typedef atomic<int_fast16_t> atomic_int_fast16_t;
-typedef atomic<uint_fast16_t> atomic_uint_fast16_t;
-typedef atomic<int_fast32_t> atomic_int_fast32_t;
-typedef atomic<uint_fast32_t> atomic_uint_fast32_t;
-typedef atomic<int_fast64_t> atomic_int_fast64_t;
-typedef atomic<uint_fast64_t> atomic_uint_fast64_t;
-
-typedef atomic< int8_t> atomic_int8_t;
-typedef atomic<uint8_t> atomic_uint8_t;
-typedef atomic< int16_t> atomic_int16_t;
-typedef atomic<uint16_t> atomic_uint16_t;
-typedef atomic< int32_t> atomic_int32_t;
-typedef atomic<uint32_t> atomic_uint32_t;
-typedef atomic< int64_t> atomic_int64_t;
-typedef atomic<uint64_t> atomic_uint64_t;
-
-typedef atomic<intptr_t> atomic_intptr_t;
-typedef atomic<uintptr_t> atomic_uintptr_t;
-typedef atomic<size_t> atomic_size_t;
-typedef atomic<ptrdiff_t> atomic_ptrdiff_t;
-typedef atomic<intmax_t> atomic_intmax_t;
-typedef atomic<uintmax_t> atomic_uintmax_t;
-
-// atomic_*_lock_free : prefer the contention type most highly, then the largest lock-free type
-
-#ifdef __cpp_lib_atomic_is_always_lock_free
-# define _LIBCPP_CONTENTION_LOCK_FREE ::std::__libcpp_is_always_lock_free<__cxx_contention_t>::__value
-#else
-# define _LIBCPP_CONTENTION_LOCK_FREE false
-#endif
-
-#if ATOMIC_LLONG_LOCK_FREE == 2
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, long long> __libcpp_signed_lock_free;
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned long long> __libcpp_unsigned_lock_free;
-#elif ATOMIC_INT_LOCK_FREE == 2
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, int> __libcpp_signed_lock_free;
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned int> __libcpp_unsigned_lock_free;
-#elif ATOMIC_SHORT_LOCK_FREE == 2
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, short> __libcpp_signed_lock_free;
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned short> __libcpp_unsigned_lock_free;
-#elif ATOMIC_CHAR_LOCK_FREE == 2
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, char> __libcpp_signed_lock_free;
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned char> __libcpp_unsigned_lock_free;
-#else
- // No signed/unsigned lock-free types
-#define _LIBCPP_NO_LOCK_FREE_TYPES
-#endif
-
-#if !defined(_LIBCPP_NO_LOCK_FREE_TYPES)
-typedef atomic<__libcpp_signed_lock_free> atomic_signed_lock_free;
-typedef atomic<__libcpp_unsigned_lock_free> atomic_unsigned_lock_free;
+#ifdef kill_dependency
+# error <atomic> is incompatible with <stdatomic.h> before C++23. Please compile with -std=c++23.
#endif
-#define ATOMIC_FLAG_INIT {false}
-#define ATOMIC_VAR_INIT(__v) {__v}
-
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
-# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1400
-# pragma clang deprecated(ATOMIC_VAR_INIT)
-# endif
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
-
-_LIBCPP_END_NAMESPACE_STD
-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cmath>
# include <compare>
+# include <cstring>
# include <type_traits>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/barrier b/contrib/libs/cxxsupp/libcxx/include/barrier
index 2e8906b7137..e0d63fa59ff 100644
--- a/contrib/libs/cxxsupp/libcxx/include/barrier
+++ b/contrib/libs/cxxsupp/libcxx/include/barrier
@@ -46,13 +46,18 @@ namespace std
*/
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__atomic/atomic_base.h>
+#include <__atomic/memory_order.h>
#include <__availability>
#include <__config>
#include <__memory/unique_ptr.h>
+#include <__thread/poll_with_backoff.h>
#include <__thread/timed_backoff_policy.h>
#include <__utility/move.h>
-#include <atomic>
+#include <cstddef>
+#include <cstdint>
#include <limits>
+#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -119,7 +124,7 @@ class __barrier_base {
public:
using arrival_token = __barrier_phase_t;
- static constexpr ptrdiff_t max() noexcept {
+ static _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t max() noexcept {
return numeric_limits<ptrdiff_t>::max();
}
@@ -130,9 +135,12 @@ public:
__expected_adjustment_(0), __completion_(std::move(__completion)), __phase_(0)
{
}
- [[nodiscard]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+ [[__nodiscard__]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
arrival_token arrive(ptrdiff_t __update)
{
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __update <= __expected_, "update is greater than the expected count for the current barrier phase");
+
auto const __old_phase = __phase_.load(memory_order_relaxed);
for(; __update; --__update)
if(__arrive_barrier_algorithm_base(__base_.get(), __old_phase)) {
@@ -200,7 +208,11 @@ public:
auto const __old_phase = __phase.load(memory_order_relaxed);
auto const __result = __arrived.fetch_sub(update, memory_order_acq_rel) - update;
auto const new_expected = __expected.load(memory_order_relaxed);
- if(0 == __result) {
+
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ update <= new_expected, "update is greater than the expected count for the current barrier phase");
+
+ if (0 == __result) {
__completion();
__arrived.store(new_expected, memory_order_relaxed);
__phase.store(!__old_phase, memory_order_release);
@@ -256,7 +268,11 @@ public:
{
auto const __inc = __arrived_unit * update;
auto const __old = __phase_arrived_expected.fetch_add(__inc, memory_order_acq_rel);
- if((__old ^ (__old + __inc)) & __phase_bit) {
+
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ update <= __old, "update is greater than the expected count for the current barrier phase");
+
+ if ((__old ^ (__old + __inc)) & __phase_bit) {
__phase_arrived_expected.fetch_add((__old & __expected_mask) << 32, memory_order_relaxed);
__phase_arrived_expected.notify_all();
}
@@ -288,21 +304,29 @@ class barrier {
public:
using arrival_token = typename __barrier_base<_CompletionF>::arrival_token;
- static constexpr ptrdiff_t max() noexcept {
+ static _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t max() noexcept {
return __barrier_base<_CompletionF>::max();
}
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- barrier(ptrdiff_t __count, _CompletionF __completion = _CompletionF())
+ explicit barrier(ptrdiff_t __count, _CompletionF __completion = _CompletionF())
: __b_(__count, _VSTD::move(__completion)) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __count >= 0,
+ "barrier::barrier(ptrdiff_t, CompletionFunction): barrier cannot be initialized with a negative value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __count <= max(),
+ "barrier::barrier(ptrdiff_t, CompletionFunction): barrier cannot be initialized with "
+ "a value greater than max()");
}
barrier(barrier const&) = delete;
barrier& operator=(barrier const&) = delete;
- [[nodiscard]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+ [[__nodiscard__]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
arrival_token arrive(ptrdiff_t __update = 1)
{
+ _LIBCPP_ASSERT_UNCATEGORIZED(__update > 0, "barrier:arrive must be called with a value greater than 0");
return __b_.arrive(__update);
}
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
@@ -329,6 +353,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
# include <iterator>
# include <memory>
diff --git a/contrib/libs/cxxsupp/libcxx/include/bit b/contrib/libs/cxxsupp/libcxx/include/bit
index d17a6e45f0d..6b35bb2c7a0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/bit
+++ b/contrib/libs/cxxsupp/libcxx/include/bit
@@ -83,6 +83,7 @@ namespace std {
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdlib>
# include <iosfwd>
# include <limits>
# include <type_traits>
diff --git a/contrib/libs/cxxsupp/libcxx/include/bitset b/contrib/libs/cxxsupp/libcxx/include/bitset
index 3a8a5b47109..2a14b7a2e98 100644
--- a/contrib/libs/cxxsupp/libcxx/include/bitset
+++ b/contrib/libs/cxxsupp/libcxx/include/bitset
@@ -79,7 +79,7 @@ public:
size_t count() const noexcept; // constexpr since C++23
constexpr size_t size() const noexcept; // constexpr since C++23
bool operator==(const bitset& rhs) const noexcept; // constexpr since C++23
- bool operator!=(const bitset& rhs) const noexcept; // constexpr since C++23
+ bool operator!=(const bitset& rhs) const noexcept; // removed in C++20
bool test(size_t pos) const; // constexpr since C++23
bool all() const noexcept; // constexpr since C++23
bool any() const noexcept; // constexpr since C++23
@@ -122,6 +122,7 @@ template <size_t N> struct hash<std::bitset<N>>;
#include <climits>
#include <cstddef>
#include <stdexcept>
+#include <string_view>
#include <version>
// standard-mandated includes
@@ -695,18 +696,30 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR bitset() _NOEXCEPT {}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
bitset(unsigned long long __v) _NOEXCEPT : base(__v) {}
- template<class _CharT, class = __enable_if_t<_IsCharLikeType<_CharT>::value> >
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
- explicit bitset(const _CharT* __str,
- typename basic_string<_CharT>::size_type __n = basic_string<_CharT>::npos,
- _CharT __zero = _CharT('0'), _CharT __one = _CharT('1'));
- template<class _CharT, class _Traits, class _Allocator>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
- explicit bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
- typename basic_string<_CharT,_Traits,_Allocator>::size_type __pos = 0,
- typename basic_string<_CharT,_Traits,_Allocator>::size_type __n =
- (basic_string<_CharT,_Traits,_Allocator>::npos),
- _CharT __zero = _CharT('0'), _CharT __one = _CharT('1'));
+ template <class _CharT, class = __enable_if_t<_IsCharLikeType<_CharT>::value> >
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit bitset(
+ const _CharT* __str,
+ typename basic_string<_CharT>::size_type __n = basic_string<_CharT>::npos,
+ _CharT __zero = _CharT('0'),
+ _CharT __one = _CharT('1')) {
+
+ size_t __rlen = std::min(__n, char_traits<_CharT>::length(__str));
+ __init_from_string_view(basic_string_view<_CharT>(__str, __rlen), __zero, __one);
+ }
+ template <class _CharT, class _Traits, class _Allocator>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit bitset(
+ const basic_string<_CharT, _Traits, _Allocator>& __str,
+ typename basic_string<_CharT, _Traits, _Allocator>::size_type __pos = 0,
+ typename basic_string<_CharT, _Traits, _Allocator>::size_type __n =
+ basic_string<_CharT, _Traits, _Allocator>::npos,
+ _CharT __zero = _CharT('0'),
+ _CharT __one = _CharT('1')) {
+ if (__pos > __str.size())
+ std::__throw_out_of_range("bitset string pos out of range");
+
+ size_t __rlen = std::min(__n, __str.size() - __pos);
+ __init_from_string_view(basic_string_view<_CharT, _Traits>(__str.data() + __pos, __rlen), __zero, __one);
+ }
// 23.3.5.2 bitset operations:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
@@ -765,8 +778,10 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR size_t size() const _NOEXCEPT {return _Size;}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
bool operator==(const bitset& __rhs) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+#if _LIBCPP_STD_VER <= 17
+ _LIBCPP_INLINE_VISIBILITY
bool operator!=(const bitset& __rhs) const _NOEXCEPT;
+#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bool test(size_t __pos) const;
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
@@ -780,6 +795,22 @@ public:
bitset operator>>(size_t __pos) const _NOEXCEPT;
private:
+ template <class _CharT, class _Traits>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void
+ __init_from_string_view(basic_string_view<_CharT, _Traits> __str, _CharT __zero, _CharT __one) {
+
+ for (size_t __i = 0; __i < __str.size(); ++__i)
+ if (!_Traits::eq(__str[__i], __zero) && !_Traits::eq(__str[__i], __one))
+ std::__throw_invalid_argument("bitset string ctor has invalid argument");
+
+ size_t __mp = std::min(__str.size(), _Size);
+ size_t __i = 0;
+ for (; __i < __mp; ++__i) {
+ _CharT __c = __str[__mp - 1 - __i];
+ (*this)[__i] = _Traits::eq(__c, __one);
+ }
+ std::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
+ }
_LIBCPP_INLINE_VISIBILITY
size_t __hash_code() const _NOEXCEPT {return base::__hash_code();}
@@ -788,54 +819,6 @@ private:
};
template <size_t _Size>
-template<class _CharT, class>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
-bitset<_Size>::bitset(const _CharT* __str,
- typename basic_string<_CharT>::size_type __n,
- _CharT __zero, _CharT __one)
-{
- size_t __rlen = _VSTD::min(__n, char_traits<_CharT>::length(__str));
- for (size_t __i = 0; __i < __rlen; ++__i)
- if (__str[__i] != __zero && __str[__i] != __one)
- __throw_invalid_argument("bitset string ctor has invalid argument");
-
- size_t _Mp = _VSTD::min(__rlen, _Size);
- size_t __i = 0;
- for (; __i < _Mp; ++__i)
- {
- _CharT __c = __str[_Mp - 1 - __i];
- (*this)[__i] = (__c == __one);
- }
- _VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
-}
-
-template <size_t _Size>
-template<class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
-bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
- typename basic_string<_CharT,_Traits,_Allocator>::size_type __pos,
- typename basic_string<_CharT,_Traits,_Allocator>::size_type __n,
- _CharT __zero, _CharT __one)
-{
- if (__pos > __str.size())
- __throw_out_of_range("bitset string pos out of range");
-
- size_t __rlen = _VSTD::min(__n, __str.size() - __pos);
- for (size_t __i = __pos; __i < __pos + __rlen; ++__i)
- if (!_Traits::eq(__str[__i], __zero) && !_Traits::eq(__str[__i], __one))
- __throw_invalid_argument("bitset string ctor has invalid argument");
-
- size_t _Mp = _VSTD::min(__rlen, _Size);
- size_t __i = 0;
- for (; __i < _Mp; ++__i)
- {
- _CharT __c = __str[__pos + _Mp - 1 - __i];
- (*this)[__i] = _Traits::eq(__c, __one);
- }
- _VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
-}
-
-template <size_t _Size>
inline
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bitset<_Size>&
@@ -960,8 +943,8 @@ bitset<_Size>::flip(size_t __pos)
if (__pos >= _Size)
__throw_out_of_range("bitset flip argument out of range");
- reference r = base::__make_ref(__pos);
- r = ~r;
+ reference __r = base::__make_ref(__pos);
+ __r = ~__r;
return *this;
}
@@ -1045,15 +1028,19 @@ bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT
return _VSTD::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
}
+#if _LIBCPP_STD_VER <= 17
+
template <size_t _Size>
inline
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
+_LIBCPP_HIDE_FROM_ABI
bool
bitset<_Size>::operator!=(const bitset& __rhs) const _NOEXCEPT
{
return !(*this == __rhs);
}
+#endif
+
template <size_t _Size>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bool
@@ -1158,6 +1145,8 @@ _LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
+# include <type_traits>
#endif
#endif // _LIBCPP_BITSET
diff --git a/contrib/libs/cxxsupp/libcxx/include/charconv b/contrib/libs/cxxsupp/libcxx/include/charconv
index 9c74ce3c697..5b6c72ea7f1 100644
--- a/contrib/libs/cxxsupp/libcxx/include/charconv
+++ b/contrib/libs/cxxsupp/libcxx/include/charconv
@@ -63,785 +63,41 @@ namespace std {
constexpr from_chars_result from_chars(const char* first, const char* last,
see below& value, int base = 10); // constexpr since C++23
- from_chars_result from_chars(const char* first, const char* last,
- float& value,
- chars_format fmt = chars_format::general);
- from_chars_result from_chars(const char* first, const char* last,
- double& value,
- chars_format fmt = chars_format::general);
- from_chars_result from_chars(const char* first, const char* last,
- long double& value,
- chars_format fmt = chars_format::general);
-
} // namespace std
*/
-#include <__algorithm/copy_n.h>
#include <__assert> // all public C++ headers provide the assertion handler
-#include <__availability>
-#include <__bit/countl.h>
#include <__charconv/chars_format.h>
+#include <__charconv/from_chars_integral.h>
#include <__charconv/from_chars_result.h>
#include <__charconv/tables.h>
+#include <__charconv/to_chars.h>
#include <__charconv/to_chars_base_10.h>
+#include <__charconv/to_chars_floating_point.h>
+#include <__charconv/to_chars_integral.h>
#include <__charconv/to_chars_result.h>
+#include <__charconv/traits.h>
#include <__config>
-#include <__debug>
-#include <__errc>
-#include <__memory/addressof.h>
-#include <__type_traits/make_32_64_or_128_bit.h>
-#include <__utility/unreachable.h>
+#include <__system_error/errc.h>
#include <cmath> // for log2f
#include <cstdint>
-#include <cstdlib>
-#include <cstring>
#include <limits>
-#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 _LIBCPP_STD_VER > 14
-
-to_chars_result to_chars(char*, char*, bool, int = 10) = delete;
-from_chars_result from_chars(const char*, const char*, bool, int = 10) = delete;
-
-namespace __itoa
-{
-
-template <typename _Tp, typename = void>
-struct _LIBCPP_HIDDEN __traits_base;
-
-template <typename _Tp>
-struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) <= sizeof(uint32_t)>>
-{
- using type = uint32_t;
-
- /// The width estimation using a log10 algorithm.
- ///
- /// The algorithm is based on
- /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
- /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
- /// function requires its input to have at least one bit set the value of
- /// zero is set to one. This means the first element of the lookup table is
- /// zero.
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v)
- {
- auto __t = (32 - std::__libcpp_clz(static_cast<type>(__v | 1))) * 1233 >> 12;
- return __t - (__v < __itoa::__pow10_32[__t]) + 1;
- }
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v)
- {
- return __itoa::__base_10_u32(__p, __v);
- }
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI decltype(__pow10_32)& __pow() { return __itoa::__pow10_32; }
-};
-
-template <typename _Tp>
-struct _LIBCPP_HIDDEN
- __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(uint64_t)>> {
- using type = uint64_t;
-
- /// The width estimation using a log10 algorithm.
- ///
- /// The algorithm is based on
- /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
- /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
- /// function requires its input to have at least one bit set the value of
- /// zero is set to one. This means the first element of the lookup table is
- /// zero.
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
- auto __t = (64 - std::__libcpp_clz(static_cast<type>(__v | 1))) * 1233 >> 12;
- return __t - (__v < __itoa::__pow10_64[__t]) + 1;
- }
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) { return __itoa::__base_10_u64(__p, __v); }
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI decltype(__pow10_64)& __pow() { return __itoa::__pow10_64; }
-};
-
-
-# ifndef _LIBCPP_HAS_NO_INT128
-template <typename _Tp>
-struct _LIBCPP_HIDDEN
- __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(__uint128_t)> > {
- using type = __uint128_t;
-
- /// The width estimation using a log10 algorithm.
- ///
- /// The algorithm is based on
- /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
- /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
- /// function requires its input to have at least one bit set the value of
- /// zero is set to one. This means the first element of the lookup table is
- /// zero.
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
- _LIBCPP_ASSERT(__v > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fail when this isn't true.");
- // There's always a bit set in the upper 64-bits.
- auto __t = (128 - std::__libcpp_clz(static_cast<uint64_t>(__v >> 64))) * 1233 >> 12;
- _LIBCPP_ASSERT(__t >= __itoa::__pow10_128_offset, "Index out of bounds");
- // __t is adjusted since the lookup table misses the lower entries.
- return __t - (__v < __itoa::__pow10_128[__t - __itoa::__pow10_128_offset]) + 1;
- }
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) { return __itoa::__base_10_u128(__p, __v); }
-
- // TODO FMT This pow function should get an index.
- // By moving this to its own header it can be reused by the pow function in to_chars_base_10.
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI decltype(__pow10_128)& __pow() { return __itoa::__pow10_128; }
-};
-#endif
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
-__mul_overflowed(unsigned char __a, _Tp __b, unsigned char& __r)
-{
- auto __c = __a * __b;
- __r = __c;
- return __c > numeric_limits<unsigned char>::max();
-}
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
-__mul_overflowed(unsigned short __a, _Tp __b, unsigned short& __r)
-{
- auto __c = __a * __b;
- __r = __c;
- return __c > numeric_limits<unsigned short>::max();
-}
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
-__mul_overflowed(_Tp __a, _Tp __b, _Tp& __r)
-{
- static_assert(is_unsigned<_Tp>::value, "");
- return __builtin_mul_overflow(__a, __b, &__r);
-}
-
-template <typename _Tp, typename _Up>
-inline _LIBCPP_HIDE_FROM_ABI bool
-_LIBCPP_CONSTEXPR_SINCE_CXX23 __mul_overflowed(_Tp __a, _Up __b, _Tp& __r)
-{
- return __itoa::__mul_overflowed(__a, static_cast<_Tp>(__b), __r);
-}
-
-template <typename _Tp>
-struct _LIBCPP_HIDDEN __traits : __traits_base<_Tp>
-{
- static constexpr int digits = numeric_limits<_Tp>::digits10 + 1;
- using __traits_base<_Tp>::__pow;
- using typename __traits_base<_Tp>::type;
-
- // precondition: at least one non-zero character available
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char const*
- __read(char const* __p, char const* __ep, type& __a, type& __b)
- {
- type __cprod[digits];
- int __j = digits - 1;
- int __i = digits;
- do
- {
- if (*__p < '0' || *__p > '9')
- break;
- __cprod[--__i] = *__p++ - '0';
- } while (__p != __ep && __i != 0);
-
- __a = __inner_product(__cprod + __i + 1, __cprod + __j, __pow() + 1,
- __cprod[__i]);
- if (__itoa::__mul_overflowed(__cprod[__j], __pow()[__j - __i], __b))
- --__p;
- return __p;
- }
-
- template <typename _It1, typename _It2, class _Up>
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _Up
- __inner_product(_It1 __first1, _It1 __last1, _It2 __first2, _Up __init)
- {
- for (; __first1 < __last1; ++__first1, ++__first2)
- __init = __init + *__first1 * *__first2;
- return __init;
- }
-};
-
-} // namespace __itoa
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _Tp
-__complement(_Tp __x)
-{
- static_assert(is_unsigned<_Tp>::value, "cast to unsigned first");
- return _Tp(~__x + 1);
-}
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_itoa(char* __first, char* __last, _Tp __value, false_type);
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_itoa(char* __first, char* __last, _Tp __value, true_type)
-{
- auto __x = std::__to_unsigned_like(__value);
- if (__value < 0 && __first != __last)
- {
- *__first++ = '-';
- __x = std::__complement(__x);
- }
-
- return std::__to_chars_itoa(__first, __last, __x, false_type());
-}
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_itoa(char* __first, char* __last, _Tp __value, false_type)
-{
- using __tx = __itoa::__traits<_Tp>;
- auto __diff = __last - __first;
-
- if (__tx::digits <= __diff || __tx::__width(__value) <= __diff)
- return {__tx::__convert(__first, __value), errc(0)};
- else
- return {__last, errc::value_too_large};
-}
-
-# ifndef _LIBCPP_HAS_NO_INT128
-template <>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_itoa(char* __first, char* __last, __uint128_t __value, false_type)
-{
- // When the value fits in 64-bits use the 64-bit code path. This reduces
- // the number of expensive calculations on 128-bit values.
- //
- // NOTE the 128-bit code path requires this optimization.
- if(__value <= numeric_limits<uint64_t>::max())
- return __to_chars_itoa(__first, __last, static_cast<uint64_t>(__value), false_type());
-
- using __tx = __itoa::__traits<__uint128_t>;
- auto __diff = __last - __first;
-
- if (__tx::digits <= __diff || __tx::__width(__value) <= __diff)
- return {__tx::__convert(__first, __value), errc(0)};
- else
- return {__last, errc::value_too_large};
-}
-#endif
-
-template <class _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_integral(char* __first, char* __last, _Tp __value, int __base, false_type);
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_integral(char* __first, char* __last, _Tp __value, int __base,
- true_type)
-{
- auto __x = std::__to_unsigned_like(__value);
- if (__value < 0 && __first != __last)
- {
- *__first++ = '-';
- __x = std::__complement(__x);
- }
-
- return std::__to_chars_integral(__first, __last, __x, __base, false_type());
-}
-
-namespace __itoa {
-
-template <unsigned _Base>
-struct _LIBCPP_HIDDEN __integral;
-
-template <>
-struct _LIBCPP_HIDDEN __integral<2> {
- template <typename _Tp>
- _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
- // If value == 0 still need one digit. If the value != this has no
- // effect since the code scans for the most significant bit set. (Note
- // that __libcpp_clz doesn't work for 0.)
- return numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1);
- }
-
- template <typename _Tp>
- _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI static to_chars_result __to_chars(char* __first, char* __last, _Tp __value) {
- ptrdiff_t __cap = __last - __first;
- int __n = __width(__value);
- if (__n > __cap)
- return {__last, errc::value_too_large};
-
- __last = __first + __n;
- char* __p = __last;
- const unsigned __divisor = 16;
- while (__value > __divisor) {
- unsigned __c = __value % __divisor;
- __value /= __divisor;
- __p -= 4;
- std::copy_n(&__base_2_lut[4 * __c], 4, __p);
- }
- do {
- unsigned __c = __value % 2;
- __value /= 2;
- *--__p = "01"[__c];
- } while (__value != 0);
- return {__last, errc(0)};
- }
-};
-
-template <>
-struct _LIBCPP_HIDDEN __integral<8> {
- template <typename _Tp>
- _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
- // If value == 0 still need one digit. If the value != this has no
- // effect since the code scans for the most significat bit set. (Note
- // that __libcpp_clz doesn't work for 0.)
- return ((numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1)) + 2) / 3;
- }
-
- template <typename _Tp>
- _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI static to_chars_result __to_chars(char* __first, char* __last, _Tp __value) {
- ptrdiff_t __cap = __last - __first;
- int __n = __width(__value);
- if (__n > __cap)
- return {__last, errc::value_too_large};
-
- __last = __first + __n;
- char* __p = __last;
- unsigned __divisor = 64;
- while (__value > __divisor) {
- unsigned __c = __value % __divisor;
- __value /= __divisor;
- __p -= 2;
- std::copy_n(&__base_8_lut[2 * __c], 2, __p);
- }
- do {
- unsigned __c = __value % 8;
- __value /= 8;
- *--__p = "01234567"[__c];
- } while (__value != 0);
- return {__last, errc(0)};
- }
-
-};
-
-template <>
-struct _LIBCPP_HIDDEN __integral<16> {
- template <typename _Tp>
- _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
- // If value == 0 still need one digit. If the value != this has no
- // effect since the code scans for the most significat bit set. (Note
- // that __libcpp_clz doesn't work for 0.)
- return (numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1) + 3) / 4;
- }
-
- template <typename _Tp>
- _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI static to_chars_result __to_chars(char* __first, char* __last, _Tp __value) {
- ptrdiff_t __cap = __last - __first;
- int __n = __width(__value);
- if (__n > __cap)
- return {__last, errc::value_too_large};
-
- __last = __first + __n;
- char* __p = __last;
- unsigned __divisor = 256;
- while (__value > __divisor) {
- unsigned __c = __value % __divisor;
- __value /= __divisor;
- __p -= 2;
- std::copy_n(&__base_16_lut[2 * __c], 2, __p);
- }
- if (__first != __last)
- do {
- unsigned __c = __value % 16;
- __value /= 16;
- *--__p = "0123456789abcdef"[__c];
- } while (__value != 0);
- return {__last, errc(0)};
- }
-};
-
-} // namespace __itoa
-
-template <unsigned _Base, typename _Tp,
- typename enable_if<(sizeof(_Tp) >= sizeof(unsigned)), int>::type = 0>
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int
-__to_chars_integral_width(_Tp __value) {
- return __itoa::__integral<_Base>::__width(__value);
-}
-
-template <unsigned _Base, typename _Tp,
- typename enable_if<(sizeof(_Tp) < sizeof(unsigned)), int>::type = 0>
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int
-__to_chars_integral_width(_Tp __value) {
- return std::__to_chars_integral_width<_Base>(static_cast<unsigned>(__value));
-}
-
-template <unsigned _Base, typename _Tp,
- typename enable_if<(sizeof(_Tp) >= sizeof(unsigned)), int>::type = 0>
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_integral(char* __first, char* __last, _Tp __value) {
- return __itoa::__integral<_Base>::__to_chars(__first, __last, __value);
-}
-
-template <unsigned _Base, typename _Tp,
- typename enable_if<(sizeof(_Tp) < sizeof(unsigned)), int>::type = 0>
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_integral(char* __first, char* __last, _Tp __value) {
- return std::__to_chars_integral<_Base>(__first, __last, static_cast<unsigned>(__value));
-}
-
-template <typename _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int
-__to_chars_integral_width(_Tp __value, unsigned __base) {
- _LIBCPP_ASSERT(__value >= 0, "The function requires a non-negative value.");
-
- unsigned __base_2 = __base * __base;
- unsigned __base_3 = __base_2 * __base;
- unsigned __base_4 = __base_2 * __base_2;
-
- int __r = 0;
- while (true) {
- if (__value < __base)
- return __r + 1;
- if (__value < __base_2)
- return __r + 2;
- if (__value < __base_3)
- return __r + 3;
- if (__value < __base_4)
- return __r + 4;
-
- __value /= __base_4;
- __r += 4;
- }
-
- __libcpp_unreachable();
-}
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_integral(char* __first, char* __last, _Tp __value, int __base,
- false_type)
-{
- if (__base == 10) [[likely]]
- return std::__to_chars_itoa(__first, __last, __value, false_type());
-
- switch (__base) {
- case 2:
- return std::__to_chars_integral<2>(__first, __last, __value);
- case 8:
- return std::__to_chars_integral<8>(__first, __last, __value);
- case 16:
- return std::__to_chars_integral<16>(__first, __last, __value);
- }
-
- ptrdiff_t __cap = __last - __first;
- int __n = std::__to_chars_integral_width(__value, __base);
- if (__n > __cap)
- return {__last, errc::value_too_large};
-
- __last = __first + __n;
- char* __p = __last;
- do {
- unsigned __c = __value % __base;
- __value /= __base;
- *--__p = "0123456789abcdefghijklmnopqrstuvwxyz"[__c];
- } while (__value != 0);
- return {__last, errc(0)};
-}
-
-template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-to_chars(char* __first, char* __last, _Tp __value)
-{
- using _Type = __make_32_64_or_128_bit_t<_Tp>;
- static_assert(!is_same<_Type, void>::value, "unsupported integral type used in to_chars");
- return std::__to_chars_itoa(__first, __last, static_cast<_Type>(__value), is_signed<_Tp>());
-}
-
-template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-to_chars(char* __first, char* __last, _Tp __value, int __base)
-{
- _LIBCPP_ASSERT(2 <= __base && __base <= 36, "base not in [2, 36]");
-
- using _Type = __make_32_64_or_128_bit_t<_Tp>;
- return std::__to_chars_integral(__first, __last, static_cast<_Type>(__value), __base, is_signed<_Tp>());
-}
-
-template <typename _It, typename _Tp, typename _Fn, typename... _Ts>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-__sign_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args)
-{
- using __tl = numeric_limits<_Tp>;
- decltype(std::__to_unsigned_like(__value)) __x;
-
- bool __neg = (__first != __last && *__first == '-');
- auto __r = __f(__neg ? __first + 1 : __first, __last, __x, __args...);
- switch (__r.ec)
- {
- case errc::invalid_argument:
- return {__first, __r.ec};
- case errc::result_out_of_range:
- return __r;
- default:
- break;
- }
-
- if (__neg)
- {
- if (__x <= std::__complement(std::__to_unsigned_like(__tl::min())))
- {
- __x = std::__complement(__x);
- std::copy_n(std::addressof(__x), 1, std::addressof(__value));
- return __r;
- }
- }
- else
- {
- if (__x <= std::__to_unsigned_like(__tl::max()))
- {
- __value = __x;
- return __r;
- }
- }
-
- return {__r.ptr, errc::result_out_of_range};
-}
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
-__in_pattern(_Tp __c)
-{
- return '0' <= __c && __c <= '9';
-}
-
-struct _LIBCPP_HIDDEN __in_pattern_result
-{
- bool __ok;
- int __val;
-
- explicit _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI operator bool() const { return __ok; }
-};
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI __in_pattern_result
-__in_pattern(_Tp __c, int __base)
-{
- if (__base <= 10)
- return {'0' <= __c && __c < '0' + __base, __c - '0'};
- else if (std::__in_pattern(__c))
- return {true, __c - '0'};
- else if ('a' <= __c && __c < 'a' + __base - 10)
- return {true, __c - 'a' + 10};
- else
- return {'A' <= __c && __c < 'A' + __base - 10, __c - 'A' + 10};
-}
-
-template <typename _It, typename _Tp, typename _Fn, typename... _Ts>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-__subject_seq_combinator(_It __first, _It __last, _Tp& __value, _Fn __f,
- _Ts... __args)
-{
- auto __find_non_zero = [](_It __firstit, _It __lastit) {
- for (; __firstit != __lastit; ++__firstit)
- if (*__firstit != '0')
- break;
- return __firstit;
- };
-
- auto __p = __find_non_zero(__first, __last);
- if (__p == __last || !std::__in_pattern(*__p, __args...))
- {
- if (__p == __first)
- return {__first, errc::invalid_argument};
- else
- {
- __value = 0;
- return {__p, {}};
- }
- }
-
- auto __r = __f(__p, __last, __value, __args...);
- if (__r.ec == errc::result_out_of_range)
- {
- for (; __r.ptr != __last; ++__r.ptr)
- {
- if (!std::__in_pattern(*__r.ptr, __args...))
- break;
- }
- }
-
- return __r;
-}
-
-template <typename _Tp, typename enable_if<is_unsigned<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-__from_chars_atoi(const char* __first, const char* __last, _Tp& __value)
-{
- using __tx = __itoa::__traits<_Tp>;
- using __output_type = typename __tx::type;
-
- return std::__subject_seq_combinator(
- __first, __last, __value,
- [](const char* __f, const char* __l,
- _Tp& __val) -> from_chars_result {
- __output_type __a, __b;
- auto __p = __tx::__read(__f, __l, __a, __b);
- if (__p == __l || !std::__in_pattern(*__p))
- {
- __output_type __m = numeric_limits<_Tp>::max();
- if (__m >= __a && __m - __a >= __b)
- {
- __val = __a + __b;
- return {__p, {}};
- }
- }
- return {__p, errc::result_out_of_range};
- });
-}
-
-template <typename _Tp, typename enable_if<is_signed<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-__from_chars_atoi(const char* __first, const char* __last, _Tp& __value)
-{
- using __t = decltype(std::__to_unsigned_like(__value));
- return std::__sign_combinator(__first, __last, __value, __from_chars_atoi<__t>);
-}
-
-
-/*
-// Code used to generate __from_chars_log2f_lut.
-#include <cmath>
-#include <iostream>
-#include <format>
-
-int main() {
- for (int i = 2; i <= 36; ++i)
- std::cout << std::format("{},\n", log2f(i));
-}
-*/
-/// log2f table for bases [2, 36].
-inline constexpr float __from_chars_log2f_lut[35] = {
- 1, 1.5849625, 2, 2.321928, 2.5849626, 2.807355, 3, 3.169925, 3.321928,
- 3.4594316, 3.5849626, 3.7004397, 3.807355, 3.9068906, 4, 4.087463, 4.169925, 4.2479277,
- 4.321928, 4.3923173, 4.4594316, 4.523562, 4.5849624, 4.643856, 4.70044, 4.7548876, 4.807355,
- 4.857981, 4.9068904, 4.9541965, 5, 5.044394, 5.087463, 5.129283, 5.169925};
-
-template <typename _Tp, typename enable_if<is_unsigned<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-__from_chars_integral(const char* __first, const char* __last, _Tp& __value,
- int __base)
-{
- if (__base == 10)
- return std::__from_chars_atoi(__first, __last, __value);
-
- return std::__subject_seq_combinator(
- __first, __last, __value,
- [](const char* __p, const char* __lastp, _Tp& __val,
- int __b) -> from_chars_result {
- using __tl = numeric_limits<_Tp>;
- // __base is always between 2 and 36 inclusive.
- auto __digits = __tl::digits / __from_chars_log2f_lut[__b - 2];
- _Tp __x = __in_pattern(*__p++, __b).__val, __y = 0;
-
- for (int __i = 1; __p != __lastp; ++__i, ++__p)
- {
- if (auto __c = __in_pattern(*__p, __b))
- {
- if (__i < __digits - 1)
- __x = __x * __b + __c.__val;
- else
- {
- if (!__itoa::__mul_overflowed(__x, __b, __x))
- ++__p;
- __y = __c.__val;
- break;
- }
- }
- else
- break;
- }
-
- if (__p == __lastp || !__in_pattern(*__p, __b))
- {
- if (__tl::max() - __x >= __y)
- {
- __val = __x + __y;
- return {__p, {}};
- }
- }
- return {__p, errc::result_out_of_range};
- },
- __base);
-}
-
-template <typename _Tp, typename enable_if<is_signed<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-__from_chars_integral(const char* __first, const char* __last, _Tp& __value,
- int __base)
-{
- using __t = decltype(std::__to_unsigned_like(__value));
- return std::__sign_combinator(__first, __last, __value,
- __from_chars_integral<__t>, __base);
-}
-
-template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-from_chars(const char* __first, const char* __last, _Tp& __value)
-{
- return std::__from_chars_atoi(__first, __last, __value);
-}
-
-template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-from_chars(const char* __first, const char* __last, _Tp& __value, int __base)
-{
- _LIBCPP_ASSERT(2 <= __base && __base <= 36, "base not in [2, 36]");
- return std::__from_chars_integral(__first, __last, __value, __base);
-}
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, float __value);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, double __value);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, long double __value);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, float __value, chars_format __fmt);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, double __value, chars_format __fmt);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, long double __value, chars_format __fmt);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, float __value, chars_format __fmt, int __precision);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, double __value, chars_format __fmt, int __precision);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, long double __value, chars_format __fmt, int __precision);
-
-#endif // _LIBCPP_STD_VER > 14
-
_LIBCPP_END_NAMESPACE_STD
-_LIBCPP_POP_MACROS
-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
+# include <cstring>
# include <iosfwd>
+# include <type_traits>
#endif
#endif // _LIBCPP_CHARCONV
diff --git a/contrib/libs/cxxsupp/libcxx/include/chrono b/contrib/libs/cxxsupp/libcxx/include/chrono
index 604fdf3a3ce..ee3da8089fc 100644
--- a/contrib/libs/cxxsupp/libcxx/include/chrono
+++ b/contrib/libs/cxxsupp/libcxx/include/chrono
@@ -182,7 +182,7 @@ template <class Rep1, class Period1, class Rep2, class Period2>
bool operator==(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
template <class Rep1, class Period1, class Rep2, class Period2>
constexpr
- bool operator!=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator!=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); // removed in C++20
template <class Rep1, class Period1, class Rep2, class Period2>
constexpr
bool operator< (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
@@ -195,6 +195,10 @@ template <class Rep1, class Period1, class Rep2, class Period2>
template <class Rep1, class Period1, class Rep2, class Period2>
constexpr
bool operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+template<class Rep1, class Period1, class Rep2, class Period2>
+ requires three_way_comparable<typename CT::rep>
+ constexpr auto operator<=>(const duration<Rep1, Period1>& lhs,
+ const duration<Rep2, Period2>& rhs); // since C++20
// duration_cast
template <class ToDuration, class Rep, class Period>
@@ -231,7 +235,7 @@ template <class Clock, class Duration1, class Duration2>
template <class Clock, class Duration1, class Duration2>
bool operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
- bool operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
+ bool operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); // removed in C++20
template <class Clock, class Duration1, class Duration2>
bool operator< (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
@@ -240,6 +244,10 @@ template <class Clock, class Duration1, class Duration2>
bool operator> (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
bool operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
+template<class Clock, class Duration1,
+ three_way_comparable_with<Duration1> Duration2>
+ constexpr auto operator<=>(const time_point<Clock, Duration1>& lhs,
+ const time_point<Clock, Duration2>& rhs); // since C++20
// time_point_cast (constexpr in C++14)
@@ -282,6 +290,10 @@ template <class Duration>
using sys_seconds = sys_time<seconds>; // C++20
using sys_days = sys_time<days>; // C++20
+template<class charT, class traits, class Duration> // C++20
+ basic_ostream<charT, traits>&
+ operator<<(basic_ostream<charT, traits>& os, const sys_time<Duration>& tp);
+
class file_clock // C++20
{
public:
@@ -303,6 +315,10 @@ public:
template<class Duration>
using file_time = time_point<file_clock, Duration>; // C++20
+template<class charT, class traits, class Duration> // C++20
+ basic_ostream<charT, traits>&
+ operator<<(basic_ostream<charT, traits>& os, const file_time<Duration>& tp);
+
class steady_clock
{
public:
@@ -324,6 +340,10 @@ template<class Duration>
using local_seconds = local_time<seconds>;
using local_days = local_time<days>;
+template<class charT, class traits, class Duration> // C++20
+ basic_ostream<charT, traits>&
+ operator<<(basic_ostream<charT, traits>& os, const local_time<Duration>& tp);
+
// 25.8.2, class last_spec // C++20
struct last_spec;
@@ -370,7 +390,6 @@ template<class charT, class traits>
class weekday;
constexpr bool operator==(const weekday& x, const weekday& y) noexcept;
-constexpr bool operator!=(const weekday& x, const weekday& y) noexcept;
constexpr weekday operator+(const weekday& x, const days& y) noexcept;
constexpr weekday operator+(const days& x, const weekday& y) noexcept;
constexpr weekday operator-(const weekday& x, const days& y) noexcept;
@@ -383,7 +402,6 @@ template<class charT, class traits>
class weekday_indexed;
constexpr bool operator==(const weekday_indexed& x, const weekday_indexed& y) noexcept;
-constexpr bool operator!=(const weekday_indexed& x, const weekday_indexed& y) noexcept;
template<class charT, class traits>
basic_ostream<charT, traits>&
@@ -393,7 +411,6 @@ template<class charT, class traits>
class weekday_last;
constexpr bool operator==(const weekday_last& x, const weekday_last& y) noexcept;
-constexpr bool operator!=(const weekday_last& x, const weekday_last& y) noexcept;
template<class charT, class traits>
basic_ostream<charT, traits>&
@@ -423,7 +440,6 @@ template<class charT, class traits>
class month_weekday;
constexpr bool operator==(const month_weekday& x, const month_weekday& y) noexcept;
-constexpr bool operator!=(const month_weekday& x, const month_weekday& y) noexcept;
template<class charT, class traits>
basic_ostream<charT, traits>&
@@ -433,7 +449,6 @@ template<class charT, class traits>
class month_weekday_last;
constexpr bool operator==(const month_weekday_last& x, const month_weekday_last& y) noexcept;
-constexpr bool operator!=(const month_weekday_last& x, const month_weekday_last& y) noexcept;
template<class charT, class traits>
basic_ostream<charT, traits>&
@@ -503,8 +518,6 @@ class year_month_weekday;
constexpr bool operator==(const year_month_weekday& x,
const year_month_weekday& y) noexcept;
-constexpr bool operator!=(const year_month_weekday& x,
- const year_month_weekday& y) noexcept;
constexpr year_month_weekday
operator+(const year_month_weekday& ymwd, const months& dm) noexcept;
@@ -528,8 +541,6 @@ class year_month_weekday_last;
constexpr bool operator==(const year_month_weekday_last& x,
const year_month_weekday_last& y) noexcept;
-constexpr bool operator!=(const year_month_weekday_last& x,
- const year_month_weekday_last& y) noexcept;
constexpr year_month_weekday_last
operator+(const year_month_weekday_last& ymwdl, const months& dm) noexcept;
constexpr year_month_weekday_last
@@ -656,6 +667,10 @@ public:
constexpr precision to_duration() const noexcept;
};
+template<class charT, class traits, class Duration>
+ basic_ostream<charT, traits>&
+ operator<<(basic_ostream<charT, traits>& os, const hh_mm_ss<Duration>& hms); // C++20
+
// 26.10, 12/24 hour functions
constexpr bool is_am(hours const& h) noexcept;
constexpr bool is_pm(hours const& h) noexcept;
@@ -674,6 +689,12 @@ bool operator>=(const time_zone& x, const time_zone& y) noexcept;
} // chrono
namespace std {
+ template<class Duration, class charT>
+ struct formatter<chrono::sys_time<Duration>, charT>; // C++20
+ template<class Duration, class charT>
+ struct formatter<chrono::filetime<Duration>, charT>; // C++20
+ template<class Duration, class charT>
+ struct formatter<chrono::local_time<Duration>, charT>; // C++20
template<class Rep, class Period, class charT>
struct formatter<chrono::duration<Rep, Period>, charT>; // C++20
template<class charT> struct formatter<chrono::day, charT>; // C++20
@@ -691,6 +712,8 @@ namespace std {
template<class charT> struct formatter<chrono::year_month_day_last, charT>; // C++20
template<class charT> struct formatter<chrono::year_month_weekday, charT>; // C++20
template<class charT> struct formatter<chrono::year_month_weekday_last, charT>; // C++20
+ template<class Rep, class Period, class charT>
+ struct formatter<chrono::hh_mm_ss<duration<Rep, Period>>, charT>; // C++20
} // namespace std
namespace chrono {
@@ -782,7 +805,13 @@ constexpr chrono::year operator ""y(unsigned lo
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <bit>
# include <concepts>
+# include <cstring>
+#endif
+
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 20
+# include <charconv>
#endif
#endif // _LIBCPP_CHRONO
diff --git a/contrib/libs/cxxsupp/libcxx/include/cmath b/contrib/libs/cxxsupp/libcxx/include/cmath
index a27d0ebceb3..e815b3a4ef2 100644
--- a/contrib/libs/cxxsupp/libcxx/include/cmath
+++ b/contrib/libs/cxxsupp/libcxx/include/cmath
@@ -311,6 +311,7 @@ constexpr long double lerp(long double a, long double b, long double t) noexcept
#include <__type_traits/is_constant_evaluated.h>
#include <__type_traits/is_floating_point.h>
#include <__type_traits/is_same.h>
+#include <__type_traits/promote.h>
#include <__type_traits/remove_cv.h>
#include <version>
@@ -543,7 +544,7 @@ using ::scalbnl _LIBCPP_USING_IF_EXISTS;
using ::tgammal _LIBCPP_USING_IF_EXISTS;
using ::truncl _LIBCPP_USING_IF_EXISTS;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
inline _LIBCPP_INLINE_VISIBILITY float hypot( float __x, float __y, float __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
inline _LIBCPP_INLINE_VISIBILITY double hypot( double __x, double __y, double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double __x, long double __y, long double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
@@ -782,7 +783,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp __constexpr_scalbn(_Tp _
return __builtin_scalbn(__x, __exp);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _Fp>
_LIBCPP_HIDE_FROM_ABI constexpr
_Fp __lerp(_Fp __a, _Fp __b, _Fp __t) noexcept {
@@ -823,7 +824,7 @@ lerp(_A1 __a, _A2 __b, _A3 __t) noexcept
_IsSame<_A3, __result_type>::value));
return std::__lerp((__result_type)__a, (__result_type)__b, (__result_type)__t);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/codecvt b/contrib/libs/cxxsupp/libcxx/include/codecvt
index ce378c8d1c6..ef22bf05306 100644
--- a/contrib/libs/cxxsupp/libcxx/include/codecvt
+++ b/contrib/libs/cxxsupp/libcxx/include/codecvt
@@ -78,7 +78,7 @@ template <class _Elem> class __codecvt_utf8;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf8<wchar_t>
+class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<wchar_t>
: public codecvt<wchar_t, char, mbstate_t>
{
unsigned long __maxcode_;
@@ -115,7 +115,7 @@ protected:
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf8<char16_t>
+class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<char16_t>
: public codecvt<char16_t, char, mbstate_t>
{
unsigned long __maxcode_;
@@ -149,7 +149,7 @@ protected:
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf8<char32_t>
+class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<char32_t>
: public codecvt<char32_t, char, mbstate_t>
{
unsigned long __maxcode_;
@@ -203,7 +203,7 @@ template <class _Elem, bool _LittleEndian> class __codecvt_utf16;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf16<wchar_t, false>
+class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<wchar_t, false>
: public codecvt<wchar_t, char, mbstate_t>
{
unsigned long __maxcode_;
@@ -239,7 +239,7 @@ protected:
};
template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf16<wchar_t, true>
+class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<wchar_t, true>
: public codecvt<wchar_t, char, mbstate_t>
{
unsigned long __maxcode_;
@@ -276,7 +276,7 @@ protected:
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, false>
+class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char16_t, false>
: public codecvt<char16_t, char, mbstate_t>
{
unsigned long __maxcode_;
@@ -310,7 +310,7 @@ protected:
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, true>
+class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char16_t, true>
: public codecvt<char16_t, char, mbstate_t>
{
unsigned long __maxcode_;
@@ -344,7 +344,7 @@ protected:
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, false>
+class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char32_t, false>
: public codecvt<char32_t, char, mbstate_t>
{
unsigned long __maxcode_;
@@ -378,7 +378,7 @@ protected:
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, true>
+class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char32_t, true>
: public codecvt<char32_t, char, mbstate_t>
{
unsigned long __maxcode_;
@@ -432,7 +432,7 @@ template <class _Elem> class __codecvt_utf8_utf16;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<wchar_t>
+class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<wchar_t>
: public codecvt<wchar_t, char, mbstate_t>
{
unsigned long __maxcode_;
@@ -469,7 +469,7 @@ protected:
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char32_t>
+class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<char32_t>
: public codecvt<char32_t, char, mbstate_t>
{
unsigned long __maxcode_;
@@ -503,7 +503,7 @@ protected:
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char16_t>
+class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<char16_t>
: public codecvt<char16_t, char, mbstate_t>
{
unsigned long __maxcode_;
diff --git a/contrib/libs/cxxsupp/libcxx/include/compare b/contrib/libs/cxxsupp/libcxx/include/compare
index 9272dbf62b1..626c7435f5f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/compare
+++ b/contrib/libs/cxxsupp/libcxx/include/compare
@@ -151,6 +151,7 @@ namespace std {
#include <__compare/ordering.h>
#include <__compare/partial_order.h>
#include <__compare/strong_order.h>
+#include <__compare/synth_three_way.h>
#include <__compare/three_way_comparable.h>
#include <__compare/weak_order.h>
#include <__config>
diff --git a/contrib/libs/cxxsupp/libcxx/include/complex b/contrib/libs/cxxsupp/libcxx/include/complex
index cac901af463..4734b492c62 100644
--- a/contrib/libs/cxxsupp/libcxx/include/complex
+++ b/contrib/libs/cxxsupp/libcxx/include/complex
@@ -148,12 +148,12 @@ template<class T> complex<T> operator/(const complex<T>&, const T&); //
template<class T> complex<T> operator/(const T&, const complex<T>&); // constexpr in C++20
template<class T> complex<T> operator+(const complex<T>&); // constexpr in C++20
template<class T> complex<T> operator-(const complex<T>&); // constexpr in C++20
-template<class T> bool operator==(const complex<T>&, const complex<T>&); // constexpr in C++14
-template<class T> bool operator==(const complex<T>&, const T&); // constexpr in C++14
-template<class T> bool operator==(const T&, const complex<T>&); // constexpr in C++14
-template<class T> bool operator!=(const complex<T>&, const complex<T>&); // constexpr in C++14
-template<class T> bool operator!=(const complex<T>&, const T&); // constexpr in C++14
-template<class T> bool operator!=(const T&, const complex<T>&); // constexpr in C++14
+template<class T> bool operator==(const complex<T>&, const complex<T>&); // constexpr in C++14
+template<class T> bool operator==(const complex<T>&, const T&); // constexpr in C++14
+template<class T> bool operator==(const T&, const complex<T>&); // constexpr in C++14, removed in C++20
+template<class T> bool operator!=(const complex<T>&, const complex<T>&); // constexpr in C++14, removed in C++20
+template<class T> bool operator!=(const complex<T>&, const T&); // constexpr in C++14, removed in C++20
+template<class T> bool operator!=(const T&, const complex<T>&); // constexpr in C++14, removed in C++20
template<class T, class charT, class traits>
basic_istream<charT, traits>&
@@ -236,7 +236,6 @@ template<class T> complex<T> tanh (const complex<T>&);
#include <cmath>
#include <iosfwd>
#include <stdexcept>
-#include <type_traits>
#include <version>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
@@ -828,6 +827,8 @@ operator==(const complex<_Tp>& __x, const _Tp& __y)
return __x.real() == __y && __x.imag() == 0;
}
+#if _LIBCPP_STD_VER <= 17
+
template<class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
bool
@@ -860,6 +861,8 @@ operator!=(const _Tp& __x, const complex<_Tp>& __y)
return !(__x == __y);
}
+#endif
+
// 26.3.7 values:
template <class _Tp, bool = is_integral<_Tp>::value,
@@ -1523,7 +1526,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
}
#endif // !_LIBCPP_HAS_NO_LOCALIZATION
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
// Literal suffix for complex number literals [complex.literals]
inline namespace literals
{
@@ -1567,4 +1570,8 @@ inline namespace literals
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <type_traits>
+#endif
+
#endif // _LIBCPP_COMPLEX
diff --git a/contrib/libs/cxxsupp/libcxx/include/condition_variable b/contrib/libs/cxxsupp/libcxx/include/condition_variable
index f13df1c012f..ac44eb32481 100644
--- a/contrib/libs/cxxsupp/libcxx/include/condition_variable
+++ b/contrib/libs/cxxsupp/libcxx/include/condition_variable
@@ -107,10 +107,18 @@ public:
*/
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__chrono/duration.h>
+#include <__chrono/steady_clock.h>
+#include <__chrono/time_point.h>
+#include <__condition_variable/condition_variable.h>
#include <__config>
#include <__memory/shared_ptr.h>
#include <__memory/unique_ptr.h>
-#include <__mutex_base>
+#include <__mutex/lock_guard.h>
+#include <__mutex/mutex.h>
+#include <__mutex/tag_types.h>
+#include <__mutex/unique_lock.h>
+#include <__utility/move.h>
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -121,7 +129,7 @@ public:
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_TYPE_VIS condition_variable_any
+class _LIBCPP_EXPORTED_FROM_ABI condition_variable_any
{
condition_variable __cv_;
shared_ptr<mutex> __mut_;
@@ -191,7 +199,7 @@ condition_variable_any::notify_all() _NOEXCEPT
struct __lock_external
{
template <class _Lock>
- void operator()(_Lock* __m) {__m->lock();}
+ _LIBCPP_HIDE_FROM_ABI void operator()(_Lock* __m) {__m->lock();}
};
template <class _Lock>
@@ -202,7 +210,7 @@ condition_variable_any::wait(_Lock& __lock)
unique_lock<mutex> __lk(*__mut);
__lock.unlock();
unique_ptr<_Lock, __lock_external> __lxx(&__lock);
- lock_guard<unique_lock<mutex> > __lx(__lk, adopt_lock);
+ lock_guard<unique_lock<mutex> > __lx(__lk, adopt_lock_t());
__cv_.wait(__lk);
} // __mut_.unlock(), __lock.lock()
@@ -224,7 +232,7 @@ condition_variable_any::wait_until(_Lock& __lock,
unique_lock<mutex> __lk(*__mut);
__lock.unlock();
unique_ptr<_Lock, __lock_external> __lxx(&__lock);
- lock_guard<unique_lock<mutex> > __lx(__lk, adopt_lock);
+ lock_guard<unique_lock<mutex> > __lx(__lk, adopt_lock_t());
return __cv_.wait_until(__lk, __t);
} // __mut_.unlock(), __lock.lock()
@@ -261,16 +269,24 @@ condition_variable_any::wait_for(_Lock& __lock,
_VSTD::move(__pred));
}
-_LIBCPP_FUNC_VIS
-void notify_all_at_thread_exit(condition_variable&, unique_lock<mutex>);
+_LIBCPP_EXPORTED_FROM_ABI void notify_all_at_thread_exit(condition_variable&, unique_lock<mutex>);
_LIBCPP_END_NAMESPACE_STD
#endif // !_LIBCPP_HAS_NO_THREADS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
+# include <cstdint>
+# include <cstdlib>
+# include <cstring>
+# include <initializer_list>
+# include <new>
+# include <stdexcept>
+# include <system_error>
# include <type_traits>
+# include <typeinfo>
#endif
#endif // _LIBCPP_CONDITION_VARIABLE
diff --git a/contrib/libs/cxxsupp/libcxx/include/cstddef b/contrib/libs/cxxsupp/libcxx/include/cstddef
index e3c06691757..a364e6e5517 100644
--- a/contrib/libs/cxxsupp/libcxx/include/cstddef
+++ b/contrib/libs/cxxsupp/libcxx/include/cstddef
@@ -66,7 +66,7 @@ using ::max_align_t _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
namespace std // purposefully not versioned
{
enum class byte : unsigned char {};
diff --git a/contrib/libs/cxxsupp/libcxx/include/cstdlib b/contrib/libs/cxxsupp/libcxx/include/cstdlib
index 457f2a65bb3..080bafecf15 100644
--- a/contrib/libs/cxxsupp/libcxx/include/cstdlib
+++ b/contrib/libs/cxxsupp/libcxx/include/cstdlib
@@ -144,7 +144,7 @@ using ::wcstombs _LIBCPP_USING_IF_EXISTS;
using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
using ::quick_exit _LIBCPP_USING_IF_EXISTS;
#endif
-#if _LIBCPP_STD_VER > 14 && __has_attribute(using_if_exists) && !defined(_LIBCPP_MSVCRT)
+#if _LIBCPP_STD_VER >= 17 && __has_attribute(using_if_exists) && !defined(_LIBCPP_MSVCRT)
using ::aligned_alloc _LIBCPP_USING_IF_EXISTS;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/cstring b/contrib/libs/cxxsupp/libcxx/include/cstring
index c88d97739f7..a9bdf4ff2df 100644
--- a/contrib/libs/cxxsupp/libcxx/include/cstring
+++ b/contrib/libs/cxxsupp/libcxx/include/cstring
@@ -100,53 +100,6 @@ using ::memset _LIBCPP_USING_IF_EXISTS;
using ::strerror _LIBCPP_USING_IF_EXISTS;
using ::strlen _LIBCPP_USING_IF_EXISTS;
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t __constexpr_strlen(const char* __str) {
- // GCC currently doesn't support __builtin_strlen for heap-allocated memory during constant evaluation.
- // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70816
-#ifdef _LIBCPP_COMPILER_GCC
- if (__libcpp_is_constant_evaluated()) {
- size_t __i = 0;
- for (; __str[__i] != '\0'; ++__i)
- ;
- return __i;
- }
-#endif
- return __builtin_strlen(__str);
-}
-
-template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int
-__constexpr_memcmp(const _Tp* __lhs, const _Tp* __rhs, size_t __count) {
-#ifdef _LIBCPP_COMPILER_GCC
- if (__libcpp_is_constant_evaluated()) {
- for (; __count; --__count, ++__lhs, ++__rhs) {
- if (*__lhs < *__rhs)
- return -1;
- if (*__rhs < *__lhs)
- return 1;
- }
- return 0;
- }
-#endif
- return __builtin_memcmp(__lhs, __rhs, __count);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const char*
-__constexpr_char_memchr(const char* __str, int __char, size_t __count) {
-#if __has_builtin(__builtin_char_memchr)
- return __builtin_char_memchr(__str, __char, __count);
-#else
- if (!__libcpp_is_constant_evaluated())
- return static_cast<const char*>(std::memchr(__str, __char, __count));
- for (; __count; --__count) {
- if (*__str == __char)
- return __str;
- ++__str;
- }
- return nullptr;
-#endif
-}
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CSTRING
diff --git a/contrib/libs/cxxsupp/libcxx/include/ctime b/contrib/libs/cxxsupp/libcxx/include/ctime
index 7cb4a1acac6..e537bbe5566 100644
--- a/contrib/libs/cxxsupp/libcxx/include/ctime
+++ b/contrib/libs/cxxsupp/libcxx/include/ctime
@@ -66,7 +66,7 @@ using ::clock_t _LIBCPP_USING_IF_EXISTS;
using ::size_t _LIBCPP_USING_IF_EXISTS;
using ::time_t _LIBCPP_USING_IF_EXISTS;
using ::tm _LIBCPP_USING_IF_EXISTS;
-#if _LIBCPP_STD_VER > 14 && __has_attribute(using_if_exists)
+#if _LIBCPP_STD_VER >= 17 && __has_attribute(using_if_exists)
using ::timespec _LIBCPP_USING_IF_EXISTS;
#endif
using ::clock _LIBCPP_USING_IF_EXISTS;
@@ -78,7 +78,7 @@ using ::ctime _LIBCPP_USING_IF_EXISTS;
using ::gmtime _LIBCPP_USING_IF_EXISTS;
using ::localtime _LIBCPP_USING_IF_EXISTS;
using ::strftime _LIBCPP_USING_IF_EXISTS;
-#if _LIBCPP_STD_VER > 14 && __has_attribute(using_if_exists)
+#if _LIBCPP_STD_VER >= 17 && __has_attribute(using_if_exists)
using ::timespec_get _LIBCPP_USING_IF_EXISTS;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/cwchar b/contrib/libs/cxxsupp/libcxx/include/cwchar
index fb7b92b760a..122af242880 100644
--- a/contrib/libs/cxxsupp/libcxx/include/cwchar
+++ b/contrib/libs/cxxsupp/libcxx/include/cwchar
@@ -104,7 +104,11 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
+#include <__type_traits/apply_cv.h>
#include <__type_traits/is_constant_evaluated.h>
+#include <__type_traits/is_equality_comparable.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/remove_cv.h>
#include <cwctype>
#include <wchar.h>
@@ -222,21 +226,31 @@ __constexpr_wmemcmp(const wchar_t* __lhs, const wchar_t* __rhs, size_t __count)
#endif
}
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const wchar_t*
-__constexpr_wmemchr(const wchar_t* __str, wchar_t __char, size_t __count) {
-#if __has_feature(cxx_constexpr_string_builtins)
- return __builtin_wmemchr(__str, __char, __count);
-#else
- if (!__libcpp_is_constant_evaluated())
- return std::wmemchr(__str, __char, __count);
+template <class _Tp, class _Up>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp* __str, _Up __value, size_t __count) {
+ static_assert(sizeof(_Tp) == sizeof(wchar_t)&& _LIBCPP_ALIGNOF(_Tp) >= _LIBCPP_ALIGNOF(wchar_t) &&
+ __libcpp_is_trivially_equality_comparable<_Tp, _Tp>::value,
+ "Calling wmemchr on non-trivially equality comparable types is unsafe.");
+
+#if __has_builtin(__builtin_wmemchr)
+ if (!__libcpp_is_constant_evaluated()) {
+ wchar_t __value_buffer = 0;
+ __builtin_memcpy(&__value_buffer, &__value, sizeof(wchar_t));
+ return reinterpret_cast<_Tp*>(
+ __builtin_wmemchr(reinterpret_cast<__apply_cv_t<_Tp, wchar_t>*>(__str), __value_buffer, __count));
+ }
+# if _LIBCPP_STD_VER >= 17
+ else if constexpr (is_same_v<remove_cv_t<_Tp>, wchar_t>)
+ return __builtin_wmemchr(__str, __value, __count);
+# endif
+#endif // __has_builtin(__builtin_wmemchr)
for (; __count; --__count) {
- if (*__str == __char)
+ if (*__str == __value)
return __str;
++__str;
}
return nullptr;
-#endif
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/deque b/contrib/libs/cxxsupp/libcxx/include/deque
index 0cd09040a83..42c0cb3f75a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/deque
+++ b/contrib/libs/cxxsupp/libcxx/include/deque
@@ -47,6 +47,8 @@ public:
deque(InputIterator f, InputIterator l);
template <class InputIterator>
deque(InputIterator f, InputIterator l, const allocator_type& a);
+ template<container-compatible-range<T> R>
+ deque(from_range_t, R&& rg, const Allocator& = Allocator()); // C++23
deque(const deque& c);
deque(deque&& c)
noexcept(is_nothrow_move_constructible<allocator_type>::value);
@@ -64,6 +66,8 @@ public:
template <class InputIterator>
void assign(InputIterator f, InputIterator l);
+ template<container-compatible-range<T> R>
+ void assign_range(R&& rg); // C++23
void assign(size_type n, const value_type& v);
void assign(initializer_list<value_type> il);
@@ -107,8 +111,12 @@ public:
// modifiers:
void push_front(const value_type& v);
void push_front(value_type&& v);
+ template<container-compatible-range<T> R>
+ void prepend_range(R&& rg); // C++23
void push_back(const value_type& v);
void push_back(value_type&& v);
+ template<container-compatible-range<T> R>
+ void append_range(R&& rg); // C++23
template <class... Args> reference emplace_front(Args&&... args); // reference in C++17
template <class... Args> reference emplace_back(Args&&... args); // reference in C++17
template <class... Args> iterator emplace(const_iterator p, Args&&... args);
@@ -117,6 +125,8 @@ public:
iterator insert(const_iterator p, size_type n, const value_type& v);
template <class InputIterator>
iterator insert(const_iterator p, InputIterator f, InputIterator l);
+ template<container-compatible-range<T> R>
+ iterator insert_range(const_iterator position, R&& rg); // C++23
iterator insert(const_iterator p, initializer_list<value_type> il);
void pop_front();
void pop_back();
@@ -131,18 +141,25 @@ template <class InputIterator, class Allocator = allocator<typename iterator_tra
deque(InputIterator, InputIterator, Allocator = Allocator())
-> deque<typename iterator_traits<InputIterator>::value_type, Allocator>; // C++17
+template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
+ deque(from_range_t, R&&, Allocator = Allocator())
+ -> deque<ranges::range_value_t<R>, Allocator>; // C++23
+
template <class T, class Allocator>
bool operator==(const deque<T,Allocator>& x, const deque<T,Allocator>& y);
template <class T, class Allocator>
- bool operator< (const deque<T,Allocator>& x, const deque<T,Allocator>& y);
+ bool operator< (const deque<T,Allocator>& x, const deque<T,Allocator>& y); // removed in C++20
template <class T, class Allocator>
- bool operator!=(const deque<T,Allocator>& x, const deque<T,Allocator>& y);
+ bool operator!=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); // removed in C++20
template <class T, class Allocator>
- bool operator> (const deque<T,Allocator>& x, const deque<T,Allocator>& y);
+ bool operator> (const deque<T,Allocator>& x, const deque<T,Allocator>& y); // removed in C++20
template <class T, class Allocator>
- bool operator>=(const deque<T,Allocator>& x, const deque<T,Allocator>& y);
+ bool operator>=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); // removed in C++20
template <class T, class Allocator>
- bool operator<=(const deque<T,Allocator>& x, const deque<T,Allocator>& y);
+ bool operator<=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); // removed in C++20
+template<class T, class Allocator>
+ synth-three-way-result<T> operator<=>(const deque<T, Allocator>& x,
+ const deque<T, Allocator>& y); // since C++20
// specialized algorithms:
template <class T, class Allocator>
@@ -162,34 +179,47 @@ template <class T, class Allocator, class Predicate>
#include <__algorithm/copy.h>
#include <__algorithm/copy_backward.h>
+#include <__algorithm/copy_n.h>
#include <__algorithm/equal.h>
#include <__algorithm/fill_n.h>
#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lexicographical_compare_three_way.h>
#include <__algorithm/min.h>
#include <__algorithm/remove.h>
#include <__algorithm/remove_if.h>
#include <__algorithm/unwrap_iter.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
#include <__format/enable_insertable.h>
+#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/next.h>
#include <__iterator/prev.h>
#include <__iterator/reverse_iterator.h>
#include <__iterator/segmented_iterator.h>
+#include <__memory/addressof.h>
#include <__memory/allocator_destructor.h>
#include <__memory/pointer_traits.h>
#include <__memory/temp_value.h>
#include <__memory/unique_ptr.h>
#include <__memory_resource/polymorphic_allocator.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/container_compatible_range.h>
+#include <__ranges/from_range.h>
+#include <__ranges/size.h>
#include <__split_buffer>
#include <__type_traits/is_allocator.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/type_identity.h>
#include <__utility/forward.h>
#include <__utility/move.h>
+#include <__utility/pair.h>
#include <__utility/swap.h>
#include <limits>
#include <stdexcept>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -251,7 +281,7 @@ public:
typedef _Reference reference;
_LIBCPP_HIDE_FROM_ABI __deque_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
: __m_iter_(nullptr), __ptr_(nullptr)
#endif
{}
@@ -453,6 +483,7 @@ public:
using __map_alloc_traits = allocator_traits<__pointer_allocator>;
using __map_pointer = typename __map_alloc_traits::pointer;
using __map_const_pointer = typename allocator_traits<__const_pointer_allocator>::const_pointer;
+ using __map_const_iterator = typename __map::const_iterator;
using reference = value_type&;
using const_reference = const value_type&;
@@ -552,10 +583,13 @@ public:
// construct/copy/destroy:
_LIBCPP_HIDE_FROM_ABI
deque() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
- : __start_(0), __size_(0, __default_init_tag()) {}
+ : __start_(0), __size_(0, __default_init_tag()) {
+ __annotate_new(0);
+ }
_LIBCPP_HIDE_FROM_ABI ~deque() {
clear();
+ __annotate_delete();
typename __map::iterator __i = __map_.begin();
typename __map::iterator __e = __map_.end();
for (; __i != __e; ++__i)
@@ -563,10 +597,12 @@ public:
}
_LIBCPP_HIDE_FROM_ABI explicit deque(const allocator_type& __a)
- : __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a) {}
+ : __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a) {
+ __annotate_new(0);
+ }
explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const _Allocator& __a);
#endif
_LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v);
@@ -575,16 +611,34 @@ public:
_LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v, const allocator_type& __a)
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a)
{
+ __annotate_new(0);
if (__n > 0)
__append(__n, __v);
}
template <class _InputIter>
_LIBCPP_HIDE_FROM_ABI deque(_InputIter __f, _InputIter __l,
- typename enable_if<__is_cpp17_input_iterator<_InputIter>::value>::type* = 0);
+ typename enable_if<__has_input_iterator_category<_InputIter>::value>::type* = 0);
template <class _InputIter>
_LIBCPP_HIDE_FROM_ABI deque(_InputIter __f, _InputIter __l, const allocator_type& __a,
- typename enable_if<__is_cpp17_input_iterator<_InputIter>::value>::type* = 0);
+ typename enable_if<__has_input_iterator_category<_InputIter>::value>::type* = 0);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI deque(from_range_t, _Range&& __range,
+ const allocator_type& __a = allocator_type())
+ : __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a) {
+ if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
+ __append_with_size(ranges::begin(__range), ranges::distance(__range));
+
+ } else {
+ for (auto&& __e : __range) {
+ emplace_back(std::forward<decltype(__e)>(__e));
+ }
+ }
+ }
+#endif
+
_LIBCPP_HIDE_FROM_ABI deque(const deque& __c);
_LIBCPP_HIDE_FROM_ABI deque(const deque& __c, const __type_identity_t<allocator_type>& __a);
@@ -612,11 +666,30 @@ public:
template <class _InputIter>
_LIBCPP_HIDE_FROM_ABI void assign(_InputIter __f, _InputIter __l,
- typename enable_if<__is_cpp17_input_iterator<_InputIter>::value &&
- !__is_cpp17_random_access_iterator<_InputIter>::value>::type* = 0);
+ typename enable_if<__has_input_iterator_category<_InputIter>::value &&
+ !__has_random_access_iterator_category<_InputIter>::value>::type* = 0);
template <class _RAIter>
_LIBCPP_HIDE_FROM_ABI void assign(_RAIter __f, _RAIter __l,
- typename enable_if<__is_cpp17_random_access_iterator<_RAIter>::value>::type* = 0);
+ typename enable_if<__has_random_access_iterator_category<_RAIter>::value>::type* = 0);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void assign_range(_Range&& __range) {
+ if constexpr (ranges::random_access_range<_Range>) {
+ auto __n = static_cast<size_type>(ranges::distance(__range));
+ __assign_with_size_random_access(ranges::begin(__range), __n);
+
+ } else if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
+ auto __n = static_cast<size_type>(ranges::distance(__range));
+ __assign_with_size(ranges::begin(__range), __n);
+
+ } else {
+ __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
+ }
+ }
+#endif
+
_LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __v);
_LIBCPP_HIDE_FROM_ABI
@@ -715,7 +788,7 @@ public:
_LIBCPP_HIDE_FROM_ABI void push_front(const value_type& __v);
_LIBCPP_HIDE_FROM_ABI void push_back(const value_type& __v);
#ifndef _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class... _Args> _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args);
template <class... _Args> _LIBCPP_HIDE_FROM_ABI reference emplace_back (_Args&&... __args);
#else
@@ -726,6 +799,21 @@ public:
_LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __v);
_LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __v);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void prepend_range(_Range&& __range) {
+ insert_range(begin(), std::forward<_Range>(__range));
+ }
+
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void append_range(_Range&& __range) {
+ insert_range(end(), std::forward<_Range>(__range));
+ }
+#endif
+
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v);
_LIBCPP_HIDE_FROM_ABI
@@ -736,13 +824,31 @@ public:
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, size_type __n, const value_type& __v);
template <class _InputIter>
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _InputIter __f, _InputIter __l,
- typename enable_if<__is_exactly_cpp17_input_iterator<_InputIter>::value>::type* = 0);
+ typename enable_if<__has_exactly_input_iterator_category<_InputIter>::value>::type* = 0);
template <class _ForwardIterator>
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l,
- typename enable_if<__is_exactly_cpp17_forward_iterator<_ForwardIterator>::value>::type* = 0);
+ typename enable_if<__has_exactly_forward_iterator_category<_ForwardIterator>::value>::type* = 0);
template <class _BiIter>
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _BiIter __f, _BiIter __l,
- typename enable_if<__is_cpp17_bidirectional_iterator<_BiIter>::value>::type* = 0);
+ typename enable_if<__has_bidirectional_iterator_category<_BiIter>::value>::type* = 0);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ iterator insert_range(const_iterator __position, _Range&& __range) {
+ if constexpr (ranges::bidirectional_range<_Range>) {
+ auto __n = static_cast<size_type>(ranges::distance(__range));
+ return __insert_bidirectional(__position, ranges::begin(__range), ranges::end(__range), __n);
+
+ } else if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
+ auto __n = static_cast<size_type>(ranges::distance(__range));
+ return __insert_with_size(__position, ranges::begin(__range), __n);
+
+ } else {
+ return __insert_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));
+ }
+ }
+#endif
_LIBCPP_HIDE_FROM_ABI void pop_front();
_LIBCPP_HIDE_FROM_ABI void pop_back();
@@ -766,7 +872,7 @@ public:
return false;
if (__map_.size() >= size_type(-1) / __block_size)
return false;
- for (typename __map::const_iterator __i = __map_.begin(), __e = __map_.end();
+ for (__map_const_iterator __i = __map_.begin(), __e = __map_.end();
__i != __e; ++__i)
if (*__i == nullptr)
return false;
@@ -853,9 +959,264 @@ public:
}
private:
+ enum __asan_annotation_type {
+ __asan_unposion,
+ __asan_poison
+ };
+
+ enum __asan_annotation_place {
+ __asan_front_moved,
+ __asan_back_moved,
+ };
+
+// The following functions are no-ops outside of AddressSanitizer mode.
+// We call annotations for every allocator, unless explicitly disabled.
+//
+// To disable annotations for a particular allocator, change value of
+// __asan_annotate_container_with_allocator to false.
+// For more details, see the "Using libc++" documentation page or
+// the documentation for __sanitizer_annotate_contiguous_container.
+#if !defined(_LIBCPP_HAS_NO_ASAN) && _LIBCPP_CLANG_VER >= 1600 && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES)
+ // TODO LLVM18: Remove the special-casing
+ _LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container(
+ const void* __beg,
+ const void* __end,
+ const void* __old_con_beg,
+ const void* __old_con_end,
+ const void* __new_con_beg,
+ const void* __new_con_end) const {
+ if (__beg != nullptr && __asan_annotate_container_with_allocator<_Allocator>::value)
+ __sanitizer_annotate_double_ended_contiguous_container(
+ __beg, __end, __old_con_beg, __old_con_end, __new_con_beg, __new_con_end);
+ }
+#else
+ _LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container(
+ const void*, const void*, const void*, const void*, const void*, const void*) const _NOEXCEPT {}
+#endif // !defined(_LIBCPP_HAS_NO_ASAN) && _LIBCPP_CLANG_VER >= 1600
+
+ _LIBCPP_HIDE_FROM_ABI
+ void __annotate_from_to(size_type __beg, size_type __end, __asan_annotation_type __annotation_type, __asan_annotation_place __place) const _NOEXCEPT {
+ // __beg - index of the first item to annotate
+ // __end - index behind the last item to annotate (so last item + 1)
+ // __annotation_type - __asan_unposion or __asan_poison
+ // __place - __asan_front_moved or __asan_back_moved
+ // Note: All indexes in __map_
+ if (__beg == __end)
+ return;
+ // __annotations_beg_map - first chunk which annotations we want to modify
+ // __annotations_end_map - last chunk which annotations we want to modify
+ // NOTE: if __end % __block_size == 0, __annotations_end_map points at the next block, which may not exist
+ __map_const_iterator __annotations_beg_map = __map_.begin() + __beg / __block_size;
+ __map_const_iterator __annotations_end_map = __map_.begin() + __end / __block_size;
+
+ bool const __poisoning = __annotation_type == __asan_poison;
+ // __old_c_beg_index - index of the first element in old container
+ // __old_c_end_index - index of the end of old container (last + 1)
+ // Note: may be outside the area we are annotating
+ size_t __old_c_beg_index = (__poisoning && __place == __asan_front_moved) ? __beg : __start_;
+ size_t __old_c_end_index = (__poisoning && __place == __asan_back_moved) ? __end : __start_ + size();
+ bool const __front = __place == __asan_front_moved;
+
+ if (__poisoning && empty()) {
+ // Special case: we shouldn't trust __start_
+ __old_c_beg_index = __beg;
+ __old_c_end_index = __end;
+ }
+ // __old_c_beg_map - memory block (chunk) with first element
+ // __old_c_end_map - memory block (chunk) with end of old container
+ // Note: if __old_c_end_index % __block_size == 0, __old_c_end_map points at the next block,
+ // which may not exist
+ __map_const_iterator __old_c_beg_map = __map_.begin() + __old_c_beg_index / __block_size;
+ __map_const_iterator __old_c_end_map = __map_.begin() + __old_c_end_index / __block_size;
+
+ // One edge (front/end) of the container was moved and one was not modified.
+ // __new_edge_index - index of new edge
+ // __new_edge_map - memory block (chunk) with new edge, it always equals to
+ // __annotations_beg_map or __annotations_end_map
+ // __old_edge_map - memory block (chunk) with old edge, it always equals to
+ // __old_c_beg_map or __old_c_end_map
+ size_t __new_edge_index = (__poisoning ^ __front) ? __beg : __end;
+ __map_const_iterator __new_edge_map = __map_.begin() + __new_edge_index / __block_size;
+ __map_const_iterator __old_edge_map = __front ? __old_c_end_map : __old_c_beg_map;
+
+ // We iterate over map pointers (chunks) and fully poison all memory blocks between the first and the last.
+ // First and last chunk may be partially poisoned.
+ // __annotate_end_map may point at not existing chunk, therefore we have to have a check for it.
+ for (__map_const_iterator __map_it = __annotations_beg_map; __map_it <= __annotations_end_map; ++__map_it) {
+ if (__map_it == __annotations_end_map && __end % __block_size == 0)
+ // Chunk may not exist, but nothing to do here anyway
+ break;
+
+ // The beginning and the end of the current memory block
+ const void* __mem_beg = std::__to_address(*__map_it);
+ const void* __mem_end = std::__to_address(*__map_it + __block_size);
+
+ // The beginning of memory-in-use in the memory block before container modification
+ const void* __old_beg =
+ (__map_it == __old_c_beg_map) ? std::__to_address(*__map_it + (__old_c_beg_index % __block_size)) : __mem_beg;
+
+ // The end of memory-in-use in the memory block before container modification
+ const void* __old_end;
+ if (__map_it < __old_c_beg_map || __map_it > __old_c_end_map || (!__poisoning && empty()))
+ __old_end = __old_beg;
+ else
+ __old_end = (__map_it == __old_c_end_map) ? std::__to_address(*__map_it + (__old_c_end_index % __block_size))
+ : __mem_end;
+
+ // New edge of the container in current memory block
+ // If the edge is in a different chunk it points on corresponding end of the memory block
+ const void* __new_edge;
+ if (__map_it == __new_edge_map)
+ __new_edge = std::__to_address(*__map_it + (__new_edge_index % __block_size));
+ else
+ __new_edge = (__poisoning ^ __front) ? __mem_beg : __mem_end;
+
+ // Not modified edge of the container
+ // If the edge is in a different chunk it points on corresponding end of the memory block
+ const void* __old_edge;
+ if (__map_it == __old_edge_map)
+ __old_edge = __front ? __old_end : __old_beg;
+ else
+ __old_edge = __front ? __mem_end : __mem_beg;
+
+ // __new_beg - the beginning of memory-in-use in the memory block after container modification
+ // __new_end - the end of memory-in-use in the memory block after container modification
+ const void* __new_beg = __front ? __new_edge : __old_edge;
+ const void* __new_end = __front ? __old_edge : __new_edge;
+
+ __annotate_double_ended_contiguous_container(__mem_beg, __mem_end, __old_beg, __old_end, __new_beg, __new_end);
+ }
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ void __annotate_new(size_type __current_size) const _NOEXCEPT {
+ if (__current_size == 0)
+ __annotate_from_to(0, __map_.size() * __block_size, __asan_poison, __asan_back_moved);
+ else {
+ __annotate_from_to(0, __start_, __asan_poison, __asan_front_moved);
+ __annotate_from_to(__start_ + __current_size, __map_.size() * __block_size, __asan_poison, __asan_back_moved);
+ }
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ void __annotate_delete() const _NOEXCEPT {
+ if (empty()) {
+ for(size_t __i = 0; __i < __map_.size(); ++__i) {
+ __annotate_whole_block(__i, __asan_unposion);
+ }
+ }
+ else {
+ __annotate_from_to(0, __start_, __asan_unposion, __asan_front_moved);
+ __annotate_from_to(__start_ + size(), __map_.size() * __block_size, __asan_unposion, __asan_back_moved);
+ }
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ void __annotate_increase_front(size_type __n) const _NOEXCEPT {
+ __annotate_from_to(__start_ - __n, __start_, __asan_unposion, __asan_front_moved);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ void __annotate_increase_back(size_type __n) const _NOEXCEPT {
+ __annotate_from_to(__start_ + size(), __start_ + size() + __n, __asan_unposion, __asan_back_moved);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ void __annotate_shrink_front(size_type __old_size, size_type __old_start) const _NOEXCEPT {
+ __annotate_from_to(__old_start, __old_start + (__old_size - size()), __asan_poison, __asan_front_moved);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ void __annotate_shrink_back(size_type __old_size, size_type __old_start) const _NOEXCEPT {
+ __annotate_from_to(__old_start + size(), __old_start + __old_size, __asan_poison, __asan_back_moved);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ void __annotate_poison_block(const void *__beginning, const void *__end) const _NOEXCEPT {
+ __annotate_double_ended_contiguous_container(__beginning, __end, __beginning, __end, __end, __end);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ void __annotate_whole_block(size_t __block_index, __asan_annotation_type __annotation_type) const _NOEXCEPT {
+ __map_const_iterator __block_it = __map_.begin() + __block_index;
+ const void* __block_start = std::__to_address(*__block_it);
+ const void* __block_end = std::__to_address(*__block_it + __block_size);
+
+ if(__annotation_type == __asan_poison)
+ __annotate_poison_block(__block_start, __block_end);
+ else {
+ __annotate_double_ended_contiguous_container(
+ __block_start, __block_end, __block_start, __block_start, __block_start, __block_end);
+ }
+ }
+#if !defined(_LIBCPP_HAS_NO_ASAN)
+
+ public:
+ _LIBCPP_HIDE_FROM_ABI
+ bool __verify_asan_annotations() const _NOEXCEPT {
+ // This function tests deque object annotations.
+ if (empty()) {
+ for (__map_const_iterator __it = __map_.begin(); __it != __map_.end(); ++__it) {
+ if (!__sanitizer_verify_double_ended_contiguous_container(
+ std::__to_address(*__it),
+ std::__to_address(*__it),
+ std::__to_address(*__it),
+ std::__to_address(*__it + __block_size)))
+ return false;
+ }
+
+ return true;
+ }
+
+ size_type __end = __start_ + size();
+ __map_const_iterator __first_mp = __map_.begin() + __start_ / __block_size;
+ __map_const_iterator __last_mp = __map_.begin() + (__end - 1) / __block_size;
+
+ // Pointers to first and after last elements
+ // Those can be in different deque blocks
+ const void* __p_beg = std::__to_address(*__first_mp + (__start_ % __block_size));
+ const void* __p_end =
+ std::__to_address(*__last_mp + ((__end % __block_size == 0) ? __block_size : __end % __block_size));
+
+ for (__map_const_iterator __it = __map_.begin(); __it != __map_.end(); ++__it) {
+ // Go over all blocks, find the place we are in and verify its annotations
+ // Note that __p_end points *behind* the last item.
+
+ // - blocks before the first block with container elements
+ // - first block with items
+ // - last block with items
+ // - blocks after last block with ciontainer elements
+
+ // Is the block before or after deque blocks that contain elements?
+ if (__it < __first_mp || __it > __last_mp) {
+ if (!__sanitizer_verify_double_ended_contiguous_container(
+ std::__to_address(*__it),
+ std::__to_address(*__it),
+ std::__to_address(*__it),
+ std::__to_address(*__it + __block_size)))
+ return false;
+ } else {
+ const void* __containers_buffer_beg = (__it == __first_mp) ? __p_beg : (const void*)std::__to_address(*__it);
+ const void* __containers_buffer_end =
+ (__it == __last_mp) ? __p_end : (const void*)std::__to_address(*__it + __block_size);
+ if (!__sanitizer_verify_double_ended_contiguous_container(
+ std::__to_address(*__it),
+ __containers_buffer_beg,
+ __containers_buffer_end,
+ std::__to_address(*__it + __block_size))) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ private:
+#endif // _LIBCPP_VERIFY_ASAN_DEQUE_ANNOTATIONS
_LIBCPP_HIDE_FROM_ABI
bool __maybe_remove_front_spare(bool __keep_one = true) {
if (__front_spare_blocks() >= 2 || (!__keep_one && __front_spare_blocks())) {
+ __annotate_whole_block(0, __asan_unposion);
__alloc_traits::deallocate(__alloc(), __map_.front(),
__block_size);
__map_.pop_front();
@@ -868,6 +1229,7 @@ public:
_LIBCPP_HIDE_FROM_ABI
bool __maybe_remove_back_spare(bool __keep_one = true) {
if (__back_spare_blocks() >= 2 || (!__keep_one && __back_spare_blocks())) {
+ __annotate_whole_block(__map_.size() - 1, __asan_unposion);
__alloc_traits::deallocate(__alloc(), __map_.back(),
__block_size);
__map_.pop_back();
@@ -876,12 +1238,44 @@ public:
return false;
}
+ template <class _Iterator, class _Sentinel>
+ _LIBCPP_HIDE_FROM_ABI
+ void __assign_with_sentinel(_Iterator __f, _Sentinel __l);
+
+ template <class _RandomAccessIterator>
+ _LIBCPP_HIDE_FROM_ABI
+ void __assign_with_size_random_access(_RandomAccessIterator __f, difference_type __n);
+ template <class _Iterator>
+ _LIBCPP_HIDE_FROM_ABI
+ void __assign_with_size(_Iterator __f, difference_type __n);
+
+ template <class _Iterator, class _Sentinel>
+ _LIBCPP_HIDE_FROM_ABI
+ iterator __insert_with_sentinel(const_iterator __p, _Iterator __f, _Sentinel __l);
+
+ template <class _Iterator>
+ _LIBCPP_HIDE_FROM_ABI
+ iterator __insert_with_size(const_iterator __p, _Iterator __f, size_type __n);
+
+ template <class _BiIter, class _Sentinel>
+ _LIBCPP_HIDE_FROM_ABI
+ iterator __insert_bidirectional(const_iterator __p, _BiIter __f, _Sentinel __sent, size_type __n);
+ template <class _BiIter>
+ _LIBCPP_HIDE_FROM_ABI
+ iterator __insert_bidirectional(const_iterator __p, _BiIter __f, _BiIter __l, size_type __n);
+
template <class _InpIter>
_LIBCPP_HIDE_FROM_ABI void __append(_InpIter __f, _InpIter __l,
- typename enable_if<__is_exactly_cpp17_input_iterator<_InpIter>::value>::type* = 0);
+ typename enable_if<__has_exactly_input_iterator_category<_InpIter>::value>::type* = 0);
template <class _ForIter>
_LIBCPP_HIDE_FROM_ABI void __append(_ForIter __f, _ForIter __l,
- typename enable_if<__is_cpp17_forward_iterator<_ForIter>::value>::type* = 0);
+ typename enable_if<__has_forward_iterator_category<_ForIter>::value>::type* = 0);
+
+ template <class _InputIterator>
+ _LIBCPP_HIDE_FROM_ABI void __append_with_size(_InputIterator __from, size_type __n);
+ template <class _InputIterator, class _Sentinel>
+ _LIBCPP_HIDE_FROM_ABI void __append_with_sentinel(_InputIterator __f, _Sentinel __l);
+
_LIBCPP_HIDE_FROM_ABI void __append(size_type __n);
_LIBCPP_HIDE_FROM_ABI void __append(size_type __n, const value_type& __v);
_LIBCPP_HIDE_FROM_ABI void __erase_to_end(const_iterator __f);
@@ -931,7 +1325,7 @@ _LIBCPP_CONSTEXPR const typename allocator_traits<_Alloc>::difference_type deque
#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Alloc>::value>
>
deque(_InputIterator, _InputIterator)
@@ -939,26 +1333,37 @@ deque(_InputIterator, _InputIterator)
template<class _InputIterator,
class _Alloc,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Alloc>::value>
>
deque(_InputIterator, _InputIterator, _Alloc)
-> deque<__iter_value_type<_InputIterator>, _Alloc>;
#endif
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range,
+ class _Alloc = allocator<ranges::range_value_t<_Range>>,
+ class = enable_if_t<__is_allocator<_Alloc>::value>
+ >
+deque(from_range_t, _Range&&, _Alloc = _Alloc())
+ -> deque<ranges::range_value_t<_Range>, _Alloc>;
+#endif
+
template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(size_type __n)
: __start_(0), __size_(0, __default_init_tag())
{
+ __annotate_new(0);
if (__n > 0)
__append(__n);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(size_type __n, const _Allocator& __a)
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a)
{
+ __annotate_new(0);
if (__n > 0)
__append(__n);
}
@@ -968,6 +1373,7 @@ template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(size_type __n, const value_type& __v)
: __start_(0), __size_(0, __default_init_tag())
{
+ __annotate_new(0);
if (__n > 0)
__append(__n, __v);
}
@@ -975,18 +1381,20 @@ deque<_Tp, _Allocator>::deque(size_type __n, const value_type& __v)
template <class _Tp, class _Allocator>
template <class _InputIter>
deque<_Tp, _Allocator>::deque(_InputIter __f, _InputIter __l,
- typename enable_if<__is_cpp17_input_iterator<_InputIter>::value>::type*)
+ typename enable_if<__has_input_iterator_category<_InputIter>::value>::type*)
: __start_(0), __size_(0, __default_init_tag())
{
+ __annotate_new(0);
__append(__f, __l);
}
template <class _Tp, class _Allocator>
template <class _InputIter>
deque<_Tp, _Allocator>::deque(_InputIter __f, _InputIter __l, const allocator_type& __a,
- typename enable_if<__is_cpp17_input_iterator<_InputIter>::value>::type*)
+ typename enable_if<__has_input_iterator_category<_InputIter>::value>::type*)
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a)
{
+ __annotate_new(0);
__append(__f, __l);
}
@@ -996,6 +1404,7 @@ deque<_Tp, _Allocator>::deque(const deque& __c)
__start_(0),
__size_(0, __map_.__alloc())
{
+ __annotate_new(0);
__append(__c.begin(), __c.end());
}
@@ -1003,6 +1412,7 @@ template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(const deque& __c, const __type_identity_t<allocator_type>& __a)
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a)
{
+ __annotate_new(0);
__append(__c.begin(), __c.end());
}
@@ -1024,6 +1434,7 @@ template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il)
: __start_(0), __size_(0, __default_init_tag())
{
+ __annotate_new(0);
__append(__il.begin(), __il.end());
}
@@ -1031,6 +1442,7 @@ template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il, const allocator_type& __a)
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a)
{
+ __annotate_new(0);
__append(__il.begin(), __il.end());
}
@@ -1107,15 +1519,22 @@ template <class _Tp, class _Allocator>
template <class _InputIter>
void
deque<_Tp, _Allocator>::assign(_InputIter __f, _InputIter __l,
- typename enable_if<__is_cpp17_input_iterator<_InputIter>::value &&
- !__is_cpp17_random_access_iterator<_InputIter>::value>::type*)
+ typename enable_if<__has_input_iterator_category<_InputIter>::value &&
+ !__has_random_access_iterator_category<_InputIter>::value>::type*)
{
+ __assign_with_sentinel(__f, __l);
+}
+
+template <class _Tp, class _Allocator>
+template <class _Iterator, class _Sentinel>
+_LIBCPP_HIDE_FROM_ABI
+void deque<_Tp, _Allocator>::__assign_with_sentinel(_Iterator __f, _Sentinel __l) {
iterator __i = begin();
iterator __e = end();
for (; __f != __l && __i != __e; ++__f, (void) ++__i)
*__i = *__f;
if (__f != __l)
- __append(__f, __l);
+ __append_with_sentinel(std::move(__f), std::move(__l));
else
__erase_to_end(__i);
}
@@ -1124,16 +1543,42 @@ template <class _Tp, class _Allocator>
template <class _RAIter>
void
deque<_Tp, _Allocator>::assign(_RAIter __f, _RAIter __l,
- typename enable_if<__is_cpp17_random_access_iterator<_RAIter>::value>::type*)
+ typename enable_if<__has_random_access_iterator_category<_RAIter>::value>::type*)
{
- if (static_cast<size_type>(__l - __f) > size())
+ __assign_with_size_random_access(__f, __l - __f);
+}
+
+template <class _Tp, class _Allocator>
+template <class _RandomAccessIterator>
+_LIBCPP_HIDE_FROM_ABI
+void deque<_Tp, _Allocator>::__assign_with_size_random_access(_RandomAccessIterator __f, difference_type __n) {
+ if (static_cast<size_type>(__n) > size())
{
- _RAIter __m = __f + size();
- _VSTD::copy(__f, __m, begin());
- __append(__m, __l);
+ auto __l = __f + size();
+ std::copy(__f, __l, begin());
+ __append_with_size(__l, __n - size());
}
else
- __erase_to_end(_VSTD::copy(__f, __l, begin()));
+ __erase_to_end(std::copy_n(__f, __n, begin()));
+}
+
+template <class _Tp, class _Allocator>
+template <class _Iterator>
+_LIBCPP_HIDE_FROM_ABI
+void deque<_Tp, _Allocator>::__assign_with_size(_Iterator __f, difference_type __n) {
+ if (static_cast<size_type>(__n) > size()) {
+ auto __added_size = __n - size();
+
+ auto __i = begin();
+ for (auto __count = size(); __count != 0; --__count) {
+ *__i++ = *__f++;
+ }
+
+ __append_with_size(__f, __added_size);
+
+ } else {
+ __erase_to_end(std::copy_n(__f, __n, begin()));
+ }
}
template <class _Tp, class _Allocator>
@@ -1185,6 +1630,7 @@ deque<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
allocator_type& __a = __alloc();
if (empty())
{
+ __annotate_delete();
while (__map_.size() > 0)
{
__alloc_traits::deallocate(__a, __map_.back(), __block_size);
@@ -1284,6 +1730,7 @@ deque<_Tp, _Allocator>::push_back(const value_type& __v)
if (__back_spare() == 0)
__add_back_capacity();
// __back_spare() >= 1
+ __annotate_increase_back(1);
__alloc_traits::construct(__a, _VSTD::addressof(*end()), __v);
++__size();
}
@@ -1296,6 +1743,7 @@ deque<_Tp, _Allocator>::push_front(const value_type& __v)
if (__front_spare() == 0)
__add_front_capacity();
// __front_spare() >= 1
+ __annotate_increase_front(1);
__alloc_traits::construct(__a, _VSTD::addressof(*--begin()), __v);
--__start_;
++__size();
@@ -1310,13 +1758,14 @@ deque<_Tp, _Allocator>::push_back(value_type&& __v)
if (__back_spare() == 0)
__add_back_capacity();
// __back_spare() >= 1
+ __annotate_increase_back(1);
__alloc_traits::construct(__a, _VSTD::addressof(*end()), _VSTD::move(__v));
++__size();
}
template <class _Tp, class _Allocator>
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typename deque<_Tp, _Allocator>::reference
#else
void
@@ -1327,10 +1776,11 @@ deque<_Tp, _Allocator>::emplace_back(_Args&&... __args)
if (__back_spare() == 0)
__add_back_capacity();
// __back_spare() >= 1
+ __annotate_increase_back(1);
__alloc_traits::construct(__a, _VSTD::addressof(*end()),
_VSTD::forward<_Args>(__args)...);
++__size();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return *--end();
#endif
}
@@ -1343,6 +1793,7 @@ deque<_Tp, _Allocator>::push_front(value_type&& __v)
if (__front_spare() == 0)
__add_front_capacity();
// __front_spare() >= 1
+ __annotate_increase_front(1);
__alloc_traits::construct(__a, _VSTD::addressof(*--begin()), _VSTD::move(__v));
--__start_;
++__size();
@@ -1351,7 +1802,7 @@ deque<_Tp, _Allocator>::push_front(value_type&& __v)
template <class _Tp, class _Allocator>
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typename deque<_Tp, _Allocator>::reference
#else
void
@@ -1362,10 +1813,11 @@ deque<_Tp, _Allocator>::emplace_front(_Args&&... __args)
if (__front_spare() == 0)
__add_front_capacity();
// __front_spare() >= 1
+ __annotate_increase_front(1);
__alloc_traits::construct(__a, _VSTD::addressof(*--begin()), _VSTD::forward<_Args>(__args)...);
--__start_;
++__size();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return *begin();
#endif
}
@@ -1382,6 +1834,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
if (__front_spare() == 0)
__add_front_capacity();
// __front_spare() >= 1
+ __annotate_increase_front(1);
if (__pos == 0)
{
__alloc_traits::construct(__a, _VSTD::addressof(*--begin()), _VSTD::move(__v));
@@ -1405,6 +1858,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
if (__back_spare() == 0)
__add_back_capacity();
// __back_capacity >= 1
+ __annotate_increase_back(1);
size_type __de = size() - __pos;
if (__de == 0)
{
@@ -1438,6 +1892,7 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
if (__front_spare() == 0)
__add_front_capacity();
// __front_spare() >= 1
+ __annotate_increase_front(1);
if (__pos == 0)
{
__alloc_traits::construct(__a, _VSTD::addressof(*--begin()), _VSTD::forward<_Args>(__args)...);
@@ -1462,6 +1917,7 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
if (__back_spare() == 0)
__add_back_capacity();
// __back_capacity >= 1
+ __annotate_increase_back(1);
size_type __de = size() - __pos;
if (__de == 0)
{
@@ -1498,6 +1954,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
if (__front_spare() == 0)
__add_front_capacity();
// __front_spare() >= 1
+ __annotate_increase_front(1);
if (__pos == 0)
{
__alloc_traits::construct(__a, _VSTD::addressof(*--begin()), __v);
@@ -1524,6 +1981,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
if (__back_spare() == 0)
__add_back_capacity();
// __back_capacity >= 1
+ __annotate_increase_back(1);
size_type __de = size() - __pos;
if (__de == 0)
{
@@ -1559,6 +2017,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
if (__n > __front_spare())
__add_front_capacity(__n - __front_spare());
// __n <= __front_spare()
+ __annotate_increase_front(__n);
iterator __old_begin = begin();
iterator __i = __old_begin;
if (__n > __pos)
@@ -1583,6 +2042,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
if (__n > __back_capacity)
__add_back_capacity(__n - __back_capacity);
// __n <= __back_capacity
+ __annotate_increase_back(__n);
iterator __old_end = end();
iterator __i = __old_end;
size_type __de = size() - __pos;
@@ -1609,10 +2069,18 @@ template <class _Tp, class _Allocator>
template <class _InputIter>
typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::insert(const_iterator __p, _InputIter __f, _InputIter __l,
- typename enable_if<__is_exactly_cpp17_input_iterator<_InputIter>::value>::type*)
+ typename enable_if<__has_exactly_input_iterator_category<_InputIter>::value>::type*)
{
+ return __insert_with_sentinel(__p, __f, __l);
+}
+
+template <class _Tp, class _Allocator>
+template <class _Iterator, class _Sentinel>
+_LIBCPP_HIDE_FROM_ABI
+typename deque<_Tp, _Allocator>::iterator
+deque<_Tp, _Allocator>::__insert_with_sentinel(const_iterator __p, _Iterator __f, _Sentinel __l) {
__split_buffer<value_type, allocator_type&> __buf(__alloc());
- __buf.__construct_at_end(__f, __l);
+ __buf.__construct_at_end_with_sentinel(std::move(__f), std::move(__l));
typedef typename __split_buffer<value_type, allocator_type&>::iterator __bi;
return insert(__p, move_iterator<__bi>(__buf.begin()), move_iterator<__bi>(__buf.end()));
}
@@ -1621,11 +2089,18 @@ template <class _Tp, class _Allocator>
template <class _ForwardIterator>
typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l,
- typename enable_if<__is_exactly_cpp17_forward_iterator<_ForwardIterator>::value>::type*)
+ typename enable_if<__has_exactly_forward_iterator_category<_ForwardIterator>::value>::type*)
{
- size_type __n = _VSTD::distance(__f, __l);
+ return __insert_with_size(__p, __f, std::distance(__f, __l));
+}
+
+template <class _Tp, class _Allocator>
+template <class _Iterator>
+_LIBCPP_HIDE_FROM_ABI
+typename deque<_Tp, _Allocator>::iterator
+deque<_Tp, _Allocator>::__insert_with_size(const_iterator __p, _Iterator __f, size_type __n) {
__split_buffer<value_type, allocator_type&> __buf(__n, 0, __alloc());
- __buf.__construct_at_end(__f, __l);
+ __buf.__construct_at_end_with_size(__f, __n);
typedef typename __split_buffer<value_type, allocator_type&>::iterator __fwd;
return insert(__p, move_iterator<__fwd>(__buf.begin()), move_iterator<__fwd>(__buf.end()));
}
@@ -1634,9 +2109,24 @@ template <class _Tp, class _Allocator>
template <class _BiIter>
typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
- typename enable_if<__is_cpp17_bidirectional_iterator<_BiIter>::value>::type*)
+ typename enable_if<__has_bidirectional_iterator_category<_BiIter>::value>::type*)
{
- size_type __n = _VSTD::distance(__f, __l);
+ return __insert_bidirectional(__p, __f, __l, std::distance(__f, __l));
+}
+
+template <class _Tp, class _Allocator>
+template <class _BiIter, class _Sentinel>
+_LIBCPP_HIDE_FROM_ABI
+typename deque<_Tp, _Allocator>::iterator
+deque<_Tp, _Allocator>::__insert_bidirectional(const_iterator __p, _BiIter __f, _Sentinel, size_type __n) {
+ return __insert_bidirectional(__p, __f, std::next(__f, __n), __n);
+}
+
+template <class _Tp, class _Allocator>
+template <class _BiIter>
+_LIBCPP_HIDE_FROM_ABI
+typename deque<_Tp, _Allocator>::iterator
+deque<_Tp, _Allocator>::__insert_bidirectional(const_iterator __p, _BiIter __f, _BiIter __l, size_type __n) {
size_type __pos = __p - begin();
size_type __to_end = size() - __pos;
allocator_type& __a = __alloc();
@@ -1645,6 +2135,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
if (__n > __front_spare())
__add_front_capacity(__n - __front_spare());
// __n <= __front_spare()
+ __annotate_increase_front(__n);
iterator __old_begin = begin();
iterator __i = __old_begin;
_BiIter __m = __f;
@@ -1675,6 +2166,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
if (__n > __back_capacity)
__add_back_capacity(__n - __back_capacity);
// __n <= __back_capacity
+ __annotate_increase_back(__n);
iterator __old_end = end();
iterator __i = __old_end;
_BiIter __m = __l;
@@ -1703,8 +2195,15 @@ template <class _Tp, class _Allocator>
template <class _InpIter>
void
deque<_Tp, _Allocator>::__append(_InpIter __f, _InpIter __l,
- typename enable_if<__is_exactly_cpp17_input_iterator<_InpIter>::value>::type*)
+ typename enable_if<__has_exactly_input_iterator_category<_InpIter>::value>::type*)
{
+ __append_with_sentinel(__f, __l);
+}
+
+template <class _Tp, class _Allocator>
+template <class _InputIterator, class _Sentinel>
+_LIBCPP_HIDE_FROM_ABI
+void deque<_Tp, _Allocator>::__append_with_sentinel(_InputIterator __f, _Sentinel __l) {
for (; __f != __l; ++__f)
#ifdef _LIBCPP_CXX03_LANG
push_back(*__f);
@@ -1717,14 +2216,22 @@ template <class _Tp, class _Allocator>
template <class _ForIter>
void
deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l,
- typename enable_if<__is_cpp17_forward_iterator<_ForIter>::value>::type*)
+ typename enable_if<__has_forward_iterator_category<_ForIter>::value>::type*)
{
- size_type __n = _VSTD::distance(__f, __l);
+ __append_with_size(__f, std::distance(__f, __l));
+}
+
+template <class _Tp, class _Allocator>
+template <class _InputIterator>
+_LIBCPP_HIDE_FROM_ABI
+void deque<_Tp, _Allocator>::__append_with_size(_InputIterator __f, size_type __n) {
allocator_type& __a = __alloc();
size_type __back_capacity = __back_spare();
if (__n > __back_capacity)
__add_back_capacity(__n - __back_capacity);
+
// __n <= __back_capacity
+ __annotate_increase_back(__n);
for (__deque_block_range __br : __deque_range(end(), end() + __n)) {
_ConstructTransaction __tx(this, __br);
for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, (void)++__f) {
@@ -1742,6 +2249,7 @@ deque<_Tp, _Allocator>::__append(size_type __n)
if (__n > __back_capacity)
__add_back_capacity(__n - __back_capacity);
// __n <= __back_capacity
+ __annotate_increase_back(__n);
for (__deque_block_range __br : __deque_range(end(), end() + __n)) {
_ConstructTransaction __tx(this, __br);
for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
@@ -1759,6 +2267,7 @@ deque<_Tp, _Allocator>::__append(size_type __n, const value_type& __v)
if (__n > __back_capacity)
__add_back_capacity(__n - __back_capacity);
// __n <= __back_capacity
+ __annotate_increase_back(__n);
for (__deque_block_range __br : __deque_range(end(), end() + __n)) {
_ConstructTransaction __tx(this, __br);
for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
@@ -1826,6 +2335,7 @@ deque<_Tp, _Allocator>::__add_front_capacity()
__block_size / 2 :
__start_ + __block_size;
}
+ __annotate_whole_block(0, __asan_poison);
}
// Create front capacity for __n elements.
@@ -1861,6 +2371,7 @@ deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
if (__map_.__front_spare() == 0)
break;
__map_.push_front(__alloc_traits::allocate(__a, __block_size));
+ __annotate_whole_block(0, __asan_poison);
}
for (; __nb > 0; --__nb, ++__back_capacity)
__map_.push_back(__alloc_traits::allocate(__a, __block_size));
@@ -1871,6 +2382,7 @@ deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
pointer __pt = __map_.back();
__map_.pop_back();
__map_.push_front(__pt);
+ __annotate_whole_block(0, __asan_poison);
}
}
// Else need to allocate __nb buffers, *and* we need to reallocate __map_.
@@ -1881,22 +2393,28 @@ deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
__buf(std::max<size_type>(2* __map_.capacity(),
__nb + __map_.size()),
0, __map_.__alloc());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
- for (; __nb > 0; --__nb)
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ for (; __nb > 0; --__nb) {
__buf.push_back(__alloc_traits::allocate(__a, __block_size));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+ // ASan: this is empty container, we have to poison whole block
+ __annotate_poison_block(
+ std::__to_address(__buf.back()),
+ std::__to_address(__buf.back() + __block_size));
+ }
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
+ __annotate_delete();
for (__map_pointer __i = __buf.begin();
__i != __buf.end(); ++__i)
__alloc_traits::deallocate(__a, *__i, __block_size);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __back_capacity > 0; --__back_capacity)
{
__buf.push_back(__map_.back());
@@ -1942,6 +2460,7 @@ deque<_Tp, _Allocator>::__add_back_capacity()
__map_.pop_front();
__map_.push_back(__pt);
}
+ __annotate_whole_block(__map_.size() - 1, __asan_poison);
}
// Else need to allocate 1 buffer, *and* we need to reallocate __map_.
else
@@ -1965,6 +2484,7 @@ deque<_Tp, _Allocator>::__add_back_capacity()
_VSTD::swap(__map_.__begin_, __buf.__begin_);
_VSTD::swap(__map_.__end_, __buf.__end_);
_VSTD::swap(__map_.__end_cap(), __buf.__end_cap());
+ __annotate_whole_block(__map_.size() - 1, __asan_poison);
}
}
@@ -2001,10 +2521,13 @@ deque<_Tp, _Allocator>::__add_back_capacity(size_type __n)
if (__map_.__back_spare() == 0)
break;
__map_.push_back(__alloc_traits::allocate(__a, __block_size));
+ __annotate_whole_block(__map_.size() - 1, __asan_poison);
}
for (; __nb > 0; --__nb, ++__front_capacity, __start_ +=
- __block_size - (__map_.size() == 1))
+ __block_size - (__map_.size() == 1)) {
__map_.push_front(__alloc_traits::allocate(__a, __block_size));
+ __annotate_whole_block(0, __asan_poison);
+ }
// Done allocating, reorder capacity
__start_ -= __block_size * __front_capacity;
for (; __front_capacity > 0; --__front_capacity)
@@ -2023,22 +2546,28 @@ deque<_Tp, _Allocator>::__add_back_capacity(size_type __n)
__nb + __map_.size()),
__map_.size() - __front_capacity,
__map_.__alloc());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
- for (; __nb > 0; --__nb)
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ for (; __nb > 0; --__nb) {
__buf.push_back(__alloc_traits::allocate(__a, __block_size));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+ // ASan: this is an empty container, we have to poison the whole block
+ __annotate_poison_block(
+ std::__to_address(__buf.back()),
+ std::__to_address(__buf.back() + __block_size));
+ }
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
+ __annotate_delete();
for (__map_pointer __i = __buf.begin();
__i != __buf.end(); ++__i)
__alloc_traits::deallocate(__a, *__i, __block_size);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __front_capacity > 0; --__front_capacity)
{
__buf.push_back(__map_.front());
@@ -2059,12 +2588,15 @@ template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::pop_front()
{
+ size_type __old_sz = size();
+ size_type __old_start = __start_;
allocator_type& __a = __alloc();
__alloc_traits::destroy(__a, _VSTD::__to_address(*(__map_.begin() +
__start_ / __block_size) +
__start_ % __block_size));
--__size();
++__start_;
+ __annotate_shrink_front(__old_sz, __old_start);
__maybe_remove_front_spare();
}
@@ -2072,13 +2604,16 @@ template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::pop_back()
{
- _LIBCPP_ASSERT(!empty(), "deque::pop_back called on an empty deque");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "deque::pop_back called on an empty deque");
+ size_type __old_sz = size();
+ size_type __old_start = __start_;
allocator_type& __a = __alloc();
size_type __p = size() + __start_ - 1;
__alloc_traits::destroy(__a, _VSTD::__to_address(*(__map_.begin() +
__p / __block_size) +
__p % __block_size));
--__size();
+ __annotate_shrink_back(__old_sz, __old_start);
__maybe_remove_back_spare();
}
@@ -2218,6 +2753,8 @@ template <class _Tp, class _Allocator>
typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::erase(const_iterator __f)
{
+ size_type __old_sz = size();
+ size_type __old_start = __start_;
iterator __b = begin();
difference_type __pos = __f - __b;
iterator __p = __b + __pos;
@@ -2228,6 +2765,7 @@ deque<_Tp, _Allocator>::erase(const_iterator __f)
__alloc_traits::destroy(__a, _VSTD::addressof(*__b));
--__size();
++__start_;
+ __annotate_shrink_front(__old_sz, __old_start);
__maybe_remove_front_spare();
}
else
@@ -2235,6 +2773,7 @@ deque<_Tp, _Allocator>::erase(const_iterator __f)
iterator __i = _VSTD::move(_VSTD::next(__p), end(), __p);
__alloc_traits::destroy(__a, _VSTD::addressof(*__i));
--__size();
+ __annotate_shrink_back(__old_sz, __old_start);
__maybe_remove_back_spare();
}
return begin() + __pos;
@@ -2244,6 +2783,8 @@ template <class _Tp, class _Allocator>
typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::erase(const_iterator __f, const_iterator __l)
{
+ size_type __old_sz = size();
+ size_type __old_start = __start_;
difference_type __n = __l - __f;
iterator __b = begin();
difference_type __pos = __f - __b;
@@ -2258,6 +2799,7 @@ deque<_Tp, _Allocator>::erase(const_iterator __f, const_iterator __l)
__alloc_traits::destroy(__a, _VSTD::addressof(*__b));
__size() -= __n;
__start_ += __n;
+ __annotate_shrink_front(__old_sz, __old_start);
while (__maybe_remove_front_spare()) {
}
}
@@ -2267,6 +2809,7 @@ deque<_Tp, _Allocator>::erase(const_iterator __f, const_iterator __l)
for (iterator __e = end(); __i != __e; ++__i)
__alloc_traits::destroy(__a, _VSTD::addressof(*__i));
__size() -= __n;
+ __annotate_shrink_back(__old_sz, __old_start);
while (__maybe_remove_back_spare()) {
}
}
@@ -2278,6 +2821,8 @@ template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::__erase_to_end(const_iterator __f)
{
+ size_type __old_sz = size();
+ size_type __old_start = __start_;
iterator __e = end();
difference_type __n = __e - __f;
if (__n > 0)
@@ -2288,6 +2833,7 @@ deque<_Tp, _Allocator>::__erase_to_end(const_iterator __f)
for (iterator __p = __b + __pos; __p != __e; ++__p)
__alloc_traits::destroy(__a, _VSTD::addressof(*__p));
__size() -= __n;
+ __annotate_shrink_back(__old_sz, __old_start);
while (__maybe_remove_back_spare()) {
}
}
@@ -2316,6 +2862,7 @@ inline
void
deque<_Tp, _Allocator>::clear() _NOEXCEPT
{
+ __annotate_delete();
allocator_type& __a = __alloc();
for (iterator __i = begin(), __e = end(); __i != __e; ++__i)
__alloc_traits::destroy(__a, _VSTD::addressof(*__i));
@@ -2334,6 +2881,7 @@ deque<_Tp, _Allocator>::clear() _NOEXCEPT
__start_ = __block_size;
break;
}
+ __annotate_new(0);
}
template <class _Tp, class _Allocator>
@@ -2345,6 +2893,8 @@ operator==(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
return __sz == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI
bool
@@ -2385,6 +2935,17 @@ operator<=(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
return !(__y < __x);
}
+#else // _LIBCPP_STD_VER <= 17
+
+template <class _Tp, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp>
+operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) {
+ return std::lexicographical_compare_three_way(
+ __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>);
+}
+
+#endif // _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI
void
@@ -2394,7 +2955,7 @@ swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y)
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, class _Allocator, class _Up>
inline _LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::size_type
erase(deque<_Tp, _Allocator>& __c, const _Up& __v) {
@@ -2418,15 +2979,15 @@ template <>
inline constexpr bool __format::__enable_insertable<std::deque<wchar_t>> = true;
#endif
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueT>
-using deque = std::deque<_ValueT, polymorphic_allocator<_ValueT>>;
+using deque _LIBCPP_AVAILABILITY_PMR = std::deque<_ValueT, polymorphic_allocator<_ValueT>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
@@ -2437,9 +2998,11 @@ _LIBCPP_POP_MACROS
# include <algorithm>
# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iosfwd>
# include <iterator>
+# include <type_traits>
# include <typeinfo>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/exception b/contrib/libs/cxxsupp/libcxx/include/exception
index d63bb8f8583..97fee977690 100644
--- a/contrib/libs/cxxsupp/libcxx/include/exception
+++ b/contrib/libs/cxxsupp/libcxx/include/exception
@@ -77,286 +77,20 @@ template <class E> void rethrow_if_nested(const E& e);
*/
#include <__assert> // all public C++ headers provide the assertion handler
-#include <__availability>
#include <__config>
-#include <__memory/addressof.h>
-#include <__type_traits/decay.h>
-#include <__type_traits/is_base_of.h>
-#include <__type_traits/is_class.h>
-#include <__type_traits/is_convertible.h>
-#include <__type_traits/is_copy_constructible.h>
-#include <__type_traits/is_final.h>
-#include <__type_traits/is_polymorphic.h>
-#include <cstddef>
-#include <cstdlib>
+#include <__exception/exception.h>
+#include <__exception/exception_ptr.h>
+#include <__exception/nested_exception.h>
+#include <__exception/operations.h>
+#include <__exception/terminate.h>
#include <version>
-// <vcruntime_exception.h> defines its own std::exception and std::bad_exception types,
-// which we use in order to be ABI-compatible with other STLs on Windows.
-#if defined(_LIBCPP_ABI_VCRUNTIME)
-# include <vcruntime_exception.h>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-namespace std // purposefully not using versioning namespace
-{
-
-#if defined(_LIBCPP_ABI_VCRUNTIME) && (!defined(_HAS_EXCEPTIONS) || _HAS_EXCEPTIONS != 0)
-// The std::exception class was already included above, but we're explicit about this condition here for clarity.
-
-#elif defined(_LIBCPP_ABI_VCRUNTIME) && _HAS_EXCEPTIONS == 0
-// However, <vcruntime_exception.h> does not define std::exception and std::bad_exception
-// when _HAS_EXCEPTIONS == 0.
-//
-// Since libc++ still wants to provide the std::exception hierarchy even when _HAS_EXCEPTIONS == 0
-// (after all those are simply types like any other), we define an ABI-compatible version
-// of the VCRuntime std::exception and std::bad_exception types in that mode.
-
-struct __std_exception_data {
- char const* _What;
- bool _DoFree;
-};
-
-class exception { // base of all library exceptions
-public:
- exception() _NOEXCEPT : __data_() {}
-
- explicit exception(char const* __message) _NOEXCEPT : __data_() {
- __data_._What = __message;
- __data_._DoFree = true;
- }
-
- exception(exception const&) _NOEXCEPT {}
-
- exception& operator=(exception const&) _NOEXCEPT { return *this; }
-
- virtual ~exception() _NOEXCEPT {}
-
- virtual char const* what() const _NOEXCEPT { return __data_._What ? __data_._What : "Unknown exception"; }
-
-private:
- __std_exception_data __data_;
-};
-
-class bad_exception : public exception {
-public:
- bad_exception() _NOEXCEPT : exception("bad exception") {}
-};
-
-#else // !defined(_LIBCPP_ABI_VCRUNTIME)
-// On all other platforms, we define our own std::exception and std::bad_exception types
-// regardless of whether exceptions are turned on as a language feature.
-
-class _LIBCPP_EXCEPTION_ABI exception {
-public:
- _LIBCPP_INLINE_VISIBILITY exception() _NOEXCEPT {}
- _LIBCPP_INLINE_VISIBILITY exception(const exception&) _NOEXCEPT = default;
-
- virtual ~exception() _NOEXCEPT;
- virtual const char* what() const _NOEXCEPT;
-};
-
-class _LIBCPP_EXCEPTION_ABI bad_exception : public exception {
-public:
- _LIBCPP_INLINE_VISIBILITY bad_exception() _NOEXCEPT {}
- ~bad_exception() _NOEXCEPT override;
- const char* what() const _NOEXCEPT override;
-};
-#endif // !_LIBCPP_ABI_VCRUNTIME
-
-#if _LIBCPP_STD_VER <= 14 \
- || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) \
- || defined(_LIBCPP_BUILDING_LIBRARY)
-typedef void (*unexpected_handler)();
-_LIBCPP_FUNC_VIS unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
-_LIBCPP_FUNC_VIS unexpected_handler get_unexpected() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void unexpected();
-#endif
-
-typedef void (*terminate_handler)();
-_LIBCPP_FUNC_VIS terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
-_LIBCPP_FUNC_VIS terminate_handler get_terminate() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void terminate() _NOEXCEPT;
-
-_LIBCPP_FUNC_VIS bool uncaught_exception() _NOEXCEPT;
-_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS int uncaught_exceptions() _NOEXCEPT;
-
-class _LIBCPP_TYPE_VIS exception_ptr;
-
-_LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
-
-class _LIBCPP_TYPE_VIS exception_ptr
-{
- void* __ptr_;
-public:
- _LIBCPP_INLINE_VISIBILITY exception_ptr() _NOEXCEPT : __ptr_() {}
- _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
-
- exception_ptr(const exception_ptr&) _NOEXCEPT;
- exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
- ~exception_ptr() _NOEXCEPT;
-
- _LIBCPP_INLINE_VISIBILITY explicit operator bool() const _NOEXCEPT
- {return __ptr_ != nullptr;}
-
- friend _LIBCPP_INLINE_VISIBILITY
- bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
- {return __x.__ptr_ == __y.__ptr_;}
-
- friend _LIBCPP_INLINE_VISIBILITY
- bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
- {return !(__x == __y);}
-
- friend _LIBCPP_FUNC_VIS void swap(exception_ptr& __x, exception_ptr& __y) _NOEXCEPT
- {
- void* __tmp = __x.__ptr_;
- __x.__ptr_ = __y.__ptr_;
- __y.__ptr_ = __tmp;
- }
-
- friend _LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
- friend _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
-};
-
-#ifndef _LIBCPP_ABI_MICROSOFT
-
-template<class _Ep>
-_LIBCPP_INLINE_VISIBILITY exception_ptr
-make_exception_ptr(_Ep __e) _NOEXCEPT
-{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try
- {
- throw __e;
- }
- catch (...)
- {
- return current_exception();
- }
-#else
- ((void)__e);
- _VSTD::abort();
-#endif
-}
-
-#else // _LIBCPP_ABI_MICROSOFT
-
-_LIBCPP_FUNC_VIS exception_ptr __copy_exception_ptr(void *__exception, const void* __ptr);
-
-// This is a built-in template function which automagically extracts the required
-// information.
-template <class _E> void *__GetExceptionInfo(_E);
-
-template<class _Ep>
-exception_ptr
-make_exception_ptr(_Ep __e) _NOEXCEPT
-{
- return __copy_exception_ptr(_VSTD::addressof(__e), __GetExceptionInfo(__e));
-}
-
-#endif // _LIBCPP_ABI_MICROSOFT
-// nested_exception
-
-class _LIBCPP_EXCEPTION_ABI nested_exception
-{
- exception_ptr __ptr_;
-public:
- nested_exception() _NOEXCEPT;
-// nested_exception(const nested_exception&) noexcept = default;
-// nested_exception& operator=(const nested_exception&) noexcept = default;
- virtual ~nested_exception() _NOEXCEPT;
-
- // access functions
- _LIBCPP_NORETURN void rethrow_nested() const;
- _LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const _NOEXCEPT {return __ptr_;}
-};
-
-template <class _Tp>
-struct __nested
- : public _Tp,
- public nested_exception
-{
- _LIBCPP_INLINE_VISIBILITY explicit __nested(const _Tp& __t) : _Tp(__t) {}
-};
-
-#ifndef _LIBCPP_NO_EXCEPTIONS
-template <class _Tp, class _Up, bool>
-struct __throw_with_nested;
-
-template <class _Tp, class _Up>
-struct __throw_with_nested<_Tp, _Up, true> {
- _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void
- __do_throw(_Tp&& __t)
- {
- throw __nested<_Up>(static_cast<_Tp&&>(__t));
- }
-};
-
-template <class _Tp, class _Up>
-struct __throw_with_nested<_Tp, _Up, false> {
- _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void
-#ifndef _LIBCPP_CXX03_LANG
- __do_throw(_Tp&& __t)
-#else
- __do_throw (_Tp& __t)
-#endif // _LIBCPP_CXX03_LANG
- {
- throw static_cast<_Tp&&>(__t);
- }
-};
-#endif
-
-template <class _Tp>
-_LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI
-void
-throw_with_nested(_Tp&& __t)
-{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- typedef typename decay<_Tp>::type _Up;
- static_assert( is_copy_constructible<_Up>::value, "type thrown must be CopyConstructible");
- __throw_with_nested<_Tp, _Up,
- is_class<_Up>::value &&
- !is_base_of<nested_exception, _Up>::value &&
- !__libcpp_is_final<_Up>::value>::
- __do_throw(static_cast<_Tp&&>(__t));
-#else
- ((void)__t);
- // FIXME: Make this abort
-#endif
-}
-
-template <class _From, class _To>
-struct __can_dynamic_cast : _BoolConstant<
- is_polymorphic<_From>::value &&
- (!is_base_of<_To, _From>::value ||
- is_convertible<const _From*, const _To*>::value)> {};
-
-template <class _Ep>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-rethrow_if_nested(const _Ep& __e,
- __enable_if_t< __can_dynamic_cast<_Ep, nested_exception>::value>* = 0)
-{
- const nested_exception* __nep = dynamic_cast<const nested_exception*>(_VSTD::addressof(__e));
- if (__nep)
- __nep->rethrow_nested();
-}
-
-template <class _Ep>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-rethrow_if_nested(const _Ep&,
- __enable_if_t<!__can_dynamic_cast<_Ep, nested_exception>::value>* = 0)
-{
-}
-
-} // namespace std
-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdlib>
# include <type_traits>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/execution b/contrib/libs/cxxsupp/libcxx/include/execution
new file mode 100644
index 00000000000..56facc87379
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/execution
@@ -0,0 +1,146 @@
+// -*- 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_EXECUTION
+#define _LIBCPP_EXECUTION
+
+/*
+namespace std::execution {
+ struct sequenced_policy;
+ struct parallel_policy;
+ struct parallel_unsequenced_policy;
+ struct unsequenced_policy; // since C++20
+
+ inline constexpr sequenced_policy seq = implementation-defined;
+ inline constexpr parallel_policy par = implementation-defined;
+ inline constexpr parallel_unsequenced_policy par_unseq = implementation-defined;
+ inline constexpr unsequenced_policy unseq = implementation-defined; // since C++20
+}
+
+namespace std {
+ template <class T>
+ struct is_execution_policy;
+
+ template <class T>
+ inline constexpr bool is_execution_policy_v;
+}
+*/
+
+#include <__assert> // all public C++ headers provide the assertion handler
+#include <__config>
+#include <__type_traits/is_execution_policy.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/remove_cvref.h>
+#include <version>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace execution {
+struct sequenced_policy {
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit sequenced_policy(__disable_user_instantiations_tag) {}
+ sequenced_policy(const sequenced_policy&) = delete;
+ sequenced_policy& operator=(const sequenced_policy&) = delete;
+};
+
+inline constexpr sequenced_policy seq{__disable_user_instantiations_tag{}};
+
+struct parallel_policy {
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit parallel_policy(__disable_user_instantiations_tag) {}
+ parallel_policy(const parallel_policy&) = delete;
+ parallel_policy& operator=(const parallel_policy&) = delete;
+};
+
+inline constexpr parallel_policy par{__disable_user_instantiations_tag{}};
+
+struct parallel_unsequenced_policy {
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit parallel_unsequenced_policy(__disable_user_instantiations_tag) {}
+ parallel_unsequenced_policy(const parallel_unsequenced_policy&) = delete;
+ parallel_unsequenced_policy& operator=(const parallel_unsequenced_policy&) = delete;
+};
+
+inline constexpr parallel_unsequenced_policy par_unseq{__disable_user_instantiations_tag{}};
+
+struct __unsequenced_policy {
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __unsequenced_policy(__disable_user_instantiations_tag) {}
+ __unsequenced_policy(const __unsequenced_policy&) = delete;
+ __unsequenced_policy& operator=(const __unsequenced_policy&) = delete;
+};
+
+constexpr __unsequenced_policy __unseq{__disable_user_instantiations_tag{}};
+
+# if _LIBCPP_STD_VER >= 20
+
+struct unsequenced_policy {
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit unsequenced_policy(__disable_user_instantiations_tag) {}
+ unsequenced_policy(const unsequenced_policy&) = delete;
+ unsequenced_policy& operator=(const unsequenced_policy&) = delete;
+};
+
+inline constexpr unsequenced_policy unseq{__disable_user_instantiations_tag{}};
+
+# endif // _LIBCPP_STD_VER >= 20
+
+} // namespace execution
+
+template <>
+inline constexpr bool is_execution_policy_v<execution::sequenced_policy> = true;
+
+template <>
+inline constexpr bool is_execution_policy_v<execution::parallel_policy> = true;
+
+template <>
+inline constexpr bool is_execution_policy_v<execution::parallel_unsequenced_policy> = true;
+
+template <>
+inline constexpr bool is_execution_policy_v<execution::__unsequenced_policy> = true;
+
+template <>
+inline constexpr bool __is_parallel_execution_policy_impl<execution::parallel_policy> = true;
+
+template <>
+inline constexpr bool __is_parallel_execution_policy_impl<execution::parallel_unsequenced_policy> = true;
+
+template <>
+inline constexpr bool __is_unsequenced_execution_policy_impl<execution::__unsequenced_policy> = true;
+
+template <>
+inline constexpr bool __is_unsequenced_execution_policy_impl<execution::parallel_unsequenced_policy> = true;
+
+# if _LIBCPP_STD_VER >= 20
+template <>
+inline constexpr bool is_execution_policy_v<execution::unsequenced_policy> = true;
+
+template <>
+inline constexpr bool __is_unsequenced_execution_policy_impl<execution::unsequenced_policy> = true;
+
+# endif
+
+template <class _Tp>
+struct is_execution_policy : bool_constant<is_execution_policy_v<_Tp>> {};
+
+template <class _ExecutionPolicy>
+_LIBCPP_HIDE_FROM_ABI auto __remove_parallel_policy(const _ExecutionPolicy&) {
+ if constexpr (is_same_v<_ExecutionPolicy, execution::parallel_policy>) {
+ return execution::sequenced_policy(execution::__disable_user_instantiations_tag{});
+ } else if constexpr (is_same_v<_ExecutionPolicy, execution::parallel_unsequenced_policy>) {
+ return execution::__unsequenced_policy{execution::__disable_user_instantiations_tag{}};
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
+
+#endif // _LIBCPP_EXECUTION
diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/__config b/contrib/libs/cxxsupp/libcxx/include/experimental/__config
index a71b348c049..839b80aa639 100644
--- a/contrib/libs/cxxsupp/libcxx/include/experimental/__config
+++ b/contrib/libs/cxxsupp/libcxx/include/experimental/__config
@@ -32,18 +32,6 @@
#define _LIBCPP_END_NAMESPACE_LFTS_PMR _LIBCPP_END_NAMESPACE_LFTS }
#define _VSTD_LFTS_PMR _VSTD_LFTS::pmr
-#if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L
-#define _LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES
-#endif
-
-#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES \
- _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace coroutines_v1 {
-
-#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES \
- } _LIBCPP_END_NAMESPACE_EXPERIMENTAL
-
-#define _VSTD_CORO _VSTD_EXPERIMENTAL::coroutines_v1
-
#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD \
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace parallelism_v2 {
diff --git a/contrib/libs/cxxsupp/libcxx/include/filesystem b/contrib/libs/cxxsupp/libcxx/include/filesystem
index 7efa4ed2b39..99ba713ad07 100644
--- a/contrib/libs/cxxsupp/libcxx/include/filesystem
+++ b/contrib/libs/cxxsupp/libcxx/include/filesystem
@@ -159,6 +159,9 @@
void swap(path& lhs, path& rhs) noexcept;
size_t hash_value(const path& p) noexcept;
+ // [fs.path.hash], hash support
+ template<> struct hash<filesystem::path>;
+
template <class Source>
path u8path(const Source& source);
template <class InputIterator>
@@ -233,19 +236,120 @@
friend class directory_iterator; // exposition only
};
- class directory_iterator;
+ class directory_iterator {
+ public:
+ using iterator_category = input_iterator_tag;
+ using value_type = directory_entry;
+ using difference_type = ptrdiff_t;
+ using pointer = const directory_entry*;
+ using reference = const directory_entry&;
+
+ // [fs.dir.itr.members], member functions
+ directory_iterator() noexcept;
+ explicit directory_iterator(const path& p);
+ directory_iterator(const path& p, directory_options options);
+ directory_iterator(const path& p, error_code& ec);
+ directory_iterator(const path& p, directory_options options,
+ error_code& ec);
+ directory_iterator(const directory_iterator& rhs);
+ directory_iterator(directory_iterator&& rhs) noexcept;
+ ~directory_iterator();
+
+ directory_iterator& operator=(const directory_iterator& rhs);
+ directory_iterator& operator=(directory_iterator&& rhs) noexcept;
+
+ const directory_entry& operator*() const;
+ const directory_entry* operator->() const;
+ directory_iterator& operator++();
+ directory_iterator& increment(error_code& ec);
+
+ bool operator==(default_sentinel_t) const noexcept { // since C++20
+ return *this == directory_iterator();
+ }
+
+ // other members as required by [input.iterators], input iterators
+ };
// enable directory_iterator range-based for statements
directory_iterator begin(directory_iterator iter) noexcept;
directory_iterator end(directory_iterator) noexcept;
- class recursive_directory_iterator;
+class recursive_directory_iterator {
+ public:
+ using iterator_category = input_iterator_tag;
+ using value_type = directory_entry;
+ using difference_type = ptrdiff_t;
+ using pointer = const directory_entry*;
+ using reference = const directory_entry&;
+
+ // [fs.rec.dir.itr.members], constructors and destructor
+ recursive_directory_iterator() noexcept;
+ explicit recursive_directory_iterator(const path& p);
+ recursive_directory_iterator(const path& p, directory_options options);
+ recursive_directory_iterator(const path& p, directory_options options,
+ error_code& ec);
+ recursive_directory_iterator(const path& p, error_code& ec);
+ recursive_directory_iterator(const recursive_directory_iterator& rhs);
+ recursive_directory_iterator(recursive_directory_iterator&& rhs) noexcept;
+ ~recursive_directory_iterator();
+
+ // [fs.rec.dir.itr.members], observers
+ directory_options options() const;
+ int depth() const;
+ bool recursion_pending() const;
+
+ const directory_entry& operator*() const;
+ const directory_entry* operator->() const;
+
+ // [fs.rec.dir.itr.members], modifiers
+ recursive_directory_iterator&
+ operator=(const recursive_directory_iterator& rhs);
+ recursive_directory_iterator&
+ operator=(recursive_directory_iterator&& rhs) noexcept;
+
+ recursive_directory_iterator& operator++();
+ recursive_directory_iterator& increment(error_code& ec);
+
+ void pop();
+ void pop(error_code& ec);
+ void disable_recursion_pending();
+
+ bool operator==(default_sentinel_t) const noexcept { // since C++20
+ return *this == recursive_directory_iterator();
+ }
+
+ // other members as required by [input.iterators], input iterators
+ };
// enable recursive_directory_iterator range-based for statements
recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept;
recursive_directory_iterator end(recursive_directory_iterator) noexcept;
- class file_status;
+ class file_status {
+ public:
+ // [fs.file.status.cons], constructors and destructor
+ file_status() noexcept : file_status(file_type::none) {}
+ explicit file_status(file_type ft,
+ perms prms = perms::unknown) noexcept;
+ file_status(const file_status&) noexcept = default;
+ file_status(file_status&&) noexcept = default;
+ ~file_status();
+
+ // assignments
+ file_status& operator=(const file_status&) noexcept = default;
+ file_status& operator=(file_status&&) noexcept = default;
+
+ // [fs.file.status.mods], modifiers
+ void type(file_type ft) noexcept;
+ void permissions(perms prms) noexcept;
+
+ // [fs.file.status.obs], observers
+ file_type type() const noexcept;
+ perms permissions() const noexcept;
+
+ friend bool operator==(const file_status& lhs, const file_status& rhs) noexcept
+ { return lhs.type() == rhs.type() && lhs.permissions() == rhs.permissions(); } // C++20
+ };
struct space_info
{
@@ -454,16 +558,14 @@ inline constexpr bool std::ranges::enable_view<std::filesystem::recursive_direct
// [fs.filesystem.syn]
#include <compare>
-#if defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
-# error "The <filesystem> library is not supported since libc++ has been configured without support for a filesystem."
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
+# include <system_error>
#endif
#endif // _LIBCPP_FILESYSTEM
diff --git a/contrib/libs/cxxsupp/libcxx/include/format b/contrib/libs/cxxsupp/libcxx/include/format
index 2c583c1065b..c48bcf6e840 100644
--- a/contrib/libs/cxxsupp/libcxx/include/format
+++ b/contrib/libs/cxxsupp/libcxx/include/format
@@ -170,11 +170,6 @@ namespace std {
*/
#include <__assert> // all public C++ headers provide the assertion handler
-// Make sure all feature-test macros are available.
-#include <version>
-// Enable the contents of the header only when libc++ was built with experimental features enabled.
-#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
-
#include <__config>
#include <__format/buffer.h>
#include <__format/concepts.h>
@@ -202,11 +197,10 @@ namespace std {
#include <__format/range_default_formatter.h>
#include <__format/range_formatter.h>
#include <__format/unicode.h>
+#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
-
#endif // _LIBCPP_FORMAT
diff --git a/contrib/libs/cxxsupp/libcxx/include/forward_list b/contrib/libs/cxxsupp/libcxx/include/forward_list
index 61dde8167df..6cb794070b7 100644
--- a/contrib/libs/cxxsupp/libcxx/include/forward_list
+++ b/contrib/libs/cxxsupp/libcxx/include/forward_list
@@ -44,6 +44,8 @@ public:
forward_list(InputIterator first, InputIterator last);
template <class InputIterator>
forward_list(InputIterator first, InputIterator last, const allocator_type& a);
+ template<container-compatible-range<T> R>
+ forward_list(from_range_t, R&& rg, const Allocator& = Allocator()); // C++23
forward_list(const forward_list& x);
forward_list(const forward_list& x, const allocator_type& a);
forward_list(forward_list&& x)
@@ -63,6 +65,8 @@ public:
template <class InputIterator>
void assign(InputIterator first, InputIterator last);
+ template<container-compatible-range<T> R>
+ void assign_range(R&& rg); // C++23
void assign(size_type n, const value_type& v);
void assign(initializer_list<value_type> il);
@@ -89,6 +93,8 @@ public:
template <class... Args> reference emplace_front(Args&&... args); // reference in C++17
void push_front(const value_type& v);
void push_front(value_type&& v);
+ template<container-compatible-range<T> R>
+ void prepend_range(R&& rg); // C++23
void pop_front();
@@ -100,6 +106,8 @@ public:
template <class InputIterator>
iterator insert_after(const_iterator p,
InputIterator first, InputIterator last);
+ template<container-compatible-range<T> R>
+ iterator insert_range_after(const_iterator position, R&& rg); // C++23
iterator insert_after(const_iterator p, initializer_list<value_type> il);
iterator erase_after(const_iterator p);
@@ -140,29 +148,37 @@ template <class InputIterator, class Allocator = allocator<typename iterator_tra
forward_list(InputIterator, InputIterator, Allocator = Allocator())
-> forward_list<typename iterator_traits<InputIterator>::value_type, Allocator>; // C++17
+template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
+ forward_list(from_range_t, R&&, Allocator = Allocator())
+ -> forward_list<ranges::range_value_t<R>, Allocator>; // C++23
+
template <class T, class Allocator>
bool operator==(const forward_list<T, Allocator>& x,
const forward_list<T, Allocator>& y);
template <class T, class Allocator>
bool operator< (const forward_list<T, Allocator>& x,
- const forward_list<T, Allocator>& y);
+ const forward_list<T, Allocator>& y); // removed in C++20
template <class T, class Allocator>
bool operator!=(const forward_list<T, Allocator>& x,
- const forward_list<T, Allocator>& y);
+ const forward_list<T, Allocator>& y); // removed in C++20
template <class T, class Allocator>
bool operator> (const forward_list<T, Allocator>& x,
- const forward_list<T, Allocator>& y);
+ const forward_list<T, Allocator>& y); // removed in C++20
template <class T, class Allocator>
bool operator>=(const forward_list<T, Allocator>& x,
- const forward_list<T, Allocator>& y);
+ const forward_list<T, Allocator>& y); // removed in C++20
template <class T, class Allocator>
bool operator<=(const forward_list<T, Allocator>& x,
- const forward_list<T, Allocator>& y);
+ const forward_list<T, Allocator>& y); // removed in C++20
+
+template<class T, class Allocator>
+ synth-three-way-result<T> operator<=>(const forward_list<T, Allocator>& x,
+ const forward_list<T, Allocator>& y); // since C++20
template <class T, class Allocator>
void swap(forward_list<T, Allocator>& x, forward_list<T, Allocator>& y)
@@ -181,14 +197,17 @@ template <class T, class Allocator, class Predicate>
#include <__algorithm/comp.h>
#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lexicographical_compare_three_way.h>
#include <__algorithm/min.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/move_iterator.h>
#include <__iterator/next.h>
#include <__memory/addressof.h>
+#include <__memory/allocation_guard.h>
#include <__memory/allocator.h>
#include <__memory/allocator_destructor.h>
#include <__memory/allocator_traits.h>
@@ -197,11 +216,22 @@ template <class T, class Allocator, class Predicate>
#include <__memory/swap_allocator.h>
#include <__memory/unique_ptr.h>
#include <__memory_resource/polymorphic_allocator.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/container_compatible_range.h>
+#include <__ranges/from_range.h>
+#include <__type_traits/conditional.h>
#include <__type_traits/is_allocator.h>
+#include <__type_traits/is_const.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_pointer.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/type_identity.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <limits>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -279,6 +309,7 @@ struct __forward_begin_node
pointer __next_;
_LIBCPP_INLINE_VISIBILITY __forward_begin_node() : __next_(nullptr) {}
+ _LIBCPP_INLINE_VISIBILITY explicit __forward_begin_node(pointer __n) : __next_(__n) {}
_LIBCPP_INLINE_VISIBILITY
__begin_node_pointer __next_as_begin() const {
@@ -294,8 +325,13 @@ struct _LIBCPP_STANDALONE_DEBUG __forward_list_node
: public __begin_node_of<_Tp, _VoidPtr>
{
typedef _Tp value_type;
+ typedef __begin_node_of<_Tp, _VoidPtr> _Base;
+ typedef typename _Base::pointer _NodePtr;
value_type __value_;
+
+ _LIBCPP_HIDE_FROM_ABI __forward_list_node() = default;
+ _LIBCPP_HIDE_FROM_ABI __forward_list_node(const value_type& __v, _NodePtr __next) : _Base(__next), __value_(__v) {}
};
@@ -395,11 +431,11 @@ class _LIBCPP_TEMPLATE_VIS __forward_list_const_iterator
__iter_node_pointer __ptr_;
- __begin_node_pointer __get_begin() const {
+ _LIBCPP_HIDE_FROM_ABI __begin_node_pointer __get_begin() const {
return static_cast<__begin_node_pointer>(
static_cast<__void_pointer>(__ptr_));
}
- __node_pointer __get_unsafe_node_pointer() const {
+ _LIBCPP_HIDE_FROM_ABI __node_pointer __get_unsafe_node_pointer() const {
return static_cast<__node_pointer>(
static_cast<__void_pointer>(__ptr_));
}
@@ -482,14 +518,6 @@ protected:
typedef typename allocator_traits<__begin_node_allocator>::pointer
__begin_node_pointer;
- static_assert((!is_same<allocator_type, __node_allocator>::value),
- "internal allocator type must differ from user-specified "
- "type; otherwise overload resolution breaks");
-
- static_assert(is_same<allocator_type, __rebind_alloc<__node_traits, value_type> >::value,
- "[allocator.requirements] states that rebinding an allocator to the same type should result in the "
- "original allocator");
-
__compressed_pair<__begin_node, __node_allocator> __before_begin_;
_LIBCPP_INLINE_VISIBILITY
@@ -533,7 +561,7 @@ private:
__forward_list_base& operator=(const __forward_list_base&);
public:
- ~__forward_list_base();
+ _LIBCPP_HIDE_FROM_ABI ~__forward_list_base();
protected:
_LIBCPP_INLINE_VISIBILITY
@@ -558,7 +586,7 @@ public:
__is_nothrow_swappable<__node_allocator>::value);
#endif
protected:
- void clear() _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
private:
_LIBCPP_INLINE_VISIBILITY
@@ -659,9 +687,17 @@ public:
typedef _Tp value_type;
typedef _Alloc allocator_type;
- static_assert((is_same<typename allocator_type::value_type, value_type>::value),
+ static_assert(is_same<value_type, typename allocator_type::value_type>::value,
"Allocator::value_type must be same type as value_type");
+ static_assert(is_same<allocator_type, __rebind_alloc<allocator_traits<allocator_type>, value_type> >::value,
+ "[allocator.requirements] states that rebinding an allocator to the same type should result in the "
+ "original allocator");
+
+ static_assert((!is_same<allocator_type, __node_allocator>::value),
+ "internal allocator type must differ from user-specified "
+ "type; otherwise overload resolution breaks");
+
typedef value_type& reference;
typedef const value_type& const_reference;
typedef typename allocator_traits<allocator_type>::pointer pointer;
@@ -671,7 +707,7 @@ public:
typedef typename base::iterator iterator;
typedef typename base::const_iterator const_iterator;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef size_type __remove_return_type;
#else
typedef void __remove_return_type;
@@ -683,39 +719,48 @@ public:
{} // = default;
_LIBCPP_INLINE_VISIBILITY
explicit forward_list(const allocator_type& __a);
- explicit forward_list(size_type __n);
-#if _LIBCPP_STD_VER > 11
- explicit forward_list(size_type __n, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI explicit forward_list(size_type __n);
+#if _LIBCPP_STD_VER >= 14
+ _LIBCPP_HIDE_FROM_ABI explicit forward_list(size_type __n, const allocator_type& __a);
#endif
- forward_list(size_type __n, const value_type& __v);
+ _LIBCPP_HIDE_FROM_ABI forward_list(size_type __n, const value_type& __v);
template <class = __enable_if_t<__is_allocator<_Alloc>::value> >
- forward_list(size_type __n, const value_type& __v, const allocator_type& __a) : base(__a)
+ _LIBCPP_HIDE_FROM_ABI forward_list(size_type __n, const value_type& __v, const allocator_type& __a) : base(__a)
{
insert_after(cbefore_begin(), __n, __v);
}
template <class _InputIterator>
- forward_list(_InputIterator __f, _InputIterator __l,
- __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>* = nullptr);
+ _LIBCPP_HIDE_FROM_ABI forward_list(_InputIterator __f, _InputIterator __l,
+ __enable_if_t<__has_input_iterator_category<_InputIterator>::value>* = nullptr);
template <class _InputIterator>
- forward_list(_InputIterator __f, _InputIterator __l,
+ _LIBCPP_HIDE_FROM_ABI forward_list(_InputIterator __f, _InputIterator __l,
const allocator_type& __a,
- __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>* = nullptr);
- forward_list(const forward_list& __x);
- forward_list(const forward_list& __x, const __type_identity_t<allocator_type>& __a);
+ __enable_if_t<__has_input_iterator_category<_InputIterator>::value>* = nullptr);
- forward_list& operator=(const forward_list& __x);
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI forward_list(from_range_t, _Range&& __range,
+ const allocator_type& __a = allocator_type()) : base(__a) {
+ prepend_range(std::forward<_Range>(__range));
+ }
+#endif
+
+ _LIBCPP_HIDE_FROM_ABI forward_list(const forward_list& __x);
+ _LIBCPP_HIDE_FROM_ABI forward_list(const forward_list& __x, const __type_identity_t<allocator_type>& __a);
+
+ _LIBCPP_HIDE_FROM_ABI forward_list& operator=(const forward_list& __x);
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
forward_list(forward_list&& __x)
_NOEXCEPT_(is_nothrow_move_constructible<base>::value)
: base(_VSTD::move(__x)) {}
- forward_list(forward_list&& __x, const __type_identity_t<allocator_type>& __a);
+ _LIBCPP_HIDE_FROM_ABI forward_list(forward_list&& __x, const __type_identity_t<allocator_type>& __a);
- forward_list(initializer_list<value_type> __il);
- forward_list(initializer_list<value_type> __il, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI forward_list(initializer_list<value_type> __il);
+ _LIBCPP_HIDE_FROM_ABI forward_list(initializer_list<value_type> __il, const allocator_type& __a);
_LIBCPP_INLINE_VISIBILITY
forward_list& operator=(forward_list&& __x)
@@ -733,9 +778,18 @@ public:
// ~forward_list() = default;
template <class _InputIterator>
- __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void>
- assign(_InputIterator __f, _InputIterator __l);
- void assign(size_type __n, const value_type& __v);
+ __enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>
+ _LIBCPP_HIDE_FROM_ABI assign(_InputIterator __f, _InputIterator __l);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void assign_range(_Range&& __range) {
+ __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
+ }
+#endif
+
+ _LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __v);
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT
@@ -787,34 +841,56 @@ public:
const_reference front() const {return base::__before_begin()->__next_->__value_;}
#ifndef _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 14
- template <class... _Args> reference emplace_front(_Args&&... __args);
+#if _LIBCPP_STD_VER >= 17
+ template <class... _Args>
+ _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args);
#else
- template <class... _Args> void emplace_front(_Args&&... __args);
+ template <class... _Args>
+ _LIBCPP_HIDE_FROM_ABI void emplace_front(_Args&&... __args);
#endif
- void push_front(value_type&& __v);
+ _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __v);
#endif // _LIBCPP_CXX03_LANG
- void push_front(const value_type& __v);
+ _LIBCPP_HIDE_FROM_ABI void push_front(const value_type& __v);
- void pop_front();
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void prepend_range(_Range&& __range) {
+ insert_range_after(cbefore_begin(), std::forward<_Range>(__range));
+ }
+#endif
+
+ _LIBCPP_HIDE_FROM_ABI void pop_front();
#ifndef _LIBCPP_CXX03_LANG
template <class... _Args>
- iterator emplace_after(const_iterator __p, _Args&&... __args);
+ _LIBCPP_HIDE_FROM_ABI iterator emplace_after(const_iterator __p, _Args&&... __args);
- iterator insert_after(const_iterator __p, value_type&& __v);
- iterator insert_after(const_iterator __p, initializer_list<value_type> __il)
+ _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, value_type&& __v);
+ _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, initializer_list<value_type> __il)
{return insert_after(__p, __il.begin(), __il.end());}
#endif // _LIBCPP_CXX03_LANG
- iterator insert_after(const_iterator __p, const value_type& __v);
- iterator insert_after(const_iterator __p, size_type __n, const value_type& __v);
+ _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, const value_type& __v);
+ _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, size_type __n, const value_type& __v);
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
- __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, iterator>
+ __enable_if_t<__has_input_iterator_category<_InputIterator>::value, iterator>
insert_after(const_iterator __p, _InputIterator __f, _InputIterator __l);
- iterator erase_after(const_iterator __p);
- iterator erase_after(const_iterator __f, const_iterator __l);
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ iterator insert_range_after(const_iterator __position, _Range&& __range) {
+ return __insert_after_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));
+ }
+#endif
+
+ template <class _InputIterator, class _Sentinel>
+ _LIBCPP_HIDE_FROM_ABI
+ iterator __insert_after_with_sentinel(const_iterator __p, _InputIterator __f, _Sentinel __l);
+
+ _LIBCPP_HIDE_FROM_ABI iterator erase_after(const_iterator __p);
+ _LIBCPP_HIDE_FROM_ABI iterator erase_after(const_iterator __f, const_iterator __l);
_LIBCPP_INLINE_VISIBILITY
void swap(forward_list& __x)
@@ -826,8 +902,8 @@ public:
#endif
{base::swap(__x);}
- void resize(size_type __n);
- void resize(size_type __n, const value_type& __v);
+ _LIBCPP_HIDE_FROM_ABI void resize(size_type __n);
+ _LIBCPP_HIDE_FROM_ABI void resize(size_type __n, const value_type& __v);
_LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {base::clear();}
@@ -838,46 +914,54 @@ public:
_LIBCPP_INLINE_VISIBILITY
void splice_after(const_iterator __p, forward_list&& __x,
const_iterator __f, const_iterator __l);
- void splice_after(const_iterator __p, forward_list& __x);
- void splice_after(const_iterator __p, forward_list& __x, const_iterator __i);
- void splice_after(const_iterator __p, forward_list& __x,
+ _LIBCPP_HIDE_FROM_ABI void splice_after(const_iterator __p, forward_list& __x);
+ _LIBCPP_HIDE_FROM_ABI void splice_after(const_iterator __p, forward_list& __x, const_iterator __i);
+ _LIBCPP_HIDE_FROM_ABI void splice_after(const_iterator __p, forward_list& __x,
const_iterator __f, const_iterator __l);
- __remove_return_type remove(const value_type& __v);
- template <class _Predicate> __remove_return_type remove_if(_Predicate __pred);
+ _LIBCPP_HIDE_FROM_ABI __remove_return_type remove(const value_type& __v);
+ template <class _Predicate>
+ _LIBCPP_HIDE_FROM_ABI __remove_return_type remove_if(_Predicate __pred);
_LIBCPP_INLINE_VISIBILITY
__remove_return_type unique() { return unique(__equal_to()); }
- template <class _BinaryPredicate> __remove_return_type unique(_BinaryPredicate __binary_pred);
+ template <class _BinaryPredicate>
+ _LIBCPP_HIDE_FROM_ABI __remove_return_type unique(_BinaryPredicate __binary_pred);
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- void merge(forward_list&& __x) {merge(__x, __less<value_type>());}
+ void merge(forward_list&& __x) {merge(__x, __less<>());}
template <class _Compare>
_LIBCPP_INLINE_VISIBILITY
void merge(forward_list&& __x, _Compare __comp)
{merge(__x, _VSTD::move(__comp));}
#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- void merge(forward_list& __x) {merge(__x, __less<value_type>());}
- template <class _Compare> void merge(forward_list& __x, _Compare __comp);
+ void merge(forward_list& __x) {merge(__x, __less<>());}
+ template <class _Compare>
+ _LIBCPP_HIDE_FROM_ABI void merge(forward_list& __x, _Compare __comp);
_LIBCPP_INLINE_VISIBILITY
- void sort() {sort(__less<value_type>());}
+ void sort() {sort(__less<>());}
template <class _Compare> _LIBCPP_INLINE_VISIBILITY void sort(_Compare __comp);
- void reverse() _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI void reverse() _NOEXCEPT;
private:
#ifndef _LIBCPP_CXX03_LANG
- void __move_assign(forward_list& __x, true_type)
+ _LIBCPP_HIDE_FROM_ABI void __move_assign(forward_list& __x, true_type)
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
- void __move_assign(forward_list& __x, false_type);
+ _LIBCPP_HIDE_FROM_ABI void __move_assign(forward_list& __x, false_type);
#endif // _LIBCPP_CXX03_LANG
+ template <class _Iter, class _Sent>
+ _LIBCPP_HIDE_FROM_ABI
+ void __assign_with_sentinel(_Iter __f, _Sent __l);
+
template <class _Compare>
- static
+ static _LIBCPP_HIDE_FROM_ABI
__node_pointer
__merge(__node_pointer __f1, __node_pointer __f2, _Compare& __comp);
+ // TODO: Make this _LIBCPP_HIDE_FROM_ABI
template <class _Compare>
- static
+ static _LIBCPP_HIDDEN
__node_pointer
__sort(__node_pointer __f, difference_type __sz, _Compare& __comp);
};
@@ -886,7 +970,7 @@ private:
#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Alloc>::value>
>
forward_list(_InputIterator, _InputIterator)
@@ -894,13 +978,22 @@ forward_list(_InputIterator, _InputIterator)
template<class _InputIterator,
class _Alloc,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Alloc>::value>
>
forward_list(_InputIterator, _InputIterator, _Alloc)
-> forward_list<__iter_value_type<_InputIterator>, _Alloc>;
#endif
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range,
+ class _Alloc = allocator<ranges::range_value_t<_Range>>,
+ class = enable_if_t<__is_allocator<_Alloc>::value>
+ >
+forward_list(from_range_t, _Range&&, _Alloc = _Alloc())
+ -> forward_list<ranges::range_value_t<_Range>, _Alloc>;
+#endif
+
template <class _Tp, class _Alloc>
inline
forward_list<_Tp, _Alloc>::forward_list(const allocator_type& __a)
@@ -927,7 +1020,7 @@ forward_list<_Tp, _Alloc>::forward_list(size_type __n)
}
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp, class _Alloc>
forward_list<_Tp, _Alloc>::forward_list(size_type __n,
const allocator_type& __base_alloc)
@@ -959,7 +1052,7 @@ forward_list<_Tp, _Alloc>::forward_list(size_type __n, const value_type& __v)
template <class _Tp, class _Alloc>
template <class _InputIterator>
forward_list<_Tp, _Alloc>::forward_list(_InputIterator __f, _InputIterator __l,
- __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>*)
+ __enable_if_t<__has_input_iterator_category<_InputIterator>::value>*)
{
insert_after(cbefore_begin(), __f, __l);
}
@@ -968,7 +1061,7 @@ template <class _Tp, class _Alloc>
template <class _InputIterator>
forward_list<_Tp, _Alloc>::forward_list(_InputIterator __f, _InputIterator __l,
const allocator_type& __a,
- __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>*)
+ __enable_if_t<__has_input_iterator_category<_InputIterator>::value>*)
: base(__a)
{
insert_after(cbefore_begin(), __f, __l);
@@ -1078,16 +1171,23 @@ forward_list<_Tp, _Alloc>::operator=(initializer_list<value_type> __il)
template <class _Tp, class _Alloc>
template <class _InputIterator>
-__enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void>
+__enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>
forward_list<_Tp, _Alloc>::assign(_InputIterator __f, _InputIterator __l)
{
+ __assign_with_sentinel(__f, __l);
+}
+
+template <class _Tp, class _Alloc>
+template <class _Iter, class _Sent>
+_LIBCPP_HIDE_FROM_ABI
+void forward_list<_Tp, _Alloc>::__assign_with_sentinel(_Iter __f, _Sent __l) {
iterator __i = before_begin();
iterator __j = _VSTD::next(__i);
iterator __e = end();
for (; __j != __e && __f != __l; ++__i, (void) ++__j, ++__f)
*__j = *__f;
if (__j == __e)
- insert_after(__i, __f, __l);
+ __insert_after_with_sentinel(__i, std::move(__f), std::move(__l));
else
erase_after(__i, __e);
}
@@ -1119,7 +1219,7 @@ forward_list<_Tp, _Alloc>::assign(initializer_list<value_type> __il)
template <class _Tp, class _Alloc>
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typename forward_list<_Tp, _Alloc>::reference
#else
void
@@ -1133,7 +1233,7 @@ forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
_VSTD::forward<_Args>(__args)...);
__h->__next_ = base::__before_begin()->__next_;
base::__before_begin()->__next_ = __h.release();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return base::__before_begin()->__next_->__value_;
#endif
}
@@ -1228,26 +1328,33 @@ typename forward_list<_Tp, _Alloc>::iterator
forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n,
const value_type& __v)
{
+ using _Guard = __allocation_guard<__node_allocator>;
+
__begin_node_pointer __r = __p.__get_begin();
if (__n > 0)
{
__node_allocator& __a = base::__alloc();
- typedef __allocator_destructor<__node_allocator> _Dp;
- unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
- __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
- __node_pointer __first = __h.release();
+
+ __node_pointer __first = nullptr;
+ {
+ _Guard __h(__a, 1);
+ __node_traits::construct(__a, std::addressof(__h.__get()->__value_), __v);
+ __h.__get()->__next_ = nullptr;
+ __first = __h.__release_ptr();
+ }
__node_pointer __last = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, __last = __last->__next_)
{
- __h.reset(__node_traits::allocate(__a, 1));
- __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
- __last->__next_ = __h.release();
+ _Guard __h(__a, 1);
+ __node_traits::construct(__a, std::addressof(__h.__get()->__value_), __v);
+ __h.__get()->__next_ = nullptr;
+ __last->__next_ = __h.__release_ptr();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1260,7 +1367,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n,
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__last->__next_ = __r->__next_;
__r->__next_ = __first;
__r = static_cast<__begin_node_pointer>(__last);
@@ -1270,30 +1377,45 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n,
template <class _Tp, class _Alloc>
template <class _InputIterator>
-__enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, typename forward_list<_Tp, _Alloc>::iterator>
+__enable_if_t<__has_input_iterator_category<_InputIterator>::value, typename forward_list<_Tp, _Alloc>::iterator>
forward_list<_Tp, _Alloc>::insert_after(const_iterator __p,
_InputIterator __f, _InputIterator __l)
{
+ return __insert_after_with_sentinel(__p, std::move(__f), std::move(__l));
+}
+
+template <class _Tp, class _Alloc>
+template <class _InputIterator, class _Sentinel>
+_LIBCPP_HIDE_FROM_ABI
+typename forward_list<_Tp, _Alloc>::iterator
+forward_list<_Tp, _Alloc>::__insert_after_with_sentinel(const_iterator __p, _InputIterator __f, _Sentinel __l) {
+ using _Guard = __allocation_guard<__node_allocator>;
__begin_node_pointer __r = __p.__get_begin();
+
if (__f != __l)
{
__node_allocator& __a = base::__alloc();
- typedef __allocator_destructor<__node_allocator> _Dp;
- unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
- __node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
- __node_pointer __first = __h.release();
+ __node_pointer __first = nullptr;
+ {
+ _Guard __h(__a, 1);
+ __node_traits::construct(__a, std::addressof(__h.__get()->__value_), *__f);
+ __h.__get()->__next_ = nullptr;
+ __first = __h.__release_ptr();
+ }
__node_pointer __last = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (++__f; __f != __l; ++__f, ((void)(__last = __last->__next_)))
{
- __h.reset(__node_traits::allocate(__a, 1));
- __node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
- __last->__next_ = __h.release();
+ _Guard __h(__a, 1);
+ __node_traits::construct(__a, std::addressof(__h.__get()->__value_), *__f);
+ __h.__get()->__next_ = nullptr;
+ __last->__next_ = __h.__release_ptr();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1306,11 +1428,13 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p,
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+
__last->__next_ = __r->__next_;
__r->__next_ = __first;
__r = static_cast<__begin_node_pointer>(__last);
}
+
return iterator(__r);
}
@@ -1711,6 +1835,8 @@ bool operator==(const forward_list<_Tp, _Alloc>& __x,
return (__ix == __ex) == (__iy == __ey);
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
bool operator!=(const forward_list<_Tp, _Alloc>& __x,
@@ -1752,6 +1878,17 @@ bool operator<=(const forward_list<_Tp, _Alloc>& __x,
return !(__y < __x);
}
+#else // #if _LIBCPP_STD_VER <= 17
+
+template <class _Tp, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp>
+operator<=>(const forward_list<_Tp, _Allocator>& __x, const forward_list<_Tp, _Allocator>& __y) {
+ return std::lexicographical_compare_three_way(
+ __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>);
+}
+
+#endif // #if _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
void
@@ -1761,7 +1898,7 @@ swap(forward_list<_Tp, _Alloc>& __x, forward_list<_Tp, _Alloc>& __y)
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, class _Allocator, class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
typename forward_list<_Tp, _Allocator>::size_type
@@ -1779,11 +1916,11 @@ inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueT>
-using forward_list = std::forward_list<_ValueT, polymorphic_allocator<_ValueT>>;
+using forward_list _LIBCPP_AVAILABILITY_PMR = std::forward_list<_ValueT, polymorphic_allocator<_ValueT>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
@@ -1794,9 +1931,11 @@ _LIBCPP_POP_MACROS
# include <algorithm>
# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iosfwd>
# include <iterator>
+# include <type_traits>
# include <typeinfo>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/fstream b/contrib/libs/cxxsupp/libcxx/include/fstream
index 41e95bf3dc6..d30575e22a4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/fstream
+++ b/contrib/libs/cxxsupp/libcxx/include/fstream
@@ -183,22 +183,18 @@ typedef basic_fstream<wchar_t> wfstream;
#include <__assert> // all public C++ headers provide the assertion handler
#include <__availability>
#include <__config>
+#include <__fwd/fstream.h>
#include <__locale>
#include <__utility/move.h>
#include <__utility/swap.h>
#include <__utility/unreachable.h>
#include <cstdio>
-#include <cstdlib>
-#include <cstring>
+#include <filesystem>
#include <istream>
#include <ostream>
#include <typeinfo>
#include <version>
-#if !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
-# include <filesystem>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
@@ -210,7 +206,7 @@ _LIBCPP_PUSH_MACROS
# define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS
#endif
-#if !defined(_LIBCPP_HAS_NO_FSTREAM)
+#if !defined(_LIBCPP_HAS_NO_FILESYSTEM)
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -246,8 +242,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
basic_filebuf* open(const string& __s, ios_base::openmode __mode);
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
- _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_INLINE_VISIBILITY
basic_filebuf* open(const _VSTD_FS::path& __p, ios_base::openmode __mode) {
return open(__p.c_str(), __mode);
}
@@ -398,17 +394,17 @@ basic_filebuf<_CharT, _Traits>::operator=(basic_filebuf&& __rhs)
template <class _CharT, class _Traits>
basic_filebuf<_CharT, _Traits>::~basic_filebuf()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
close();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (__owns_eb_)
delete [] __extbuf_;
if (__owns_ib_)
@@ -754,8 +750,8 @@ basic_filebuf<_CharT, _Traits>::underflow()
else
{
if (__extbufend_ != __extbufnext_) {
- _LIBCPP_ASSERT(__extbufnext_ != nullptr, "underflow moving from nullptr");
- _LIBCPP_ASSERT(__extbuf_ != nullptr, "underflow moving into nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__extbufnext_ != nullptr, "underflow moving from nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__extbuf_ != nullptr, "underflow moving into nullptr");
_VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
}
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
@@ -1169,8 +1165,8 @@ public:
#endif
_LIBCPP_INLINE_VISIBILITY
explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
- _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_INLINE_VISIBILITY
explicit basic_ifstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in)
: basic_ifstream(__p.c_str(), __mode) {}
#endif // _LIBCPP_STD_VER >= 17
@@ -1190,8 +1186,8 @@ public:
void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in);
#endif
void open(const string& __s, ios_base::openmode __mode = ios_base::in);
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
- _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_INLINE_VISIBILITY
void open(const filesystem::path& __p,
ios_base::openmode __mode = ios_base::in) {
return open(__p.c_str(), __mode);
@@ -1370,8 +1366,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
- _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_INLINE_VISIBILITY
explicit basic_ofstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
: basic_ofstream(__p.c_str(), __mode) {}
#endif // _LIBCPP_STD_VER >= 17
@@ -1393,8 +1389,8 @@ public:
#endif
void open(const string& __s, ios_base::openmode __mode = ios_base::out);
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
- _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_INLINE_VISIBILITY
void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
{ return open(__p.c_str(), __mode); }
#endif // _LIBCPP_STD_VER >= 17
@@ -1571,8 +1567,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
- _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_INLINE_VISIBILITY
explicit basic_fstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out)
: basic_fstream(__p.c_str(), __mode) {}
#endif // _LIBCPP_STD_VER >= 17
@@ -1590,14 +1586,14 @@ public:
basic_filebuf<char_type, traits_type>* rdbuf() const;
_LIBCPP_INLINE_VISIBILITY
bool is_open() const;
- void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
+ _LIBCPP_HIDE_FROM_ABI void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
#endif
- void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
+ _LIBCPP_HIDE_FROM_ABI void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
- _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_INLINE_VISIBILITY
void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in|ios_base::out)
{ return open(__p.c_str(), __mode); }
#endif // _LIBCPP_STD_VER >= 17
@@ -1746,13 +1742,14 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_filebuf<char>;
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_HAS_NO_FSTREAM
+#endif // _LIBCPP_HAS_NO_FILESYSTEM
_LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <iosfwd>
# include <limits>
# include <new>
diff --git a/contrib/libs/cxxsupp/libcxx/include/functional b/contrib/libs/cxxsupp/libcxx/include/functional
index 8589d3a9d6a..5c60b9fc39f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/functional
+++ b/contrib/libs/cxxsupp/libcxx/include/functional
@@ -43,20 +43,22 @@ public:
// construct/copy/destroy
template<class U>
- reference_wrapper(U&&);
- reference_wrapper(const reference_wrapper<T>& x) noexcept;
+ constexpr reference_wrapper(U&&); // constexpr since C++20
+ constexpr reference_wrapper(const reference_wrapper<T>& x) noexcept; // constexpr since C++20
// assignment
- reference_wrapper& operator=(const reference_wrapper<T>& x) noexcept;
+ constexpr reference_wrapper&
+ operator=(const reference_wrapper<T>& x) noexcept; // constexpr since C++20
// access
- operator T& () const noexcept;
- T& get() const noexcept;
+ constexpr operator T& () const noexcept; // constexpr since C++20
+ constexpr T& get() const noexcept; // constexpr since C++20
// invoke
template <class... ArgTypes>
- typename result_of<T&(ArgTypes&&...)>::type
- operator() (ArgTypes&&...) const;
+ constexpr typename result_of<T&(ArgTypes&&...)>::type // constexpr since C++20
+ operator() (ArgTypes&&...) const
+ noexcept(is_nothrow_invocable_v<T&, ArgTypes...>); // noexcept since C++17
};
template <class T>
@@ -220,11 +222,16 @@ template<class Fn, class... BoundArgs>
template<class R, class Fn, class... BoundArgs>
constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20
+// [func.invoke]
template<class F, class... Args>
constexpr // constexpr in C++20
invoke_result_t<F, Args...> invoke(F&& f, Args&&... args) // C++17
noexcept(is_nothrow_invocable_v<F, Args...>);
+template<class R, class F, class... Args>
+ constexpr R invoke_r(F&& f, Args&&... args) // C++23
+ noexcept(is_nothrow_invocable_r_v<R, F, Args...>);
+
namespace placeholders {
// M is the implementation-defined number of placeholders
extern unspecified _1;
@@ -250,10 +257,10 @@ public:
};
template <class Operation, class T>
-binder1st<Operation> bind1st(const Operation& op, const T& x); // deprecated in C++11, removed in C++17
+binder1st<Operation> bind1st(const Operation& op, const T& x); // deprecated in C++11, removed in C++17
template <class Operation>
-class binder2nd // deprecated in C++11, removed in C++17
+class binder2nd // deprecated in C++11, removed in C++17
: public unary_function<typename Operation::first_argument_type,
typename Operation::result_type>
{
@@ -267,9 +274,9 @@ public:
};
template <class Operation, class T>
-binder2nd<Operation> bind2nd(const Operation& op, const T& x); // deprecated in C++11, removed in C++17
+binder2nd<Operation> bind2nd(const Operation& op, const T& x); // deprecated in C++11, removed in C++17
-template <class Arg, class Result> // deprecated in C++11, removed in C++17
+template <class Arg, class Result> // deprecated in C++11, removed in C++17
class pointer_to_unary_function : public unary_function<Arg, Result>
{
public:
@@ -278,9 +285,9 @@ public:
};
template <class Arg, class Result>
-pointer_to_unary_function<Arg,Result> ptr_fun(Result (*f)(Arg)); // deprecated in C++11, removed in C++17
+pointer_to_unary_function<Arg,Result> ptr_fun(Result (*f)(Arg)); // deprecated in C++11, removed in C++17
-template <class Arg1, class Arg2, class Result> // deprecated in C++11, removed in C++17
+template <class Arg1, class Arg2, class Result> // deprecated in C++11, removed in C++17
class pointer_to_binary_function : public binary_function<Arg1, Arg2, Result>
{
public:
@@ -289,9 +296,9 @@ public:
};
template <class Arg1, class Arg2, class Result>
-pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1,Arg2)); // deprecated in C++11, removed in C++17
+pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1,Arg2)); // deprecated in C++11, removed in C++17
-template<class S, class T> // deprecated in C++11, removed in C++17
+template<class S, class T> // deprecated in C++11, removed in C++17
class mem_fun_t : public unary_function<T*, S>
{
public:
@@ -300,18 +307,18 @@ public:
};
template<class S, class T, class A>
-class mem_fun1_t : public binary_function<T*, A, S> // deprecated in C++11, removed in C++17
+class mem_fun1_t : public binary_function<T*, A, S> // deprecated in C++11, removed in C++17
{
public:
explicit mem_fun1_t(S (T::*p)(A));
S operator()(T* p, A x) const;
};
-template<class S, class T> mem_fun_t<S,T> mem_fun(S (T::*f)()); // deprecated in C++11, removed in C++17
-template<class S, class T, class A> mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A)); // deprecated in C++11, removed in C++17
+template<class S, class T> mem_fun_t<S,T> mem_fun(S (T::*f)()); // deprecated in C++11, removed in C++17
+template<class S, class T, class A> mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A)); // deprecated in C++11, removed in C++17
template<class S, class T>
-class mem_fun_ref_t : public unary_function<T, S> // deprecated in C++11, removed in C++17
+class mem_fun_ref_t : public unary_function<T, S> // deprecated in C++11, removed in C++17
{
public:
explicit mem_fun_ref_t(S (T::*p)());
@@ -319,18 +326,20 @@ public:
};
template<class S, class T, class A>
-class mem_fun1_ref_t : public binary_function<T, A, S> // deprecated in C++11, removed in C++17
+class mem_fun1_ref_t : public binary_function<T, A, S> // deprecated in C++11, removed in C++17
{
public:
explicit mem_fun1_ref_t(S (T::*p)(A));
S operator()(T& p, A x) const;
};
-template<class S, class T> mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)()); // deprecated in C++11, removed in C++17
-template<class S, class T, class A> mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A)); // deprecated in C++11, removed in C++17
+template<class S, class T>
+mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)()); // deprecated in C++11, removed in C++17
+template<class S, class T, class A>
+mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A)); // deprecated in C++11, removed in C++17
template <class S, class T>
-class const_mem_fun_t : public unary_function<const T*, S> // deprecated in C++11, removed in C++17
+class const_mem_fun_t : public unary_function<const T*, S> // deprecated in C++11, removed in C++17
{
public:
explicit const_mem_fun_t(S (T::*p)() const);
@@ -338,18 +347,20 @@ public:
};
template <class S, class T, class A>
-class const_mem_fun1_t : public binary_function<const T*, A, S> // deprecated in C++11, removed in C++17
+class const_mem_fun1_t : public binary_function<const T*, A, S> // deprecated in C++11, removed in C++17
{
public:
explicit const_mem_fun1_t(S (T::*p)(A) const);
S operator()(const T* p, A x) const;
};
-template <class S, class T> const_mem_fun_t<S,T> mem_fun(S (T::*f)() const); // deprecated in C++11, removed in C++17
-template <class S, class T, class A> const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const); // deprecated in C++11, removed in C++17
+template <class S, class T>
+const_mem_fun_t<S,T> mem_fun(S (T::*f)() const); // deprecated in C++11, removed in C++17
+template <class S, class T, class A>
+const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const); // deprecated in C++11, removed in C++17
template <class S, class T>
-class const_mem_fun_ref_t : public unary_function<T, S> // deprecated in C++11, removed in C++17
+class const_mem_fun_ref_t : public unary_function<T, S> // deprecated in C++11, removed in C++17
{
public:
explicit const_mem_fun_ref_t(S (T::*p)() const);
@@ -357,18 +368,19 @@ public:
};
template <class S, class T, class A>
-class const_mem_fun1_ref_t : public binary_function<T, A, S> // deprecated in C++11, removed in C++17
+class const_mem_fun1_ref_t : public binary_function<T, A, S> // deprecated in C++11, removed in C++17
{
public:
explicit const_mem_fun1_ref_t(S (T::*p)(A) const);
S operator()(const T& p, A x) const;
};
-template <class S, class T> const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const); // deprecated in C++11, removed in C++17
-template <class S, class T, class A> const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17
+template <class S, class T>
+const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const); // deprecated in C++11, removed in C++17
+template <class S, class T, class A>
+const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17
-template<class R, class T>
-constexpr unspecified mem_fn(R T::*); // constexpr in C++20
+template<class R, class T> constexpr unspecified mem_fn(R T::*); // constexpr in C++20
class bad_function_call
: public exception
@@ -444,13 +456,13 @@ template <class R, class ... ArgTypes>
bool operator==(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
template <class R, class ... ArgTypes>
- bool operator==(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
+ bool operator==(nullptr_t, const function<R(ArgTypes...)>&) noexcept; // removed in C++20
template <class R, class ... ArgTypes>
- bool operator!=(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
+ bool operator!=(const function<R(ArgTypes...)>&, nullptr_t) noexcept; // removed in C++20
template <class R, class ... ArgTypes>
- bool operator!=(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
+ bool operator!=(nullptr_t, const function<R(ArgTypes...)>&) noexcept; // removed in C++20
// specialized algorithms:
template <class R, class ... ArgTypes>
@@ -504,8 +516,7 @@ POLICY: For non-variadic implementations, the number of arguments is limited
#include <__assert> // all public C++ headers provide the assertion handler
#include <__compare/compare_three_way.h>
#include <__config>
-#include <__debug>
-#include <__functional/binary_function.h> // TODO: deprecate
+#include <__functional/binary_function.h>
#include <__functional/binary_negate.h>
#include <__functional/bind.h>
#include <__functional/bind_back.h>
@@ -527,13 +538,11 @@ POLICY: For non-variadic implementations, the number of arguments is limited
#include <__functional/pointer_to_unary_function.h>
#include <__functional/ranges_operations.h>
#include <__functional/reference_wrapper.h>
-#include <__functional/unary_function.h> // TODO: deprecate
+#include <__functional/unary_function.h>
#include <__functional/unary_negate.h>
-#include <__functional/unwrap_ref.h>
+#include <__type_traits/unwrap_ref.h>
#include <__utility/forward.h>
-#include <exception>
#include <memory> // TODO: find out why removing this breaks the modules build
-#include <type_traits>
#include <typeinfo>
#include <version>
@@ -542,8 +551,12 @@ POLICY: For non-variadic implementations, the number of arguments is limited
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
+# include <cstdlib>
+# include <exception>
# include <tuple>
+# include <type_traits>
# include <utility>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/future b/contrib/libs/cxxsupp/libcxx/include/future
index 2f14a471c45..273e4175e60 100644
--- a/contrib/libs/cxxsupp/libcxx/include/future
+++ b/contrib/libs/cxxsupp/libcxx/include/future
@@ -366,17 +366,29 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
#include <__chrono/duration.h>
#include <__chrono/time_point.h>
#include <__config>
+#include <__exception/exception_ptr.h>
+#include <__memory/addressof.h>
+#include <__memory/allocator.h>
#include <__memory/allocator_arg_t.h>
#include <__memory/allocator_destructor.h>
+#include <__memory/allocator_traits.h>
+#include <__memory/compressed_pair.h>
+#include <__memory/pointer_traits.h>
+#include <__memory/shared_ptr.h>
+#include <__memory/unique_ptr.h>
#include <__memory/uses_allocator.h>
+#include <__system_error/error_category.h>
+#include <__system_error/error_code.h>
+#include <__system_error/error_condition.h>
+#include <__type_traits/aligned_storage.h>
+#include <__type_traits/alignment_of.h>
#include <__type_traits/strip_signature.h>
#include <__utility/auto_cast.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <exception>
#include <mutex>
#include <new>
-#include <system_error>
+#include <stdexcept>
#include <thread>
#include <version>
@@ -488,8 +500,7 @@ _LIBCPP_DECLARE_STRONG_ENUM(future_status)
};
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_status)
-_LIBCPP_FUNC_VIS
-const error_category& future_category() _NOEXCEPT;
+_LIBCPP_EXPORTED_FROM_ABI const error_category& future_category() _NOEXCEPT;
inline _LIBCPP_INLINE_VISIBILITY
error_code
@@ -505,7 +516,7 @@ make_error_condition(future_errc __e) _NOEXCEPT
return error_condition(static_cast<int>(__e), future_category());
}
-class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_FUTURE_ERROR future_error
+class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_FUTURE_ERROR future_error
: public logic_error
{
error_code __ec_;
@@ -515,25 +526,25 @@ public:
_LIBCPP_INLINE_VISIBILITY
const error_code& code() const _NOEXCEPT {return __ec_;}
- future_error(const future_error&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI future_error(const future_error&) _NOEXCEPT = default;
~future_error() _NOEXCEPT override;
};
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
_LIBCPP_AVAILABILITY_FUTURE_ERROR
#endif
void __throw_future_error(future_errc __ev)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw future_error(make_error_code(__ev));
#else
- ((void)__ev);
- _VSTD::abort();
+ (void)__ev;
+ _LIBCPP_VERBOSE_ABORT("future_error was thrown in -fno-exceptions mode");
#endif
}
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state
+class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state
: public __shared_count
{
protected:
@@ -631,17 +642,17 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
protected:
_Up __value_;
- void __on_zero_shared() _NOEXCEPT override;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override;
public:
template <class _Arg>
- void set_value(_Arg&& __arg);
+ _LIBCPP_HIDE_FROM_ABI void set_value(_Arg&& __arg);
template <class _Arg>
- void set_value_at_thread_exit(_Arg&& __arg);
+ _LIBCPP_HIDE_FROM_ABI void set_value_at_thread_exit(_Arg&& __arg);
- _Rp move();
- __add_lvalue_reference_t<_Rp> copy();
+ _LIBCPP_HIDE_FROM_ABI _Rp move();
+ _LIBCPP_HIDE_FROM_ABI __add_lvalue_reference_t<_Rp> copy();
};
template <class _Rp>
@@ -711,13 +722,13 @@ class _LIBCPP_AVAILABILITY_FUTURE __assoc_state<_Rp&>
protected:
_Up __value_;
- void __on_zero_shared() _NOEXCEPT override;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override;
public:
- void set_value(_Rp& __arg);
- void set_value_at_thread_exit(_Rp& __arg);
+ _LIBCPP_HIDE_FROM_ABI void set_value(_Rp& __arg);
+ _LIBCPP_HIDE_FROM_ABI void set_value_at_thread_exit(_Rp& __arg);
- _Rp& copy();
+ _LIBCPP_HIDE_FROM_ABI _Rp& copy();
};
template <class _Rp>
@@ -769,7 +780,7 @@ class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc
typedef __assoc_state<_Rp> base;
_Alloc __alloc_;
- virtual void __on_zero_shared() _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __on_zero_shared() _NOEXCEPT;
public:
_LIBCPP_INLINE_VISIBILITY
explicit __assoc_state_alloc(const _Alloc& __a)
@@ -797,7 +808,7 @@ class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc<_Rp&, _Alloc>
typedef __assoc_state<_Rp&> base;
_Alloc __alloc_;
- virtual void __on_zero_shared() _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __on_zero_shared() _NOEXCEPT;
public:
_LIBCPP_INLINE_VISIBILITY
explicit __assoc_state_alloc(const _Alloc& __a)
@@ -823,7 +834,7 @@ class _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state_alloc
typedef __assoc_sub_state base;
_Alloc __alloc_;
- void __on_zero_shared() _NOEXCEPT override;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override;
public:
_LIBCPP_INLINE_VISIBILITY
explicit __assoc_sub_state_alloc(const _Alloc& __a)
@@ -854,7 +865,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
explicit __deferred_assoc_state(_Fp&& __f);
- virtual void __execute();
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __execute();
};
template <class _Rp, class _Fp>
@@ -869,18 +880,18 @@ template <class _Rp, class _Fp>
void
__deferred_assoc_state<_Rp, _Fp>::__execute()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->set_value(__func_());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Fp>
@@ -895,7 +906,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
explicit __deferred_assoc_state(_Fp&& __f);
- void __execute() override;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __execute() override;
};
template <class _Fp>
@@ -910,19 +921,19 @@ template <class _Fp>
void
__deferred_assoc_state<void, _Fp>::__execute()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__func_();
this->set_value();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Rp, class _Fp>
@@ -933,12 +944,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state
_Fp __func_;
- virtual void __on_zero_shared() _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __on_zero_shared() _NOEXCEPT;
public:
_LIBCPP_INLINE_VISIBILITY
explicit __async_assoc_state(_Fp&& __f);
- virtual void __execute();
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __execute();
};
template <class _Rp, class _Fp>
@@ -952,18 +963,18 @@ template <class _Rp, class _Fp>
void
__async_assoc_state<_Rp, _Fp>::__execute()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->set_value(__func_());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Rp, class _Fp>
@@ -982,12 +993,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state<void, _Fp>
_Fp __func_;
- void __on_zero_shared() _NOEXCEPT override;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override;
public:
_LIBCPP_INLINE_VISIBILITY
explicit __async_assoc_state(_Fp&& __f);
- void __execute() override;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __execute() override;
};
template <class _Fp>
@@ -1001,19 +1012,19 @@ template <class _Fp>
void
__async_assoc_state<void, _Fp>::__execute()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__func_();
this->set_value();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Fp>
@@ -1044,7 +1055,7 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
{
__assoc_state<_Rp>* __state_;
- explicit future(__assoc_state<_Rp>* __state);
+ explicit _LIBCPP_HIDE_FROM_ABI future(__assoc_state<_Rp>* __state);
template <class> friend class promise;
template <class> friend class shared_future;
@@ -1069,12 +1080,12 @@ public:
return *this;
}
- ~future();
+ _LIBCPP_HIDE_FROM_ABI ~future();
_LIBCPP_INLINE_VISIBILITY
shared_future<_Rp> share() _NOEXCEPT;
// retrieving the value
- _Rp get();
+ _LIBCPP_HIDE_FROM_ABI _Rp get();
_LIBCPP_INLINE_VISIBILITY
void swap(future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
@@ -1106,7 +1117,7 @@ future<_Rp>::future(__assoc_state<_Rp>* __state)
struct __release_shared_count
{
- void operator()(__shared_count* __p) {__p->__release_shared();}
+ _LIBCPP_HIDE_FROM_ABI void operator()(__shared_count* __p) {__p->__release_shared();}
};
template <class _Rp>
@@ -1120,7 +1131,7 @@ template <class _Rp>
_Rp
future<_Rp>::get()
{
- unique_ptr<__shared_count, __release_shared_count> __(__state_);
+ unique_ptr<__shared_count, __release_shared_count> __guard(__state_);
__assoc_state<_Rp>* __s = __state_;
__state_ = nullptr;
return __s->move();
@@ -1131,7 +1142,7 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future<_Rp&>
{
__assoc_state<_Rp&>* __state_;
- explicit future(__assoc_state<_Rp&>* __state);
+ explicit _LIBCPP_HIDE_FROM_ABI future(__assoc_state<_Rp&>* __state);
template <class> friend class promise;
template <class> friend class shared_future;
@@ -1156,12 +1167,12 @@ public:
return *this;
}
- ~future();
+ _LIBCPP_HIDE_FROM_ABI ~future();
_LIBCPP_INLINE_VISIBILITY
shared_future<_Rp&> share() _NOEXCEPT;
// retrieving the value
- _Rp& get();
+ _LIBCPP_HIDE_FROM_ABI _Rp& get();
_LIBCPP_INLINE_VISIBILITY
void swap(future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
@@ -1202,14 +1213,14 @@ template <class _Rp>
_Rp&
future<_Rp&>::get()
{
- unique_ptr<__shared_count, __release_shared_count> __(__state_);
+ unique_ptr<__shared_count, __release_shared_count> __guard(__state_);
__assoc_state<_Rp&>* __s = __state_;
__state_ = nullptr;
return __s->copy();
}
template <>
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE future<void>
+class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_FUTURE future<void>
{
__assoc_sub_state* __state_;
@@ -1288,14 +1299,14 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE promise
template <class> friend class packaged_task;
public:
- promise();
+ _LIBCPP_HIDE_FROM_ABI promise();
template <class _Alloc>
- promise(allocator_arg_t, const _Alloc& __a);
+ _LIBCPP_HIDE_FROM_ABI promise(allocator_arg_t, const _Alloc& __a);
_LIBCPP_INLINE_VISIBILITY
promise(promise&& __rhs) _NOEXCEPT
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
promise(const promise& __rhs) = delete;
- ~promise();
+ _LIBCPP_HIDE_FROM_ABI ~promise();
// assignment
_LIBCPP_INLINE_VISIBILITY
@@ -1310,17 +1321,17 @@ public:
void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
// retrieving the result
- future<_Rp> get_future();
+ _LIBCPP_HIDE_FROM_ABI future<_Rp> get_future();
// setting the result
- void set_value(const _Rp& __r);
- void set_value(_Rp&& __r);
- void set_exception(exception_ptr __p);
+ _LIBCPP_HIDE_FROM_ABI void set_value(const _Rp& __r);
+ _LIBCPP_HIDE_FROM_ABI void set_value(_Rp&& __r);
+ _LIBCPP_HIDE_FROM_ABI void set_exception(exception_ptr __p);
// setting the result with deferred notification
- void set_value_at_thread_exit(const _Rp& __r);
- void set_value_at_thread_exit(_Rp&& __r);
- void set_exception_at_thread_exit(exception_ptr __p);
+ _LIBCPP_HIDE_FROM_ABI void set_value_at_thread_exit(const _Rp& __r);
+ _LIBCPP_HIDE_FROM_ABI void set_value_at_thread_exit(_Rp&& __r);
+ _LIBCPP_HIDE_FROM_ABI void set_exception_at_thread_exit(exception_ptr __p);
};
template <class _Rp>
@@ -1386,7 +1397,7 @@ template <class _Rp>
void
promise<_Rp>::set_exception(exception_ptr __p)
{
- _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" );
+ _LIBCPP_ASSERT_UNCATEGORIZED( __p != nullptr, "promise::set_exception: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception(__p);
@@ -1414,7 +1425,7 @@ template <class _Rp>
void
promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
{
- _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
+ _LIBCPP_ASSERT_UNCATEGORIZED( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception_at_thread_exit(__p);
@@ -1433,14 +1444,14 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE promise<_Rp&>
template <class> friend class packaged_task;
public:
- promise();
+ _LIBCPP_HIDE_FROM_ABI promise();
template <class _Allocator>
- promise(allocator_arg_t, const _Allocator& __a);
+ _LIBCPP_HIDE_FROM_ABI promise(allocator_arg_t, const _Allocator& __a);
_LIBCPP_INLINE_VISIBILITY
promise(promise&& __rhs) _NOEXCEPT
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
promise(const promise& __rhs) = delete;
- ~promise();
+ _LIBCPP_HIDE_FROM_ABI ~promise();
// assignment
_LIBCPP_INLINE_VISIBILITY
@@ -1455,15 +1466,15 @@ public:
void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
// retrieving the result
- future<_Rp&> get_future();
+ _LIBCPP_HIDE_FROM_ABI future<_Rp&> get_future();
// setting the result
- void set_value(_Rp& __r);
- void set_exception(exception_ptr __p);
+ _LIBCPP_HIDE_FROM_ABI void set_value(_Rp& __r);
+ _LIBCPP_HIDE_FROM_ABI void set_exception(exception_ptr __p);
// setting the result with deferred notification
- void set_value_at_thread_exit(_Rp&);
- void set_exception_at_thread_exit(exception_ptr __p);
+ _LIBCPP_HIDE_FROM_ABI void set_value_at_thread_exit(_Rp&);
+ _LIBCPP_HIDE_FROM_ABI void set_exception_at_thread_exit(exception_ptr __p);
};
template <class _Rp>
@@ -1520,7 +1531,7 @@ template <class _Rp>
void
promise<_Rp&>::set_exception(exception_ptr __p)
{
- _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" );
+ _LIBCPP_ASSERT_UNCATEGORIZED( __p != nullptr, "promise::set_exception: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception(__p);
@@ -1539,7 +1550,7 @@ template <class _Rp>
void
promise<_Rp&>::set_exception_at_thread_exit(exception_ptr __p)
{
- _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
+ _LIBCPP_ASSERT_UNCATEGORIZED( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception_at_thread_exit(__p);
@@ -1548,7 +1559,7 @@ promise<_Rp&>::set_exception_at_thread_exit(exception_ptr __p)
// promise<void>
template <>
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE promise<void>
+class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_FUTURE promise<void>
{
__assoc_sub_state* __state_;
@@ -1654,10 +1665,10 @@ public:
_LIBCPP_INLINE_VISIBILITY
__packaged_task_func(_Fp&& __f, const _Alloc& __a)
: __f_(_VSTD::move(__f), __a) {}
- virtual void __move_to(__packaged_task_base<_Rp(_ArgTypes...)>*) _NOEXCEPT;
- virtual void destroy();
- virtual void destroy_deallocate();
- virtual _Rp operator()(_ArgTypes&& ... __args);
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __move_to(__packaged_task_base<_Rp(_ArgTypes...)>*) _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void destroy();
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void destroy_deallocate();
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual _Rp operator()(_ArgTypes&& ... __args);
};
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
@@ -1716,22 +1727,22 @@ public:
_LIBCPP_INLINE_VISIBILITY
__packaged_task_function() _NOEXCEPT : __f_(nullptr) {}
template<class _Fp>
- __packaged_task_function(_Fp&& __f);
+ _LIBCPP_HIDE_FROM_ABI __packaged_task_function(_Fp&& __f);
template<class _Fp, class _Alloc>
- __packaged_task_function(allocator_arg_t, const _Alloc& __a, _Fp&& __f);
+ _LIBCPP_HIDE_FROM_ABI __packaged_task_function(allocator_arg_t, const _Alloc& __a, _Fp&& __f);
- __packaged_task_function(__packaged_task_function&&) _NOEXCEPT;
- __packaged_task_function& operator=(__packaged_task_function&&) _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI __packaged_task_function(__packaged_task_function&&) _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI __packaged_task_function& operator=(__packaged_task_function&&) _NOEXCEPT;
__packaged_task_function(const __packaged_task_function&) = delete;
__packaged_task_function& operator=(const __packaged_task_function&) = delete;
- ~__packaged_task_function();
+ _LIBCPP_HIDE_FROM_ABI ~__packaged_task_function();
- void swap(__packaged_task_function&) _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI void swap(__packaged_task_function&) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
- _Rp operator()(_ArgTypes...) const;
+ _LIBCPP_HIDE_FROM_ABI _Rp operator()(_ArgTypes...) const;
};
template<class _Rp, class ..._ArgTypes>
@@ -1756,7 +1767,7 @@ template <class _Fp>
__packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f)
: __f_(nullptr)
{
- typedef __libcpp_remove_reference_t<typename decay<_Fp>::type> _FR;
+ typedef __libcpp_remove_reference_t<__decay_t<_Fp> > _FR;
typedef __packaged_task_func<_FR, allocator<_FR>, _Rp(_ArgTypes...)> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
{
@@ -1780,7 +1791,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(
allocator_arg_t, const _Alloc& __a0, _Fp&& __f)
: __f_(nullptr)
{
- typedef __libcpp_remove_reference_t<typename decay<_Fp>::type> _FR;
+ typedef __libcpp_remove_reference_t<__decay_t<_Fp> > _FR;
typedef __packaged_task_func<_FR, _Alloc, _Rp(_ArgTypes...)> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
{
@@ -1902,8 +1913,8 @@ public:
class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, packaged_task>::value> >
_LIBCPP_INLINE_VISIBILITY
packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
- : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
- __p_(allocator_arg, __a) {}
+ : __f_(allocator_arg_t(), __a, _VSTD::forward<_Fp>(__f)),
+ __p_(allocator_arg_t(), __a) {}
// ~packaged_task() = default;
// no copy
@@ -1936,10 +1947,10 @@ public:
future<result_type> get_future() {return __p_.get_future();}
// execution
- void operator()(_ArgTypes... __args);
- void make_ready_at_thread_exit(_ArgTypes... __args);
+ _LIBCPP_HIDE_FROM_ABI void operator()(_ArgTypes... __args);
+ _LIBCPP_HIDE_FROM_ABI void make_ready_at_thread_exit(_ArgTypes... __args);
- void reset();
+ _LIBCPP_HIDE_FROM_ABI void reset();
};
template<class _Rp, class ..._ArgTypes>
@@ -1950,18 +1961,18 @@ packaged_task<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __args)
__throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__p_.set_value(__f_(_VSTD::forward<_ArgTypes>(__args)...));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__p_.set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Rp, class ..._ArgTypes>
@@ -1972,18 +1983,18 @@ packaged_task<_Rp(_ArgTypes...)>::make_ready_at_thread_exit(_ArgTypes... __args)
__throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__p_.set_value_at_thread_exit(__f_(_VSTD::forward<_ArgTypes>(__args)...));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__p_.set_exception_at_thread_exit(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Rp, class ..._ArgTypes>
@@ -2017,8 +2028,8 @@ public:
class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, packaged_task>::value> >
_LIBCPP_INLINE_VISIBILITY
packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
- : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
- __p_(allocator_arg, __a) {}
+ : __f_(allocator_arg_t(), __a, _VSTD::forward<_Fp>(__f)),
+ __p_(allocator_arg_t(), __a) {}
// ~packaged_task() = default;
// no copy
@@ -2051,10 +2062,10 @@ public:
future<result_type> get_future() {return __p_.get_future();}
// execution
- void operator()(_ArgTypes... __args);
- void make_ready_at_thread_exit(_ArgTypes... __args);
+ _LIBCPP_HIDE_FROM_ABI void operator()(_ArgTypes... __args);
+ _LIBCPP_HIDE_FROM_ABI void make_ready_at_thread_exit(_ArgTypes... __args);
- void reset();
+ _LIBCPP_HIDE_FROM_ABI void reset();
};
#if _LIBCPP_STD_VER >= 17
@@ -2075,19 +2086,19 @@ packaged_task<void(_ArgTypes...)>::operator()(_ArgTypes... __args)
__throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__f_(_VSTD::forward<_ArgTypes>(__args)...);
__p_.set_value();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__p_.set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class ..._ArgTypes>
@@ -2098,19 +2109,19 @@ packaged_task<void(_ArgTypes...)>::make_ready_at_thread_exit(_ArgTypes... __args
__throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__f_(_VSTD::forward<_ArgTypes>(__args)...);
__p_.set_value_at_thread_exit();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__p_.set_exception_at_thread_exit(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class ..._ArgTypes>
@@ -2170,14 +2181,14 @@ public:
_LIBCPP_INLINE_VISIBILITY
__async_func(__async_func&& __f) : __f_(_VSTD::move(__f.__f_)) {}
- _Rp operator()()
+ _LIBCPP_HIDE_FROM_ABI _Rp operator()()
{
typedef typename __make_tuple_indices<1+sizeof...(_Args), 1>::type _Index;
return __execute(_Index());
}
private:
template <size_t ..._Indices>
- _Rp
+ _LIBCPP_HIDE_FROM_ABI _Rp
__execute(__tuple_indices<_Indices...>)
{
return _VSTD::__invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...);
@@ -2189,20 +2200,20 @@ inline _LIBCPP_INLINE_VISIBILITY bool __does_policy_contain(launch __policy, lau
template <class _Fp, class... _Args>
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI
-future<typename __invoke_of<typename decay<_Fp>::type, typename decay<_Args>::type...>::type>
+future<typename __invoke_of<__decay_t<_Fp>, __decay_t<_Args>...>::type>
async(launch __policy, _Fp&& __f, _Args&&... __args)
{
- typedef __async_func<typename decay<_Fp>::type, typename decay<_Args>::type...> _BF;
+ typedef __async_func<__decay_t<_Fp>, __decay_t<_Args>...> _BF;
typedef typename _BF::_Rp _Rp;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
if (__does_policy_contain(__policy, launch::async))
return _VSTD::__make_async_assoc_state<_Rp>(_BF(_LIBCPP_AUTO_CAST(_VSTD::forward<_Fp>(__f)),
_LIBCPP_AUTO_CAST(_VSTD::forward<_Args>(__args))...));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch ( ... ) { if (__policy == launch::async) throw ; }
#endif
@@ -2215,7 +2226,7 @@ async(launch __policy, _Fp&& __f, _Args&&... __args)
template <class _Fp, class... _Args>
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY
-future<typename __invoke_of<typename decay<_Fp>::type, typename decay<_Args>::type...>::type>
+future<typename __invoke_of<__decay_t<_Fp>, __decay_t<_Args>...>::type>
async(_Fp&& __f, _Args&&... __args)
{
return _VSTD::async(launch::any, _VSTD::forward<_Fp>(__f),
@@ -2243,8 +2254,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
{__rhs.__state_ = nullptr;}
- ~shared_future();
- shared_future& operator=(const shared_future& __rhs) _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI ~shared_future();
+ _LIBCPP_HIDE_FROM_ABI shared_future& operator=(const shared_future& __rhs) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
{
@@ -2313,8 +2324,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
{__rhs.__state_ = nullptr;}
- ~shared_future();
- shared_future& operator=(const shared_future& __rhs);
+ _LIBCPP_HIDE_FROM_ABI ~shared_future();
+ _LIBCPP_HIDE_FROM_ABI shared_future& operator=(const shared_future& __rhs);
_LIBCPP_INLINE_VISIBILITY
shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
{
@@ -2367,7 +2378,7 @@ shared_future<_Rp&>::operator=(const shared_future& __rhs)
}
template <>
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE shared_future<void>
+class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_FUTURE shared_future<void>
{
__assoc_sub_state* __state_;
@@ -2454,4 +2465,11 @@ _LIBCPP_END_NAMESPACE_STD
# include <chrono>
#endif
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
+# include <cstdlib>
+# include <exception>
+# include <system_error>
+#endif
+
#endif // _LIBCPP_FUTURE
diff --git a/contrib/libs/cxxsupp/libcxx/include/iomanip b/contrib/libs/cxxsupp/libcxx/include/iomanip
index 38c5c9b9c6b..53445c72ba1 100644
--- a/contrib/libs/cxxsupp/libcxx/include/iomanip
+++ b/contrib/libs/cxxsupp/libcxx/include/iomanip
@@ -301,10 +301,10 @@ template <class _CharT, class _Traits, class _MoneyT>
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
@@ -315,13 +315,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x)
__mf.get(_Ip(__is), _Ip(), __x.__intl_, __is, __err, __x.__mon_);
__is.setstate(__err);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__is.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __is;
}
@@ -361,10 +361,10 @@ template <class _CharT, class _Traits, class _MoneyT>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -374,13 +374,13 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x)
if (__mf.put(_Op(__os), __x.__intl_, __os, __os.fill(), __x.__mon_).failed())
__os.setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -420,10 +420,10 @@ template <class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
@@ -435,13 +435,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x)
__x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_));
__is.setstate(__err);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__is.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __is;
}
@@ -481,10 +481,10 @@ template <class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -495,13 +495,13 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x)
__x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_)).failed())
__os.setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -513,8 +513,6 @@ put_time(const tm* __tm, const _CharT* __fmt)
return __iom_t10<_CharT>(__tm, __fmt);
}
-#if _LIBCPP_STD_VER >= 11
-
template <class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
__quoted_output(basic_ostream<_CharT, _Traits>& __os,
@@ -622,9 +620,7 @@ __quoted(basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __delim = _CharT
return __quoted_proxy<_CharT, _Traits, _Allocator>(__s, __delim, __escape);
}
-#endif // _LIBCPP_STD_VER >= 11
-
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _CharT>
_LIBCPP_HIDE_FROM_ABI
@@ -656,7 +652,7 @@ auto quoted(basic_string_view<_CharT, _Traits> __sv, _CharT __delim = _CharT('"'
return __quoted_output_proxy<_CharT, _Traits>(__sv.data(), __sv.data() + __sv.size(), __delim, __escape);
}
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/ios b/contrib/libs/cxxsupp/libcxx/include/ios
index 9eecf4d8dd8..156f6855642 100644
--- a/contrib/libs/cxxsupp/libcxx/include/ios
+++ b/contrib/libs/cxxsupp/libcxx/include/ios
@@ -217,10 +217,15 @@ storage-class-specifier const error_category& iostream_category() noexcept;
#endif
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__fwd/ios.h>
#include <__ios/fpos.h>
#include <__locale>
+#include <__system_error/error_category.h>
+#include <__system_error/error_code.h>
+#include <__system_error/error_condition.h>
+#include <__system_error/system_error.h>
#include <__utility/swap.h>
-#include <system_error>
+#include <__verbose_abort>
#include <version>
// standard-mandated includes
@@ -229,7 +234,7 @@ storage-class-specifier const error_category& iostream_category() noexcept;
#include <iosfwd>
#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
-#include <atomic> // for __xindex_
+# include <__atomic/atomic.h> // for __xindex_
#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -240,10 +245,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
typedef ptrdiff_t streamsize;
-class _LIBCPP_TYPE_VIS ios_base
+class _LIBCPP_EXPORTED_FROM_ABI ios_base
{
public:
- class _LIBCPP_EXCEPTION_ABI failure;
+ class _LIBCPP_EXPORTED_FROM_ABI failure;
typedef unsigned int fmtflags;
static const fmtflags boolalpha = 0x0001;
@@ -290,7 +295,7 @@ public:
typedef _VSTD::streampos streampos;
#endif
- class _LIBCPP_TYPE_VIS Init;
+ class _LIBCPP_EXPORTED_FROM_ABI Init;
// 27.5.2.2 fmtflags state:
_LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
@@ -419,8 +424,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc::__lx> : public true_type { };
#endif
-_LIBCPP_FUNC_VIS
-const error_category& iostream_category() _NOEXCEPT;
+_LIBCPP_EXPORTED_FROM_ABI const error_category& iostream_category() _NOEXCEPT;
inline _LIBCPP_INLINE_VISIBILITY
error_code
@@ -436,27 +440,26 @@ make_error_condition(io_errc __e) _NOEXCEPT
return error_condition(static_cast<int>(__e), iostream_category());
}
-class _LIBCPP_EXCEPTION_ABI ios_base::failure
+class _LIBCPP_EXPORTED_FROM_ABI ios_base::failure
: public system_error
{
public:
explicit failure(const string& __msg, const error_code& __ec = io_errc::stream);
explicit failure(const char* __msg, const error_code& __ec = io_errc::stream);
- failure(const failure&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI failure(const failure&) _NOEXCEPT = default;
~failure() _NOEXCEPT override;
};
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_failure(char const* __msg) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw ios_base::failure(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("ios_base::failure was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
-class _LIBCPP_TYPE_VIS ios_base::Init
+class _LIBCPP_EXPORTED_FROM_ABI ios_base::Init
{
public:
Init();
@@ -844,6 +847,12 @@ basic_ios<_CharT, _Traits>::set_rdbuf(basic_streambuf<char_type, traits_type>* _
ios_base::set_rdbuf(__sb);
}
+extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>;
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>;
+#endif
+
_LIBCPP_HIDE_FROM_ABI inline
ios_base&
boolalpha(ios_base& __str)
@@ -1039,6 +1048,7 @@ defaultfloat(ios_base& __str)
_LIBCPP_END_NAMESPACE_STD
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
# include <cstddef>
# include <cstdlib>
@@ -1047,6 +1057,7 @@ _LIBCPP_END_NAMESPACE_STD
# include <limits>
# include <new>
# include <stdexcept>
+# include <system_error>
# include <type_traits>
# include <typeinfo>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/iosfwd b/contrib/libs/cxxsupp/libcxx/include/iosfwd
index 7948606e645..ea1a8c0ec37 100644
--- a/contrib/libs/cxxsupp/libcxx/include/iosfwd
+++ b/contrib/libs/cxxsupp/libcxx/include/iosfwd
@@ -96,8 +96,14 @@ using u32streampos = fpos<char_traits<char32_t>::state_type>;
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
+#include <__fwd/fstream.h>
+#include <__fwd/ios.h>
+#include <__fwd/istream.h>
+#include <__fwd/ostream.h>
+#include <__fwd/sstream.h>
+#include <__fwd/streambuf.h>
#include <__fwd/string.h>
-#include <__mbstate_t.h>
+#include <__std_mbstate_t.h>
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -106,114 +112,13 @@ using u32streampos = fpos<char_traits<char32_t>::state_type>;
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_TYPE_VIS ios_base;
-
-template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TEMPLATE_VIS basic_ios;
-
-template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TEMPLATE_VIS basic_streambuf;
-template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TEMPLATE_VIS basic_istream;
-template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TEMPLATE_VIS basic_ostream;
-template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TEMPLATE_VIS basic_iostream;
-
-template <class _CharT, class _Traits = char_traits<_CharT>,
- class _Allocator = allocator<_CharT> >
- class _LIBCPP_TEMPLATE_VIS basic_stringbuf;
-template <class _CharT, class _Traits = char_traits<_CharT>,
- class _Allocator = allocator<_CharT> >
- class _LIBCPP_TEMPLATE_VIS basic_istringstream;
-template <class _CharT, class _Traits = char_traits<_CharT>,
- class _Allocator = allocator<_CharT> >
- class _LIBCPP_TEMPLATE_VIS basic_ostringstream;
-template <class _CharT, class _Traits = char_traits<_CharT>,
- class _Allocator = allocator<_CharT> >
- class _LIBCPP_TEMPLATE_VIS basic_stringstream;
-
-template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TEMPLATE_VIS basic_filebuf;
-template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TEMPLATE_VIS basic_ifstream;
-template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TEMPLATE_VIS basic_ofstream;
-template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TEMPLATE_VIS basic_fstream;
+class _LIBCPP_EXPORTED_FROM_ABI ios_base;
template <class _CharT, class _Traits = char_traits<_CharT> >
class _LIBCPP_TEMPLATE_VIS istreambuf_iterator;
template <class _CharT, class _Traits = char_traits<_CharT> >
class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator;
-typedef basic_ios<char> ios;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-typedef basic_ios<wchar_t> wios;
-#endif
-
-typedef basic_streambuf<char> streambuf;
-typedef basic_istream<char> istream;
-typedef basic_ostream<char> ostream;
-typedef basic_iostream<char> iostream;
-
-typedef basic_stringbuf<char> stringbuf;
-typedef basic_istringstream<char> istringstream;
-typedef basic_ostringstream<char> ostringstream;
-typedef basic_stringstream<char> stringstream;
-
-typedef basic_filebuf<char> filebuf;
-typedef basic_ifstream<char> ifstream;
-typedef basic_ofstream<char> ofstream;
-typedef basic_fstream<char> fstream;
-
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-typedef basic_streambuf<wchar_t> wstreambuf;
-typedef basic_istream<wchar_t> wistream;
-typedef basic_ostream<wchar_t> wostream;
-typedef basic_iostream<wchar_t> wiostream;
-
-typedef basic_stringbuf<wchar_t> wstringbuf;
-typedef basic_istringstream<wchar_t> wistringstream;
-typedef basic_ostringstream<wchar_t> wostringstream;
-typedef basic_stringstream<wchar_t> wstringstream;
-
-typedef basic_filebuf<wchar_t> wfilebuf;
-typedef basic_ifstream<wchar_t> wifstream;
-typedef basic_ofstream<wchar_t> wofstream;
-typedef basic_fstream<wchar_t> wfstream;
-#endif
-
-template <class _CharT, class _Traits>
- class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wios)) basic_ios;
-
-template <class _CharT, class _Traits>
- class _LIBCPP_PREFERRED_NAME(streambuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstreambuf)) basic_streambuf;
-template <class _CharT, class _Traits>
- class _LIBCPP_PREFERRED_NAME(istream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistream)) basic_istream;
-template <class _CharT, class _Traits>
- class _LIBCPP_PREFERRED_NAME(ostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostream)) basic_ostream;
-template <class _CharT, class _Traits>
- class _LIBCPP_PREFERRED_NAME(iostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wiostream)) basic_iostream;
-
-template <class _CharT, class _Traits, class _Allocator>
- class _LIBCPP_PREFERRED_NAME(stringbuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringbuf)) basic_stringbuf;
-template <class _CharT, class _Traits, class _Allocator>
- class _LIBCPP_PREFERRED_NAME(istringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistringstream)) basic_istringstream;
-template <class _CharT, class _Traits, class _Allocator>
- class _LIBCPP_PREFERRED_NAME(ostringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostringstream)) basic_ostringstream;
-template <class _CharT, class _Traits, class _Allocator>
- class _LIBCPP_PREFERRED_NAME(stringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringstream)) basic_stringstream;
-
-template <class _CharT, class _Traits>
- class _LIBCPP_PREFERRED_NAME(filebuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfilebuf)) basic_filebuf;
-template <class _CharT, class _Traits>
- class _LIBCPP_PREFERRED_NAME(ifstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wifstream)) basic_ifstream;
-template <class _CharT, class _Traits>
- class _LIBCPP_PREFERRED_NAME(ofstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wofstream)) basic_ofstream;
-template <class _CharT, class _Traits>
- class _LIBCPP_PREFERRED_NAME(fstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfstream)) basic_fstream;
-
template <class _State> class _LIBCPP_TEMPLATE_VIS fpos;
typedef fpos<mbstate_t> streampos;
typedef fpos<mbstate_t> wstreampos;
@@ -223,13 +128,6 @@ typedef fpos<mbstate_t> u8streampos;
typedef fpos<mbstate_t> u16streampos;
typedef fpos<mbstate_t> u32streampos;
-#if defined(_NEWLIB_VERSION)
-// On newlib, off_t is 'long int'
-typedef long int streamoff; // for char_traits in <string>
-#else
-typedef long long streamoff; // for char_traits in <string>
-#endif
-
// Include other forward declarations here
template <class _Tp, class _Alloc = allocator<_Tp> >
class _LIBCPP_TEMPLATE_VIS vector;
diff --git a/contrib/libs/cxxsupp/libcxx/include/iostream b/contrib/libs/cxxsupp/libcxx/include/iostream
index d679d9932d7..568ce8caed6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/iostream
+++ b/contrib/libs/cxxsupp/libcxx/include/iostream
@@ -51,16 +51,16 @@ extern wostream wclog;
_LIBCPP_BEGIN_NAMESPACE_STD
-extern _LIBCPP_FUNC_VIS istream cin;
-extern _LIBCPP_FUNC_VIS ostream cout;
-extern _LIBCPP_FUNC_VIS ostream cerr;
-extern _LIBCPP_FUNC_VIS ostream clog;
+extern _LIBCPP_EXPORTED_FROM_ABI istream cin;
+extern _LIBCPP_EXPORTED_FROM_ABI ostream cout;
+extern _LIBCPP_EXPORTED_FROM_ABI ostream cerr;
+extern _LIBCPP_EXPORTED_FROM_ABI ostream clog;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern _LIBCPP_FUNC_VIS wistream wcin;
-extern _LIBCPP_FUNC_VIS wostream wcout;
-extern _LIBCPP_FUNC_VIS wostream wcerr;
-extern _LIBCPP_FUNC_VIS wostream wclog;
+extern _LIBCPP_EXPORTED_FROM_ABI wistream wcin;
+extern _LIBCPP_EXPORTED_FROM_ABI wostream wcout;
+extern _LIBCPP_EXPORTED_FROM_ABI wostream wcerr;
+extern _LIBCPP_EXPORTED_FROM_ABI wostream wclog;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/istream b/contrib/libs/cxxsupp/libcxx/include/istream
index 6e67d61de2a..8b440c036dd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/istream
+++ b/contrib/libs/cxxsupp/libcxx/include/istream
@@ -160,7 +160,12 @@ template <class Stream, class T>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
+#include <__fwd/istream.h>
#include <__iterator/istreambuf_iterator.h>
+#include <__type_traits/conjunction.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_base_of.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <ostream>
#include <version>
@@ -360,14 +365,14 @@ __input_arithmetic(basic_istream<_CharT, _Traits>& __is, _Tp& __n) {
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef num_get<_CharT, _Ip> _Fp;
std::use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __state, __n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -469,10 +474,10 @@ __input_arithmetic_with_numeric_limits(basic_istream<_CharT, _Traits>& __is, _Tp
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef num_get<_CharT, _Ip> _Fp;
long __temp;
@@ -491,7 +496,7 @@ __input_arithmetic_with_numeric_limits(basic_istream<_CharT, _Traits>& __is, _Tp
{
__n = static_cast<_Tp>(__temp);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -502,7 +507,7 @@ __input_arithmetic_with_numeric_limits(basic_istream<_CharT, _Traits>& __is, _Tp
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__is.setstate(__state);
}
return __is;
@@ -531,7 +536,7 @@ __input_c_string(basic_istream<_CharT, _Traits>& __is, _CharT* __p, size_t __n)
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -555,7 +560,7 @@ __input_c_string(basic_istream<_CharT, _Traits>& __is, _CharT* __p, size_t __n)
__is.width(0);
if (__s == __p)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -572,7 +577,7 @@ __input_c_string(basic_istream<_CharT, _Traits>& __is, _CharT* __p, size_t __n)
return __is;
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _CharT, class _Traits, size_t _Np>
inline _LIBCPP_INLINE_VISIBILITY
@@ -630,7 +635,7 @@ operator>>(basic_istream<char, _Traits>& __is, signed char* __s)
return __is >> (char*)__s;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template<class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
@@ -640,7 +645,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -649,7 +654,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
__state |= ios_base::eofbit | ios_base::failbit;
else
__c = _Traits::to_char_type(__i);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -693,10 +698,10 @@ basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_typ
{
if (__sb)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
while (true)
{
typename traits_type::int_type __i = this->rdbuf()->sgetc();
@@ -714,7 +719,7 @@ basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_typ
}
if (__gc_ == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -728,7 +733,7 @@ basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_typ
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -749,7 +754,7 @@ basic_istream<_CharT, _Traits>::get()
sentry __s(*this, true);
if (__s)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -758,7 +763,7 @@ basic_istream<_CharT, _Traits>::get()
__state |= ios_base::failbit | ios_base::eofbit;
else
__gc_ = 1;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -785,7 +790,7 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __
{
if (__n > 0)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -806,7 +811,7 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __
}
if (__gc_ == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -845,10 +850,10 @@ basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __s
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
while (true)
{
typename traits_type::int_type __i = this->rdbuf()->sgetc();
@@ -865,14 +870,14 @@ basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __s
++__gc_;
this->rdbuf()->sbumpc();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__state |= ios_base::badbit;
// according to the spec, exceptions here are caught but not rethrown
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (__gc_ == 0)
__state |= ios_base::failbit;
this->setstate(__state);
@@ -889,10 +894,10 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
while (true)
{
typename traits_type::int_type __i = this->rdbuf()->sgetc();
@@ -917,7 +922,7 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
this->rdbuf()->sbumpc();
++__gc_;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -932,7 +937,7 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
if (__n > 0)
*__s = char_type();
@@ -951,10 +956,10 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (__n == numeric_limits<streamsize>::max())
{
while (true)
@@ -985,7 +990,7 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
break;
}
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -996,7 +1001,7 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return *this;
@@ -1012,14 +1017,14 @@ basic_istream<_CharT, _Traits>::peek()
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__r = this->rdbuf()->sgetc();
if (traits_type::eq_int_type(__r, traits_type::eof()))
__state |= ios_base::eofbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1030,7 +1035,7 @@ basic_istream<_CharT, _Traits>::peek()
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return __r;
@@ -1045,14 +1050,14 @@ basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n)
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__gc_ = this->rdbuf()->sgetn(__s, __n);
if (__gc_ != __n)
__state |= ios_base::failbit | ios_base::eofbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1063,7 +1068,7 @@ basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -1082,10 +1087,10 @@ basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
streamsize __c = this->rdbuf()->in_avail();
switch (__c)
{
@@ -1101,7 +1106,7 @@ basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
__state |= ios_base::failbit | ios_base::eofbit;
break;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1112,7 +1117,7 @@ basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -1132,13 +1137,13 @@ basic_istream<_CharT, _Traits>::putback(char_type __c)
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf() == nullptr || this->rdbuf()->sputbackc(__c) == traits_type::eof())
__state |= ios_base::badbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1149,7 +1154,7 @@ basic_istream<_CharT, _Traits>::putback(char_type __c)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -1169,13 +1174,13 @@ basic_istream<_CharT, _Traits>::unget()
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf() == nullptr || this->rdbuf()->sungetc() == traits_type::eof())
__state |= ios_base::badbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1186,7 +1191,7 @@ basic_istream<_CharT, _Traits>::unget()
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -1205,10 +1210,10 @@ basic_istream<_CharT, _Traits>::sync()
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf() == nullptr)
return -1;
if (this->rdbuf()->pubsync() == -1)
@@ -1216,7 +1221,7 @@ basic_istream<_CharT, _Traits>::sync()
__state |= ios_base::badbit;
return -1;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1227,7 +1232,7 @@ basic_istream<_CharT, _Traits>::sync()
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return __r;
@@ -1242,12 +1247,12 @@ basic_istream<_CharT, _Traits>::tellg()
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__r = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1258,7 +1263,7 @@ basic_istream<_CharT, _Traits>::tellg()
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return __r;
@@ -1273,13 +1278,13 @@ basic_istream<_CharT, _Traits>::seekg(pos_type __pos)
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf()->pubseekpos(__pos, ios_base::in) == pos_type(-1))
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1290,7 +1295,7 @@ basic_istream<_CharT, _Traits>::seekg(pos_type __pos)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return *this;
@@ -1305,13 +1310,13 @@ basic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir)
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::in) == pos_type(-1))
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1322,7 +1327,7 @@ basic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return *this;
@@ -1336,10 +1341,10 @@ ws(basic_istream<_CharT, _Traits>& __is)
typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
while (true)
{
@@ -1353,7 +1358,7 @@ ws(basic_istream<_CharT, _Traits>& __is)
break;
__is.rdbuf()->sbumpc();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1364,7 +1369,7 @@ ws(basic_istream<_CharT, _Traits>& __is)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__is.setstate(__state);
}
return __is;
@@ -1450,7 +1455,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -1480,7 +1485,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
__is.width(0);
if (__c == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1506,7 +1511,7 @@ getline(basic_istream<_CharT, _Traits>& __is,
typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -1533,7 +1538,7 @@ getline(basic_istream<_CharT, _Traits>& __is,
}
if (__extr == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1585,7 +1590,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -1612,7 +1617,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
__x = bitset<_Size>(__str);
if (_Size > 0 && __c == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
diff --git a/contrib/libs/cxxsupp/libcxx/include/iterator b/contrib/libs/cxxsupp/libcxx/include/iterator
index 35eca67b4a5..42843781ebb 100644
--- a/contrib/libs/cxxsupp/libcxx/include/iterator
+++ b/contrib/libs/cxxsupp/libcxx/include/iterator
@@ -387,7 +387,7 @@ template <class Iterator>
class move_iterator {
public:
using iterator_type = Iterator;
- using iterator_concept = input_iterator_tag; // From C++20
+ using iterator_concept = see below; // From C++20
using iterator_category = see below; // not always present starting from C++20
using value_type = iter_value_t<Iterator>; // Until C++20, iterator_traits<Iterator>::value_type
using difference_type = iter_difference_t<Iterator>; // Until C++20, iterator_traits<Iterator>::difference_type;
@@ -676,7 +676,6 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
-#include <__debug>
#include <__iterator/access.h>
#include <__iterator/advance.h>
#include <__iterator/back_insert_iterator.h>
@@ -732,6 +731,7 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdlib>
# include <exception>
# include <new>
# include <type_traits>
diff --git a/contrib/libs/cxxsupp/libcxx/include/latch b/contrib/libs/cxxsupp/libcxx/include/latch
index ff17f8453ea..47538060eec 100644
--- a/contrib/libs/cxxsupp/libcxx/include/latch
+++ b/contrib/libs/cxxsupp/libcxx/include/latch
@@ -41,9 +41,12 @@ namespace std
*/
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__atomic/atomic_base.h>
+#include <__atomic/atomic_sync.h>
+#include <__atomic/memory_order.h>
#include <__availability>
#include <__config>
-#include <atomic>
+#include <cstddef>
#include <limits>
#include <version>
@@ -67,22 +70,35 @@ class latch
__atomic_base<ptrdiff_t> __a_;
public:
- static constexpr ptrdiff_t max() noexcept {
+ static _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t max() noexcept {
return numeric_limits<ptrdiff_t>::max();
}
inline _LIBCPP_INLINE_VISIBILITY
- constexpr explicit latch(ptrdiff_t __expected) : __a_(__expected) { }
+ constexpr explicit latch(ptrdiff_t __expected) : __a_(__expected)
+ {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__expected >= 0,
+ "latch::latch(ptrdiff_t): latch cannot be "
+ "initialized with a negative value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__expected <= max(),
+ "latch::latch(ptrdiff_t): latch cannot be "
+ "initialized with a value greater than max()");
+ }
- ~latch() = default;
+ _LIBCPP_HIDE_FROM_ABI ~latch() = default;
latch(const latch&) = delete;
latch& operator=(const latch&) = delete;
inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
void count_down(ptrdiff_t __update = 1)
{
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __update >= 0, "latch::count_down called with a negative value");
auto const __old = __a_.fetch_sub(__update, memory_order_release);
- if(__old == __update)
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __update <= __old, "latch::count_down called with a value greater "
+ "than the internal counter");
+ if (__old == __update)
__a_.notify_all();
}
inline _LIBCPP_INLINE_VISIBILITY
@@ -93,13 +109,17 @@ public:
inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
void wait() const
{
- __cxx_atomic_wait(&__a_.__a_, [&]() -> bool {
+ __cxx_atomic_wait(&__a_.__a_, [this]() -> bool {
return try_wait();
});
}
inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
void arrive_and_wait(ptrdiff_t __update = 1)
{
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __update >= 0, "latch::arrive_and_wait called with a negative value");
+ // other preconditions on __update are checked in count_down()
+
count_down(__update);
wait();
}
@@ -111,4 +131,8 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
+#endif
+
#endif //_LIBCPP_LATCH
diff --git a/contrib/libs/cxxsupp/libcxx/include/list b/contrib/libs/cxxsupp/libcxx/include/list
index a0c732739ca..37bed3cd89f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/list
+++ b/contrib/libs/cxxsupp/libcxx/include/list
@@ -46,6 +46,8 @@ public:
list(Iter first, Iter last);
template <class Iter>
list(Iter first, Iter last, const allocator_type& a);
+ template<container-compatible-range<T> R>
+ list(from_range_t, R&& rg, const Allocator& = Allocator()); // C++23
list(const list& x);
list(const list&, const allocator_type& a);
list(list&& x)
@@ -64,6 +66,8 @@ public:
list& operator=(initializer_list<value_type>);
template <class Iter>
void assign(Iter first, Iter last);
+ template<container-compatible-range<T> R>
+ void assign_range(R&& rg); // C++23
void assign(size_type n, const value_type& t);
void assign(initializer_list<value_type>);
@@ -99,8 +103,12 @@ public:
void pop_back();
void push_front(const value_type& x);
void push_front(value_type&& x);
+ template<container-compatible-range<T> R>
+ void prepend_range(R&& rg); // C++23
void push_back(const value_type& x);
void push_back(value_type&& x);
+ template<container-compatible-range<T> R>
+ void append_range(R&& rg); // C++23
template <class... Args>
iterator emplace(const_iterator position, Args&&... args);
iterator insert(const_iterator position, const value_type& x);
@@ -108,6 +116,8 @@ public:
iterator insert(const_iterator position, size_type n, const value_type& x);
template <class Iter>
iterator insert(const_iterator position, Iter first, Iter last);
+ template<container-compatible-range<T> R>
+ iterator insert_range(const_iterator position, R&& rg); // C++23
iterator insert(const_iterator position, initializer_list<value_type> il);
iterator erase(const_iterator position);
@@ -152,18 +162,25 @@ template <class InputIterator, class Allocator = allocator<typename iterator_tra
list(InputIterator, InputIterator, Allocator = Allocator())
-> list<typename iterator_traits<InputIterator>::value_type, Allocator>; // C++17
+template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
+ list(from_range_t, R&&, Allocator = Allocator())
+ -> list<ranges::range_value_t<R>, Allocator>; // C++23
+
template <class T, class Alloc>
bool operator==(const list<T,Alloc>& x, const list<T,Alloc>& y);
template <class T, class Alloc>
- bool operator< (const list<T,Alloc>& x, const list<T,Alloc>& y);
+ bool operator< (const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20
template <class T, class Alloc>
- bool operator!=(const list<T,Alloc>& x, const list<T,Alloc>& y);
+ bool operator!=(const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20
template <class T, class Alloc>
- bool operator> (const list<T,Alloc>& x, const list<T,Alloc>& y);
+ bool operator> (const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20
template <class T, class Alloc>
- bool operator>=(const list<T,Alloc>& x, const list<T,Alloc>& y);
+ bool operator>=(const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20
template <class T, class Alloc>
- bool operator<=(const list<T,Alloc>& x, const list<T,Alloc>& y);
+ bool operator<=(const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20
+template<class T, class Allocator>
+ synth-three-way-result<T> operator<=>(const list<T, Allocator>& x,
+ const list<T, Allocator>& y); // since C++20
template <class T, class Alloc>
void swap(list<T,Alloc>& x, list<T,Alloc>& y)
@@ -171,10 +188,10 @@ template <class T, class Alloc>
template <class T, class Allocator, class U>
typename list<T, Allocator>::size_type
- erase(list<T, Allocator>& c, const U& value); // C++20
+ erase(list<T, Allocator>& c, const U& value); // since C++20
template <class T, class Allocator, class Predicate>
typename list<T, Allocator>::size_type
- erase_if(list<T, Allocator>& c, Predicate pred); // C++20
+ erase_if(list<T, Allocator>& c, Predicate pred); // since C++20
} // std
@@ -183,10 +200,11 @@ template <class T, class Allocator, class Predicate>
#include <__algorithm/comp.h>
#include <__algorithm/equal.h>
#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lexicographical_compare_three_way.h>
#include <__algorithm/min.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
-#include <__debug>
#include <__format/enable_insertable.h>
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
@@ -203,13 +221,23 @@ template <class T, class Allocator, class Predicate>
#include <__memory/swap_allocator.h>
#include <__memory/unique_ptr.h>
#include <__memory_resource/polymorphic_allocator.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/container_compatible_range.h>
+#include <__ranges/from_range.h>
+#include <__type_traits/conditional.h>
#include <__type_traits/is_allocator.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_pointer.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/type_identity.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/swap.h>
#include <cstring>
#include <limits>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -320,13 +348,9 @@ class _LIBCPP_TEMPLATE_VIS __list_iterator
__link_pointer __ptr_;
_LIBCPP_INLINE_VISIBILITY
- explicit __list_iterator(__link_pointer __p, const void* __c) _NOEXCEPT
+ explicit __list_iterator(__link_pointer __p) _NOEXCEPT
: __ptr_(__p)
{
- (void)__c;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __get_db()->__insert_ic(this, __c);
-#endif
}
template<class, class> friend class list;
@@ -342,57 +366,22 @@ public:
_LIBCPP_INLINE_VISIBILITY
__list_iterator() _NOEXCEPT : __ptr_(nullptr)
{
- _VSTD::__debug_db_insert_i(this);
- }
-
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
- _LIBCPP_INLINE_VISIBILITY
- __list_iterator(const __list_iterator& __p)
- : __ptr_(__p.__ptr_)
- {
- __get_db()->__iterator_copy(this, _VSTD::addressof(__p));
- }
-
- _LIBCPP_INLINE_VISIBILITY
- ~__list_iterator()
- {
- __get_db()->__erase_i(this);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __list_iterator& operator=(const __list_iterator& __p)
- {
- if (this != _VSTD::addressof(__p))
- {
- __get_db()->__iterator_copy(this, _VSTD::addressof(__p));
- __ptr_ = __p.__ptr_;
- }
- return *this;
}
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
_LIBCPP_INLINE_VISIBILITY
reference operator*() const
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable list::iterator");
return __ptr_->__as_node()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable list::iterator");
return pointer_traits<pointer>::pointer_to(__ptr_->__as_node()->__value_);
}
_LIBCPP_INLINE_VISIBILITY
__list_iterator& operator++()
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment a non-incrementable list::iterator");
__ptr_ = __ptr_->__next_;
return *this;
}
@@ -402,8 +391,6 @@ public:
_LIBCPP_INLINE_VISIBILITY
__list_iterator& operator--()
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__decrementable(this),
- "Attempted to decrement a non-decrementable list::iterator");
__ptr_ = __ptr_->__prev_;
return *this;
}
@@ -429,13 +416,9 @@ class _LIBCPP_TEMPLATE_VIS __list_const_iterator
__link_pointer __ptr_;
_LIBCPP_INLINE_VISIBILITY
- explicit __list_const_iterator(__link_pointer __p, const void* __c) _NOEXCEPT
+ explicit __list_const_iterator(__link_pointer __p) _NOEXCEPT
: __ptr_(__p)
{
- (void)__c;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __get_db()->__insert_ic(this, __c);
-#endif
}
template<class, class> friend class list;
@@ -450,64 +433,27 @@ public:
_LIBCPP_INLINE_VISIBILITY
__list_const_iterator() _NOEXCEPT : __ptr_(nullptr)
{
- _VSTD::__debug_db_insert_i(this);
}
_LIBCPP_INLINE_VISIBILITY
__list_const_iterator(const __list_iterator<_Tp, _VoidPtr>& __p) _NOEXCEPT
: __ptr_(__p.__ptr_)
{
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __get_db()->__iterator_copy(this, _VSTD::addressof(__p));
-#endif
- }
-
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
- _LIBCPP_INLINE_VISIBILITY
- __list_const_iterator(const __list_const_iterator& __p)
- : __ptr_(__p.__ptr_)
- {
- __get_db()->__iterator_copy(this, _VSTD::addressof(__p));
- }
-
- _LIBCPP_INLINE_VISIBILITY
- ~__list_const_iterator()
- {
- __get_db()->__erase_i(this);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __list_const_iterator& operator=(const __list_const_iterator& __p)
- {
- if (this != _VSTD::addressof(__p))
- {
- __get_db()->__iterator_copy(this, _VSTD::addressof(__p));
- __ptr_ = __p.__ptr_;
- }
- return *this;
}
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
_LIBCPP_INLINE_VISIBILITY
reference operator*() const
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable list::const_iterator");
return __ptr_->__as_node()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable list::const_iterator");
return pointer_traits<pointer>::pointer_to(__ptr_->__as_node()->__value_);
}
_LIBCPP_INLINE_VISIBILITY
__list_const_iterator& operator++()
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment a non-incrementable list::const_iterator");
__ptr_ = __ptr_->__next_;
return *this;
}
@@ -517,8 +463,6 @@ public:
_LIBCPP_INLINE_VISIBILITY
__list_const_iterator& operator--()
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__decrementable(this),
- "Attempted to decrement a non-decrementable list::const_iterator");
__ptr_ = __ptr_->__prev_;
return *this;
}
@@ -604,35 +548,35 @@ protected:
_LIBCPP_INLINE_VISIBILITY
__list_imp(const __node_allocator& __a);
#ifndef _LIBCPP_CXX03_LANG
- __list_imp(__node_allocator&& __a) _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI __list_imp(__node_allocator&& __a) _NOEXCEPT;
#endif
- ~__list_imp();
- void clear() _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI ~__list_imp();
+ _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
bool empty() const _NOEXCEPT {return __sz() == 0;}
_LIBCPP_INLINE_VISIBILITY
iterator begin() _NOEXCEPT
{
- return iterator(__end_.__next_, this);
+ return iterator(__end_.__next_);
}
_LIBCPP_INLINE_VISIBILITY
const_iterator begin() const _NOEXCEPT
{
- return const_iterator(__end_.__next_, this);
+ return const_iterator(__end_.__next_);
}
_LIBCPP_INLINE_VISIBILITY
iterator end() _NOEXCEPT
{
- return iterator(__end_as_link(), this);
+ return iterator(__end_as_link());
}
_LIBCPP_INLINE_VISIBILITY
const_iterator end() const _NOEXCEPT
{
- return const_iterator(__end_as_link(), this);
+ return const_iterator(__end_as_link());
}
- void swap(__list_imp& __c)
+ _LIBCPP_HIDE_FROM_ABI void swap(__list_imp& __c)
#if _LIBCPP_STD_VER >= 14
_NOEXCEPT;
#else
@@ -718,7 +662,6 @@ inline __list_imp<_Tp, _Alloc>::__list_imp(__node_allocator&& __a) _NOEXCEPT
template <class _Tp, class _Alloc>
__list_imp<_Tp, _Alloc>::~__list_imp() {
clear();
- std::__debug_db_erase_c(this);
}
template <class _Tp, class _Alloc>
@@ -739,7 +682,6 @@ __list_imp<_Tp, _Alloc>::clear() _NOEXCEPT
__node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
__node_alloc_traits::deallocate(__na, __np, 1);
}
- std::__debug_db_invalidate_all(this);
}
}
@@ -753,10 +695,10 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
__is_nothrow_swappable<allocator_type>::value)
#endif
{
- _LIBCPP_ASSERT(__alloc_traits::propagate_on_container_swap::value ||
- this->__node_alloc() == __c.__node_alloc(),
- "list::swap: Either propagate_on_container_swap must be true"
- " or the allocators must compare equal");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__alloc_traits::propagate_on_container_swap::value ||
+ this->__node_alloc() == __c.__node_alloc(),
+ "list::swap: Either propagate_on_container_swap must be true"
+ " or the allocators must compare equal");
using _VSTD::swap;
_VSTD::__swap_allocator(__node_alloc(), __c.__node_alloc());
swap(__sz(), __c.__sz());
@@ -769,42 +711,6 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
__c.__end_.__next_ = __c.__end_.__prev_ = __c.__end_as_link();
else
__c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_ = __c.__end_as_link();
-
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __libcpp_db* __db = __get_db();
- __c_node* __cn1 = __db->__find_c_and_lock(this);
- __c_node* __cn2 = __db->__find_c(_VSTD::addressof(__c));
- _VSTD::swap(__cn1->beg_, __cn2->beg_);
- _VSTD::swap(__cn1->end_, __cn2->end_);
- _VSTD::swap(__cn1->cap_, __cn2->cap_);
- for (__i_node** __p = __cn1->end_; __p != __cn1->beg_;)
- {
- --__p;
- const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
- if (__i->__ptr_ == __c.__end_as_link())
- {
- __cn2->__add(*__p);
- if (--__cn1->end_ != __p)
- _VSTD::memmove(__p, __p+1, (__cn1->end_ - __p)*sizeof(__i_node*));
- }
- else
- (*__p)->__c_ = __cn1;
- }
- for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
- {
- --__p;
- const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
- if (__i->__ptr_ == __end_as_link())
- {
- __cn1->__add(*__p);
- if (--__cn2->end_ != __p)
- _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
- }
- else
- (*__p)->__c_ = __cn2;
- }
- __db->unlock();
-#endif
}
template <class _Tp, class _Alloc /*= allocator<_Tp>*/>
@@ -824,7 +730,7 @@ public:
typedef _Tp value_type;
typedef _Alloc allocator_type;
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
- "Invalid allocator::value_type");
+ "Allocator::value_type must be same type as value_type");
typedef value_type& reference;
typedef const value_type& const_reference;
typedef typename base::pointer pointer;
@@ -835,7 +741,7 @@ public:
typedef typename base::const_iterator const_iterator;
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef size_type __remove_return_type;
#else
typedef void __remove_return_type;
@@ -849,40 +755,45 @@ public:
list()
_NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
{
- _VSTD::__debug_db_insert_c(this);
}
_LIBCPP_INLINE_VISIBILITY
explicit list(const allocator_type& __a) : base(__a)
{
- _VSTD::__debug_db_insert_c(this);
}
- explicit list(size_type __n);
-#if _LIBCPP_STD_VER > 11
- explicit list(size_type __n, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI explicit list(size_type __n);
+#if _LIBCPP_STD_VER >= 14
+ _LIBCPP_HIDE_FROM_ABI explicit list(size_type __n, const allocator_type& __a);
#endif
- list(size_type __n, const value_type& __x);
+ _LIBCPP_HIDE_FROM_ABI list(size_type __n, const value_type& __x);
template <class = __enable_if_t<__is_allocator<_Alloc>::value> >
- list(size_type __n, const value_type& __x, const allocator_type& __a) : base(__a)
+ _LIBCPP_HIDE_FROM_ABI list(size_type __n, const value_type& __x, const allocator_type& __a) : base(__a)
{
- _VSTD::__debug_db_insert_c(this);
for (; __n > 0; --__n)
push_back(__x);
}
template <class _InpIter>
- list(_InpIter __f, _InpIter __l,
- __enable_if_t<__is_cpp17_input_iterator<_InpIter>::value>* = 0);
+ _LIBCPP_HIDE_FROM_ABI list(_InpIter __f, _InpIter __l,
+ __enable_if_t<__has_input_iterator_category<_InpIter>::value>* = 0);
template <class _InpIter>
- list(_InpIter __f, _InpIter __l, const allocator_type& __a,
- __enable_if_t<__is_cpp17_input_iterator<_InpIter>::value>* = 0);
+ _LIBCPP_HIDE_FROM_ABI list(_InpIter __f, _InpIter __l, const allocator_type& __a,
+ __enable_if_t<__has_input_iterator_category<_InpIter>::value>* = 0);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI list(from_range_t, _Range&& __range,
+ const allocator_type& __a = allocator_type()) : base(__a) {
+ prepend_range(std::forward<_Range>(__range));
+ }
+#endif
- list(const list& __c);
- list(const list& __c, const __type_identity_t<allocator_type>& __a);
+ _LIBCPP_HIDE_FROM_ABI list(const list& __c);
+ _LIBCPP_HIDE_FROM_ABI list(const list& __c, const __type_identity_t<allocator_type>& __a);
_LIBCPP_INLINE_VISIBILITY
list& operator=(const list& __c);
#ifndef _LIBCPP_CXX03_LANG
- list(initializer_list<value_type> __il);
- list(initializer_list<value_type> __il, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI list(initializer_list<value_type> __il);
+ _LIBCPP_HIDE_FROM_ABI list(initializer_list<value_type> __il, const allocator_type& __a);
_LIBCPP_INLINE_VISIBILITY
list(list&& __c)
@@ -905,9 +816,18 @@ public:
#endif // _LIBCPP_CXX03_LANG
template <class _InpIter>
- void assign(_InpIter __f, _InpIter __l,
- __enable_if_t<__is_cpp17_input_iterator<_InpIter>::value>* = 0);
- void assign(size_type __n, const value_type& __x);
+ _LIBCPP_HIDE_FROM_ABI void assign(_InpIter __f, _InpIter __l,
+ __enable_if_t<__has_input_iterator_category<_InpIter>::value>* = 0);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void assign_range(_Range&& __range) {
+ __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
+ }
+#endif
+
+ _LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __x);
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT;
@@ -959,56 +879,70 @@ public:
_LIBCPP_INLINE_VISIBILITY
reference front()
{
- _LIBCPP_ASSERT(!empty(), "list::front called on empty list");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::front called on empty list");
return base::__end_.__next_->__as_node()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
const_reference front() const
{
- _LIBCPP_ASSERT(!empty(), "list::front called on empty list");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::front called on empty list");
return base::__end_.__next_->__as_node()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
reference back()
{
- _LIBCPP_ASSERT(!empty(), "list::back called on empty list");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::back called on empty list");
return base::__end_.__prev_->__as_node()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
const_reference back() const
{
- _LIBCPP_ASSERT(!empty(), "list::back called on empty list");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::back called on empty list");
return base::__end_.__prev_->__as_node()->__value_;
}
#ifndef _LIBCPP_CXX03_LANG
- void push_front(value_type&& __x);
- void push_back(value_type&& __x);
+ _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __x);
+ _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __x);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void prepend_range(_Range&& __range) {
+ insert_range(begin(), std::forward<_Range>(__range));
+ }
+
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void append_range(_Range&& __range) {
+ insert_range(end(), std::forward<_Range>(__range));
+ }
+#endif
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
- reference emplace_front(_Args&&... __args);
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args);
#else
- void emplace_front(_Args&&... __args);
+ _LIBCPP_HIDE_FROM_ABI void emplace_front(_Args&&... __args);
#endif
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
- reference emplace_back(_Args&&... __args);
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_HIDE_FROM_ABI reference emplace_back(_Args&&... __args);
#else
- void emplace_back(_Args&&... __args);
+ _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);
#endif
template <class... _Args>
- iterator emplace(const_iterator __p, _Args&&... __args);
+ _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __p, _Args&&... __args);
- iterator insert(const_iterator __p, value_type&& __x);
+ _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __x);
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, initializer_list<value_type> __il)
{return insert(__p, __il.begin(), __il.end());}
#endif // _LIBCPP_CXX03_LANG
- void push_front(const value_type& __x);
- void push_back(const value_type& __x);
+ _LIBCPP_HIDE_FROM_ABI void push_front(const value_type& __x);
+ _LIBCPP_HIDE_FROM_ABI void push_back(const value_type& __x);
#ifndef _LIBCPP_CXX03_LANG
template <class _Arg>
@@ -1019,11 +953,19 @@ public:
void __emplace_back(value_type const& __arg) { push_back(__arg); }
#endif
- iterator insert(const_iterator __p, const value_type& __x);
- iterator insert(const_iterator __p, size_type __n, const value_type& __x);
+ _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __x);
+ _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, size_type __n, const value_type& __x);
template <class _InpIter>
- iterator insert(const_iterator __p, _InpIter __f, _InpIter __l,
- __enable_if_t<__is_cpp17_input_iterator<_InpIter>::value>* = 0);
+ _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _InpIter __f, _InpIter __l,
+ __enable_if_t<__has_input_iterator_category<_InpIter>::value>* = 0);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ iterator insert_range(const_iterator __position, _Range&& __range) {
+ return __insert_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));
+ }
+#endif
_LIBCPP_INLINE_VISIBILITY
void swap(list& __c)
@@ -1037,16 +979,16 @@ public:
_LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {base::clear();}
- void pop_front();
- void pop_back();
+ _LIBCPP_HIDE_FROM_ABI void pop_front();
+ _LIBCPP_HIDE_FROM_ABI void pop_back();
- iterator erase(const_iterator __p);
- iterator erase(const_iterator __f, const_iterator __l);
+ _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p);
+ _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l);
- void resize(size_type __n);
- void resize(size_type __n, const value_type& __x);
+ _LIBCPP_HIDE_FROM_ABI void resize(size_type __n);
+ _LIBCPP_HIDE_FROM_ABI void resize(size_type __n, const value_type& __x);
- void splice(const_iterator __p, list& __c);
+ _LIBCPP_HIDE_FROM_ABI void splice(const_iterator __p, list& __c);
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void splice(const_iterator __p, list&& __c) {splice(__p, __c);}
@@ -1057,15 +999,16 @@ public:
void splice(const_iterator __p, list&& __c, const_iterator __f, const_iterator __l)
{splice(__p, __c, __f, __l);}
#endif
- void splice(const_iterator __p, list& __c, const_iterator __i);
- void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l);
+ _LIBCPP_HIDE_FROM_ABI void splice(const_iterator __p, list& __c, const_iterator __i);
+ _LIBCPP_HIDE_FROM_ABI void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l);
- __remove_return_type remove(const value_type& __x);
- template <class _Pred> __remove_return_type remove_if(_Pred __pred);
+ _LIBCPP_HIDE_FROM_ABI __remove_return_type remove(const value_type& __x);
+ template <class _Pred>
+ _LIBCPP_HIDE_FROM_ABI __remove_return_type remove_if(_Pred __pred);
_LIBCPP_INLINE_VISIBILITY
__remove_return_type unique() { return unique(__equal_to()); }
template <class _BinaryPred>
- __remove_return_type unique(_BinaryPred __binary_pred);
+ _LIBCPP_HIDE_FROM_ABI __remove_return_type unique(_BinaryPred __binary_pred);
_LIBCPP_INLINE_VISIBILITY
void merge(list& __c);
#ifndef _LIBCPP_CXX03_LANG
@@ -1077,7 +1020,7 @@ public:
void merge(list&& __c, _Comp __comp) {merge(__c, __comp);}
#endif
template <class _Comp>
- void merge(list& __c, _Comp __comp);
+ _LIBCPP_HIDE_FROM_ABI void merge(list& __c, _Comp __comp);
_LIBCPP_INLINE_VISIBILITY
void sort();
@@ -1085,9 +1028,9 @@ public:
_LIBCPP_INLINE_VISIBILITY
void sort(_Comp __comp);
- void reverse() _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI void reverse() _NOEXCEPT;
- bool __invariants() const;
+ _LIBCPP_HIDE_FROM_ABI bool __invariants() const;
typedef __allocator_destructor<__node_allocator> __node_destructor;
typedef unique_ptr<__node, __node_destructor> __hold_pointer;
@@ -1099,35 +1042,35 @@ public:
return __hold_pointer(__p, __node_destructor(__na, 1));
}
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
- bool __dereferenceable(const const_iterator* __i) const;
- bool __decrementable(const const_iterator* __i) const;
- bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
- bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
+private:
+ template <class _Iterator, class _Sentinel>
+ _LIBCPP_HIDE_FROM_ABI
+ void __assign_with_sentinel(_Iterator __f, _Sentinel __l);
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
+ template <class _Iterator, class _Sentinel>
+ _LIBCPP_HIDE_FROM_ABI
+ iterator __insert_with_sentinel(const_iterator __p, _Iterator __f, _Sentinel __l);
-private:
_LIBCPP_INLINE_VISIBILITY
static void __link_nodes (__link_pointer __p, __link_pointer __f, __link_pointer __l);
_LIBCPP_INLINE_VISIBILITY
void __link_nodes_at_front(__link_pointer __f, __link_pointer __l);
_LIBCPP_INLINE_VISIBILITY
void __link_nodes_at_back (__link_pointer __f, __link_pointer __l);
- iterator __iterator(size_type __n);
+ _LIBCPP_HIDE_FROM_ABI iterator __iterator(size_type __n);
+ // TODO: Make this _LIBCPP_HIDE_FROM_ABI
template <class _Comp>
- static iterator __sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp);
+ _LIBCPP_HIDDEN static iterator __sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp);
- void __move_assign(list& __c, true_type)
+ _LIBCPP_HIDE_FROM_ABI void __move_assign(list& __c, true_type)
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value);
- void __move_assign(list& __c, false_type);
+ _LIBCPP_HIDE_FROM_ABI void __move_assign(list& __c, false_type);
};
#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Alloc>::value>
>
list(_InputIterator, _InputIterator)
@@ -1135,13 +1078,22 @@ list(_InputIterator, _InputIterator)
template<class _InputIterator,
class _Alloc,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Alloc>::value>
>
list(_InputIterator, _InputIterator, _Alloc)
-> list<__iter_value_type<_InputIterator>, _Alloc>;
#endif
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range,
+ class _Alloc = allocator<ranges::range_value_t<_Range>>,
+ class = enable_if_t<__is_allocator<_Alloc>::value>
+ >
+list(from_range_t, _Range&&, _Alloc = _Alloc())
+ -> list<ranges::range_value_t<_Range>, _Alloc>;
+#endif
+
// Link in nodes [__f, __l] just prior to __p
template <class _Tp, class _Alloc>
inline
@@ -1191,7 +1143,6 @@ list<_Tp, _Alloc>::__iterator(size_type __n)
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(size_type __n)
{
- _VSTD::__debug_db_insert_c(this);
for (; __n > 0; --__n)
#ifndef _LIBCPP_CXX03_LANG
emplace_back();
@@ -1200,11 +1151,10 @@ list<_Tp, _Alloc>::list(size_type __n)
#endif
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)
{
- _VSTD::__debug_db_insert_c(this);
for (; __n > 0; --__n)
emplace_back();
}
@@ -1213,7 +1163,6 @@ list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(size_type __n, const value_type& __x)
{
- _VSTD::__debug_db_insert_c(this);
for (; __n > 0; --__n)
push_back(__x);
}
@@ -1221,9 +1170,8 @@ list<_Tp, _Alloc>::list(size_type __n, const value_type& __x)
template <class _Tp, class _Alloc>
template <class _InpIter>
list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l,
- __enable_if_t<__is_cpp17_input_iterator<_InpIter>::value>*)
+ __enable_if_t<__has_input_iterator_category<_InpIter>::value>*)
{
- _VSTD::__debug_db_insert_c(this);
for (; __f != __l; ++__f)
__emplace_back(*__f);
}
@@ -1231,10 +1179,9 @@ list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l,
template <class _Tp, class _Alloc>
template <class _InpIter>
list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, const allocator_type& __a,
- __enable_if_t<__is_cpp17_input_iterator<_InpIter>::value>*)
+ __enable_if_t<__has_input_iterator_category<_InpIter>::value>*)
: base(__a)
{
- _VSTD::__debug_db_insert_c(this);
for (; __f != __l; ++__f)
__emplace_back(*__f);
}
@@ -1243,7 +1190,6 @@ template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(const list& __c)
: base(__node_alloc_traits::select_on_container_copy_construction(
__c.__node_alloc())) {
- _VSTD::__debug_db_insert_c(this);
for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)
push_back(*__i);
}
@@ -1252,7 +1198,6 @@ template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(const list& __c, const __type_identity_t<allocator_type>& __a)
: base(__a)
{
- _VSTD::__debug_db_insert_c(this);
for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)
push_back(*__i);
}
@@ -1263,7 +1208,6 @@ template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a)
: base(__a)
{
- _VSTD::__debug_db_insert_c(this);
for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),
__e = __il.end(); __i != __e; ++__i)
push_back(*__i);
@@ -1272,7 +1216,6 @@ list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type&
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(initializer_list<value_type> __il)
{
- _VSTD::__debug_db_insert_c(this);
for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),
__e = __il.end(); __i != __e; ++__i)
push_back(*__i);
@@ -1282,7 +1225,6 @@ template <class _Tp, class _Alloc>
inline list<_Tp, _Alloc>::list(list&& __c)
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
: base(_VSTD::move(__c.__node_alloc())) {
- _VSTD::__debug_db_insert_c(this);
splice(end(), __c);
}
@@ -1291,7 +1233,6 @@ inline
list<_Tp, _Alloc>::list(list&& __c, const __type_identity_t<allocator_type>& __a)
: base(__a)
{
- _VSTD::__debug_db_insert_c(this);
if (__a == __c.get_allocator())
splice(end(), __c);
else
@@ -1356,17 +1297,23 @@ template <class _Tp, class _Alloc>
template <class _InpIter>
void
list<_Tp, _Alloc>::assign(_InpIter __f, _InpIter __l,
- __enable_if_t<__is_cpp17_input_iterator<_InpIter>::value>*)
+ __enable_if_t<__has_input_iterator_category<_InpIter>::value>*)
{
+ __assign_with_sentinel(__f, __l);
+}
+
+template <class _Tp, class _Alloc>
+template <class _Iterator, class _Sentinel>
+_LIBCPP_HIDE_FROM_ABI
+void list<_Tp, _Alloc>::__assign_with_sentinel(_Iterator __f, _Sentinel __l) {
iterator __i = begin();
iterator __e = end();
for (; __f != __l && __i != __e; ++__f, (void) ++__i)
*__i = *__f;
if (__i == __e)
- insert(__e, __f, __l);
+ __insert_with_sentinel(__e, std::move(__f), std::move(__l));
else
erase(__i, __e);
- std::__debug_db_invalidate_all(this);
}
template <class _Tp, class _Alloc>
@@ -1381,7 +1328,6 @@ list<_Tp, _Alloc>::assign(size_type __n, const value_type& __x)
insert(__e, __n, __x);
else
erase(__i, __e);
- std::__debug_db_invalidate_all(this);
}
template <class _Tp, class _Alloc>
@@ -1396,23 +1342,19 @@ template <class _Tp, class _Alloc>
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "list::insert(iterator, x) called with an iterator not referring to this list");
__node_allocator& __na = base::__node_alloc();
__hold_pointer __hold = __allocate_node(__na);
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
__link_nodes(__p.__ptr_, __hold->__as_link(), __hold->__as_link());
++base::__sz();
- return iterator(__hold.release()->__as_link(), this);
+ return iterator(__hold.release()->__as_link());
}
template <class _Tp, class _Alloc>
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& __x)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "list::insert(iterator, n, x) called with an iterator not referring to this list");
- iterator __r(__p.__ptr_, this);
+ iterator __r(__p.__ptr_);
if (__n > 0)
{
size_type __ds = 0;
@@ -1420,13 +1362,13 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
__hold_pointer __hold = __allocate_node(__na);
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
++__ds;
- __r = iterator(__hold->__as_link(), this);
+ __r = iterator(__hold->__as_link());
__hold.release();
iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, (void) ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
@@ -1435,7 +1377,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1446,11 +1388,11 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
__node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
if (__prev == 0)
break;
- __e = iterator(__prev, this);
+ __e = iterator(__prev);
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
@@ -1461,11 +1403,17 @@ template <class _Tp, class _Alloc>
template <class _InpIter>
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
- __enable_if_t<__is_cpp17_input_iterator<_InpIter>::value>*)
+ __enable_if_t<__has_input_iterator_category<_InpIter>::value>*)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "list::insert(iterator, range) called with an iterator not referring to this list");
- iterator __r(__p.__ptr_, this);
+ return __insert_with_sentinel(__p, __f, __l);
+}
+
+template <class _Tp, class _Alloc>
+template <class _Iterator, class _Sentinel>
+_LIBCPP_HIDE_FROM_ABI
+typename list<_Tp, _Alloc>::iterator
+list<_Tp, _Alloc>::__insert_with_sentinel(const_iterator __p, _Iterator __f, _Sentinel __l) {
+ iterator __r(__p.__ptr_);
if (__f != __l)
{
size_type __ds = 0;
@@ -1473,13 +1421,13 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
__hold_pointer __hold = __allocate_node(__na);
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
++__ds;
- __r = iterator(__hold.get()->__as_link(), this);
+ __r = iterator(__hold.get()->__as_link());
__hold.release();
iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (++__f; __f != __l; ++__f, (void) ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
@@ -1488,7 +1436,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1499,11 +1447,11 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
__node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
if (__prev == 0)
break;
- __e = iterator(__prev, this);
+ __e = iterator(__prev);
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
@@ -1563,7 +1511,7 @@ list<_Tp, _Alloc>::push_back(value_type&& __x)
template <class _Tp, class _Alloc>
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typename list<_Tp, _Alloc>::reference
#else
void
@@ -1575,7 +1523,7 @@ list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
__link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link());
++base::__sz();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return __hold.release()->__value_;
#else
__hold.release();
@@ -1584,7 +1532,7 @@ list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
template <class _Tp, class _Alloc>
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typename list<_Tp, _Alloc>::reference
#else
void
@@ -1597,7 +1545,7 @@ list<_Tp, _Alloc>::emplace_back(_Args&&... __args)
__link_pointer __nl = __hold->__as_link();
__link_nodes_at_back(__nl, __nl);
++base::__sz();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return __hold.release()->__value_;
#else
__hold.release();
@@ -1609,8 +1557,6 @@ template <class... _Args>
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "list::emplace(iterator, args...) called with an iterator not referring to this list");
__node_allocator& __na = base::__node_alloc();
__hold_pointer __hold = __allocate_node(__na);
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
@@ -1618,15 +1564,13 @@ list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
__link_nodes(__p.__ptr_, __nl, __nl);
++base::__sz();
__hold.release();
- return iterator(__nl, this);
+ return iterator(__nl);
}
template <class _Tp, class _Alloc>
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "list::insert(iterator, x) called with an iterator not referring to this list");
__node_allocator& __na = base::__node_alloc();
__hold_pointer __hold = __allocate_node(__na);
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
@@ -1634,7 +1578,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
__link_nodes(__p.__ptr_, __nl, __nl);
++base::__sz();
__hold.release();
- return iterator(__nl, this);
+ return iterator(__nl);
}
#endif // _LIBCPP_CXX03_LANG
@@ -1643,26 +1587,11 @@ template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::pop_front()
{
- _LIBCPP_ASSERT(!empty(), "list::pop_front() called with empty list");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::pop_front() called with empty list");
__node_allocator& __na = base::__node_alloc();
__link_pointer __n = base::__end_.__next_;
base::__unlink_nodes(__n, __n);
--base::__sz();
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __p = __c->end_; __p != __c->beg_; )
- {
- --__p;
- iterator* __i = static_cast<iterator*>((*__p)->__i_);
- if (__i->__ptr_ == __n)
- {
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
- }
- }
- __get_db()->unlock();
-#endif
__node_pointer __np = __n->__as_node();
__node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
__node_alloc_traits::deallocate(__na, __np, 1);
@@ -1672,26 +1601,11 @@ template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::pop_back()
{
- _LIBCPP_ASSERT(!empty(), "list::pop_back() called on an empty list");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::pop_back() called on an empty list");
__node_allocator& __na = base::__node_alloc();
__link_pointer __n = base::__end_.__prev_;
base::__unlink_nodes(__n, __n);
--base::__sz();
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __p = __c->end_; __p != __c->beg_; )
- {
- --__p;
- iterator* __i = static_cast<iterator*>((*__p)->__i_);
- if (__i->__ptr_ == __n)
- {
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
- }
- }
- __get_db()->unlock();
-#endif
__node_pointer __np = __n->__as_node();
__node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
__node_alloc_traits::deallocate(__na, __np, 1);
@@ -1701,44 +1615,23 @@ template <class _Tp, class _Alloc>
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::erase(const_iterator __p)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "list::erase(iterator) called with an iterator not referring to this list");
- _LIBCPP_ASSERT(__p != end(),
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__p != end(),
"list::erase(iterator) called with a non-dereferenceable iterator");
__node_allocator& __na = base::__node_alloc();
__link_pointer __n = __p.__ptr_;
__link_pointer __r = __n->__next_;
base::__unlink_nodes(__n, __n);
--base::__sz();
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __ip = __c->end_; __ip != __c->beg_; )
- {
- --__ip;
- iterator* __i = static_cast<iterator*>((*__ip)->__i_);
- if (__i->__ptr_ == __n)
- {
- (*__ip)->__c_ = nullptr;
- if (--__c->end_ != __ip)
- _VSTD::memmove(__ip, __ip+1, (__c->end_ - __ip)*sizeof(__i_node*));
- }
- }
- __get_db()->unlock();
-#endif
__node_pointer __np = __n->__as_node();
__node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
__node_alloc_traits::deallocate(__na, __np, 1);
- return iterator(__r, this);
+ return iterator(__r);
}
template <class _Tp, class _Alloc>
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__f)) == this,
- "list::erase(iterator, iterator) called with an iterator not referring to this list");
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__l)) == this,
- "list::erase(iterator, iterator) called with an iterator not referring to this list");
if (__f != __l)
{
__node_allocator& __na = base::__node_alloc();
@@ -1748,27 +1641,12 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
__link_pointer __n = __f.__ptr_;
++__f;
--base::__sz();
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __p = __c->end_; __p != __c->beg_; )
- {
- --__p;
- iterator* __i = static_cast<iterator*>((*__p)->__i_);
- if (__i->__ptr_ == __n)
- {
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
- }
- }
- __get_db()->unlock();
-#endif
__node_pointer __np = __n->__as_node();
__node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
__node_alloc_traits::deallocate(__na, __np, 1);
}
}
- return iterator(__l.__ptr_, this);
+ return iterator(__l.__ptr_);
}
template <class _Tp, class _Alloc>
@@ -1785,12 +1663,12 @@ list<_Tp, _Alloc>::resize(size_type __n)
__hold_pointer __hold = __allocate_node(__na);
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
++__ds;
- iterator __r = iterator(__hold.release()->__as_link(), this);
+ iterator __r = iterator(__hold.release()->__as_link());
iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, (void) ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
@@ -1799,7 +1677,7 @@ list<_Tp, _Alloc>::resize(size_type __n)
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1810,11 +1688,11 @@ list<_Tp, _Alloc>::resize(size_type __n)
__node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
if (__prev == 0)
break;
- __e = iterator(__prev, this);
+ __e = iterator(__prev);
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__link_nodes_at_back(__r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
@@ -1835,12 +1713,12 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
++__ds;
__link_pointer __nl = __hold.release()->__as_link();
- iterator __r = iterator(__nl, this);
+ iterator __r = iterator(__nl);
iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, (void) ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
@@ -1849,7 +1727,7 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1860,11 +1738,11 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
__node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
if (__prev == 0)
break;
- __e = iterator(__prev, this);
+ __e = iterator(__prev);
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__link_nodes(base::__end_as_link(), __r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
@@ -1874,10 +1752,8 @@ template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
{
- _LIBCPP_ASSERT(this != _VSTD::addressof(__c),
- "list::splice(iterator, list) called with this == &list");
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "list::splice(iterator, list) called with an iterator not referring to this list");
+ _LIBCPP_ASSERT_VALID_INPUT_RANGE(this != _VSTD::addressof(__c),
+ "list::splice(iterator, list) called with this == &list");
if (!__c.empty())
{
__link_pointer __f = __c.__end_.__next_;
@@ -1886,26 +1762,6 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
__link_nodes(__p.__ptr_, __f, __l);
base::__sz() += __c.__sz();
__c.__sz() = 0;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- if (_VSTD::addressof(__c) != this) {
- __libcpp_db* __db = __get_db();
- __c_node* __cn1 = __db->__find_c_and_lock(this);
- __c_node* __cn2 = __db->__find_c(_VSTD::addressof(__c));
- for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;)
- {
- --__ip;
- iterator* __i = static_cast<iterator*>((*__ip)->__i_);
- if (__i->__ptr_ != __c.__end_as_link())
- {
- __cn1->__add(*__ip);
- (*__ip)->__c_ = __cn1;
- if (--__cn2->end_ != __ip)
- _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
- }
- }
- __db->unlock();
- }
-#endif
}
}
@@ -1913,13 +1769,6 @@ template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "list::splice(iterator, list, iterator) called with the first iterator not referring to this list");
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__i)) == _VSTD::addressof(__c),
- "list::splice(iterator, list, iterator) called with the second iterator not referring to the list argument");
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(_VSTD::addressof(__i)),
- "list::splice(iterator, list, iterator) called with the second iterator not dereferenceable");
-
if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_)
{
__link_pointer __f = __i.__ptr_;
@@ -1927,26 +1776,6 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
__link_nodes(__p.__ptr_, __f, __f);
--__c.__sz();
++base::__sz();
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- if (_VSTD::addressof(__c) != this) {
- __libcpp_db* __db = __get_db();
- __c_node* __cn1 = __db->__find_c_and_lock(this);
- __c_node* __cn2 = __db->__find_c(_VSTD::addressof(__c));
- for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;)
- {
- --__ip;
- iterator* __j = static_cast<iterator*>((*__ip)->__i_);
- if (__j->__ptr_ == __f)
- {
- __cn1->__add(*__ip);
- (*__ip)->__c_ = __cn1;
- if (--__cn2->end_ != __ip)
- _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
- }
- }
- __db->unlock();
- }
-#endif
}
}
@@ -1965,16 +1794,6 @@ template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "list::splice(iterator, list, iterator, iterator) called with first iterator not referring to this list");
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__f)) == _VSTD::addressof(__c),
- "list::splice(iterator, list, iterator, iterator) called with second iterator not referring to the list argument");
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__l)) == _VSTD::addressof(__c),
- "list::splice(iterator, list, iterator, iterator) called with third iterator not referring to the list argument");
- _LIBCPP_DEBUG_ASSERT(this != std::addressof(__c) || !std::__iterator_in_range(__f, __l, __p),
- "list::splice(iterator, list, iterator, iterator)"
- " called with the first iterator within the range of the second and third iterators");
-
if (__f != __l)
{
__link_pointer __first = __f.__ptr_;
@@ -1988,30 +1807,6 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con
}
base::__unlink_nodes(__first, __last);
__link_nodes(__p.__ptr_, __first, __last);
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- if (_VSTD::addressof(__c) != this) {
- __libcpp_db* __db = __get_db();
- __c_node* __cn1 = __db->__find_c_and_lock(this);
- __c_node* __cn2 = __db->__find_c(_VSTD::addressof(__c));
- for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;)
- {
- --__ip;
- iterator* __j = static_cast<iterator*>((*__ip)->__i_);
- for (__link_pointer __k = __f.__ptr_;
- __k != __l.__ptr_; __k = __k->__next_)
- {
- if (__j->__ptr_ == __k)
- {
- __cn1->__add(*__ip);
- (*__ip)->__c_ = __cn1;
- if (--__cn2->end_ != __ip)
- _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
- }
- }
- }
- __db->unlock();
- }
-#endif
}
}
@@ -2089,7 +1884,7 @@ inline
void
list<_Tp, _Alloc>::merge(list& __c)
{
- merge(__c, __less<value_type>());
+ merge(__c, __less<>());
}
template <class _Tp, class _Alloc>
@@ -2125,24 +1920,6 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
++__f1;
}
splice(__e1, __c);
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __libcpp_db* __db = __get_db();
- __c_node* __cn1 = __db->__find_c_and_lock(this);
- __c_node* __cn2 = __db->__find_c(_VSTD::addressof(__c));
- for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
- {
- --__p;
- iterator* __i = static_cast<iterator*>((*__p)->__i_);
- if (__i->__ptr_ != __c.__end_as_link())
- {
- __cn1->__add(*__p);
- (*__p)->__c_ = __cn1;
- if (--__cn2->end_ != __p)
- _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
- }
- }
- __db->unlock();
-#endif
}
}
@@ -2151,7 +1928,7 @@ inline
void
list<_Tp, _Alloc>::sort()
{
- sort(__less<value_type>());
+ sort(__less<>());
}
template <class _Tp, class _Alloc>
@@ -2249,38 +2026,6 @@ list<_Tp, _Alloc>::__invariants() const
return size() == _VSTD::distance(begin(), end());
}
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
-template <class _Tp, class _Alloc>
-bool
-list<_Tp, _Alloc>::__dereferenceable(const const_iterator* __i) const
-{
- return __i->__ptr_ != this->__end_as_link();
-}
-
-template <class _Tp, class _Alloc>
-bool
-list<_Tp, _Alloc>::__decrementable(const const_iterator* __i) const
-{
- return !empty() && __i->__ptr_ != base::__end_.__next_;
-}
-
-template <class _Tp, class _Alloc>
-bool
-list<_Tp, _Alloc>::__addable(const const_iterator*, ptrdiff_t) const
-{
- return false;
-}
-
-template <class _Tp, class _Alloc>
-bool
-list<_Tp, _Alloc>::__subscriptable(const const_iterator*, ptrdiff_t) const
-{
- return false;
-}
-
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -2289,6 +2034,8 @@ operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -2329,6 +2076,17 @@ operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
return !(__y < __x);
}
+#else // _LIBCPP_STD_VER <= 17
+
+template <class _Tp, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp>
+operator<=>(const list<_Tp, _Allocator>& __x, const list<_Tp, _Allocator>& __y) {
+ return std::lexicographical_compare_three_way(
+ __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>);
+}
+
+#endif // _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
void
@@ -2338,7 +2096,7 @@ swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, class _Allocator, class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY typename list<_Tp, _Allocator>::size_type
erase_if(list<_Tp, _Allocator>& __c, _Predicate __pred) {
@@ -2358,15 +2116,15 @@ template <>
inline constexpr bool __format::__enable_insertable<std::list<wchar_t>> = true;
#endif
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueT>
-using list = std::list<_ValueT, polymorphic_allocator<_ValueT>>;
+using list _LIBCPP_AVAILABILITY_PMR = std::list<_ValueT, polymorphic_allocator<_ValueT>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
@@ -2377,9 +2135,11 @@ _LIBCPP_POP_MACROS
# include <algorithm>
# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iosfwd>
# include <iterator>
+# include <type_traits>
# include <typeinfo>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/locale b/contrib/libs/cxxsupp/libcxx/include/locale
index 3d76ec862d2..74512995294 100644
--- a/contrib/libs/cxxsupp/libcxx/include/locale
+++ b/contrib/libs/cxxsupp/libcxx/include/locale
@@ -53,7 +53,7 @@ public:
// locale operations:
basic_string<char> name() const;
bool operator==(const locale& other) const;
- bool operator!=(const locale& other) const;
+ bool operator!=(const locale& other) const; // removed C++20
template <class charT, class Traits, class Allocator>
bool operator()(const basic_string<charT,Traits,Allocator>& s1,
const basic_string<charT,Traits,Allocator>& s2) const;
@@ -195,13 +195,14 @@ template <class charT> class messages_byname;
#include <__algorithm/unwrap_iter.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
-#include <__debug>
#include <__iterator/access.h>
#include <__iterator/back_insert_iterator.h>
#include <__iterator/istreambuf_iterator.h>
#include <__iterator/ostreambuf_iterator.h>
#include <__locale>
#include <__memory/unique_ptr.h>
+#include <__type_traits/make_unsigned.h>
+#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <ctime>
@@ -223,9 +224,9 @@ template <class charT> class messages_byname;
#endif
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
-#include <__bsd_locale_defaults.h>
+# include <__locale_dir/locale_base_api/bsd_locale_defaults.h>
#else
-#include <__bsd_locale_fallbacks.h>
+# include <__locale_dir/locale_base_api/bsd_locale_fallbacks.h>
#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -245,7 +246,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#else
# define _LIBCPP_GET_C_LOCALE __cloc()
// Get the C locale object
- _LIBCPP_FUNC_VIS locale_t __cloc();
+ _LIBCPP_EXPORTED_FROM_ABI locale_t __cloc();
#define __cloc_defined
#endif
@@ -377,7 +378,7 @@ __scan_keyword(_InputIterator& __b, _InputIterator __e,
return __kb;
}
-struct _LIBCPP_TYPE_VIS __num_get_base
+struct _LIBCPP_EXPORTED_FROM_ABI __num_get_base
{
static const int __num_get_buf_sz = 40;
@@ -385,8 +386,7 @@ struct _LIBCPP_TYPE_VIS __num_get_base
static const char __src[33];
};
-_LIBCPP_FUNC_VIS
-void __check_grouping(const string& __grouping, unsigned* __g, unsigned* __g_end,
+_LIBCPP_EXPORTED_FROM_ABI void __check_grouping(const string& __grouping, unsigned* __g, unsigned* __g_end,
ios_base::iostate& __err);
template <class _CharT>
@@ -1126,7 +1126,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<char>;
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<wchar_t>;
#endif
-struct _LIBCPP_TYPE_VIS __num_put_base
+struct _LIBCPP_EXPORTED_FROM_ABI __num_put_base
{
protected:
static void __format_int(char* __fmt, const char* __len, bool __signd,
@@ -1464,12 +1464,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
return do_put(__s, __iob, __fl, (unsigned long)__v);
const numpunct<char_type>& __np = std::use_facet<numpunct<char_type> >(__iob.getloc());
typedef typename numpunct<char_type>::string_type string_type;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- string_type __tmp(__v ? __np.truename() : __np.falsename());
- string_type __nm = _VSTD::move(__tmp);
-#else
string_type __nm = __v ? __np.truename() : __np.falsename();
-#endif
for (typename string_type::iterator __i = __nm.begin(); __i != __nm.end(); ++__i, ++__s)
*__s = *__i;
return __s;
@@ -1681,7 +1676,7 @@ __get_up_to_n_digits(_InputIterator& __b, _InputIterator __e,
return __r;
}
-class _LIBCPP_TYPE_VIS time_base
+class _LIBCPP_EXPORTED_FROM_ABI time_base
{
public:
enum dateorder {no_order, dmy, mdy, ymd, ydm};
@@ -1705,22 +1700,22 @@ protected:
~__time_get_c_storage() {}
};
-template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage<char>::__weeks() const;
-template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage<char>::__months() const;
-template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage<char>::__am_pm() const;
-template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__c() const;
-template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__r() const;
-template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__x() const;
-template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__X() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const string* __time_get_c_storage<char>::__weeks() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const string* __time_get_c_storage<char>::__months() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const string* __time_get_c_storage<char>::__am_pm() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const string& __time_get_c_storage<char>::__c() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const string& __time_get_c_storage<char>::__r() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const string& __time_get_c_storage<char>::__x() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const string& __time_get_c_storage<char>::__X() const;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__weeks() const;
-template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__months() const;
-template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__am_pm() const;
-template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__c() const;
-template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__r() const;
-template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__x() const;
-template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__X() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const wstring* __time_get_c_storage<wchar_t>::__weeks() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const wstring* __time_get_c_storage<wchar_t>::__months() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const wstring* __time_get_c_storage<wchar_t>::__am_pm() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const wstring& __time_get_c_storage<wchar_t>::__c() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const wstring& __time_get_c_storage<wchar_t>::__r() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const wstring& __time_get_c_storage<wchar_t>::__x() const;
+template <> _LIBCPP_EXPORTED_FROM_ABI const wstring& __time_get_c_storage<wchar_t>::__X() const;
#endif
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
@@ -2337,7 +2332,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<char>;
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<wchar_t>;
#endif
-class _LIBCPP_TYPE_VIS __time_get
+class _LIBCPP_EXPORTED_FROM_ABI __time_get
{
protected:
locale_t __loc_;
@@ -2375,16 +2370,16 @@ private:
};
#define _LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(_CharT) \
-template <> _LIBCPP_FUNC_VIS time_base::dateorder __time_get_storage<_CharT>::__do_date_order() const; \
-template <> _LIBCPP_FUNC_VIS __time_get_storage<_CharT>::__time_get_storage(const char*); \
-template <> _LIBCPP_FUNC_VIS __time_get_storage<_CharT>::__time_get_storage(const string&); \
-template <> _LIBCPP_FUNC_VIS void __time_get_storage<_CharT>::init(const ctype<_CharT>&); \
-template <> _LIBCPP_FUNC_VIS __time_get_storage<_CharT>::string_type __time_get_storage<_CharT>::__analyze(char, const ctype<_CharT>&); \
-extern template _LIBCPP_FUNC_VIS time_base::dateorder __time_get_storage<_CharT>::__do_date_order() const; \
-extern template _LIBCPP_FUNC_VIS __time_get_storage<_CharT>::__time_get_storage(const char*); \
-extern template _LIBCPP_FUNC_VIS __time_get_storage<_CharT>::__time_get_storage(const string&); \
-extern template _LIBCPP_FUNC_VIS void __time_get_storage<_CharT>::init(const ctype<_CharT>&); \
-extern template _LIBCPP_FUNC_VIS __time_get_storage<_CharT>::string_type __time_get_storage<_CharT>::__analyze(char, const ctype<_CharT>&); \
+template <> _LIBCPP_EXPORTED_FROM_ABI time_base::dateorder __time_get_storage<_CharT>::__do_date_order() const; \
+template <> _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const char*); \
+template <> _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const string&); \
+template <> _LIBCPP_EXPORTED_FROM_ABI void __time_get_storage<_CharT>::init(const ctype<_CharT>&); \
+template <> _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::string_type __time_get_storage<_CharT>::__analyze(char, const ctype<_CharT>&); \
+extern template _LIBCPP_EXPORTED_FROM_ABI time_base::dateorder __time_get_storage<_CharT>::__do_date_order() const; \
+extern template _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const char*); \
+extern template _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const string&); \
+extern template _LIBCPP_EXPORTED_FROM_ABI void __time_get_storage<_CharT>::init(const ctype<_CharT>&); \
+extern template _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::string_type __time_get_storage<_CharT>::__analyze(char, const ctype<_CharT>&); \
/**/
_LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(char)
@@ -2432,7 +2427,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<char>;
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<wchar_t>;
#endif
-class _LIBCPP_TYPE_VIS __time_put
+class _LIBCPP_EXPORTED_FROM_ABI __time_put
{
locale_t __loc_;
protected:
@@ -2576,7 +2571,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<wchar_t>;
// money_base
-class _LIBCPP_TYPE_VIS money_base
+class _LIBCPP_EXPORTED_FROM_ABI money_base
{
public:
enum part {none, space, symbol, sign, value};
@@ -2690,14 +2685,14 @@ private:
void init(const char*);
};
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<char, false>::init(const char*);
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<char, true>::init(const char*);
+template<> _LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname<char, false>::init(const char*);
+template<> _LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname<char, true>::init(const char*);
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, false>;
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, true>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, false>::init(const char*);
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, true>::init(const char*);
+template<> _LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname<wchar_t, false>::init(const char*);
+template<> _LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname<wchar_t, true>::init(const char*);
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, false>;
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, true>;
#endif
@@ -2814,7 +2809,7 @@ template <class _CharT, class _InputIterator>
locale::id
money_get<_CharT, _InputIterator>::id;
-_LIBCPP_FUNC_VIS void __do_nothing(void*);
+_LIBCPP_EXPORTED_FROM_ABI void __do_nothing(void*);
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI
@@ -3461,7 +3456,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>;
// messages
-class _LIBCPP_TYPE_VIS messages_base
+class _LIBCPP_EXPORTED_FROM_ABI messages_base
{
public:
typedef ptrdiff_t catalog;
@@ -3602,15 +3597,15 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>;
#endif
template<class _Codecvt, class _Elem = wchar_t,
- class _Wide_alloc = allocator<_Elem>,
- class _Byte_alloc = allocator<char> >
+ class _WideAlloc = allocator<_Elem>,
+ class _ByteAlloc = allocator<char> >
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert
{
public:
- typedef basic_string<char, char_traits<char>, _Byte_alloc> byte_string;
- typedef basic_string<_Elem, char_traits<_Elem>, _Wide_alloc> wide_string;
- typedef typename _Codecvt::state_type state_type;
- typedef typename wide_string::traits_type::int_type int_type;
+ typedef basic_string<char, char_traits<char>, _ByteAlloc> byte_string;
+ typedef basic_string<_Elem, char_traits<_Elem>, _WideAlloc> wide_string;
+ typedef typename _Codecvt::state_type state_type;
+ typedef typename wide_string::traits_type::int_type int_type;
private:
byte_string __byte_err_string_;
@@ -3629,19 +3624,19 @@ public:
explicit wstring_convert(_Codecvt* __pcvt);
#else
_LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT_AFTER_CXX11
+ _LIBCPP_EXPLICIT_SINCE_CXX14
wstring_convert(_Codecvt* __pcvt = new _Codecvt);
#endif
_LIBCPP_INLINE_VISIBILITY
wstring_convert(_Codecvt* __pcvt, state_type __state);
- _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err,
+ _LIBCPP_EXPLICIT_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI wstring_convert(const byte_string& __byte_err,
const wide_string& __wide_err = wide_string());
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
wstring_convert(wstring_convert&& __wc);
#endif
- ~wstring_convert();
+ _LIBCPP_HIDE_FROM_ABI ~wstring_convert();
_LIBCPP_INLINE_VISIBILITY
wide_string from_bytes(char __byte)
@@ -3652,7 +3647,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
wide_string from_bytes(const byte_string& __str)
{return from_bytes(__str.data(), __str.data() + __str.size());}
- wide_string from_bytes(const char* __first, const char* __last);
+ _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(const char* __first, const char* __last);
_LIBCPP_INLINE_VISIBILITY
byte_string to_bytes(_Elem __wchar)
@@ -3663,7 +3658,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
byte_string to_bytes(const wide_string& __wstr)
{return to_bytes(__wstr.data(), __wstr.data() + __wstr.size());}
- byte_string to_bytes(const _Elem* __first, const _Elem* __last);
+ _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(const _Elem* __first, const _Elem* __last);
_LIBCPP_INLINE_VISIBILITY
size_t converted() const _NOEXCEPT {return __cvtcount_;}
@@ -3672,25 +3667,25 @@ public:
};
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
+template<class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc>
inline
-wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
+wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::
wstring_convert(_Codecvt* __pcvt)
: __cvtptr_(__pcvt), __cvtstate_(), __cvtcount_(0)
{
}
_LIBCPP_SUPPRESS_DEPRECATED_POP
-template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
+template<class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc>
inline
-wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
+wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::
wstring_convert(_Codecvt* __pcvt, state_type __state)
: __cvtptr_(__pcvt), __cvtstate_(__state), __cvtcount_(0)
{
}
-template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
-wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
+template<class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc>
+wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::
wstring_convert(const byte_string& __byte_err, const wide_string& __wide_err)
: __byte_err_string_(__byte_err), __wide_err_string_(__wide_err),
__cvtstate_(), __cvtcount_(0)
@@ -3700,9 +3695,9 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
#ifndef _LIBCPP_CXX03_LANG
-template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
+template<class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc>
inline
-wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
+wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::
wstring_convert(wstring_convert&& __wc)
: __byte_err_string_(_VSTD::move(__wc.__byte_err_string_)),
__wide_err_string_(_VSTD::move(__wc.__wide_err_string_)),
@@ -3715,15 +3710,15 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
#endif // _LIBCPP_CXX03_LANG
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
-wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::~wstring_convert()
+template<class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc>
+wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::~wstring_convert()
{
delete __cvtptr_;
}
-template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
-typename wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::wide_string
-wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
+template<class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc>
+typename wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::wide_string
+wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::
from_bytes(const char* __frm, const char* __frm_end)
{
_LIBCPP_SUPPRESS_DEPRECATED_POP
@@ -3783,9 +3778,9 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
return __wide_err_string_;
}
-template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
-typename wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::byte_string
-wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
+template<class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc>
+typename wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::byte_string
+wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::
to_bytes(const _Elem* __frm, const _Elem* __frm_end)
{
__cvtcount_ = 0;
@@ -3906,18 +3901,18 @@ private:
public:
#ifndef _LIBCPP_CXX03_LANG
- wbuffer_convert() : wbuffer_convert(nullptr) {}
- explicit wbuffer_convert(streambuf* __bytebuf,
+ _LIBCPP_HIDE_FROM_ABI wbuffer_convert() : wbuffer_convert(nullptr) {}
+ explicit _LIBCPP_HIDE_FROM_ABI wbuffer_convert(streambuf* __bytebuf,
_Codecvt* __pcvt = new _Codecvt,
state_type __state = state_type());
#else
- _LIBCPP_EXPLICIT_AFTER_CXX11
+ _LIBCPP_EXPLICIT_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI
wbuffer_convert(streambuf* __bytebuf = nullptr,
_Codecvt* __pcvt = new _Codecvt,
state_type __state = state_type());
#endif
- ~wbuffer_convert();
+ _LIBCPP_HIDE_FROM_ABI ~wbuffer_convert();
_LIBCPP_INLINE_VISIBILITY
streambuf* rdbuf() const {return __bufptr_;}
@@ -3933,21 +3928,21 @@ public:
state_type state() const {return __st_;}
protected:
- virtual int_type underflow();
- virtual int_type pbackfail(int_type __c = traits_type::eof());
- virtual int_type overflow (int_type __c = traits_type::eof());
- virtual basic_streambuf<char_type, traits_type>* setbuf(char_type* __s,
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int_type underflow();
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int_type pbackfail(int_type __c = traits_type::eof());
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int_type overflow (int_type __c = traits_type::eof());
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual basic_streambuf<char_type, traits_type>* setbuf(char_type* __s,
streamsize __n);
- virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,
ios_base::openmode __wch = ios_base::in | ios_base::out);
- virtual pos_type seekpos(pos_type __sp,
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual pos_type seekpos(pos_type __sp,
ios_base::openmode __wch = ios_base::in | ios_base::out);
- virtual int sync();
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int sync();
private:
- bool __read_mode();
- void __write_mode();
- wbuffer_convert* __close();
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL bool __read_mode();
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __write_mode();
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL wbuffer_convert* __close();
};
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -4013,8 +4008,8 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
else
{
if (__extbufend_ != __extbufnext_) {
- _LIBCPP_ASSERT(__extbufnext_ != nullptr, "underflow moving from nullptr");
- _LIBCPP_ASSERT(__extbuf_ != nullptr, "underflow moving into nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__extbufnext_ != nullptr, "underflow moving from nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__extbuf_ != nullptr, "underflow moving into nullptr");
_VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
}
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
diff --git a/contrib/libs/cxxsupp/libcxx/include/map b/contrib/libs/cxxsupp/libcxx/include/map
index ee46647d28a..ce8a705eaaa 100644
--- a/contrib/libs/cxxsupp/libcxx/include/map
+++ b/contrib/libs/cxxsupp/libcxx/include/map
@@ -70,6 +70,8 @@ public:
template <class InputIterator>
map(InputIterator first, InputIterator last,
const key_compare& comp, const allocator_type& a);
+ template<container-compatible-range<value_type> R>
+ map(from_range_t, R&& rg, const Compare& comp = Compare(), const Allocator& = Allocator()); // C++23
map(const map& m);
map(map&& m)
noexcept(
@@ -83,6 +85,9 @@ public:
template <class InputIterator>
map(InputIterator first, InputIterator last, const allocator_type& a)
: map(first, last, Compare(), a) {} // C++14
+ template<container-compatible-range<value_type> R>
+ map(from_range_t, R&& rg, const Allocator& a))
+ : map(from_range, std::forward<R>(rg), Compare(), a) { } // C++23
map(initializer_list<value_type> il, const allocator_type& a)
: map(il, Compare(), a) {} // C++14
~map();
@@ -138,6 +143,8 @@ public:
iterator insert(const_iterator position, P&& p);
template <class InputIterator>
void insert(InputIterator first, InputIterator last);
+ template<container-compatible-range<value_type> R>
+ void insert_range(R&& rg); // C++23
void insert(initializer_list<value_type> il);
node_type extract(const_iterator position); // C++17
@@ -229,6 +236,11 @@ template <class InputIterator,
map(InputIterator, InputIterator, Compare = Compare(), Allocator = Allocator())
-> map<iter_key_t<InputIterator>, iter_val_t<InputIterator>, Compare, Allocator>; // C++17
+template<ranges::input_range R, class Compare = less<range-key-type<R>,
+ class Allocator = allocator<range-to-alloc-type<R>>>
+ map(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())
+ -> map<range-key-type<R>, range-mapped-type<R>, Compare, Allocator>; // C++23
+
template<class Key, class T, class Compare = less<Key>,
class Allocator = allocator<pair<const Key, T>>>
map(initializer_list<pair<const Key, T>>, Compare = Compare(), Allocator = Allocator())
@@ -239,6 +251,10 @@ map(InputIterator, InputIterator, Allocator)
-> map<iter_key_t<InputIterator>, iter_val_t<InputIterator>, less<iter_key_t<InputIterator>>,
Allocator>; // C++17
+template<ranges::input_range R, class Allocator>
+ map(from_range_t, R&&, Allocator)
+ -> map<range-key-type<R>, range-mapped-type<R>, less<range-key-type<R>>, Allocator>; // C++23
+
template<class Key, class T, class Allocator>
map(initializer_list<pair<const Key, T>>, Allocator) -> map<Key, T, less<Key>, Allocator>; // C++17
@@ -250,27 +266,32 @@ operator==(const map<Key, T, Compare, Allocator>& x,
template <class Key, class T, class Compare, class Allocator>
bool
operator< (const map<Key, T, Compare, Allocator>& x,
- const map<Key, T, Compare, Allocator>& y);
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator!=(const map<Key, T, Compare, Allocator>& x,
- const map<Key, T, Compare, Allocator>& y);
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator> (const map<Key, T, Compare, Allocator>& x,
- const map<Key, T, Compare, Allocator>& y);
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator>=(const map<Key, T, Compare, Allocator>& x,
- const map<Key, T, Compare, Allocator>& y);
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator<=(const map<Key, T, Compare, Allocator>& x,
- const map<Key, T, Compare, Allocator>& y);
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
+
+template<class Key, class T, class Compare, class Allocator>
+ synth-three-way-result<pair<const Key, T>>
+ operator<=>(const map<Key, T, Compare, Allocator>& x,
+ const map<Key, T, Compare, Allocator>& y); // since C++20
// specialized algorithms:
template <class Key, class T, class Compare, class Allocator>
@@ -333,6 +354,9 @@ public:
template <class InputIterator>
multimap(InputIterator first, InputIterator last, const key_compare& comp,
const allocator_type& a);
+ template<container-compatible-range<value_type> R>
+ multimap(from_range_t, R&& rg,
+ const Compare& comp = Compare(), const Allocator& = Allocator()); // C++23
multimap(const multimap& m);
multimap(multimap&& m)
noexcept(
@@ -347,6 +371,9 @@ public:
template <class InputIterator>
multimap(InputIterator first, InputIterator last, const allocator_type& a)
: multimap(first, last, Compare(), a) {} // C++14
+ template<container-compatible-range<value_type> R>
+ multimap(from_range_t, R&& rg, const Allocator& a))
+ : multimap(from_range, std::forward<R>(rg), Compare(), a) { } // C++23
multimap(initializer_list<value_type> il, const allocator_type& a)
: multimap(il, Compare(), a) {} // C++14
~multimap();
@@ -395,6 +422,8 @@ public:
iterator insert(const_iterator position, P&& p);
template <class InputIterator>
void insert(InputIterator first, InputIterator last);
+ template<container-compatible-range<value_type> R>
+ void insert_range(R&& rg); // C++23
void insert(initializer_list<value_type> il);
node_type extract(const_iterator position); // C++17
@@ -469,6 +498,11 @@ template <class InputIterator,
multimap(InputIterator, InputIterator, Compare = Compare(), Allocator = Allocator())
-> multimap<iter_key_t<InputIterator>, iter_val_t<InputIterator>, Compare, Allocator>; // C++17
+template<ranges::input_range R, class Compare = less<range-key-type<R>>,
+ class Allocator = allocator<range-to-alloc-type<R>>>
+ multimap(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())
+ -> multimap<range-key-type<R>, range-mapped-type<R>, Compare, Allocator>; // C++23
+
template<class Key, class T, class Compare = less<Key>,
class Allocator = allocator<pair<const Key, T>>>
multimap(initializer_list<pair<const Key, T>>, Compare = Compare(), Allocator = Allocator())
@@ -479,6 +513,10 @@ multimap(InputIterator, InputIterator, Allocator)
-> multimap<iter_key_t<InputIterator>, iter_val_t<InputIterator>,
less<iter_key_t<InputIterator>>, Allocator>; // C++17
+template<ranges::input_range R, class Allocator>
+ multimap(from_range_t, R&&, Allocator)
+ -> multimap<range-key-type<R>, range-mapped-type<R>, less<range-key-type<R>>, Allocator>; // C++23
+
template<class Key, class T, class Allocator>
multimap(initializer_list<pair<const Key, T>>, Allocator)
-> multimap<Key, T, less<Key>, Allocator>; // C++17
@@ -491,27 +529,32 @@ operator==(const multimap<Key, T, Compare, Allocator>& x,
template <class Key, class T, class Compare, class Allocator>
bool
operator< (const multimap<Key, T, Compare, Allocator>& x,
- const multimap<Key, T, Compare, Allocator>& y);
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator!=(const multimap<Key, T, Compare, Allocator>& x,
- const multimap<Key, T, Compare, Allocator>& y);
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator> (const multimap<Key, T, Compare, Allocator>& x,
- const multimap<Key, T, Compare, Allocator>& y);
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator>=(const multimap<Key, T, Compare, Allocator>& x,
- const multimap<Key, T, Compare, Allocator>& y);
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator<=(const multimap<Key, T, Compare, Allocator>& x,
- const multimap<Key, T, Compare, Allocator>& y);
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
+
+template<class Key, class T, class Compare, class Allocator>
+ synth-three-way-result<pair<const Key, T>>
+ operator<=>(const multimap<Key, T, Compare, Allocator>& x,
+ const multimap<Key, T, Compare, Allocator>& y); // since c++20
// specialized algorithms:
template <class Key, class T, class Compare, class Allocator>
@@ -530,24 +573,30 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
#include <__algorithm/equal.h>
#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lexicographical_compare_three_way.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
#include <__functional/binary_function.h>
#include <__functional/is_transparent.h>
#include <__functional/operations.h>
#include <__iterator/erase_if_container.h>
#include <__iterator/iterator_traits.h>
+#include <__iterator/ranges_iterator_traits.h>
#include <__iterator/reverse_iterator.h>
+#include <__memory/addressof.h>
#include <__memory/allocator.h>
#include <__memory_resource/polymorphic_allocator.h>
#include <__node_handle>
+#include <__ranges/concepts.h>
+#include <__ranges/container_compatible_range.h>
+#include <__ranges/from_range.h>
#include <__tree>
#include <__type_traits/is_allocator.h>
#include <__utility/forward.h>
#include <__utility/piecewise_construct.h>
#include <__utility/swap.h>
#include <tuple>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -594,14 +643,14 @@ public:
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _CP& __y) const
{return static_cast<const _Compare&>(*this)(__x, __y.__get_value().first);}
- void swap(__map_value_compare& __y)
+ _LIBCPP_HIDE_FROM_ABI void swap(__map_value_compare& __y)
_NOEXCEPT_(__is_nothrow_swappable<_Compare>::value)
{
using _VSTD::swap;
swap(static_cast<_Compare&>(*this), static_cast<_Compare&>(__y));
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _K2& __x, const _CP& __y) const
@@ -647,7 +696,7 @@ public:
swap(__comp_, __y.__comp_);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _K2& __x, const _CP& __y) const
@@ -742,7 +791,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
value_type& __get_value()
{
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return *_VSTD::launder(_VSTD::addressof(__cc_));
#else
return __cc_;
@@ -752,7 +801,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const value_type& __get_value() const
{
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return *_VSTD::launder(_VSTD::addressof(__cc_));
#else
return __cc_;
@@ -1020,7 +1069,7 @@ public:
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __map_node_handle<typename __base::__node, allocator_type> node_type;
typedef __insert_return_type<iterator, node_type> insert_return_type;
#endif
@@ -1067,13 +1116,30 @@ public:
insert(__f, __l);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ map(from_range_t, _Range&& __range, const key_compare& __comp = key_compare(),
+ const allocator_type& __a = allocator_type())
+ : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {
+ insert_range(std::forward<_Range>(__range));
+ }
+#endif
+
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
map(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
: map(__f, __l, key_compare(), __a) {}
#endif
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ map(from_range_t, _Range&& __range, const allocator_type& __a)
+ : map(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
map(const map& __m)
: __tree_(__m.__tree_)
@@ -1106,7 +1172,7 @@ public:
{
}
- map(map&& __m, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI map(map&& __m, const allocator_type& __a);
_LIBCPP_INLINE_VISIBILITY
map& operator=(map&& __m)
@@ -1130,7 +1196,7 @@ public:
insert(__il.begin(), __il.end());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_INLINE_VISIBILITY
map(initializer_list<value_type> __il, const allocator_type& __a)
: map(__il, key_compare(), __a) {}
@@ -1200,13 +1266,13 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
- mapped_type& operator[](const key_type& __k);
+ _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k);
#ifndef _LIBCPP_CXX03_LANG
- mapped_type& operator[](key_type&& __k);
+ _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k);
#endif
- mapped_type& at(const key_type& __k);
- const mapped_type& at(const key_type& __k) const;
+ _LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __k);
+ _LIBCPP_HIDE_FROM_ABI const mapped_type& at(const key_type& __k) const;
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT {return allocator_type(__tree_.__alloc());}
@@ -1273,7 +1339,18 @@ public:
insert(__e.__i_, *__f);
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void insert_range(_Range&& __range) {
+ const_iterator __end = cend();
+ for (auto&& __element : __range) {
+ insert(__end.__i_, std::forward<decltype(__element)>(__element));
+ }
+ }
+#endif
+
+#if _LIBCPP_STD_VER >= 17
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
@@ -1367,7 +1444,7 @@ public:
return __r;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
@@ -1382,11 +1459,11 @@ public:
_LIBCPP_REINITIALIZES_OBJECT _LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {__tree_.clear();}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
insert_return_type insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to map::insert()");
return __tree_.template __node_handle_insert_unique<
node_type, insert_return_type>(_VSTD::move(__nh));
@@ -1394,7 +1471,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to map::insert()");
return __tree_.template __node_handle_insert_unique<node_type>(
__hint.__i_, _VSTD::move(__nh));
@@ -1413,32 +1490,32 @@ public:
_LIBCPP_INLINE_VISIBILITY
void merge(map<key_type, mapped_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
template <class _Compare2>
_LIBCPP_INLINE_VISIBILITY
void merge(map<key_type, mapped_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
template <class _Compare2>
_LIBCPP_INLINE_VISIBILITY
void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
template <class _Compare2>
_LIBCPP_INLINE_VISIBILITY
void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
#endif
@@ -1452,7 +1529,7 @@ public:
iterator find(const key_type& __k) {return __tree_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
@@ -1466,21 +1543,21 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const
{return __tree_.__count_unique(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, size_type>
count(const _K2& __k) const {return __tree_.__count_multi(__k);}
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, bool>
contains(const _K2& __k) const { return find(__k) != end(); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
@@ -1488,7 +1565,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_iterator lower_bound(const key_type& __k) const
{return __tree_.lower_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
@@ -1506,7 +1583,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_iterator upper_bound(const key_type& __k) const
{return __tree_.upper_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
@@ -1523,7 +1600,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
{return __tree_.__equal_range_unique(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, pair<iterator,iterator>>
@@ -1545,19 +1622,28 @@ private:
typedef unique_ptr<__node, _Dp> __node_holder;
#ifdef _LIBCPP_CXX03_LANG
- __node_holder __construct_node_with_key(const key_type& __k);
+ _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node_with_key(const key_type& __k);
#endif
};
#if _LIBCPP_STD_VER >= 17
template<class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>,
class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
map(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
-> map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range, class _Compare = less<__range_key_type<_Range>>,
+ class _Allocator = allocator<__range_to_alloc_type<_Range>>,
+ class = enable_if_t<!__is_allocator<_Compare>::value, void>,
+ class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
+ -> map<__range_key_type<_Range>, __range_mapped_type<_Range>, _Compare, _Allocator>;
+#endif
+
template<class _Key, class _Tp, class _Compare = less<remove_const_t<_Key>>,
class _Allocator = allocator<pair<const _Key, _Tp>>,
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
@@ -1566,12 +1652,19 @@ map(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allo
-> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
template<class _InputIterator, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
map(_InputIterator, _InputIterator, _Allocator)
-> map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>,
less<__iter_key_type<_InputIterator>>, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range, class _Allocator,
+ class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+map(from_range_t, _Range&&, _Allocator)
+ -> map<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>;
+#endif
+
template<class _Key, class _Tp, class _Allocator,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
map(initializer_list<pair<_Key, _Tp>>, _Allocator)
@@ -1677,6 +1770,8 @@ operator==(const map<_Key, _Tp, _Compare, _Allocator>& __x,
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -1722,6 +1817,21 @@ operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __x,
return !(__y < __x);
}
+#else // #if _LIBCPP_STD_VER <= 17
+
+template <class _Key, class _Tp, class _Compare, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<pair<const _Key, _Tp>>
+operator<=>(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {
+ return std::lexicographical_compare_three_way(
+ __x.begin(),
+ __x.end(),
+ __y.begin(),
+ __y.end(),
+ std::__synth_three_way<pair<const _Key, _Tp>, pair<const _Key, _Tp>>);
+}
+
+#endif // #if _LIBCPP_STD_VER <= 17
+
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
@@ -1732,7 +1842,7 @@ swap(map<_Key, _Tp, _Compare, _Allocator>& __x,
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Key, class _Tp, class _Compare, class _Allocator,
class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1800,7 +1910,7 @@ public:
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __map_node_handle<typename __base::__node, allocator_type> node_type;
#endif
@@ -1846,13 +1956,30 @@ public:
insert(__f, __l);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ multimap(from_range_t, _Range&& __range, const key_compare& __comp = key_compare(),
+ const allocator_type& __a = allocator_type())
+ : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {
+ insert_range(std::forward<_Range>(__range));
+ }
+#endif
+
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
multimap(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
: multimap(__f, __l, key_compare(), __a) {}
#endif
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ multimap(from_range_t, _Range&& __range, const allocator_type& __a)
+ : multimap(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
multimap(const multimap& __m)
: __tree_(__m.__tree_.value_comp(),
@@ -1886,7 +2013,7 @@ public:
{
}
- multimap(multimap&& __m, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI multimap(multimap&& __m, const allocator_type& __a);
_LIBCPP_INLINE_VISIBILITY
multimap& operator=(multimap&& __m)
@@ -1910,7 +2037,7 @@ public:
insert(__il.begin(), __il.end());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_INLINE_VISIBILITY
multimap(initializer_list<value_type> __il, const allocator_type& __a)
: multimap(__il, key_compare(), __a) {}
@@ -2043,6 +2170,17 @@ public:
__tree_.__insert_multi(__e.__i_, *__f);
}
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void insert_range(_Range&& __range) {
+ const_iterator __end = cend();
+ for (auto&& __element : __range) {
+ __tree_.__insert_multi(__end.__i_, std::forward<decltype(__element)>(__element));
+ }
+ }
+#endif
+
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
_LIBCPP_INLINE_VISIBILITY
@@ -2053,11 +2191,11 @@ public:
iterator erase(const_iterator __f, const_iterator __l)
{return __tree_.erase(__f.__i_, __l.__i_);}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
iterator insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to multimap::insert()");
return __tree_.template __node_handle_insert_multi<node_type>(
_VSTD::move(__nh));
@@ -2065,7 +2203,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to multimap::insert()");
return __tree_.template __node_handle_insert_multi<node_type>(
__hint.__i_, _VSTD::move(__nh));
@@ -2085,32 +2223,32 @@ public:
_LIBCPP_INLINE_VISIBILITY
void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __tree_.__node_handle_merge_multi(__source.__tree_);
}
template <class _Compare2>
_LIBCPP_INLINE_VISIBILITY
void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __tree_.__node_handle_merge_multi(__source.__tree_);
}
template <class _Compare2>
_LIBCPP_INLINE_VISIBILITY
void merge(map<key_type, mapped_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __tree_.__node_handle_merge_multi(__source.__tree_);
}
template <class _Compare2>
_LIBCPP_INLINE_VISIBILITY
void merge(map<key_type, mapped_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __tree_.__node_handle_merge_multi(__source.__tree_);
}
#endif
@@ -2127,7 +2265,7 @@ public:
iterator find(const key_type& __k) {return __tree_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
@@ -2141,21 +2279,21 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const
{return __tree_.__count_multi(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, size_type>
count(const _K2& __k) const {return __tree_.__count_multi(__k);}
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, bool>
contains(const _K2& __k) const { return find(__k) != end(); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
@@ -2163,7 +2301,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_iterator lower_bound(const key_type& __k) const
{return __tree_.lower_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
@@ -2181,7 +2319,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_iterator upper_bound(const key_type& __k) const
{return __tree_.upper_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
@@ -2198,7 +2336,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
{return __tree_.__equal_range_multi(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, pair<iterator,iterator>>
@@ -2221,12 +2359,21 @@ private:
#if _LIBCPP_STD_VER >= 17
template<class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>,
class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
multimap(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
-> multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range, class _Compare = less<__range_key_type<_Range>>,
+ class _Allocator = allocator<__range_to_alloc_type<_Range>>,
+ class = enable_if_t<!__is_allocator<_Compare>::value, void>,
+ class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+multimap(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
+ -> multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, _Compare, _Allocator>;
+#endif
+
template<class _Key, class _Tp, class _Compare = less<remove_const_t<_Key>>,
class _Allocator = allocator<pair<const _Key, _Tp>>,
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
@@ -2235,12 +2382,19 @@ multimap(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator =
-> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
template<class _InputIterator, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
multimap(_InputIterator, _InputIterator, _Allocator)
-> multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>,
less<__iter_key_type<_InputIterator>>, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range, class _Allocator,
+ class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+multimap(from_range_t, _Range&&, _Allocator)
+ -> multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>;
+#endif
+
template<class _Key, class _Tp, class _Allocator,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
@@ -2271,6 +2425,8 @@ operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -2316,6 +2472,22 @@ operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
return !(__y < __x);
}
+#else // #if _LIBCPP_STD_VER <= 17
+
+template <class _Key, class _Tp, class _Compare, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<pair<const _Key, _Tp>>
+operator<=>(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {
+ return std::lexicographical_compare_three_way(
+ __x.begin(),
+ __x.end(),
+ __y.begin(),
+ __y.end(),
+ std::__synth_three_way<pair<const _Key, _Tp>, pair<const _Key, _Tp>>);
+}
+
+#endif // #if _LIBCPP_STD_VER <= 17
+
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
@@ -2326,7 +2498,7 @@ swap(multimap<_Key, _Tp, _Compare, _Allocator>& __x,
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Key, class _Tp, class _Compare, class _Allocator,
class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
@@ -2339,22 +2511,24 @@ inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _KeyT, class _ValueT, class _CompareT = std::less<_KeyT>>
-using map = std::map<_KeyT, _ValueT, _CompareT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
+using map _LIBCPP_AVAILABILITY_PMR = std::map<_KeyT, _ValueT, _CompareT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
template <class _KeyT, class _ValueT, class _CompareT = std::less<_KeyT>>
-using multimap = std::multimap<_KeyT, _ValueT, _CompareT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
+using multimap _LIBCPP_AVAILABILITY_PMR = std::multimap<_KeyT, _ValueT, _CompareT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iterator>
+# include <type_traits>
# include <utility>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/math.h b/contrib/libs/cxxsupp/libcxx/include/math.h
index 7f9330eb1a3..0ddaa9be8e9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/math.h
+++ b/contrib/libs/cxxsupp/libcxx/include/math.h
@@ -554,7 +554,6 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI bool isunordered(_A1 __x, _A2
// acos
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float acos(float __x) _NOEXCEPT {return __builtin_acosf(__x);}
template <class = int>
@@ -563,7 +562,6 @@ _LIBCPP_HIDE_FROM_ABI double acos(double __x) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double acos(long double __x) _NOEXCEPT {return __builtin_acosl(__x);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -572,7 +570,6 @@ acos(_A1 __x) _NOEXCEPT {return __builtin_acos((double)__x);}
// asin
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float asin(float __x) _NOEXCEPT {return __builtin_asinf(__x);}
template <class = int>
@@ -581,7 +578,6 @@ _LIBCPP_HIDE_FROM_ABI double asin(double __x) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double asin(long double __x) _NOEXCEPT {return __builtin_asinl(__x);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -590,7 +586,6 @@ asin(_A1 __x) _NOEXCEPT {return __builtin_asin((double)__x);}
// atan
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float atan(float __x) _NOEXCEPT {return __builtin_atanf(__x);}
template <class = int>
@@ -599,7 +594,6 @@ _LIBCPP_HIDE_FROM_ABI double atan(double __x) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double atan(long double __x) _NOEXCEPT {return __builtin_atanl(__x);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -608,7 +602,6 @@ atan(_A1 __x) _NOEXCEPT {return __builtin_atan((double)__x);}
// atan2
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float atan2(float __y, float __x) _NOEXCEPT {return __builtin_atan2f(__y, __x);}
template <class = int>
@@ -617,7 +610,6 @@ _LIBCPP_HIDE_FROM_ABI double atan2(double __x, double __y) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double atan2(long double __y, long double __x) _NOEXCEPT {return __builtin_atan2l(__y, __x);}
-# endif
template <class _A1, class _A2>
inline _LIBCPP_HIDE_FROM_ABI
@@ -637,7 +629,6 @@ atan2(_A1 __y, _A2 __x) _NOEXCEPT
// ceil
-# if !defined(__sun__)
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float ceil(float __x) _NOEXCEPT {return __builtin_ceilf(__x);}
template <class = int>
@@ -646,7 +637,6 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double ceil(double __x) _NOEXCEPT {
}
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double ceil(long double __x) _NOEXCEPT {return __builtin_ceill(__x);}
-# endif
template <class _A1>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI
@@ -655,7 +645,6 @@ ceil(_A1 __x) _NOEXCEPT {return __builtin_ceil((double)__x);}
// cos
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float cos(float __x) _NOEXCEPT {return __builtin_cosf(__x);}
template <class = int>
@@ -664,7 +653,6 @@ _LIBCPP_HIDE_FROM_ABI double cos(double __x) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double cos(long double __x) _NOEXCEPT {return __builtin_cosl(__x);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -673,7 +661,6 @@ cos(_A1 __x) _NOEXCEPT {return __builtin_cos((double)__x);}
// cosh
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float cosh(float __x) _NOEXCEPT {return __builtin_coshf(__x);}
template <class = int>
@@ -682,7 +669,6 @@ _LIBCPP_HIDE_FROM_ABI double cosh(double __x) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double cosh(long double __x) _NOEXCEPT {return __builtin_coshl(__x);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -691,7 +677,6 @@ cosh(_A1 __x) _NOEXCEPT {return __builtin_cosh((double)__x);}
// exp
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float exp(float __x) _NOEXCEPT {return __builtin_expf(__x);}
template <class = int>
@@ -700,7 +685,6 @@ _LIBCPP_HIDE_FROM_ABI double exp(double __x) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double exp(long double __x) _NOEXCEPT {return __builtin_expl(__x);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -709,7 +693,6 @@ exp(_A1 __x) _NOEXCEPT {return __builtin_exp((double)__x);}
// fabs
-# if !defined(__sun__)
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float fabs(float __x) _NOEXCEPT {return __builtin_fabsf(__x);}
template <class = int>
@@ -718,7 +701,6 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double fabs(double __x) _NOEXCEPT {
}
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double fabs(long double __x) _NOEXCEPT {return __builtin_fabsl(__x);}
-# endif
template <class _A1>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI
@@ -727,7 +709,6 @@ fabs(_A1 __x) _NOEXCEPT {return __builtin_fabs((double)__x);}
// floor
-# if !defined(__sun__)
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float floor(float __x) _NOEXCEPT {return __builtin_floorf(__x);}
template <class = int>
@@ -736,7 +717,6 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double floor(double __x) _NOEXCEPT {
}
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double floor(long double __x) _NOEXCEPT {return __builtin_floorl(__x);}
-# endif
template <class _A1>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI
@@ -745,7 +725,6 @@ floor(_A1 __x) _NOEXCEPT {return __builtin_floor((double)__x);}
// fmod
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float fmod(float __x, float __y) _NOEXCEPT {return __builtin_fmodf(__x, __y);}
template <class = int>
@@ -754,7 +733,6 @@ _LIBCPP_HIDE_FROM_ABI double fmod(double __x, double __y) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double fmod(long double __x, long double __y) _NOEXCEPT {return __builtin_fmodl(__x, __y);}
-# endif
template <class _A1, class _A2>
inline _LIBCPP_HIDE_FROM_ABI
@@ -774,7 +752,6 @@ fmod(_A1 __x, _A2 __y) _NOEXCEPT
// frexp
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float frexp(float __x, int* __e) _NOEXCEPT {return __builtin_frexpf(__x, __e);}
template <class = int>
@@ -783,7 +760,6 @@ _LIBCPP_HIDE_FROM_ABI double frexp(double __x, int* __e) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double frexp(long double __x, int* __e) _NOEXCEPT {return __builtin_frexpl(__x, __e);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -792,7 +768,6 @@ frexp(_A1 __x, int* __e) _NOEXCEPT {return __builtin_frexp((double)__x, __e);}
// ldexp
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float ldexp(float __x, int __e) _NOEXCEPT {return __builtin_ldexpf(__x, __e);}
template <class = int>
@@ -801,7 +776,6 @@ _LIBCPP_HIDE_FROM_ABI double ldexp(double __x, int __e) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double ldexp(long double __x, int __e) _NOEXCEPT {return __builtin_ldexpl(__x, __e);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -810,7 +784,6 @@ ldexp(_A1 __x, int __e) _NOEXCEPT {return __builtin_ldexp((double)__x, __e);}
// log
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float log(float __x) _NOEXCEPT {return __builtin_logf(__x);}
template <class = int>
@@ -819,7 +792,6 @@ _LIBCPP_HIDE_FROM_ABI double log(double __x) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double log(long double __x) _NOEXCEPT {return __builtin_logl(__x);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -828,7 +800,6 @@ log(_A1 __x) _NOEXCEPT {return __builtin_log((double)__x);}
// log10
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float log10(float __x) _NOEXCEPT {return __builtin_log10f(__x);}
@@ -838,7 +809,6 @@ _LIBCPP_HIDE_FROM_ABI double log10(double __x) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double log10(long double __x) _NOEXCEPT {return __builtin_log10l(__x);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -847,7 +817,6 @@ log10(_A1 __x) _NOEXCEPT {return __builtin_log10((double)__x);}
// modf
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float modf(float __x, float* __y) _NOEXCEPT {return __builtin_modff(__x, __y);}
template <class = int>
@@ -856,11 +825,9 @@ _LIBCPP_HIDE_FROM_ABI double modf(double __x, double* __y) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double modf(long double __x, long double* __y) _NOEXCEPT {return __builtin_modfl(__x, __y);}
-# endif
// pow
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float pow(float __x, float __y) _NOEXCEPT {return __builtin_powf(__x, __y);}
template <class = int>
@@ -869,7 +836,6 @@ _LIBCPP_HIDE_FROM_ABI double pow(double __x, double __y) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double pow(long double __x, long double __y) _NOEXCEPT {return __builtin_powl(__x, __y);}
-# endif
template <class _A1, class _A2>
inline _LIBCPP_HIDE_FROM_ABI
@@ -889,7 +855,6 @@ pow(_A1 __x, _A2 __y) _NOEXCEPT
// sin
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float sin(float __x) _NOEXCEPT {return __builtin_sinf(__x);}
template <class = int>
@@ -898,7 +863,6 @@ _LIBCPP_HIDE_FROM_ABI double sin(double __x) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double sin(long double __x) _NOEXCEPT {return __builtin_sinl(__x);}
-#endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -907,7 +871,6 @@ sin(_A1 __x) _NOEXCEPT {return __builtin_sin((double)__x);}
// sinh
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float sinh(float __x) _NOEXCEPT {return __builtin_sinhf(__x);}
template <class = int>
@@ -916,7 +879,6 @@ _LIBCPP_HIDE_FROM_ABI double sinh(double __x) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double sinh(long double __x) _NOEXCEPT {return __builtin_sinhl(__x);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -925,7 +887,6 @@ sinh(_A1 __x) _NOEXCEPT {return __builtin_sinh((double)__x);}
// sqrt
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float sqrt(float __x) _NOEXCEPT {return __builtin_sqrtf(__x);}
template <class = int>
@@ -934,7 +895,6 @@ _LIBCPP_HIDE_FROM_ABI double sqrt(double __x) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double sqrt(long double __x) _NOEXCEPT {return __builtin_sqrtl(__x);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -943,7 +903,6 @@ sqrt(_A1 __x) _NOEXCEPT {return __builtin_sqrt((double)__x);}
// tan
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float tan(float __x) _NOEXCEPT {return __builtin_tanf(__x);}
template <class = int>
@@ -952,7 +911,6 @@ _LIBCPP_HIDE_FROM_ABI double tan(double __x) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double tan(long double __x) _NOEXCEPT {return __builtin_tanl(__x);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
@@ -961,7 +919,6 @@ tan(_A1 __x) _NOEXCEPT {return __builtin_tan((double)__x);}
// tanh
-# if !defined(__sun__)
inline _LIBCPP_HIDE_FROM_ABI float tanh(float __x) _NOEXCEPT {return __builtin_tanhf(__x);}
template <class = int>
@@ -970,7 +927,6 @@ _LIBCPP_HIDE_FROM_ABI double tanh(double __x) _NOEXCEPT {
}
inline _LIBCPP_HIDE_FROM_ABI long double tanh(long double __x) _NOEXCEPT {return __builtin_tanhl(__x);}
-# endif
template <class _A1>
inline _LIBCPP_HIDE_FROM_ABI
diff --git a/contrib/libs/cxxsupp/libcxx/include/memory b/contrib/libs/cxxsupp/libcxx/include/memory
index 8d63fb94b72..cd6bcc7eaa3 100644
--- a/contrib/libs/cxxsupp/libcxx/include/memory
+++ b/contrib/libs/cxxsupp/libcxx/include/memory
@@ -160,7 +160,7 @@ template <class T, class U>
bool operator==(const allocator<T>&, const allocator<U>&) noexcept; // constexpr in C++20
template <class T, class U>
-bool operator!=(const allocator<T>&, const allocator<U>&) noexcept; // constexpr in C++20
+bool operator!=(const allocator<T>&, const allocator<U>&) noexcept; // removed in C++20
template <class OutputIterator, class T>
class raw_storage_iterator // deprecated in C++17, removed in C++20
@@ -912,14 +912,12 @@ template<size_t N, class T>
# pragma GCC system_header
#endif
-#if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17
-#error # include <__pstl_memory>
-#endif
-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
# include <cstddef>
# include <cstdint>
+# include <cstdlib>
# include <cstring>
# include <iosfwd>
# include <iterator>
diff --git a/contrib/libs/cxxsupp/libcxx/include/memory_resource b/contrib/libs/cxxsupp/libcxx/include/memory_resource
index 4b393433696..276e08f23fa 100644
--- a/contrib/libs/cxxsupp/libcxx/include/memory_resource
+++ b/contrib/libs/cxxsupp/libcxx/include/memory_resource
@@ -22,7 +22,7 @@ namespace std::pmr {
bool operator==(const memory_resource& a,
const memory_resource& b) noexcept;
bool operator!=(const memory_resource& a,
- const memory_resource& b) noexcept;
+ const memory_resource& b) noexcept; // removed in C++20
template <class Tp> class polymorphic_allocator;
@@ -31,7 +31,7 @@ namespace std::pmr {
const polymorphic_allocator<T2>& b) noexcept;
template <class T1, class T2>
bool operator!=(const polymorphic_allocator<T1>& a,
- const polymorphic_allocator<T2>& b) noexcept;
+ const polymorphic_allocator<T2>& b) noexcept; // removed in C++20
// Global memory resources
memory_resource* set_default_resource(memory_resource* r) noexcept;
diff --git a/contrib/libs/cxxsupp/libcxx/include/mutex b/contrib/libs/cxxsupp/libcxx/include/mutex
index dc51d572c01..6cd4f028b03 100644
--- a/contrib/libs/cxxsupp/libcxx/include/mutex
+++ b/contrib/libs/cxxsupp/libcxx/include/mutex
@@ -187,12 +187,20 @@ template<class Callable, class ...Args>
*/
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__chrono/steady_clock.h>
+#include <__chrono/time_point.h>
+#include <__condition_variable/condition_variable.h>
#include <__config>
#include <__memory/shared_ptr.h>
-#include <__mutex_base>
+#include <__mutex/lock_guard.h>
+#include <__mutex/mutex.h>
+#include <__mutex/tag_types.h>
+#include <__mutex/unique_lock.h>
+#include <__thread/id.h>
#include <__threading_support>
#include <__utility/forward.h>
#include <cstdint>
+#include <limits>
#ifndef _LIBCPP_CXX03_LANG
# include <tuple>
#endif
@@ -214,7 +222,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_HAS_NO_THREADS
-class _LIBCPP_TYPE_VIS recursive_mutex
+class _LIBCPP_EXPORTED_FROM_ABI recursive_mutex
{
__libcpp_recursive_mutex_t __m_;
@@ -235,7 +243,7 @@ public:
native_handle_type native_handle() {return &__m_;}
};
-class _LIBCPP_TYPE_VIS timed_mutex
+class _LIBCPP_EXPORTED_FROM_ABI timed_mutex
{
mutex __m_;
condition_variable __cv_;
@@ -266,9 +274,9 @@ timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t)
{
using namespace chrono;
unique_lock<mutex> __lk(__m_);
- bool no_timeout = _Clock::now() < __t;
- while (no_timeout && __locked_)
- no_timeout = __cv_.wait_until(__lk, __t) == cv_status::no_timeout;
+ bool __no_timeout = _Clock::now() < __t;
+ while (__no_timeout && __locked_)
+ __no_timeout = __cv_.wait_until(__lk, __t) == cv_status::no_timeout;
if (!__locked_)
{
__locked_ = true;
@@ -277,7 +285,7 @@ timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t)
return false;
}
-class _LIBCPP_TYPE_VIS recursive_timed_mutex
+class _LIBCPP_EXPORTED_FROM_ABI recursive_timed_mutex
{
mutex __m_;
condition_variable __cv_;
@@ -308,7 +316,7 @@ recursive_timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration
{
using namespace chrono;
__thread_id __id = this_thread::get_id();
- unique_lock<mutex> lk(__m_);
+ unique_lock<mutex> __lk(__m_);
if (__id == __id_)
{
if (__count_ == numeric_limits<size_t>::max())
@@ -316,9 +324,9 @@ recursive_timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration
++__count_;
return true;
}
- bool no_timeout = _Clock::now() < __t;
- while (no_timeout && __count_ != 0)
- no_timeout = __cv_.wait_until(lk, __t) == cv_status::no_timeout;
+ bool __no_timeout = _Clock::now() < __t;
+ while (__no_timeout && __count_ != 0)
+ __no_timeout = __cv_.wait_until(__lk, __t) == cv_status::no_timeout;
if (__count_ == 0)
{
__count_ = 1;
@@ -332,7 +340,7 @@ template <class _L0, class _L1>
_LIBCPP_HIDE_FROM_ABI int
try_lock(_L0& __l0, _L1& __l1)
{
- unique_lock<_L0> __u0(__l0, try_to_lock);
+ unique_lock<_L0> __u0(__l0, try_to_lock_t());
if (__u0.owns_lock())
{
if (__l1.try_lock())
@@ -471,7 +479,7 @@ void __unlock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {
#endif // _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class ..._Mutexes>
class _LIBCPP_TEMPLATE_VIS scoped_lock;
@@ -548,7 +556,7 @@ private:
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(scoped_lock);
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // !_LIBCPP_HAS_NO_THREADS
struct _LIBCPP_TEMPLATE_VIS once_flag;
@@ -661,11 +669,9 @@ __call_once_proxy(void* __vp)
}
#ifdef _LIBCPP_ABI_MICROSOFT
-_LIBCPP_FUNC_VIS void __call_once(volatile atomic<once_flag::_State_type>&, void*,
- void (*)(void*));
+_LIBCPP_EXPORTED_FROM_ABI void __call_once(volatile atomic<once_flag::_State_type>&, void*, void (*)(void*));
#else
-_LIBCPP_FUNC_VIS void __call_once(volatile once_flag::_State_type&, void*,
- void (*)(void*));
+_LIBCPP_EXPORTED_FROM_ABI void __call_once(volatile once_flag::_State_type&, void*, void (*)(void*));
#endif
#ifndef _LIBCPP_CXX03_LANG
@@ -729,9 +735,17 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
-# include <functional>
+# include <cstdlib>
+# include <cstring>
+# include <ctime>
+# include <initializer_list>
+# include <new>
+# include <stdexcept>
+# include <system_error>
# include <type_traits>
+# include <typeinfo>
#endif
#endif // _LIBCPP_MUTEX
diff --git a/contrib/libs/cxxsupp/libcxx/include/new b/contrib/libs/cxxsupp/libcxx/include/new
index aa62f81b022..3064a0e2f08 100644
--- a/contrib/libs/cxxsupp/libcxx/include/new
+++ b/contrib/libs/cxxsupp/libcxx/include/new
@@ -89,12 +89,14 @@ void operator delete[](void* ptr, void*) noexcept;
#include <__assert> // all public C++ headers provide the assertion handler
#include <__availability>
#include <__config>
+#include <__exception/exception.h>
+#include <__type_traits/alignment_of.h>
#include <__type_traits/is_function.h>
#include <__type_traits/is_same.h>
#include <__type_traits/remove_cv.h>
+#include <__verbose_abort>
#include <cstddef>
#include <cstdlib>
-#include <exception>
#include <version>
#if defined(_LIBCPP_ABI_VCRUNTIME)
@@ -123,10 +125,10 @@ namespace std // purposefully not using versioning namespace
{
#if !defined(_LIBCPP_ABI_VCRUNTIME)
-struct _LIBCPP_TYPE_VIS nothrow_t { explicit nothrow_t() = default; };
-extern _LIBCPP_FUNC_VIS const nothrow_t nothrow;
+struct _LIBCPP_EXPORTED_FROM_ABI nothrow_t { explicit nothrow_t() = default; };
+extern _LIBCPP_EXPORTED_FROM_ABI const nothrow_t nothrow;
-class _LIBCPP_EXCEPTION_ABI bad_alloc
+class _LIBCPP_EXPORTED_FROM_ABI bad_alloc
: public exception
{
public:
@@ -135,7 +137,7 @@ public:
const char* what() const _NOEXCEPT override;
};
-class _LIBCPP_EXCEPTION_ABI bad_array_new_length
+class _LIBCPP_EXPORTED_FROM_ABI bad_array_new_length
: public bad_alloc
{
public:
@@ -145,8 +147,8 @@ public:
};
typedef void (*new_handler)();
-_LIBCPP_FUNC_VIS new_handler set_new_handler(new_handler) _NOEXCEPT;
-_LIBCPP_FUNC_VIS new_handler get_new_handler() _NOEXCEPT;
+_LIBCPP_EXPORTED_FROM_ABI new_handler set_new_handler(new_handler) _NOEXCEPT;
+_LIBCPP_EXPORTED_FROM_ABI new_handler get_new_handler() _NOEXCEPT;
#elif defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS == 0 // !_LIBCPP_ABI_VCRUNTIME
@@ -168,15 +170,15 @@ public:
};
#endif // defined(_LIBCPP_ABI_VCRUNTIME) && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS == 0
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec
+_LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void __throw_bad_alloc(); // not in C++ spec
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_array_new_length()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_array_new_length();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_array_new_length was thrown in -fno-exceptions mode");
#endif
}
@@ -189,14 +191,14 @@ enum align_val_t { __zero = 0, __max = (size_t)-1 };
#endif
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// Enable the declaration even if the compiler doesn't support the language
// feature.
struct destroying_delete_t {
explicit destroying_delete_t() = default;
};
inline constexpr destroying_delete_t destroying_delete{};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
} // namespace std
@@ -332,47 +334,6 @@ inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate_unsized(void* __ptr, s
#endif
}
-#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
-// Low-level helpers to call the aligned allocation and deallocation functions
-// on the target platform. This is used to implement libc++'s own memory
-// allocation routines -- if you need to allocate memory inside the library,
-// chances are that you want to use `__libcpp_allocate` instead.
-//
-// Returns the allocated memory, or `nullptr` on failure.
-inline _LIBCPP_INLINE_VISIBILITY void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) {
-# if defined(_LIBCPP_MSVCRT_LIKE)
- return ::_aligned_malloc(__size, __alignment);
- // Use posix_memalign instead of ::aligned_alloc to fix the musl and some of the tests
-# elif _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC) && false
- // aligned_alloc() requires that __size is a multiple of __alignment,
- // but for C++ [new.delete.general], only states "if the value of an
- // alignment argument passed to any of these functions is not a valid
- // alignment value, the behavior is undefined".
- // To handle calls such as ::operator new(1, std::align_val_t(128)), we
- // round __size up to the next multiple of __alignment.
- size_t __rounded_size = (__size + __alignment - 1) & ~(__alignment - 1);
- // Rounding up could have wrapped around to zero, so we have to add another
- // max() ternary to the actual call site to avoid succeeded in that case.
- return ::aligned_alloc(__alignment, __size > __rounded_size ? __size : __rounded_size);
-# else
- void* __result = nullptr;
- (void)::posix_memalign(&__result, __alignment, __size);
- // If posix_memalign fails, __result is unmodified so we still return `nullptr`.
- return __result;
-# endif
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-void __libcpp_aligned_free(void* __ptr) {
-#if defined(_LIBCPP_MSVCRT_LIKE)
- ::_aligned_free(__ptr);
-#else
- ::free(__ptr);
-#endif
-}
-#endif // !_LIBCPP_HAS_NO_ALIGNED_ALLOCATION
-
-
template <class _Tp>
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI
_LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT
@@ -382,7 +343,7 @@ _LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT
return __builtin_launder(__p);
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI
constexpr _Tp* launder(_Tp* __p) noexcept
@@ -391,7 +352,7 @@ constexpr _Tp* launder(_Tp* __p) noexcept
}
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
#if defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)
@@ -400,11 +361,12 @@ inline constexpr size_t hardware_constructive_interference_size = __GCC_CONSTRUC
#endif // defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <exception>
# include <type_traits>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/numeric b/contrib/libs/cxxsupp/libcxx/include/numeric
index f025913cb57..3fcf6cefdb4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/numeric
+++ b/contrib/libs/cxxsupp/libcxx/include/numeric
@@ -158,6 +158,8 @@ template<class T>
#include <__numeric/iota.h>
#include <__numeric/midpoint.h>
#include <__numeric/partial_sum.h>
+#include <__numeric/pstl_reduce.h>
+#include <__numeric/pstl_transform_reduce.h>
#include <__numeric/reduce.h>
#include <__numeric/transform_exclusive_scan.h>
#include <__numeric/transform_inclusive_scan.h>
@@ -167,10 +169,6 @@ template<class T>
# pragma GCC system_header
#endif
-#if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17
-#error # include <__pstl_numeric>
-#endif
-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <functional>
diff --git a/contrib/libs/cxxsupp/libcxx/include/optional b/contrib/libs/cxxsupp/libcxx/include/optional
index c8fca8885c6..ac1a9254965 100644
--- a/contrib/libs/cxxsupp/libcxx/include/optional
+++ b/contrib/libs/cxxsupp/libcxx/include/optional
@@ -16,107 +16,126 @@
// C++1z
namespace std {
- // 23.6.3, optional for object types
- template <class T> class optional;
+ // [optional.optional], class template optional
+ template <class T>
+ class optional;
- // 23.6.4, no-value state indicator
+ template<class T>
+ concept is-derived-from-optional = requires(const T& t) { // exposition only
+ []<class U>(const optional<U>&){ }(t);
+ };
+
+ // [optional.nullopt], no-value state indicator
struct nullopt_t{see below };
inline constexpr nullopt_t nullopt(unspecified );
- // 23.6.5, class bad_optional_access
+ // [optional.bad.access], class bad_optional_access
class bad_optional_access;
- // 23.6.6, relational operators
+ // [optional.relops], relational operators
template <class T, class U>
- constexpr bool operator==(const optional<T>&, const optional<U>&);
+ constexpr bool operator==(const optional<T>&, const optional<U>&);
template <class T, class U>
- constexpr bool operator!=(const optional<T>&, const optional<U>&);
+ constexpr bool operator!=(const optional<T>&, const optional<U>&);
template <class T, class U>
- constexpr bool operator<(const optional<T>&, const optional<U>&);
+ constexpr bool operator<(const optional<T>&, const optional<U>&);
template <class T, class U>
- constexpr bool operator>(const optional<T>&, const optional<U>&);
+ constexpr bool operator>(const optional<T>&, const optional<U>&);
template <class T, class U>
- constexpr bool operator<=(const optional<T>&, const optional<U>&);
+ constexpr bool operator<=(const optional<T>&, const optional<U>&);
template <class T, class U>
- constexpr bool operator>=(const optional<T>&, const optional<U>&);
-
- // 23.6.7 comparison with nullopt
- template <class T> constexpr bool operator==(const optional<T>&, nullopt_t) noexcept;
- template <class T> constexpr bool operator==(nullopt_t, const optional<T>&) noexcept;
- template <class T> constexpr bool operator!=(const optional<T>&, nullopt_t) noexcept;
- template <class T> constexpr bool operator!=(nullopt_t, const optional<T>&) noexcept;
- template <class T> constexpr bool operator<(const optional<T>&, nullopt_t) noexcept;
- template <class T> constexpr bool operator<(nullopt_t, const optional<T>&) noexcept;
- template <class T> constexpr bool operator<=(const optional<T>&, nullopt_t) noexcept;
- template <class T> constexpr bool operator<=(nullopt_t, const optional<T>&) noexcept;
- template <class T> constexpr bool operator>(const optional<T>&, nullopt_t) noexcept;
- template <class T> constexpr bool operator>(nullopt_t, const optional<T>&) noexcept;
- template <class T> constexpr bool operator>=(const optional<T>&, nullopt_t) noexcept;
- template <class T> constexpr bool operator>=(nullopt_t, const optional<T>&) noexcept;
-
- // 23.6.8, comparison with T
- template <class T, class U> constexpr bool operator==(const optional<T>&, const U&);
- template <class T, class U> constexpr bool operator==(const T&, const optional<U>&);
- template <class T, class U> constexpr bool operator!=(const optional<T>&, const U&);
- template <class T, class U> constexpr bool operator!=(const T&, const optional<U>&);
- template <class T, class U> constexpr bool operator<(const optional<T>&, const U&);
- template <class T, class U> constexpr bool operator<(const T&, const optional<U>&);
- template <class T, class U> constexpr bool operator<=(const optional<T>&, const U&);
- template <class T, class U> constexpr bool operator<=(const T&, const optional<U>&);
- template <class T, class U> constexpr bool operator>(const optional<T>&, const U&);
- template <class T, class U> constexpr bool operator>(const T&, const optional<U>&);
- template <class T, class U> constexpr bool operator>=(const optional<T>&, const U&);
- template <class T, class U> constexpr bool operator>=(const T&, const optional<U>&);
-
- // 23.6.9, specialized algorithms
- template <class T> void swap(optional<T>&, optional<T>&) noexcept(see below ); // constexpr in C++20
- template <class T> constexpr optional<see below > make_optional(T&&);
- template <class T, class... Args>
+ constexpr bool operator>=(const optional<T>&, const optional<U>&);
+ template<class T, three_way_comparable_with<T> U>
+ constexpr compare_three_way_result_t<T, U>
+ operator<=>(const optional<T>&, const optional<U>&); // since C++20
+
+ // [optional.nullops], comparison with nullopt
+ template<class T> constexpr bool operator==(const optional<T>&, nullopt_t) noexcept;
+ template<class T> constexpr bool operator==(nullopt_t, const optional<T>&) noexcept; // until C++17
+ template<class T> constexpr bool operator!=(const optional<T>&, nullopt_t) noexcept; // until C++17
+ template<class T> constexpr bool operator!=(nullopt_t, const optional<T>&) noexcept; // until C++17
+ template<class T> constexpr bool operator<(const optional<T>&, nullopt_t) noexcept; // until C++17
+ template<class T> constexpr bool operator<(nullopt_t, const optional<T>&) noexcept; // until C++17
+ template<class T> constexpr bool operator<=(const optional<T>&, nullopt_t) noexcept; // until C++17
+ template<class T> constexpr bool operator<=(nullopt_t, const optional<T>&) noexcept; // until C++17
+ template<class T> constexpr bool operator>(const optional<T>&, nullopt_t) noexcept; // until C++17
+ template<class T> constexpr bool operator>(nullopt_t, const optional<T>&) noexcept; // until C++17
+ template<class T> constexpr bool operator>=(const optional<T>&, nullopt_t) noexcept; // until C++17
+ template<class T> constexpr bool operator>=(nullopt_t, const optional<T>&) noexcept; // until C++17
+ template<class T>
+ constexpr strong_ordering operator<=>(const optional<T>&, nullopt_t) noexcept; // since C++20
+
+ // [optional.comp.with.t], comparison with T
+ template<class T, class U> constexpr bool operator==(const optional<T>&, const U&);
+ template<class T, class U> constexpr bool operator==(const T&, const optional<U>&);
+ template<class T, class U> constexpr bool operator!=(const optional<T>&, const U&);
+ template<class T, class U> constexpr bool operator!=(const T&, const optional<U>&);
+ template<class T, class U> constexpr bool operator<(const optional<T>&, const U&);
+ template<class T, class U> constexpr bool operator<(const T&, const optional<U>&);
+ template<class T, class U> constexpr bool operator<=(const optional<T>&, const U&);
+ template<class T, class U> constexpr bool operator<=(const T&, const optional<U>&);
+ template<class T, class U> constexpr bool operator>(const optional<T>&, const U&);
+ template<class T, class U> constexpr bool operator>(const T&, const optional<U>&);
+ template<class T, class U> constexpr bool operator>=(const optional<T>&, const U&);
+ template<class T, class U> constexpr bool operator>=(const T&, const optional<U>&);
+ template<class T, class U>
+ requires (!is-derived-from-optional<U>) && three_way_comparable_with<T, U>
+ constexpr compare_three_way_result_t<T, U>
+ operator<=>(const optional<T>&, const U&); // since C++20
+
+ // [optional.specalg], specialized algorithms
+ template<class T>
+ void swap(optional<T>&, optional<T>&) noexcept(see below ); // constexpr in C++20
+
+ template<class T>
+ constexpr optional<see below > make_optional(T&&);
+ template<class T, class... Args>
constexpr optional<T> make_optional(Args&&... args);
- template <class T, class U, class... Args>
+ template<class T, class U, class... Args>
constexpr optional<T> make_optional(initializer_list<U> il, Args&&... args);
- // 23.6.10, hash support
- template <class T> struct hash;
- template <class T> struct hash<optional<T>>;
+ // [optional.hash], hash support
+ template<class T> struct hash;
+ template<class T> struct hash<optional<T>>;
- template <class T> class optional {
+ template<class T>
+ class optional {
public:
using value_type = T;
- // 23.6.3.1, constructors
+ // [optional.ctor], constructors
constexpr optional() noexcept;
constexpr optional(nullopt_t) noexcept;
constexpr optional(const optional &);
constexpr optional(optional &&) noexcept(see below);
- template <class... Args> constexpr explicit optional(in_place_t, Args &&...);
- template <class U, class... Args>
+ template<class... Args>
+ constexpr explicit optional(in_place_t, Args &&...);
+ template<class U, class... Args>
constexpr explicit optional(in_place_t, initializer_list<U>, Args &&...);
- template <class U = T>
+ template<class U = T>
constexpr explicit(see-below) optional(U &&);
- template <class U>
- explicit(see-below) optional(const optional<U> &); // constexpr in C++20
- template <class U>
- explicit(see-below) optional(optional<U> &&); // constexpr in C++20
+ template<class U>
+ explicit(see-below) optional(const optional<U> &); // constexpr in C++20
+ template<class U>
+ explicit(see-below) optional(optional<U> &&); // constexpr in C++20
- // 23.6.3.2, destructor
+ // [optional.dtor], destructor
~optional(); // constexpr in C++20
- // 23.6.3.3, assignment
- optional &operator=(nullopt_t) noexcept; // constexpr in C++20
+ // [optional.assign], assignment
+ optional &operator=(nullopt_t) noexcept; // constexpr in C++20
constexpr optional &operator=(const optional &);
constexpr optional &operator=(optional &&) noexcept(see below);
- template <class U = T> optional &operator=(U &&); // constexpr in C++20
- template <class U> optional &operator=(const optional<U> &); // constexpr in C++20
- template <class U> optional &operator=(optional<U> &&); // constexpr in C++20
- template <class... Args> T& emplace(Args &&...); // constexpr in C++20
- template <class U, class... Args>
- T& emplace(initializer_list<U>, Args &&...); // constexpr in C++20
-
- // 23.6.3.4, swap
+ template<class U = T> optional &operator=(U &&); // constexpr in C++20
+ template<class U> optional &operator=(const optional<U> &); // constexpr in C++20
+ template<class U> optional &operator=(optional<U> &&); // constexpr in C++20
+ template<class... Args> T& emplace(Args &&...); // constexpr in C++20
+ template<class U, class... Args> T& emplace(initializer_list<U>, Args &&...); // constexpr in C++20
+
+ // [optional.swap], swap
void swap(optional &) noexcept(see below ); // constexpr in C++20
- // 23.6.3.5, observers
+ // [optional.observe], observers
constexpr T const *operator->() const;
constexpr T *operator->();
constexpr T const &operator*() const &;
@@ -129,8 +148,8 @@ namespace std {
constexpr T &value() &;
constexpr T &&value() &&;
constexpr const T &&value() const &&;
- template <class U> constexpr T value_or(U &&) const &;
- template <class U> constexpr T value_or(U &&) &&;
+ template<class U> constexpr T value_or(U &&) const &;
+ template<class U> constexpr T value_or(U &&) &&;
// [optional.monadic], monadic operations
template<class F> constexpr auto and_then(F&& f) &; // since C++23
@@ -144,15 +163,15 @@ namespace std {
template<class F> constexpr optional or_else(F&& f) &&; // since C++23
template<class F> constexpr optional or_else(F&& f) const&; // since C++23
- // 23.6.3.6, modifiers
- void reset() noexcept; // constexpr in C++20
+ // [optional.mod], modifiers
+ void reset() noexcept; // constexpr in C++20
private:
- T *val; // exposition only
+ T *val; // exposition only
};
-template<class T>
- optional(T) -> optional<T>;
+ template<class T>
+ optional(T) -> optional<T>;
} // namespace std
@@ -160,21 +179,55 @@ template<class T>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__availability>
+#include <__compare/compare_three_way_result.h>
+#include <__compare/three_way_comparable.h>
#include <__concepts/invocable.h>
#include <__config>
#include <__functional/hash.h>
#include <__functional/invoke.h>
+#include <__functional/reference_wrapper.h>
#include <__functional/unary_function.h>
+#include <__memory/addressof.h>
#include <__memory/construct_at.h>
-#include <__tuple_dir/sfinae_helpers.h>
+#include <__tuple/sfinae_helpers.h>
+#include <__type_traits/add_pointer.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/conjunction.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/disjunction.h>
+#include <__type_traits/is_array.h>
+#include <__type_traits/is_assignable.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
+#include <__type_traits/is_destructible.h>
+#include <__type_traits/is_move_assignable.h>
+#include <__type_traits/is_move_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_object.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/is_scalar.h>
+#include <__type_traits/is_swappable.h>
+#include <__type_traits/is_trivially_copy_assignable.h>
+#include <__type_traits/is_trivially_copy_constructible.h>
+#include <__type_traits/is_trivially_destructible.h>
+#include <__type_traits/is_trivially_move_assignable.h>
+#include <__type_traits/is_trivially_move_constructible.h>
+#include <__type_traits/negation.h>
+#include <__type_traits/remove_const.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/in_place.h>
#include <__utility/move.h>
#include <__utility/swap.h>
+#include <__verbose_abort>
#include <initializer_list>
#include <new>
#include <stdexcept>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -186,10 +239,13 @@ template<class T>
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
namespace std // purposefully not using versioning namespace
{
-class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
+class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
: public exception
{
public:
@@ -200,7 +256,7 @@ public:
} // namespace std
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -208,16 +264,16 @@ _LIBCPP_NORETURN
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
void __throw_bad_optional_access() {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_optional_access();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_optional_access was thrown in -fno-exceptions mode");
#endif
}
struct nullopt_t
{
- struct __secret_tag { _LIBCPP_INLINE_VISIBILITY explicit __secret_tag() = default; };
+ struct __secret_tag { explicit __secret_tag() = default; };
_LIBCPP_INLINE_VISIBILITY constexpr explicit nullopt_t(__secret_tag, __secret_tag) noexcept {}
};
@@ -259,7 +315,7 @@ struct __optional_destruct_base<_Tp, false>
: __val_(_VSTD::forward<_Args>(__args)...),
__engaged_(true) {}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Fp, class... _Args>
_LIBCPP_HIDE_FROM_ABI
constexpr __optional_destruct_base(__optional_construct_from_invoke_tag, _Fp&& __f, _Args&&... __args)
@@ -301,7 +357,7 @@ struct __optional_destruct_base<_Tp, true>
: __val_(_VSTD::forward<_Args>(__args)...),
__engaged_(true) {}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Fp, class... _Args>
_LIBCPP_HIDE_FROM_ABI
constexpr __optional_destruct_base(__optional_construct_from_invoke_tag, _Fp&& __f, _Args&&... __args)
@@ -356,8 +412,8 @@ struct __optional_storage_base : __optional_destruct_base<_Tp>
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct(_Args&&... __args)
{
- _LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
-#if _LIBCPP_STD_VER > 17
+ _LIBCPP_ASSERT_INTERNAL(!has_value(), "__construct called for engaged __optional_storage");
+#if _LIBCPP_STD_VER >= 20
_VSTD::construct_at(_VSTD::addressof(this->__val_), _VSTD::forward<_Args>(__args)...);
#else
::new ((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Args>(__args)...);
@@ -403,7 +459,7 @@ struct __optional_storage_base<_Tp, true>
__raw_type* __value_;
template <class _Up>
- static constexpr bool __can_bind_reference() {
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __can_bind_reference() {
using _RawUp = __libcpp_remove_reference_t<_Up>;
using _UpPtr = _RawUp*;
using _RawTp = __libcpp_remove_reference_t<_Tp>;
@@ -451,7 +507,7 @@ struct __optional_storage_base<_Tp, true>
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct(_UArg&& __val)
{
- _LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
+ _LIBCPP_ASSERT_INTERNAL(!has_value(), "__construct called for engaged __optional_storage");
static_assert(__can_bind_reference<_UArg>(),
"Attempted to construct a reference element in tuple from a "
"possible temporary");
@@ -623,12 +679,20 @@ using __optional_sfinae_assign_base_t = __sfinae_assign_base<
template<class _Tp>
class optional;
+
+#if _LIBCPP_STD_VER >= 20
+
+template <class _Tp>
+concept __is_derived_from_optional = requires(const _Tp& __t) { []<class _Up>(const optional<_Up>&) {}(__t); };
+
+# endif // _LIBCPP_STD_VER >= 20
+
template <class _Tp>
struct __is_std_optional : false_type {};
template <class _Tp> struct __is_std_optional<optional<_Tp>> : true_type {};
template <class _Tp>
-class optional
+class _LIBCPP_DECLSPEC_EMPTY_BASES optional
: private __optional_move_assign_base<_Tp>
, private __optional_sfinae_ctor_base_t<_Tp>
, private __optional_sfinae_assign_base_t<_Tp>
@@ -653,13 +717,13 @@ private:
// LWG2756: conditionally explicit conversion from _Up
struct _CheckOptionalArgsConstructor {
template <class _Up>
- static constexpr bool __enable_implicit() {
+ _LIBCPP_HIDE_FROM_ABI static constexpr bool __enable_implicit() {
return is_constructible_v<_Tp, _Up&&> &&
is_convertible_v<_Up&&, _Tp>;
}
template <class _Up>
- static constexpr bool __enable_explicit() {
+ _LIBCPP_HIDE_FROM_ABI static constexpr bool __enable_explicit() {
return is_constructible_v<_Tp, _Up&&> &&
!is_convertible_v<_Up&&, _Tp>;
}
@@ -692,17 +756,17 @@ private:
is_assignable<_Tp&, _Opt const&&>
>;
template <class _Up, class _QUp = _QualUp>
- static constexpr bool __enable_implicit() {
+ _LIBCPP_HIDE_FROM_ABI static constexpr bool __enable_implicit() {
return is_convertible<_QUp, _Tp>::value &&
!__check_constructible_from_opt<_Up>::value;
}
template <class _Up, class _QUp = _QualUp>
- static constexpr bool __enable_explicit() {
+ _LIBCPP_HIDE_FROM_ABI static constexpr bool __enable_explicit() {
return !is_convertible<_QUp, _Tp>::value &&
!__check_constructible_from_opt<_Up>::value;
}
template <class _Up, class _QUp = _QualUp>
- static constexpr bool __enable_assign() {
+ _LIBCPP_HIDE_FROM_ABI static constexpr bool __enable_assign() {
// Construction and assignability of _QUp to _Tp has already been
// checked.
return !__check_constructible_from_opt<_Up>::value &&
@@ -805,7 +869,7 @@ public:
this->__construct_from(_VSTD::move(__v));
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template<class _Fp, class... _Args>
_LIBCPP_HIDE_FROM_ABI
constexpr explicit optional(__optional_construct_from_invoke_tag, _Fp&& __f, _Args&&... __args)
@@ -820,8 +884,8 @@ public:
return *this;
}
- constexpr optional& operator=(const optional&) = default;
- constexpr optional& operator=(optional&&) = default;
+ _LIBCPP_HIDE_FROM_ABI constexpr optional& operator=(const optional&) = default;
+ _LIBCPP_HIDE_FROM_ABI constexpr optional& operator=(optional&&) = default;
// LWG2756
template <class _Up = value_type,
@@ -932,7 +996,7 @@ public:
add_pointer_t<value_type const>
operator->() const
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator-> called on a disengaged value");
return _VSTD::addressof(this->__get());
}
@@ -941,7 +1005,7 @@ public:
add_pointer_t<value_type>
operator->()
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator-> called on a disengaged value");
return _VSTD::addressof(this->__get());
}
@@ -950,7 +1014,7 @@ public:
const value_type&
operator*() const& noexcept
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
return this->__get();
}
@@ -959,7 +1023,7 @@ public:
value_type&
operator*() & noexcept
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
return this->__get();
}
@@ -968,7 +1032,7 @@ public:
value_type&&
operator*() && noexcept
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
return _VSTD::move(this->__get());
}
@@ -977,7 +1041,7 @@ public:
const value_type&&
operator*() const&& noexcept
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
return _VSTD::move(this->__get());
}
@@ -1047,7 +1111,7 @@ public:
static_cast<value_type>(_VSTD::forward<_Up>(__v));
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template<class _Func>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
constexpr auto and_then(_Func&& __f) & {
@@ -1171,7 +1235,7 @@ public:
return _VSTD::move(*this);
return _VSTD::forward<_Func>(__f)();
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
using __base::reset;
};
@@ -1278,6 +1342,18 @@ operator>=(const optional<_Tp>& __x, const optional<_Up>& __y)
return *__x >= *__y;
}
+#if _LIBCPP_STD_VER >= 20
+
+template <class _Tp, three_way_comparable_with<_Tp> _Up>
+_LIBCPP_HIDE_FROM_ABI constexpr compare_three_way_result_t<_Tp, _Up>
+operator<=>(const optional<_Tp>& __x, const optional<_Up>& __y) {
+ if (__x && __y)
+ return *__x <=> *__y;
+ return __x.has_value() <=> __y.has_value();
+}
+
+#endif // _LIBCPP_STD_VER >= 20
+
// Comparisons with nullopt
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
@@ -1287,6 +1363,8 @@ operator==(const optional<_Tp>& __x, nullopt_t) noexcept
return !static_cast<bool>(__x);
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
bool
@@ -1375,6 +1453,15 @@ operator>=(nullopt_t, const optional<_Tp>& __x) noexcept
return !static_cast<bool>(__x);
}
+#else // _LIBCPP_STD_VER <= 17
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI constexpr strong_ordering operator<=>(const optional<_Tp>& __x, nullopt_t) noexcept {
+ return __x.has_value() <=> false;
+}
+
+#endif // _LIBCPP_STD_VER <= 17
+
// Comparisons with T
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
@@ -1520,6 +1607,17 @@ operator>=(const _Tp& __v, const optional<_Up>& __x)
return static_cast<bool>(__x) ? __v >= *__x : true;
}
+#if _LIBCPP_STD_VER >= 20
+
+template <class _Tp, class _Up>
+ requires(!__is_derived_from_optional<_Up>) && three_way_comparable_with<_Tp, _Up>
+_LIBCPP_HIDE_FROM_ABI constexpr compare_three_way_result_t<_Tp, _Up>
+operator<=>(const optional<_Tp>& __x, const _Up& __v) {
+ return __x.has_value() ? *__x <=> __v : strong_ordering::less;
+}
+
+#endif // _LIBCPP_STD_VER >= 20
+
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1572,7 +1670,9 @@ struct _LIBCPP_TEMPLATE_VIS hash<
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
+
+_LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
@@ -1583,6 +1683,7 @@ _LIBCPP_END_NAMESPACE_STD
# include <memory>
# include <ratio>
# include <tuple>
+# include <type_traits>
# include <typeinfo>
# include <utility>
# include <variant>
diff --git a/contrib/libs/cxxsupp/libcxx/include/ostream b/contrib/libs/cxxsupp/libcxx/include/ostream
index 743d40539c1..51d944e9c83 100644
--- a/contrib/libs/cxxsupp/libcxx/include/ostream
+++ b/contrib/libs/cxxsupp/libcxx/include/ostream
@@ -165,8 +165,16 @@ basic_ostream<wchar_t, traits>& operator<<(basic_ostream<wchar_t, traits>&, cons
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
+#include <__exception/operations.h>
+#include <__fwd/ostream.h>
#include <__memory/shared_ptr.h>
#include <__memory/unique_ptr.h>
+#include <__system_error/error_code.h>
+#include <__type_traits/conjunction.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_base_of.h>
+#include <__type_traits/void_t.h>
+#include <__utility/declval.h>
#include <bitset>
#include <ios>
#include <locale>
@@ -244,7 +252,7 @@ public:
basic_ostream& operator<<(long double __f);
basic_ostream& operator<<(const void* __p);
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI
basic_ostream& operator<<(const volatile void* __p) {
return operator<<(const_cast<const void*>(__p));
@@ -253,7 +261,7 @@ public:
basic_ostream& operator<<(basic_streambuf<char_type, traits_type>* __sb);
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
// LWG 2221 - nullptr. This is not backported to older standards modes.
// See https://reviews.llvm.org/D127033 for more info on the rationale.
_LIBCPP_INLINE_VISIBILITY
@@ -314,18 +322,18 @@ basic_ostream<_CharT, _Traits>::sentry::~sentry()
if (__os_.rdbuf() && __os_.good() && (__os_.flags() & ios_base::unitbuf)
&& !uncaught_exception())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (__os_.rdbuf()->pubsync() == -1)
__os_.setstate(ios_base::badbit);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -352,19 +360,19 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_type>* __sb)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
if (__sb)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef ostreambuf_iterator<_CharT, _Traits> _Op;
_Ip __i(__sb);
@@ -379,24 +387,24 @@ basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_typ
}
if (__c == 0)
this->setstate(ios_base::failbit);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_failbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
this->setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -404,10 +412,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(bool __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -416,13 +424,13 @@ basic_ostream<_CharT, _Traits>::operator<<(bool __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -430,10 +438,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(short __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -446,13 +454,13 @@ basic_ostream<_CharT, _Traits>::operator<<(short __n)
static_cast<long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -460,10 +468,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned short __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -472,13 +480,13 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned short __n)
if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -486,10 +494,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(int __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -502,13 +510,13 @@ basic_ostream<_CharT, _Traits>::operator<<(int __n)
static_cast<long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -516,10 +524,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -528,13 +536,13 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n)
if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -542,10 +550,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(long __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -554,13 +562,13 @@ basic_ostream<_CharT, _Traits>::operator<<(long __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -568,10 +576,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -580,13 +588,13 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -594,10 +602,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(long long __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -606,13 +614,13 @@ basic_ostream<_CharT, _Traits>::operator<<(long long __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -620,10 +628,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -632,13 +640,13 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -646,10 +654,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(float __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -658,13 +666,13 @@ basic_ostream<_CharT, _Traits>::operator<<(float __n)
if (__f.put(*this, *this, this->fill(), static_cast<double>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -672,10 +680,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(double __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -684,13 +692,13 @@ basic_ostream<_CharT, _Traits>::operator<<(double __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -698,10 +706,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(long double __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -710,13 +718,13 @@ basic_ostream<_CharT, _Traits>::operator<<(long double __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -724,10 +732,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(const void* __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -736,13 +744,13 @@ basic_ostream<_CharT, _Traits>::operator<<(const void* __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -751,10 +759,10 @@ _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
__put_character_sequence(basic_ostream<_CharT, _Traits>& __os,
const _CharT* __str, size_t __len)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -769,13 +777,13 @@ __put_character_sequence(basic_ostream<_CharT, _Traits>& __os,
__os.fill()).failed())
__os.setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -791,10 +799,10 @@ template<class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -810,13 +818,13 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
__os.fill()).failed())
__os.setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -852,10 +860,10 @@ template<class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -884,13 +892,13 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
__os.fill()).failed())
__os.setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -921,10 +929,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::put(char_type __c)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -934,13 +942,13 @@ basic_ostream<_CharT, _Traits>::put(char_type __c)
if (__o.failed())
this->setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -948,23 +956,23 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::write(const char_type* __s, streamsize __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __sen(*this);
if (__sen && __n)
{
if (this->rdbuf()->sputn(__s, __n) != __n)
this->setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -972,10 +980,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::flush()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf())
{
sentry __s(*this);
@@ -985,13 +993,13 @@ basic_ostream<_CharT, _Traits>::flush()
this->setstate(ios_base::badbit);
}
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -1179,7 +1187,7 @@ basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const ch
template <class _Traits>
basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const char32_t*) = delete;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -1189,7 +1197,9 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>;
_LIBCPP_END_NAMESPACE_STD
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <iterator>
# include <type_traits>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/print b/contrib/libs/cxxsupp/libcxx/include/print
new file mode 100644
index 00000000000..d119c8bda74
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/include/print
@@ -0,0 +1,389 @@
+// -*- 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_PRINT
+#define _LIBCPP_PRINT
+
+/*
+namespace std {
+ // [print.fun], print functions
+ template<class... Args>
+ void print(format_string<Args...> fmt, Args&&... args);
+ template<class... Args>
+ void print(FILE* stream, format_string<Args...> fmt, Args&&... args);
+
+ template<class... Args>
+ void println(format_string<Args...> fmt, Args&&... args);
+ template<class... Args>
+ void println(FILE* stream, format_string<Args...> fmt, Args&&... args);
+
+ void vprint_unicode(string_view fmt, format_args args);
+ void vprint_unicode(FILE* stream, string_view fmt, format_args args);
+
+ void vprint_nonunicode(string_view fmt, format_args args);
+ void vprint_nonunicode(FILE* stream, string_view fmt, format_args args);
+}
+*/
+
+#include <__assert> // all public C++ headers provide the assertion handler
+#include <__concepts/same_as.h>
+#include <__config>
+#include <__format/buffer.h>
+#include <__format/format_arg_store.h>
+#include <__format/format_args.h>
+#include <__format/format_context.h>
+#include <__format/format_error.h>
+#include <__format/format_functions.h>
+#include <__format/unicode.h>
+#include <__system_error/system_error.h>
+#include <__utility/forward.h>
+#include <cerrno>
+#include <cstdio>
+#include <string>
+#include <string_view>
+#include <version>
+
+#if __has_include(<unistd.h>)
+# include <unistd.h>
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifdef _WIN32
+_LIBCPP_EXPORTED_FROM_ABI bool __is_windows_terminal(FILE* __stream);
+
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+// A wrapper for WriteConsoleW which is used to write to the Windows
+// console. This function is in the dylib to avoid pulling in windows.h
+// in the library headers. The function itself uses some private parts
+// of the dylib too.
+//
+// The function does not depend on the language standard used. Guarding
+// it with C++23 would fail since the dylib is currently built using C++20.
+//
+// Note the function is only implemented on the Windows platform.
+_LIBCPP_EXPORTED_FROM_ABI void __write_to_windows_console(FILE* __stream, wstring_view __view);
+# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+
+#endif // _WIN32
+
+#if _LIBCPP_STD_VER >= 23
+
+# ifndef _LIBCPP_HAS_NO_UNICODE
+// This is the code to transcode UTF-8 to UTF-16. This is used on
+// Windows for the native Unicode API. The code is modeled to make it
+// easier to extend to
+//
+// P2728R0 Unicode in the Library, Part 1: UTF Transcoding
+//
+// This paper is still under heavy development so it makes no sense yet
+// to strictly follow the paper.
+namespace __unicode {
+
+// The names of these concepts are modelled after P2728R0, but the
+// implementation is not. char16_t may contain 32-bits so depending on the
+// number of bits is an issue.
+# ifdef _LIBCPP_SHORT_WCHAR
+template <class _Tp>
+concept __utf16_code_unit =
+ same_as<_Tp, char16_t>
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+ || same_as<_Tp, wchar_t>
+# endif
+ ;
+template <class _Tp>
+concept __utf32_code_unit = same_as<_Tp, char32_t>;
+# else // _LIBCPP_SHORT_WCHAR
+template <class _Tp>
+concept __utf16_code_unit = same_as<_Tp, char16_t>;
+template <class _Tp>
+concept __utf32_code_unit =
+ same_as<_Tp, char32_t>
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+ || same_as<_Tp, wchar_t>
+# endif
+ ;
+# endif // _LIBCPP_SHORT_WCHAR
+
+// Pass by reference since an output_iterator may not be copyable.
+template <class _OutIt>
+_LIBCPP_HIDE_FROM_ABI constexpr void __encode(_OutIt&, char32_t) = delete;
+
+template <class _OutIt>
+ requires __utf16_code_unit<iter_value_t<_OutIt>>
+_LIBCPP_HIDE_FROM_ABI constexpr void __encode(_OutIt& __out_it, char32_t __value) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_scalar_value(__value), "an invalid unicode scalar value results in invalid UTF-16");
+
+ if (__value < 0x10000) {
+ *__out_it++ = __value;
+ return;
+ }
+
+ __value -= 0x10000;
+ *__out_it++ = 0xd800 + (__value >> 10);
+ *__out_it++ = 0xdc00 + (__value & 0x3FF);
+}
+
+template <class _OutIt>
+ requires __utf32_code_unit<iter_value_t<_OutIt>>
+_LIBCPP_HIDE_FROM_ABI constexpr void __encode(_OutIt& __out_it, char32_t __value) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_scalar_value(__value), "an invalid unicode scalar value results in invalid UTF-32");
+ *__out_it++ = __value;
+}
+
+template <class _OutIt, input_iterator _InIt>
+ requires output_iterator<_OutIt, const iter_value_t<_OutIt>&> && (!same_as<iter_value_t<_OutIt>, iter_value_t<_InIt>>)
+_LIBCPP_HIDE_FROM_ABI constexpr _OutIt __transcode(_InIt __first, _InIt __last, _OutIt __out_it) {
+ // The __code_point_view has a basic_string_view interface.
+ // When transcoding becomes part of the standard we probably want to
+ // look at smarter algorithms.
+ // For example, when processing a code point that is encoded in
+ // 1 to 3 code units in UTF-8, the result will always be encoded
+ // in 1 code unit in UTF-16 (code points that require 4 code
+ // units in UTF-8 will require 2 code units in UTF-16).
+ //
+ // Note if P2728 is accepted types like int may become valid. In that case
+ // the __code_point_view should use a span. Libc++ will remove support for
+ // char_traits<int>.
+
+ // TODO PRINT Validate with clang-tidy
+ // NOLINTNEXTLINE(bugprone-dangling-handle)
+ basic_string_view<iter_value_t<_InIt>> __data{__first, __last};
+ __code_point_view<iter_value_t<_InIt>> __view{__data.begin(), __data.end()};
+ while (!__view.__at_end())
+ __unicode::__encode(__out_it, __view.__consume().__code_point);
+ return __out_it;
+}
+
+} // namespace __unicode
+
+# endif // _LIBCPP_HAS_NO_UNICODE
+
+namespace __print {
+
+// [print.fun]/2
+// Effects: If the ordinary literal encoding ([lex.charset]) is UTF-8, equivalent to:
+// vprint_unicode(stream, fmt.str, make_format_args(args...));
+// Otherwise, equivalent to:
+// vprint_nonunicode(stream, fmt.str, make_format_args(args...));
+//
+// Based on the compiler and its compilation flags this value is or is
+// not true. As mentioned in P2093R14 this only affects Windows. The
+// test below could also be done for
+// - GCC using __GNUC_EXECUTION_CHARSET_NAME
+// https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
+// - Clang using __clang_literal_encoding__
+// https://clang.llvm.org/docs/LanguageExtensions.html#builtin-macros
+// (note at the time of writing Clang is hard-coded to UTF-8.)
+//
+
+# ifdef _LIBCPP_HAS_NO_UNICODE
+inline constexpr bool __use_unicode = false;
+# elif defined(_MSVC_EXECUTION_CHARACTER_SET)
+// This is the same test MSVC STL uses in their implementation of <print>
+// See: https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers
+inline constexpr bool __use_unicode = _MSVC_EXECUTION_CHARACTER_SET == 65001;
+# else
+inline constexpr bool __use_unicode = true;
+# endif
+
+_LIBCPP_HIDE_FROM_ABI inline bool __is_terminal(FILE* __stream) {
+# ifdef _WIN32
+ return std::__is_windows_terminal(__stream);
+# elif __has_include(<unistd.h>)
+ return isatty(fileno(__stream));
+# else
+# error "Provide a way to determine whether a FILE* is a terminal"
+# endif
+}
+
+template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
+_LIBCPP_HIDE_FROM_ABI inline void
+__vprint_nonunicode(FILE* __stream, string_view __fmt, format_args __args, bool __write_nl) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__stream, "__stream is a valid pointer to an output C stream");
+ string __str = std::vformat(__fmt, __args);
+ if (__write_nl)
+ __str.push_back('\n');
+
+ size_t __size = fwrite(__str.data(), 1, __str.size(), __stream);
+ if (__size < __str.size()) {
+ if (std::feof(__stream))
+ std::__throw_system_error(EIO, "EOF while writing the formatted output");
+ std::__throw_system_error(std::ferror(__stream), "failed to write formatted output");
+ }
+}
+
+# ifndef _LIBCPP_HAS_NO_UNICODE
+
+// Note these helper functions are mainly used to aid testing.
+// On POSIX systems and Windows the output is no longer considered a
+// terminal when the output is redirected. Typically during testing the
+// output is redirected to be able to capture it. This makes it hard to
+// test this code path.
+template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
+_LIBCPP_HIDE_FROM_ABI inline void
+__vprint_unicode_posix(FILE* __stream, string_view __fmt, format_args __args, bool __write_nl, bool __is_terminal) {
+ // TODO PRINT Should flush errors throw too?
+ if (__is_terminal)
+ std::fflush(__stream);
+
+ __print::__vprint_nonunicode(__stream, __fmt, __args, __write_nl);
+}
+
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
+_LIBCPP_HIDE_FROM_ABI inline void
+__vprint_unicode_windows(FILE* __stream, string_view __fmt, format_args __args, bool __write_nl, bool __is_terminal) {
+ if (!__is_terminal)
+ return __print::__vprint_nonunicode(__stream, __fmt, __args, __write_nl);
+
+ // TODO PRINT Should flush errors throw too?
+ std::fflush(__stream);
+
+ string __str = std::vformat(__fmt, __args);
+ // UTF-16 uses the same number or less code units than UTF-8.
+ // However the size of the code unit is 16 bits instead of 8 bits.
+ //
+ // The buffer uses the worst-case estimate and should never resize.
+ // However when the string is large this could lead to OOM. Using a
+ // smaller size might work, but since the buffer uses a grow factor
+ // the final size might be larger when the estimate is wrong.
+ //
+ // TODO PRINT profile and improve the speed of this code.
+ __format::__retarget_buffer<wchar_t> __buffer{__str.size()};
+ __unicode::__transcode(__str.begin(), __str.end(), __buffer.__make_output_iterator());
+ if (__write_nl)
+ __buffer.push_back(L'\n');
+
+ [[maybe_unused]] wstring_view __view = __buffer.__view();
+
+ // The macro _LIBCPP_TESTING_PRINT_WRITE_TO_WINDOWS_CONSOLE_FUNCTION is used to change
+ // the behavior in the test. This is not part of the public API.
+# ifdef _LIBCPP_TESTING_PRINT_WRITE_TO_WINDOWS_CONSOLE_FUNCTION
+ _LIBCPP_TESTING_PRINT_WRITE_TO_WINDOWS_CONSOLE_FUNCTION(__stream, __view);
+# elif defined(_WIN32)
+ std::__write_to_windows_console(__stream, __view);
+# else
+ std::__throw_runtime_error("No defintion of _LIBCPP_TESTING_PRINT_WRITE_TO_WINDOWS_CONSOLE_FUNCTION and "
+ "__write_to_windows_console is not available.");
+# endif
+}
+# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+
+template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
+_LIBCPP_HIDE_FROM_ABI inline void
+__vprint_unicode([[maybe_unused]] FILE* __stream,
+ [[maybe_unused]] string_view __fmt,
+ [[maybe_unused]] format_args __args,
+ [[maybe_unused]] bool __write_nl) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__stream, "__stream is a valid pointer to an output C stream");
+
+ // [print.fun]
+ // 7 - Effects: If stream refers to a terminal capable of displaying
+ // Unicode, writes out to the terminal using the native Unicode
+ // API; if out contains invalid code units, the behavior is
+ // undefined and implementations are encouraged to diagnose it.
+ // Otherwise writes out to stream unchanged. If the native
+ // Unicode API is used, the function flushes stream before
+ // writing out.
+ // 8 - Throws: Any exception thrown by the call to vformat
+ // ([format.err.report]). system_error if writing to the terminal
+ // or stream fails. May throw bad_alloc.
+ // 9 - Recommended practice: If invoking the native Unicode API
+ // requires transcoding, implementations should substitute
+ // invalid code units with U+FFFD replacement character per the
+ // Unicode Standard, Chapter 3.9 U+FFFD Substitution in
+ // Conversion.
+
+ // On non-Windows platforms the Unicode API is the normal file I/O API
+ // so there the call can be forwarded to the non_unicode API. On
+ // Windows there is a different API. This API requires transcoding.
+
+# ifndef _WIN32
+ __print::__vprint_unicode_posix(__stream, __fmt, __args, __write_nl, __print::__is_terminal(__stream));
+# elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
+ __print::__vprint_unicode_windows(__stream, __fmt, __args, __write_nl, __print::__is_terminal(__stream));
+# else
+# error "Windows builds with wchar_t disabled are not supported."
+# endif
+}
+
+# endif // _LIBCPP_HAS_NO_UNICODE
+
+} // namespace __print
+
+template <class... _Args>
+_LIBCPP_HIDE_FROM_ABI void print(FILE* __stream, format_string<_Args...> __fmt, _Args&&... __args) {
+# ifndef _LIBCPP_HAS_NO_UNICODE
+ if constexpr (__print::__use_unicode)
+ __print::__vprint_unicode(__stream, __fmt.get(), std::make_format_args(__args...), false);
+ else
+ __print::__vprint_nonunicode(__stream, __fmt.get(), std::make_format_args(__args...), false);
+# else // _LIBCPP_HAS_NO_UNICODE
+ __print::__vprint_nonunicode(__stream, __fmt.get(), std::make_format_args(__args...), false);
+# endif // _LIBCPP_HAS_NO_UNICODE
+}
+
+template <class... _Args>
+_LIBCPP_HIDE_FROM_ABI void print(format_string<_Args...> __fmt, _Args&&... __args) {
+ std::print(stdout, __fmt, std::forward<_Args>(__args)...);
+}
+
+template <class... _Args>
+_LIBCPP_HIDE_FROM_ABI void println(FILE* __stream, format_string<_Args...> __fmt, _Args&&... __args) {
+# ifndef _LIBCPP_HAS_NO_UNICODE
+ // Note the wording in the Standard is inefficient. The output of
+ // std::format is a std::string which is then copied. This solution
+ // just appends a newline at the end of the output.
+ if constexpr (__print::__use_unicode)
+ __print::__vprint_unicode(__stream, __fmt.get(), std::make_format_args(__args...), true);
+ else
+ __print::__vprint_nonunicode(__stream, __fmt.get(), std::make_format_args(__args...), true);
+# else // _LIBCPP_HAS_NO_UNICODE
+ __print::__vprint_nonunicode(__stream, __fmt.get(), std::make_format_args(__args...), true);
+# endif // _LIBCPP_HAS_NO_UNICODE
+}
+
+template <class... _Args>
+_LIBCPP_HIDE_FROM_ABI void println(format_string<_Args...> __fmt, _Args&&... __args) {
+ std::println(stdout, __fmt, std::forward<_Args>(__args)...);
+}
+
+# ifndef _LIBCPP_HAS_NO_UNICODE
+template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
+_LIBCPP_HIDE_FROM_ABI inline void vprint_unicode(FILE* __stream, string_view __fmt, format_args __args) {
+ __print::__vprint_unicode(__stream, __fmt, __args, false);
+}
+
+template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
+_LIBCPP_HIDE_FROM_ABI inline void vprint_unicode(string_view __fmt, format_args __args) {
+ std::vprint_unicode(stdout, __fmt, __args);
+}
+
+# endif // _LIBCPP_HAS_NO_UNICODE
+
+template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
+_LIBCPP_HIDE_FROM_ABI inline void vprint_nonunicode(FILE* __stream, string_view __fmt, format_args __args) {
+ __print::__vprint_nonunicode(__stream, __fmt, __args, false);
+}
+
+template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
+_LIBCPP_HIDE_FROM_ABI inline void vprint_nonunicode(string_view __fmt, format_args __args) {
+ std::vprint_nonunicode(stdout, __fmt, __args);
+}
+
+#endif // _LIBCPP_STD_VER >= 23
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_PRINT
diff --git a/contrib/libs/cxxsupp/libcxx/include/queue b/contrib/libs/cxxsupp/libcxx/include/queue
index 6c1b892efad..b5944e8f9f9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/queue
+++ b/contrib/libs/cxxsupp/libcxx/include/queue
@@ -43,6 +43,7 @@ public:
explicit queue(container_type&& c)
template<class InputIterator>
queue(InputIterator first, InputIterator last); // since C++23
+ template<container-compatible-range<T> R> queue(from_range_t, R&& rg); // since C++23
template <class Alloc>
explicit queue(const Alloc& a);
template <class Alloc>
@@ -55,6 +56,8 @@ public:
queue(queue&& q, const Alloc& a);
template <class InputIterator, class Alloc>
queue(InputIterator first, InputIterator last, const Alloc&); // since C++23
+ template<container-compatible-range<T> R, class Alloc>
+ queue(from_range_t, R&& rg, const Alloc&); // since C++23
bool empty() const;
size_type size() const;
@@ -66,6 +69,8 @@ public:
void push(const value_type& v);
void push(value_type&& v);
+ template<container-compatible-range<T> R>
+ void push_range(R&& rg); // C++23
template <class... Args> reference emplace(Args&&... args); // reference in C++17
void pop();
@@ -78,6 +83,9 @@ template<class Container>
template<class InputIterator>
queue(InputIterator, InputIterator) -> queue<iter-value-type<InputIterator>>; // since C++23
+template<ranges::input_range R>
+ queue(from_range_t, R&&) -> queue<ranges::range_value_t<R>>; // since C++23
+
template<class Container, class Allocator>
queue(Container, Allocator) -> queue<typename Container::value_type, Container>; // C++17
@@ -86,6 +94,10 @@ template<class InputIterator, class Allocator>
-> queue<iter-value-type<InputIterator>,
deque<iter-value-type<InputIterator>, Allocator>>; // since C++23
+template<ranges::input_range R, class Allocator>
+ queue(from_range_t, R&&, Allocator)
+ -> queue<ranges::range_value_t<R>, deque<ranges::range_value_t<R>, Allocator>>; // since C++23
+
template <class T, class Container>
bool operator==(const queue<T, Container>& x,const queue<T, Container>& y);
@@ -104,6 +116,10 @@ template <class T, class Container>
template <class T, class Container>
bool operator<=(const queue<T, Container>& x,const queue<T, Container>& y);
+template<class T, three_way_comparable Container>
+ compare_three_way_result_t<Container>
+ operator<=>(const queue<T, Container>& x, const queue<T, Container>& y); // since C++20
+
template <class T, class Container>
void swap(queue<T, Container>& x, queue<T, Container>& y)
noexcept(noexcept(x.swap(y)));
@@ -138,6 +154,8 @@ public:
template <class InputIterator>
priority_queue(InputIterator first, InputIterator last,
const Compare& comp, Container&& c);
+ template <container-compatible-range<T> R>
+ priority_queue(from_range_t, R&& rg, const Compare& x = Compare()); // since C++23
template <class Alloc>
explicit priority_queue(const Alloc& a);
template <class Alloc>
@@ -160,6 +178,10 @@ public:
template <class InputIterator>
priority_queue(InputIterator first, InputIterator last,
const Compare& comp, Container&& c, const Alloc& a);
+ template <container-compatible-range<T> R, class Alloc>
+ priority_queue(from_range_t, R&& rg, const Compare&, const Alloc&); // since C++23
+ template <container-compatible-range<T> R, class Alloc>
+ priority_queue(from_range_t, R&& rg, const Alloc&); // since C++23
template <class Alloc>
priority_queue(const priority_queue& q, const Alloc& a);
template <class Alloc>
@@ -171,6 +193,8 @@ public:
void push(const value_type& v);
void push(value_type&& v);
+ template<container-compatible-range<T> R>
+ void push_range(R&& rg); // C++23
template <class... Args> void emplace(Args&&... args);
void pop();
@@ -189,6 +213,10 @@ template<class InputIterator,
priority_queue(InputIterator, InputIterator, Compare = Compare(), Container = Container())
-> priority_queue<iter-value-type<InputIterator>, Container, Compare>; // C++17
+template<ranges::input_range R, class Compare = less<ranges::range_value_t<R>>>
+ priority_queue(from_range_t, R&&, Compare = Compare())
+ -> priority_queue<ranges::range_value_t<R>, vector<ranges::range_value_t<R>>, Compare>; // C++23
+
template<class Compare, class Container, class Allocator>
priority_queue(Compare, Container, Allocator)
-> priority_queue<typename Container::value_type, Container, Compare>; // C++17
@@ -208,6 +236,15 @@ template<class InputIterator, class Compare, class Container, class Allocator>
priority_queue(InputIterator, InputIterator, Compare, Container, Allocator)
-> priority_queue<typename Container::value_type, Container, Compare>; // C++17
+template<ranges::input_range R, class Compare, class Allocator>
+ priority_queue(from_range_t, R&&, Compare, Allocator)
+ -> priority_queue<ranges::range_value_t<R>, vector<ranges::range_value_t<R>, Allocator>,
+ Compare>; // C++23
+
+template<ranges::input_range R, class Allocator>
+ priority_queue(from_range_t, R&&, Allocator)
+ -> priority_queue<ranges::range_value_t<R>, vector<ranges::range_value_t<R>, Allocator>>; // C++23
+
template <class T, class Container, class Compare>
void swap(priority_queue<T, Container, Compare>& x,
priority_queue<T, Container, Compare>& y)
@@ -220,14 +257,19 @@ template <class T, class Container, class Compare>
#include <__algorithm/make_heap.h>
#include <__algorithm/pop_heap.h>
#include <__algorithm/push_heap.h>
+#include <__algorithm/ranges_copy.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <__functional/operations.h>
+#include <__iterator/back_insert_iterator.h>
#include <__iterator/iterator_traits.h>
#include <__memory/uses_allocator.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/container_compatible_range.h>
+#include <__ranges/from_range.h>
#include <__utility/forward.h>
#include <deque>
-#include <type_traits>
#include <vector>
#include <version>
@@ -278,18 +320,30 @@ public:
_LIBCPP_INLINE_VISIBILITY
queue(const queue& __q) : c(__q.c) {}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _InputIterator,
- class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
+ class = __enable_if_t<__has_input_iterator_category<_InputIterator>::value>>
_LIBCPP_HIDE_FROM_ABI
queue(_InputIterator __first, _InputIterator __last) : c(__first, __last) {}
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ queue(from_range_t, _Range&& __range) : c(from_range, std::forward<_Range>(__range)) {}
+
template <class _InputIterator,
class _Alloc,
- class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = __enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = __enable_if_t<uses_allocator<container_type, _Alloc>::value>>
_LIBCPP_HIDE_FROM_ABI
queue(_InputIterator __first, _InputIterator __second, const _Alloc& __alloc) : c(__first, __second, __alloc) {}
+
+ template <_ContainerCompatibleRange<_Tp> _Range,
+ class _Alloc,
+ class = __enable_if_t<uses_allocator<container_type, _Alloc>::value>>
+ _LIBCPP_HIDE_FROM_ABI
+ queue(from_range_t, _Range&& __range, const _Alloc& __alloc)
+ : c(from_range, std::forward<_Range>(__range), __alloc) {}
+
#endif
_LIBCPP_INLINE_VISIBILITY
@@ -361,9 +415,24 @@ public:
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void push(value_type&& __v) {c.push_back(_VSTD::move(__v));}
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void push_range(_Range&& __range) {
+ if constexpr (requires (container_type& __c) {
+ __c.append_range(std::forward<_Range>(__range));
+ }) {
+ c.append_range(std::forward<_Range>(__range));
+ } else {
+ ranges::copy(std::forward<_Range>(__range), std::back_inserter(c));
+ }
+ }
+#endif
+
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
decltype(auto) emplace(_Args&&... __args)
{ return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
#else
@@ -384,20 +453,20 @@ public:
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI const _Container& __get_container() const { return c; }
- template <class _T1, class _C1>
+ template <class _T1, class _OtherContainer>
friend
_LIBCPP_INLINE_VISIBILITY
bool
- operator==(const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
+ operator==(const queue<_T1, _OtherContainer>& __x,const queue<_T1, _OtherContainer>& __y);
- template <class _T1, class _C1>
+ template <class _T1, class _OtherContainer>
friend
_LIBCPP_INLINE_VISIBILITY
bool
- operator< (const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
+ operator< (const queue<_T1, _OtherContainer>& __x,const queue<_T1, _OtherContainer>& __y);
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Container,
class = enable_if_t<!__is_allocator<_Container>::value>
>
@@ -413,18 +482,28 @@ queue(_Container, _Alloc)
-> queue<typename _Container::value_type, _Container>;
#endif
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _InputIterator,
- class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
+ class = __enable_if_t<__has_input_iterator_category<_InputIterator>::value>>
queue(_InputIterator, _InputIterator)
-> queue<__iter_value_type<_InputIterator>>;
+template <ranges::input_range _Range>
+queue(from_range_t, _Range&&)
+ -> queue<ranges::range_value_t<_Range>>;
+
template <class _InputIterator,
class _Alloc,
- class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = __enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = __enable_if_t<__is_allocator<_Alloc>::value>>
queue(_InputIterator, _InputIterator, _Alloc)
-> queue<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>;
+
+template <ranges::input_range _Range,
+ class _Alloc,
+ class = __enable_if_t<__is_allocator<_Alloc>::value>>
+queue(from_range_t, _Range&&, _Alloc)
+ -> queue<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>;
#endif
template <class _Tp, class _Container>
@@ -475,6 +554,17 @@ operator<=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
return !(__y < __x);
}
+#if _LIBCPP_STD_VER >= 20
+
+template <class _Tp, three_way_comparable _Container>
+_LIBCPP_HIDE_FROM_ABI compare_three_way_result_t<_Container>
+operator<=>(const queue<_Tp, _Container>& __x, const queue<_Tp, _Container>& __y) {
+ // clang 16 bug: declaring `friend operator<=>` causes "use of overloaded operator '*' is ambiguous" errors
+ return __x.__get_container() <=> __y.__get_container();
+}
+
+#endif
+
template <class _Tp, class _Container>
inline _LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_swappable<_Container>::value, void>
@@ -544,20 +634,31 @@ public:
_LIBCPP_INLINE_VISIBILITY
priority_queue(const value_compare& __comp, container_type&& __c);
#endif
- template <class _InputIter, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
+ template <class _InputIter, class = __enable_if_t<__has_input_iterator_category<_InputIter>::value> >
_LIBCPP_INLINE_VISIBILITY
priority_queue(_InputIter __f, _InputIter __l,
const value_compare& __comp = value_compare());
- template <class _InputIter, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
+ template <class _InputIter, class = __enable_if_t<__has_input_iterator_category<_InputIter>::value> >
_LIBCPP_INLINE_VISIBILITY
priority_queue(_InputIter __f, _InputIter __l,
const value_compare& __comp, const container_type& __c);
#ifndef _LIBCPP_CXX03_LANG
- template <class _InputIter, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
+ template <class _InputIter, class = __enable_if_t<__has_input_iterator_category<_InputIter>::value> >
_LIBCPP_INLINE_VISIBILITY
priority_queue(_InputIter __f, _InputIter __l,
const value_compare& __comp, container_type&& __c);
#endif // _LIBCPP_CXX03_LANG
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ priority_queue(from_range_t, _Range&& __range, const value_compare& __comp = value_compare())
+ : c(from_range, std::forward<_Range>(__range)),
+ comp(__comp) {
+ std::make_heap(c.begin(), c.end(), comp);
+ }
+#endif
+
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
explicit priority_queue(const _Alloc& __a,
@@ -587,31 +688,55 @@ public:
__enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
#endif // _LIBCPP_CXX03_LANG
- template <class _InputIter, class _Alloc, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
+ template <class _InputIter, class _Alloc, class = __enable_if_t<__has_input_iterator_category<_InputIter>::value> >
_LIBCPP_INLINE_VISIBILITY
priority_queue(_InputIter __f, _InputIter __l, const _Alloc& __a,
__enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
- template <class _InputIter, class _Alloc, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
+ template <class _InputIter, class _Alloc, class = __enable_if_t<__has_input_iterator_category<_InputIter>::value> >
_LIBCPP_INLINE_VISIBILITY
priority_queue(_InputIter __f, _InputIter __l,
const value_compare& __comp, const _Alloc& __a,
__enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
- template <class _InputIter, class _Alloc, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
+ template <class _InputIter, class _Alloc, class = __enable_if_t<__has_input_iterator_category<_InputIter>::value> >
_LIBCPP_INLINE_VISIBILITY
priority_queue(_InputIter __f, _InputIter __l,
const value_compare& __comp, const container_type& __c, const _Alloc& __a,
__enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
#ifndef _LIBCPP_CXX03_LANG
- template <class _InputIter, class _Alloc, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
+ template <class _InputIter, class _Alloc, class = __enable_if_t<__has_input_iterator_category<_InputIter>::value> >
_LIBCPP_INLINE_VISIBILITY
priority_queue(_InputIter __f, _InputIter __l,
const value_compare& __comp, container_type&& __c, const _Alloc& __a,
__enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
#endif // _LIBCPP_CXX03_LANG
+#if _LIBCPP_STD_VER >= 23
+
+ template <_ContainerCompatibleRange<_Tp> _Range,
+ class _Alloc,
+ class = enable_if_t<uses_allocator<_Container, _Alloc>::value>>
+ _LIBCPP_HIDE_FROM_ABI
+ priority_queue(from_range_t, _Range&& __range, const value_compare& __comp, const _Alloc& __a)
+ : c(from_range, std::forward<_Range>(__range), __a),
+ comp(__comp) {
+ std::make_heap(c.begin(), c.end(), comp);
+ }
+
+ template <_ContainerCompatibleRange<_Tp> _Range,
+ class _Alloc,
+ class = enable_if_t<uses_allocator<_Container, _Alloc>::value>>
+ _LIBCPP_HIDE_FROM_ABI
+ priority_queue(from_range_t, _Range&& __range, const _Alloc& __a)
+ : c(from_range, std::forward<_Range>(__range), __a),
+ comp() {
+ std::make_heap(c.begin(), c.end(), comp);
+ }
+
+#endif
+
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
bool empty() const {return c.empty();}
_LIBCPP_INLINE_VISIBILITY
@@ -624,6 +749,23 @@ public:
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void push(value_type&& __v);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void push_range(_Range&& __range) {
+ if constexpr (requires (container_type& __c) {
+ __c.append_range(std::forward<_Range>(__range));
+ }) {
+ c.append_range(std::forward<_Range>(__range));
+ } else {
+ ranges::copy(std::forward<_Range>(__range), std::back_inserter(c));
+ }
+
+ std::make_heap(c.begin(), c.end(), comp);
+ }
+#endif
+
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
void emplace(_Args&&... __args);
@@ -651,7 +793,7 @@ priority_queue(_Compare, _Container)
template<class _InputIterator,
class _Compare = less<__iter_value_type<_InputIterator>>,
class _Container = vector<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<!__is_allocator<_Compare>::value>,
class = enable_if_t<!__is_allocator<_Container>::value>
>
@@ -669,7 +811,7 @@ priority_queue(_Compare, _Container, _Alloc)
-> priority_queue<typename _Container::value_type, _Container, _Compare>;
template<class _InputIterator, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>
>
priority_queue(_InputIterator, _InputIterator, _Allocator)
@@ -678,7 +820,7 @@ priority_queue(_InputIterator, _InputIterator, _Allocator)
less<__iter_value_type<_InputIterator>>>;
template<class _InputIterator, class _Compare, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<!__is_allocator<_Compare>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>
>
@@ -687,7 +829,7 @@ priority_queue(_InputIterator, _InputIterator, _Compare, _Allocator)
vector<__iter_value_type<_InputIterator>, _Allocator>, _Compare>;
template<class _InputIterator, class _Compare, class _Container, class _Alloc,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<!__is_allocator<_Compare>::value>,
class = enable_if_t<!__is_allocator<_Container>::value>,
class = enable_if_t<uses_allocator<_Container, _Alloc>::value>
@@ -696,6 +838,31 @@ priority_queue(_InputIterator, _InputIterator, _Compare, _Container, _Alloc)
-> priority_queue<typename _Container::value_type, _Container, _Compare>;
#endif
+#if _LIBCPP_STD_VER >= 23
+
+template <ranges::input_range _Range,
+ class _Compare = less<ranges::range_value_t<_Range>>,
+ class = enable_if_t<!__is_allocator<_Compare>::value>>
+priority_queue(from_range_t, _Range&&, _Compare = _Compare())
+ -> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>>, _Compare>;
+
+template <ranges::input_range _Range,
+ class _Compare,
+ class _Alloc,
+ class = enable_if_t<!__is_allocator<_Compare>::value>,
+ class = enable_if_t<__is_allocator<_Alloc>::value>>
+priority_queue(from_range_t, _Range&&, _Compare, _Alloc)
+ -> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>, _Alloc>,
+ _Compare>;
+
+template <ranges::input_range _Range,
+ class _Alloc,
+ class = enable_if_t<__is_allocator<_Alloc>::value>>
+priority_queue(from_range_t, _Range&&, _Alloc)
+ -> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>, _Alloc>>;
+
+#endif
+
template <class _Tp, class _Container, class _Compare>
inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp,
@@ -964,7 +1131,9 @@ _LIBCPP_END_NAMESPACE_STD
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
# include <functional>
+# include <type_traits>
#endif
#endif // _LIBCPP_QUEUE
diff --git a/contrib/libs/cxxsupp/libcxx/include/random b/contrib/libs/cxxsupp/libcxx/include/random
index 5fe4906cb02..02d71ad6dd2 100644
--- a/contrib/libs/cxxsupp/libcxx/include/random
+++ b/contrib/libs/cxxsupp/libcxx/include/random
@@ -1734,6 +1734,7 @@ class piecewise_linear_distribution
# include <concepts>
# include <cstddef>
# include <cstdint>
+# include <cstdlib>
# include <iosfwd>
# include <limits>
# include <numeric>
diff --git a/contrib/libs/cxxsupp/libcxx/include/ranges b/contrib/libs/cxxsupp/libcxx/include/ranges
index f999fa00c33..523f7cdcb36 100644
--- a/contrib/libs/cxxsupp/libcxx/include/ranges
+++ b/contrib/libs/cxxsupp/libcxx/include/ranges
@@ -49,6 +49,8 @@ namespace std::ranges {
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>>;
+ template <range R>
+ using range_common_reference_t = iter_common_reference_t<iterator_t<R>>;
// [range.sized], sized ranges
template<class>
@@ -136,6 +138,16 @@ namespace std::ranges {
inline constexpr auto values = elements<1>;
}
+ // [range.utility.conv], range conversions
+ template<class C, input_range R, class... Args> requires (!view<C>)
+ constexpr C to(R&& r, Args&&... args); // Since C++23
+ template<template<class...> class C, input_range R, class... Args>
+ constexpr auto to(R&& r, Args&&... args); // Since C++23
+ template<class C, class... Args> requires (!view<C>)
+ constexpr auto to(Args&&... args); // Since C++23
+ template<template<class...> class C, class... Args>
+ constexpr auto to(Args&&... args); // Since C++23
+
// [range.empty], empty view
template<class T>
requires is_object_v<T>
@@ -250,6 +262,19 @@ namespace std::ranges {
template<class W, class Bound>
inline constexpr bool enable_borrowed_range<iota_view<W, Bound>> = true;
+ // [range.repeat], repeat view
+ template<class T>
+ concept integer-like-with-usable-difference-type = // exposition only
+ is-signed-integer-like<T> || (is-integer-like<T> && weakly_incrementable<T>);
+
+ template<move_constructible T, semiregular Bound = unreachable_sentinel_t>
+ requires (is_object_v<T> && same_as<T, remove_cv_t<T>> &&
+ (integer-like-with-usable-difference-type<Bound> ||
+ same_as<Bound, unreachable_sentinel_t>))
+ class repeat_view;
+
+ namespace views { inline constexpr unspecified repeat = unspecified; }
+
// [range.join], join view
template<input_range V>
requires view<V> && input_range<range_reference_t<V>>
@@ -292,13 +317,13 @@ namespace std::ranges {
// [range.zip], zip view
template<input_range... Views>
requires (view<Views> && ...) && (sizeof...(Views) > 0)
- class zip_view; // C++2b
+ class zip_view; // C++23
template<class... Views>
- inline constexpr bool enable_borrowed_range<zip_view<Views...>> = // C++2b
+ inline constexpr bool enable_borrowed_range<zip_view<Views...>> = // C++23
(enable_borrowed_range<Views> && ...);
- namespace views { inline constexpr unspecified zip = unspecified; } // C++2b
+ namespace views { inline constexpr unspecified zip = unspecified; } // C++23
// [range.as.rvalue]
template <view V>
@@ -337,6 +362,9 @@ namespace std {
struct tuple_element<1, const ranges::subrange<I, S, K>> {
using type = S;
};
+
+ struct from_range_t { explicit from_range_t() = default; }; // Since C++23
+ inline constexpr from_range_t from_range{}; // Since C++23
}
*/
@@ -358,12 +386,14 @@ namespace std {
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/enable_view.h>
#include <__ranges/filter_view.h>
+#include <__ranges/from_range.h>
#include <__ranges/iota_view.h>
#include <__ranges/join_view.h>
#include <__ranges/lazy_split_view.h>
#include <__ranges/rbegin.h>
#include <__ranges/ref_view.h>
#include <__ranges/rend.h>
+#include <__ranges/repeat_view.h>
#include <__ranges/reverse_view.h>
#include <__ranges/single_view.h>
#include <__ranges/size.h>
@@ -371,11 +401,11 @@ namespace std {
#include <__ranges/subrange.h>
#include <__ranges/take_view.h>
#include <__ranges/take_while_view.h>
+#include <__ranges/to.h>
#include <__ranges/transform_view.h>
#include <__ranges/view_interface.h>
#include <__ranges/views.h>
#include <__ranges/zip_view.h>
-#include <type_traits>
#include <version>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
@@ -390,11 +420,16 @@ namespace std {
#include <iterator>
// [tuple.helper]
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_size.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_size.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdlib>
+# include <type_traits>
+#endif
+
#endif // _LIBCPP_RANGES
diff --git a/contrib/libs/cxxsupp/libcxx/include/ratio b/contrib/libs/cxxsupp/libcxx/include/ratio
index 3969a392f3c..c9637ab818c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/ratio
+++ b/contrib/libs/cxxsupp/libcxx/include/ratio
@@ -40,6 +40,8 @@ template <class R1, class R2> struct ratio_greater;
template <class R1, class R2> struct ratio_greater_equal;
// convenience SI typedefs
+using quecto = ratio <1, 1'000'000'000'000'000'000'000'000'000'000>; // Since C++26; not supported
+using ronto = ratio <1, 1'000'000'000'000'000'000'000'000'000>; // Since C++26; not supported
typedef ratio<1, 1000000000000000000000000> yocto; // not supported
typedef ratio<1, 1000000000000000000000> zepto; // not supported
typedef ratio<1, 1000000000000000000> atto;
@@ -60,6 +62,8 @@ typedef ratio< 1000000000000000, 1> peta;
typedef ratio< 1000000000000000000, 1> exa;
typedef ratio< 1000000000000000000000, 1> zetta; // not supported
typedef ratio<1000000000000000000000000, 1> yotta; // not supported
+using ronna = ratio <1'000'000'000'000'000'000'000'000'000, 1>; // Since C++26; not supported
+using quetta = ratio <1'000'000'000'000'000'000'000'000'000'000, 1>; // Since C++26; not supported
// 20.11.5, ratio comparison
template <class R1, class R2> inline constexpr bool ratio_equal_v
@@ -501,7 +505,7 @@ struct __ratio_gcd
__static_lcm<_R1::den, _R2::den>::value> type;
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _R1, class _R2>
inline constexpr bool ratio_equal_v = ratio_equal<_R1, _R2>::value;
diff --git a/contrib/libs/cxxsupp/libcxx/include/regex b/contrib/libs/cxxsupp/libcxx/include/regex
index 06c017fcce3..be1bce10ebd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/regex
+++ b/contrib/libs/cxxsupp/libcxx/include/regex
@@ -13,6 +13,7 @@
/*
regex synopsis
+#include <compare>
#include <initializer_list>
namespace std
@@ -225,6 +226,8 @@ public:
int compare(const sub_match& s) const;
int compare(const string_type& s) const;
int compare(const value_type* s) const;
+
+ void swap(sub_match& s) noexcept(see below);
};
typedef sub_match<const char*> csub_match;
@@ -237,50 +240,54 @@ template <class BiIter>
operator==(const sub_match<BiIter>& lhs, const sub_match<BiIter>& rhs);
template <class BiIter>
+ auto
+ operator<=>(const sub_match<BiIter>& lhs, const sub_match<BiIter>& rhs); // Since C++20
+
+ template <class BiIter> // Removed in C++20
bool
operator!=(const sub_match<BiIter>& lhs, const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator<(const sub_match<BiIter>& lhs, const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator<=(const sub_match<BiIter>& lhs, const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator>=(const sub_match<BiIter>& lhs, const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator>(const sub_match<BiIter>& lhs, const sub_match<BiIter>& rhs);
-template <class BiIter, class ST, class SA>
+template <class BiIter, class ST, class SA> // Removed in C++20
bool
operator==(const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter, class ST, class SA>
+template <class BiIter, class ST, class SA> // Removed in C++20
bool
operator!=(const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter, class ST, class SA>
+template <class BiIter, class ST, class SA> // Removed in C++20
bool
operator<(const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter, class ST, class SA>
+template <class BiIter, class ST, class SA> // Removed in C++20
bool
operator>(const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter, class ST, class SA>
+template <class BiIter, class ST, class SA> // Removed in C++20
bool operator>=(const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter, class ST, class SA>
+template <class BiIter, class ST, class SA> // Removed in C++20
bool
operator<=(const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& lhs,
const sub_match<BiIter>& rhs);
@@ -290,56 +297,62 @@ template <class BiIter, class ST, class SA>
operator==(const sub_match<BiIter>& lhs,
const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& rhs);
-template <class BiIter, class ST, class SA>
+template <class BiIter, class ST, class SA> // Since C++20
+ auto
+ operator<=>(const sub_match<BiIter>& lhs,
+ const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& rhs);
+
+template <class BiIter, class ST, class SA> // Removed in C++20
bool
operator!=(const sub_match<BiIter>& lhs,
const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& rhs);
-template <class BiIter, class ST, class SA>
+template <class BiIter, class ST, class SA> // Removed in C++20
bool
operator<(const sub_match<BiIter>& lhs,
const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& rhs);
-template <class BiIter, class ST, class SA>
- bool operator>(const sub_match<BiIter>& lhs,
+template <class BiIter, class ST, class SA> // Removed in C++20
+ bool
+ operator>(const sub_match<BiIter>& lhs,
const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& rhs);
-template <class BiIter, class ST, class SA>
+template <class BiIter, class ST, class SA> // Removed in C++20
bool
operator>=(const sub_match<BiIter>& lhs,
const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& rhs);
-template <class BiIter, class ST, class SA>
+template <class BiIter, class ST, class SA> // Removed in C++20
bool
operator<=(const sub_match<BiIter>& lhs,
const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator==(typename iterator_traits<BiIter>::value_type const* lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator!=(typename iterator_traits<BiIter>::value_type const* lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator<(typename iterator_traits<BiIter>::value_type const* lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator>(typename iterator_traits<BiIter>::value_type const* lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator>=(typename iterator_traits<BiIter>::value_type const* lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator<=(typename iterator_traits<BiIter>::value_type const* lhs,
const sub_match<BiIter>& rhs);
@@ -349,57 +362,62 @@ template <class BiIter>
operator==(const sub_match<BiIter>& lhs,
typename iterator_traits<BiIter>::value_type const* rhs);
-template <class BiIter>
+template <class BiIter> // Since C++20
+ auto
+ operator<=>(const sub_match<BiIter>& lhs,
+ typename iterator_traits<BiIter>::value_type const* rhs);
+
+template <class BiIter, class ST, class SA> // Removed in C++20
bool
operator!=(const sub_match<BiIter>& lhs,
typename iterator_traits<BiIter>::value_type const* rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator<(const sub_match<BiIter>& lhs,
typename iterator_traits<BiIter>::value_type const* rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator>(const sub_match<BiIter>& lhs,
typename iterator_traits<BiIter>::value_type const* rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator>=(const sub_match<BiIter>& lhs,
typename iterator_traits<BiIter>::value_type const* rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator<=(const sub_match<BiIter>& lhs,
typename iterator_traits<BiIter>::value_type const* rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator==(typename iterator_traits<BiIter>::value_type const& lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator!=(typename iterator_traits<BiIter>::value_type const& lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator<(typename iterator_traits<BiIter>::value_type const& lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator>(typename iterator_traits<BiIter>::value_type const& lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator>=(typename iterator_traits<BiIter>::value_type const& lhs,
const sub_match<BiIter>& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator<=(typename iterator_traits<BiIter>::value_type const& lhs,
const sub_match<BiIter>& rhs);
@@ -409,27 +427,32 @@ template <class BiIter>
operator==(const sub_match<BiIter>& lhs,
typename iterator_traits<BiIter>::value_type const& rhs);
-template <class BiIter>
+template <class BiIter> // Since C++20
+ auto
+ operator<=>(const sub_match<BiIter>& lhs,
+ typename iterator_traits<BiIter>::value_type const& rhs);
+
+template <class BiIter> // Removed in C++20
bool
operator!=(const sub_match<BiIter>& lhs,
typename iterator_traits<BiIter>::value_type const& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator<(const sub_match<BiIter>& lhs,
typename iterator_traits<BiIter>::value_type const& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator>(const sub_match<BiIter>& lhs,
typename iterator_traits<BiIter>::value_type const& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator>=(const sub_match<BiIter>& lhs,
typename iterator_traits<BiIter>::value_type const& rhs);
-template <class BiIter>
+template <class BiIter> // Removed in C++20
bool
operator<=(const sub_match<BiIter>& lhs,
typename iterator_traits<BiIter>::value_type const& rhs);
@@ -520,7 +543,7 @@ template <class BidirectionalIterator, class Allocator>
operator==(const match_results<BidirectionalIterator, Allocator>& m1,
const match_results<BidirectionalIterator, Allocator>& m2);
-template <class BidirectionalIterator, class Allocator>
+template <class BidirectionalIterator, class Allocator> // Removed in C++20
bool
operator!=(const match_results<BidirectionalIterator, Allocator>& m1,
const match_results<BidirectionalIterator, Allocator>& m2);
@@ -687,7 +710,8 @@ public:
regex_iterator& operator=(const regex_iterator&);
bool operator==(const regex_iterator&) const;
- bool operator!=(const regex_iterator&) const;
+ bool operator==(default_sentinel_t) const { return *this == regex_iterator(); } // since C++20
+ bool operator!=(const regex_iterator&) const; // Removed in C++20
const value_type& operator*() const;
const value_type* operator->() const;
@@ -745,7 +769,8 @@ public:
regex_token_iterator& operator=(const regex_token_iterator&);
bool operator==(const regex_token_iterator&) const;
- bool operator!=(const regex_token_iterator&) const;
+ bool operator==(default_sentinel_t) const { return *this == regex_token_iterator(); } // since C++20
+ bool operator!=(const regex_token_iterator&) const; // Removed in C++20
const value_type& operator*() const;
const value_type* operator->() const;
@@ -765,15 +790,19 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
#include <__algorithm/find.h>
#include <__algorithm/search.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
#include <__iterator/back_insert_iterator.h>
+#include <__iterator/default_sentinel.h>
#include <__iterator/wrap_iter.h>
#include <__locale>
+#include <__memory/shared_ptr.h>
#include <__memory_resource/polymorphic_allocator.h>
+#include <__type_traits/is_swappable.h>
#include <__utility/move.h>
#include <__utility/pair.h>
#include <__utility/swap.h>
-#include <cstring>
+#include <__verbose_abort>
#include <deque>
#include <stdexcept>
#include <string>
@@ -996,13 +1025,13 @@ enum error_type
} // namespace regex_constants
-class _LIBCPP_EXCEPTION_ABI regex_error
+class _LIBCPP_EXPORTED_FROM_ABI regex_error
: public runtime_error
{
regex_constants::error_type __code_;
public:
explicit regex_error(regex_constants::error_type __ecode);
- regex_error(const regex_error&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI regex_error(const regex_error&) _NOEXCEPT = default;
~regex_error() _NOEXCEPT override;
_LIBCPP_INLINE_VISIBILITY
regex_constants::error_type code() const {return __code_;}
@@ -1012,10 +1041,10 @@ template <regex_constants::error_type _Ev>
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_regex_error()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw regex_error(_Ev);
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("regex_error was thrown in -fno-exceptions mode");
#endif
}
@@ -1221,7 +1250,7 @@ regex_traits<_CharT>::__transform_primary(_ForwardIterator __f,
// lookup_collatename is very FreeBSD-specific
-_LIBCPP_FUNC_VIS string __get_collation_name(const char* __s);
+_LIBCPP_EXPORTED_FROM_ABI string __get_collation_name(const char* __s);
template <class _CharT>
template <class _ForwardIterator>
@@ -1284,8 +1313,7 @@ regex_traits<_CharT>::__lookup_collatename(_ForwardIterator __f,
// lookup_classname
-regex_traits<char>::char_class_type _LIBCPP_FUNC_VIS
-__get_classname(const char* __s, bool __icase);
+regex_traits<char>::char_class_type _LIBCPP_EXPORTED_FROM_ABI __get_classname(const char* __s, bool __icase);
template <class _CharT>
template <class _ForwardIterator>
@@ -1467,7 +1495,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
__end_state() {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT>
@@ -1533,7 +1561,7 @@ public:
explicit __empty_state(__node<_CharT>* __s)
: base(__s) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT>
@@ -1559,7 +1587,7 @@ public:
explicit __empty_non_own_state(__node<_CharT>* __s)
: base(__s) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT>
@@ -1585,7 +1613,7 @@ public:
explicit __repeat_one_loop(__node<_CharT>* __s)
: base(__s) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT>
@@ -1611,7 +1639,7 @@ public:
explicit __owns_two_states(__node<_CharT>* __s1, base* __s2)
: base(__s1), __second_(__s2) {}
- virtual ~__owns_two_states();
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual ~__owns_two_states();
_LIBCPP_INLINE_VISIBILITY
base* second() const {return __second_;}
@@ -1654,8 +1682,8 @@ public:
__mexp_begin_(__mexp_begin), __mexp_end_(__mexp_end),
__greedy_(__greedy) {}
- virtual void __exec(__state& __s) const;
- virtual void __exec_split(bool __second, __state& __s) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state& __s) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec_split(bool __second, __state& __s) const;
private:
_LIBCPP_INLINE_VISIBILITY
@@ -1747,8 +1775,8 @@ public:
__owns_one_state<_CharT>* __s2)
: base(__s1, __s2) {}
- virtual void __exec(__state& __s) const;
- virtual void __exec_split(bool __second, __state& __s) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state& __s) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec_split(bool __second, __state& __s) const;
};
template <class _CharT>
@@ -1785,7 +1813,7 @@ public:
explicit __begin_marked_subexpression(unsigned __mexp, __node<_CharT>* __s)
: base(__s), __mexp_(__mexp) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT>
@@ -1813,7 +1841,7 @@ public:
explicit __end_marked_subexpression(unsigned __mexp, __node<_CharT>* __s)
: base(__s), __mexp_(__mexp) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT>
@@ -1842,7 +1870,7 @@ public:
explicit __back_ref(unsigned __mexp, __node<_CharT>* __s)
: base(__s), __mexp_(__mexp) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT>
@@ -1893,7 +1921,7 @@ public:
__node<_CharT>* __s)
: base(__s), __traits_(__traits), __mexp_(__mexp) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT, class _Traits>
@@ -1948,7 +1976,7 @@ public:
__node<_CharT>* __s)
: base(__s), __traits_(__traits), __mexp_(__mexp) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT, class _Traits>
@@ -2003,7 +2031,7 @@ public:
__node<_CharT>* __s)
: base(__s), __traits_(__traits), __invert_(__invert) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT, class _Traits>
@@ -2079,7 +2107,7 @@ public:
__l_anchor_multiline(bool __multiline, __node<_CharT>* __s)
: base(__s), __multiline_(__multiline) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT>
@@ -2123,7 +2151,7 @@ public:
__r_anchor_multiline(bool __multiline, __node<_CharT>* __s)
: base(__s), __multiline_(__multiline) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT>
@@ -2163,7 +2191,7 @@ public:
__match_any(__node<_CharT>* __s)
: base(__s) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT>
@@ -2201,9 +2229,9 @@ public:
void __exec(__state&) const override;
};
-template <> _LIBCPP_FUNC_VIS void __match_any_but_newline<char>::__exec(__state&) const;
+template <> _LIBCPP_EXPORTED_FROM_ABI void __match_any_but_newline<char>::__exec(__state&) const;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template <> _LIBCPP_FUNC_VIS void __match_any_but_newline<wchar_t>::__exec(__state&) const;
+template <> _LIBCPP_EXPORTED_FROM_ABI void __match_any_but_newline<wchar_t>::__exec(__state&) const;
#endif
// __match_char
@@ -2225,7 +2253,7 @@ public:
__match_char(_CharT __c, __node<_CharT>* __s)
: base(__s), __c_(__c) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT>
@@ -2265,7 +2293,7 @@ public:
__match_char_icase(const _Traits& __traits, _CharT __c, __node<_CharT>* __s)
: base(__s), __traits_(__traits), __c_(__traits.translate_nocase(__c)) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT, class _Traits>
@@ -2306,7 +2334,7 @@ public:
__match_char_collate(const _Traits& __traits, _CharT __c, __node<_CharT>* __s)
: base(__s), __traits_(__traits), __c_(__traits.translate(__c)) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT, class _Traits>
@@ -2361,7 +2389,7 @@ public:
__negate_(__negate), __icase_(__icase), __collate_(__collate),
__might_have_digraph_(__traits_.getloc().name() != "C") {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
_LIBCPP_INLINE_VISIBILITY
bool __negated() const {return __negate_;}
@@ -2750,7 +2778,7 @@ public:
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
- typename enable_if<__is_exactly_cpp17_input_iterator<_InputIterator>::value, basic_regex&>::type
+ typename enable_if<__has_exactly_input_iterator_category<_InputIterator>::value, basic_regex&>::type
assign(_InputIterator __first, _InputIterator __last,
flag_type __f = regex_constants::ECMAScript)
{
@@ -2774,7 +2802,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
+ __has_forward_iterator_category<_ForwardIterator>::value,
basic_regex&
>::type
assign(_ForwardIterator __first, _ForwardIterator __last,
@@ -3082,7 +3110,7 @@ private:
#if _LIBCPP_STD_VER >= 17
template <class _ForwardIterator,
- class = typename enable_if<__is_cpp17_forward_iterator<_ForwardIterator>::value, nullptr_t>::type
+ class = typename enable_if<__has_forward_iterator_category<_ForwardIterator>::value, nullptr_t>::type
>
basic_regex(_ForwardIterator, _ForwardIterator,
regex_constants::syntax_option_type = regex_constants::ECMAScript)
@@ -3153,7 +3181,7 @@ public:
__lookahead(const basic_regex<_CharT, _Traits>& __exp, bool __invert, __node<_CharT>* __s, unsigned __mexp)
: base(__s), __exp_(__exp), __mexp_(__mexp), __invert_(__invert) {}
- virtual void __exec(__state&) const;
+ _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
template <class _CharT, class _Traits>
@@ -4131,9 +4159,9 @@ basic_regex<_CharT, _Traits>::__parse_equivalence_class(_ForwardIterator __first
{
// Found [=
// This means =] must exist
- value_type _Equal_close[2] = {'=', ']'};
- _ForwardIterator __temp = _VSTD::search(__first, __last, _Equal_close,
- _Equal_close+2);
+ value_type __equal_close[2] = {'=', ']'};
+ _ForwardIterator __temp = _VSTD::search(__first, __last, __equal_close,
+ __equal_close+2);
if (__temp == __last)
__throw_regex_error<regex_constants::error_brack>();
// [__first, __temp) contains all text in [= ... =]
@@ -4173,9 +4201,9 @@ basic_regex<_CharT, _Traits>::__parse_character_class(_ForwardIterator __first,
{
// Found [:
// This means :] must exist
- value_type _Colon_close[2] = {':', ']'};
- _ForwardIterator __temp = _VSTD::search(__first, __last, _Colon_close,
- _Colon_close+2);
+ value_type __colon_close[2] = {':', ']'};
+ _ForwardIterator __temp = _VSTD::search(__first, __last, __colon_close,
+ __colon_close+2);
if (__temp == __last)
__throw_regex_error<regex_constants::error_brack>();
// [__first, __temp) contains all text in [: ... :]
@@ -4198,9 +4226,9 @@ basic_regex<_CharT, _Traits>::__parse_collating_symbol(_ForwardIterator __first,
{
// Found [.
// This means .] must exist
- value_type _Dot_close[2] = {'.', ']'};
- _ForwardIterator __temp = _VSTD::search(__first, __last, _Dot_close,
- _Dot_close+2);
+ value_type __dot_close[2] = {'.', ']'};
+ _ForwardIterator __temp = _VSTD::search(__first, __last, __dot_close,
+ __dot_close+2);
if (__temp == __last)
__throw_regex_error<regex_constants::error_brack>();
// [__first, __temp) contains all text in [. ... .]
@@ -5009,6 +5037,16 @@ public:
_LIBCPP_INLINE_VISIBILITY
int compare(const value_type* __s) const
{return str().compare(__s);}
+
+ _LIBCPP_HIDE_FROM_ABI
+ void swap(sub_match& __s)
+#ifndef _LIBCPP_CXX03_LANG
+ _NOEXCEPT(__is_nothrow_swappable<_BidirectionalIterator>::value)
+#endif // _LIBCPP_CXX03_LANG
+ {
+ this->pair<_BidirectionalIterator, _BidirectionalIterator>::swap(__s);
+ std::swap(matched, __s.matched);
+ }
};
template <class _BiIter>
@@ -5019,6 +5057,15 @@ operator==(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
return __x.compare(__y) == 0;
}
+#if _LIBCPP_STD_VER >= 20
+template<class _BiIter>
+using __sub_match_cat = compare_three_way_result_t<basic_string<typename iterator_traits<_BiIter>::value_type>>;
+
+template <class _BiIter>
+_LIBCPP_HIDE_FROM_ABI auto operator<=>(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y) {
+ return static_cast<__sub_match_cat<_BiIter>>(__x.compare(__y) <=> 0);
+}
+#else // _LIBCPP_STD_VER >= 20
template <class _BiIter>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -5111,6 +5158,7 @@ operator<=(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST
{
return !(__y < __x);
}
+#endif // _LIBCPP_STD_VER >= 20
template <class _BiIter, class _ST, class _SA>
inline _LIBCPP_INLINE_VISIBILITY
@@ -5121,6 +5169,14 @@ operator==(const sub_match<_BiIter>& __x,
return __x.compare(typename sub_match<_BiIter>::string_type(__y.data(), __y.size())) == 0;
}
+#if _LIBCPP_STD_VER >= 20
+template <class _BiIter, class _ST, class _SA>
+_LIBCPP_HIDE_FROM_ABI auto operator<=>(
+ const sub_match<_BiIter>& __x, const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __y) {
+ return static_cast<__sub_match_cat<_BiIter>>(
+ __x.compare(typename sub_match<_BiIter>::string_type(__y.data(), __y.size())) <=> 0);
+}
+#else // _LIBCPP_STD_VER >= 20
template <class _BiIter, class _ST, class _SA>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -5218,6 +5274,7 @@ operator<=(typename iterator_traits<_BiIter>::value_type const* __x,
{
return !(__y < __x);
}
+#endif // _LIBCPP_STD_VER >= 20
template <class _BiIter>
inline _LIBCPP_INLINE_VISIBILITY
@@ -5228,6 +5285,13 @@ operator==(const sub_match<_BiIter>& __x,
return __x.compare(__y) == 0;
}
+#if _LIBCPP_STD_VER >= 20
+template <class _BiIter>
+_LIBCPP_HIDE_FROM_ABI auto
+operator<=>(const sub_match<_BiIter>& __x, typename iterator_traits<_BiIter>::value_type const* __y) {
+ return static_cast<__sub_match_cat<_BiIter>>(__x.compare(__y) <=> 0);
+}
+#else // _LIBCPP_STD_VER >= 20
template <class _BiIter>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -5328,6 +5392,7 @@ operator<=(typename iterator_traits<_BiIter>::value_type const& __x,
{
return !(__y < __x);
}
+#endif // _LIBCPP_STD_VER >= 20
template <class _BiIter>
inline _LIBCPP_INLINE_VISIBILITY
@@ -5339,6 +5404,14 @@ operator==(const sub_match<_BiIter>& __x,
return __x.compare(string_type(1, __y)) == 0;
}
+#if _LIBCPP_STD_VER >= 20
+template <class _BiIter>
+_LIBCPP_HIDE_FROM_ABI auto
+operator<=>(const sub_match<_BiIter>& __x, typename iterator_traits<_BiIter>::value_type const& __y) {
+ using string_type = basic_string<typename iterator_traits<_BiIter>::value_type>;
+ return static_cast<__sub_match_cat<_BiIter>>(__x.compare(string_type(1, __y)) <=> 0);
+}
+#else // _LIBCPP_STD_VER >= 20
template <class _BiIter>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -5384,6 +5457,7 @@ operator<=(const sub_match<_BiIter>& __x,
{
return !(__y < __x);
}
+#endif // _LIBCPP_STD_VER >= 20
template <class _CharT, class _ST, class _BiIter>
inline _LIBCPP_INLINE_VISIBILITY
@@ -5460,38 +5534,38 @@ public:
_LIBCPP_INLINE_VISIBILITY
difference_type length(size_type __sub = 0) const
{
- _LIBCPP_ASSERT(ready(), "match_results::length() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::length() called when not ready");
return (*this)[__sub].length();
}
_LIBCPP_INLINE_VISIBILITY
difference_type position(size_type __sub = 0) const
{
- _LIBCPP_ASSERT(ready(), "match_results::position() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::position() called when not ready");
return _VSTD::distance(__position_start_, (*this)[__sub].first);
}
_LIBCPP_INLINE_VISIBILITY
string_type str(size_type __sub = 0) const
{
- _LIBCPP_ASSERT(ready(), "match_results::str() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::str() called when not ready");
return (*this)[__sub].str();
}
_LIBCPP_INLINE_VISIBILITY
const_reference operator[](size_type __n) const
{
- _LIBCPP_ASSERT(ready(), "match_results::operator[]() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::operator[]() called when not ready");
return __n < __matches_.size() ? __matches_[__n] : __unmatched_;
}
_LIBCPP_INLINE_VISIBILITY
const_reference prefix() const
{
- _LIBCPP_ASSERT(ready(), "match_results::prefix() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::prefix() called when not ready");
return __prefix_;
}
_LIBCPP_INLINE_VISIBILITY
const_reference suffix() const
{
- _LIBCPP_ASSERT(ready(), "match_results::suffix() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::suffix() called when not ready");
return __suffix_;
}
@@ -5631,7 +5705,7 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output_i
const char_type* __fmt_first, const char_type* __fmt_last,
regex_constants::match_flag_type __flags) const
{
- _LIBCPP_ASSERT(ready(), "match_results::format() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::format() called when not ready");
if (__flags & regex_constants::format_sed)
{
for (; __fmt_first != __fmt_last; ++__fmt_first)
@@ -5747,6 +5821,7 @@ operator==(const match_results<_BidirectionalIterator, _Allocator>& __x,
__x.__suffix_ == __y.__suffix_;
}
+#if _LIBCPP_STD_VER < 20
template <class _BidirectionalIterator, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -5755,6 +5830,7 @@ operator!=(const match_results<_BidirectionalIterator, _Allocator>& __x,
{
return !(__x == __y);
}
+#endif
template <class _BidirectionalIterator, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -5861,7 +5937,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
{
deque<__state> __states;
ptrdiff_t __highest_j = 0;
- ptrdiff_t _Np = _VSTD::distance(__first, __last);
+ ptrdiff_t __np = _VSTD::distance(__first, __last);
__node* __st = __start_.get();
if (__st)
{
@@ -5904,7 +5980,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
if (!__matched || __highest_j < __s.__current_ - __s.__first_)
__highest_j = __s.__current_ - __s.__first_;
__matched = true;
- if (__highest_j == _Np)
+ if (__highest_j == __np)
__states.clear();
else
__states.pop_back();
@@ -5956,7 +6032,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
vector<__state> __states;
__state __best_state;
ptrdiff_t __highest_j = 0;
- ptrdiff_t _Np = _VSTD::distance(__first, __last);
+ ptrdiff_t __np = _VSTD::distance(__first, __last);
__node* __st = __start_.get();
if (__st)
{
@@ -6008,7 +6084,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
__best_state = __s;
}
__matched = true;
- if (__highest_j == _Np)
+ if (__highest_j == __np)
__states.clear();
else
__states.pop_back();
@@ -6214,7 +6290,7 @@ regex_search(const basic_string<_CharT, _ST, _SA>& __s,
return __r;
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _ST, class _SA, class _Ap, class _Cp, class _Tp>
bool
regex_search(const basic_string<_Cp, _ST, _SA>&& __s,
@@ -6277,7 +6353,7 @@ regex_match(const basic_string<_CharT, _ST, _SA>& __s,
return _VSTD::regex_match(__s.begin(), __s.end(), __m, __e, __flags);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _ST, class _SA, class _Allocator, class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -6350,16 +6426,21 @@ public:
const regex_type& __re,
regex_constants::match_flag_type __m
= regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
regex_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
const regex_type&& __re,
regex_constants::match_flag_type __m
= regex_constants::match_default) = delete;
#endif
- bool operator==(const regex_iterator& __x) const;
+ _LIBCPP_HIDE_FROM_ABI bool operator==(const regex_iterator& __x) const;
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI bool operator==(default_sentinel_t) const { return *this == regex_iterator(); }
+#endif
+#if _LIBCPP_STD_VER < 20
_LIBCPP_INLINE_VISIBILITY
bool operator!=(const regex_iterator& __x) const {return !(*this == __x);}
+#endif
_LIBCPP_INLINE_VISIBILITY
reference operator*() const {return __match_;}
@@ -6482,7 +6563,7 @@ public:
const regex_type& __re, int __submatch = 0,
regex_constants::match_flag_type __m =
regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
const regex_type&& __re, int __submatch = 0,
regex_constants::match_flag_type __m =
@@ -6493,7 +6574,7 @@ public:
const regex_type& __re, const vector<int>& __submatches,
regex_constants::match_flag_type __m =
regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
const regex_type&& __re, const vector<int>& __submatches,
regex_constants::match_flag_type __m =
@@ -6507,7 +6588,7 @@ public:
regex_constants::match_flag_type __m =
regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
const regex_type&& __re,
initializer_list<int> __submatches,
@@ -6522,7 +6603,7 @@ public:
const int (&__submatches)[_Np],
regex_constants::match_flag_type __m =
regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <size_t _Np>
regex_token_iterator(_BidirectionalIterator __a,
_BidirectionalIterator __b,
@@ -6535,9 +6616,16 @@ public:
regex_token_iterator(const regex_token_iterator&);
regex_token_iterator& operator=(const regex_token_iterator&);
- bool operator==(const regex_token_iterator& __x) const;
+ _LIBCPP_HIDE_FROM_ABI bool operator==(const regex_token_iterator& __x) const;
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDE_FROM_ABI bool operator==(default_sentinel_t) const {
+ return *this == regex_token_iterator();
+ }
+#endif
+#if _LIBCPP_STD_VER < 20
_LIBCPP_INLINE_VISIBILITY
bool operator!=(const regex_token_iterator& __x) const {return !(*this == __x);}
+#endif
_LIBCPP_INLINE_VISIBILITY
const value_type& operator*() const {return *__result_;}
@@ -6844,18 +6932,18 @@ regex_replace(const _CharT* __s,
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _BidirT>
-using match_results = std::match_results<_BidirT, polymorphic_allocator<std::sub_match<_BidirT>>>;
+using match_results _LIBCPP_AVAILABILITY_PMR = std::match_results<_BidirT, polymorphic_allocator<std::sub_match<_BidirT>>>;
-using cmatch = match_results<const char*>;
-using smatch = match_results<std::pmr::string::const_iterator>;
+using cmatch _LIBCPP_AVAILABILITY_PMR = match_results<const char*>;
+using smatch _LIBCPP_AVAILABILITY_PMR = match_results<std::pmr::string::const_iterator>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-using wcmatch = match_results<const wchar_t*>;
-using wsmatch = match_results<std::pmr::wstring::const_iterator>;
+using wcmatch _LIBCPP_AVAILABILITY_PMR = match_results<const wchar_t*>;
+using wsmatch _LIBCPP_AVAILABILITY_PMR = match_results<std::pmr::wstring::const_iterator>;
#endif
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
@@ -6866,9 +6954,11 @@ _LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <iosfwd>
# include <iterator>
# include <new>
+# include <type_traits>
# include <typeinfo>
# include <utility>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/semaphore b/contrib/libs/cxxsupp/libcxx/include/semaphore
index ddccb28dab4..971ca2f70ad 100644
--- a/contrib/libs/cxxsupp/libcxx/include/semaphore
+++ b/contrib/libs/cxxsupp/libcxx/include/semaphore
@@ -46,12 +46,15 @@ using binary_semaphore = counting_semaphore<1>;
*/
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__atomic/atomic_base.h>
+#include <__atomic/atomic_sync.h>
+#include <__atomic/memory_order.h>
#include <__availability>
#include <__chrono/time_point.h>
#include <__config>
#include <__thread/timed_backoff_policy.h>
#include <__threading_support>
-#include <atomic>
+#include <cstddef>
#include <limits>
#include <version>
@@ -78,6 +81,8 @@ functions. It avoids contention against users' own use of those facilities.
*/
+#define _LIBCPP_SEMAPHORE_MAX (numeric_limits<ptrdiff_t>::max())
+
class __atomic_semaphore_base
{
__atomic_base<ptrdiff_t> __a_;
@@ -90,9 +95,14 @@ public:
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
void release(ptrdiff_t __update = 1)
{
- if(0 < __a_.fetch_add(__update, memory_order_release))
- ;
- else if(__update > 1)
+ auto __old = __a_.fetch_add(__update, memory_order_release);
+ _LIBCPP_ASSERT_UNCATEGORIZED(__update <= _LIBCPP_SEMAPHORE_MAX - __old, "update is greater than the expected value");
+
+ if (__old > 0)
+ {
+ // Nothing to do
+ }
+ else if (__update > 1)
__a_.notify_all();
else
__a_.notify_one();
@@ -106,11 +116,11 @@ public:
};
__cxx_atomic_wait(&__a_.__a_, __test_fn);
}
- template <class Rep, class Period>
+ template <class _Rep, class _Period>
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- bool try_acquire_for(chrono::duration<Rep, Period> const& __rel_time)
+ bool try_acquire_for(chrono::duration<_Rep, _Period> const& __rel_time)
{
- if (__rel_time == chrono::duration<Rep, Period>::zero())
+ if (__rel_time == chrono::duration<_Rep, _Period>::zero())
return try_acquire();
auto const __test_fn = [this]() { return try_acquire(); };
return std::__libcpp_thread_poll_with_backoff(__test_fn, __libcpp_timed_backoff_policy(), __rel_time);
@@ -128,20 +138,30 @@ public:
}
};
-#define _LIBCPP_SEMAPHORE_MAX (numeric_limits<ptrdiff_t>::max())
-
template<ptrdiff_t __least_max_value = _LIBCPP_SEMAPHORE_MAX>
class counting_semaphore
{
__atomic_semaphore_base __semaphore_;
public:
+ static_assert(__least_max_value >= 0, "The least maximum value must be a positive number");
+
static constexpr ptrdiff_t max() noexcept {
return __least_max_value;
}
_LIBCPP_INLINE_VISIBILITY
- constexpr explicit counting_semaphore(ptrdiff_t __count) : __semaphore_(__count) { }
+ constexpr explicit counting_semaphore(ptrdiff_t __count) : __semaphore_(__count)
+ {
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __count >= 0,
+ "counting_semaphore::counting_semaphore(ptrdiff_t): counting_semaphore cannot be "
+ "initialized with a negative value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __count <= max(),
+ "counting_semaphore::counting_semaphore(ptrdiff_t): counting_semaphore cannot be "
+ "initialized with a value greater than max()");
+ }
~counting_semaphore() = default;
counting_semaphore(const counting_semaphore&) = delete;
@@ -150,6 +170,7 @@ public:
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
void release(ptrdiff_t __update = 1)
{
+ _LIBCPP_ASSERT_UNCATEGORIZED(__update >= 0, "counting_semaphore:release called with a negative value");
__semaphore_.release(__update);
}
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
@@ -157,9 +178,9 @@ public:
{
__semaphore_.acquire();
}
- template<class Rep, class Period>
+ template<class _Rep, class _Period>
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- bool try_acquire_for(chrono::duration<Rep, Period> const& __rel_time)
+ bool try_acquire_for(chrono::duration<_Rep, _Period> const& __rel_time)
{
return __semaphore_.try_acquire_for(chrono::duration_cast<chrono::nanoseconds>(__rel_time));
}
@@ -168,15 +189,15 @@ public:
{
return __semaphore_.try_acquire();
}
- template <class Clock, class Duration>
+ template <class _Clock, class _Duration>
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- bool try_acquire_until(chrono::time_point<Clock, Duration> const& __abs_time)
+ bool try_acquire_until(chrono::time_point<_Clock, _Duration> const& __abs_time)
{
- auto const current = Clock::now();
- if (current >= __abs_time)
+ auto const __current = _Clock::now();
+ if (__current >= __abs_time)
return try_acquire();
else
- return try_acquire_for(__abs_time - current);
+ return try_acquire_for(__abs_time - __current);
}
};
@@ -188,4 +209,8 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
+#endif
+
#endif //_LIBCPP_SEMAPHORE
diff --git a/contrib/libs/cxxsupp/libcxx/include/set b/contrib/libs/cxxsupp/libcxx/include/set
index 97387e239b5..0577ff080e8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/set
+++ b/contrib/libs/cxxsupp/libcxx/include/set
@@ -56,6 +56,8 @@ public:
template <class InputIterator>
set(InputIterator first, InputIterator last, const value_compare& comp,
const allocator_type& a);
+ template<container-compatible-range<value_type> R>
+ set(from_range_t, R&& rg, const Compare& comp = Compare(), const Allocator& = Allocator()); // C++23
set(const set& s);
set(set&& s)
noexcept(
@@ -70,6 +72,9 @@ public:
template <class InputIterator>
set(InputIterator first, InputIterator last, const allocator_type& a)
: set(first, last, Compare(), a) {} // C++14
+ template<container-compatible-range<value_type> R>
+ set(from_range_t, R&& rg, const Allocator& a))
+ : set(from_range, std::forward<R>(rg), Compare(), a) { } // C++23
set(initializer_list<value_type> il, const allocator_type& a)
: set(il, Compare(), a) {} // C++14
~set();
@@ -114,6 +119,8 @@ public:
iterator insert(const_iterator position, value_type&& v);
template <class InputIterator>
void insert(InputIterator first, InputIterator last);
+ template<container-compatible-range<value_type> R>
+ void insert_range(R&& rg); // C++23
void insert(initializer_list<value_type> il);
node_type extract(const_iterator position); // C++17
@@ -190,6 +197,11 @@ set(InputIterator, InputIterator,
Compare = Compare(), Allocator = Allocator())
-> set<typename iterator_traits<InputIterator>::value_type, Compare, Allocator>; // C++17
+template<ranges::input_range R, class Compare = less<ranges::range_value_t<R>>,
+ class Allocator = allocator<ranges::range_value_t<R>>>
+ set(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())
+ -> set<ranges::range_value_t<R>, Compare, Allocator>; // C++23
+
template<class Key, class Compare = less<Key>, class Allocator = allocator<Key>>
set(initializer_list<Key>, Compare = Compare(), Allocator = Allocator())
-> set<Key, Compare, Allocator>; // C++17
@@ -199,6 +211,10 @@ set(InputIterator, InputIterator, Allocator)
-> set<typename iterator_traits<InputIterator>::value_type,
less<typename iterator_traits<InputIterator>::value_type>, Allocator>; // C++17
+template<ranges::input_range R, class Allocator>
+ set(from_range_t, R&&, Allocator)
+ -> set<ranges::range_value_t<R>, less<ranges::range_value_t<R>>, Allocator>; // C++23
+
template<class Key, class Allocator>
set(initializer_list<Key>, Allocator) -> set<Key, less<Key>, Allocator>; // C++17
@@ -210,27 +226,31 @@ operator==(const set<Key, Compare, Allocator>& x,
template <class Key, class Compare, class Allocator>
bool
operator< (const set<Key, Compare, Allocator>& x,
- const set<Key, Compare, Allocator>& y);
+ const set<Key, Compare, Allocator>& y); // removed in C++20
template <class Key, class Compare, class Allocator>
bool
operator!=(const set<Key, Compare, Allocator>& x,
- const set<Key, Compare, Allocator>& y);
+ const set<Key, Compare, Allocator>& y); // removed in C++20
template <class Key, class Compare, class Allocator>
bool
operator> (const set<Key, Compare, Allocator>& x,
- const set<Key, Compare, Allocator>& y);
+ const set<Key, Compare, Allocator>& y); // removed in C++20
template <class Key, class Compare, class Allocator>
bool
operator>=(const set<Key, Compare, Allocator>& x,
- const set<Key, Compare, Allocator>& y);
+ const set<Key, Compare, Allocator>& y); // removed in C++20
template <class Key, class Compare, class Allocator>
bool
operator<=(const set<Key, Compare, Allocator>& x,
- const set<Key, Compare, Allocator>& y);
+ const set<Key, Compare, Allocator>& y); // removed in C++20
+
+template<class Key, class Compare, class Allocator>
+ synth-three-way-result<Key> operator<=>(const set<Key, Compare, Allocator>& x,
+ const set<Key, Compare, Allocator>& y); // since C++20
// specialized algorithms:
template <class Key, class Compare, class Allocator>
@@ -280,6 +300,9 @@ public:
template <class InputIterator>
multiset(InputIterator first, InputIterator last,
const value_compare& comp, const allocator_type& a);
+ template<container-compatible-range<value_type> R>
+ multiset(from_range_t, R&& rg,
+ const Compare& comp = Compare(), const Allocator& = Allocator()); // C++23
multiset(const multiset& s);
multiset(multiset&& s)
noexcept(
@@ -294,6 +317,9 @@ public:
template <class InputIterator>
multiset(InputIterator first, InputIterator last, const allocator_type& a)
: set(first, last, Compare(), a) {} // C++14
+ template<container-compatible-range<value_type> R>
+ multiset(from_range_t, R&& rg, const Allocator& a))
+ : multiset(from_range, std::forward<R>(rg), Compare(), a) { } // C++23
multiset(initializer_list<value_type> il, const allocator_type& a)
: set(il, Compare(), a) {} // C++14
~multiset();
@@ -338,6 +364,8 @@ public:
iterator insert(const_iterator position, value_type&& v);
template <class InputIterator>
void insert(InputIterator first, InputIterator last);
+ template<container-compatible-range<value_type> R>
+ void insert_range(R&& rg); // C++23
void insert(initializer_list<value_type> il);
node_type extract(const_iterator position); // C++17
@@ -415,6 +443,11 @@ multiset(InputIterator, InputIterator,
Compare = Compare(), Allocator = Allocator())
-> multiset<typename iterator_traits<InputIterator>::value_type, Compare, Allocator>; // C++17
+template<ranges::input_range R, class Compare = less<ranges::range_value_t<R>>,
+ class Allocator = allocator<ranges::range_value_t<R>>>
+ multiset(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())
+ -> multiset<ranges::range_value_t<R>, Compare, Allocator>;
+
template<class Key, class Compare = less<Key>, class Allocator = allocator<Key>>
multiset(initializer_list<Key>, Compare = Compare(), Allocator = Allocator())
-> multiset<Key, Compare, Allocator>; // C++17
@@ -424,6 +457,10 @@ multiset(InputIterator, InputIterator, Allocator)
-> multiset<typename iterator_traits<InputIterator>::value_type,
less<typename iterator_traits<InputIterator>::value_type>, Allocator>; // C++17
+template<ranges::input_range R, class Allocator>
+ multiset(from_range_t, R&&, Allocator)
+ -> multiset<ranges::range_value_t<R>, less<ranges::range_value_t<R>>, Allocator>;
+
template<class Key, class Allocator>
multiset(initializer_list<Key>, Allocator) -> multiset<Key, less<Key>, Allocator>; // C++17
@@ -435,27 +472,31 @@ operator==(const multiset<Key, Compare, Allocator>& x,
template <class Key, class Compare, class Allocator>
bool
operator< (const multiset<Key, Compare, Allocator>& x,
- const multiset<Key, Compare, Allocator>& y);
+ const multiset<Key, Compare, Allocator>& y); // removed in C++20
template <class Key, class Compare, class Allocator>
bool
operator!=(const multiset<Key, Compare, Allocator>& x,
- const multiset<Key, Compare, Allocator>& y);
+ const multiset<Key, Compare, Allocator>& y); // removed in C++20
template <class Key, class Compare, class Allocator>
bool
operator> (const multiset<Key, Compare, Allocator>& x,
- const multiset<Key, Compare, Allocator>& y);
+ const multiset<Key, Compare, Allocator>& y); // removed in C++20
template <class Key, class Compare, class Allocator>
bool
operator>=(const multiset<Key, Compare, Allocator>& x,
- const multiset<Key, Compare, Allocator>& y);
+ const multiset<Key, Compare, Allocator>& y); // removed in C++20
template <class Key, class Compare, class Allocator>
bool
operator<=(const multiset<Key, Compare, Allocator>& x,
- const multiset<Key, Compare, Allocator>& y);
+ const multiset<Key, Compare, Allocator>& y); // removed in C++20
+
+template<class Key, class Compare, class Allocator>
+ synth-three-way-result<Key> operator<=>(const multiset<Key, Compare, Allocator>& x,
+ const multiset<Key, Compare, Allocator>& y); // since C++20
// specialized algorithms:
template <class Key, class Compare, class Allocator>
@@ -473,16 +514,22 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20
#include <__algorithm/equal.h>
#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lexicographical_compare_three_way.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
#include <__functional/is_transparent.h>
#include <__functional/operations.h>
#include <__iterator/erase_if_container.h>
#include <__iterator/iterator_traits.h>
+#include <__iterator/ranges_iterator_traits.h>
#include <__iterator/reverse_iterator.h>
#include <__memory/allocator.h>
#include <__memory_resource/polymorphic_allocator.h>
#include <__node_handle>
+#include <__ranges/concepts.h>
+#include <__ranges/container_compatible_range.h>
+#include <__ranges/from_range.h>
#include <__tree>
#include <__type_traits/is_allocator.h>
#include <__utility/forward.h>
@@ -547,7 +594,7 @@ public:
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __set_node_handle<typename __base::__node, allocator_type> node_type;
typedef __insert_return_type<iterator, node_type> insert_return_type;
#endif
@@ -593,13 +640,30 @@ public:
insert(__f, __l);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ set(from_range_t, _Range&& __range, const key_compare& __comp = key_compare(),
+ const allocator_type& __a = allocator_type())
+ : __tree_(__comp, __a) {
+ insert_range(std::forward<_Range>(__range));
+ }
+#endif
+
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
set(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
: set(__f, __l, key_compare(), __a) {}
#endif
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ set(from_range_t, _Range&& __range, const allocator_type& __a)
+ : set(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
set(const set& __s)
: __tree_(__s.__tree_)
@@ -633,7 +697,7 @@ public:
}
#ifndef _LIBCPP_CXX03_LANG
- set(set&& __s, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI set(set&& __s, const allocator_type& __a);
_LIBCPP_INLINE_VISIBILITY
set(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
@@ -650,7 +714,7 @@ public:
insert(__il.begin(), __il.end());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_INLINE_VISIBILITY
set(initializer_list<value_type> __il, const allocator_type& __a)
: set(__il, key_compare(), __a) {}
@@ -742,6 +806,17 @@ public:
__tree_.__insert_unique(__e, *__f);
}
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void insert_range(_Range&& __range) {
+ const_iterator __end = cend();
+ for (auto&& __element : __range) {
+ __tree_.__insert_unique(__end, std::forward<decltype(__element)>(__element));
+ }
+ }
+#endif
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
pair<iterator,bool> insert(value_type&& __v)
@@ -767,11 +842,11 @@ public:
_LIBCPP_REINITIALIZES_OBJECT _LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {__tree_.clear();}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
insert_return_type insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to set::insert()");
return __tree_.template __node_handle_insert_unique<
node_type, insert_return_type>(_VSTD::move(__nh));
@@ -779,7 +854,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to set::insert()");
return __tree_.template __node_handle_insert_unique<node_type>(
__hint, _VSTD::move(__nh));
@@ -798,7 +873,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void merge(set<key_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
@@ -806,7 +881,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void merge(set<key_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
@@ -814,7 +889,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void merge(multiset<key_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
@@ -822,7 +897,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void merge(multiset<key_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
@@ -844,7 +919,7 @@ public:
iterator find(const key_type& __k) {return __tree_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
@@ -858,21 +933,21 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const
{return __tree_.__count_unique(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
count(const _K2& __k) const {return __tree_.__count_multi(__k);}
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
contains(const _K2& __k) const { return find(__k) != end(); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
@@ -880,7 +955,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_iterator lower_bound(const key_type& __k) const
{return __tree_.lower_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
@@ -898,7 +973,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_iterator upper_bound(const key_type& __k) const
{return __tree_.upper_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
@@ -915,7 +990,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
{return __tree_.__equal_range_unique(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
@@ -931,12 +1006,21 @@ public:
template<class _InputIterator,
class _Compare = less<__iter_value_type<_InputIterator>>,
class _Allocator = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>,
class = enable_if_t<!__is_allocator<_Compare>::value, void>>
set(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
-> set<__iter_value_type<_InputIterator>, _Compare, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range, class _Compare = less<ranges::range_value_t<_Range>>,
+ class _Allocator = allocator<ranges::range_value_t<_Range>>,
+ class = enable_if_t<__is_allocator<_Allocator>::value, void>,
+ class = enable_if_t<!__is_allocator<_Compare>::value, void>>
+set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
+ -> set<ranges::range_value_t<_Range>, _Compare, _Allocator>;
+#endif
+
template<class _Key, class _Compare = less<_Key>,
class _Allocator = allocator<_Key>,
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
@@ -945,12 +1029,19 @@ set(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator())
-> set<_Key, _Compare, _Allocator>;
template<class _InputIterator, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
set(_InputIterator, _InputIterator, _Allocator)
-> set<__iter_value_type<_InputIterator>,
less<__iter_value_type<_InputIterator>>, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range, class _Allocator,
+ class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+set(from_range_t, _Range&&, _Allocator)
+ -> set<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
+#endif
+
template<class _Key, class _Allocator,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
set(initializer_list<_Key>, _Allocator)
@@ -982,6 +1073,8 @@ operator==(const set<_Key, _Compare, _Allocator>& __x,
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -1027,6 +1120,17 @@ operator<=(const set<_Key, _Compare, _Allocator>& __x,
return !(__y < __x);
}
+#else // _LIBCPP_STD_VER <= 17
+
+template <class _Key, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Key>
+operator<=>(const set<_Key, _Allocator>& __x, const set<_Key, _Allocator>& __y) {
+ return std::lexicographical_compare_three_way(
+ __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Key, _Key>);
+}
+
+#endif // _LIBCPP_STD_VER <= 17
+
// specialized algorithms:
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1038,7 +1142,7 @@ swap(set<_Key, _Compare, _Allocator>& __x,
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Key, class _Compare, class _Allocator, class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
typename set<_Key, _Compare, _Allocator>::size_type
@@ -1084,7 +1188,7 @@ public:
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __set_node_handle<typename __base::__node, allocator_type> node_type;
#endif
@@ -1121,7 +1225,7 @@ public:
insert(__f, __l);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
multiset(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
@@ -1137,6 +1241,21 @@ public:
insert(__f, __l);
}
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ multiset(from_range_t, _Range&& __range, const key_compare& __comp = key_compare(),
+ const allocator_type& __a = allocator_type())
+ : __tree_(__comp, __a) {
+ insert_range(std::forward<_Range>(__range));
+ }
+
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ multiset(from_range_t, _Range&& __range, const allocator_type& __a)
+ : multiset(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
multiset(const multiset& __s)
: __tree_(__s.__tree_.value_comp(),
@@ -1158,7 +1277,7 @@ public:
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
: __tree_(_VSTD::move(__s.__tree_)) {}
- multiset(multiset&& __s, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s, const allocator_type& __a);
#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit multiset(const allocator_type& __a)
@@ -1186,7 +1305,7 @@ public:
insert(__il.begin(), __il.end());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_INLINE_VISIBILITY
multiset(initializer_list<value_type> __il, const allocator_type& __a)
: multiset(__il, key_compare(), __a) {}
@@ -1278,6 +1397,17 @@ public:
__tree_.__insert_multi(__e, *__f);
}
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void insert_range(_Range&& __range) {
+ const_iterator __end = cend();
+ for (auto&& __element : __range) {
+ __tree_.__insert_multi(__end, std::forward<decltype(__element)>(__element));
+ }
+ }
+#endif
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator insert(value_type&& __v)
@@ -1302,11 +1432,11 @@ public:
_LIBCPP_REINITIALIZES_OBJECT _LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {__tree_.clear();}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
iterator insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to multiset::insert()");
return __tree_.template __node_handle_insert_multi<node_type>(
_VSTD::move(__nh));
@@ -1314,7 +1444,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to multiset::insert()");
return __tree_.template __node_handle_insert_multi<node_type>(
__hint, _VSTD::move(__nh));
@@ -1333,7 +1463,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void merge(multiset<key_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_multi(__source.__tree_);
}
@@ -1341,7 +1471,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void merge(multiset<key_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_multi(__source.__tree_);
}
@@ -1349,7 +1479,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void merge(set<key_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_multi(__source.__tree_);
}
@@ -1357,7 +1487,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void merge(set<key_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_multi(__source.__tree_);
}
@@ -1380,7 +1510,7 @@ public:
iterator find(const key_type& __k) {return __tree_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
@@ -1394,21 +1524,21 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const
{return __tree_.__count_multi(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
count(const _K2& __k) const {return __tree_.__count_multi(__k);}
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
contains(const _K2& __k) const { return find(__k) != end(); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
@@ -1416,7 +1546,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_iterator lower_bound(const key_type& __k) const
{return __tree_.lower_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
@@ -1434,7 +1564,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_iterator upper_bound(const key_type& __k) const
{return __tree_.upper_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
@@ -1451,7 +1581,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
{return __tree_.__equal_range_multi(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
@@ -1467,12 +1597,21 @@ public:
template<class _InputIterator,
class _Compare = less<__iter_value_type<_InputIterator>>,
class _Allocator = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>,
class = enable_if_t<!__is_allocator<_Compare>::value, void>>
multiset(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
-> multiset<__iter_value_type<_InputIterator>, _Compare, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range, class _Compare = less<ranges::range_value_t<_Range>>,
+ class _Allocator = allocator<ranges::range_value_t<_Range>>,
+ class = enable_if_t<__is_allocator<_Allocator>::value, void>,
+ class = enable_if_t<!__is_allocator<_Compare>::value, void>>
+multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
+ -> multiset<ranges::range_value_t<_Range>, _Compare, _Allocator>;
+#endif
+
template<class _Key, class _Compare = less<_Key>,
class _Allocator = allocator<_Key>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>,
@@ -1481,12 +1620,19 @@ multiset(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator(
-> multiset<_Key, _Compare, _Allocator>;
template<class _InputIterator, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
multiset(_InputIterator, _InputIterator, _Allocator)
-> multiset<__iter_value_type<_InputIterator>,
less<__iter_value_type<_InputIterator>>, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range, class _Allocator,
+ class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+multiset(from_range_t, _Range&&, _Allocator)
+ -> multiset<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
+#endif
+
template<class _Key, class _Allocator,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
multiset(initializer_list<_Key>, _Allocator)
@@ -1518,6 +1664,8 @@ operator==(const multiset<_Key, _Compare, _Allocator>& __x,
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -1563,6 +1711,17 @@ operator<=(const multiset<_Key, _Compare, _Allocator>& __x,
return !(__y < __x);
}
+#else // _LIBCPP_STD_VER <= 17
+
+template <class _Key, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Key>
+operator<=>(const multiset<_Key, _Allocator>& __x, const multiset<_Key, _Allocator>& __y) {
+ return std::lexicographical_compare_three_way(
+ __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Key, _Key>);
+}
+
+#endif // _LIBCPP_STD_VER <= 17
+
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
@@ -1573,7 +1732,7 @@ swap(multiset<_Key, _Compare, _Allocator>& __x,
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Key, class _Compare, class _Allocator, class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
typename multiset<_Key, _Compare, _Allocator>::size_type
@@ -1584,22 +1743,24 @@ inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _KeyT, class _CompareT = std::less<_KeyT>>
-using set = std::set<_KeyT, _CompareT, polymorphic_allocator<_KeyT>>;
+using set _LIBCPP_AVAILABILITY_PMR = std::set<_KeyT, _CompareT, polymorphic_allocator<_KeyT>>;
template <class _KeyT, class _CompareT = std::less<_KeyT>>
-using multiset = std::multiset<_KeyT, _CompareT, polymorphic_allocator<_KeyT>>;
+using multiset _LIBCPP_AVAILABILITY_PMR = std::multiset<_KeyT, _CompareT, polymorphic_allocator<_KeyT>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iterator>
+# include <type_traits>
#endif
#endif // _LIBCPP_SET
diff --git a/contrib/libs/cxxsupp/libcxx/include/shared_mutex b/contrib/libs/cxxsupp/libcxx/include/shared_mutex
index 6919898f66f..350c841e11a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/shared_mutex
+++ b/contrib/libs/cxxsupp/libcxx/include/shared_mutex
@@ -124,386 +124,343 @@ template <class Mutex>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__availability>
+#include <__chrono/duration.h>
+#include <__chrono/steady_clock.h>
+#include <__chrono/time_point.h>
+#include <__condition_variable/condition_variable.h>
#include <__config>
+#include <__memory/addressof.h>
+#include <__mutex/mutex.h>
+#include <__mutex/tag_types.h>
+#include <__mutex/unique_lock.h>
+#include <__system_error/system_error.h>
+#include <__utility/swap.h>
+#include <cerrno>
#include <version>
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
+#if _LIBCPP_STD_VER >= 14
-#if _LIBCPP_STD_VER > 11 || defined(_LIBCPP_BUILDING_LIBRARY)
+# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+# endif
-#include <__mutex_base>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-#ifdef _LIBCPP_HAS_NO_THREADS
-# error "<shared_mutex> is not supported since libc++ has been configured without support for threads."
-#endif
+# ifdef _LIBCPP_HAS_NO_THREADS
+# error "<shared_mutex> is not supported since libc++ has been configured without support for threads."
+# endif
_LIBCPP_BEGIN_NAMESPACE_STD
-struct _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("shared_mutex"))
-__shared_mutex_base
-{
- mutex __mut_;
- condition_variable __gate1_;
- condition_variable __gate2_;
- unsigned __state_;
+struct _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_SHARED_MUTEX __shared_mutex_base {
+ mutex __mut_;
+ condition_variable __gate1_;
+ condition_variable __gate2_;
+ unsigned __state_;
- static const unsigned __write_entered_ = 1U << (sizeof(unsigned)*__CHAR_BIT__ - 1);
- static const unsigned __n_readers_ = ~__write_entered_;
+ static const unsigned __write_entered_ = 1U << (sizeof(unsigned) * __CHAR_BIT__ - 1);
+ static const unsigned __n_readers_ = ~__write_entered_;
- __shared_mutex_base();
- _LIBCPP_INLINE_VISIBILITY ~__shared_mutex_base() = default;
+ __shared_mutex_base();
+ _LIBCPP_HIDE_FROM_ABI ~__shared_mutex_base() = default;
- __shared_mutex_base(const __shared_mutex_base&) = delete;
- __shared_mutex_base& operator=(const __shared_mutex_base&) = delete;
+ __shared_mutex_base(const __shared_mutex_base&) = delete;
+ __shared_mutex_base& operator=(const __shared_mutex_base&) = delete;
- // Exclusive ownership
- void lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability()); // blocking
- bool try_lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(try_acquire_capability(true));
- void unlock() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability());
+ // Exclusive ownership
+ void lock(); // blocking
+ bool try_lock();
+ void unlock();
- // Shared ownership
- void lock_shared() _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_shared_capability()); // blocking
- bool try_lock_shared() _LIBCPP_THREAD_SAFETY_ANNOTATION(try_acquire_shared_capability(true));
- void unlock_shared() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_shared_capability());
+ // Shared ownership
+ void lock_shared(); // blocking
+ bool try_lock_shared();
+ void unlock_shared();
-// typedef implementation-defined native_handle_type; // See 30.2.3
-// native_handle_type native_handle(); // See 30.2.3
+ // typedef implementation-defined native_handle_type; // See 30.2.3
+ // native_handle_type native_handle(); // See 30.2.3
};
+# if _LIBCPP_STD_VER >= 17
+class _LIBCPP_EXPORTED_FROM_ABI
+ _LIBCPP_AVAILABILITY_SHARED_MUTEX _LIBCPP_THREAD_SAFETY_ANNOTATION(__capability__("shared_mutex")) shared_mutex {
+ __shared_mutex_base __base_;
-#if _LIBCPP_STD_VER > 14
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_mutex
-{
- __shared_mutex_base __base_;
public:
- _LIBCPP_INLINE_VISIBILITY shared_mutex() : __base_() {}
- _LIBCPP_INLINE_VISIBILITY ~shared_mutex() = default;
-
- shared_mutex(const shared_mutex&) = delete;
- shared_mutex& operator=(const shared_mutex&) = delete;
-
- // Exclusive ownership
- _LIBCPP_INLINE_VISIBILITY void lock() { return __base_.lock(); }
- _LIBCPP_INLINE_VISIBILITY bool try_lock() { return __base_.try_lock(); }
- _LIBCPP_INLINE_VISIBILITY void unlock() { return __base_.unlock(); }
-
- // Shared ownership
- _LIBCPP_INLINE_VISIBILITY void lock_shared() { return __base_.lock_shared(); }
- _LIBCPP_INLINE_VISIBILITY bool try_lock_shared() { return __base_.try_lock_shared(); }
- _LIBCPP_INLINE_VISIBILITY void unlock_shared() { return __base_.unlock_shared(); }
-
-// typedef __shared_mutex_base::native_handle_type native_handle_type;
-// _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() { return __base::unlock_shared(); }
+ _LIBCPP_HIDE_FROM_ABI shared_mutex() : __base_() {}
+ _LIBCPP_HIDE_FROM_ABI ~shared_mutex() = default;
+
+ shared_mutex(const shared_mutex&) = delete;
+ shared_mutex& operator=(const shared_mutex&) = delete;
+
+ // Exclusive ownership
+ _LIBCPP_HIDE_FROM_ABI void lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(__acquire_capability__()) {
+ return __base_.lock();
+ }
+ _LIBCPP_HIDE_FROM_ABI bool try_lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(__try_acquire_capability__(true)) {
+ return __base_.try_lock();
+ }
+ _LIBCPP_HIDE_FROM_ABI void unlock() _LIBCPP_THREAD_SAFETY_ANNOTATION(__release_capability__()) {
+ return __base_.unlock();
+ }
+
+ // Shared ownership
+ _LIBCPP_HIDE_FROM_ABI void lock_shared() _LIBCPP_THREAD_SAFETY_ANNOTATION(__acquire_shared_capability__()) {
+ return __base_.lock_shared();
+ }
+ _LIBCPP_HIDE_FROM_ABI bool try_lock_shared()
+ _LIBCPP_THREAD_SAFETY_ANNOTATION(__try_acquire_shared_capability__(true)) {
+ return __base_.try_lock_shared();
+ }
+ _LIBCPP_HIDE_FROM_ABI void unlock_shared() _LIBCPP_THREAD_SAFETY_ANNOTATION(__release_shared_capability__()) {
+ return __base_.unlock_shared();
+ }
+
+ // typedef __shared_mutex_base::native_handle_type native_handle_type;
+ // _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return __base::unlock_shared(); }
};
-#endif
+# endif
+class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_SHARED_MUTEX _LIBCPP_THREAD_SAFETY_ANNOTATION(
+ __capability__("shared_timed_mutex")) shared_timed_mutex {
+ __shared_mutex_base __base_;
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_timed_mutex
-{
- __shared_mutex_base __base_;
public:
- shared_timed_mutex();
- _LIBCPP_INLINE_VISIBILITY ~shared_timed_mutex() = default;
-
- shared_timed_mutex(const shared_timed_mutex&) = delete;
- shared_timed_mutex& operator=(const shared_timed_mutex&) = delete;
-
- // Exclusive ownership
- void lock();
- bool try_lock();
- template <class _Rep, class _Period>
- _LIBCPP_INLINE_VISIBILITY
- bool
- try_lock_for(const chrono::duration<_Rep, _Period>& __rel_time)
- {
- return try_lock_until(chrono::steady_clock::now() + __rel_time);
- }
- template <class _Clock, class _Duration>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- bool
- try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time);
- void unlock();
-
- // Shared ownership
- void lock_shared();
- bool try_lock_shared();
- template <class _Rep, class _Period>
- _LIBCPP_INLINE_VISIBILITY
- bool
- try_lock_shared_for(const chrono::duration<_Rep, _Period>& __rel_time)
- {
- return try_lock_shared_until(chrono::steady_clock::now() + __rel_time);
- }
- template <class _Clock, class _Duration>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- bool
- try_lock_shared_until(const chrono::time_point<_Clock, _Duration>& __abs_time);
- void unlock_shared();
+ shared_timed_mutex();
+ _LIBCPP_HIDE_FROM_ABI ~shared_timed_mutex() = default;
+
+ shared_timed_mutex(const shared_timed_mutex&) = delete;
+ shared_timed_mutex& operator=(const shared_timed_mutex&) = delete;
+
+ // Exclusive ownership
+ void lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(__acquire_capability__());
+ bool try_lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(__try_acquire_capability__(true));
+ template <class _Rep, class _Period>
+ _LIBCPP_HIDE_FROM_ABI bool try_lock_for(const chrono::duration<_Rep, _Period>& __rel_time)
+ _LIBCPP_THREAD_SAFETY_ANNOTATION(__try_acquire_capability__(true)) {
+ return try_lock_until(chrono::steady_clock::now() + __rel_time);
+ }
+ template <class _Clock, class _Duration>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time)
+ _LIBCPP_THREAD_SAFETY_ANNOTATION(__try_acquire_capability__(true));
+ void unlock() _LIBCPP_THREAD_SAFETY_ANNOTATION(__release_capability__());
+
+ // Shared ownership
+ void lock_shared() _LIBCPP_THREAD_SAFETY_ANNOTATION(__acquire_shared_capability__());
+ bool try_lock_shared() _LIBCPP_THREAD_SAFETY_ANNOTATION(__try_acquire_shared_capability__(true));
+ template <class _Rep, class _Period>
+ _LIBCPP_HIDE_FROM_ABI bool try_lock_shared_for(const chrono::duration<_Rep, _Period>& __rel_time)
+ _LIBCPP_THREAD_SAFETY_ANNOTATION(__try_acquire_shared_capability__(true)) {
+ return try_lock_shared_until(chrono::steady_clock::now() + __rel_time);
+ }
+ template <class _Clock, class _Duration>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool
+ try_lock_shared_until(const chrono::time_point<_Clock, _Duration>& __abs_time)
+ _LIBCPP_THREAD_SAFETY_ANNOTATION(__try_acquire_shared_capability__(true));
+ void unlock_shared() _LIBCPP_THREAD_SAFETY_ANNOTATION(__release_shared_capability__());
};
template <class _Clock, class _Duration>
-bool
-shared_timed_mutex::try_lock_until(
- const chrono::time_point<_Clock, _Duration>& __abs_time)
-{
- unique_lock<mutex> __lk(__base_.__mut_);
- if (__base_.__state_ & __base_.__write_entered_)
- {
- while (true)
- {
- cv_status __status = __base_.__gate1_.wait_until(__lk, __abs_time);
- if ((__base_.__state_ & __base_.__write_entered_) == 0)
- break;
- if (__status == cv_status::timeout)
- return false;
- }
+bool shared_timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time) {
+ unique_lock<mutex> __lk(__base_.__mut_);
+ if (__base_.__state_ & __base_.__write_entered_) {
+ while (true) {
+ cv_status __status = __base_.__gate1_.wait_until(__lk, __abs_time);
+ if ((__base_.__state_ & __base_.__write_entered_) == 0)
+ break;
+ if (__status == cv_status::timeout)
+ return false;
}
- __base_.__state_ |= __base_.__write_entered_;
- if (__base_.__state_ & __base_.__n_readers_)
- {
- while (true)
- {
- cv_status __status = __base_.__gate2_.wait_until(__lk, __abs_time);
- if ((__base_.__state_ & __base_.__n_readers_) == 0)
- break;
- if (__status == cv_status::timeout)
- {
- __base_.__state_ &= ~__base_.__write_entered_;
- __base_.__gate1_.notify_all();
- return false;
- }
- }
+ }
+ __base_.__state_ |= __base_.__write_entered_;
+ if (__base_.__state_ & __base_.__n_readers_) {
+ while (true) {
+ cv_status __status = __base_.__gate2_.wait_until(__lk, __abs_time);
+ if ((__base_.__state_ & __base_.__n_readers_) == 0)
+ break;
+ if (__status == cv_status::timeout) {
+ __base_.__state_ &= ~__base_.__write_entered_;
+ __base_.__gate1_.notify_all();
+ return false;
+ }
}
- return true;
+ }
+ return true;
}
template <class _Clock, class _Duration>
-bool
-shared_timed_mutex::try_lock_shared_until(
- const chrono::time_point<_Clock, _Duration>& __abs_time)
-{
- unique_lock<mutex> __lk(__base_.__mut_);
- if ((__base_.__state_ & __base_.__write_entered_) || (__base_.__state_ & __base_.__n_readers_) == __base_.__n_readers_)
- {
- while (true)
- {
- cv_status status = __base_.__gate1_.wait_until(__lk, __abs_time);
- if ((__base_.__state_ & __base_.__write_entered_) == 0 &&
- (__base_.__state_ & __base_.__n_readers_) < __base_.__n_readers_)
- break;
- if (status == cv_status::timeout)
- return false;
- }
+bool shared_timed_mutex::try_lock_shared_until(const chrono::time_point<_Clock, _Duration>& __abs_time) {
+ unique_lock<mutex> __lk(__base_.__mut_);
+ if ((__base_.__state_ & __base_.__write_entered_) ||
+ (__base_.__state_ & __base_.__n_readers_) == __base_.__n_readers_) {
+ while (true) {
+ cv_status __status = __base_.__gate1_.wait_until(__lk, __abs_time);
+ if ((__base_.__state_ & __base_.__write_entered_) == 0 &&
+ (__base_.__state_ & __base_.__n_readers_) < __base_.__n_readers_)
+ break;
+ if (__status == cv_status::timeout)
+ return false;
}
- unsigned __num_readers = (__base_.__state_ & __base_.__n_readers_) + 1;
- __base_.__state_ &= ~__base_.__n_readers_;
- __base_.__state_ |= __num_readers;
- return true;
+ }
+ unsigned __num_readers = (__base_.__state_ & __base_.__n_readers_) + 1;
+ __base_.__state_ &= ~__base_.__n_readers_;
+ __base_.__state_ |= __num_readers;
+ return true;
}
template <class _Mutex>
-class shared_lock
-{
+class shared_lock {
public:
- typedef _Mutex mutex_type;
+ typedef _Mutex mutex_type;
private:
- mutex_type* __m_;
- bool __owns_;
+ mutex_type* __m_;
+ bool __owns_;
public:
- _LIBCPP_INLINE_VISIBILITY
- shared_lock() _NOEXCEPT
- : __m_(nullptr),
- __owns_(false)
- {}
-
- _LIBCPP_INLINE_VISIBILITY
- explicit shared_lock(mutex_type& __m)
- : __m_(_VSTD::addressof(__m)),
- __owns_(true)
- {__m_->lock_shared();}
-
- _LIBCPP_INLINE_VISIBILITY
- shared_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
- : __m_(_VSTD::addressof(__m)),
- __owns_(false)
- {}
-
- _LIBCPP_INLINE_VISIBILITY
- shared_lock(mutex_type& __m, try_to_lock_t)
- : __m_(_VSTD::addressof(__m)),
- __owns_(__m.try_lock_shared())
- {}
-
- _LIBCPP_INLINE_VISIBILITY
- shared_lock(mutex_type& __m, adopt_lock_t)
- : __m_(_VSTD::addressof(__m)),
- __owns_(true)
- {}
-
- template <class _Clock, class _Duration>
- _LIBCPP_INLINE_VISIBILITY
- shared_lock(mutex_type& __m,
- const chrono::time_point<_Clock, _Duration>& __abs_time)
- : __m_(_VSTD::addressof(__m)),
- __owns_(__m.try_lock_shared_until(__abs_time))
- {}
-
- template <class _Rep, class _Period>
- _LIBCPP_INLINE_VISIBILITY
- shared_lock(mutex_type& __m,
- const chrono::duration<_Rep, _Period>& __rel_time)
- : __m_(_VSTD::addressof(__m)),
- __owns_(__m.try_lock_shared_for(__rel_time))
- {}
-
- _LIBCPP_INLINE_VISIBILITY
- ~shared_lock()
- {
- if (__owns_)
- __m_->unlock_shared();
- }
+ _LIBCPP_HIDE_FROM_ABI shared_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {}
- shared_lock(shared_lock const&) = delete;
- shared_lock& operator=(shared_lock const&) = delete;
+ _LIBCPP_HIDE_FROM_ABI explicit shared_lock(mutex_type& __m) : __m_(_VSTD::addressof(__m)), __owns_(true) {
+ __m_->lock_shared();
+ }
- _LIBCPP_INLINE_VISIBILITY
- shared_lock(shared_lock&& __u) _NOEXCEPT
- : __m_(__u.__m_),
- __owns_(__u.__owns_)
- {
- __u.__m_ = nullptr;
- __u.__owns_ = false;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- shared_lock& operator=(shared_lock&& __u) _NOEXCEPT
- {
- if (__owns_)
- __m_->unlock_shared();
- __m_ = nullptr;
- __owns_ = false;
- __m_ = __u.__m_;
- __owns_ = __u.__owns_;
- __u.__m_ = nullptr;
- __u.__owns_ = false;
- return *this;
- }
+ _LIBCPP_HIDE_FROM_ABI shared_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
+ : __m_(_VSTD::addressof(__m)),
+ __owns_(false) {}
- void lock();
- bool try_lock();
- template <class Rep, class Period>
- bool try_lock_for(const chrono::duration<Rep, Period>& __rel_time);
- template <class Clock, class Duration>
- bool try_lock_until(const chrono::time_point<Clock, Duration>& __abs_time);
- void unlock();
+ _LIBCPP_HIDE_FROM_ABI shared_lock(mutex_type& __m, try_to_lock_t)
+ : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_shared()) {}
- // Setters
- _LIBCPP_INLINE_VISIBILITY
- void swap(shared_lock& __u) _NOEXCEPT
- {
- _VSTD::swap(__m_, __u.__m_);
- _VSTD::swap(__owns_, __u.__owns_);
- }
+ _LIBCPP_HIDE_FROM_ABI shared_lock(mutex_type& __m, adopt_lock_t) : __m_(_VSTD::addressof(__m)), __owns_(true) {}
- _LIBCPP_INLINE_VISIBILITY
- mutex_type* release() _NOEXCEPT
- {
- mutex_type* __m = __m_;
- __m_ = nullptr;
- __owns_ = false;
- return __m;
- }
+ template <class _Clock, class _Duration>
+ _LIBCPP_HIDE_FROM_ABI shared_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __abs_time)
+ : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_shared_until(__abs_time)) {}
- // Getters
- _LIBCPP_INLINE_VISIBILITY
- bool owns_lock() const _NOEXCEPT {return __owns_;}
+ template <class _Rep, class _Period>
+ _LIBCPP_HIDE_FROM_ABI shared_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __rel_time)
+ : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_shared_for(__rel_time)) {}
- _LIBCPP_INLINE_VISIBILITY
- explicit operator bool () const _NOEXCEPT {return __owns_;}
+ _LIBCPP_HIDE_FROM_ABI ~shared_lock() {
+ if (__owns_)
+ __m_->unlock_shared();
+ }
+
+ shared_lock(shared_lock const&) = delete;
+ shared_lock& operator=(shared_lock const&) = delete;
+
+ _LIBCPP_HIDE_FROM_ABI shared_lock(shared_lock&& __u) _NOEXCEPT : __m_(__u.__m_), __owns_(__u.__owns_) {
+ __u.__m_ = nullptr;
+ __u.__owns_ = false;
+ }
- _LIBCPP_INLINE_VISIBILITY
- mutex_type* mutex() const _NOEXCEPT {return __m_;}
+ _LIBCPP_HIDE_FROM_ABI shared_lock& operator=(shared_lock&& __u) _NOEXCEPT {
+ if (__owns_)
+ __m_->unlock_shared();
+ __m_ = nullptr;
+ __owns_ = false;
+ __m_ = __u.__m_;
+ __owns_ = __u.__owns_;
+ __u.__m_ = nullptr;
+ __u.__owns_ = false;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI void lock();
+ _LIBCPP_HIDE_FROM_ABI bool try_lock();
+ template <class _Rep, class _Period>
+ _LIBCPP_HIDE_FROM_ABI bool try_lock_for(const chrono::duration<_Rep, _Period>& __rel_time);
+ template <class _Clock, class _Duration>
+ _LIBCPP_HIDE_FROM_ABI bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time);
+ _LIBCPP_HIDE_FROM_ABI void unlock();
+
+ // Setters
+ _LIBCPP_HIDE_FROM_ABI void swap(shared_lock& __u) _NOEXCEPT {
+ _VSTD::swap(__m_, __u.__m_);
+ _VSTD::swap(__owns_, __u.__owns_);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI mutex_type* release() _NOEXCEPT {
+ mutex_type* __m = __m_;
+ __m_ = nullptr;
+ __owns_ = false;
+ return __m;
+ }
+
+ // Getters
+ _LIBCPP_HIDE_FROM_ABI bool owns_lock() const _NOEXCEPT { return __owns_; }
+
+ _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __owns_; }
+
+ _LIBCPP_HIDE_FROM_ABI mutex_type* mutex() const _NOEXCEPT { return __m_; }
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(shared_lock);
template <class _Mutex>
-void
-shared_lock<_Mutex>::lock()
-{
- if (__m_ == nullptr)
- __throw_system_error(EPERM, "shared_lock::lock: references null mutex");
- if (__owns_)
- __throw_system_error(EDEADLK, "shared_lock::lock: already locked");
- __m_->lock_shared();
- __owns_ = true;
+void shared_lock<_Mutex>::lock() {
+ if (__m_ == nullptr)
+ __throw_system_error(EPERM, "shared_lock::lock: references null mutex");
+ if (__owns_)
+ __throw_system_error(EDEADLK, "shared_lock::lock: already locked");
+ __m_->lock_shared();
+ __owns_ = true;
}
template <class _Mutex>
-bool
-shared_lock<_Mutex>::try_lock()
-{
- if (__m_ == nullptr)
- __throw_system_error(EPERM, "shared_lock::try_lock: references null mutex");
- if (__owns_)
- __throw_system_error(EDEADLK, "shared_lock::try_lock: already locked");
- __owns_ = __m_->try_lock_shared();
- return __owns_;
+bool shared_lock<_Mutex>::try_lock() {
+ if (__m_ == nullptr)
+ __throw_system_error(EPERM, "shared_lock::try_lock: references null mutex");
+ if (__owns_)
+ __throw_system_error(EDEADLK, "shared_lock::try_lock: already locked");
+ __owns_ = __m_->try_lock_shared();
+ return __owns_;
}
template <class _Mutex>
template <class _Rep, class _Period>
-bool
-shared_lock<_Mutex>::try_lock_for(const chrono::duration<_Rep, _Period>& __d)
-{
- if (__m_ == nullptr)
- __throw_system_error(EPERM, "shared_lock::try_lock_for: references null mutex");
- if (__owns_)
- __throw_system_error(EDEADLK, "shared_lock::try_lock_for: already locked");
- __owns_ = __m_->try_lock_shared_for(__d);
- return __owns_;
+bool shared_lock<_Mutex>::try_lock_for(const chrono::duration<_Rep, _Period>& __d) {
+ if (__m_ == nullptr)
+ __throw_system_error(EPERM, "shared_lock::try_lock_for: references null mutex");
+ if (__owns_)
+ __throw_system_error(EDEADLK, "shared_lock::try_lock_for: already locked");
+ __owns_ = __m_->try_lock_shared_for(__d);
+ return __owns_;
}
template <class _Mutex>
template <class _Clock, class _Duration>
-bool
-shared_lock<_Mutex>::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t)
-{
- if (__m_ == nullptr)
- __throw_system_error(EPERM, "shared_lock::try_lock_until: references null mutex");
- if (__owns_)
- __throw_system_error(EDEADLK, "shared_lock::try_lock_until: already locked");
- __owns_ = __m_->try_lock_shared_until(__t);
- return __owns_;
+bool shared_lock<_Mutex>::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t) {
+ if (__m_ == nullptr)
+ __throw_system_error(EPERM, "shared_lock::try_lock_until: references null mutex");
+ if (__owns_)
+ __throw_system_error(EDEADLK, "shared_lock::try_lock_until: already locked");
+ __owns_ = __m_->try_lock_shared_until(__t);
+ return __owns_;
}
template <class _Mutex>
-void
-shared_lock<_Mutex>::unlock()
-{
- if (!__owns_)
- __throw_system_error(EPERM, "shared_lock::unlock: not locked");
- __m_->unlock_shared();
- __owns_ = false;
+void shared_lock<_Mutex>::unlock() {
+ if (!__owns_)
+ __throw_system_error(EPERM, "shared_lock::unlock: not locked");
+ __m_->unlock_shared();
+ __owns_ = false;
}
template <class _Mutex>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-swap(shared_lock<_Mutex>& __x, shared_lock<_Mutex>& __y) _NOEXCEPT
- {__x.swap(__y);}
+inline _LIBCPP_HIDE_FROM_ABI void swap(shared_lock<_Mutex>& __x, shared_lock<_Mutex>& __y) _NOEXCEPT {
+ __x.swap(__y);
+}
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <system_error>
+#endif
+
#endif // _LIBCPP_SHARED_MUTEX
diff --git a/contrib/libs/cxxsupp/libcxx/include/span b/contrib/libs/cxxsupp/libcxx/include/span
index 23af04f3883..b050dfe6e34 100644
--- a/contrib/libs/cxxsupp/libcxx/include/span
+++ b/contrib/libs/cxxsupp/libcxx/include/span
@@ -71,7 +71,6 @@ public:
constexpr span(const span& other) noexcept = default;
template <class OtherElementType, size_t OtherExtent>
constexpr explicit(Extent != dynamic_extent) span(const span<OtherElementType, OtherExtent>& s) noexcept;
- ~span() noexcept = default;
constexpr span& operator=(const span& other) noexcept = default;
// [span.sub], span subviews
@@ -129,7 +128,6 @@ template<class R>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
-#include <__debug>
#include <__fwd/span.h>
#include <__iterator/bounded_iter.h>
#include <__iterator/concepts.h>
@@ -141,11 +139,14 @@ template<class R>
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/enable_view.h>
#include <__ranges/size.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h>
+#include <__type_traits/type_identity.h>
#include <__utility/forward.h>
#include <array> // for array
#include <cstddef> // for byte
#include <limits>
-#include <type_traits> // for remove_cv, etc
#include <version>
// standard-mandated includes
@@ -166,7 +167,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp>
struct __is_std_array : false_type {};
@@ -211,7 +212,7 @@ public:
using const_pointer = const _Tp *;
using reference = _Tp &;
using const_reference = const _Tp &;
-#ifdef _LIBCPP_DEBUG_ITERATOR_BOUNDS_CHECKING
+#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
using iterator = __bounded_iter<pointer>;
#else
using iterator = __wrap_iter<pointer>;
@@ -232,16 +233,18 @@ public:
constexpr explicit span(_It __first, size_type __count)
: __data_{_VSTD::to_address(__first)} {
(void)__count;
- _LIBCPP_ASSERT(_Extent == __count, "size mismatch in span's constructor (iterator, len)");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(_Extent == __count, "size mismatch in span's constructor (iterator, len)");
}
template <__span_compatible_iterator<element_type> _It, __span_compatible_sentinel_for<_It> _End>
_LIBCPP_INLINE_VISIBILITY
constexpr explicit span(_It __first, _End __last) : __data_{_VSTD::to_address(__first)} {
- (void)__last;
- _LIBCPP_ASSERT((__last - __first >= 0), "invalid range in span's constructor (iterator, sentinel)");
- _LIBCPP_ASSERT(__last - __first == _Extent,
- "invalid range in span's constructor (iterator, sentinel): last - first != extent");
+ // [span.cons]/10
+ // Throws: When and what last - first throws.
+ [[maybe_unused]] auto __dist = __last - __first;
+ _LIBCPP_ASSERT_VALID_INPUT_RANGE(__dist >= 0, "invalid range in span's constructor (iterator, sentinel)");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
+ __dist == _Extent, "invalid range in span's constructor (iterator, sentinel): last - first != extent");
}
_LIBCPP_INLINE_VISIBILITY constexpr span(type_identity_t<element_type> (&__arr)[_Extent]) noexcept : __data_{__arr} {}
@@ -258,7 +261,8 @@ public:
template <__span_compatible_range<element_type> _Range>
_LIBCPP_INLINE_VISIBILITY
constexpr explicit span(_Range&& __r) : __data_{ranges::data(__r)} {
- _LIBCPP_ASSERT(ranges::size(__r) == _Extent, "size mismatch in span's constructor (range)");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
+ ranges::size(__r) == _Extent, "size mismatch in span's constructor (range)");
}
template <__span_array_convertible<element_type> _OtherElementType>
@@ -269,10 +273,10 @@ public:
template <__span_array_convertible<element_type> _OtherElementType>
_LIBCPP_INLINE_VISIBILITY
constexpr explicit span(const span<_OtherElementType, dynamic_extent>& __other) noexcept
- : __data_{__other.data()} { _LIBCPP_ASSERT(_Extent == __other.size(), "size mismatch in span's constructor (other span)"); }
-
-
-// ~span() noexcept = default;
+ : __data_{__other.data()} {
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
+ _Extent == __other.size(), "size mismatch in span's constructor (other span)");
+ }
template <size_t _Count>
_LIBCPP_INLINE_VISIBILITY
@@ -293,14 +297,14 @@ public:
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, dynamic_extent> first(size_type __count) const noexcept
{
- _LIBCPP_ASSERT(__count <= size(), "span<T, N>::first(count): count out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count <= size(), "span<T, N>::first(count): count out of range");
return {data(), __count};
}
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, dynamic_extent> last(size_type __count) const noexcept
{
- _LIBCPP_ASSERT(__count <= size(), "span<T, N>::last(count): count out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count <= size(), "span<T, N>::last(count): count out of range");
return {data() + size() - __count, __count};
}
@@ -321,11 +325,12 @@ public:
constexpr span<element_type, dynamic_extent>
subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept
{
- _LIBCPP_ASSERT(__offset <= size(), "span<T, N>::subspan(offset, count): offset out of range");
- _LIBCPP_ASSERT(__count <= size() || __count == dynamic_extent, "span<T, N>::subspan(offset, count): count out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
+ __offset <= size(), "span<T, N>::subspan(offset, count): offset out of range");
if (__count == dynamic_extent)
return {data() + __offset, size() - __offset};
- _LIBCPP_ASSERT(__count <= size() - __offset, "span<T, N>::subspan(offset, count): offset + count out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
+ __count <= size() - __offset, "span<T, N>::subspan(offset, count): offset + count out of range");
return {data() + __offset, __count};
}
@@ -335,19 +340,19 @@ public:
_LIBCPP_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept
{
- _LIBCPP_ASSERT(__idx < size(), "span<T, N>::operator[](index): index out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__idx < size(), "span<T, N>::operator[](index): index out of range");
return __data_[__idx];
}
_LIBCPP_INLINE_VISIBILITY constexpr reference front() const noexcept
{
- _LIBCPP_ASSERT(!empty(), "span<T, N>::front() on empty span");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T, N>::front() on empty span");
return __data_[0];
}
_LIBCPP_INLINE_VISIBILITY constexpr reference back() const noexcept
{
- _LIBCPP_ASSERT(!empty(), "span<T, N>::back() on empty span");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T, N>::back() on empty span");
return __data_[size()-1];
}
@@ -355,17 +360,17 @@ public:
// [span.iter], span iterator support
_LIBCPP_INLINE_VISIBILITY constexpr iterator begin() const noexcept {
-#ifdef _LIBCPP_DEBUG_ITERATOR_BOUNDS_CHECKING
+#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
return std::__make_bounded_iter(data(), data(), data() + size());
#else
- return iterator(this, data());
+ return iterator(data());
#endif
}
_LIBCPP_INLINE_VISIBILITY constexpr iterator end() const noexcept {
-#ifdef _LIBCPP_DEBUG_ITERATOR_BOUNDS_CHECKING
+#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
return std::__make_bounded_iter(data() + size(), data(), data() + size());
#else
- return iterator(this, data() + size());
+ return iterator(data() + size());
#endif
}
_LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator rbegin() const noexcept { return reverse_iterator(end()); }
@@ -394,7 +399,7 @@ public:
using const_pointer = const _Tp *;
using reference = _Tp &;
using const_reference = const _Tp &;
-#ifdef _LIBCPP_DEBUG_ITERATOR_BOUNDS_CHECKING
+#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
using iterator = __bounded_iter<pointer>;
#else
using iterator = __wrap_iter<pointer>;
@@ -417,7 +422,8 @@ public:
template <__span_compatible_iterator<element_type> _It, __span_compatible_sentinel_for<_It> _End>
_LIBCPP_INLINE_VISIBILITY constexpr span(_It __first, _End __last)
: __data_(_VSTD::to_address(__first)), __size_(__last - __first) {
- _LIBCPP_ASSERT(__last - __first >= 0, "invalid range in span's constructor (iterator, sentinel)");
+ _LIBCPP_ASSERT_VALID_INPUT_RANGE(
+ __last - __first >= 0, "invalid range in span's constructor (iterator, sentinel)");
}
template <size_t _Sz>
@@ -442,13 +448,11 @@ public:
constexpr span(const span<_OtherElementType, _OtherExtent>& __other) noexcept
: __data_{__other.data()}, __size_{__other.size()} {}
-// ~span() noexcept = default;
-
template <size_t _Count>
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, _Count> first() const noexcept
{
- _LIBCPP_ASSERT(_Count <= size(), "span<T>::first<Count>(): Count out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(_Count <= size(), "span<T>::first<Count>(): Count out of range");
return span<element_type, _Count>{data(), _Count};
}
@@ -456,21 +460,21 @@ public:
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, _Count> last() const noexcept
{
- _LIBCPP_ASSERT(_Count <= size(), "span<T>::last<Count>(): Count out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(_Count <= size(), "span<T>::last<Count>(): Count out of range");
return span<element_type, _Count>{data() + size() - _Count, _Count};
}
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, dynamic_extent> first(size_type __count) const noexcept
{
- _LIBCPP_ASSERT(__count <= size(), "span<T>::first(count): count out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count <= size(), "span<T>::first(count): count out of range");
return {data(), __count};
}
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, dynamic_extent> last (size_type __count) const noexcept
{
- _LIBCPP_ASSERT(__count <= size(), "span<T>::last(count): count out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count <= size(), "span<T>::last(count): count out of range");
return {data() + size() - __count, __count};
}
@@ -478,8 +482,10 @@ public:
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, _Count> subspan() const noexcept
{
- _LIBCPP_ASSERT(_Offset <= size(), "span<T>::subspan<Offset, Count>(): Offset out of range");
- _LIBCPP_ASSERT(_Count == dynamic_extent || _Count <= size() - _Offset, "span<T>::subspan<Offset, Count>(): Offset + Count out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
+ _Offset <= size(), "span<T>::subspan<Offset, Count>(): Offset out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(_Count == dynamic_extent || _Count <= size() - _Offset,
+ "span<T>::subspan<Offset, Count>(): Offset + Count out of range");
return span<element_type, _Count>{data() + _Offset, _Count == dynamic_extent ? size() - _Offset : _Count};
}
@@ -487,11 +493,11 @@ public:
_LIBCPP_INLINE_VISIBILITY
subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept
{
- _LIBCPP_ASSERT(__offset <= size(), "span<T>::subspan(offset, count): offset out of range");
- _LIBCPP_ASSERT(__count <= size() || __count == dynamic_extent, "span<T>::subspan(offset, count): count out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__offset <= size(), "span<T>::subspan(offset, count): offset out of range");
if (__count == dynamic_extent)
return {data() + __offset, size() - __offset};
- _LIBCPP_ASSERT(__count <= size() - __offset, "span<T>::subspan(offset, count): offset + count out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
+ __count <= size() - __offset, "span<T>::subspan(offset, count): offset + count out of range");
return {data() + __offset, __count};
}
@@ -501,19 +507,19 @@ public:
_LIBCPP_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept
{
- _LIBCPP_ASSERT(__idx < size(), "span<T>::operator[](index): index out of range");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__idx < size(), "span<T>::operator[](index): index out of range");
return __data_[__idx];
}
_LIBCPP_INLINE_VISIBILITY constexpr reference front() const noexcept
{
- _LIBCPP_ASSERT(!empty(), "span<T>::front() on empty span");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T>::front() on empty span");
return __data_[0];
}
_LIBCPP_INLINE_VISIBILITY constexpr reference back() const noexcept
{
- _LIBCPP_ASSERT(!empty(), "span<T>::back() on empty span");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T>::back() on empty span");
return __data_[size()-1];
}
@@ -522,17 +528,17 @@ public:
// [span.iter], span iterator support
_LIBCPP_INLINE_VISIBILITY constexpr iterator begin() const noexcept {
-#ifdef _LIBCPP_DEBUG_ITERATOR_BOUNDS_CHECKING
+#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
return std::__make_bounded_iter(data(), data(), data() + size());
#else
- return iterator(this, data());
+ return iterator(data());
#endif
}
_LIBCPP_INLINE_VISIBILITY constexpr iterator end() const noexcept {
-#ifdef _LIBCPP_DEBUG_ITERATOR_BOUNDS_CHECKING
+#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
return std::__make_bounded_iter(data() + size(), data(), data() + size());
#else
- return iterator(this, data() + size());
+ return iterator(data() + size());
#endif
}
_LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator rbegin() const noexcept { return reverse_iterator(end()); }
@@ -566,10 +572,10 @@ _LIBCPP_INLINE_VISIBILITY
auto as_writable_bytes(span<_Tp, _Extent> __s) noexcept
{ return __s.__as_writable_bytes(); }
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<contiguous_iterator _It, class _EndOrSize>
span(_It, _EndOrSize) -> span<remove_reference_t<iter_reference_t<_It>>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template<class _Tp, size_t _Sz>
span(_Tp (&)[_Sz]) -> span<_Tp, _Sz>;
@@ -583,7 +589,7 @@ template<class _Tp, size_t _Sz>
template<ranges::contiguous_range _Range>
span(_Range&&) -> span<remove_reference_t<ranges::range_reference_t<_Range>>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
@@ -593,6 +599,7 @@ _LIBCPP_POP_MACROS
# include <concepts>
# include <functional>
# include <iterator>
+# include <type_traits>
#endif
#endif // _LIBCPP_SPAN
diff --git a/contrib/libs/cxxsupp/libcxx/include/sstream b/contrib/libs/cxxsupp/libcxx/include/sstream
index 78cc28a5028..40930df24c6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/sstream
+++ b/contrib/libs/cxxsupp/libcxx/include/sstream
@@ -30,17 +30,41 @@ public:
explicit basic_stringbuf(ios_base::openmode which = ios_base::in | ios_base::out); // before C++20
basic_stringbuf() : basic_stringbuf(ios_base::in | ios_base::out) {} // C++20
explicit basic_stringbuf(ios_base::openmode which); // C++20
- explicit basic_stringbuf(const basic_string<char_type, traits_type, allocator_type>& str,
+ explicit basic_stringbuf(const basic_string<char_type, traits_type, allocator_type>& s,
ios_base::openmode which = ios_base::in | ios_base::out);
+ explicit basic_stringbuf(const allocator_type& a)
+ : basic_stringbuf(ios_base::in | ios_base::out, a) {} // C++20
+ basic_stringbuf(ios_base::openmode which, const allocator_type& a); // C++20
+ explicit basic_stringbuf(basic_string<char_type, traits_type, allocator_type>&& s,
+ ios_base::openmode which = ios_base::in | ios_base::out); // C++20
+ template <class SAlloc>
+ basic_stringbuf(const basic_string<char_type, traits_type, SAlloc>& s, const allocator_type& a)
+ : basic_stringbuf(s, ios_base::in | ios_base::out, a) {} // C++20
+ template <class SAlloc>
+ basic_stringbuf(const basic_string<char_type, traits_type, SAlloc>& s,
+ ios_base::openmode which, const allocator_type& a); // C++20
+ template <class SAlloc>
+ explicit basic_stringbuf(const basic_string<char_type, traits_type, SAlloc>& s,
+ ios_base::openmode which = ios_base::in | ios_base::out); // C++20
basic_stringbuf(basic_stringbuf&& rhs);
+ basic_stringbuf(basic_stringbuf&& rhs, const allocator_type& a); // C++20
// [stringbuf.assign] Assign and swap:
basic_stringbuf& operator=(basic_stringbuf&& rhs);
- void swap(basic_stringbuf& rhs);
+ void swap(basic_stringbuf& rhs) noexcept(see below); // conditionally noexcept since C++20
// [stringbuf.members] Member functions:
- basic_string<char_type, traits_type, allocator_type> str() const;
+ allocator_type get_allocator() const noexcept; // C++20
+ basic_string<char_type, traits_type, allocator_type> str() const; // before C++20
+ basic_string<char_type, traits_type, allocator_type> str() const &; // C++20
+ template <class SAlloc>
+ basic_string<char_type, traits_type, SAlloc> str(const SAlloc& sa) const; // C++20
+ basic_string<char_type, traits_type, allocator_type> str() &&; // C++20
+ basic_string_view<char_type, traits_type> view() const noexcept; // C++20
void str(const basic_string<char_type, traits_type, allocator_type>& s);
+ template <class SAlloc>
+ void str(const basic_string<char_type, traits_type, SAlloc>& s); // C++20
+ void str(basic_string<char_type, traits_type, allocator_type>&& s); // C++20
protected:
// [stringbuf.virtuals] Overridden virtual functions:
@@ -56,8 +80,8 @@ protected:
// [stringbuf.assign] non member swap
template <class charT, class traits, class Allocator>
- void swap(basic_stringbuf<charT, traits, Allocator>& x,
- basic_stringbuf<charT, traits, Allocator>& y);
+void swap(basic_stringbuf<charT, traits, Allocator>& x,
+ basic_stringbuf<charT, traits, Allocator>& y); // conditionally noexcept since C++20
typedef basic_stringbuf<char> stringbuf;
typedef basic_stringbuf<wchar_t> wstringbuf;
@@ -76,12 +100,23 @@ public:
typedef Allocator allocator_type;
// [istringstream.cons] Constructors:
- explicit basic_istringstream(ios_base::openmode which = ios_base::in); // before C++20
- basic_istringstream() : basic_istringstream(ios_base::in) {} // C++20
- explicit basic_istringstream(ios_base::openmode which); // C++20
-
- explicit basic_istringstream(const basic_string<char_type, traits_type,allocator_type>& str,
+ explicit basic_istringstream(ios_base::openmode which = ios_base::in); // before C++20
+ basic_istringstream() : basic_istringstream(ios_base::in) {} // C++20
+ explicit basic_istringstream(ios_base::openmode which); // C++20
+ explicit basic_istringstream(const basic_string<char_type, traits_type, allocator_type>& s,
ios_base::openmode which = ios_base::in);
+ basic_istringstream(ios_base::openmode which, const allocator_type& a); // C++20
+ explicit basic_istringstream(basic_string<char_type, traits_type, allocator_type>&& s,
+ ios_base::openmode which = ios_base::in); // C++20
+ template <class SAlloc>
+ basic_istringstream(const basic_string<char_type, traits_type, SAlloc>& s, const allocator_type& a)
+ : basic_istringstream(s, ios_base::in, a) {} // C++20
+ template <class SAlloc>
+ basic_istringstream(const basic_string<char_type, traits_type, SAlloc>& s,
+ ios_base::openmode which, const allocator_type& a); // C++20
+ template <class SAlloc>
+ explicit basic_istringstream(const basic_string<char_type, traits_type, SAlloc>& s,
+ ios_base::openmode which = ios_base::in); // C++20
basic_istringstream(basic_istringstream&& rhs);
// [istringstream.assign] Assign and swap:
@@ -90,13 +125,21 @@ public:
// [istringstream.members] Member functions:
basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
- basic_string<char_type, traits_type, allocator_type> str() const;
+ basic_string<char_type, traits_type, allocator_type> str() const; // before C++20
+ basic_string<char_type, traits_type, allocator_type> str() const &; // C++20
+ template <class SAlloc>
+ basic_string<char_type, traits_type, SAlloc> str(const SAlloc& sa) const; // C++20
+ basic_string<char_type, traits_type, allocator_type> str() &&; // C++20
+ basic_string_view<char_type, traits_type> view() const noexcept; // C++20
void str(const basic_string<char_type, traits_type, allocator_type>& s);
+ template <class SAlloc>
+ void str(const basic_string<char_type, traits_type, SAlloc>& s); // C++20
+ void str(basic_string<char_type, traits_type, allocator_type>&& s); // C++20
};
template <class charT, class traits, class Allocator>
- void swap(basic_istringstream<charT, traits, Allocator>& x,
- basic_istringstream<charT, traits, Allocator>& y);
+void swap(basic_istringstream<charT, traits, Allocator>& x,
+ basic_istringstream<charT, traits, Allocator>& y);
typedef basic_istringstream<char> istringstream;
typedef basic_istringstream<wchar_t> wistringstream;
@@ -116,12 +159,23 @@ public:
typedef Allocator allocator_type;
// [ostringstream.cons] Constructors:
- explicit basic_ostringstream(ios_base::openmode which = ios_base::out); // before C++20
- basic_ostringstream() : basic_ostringstream(ios_base::out) {} // C++20
- explicit basic_ostringstream(ios_base::openmode which); // C++20
-
- explicit basic_ostringstream(const basic_string<char_type, traits_type, allocator_type>& str,
+ explicit basic_ostringstream(ios_base::openmode which = ios_base::out); // before C++20
+ basic_ostringstream() : basic_ostringstream(ios_base::out) {} // C++20
+ explicit basic_ostringstream(ios_base::openmode which); // C++20
+ explicit basic_ostringstream(const basic_string<char_type, traits_type, allocator_type>& s,
ios_base::openmode which = ios_base::out);
+ basic_ostringstream(ios_base::openmode which, const allocator_type& a); // C++20
+ explicit basic_ostringstream(basic_string<char_type, traits_type, allocator_type>&& s,
+ ios_base::openmode which = ios_base::out); // C++20
+ template <class SAlloc>
+ basic_ostringstream(const basic_string<char_type, traits_type, SAlloc>& s, const allocator_type& a)
+ : basic_ostringstream(s, ios_base::out, a) {} // C++20
+ template <class SAlloc>
+ basic_ostringstream(const basic_string<char_type, traits_type, SAlloc>& s,
+ ios_base::openmode which, const allocator_type& a); // C++20
+ template <class SAlloc>
+ explicit basic_ostringstream(const basic_string<char_type, traits_type, SAlloc>& s,
+ ios_base::openmode which = ios_base::out); // C++20
basic_ostringstream(basic_ostringstream&& rhs);
// [ostringstream.assign] Assign and swap:
@@ -130,13 +184,21 @@ public:
// [ostringstream.members] Member functions:
basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
- basic_string<char_type, traits_type, allocator_type> str() const;
+ basic_string<char_type, traits_type, allocator_type> str() const; // before C++20
+ basic_string<char_type, traits_type, allocator_type> str() const &; // C++20
+ template <class SAlloc>
+ basic_string<char_type, traits_type, SAlloc> str(const SAlloc& sa) const; // C++20
+ basic_string<char_type, traits_type, allocator_type> str() &&; // C++20
+ basic_string_view<char_type, traits_type> view() const noexcept; // C++20
void str(const basic_string<char_type, traits_type, allocator_type>& s);
+ template <class SAlloc>
+ void str(const basic_string<char_type, traits_type, SAlloc>& s); // C++20
+ void str(basic_string<char_type, traits_type, allocator_type>&& s); // C++20
};
template <class charT, class traits, class Allocator>
- void swap(basic_ostringstream<charT, traits, Allocator>& x,
- basic_ostringstream<charT, traits, Allocator>& y);
+void swap(basic_ostringstream<charT, traits, Allocator>& x,
+ basic_ostringstream<charT, traits, Allocator>& y);
typedef basic_ostringstream<char> ostringstream;
typedef basic_ostringstream<wchar_t> wostringstream;
@@ -159,9 +221,20 @@ public:
explicit basic_stringstream(ios_base::openmode which = ios_base::out | ios_base::in); // before C++20
basic_stringstream() : basic_stringstream(ios_base::out | ios_base::in) {} // C++20
explicit basic_stringstream(ios_base::openmode which); // C++20
-
- explicit basic_stringstream(const basic_string<char_type, traits_type, allocator_type>& str,
- ios_base::openmode which = ios_base::out|ios_base::in);
+ explicit basic_stringstream(const basic_string<char_type, traits_type, allocator_type>& s,
+ ios_base::openmode which = ios_base::out | ios_base::in);
+ basic_stringstream(ios_base::openmode which, const allocator_type& a); // C++20
+ explicit basic_stringstream(basic_string<char_type, traits_type, allocator_type>&& s,
+ ios_base::openmode which = ios_base::out | ios_base::in); // C++20
+ template <class SAlloc>
+ basic_stringstream(const basic_string<char_type, traits_type, SAlloc>& s, const allocator_type& a)
+ : basic_stringstream(s, ios_base::out | ios_base::in, a) {} // C++20
+ template <class SAlloc>
+ basic_stringstream(const basic_string<char_type, traits_type, SAlloc>& s,
+ ios_base::openmode which, const allocator_type& a); // C++20
+ template <class SAlloc>
+ explicit basic_stringstream(const basic_string<char_type, traits_type, SAlloc>& s,
+ ios_base::openmode which = ios_base::out | ios_base::in); // C++20
basic_stringstream(basic_stringstream&& rhs);
// [stringstream.assign] Assign and swap:
@@ -170,13 +243,21 @@ public:
// [stringstream.members] Member functions:
basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
- basic_string<char_type, traits_type, allocator_type> str() const;
- void str(const basic_string<char_type, traits_type, allocator_type>& str);
+ basic_string<char_type, traits_type, allocator_type> str() const; // before C++20
+ basic_string<char_type, traits_type, allocator_type> str() const &; // C++20
+ template <class SAlloc>
+ basic_string<char_type, traits_type, SAlloc> str(const SAlloc& sa) const; // C++20
+ basic_string<char_type, traits_type, allocator_type> str() &&; // C++20
+ basic_string_view<char_type, traits_type> view() const noexcept; // C++20
+ void str(const basic_string<char_type, traits_type, allocator_type>& s);
+ template <class SAlloc>
+ void str(const basic_string<char_type, traits_type, SAlloc>& s); // C++20
+ void str(basic_string<char_type, traits_type, allocator_type>&& s); // C++20
};
template <class charT, class traits, class Allocator>
- void swap(basic_stringstream<charT, traits, Allocator>& x,
- basic_stringstream<charT, traits, Allocator>& y);
+void swap(basic_stringstream<charT, traits, Allocator>& x,
+ basic_stringstream<charT, traits, Allocator>& y);
typedef basic_stringstream<char> stringstream;
typedef basic_stringstream<wchar_t> wstringstream;
@@ -187,6 +268,7 @@ typedef basic_stringstream<wchar_t> wstringstream;
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
+#include <__fwd/sstream.h>
#include <__utility/swap.h>
#include <istream>
#include <ostream>
@@ -201,6 +283,14 @@ _LIBCPP_PUSH_MACROS
#include <__undef_macros>
+// TODO(LLVM-19): Remove this once we drop support for Clang 16,
+// which had this bug: https://github.com/llvm/llvm-project/issues/40363
+#ifdef _WIN32
+#define _LIBCPP_HIDE_FROM_ABI_SSTREAM _LIBCPP_ALWAYS_INLINE
+#else
+#define _LIBCPP_HIDE_FROM_ABI_SSTREAM _LIBCPP_HIDE_FROM_ABI
+#endif
+
_LIBCPP_BEGIN_NAMESPACE_STD
// Class template basic_stringbuf [stringbuf]
@@ -224,6 +314,8 @@ private:
string_type __str_;
mutable char_type* __hm_;
ios_base::openmode __mode_;
+ _LIBCPP_HIDE_FROM_ABI void __init_buf_ptrs();
+ _LIBCPP_HIDE_FROM_ABI void __move_init(basic_stringbuf&& __rhs);
public:
// [stringbuf.cons] constructors:
@@ -243,15 +335,110 @@ public:
str(__s);
}
- basic_stringbuf(basic_stringbuf&& __rhs);
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI explicit basic_stringbuf(const allocator_type& __a)
+ : basic_stringbuf(ios_base::in | ios_base::out, __a) {}
+
+ _LIBCPP_HIDE_FROM_ABI basic_stringbuf(ios_base::openmode __wch, const allocator_type& __a)
+ : __str_(__a), __hm_(nullptr), __mode_(__wch) {}
+
+ _LIBCPP_HIDE_FROM_ABI explicit basic_stringbuf(string_type&& __s,
+ ios_base::openmode __wch = ios_base::in | ios_base::out)
+ : __str_(std::move(__s)), __hm_(nullptr), __mode_(__wch) {
+ __init_buf_ptrs();
+ }
+
+ template <class _SAlloc>
+ _LIBCPP_HIDE_FROM_ABI
+ basic_stringbuf(const basic_string<char_type, traits_type, _SAlloc>& __s, const allocator_type& __a)
+ : basic_stringbuf(__s, ios_base::in | ios_base::out, __a) {}
+
+ template <class _SAlloc>
+ _LIBCPP_HIDE_FROM_ABI basic_stringbuf(
+ const basic_string<char_type, traits_type, _SAlloc>& __s, ios_base::openmode __wch, const allocator_type& __a)
+ : __str_(__s, __a), __hm_(nullptr), __mode_(__wch) {
+ __init_buf_ptrs();
+ }
+
+ template <class _SAlloc>
+ requires (!is_same_v<_SAlloc, allocator_type>)
+ _LIBCPP_HIDE_FROM_ABI explicit basic_stringbuf(const basic_string<char_type, traits_type, _SAlloc>& __s,
+ ios_base::openmode __wch = ios_base::in | ios_base::out)
+ : __str_(__s), __hm_(nullptr), __mode_(__wch) {
+ __init_buf_ptrs();
+ }
+#endif // _LIBCPP_STD_VER >= 20
+
+ basic_stringbuf(basic_stringbuf&& __rhs) : __mode_(__rhs.__mode_) { __move_init(std::move(__rhs)); }
+
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI basic_stringbuf(basic_stringbuf&& __rhs, const allocator_type& __a)
+ : basic_stringbuf(__rhs.__mode_, __a) {
+ __move_init(std::move(__rhs));
+ }
+#endif
// [stringbuf.assign] Assign and swap:
basic_stringbuf& operator=(basic_stringbuf&& __rhs);
- void swap(basic_stringbuf& __rhs);
+ void swap(basic_stringbuf& __rhs)
+#if _LIBCPP_STD_VER >= 20
+ noexcept(allocator_traits<allocator_type>::propagate_on_container_swap::value ||
+ allocator_traits<allocator_type>::is_always_equal::value)
+#endif
+ ;
// [stringbuf.members] Member functions:
+
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const noexcept { return __str_.get_allocator(); }
+#endif
+
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
string_type str() const;
- void str(const string_type& __s);
+#else
+ _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() const & { return str(__str_.get_allocator()); }
+
+ _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() && {
+ string_type __result;
+ const basic_string_view<_CharT, _Traits> __view = view();
+ if (!__view.empty()) {
+ auto __pos = __view.data() - __str_.data();
+ __result.assign(std::move(__str_), __pos, __view.size());
+ }
+ __str_.clear();
+ __init_buf_ptrs();
+ return __result;
+ }
+#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
+
+#if _LIBCPP_STD_VER >= 20
+ template <class _SAlloc>
+ requires __is_allocator<_SAlloc>::value
+ _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
+ return basic_string<_CharT, _Traits, _SAlloc>(view(), __sa);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept;
+#endif // _LIBCPP_STD_VER >= 20
+
+ void str(const string_type& __s) {
+ __str_ = __s;
+ __init_buf_ptrs();
+ }
+
+#if _LIBCPP_STD_VER >= 20
+ template <class _SAlloc>
+ requires (!is_same_v<_SAlloc, allocator_type>)
+ _LIBCPP_HIDE_FROM_ABI void str(const basic_string<char_type, traits_type, _SAlloc>& __s) {
+ __str_ = __s;
+ __init_buf_ptrs();
+ }
+
+ _LIBCPP_HIDE_FROM_ABI void str(string_type&& __s) {
+ __str_ = std::move(__s);
+ __init_buf_ptrs();
+ }
+#endif // _LIBCPP_STD_VER >= 20
protected:
// [stringbuf.virtuals] Overridden virtual functions:
@@ -268,9 +455,7 @@ protected:
};
template <class _CharT, class _Traits, class _Allocator>
-basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs)
- : __mode_(__rhs.__mode_)
-{
+_LIBCPP_HIDE_FROM_ABI void basic_stringbuf<_CharT, _Traits, _Allocator>::__move_init(basic_stringbuf&& __rhs) {
char_type* __p = const_cast<char_type*>(__rhs.__str_.data());
ptrdiff_t __binp = -1;
ptrdiff_t __ninp = -1;
@@ -359,6 +544,10 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
template <class _CharT, class _Traits, class _Allocator>
void
basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
+#if _LIBCPP_STD_VER >= 20
+ noexcept(allocator_traits<_Allocator>::propagate_on_container_swap::value ||
+ allocator_traits<_Allocator>::is_always_equal::value)
+#endif
{
char_type* __p = const_cast<char_type*>(__rhs.__str_.data());
ptrdiff_t __rbinp = -1;
@@ -438,49 +627,42 @@ inline _LIBCPP_INLINE_VISIBILITY
void
swap(basic_stringbuf<_CharT, _Traits, _Allocator>& __x,
basic_stringbuf<_CharT, _Traits, _Allocator>& __y)
+#if _LIBCPP_STD_VER >= 20
+ noexcept(noexcept(__x.swap(__y)))
+#endif
{
__x.swap(__y);
}
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>
-basic_stringbuf<_CharT, _Traits, _Allocator>::str() const
-{
- if (__mode_ & ios_base::out)
- {
+basic_stringbuf<_CharT, _Traits, _Allocator>::str() const {
+ if (__mode_ & ios_base::out) {
if (__hm_ < this->pptr())
__hm_ = this->pptr();
return string_type(this->pbase(), __hm_, __str_.get_allocator());
- }
- else if (__mode_ & ios_base::in)
+ } else if (__mode_ & ios_base::in)
return string_type(this->eback(), this->egptr(), __str_.get_allocator());
return string_type(__str_.get_allocator());
}
+#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
template <class _CharT, class _Traits, class _Allocator>
-void
-basic_stringbuf<_CharT, _Traits, _Allocator>::str(const string_type& __s)
-{
- __str_ = __s;
+_LIBCPP_HIDE_FROM_ABI void basic_stringbuf<_CharT, _Traits, _Allocator>::__init_buf_ptrs() {
__hm_ = nullptr;
- if (__mode_ & ios_base::in)
- {
- __hm_ = const_cast<char_type*>(__str_.data()) + __str_.size();
- this->setg(const_cast<char_type*>(__str_.data()),
- const_cast<char_type*>(__str_.data()),
- __hm_);
+ char_type* __data = const_cast<char_type*>(__str_.data());
+ typename string_type::size_type __sz = __str_.size();
+ if (__mode_ & ios_base::in) {
+ __hm_ = __data + __sz;
+ this->setg(__data, __data, __hm_);
}
- if (__mode_ & ios_base::out)
- {
- typename string_type::size_type __sz = __str_.size();
- __hm_ = const_cast<char_type*>(__str_.data()) + __sz;
+ if (__mode_ & ios_base::out) {
+ __hm_ = __data + __sz;
__str_.resize(__str_.capacity());
- this->setp(const_cast<char_type*>(__str_.data()),
- const_cast<char_type*>(__str_.data()) + __str_.size());
- if (__mode_ & (ios_base::app | ios_base::ate))
- {
- while (__sz > INT_MAX)
- {
+ this->setp(__data, __data + __str_.size());
+ if (__mode_ & (ios_base::app | ios_base::ate)) {
+ while (__sz > INT_MAX) {
this->pbump(INT_MAX);
__sz -= INT_MAX;
}
@@ -490,6 +672,20 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::str(const string_type& __s)
}
}
+#if _LIBCPP_STD_VER >= 20
+template <class _CharT, class _Traits, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI basic_string_view<_CharT, _Traits>
+basic_stringbuf<_CharT, _Traits, _Allocator>::view() const noexcept {
+ if (__mode_ & ios_base::out) {
+ if (__hm_ < this->pptr())
+ __hm_ = this->pptr();
+ return basic_string_view<_CharT, _Traits>(this->pbase(), __hm_);
+ } else if (__mode_ & ios_base::in)
+ return basic_string_view<_CharT, _Traits>(this->eback(), this->egptr());
+ return basic_string_view<_CharT, _Traits>();
+}
+#endif // _LIBCPP_STD_VER >= 20
+
template <class _CharT, class _Traits, class _Allocator>
typename basic_stringbuf<_CharT, _Traits, _Allocator>::int_type
basic_stringbuf<_CharT, _Traits, _Allocator>::underflow()
@@ -536,16 +732,16 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c)
{
if (!traits_type::eq_int_type(__c, traits_type::eof()))
{
- ptrdiff_t __ninp = this->gptr() - this->eback();
+ ptrdiff_t __ninp = this->gptr() - this->eback();
if (this->pptr() == this->epptr())
{
if (!(__mode_ & ios_base::out))
return traits_type::eof();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
- ptrdiff_t __nout = this->pptr() - this->pbase();
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ ptrdiff_t __nout = this->pptr() - this->pbase();
ptrdiff_t __hm = __hm_ - this->pbase();
__str_.push_back(char_type());
__str_.resize(__str_.capacity());
@@ -553,13 +749,13 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c)
this->setp(__p, __p + __str_.size());
this->__pbump(__nout);
__hm_ = this->pbase() + __hm;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
return traits_type::eof();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
__hm_ = _VSTD::max(this->pptr() + 1, __hm_);
if (__mode_ & ios_base::in)
@@ -619,7 +815,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off,
if (__wch & ios_base::out)
{
this->setp(this->pbase(), this->epptr());
- this->pbump(__noff);
+ this->__pbump(__noff);
}
return pos_type(__noff);
}
@@ -660,6 +856,28 @@ public:
, __sb_(__s, __wch | ios_base::in)
{ }
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI basic_istringstream(ios_base::openmode __wch, const _Allocator& __a)
+ : basic_istream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__wch | ios_base::in, __a) {}
+
+ _LIBCPP_HIDE_FROM_ABI explicit basic_istringstream(string_type&& __s, ios_base::openmode __wch = ios_base::in)
+ : basic_istream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(std::move(__s), __wch | ios_base::in) {}
+
+ template <class _SAlloc>
+ _LIBCPP_HIDE_FROM_ABI basic_istringstream(const basic_string<_CharT, _Traits, _SAlloc>& __s, const _Allocator& __a)
+ : basic_istringstream(__s, ios_base::in, __a) {}
+
+ template <class _SAlloc>
+ _LIBCPP_HIDE_FROM_ABI basic_istringstream(
+ const basic_string<_CharT, _Traits, _SAlloc>& __s, ios_base::openmode __wch, const _Allocator& __a)
+ : basic_istream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__s, __wch | ios_base::in, __a) {}
+
+ template <class _SAlloc>
+ _LIBCPP_HIDE_FROM_ABI explicit basic_istringstream(const basic_string<_CharT, _Traits, _SAlloc>& __s,
+ ios_base::openmode __wch = ios_base::in)
+ : basic_istream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__s, __wch | ios_base::in) {}
+#endif // _LIBCPP_STD_VER >= 20
+
_LIBCPP_INLINE_VISIBILITY
basic_istringstream(basic_istringstream&& __rhs)
: basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
@@ -685,14 +903,35 @@ public:
basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
}
- _LIBCPP_INLINE_VISIBILITY
- string_type str() const {
- return __sb_.str();
+
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
+ _LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); }
+#else
+ _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() const & { return __sb_.str(); }
+
+ _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() && { return std::move(__sb_).str(); }
+#endif
+
+#if _LIBCPP_STD_VER >= 20
+ template <class _SAlloc>
+ requires __is_allocator<_SAlloc>::value
+ _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
+ return __sb_.str(__sa);
}
- _LIBCPP_INLINE_VISIBILITY
- void str(const string_type& __s) {
+
+ _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept { return __sb_.view(); }
+#endif // _LIBCPP_STD_VER >= 20
+
+ _LIBCPP_HIDE_FROM_ABI void str(const string_type& __s) { __sb_.str(__s); }
+
+#if _LIBCPP_STD_VER >= 20
+ template <class _SAlloc>
+ _LIBCPP_HIDE_FROM_ABI void str(const basic_string<char_type, traits_type, _SAlloc>& __s) {
__sb_.str(__s);
}
+
+ _LIBCPP_HIDE_FROM_ABI void str(string_type&& __s) { __sb_.str(std::move(__s)); }
+#endif // _LIBCPP_STD_VER >= 20
};
template <class _CharT, class _Traits, class _Allocator>
@@ -740,6 +979,29 @@ public:
, __sb_(__s, __wch | ios_base::out)
{ }
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI basic_ostringstream(ios_base::openmode __wch, const _Allocator& __a)
+ : basic_ostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__wch | ios_base::out, __a) {}
+
+ _LIBCPP_HIDE_FROM_ABI explicit basic_ostringstream(string_type&& __s, ios_base::openmode __wch = ios_base::out)
+ : basic_ostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(std::move(__s), __wch | ios_base::out) {}
+
+ template <class _SAlloc>
+ _LIBCPP_HIDE_FROM_ABI basic_ostringstream(const basic_string<_CharT, _Traits, _SAlloc>& __s, const _Allocator& __a)
+ : basic_ostringstream(__s, ios_base::out, __a) {}
+
+ template <class _SAlloc>
+ _LIBCPP_HIDE_FROM_ABI basic_ostringstream(
+ const basic_string<_CharT, _Traits, _SAlloc>& __s, ios_base::openmode __wch, const _Allocator& __a)
+ : basic_ostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__s, __wch | ios_base::out, __a) {}
+
+ template <class _SAlloc>
+ requires (!is_same_v<_SAlloc, allocator_type>)
+ _LIBCPP_HIDE_FROM_ABI explicit basic_ostringstream(const basic_string<_CharT, _Traits, _SAlloc>& __s,
+ ios_base::openmode __wch = ios_base::out)
+ : basic_ostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__s, __wch | ios_base::out) {}
+#endif // _LIBCPP_STD_VER >= 20
+
_LIBCPP_INLINE_VISIBILITY
basic_ostringstream(basic_ostringstream&& __rhs)
: basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs))
@@ -766,14 +1028,35 @@ public:
basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
}
- _LIBCPP_INLINE_VISIBILITY
- string_type str() const {
- return __sb_.str();
+
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
+ _LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); }
+#else
+ _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() const & { return __sb_.str(); }
+
+ _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() && { return std::move(__sb_).str(); }
+#endif
+
+#if _LIBCPP_STD_VER >= 20
+ template <class _SAlloc>
+ requires __is_allocator<_SAlloc>::value
+ _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
+ return __sb_.str(__sa);
}
- _LIBCPP_INLINE_VISIBILITY
- void str(const string_type& __s) {
+
+ _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept { return __sb_.view(); }
+#endif // _LIBCPP_STD_VER >= 20
+
+ _LIBCPP_HIDE_FROM_ABI void str(const string_type& __s) { __sb_.str(__s); }
+
+#if _LIBCPP_STD_VER >= 20
+ template <class _SAlloc>
+ _LIBCPP_HIDE_FROM_ABI void str(const basic_string<char_type, traits_type, _SAlloc>& __s) {
__sb_.str(__s);
}
+
+ _LIBCPP_HIDE_FROM_ABI void str(string_type&& __s) { __sb_.str(std::move(__s)); }
+#endif // _LIBCPP_STD_VER >= 20
};
template <class _CharT, class _Traits, class _Allocator>
@@ -821,6 +1104,29 @@ public:
, __sb_(__s, __wch)
{ }
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI basic_stringstream(ios_base::openmode __wch, const _Allocator& __a)
+ : basic_iostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__wch, __a) {}
+
+ _LIBCPP_HIDE_FROM_ABI explicit basic_stringstream(string_type&& __s, ios_base::openmode __wch = ios_base::out | ios_base::in)
+ : basic_iostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(std::move(__s), __wch) {}
+
+ template <class _SAlloc>
+ _LIBCPP_HIDE_FROM_ABI basic_stringstream(const basic_string<_CharT, _Traits, _SAlloc>& __s, const _Allocator& __a)
+ : basic_stringstream(__s, ios_base::out | ios_base::in, __a) {}
+
+ template <class _SAlloc>
+ _LIBCPP_HIDE_FROM_ABI basic_stringstream(
+ const basic_string<_CharT, _Traits, _SAlloc>& __s, ios_base::openmode __wch, const _Allocator& __a)
+ : basic_iostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__s, __wch, __a) {}
+
+ template <class _SAlloc>
+ requires (!is_same_v<_SAlloc, allocator_type>)
+ _LIBCPP_HIDE_FROM_ABI explicit basic_stringstream(const basic_string<_CharT, _Traits, _SAlloc>& __s,
+ ios_base::openmode __wch = ios_base::out | ios_base::in)
+ : basic_iostream<_CharT, _Traits>(std::addressof(__sb_)), __sb_(__s, __wch) {}
+#endif // _LIBCPP_STD_VER >= 20
+
_LIBCPP_INLINE_VISIBILITY
basic_stringstream(basic_stringstream&& __rhs)
: basic_iostream<_CharT, _Traits>(_VSTD::move(__rhs))
@@ -846,14 +1152,35 @@ public:
basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
}
- _LIBCPP_INLINE_VISIBILITY
- string_type str() const {
- return __sb_.str();
+
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
+ _LIBCPP_HIDE_FROM_ABI string_type str() const { return __sb_.str(); }
+#else
+ _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() const & { return __sb_.str(); }
+
+ _LIBCPP_HIDE_FROM_ABI_SSTREAM string_type str() && { return std::move(__sb_).str(); }
+#endif
+
+#if _LIBCPP_STD_VER >= 20
+ template <class _SAlloc>
+ requires __is_allocator<_SAlloc>::value
+ _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
+ return __sb_.str(__sa);
}
- _LIBCPP_INLINE_VISIBILITY
- void str(const string_type& __s) {
+
+ _LIBCPP_HIDE_FROM_ABI basic_string_view<char_type, traits_type> view() const noexcept { return __sb_.view(); }
+#endif // _LIBCPP_STD_VER >= 20
+
+ _LIBCPP_HIDE_FROM_ABI void str(const string_type& __s) { __sb_.str(__s); }
+
+#if _LIBCPP_STD_VER >= 20
+ template <class _SAlloc>
+ _LIBCPP_HIDE_FROM_ABI void str(const basic_string<char_type, traits_type, _SAlloc>& __s) {
__sb_.str(__s);
}
+
+ _LIBCPP_HIDE_FROM_ABI void str(string_type&& __s) { __sb_.str(std::move(__s)); }
+#endif // _LIBCPP_STD_VER >= 20
};
template <class _CharT, class _Traits, class _Allocator>
diff --git a/contrib/libs/cxxsupp/libcxx/include/stack b/contrib/libs/cxxsupp/libcxx/include/stack
index d653d1bc7e4..437f57d76bd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/stack
+++ b/contrib/libs/cxxsupp/libcxx/include/stack
@@ -42,6 +42,7 @@ public:
explicit stack(const container_type& c);
explicit stack(container_type&& c);
template <class InputIterator> stack(InputIterator first, InputIterator last); // since C++23
+ template<container-compatible-range<T> R> stack(from_range_t, R&& rg); // since C++23
template <class Alloc> explicit stack(const Alloc& a);
template <class Alloc> stack(const container_type& c, const Alloc& a);
template <class Alloc> stack(container_type&& c, const Alloc& a);
@@ -49,6 +50,8 @@ public:
template <class Alloc> stack(stack&& c, const Alloc& a);
template<class InputIterator, class Alloc>
stack(InputIterator first, InputIterator last, const Alloc&); // since C++23
+ template<container-compatible-range<T> R, class Alloc>
+ stack(from_range_t, R&& rg, const Alloc&); // since C++23
bool empty() const;
size_type size() const;
@@ -57,6 +60,8 @@ public:
void push(const value_type& x);
void push(value_type&& x);
+ template<container-compatible-range<T> R>
+ void push_range(R&& rg); // C++23
template <class... Args> reference emplace(Args&&... args); // reference in C++17
void pop();
@@ -69,6 +74,9 @@ template<class Container>
template<class InputIterator>
stack(InputIterator, InputIterator) -> stack<iter-value-type<InputIterator>>; // since C++23
+template<ranges::input_range R>
+ stack(from_range_t, R&&) -> stack<ranges::range_value_t<R>>; // since C++23
+
template<class Container, class Allocator>
stack(Container, Allocator) -> stack<typename Container::value_type, Container>; // C++17
@@ -77,6 +85,10 @@ template<class InputIterator, class Allocator>
-> stack<iter-value-type<InputIterator>,
deque<iter-value-type<InputIterator>, Allocator>>; // since C++23
+template<ranges::input_range R, class Allocator>
+ stack(from_range_t, R&&, Allocator)
+ -> stack<ranges::range_value_t<R>, deque<ranges::range_value_t<R>, Allocator>>; // since C++23
+
template <class T, class Container>
bool operator==(const stack<T, Container>& x, const stack<T, Container>& y);
template <class T, class Container>
@@ -89,6 +101,9 @@ template <class T, class Container>
bool operator>=(const stack<T, Container>& x, const stack<T, Container>& y);
template <class T, class Container>
bool operator<=(const stack<T, Container>& x, const stack<T, Container>& y);
+template<class T, three_way_comparable Container>
+ compare_three_way_result_t<Container>
+ operator<=>(const stack<T, Container>& x, const stack<T, Container>& y); // since C++20
template <class T, class Container>
void swap(stack<T, Container>& x, stack<T, Container>& y)
@@ -98,13 +113,19 @@ template <class T, class Container>
*/
+#include <__algorithm/ranges_copy.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
+#include <__iterator/back_insert_iterator.h>
#include <__iterator/iterator_traits.h>
#include <__memory/uses_allocator.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/container_compatible_range.h>
+#include <__ranges/from_range.h>
+#include <__type_traits/is_same.h>
#include <__utility/forward.h>
#include <deque>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -204,18 +225,30 @@ public:
: c(_VSTD::move(__s.c), __a) {}
#endif // _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _InputIterator,
- class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
+ class = __enable_if_t<__has_input_iterator_category<_InputIterator>::value>>
_LIBCPP_HIDE_FROM_ABI
stack(_InputIterator __first, _InputIterator __last) : c(__first, __last) {}
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ stack(from_range_t, _Range&& __range) : c(from_range, std::forward<_Range>(__range)) {}
+
template <class _InputIterator,
class _Alloc,
- class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = __enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = __enable_if_t<uses_allocator<container_type, _Alloc>::value>>
_LIBCPP_HIDE_FROM_ABI
stack(_InputIterator __first, _InputIterator __last, const _Alloc& __alloc) : c(__first, __last, __alloc) {}
+
+ template <_ContainerCompatibleRange<_Tp> _Range,
+ class _Alloc,
+ class = __enable_if_t<uses_allocator<container_type, _Alloc>::value>>
+ _LIBCPP_HIDE_FROM_ABI
+ stack(from_range_t, _Range&& __range, const _Alloc& __alloc)
+ : c(from_range, std::forward<_Range>(__range), __alloc) {}
+
#endif
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
@@ -233,9 +266,23 @@ public:
_LIBCPP_INLINE_VISIBILITY
void push(value_type&& __v) {c.push_back(_VSTD::move(__v));}
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void push_range(_Range&& __range) {
+ if constexpr (requires (container_type& __c) {
+ __c.append_range(std::forward<_Range>(__range));
+ }) {
+ c.append_range(std::forward<_Range>(__range));
+ } else {
+ ranges::copy(std::forward<_Range>(__range), std::back_inserter(c));
+ }
+ }
+#endif
+
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
decltype(auto) emplace(_Args&&... __args)
{ return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
#else
@@ -257,18 +304,18 @@ public:
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI const _Container& __get_container() const { return c; }
- template <class T1, class _C1>
+ template <class _T1, class _OtherContainer>
friend
bool
- operator==(const stack<T1, _C1>& __x, const stack<T1, _C1>& __y);
+ operator==(const stack<_T1, _OtherContainer>& __x, const stack<_T1, _OtherContainer>& __y);
- template <class T1, class _C1>
+ template <class _T1, class _OtherContainer>
friend
bool
- operator< (const stack<T1, _C1>& __x, const stack<T1, _C1>& __y);
+ operator< (const stack<_T1, _OtherContainer>& __x, const stack<_T1, _OtherContainer>& __y);
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Container,
class = enable_if_t<!__is_allocator<_Container>::value>
>
@@ -284,18 +331,28 @@ stack(_Container, _Alloc)
-> stack<typename _Container::value_type, _Container>;
#endif
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template<class _InputIterator,
- class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
+ class = __enable_if_t<__has_input_iterator_category<_InputIterator>::value>>
stack(_InputIterator, _InputIterator)
-> stack<__iter_value_type<_InputIterator>>;
+template <ranges::input_range _Range>
+stack(from_range_t, _Range&&) -> stack<ranges::range_value_t<_Range>>;
+
template<class _InputIterator,
class _Alloc,
- class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = __enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = __enable_if_t<__is_allocator<_Alloc>::value>>
stack(_InputIterator, _InputIterator, _Alloc)
-> stack<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>;
+
+template <ranges::input_range _Range,
+ class _Alloc,
+ class = __enable_if_t<__is_allocator<_Alloc>::value>>
+stack(from_range_t, _Range&&, _Alloc)
+ -> stack<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>;
+
#endif
template <class _Tp, class _Container>
@@ -346,6 +403,17 @@ operator<=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
return !(__y < __x);
}
+#if _LIBCPP_STD_VER >= 20
+
+template <class _Tp, three_way_comparable _Container>
+_LIBCPP_HIDE_FROM_ABI compare_three_way_result_t<_Container>
+operator<=>(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) {
+ // clang 16 bug: declaring `friend operator<=>` causes "use of overloaded operator '*' is ambiguous" errors
+ return __x.__get_container() <=> __y.__get_container();
+}
+
+#endif
+
template <class _Tp, class _Container>
inline _LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_swappable<_Container>::value, void>
@@ -366,6 +434,7 @@ _LIBCPP_END_NAMESPACE_STD
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <functional>
+# include <type_traits>
#endif
#endif // _LIBCPP_STACK
diff --git a/contrib/libs/cxxsupp/libcxx/include/stdexcept b/contrib/libs/cxxsupp/libcxx/include/stdexcept
index 68de6ced174..5428535a102 100644
--- a/contrib/libs/cxxsupp/libcxx/include/stdexcept
+++ b/contrib/libs/cxxsupp/libcxx/include/stdexcept
@@ -43,8 +43,8 @@ public:
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
-#include <cstdlib>
-#include <exception>
+#include <__exception/exception.h>
+#include <__verbose_abort>
#include <iosfwd> // for string forward decl
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -65,7 +65,7 @@ public:
__libcpp_refstring& operator=(const __libcpp_refstring& __s) _NOEXCEPT;
~__libcpp_refstring();
- const char* c_str() const _NOEXCEPT {return __imp_;}
+ _LIBCPP_HIDE_FROM_ABI const char* c_str() const _NOEXCEPT {return __imp_;}
};
#endif // !_LIBCPP_ABI_VCRUNTIME
@@ -74,7 +74,7 @@ _LIBCPP_END_NAMESPACE_STD
namespace std // purposefully not using versioning namespace
{
-class _LIBCPP_EXCEPTION_ABI logic_error
+class _LIBCPP_EXPORTED_FROM_ABI logic_error
: public exception
{
#ifndef _LIBCPP_ABI_VCRUNTIME
@@ -97,7 +97,7 @@ public:
#endif
};
-class _LIBCPP_EXCEPTION_ABI runtime_error
+class _LIBCPP_EXPORTED_FROM_ABI runtime_error
: public exception
{
#ifndef _LIBCPP_ABI_VCRUNTIME
@@ -120,7 +120,7 @@ public:
#endif // _LIBCPP_ABI_VCRUNTIME
};
-class _LIBCPP_EXCEPTION_ABI domain_error
+class _LIBCPP_EXPORTED_FROM_ABI domain_error
: public logic_error
{
public:
@@ -128,12 +128,12 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit domain_error(const char* __s) : logic_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- domain_error(const domain_error&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI domain_error(const domain_error&) _NOEXCEPT = default;
~domain_error() _NOEXCEPT override;
#endif
};
-class _LIBCPP_EXCEPTION_ABI invalid_argument
+class _LIBCPP_EXPORTED_FROM_ABI invalid_argument
: public logic_error
{
public:
@@ -141,24 +141,24 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const char* __s) : logic_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- invalid_argument(const invalid_argument&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI invalid_argument(const invalid_argument&) _NOEXCEPT = default;
~invalid_argument() _NOEXCEPT override;
#endif
};
-class _LIBCPP_EXCEPTION_ABI length_error
+class _LIBCPP_EXPORTED_FROM_ABI length_error
: public logic_error
{
public:
_LIBCPP_INLINE_VISIBILITY explicit length_error(const string& __s) : logic_error(__s) {}
_LIBCPP_INLINE_VISIBILITY explicit length_error(const char* __s) : logic_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- length_error(const length_error&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI length_error(const length_error&) _NOEXCEPT = default;
~length_error() _NOEXCEPT override;
#endif
};
-class _LIBCPP_EXCEPTION_ABI out_of_range
+class _LIBCPP_EXPORTED_FROM_ABI out_of_range
: public logic_error
{
public:
@@ -166,12 +166,12 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit out_of_range(const char* __s) : logic_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- out_of_range(const out_of_range&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI out_of_range(const out_of_range&) _NOEXCEPT = default;
~out_of_range() _NOEXCEPT override;
#endif
};
-class _LIBCPP_EXCEPTION_ABI range_error
+class _LIBCPP_EXPORTED_FROM_ABI range_error
: public runtime_error
{
public:
@@ -179,12 +179,12 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit range_error(const char* __s) : runtime_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- range_error(const range_error&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI range_error(const range_error&) _NOEXCEPT = default;
~range_error() _NOEXCEPT override;
#endif
};
-class _LIBCPP_EXCEPTION_ABI overflow_error
+class _LIBCPP_EXPORTED_FROM_ABI overflow_error
: public runtime_error
{
public:
@@ -192,12 +192,12 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit overflow_error(const char* __s) : runtime_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- overflow_error(const overflow_error&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI overflow_error(const overflow_error&) _NOEXCEPT = default;
~overflow_error() _NOEXCEPT override;
#endif
};
-class _LIBCPP_EXCEPTION_ABI underflow_error
+class _LIBCPP_EXPORTED_FROM_ABI underflow_error
: public runtime_error
{
public:
@@ -205,7 +205,7 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit underflow_error(const char* __s) : runtime_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- underflow_error(const underflow_error&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI underflow_error(const underflow_error&) _NOEXCEPT = default;
~underflow_error() _NOEXCEPT override;
#endif
};
@@ -215,96 +215,93 @@ public:
_LIBCPP_BEGIN_NAMESPACE_STD
// in the dylib
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);
+_LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void __throw_runtime_error(const char*);
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_logic_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw logic_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("logic_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_domain_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw domain_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("domain_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_invalid_argument(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw invalid_argument(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("invalid_argument was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_length_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw length_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("length_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_out_of_range(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw out_of_range(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("out_of_range was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_range_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw range_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("range_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_overflow_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw overflow_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("overflow_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_underflow_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw underflow_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("underflow_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdlib>
+# include <exception>
+#endif
+
#endif // _LIBCPP_STDEXCEPT
diff --git a/contrib/libs/cxxsupp/libcxx/include/stdlib.h b/contrib/libs/cxxsupp/libcxx/include/stdlib.h
index 4dd3a9c14ab..614e3730c2f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/stdlib.h
+++ b/contrib/libs/cxxsupp/libcxx/include/stdlib.h
@@ -109,16 +109,15 @@ extern "C++" {
#endif
// MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined
-#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__)
+#if !defined(_LIBCPP_MSVCRT)
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT {
return __builtin_labs(__x);
}
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {
return __builtin_llabs(__x);
}
-#endif // !defined(_LIBCPP_MSVCRT) && !defined(__sun__)
+#endif // !defined(_LIBCPP_MSVCRT)
-#if !defined(__sun__)
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY float abs(float __lcpp_x) _NOEXCEPT {
return __builtin_fabsf(__lcpp_x); // Use builtins to prevent needing math.h
}
@@ -131,7 +130,6 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY long double
abs(long double __lcpp_x) _NOEXCEPT {
return __builtin_fabsl(__lcpp_x);
}
-#endif // !defined(__sun__)
// div
@@ -146,7 +144,7 @@ abs(long double __lcpp_x) _NOEXCEPT {
#endif
// MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined
-#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__)
+#if !defined(_LIBCPP_MSVCRT)
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
return ::ldiv(__x, __y);
}
@@ -156,7 +154,7 @@ inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x,
return ::lldiv(__x, __y);
}
#endif
-#endif // _LIBCPP_MSVCRT / __sun__
+#endif // _LIBCPP_MSVCRT
} // extern "C++"
#endif // __cplusplus
diff --git a/contrib/libs/cxxsupp/libcxx/include/streambuf b/contrib/libs/cxxsupp/libcxx/include/streambuf
index d473df10347..095ac7d3ad8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/streambuf
+++ b/contrib/libs/cxxsupp/libcxx/include/streambuf
@@ -109,6 +109,7 @@ protected:
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
+#include <__fwd/streambuf.h>
#include <cstdint>
#include <ios>
#include <iosfwd>
@@ -489,11 +490,9 @@ basic_streambuf<_CharT, _Traits>::overflow(int_type)
}
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/include/string b/contrib/libs/cxxsupp/libcxx/include/string
index 7ad144a79e1..30bca6b92eb 100644
--- a/contrib/libs/cxxsupp/libcxx/include/string
+++ b/contrib/libs/cxxsupp/libcxx/include/string
@@ -119,11 +119,13 @@ public:
explicit basic_string(const T& t, const Allocator& a = Allocator()); // C++17, constexpr since C++20
basic_string(const value_type* s, const allocator_type& a = allocator_type()); // constexpr since C++20
basic_string(const value_type* s, size_type n, const allocator_type& a = allocator_type()); // constexpr since C++20
- basic_string(nullptr_t) = delete; // C++2b
+ basic_string(nullptr_t) = delete; // C++23
basic_string(size_type n, value_type c, const allocator_type& a = allocator_type()); // constexpr since C++20
template<class InputIterator>
basic_string(InputIterator begin, InputIterator end,
const allocator_type& a = allocator_type()); // constexpr since C++20
+ template<container-compatible-range<charT> R>
+ constexpr basic_string(from_range_t, R&& rg, const Allocator& a = Allocator()); // since C++23
basic_string(initializer_list<value_type>, const Allocator& = Allocator()); // constexpr since C++20
basic_string(const basic_string&, const Allocator&); // constexpr since C++20
basic_string(basic_string&&, const Allocator&); // constexpr since C++20
@@ -140,7 +142,7 @@ public:
allocator_type::propagate_on_container_move_assignment::value ||
allocator_type::is_always_equal::value ); // C++17, constexpr since C++20
basic_string& operator=(const value_type* s); // constexpr since C++20
- basic_string& operator=(nullptr_t) = delete; // C++2b
+ basic_string& operator=(nullptr_t) = delete; // C++23
basic_string& operator=(value_type c); // constexpr since C++20
basic_string& operator=(initializer_list<value_type>); // constexpr since C++20
@@ -200,6 +202,8 @@ public:
basic_string& append(size_type n, value_type c); // constexpr since C++20
template<class InputIterator>
basic_string& append(InputIterator first, InputIterator last); // constexpr since C++20
+ template<container-compatible-range<charT> R>
+ constexpr basic_string& append_range(R&& rg); // C++23
basic_string& append(initializer_list<value_type>); // constexpr since C++20
void push_back(value_type c); // constexpr since C++20
@@ -221,6 +225,8 @@ public:
basic_string& assign(size_type n, value_type c); // constexpr since C++20
template<class InputIterator>
basic_string& assign(InputIterator first, InputIterator last); // constexpr since C++20
+ template<container-compatible-range<charT> R>
+ constexpr basic_string& assign_range(R&& rg); // C++23
basic_string& assign(initializer_list<value_type>); // constexpr since C++20
basic_string& insert(size_type pos1, const basic_string& str); // constexpr since C++20
@@ -237,6 +243,8 @@ public:
iterator insert(const_iterator p, size_type n, value_type c); // constexpr since C++20
template<class InputIterator>
iterator insert(const_iterator p, InputIterator first, InputIterator last); // constexpr since C++20
+ template<container-compatible-range<charT> R>
+ constexpr iterator insert_range(const_iterator p, R&& rg); // C++23
iterator insert(const_iterator p, initializer_list<value_type>); // constexpr since C++20
basic_string& erase(size_type pos = 0, size_type n = npos); // constexpr since C++20
@@ -262,6 +270,8 @@ public:
basic_string& replace(const_iterator i1, const_iterator i2, size_type n, value_type c); // constexpr since C++20
template<class InputIterator>
basic_string& replace(const_iterator i1, const_iterator i2, InputIterator j1, InputIterator j2); // constexpr since C++20
+ template<container-compatible-range<charT> R>
+ constexpr basic_string& replace_with_range(const_iterator i1, const_iterator i2, R&& rg); // C++23
basic_string& replace(const_iterator i1, const_iterator i2, initializer_list<value_type>); // constexpr since C++20
size_type copy(value_type* s, size_type n, size_type pos = 0) const; // constexpr since C++20
@@ -342,9 +352,9 @@ public:
constexpr bool ends_with(charT c) const noexcept; // C++20
constexpr bool ends_with(const charT* s) const; // C++20
- constexpr bool contains(basic_string_view<charT, traits> sv) const noexcept; // C++2b
- constexpr bool contains(charT c) const noexcept; // C++2b
- constexpr bool contains(const charT* s) const; // C++2b
+ constexpr bool contains(basic_string_view<charT, traits> sv) const noexcept; // C++23
+ constexpr bool contains(charT c) const noexcept; // C++23
+ constexpr bool contains(const charT* s) const; // C++23
};
template<class InputIterator,
@@ -354,6 +364,26 @@ basic_string(InputIterator, InputIterator, Allocator = Allocator())
char_traits<typename iterator_traits<InputIterator>::value_type>,
Allocator>; // C++17
+template<ranges::input_range R,
+ class Allocator = allocator<ranges::range_value_t<R>>>
+ basic_string(from_range_t, R&&, Allocator = Allocator())
+ -> basic_string<ranges::range_value_t<R>, char_traits<ranges::range_value_t<R>>,
+ Allocator>; // C++23
+
+template<class charT,
+ class traits,
+ class Allocator = allocator<charT>>
+ explicit basic_string(basic_string_view<charT, traits>, const Allocator& = Allocator())
+ -> basic_string<charT, traits, Allocator>; // C++17
+
+template<class charT,
+ class traits,
+ class Allocator = allocator<charT>>
+ basic_string(basic_string_view<charT, traits>,
+ typename see below::size_type, typename see below::size_type,
+ const Allocator& = Allocator())
+ -> basic_string<charT, traits, Allocator>; // C++17
+
template<class charT, class traits, class Allocator>
basic_string<charT, traits, Allocator>
operator+(const basic_string<charT, traits, Allocator>& lhs,
@@ -524,11 +554,11 @@ template <> struct hash<u16string>;
template <> struct hash<u32string>;
template <> struct hash<wstring>;
-basic_string<char> operator "" s( const char *str, size_t len ); // C++14, constexpr since C++20
-basic_string<wchar_t> operator "" s( const wchar_t *str, size_t len ); // C++14, constexpr since C++20
-constexpr basic_string<char8_t> operator "" s( const char8_t *str, size_t len ); // C++20
-basic_string<char16_t> operator "" s( const char16_t *str, size_t len ); // C++14, constexpr since C++20
-basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++14, constexpr since C++20
+basic_string<char> operator""s( const char *str, size_t len ); // C++14, constexpr since C++20
+basic_string<wchar_t> operator""s( const wchar_t *str, size_t len ); // C++14, constexpr since C++20
+constexpr basic_string<char8_t> operator""s( const char8_t *str, size_t len ); // C++20
+basic_string<char16_t> operator""s( const char16_t *str, size_t len ); // C++14, constexpr since C++20
+basic_string<char32_t> operator""s( const char32_t *str, size_t len ); // C++14, constexpr since C++20
} // std
@@ -540,7 +570,6 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
#include <__algorithm/remove_if.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
-#include <__debug>
#include <__format/enable_insertable.h>
#include <__functional/hash.h>
#include <__functional/unary_function.h>
@@ -550,6 +579,7 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
#include <__iterator/iterator_traits.h>
#include <__iterator/reverse_iterator.h>
#include <__iterator/wrap_iter.h>
+#include <__memory/addressof.h>
#include <__memory/allocate_at_least.h>
#include <__memory/allocator.h>
#include <__memory/allocator_traits.h>
@@ -558,23 +588,38 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
#include <__memory/pointer_traits.h>
#include <__memory/swap_allocator.h>
#include <__memory_resource/polymorphic_allocator.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/container_compatible_range.h>
+#include <__ranges/from_range.h>
+#include <__ranges/size.h>
#include <__string/char_traits.h>
#include <__string/extern_template_lists.h>
#include <__type_traits/is_allocator.h>
+#include <__type_traits/is_array.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_standard_layout.h>
+#include <__type_traits/is_trivial.h>
#include <__type_traits/noexcept_move_assign_container.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/void_t.h>
#include <__utility/auto_cast.h>
+#include <__utility/declval.h>
+#include <__utility/forward.h>
+#include <__utility/is_pointer_in_range.h>
#include <__utility/move.h>
#include <__utility/swap.h>
#include <__utility/unreachable.h>
#include <climits>
#include <cstdint>
#include <cstdio> // EOF
-#include <cstdlib>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <string_view>
-#include <type_traits>
#include <version>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -632,7 +677,8 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string<_CharT, _Traits, _Allocator>
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y);
-extern template _LIBCPP_FUNC_VIS string operator+<char, char_traits<char>, allocator<char> >(char const*, string const&);
+extern template _LIBCPP_EXPORTED_FROM_ABI string operator+
+ <char, char_traits<char>, allocator<char> >(char const*, string const&);
template <class _Iter>
struct __string_is_trivial_iterator : public false_type {};
@@ -652,6 +698,7 @@ struct __can_be_converted_to_string_view : public _BoolConstant<
> {};
struct __uninitialized_size_tag {};
+struct __init_with_sentinel_tag {};
template<class _CharT, class _Traits, class _Allocator>
class basic_string
@@ -816,15 +863,21 @@ private:
__set_long_pointer(__allocation);
__set_long_size(__size);
}
- std::__debug_db_insert_c(this);
+ }
+
+ template <class _Iter, class _Sent>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ basic_string(__init_with_sentinel_tag, _Iter __first, _Sent __last, const allocator_type& __a)
+ : __r_(__default_init_tag(), __a) {
+ __init_with_sentinel(std::move(__first), std::move(__last));
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator __make_iterator(pointer __p) {
- return iterator(this, __p);
+ return iterator(__p);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator __make_const_iterator(const_pointer __p) const {
- return const_iterator(this, __p);
+ return const_iterator(__p);
}
public:
@@ -833,7 +886,6 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string()
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
: __r_(__default_init_tag(), __default_init_tag()) {
- std::__debug_db_insert_c(this);
__default_init();
}
@@ -844,12 +896,24 @@ public:
_NOEXCEPT
#endif
: __r_(__default_init_tag(), __a) {
- std::__debug_db_insert_c(this);
__default_init();
}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const basic_string& __str);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const basic_string& __str, const allocator_type& __a);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const basic_string& __str)
+ : __r_(__default_init_tag(), __alloc_traits::select_on_container_copy_construction(__str.__alloc())) {
+ if (!__str.__is_long())
+ __r_.first() = __str.__r_.first();
+ else
+ __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()), __str.__get_long_size());
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const basic_string& __str, const allocator_type& __a)
+ : __r_(__default_init_tag(), __a) {
+ if (!__str.__is_long())
+ __r_.first() = __str.__r_.first();
+ else
+ __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()), __str.__get_long_size());
+ }
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(basic_string&& __str)
@@ -860,9 +924,6 @@ public:
# endif
: __r_(std::move(__str.__r_)) {
__str.__default_init();
- std::__debug_db_insert_c(this);
- if (__is_long())
- std::__debug_db_swap(this, &__str);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(basic_string&& __str, const allocator_type& __a)
@@ -875,24 +936,24 @@ public:
__r_.first() = __str.__r_.first();
__str.__default_init();
}
- std::__debug_db_insert_c(this);
- if (__is_long())
- std::__debug_db_swap(this, &__str);
}
#endif // _LIBCPP_CXX03_LANG
- template <class = __enable_if_t<__is_allocator<_Allocator>::value, nullptr_t> >
+ template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s)
: __r_(__default_init_tag(), __default_init_tag()) {
- _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "basic_string(const char*) detected nullptr");
__init(__s, traits_type::length(__s));
- std::__debug_db_insert_c(this);
}
- template <class = __enable_if_t<__is_allocator<_Allocator>::value, nullptr_t> >
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, const _Allocator& __a);
+ template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, const _Allocator& __a)
+ : __r_(__default_init_tag(), __a) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
+ __init(__s, traits_type::length(__s));
+ }
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
basic_string(nullptr_t) = delete;
#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -900,9 +961,8 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n)
: __r_(__default_init_tag(), __default_init_tag()) {
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
__init(__s, __n);
- std::__debug_db_insert_c(this);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -911,18 +971,17 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string(const _CharT* __s, size_type __n, const _Allocator& __a)
: __r_(__default_init_tag(), __a) {
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr,
+ "basic_string(const char*, n, allocator) detected nullptr");
__init(__s, __n);
- std::__debug_db_insert_c(this);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c)
: __r_(__default_init_tag(), __default_init_tag()) {
__init(__n, __c);
- std::__debug_db_insert_c(this);
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr
basic_string(basic_string&& __str, size_type __pos, const _Allocator& __alloc = _Allocator())
: basic_string(std::move(__str), __pos, npos, __alloc) {}
@@ -945,18 +1004,23 @@ public:
// Perform a copy because the allocators are not compatible.
__init(__str.data() + __pos, __len);
}
-
- std::__debug_db_insert_c(this);
- if (__is_long())
- std::__debug_db_swap(this, &__str);
}
#endif
- template <class = __enable_if_t<__is_allocator<_Allocator>::value, nullptr_t> >
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a);
+ template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a)
+ : __r_(__default_init_tag(), __a) {
+ __init(__n, __c);
+ }
_LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Allocator& __a = _Allocator());
+ basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Allocator& __a = _Allocator())
+ : __r_(__default_init_tag(), __a) {
+ size_type __str_sz = __str.size();
+ if (__pos > __str_sz)
+ __throw_out_of_range();
+ __init(__str.data() + __pos, std::min(__n, __str_sz - __pos));
+ }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string(const basic_string& __str, size_type __pos, const _Allocator& __a = _Allocator())
@@ -965,67 +1029,91 @@ public:
if (__pos > __str_sz)
__throw_out_of_range();
__init(__str.data() + __pos, __str_sz - __pos);
- std::__debug_db_insert_c(this);
}
template <class _Tp,
- class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
- !__is_same_uncvref<_Tp, basic_string>::value> >
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string(const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a = allocator_type());
+ basic_string(const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a = allocator_type())
+ : __r_(__default_init_tag(), __a) {
+ __self_view __sv0 = __t;
+ __self_view __sv = __sv0.substr(__pos, __n);
+ __init(__sv.data(), __sv.size());
+ }
template <class _Tp,
- class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
- !__is_same_uncvref<_Tp, basic_string>::value> >
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(
- const _Tp& __t);
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t)
+ : __r_(__default_init_tag(), __default_init_tag()) {
+ __self_view __sv = __t;
+ __init(__sv.data(), __sv.size());
+ }
template <class _Tp,
- class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
- !__is_same_uncvref<_Tp, basic_string>::value> >
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(
- const _Tp& __t, const allocator_type& __a);
+ const _Tp& __t, const allocator_type& __a)
+ : __r_(__default_init_tag(), __a) {
+ __self_view __sv = __t;
+ __init(__sv.data(), __sv.size());
+ }
- template <class _InputIterator, class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value> >
+ template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(_InputIterator __first, _InputIterator __last)
: __r_(__default_init_tag(), __default_init_tag()) {
__init(__first, __last);
- std::__debug_db_insert_c(this);
}
- template <class _InputIterator, class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value> >
+ template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a)
: __r_(__default_init_tag(), __a) {
__init(__first, __last);
- std::__debug_db_insert_c(this);
}
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_CharT> _Range>
+ _LIBCPP_HIDE_FROM_ABI constexpr
+ basic_string(from_range_t, _Range&& __range, const allocator_type& __a = allocator_type())
+ : __r_(__default_init_tag(), __a) {
+ if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
+ __init_with_size(ranges::begin(__range), ranges::end(__range), ranges::distance(__range));
+ } else {
+ __init_with_sentinel(ranges::begin(__range), ranges::end(__range));
+ }
+ }
+#endif
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(initializer_list<_CharT> __il)
: __r_(__default_init_tag(), __default_init_tag()) {
__init(__il.begin(), __il.end());
- std::__debug_db_insert_c(this);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(initializer_list<_CharT> __il, const _Allocator& __a)
: __r_(__default_init_tag(), __a) {
__init(__il.begin(), __il.end());
- std::__debug_db_insert_c(this);
}
#endif // _LIBCPP_CXX03_LANG
- inline _LIBCPP_CONSTEXPR_SINCE_CXX20 ~basic_string();
+ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 ~basic_string() {
+ if (__is_long())
+ __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
+ }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
operator __self_view() const _NOEXCEPT { return __self_view(data(), size()); }
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(const basic_string& __str);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(nullptr_t) = delete;
-
- template <class _Tp, class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
- !__is_same_uncvref<_Tp, basic_string>::value> >
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value, int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(const _Tp& __t) {
__self_view __sv = __t;
return assign(__sv);
@@ -1043,7 +1131,7 @@ public:
#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string& operator=(const value_type* __s) {return assign(__s);}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 20
basic_string& operator=(nullptr_t) = delete;
#endif
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(value_type __c);
@@ -1134,7 +1222,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX20 void reserve(size_type __requested_capacity);
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Op>
_LIBCPP_HIDE_FROM_ABI constexpr
void resize_and_overwrite(size_type __n, _Op __op) {
@@ -1153,12 +1241,12 @@ public:
bool empty() const _NOEXCEPT {return size() == 0;}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference operator[](size_type __pos) const _NOEXCEPT {
- _LIBCPP_ASSERT(__pos <= size(), "string index out of bounds");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__pos <= size(), "string index out of bounds");
return *(data() + __pos);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](size_type __pos) _NOEXCEPT {
- _LIBCPP_ASSERT(__pos <= size(), "string index out of bounds");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__pos <= size(), "string index out of bounds");
return *(__get_pointer() + __pos);
}
@@ -1169,14 +1257,11 @@ public:
return append(__str);
}
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
- && !__is_same_uncvref<_Tp, basic_string >::value,
- basic_string&
- >
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string >::value,
+ int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
operator+=(const _Tp& __t) {
__self_view __sv = __t; return append(__sv);
}
@@ -1199,25 +1284,27 @@ public:
return append(__str.data(), __str.size());
}
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
- && !__is_same_uncvref<_Tp, basic_string>::value,
- basic_string&
- >
- append(const _Tp& __t) { __self_view __sv = __t; return append(__sv.data(), __sv.size()); }
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ append(const _Tp& __t) {
+ __self_view __sv = __t;
+ return append(__sv.data(), __sv.size());
+ }
+
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const basic_string& __str, size_type __pos, size_type __n=npos);
- template <class _Tp>
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
- && !__is_same_uncvref<_Tp, basic_string>::value,
- basic_string&
- >
- append(const _Tp& __t, size_type __pos, size_type __n=npos);
+
+ basic_string&
+ append(const _Tp& __t, size_type __pos, size_type __n = npos);
+
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s, size_type __n);
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s);
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(size_type __n, value_type __c);
@@ -1225,29 +1312,27 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void __append_default_init(size_type __n);
- template<class _InputIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- __enable_if_t
- <
- __is_exactly_cpp17_input_iterator<_InputIterator>::value,
- basic_string&
- >
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
append(_InputIterator __first, _InputIterator __last) {
- const basic_string __temp(__first, __last, __alloc());
- append(__temp.data(), __temp.size());
- return *this;
+ const basic_string __temp(__first, __last, __alloc());
+ append(__temp.data(), __temp.size());
+ return *this;
}
- template<class _ForwardIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- __enable_if_t
- <
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- basic_string&
- >
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+
+ template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
append(_ForwardIterator __first, _ForwardIterator __last);
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_CharT> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr basic_string& append_range(_Range&& __range) {
+ insert_range(end(), std::forward<_Range>(__range));
+ return *this;
+ }
+#endif
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}
@@ -1257,33 +1342,32 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void pop_back();
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference front() _NOEXCEPT {
- _LIBCPP_ASSERT(!empty(), "string::front(): string is empty");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::front(): string is empty");
return *__get_pointer();
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const _NOEXCEPT {
- _LIBCPP_ASSERT(!empty(), "string::front(): string is empty");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::front(): string is empty");
return *data();
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference back() _NOEXCEPT {
- _LIBCPP_ASSERT(!empty(), "string::back(): string is empty");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::back(): string is empty");
return *(__get_pointer() + size() - 1);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const _NOEXCEPT {
- _LIBCPP_ASSERT(!empty(), "string::back(): string is empty");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::back(): string is empty");
return *(data() + size() - 1);
}
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- basic_string&
- >
- assign(const _Tp & __t) { __self_view __sv = __t; return assign(__sv.data(), __sv.size()); }
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ assign(const _Tp& __t) {
+ __self_view __sv = __t;
+ return assign(__sv.data(), __sv.size());
+ }
+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string& assign(const basic_string& __str) { return *this = __str; }
#ifndef _LIBCPP_CXX03_LANG
@@ -1293,34 +1377,42 @@ public:
{*this = std::move(__str); return *this;}
#endif
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const basic_string& __str, size_type __pos, size_type __n=npos);
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
- && !__is_same_uncvref<_Tp, basic_string>::value,
- basic_string&
- >
- assign(const _Tp & __t, size_type __pos, size_type __n=npos);
+
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ assign(const _Tp& __t, size_type __pos, size_type __n = npos);
+
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* __s, size_type __n);
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* __s);
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(size_type __n, value_type __c);
- template<class _InputIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_exactly_cpp17_input_iterator<_InputIterator>::value,
- basic_string&
- >
- assign(_InputIterator __first, _InputIterator __last);
- template<class _ForwardIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- basic_string&
- >
- assign(_ForwardIterator __first, _ForwardIterator __last);
+ template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ assign(_InputIterator __first, _InputIterator __last);
+
+ template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ assign(_ForwardIterator __first, _ForwardIterator __last);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_CharT> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr basic_string& assign_range(_Range&& __range) {
+ if constexpr (__string_is_trivial_iterator<ranges::iterator_t<_Range>>::value &&
+ (ranges::forward_range<_Range> || ranges::sized_range<_Range>)) {
+ size_type __n = static_cast<size_type>(ranges::distance(__range));
+ __assign_trivial(ranges::begin(__range), ranges::end(__range), __n);
+
+ } else {
+ __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
+ }
+
+ return *this;
+ }
+#endif
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
@@ -1331,56 +1423,57 @@ public:
return insert(__pos1, __str.data(), __str.size());
}
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- basic_string&
- >
- insert(size_type __pos1, const _Tp& __t)
- { __self_view __sv = __t; return insert(__pos1, __sv.data(), __sv.size()); }
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ insert(size_type __pos1, const _Tp& __t) {
+ __self_view __sv = __t;
+ return insert(__pos1, __sv.data(), __sv.size());
+ }
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value,
- basic_string&
- >
- insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n=npos);
- _LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string& insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n=npos);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s, size_type __n);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, size_type __n, value_type __c);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, value_type __c);
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n = npos);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n = npos);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s, size_type __n);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, size_type __n, value_type __c);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, value_type __c);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_CharT> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr iterator insert_range(const_iterator __position, _Range&& __range) {
+ if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
+ auto __n = static_cast<size_type>(ranges::distance(__range));
+ return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n);
+
+ } else {
+ basic_string __temp(from_range, std::forward<_Range>(__range), __alloc());
+ return insert(__position, __temp.data(), __temp.data() + __temp.size());
+ }
+ }
+#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
insert(const_iterator __pos, size_type __n, value_type __c) {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
- "string::insert(iterator, n, value) called with an iterator not referring to this string");
difference_type __p = __pos - begin();
insert(static_cast<size_type>(__p), __n, __c);
return begin() + __p;
}
- template<class _InputIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_exactly_cpp17_input_iterator<_InputIterator>::value,
- iterator
- >
- insert(const_iterator __pos, _InputIterator __first, _InputIterator __last);
- template<class _ForwardIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- iterator
- >
- insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);
+ template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
+ insert(const_iterator __pos, _InputIterator __first, _InputIterator __last);
+
+ template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
+ insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
iterator insert(const_iterator __pos, initializer_list<value_type> __il)
@@ -1398,28 +1491,27 @@ public:
return replace(__pos1, __n1, __str.data(), __str.size());
}
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- basic_string&
- >
- replace(size_type __pos1, size_type __n1, const _Tp& __t) { __self_view __sv = __t; return replace(__pos1, __n1, __sv.data(), __sv.size()); }
- _LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2=npos);
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value,
- basic_string&
- >
- replace(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos);
- _LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string& replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, const value_type* __s);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ replace(size_type __pos1, size_type __n1, const _Tp& __t) {
+ __self_view __sv = __t;
+ return replace(__pos1, __n1, __sv.data(), __sv.size());
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2 = npos);
+
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ replace(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2 = npos);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, const value_type* __s);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
replace(const_iterator __i1, const_iterator __i2, const basic_string& __str) {
@@ -1427,14 +1519,12 @@ public:
static_cast<size_type>(__i1 - begin()), static_cast<size_type>(__i2 - __i1), __str.data(), __str.size());
}
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- basic_string&
- >
- replace(const_iterator __i1, const_iterator __i2, const _Tp& __t) { __self_view __sv = __t; return replace(__i1 - begin(), __i2 - __i1, __sv); }
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ replace(const_iterator __i1, const_iterator __i2, const _Tp& __t) {
+ __self_view __sv = __t;
+ return replace(__i1 - begin(), __i2 - __i1, __sv);
+ }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
replace(const_iterator __i1, const_iterator __i2, const value_type* __s, size_type __n) {
@@ -1451,14 +1541,19 @@ public:
return replace(static_cast<size_type>(__i1 - begin()), static_cast<size_type>(__i2 - __i1), __n, __c);
}
- template<class _InputIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_cpp17_input_iterator<_InputIterator>::value,
- basic_string&
- >
- replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2);
+ template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_CharT> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr basic_string& replace_with_range(const_iterator __i1, const_iterator __i2, _Range&& __range) {
+ basic_string __temp(from_range, std::forward<_Range>(__range), __alloc());
+ return replace(__i1, __i2, __temp);
+ }
+#endif
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string& replace(const_iterator __i1, const_iterator __i2, initializer_list<value_type> __il)
@@ -1497,7 +1592,7 @@ public:
const value_type* c_str() const _NOEXCEPT {return data();}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
const value_type* data() const _NOEXCEPT {return std::__to_address(__get_pointer());}
-#if _LIBCPP_STD_VER > 14 || defined(_LIBCPP_BUILDING_LIBRARY)
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
value_type* data() _NOEXCEPT {return std::__to_address(__get_pointer());}
#endif
@@ -1508,16 +1603,11 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- size_type
- >
- find(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
- _LIBCPP_CONSTEXPR_SINCE_CXX20
- size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
+ find(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
_LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT;
@@ -1525,14 +1615,10 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- size_type
- >
- rfind(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
+ rfind(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
+
_LIBCPP_CONSTEXPR_SINCE_CXX20
size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1542,14 +1628,10 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- size_type
- >
- find_first_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
+ find_first_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
+
_LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1560,14 +1642,10 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- size_type
- >
- find_last_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
+ find_last_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
+
_LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1578,14 +1656,10 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- size_type
- >
- find_first_not_of(const _Tp &__t, size_type __pos = 0) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
+ find_first_not_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
+
_LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1596,14 +1670,10 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- size_type
- >
- find_last_not_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
+ find_last_not_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
+
_LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1614,23 +1684,13 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
int compare(const basic_string& __str) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- int
- >
- compare(const _Tp &__t) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 int
+ compare(const _Tp& __t) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- int
- >
- compare(size_type __pos1, size_type __n1, const _Tp& __t) const;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 int
+ compare(size_type __pos1, size_type __n1, const _Tp& __t) const;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
int compare(size_type __pos1, size_type __n1, const basic_string& __str) const;
@@ -1638,21 +1698,19 @@ public:
int compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2,
size_type __n2 = npos) const;
- template <class _Tp>
- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value,
- int
- >
- compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos) const;
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
+ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int
+ compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2 = npos) const;
+
_LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(const value_type* __s) const _NOEXCEPT;
_LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(size_type __pos1, size_type __n1, const value_type* __s) const;
_LIBCPP_CONSTEXPR_SINCE_CXX20
int compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const;
-//WARN: disabled std guards in order to allow using these options without switching to new std
-//#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
constexpr _LIBCPP_HIDE_FROM_ABI
bool starts_with(__self_view __sv) const noexcept
{ return __self_view(data(), size()).starts_with(__sv); }
@@ -1676,7 +1734,7 @@ public:
constexpr _LIBCPP_HIDE_FROM_ABI
bool ends_with(const value_type* __s) const noexcept
{ return ends_with(__self_view(__s)); }
-//#endif // _LIBCPP_STD_VER > 17
+#endif
#if _LIBCPP_STD_VER >= 20
constexpr _LIBCPP_HIDE_FROM_ABI
@@ -1696,15 +1754,6 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __clear_and_shrink() _NOEXCEPT;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
- bool __dereferenceable(const const_iterator* __i) const;
- bool __decrementable(const const_iterator* __i) const;
- bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
- bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
-
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
private:
template<class _Alloc>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1721,7 +1770,7 @@ private:
}
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __begin_lifetime(pointer __begin, size_type __n) {
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
if (__libcpp_is_constant_evaluated()) {
for (size_type __i = 0; __i != __n; ++__i)
std::construct_at(std::addressof(__begin[__i]));
@@ -1729,7 +1778,7 @@ private:
#else
(void)__begin;
(void)__n;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __default_init() {
@@ -1754,9 +1803,17 @@ private:
return !__libcpp_is_constant_evaluated() && (__sz < __min_cap);
}
- template <class _ForwardIterator>
+ template <class _Iterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ void __assign_trivial(_Iterator __first, _Sentinel __last, size_type __n);
+
+ template <class _Iterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ void __assign_with_sentinel(_Iterator __first, _Sentinel __last);
+
+ template <class _ForwardIterator, class _Sentinel>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
- iterator __insert_from_safe_copy(size_type __n, size_type __ip, _ForwardIterator __first, _ForwardIterator __last) {
+ iterator __insert_from_safe_copy(size_type __n, size_type __ip, _ForwardIterator __first, _Sentinel __last) {
size_type __sz = size();
size_type __cap = capacity();
value_type* __p;
@@ -1769,7 +1826,7 @@ private:
}
else
{
- __grow_by(__cap, __sz + __n - __cap, __sz, __ip, 0, __n);
+ __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __ip, 0, __n);
__p = std::__to_address(__get_long_pointer());
}
__sz += __n;
@@ -1781,19 +1838,25 @@ private:
return begin() + __ip;
}
+ template<class _Iterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20
+ iterator __insert_with_size(const_iterator __pos, _Iterator __first, _Sentinel __last, size_type __n);
+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 allocator_type& __alloc() _NOEXCEPT { return __r_.second(); }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const allocator_type& __alloc() const _NOEXCEPT { return __r_.second(); }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void __set_short_size(size_type __s) _NOEXCEPT {
- _LIBCPP_ASSERT(__s < __min_cap, "__s should never be greater than or equal to the short string capacity");
+ _LIBCPP_ASSERT_INTERNAL(
+ __s < __min_cap, "__s should never be greater than or equal to the short string capacity");
__r_.first().__s.__size_ = __s;
__r_.first().__s.__is_long_ = false;
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type __get_short_size() const _NOEXCEPT {
- _LIBCPP_ASSERT(!__r_.first().__s.__is_long_, "String has to be short when trying to get the short size");
+ _LIBCPP_ASSERT_INTERNAL(
+ !__r_.first().__s.__is_long_, "String has to be short when trying to get the short size");
return __r_.first().__s.__size_;
}
@@ -1877,25 +1940,29 @@ private:
// to only inline the fast path code directly in the ctor.
_LIBCPP_CONSTEXPR_SINCE_CXX20 void __init_copy_ctor_external(const value_type* __s, size_type __sz);
- template <class _InputIterator>
- inline _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_exactly_cpp17_input_iterator<_InputIterator>::value
- >
- __init(_InputIterator __first, _InputIterator __last);
+ template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
+ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init(_InputIterator __first, _InputIterator __last);
- template <class _ForwardIterator>
- inline _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_cpp17_forward_iterator<_ForwardIterator>::value
- >
- __init(_ForwardIterator __first, _ForwardIterator __last);
+ template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
+ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init(_ForwardIterator __first, _ForwardIterator __last);
+
+ template <class _InputIterator, class _Sentinel>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ void __init_with_sentinel(_InputIterator __first, _Sentinel __last);
+ template <class _InputIterator, class _Sentinel>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ void __init_with_size(_InputIterator __first, _Sentinel __last, size_type __sz);
_LIBCPP_CONSTEXPR_SINCE_CXX20
+#if _LIBCPP_ABI_VERSION >= 2 // We want to use the function in the dylib in ABIv1
+ _LIBCPP_HIDE_FROM_ABI
+#endif
+ _LIBCPP_DEPRECATED_("use __grow_by_without_replace")
void __grow_by(size_type __old_cap, size_type __delta_cap, size_type __old_sz,
size_type __n_copy, size_type __n_del, size_type __n_add = 0);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ void __grow_by_without_replace(size_type __old_cap, size_type __delta_cap, size_type __old_sz,
+ size_type __n_copy, size_type __n_del, size_type __n_add = 0);
_LIBCPP_CONSTEXPR_SINCE_CXX20
void __grow_by_and_replace(size_type __old_cap, size_type __delta_cap, size_type __old_sz,
size_type __n_copy, size_type __n_del,
@@ -1956,7 +2023,7 @@ private:
_NOEXCEPT_(__alloc_traits::is_always_equal::value);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void __move_assign(basic_string& __str, true_type)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_NOEXCEPT;
#else
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
@@ -2000,21 +2067,13 @@ private:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string& __null_terminate_at(value_type* __p, size_type __newsz) {
__set_size(__newsz);
- __invalidate_iterators_past(__newsz);
traits_type::assign(__p[__newsz], value_type());
return *this;
}
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __invalidate_iterators_past(size_type);
-
- template<class _Tp>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- bool __addr_in_range(_Tp&& __t) const {
- // assume that the ranges overlap, because we can't check during constant evaluation
- if (__libcpp_is_constant_evaluated())
- return true;
- const volatile void *__p = std::addressof(__t);
- return data() <= __p && __p <= data() + size();
+ template <class _Tp>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __addr_in_range(const _Tp& __v) const {
+ return std::__is_pointer_in_range(data(), data() + size() + 1, std::addressof(__v));
}
_LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI
@@ -2055,7 +2114,7 @@ private:
template<class _InputIterator,
class _CharT = __iter_value_type<_InputIterator>,
class _Allocator = allocator<_CharT>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>
>
basic_string(_InputIterator, _InputIterator, _Allocator = _Allocator())
@@ -2079,35 +2138,14 @@ basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _
-> basic_string<_CharT, _Traits, _Allocator>;
#endif
-template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX20
-void
-basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type __pos)
-{
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- if (!__libcpp_is_constant_evaluated()) {
- __c_node* __c = __get_db()->__find_c_and_lock(this);
- if (__c)
- {
- const_pointer __new_last = __get_pointer() + __pos;
- for (__i_node** __p = __c->end_; __p != __c->beg_; )
- {
- --__p;
- const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
- if (__i->base() > __new_last)
- {
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- std::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
- }
- }
- __get_db()->unlock();
- }
- }
-#else
- (void)__pos;
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-}
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range,
+ class _Allocator = allocator<ranges::range_value_t<_Range>>,
+ class = enable_if_t<__is_allocator<_Allocator>::value>
+ >
+basic_string(from_range_t, _Range&&, _Allocator = _Allocator())
+ -> basic_string<ranges::range_value_t<_Range>, char_traits<ranges::range_value_t<_Range>>, _Allocator>;
+#endif
template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -2167,44 +2205,6 @@ basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_ty
}
template <class _CharT, class _Traits, class _Allocator>
-template <class>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const _Allocator& __a)
- : __r_(__default_init_tag(), __a)
-{
- _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
- __init(__s, traits_type::length(__s));
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str)
- : __r_(__default_init_tag(), __alloc_traits::select_on_container_copy_construction(__str.__alloc()))
-{
- if (!__str.__is_long())
- __r_.first() = __str.__r_.first();
- else
- __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()),
- __str.__get_long_size());
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(
- const basic_string& __str, const allocator_type& __a)
- : __r_(__default_init_tag(), __a)
-{
- if (!__str.__is_long())
- __r_.first() = __str.__r_.first();
- else
- __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()),
- __str.__get_long_size());
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
void basic_string<_CharT, _Traits, _Allocator>::__init_copy_ctor_external(
const value_type* __s, size_type __sz) {
@@ -2258,81 +2258,26 @@ basic_string<_CharT, _Traits, _Allocator>::__init(size_type __n, value_type __c)
}
template <class _CharT, class _Traits, class _Allocator>
-template <class>
+template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> >
_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c, const _Allocator& __a)
- : __r_(__default_init_tag(), __a)
+void basic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _InputIterator __last)
{
- __init(__n, __c);
- std::__debug_db_insert_c(this);
+ __init_with_sentinel(std::move(__first), std::move(__last));
}
template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str,
- size_type __pos, size_type __n,
- const _Allocator& __a)
- : __r_(__default_init_tag(), __a)
-{
- size_type __str_sz = __str.size();
- if (__pos > __str_sz)
- __throw_out_of_range();
- __init(__str.data() + __pos, std::min(__n, __str_sz - __pos));
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp, class>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(
- const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a)
- : __r_(__default_init_tag(), __a)
-{
- __self_view __sv0 = __t;
- __self_view __sv = __sv0.substr(__pos, __n);
- __init(__sv.data(), __sv.size());
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp, class>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t)
- : __r_(__default_init_tag(), __default_init_tag())
-{
- __self_view __sv = __t;
- __init(__sv.data(), __sv.size());
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp, class>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t, const _Allocator& __a)
- : __r_(__default_init_tag(), __a)
-{
- __self_view __sv = __t;
- __init(__sv.data(), __sv.size());
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-template <class _InputIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_exactly_cpp17_input_iterator<_InputIterator>::value
->
-basic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _InputIterator __last)
-{
+template <class _InputIterator, class _Sentinel>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+void basic_string<_CharT, _Traits, _Allocator>::__init_with_sentinel(_InputIterator __first, _Sentinel __last) {
__default_init();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __first != __last; ++__first)
push_back(*__first);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -2340,28 +2285,35 @@ basic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _Input
__alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _ForwardIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_cpp17_forward_iterator<_ForwardIterator>::value
->
+template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 void
basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _ForwardIterator __last)
{
+ size_type __sz = static_cast<size_type>(std::distance(__first, __last));
+ __init_with_size(__first, __last, __sz);
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+template <class _InputIterator, class _Sentinel>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+void basic_string<_CharT, _Traits, _Allocator>::__init_with_size(
+ _InputIterator __first, _Sentinel __last, size_type __sz) {
if (__libcpp_is_constant_evaluated())
__r_.first() = __rep();
- size_type __sz = static_cast<size_type>(std::distance(__first, __last));
+
if (__sz > max_size())
__throw_length_error();
+
pointer __p;
if (__fits_in_sso(__sz))
{
__set_short_size(__sz);
__p = __get_short_pointer();
+
}
else
{
@@ -2373,14 +2325,14 @@ basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _For
__set_long_size(__sz);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __first != __last; ++__first, (void) ++__p)
traits_type::assign(*__p, *__first);
traits_type::assign(*__p, value_type());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -2388,16 +2340,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _For
__alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::~basic_string()
-{
- std::__debug_db_erase_c(this);
- if (__is_long())
- __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _CharT, class _Traits, class _Allocator>
@@ -2417,7 +2360,6 @@ basic_string<_CharT, _Traits, _Allocator>::__grow_by_and_replace
auto __allocation = std::__allocate_at_least(__alloc(), __cap + 1);
pointer __p = __allocation.ptr;
__begin_lifetime(__p, __allocation.count);
- std::__debug_db_invalidate_all(this);
if (__n_copy != 0)
traits_type::copy(std::__to_address(__p),
std::__to_address(__old_p), __n_copy);
@@ -2436,9 +2378,16 @@ basic_string<_CharT, _Traits, _Allocator>::__grow_by_and_replace
traits_type::assign(__p[__old_sz], value_type());
}
+// __grow_by is deprecated because it does not set the size. It may not update the size when the size is changed, and it
+// may also not set the size at all when the string was short initially. This leads to unpredictable size value. It is
+// not removed or changed to avoid breaking the ABI.
template <class _CharT, class _Traits, class _Allocator>
void
_LIBCPP_CONSTEXPR_SINCE_CXX20
+#if _LIBCPP_ABI_VERSION >= 2 // We want to use the function in the dylib in ABIv1
+ _LIBCPP_HIDE_FROM_ABI
+#endif
+ _LIBCPP_DEPRECATED_("use __grow_by_without_replace")
basic_string<_CharT, _Traits, _Allocator>::__grow_by(size_type __old_cap, size_type __delta_cap, size_type __old_sz,
size_type __n_copy, size_type __n_del, size_type __n_add)
{
@@ -2452,7 +2401,6 @@ basic_string<_CharT, _Traits, _Allocator>::__grow_by(size_type __old_cap, size_t
auto __allocation = std::__allocate_at_least(__alloc(), __cap + 1);
pointer __p = __allocation.ptr;
__begin_lifetime(__p, __allocation.count);
- std::__debug_db_invalidate_all(this);
if (__n_copy != 0)
traits_type::copy(std::__to_address(__p),
std::__to_address(__old_p), __n_copy);
@@ -2467,6 +2415,21 @@ basic_string<_CharT, _Traits, _Allocator>::__grow_by(size_type __old_cap, size_t
__set_long_cap(__allocation.count);
}
+template <class _CharT, class _Traits, class _Allocator>
+void _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+basic_string<_CharT, _Traits, _Allocator>::__grow_by_without_replace(
+ size_type __old_cap,
+ size_type __delta_cap,
+ size_type __old_sz,
+ size_type __n_copy,
+ size_type __n_del,
+ size_type __n_add) {
+ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
+ __grow_by(__old_cap, __delta_cap, __old_sz, __n_copy, __n_del, __n_add);
+ _LIBCPP_SUPPRESS_DEPRECATED_POP
+ __set_long_size(__old_sz - __n_del + __n_add);
+}
+
// assign
template <class _CharT, class _Traits, class _Allocator>
@@ -2481,7 +2444,6 @@ basic_string<_CharT, _Traits, _Allocator>::__assign_no_alias(
__is_short ? __set_short_size(__n) : __set_long_size(__n);
traits_type::copy(std::__to_address(__p), __s, __n);
traits_type::assign(__p[__n], value_type());
- __invalidate_iterators_past(__n);
} else {
size_type __sz = __is_short ? __get_short_size() : __get_long_size();
__grow_by_and_replace(__cap - 1, __n - __cap + 1, __sz, 0, __sz, __n, __s);
@@ -2511,7 +2473,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s, size_type __n)
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::assign received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::assign received nullptr");
return (__builtin_constant_p(__n) && __fits_in_sso(__n))
? __assign_short(__s, __n)
: __assign_external(__s, __n);
@@ -2526,7 +2488,7 @@ basic_string<_CharT, _Traits, _Allocator>::assign(size_type __n, value_type __c)
if (__cap < __n)
{
size_type __sz = size();
- __grow_by(__cap, __n - __cap, __sz, 0, __sz);
+ __grow_by_without_replace(__cap, __n - __cap, __sz, 0, __sz);
}
value_type* __p = std::__to_address(__get_pointer());
traits_type::assign(__p, __n, __c);
@@ -2551,7 +2513,6 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(value_type __c)
}
traits_type::assign(*__p, __c);
traits_type::assign(*++__p, value_type());
- __invalidate_iterators_past(1);
return *this;
}
@@ -2560,7 +2521,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str)
{
- if (this != &__str) {
+ if (this != std::addressof(__str)) {
__copy_assign_alloc(__str);
if (!__is_long()) {
if (!__str.__is_long()) {
@@ -2593,7 +2554,7 @@ template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_CONSTEXPR_SINCE_CXX20
void
basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, true_type)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_NOEXCEPT
#else
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
@@ -2622,55 +2583,62 @@ basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, tr
#endif
template <class _CharT, class _Traits, class _Allocator>
-template<class _InputIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_exactly_cpp17_input_iterator<_InputIterator>::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
+template<class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::assign(_InputIterator __first, _InputIterator __last)
{
- const basic_string __temp(__first, __last, __alloc());
- assign(__temp.data(), __temp.size());
- return *this;
+ __assign_with_sentinel(__first, __last);
+ return *this;
}
template <class _CharT, class _Traits, class _Allocator>
-template<class _ForwardIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
+template <class _InputIterator, class _Sentinel>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+void
+basic_string<_CharT, _Traits, _Allocator>::__assign_with_sentinel(_InputIterator __first, _Sentinel __last) {
+ const basic_string __temp(__init_with_sentinel_tag(), std::move(__first), std::move(__last), __alloc());
+ assign(__temp.data(), __temp.size());
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+template<class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
{
- size_type __cap = capacity();
- size_type __n = __string_is_trivial_iterator<_ForwardIterator>::value ?
- static_cast<size_type>(std::distance(__first, __last)) : 0;
+ if (__string_is_trivial_iterator<_ForwardIterator>::value) {
+ size_type __n = static_cast<size_type>(std::distance(__first, __last));
+ __assign_trivial(__first, __last, __n);
+ } else {
+ __assign_with_sentinel(__first, __last);
+ }
- if (__string_is_trivial_iterator<_ForwardIterator>::value &&
- (__cap >= __n || !__addr_in_range(*__first)))
- {
- if (__cap < __n)
- {
- size_type __sz = size();
- __grow_by(__cap, __n - __cap, __sz, 0, __sz);
- }
- pointer __p = __get_pointer();
- for (; __first != __last; ++__p, (void) ++__first)
- traits_type::assign(*__p, *__first);
- traits_type::assign(*__p, value_type());
- __set_size(__n);
- __invalidate_iterators_past(__n);
- }
- else
- {
- const basic_string __temp(__first, __last, __alloc());
- assign(__temp.data(), __temp.size());
+ return *this;
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+template <class _Iterator, class _Sentinel>
+_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+void
+basic_string<_CharT, _Traits, _Allocator>::__assign_trivial(_Iterator __first, _Sentinel __last, size_type __n) {
+ _LIBCPP_ASSERT_INTERNAL(
+ __string_is_trivial_iterator<_Iterator>::value, "The iterator type given to `__assign_trivial` must be trivial");
+
+ size_type __cap = capacity();
+ if (__cap < __n) {
+ // Unlike `append` functions, if the input range points into the string itself, there is no case that the input
+ // range could get invalidated by reallocation:
+ // 1. If the input range is a subset of the string itself, its size cannot exceed the capacity of the string,
+ // thus no reallocation would happen.
+ // 2. In the exotic case where the input range is the byte representation of the string itself, the string
+ // object itself stays valid even if reallocation happens.
+ size_type __sz = size();
+ __grow_by_without_replace(__cap, __n - __cap, __sz, 0, __sz);
}
- return *this;
+ pointer __p = __get_pointer();
+ for (; __first != __last; ++__p, (void) ++__first)
+ traits_type::assign(*__p, *__first);
+ traits_type::assign(*__p, value_type());
+ __set_size(__n);
}
template <class _CharT, class _Traits, class _Allocator>
@@ -2685,16 +2653,12 @@ basic_string<_CharT, _Traits, _Allocator>::assign(const basic_string& __str, siz
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
- && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
-basic_string<_CharT, _Traits, _Allocator>::assign(const _Tp & __t, size_type __pos, size_type __n)
-{
+template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
+ int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
+basic_string<_CharT, _Traits, _Allocator>::assign(const _Tp& __t, size_type __pos, size_type __n) {
__self_view __sv = __t;
size_type __sz = __sv.size();
if (__pos > __sz)
@@ -2702,7 +2666,6 @@ basic_string<_CharT, _Traits, _Allocator>::assign(const _Tp & __t, size_type __p
return assign(__sv.data() + __pos, std::min(__n, __sz - __pos));
}
-
template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string<_CharT, _Traits, _Allocator>&
@@ -2715,7 +2678,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s)
{
- _LIBCPP_ASSERT(__s != nullptr, "string::assign received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::assign received nullptr");
return __builtin_constant_p(*__s)
? (__fits_in_sso(traits_type::length(__s))
? __assign_short(__s, traits_type::length(__s))
@@ -2729,7 +2692,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s, size_type __n)
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::append received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::append received nullptr");
size_type __cap = capacity();
size_type __sz = size();
if (__cap - __sz >= __n)
@@ -2758,7 +2721,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(size_type __n, value_type __c)
size_type __cap = capacity();
size_type __sz = size();
if (__cap - __sz < __n)
- __grow_by(__cap, __sz + __n - __cap, __sz, __sz, 0);
+ __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __sz, 0);
pointer __p = __get_pointer();
traits_type::assign(std::__to_address(__p) + __sz, __n, __c);
__sz += __n;
@@ -2777,7 +2740,7 @@ basic_string<_CharT, _Traits, _Allocator>::__append_default_init(size_type __n)
size_type __cap = capacity();
size_type __sz = size();
if (__cap - __sz < __n)
- __grow_by(__cap, __sz + __n - __cap, __sz, __sz, 0);
+ __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __sz, 0);
pointer __p = __get_pointer();
__sz += __n;
__set_size(__sz);
@@ -2805,7 +2768,7 @@ basic_string<_CharT, _Traits, _Allocator>::push_back(value_type __c)
}
if (__sz == __cap)
{
- __grow_by(__cap, 1, __sz, __sz, 0);
+ __grow_by_without_replace(__cap, 1, __sz, __sz, 0);
__is_short = false; // the string is always long after __grow_by
}
pointer __p = __get_pointer();
@@ -2824,13 +2787,8 @@ basic_string<_CharT, _Traits, _Allocator>::push_back(value_type __c)
}
template <class _CharT, class _Traits, class _Allocator>
-template<class _ForwardIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
+template<class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::append(
_ForwardIterator __first, _ForwardIterator __last)
{
@@ -2843,7 +2801,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(
!__addr_in_range(*__first))
{
if (__cap - __sz < __n)
- __grow_by(__cap, __sz + __n - __cap, __sz, __sz, 0);
+ __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __sz, 0);
pointer __p = __get_pointer() + __sz;
for (; __first != __last; ++__p, (void) ++__first)
traits_type::assign(*__p, *__first);
@@ -2871,15 +2829,12 @@ basic_string<_CharT, _Traits, _Allocator>::append(const basic_string& __str, siz
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
- basic_string<_CharT, _Traits, _Allocator>&
- >
-basic_string<_CharT, _Traits, _Allocator>::append(const _Tp & __t, size_type __pos, size_type __n)
-{
+template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
+ int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
+basic_string<_CharT, _Traits, _Allocator>::append(const _Tp& __t, size_type __pos, size_type __n) {
__self_view __sv = __t;
size_type __sz = __sv.size();
if (__pos > __sz)
@@ -2892,7 +2847,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s)
{
- _LIBCPP_ASSERT(__s != nullptr, "string::append received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::append received nullptr");
return append(__s, traits_type::length(__s));
}
@@ -2903,7 +2858,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_type* __s, size_type __n)
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::insert received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::insert received nullptr");
size_type __sz = size();
if (__pos > __sz)
__throw_out_of_range();
@@ -2959,7 +2914,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, size_type __n
}
else
{
- __grow_by(__cap, __sz + __n - __cap, __sz, __pos, 0, __n);
+ __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __pos, 0, __n);
__p = std::__to_address(__get_long_pointer());
}
traits_type::assign(__p + __pos, __n, __c);
@@ -2971,47 +2926,40 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, size_type __n
}
template <class _CharT, class _Traits, class _Allocator>
-template<class _InputIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_exactly_cpp17_input_iterator<_InputIterator>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::iterator
->
+template<class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::iterator
basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIterator __first, _InputIterator __last)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
- "string::insert(iterator, range) called with an iterator not"
- " referring to this string");
const basic_string __temp(__first, __last, __alloc());
return insert(__pos, __temp.data(), __temp.data() + __temp.size());
}
template <class _CharT, class _Traits, class _Allocator>
-template<class _ForwardIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::iterator
->
+template<class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::iterator
basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
- "string::insert(iterator, range) called with an iterator not referring to this string");
+ auto __n = static_cast<size_type>(std::distance(__first, __last));
+ return __insert_with_size(__pos, __first, __last, __n);
+}
+template <class _CharT, class _Traits, class _Allocator>
+template<class _Iterator, class _Sentinel>
+_LIBCPP_CONSTEXPR_SINCE_CXX20
+typename basic_string<_CharT, _Traits, _Allocator>::iterator
+basic_string<_CharT, _Traits, _Allocator>::__insert_with_size(
+ const_iterator __pos, _Iterator __first, _Sentinel __last, size_type __n) {
size_type __ip = static_cast<size_type>(__pos - begin());
- size_type __n = static_cast<size_type>(std::distance(__first, __last));
if (__n == 0)
return begin() + __ip;
- if (__string_is_trivial_iterator<_ForwardIterator>::value && !__addr_in_range(*__first))
+ if (__string_is_trivial_iterator<_Iterator>::value && !__addr_in_range(*__first))
{
return __insert_from_safe_copy(__n, __ip, __first, __last);
}
else
{
- const basic_string __temp(__first, __last, __alloc());
+ const basic_string __temp(__init_with_sentinel_tag(), __first, __last, __alloc());
return __insert_from_safe_copy(__n, __ip, __temp.begin(), __temp.end());
}
}
@@ -3029,16 +2977,12 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const basic_
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
-basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const _Tp& __t,
- size_type __pos2, size_type __n)
-{
+template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
+ int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
+basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n) {
__self_view __sv = __t;
size_type __str_sz = __sv.size();
if (__pos2 > __str_sz)
@@ -3051,7 +2995,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_type* __s)
{
- _LIBCPP_ASSERT(__s != nullptr, "string::insert received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::insert received nullptr");
return insert(__pos, __s, traits_type::length(__s));
}
@@ -3060,17 +3004,13 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
typename basic_string<_CharT, _Traits, _Allocator>::iterator
basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, value_type __c)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
- "string::insert(iterator, character) called with an iterator not"
- " referring to this string");
-
size_type __ip = static_cast<size_type>(__pos - begin());
size_type __sz = size();
size_type __cap = capacity();
value_type* __p;
if (__cap == __sz)
{
- __grow_by(__cap, 1, __sz, __ip, 0, 1);
+ __grow_by_without_replace(__cap, 1, __sz, __ip, 0, 1);
__p = std::__to_address(__get_long_pointer());
}
else
@@ -3094,7 +3034,7 @@ basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2)
_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
{
- _LIBCPP_ASSERT(__n2 == 0 || __s != nullptr, "string::replace received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n2 == 0 || __s != nullptr, "string::replace received nullptr");
size_type __sz = size();
if (__pos > __sz)
__throw_out_of_range();
@@ -3102,10 +3042,6 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __
size_type __cap = capacity();
if (__cap - __sz + __n1 >= __n2)
{
- if (__libcpp_is_constant_evaluated()) {
- __grow_by_and_replace(__cap, 0, __sz, __pos, __n1, __n2, __s);
- return *this;
- }
value_type* __p = std::__to_address(__get_pointer());
if (__n1 != __n2)
{
@@ -3118,7 +3054,7 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __
traits_type::move(__p + __pos + __n2, __p + __pos + __n1, __n_move);
return __null_terminate_at(__p, __sz + (__n2 - __n1));
}
- if (__p + __pos < __s && __s < __p + __sz)
+ if (std::__is_pointer_in_range(__p + __pos + 1, __p + __sz, __s))
{
if (__p + __pos + __n1 <= __s)
__s += __n2 - __n1;
@@ -3165,7 +3101,7 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __
}
else
{
- __grow_by(__cap, __sz - __n1 + __n2 - __cap, __sz, __pos, __n1, __n2);
+ __grow_by_without_replace(__cap, __sz - __n1 + __n2 - __cap, __sz, __pos, __n1, __n2);
__p = std::__to_address(__get_long_pointer());
}
traits_type::assign(__p + __pos, __n2, __c);
@@ -3173,13 +3109,8 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __
}
template <class _CharT, class _Traits, class _Allocator>
-template<class _InputIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_cpp17_input_iterator<_InputIterator>::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
+template<class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::replace(const_iterator __i1, const_iterator __i2,
_InputIterator __j1, _InputIterator __j2)
{
@@ -3200,16 +3131,13 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos1, size_type _
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
-basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos1, size_type __n1, const _Tp& __t,
- size_type __pos2, size_type __n2)
-{
+template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
+ int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
+basic_string<_CharT, _Traits, _Allocator>::replace(
+ size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2) {
__self_view __sv = __t;
size_type __str_sz = __sv.size();
if (__pos2 > __str_sz)
@@ -3222,7 +3150,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __n1, const value_type* __s)
{
- _LIBCPP_ASSERT(__s != nullptr, "string::replace received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::replace received nullptr");
return replace(__pos, __n1, __s, traits_type::length(__s));
}
@@ -3268,11 +3196,8 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX20
typename basic_string<_CharT, _Traits, _Allocator>::iterator
basic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __pos)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
- "string::erase(iterator) called with an iterator not"
- " referring to this string");
-
- _LIBCPP_ASSERT(__pos != end(), "string::erase(iterator) called with a non-dereferenceable iterator");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
+ __pos != end(), "string::erase(iterator) called with a non-dereferenceable iterator");
iterator __b = begin();
size_type __r = static_cast<size_type>(__pos - __b);
erase(__r, 1);
@@ -3284,11 +3209,7 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX20
typename basic_string<_CharT, _Traits, _Allocator>::iterator
basic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __first, const_iterator __last)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,
- "string::erase(iterator, iterator) called with an iterator not"
- " referring to this string");
-
- _LIBCPP_ASSERT(__first <= __last, "string::erase(first, last) called with invalid range");
+ _LIBCPP_ASSERT_VALID_INPUT_RANGE(__first <= __last, "string::erase(first, last) called with invalid range");
iterator __b = begin();
size_type __r = static_cast<size_type>(__first - __b);
erase(__r, static_cast<size_type>(__last - __first));
@@ -3300,7 +3221,7 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX20
void
basic_string<_CharT, _Traits, _Allocator>::pop_back()
{
- _LIBCPP_ASSERT(!empty(), "string::pop_back(): string is already empty");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::pop_back(): string is already empty");
__erase_to_end(size() - 1);
}
@@ -3309,7 +3230,6 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX20
void
basic_string<_CharT, _Traits, _Allocator>::clear() _NOEXCEPT
{
- std::__debug_db_invalidate_all(this);
if (__is_long())
{
traits_type::assign(*__get_long_pointer(), value_type());
@@ -3403,23 +3323,23 @@ basic_string<_CharT, _Traits, _Allocator>::__shrink_or_extend(size_type __target
}
else
{
- #ifndef _LIBCPP_NO_EXCEPTIONS
+ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
- #endif // _LIBCPP_NO_EXCEPTIONS
+ #endif // _LIBCPP_HAS_NO_EXCEPTIONS
auto __allocation = std::__allocate_at_least(__alloc(), __target_capacity + 1);
__new_data = __allocation.ptr;
__target_capacity = __allocation.count - 1;
- #ifndef _LIBCPP_NO_EXCEPTIONS
+ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
return;
}
- #else // _LIBCPP_NO_EXCEPTIONS
+ #else // _LIBCPP_HAS_NO_EXCEPTIONS
if (__new_data == nullptr)
return;
- #endif // _LIBCPP_NO_EXCEPTIONS
+ #endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
__begin_lifetime(__new_data, __target_capacity + 1);
__now_long = true;
@@ -3438,7 +3358,6 @@ basic_string<_CharT, _Traits, _Allocator>::__shrink_or_extend(size_type __target
}
else
__set_short_size(__sz);
- std::__debug_db_invalidate_all(this);
}
template <class _CharT, class _Traits, class _Allocator>
@@ -3485,13 +3404,7 @@ basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)
__is_nothrow_swappable<allocator_type>::value)
#endif
{
- if (!__is_long())
- std::__debug_db_invalidate_all(this);
- if (!__str.__is_long())
- std::__debug_db_invalidate_all(&__str);
- std::__debug_db_swap(this, &__str);
-
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
__alloc_traits::propagate_on_container_swap::value ||
__alloc_traits::is_always_equal::value ||
__alloc() == __str.__alloc(), "swapping non-equal allocators");
@@ -3517,7 +3430,7 @@ basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s,
size_type __pos,
size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::find(): received nullptr");
return std::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3533,13 +3446,8 @@ basic_string<_CharT, _Traits, _Allocator>::find(const basic_string& __str,
}
template<class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::size_type
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(const _Tp &__t,
size_type __pos) const _NOEXCEPT
{
@@ -3554,7 +3462,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::find(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::find(): received nullptr");
return std::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3578,7 +3486,7 @@ basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s,
size_type __pos,
size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::rfind(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::rfind(): received nullptr");
return std::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3594,13 +3502,8 @@ basic_string<_CharT, _Traits, _Allocator>::rfind(const basic_string& __str,
}
template<class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::size_type
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::rfind(const _Tp& __t,
size_type __pos) const _NOEXCEPT
{
@@ -3615,7 +3518,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::rfind(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::rfind(): received nullptr");
return std::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3639,7 +3542,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_of(const value_type* __s,
size_type __pos,
size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_first_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::find_first_of(): received nullptr");
return std::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3655,13 +3558,8 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_of(const basic_string& __s
}
template<class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::size_type
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_of(const _Tp& __t,
size_type __pos) const _NOEXCEPT
{
@@ -3676,7 +3574,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::find_first_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::find_first_of(): received nullptr");
return std::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3699,7 +3597,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_of(const value_type* __s,
size_type __pos,
size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_last_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::find_last_of(): received nullptr");
return std::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3715,13 +3613,8 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_of(const basic_string& __st
}
template<class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::size_type
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_of(const _Tp& __t,
size_type __pos) const _NOEXCEPT
{
@@ -3736,7 +3629,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::find_last_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::find_last_of(): received nullptr");
return std::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3759,7 +3652,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const value_type* _
size_type __pos,
size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_first_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::find_first_not_of(): received nullptr");
return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3775,13 +3668,8 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const basic_string&
}
template<class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::size_type
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const _Tp& __t,
size_type __pos) const _NOEXCEPT
{
@@ -3796,7 +3684,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::find_first_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::find_first_not_of(): received nullptr");
return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3820,7 +3708,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const value_type* __
size_type __pos,
size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_last_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::find_last_not_of(): received nullptr");
return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3836,13 +3724,8 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const basic_string&
}
template<class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::size_type
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const _Tp& __t,
size_type __pos) const _NOEXCEPT
{
@@ -3857,7 +3740,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::find_last_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::find_last_not_of(): received nullptr");
return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3875,13 +3758,8 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(value_type __c,
// compare
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- int
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 int
basic_string<_CharT, _Traits, _Allocator>::compare(const _Tp& __t) const _NOEXCEPT
{
__self_view __sv = __t;
@@ -3914,7 +3792,7 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
const value_type* __s,
size_type __n2) const
{
- _LIBCPP_ASSERT(__n2 == 0 || __s != nullptr, "string::compare(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n2 == 0 || __s != nullptr, "string::compare(): received nullptr");
size_type __sz = size();
if (__pos1 > __sz || __n2 == npos)
__throw_out_of_range();
@@ -3931,13 +3809,8 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- int
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 int
basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
size_type __n1,
const _Tp& __t) const
@@ -3957,20 +3830,12 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
- && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
- int
->
-basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
- size_type __n1,
- const _Tp& __t,
- size_type __pos2,
- size_type __n2) const
-{
+template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
+ int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 int basic_string<_CharT, _Traits, _Allocator>::compare(
+ size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2) const {
__self_view __sv = __t;
return __self_view(*this).substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));
}
@@ -3992,7 +3857,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
int
basic_string<_CharT, _Traits, _Allocator>::compare(const value_type* __s) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::compare(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::compare(): received nullptr");
return compare(0, npos, __s, traits_type::length(__s));
}
@@ -4003,7 +3868,7 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
size_type __n1,
const value_type* __s) const
{
- _LIBCPP_ASSERT(__s != nullptr, "string::compare(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::compare(): received nullptr");
return compare(__pos1, __n1, __s, traits_type::length(__s));
}
@@ -4020,7 +3885,7 @@ basic_string<_CharT, _Traits, _Allocator>::__invariants() const
return false;
if (data() == nullptr)
return false;
- if (data()[size()] != value_type())
+ if (!_Traits::eq(data()[size()], value_type()))
return false;
return true;
}
@@ -4048,7 +3913,7 @@ bool
operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT
{
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
return basic_string_view<_CharT, _Traits>(__lhs) == basic_string_view<_CharT, _Traits>(__rhs);
#else
size_t __lhs_sz = __lhs.size();
@@ -4085,7 +3950,7 @@ operator==(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT
{
typedef basic_string<_CharT, _Traits, _Allocator> _String;
- _LIBCPP_ASSERT(__lhs != nullptr, "operator==(char*, basic_string): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__lhs != nullptr, "operator==(char*, basic_string): received nullptr");
size_t __lhs_len = _Traits::length(__lhs);
if (__lhs_len != __rhs.size()) return false;
return __rhs.compare(0, _String::npos, __lhs, __lhs_len) == 0;
@@ -4098,18 +3963,18 @@ bool
operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
const _CharT* __rhs) _NOEXCEPT
{
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
return basic_string_view<_CharT, _Traits>(__lhs) == basic_string_view<_CharT, _Traits>(__rhs);
#else
typedef basic_string<_CharT, _Traits, _Allocator> _String;
- _LIBCPP_ASSERT(__rhs != nullptr, "operator==(basic_string, char*): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__rhs != nullptr, "operator==(basic_string, char*): received nullptr");
size_t __rhs_len = _Traits::length(__rhs);
if (__rhs_len != __lhs.size()) return false;
return __lhs.compare(0, _String::npos, __rhs, __rhs_len) == 0;
#endif
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_HIDE_FROM_ABI constexpr auto operator<=>(
@@ -4124,7 +3989,7 @@ operator<=>(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const _CharT
return basic_string_view<_CharT, _Traits>(__lhs) <=> basic_string_view<_CharT, _Traits>(__rhs);
}
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCPP_STD_VER >= 20
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI
@@ -4268,7 +4133,7 @@ operator>=(const _CharT* __lhs,
{
return !(__lhs < __rhs);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
// operator +
@@ -4435,46 +4300,46 @@ swap(basic_string<_CharT, _Traits, _Allocator>& __lhs,
__lhs.swap(__rhs);
}
-_LIBCPP_FUNC_VIS int stoi (const string& __str, size_t* __idx = nullptr, int __base = 10);
-_LIBCPP_FUNC_VIS long stol (const string& __str, size_t* __idx = nullptr, int __base = 10);
-_LIBCPP_FUNC_VIS unsigned long stoul (const string& __str, size_t* __idx = nullptr, int __base = 10);
-_LIBCPP_FUNC_VIS long long stoll (const string& __str, size_t* __idx = nullptr, int __base = 10);
-_LIBCPP_FUNC_VIS unsigned long long stoull(const string& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_EXPORTED_FROM_ABI int stoi (const string& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_EXPORTED_FROM_ABI long stol (const string& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_EXPORTED_FROM_ABI unsigned long stoul (const string& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_EXPORTED_FROM_ABI long long stoll (const string& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_EXPORTED_FROM_ABI unsigned long long stoull(const string& __str, size_t* __idx = nullptr, int __base = 10);
-_LIBCPP_FUNC_VIS float stof (const string& __str, size_t* __idx = nullptr);
-_LIBCPP_FUNC_VIS double stod (const string& __str, size_t* __idx = nullptr);
-_LIBCPP_FUNC_VIS long double stold(const string& __str, size_t* __idx = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI float stof (const string& __str, size_t* __idx = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI double stod (const string& __str, size_t* __idx = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI long double stold(const string& __str, size_t* __idx = nullptr);
-_LIBCPP_FUNC_VIS string to_string(int __val);
-_LIBCPP_FUNC_VIS string to_string(unsigned __val);
-_LIBCPP_FUNC_VIS string to_string(long __val);
-_LIBCPP_FUNC_VIS string to_string(unsigned long __val);
-_LIBCPP_FUNC_VIS string to_string(long long __val);
-_LIBCPP_FUNC_VIS string to_string(unsigned long long __val);
-_LIBCPP_FUNC_VIS string to_string(float __val);
-_LIBCPP_FUNC_VIS string to_string(double __val);
-_LIBCPP_FUNC_VIS string to_string(long double __val);
+_LIBCPP_EXPORTED_FROM_ABI string to_string(int __val);
+_LIBCPP_EXPORTED_FROM_ABI string to_string(unsigned __val);
+_LIBCPP_EXPORTED_FROM_ABI string to_string(long __val);
+_LIBCPP_EXPORTED_FROM_ABI string to_string(unsigned long __val);
+_LIBCPP_EXPORTED_FROM_ABI string to_string(long long __val);
+_LIBCPP_EXPORTED_FROM_ABI string to_string(unsigned long long __val);
+_LIBCPP_EXPORTED_FROM_ABI string to_string(float __val);
+_LIBCPP_EXPORTED_FROM_ABI string to_string(double __val);
+_LIBCPP_EXPORTED_FROM_ABI string to_string(long double __val);
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-_LIBCPP_FUNC_VIS int stoi (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
-_LIBCPP_FUNC_VIS long stol (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
-_LIBCPP_FUNC_VIS unsigned long stoul (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
-_LIBCPP_FUNC_VIS long long stoll (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
-_LIBCPP_FUNC_VIS unsigned long long stoull(const wstring& __str, size_t* __idx = nullptr, int __base = 10);
-
-_LIBCPP_FUNC_VIS float stof (const wstring& __str, size_t* __idx = nullptr);
-_LIBCPP_FUNC_VIS double stod (const wstring& __str, size_t* __idx = nullptr);
-_LIBCPP_FUNC_VIS long double stold(const wstring& __str, size_t* __idx = nullptr);
-
-_LIBCPP_FUNC_VIS wstring to_wstring(int __val);
-_LIBCPP_FUNC_VIS wstring to_wstring(unsigned __val);
-_LIBCPP_FUNC_VIS wstring to_wstring(long __val);
-_LIBCPP_FUNC_VIS wstring to_wstring(unsigned long __val);
-_LIBCPP_FUNC_VIS wstring to_wstring(long long __val);
-_LIBCPP_FUNC_VIS wstring to_wstring(unsigned long long __val);
-_LIBCPP_FUNC_VIS wstring to_wstring(float __val);
-_LIBCPP_FUNC_VIS wstring to_wstring(double __val);
-_LIBCPP_FUNC_VIS wstring to_wstring(long double __val);
+_LIBCPP_EXPORTED_FROM_ABI int stoi (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_EXPORTED_FROM_ABI long stol (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_EXPORTED_FROM_ABI unsigned long stoul (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_EXPORTED_FROM_ABI long long stoll (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_EXPORTED_FROM_ABI unsigned long long stoull(const wstring& __str, size_t* __idx = nullptr, int __base = 10);
+
+_LIBCPP_EXPORTED_FROM_ABI float stof (const wstring& __str, size_t* __idx = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI double stod (const wstring& __str, size_t* __idx = nullptr);
+_LIBCPP_EXPORTED_FROM_ABI long double stold(const wstring& __str, size_t* __idx = nullptr);
+
+_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(int __val);
+_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(unsigned __val);
+_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(long __val);
+_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(unsigned long __val);
+_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(long long __val);
+_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(unsigned long long __val);
+_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(float __val);
+_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(double __val);
+_LIBCPP_EXPORTED_FROM_ABI wstring to_wstring(long double __val);
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
template<class _CharT, class _Traits, class _Allocator>
@@ -4483,11 +4348,11 @@ const typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::npos;
template <class _CharT, class _Allocator>
-struct __string_hash : public __unary_function<basic_string<_CharT, char_traits<_CharT>, _Allocator>, size_t>
-{
- size_t
- operator()(const basic_string<_CharT, char_traits<_CharT>, _Allocator>& __val) const _NOEXCEPT
- { return std::__do_string_hash(__val.data(), __val.data() + __val.size()); }
+struct __string_hash : public __unary_function<basic_string<_CharT, char_traits<_CharT>, _Allocator>, size_t> {
+ _LIBCPP_HIDE_FROM_ABI size_t
+ operator()(const basic_string<_CharT, char_traits<_CharT>, _Allocator>& __val) const _NOEXCEPT {
+ return std::__do_string_hash(__val.data(), __val.data() + __val.size());
+ }
};
template <class _Allocator>
@@ -4542,7 +4407,7 @@ basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>&& __is,
basic_string<_CharT, _Traits, _Allocator>& __str);
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _CharT, class _Traits, class _Allocator, class _Up>
inline _LIBCPP_HIDE_FROM_ABI
typename basic_string<_CharT, _Traits, _Allocator>::size_type
@@ -4564,57 +4429,21 @@ inline _LIBCPP_HIDE_FROM_ABI
}
#endif
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
-template<class _CharT, class _Traits, class _Allocator>
-bool
-basic_string<_CharT, _Traits, _Allocator>::__dereferenceable(const const_iterator* __i) const
-{
- return data() <= std::__to_address(__i->base()) &&
- std::__to_address(__i->base()) < data() + size();
-}
-
-template<class _CharT, class _Traits, class _Allocator>
-bool
-basic_string<_CharT, _Traits, _Allocator>::__decrementable(const const_iterator* __i) const
-{
- return data() < std::__to_address(__i->base()) &&
- std::__to_address(__i->base()) <= data() + size();
-}
-
-template<class _CharT, class _Traits, class _Allocator>
-bool
-basic_string<_CharT, _Traits, _Allocator>::__addable(const const_iterator* __i, ptrdiff_t __n) const
-{
- const value_type* __p = std::__to_address(__i->base()) + __n;
- return data() <= __p && __p <= data() + size();
-}
-
-template<class _CharT, class _Traits, class _Allocator>
-bool
-basic_string<_CharT, _Traits, _Allocator>::__subscriptable(const const_iterator* __i, ptrdiff_t __n) const
-{
- const value_type* __p = std::__to_address(__i->base()) + __n;
- return data() <= __p && __p < data() + size();
-}
-
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
// Literal suffixes for basic_string [basic.string.literals]
inline namespace literals
{
inline namespace string_literals
{
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string<char> operator "" s( const char *__str, size_t __len )
+ basic_string<char> operator""s( const char *__str, size_t __len )
{
return basic_string<char> (__str, __len);
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string<wchar_t> operator "" s( const wchar_t *__str, size_t __len )
+ basic_string<wchar_t> operator""s( const wchar_t *__str, size_t __len )
{
return basic_string<wchar_t> (__str, __len);
}
@@ -4622,27 +4451,27 @@ inline namespace literals
#ifndef _LIBCPP_HAS_NO_CHAR8_T
inline _LIBCPP_HIDE_FROM_ABI constexpr
- basic_string<char8_t> operator "" s(const char8_t *__str, size_t __len)
+ basic_string<char8_t> operator""s(const char8_t *__str, size_t __len)
{
return basic_string<char8_t> (__str, __len);
}
#endif
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string<char16_t> operator "" s( const char16_t *__str, size_t __len )
+ basic_string<char16_t> operator""s( const char16_t *__str, size_t __len )
{
return basic_string<char16_t> (__str, __len);
}
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string<char32_t> operator "" s( const char32_t *__str, size_t __len )
+ basic_string<char32_t> operator""s( const char32_t *__str, size_t __len )
{
return basic_string<char32_t> (__str, __len);
}
} // namespace string_literals
} // namespace literals
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <>
inline constexpr bool __format::__enable_insertable<std::basic_string<char>> = true;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -4660,12 +4489,12 @@ _LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <concepts>
-# include <functional>
+# include <cstdlib>
# include <iterator>
# include <new>
+# include <type_traits>
# include <typeinfo>
# include <utility>
-# include <vector>
#endif
#endif // _LIBCPP_STRING
diff --git a/contrib/libs/cxxsupp/libcxx/include/string.h b/contrib/libs/cxxsupp/libcxx/include/string.h
index 3ec877bad31..673d90316d0 100644
--- a/contrib/libs/cxxsupp/libcxx/include/string.h
+++ b/contrib/libs/cxxsupp/libcxx/include/string.h
@@ -64,8 +64,7 @@ size_t strlen(const char* s);
// MSVCRT, GNU libc and its derivates may already have the correct prototype in
// <string.h>. This macro can be defined by users if their C library provides
// the right signature.
-#if defined(__CORRECT_ISO_CPP_STRING_H_PROTO) || defined(_LIBCPP_MSVCRT) || \
- defined(__sun__) || defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_)
+#if defined(__CORRECT_ISO_CPP_STRING_H_PROTO) || defined(_LIBCPP_MSVCRT) || defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_)
#define _LIBCPP_STRING_H_HAS_CONST_OVERLOADS
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/string_view b/contrib/libs/cxxsupp/libcxx/include/string_view
index 4ba6b0e12d7..32194555401 100644
--- a/contrib/libs/cxxsupp/libcxx/include/string_view
+++ b/contrib/libs/cxxsupp/libcxx/include/string_view
@@ -90,7 +90,7 @@ namespace std {
basic_string_view& operator=(const basic_string_view&) noexcept = default;
template<class Allocator>
constexpr basic_string_view(const charT* str);
- basic_string_view(nullptr_t) = delete; // C++2b
+ basic_string_view(nullptr_t) = delete; // C++23
constexpr basic_string_view(const charT* str, size_type len);
template <class It, class End>
constexpr basic_string_view(It begin, End end); // C++20
@@ -168,9 +168,9 @@ namespace std {
constexpr bool ends_with(charT c) const noexcept; // C++20
constexpr bool ends_with(const charT* s) const; // C++20
- constexpr bool contains(basic_string_view s) const noexcept; // C++2b
- constexpr bool contains(charT c) const noexcept; // C++2b
- constexpr bool contains(const charT* s) const; // C++2b
+ constexpr bool contains(basic_string_view s) const noexcept; // C++23
+ constexpr bool contains(charT c) const noexcept; // C++23
+ constexpr bool contains(const charT* s) const; // C++23
private:
const_pointer data_; // exposition only
@@ -191,11 +191,11 @@ namespace std {
template <> struct hash<u32string_view>;
template <> struct hash<wstring_view>;
- constexpr basic_string_view<char> operator "" sv(const char *str, size_t len) noexcept;
- constexpr basic_string_view<wchar_t> operator "" sv(const wchar_t *str, size_t len) noexcept;
- constexpr basic_string_view<char8_t> operator "" sv(const char8_t *str, size_t len) noexcept; // C++20
- constexpr basic_string_view<char16_t> operator "" sv(const char16_t *str, size_t len) noexcept;
- constexpr basic_string_view<char32_t> operator "" sv(const char32_t *str, size_t len) noexcept;
+ constexpr basic_string_view<char> operator""sv(const char *str, size_t len) noexcept;
+ constexpr basic_string_view<wchar_t> operator""sv(const wchar_t *str, size_t len) noexcept;
+ constexpr basic_string_view<char8_t> operator""sv(const char8_t *str, size_t len) noexcept; // C++20
+ constexpr basic_string_view<char16_t> operator""sv(const char16_t *str, size_t len) noexcept;
+ constexpr basic_string_view<char32_t> operator""sv(const char32_t *str, size_t len) noexcept;
} // namespace std
@@ -208,8 +208,9 @@ namespace std {
#include <__functional/hash.h>
#include <__functional/unary_function.h>
#include <__fwd/string_view.h>
+#include <__iterator/bounded_iter.h>
#include <__iterator/concepts.h>
-#include <__iterator/readable_traits.h>
+#include <__iterator/iterator_traits.h>
#include <__iterator/reverse_iterator.h>
#include <__memory/pointer_traits.h>
#include <__ranges/concepts.h>
@@ -218,10 +219,18 @@ namespace std {
#include <__ranges/enable_view.h>
#include <__ranges/size.h>
#include <__string/char_traits.h>
+#include <__type_traits/is_array.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_standard_layout.h>
+#include <__type_traits/is_trivial.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h>
+#include <__type_traits/type_identity.h>
+#include <cstddef>
#include <iosfwd>
#include <limits>
#include <stdexcept>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -252,7 +261,9 @@ template <class _Traits>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
inline size_t __char_traits_length_checked(const typename _Traits::char_type* __s) _NOEXCEPT {
// This needs to be a single statement for C++11 constexpr
- return _LIBCPP_ASSERT(__s != nullptr, "null pointer passed to non-null argument of char_traits<...>::length"), _Traits::length(__s);
+ return _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr,
+ "null pointer passed to non-null argument of char_traits<...>::length"),
+ _Traits::length(__s);
}
template<class _CharT, class _Traits>
@@ -265,7 +276,11 @@ public:
using const_pointer = const _CharT*;
using reference = _CharT&;
using const_reference = const _CharT&;
+#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
+ using const_iterator = __bounded_iter<const_pointer>;
+#else
using const_iterator = const_pointer; // See [string.view.iterators]
+#endif
using iterator = const_iterator;
using const_reverse_iterator = _VSTD::reverse_iterator<const_iterator>;
using reverse_iterator = const_reverse_iterator;
@@ -296,22 +311,27 @@ public:
basic_string_view(const _CharT* __s, size_type __len) _NOEXCEPT
: __data_(__s), __size_(__len)
{
-#if _LIBCPP_STD_VER > 11
- _LIBCPP_ASSERT(__len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): received nullptr");
+#if _LIBCPP_STD_VER >= 14
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __len <= static_cast<size_type>(numeric_limits<difference_type>::max()),
+ "string_view::string_view(_CharT *, size_t): length does not fit in difference_type");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__len == 0 || __s != nullptr,
+ "string_view::string_view(_CharT *, size_t): received nullptr");
#endif
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <contiguous_iterator _It, sized_sentinel_for<_It> _End>
requires (is_same_v<iter_value_t<_It>, _CharT> && !is_convertible_v<_End, size_type>)
constexpr _LIBCPP_HIDE_FROM_ABI basic_string_view(_It __begin, _End __end)
: __data_(_VSTD::to_address(__begin)), __size_(__end - __begin)
{
- _LIBCPP_ASSERT((__end - __begin) >= 0, "std::string_view::string_view(iterator, sentinel) received invalid range");
+ _LIBCPP_ASSERT_VALID_INPUT_RANGE((__end - __begin) >= 0,
+ "std::string_view::string_view(iterator, sentinel) received invalid range");
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Range>
requires (
!is_same_v<remove_cvref_t<_Range>, basic_string_view> &&
@@ -321,20 +341,17 @@ public:
!is_convertible_v<_Range, const _CharT*> &&
(!requires(remove_cvref_t<_Range>& __d) {
__d.operator _VSTD::basic_string_view<_CharT, _Traits>();
- }) &&
- (!requires {
- typename remove_reference_t<_Range>::traits_type;
- } || is_same_v<typename remove_reference_t<_Range>::traits_type, _Traits>)
+ })
)
constexpr explicit _LIBCPP_HIDE_FROM_ABI
basic_string_view(_Range&& __r) : __data_(ranges::data(__r)), __size_(ranges::size(__r)) {}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
basic_string_view(const _CharT* __s)
: __data_(__s), __size_(_VSTD::__char_traits_length_checked<_Traits>(__s)) {}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
basic_string_view(nullptr_t) = delete;
#endif
@@ -346,10 +363,22 @@ public:
const_iterator end() const _NOEXCEPT { return cend(); }
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
- const_iterator cbegin() const _NOEXCEPT { return __data_; }
+ const_iterator cbegin() const _NOEXCEPT {
+#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
+ return std::__make_bounded_iter(data(), data(), data() + size());
+#else
+ return __data_;
+#endif
+ }
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
- const_iterator cend() const _NOEXCEPT { return __data_ + __size_; }
+ const_iterator cend() const _NOEXCEPT {
+#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
+ return std::__make_bounded_iter(data() + size(), data(), data() + size());
+#else
+ return __data_ + __size_;
+#endif
+ }
_LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_INLINE_VISIBILITY
const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(cend()); }
@@ -379,7 +408,7 @@ public:
// [string.view.access], element access
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
const_reference operator[](size_type __pos) const _NOEXCEPT {
- return _LIBCPP_ASSERT(__pos < size(), "string_view[] index out of bounds"), __data_[__pos];
+ return _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__pos < size(), "string_view[] index out of bounds"), __data_[__pos];
}
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
@@ -393,13 +422,14 @@ public:
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
const_reference front() const _NOEXCEPT
{
- return _LIBCPP_ASSERT(!empty(), "string_view::front(): string is empty"), __data_[0];
+ return _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string_view::front(): string is empty"), __data_[0];
}
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
const_reference back() const _NOEXCEPT
{
- return _LIBCPP_ASSERT(!empty(), "string_view::back(): string is empty"), __data_[__size_-1];
+ return _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string_view::back(): string is empty"),
+ __data_[__size_ - 1];
}
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
@@ -409,7 +439,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
void remove_prefix(size_type __n) _NOEXCEPT
{
- _LIBCPP_ASSERT(__n <= size(), "remove_prefix() can't remove more than size()");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n <= size(), "remove_prefix() can't remove more than size()");
__data_ += __n;
__size_ -= __n;
}
@@ -417,7 +447,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
void remove_suffix(size_type __n) _NOEXCEPT
{
- _LIBCPP_ASSERT(__n <= size(), "remove_suffix() can't remove more than size()");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n <= size(), "remove_suffix() can't remove more than size()");
__size_ -= __n;
}
@@ -495,7 +525,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
return std::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
@@ -510,7 +540,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string_view::find(): received nullptr");
return std::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -518,7 +548,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find(const _CharT* __s, size_type __pos = 0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string_view::find(): received nullptr");
return std::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -527,7 +557,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type rfind(basic_string_view __s, size_type __pos = npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
return std::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
@@ -542,7 +572,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::rfind(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string_view::rfind(): received nullptr");
return std::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -550,7 +580,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type rfind(const _CharT* __s, size_type __pos=npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::rfind(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string_view::rfind(): received nullptr");
return std::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -559,7 +589,8 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_first_of(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s.size() == 0 || __s.data() != nullptr,
+ "string_view::find_first_of(): received nullptr");
return std::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
@@ -571,7 +602,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string_view::find_first_of(): received nullptr");
return std::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -579,7 +610,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_first_of(const _CharT* __s, size_type __pos=0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string_view::find_first_of(): received nullptr");
return std::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -588,7 +619,8 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_last_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s.size() == 0 || __s.data() != nullptr,
+ "string_view::find_last_of(): received nullptr");
return std::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
@@ -600,7 +632,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string_view::find_last_of(): received nullptr");
return std::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -608,7 +640,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_last_of(const _CharT* __s, size_type __pos=npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string_view::find_last_of(): received nullptr");
return std::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -617,7 +649,8 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(basic_string_view __s, size_type __pos=0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s.size() == 0 || __s.data() != nullptr,
+ "string_view::find_first_not_of(): received nullptr");
return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
@@ -632,7 +665,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): received nullptr");
return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -640,7 +673,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(const _CharT* __s, size_type __pos=0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string_view::find_first_not_of(): received nullptr");
return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -649,7 +682,8 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s.size() == 0 || __s.data() != nullptr,
+ "string_view::find_last_not_of(): received nullptr");
return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
@@ -664,7 +698,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): received nullptr");
return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -672,13 +706,12 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(const _CharT* __s, size_type __pos=npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string_view::find_last_not_of(): received nullptr");
return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
-//WARN: disabled std guards in order to allow using these options without switching to new std
-//#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
constexpr _LIBCPP_INLINE_VISIBILITY
bool starts_with(basic_string_view __s) const noexcept
{ return size() >= __s.size() && compare(0, __s.size(), __s) == 0; }
@@ -702,7 +735,7 @@ public:
constexpr _LIBCPP_INLINE_VISIBILITY
bool ends_with(const value_type* __s) const noexcept
{ return ends_with(basic_string_view(__s)); }
-//#endif
+#endif
#if _LIBCPP_STD_VER >= 20
constexpr _LIBCPP_INLINE_VISIBILITY
@@ -724,23 +757,23 @@ private:
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(basic_string_view);
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _CharT, class _Traits>
inline constexpr bool ranges::enable_view<basic_string_view<_CharT, _Traits>> = true;
template <class _CharT, class _Traits>
inline constexpr bool ranges::enable_borrowed_range<basic_string_view<_CharT, _Traits> > = true;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
// [string.view.deduct]
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <contiguous_iterator _It, sized_sentinel_for<_It> _End>
basic_string_view(_It, _End) -> basic_string_view<iter_value_t<_It>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <ranges::contiguous_range _Range>
basic_string_view(_Range) -> basic_string_view<ranges::range_value_t<_Range>>;
#endif
@@ -777,11 +810,11 @@ bool operator==(__type_identity_t<basic_string_view<_CharT, _Traits> > __lhs,
if (__lhs.size() != __rhs.size()) return false;
return __lhs.compare(__rhs) == 0;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
// operator <=>
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI constexpr auto
@@ -811,7 +844,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto operator<=>(
}
}
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCPP_STD_VER >= 20
// operator !=
template<class _CharT, class _Traits>
@@ -944,7 +977,7 @@ bool operator>=(__type_identity_t<basic_string_view<_CharT, _Traits> > __lhs,
return __lhs.compare(__rhs) >= 0;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template<class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
@@ -980,20 +1013,20 @@ template <>
struct hash<basic_string_view<wchar_t, char_traits<wchar_t> > > : __string_view_hash<wchar_t> {};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
inline namespace literals
{
inline namespace string_view_literals
{
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- basic_string_view<char> operator "" sv(const char *__str, size_t __len) _NOEXCEPT
+ basic_string_view<char> operator""sv(const char *__str, size_t __len) _NOEXCEPT
{
return basic_string_view<char> (__str, __len);
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- basic_string_view<wchar_t> operator "" sv(const wchar_t *__str, size_t __len) _NOEXCEPT
+ basic_string_view<wchar_t> operator""sv(const wchar_t *__str, size_t __len) _NOEXCEPT
{
return basic_string_view<wchar_t> (__str, __len);
}
@@ -1001,20 +1034,20 @@ inline namespace literals
#ifndef _LIBCPP_HAS_NO_CHAR8_T
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- basic_string_view<char8_t> operator "" sv(const char8_t *__str, size_t __len) _NOEXCEPT
+ basic_string_view<char8_t> operator""sv(const char8_t *__str, size_t __len) _NOEXCEPT
{
return basic_string_view<char8_t> (__str, __len);
}
#endif
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- basic_string_view<char16_t> operator "" sv(const char16_t *__str, size_t __len) _NOEXCEPT
+ basic_string_view<char16_t> operator""sv(const char16_t *__str, size_t __len) _NOEXCEPT
{
return basic_string_view<char16_t> (__str, __len);
}
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- basic_string_view<char32_t> operator "" sv(const char32_t *__str, size_t __len) _NOEXCEPT
+ basic_string_view<char32_t> operator""sv(const char32_t *__str, size_t __len) _NOEXCEPT
{
return basic_string_view<char32_t> (__str, __len);
}
@@ -1028,8 +1061,9 @@ _LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <concepts>
-# include <functional>
+# include <cstdlib>
# include <iterator>
+# include <type_traits>
#endif
#endif // _LIBCPP_STRING_VIEW
diff --git a/contrib/libs/cxxsupp/libcxx/include/strstream b/contrib/libs/cxxsupp/libcxx/include/strstream
index 9382473f68f..35d655b8261 100644
--- a/contrib/libs/cxxsupp/libcxx/include/strstream
+++ b/contrib/libs/cxxsupp/libcxx/include/strstream
@@ -141,12 +141,12 @@ private:
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_TYPE_VIS strstreambuf
+class _LIBCPP_DEPRECATED _LIBCPP_EXPORTED_FROM_ABI strstreambuf
: public streambuf
{
public:
#ifndef _LIBCPP_CXX03_LANG
- strstreambuf() : strstreambuf(0) {}
+ _LIBCPP_HIDE_FROM_ABI strstreambuf() : strstreambuf(0) {}
explicit strstreambuf(streamsize __alsize);
#else
explicit strstreambuf(streamsize __alsize = 0);
@@ -237,7 +237,7 @@ strstreambuf::operator=(strstreambuf&& __rhs)
#endif // _LIBCPP_CXX03_LANG
-class _LIBCPP_TYPE_VIS istrstream
+class _LIBCPP_DEPRECATED _LIBCPP_EXPORTED_FROM_ABI istrstream
: public istream
{
public:
@@ -256,8 +256,8 @@ public:
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- istrstream(istrstream&& __rhs)
- : istream(_VSTD::move(__rhs)),
+ istrstream(istrstream&& __rhs) // extension
+ : istream(_VSTD::move(static_cast<istream&>(__rhs))),
__sb_(_VSTD::move(__rhs.__sb_))
{
istream::set_rdbuf(&__sb_);
@@ -290,7 +290,7 @@ private:
strstreambuf __sb_;
};
-class _LIBCPP_TYPE_VIS ostrstream
+class _LIBCPP_DEPRECATED _LIBCPP_EXPORTED_FROM_ABI ostrstream
: public ostream
{
public:
@@ -305,8 +305,8 @@ public:
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- ostrstream(ostrstream&& __rhs)
- : ostream(_VSTD::move(__rhs)),
+ ostrstream(ostrstream&& __rhs) // extension
+ : ostream(_VSTD::move(static_cast<ostream&>(__rhs))),
__sb_(_VSTD::move(__rhs.__sb_))
{
ostream::set_rdbuf(&__sb_);
@@ -343,7 +343,7 @@ private:
strstreambuf __sb_; // exposition only
};
-class _LIBCPP_TYPE_VIS strstream
+class _LIBCPP_DEPRECATED _LIBCPP_EXPORTED_FROM_ABI strstream
: public iostream
{
public:
@@ -365,8 +365,8 @@ public:
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- strstream(strstream&& __rhs)
- : iostream(_VSTD::move(__rhs)),
+ strstream(strstream&& __rhs) // extension
+ : iostream(_VSTD::move(static_cast<iostream&>(__rhs))),
__sb_(_VSTD::move(__rhs.__sb_))
{
iostream::set_rdbuf(&__sb_);
diff --git a/contrib/libs/cxxsupp/libcxx/include/system_error b/contrib/libs/cxxsupp/libcxx/include/system_error
index 98919927bc0..a60c98492aa 100644
--- a/contrib/libs/cxxsupp/libcxx/include/system_error
+++ b/contrib/libs/cxxsupp/libcxx/include/system_error
@@ -146,13 +146,11 @@ template <> struct hash<std::error_condition>;
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
-#include <__errc>
-#include <__functional/hash.h>
-#include <__functional/unary_function.h>
-#include <__memory/addressof.h>
-#include <stdexcept>
-#include <string>
-#include <type_traits>
+#include <__system_error/errc.h>
+#include <__system_error/error_category.h>
+#include <__system_error/error_code.h>
+#include <__system_error/error_condition.h>
+#include <__system_error/system_error.h>
#include <version>
// standard-mandated includes
@@ -164,385 +162,11 @@ template <> struct hash<std::error_condition>;
# pragma GCC system_header
#endif
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-// is_error_code_enum
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_error_code_enum
- : public false_type {};
-
-#if _LIBCPP_STD_VER > 14
-template <class _Tp>
-inline constexpr bool is_error_code_enum_v = is_error_code_enum<_Tp>::value;
-#endif
-
-// is_error_condition_enum
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum
- : public false_type {};
-
-#if _LIBCPP_STD_VER > 14
-template <class _Tp>
-inline constexpr bool is_error_condition_enum_v = is_error_condition_enum<_Tp>::value;
-#endif
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum<errc>
- : true_type { };
-
-#ifdef _LIBCPP_CXX03_LANG
-template <>
-struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum<errc::__lx>
- : true_type { };
-#endif
-
-class _LIBCPP_TYPE_VIS error_condition;
-class _LIBCPP_TYPE_VIS error_code;
-
-// class error_category
-
-class _LIBCPP_HIDDEN __do_message;
-
-class _LIBCPP_TYPE_VIS error_category
-{
-public:
- virtual ~error_category() _NOEXCEPT;
-
-#if defined(_LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS)
- error_category() noexcept;
-#else
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR_SINCE_CXX14 error_category() _NOEXCEPT = default;
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdint>
+# include <cstring>
+# include <limits>
+# include <type_traits>
#endif
- error_category(const error_category&) = delete;
- error_category& operator=(const error_category&) = delete;
-
- virtual const char* name() const _NOEXCEPT = 0;
- virtual error_condition default_error_condition(int __ev) const _NOEXCEPT;
- virtual bool equivalent(int __code, const error_condition& __condition) const _NOEXCEPT;
- virtual bool equivalent(const error_code& __code, int __condition) const _NOEXCEPT;
- virtual string message(int __ev) const = 0;
-
- _LIBCPP_INLINE_VISIBILITY
- bool operator==(const error_category& __rhs) const _NOEXCEPT {return this == &__rhs;}
-
-#if _LIBCPP_STD_VER > 17
-
- _LIBCPP_HIDE_FROM_ABI
- strong_ordering operator<=>(const error_category& __rhs) const noexcept {return compare_three_way()(this, std::addressof(__rhs));}
-
-#else // _LIBCPP_STD_VER > 17
-
- _LIBCPP_INLINE_VISIBILITY
- bool operator!=(const error_category& __rhs) const _NOEXCEPT {return !(*this == __rhs);}
-
- _LIBCPP_INLINE_VISIBILITY
- bool operator< (const error_category& __rhs) const _NOEXCEPT {return this < &__rhs;}
-
-#endif // _LIBCPP_STD_VER > 17
-
- friend class _LIBCPP_HIDDEN __do_message;
-};
-
-class _LIBCPP_HIDDEN __do_message
- : public error_category
-{
-public:
- string message(int __ev) const override;
-};
-
-_LIBCPP_FUNC_VIS const error_category& generic_category() _NOEXCEPT;
-_LIBCPP_FUNC_VIS const error_category& system_category() _NOEXCEPT;
-
-namespace __adl_only {
- // Those cause ADL to trigger but they are not viable candidates,
- // so they are never actually selected.
- void make_error_condition() = delete;
- void make_error_code() = delete;
-} // namespace __adl_only
-
-class _LIBCPP_TYPE_VIS error_condition
-{
- int __val_;
- const error_category* __cat_;
-public:
- _LIBCPP_INLINE_VISIBILITY
- error_condition() _NOEXCEPT : __val_(0), __cat_(&generic_category()) {}
-
- _LIBCPP_INLINE_VISIBILITY
- error_condition(int __val, const error_category& __cat) _NOEXCEPT
- : __val_(__val), __cat_(&__cat) {}
-
- template <class _Ep>
- _LIBCPP_INLINE_VISIBILITY
- error_condition(_Ep __e,
- typename enable_if<is_error_condition_enum<_Ep>::value>::type* = nullptr
- ) _NOEXCEPT
- {
- using __adl_only::make_error_condition;
- *this = make_error_condition(__e);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void assign(int __val, const error_category& __cat) _NOEXCEPT
- {
- __val_ = __val;
- __cat_ = &__cat;
- }
-
- template <class _Ep>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- is_error_condition_enum<_Ep>::value,
- error_condition&
- >::type
- operator=(_Ep __e) _NOEXCEPT
- {
- using __adl_only::make_error_condition;
- *this = make_error_condition(__e);
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void clear() _NOEXCEPT
- {
- __val_ = 0;
- __cat_ = &generic_category();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- int value() const _NOEXCEPT {return __val_;}
-
- _LIBCPP_INLINE_VISIBILITY
- const error_category& category() const _NOEXCEPT {return *__cat_;}
- string message() const;
-
- _LIBCPP_INLINE_VISIBILITY
- explicit operator bool() const _NOEXCEPT {return __val_ != 0;}
-};
-
-inline _LIBCPP_INLINE_VISIBILITY
-error_condition
-make_error_condition(errc __e) _NOEXCEPT
-{
- return error_condition(static_cast<int>(__e), generic_category());
-}
-
-// error_code
-
-class _LIBCPP_TYPE_VIS error_code
-{
- int __val_;
- const error_category* __cat_;
-public:
- _LIBCPP_INLINE_VISIBILITY
- error_code() _NOEXCEPT : __val_(0), __cat_(&system_category()) {}
-
- _LIBCPP_INLINE_VISIBILITY
- error_code(int __val, const error_category& __cat) _NOEXCEPT
- : __val_(__val), __cat_(&__cat) {}
-
- template <class _Ep>
- _LIBCPP_INLINE_VISIBILITY
- error_code(_Ep __e,
- typename enable_if<is_error_code_enum<_Ep>::value>::type* = nullptr
- ) _NOEXCEPT
- {
- using __adl_only::make_error_code;
- *this = make_error_code(__e);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void assign(int __val, const error_category& __cat) _NOEXCEPT
- {
- __val_ = __val;
- __cat_ = &__cat;
- }
-
- template <class _Ep>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- is_error_code_enum<_Ep>::value,
- error_code&
- >::type
- operator=(_Ep __e) _NOEXCEPT
- {
- using __adl_only::make_error_code;
- *this = make_error_code(__e);
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void clear() _NOEXCEPT
- {
- __val_ = 0;
- __cat_ = &system_category();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- int value() const _NOEXCEPT {return __val_;}
-
- _LIBCPP_INLINE_VISIBILITY
- const error_category& category() const _NOEXCEPT {return *__cat_;}
-
- _LIBCPP_INLINE_VISIBILITY
- error_condition default_error_condition() const _NOEXCEPT
- {return __cat_->default_error_condition(__val_);}
-
- string message() const;
-
- _LIBCPP_INLINE_VISIBILITY
- explicit operator bool() const _NOEXCEPT {return __val_ != 0;}
-};
-
-inline _LIBCPP_INLINE_VISIBILITY
-error_code
-make_error_code(errc __e) _NOEXCEPT
-{
- return error_code(static_cast<int>(__e), generic_category());
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const error_code& __x, const error_code& __y) _NOEXCEPT
-{
- return __x.category() == __y.category() && __x.value() == __y.value();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const error_code& __x, const error_condition& __y) _NOEXCEPT
-{
- return __x.category().equivalent(__x.value(), __y)
- || __y.category().equivalent(__x, __y.value());
-}
-
-#if _LIBCPP_STD_VER <= 17
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const error_condition& __x, const error_code& __y) _NOEXCEPT
-{
- return __y == __x;
-}
-#endif
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const error_condition& __x, const error_condition& __y) _NOEXCEPT
-{
- return __x.category() == __y.category() && __x.value() == __y.value();
-}
-
-#if _LIBCPP_STD_VER <= 17
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const error_code& __x, const error_code& __y) _NOEXCEPT
-{return !(__x == __y);}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const error_code& __x, const error_condition& __y) _NOEXCEPT
-{return !(__x == __y);}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const error_condition& __x, const error_code& __y) _NOEXCEPT
-{return !(__x == __y);}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const error_condition& __x, const error_condition& __y) _NOEXCEPT
-{return !(__x == __y);}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<(const error_condition& __x, const error_condition& __y) _NOEXCEPT
-{
- return __x.category() < __y.category()
- || (__x.category() == __y.category() && __x.value() < __y.value());
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<(const error_code& __x, const error_code& __y) _NOEXCEPT
-{
- return __x.category() < __y.category()
- || (__x.category() == __y.category() && __x.value() < __y.value());
-}
-
-#else // _LIBCPP_STD_VER <= 17
-
-inline _LIBCPP_HIDE_FROM_ABI strong_ordering
-operator<=>(const error_code& __x, const error_code& __y) noexcept
-{
- if (auto __c = __x.category() <=> __y.category(); __c != 0)
- return __c;
- return __x.value() <=> __y.value();
-}
-
-inline _LIBCPP_HIDE_FROM_ABI strong_ordering
-operator<=>(const error_condition& __x, const error_condition& __y) noexcept
-{
- if (auto __c = __x.category() <=> __y.category(); __c != 0)
- return __c;
- return __x.value() <=> __y.value();
-}
-
-#endif // _LIBCPP_STD_VER <= 17
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<error_code>
- : public __unary_function<error_code, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(const error_code& __ec) const _NOEXCEPT
- {
- return static_cast<size_t>(__ec.value());
- }
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<error_condition>
- : public __unary_function<error_condition, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(const error_condition& __ec) const _NOEXCEPT
- {
- return static_cast<size_t>(__ec.value());
- }
-};
-
-// system_error
-
-class _LIBCPP_TYPE_VIS system_error
- : public runtime_error
-{
- error_code __ec_;
-public:
- system_error(error_code __ec, const string& __what_arg);
- system_error(error_code __ec, const char* __what_arg);
- system_error(error_code __ec);
- system_error(int __ev, const error_category& __ecat, const string& __what_arg);
- system_error(int __ev, const error_category& __ecat, const char* __what_arg);
- system_error(int __ev, const error_category& __ecat);
- system_error(const system_error&) _NOEXCEPT = default;
- ~system_error() _NOEXCEPT override;
-
- _LIBCPP_INLINE_VISIBILITY
- const error_code& code() const _NOEXCEPT {return __ec_;}
-
-private:
- static string __init(const error_code&, string);
-};
-
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS
-void __throw_system_error(int __ev, const char* __what_arg);
-
-_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_SYSTEM_ERROR
diff --git a/contrib/libs/cxxsupp/libcxx/include/thread b/contrib/libs/cxxsupp/libcxx/include/thread
index 7a1117f555a..4ddcf3ec79c 100644
--- a/contrib/libs/cxxsupp/libcxx/include/thread
+++ b/contrib/libs/cxxsupp/libcxx/include/thread
@@ -64,6 +64,9 @@ template<class charT, class traits>
basic_ostream<charT, traits>&
operator<<(basic_ostream<charT, traits>& out, thread::id id);
+template<class charT>
+struct formatter<thread::id, charT>;
+
namespace this_thread
{
@@ -84,19 +87,12 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
*/
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
-#include <__functional/hash.h>
-#include <__memory/unique_ptr.h>
-#include <__mutex_base>
-#include <__thread/poll_with_backoff.h>
-#include <__thread/timed_backoff_policy.h>
+#include <__thread/formatter.h>
+#include <__thread/this_thread.h>
+#include <__thread/thread.h>
#include <__threading_support>
-#include <__utility/forward.h>
-#include <cstddef>
-#include <iosfwd>
-#include <system_error>
-#include <tuple>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -108,314 +104,27 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
# pragma GCC system_header
#endif
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
#ifdef _LIBCPP_HAS_NO_THREADS
# error "<thread> is not supported since libc++ has been configured without support for threads."
#endif
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <class _Tp> class __thread_specific_ptr;
-class _LIBCPP_TYPE_VIS __thread_struct;
-class _LIBCPP_HIDDEN __thread_struct_imp;
-class __assoc_sub_state;
-
-_LIBCPP_FUNC_VIS __thread_specific_ptr<__thread_struct>& __thread_local_data();
-
-class _LIBCPP_TYPE_VIS __thread_struct
-{
- __thread_struct_imp* __p_;
-
- __thread_struct(const __thread_struct&);
- __thread_struct& operator=(const __thread_struct&);
-public:
- __thread_struct();
- ~__thread_struct();
-
- void notify_all_at_thread_exit(condition_variable*, mutex*);
- void __make_ready_at_thread_exit(__assoc_sub_state*);
-};
-
-template <class _Tp>
-class __thread_specific_ptr
-{
- __libcpp_tls_key __key_;
-
- // Only __thread_local_data() may construct a __thread_specific_ptr
- // and only with _Tp == __thread_struct.
- static_assert((is_same<_Tp, __thread_struct>::value), "");
- __thread_specific_ptr();
- friend _LIBCPP_FUNC_VIS __thread_specific_ptr<__thread_struct>& __thread_local_data();
-
- __thread_specific_ptr(const __thread_specific_ptr&);
- __thread_specific_ptr& operator=(const __thread_specific_ptr&);
-
- _LIBCPP_HIDDEN static void _LIBCPP_TLS_DESTRUCTOR_CC __at_thread_exit(void*);
-
-public:
- typedef _Tp* pointer;
-
- ~__thread_specific_ptr();
-
- _LIBCPP_INLINE_VISIBILITY
- pointer get() const {return static_cast<_Tp*>(__libcpp_tls_get(__key_));}
- _LIBCPP_INLINE_VISIBILITY
- pointer operator*() const {return *get();}
- _LIBCPP_INLINE_VISIBILITY
- pointer operator->() const {return get();}
- void set_pointer(pointer __p);
-};
-
-template <class _Tp>
-void _LIBCPP_TLS_DESTRUCTOR_CC
-__thread_specific_ptr<_Tp>::__at_thread_exit(void* __p)
-{
- delete static_cast<pointer>(__p);
-}
-
-template <class _Tp>
-__thread_specific_ptr<_Tp>::__thread_specific_ptr()
-{
- int __ec =
- __libcpp_tls_create(&__key_, &__thread_specific_ptr::__at_thread_exit);
- if (__ec)
- __throw_system_error(__ec, "__thread_specific_ptr construction failed");
-}
-
-template <class _Tp>
-__thread_specific_ptr<_Tp>::~__thread_specific_ptr()
-{
- // __thread_specific_ptr is only created with a static storage duration
- // so this destructor is only invoked during program termination. Invoking
- // pthread_key_delete(__key_) may prevent other threads from deleting their
- // thread local data. For this reason we leak the key.
-}
-
-template <class _Tp>
-void
-__thread_specific_ptr<_Tp>::set_pointer(pointer __p)
-{
- _LIBCPP_ASSERT(get() == nullptr,
- "Attempting to overwrite thread local data");
- std::__libcpp_tls_set(__key_, __p);
-}
-
-template<>
-struct _LIBCPP_TEMPLATE_VIS hash<__thread_id>
- : public __unary_function<__thread_id, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(__thread_id __v) const _NOEXCEPT
- {
- return hash<__libcpp_thread_id>()(__v.__id_);
- }
-};
-
-template<class _CharT, class _Traits>
-_LIBCPP_INLINE_VISIBILITY
-basic_ostream<_CharT, _Traits>&
-operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id)
-{return __os << __id.__id_;}
-
-class _LIBCPP_TYPE_VIS thread
-{
- __libcpp_thread_t __t_;
-
- thread(const thread&);
- thread& operator=(const thread&);
-public:
- typedef __thread_id id;
- typedef __libcpp_thread_t native_handle_type;
-
- _LIBCPP_INLINE_VISIBILITY
- thread() _NOEXCEPT : __t_(_LIBCPP_NULL_THREAD) {}
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Fp, class ..._Args,
- class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, thread>::value> >
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- explicit thread(_Fp&& __f, _Args&&... __args);
-#else // _LIBCPP_CXX03_LANG
- template <class _Fp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- explicit thread(_Fp __f);
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
+# include <cstddef>
+# include <ctime>
+# include <iosfwd>
+# include <ratio>
#endif
- ~thread();
-
- _LIBCPP_INLINE_VISIBILITY
- thread(thread&& __t) _NOEXCEPT : __t_(__t.__t_) {
- __t.__t_ = _LIBCPP_NULL_THREAD;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- thread& operator=(thread&& __t) _NOEXCEPT {
- if (!__libcpp_thread_isnull(&__t_))
- terminate();
- __t_ = __t.__t_;
- __t.__t_ = _LIBCPP_NULL_THREAD;
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void swap(thread& __t) _NOEXCEPT {_VSTD::swap(__t_, __t.__t_);}
-
- _LIBCPP_INLINE_VISIBILITY
- bool joinable() const _NOEXCEPT {return !__libcpp_thread_isnull(&__t_);}
- void join();
- void detach();
- _LIBCPP_INLINE_VISIBILITY
- id get_id() const _NOEXCEPT {return __libcpp_thread_get_id(&__t_);}
- _LIBCPP_INLINE_VISIBILITY
- native_handle_type native_handle() _NOEXCEPT {return __t_;}
-
- static unsigned hardware_concurrency() _NOEXCEPT;
-};
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _TSp, class _Fp, class ..._Args, size_t ..._Indices>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-__thread_execute(tuple<_TSp, _Fp, _Args...>& __t, __tuple_indices<_Indices...>)
-{
- _VSTD::__invoke(_VSTD::move(_VSTD::get<1>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
-}
-
-template <class _Fp>
-_LIBCPP_INLINE_VISIBILITY
-void* __thread_proxy(void* __vp)
-{
- // _Fp = tuple< unique_ptr<__thread_struct>, Functor, Args...>
- unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
- __thread_local_data().set_pointer(_VSTD::get<0>(*__p.get()).release());
- typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 2>::type _Index;
- _VSTD::__thread_execute(*__p.get(), _Index());
- return nullptr;
-}
-
-template <class _Fp, class ..._Args,
- class
- >
-thread::thread(_Fp&& __f, _Args&&... __args)
-{
- typedef unique_ptr<__thread_struct> _TSPtr;
- _TSPtr __tsp(new __thread_struct);
- typedef tuple<_TSPtr, typename decay<_Fp>::type, typename decay<_Args>::type...> _Gp;
- unique_ptr<_Gp> __p(
- new _Gp(_VSTD::move(__tsp),
- _VSTD::forward<_Fp>(__f),
- _VSTD::forward<_Args>(__args)...));
- int __ec = _VSTD::__libcpp_thread_create(&__t_, &__thread_proxy<_Gp>, __p.get());
- if (__ec == 0)
- __p.release();
- else
- __throw_system_error(__ec, "thread constructor failed");
-}
-
-#else // _LIBCPP_CXX03_LANG
-
-template <class _Fp>
-struct __thread_invoke_pair {
- // This type is used to pass memory for thread local storage and a functor
- // to a newly created thread because std::pair doesn't work with
- // std::unique_ptr in C++03.
- __thread_invoke_pair(_Fp& __f) : __tsp_(new __thread_struct), __fn_(__f) {}
- unique_ptr<__thread_struct> __tsp_;
- _Fp __fn_;
-};
-
-template <class _Fp>
-_LIBCPP_HIDE_FROM_ABI void* __thread_proxy_cxx03(void* __vp)
-{
- unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
- __thread_local_data().set_pointer(__p->__tsp_.release());
- (__p->__fn_)();
- return nullptr;
-}
-
-template <class _Fp>
-thread::thread(_Fp __f)
-{
-
- typedef __thread_invoke_pair<_Fp> _InvokePair;
- typedef unique_ptr<_InvokePair> _PairPtr;
- _PairPtr __pp(new _InvokePair(__f));
- int __ec = _VSTD::__libcpp_thread_create(&__t_, &__thread_proxy_cxx03<_InvokePair>, __pp.get());
- if (__ec == 0)
- __pp.release();
- else
- __throw_system_error(__ec, "thread constructor failed");
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
-inline _LIBCPP_INLINE_VISIBILITY
-void swap(thread& __x, thread& __y) _NOEXCEPT {__x.swap(__y);}
-
-namespace this_thread
-{
-
-_LIBCPP_FUNC_VIS void sleep_for(const chrono::nanoseconds& __ns);
-
-template <class _Rep, class _Period>
-_LIBCPP_HIDE_FROM_ABI void
-sleep_for(const chrono::duration<_Rep, _Period>& __d)
-{
- if (__d > chrono::duration<_Rep, _Period>::zero())
- {
- // The standard guarantees a 64bit signed integer resolution for nanoseconds,
- // so use INT64_MAX / 1e9 as cut-off point. Use a constant to avoid <climits>
- // and issues with long double folding on PowerPC with GCC.
- _LIBCPP_CONSTEXPR chrono::duration<long double> _Max =
- chrono::duration<long double>(9223372036.0L);
- chrono::nanoseconds __ns;
- if (__d < _Max)
- {
- __ns = chrono::duration_cast<chrono::nanoseconds>(__d);
- if (__ns < __d)
- ++__ns;
- }
- else
- __ns = chrono::nanoseconds::max();
- this_thread::sleep_for(__ns);
- }
-}
-
-template <class _Clock, class _Duration>
-_LIBCPP_HIDE_FROM_ABI void
-sleep_until(const chrono::time_point<_Clock, _Duration>& __t)
-{
- mutex __mut;
- condition_variable __cv;
- unique_lock<mutex> __lk(__mut);
- while (_Clock::now() < __t)
- __cv.wait_until(__lk, __t);
-}
-
-template <class _Duration>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-sleep_until(const chrono::time_point<chrono::steady_clock, _Duration>& __t)
-{
- this_thread::sleep_for(__t - chrono::steady_clock::now());
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-void yield() _NOEXCEPT {__libcpp_thread_yield();}
-
-} // namespace this_thread
-
-_LIBCPP_END_NAMESPACE_STD
-
-_LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
# include <chrono>
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstring>
# include <functional>
+# include <new>
+# include <system_error>
+# include <type_traits>
#endif
#endif // _LIBCPP_THREAD
diff --git a/contrib/libs/cxxsupp/libcxx/include/tuple b/contrib/libs/cxxsupp/libcxx/include/tuple
index 221b50375d8..8769e2569db 100644
--- a/contrib/libs/cxxsupp/libcxx/include/tuple
+++ b/contrib/libs/cxxsupp/libcxx/include/tuple
@@ -206,10 +206,18 @@ template <class... Types>
#include <__compare/synth_three_way.h>
#include <__config>
#include <__functional/invoke.h>
-#include <__functional/unwrap_ref.h>
#include <__fwd/array.h>
+#include <__fwd/get.h>
+#include <__fwd/tuple.h>
#include <__memory/allocator_arg_t.h>
#include <__memory/uses_allocator.h>
+#include <__tuple/make_tuple_types.h>
+#include <__tuple/sfinae_helpers.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_indices.h>
+#include <__tuple/tuple_like_ext.h>
+#include <__tuple/tuple_size.h>
+#include <__tuple/tuple_types.h>
#include <__type_traits/apply_cv.h>
#include <__type_traits/common_reference.h>
#include <__type_traits/common_type.h>
@@ -244,6 +252,7 @@ template <class... Types>
#include <__type_traits/negation.h>
#include <__type_traits/remove_cvref.h>
#include <__type_traits/remove_reference.h>
+#include <__type_traits/unwrap_ref.h>
#include <__utility/forward.h>
#include <__utility/integer_sequence.h>
#include <__utility/move.h>
@@ -262,6 +271,9 @@ template <class... Types>
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_CXX03_LANG
@@ -295,7 +307,7 @@ class __tuple_leaf
_Hp __value_;
template <class _Tp>
- static constexpr bool __can_bind_reference() {
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __can_bind_reference() {
#if __has_keyword(__reference_binds_to_temporary) && !defined(__CUDACC__)
return !__reference_binds_to_temporary(_Hp, _Tp);
#else
@@ -367,8 +379,8 @@ public:
{static_assert(!is_reference<_Hp>::value,
"Attempted to uses-allocator construct a reference element in a tuple");}
- __tuple_leaf(const __tuple_leaf& __t) = default;
- __tuple_leaf(__tuple_leaf&& __t) = default;
+ _LIBCPP_HIDE_FROM_ABI __tuple_leaf(const __tuple_leaf& __t) = default;
+ _LIBCPP_HIDE_FROM_ABI __tuple_leaf(__tuple_leaf&& __t) = default;
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
int swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value)
@@ -865,7 +877,7 @@ public:
: __base_(allocator_arg_t(), __a, __t)
{ }
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
// tuple(tuple<U...>&) constructors (including allocator_arg_t variants)
template <class... _Up, enable_if_t<
@@ -879,7 +891,7 @@ public:
_LIBCPP_HIDE_FROM_ABI constexpr
explicit(!(is_convertible_v<_Up&, _Tp> && ...))
tuple(allocator_arg_t, const _Alloc& __alloc, tuple<_Up...>& __t) : __base_(allocator_arg_t(), __alloc, __t) {}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
// tuple(tuple<U...>&&) constructors (including allocator_arg_t variants)
@@ -929,7 +941,7 @@ public:
: __base_(allocator_arg_t(), __a, _VSTD::move(__t))
{ }
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
// tuple(const tuple<U...>&&) constructors (including allocator_arg_t variants)
template <class... _Up, enable_if_t<
@@ -944,17 +956,17 @@ public:
explicit(!(is_convertible_v<const _Up&&, _Tp> && ...))
tuple(allocator_arg_t, const _Alloc& __alloc, const tuple<_Up...>&& __t)
: __base_(allocator_arg_t(), __alloc, std::move(__t)) {}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
// tuple(const pair<U1, U2>&) constructors (including allocator_arg_t variants)
- template <template <class...> class Pred, class _Pair, class _DecayedPair = __remove_cvref_t<_Pair>, class _Tuple = tuple>
+ template <template <class...> class _Pred, class _Pair, class _DecayedPair = __remove_cvref_t<_Pair>, class _Tuple = tuple>
struct _CtorPredicateFromPair : false_type{};
- template <template <class...> class Pred, class _Pair, class _Up1, class _Up2, class _Tp1, class _Tp2>
- struct _CtorPredicateFromPair<Pred, _Pair, pair<_Up1, _Up2>, tuple<_Tp1, _Tp2> > : _And<
- Pred<_Tp1, __copy_cvref_t<_Pair, _Up1> >,
- Pred<_Tp2, __copy_cvref_t<_Pair, _Up2> >
+ template <template <class...> class _Pred, class _Pair, class _Up1, class _Up2, class _Tp1, class _Tp2>
+ struct _CtorPredicateFromPair<_Pred, _Pair, pair<_Up1, _Up2>, tuple<_Tp1, _Tp2> > : _And<
+ _Pred<_Tp1, __copy_cvref_t<_Pair, _Up1> >,
+ _Pred<_Tp2, __copy_cvref_t<_Pair, _Up2> >
> {};
template <class _Pair>
@@ -1018,7 +1030,7 @@ public:
: __base_(allocator_arg_t(), __a, __p)
{ }
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
// tuple(pair<U1, U2>&) constructors (including allocator_arg_t variants)
template <class _U1, class _U2, enable_if_t<
@@ -1082,7 +1094,7 @@ public:
: __base_(allocator_arg_t(), __a, _VSTD::move(__p))
{ }
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
// tuple(const pair<U1, U2>&&) constructors (including allocator_arg_t variants)
template <class _U1, class _U2, enable_if_t<
@@ -1097,7 +1109,7 @@ public:
explicit(!_BothImplicitlyConvertible<const pair<_U1, _U2>&&>::value)
tuple(allocator_arg_t, const _Alloc& __alloc, const pair<_U1, _U2>&& __p)
: __base_(allocator_arg_t(), __alloc, std::move(__p)) {}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
// [tuple.assign]
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1109,7 +1121,7 @@ public:
return *this;
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr
const tuple& operator=(tuple const& __tuple) const
requires (_And<is_copy_assignable<const _Tp>...>::value) {
@@ -1126,7 +1138,7 @@ public:
typename __make_tuple_indices<sizeof...(_Tp)>::type());
return *this;
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
tuple& operator=(_If<_And<is_move_assignable<_Tp>...>::value, tuple, __nat>&& __tuple)
@@ -1170,7 +1182,7 @@ public:
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class... _UTypes, enable_if_t<
_And<_BoolConstant<sizeof...(_Tp) == sizeof...(_UTypes)>,
is_assignable<const _Tp&, const _UTypes&>...>::value>* = nullptr>
@@ -1193,17 +1205,17 @@ public:
typename __make_tuple_indices<sizeof...(_Tp)>::type());
return *this;
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
- template <template<class...> class Pred, bool _Const,
+ template <template<class...> class _Pred, bool _Const,
class _Pair, class _DecayedPair = __remove_cvref_t<_Pair>, class _Tuple = tuple>
struct _AssignPredicateFromPair : false_type {};
- template <template<class...> class Pred, bool _Const,
+ template <template<class...> class _Pred, bool _Const,
class _Pair, class _Up1, class _Up2, class _Tp1, class _Tp2>
- struct _AssignPredicateFromPair<Pred, _Const, _Pair, pair<_Up1, _Up2>, tuple<_Tp1, _Tp2> > :
- _And<Pred<__maybe_const<_Const, _Tp1>&, __copy_cvref_t<_Pair, _Up1> >,
- Pred<__maybe_const<_Const, _Tp2>&, __copy_cvref_t<_Pair, _Up2> >
+ struct _AssignPredicateFromPair<_Pred, _Const, _Pair, pair<_Up1, _Up2>, tuple<_Tp1, _Tp2> > :
+ _And<_Pred<__maybe_const<_Const, _Tp1>&, __copy_cvref_t<_Pair, _Up1> >,
+ _Pred<__maybe_const<_Const, _Tp2>&, __copy_cvref_t<_Pair, _Up2> >
> {};
template <bool _Const, class _Pair>
@@ -1212,7 +1224,7 @@ public:
template <bool _Const, class _Pair>
struct _NothrowAssignFromPair : _AssignPredicateFromPair<is_nothrow_assignable, _Const, _Pair> {};
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _U1, class _U2, enable_if_t<
_EnableAssignFromPair<true, const pair<_U1, _U2>&>::value>* = nullptr>
_LIBCPP_HIDE_FROM_ABI constexpr
@@ -1232,7 +1244,7 @@ public:
std::get<1>(*this) = std::move(__pair.second);
return *this;
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
template<class _Up1, class _Up2, __enable_if_t<
_EnableAssignFromPair<false, pair<_Up1, _Up2> const&>::value
@@ -1296,20 +1308,19 @@ public:
void swap(tuple& __t) _NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
{__base_.swap(__t.__base_);}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr
void swap(const tuple& __t) const noexcept(__all<is_nothrow_swappable_v<const _Tp&>...>::value) {
__base_.swap(__t.__base_);
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
};
template <>
class _LIBCPP_TEMPLATE_VIS tuple<>
{
public:
- _LIBCPP_INLINE_VISIBILITY constexpr
- tuple() _NOEXCEPT = default;
+ constexpr tuple() _NOEXCEPT = default;
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
tuple(allocator_arg_t, const _Alloc&) _NOEXCEPT {}
@@ -1324,12 +1335,12 @@ public:
tuple(allocator_arg_t, const _Alloc&, array<_Up, 0>) _NOEXCEPT {}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
void swap(tuple&) _NOEXCEPT {}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr void swap(const tuple&) const noexcept {}
#endif
};
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class... _TTypes, class... _UTypes, template<class> class _TQual, template<class> class _UQual>
requires requires { typename tuple<common_reference_t<_TQual<_TTypes>, _UQual<_UTypes>>...>; }
struct basic_common_reference<tuple<_TTypes...>, tuple<_UTypes...>, _TQual, _UQual> {
@@ -1341,9 +1352,9 @@ template <class... _TTypes, class... _UTypes>
struct common_type<tuple<_TTypes...>, tuple<_UTypes...>> {
using type = tuple<common_type_t<_TTypes, _UTypes>...>;
};
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class ..._Tp>
tuple(_Tp...) -> tuple<_Tp...>;
template <class _Tp1, class _Tp2>
@@ -1363,7 +1374,7 @@ swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u)
_NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
{__t.swap(__u);}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class... _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr
enable_if_t<__all<is_swappable_v<const _Tp>...>::value, void>
@@ -1413,7 +1424,7 @@ get(const tuple<_Tp...>&& __t) _NOEXCEPT
static_cast<const __tuple_leaf<_Ip, type>&&>(__t.__base_).get());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
namespace __find_detail {
@@ -1501,9 +1512,13 @@ struct __ignore_t
const __ignore_t& operator=(_Tp&&) const {return *this;}
};
+# if _LIBCPP_STD_VER >= 17
+inline constexpr __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>();
+# else
namespace {
constexpr __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>();
} // namespace
+# endif
template <class... _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
@@ -1552,7 +1567,7 @@ operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
return __tuple_equal<sizeof...(_Tp)>()(__x, __y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// operator<=>
@@ -1574,7 +1589,7 @@ operator<=>(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
return _VSTD::__tuple_compare_three_way(__x, __y, index_sequence_for<_Tp...>{});
}
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCPP_STD_VER >= 20
template <class ..._Tp, class ..._Up>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
@@ -1644,7 +1659,7 @@ operator<=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
return !(__y < __x);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
// tuple_cat
@@ -1712,17 +1727,15 @@ template <class ..._Types, size_t ..._I0, class _Tuple0>
struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>, _Tuple0>
{
typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tuple0> _T0;
- typedef tuple<_Types..., typename __apply_cv<_Tuple0,
- typename tuple_element<_I0, _T0>::type>::type&&...> type;
+ typedef tuple<_Types..., __apply_cv_t<_Tuple0, typename tuple_element<_I0, _T0>::type>&&...> type;
};
template <class ..._Types, size_t ..._I0, class _Tuple0, class _Tuple1, class ..._Tuples>
struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>,
_Tuple0, _Tuple1, _Tuples...>
: public __tuple_cat_return_ref_imp<
- tuple<_Types..., typename __apply_cv<_Tuple0,
- typename tuple_element<_I0,
- __libcpp_remove_reference_t<_Tuple0> >::type>::type&&...>,
+ tuple<_Types..., __apply_cv_t<_Tuple0,
+ typename tuple_element<_I0, __libcpp_remove_reference_t<_Tuple0>>::type>&&...>,
typename __make_tuple_indices<tuple_size<__libcpp_remove_reference_t<_Tuple1> >::value>::type,
_Tuple1, _Tuples...>
{
@@ -1762,13 +1775,9 @@ struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J
(void)__t; // avoid unused parameter warning on GCC when _I0 is empty
typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tuple0> _T0;
typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tuple1> _T1;
- return __tuple_cat<
- tuple<_Types...,
- typename __apply_cv<_Tuple0, typename tuple_element<
- _J0, _T0>::type>::type&&...>,
- typename __make_tuple_indices<sizeof...(_Types) +
- tuple_size<_T0>::value>::type,
- typename __make_tuple_indices<tuple_size<_T1>::value>::type>()(
+ return __tuple_cat<tuple<_Types..., __apply_cv_t<_Tuple0, typename tuple_element<_J0, _T0>::type>&&...>,
+ typename __make_tuple_indices<sizeof...(_Types) + tuple_size<_T0>::value>::type,
+ typename __make_tuple_indices<tuple_size<_T1>::value>::type>()(
_VSTD::forward_as_tuple(
_VSTD::forward<_Types>(_VSTD::get<_I0>(__t))...,
_VSTD::get<_J0>(_VSTD::forward<_Tuple0>(__t0))...),
@@ -1803,7 +1812,7 @@ pair<_T1, _T2>::pair(piecewise_construct_t,
{
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr size_t tuple_size_v = tuple_size<_Tp>::value;
@@ -1845,12 +1854,14 @@ _LIBCPP_NOEXCEPT_RETURN(
#undef _LIBCPP_NOEXCEPT_RETURN
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // !defined(_LIBCPP_CXX03_LANG)
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <exception>
# include <iosfwd>
diff --git a/contrib/libs/cxxsupp/libcxx/include/type_traits b/contrib/libs/cxxsupp/libcxx/include/type_traits
index 7646f580598..466aeb6e0dd 100644
--- a/contrib/libs/cxxsupp/libcxx/include/type_traits
+++ b/contrib/libs/cxxsupp/libcxx/include/type_traits
@@ -51,7 +51,7 @@ namespace std
template <class T> struct is_arithmetic;
template <class T> struct is_fundamental;
template <class T> struct is_member_pointer;
- template <class T> struct is_scoped_enum; // C++2b
+ template <class T> struct is_scoped_enum; // C++23
template <class T> struct is_scalar;
template <class T> struct is_object;
template <class T> struct is_compound;
@@ -286,7 +286,7 @@ namespace std
template <class T> inline constexpr bool is_member_pointer_v
= is_member_pointer<T>::value; // C++17
template <class T> inline constexpr bool is_scoped_enum_v
- = is_scoped_enum<T>::value; // C++2b
+ = is_scoped_enum<T>::value; // C++23
// See C++14 20.10.4.3, type properties
template <class T> inline constexpr bool is_const_v
@@ -418,7 +418,6 @@ namespace std
*/
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
-#include <__functional/invoke.h>
#include <__fwd/hash.h> // This is https://llvm.org/PR56938
#include <__type_traits/add_const.h>
#include <__type_traits/add_cv.h>
@@ -443,6 +442,7 @@ namespace std
#include <__type_traits/has_unique_object_representation.h>
#include <__type_traits/has_virtual_destructor.h>
#include <__type_traits/integral_constant.h>
+#include <__type_traits/invoke.h>
#include <__type_traits/is_abstract.h>
#include <__type_traits/is_aggregate.h>
#include <__type_traits/is_arithmetic.h>
@@ -532,6 +532,7 @@ namespace std
#include <__type_traits/result_of.h>
#include <__type_traits/type_identity.h>
#include <__type_traits/underlying_type.h>
+#include <__type_traits/unwrap_ref.h>
#include <__type_traits/void_t.h>
#include <__utility/declval.h>
#include <cstddef>
diff --git a/contrib/libs/cxxsupp/libcxx/include/typeindex b/contrib/libs/cxxsupp/libcxx/include/typeindex
index e3132c8cb85..251aa430610 100644
--- a/contrib/libs/cxxsupp/libcxx/include/typeindex
+++ b/contrib/libs/cxxsupp/libcxx/include/typeindex
@@ -87,7 +87,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
bool operator>=(const type_index& __y) const _NOEXCEPT
{return !__t_->before(*__y.__t_);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI
strong_ordering operator<=>(const type_index& __y) const noexcept {
if (*__t_ == *__y.__t_)
diff --git a/contrib/libs/cxxsupp/libcxx/include/typeinfo b/contrib/libs/cxxsupp/libcxx/include/typeinfo
index 4b81216b789..0a640bf984b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/typeinfo
+++ b/contrib/libs/cxxsupp/libcxx/include/typeinfo
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef __LIBCPP_TYPEINFO
-#define __LIBCPP_TYPEINFO
+#ifndef _LIBCPP_TYPEINFO
+#define _LIBCPP_TYPEINFO
/*
@@ -21,7 +21,7 @@ class type_info
public:
virtual ~type_info();
- bool operator==(const type_info& rhs) const noexcept;
+ bool operator==(const type_info& rhs) const noexcept; // constexpr since C++23
bool operator!=(const type_info& rhs) const noexcept; // removed in C++20
bool before(const type_info& rhs) const noexcept;
@@ -59,11 +59,11 @@ public:
#include <__assert> // all public C++ headers provide the assertion handler
#include <__availability>
#include <__config>
+#include <__exception/exception.h>
+#include <__type_traits/is_constant_evaluated.h>
+#include <__verbose_abort>
#include <cstddef>
#include <cstdint>
-#include <cstdlib>
-#include <exception>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -79,7 +79,7 @@ namespace std // purposefully not using versioning namespace
#if defined(_LIBCPP_ABI_MICROSOFT)
-class _LIBCPP_EXCEPTION_ABI type_info
+class _LIBCPP_EXPORTED_FROM_ABI type_info
{
type_info& operator=(const type_info&);
type_info(const type_info&);
@@ -109,8 +109,13 @@ public:
// https://github.com/emscripten-core/emscripten/issues/13330
__attribute__((always_inline))
#endif
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
bool operator==(const type_info& __arg) const _NOEXCEPT {
+ // When evaluated in a constant expression, both type infos simply can't come
+ // from different translation units, so it is sufficient to compare their addresses.
+ if (__libcpp_is_constant_evaluated()) {
+ return this == &__arg;
+ }
return __compare(__arg) == 0;
}
@@ -299,7 +304,7 @@ struct __type_info_implementations {
__impl;
};
-class _LIBCPP_EXCEPTION_ABI type_info
+class _LIBCPP_EXPORTED_FROM_ABI type_info
{
type_info& operator=(const type_info&);
type_info(const type_info&);
@@ -335,9 +340,14 @@ public:
return __impl::__hash(__type_name);
}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
bool operator==(const type_info& __arg) const _NOEXCEPT
{
+ // When evaluated in a constant expression, both type infos simply can't come
+ // from different translation units, so it is sufficient to compare their addresses.
+ if (__libcpp_is_constant_evaluated()) {
+ return this == &__arg;
+ }
return __impl::__eq(__type_name, __arg.__type_name);
}
@@ -349,7 +359,7 @@ public:
};
#endif // defined(_LIBCPP_ABI_MICROSOFT)
-class _LIBCPP_EXCEPTION_ABI bad_cast
+class _LIBCPP_EXPORTED_FROM_ABI bad_cast
: public exception
{
public:
@@ -362,13 +372,13 @@ class _LIBCPP_EXCEPTION_ABI bad_cast
}
#else
bad_cast() _NOEXCEPT;
- bad_cast(const bad_cast&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI bad_cast(const bad_cast&) _NOEXCEPT = default;
~bad_cast() _NOEXCEPT override;
const char* what() const _NOEXCEPT override;
#endif
};
-class _LIBCPP_EXCEPTION_ABI bad_typeid
+class _LIBCPP_EXPORTED_FROM_ABI bad_typeid
: public exception
{
public:
@@ -422,12 +432,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_cast()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_cast();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_cast was thrown in -fno-exceptions mode");
#endif
}
_LIBCPP_END_NAMESPACE_STD
-#endif // __LIBCPP_TYPEINFO
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdlib>
+# include <exception>
+# include <type_traits>
+#endif
+
+#endif // _LIBCPP_TYPEINFO
diff --git a/contrib/libs/cxxsupp/libcxx/include/unordered_map b/contrib/libs/cxxsupp/libcxx/include/unordered_map
index 14f93bab36e..8d83063bbea 100644
--- a/contrib/libs/cxxsupp/libcxx/include/unordered_map
+++ b/contrib/libs/cxxsupp/libcxx/include/unordered_map
@@ -59,6 +59,11 @@ public:
size_type n = 0, const hasher& hf = hasher(),
const key_equal& eql = key_equal(),
const allocator_type& a = allocator_type());
+ template<container-compatible-range<value_type> R>
+ unordered_map(from_range_t, R&& rg, size_type n = see below,
+ const hasher& hf = hasher(), const key_equal& eql = key_equal(),
+ const allocator_type& a = allocator_type()); // C++23
+
explicit unordered_map(const allocator_type&);
unordered_map(const unordered_map&);
unordered_map(const unordered_map&, const Allocator&);
@@ -82,6 +87,12 @@ public:
unordered_map(InputIterator f, InputIterator l, size_type n, const hasher& hf,
const allocator_type& a)
: unordered_map(f, l, n, hf, key_equal(), a) {} // C++14
+ template<container-compatible-range<value_type> R>
+ unordered_map(from_range_t, R&& rg, size_type n, const allocator_type& a)
+ : unordered_map(from_range, std::forward<R>(rg), n, hasher(), key_equal(), a) { } // C++23
+ template<container-compatible-range<value_type> R>
+ unordered_map(from_range_t, R&& rg, size_type n, const hasher& hf, const allocator_type& a)
+ : unordered_map(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { } // C++23
unordered_map(initializer_list<value_type> il, size_type n, const allocator_type& a)
: unordered_map(il, n, hasher(), key_equal(), a) {} // C++14
unordered_map(initializer_list<value_type> il, size_type n, const hasher& hf,
@@ -122,6 +133,8 @@ public:
iterator insert(const_iterator hint, P&& obj);
template <class InputIterator>
void insert(InputIterator first, InputIterator last);
+ template<container-compatible-range<value_type> R>
+ void insert_range(R&& rg); // C++23
void insert(initializer_list<value_type>);
node_type extract(const_iterator position); // C++17
@@ -224,6 +237,13 @@ unordered_map(InputIterator, InputIterator, typename see below::size_type = see
-> unordered_map<iter_key_t<InputIterator>, iter_value_t<InputIterator>, Hash, Pred,
Allocator>; // C++17
+template<ranges::input_range R, class Hash = hash<range-key-type<R>>,
+ class Pred = equal_to<range-key-type<R>>,
+ class Allocator = allocator<range-to-alloc-type<R>>>
+ unordered_map(from_range_t, R&&, typename see below::size_type = see below,
+ Hash = Hash(), Pred = Pred(), Allocator = Allocator())
+ -> unordered_map<range-key-type<R>, range-mapped-type<R>, Hash, Pred, Allocator>; // C++23
+
template<class Key, class T, class Hash = hash<Key>,
class Pred = equal_to<Key>, class Allocator = allocator<pair<const Key, T>>>
unordered_map(initializer_list<pair<const Key, T>>, typename see below::size_type = see below,
@@ -245,6 +265,21 @@ unordered_map(InputIterator, InputIterator, typename see below::size_type, Hash,
-> unordered_map<iter_key_t<InputIterator>, iter_val_t<InputIterator>, Hash,
equal_to<iter_key_t<InputIterator>>, Allocator>; // C++17
+template<ranges::input_range R, class Allocator>
+ unordered_map(from_range_t, R&&, typename see below::size_type, Allocator)
+ -> unordered_map<range-key-type<R>, range-mapped-type<R>, hash<range-key-type<R>>,
+ equal_to<range-key-type<R>>, Allocator>; // C++23
+
+template<ranges::input_range R, class Allocator>
+ unordered_map(from_range_t, R&&, Allocator)
+ -> unordered_map<range-key-type<R>, range-mapped-type<R>, hash<range-key-type<R>>,
+ equal_to<range-key-type<R>>, Allocator>; // C++23
+
+template<ranges::input_range R, class Hash, class Allocator>
+ unordered_map(from_range_t, R&&, typename see below::size_type, Hash, Allocator)
+ -> unordered_map<range-key-type<R>, range-mapped-type<R>, Hash,
+ equal_to<range-key-type<R>>, Allocator>; // C++23
+
template<class Key, class T, typename Allocator>
unordered_map(initializer_list<pair<const Key, T>>, typename see below::size_type, Allocator)
-> unordered_map<Key, T, hash<Key>, equal_to<Key>, Allocator>; // C++17
@@ -270,7 +305,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
template <class Key, class T, class Hash, class Pred, class Alloc>
bool
operator!=(const unordered_map<Key, T, Hash, Pred, Alloc>& x,
- const unordered_map<Key, T, Hash, Pred, Alloc>& y);
+ const unordered_map<Key, T, Hash, Pred, Alloc>& y); // Removed in C++20
template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
class Alloc = allocator<pair<const Key, T>>>
@@ -311,6 +346,10 @@ public:
size_type n = 0, const hasher& hf = hasher(),
const key_equal& eql = key_equal(),
const allocator_type& a = allocator_type());
+ template<container-compatible-range<value_type> R>
+ unordered_multimap(from_range_t, R&& rg, size_type n = see below,
+ const hasher& hf = hasher(), const key_equal& eql = key_equal(),
+ const allocator_type& a = allocator_type()); // C++23
explicit unordered_multimap(const allocator_type&);
unordered_multimap(const unordered_multimap&);
unordered_multimap(const unordered_multimap&, const Allocator&);
@@ -334,6 +373,12 @@ public:
unordered_multimap(InputIterator f, InputIterator l, size_type n, const hasher& hf,
const allocator_type& a)
: unordered_multimap(f, l, n, hf, key_equal(), a) {} // C++14
+ template<container-compatible-range<value_type> R>
+ unordered_multimap(from_range_t, R&& rg, size_type n, const allocator_type& a)
+ : unordered_multimap(from_range, std::forward<R>(rg), n, hasher(), key_equal(), a) { } // C++23
+ template<container-compatible-range<value_type> R>
+ unordered_multimap(from_range_t, R&& rg, size_type n, const hasher& hf, const allocator_type& a)
+ : unordered_multimap(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { } // C++23
unordered_multimap(initializer_list<value_type> il, size_type n, const allocator_type& a)
: unordered_multimap(il, n, hasher(), key_equal(), a) {} // C++14
unordered_multimap(initializer_list<value_type> il, size_type n, const hasher& hf,
@@ -374,6 +419,8 @@ public:
iterator insert(const_iterator hint, P&& obj);
template <class InputIterator>
void insert(InputIterator first, InputIterator last);
+ template<container-compatible-range<value_type> R>
+ void insert_range(R&& rg); // C++23
void insert(initializer_list<value_type>);
node_type extract(const_iterator position); // C++17
@@ -453,6 +500,13 @@ unordered_multimap(InputIterator, InputIterator, typename see below::size_type =
-> unordered_multimap<iter_key_t<InputIterator>, iter_value_t<InputIterator>, Hash, Pred,
Allocator>; // C++17
+template<ranges::input_range R, class Hash = hash<range-key-type<R>>,
+ class Pred = equal_to<range-key-type<R>>,
+ class Allocator = allocator<range-to-alloc-type<R>>>
+ unordered_multimap(from_range_t, R&&, typename see below::size_type = see below,
+ Hash = Hash(), Pred = Pred(), Allocator = Allocator())
+ -> unordered_multimap<range-key-type<R>, range-mapped-type<R>, Hash, Pred, Allocator>; // C++23
+
template<class Key, class T, class Hash = hash<Key>,
class Pred = equal_to<Key>, class Allocator = allocator<pair<const Key, T>>>
unordered_multimap(initializer_list<pair<const Key, T>>, typename see below::size_type = see below,
@@ -474,6 +528,21 @@ unordered_multimap(InputIterator, InputIterator, typename see below::size_type,
-> unordered_multimap<iter_key_t<InputIterator>, iter_val_t<InputIterator>, Hash,
equal_to<iter_key_t<InputIterator>>, Allocator>; // C++17
+template<ranges::input_range R, class Allocator>
+ unordered_multimap(from_range_t, R&&, typename see below::size_type, Allocator)
+ -> unordered_multimap<range-key-type<R>, range-mapped-type<R>, hash<range-key-type<R>>,
+ equal_to<range-key-type<R>>, Allocator>; // C++23
+
+template<ranges::input_range R, class Allocator>
+ unordered_multimap(from_range_t, R&&, Allocator)
+ -> unordered_multimap<range-key-type<R>, range-mapped-type<R>, hash<range-key-type<R>>,
+ equal_to<range-key-type<R>>, Allocator>; // C++23
+
+template<ranges::input_range R, class Hash, class Allocator>
+ unordered_multimap(from_range_t, R&&, typename see below::size_type, Hash, Allocator)
+ -> unordered_multimap<range-key-type<R>, range-mapped-type<R>, Hash,
+ equal_to<range-key-type<R>>, Allocator>; // C++23
+
template<class Key, class T, typename Allocator>
unordered_multimap(initializer_list<pair<const Key, T>>, typename see below::size_type, Allocator)
-> unordered_multimap<Key, T, hash<Key>, equal_to<Key>, Allocator>; // C++17
@@ -508,7 +577,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
template <class Key, class T, class Hash, class Pred, class Alloc>
bool
operator!=(const unordered_multimap<Key, T, Hash, Pred, Alloc>& x,
- const unordered_multimap<Key, T, Hash, Pred, Alloc>& y);
+ const unordered_multimap<Key, T, Hash, Pred, Alloc>& y); // Removed in C++20
} // std
@@ -516,19 +585,24 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
#include <__algorithm/is_permutation.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
-#include <__debug>
#include <__functional/is_transparent.h>
#include <__functional/operations.h>
#include <__hash_table>
#include <__iterator/distance.h>
#include <__iterator/erase_if_container.h>
#include <__iterator/iterator_traits.h>
+#include <__iterator/ranges_iterator_traits.h>
#include <__memory/addressof.h>
#include <__memory/allocator.h>
#include <__memory_resource/polymorphic_allocator.h>
#include <__node_handle>
+#include <__ranges/concepts.h>
+#include <__ranges/container_compatible_range.h>
+#include <__ranges/from_range.h>
#include <__type_traits/is_allocator.h>
+#include <__type_traits/type_identity.h>
#include <__utility/forward.h>
#include <stdexcept>
#include <tuple>
@@ -575,7 +649,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _Key& __x) const
{return static_cast<const _Hash&>(*this)(__x);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _K2& __x) const
@@ -611,7 +685,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _Key& __x) const
{return __hash_(__x);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _K2& __x) const
@@ -661,7 +735,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _Cp& __y) const
{return static_cast<const _Pred&>(*this)(__x, __y.__get_value().first);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Cp& __x, const _K2& __y) const
@@ -712,7 +786,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _Cp& __y) const
{return __pred_(__x, __y.__get_value().first);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Cp& __x, const _K2& __y) const
@@ -825,7 +899,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
value_type& __get_value()
{
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return *_VSTD::launder(_VSTD::addressof(__cc_));
#else
return __cc_;
@@ -835,7 +909,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const value_type& __get_value() const
{
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return *_VSTD::launder(_VSTD::addressof(__cc_));
#else
return __cc_;
@@ -953,9 +1027,11 @@ public:
friend _LIBCPP_INLINE_VISIBILITY
bool operator==(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
{return __x.__i_ == __y.__i_;}
+#if _LIBCPP_STD_VER <= 17
friend _LIBCPP_INLINE_VISIBILITY
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
{return __x.__i_ != __y.__i_;}
+#endif
template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_map;
template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_multimap;
@@ -1007,9 +1083,11 @@ public:
friend _LIBCPP_INLINE_VISIBILITY
bool operator==(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
{return __x.__i_ == __y.__i_;}
+#if _LIBCPP_STD_VER <= 17
friend _LIBCPP_INLINE_VISIBILITY
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
{return __x.__i_ != __y.__i_;}
+#endif
template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_map;
template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_multimap;
@@ -1035,7 +1113,7 @@ public:
typedef value_type& reference;
typedef const value_type& const_reference;
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
- "Invalid allocator::value_type");
+ "Allocator::value_type must be same type as value_type");
private:
typedef __hash_value_type<key_type, mapped_type> __value_type;
@@ -1075,7 +1153,7 @@ public:
typedef __hash_map_iterator<typename __table::local_iterator> local_iterator;
typedef __hash_map_const_iterator<typename __table::const_local_iterator> const_local_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __map_node_handle<__node, allocator_type> node_type;
typedef __insert_return_type<iterator, node_type> insert_return_type;
#endif
@@ -1089,41 +1167,55 @@ public:
unordered_map()
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
{
- _VSTD::__debug_db_insert_c(this);
}
- explicit unordered_map(size_type __n, const hasher& __hf = hasher(),
+ explicit _LIBCPP_HIDE_FROM_ABI unordered_map(size_type __n, const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
- unordered_map(size_type __n, const hasher& __hf,
+ _LIBCPP_HIDE_FROM_ABI unordered_map(size_type __n, const hasher& __hf,
const key_equal& __eql,
const allocator_type& __a);
template <class _InputIterator>
- unordered_map(_InputIterator __first, _InputIterator __last);
+ _LIBCPP_HIDE_FROM_ABI unordered_map(_InputIterator __first, _InputIterator __last);
template <class _InputIterator>
- unordered_map(_InputIterator __first, _InputIterator __last,
+ _LIBCPP_HIDE_FROM_ABI unordered_map(_InputIterator __first, _InputIterator __last,
size_type __n, const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
template <class _InputIterator>
- unordered_map(_InputIterator __first, _InputIterator __last,
+ _LIBCPP_HIDE_FROM_ABI unordered_map(_InputIterator __first, _InputIterator __last,
size_type __n, const hasher& __hf,
const key_equal& __eql,
const allocator_type& __a);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ unordered_map(from_range_t, _Range&& __range, size_type __n = /*implementation-defined*/0,
+ const hasher& __hf = hasher(), const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : __table_(__hf, __eql, typename __table::allocator_type(__a)) {
+ if (__n > 0) {
+ __table_.__rehash_unique(__n);
+ }
+ insert_range(std::forward<_Range>(__range));
+ }
+#endif
+
_LIBCPP_INLINE_VISIBILITY
explicit unordered_map(const allocator_type& __a);
- unordered_map(const unordered_map& __u);
- unordered_map(const unordered_map& __u, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI unordered_map(const unordered_map& __u);
+ _LIBCPP_HIDE_FROM_ABI unordered_map(const unordered_map& __u, const allocator_type& __a);
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
unordered_map(unordered_map&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
- unordered_map(unordered_map&& __u, const allocator_type& __a);
- unordered_map(initializer_list<value_type> __il);
- unordered_map(initializer_list<value_type> __il, size_type __n,
+ _LIBCPP_HIDE_FROM_ABI unordered_map(unordered_map&& __u, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI unordered_map(initializer_list<value_type> __il);
+ _LIBCPP_HIDE_FROM_ABI unordered_map(initializer_list<value_type> __il, size_type __n,
const hasher& __hf = hasher(), const key_equal& __eql = key_equal());
- unordered_map(initializer_list<value_type> __il, size_type __n,
+ _LIBCPP_HIDE_FROM_ABI unordered_map(initializer_list<value_type> __il, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
#endif // _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_INLINE_VISIBILITY
unordered_map(size_type __n, const allocator_type& __a)
: unordered_map(__n, hasher(), key_equal(), __a) {}
@@ -1139,6 +1231,19 @@ public:
unordered_map(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf,
const allocator_type& __a)
: unordered_map(__first, __last, __n, __hf, key_equal(), __a) {}
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ unordered_map(from_range_t, _Range&& __range, size_type __n, const allocator_type& __a)
+ : unordered_map(from_range, std::forward<_Range>(__range), __n, hasher(), key_equal(), __a) {}
+
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ unordered_map(from_range_t, _Range&& __range, size_type __n, const hasher& __hf, const allocator_type& __a)
+ : unordered_map(from_range, std::forward<_Range>(__range), __n, __hf, key_equal(), __a) {}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
unordered_map(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)
: unordered_map(__il, __n, hasher(), key_equal(), __a) {}
@@ -1205,11 +1310,7 @@ public:
pair<iterator, bool> insert(const value_type& __x)
{return __table_.__insert_unique(__x);}
- iterator insert(const_iterator __p, const value_type& __x) {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "unordered_map::insert(const_iterator, const value_type&) called with an iterator not "
- "referring to this unordered_map");
- ((void)__p);
+ _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) {
return insert(__x).first;
}
@@ -1217,6 +1318,16 @@ public:
_LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __first, _InputIterator __last);
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void insert_range(_Range&& __range) {
+ for (auto&& __element : __range) {
+ __table_.__insert_unique(std::forward<decltype(__element)>(__element));
+ }
+ }
+#endif
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
@@ -1226,11 +1337,7 @@ public:
pair<iterator, bool> insert(value_type&& __x)
{return __table_.__insert_unique(_VSTD::move(__x));}
- iterator insert(const_iterator __p, value_type&& __x) {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
- " referring to this unordered_map");
- ((void)__p);
+ _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, value_type&& __x) {
return __table_.__insert_unique(_VSTD::move(__x)).first;
}
@@ -1243,12 +1350,8 @@ public:
template <class _Pp,
class = __enable_if_t<is_constructible<value_type, _Pp>::value> >
_LIBCPP_INLINE_VISIBILITY
- iterator insert(const_iterator __p, _Pp&& __x)
+ iterator insert(const_iterator, _Pp&& __x)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "unordered_map::insert(const_iterator, value_type&&) called with an iterator not"
- " referring to this unordered_map");
- ((void)__p);
return insert(_VSTD::forward<_Pp>(__x)).first;
}
@@ -1260,17 +1363,13 @@ public:
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
- iterator emplace_hint(const_iterator __p, _Args&&... __args) {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
- "unordered_map::emplace_hint(const_iterator, args...) called with an iterator not"
- " referring to this unordered_map");
- ((void)__p);
+ iterator emplace_hint(const_iterator, _Args&&... __args) {
return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;
}
#endif // _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args)
@@ -1291,23 +1390,15 @@ public:
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
- iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args)
+ iterator try_emplace(const_iterator, const key_type& __k, _Args&&... __args)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__h)) == this,
- "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
- " referring to this unordered_map");
- ((void)__h);
return try_emplace(__k, _VSTD::forward<_Args>(__args)...).first;
}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
- iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args)
+ iterator try_emplace(const_iterator, key_type&& __k, _Args&&... __args)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__h)) == this,
- "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
- " referring to this unordered_map");
- ((void)__h);
return try_emplace(_VSTD::move(__k), _VSTD::forward<_Args>(__args)...).first;
}
@@ -1339,7 +1430,6 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert_or_assign(const_iterator, const key_type& __k, _Vp&& __v)
{
- // FIXME: Add debug mode checking for the iterator input
return insert_or_assign(__k, _VSTD::forward<_Vp>(__v)).first;
}
@@ -1347,10 +1437,9 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert_or_assign(const_iterator, key_type&& __k, _Vp&& __v)
{
- // FIXME: Add debug mode checking for the iterator input
return insert_or_assign(_VSTD::move(__k), _VSTD::forward<_Vp>(__v)).first;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __table_.erase(__p.__i_);}
@@ -1364,11 +1453,11 @@ public:
_LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {__table_.clear();}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
insert_return_type insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_map::insert()");
return __table_.template __node_handle_insert_unique<
node_type, insert_return_type>(_VSTD::move(__nh));
@@ -1376,7 +1465,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_map::insert()");
return __table_.template __node_handle_insert_unique<node_type>(
__hint.__i_, _VSTD::move(__nh));
@@ -1397,32 +1486,32 @@ public:
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_map<key_type, mapped_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_unique(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_map<key_type, mapped_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_unique(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multimap<key_type, mapped_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_unique(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multimap<key_type, mapped_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_unique(__source.__table_);
}
#endif
@@ -1443,31 +1532,31 @@ public:
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
iterator find(const _K2& __k) {return __table_.find(__k);}
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const _K2& __k) const {return __table_.find(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
size_type count(const _K2& __k) const {return __table_.__count_unique(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
bool contains(const _K2& __k) const {return find(__k) != end();}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
@@ -1475,7 +1564,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_unique(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const _K2& __k)
@@ -1484,15 +1573,15 @@ public:
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const _K2& __k) const
{return __table_.__equal_range_unique(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
- mapped_type& operator[](const key_type& __k);
+ _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k);
#ifndef _LIBCPP_CXX03_LANG
- mapped_type& operator[](key_type&& __k);
+ _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k);
#endif
- mapped_type& at(const key_type& __k);
- const mapped_type& at(const key_type& __k) const;
+ _LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __k);
+ _LIBCPP_HIDE_FROM_ABI const mapped_type& at(const key_type& __k) const;
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
@@ -1529,23 +1618,10 @@ public:
_LIBCPP_INLINE_VISIBILITY
void reserve(size_type __n) {__table_.__reserve_unique(__n);}
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
- bool __dereferenceable(const const_iterator* __i) const
- {return __table_.__dereferenceable(_VSTD::addressof(__i->__i_));}
- bool __decrementable(const const_iterator* __i) const
- {return __table_.__decrementable(_VSTD::addressof(__i->__i_));}
- bool __addable(const const_iterator* __i, ptrdiff_t __n) const
- {return __table_.__addable(_VSTD::addressof(__i->__i_), __n);}
- bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
- {return __table_.__addable(_VSTD::addressof(__i->__i_), __n);}
-
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
private:
#ifdef _LIBCPP_CXX03_LANG
- __node_holder __construct_node_with_key(const key_type& __k);
+ _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node_with_key(const key_type& __k);
#endif
};
@@ -1554,7 +1630,7 @@ template<class _InputIterator,
class _Hash = hash<__iter_key_type<_InputIterator>>,
class _Pred = equal_to<__iter_key_type<_InputIterator>>,
class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<!__is_allocator<_Hash>::value>,
class = enable_if_t<!is_integral<_Hash>::value>,
class = enable_if_t<!__is_allocator<_Pred>::value>,
@@ -1563,6 +1639,20 @@ unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocat
_Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
-> unordered_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Hash, _Pred, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range,
+ class _Hash = hash<__range_key_type<_Range>>,
+ class _Pred = equal_to<__range_key_type<_Range>>,
+ class _Allocator = allocator<__range_to_alloc_type<_Range>>,
+ class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!is_integral<_Hash>::value>,
+ class = enable_if_t<!__is_allocator<_Pred>::value>,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type = 0,
+ _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
+ -> unordered_map<__range_key_type<_Range>, __range_mapped_type<_Range>, _Hash, _Pred, _Allocator>; // C++23
+#endif
+
template<class _Key, class _Tp, class _Hash = hash<remove_const_t<_Key>>,
class _Pred = equal_to<remove_const_t<_Key>>,
class _Allocator = allocator<pair<const _Key, _Tp>>,
@@ -1575,21 +1665,21 @@ unordered_map(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allo
-> unordered_map<remove_const_t<_Key>, _Tp, _Hash, _Pred, _Allocator>;
template<class _InputIterator, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>>
unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>,
hash<__iter_key_type<_InputIterator>>, equal_to<__iter_key_type<_InputIterator>>, _Allocator>;
template<class _InputIterator, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>>
unordered_map(_InputIterator, _InputIterator, _Allocator)
-> unordered_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>,
hash<__iter_key_type<_InputIterator>>, equal_to<__iter_key_type<_InputIterator>>, _Allocator>;
template<class _InputIterator, class _Hash, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<!__is_allocator<_Hash>::value>,
class = enable_if_t<!is_integral<_Hash>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>>
@@ -1597,6 +1687,30 @@ unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocat
-> unordered_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>,
_Hash, equal_to<__iter_key_type<_InputIterator>>, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+
+template <ranges::input_range _Range, class _Allocator,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
+ -> unordered_map<__range_key_type<_Range>, __range_mapped_type<_Range>, hash<__range_key_type<_Range>>,
+ equal_to<__range_key_type<_Range>>, _Allocator>;
+
+template <ranges::input_range _Range, class _Allocator,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_map(from_range_t, _Range&&, _Allocator)
+ -> unordered_map<__range_key_type<_Range>, __range_mapped_type<_Range>, hash<__range_key_type<_Range>>,
+ equal_to<__range_key_type<_Range>>, _Allocator>;
+
+template <ranges::input_range _Range, class _Hash, class _Allocator,
+ class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!is_integral<_Hash>::value>,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
+ -> unordered_map<__range_key_type<_Range>, __range_mapped_type<_Range>, _Hash,
+ equal_to<__range_key_type<_Range>>, _Allocator>;
+
+#endif
+
template<class _Key, class _Tp, class _Allocator,
class = enable_if_t<__is_allocator<_Allocator>::value>>
unordered_map(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Allocator)
@@ -1625,7 +1739,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
size_type __n, const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__n);
}
@@ -1635,7 +1748,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
const allocator_type& __a)
: __table_(__hf, __eql, typename __table::allocator_type(__a))
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__n);
}
@@ -1645,7 +1757,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
const allocator_type& __a)
: __table_(typename __table::allocator_type(__a))
{
- _VSTD::__debug_db_insert_c(this);
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
@@ -1653,7 +1764,6 @@ template <class _InputIterator>
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
_InputIterator __first, _InputIterator __last)
{
- _VSTD::__debug_db_insert_c(this);
insert(__first, __last);
}
@@ -1664,7 +1774,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__n);
insert(__first, __last);
}
@@ -1676,7 +1785,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, typename __table::allocator_type(__a))
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__n);
insert(__first, __last);
}
@@ -1686,7 +1794,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
const unordered_map& __u)
: __table_(__u.__table_)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__u.bucket_count());
insert(__u.begin(), __u.end());
}
@@ -1696,7 +1803,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
const unordered_map& __u, const allocator_type& __a)
: __table_(__u.__table_, typename __table::allocator_type(__a))
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__u.bucket_count());
insert(__u.begin(), __u.end());
}
@@ -1710,8 +1816,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
: __table_(_VSTD::move(__u.__table_))
{
- _VSTD::__debug_db_insert_c(this);
- std::__debug_db_swap(this, std::addressof(__u));
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
@@ -1719,7 +1823,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
unordered_map&& __u, const allocator_type& __a)
: __table_(_VSTD::move(__u.__table_), typename __table::allocator_type(__a))
{
- _VSTD::__debug_db_insert_c(this);
if (__a != __u.get_allocator())
{
iterator __i = __u.begin();
@@ -1728,15 +1831,12 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
__u.__table_.remove((__i++).__i_)->__value_.__move());
}
}
- else
- std::__debug_db_swap(this, std::addressof(__u));
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
initializer_list<value_type> __il)
{
- _VSTD::__debug_db_insert_c(this);
insert(__il.begin(), __il.end());
}
@@ -1746,7 +1846,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
const key_equal& __eql)
: __table_(__hf, __eql)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__n);
insert(__il.begin(), __il.end());
}
@@ -1757,7 +1856,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, typename __table::allocator_type(__a))
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__n);
insert(__il.begin(), __il.end());
}
@@ -1874,7 +1972,7 @@ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc,
class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1904,6 +2002,8 @@ operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
return true;
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -1913,6 +2013,8 @@ operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
return !(__x == __y);
}
+#endif
+
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
class _LIBCPP_TEMPLATE_VIS unordered_multimap
@@ -1928,7 +2030,7 @@ public:
typedef value_type& reference;
typedef const value_type& const_reference;
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
- "Invalid allocator::value_type");
+ "Allocator::value_type must be same type as value_type");
private:
typedef __hash_value_type<key_type, mapped_type> __value_type;
@@ -1967,7 +2069,7 @@ private:
typedef __hash_map_iterator<typename __table::local_iterator> local_iterator;
typedef __hash_map_const_iterator<typename __table::const_local_iterator> const_local_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __map_node_handle<__node, allocator_type> node_type;
#endif
@@ -1980,42 +2082,56 @@ private:
unordered_multimap()
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
{
- _VSTD::__debug_db_insert_c(this);
}
- explicit unordered_multimap(size_type __n, const hasher& __hf = hasher(),
+ explicit _LIBCPP_HIDE_FROM_ABI unordered_multimap(size_type __n, const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
- unordered_multimap(size_type __n, const hasher& __hf,
+ _LIBCPP_HIDE_FROM_ABI unordered_multimap(size_type __n, const hasher& __hf,
const key_equal& __eql,
const allocator_type& __a);
template <class _InputIterator>
- unordered_multimap(_InputIterator __first, _InputIterator __last);
+ _LIBCPP_HIDE_FROM_ABI unordered_multimap(_InputIterator __first, _InputIterator __last);
template <class _InputIterator>
- unordered_multimap(_InputIterator __first, _InputIterator __last,
+ _LIBCPP_HIDE_FROM_ABI unordered_multimap(_InputIterator __first, _InputIterator __last,
size_type __n, const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
template <class _InputIterator>
- unordered_multimap(_InputIterator __first, _InputIterator __last,
+ _LIBCPP_HIDE_FROM_ABI unordered_multimap(_InputIterator __first, _InputIterator __last,
size_type __n, const hasher& __hf,
const key_equal& __eql,
const allocator_type& __a);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ unordered_multimap(from_range_t, _Range&& __range, size_type __n = /*implementation-defined*/0,
+ const hasher& __hf = hasher(), const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : __table_(__hf, __eql, typename __table::allocator_type(__a)) {
+ if (__n > 0) {
+ __table_.__rehash_multi(__n);
+ }
+ insert_range(std::forward<_Range>(__range));
+ }
+#endif
+
_LIBCPP_INLINE_VISIBILITY
explicit unordered_multimap(const allocator_type& __a);
- unordered_multimap(const unordered_multimap& __u);
- unordered_multimap(const unordered_multimap& __u, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI unordered_multimap(const unordered_multimap& __u);
+ _LIBCPP_HIDE_FROM_ABI unordered_multimap(const unordered_multimap& __u, const allocator_type& __a);
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
unordered_multimap(unordered_multimap&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
- unordered_multimap(unordered_multimap&& __u, const allocator_type& __a);
- unordered_multimap(initializer_list<value_type> __il);
- unordered_multimap(initializer_list<value_type> __il, size_type __n,
+ _LIBCPP_HIDE_FROM_ABI unordered_multimap(unordered_multimap&& __u, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI unordered_multimap(initializer_list<value_type> __il);
+ _LIBCPP_HIDE_FROM_ABI unordered_multimap(initializer_list<value_type> __il, size_type __n,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
- unordered_multimap(initializer_list<value_type> __il, size_type __n,
+ _LIBCPP_HIDE_FROM_ABI unordered_multimap(initializer_list<value_type> __il, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
#endif // _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_INLINE_VISIBILITY
unordered_multimap(size_type __n, const allocator_type& __a)
: unordered_multimap(__n, hasher(), key_equal(), __a) {}
@@ -2031,6 +2147,19 @@ private:
unordered_multimap(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf,
const allocator_type& __a)
: unordered_multimap(__first, __last, __n, __hf, key_equal(), __a) {}
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ unordered_multimap(from_range_t, _Range&& __range, size_type __n, const allocator_type& __a)
+ : unordered_multimap(from_range, std::forward<_Range>(__range), __n, hasher(), key_equal(), __a) {}
+
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ unordered_multimap(from_range_t, _Range&& __range, size_type __n, const hasher& __hf, const allocator_type& __a)
+ : unordered_multimap(from_range, std::forward<_Range>(__range), __n, __hf, key_equal(), __a) {}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
unordered_multimap(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)
: unordered_multimap(__il, __n, hasher(), key_equal(), __a) {}
@@ -2104,6 +2233,16 @@ private:
_LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __first, _InputIterator __last);
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void insert_range(_Range&& __range) {
+ for (auto&& __element : __range) {
+ __table_.__insert_multi(std::forward<decltype(__element)>(__element));
+ }
+ }
+#endif
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
@@ -2128,12 +2267,12 @@ private:
{return __table_.__insert_multi(__p.__i_, _VSTD::forward<_Pp>(__x));}
template <class... _Args>
- iterator emplace(_Args&&... __args) {
+ _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) {
return __table_.__emplace_multi(_VSTD::forward<_Args>(__args)...);
}
template <class... _Args>
- iterator emplace_hint(const_iterator __p, _Args&&... __args) {
+ _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
return __table_.__emplace_hint_multi(__p.__i_, _VSTD::forward<_Args>(__args)...);
}
#endif // _LIBCPP_CXX03_LANG
@@ -2151,11 +2290,11 @@ private:
_LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {__table_.clear();}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
iterator insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_multimap::insert()");
return __table_.template __node_handle_insert_multi<node_type>(
_VSTD::move(__nh));
@@ -2163,7 +2302,7 @@ private:
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_multimap::insert()");
return __table_.template __node_handle_insert_multi<node_type>(
__hint.__i_, _VSTD::move(__nh));
@@ -2184,32 +2323,32 @@ private:
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multimap<key_type, mapped_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multimap<key_type, mapped_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_map<key_type, mapped_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_map<key_type, mapped_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
#endif
@@ -2230,31 +2369,31 @@ private:
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
iterator find(const _K2& __k) {return __table_.find(__k);}
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const _K2& __k) const {return __table_.find(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
size_type count(const _K2& __k) const {return __table_.__count_multi(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
bool contains(const _K2& __k) const {return find(__k) != end();}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
@@ -2262,7 +2401,7 @@ private:
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_multi(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const _K2& __k)
@@ -2271,7 +2410,7 @@ private:
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const _K2& __k) const
{return __table_.__equal_range_multi(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
@@ -2308,21 +2447,6 @@ private:
void rehash(size_type __n) {__table_.__rehash_multi(__n);}
_LIBCPP_INLINE_VISIBILITY
void reserve(size_type __n) {__table_.__reserve_multi(__n);}
-
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
- bool __dereferenceable(const const_iterator* __i) const
- {return __table_.__dereferenceable(_VSTD::addressof(__i->__i_));}
- bool __decrementable(const const_iterator* __i) const
- {return __table_.__decrementable(_VSTD::addressof(__i->__i_));}
- bool __addable(const const_iterator* __i, ptrdiff_t __n) const
- {return __table_.__addable(_VSTD::addressof(__i->__i_), __n);}
- bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
- {return __table_.__addable(_VSTD::addressof(__i->__i_), __n);}
-
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
-
};
#if _LIBCPP_STD_VER >= 17
@@ -2330,7 +2454,7 @@ template<class _InputIterator,
class _Hash = hash<__iter_key_type<_InputIterator>>,
class _Pred = equal_to<__iter_key_type<_InputIterator>>,
class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<!__is_allocator<_Hash>::value>,
class = enable_if_t<!is_integral<_Hash>::value>,
class = enable_if_t<!__is_allocator<_Pred>::value>,
@@ -2339,6 +2463,20 @@ unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Al
_Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
-> unordered_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Hash, _Pred, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range,
+ class _Hash = hash<__range_key_type<_Range>>,
+ class _Pred = equal_to<__range_key_type<_Range>>,
+ class _Allocator = allocator<__range_to_alloc_type<_Range>>,
+ class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!is_integral<_Hash>::value>,
+ class = enable_if_t<!__is_allocator<_Pred>::value>,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type = 0,
+ _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
+ -> unordered_multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, _Hash, _Pred, _Allocator>;
+#endif
+
template<class _Key, class _Tp, class _Hash = hash<remove_const_t<_Key>>,
class _Pred = equal_to<remove_const_t<_Key>>,
class _Allocator = allocator<pair<const _Key, _Tp>>,
@@ -2351,21 +2489,21 @@ unordered_multimap(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<
-> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, _Pred, _Allocator>;
template<class _InputIterator, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>>
unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>,
hash<__iter_key_type<_InputIterator>>, equal_to<__iter_key_type<_InputIterator>>, _Allocator>;
template<class _InputIterator, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>>
unordered_multimap(_InputIterator, _InputIterator, _Allocator)
-> unordered_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>,
hash<__iter_key_type<_InputIterator>>, equal_to<__iter_key_type<_InputIterator>>, _Allocator>;
template<class _InputIterator, class _Hash, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<!__is_allocator<_Hash>::value>,
class = enable_if_t<!is_integral<_Hash>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>>
@@ -2373,6 +2511,30 @@ unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Al
-> unordered_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>,
_Hash, equal_to<__iter_key_type<_InputIterator>>, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+
+template <ranges::input_range _Range, class _Allocator,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
+ -> unordered_multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, hash<__range_key_type<_Range>>,
+ equal_to<__range_key_type<_Range>>, _Allocator>;
+
+template <ranges::input_range _Range, class _Allocator,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_multimap(from_range_t, _Range&&, _Allocator)
+ -> unordered_multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, hash<__range_key_type<_Range>>,
+ equal_to<__range_key_type<_Range>>, _Allocator>;
+
+template <ranges::input_range _Range, class _Hash, class _Allocator,
+ class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!is_integral<_Hash>::value>,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
+ -> unordered_multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, _Hash,
+ equal_to<__range_key_type<_Range>>, _Allocator>;
+
+#endif
+
template<class _Key, class _Tp, class _Allocator,
class = enable_if_t<__is_allocator<_Allocator>::value>>
unordered_multimap(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Allocator)
@@ -2401,7 +2563,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
size_type __n, const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__n);
}
@@ -2411,7 +2572,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
const allocator_type& __a)
: __table_(__hf, __eql, typename __table::allocator_type(__a))
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__n);
}
@@ -2420,7 +2580,6 @@ template <class _InputIterator>
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
_InputIterator __first, _InputIterator __last)
{
- _VSTD::__debug_db_insert_c(this);
insert(__first, __last);
}
@@ -2431,7 +2590,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__n);
insert(__first, __last);
}
@@ -2443,7 +2601,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, typename __table::allocator_type(__a))
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__n);
insert(__first, __last);
}
@@ -2454,7 +2611,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
const allocator_type& __a)
: __table_(typename __table::allocator_type(__a))
{
- _VSTD::__debug_db_insert_c(this);
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
@@ -2462,7 +2618,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
const unordered_multimap& __u)
: __table_(__u.__table_)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__u.bucket_count());
insert(__u.begin(), __u.end());
}
@@ -2472,7 +2627,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
const unordered_multimap& __u, const allocator_type& __a)
: __table_(__u.__table_, typename __table::allocator_type(__a))
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__u.bucket_count());
insert(__u.begin(), __u.end());
}
@@ -2486,8 +2640,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
: __table_(_VSTD::move(__u.__table_))
{
- _VSTD::__debug_db_insert_c(this);
- std::__debug_db_swap(this, std::addressof(__u));
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
@@ -2495,7 +2647,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
unordered_multimap&& __u, const allocator_type& __a)
: __table_(_VSTD::move(__u.__table_), typename __table::allocator_type(__a))
{
- _VSTD::__debug_db_insert_c(this);
if (__a != __u.get_allocator())
{
iterator __i = __u.begin();
@@ -2505,15 +2656,12 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
__u.__table_.remove((__i++).__i_)->__value_.__move());
}
}
- else
- std::__debug_db_swap(this, std::addressof(__u));
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
initializer_list<value_type> __il)
{
- _VSTD::__debug_db_insert_c(this);
insert(__il.begin(), __il.end());
}
@@ -2523,7 +2671,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
const key_equal& __eql)
: __table_(__hf, __eql)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__n);
insert(__il.begin(), __il.end());
}
@@ -2534,7 +2681,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, typename __table::allocator_type(__a))
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__n);
insert(__il.begin(), __il.end());
}
@@ -2584,7 +2730,7 @@ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc,
class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
@@ -2618,6 +2764,8 @@ operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
return true;
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -2627,17 +2775,19 @@ operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
return !(__x == __y);
}
+#endif
+
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _KeyT, class _ValueT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
-using unordered_map =
+using unordered_map _LIBCPP_AVAILABILITY_PMR =
std::unordered_map<_KeyT, _ValueT, _HashT, _PredT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
template <class _KeyT, class _ValueT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
-using unordered_multimap =
+using unordered_multimap _LIBCPP_AVAILABILITY_PMR =
std::unordered_multimap<_KeyT, _ValueT, _HashT, _PredT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
@@ -2647,7 +2797,9 @@ _LIBCPP_END_NAMESPACE_STD
# include <algorithm>
# include <bit>
# include <concepts>
+# include <cstdlib>
# include <iterator>
+# include <type_traits>
#endif
#endif // _LIBCPP_UNORDERED_MAP
diff --git a/contrib/libs/cxxsupp/libcxx/include/unordered_set b/contrib/libs/cxxsupp/libcxx/include/unordered_set
index b4203c08a9b..5e47f12446f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/unordered_set
+++ b/contrib/libs/cxxsupp/libcxx/include/unordered_set
@@ -58,6 +58,10 @@ public:
size_type n = 0, const hasher& hf = hasher(),
const key_equal& eql = key_equal(),
const allocator_type& a = allocator_type());
+ template<container-compatible-range<value_type> R>
+ unordered_set(from_range_t, R&& rg, size_type n = see below,
+ const hasher& hf = hasher(), const key_equal& eql = key_equal(),
+ const allocator_type& a = allocator_type()); // C++23
explicit unordered_set(const allocator_type&);
unordered_set(const unordered_set&);
unordered_set(const unordered_set&, const Allocator&);
@@ -77,6 +81,12 @@ public:
template <class InputIterator>
unordered_set(InputIterator f, InputIterator l, size_type n,
const hasher& hf, const allocator_type& a); // C++14
+ template<container-compatible-range<value_type> R>
+ unordered_set(from_range_t, R&& rg, size_type n, const allocator_type& a)
+ : unordered_set(from_range, std::forward<R>(rg), n, hasher(), key_equal(), a) { } // C++23
+ template<container-compatible-range<value_type> R>
+ unordered_set(from_range_t, R&& rg, size_type n, const hasher& hf, const allocator_type& a)
+ : unordered_set(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { } // C++23
unordered_set(initializer_list<value_type> il, size_type n, const allocator_type& a); // C++14
unordered_set(initializer_list<value_type> il, size_type n,
const hasher& hf, const allocator_type& a); // C++14
@@ -113,6 +123,8 @@ public:
iterator insert(const_iterator hint, value_type&& obj);
template <class InputIterator>
void insert(InputIterator first, InputIterator last);
+ template<container-compatible-range<value_type> R>
+ void insert_range(R&& rg); // C++23
void insert(initializer_list<value_type>);
node_type extract(const_iterator position); // C++17
@@ -191,6 +203,13 @@ unordered_set(InputIterator, InputIterator, typename see below::size_type = see
-> unordered_set<typename iterator_traits<InputIterator>::value_type,
Hash, Pred, Allocator>; // C++17
+template<ranges::input_range R,
+ class Hash = hash<ranges::range_value_t<R>>,
+ class Pred = equal_to<ranges::range_value_t<R>>,
+ class Allocator = allocator<ranges::range_value_t<R>>>
+ unordered_set(from_range_t, R&&, typename see below::size_type = see below, Hash = Hash(), Pred = Pred(), Allocator = Allocator())
+ -> unordered_set<ranges::range_value_t<R>, Hash, Pred, Allocator>; // C++23
+
template<class T, class Hash = hash<T>,
class Pred = equal_to<T>, class Allocator = allocator<T>>
unordered_set(initializer_list<T>, typename see below::size_type = see below,
@@ -211,6 +230,21 @@ unordered_set(InputIterator, InputIterator, typename see below::size_type,
equal_to<typename iterator_traits<InputIterator>::value_type>,
Allocator>; // C++17
+template<ranges::input_range R, class Allocator>
+ unordered_set(from_range_t, R&&, typename see below::size_type, Allocator)
+ -> unordered_set<ranges::range_value_t<R>, hash<ranges::range_value_t<R>>,
+ equal_to<ranges::range_value_t<R>>, Allocator>; // C++23
+
+template<ranges::input_range R, class Allocator>
+ unordered_set(from_range_t, R&&, Allocator)
+ -> unordered_set<ranges::range_value_t<R>, hash<ranges::range_value_t<R>>,
+ equal_to<ranges::range_value_t<R>>, Allocator>; // C++23
+
+template<ranges::input_range R, class Hash, class Allocator>
+ unordered_set(from_range_t, R&&, typename see below::size_type, Hash, Allocator)
+ -> unordered_set<ranges::range_value_t<R>, Hash,
+ equal_to<ranges::range_value_t<R>>, Allocator>; // C++23
+
template<class T, class Allocator>
unordered_set(initializer_list<T>, typename see below::size_type, Allocator)
-> unordered_set<T, hash<T>, equal_to<T>, Allocator>; // C++17
@@ -232,7 +266,7 @@ template <class Value, class Hash, class Pred, class Alloc>
template <class Value, class Hash, class Pred, class Alloc>
bool
operator!=(const unordered_set<Value, Hash, Pred, Alloc>& x,
- const unordered_set<Value, Hash, Pred, Alloc>& y);
+ const unordered_set<Value, Hash, Pred, Alloc>& y); // removed in C++20
template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
class Alloc = allocator<Value>>
@@ -272,6 +306,10 @@ public:
size_type n = 0, const hasher& hf = hasher(),
const key_equal& eql = key_equal(),
const allocator_type& a = allocator_type());
+ template<container-compatible-range<value_type> R>
+ unordered_multiset(from_range_t, R&& rg, size_type n = see below,
+ const hasher& hf = hasher(), const key_equal& eql = key_equal(),
+ const allocator_type& a = allocator_type()); // C++23
explicit unordered_multiset(const allocator_type&);
unordered_multiset(const unordered_multiset&);
unordered_multiset(const unordered_multiset&, const Allocator&);
@@ -291,6 +329,12 @@ public:
template <class InputIterator>
unordered_multiset(InputIterator f, InputIterator l, size_type n,
const hasher& hf, const allocator_type& a); // C++14
+ template<container-compatible-range<value_type> R>
+ unordered_multiset(from_range_t, R&& rg, size_type n, const allocator_type& a)
+ : unordered_multiset(from_range, std::forward<R>(rg), n, hasher(), key_equal(), a) { } // C++23
+ template<container-compatible-range<value_type> R>
+ unordered_multiset(from_range_t, R&& rg, size_type n, const hasher& hf, const allocator_type& a)
+ : unordered_multiset(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { } // C++23
unordered_multiset(initializer_list<value_type> il, size_type n, const allocator_type& a); // C++14
unordered_multiset(initializer_list<value_type> il, size_type n,
const hasher& hf, const allocator_type& a); // C++14
@@ -327,6 +371,8 @@ public:
iterator insert(const_iterator hint, value_type&& obj);
template <class InputIterator>
void insert(InputIterator first, InputIterator last);
+ template<container-compatible-range<value_type> R>
+ void insert_range(R&& rg); // C++23
void insert(initializer_list<value_type>);
node_type extract(const_iterator position); // C++17
@@ -405,6 +451,13 @@ unordered_multiset(InputIterator, InputIterator, see below::size_type = see belo
-> unordered_multiset<typename iterator_traits<InputIterator>::value_type,
Hash, Pred, Allocator>; // C++17
+template<ranges::input_range R,
+ class Hash = hash<ranges::range_value_t<R>>,
+ class Pred = equal_to<ranges::range_value_t<R>>,
+ class Allocator = allocator<ranges::range_value_t<R>>>
+ unordered_multiset(from_range_t, R&&, typename see below::size_type = see below, Hash = Hash(), Pred = Pred(), Allocator = Allocator())
+ -> unordered_multiset<ranges::range_value_t<R>, Hash, Pred, Allocator>; // C++23
+
template<class T, class Hash = hash<T>,
class Pred = equal_to<T>, class Allocator = allocator<T>>
unordered_multiset(initializer_list<T>, typename see below::size_type = see below,
@@ -424,6 +477,21 @@ unordered_multiset(InputIterator, InputIterator, typename see below::size_type,
-> unordered_multiset<typename iterator_traits<InputIterator>::value_type, Hash,
equal_to<typename iterator_traits<InputIterator>::value_type>, Allocator>; // C++17
+template<ranges::input_range R, class Allocator>
+ unordered_multiset(from_range_t, R&&, typename see below::size_type, Allocator)
+ -> unordered_multiset<ranges::range_value_t<R>, hash<ranges::range_value_t<R>>,
+ equal_to<ranges::range_value_t<R>>, Allocator>; // C++23
+
+template<ranges::input_range R, class Allocator>
+ unordered_multiset(from_range_t, R&&, Allocator)
+ -> unordered_multiset<ranges::range_value_t<R>, hash<ranges::range_value_t<R>>,
+ equal_to<ranges::range_value_t<R>>, Allocator>; // C++23
+
+template<ranges::input_range R, class Hash, class Allocator>
+ unordered_multiset(from_range_t, R&&, typename see below::size_type, Hash, Allocator)
+ -> unordered_multiset<ranges::range_value_t<R>, Hash,
+ equal_to<ranges::range_value_t<R>>, Allocator>; // C++23
+
template<class T, class Allocator>
unordered_multiset(initializer_list<T>, typename see below::size_type, Allocator)
-> unordered_multiset<T, hash<T>, equal_to<T>, Allocator>; // C++17
@@ -454,25 +522,29 @@ template <class Value, class Hash, class Pred, class Alloc>
template <class Value, class Hash, class Pred, class Alloc>
bool
operator!=(const unordered_multiset<Value, Hash, Pred, Alloc>& x,
- const unordered_multiset<Value, Hash, Pred, Alloc>& y);
+ const unordered_multiset<Value, Hash, Pred, Alloc>& y); // removed in C++20
} // std
*/
#include <__algorithm/is_permutation.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
-#include <__debug>
#include <__functional/is_transparent.h>
#include <__functional/operations.h>
#include <__hash_table>
#include <__iterator/distance.h>
#include <__iterator/erase_if_container.h>
#include <__iterator/iterator_traits.h>
+#include <__iterator/ranges_iterator_traits.h>
#include <__memory/addressof.h>
#include <__memory/allocator.h>
#include <__memory_resource/polymorphic_allocator.h>
#include <__node_handle>
+#include <__ranges/concepts.h>
+#include <__ranges/container_compatible_range.h>
+#include <__ranges/from_range.h>
#include <__type_traits/is_allocator.h>
#include <__utility/forward.h>
#include <version>
@@ -513,7 +585,7 @@ public:
typedef value_type& reference;
typedef const value_type& const_reference;
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
- "Invalid allocator::value_type");
+ "Allocator::value_type must be same type as value_type");
static_assert(is_same<allocator_type, __rebind_alloc<allocator_traits<allocator_type>, value_type> >::value,
"[allocator.requirements] states that rebinding an allocator to the same type should result in the "
@@ -535,7 +607,7 @@ public:
typedef typename __table::const_local_iterator local_iterator;
typedef typename __table::const_local_iterator const_local_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __set_node_handle<typename __table::__node, allocator_type> node_type;
typedef __insert_return_type<iterator, node_type> insert_return_type;
#endif
@@ -549,11 +621,10 @@ public:
unordered_set()
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
{
- _VSTD::__debug_db_insert_c(this);
}
- explicit unordered_set(size_type __n, const hasher& __hf = hasher(),
+ explicit _LIBCPP_HIDE_FROM_ABI unordered_set(size_type __n, const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
inline _LIBCPP_INLINE_VISIBILITY
unordered_set(size_type __n, const allocator_type& __a)
: unordered_set(__n, hasher(), key_equal(), __a) {}
@@ -561,46 +632,74 @@ public:
unordered_set(size_type __n, const hasher& __hf, const allocator_type& __a)
: unordered_set(__n, __hf, key_equal(), __a) {}
#endif
- unordered_set(size_type __n, const hasher& __hf, const key_equal& __eql,
+ _LIBCPP_HIDE_FROM_ABI unordered_set(size_type __n, const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
template <class _InputIterator>
- unordered_set(_InputIterator __first, _InputIterator __last);
+ _LIBCPP_HIDE_FROM_ABI unordered_set(_InputIterator __first, _InputIterator __last);
template <class _InputIterator>
- unordered_set(_InputIterator __first, _InputIterator __last,
+ _LIBCPP_HIDE_FROM_ABI unordered_set(_InputIterator __first, _InputIterator __last,
size_type __n, const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
template <class _InputIterator>
- unordered_set(_InputIterator __first, _InputIterator __last,
+ _LIBCPP_HIDE_FROM_ABI unordered_set(_InputIterator __first, _InputIterator __last,
size_type __n, const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
-#if _LIBCPP_STD_VER > 11
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ unordered_set(from_range_t, _Range&& __range, size_type __n = /*implementation-defined*/0,
+ const hasher& __hf = hasher(), const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : __table_(__hf, __eql, __a) {
+ if (__n > 0) {
+ __table_.__rehash_unique(__n);
+ }
+ insert_range(std::forward<_Range>(__range));
+ }
+#endif
+
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator>
inline _LIBCPP_INLINE_VISIBILITY
unordered_set(_InputIterator __first, _InputIterator __last,
size_type __n, const allocator_type& __a)
: unordered_set(__first, __last, __n, hasher(), key_equal(), __a) {}
template <class _InputIterator>
- unordered_set(_InputIterator __first, _InputIterator __last,
+ _LIBCPP_HIDE_FROM_ABI unordered_set(_InputIterator __first, _InputIterator __last,
size_type __n, const hasher& __hf, const allocator_type& __a)
: unordered_set(__first, __last, __n, __hf, key_equal(), __a) {}
#endif
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ unordered_set(from_range_t, _Range&& __range, size_type __n, const allocator_type& __a)
+ : unordered_set(from_range, std::forward<_Range>(__range), __n, hasher(), key_equal(), __a) {}
+
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ unordered_set(from_range_t, _Range&& __range, size_type __n, const hasher& __hf, const allocator_type& __a)
+ : unordered_set(from_range, std::forward<_Range>(__range), __n, __hf, key_equal(), __a) {}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
explicit unordered_set(const allocator_type& __a);
- unordered_set(const unordered_set& __u);
- unordered_set(const unordered_set& __u, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI unordered_set(const unordered_set& __u);
+ _LIBCPP_HIDE_FROM_ABI unordered_set(const unordered_set& __u, const allocator_type& __a);
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
unordered_set(unordered_set&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
- unordered_set(unordered_set&& __u, const allocator_type& __a);
- unordered_set(initializer_list<value_type> __il);
- unordered_set(initializer_list<value_type> __il, size_type __n,
+ _LIBCPP_HIDE_FROM_ABI unordered_set(unordered_set&& __u, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI unordered_set(initializer_list<value_type> __il);
+ _LIBCPP_HIDE_FROM_ABI unordered_set(initializer_list<value_type> __il, size_type __n,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
- unordered_set(initializer_list<value_type> __il, size_type __n,
+ _LIBCPP_HIDE_FROM_ABI unordered_set(initializer_list<value_type> __il, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
inline _LIBCPP_INLINE_VISIBILITY
unordered_set(initializer_list<value_type> __il, size_type __n,
const allocator_type& __a)
@@ -661,11 +760,7 @@ public:
{return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...);}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
- iterator emplace_hint(const_iterator __p, _Args&&... __args) {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__p)) == this,
- "unordered_set::emplace_hint(const_iterator, args...) called with an iterator not"
- " referring to this unordered_set");
- (void)__p;
+ iterator emplace_hint(const_iterator, _Args&&... __args) {
return __table_.__emplace_unique(std::forward<_Args>(__args)...).first;
}
@@ -673,11 +768,7 @@ public:
pair<iterator, bool> insert(value_type&& __x)
{return __table_.__insert_unique(_VSTD::move(__x));}
_LIBCPP_INLINE_VISIBILITY
- iterator insert(const_iterator __p, value_type&& __x) {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__p)) == this,
- "unordered_set::insert(const_iterator, value_type&&) called with an iterator not"
- " referring to this unordered_set");
- (void)__p;
+ iterator insert(const_iterator, value_type&& __x) {
return insert(std::move(__x)).first;
}
@@ -690,17 +781,23 @@ public:
{return __table_.__insert_unique(__x);}
_LIBCPP_INLINE_VISIBILITY
- iterator insert(const_iterator __p, const value_type& __x) {
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__p)) == this,
- "unordered_set::insert(const_iterator, const value_type&) called with an iterator not"
- " referring to this unordered_set");
- (void)__p;
+ iterator insert(const_iterator, const value_type& __x) {
return insert(__x).first;
}
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __first, _InputIterator __last);
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void insert_range(_Range&& __range) {
+ for (auto&& __element : __range) {
+ __table_.__insert_unique(std::forward<decltype(__element)>(__element));
+ }
+ }
+#endif
+
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __table_.erase(__p);}
_LIBCPP_INLINE_VISIBILITY
@@ -711,11 +808,11 @@ public:
_LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {__table_.clear();}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
insert_return_type insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_set::insert()");
return __table_.template __node_handle_insert_unique<
node_type, insert_return_type>(_VSTD::move(__nh));
@@ -723,7 +820,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __h, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_set::insert()");
return __table_.template __node_handle_insert_unique<node_type>(
__h, _VSTD::move(__nh));
@@ -743,32 +840,32 @@ public:
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_set<key_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__table_.__node_handle_merge_unique(__source.__table_);
}
template<class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_set<key_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__table_.__node_handle_merge_unique(__source.__table_);
}
template<class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__table_.__node_handle_merge_unique(__source.__table_);
}
template<class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__table_.__node_handle_merge_unique(__source.__table_);
}
#endif
@@ -787,31 +884,31 @@ public:
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
iterator find(const _K2& __k) {return __table_.find(__k);}
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const _K2& __k) const {return __table_.find(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
size_type count(const _K2& __k) const {return __table_.__count_unique(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
bool contains(const _K2& __k) const {return find(__k) != end();}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
@@ -819,7 +916,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_unique(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const _K2& __k)
@@ -828,7 +925,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const _K2& __k) const
{return __table_.__equal_range_unique(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
@@ -863,20 +960,6 @@ public:
void rehash(size_type __n) {__table_.__rehash_unique(__n);}
_LIBCPP_INLINE_VISIBILITY
void reserve(size_type __n) {__table_.__reserve_unique(__n);}
-
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
- bool __dereferenceable(const const_iterator* __i) const
- {return __table_.__dereferenceable(__i);}
- bool __decrementable(const const_iterator* __i) const
- {return __table_.__decrementable(__i);}
- bool __addable(const const_iterator* __i, ptrdiff_t __n) const
- {return __table_.__addable(__i, __n);}
- bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
- {return __table_.__addable(__i, __n);}
-
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
};
#if _LIBCPP_STD_VER >= 17
@@ -884,7 +967,7 @@ template<class _InputIterator,
class _Hash = hash<__iter_value_type<_InputIterator>>,
class _Pred = equal_to<__iter_value_type<_InputIterator>>,
class _Allocator = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<!__is_allocator<_Hash>::value>,
class = enable_if_t<!is_integral<_Hash>::value>,
class = enable_if_t<!__is_allocator<_Pred>::value>,
@@ -893,6 +976,20 @@ unordered_set(_InputIterator, _InputIterator, typename allocator_traits<_Allocat
_Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
-> unordered_set<__iter_value_type<_InputIterator>, _Hash, _Pred, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range,
+ class _Hash = hash<ranges::range_value_t<_Range>>,
+ class _Pred = equal_to<ranges::range_value_t<_Range>>,
+ class _Allocator = allocator<ranges::range_value_t<_Range>>,
+ class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!is_integral<_Hash>::value>,
+ class = enable_if_t<!__is_allocator<_Pred>::value>,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_set(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type = 0,
+ _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
+ -> unordered_set<ranges::range_value_t<_Range>, _Hash, _Pred, _Allocator>; // C++23
+#endif
+
template<class _Tp, class _Hash = hash<_Tp>,
class _Pred = equal_to<_Tp>,
class _Allocator = allocator<_Tp>,
@@ -905,7 +1002,7 @@ unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size
-> unordered_set<_Tp, _Hash, _Pred, _Allocator>;
template<class _InputIterator, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>>
unordered_set(_InputIterator, _InputIterator,
typename allocator_traits<_Allocator>::size_type, _Allocator)
@@ -915,7 +1012,7 @@ unordered_set(_InputIterator, _InputIterator,
_Allocator>;
template<class _InputIterator, class _Hash, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<!__is_allocator<_Hash>::value>,
class = enable_if_t<!is_integral<_Hash>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>>
@@ -925,6 +1022,29 @@ unordered_set(_InputIterator, _InputIterator,
equal_to<__iter_value_type<_InputIterator>>,
_Allocator>;
+#if _LIBCPP_STD_VER >= 23
+
+template <ranges::input_range _Range, class _Allocator,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_set(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
+ -> unordered_set<ranges::range_value_t<_Range>, hash<ranges::range_value_t<_Range>>,
+ equal_to<ranges::range_value_t<_Range>>, _Allocator>;
+
+template <ranges::input_range _Range, class _Allocator,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_set(from_range_t, _Range&&, _Allocator)
+ -> unordered_set<ranges::range_value_t<_Range>, hash<ranges::range_value_t<_Range>>,
+ equal_to<ranges::range_value_t<_Range>>, _Allocator>;
+
+template <ranges::input_range _Range, class _Hash, class _Allocator,
+ class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!is_integral<_Hash>::value>,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_set(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
+ -> unordered_set<ranges::range_value_t<_Range>, _Hash, equal_to<ranges::range_value_t<_Range>>, _Allocator>;
+
+#endif
+
template<class _Tp, class _Allocator,
class = enable_if_t<__is_allocator<_Allocator>::value>>
unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator)
@@ -943,7 +1063,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n,
const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__n);
}
@@ -952,7 +1071,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n,
const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, __a)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__n);
}
@@ -961,7 +1079,6 @@ template <class _InputIterator>
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
_InputIterator __first, _InputIterator __last)
{
- _VSTD::__debug_db_insert_c(this);
insert(__first, __last);
}
@@ -972,7 +1089,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__n);
insert(__first, __last);
}
@@ -984,7 +1100,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, __a)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__n);
insert(__first, __last);
}
@@ -995,7 +1110,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
const allocator_type& __a)
: __table_(__a)
{
- _VSTD::__debug_db_insert_c(this);
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
@@ -1003,7 +1117,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
const unordered_set& __u)
: __table_(__u.__table_)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__u.bucket_count());
insert(__u.begin(), __u.end());
}
@@ -1013,7 +1126,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
const unordered_set& __u, const allocator_type& __a)
: __table_(__u.__table_, __a)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__u.bucket_count());
insert(__u.begin(), __u.end());
}
@@ -1027,8 +1139,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
: __table_(_VSTD::move(__u.__table_))
{
- _VSTD::__debug_db_insert_c(this);
- std::__debug_db_swap(this, std::addressof(__u));
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
@@ -1036,22 +1146,18 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
unordered_set&& __u, const allocator_type& __a)
: __table_(_VSTD::move(__u.__table_), __a)
{
- _VSTD::__debug_db_insert_c(this);
if (__a != __u.get_allocator())
{
iterator __i = __u.begin();
while (__u.size() != 0)
__table_.__insert_unique(_VSTD::move(__u.__table_.remove(__i++)->__value_));
}
- else
- std::__debug_db_swap(this, std::addressof(__u));
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
initializer_list<value_type> __il)
{
- _VSTD::__debug_db_insert_c(this);
insert(__il.begin(), __il.end());
}
@@ -1061,7 +1167,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
const key_equal& __eql)
: __table_(__hf, __eql)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__n);
insert(__il.begin(), __il.end());
}
@@ -1072,7 +1177,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, __a)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_unique(__n);
insert(__il.begin(), __il.end());
}
@@ -1120,7 +1224,7 @@ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Value, class _Hash, class _Pred, class _Alloc,
class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1150,6 +1254,8 @@ operator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
return true;
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -1159,6 +1265,8 @@ operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
return !(__x == __y);
}
+#endif
+
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
class _Alloc = allocator<_Value> >
class _LIBCPP_TEMPLATE_VIS unordered_multiset
@@ -1173,7 +1281,7 @@ public:
typedef value_type& reference;
typedef const value_type& const_reference;
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
- "Invalid allocator::value_type");
+ "Allocator::value_type must be same type as value_type");
private:
typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table;
@@ -1191,7 +1299,7 @@ public:
typedef typename __table::const_local_iterator local_iterator;
typedef typename __table::const_local_iterator const_local_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __set_node_handle<typename __table::__node, allocator_type> node_type;
#endif
@@ -1204,13 +1312,12 @@ public:
unordered_multiset()
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
{
- _VSTD::__debug_db_insert_c(this);
}
- explicit unordered_multiset(size_type __n, const hasher& __hf = hasher(),
+ explicit _LIBCPP_HIDE_FROM_ABI unordered_multiset(size_type __n, const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
- unordered_multiset(size_type __n, const hasher& __hf,
+ _LIBCPP_HIDE_FROM_ABI unordered_multiset(size_type __n, const hasher& __hf,
const key_equal& __eql, const allocator_type& __a);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
inline _LIBCPP_INLINE_VISIBILITY
unordered_multiset(size_type __n, const allocator_type& __a)
: unordered_multiset(__n, hasher(), key_equal(), __a) {}
@@ -1219,16 +1326,31 @@ public:
: unordered_multiset(__n, __hf, key_equal(), __a) {}
#endif
template <class _InputIterator>
- unordered_multiset(_InputIterator __first, _InputIterator __last);
+ _LIBCPP_HIDE_FROM_ABI unordered_multiset(_InputIterator __first, _InputIterator __last);
template <class _InputIterator>
- unordered_multiset(_InputIterator __first, _InputIterator __last,
+ _LIBCPP_HIDE_FROM_ABI unordered_multiset(_InputIterator __first, _InputIterator __last,
size_type __n, const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
template <class _InputIterator>
- unordered_multiset(_InputIterator __first, _InputIterator __last,
+ _LIBCPP_HIDE_FROM_ABI unordered_multiset(_InputIterator __first, _InputIterator __last,
size_type __n , const hasher& __hf,
const key_equal& __eql, const allocator_type& __a);
-#if _LIBCPP_STD_VER > 11
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ unordered_multiset(from_range_t, _Range&& __range, size_type __n = /*implementation-defined*/0,
+ const hasher& __hf = hasher(), const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : __table_(__hf, __eql, __a) {
+ if (__n > 0) {
+ __table_.__rehash_multi(__n);
+ }
+ insert_range(std::forward<_Range>(__range));
+ }
+#endif
+
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator>
inline _LIBCPP_INLINE_VISIBILITY
unordered_multiset(_InputIterator __first, _InputIterator __last,
@@ -1240,23 +1362,36 @@ public:
size_type __n, const hasher& __hf, const allocator_type& __a)
: unordered_multiset(__first, __last, __n, __hf, key_equal(), __a) {}
#endif
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ unordered_multiset(from_range_t, _Range&& __range, size_type __n, const allocator_type& __a)
+ : unordered_multiset(from_range, std::forward<_Range>(__range), __n, hasher(), key_equal(), __a) {}
+
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ unordered_multiset(from_range_t, _Range&& __range, size_type __n, const hasher& __hf, const allocator_type& __a)
+ : unordered_multiset(from_range, std::forward<_Range>(__range), __n, __hf, key_equal(), __a) {}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
explicit unordered_multiset(const allocator_type& __a);
- unordered_multiset(const unordered_multiset& __u);
- unordered_multiset(const unordered_multiset& __u, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI unordered_multiset(const unordered_multiset& __u);
+ _LIBCPP_HIDE_FROM_ABI unordered_multiset(const unordered_multiset& __u, const allocator_type& __a);
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
unordered_multiset(unordered_multiset&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
- unordered_multiset(unordered_multiset&& __u, const allocator_type& __a);
- unordered_multiset(initializer_list<value_type> __il);
- unordered_multiset(initializer_list<value_type> __il, size_type __n,
+ _LIBCPP_HIDE_FROM_ABI unordered_multiset(unordered_multiset&& __u, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI unordered_multiset(initializer_list<value_type> __il);
+ _LIBCPP_HIDE_FROM_ABI unordered_multiset(initializer_list<value_type> __il, size_type __n,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
- unordered_multiset(initializer_list<value_type> __il, size_type __n,
+ _LIBCPP_HIDE_FROM_ABI unordered_multiset(initializer_list<value_type> __il, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
inline _LIBCPP_INLINE_VISIBILITY
unordered_multiset(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)
: unordered_multiset(__il, __n, hasher(), key_equal(), __a) {}
@@ -1280,7 +1415,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
unordered_multiset& operator=(unordered_multiset&& __u)
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
- unordered_multiset& operator=(initializer_list<value_type> __il);
+ _LIBCPP_HIDE_FROM_ABI unordered_multiset& operator=(initializer_list<value_type> __il);
#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
@@ -1338,11 +1473,21 @@ public:
_LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __first, _InputIterator __last);
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<value_type> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ void insert_range(_Range&& __range) {
+ for (auto&& __element : __range) {
+ __table_.__insert_multi(std::forward<decltype(__element)>(__element));
+ }
+ }
+#endif
+
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
iterator insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_multiset::insert()");
return __table_.template __node_handle_insert_multi<node_type>(
_VSTD::move(__nh));
@@ -1350,7 +1495,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_multiset::insert()");
return __table_.template __node_handle_insert_multi<node_type>(
__hint, _VSTD::move(__nh));
@@ -1371,32 +1516,32 @@ public:
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_set<key_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_set<key_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
#endif
@@ -1425,31 +1570,31 @@ public:
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
iterator find(const _K2& __k) {return __table_.find(__k);}
template<class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const _K2& __k) const {return __table_.find(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
size_type count(const _K2& __k) const {return __table_.__count_multi(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template<class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
bool contains(const _K2& __k) const {return find(__k) != end();}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
@@ -1457,7 +1602,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_multi(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const _K2& __k)
@@ -1466,7 +1611,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const _K2& __k) const
{return __table_.__equal_range_multi(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
@@ -1501,20 +1646,6 @@ public:
void rehash(size_type __n) {__table_.__rehash_multi(__n);}
_LIBCPP_INLINE_VISIBILITY
void reserve(size_type __n) {__table_.__reserve_multi(__n);}
-
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
- bool __dereferenceable(const const_iterator* __i) const
- {return __table_.__dereferenceable(__i);}
- bool __decrementable(const const_iterator* __i) const
- {return __table_.__decrementable(__i);}
- bool __addable(const const_iterator* __i, ptrdiff_t __n) const
- {return __table_.__addable(__i, __n);}
- bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
- {return __table_.__addable(__i, __n);}
-
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
};
#if _LIBCPP_STD_VER >= 17
@@ -1522,7 +1653,7 @@ template<class _InputIterator,
class _Hash = hash<__iter_value_type<_InputIterator>>,
class _Pred = equal_to<__iter_value_type<_InputIterator>>,
class _Allocator = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<!__is_allocator<_Hash>::value>,
class = enable_if_t<!is_integral<_Hash>::value>,
class = enable_if_t<!__is_allocator<_Pred>::value>,
@@ -1531,6 +1662,20 @@ unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Al
_Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
-> unordered_multiset<__iter_value_type<_InputIterator>, _Hash, _Pred, _Allocator>;
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range,
+ class _Hash = hash<ranges::range_value_t<_Range>>,
+ class _Pred = equal_to<ranges::range_value_t<_Range>>,
+ class _Allocator = allocator<ranges::range_value_t<_Range>>,
+ class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!is_integral<_Hash>::value>,
+ class = enable_if_t<!__is_allocator<_Pred>::value>,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_multiset(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type = 0,
+ _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
+ -> unordered_multiset<ranges::range_value_t<_Range>, _Hash, _Pred, _Allocator>; // C++23
+#endif
+
template<class _Tp, class _Hash = hash<_Tp>,
class _Pred = equal_to<_Tp>, class _Allocator = allocator<_Tp>,
class = enable_if_t<!__is_allocator<_Hash>::value>,
@@ -1542,7 +1687,7 @@ unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>:
-> unordered_multiset<_Tp, _Hash, _Pred, _Allocator>;
template<class _InputIterator, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>>
unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_multiset<__iter_value_type<_InputIterator>,
@@ -1551,7 +1696,7 @@ unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Al
_Allocator>;
template<class _InputIterator, class _Hash, class _Allocator,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<!__is_allocator<_Hash>::value>,
class = enable_if_t<!is_integral<_Hash>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>>
@@ -1561,6 +1706,29 @@ unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Al
equal_to<__iter_value_type<_InputIterator>>,
_Allocator>;
+#if _LIBCPP_STD_VER >= 23
+
+template <ranges::input_range _Range, class _Allocator,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_multiset(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
+ -> unordered_multiset<ranges::range_value_t<_Range>, hash<ranges::range_value_t<_Range>>,
+ equal_to<ranges::range_value_t<_Range>>, _Allocator>;
+
+template <ranges::input_range _Range, class _Allocator,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_multiset(from_range_t, _Range&&, _Allocator)
+ -> unordered_multiset<ranges::range_value_t<_Range>, hash<ranges::range_value_t<_Range>>,
+ equal_to<ranges::range_value_t<_Range>>, _Allocator>;
+
+template <ranges::input_range _Range, class _Hash, class _Allocator,
+ class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!is_integral<_Hash>::value>,
+ class = enable_if_t<__is_allocator<_Allocator>::value>>
+unordered_multiset(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
+ -> unordered_multiset<ranges::range_value_t<_Range>, _Hash, equal_to<ranges::range_value_t<_Range>>, _Allocator>;
+
+#endif
+
template<class _Tp, class _Allocator,
class = enable_if_t<__is_allocator<_Allocator>::value>>
unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator)
@@ -1579,7 +1747,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
size_type __n, const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__n);
}
@@ -1589,7 +1756,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
const allocator_type& __a)
: __table_(__hf, __eql, __a)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__n);
}
@@ -1598,7 +1764,6 @@ template <class _InputIterator>
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
_InputIterator __first, _InputIterator __last)
{
- _VSTD::__debug_db_insert_c(this);
insert(__first, __last);
}
@@ -1609,7 +1774,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__n);
insert(__first, __last);
}
@@ -1621,7 +1785,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, __a)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__n);
insert(__first, __last);
}
@@ -1632,7 +1795,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
const allocator_type& __a)
: __table_(__a)
{
- _VSTD::__debug_db_insert_c(this);
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
@@ -1640,7 +1802,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
const unordered_multiset& __u)
: __table_(__u.__table_)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__u.bucket_count());
insert(__u.begin(), __u.end());
}
@@ -1650,7 +1811,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
const unordered_multiset& __u, const allocator_type& __a)
: __table_(__u.__table_, __a)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__u.bucket_count());
insert(__u.begin(), __u.end());
}
@@ -1664,8 +1824,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
: __table_(_VSTD::move(__u.__table_))
{
- _VSTD::__debug_db_insert_c(this);
- std::__debug_db_swap(this, std::addressof(__u));
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
@@ -1673,22 +1831,18 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
unordered_multiset&& __u, const allocator_type& __a)
: __table_(_VSTD::move(__u.__table_), __a)
{
- _VSTD::__debug_db_insert_c(this);
if (__a != __u.get_allocator())
{
iterator __i = __u.begin();
while (__u.size() != 0)
__table_.__insert_multi(_VSTD::move(__u.__table_.remove(__i++)->__value_));
}
- else
- std::__debug_db_swap(this, std::addressof(__u));
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
initializer_list<value_type> __il)
{
- _VSTD::__debug_db_insert_c(this);
insert(__il.begin(), __il.end());
}
@@ -1698,7 +1852,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
const key_equal& __eql)
: __table_(__hf, __eql)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__n);
insert(__il.begin(), __il.end());
}
@@ -1709,7 +1862,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, __a)
{
- _VSTD::__debug_db_insert_c(this);
__table_.__rehash_multi(__n);
insert(__il.begin(), __il.end());
}
@@ -1758,7 +1910,7 @@ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Value, class _Hash, class _Pred, class _Alloc,
class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1792,6 +1944,8 @@ operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
return true;
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -1801,24 +1955,28 @@ operator!=(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
return !(__x == __y);
}
+#endif
+
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _KeyT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
-using unordered_set = std::unordered_set<_KeyT, _HashT, _PredT, polymorphic_allocator<_KeyT>>;
+using unordered_set _LIBCPP_AVAILABILITY_PMR = std::unordered_set<_KeyT, _HashT, _PredT, polymorphic_allocator<_KeyT>>;
template <class _KeyT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
-using unordered_multiset = std::unordered_multiset<_KeyT, _HashT, _PredT, polymorphic_allocator<_KeyT>>;
+using unordered_multiset _LIBCPP_AVAILABILITY_PMR = std::unordered_multiset<_KeyT, _HashT, _PredT, polymorphic_allocator<_KeyT>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iterator>
+# include <type_traits>
#endif
#endif // _LIBCPP_UNORDERED_SET
diff --git a/contrib/libs/cxxsupp/libcxx/include/utility b/contrib/libs/cxxsupp/libcxx/include/utility
index a4d8cf853d2..c5581d55e79 100644
--- a/contrib/libs/cxxsupp/libcxx/include/utility
+++ b/contrib/libs/cxxsupp/libcxx/include/utility
@@ -84,14 +84,15 @@ struct pair
explicit(see-below) constexpr pair();
explicit(see-below) pair(const T1& x, const T2& y); // constexpr in C++14
template <class U = T1, class V = T2> explicit(see-below) pair(U&&, V&&); // constexpr in C++14
- template <class U, class V> constexpr explicit(see below) pair(pair<U, V>&); // since C++23
+ template <class U, class V> constexpr explicit(see-below) pair(pair<U, V>&); // since C++23
template <class U, class V> explicit(see-below) pair(const pair<U, V>& p); // constexpr in C++14
template <class U, class V> explicit(see-below) pair(pair<U, V>&& p); // constexpr in C++14
template <class U, class V>
- constexpr explicit(see below) pair(const pair<U, V>&&); // since C++23
+ constexpr explicit(see-below) pair(const pair<U, V>&&); // since C++23
+ template <pair-like P> constexpr explicit(see-below) pair(P&&); // since C++23
template <class... Args1, class... Args2>
- pair(piecewise_construct_t, tuple<Args1...> first_args,
- tuple<Args2...> second_args); // constexpr in C++20
+ pair(piecewise_construct_t, tuple<Args1...> first_args, // constexpr in C++20
+ tuple<Args2...> second_args);
constexpr const pair& operator=(const pair& p) const; // since C++23
template <class U, class V> pair& operator=(const pair<U, V>& p); // constexpr in C++20
@@ -103,6 +104,8 @@ struct pair
template <class U, class V> pair& operator=(pair<U, V>&& p); // constexpr in C++20
template <class U, class V>
constexpr const pair& operator=(pair<U, V>&& p) const; // since C++23
+ template <pair-like P> constexpr pair& operator=(P&&); // since C++23
+ template <pair-like P> constexpr const pair& operator=(P&&) const; // since C++23
void swap(pair& p) noexcept(is_nothrow_swappable_v<T1> &&
is_nothrow_swappable_v<T2>); // constexpr in C++20
@@ -117,24 +120,30 @@ struct common_type<pair<T1, T2>, pair<U1, U2>>;
template<class T1, class T2> pair(T1, T2) -> pair<T1, T2>;
-template <class T1, class T2> bool operator==(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
-template <class T1, class T2> bool operator!=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
-template <class T1, class T2> bool operator< (const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
-template <class T1, class T2> bool operator> (const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
-template <class T1, class T2> bool operator>=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
-template <class T1, class T2> bool operator<=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
-template <class T1, class T2>
- constexpr common_comparison_type_t<synth-three-way-result<T1>,
- synth-three-way-result<T2>>
- operator<=>(const pair<T1,T2>&, const pair<T1,T2>&); // C++20
+template <class T1, class T2, class U1, class U2>
+bool operator==(const pair<T1,T2>&, const pair<U1,U2>&); // constexpr in C++14
+template <class T1, class T2, class U1, class U2>
+bool operator!=(const pair<T1,T2>&, const pair<U1,U2>&); // constexpr in C++14, removed in C++20
+template <class T1, class T2, class U1, class U2>
+bool operator< (const pair<T1,T2>&, const pair<U1,U2>&); // constexpr in C++14, removed in C++20
+template <class T1, class T2, class U1, class U2>
+bool operator> (const pair<T1,T2>&, const pair<U1,U2>&); // constexpr in C++14, removed in C++20
+template <class T1, class T2, class U1, class U2>
+bool operator>=(const pair<T1,T2>&, const pair<U1,U2>&); // constexpr in C++14, removed in C++20
+template <class T1, class T2, class U1, class U2>
+bool operator<=(const pair<T1,T2>&, const pair<U1,U2>&); // constexpr in C++14, removed in C++20
+template <class T1, class T2, class U1, class U2>
+ constexpr common_comparison_type_t<synth-three-way-result<T1,U1>,
+ synth-three-way-result<T2,U2>>
+ operator<=>(const pair<T1,T2>&, const pair<U1,U2>&); // C++20
template <class T1, class T2> pair<V1, V2> make_pair(T1&&, T2&&); // constexpr in C++14
template <class T1, class T2>
void
swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y))); // constexpr in C++20
-template<class T1, class T2>
-constexpr void swap(const pair<T1, T2>& x, const pair<T1, T2>& y) noexcept(noexcept(x.swap(y))); // since C++23
+template<class T1, class T2> // since C++23
+constexpr void swap(const pair<T1, T2>& x, const pair<T1, T2>& y) noexcept(noexcept(x.swap(y)));
struct piecewise_construct_t { explicit piecewise_construct_t() = default; };
inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
@@ -208,8 +217,8 @@ template<class... T>
using index_sequence_for = make_index_sequence<sizeof...(T)>;
template<class T, class U=T>
- constexpr T exchange(T& obj, U&& new_value)
- noexcept(is_nothrow_move_constructible<T>::value && is_nothrow_assignable<T&, U>::value); // constexpr in C++17, noexcept in C++23
+ constexpr T exchange(T& obj, U&& new_value) // constexpr in C++17, noexcept in C++23
+ noexcept(is_nothrow_move_constructible<T>::value && is_nothrow_assignable<T&, U>::value);
// 20.2.7, in-place construction // C++17
struct in_place_t {
@@ -231,7 +240,7 @@ template <size_t I>
// [utility.underlying], to_underlying
template <class T>
- constexpr underlying_type_t<T> to_underlying( T value ) noexcept; // C++2b
+ constexpr underlying_type_t<T> to_underlying( T value ) noexcept; // C++23
} // std
@@ -266,8 +275,8 @@ template <class T>
#include <initializer_list>
// [tuple.helper]
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_size.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_size.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/contrib/libs/cxxsupp/libcxx/include/valarray b/contrib/libs/cxxsupp/libcxx/include/valarray
index 92521ed3819..09a7c9016c9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/valarray
+++ b/contrib/libs/cxxsupp/libcxx/include/valarray
@@ -116,6 +116,8 @@ public:
size_t start() const;
size_t size() const;
size_t stride() const;
+
+ friend bool operator==(const slice& x, const slice& y); // since C++20
};
template <class T>
@@ -351,8 +353,10 @@ template <class T> unspecified2 end(const valarray<T>& v);
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <__functional/operations.h>
+#include <__memory/addressof.h>
#include <__memory/allocator.h>
#include <__memory/uninitialized_algorithms.h>
+#include <__type_traits/decay.h>
#include <__type_traits/remove_reference.h>
#include <__utility/move.h>
#include <__utility/swap.h>
@@ -400,10 +404,18 @@ public:
_LIBCPP_INLINE_VISIBILITY size_t start() const {return __start_;}
_LIBCPP_INLINE_VISIBILITY size_t size() const {return __size_;}
_LIBCPP_INLINE_VISIBILITY size_t stride() const {return __stride_;}
+
+#if _LIBCPP_STD_VER >= 20
+
+ _LIBCPP_HIDE_FROM_ABI friend bool operator==(const slice& __x, const slice& __y) {
+ return __x.start() == __y.start() && __x.size() == __y.size() && __x.stride() == __y.stride();
+ }
+
+#endif
};
template <class _Tp> class _LIBCPP_TEMPLATE_VIS slice_array;
-class _LIBCPP_TYPE_VIS gslice;
+class _LIBCPP_EXPORTED_FROM_ABI gslice;
template <class _Tp> class _LIBCPP_TEMPLATE_VIS gslice_array;
template <class _Tp> class _LIBCPP_TEMPLATE_VIS mask_array;
template <class _Tp> class _LIBCPP_TEMPLATE_VIS indirect_array;
@@ -432,7 +444,7 @@ template <class _Op, class _A0>
struct _UnaryOp
{
typedef typename _Op::__result_type __result_type;
- typedef typename decay<__result_type>::type value_type;
+ using value_type = __decay_t<__result_type>;
_Op __op_;
_A0 __a0_;
@@ -451,7 +463,7 @@ template <class _Op, class _A0, class _A1>
struct _BinaryOp
{
typedef typename _Op::__result_type __result_type;
- typedef typename decay<__result_type>::type value_type;
+ using value_type = __decay_t<__result_type>;
_Op __op_;
_A0 __a0_;
@@ -1104,18 +1116,18 @@ private:
valarray& __assign_range(const value_type* __f, const value_type* __l);
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Tp, size_t _Size>
valarray(const _Tp(&)[_Size], size_t) -> valarray<_Tp>;
#endif
-extern template _LIBCPP_FUNC_VIS void valarray<size_t>::resize(size_t, size_t);
+extern template _LIBCPP_EXPORTED_FROM_ABI void valarray<size_t>::resize(size_t, size_t);
template <class _Op, class _Tp>
struct _UnaryOp<_Op, valarray<_Tp> >
{
typedef typename _Op::__result_type __result_type;
- typedef typename decay<__result_type>::type value_type;
+ using value_type = __decay_t<__result_type>;
_Op __op_;
const valarray<_Tp>& __a0_;
@@ -1134,7 +1146,7 @@ template <class _Op, class _Tp, class _A1>
struct _BinaryOp<_Op, valarray<_Tp>, _A1>
{
typedef typename _Op::__result_type __result_type;
- typedef typename decay<__result_type>::type value_type;
+ using value_type = __decay_t<__result_type>;
_Op __op_;
const valarray<_Tp>& __a0_;
@@ -1155,7 +1167,7 @@ template <class _Op, class _A0, class _Tp>
struct _BinaryOp<_Op, _A0, valarray<_Tp> >
{
typedef typename _Op::__result_type __result_type;
- typedef typename decay<__result_type>::type value_type;
+ using value_type = __decay_t<__result_type>;
_Op __op_;
_A0 __a0_;
@@ -1176,7 +1188,7 @@ template <class _Op, class _Tp>
struct _BinaryOp<_Op, valarray<_Tp>, valarray<_Tp> >
{
typedef typename _Op::__result_type __result_type;
- typedef typename decay<__result_type>::type value_type;
+ using value_type = __decay_t<__result_type>;
_Op __op_;
const valarray<_Tp>& __a0_;
@@ -1326,7 +1338,6 @@ private:
{}
template <class> friend class valarray;
- template <class> friend class sliceExpr;
};
template <class _Tp>
@@ -1527,7 +1538,7 @@ slice_array<_Tp>::operator=(const value_type& __x) const
// gslice
-class _LIBCPP_TYPE_VIS gslice
+class _LIBCPP_EXPORTED_FROM_ABI gslice
{
valarray<size_t> __size_;
valarray<size_t> __stride_;
@@ -2818,20 +2829,20 @@ valarray<_Tp>::valarray(size_t __n)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
::new ((void*)__end_) value_type();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2852,20 +2863,20 @@ valarray<_Tp>::valarray(const value_type* __p, size_t __n)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (size_t __n_left = __n; __n_left; ++__end_, ++__p, --__n_left)
::new ((void*)__end_) value_type(*__p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2877,20 +2888,20 @@ valarray<_Tp>::valarray(const valarray& __v)
if (__v.size())
{
__begin_ = __end_ = allocator<value_type>().allocate(__v.size());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (value_type* __p = __v.__begin_; __p != __v.__end_; ++__end_, ++__p)
::new ((void*)__end_) value_type(*__p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__v.size());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2914,21 +2925,21 @@ valarray<_Tp>::valarray(initializer_list<value_type> __il)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
size_t __n_left = __n;
for (const value_type* __p = __il.begin(); __n_left; ++__end_, ++__p, --__n_left)
::new ((void*)__end_) value_type(*__p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2943,21 +2954,21 @@ valarray<_Tp>::valarray(const slice_array<value_type>& __sa)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
size_t __n_left = __n;
for (const value_type* __p = __sa.__vp_; __n_left; ++__end_, __p += __sa.__stride_, --__n_left)
::new ((void*)__end_) value_type(*__p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2970,23 +2981,23 @@ valarray<_Tp>::valarray(const gslice_array<value_type>& __ga)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef const size_t* _Ip;
const value_type* __s = __ga.__vp_;
for (_Ip __i = __ga.__1d_.__begin_, __e = __ga.__1d_.__end_;
__i != __e; ++__i, ++__end_)
::new ((void*)__end_) value_type(__s[*__i]);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2999,23 +3010,23 @@ valarray<_Tp>::valarray(const mask_array<value_type>& __ma)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef const size_t* _Ip;
const value_type* __s = __ma.__vp_;
for (_Ip __i = __ma.__1d_.__begin_, __e = __ma.__1d_.__end_;
__i != __e; ++__i, ++__end_)
::new ((void*)__end_) value_type(__s[*__i]);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -3028,23 +3039,23 @@ valarray<_Tp>::valarray(const indirect_array<value_type>& __ia)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef const size_t* _Ip;
const value_type* __s = __ia.__vp_;
for (_Ip __i = __ia.__1d_.__begin_, __e = __ia.__1d_.__end_;
__i != __e; ++__i, ++__end_)
::new ((void*)__end_) value_type(__s[*__i]);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -3753,20 +3764,20 @@ valarray<_Tp>::resize(size_t __n, value_type __x)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
::new ((void*)__end_) value_type(__x);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -4933,8 +4944,11 @@ _LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <concepts>
+# include <cstdlib>
# include <cstring>
# include <functional>
+# include <stdexcept>
+# include <type_traits>
#endif
#endif // _LIBCPP_VALARRAY
diff --git a/contrib/libs/cxxsupp/libcxx/include/variant b/contrib/libs/cxxsupp/libcxx/include/variant
index 13c89822ca7..7df2e87cf3b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/variant
+++ b/contrib/libs/cxxsupp/libcxx/include/variant
@@ -210,10 +210,12 @@ namespace std {
#include <__compare/compare_three_way_result.h>
#include <__compare/three_way_comparable.h>
#include <__config>
+#include <__exception/exception.h>
#include <__functional/hash.h>
#include <__functional/invoke.h>
#include <__functional/operations.h>
#include <__functional/unary_function.h>
+#include <__memory/addressof.h>
#include <__type_traits/add_const.h>
#include <__type_traits/add_cv.h>
#include <__type_traits/add_pointer.h>
@@ -231,12 +233,13 @@ namespace std {
#include <__type_traits/remove_const.h>
#include <__type_traits/type_identity.h>
#include <__type_traits/void_t.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/in_place.h>
#include <__utility/move.h>
#include <__utility/swap.h>
#include <__variant/monostate.h>
-#include <exception>
+#include <__verbose_abort>
#include <initializer_list>
#include <limits>
#include <new>
@@ -257,7 +260,7 @@ _LIBCPP_PUSH_MACROS
namespace std { // explicitly not using versioning namespace
-class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS bad_variant_access : public exception {
+class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS bad_variant_access : public exception {
public:
const char* what() const _NOEXCEPT override;
};
@@ -266,7 +269,7 @@ public:
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
// Light N-dimensional array of function pointers. Used in place of std::array to avoid
// adding a dependency.
@@ -285,10 +288,10 @@ _LIBCPP_NORETURN
inline _LIBCPP_HIDE_FROM_ABI
_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
void __throw_bad_variant_access() {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_variant_access();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_variant_access was thrown in -fno-exceptions mode");
#endif
}
@@ -547,7 +550,7 @@ private:
}
template <class _Fp, class... _Fs>
- static constexpr void __std_visit_visitor_return_type_check() {
+ static _LIBCPP_HIDE_FROM_ABI constexpr void __std_visit_visitor_return_type_check() {
static_assert(
__all<is_same_v<_Fp, _Fs>...>::value,
"`std::visit` requires the visitor to have a single return type.");
@@ -594,9 +597,9 @@ private:
template <class _Fp, class _Vp, class... _Vs>
_LIBCPP_HIDE_FROM_ABI
static constexpr auto __make_fdiagonal() {
- constexpr size_t _Np = __remove_cvref_t<_Vp>::__size();
- static_assert(__all<(_Np == __remove_cvref_t<_Vs>::__size())...>::value);
- return __make_fdiagonal_impl<_Fp, _Vp, _Vs...>(make_index_sequence<_Np>{});
+ constexpr size_t __np = __remove_cvref_t<_Vp>::__size();
+ static_assert(__all<(__np == __remove_cvref_t<_Vs>::__size())...>::value);
+ return __make_fdiagonal_impl<_Fp, _Vp, _Vs...>(make_index_sequence<__np>{});
}
template <class _Fp, class... _Vs, size_t... _Is>
@@ -660,7 +663,7 @@ struct __variant {
_VSTD::forward<_Vs>(__vs)...);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Rp, class _Visitor, class... _Vs>
_LIBCPP_HIDE_FROM_ABI
static constexpr _Rp __visit_value(_Visitor&& __visitor,
@@ -673,7 +676,7 @@ struct __variant {
private:
template <class _Visitor, class... _Values>
- static constexpr void __std_visit_exhaustive_visitor_check() {
+ static _LIBCPP_HIDE_FROM_ABI constexpr void __std_visit_exhaustive_visitor_check() {
static_assert(is_invocable_v<_Visitor, _Values...>,
"`std::visit` requires the visitor to be exhaustive.");
}
@@ -692,7 +695,7 @@ private:
_Visitor&& __visitor;
};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Rp, class _Visitor>
struct __value_visitor_return_type {
template <class... _Alts>
@@ -721,7 +724,7 @@ private:
return __value_visitor<_Visitor>{_VSTD::forward<_Visitor>(__visitor)};
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Rp, class _Visitor>
_LIBCPP_HIDE_FROM_ABI
static constexpr auto __make_value_visitor(_Visitor&& __visitor) {
@@ -1034,10 +1037,10 @@ protected:
__a.__value = _VSTD::forward<_Arg>(__arg);
} else {
struct {
- void operator()(true_type) const {
+ _LIBCPP_HIDE_FROM_ABI void operator()(true_type) const {
__this->__emplace<_Ip>(_VSTD::forward<_Arg>(__arg));
}
- void operator()(false_type) const {
+ _LIBCPP_HIDE_FROM_ABI void operator()(false_type) const {
__this->__emplace<_Ip>(_Tp(_VSTD::forward<_Arg>(__arg)));
}
__assignment* __this;
@@ -1155,10 +1158,10 @@ class _LIBCPP_TEMPLATE_VIS __impl
public:
using __base_type::__base_type; // get in_place_index_t constructor & friends
- __impl(__impl const&) = default;
- __impl(__impl&&) = default;
- __impl& operator=(__impl const&) = default;
- __impl& operator=(__impl&&) = default;
+ _LIBCPP_HIDE_FROM_ABI __impl(__impl const&) = default;
+ _LIBCPP_HIDE_FROM_ABI __impl(__impl&&) = default;
+ _LIBCPP_HIDE_FROM_ABI __impl& operator=(__impl const&) = default;
+ _LIBCPP_HIDE_FROM_ABI __impl& operator=(__impl&&) = default;
template <size_t _Ip, class _Arg>
_LIBCPP_HIDE_FROM_ABI
@@ -1187,7 +1190,7 @@ public:
_VSTD::swap(__lhs, __rhs);
}
__impl __tmp(_VSTD::move(*__rhs));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
if constexpr (__all<is_nothrow_move_constructible_v<_Types>...>::value) {
this->__generic_construct(*__rhs, _VSTD::move(*__lhs));
} else {
@@ -1271,7 +1274,7 @@ struct __all_overloads : _Bases... {
using _Bases::operator()...;
};
-template <class IdxSeq>
+template <class _IdxSeq>
struct __make_overloads_imp;
template <size_t ..._Idx>
@@ -1291,7 +1294,7 @@ using __best_match_t =
} // namespace __variant_detail
template <class... _Types>
-class _LIBCPP_TEMPLATE_VIS variant
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DECLSPEC_EMPTY_BASES variant
: private __sfinae_ctor_base<
__all<is_copy_constructible_v<_Types>...>::value,
__all<is_move_constructible_v<_Types>...>::value>,
@@ -1323,8 +1326,8 @@ public:
constexpr variant() noexcept(is_nothrow_default_constructible_v<__first_type>)
: __impl_(in_place_index<0>) {}
- constexpr variant(const variant&) = default;
- constexpr variant(variant&&) = default;
+ _LIBCPP_HIDE_FROM_ABI constexpr variant(const variant&) = default;
+ _LIBCPP_HIDE_FROM_ABI constexpr variant(variant&&) = default;
template <
class _Arg,
@@ -1393,10 +1396,10 @@ public:
is_nothrow_constructible_v<_Tp, initializer_list< _Up>&, _Args...>)
: __impl_(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {}
- ~variant() = default;
+ _LIBCPP_HIDE_FROM_ABI ~variant() = default;
- constexpr variant& operator=(const variant&) = default;
- constexpr variant& operator=(variant&&) = default;
+ _LIBCPP_HIDE_FROM_ABI constexpr variant& operator=(const variant&) = default;
+ _LIBCPP_HIDE_FROM_ABI constexpr variant& operator=(variant&&) = default;
template <
class _Arg,
@@ -1652,7 +1655,7 @@ constexpr bool operator==(const variant<_Types...>& __lhs,
return __variant::__visit_value_at(__lhs.index(), __convert_to_bool<equal_to<>>{}, __lhs, __rhs);
}
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
template <class... _Types> requires (three_way_comparable<_Types> && ...)
_LIBCPP_HIDE_FROM_ABI constexpr common_comparison_category_t<compare_three_way_result_t<_Types>...>
@@ -1671,7 +1674,7 @@ operator<=>(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) {
return __variant::__visit_value_at(__lhs.index(), __three_way, __lhs, __rhs);
}
-# endif // _LIBCPP_STD_VER > 17
+# endif // _LIBCPP_STD_VER >= 20
template <class... _Types>
_LIBCPP_HIDE_FROM_ABI
@@ -1757,7 +1760,7 @@ constexpr decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {
_VSTD::forward<_Vs>(__vs)...);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <
class _Rp, class _Visitor, class... _Vs,
typename = void_t<decltype(_VSTD::__as_variant(std::declval<_Vs>()))...> >
@@ -1824,13 +1827,14 @@ constexpr auto&& __unchecked_get(variant<_Types...>& __v) noexcept {
return std::__unchecked_get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <exception>
# include <type_traits>
# include <typeinfo>
# include <utility>
diff --git a/contrib/libs/cxxsupp/libcxx/include/vector b/contrib/libs/cxxsupp/libcxx/include/vector
index 32ee8cd450b..cf70d15c03d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/vector
+++ b/contrib/libs/cxxsupp/libcxx/include/vector
@@ -41,6 +41,8 @@ public:
vector(size_type n, const value_type& value, const allocator_type& = allocator_type());
template <class InputIterator>
vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type());
+ template<container-compatible-range<T> R>
+ constexpr vector(from_range_t, R&& rg, const Allocator& = Allocator()); // C++23
vector(const vector& x);
vector(vector&& x)
noexcept(is_nothrow_move_constructible<allocator_type>::value);
@@ -55,6 +57,8 @@ public:
vector& operator=(initializer_list<value_type> il);
template <class InputIterator>
void assign(InputIterator first, InputIterator last);
+ template<container-compatible-range<T> R>
+ constexpr void assign_range(R&& rg); // C++23
void assign(size_type n, const value_type& u);
void assign(initializer_list<value_type> il);
@@ -99,6 +103,8 @@ public:
void push_back(value_type&& x);
template <class... Args>
reference emplace_back(Args&&... args); // reference in C++17
+ template<container-compatible-range<T> R>
+ constexpr void append_range(R&& rg); // C++23
void pop_back();
template <class... Args> iterator emplace(const_iterator position, Args&&... args);
@@ -107,6 +113,8 @@ public:
iterator insert(const_iterator position, size_type n, const value_type& x);
template <class InputIterator>
iterator insert(const_iterator position, InputIterator first, InputIterator last);
+ template<container-compatible-range<T> R>
+ constexpr iterator insert_range(const_iterator position, R&& rg); // C++23
iterator insert(const_iterator position, initializer_list<value_type> il);
iterator erase(const_iterator position);
@@ -165,6 +173,8 @@ public:
vector(size_type n, const value_type& value, const allocator_type& = allocator_type());
template <class InputIterator>
vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type());
+ template<container-compatible-range<bool> R>
+ constexpr vector(from_range_t, R&& rg, const Allocator& = Allocator());
vector(const vector& x);
vector(vector&& x)
noexcept(is_nothrow_move_constructible<allocator_type>::value);
@@ -179,6 +189,8 @@ public:
vector& operator=(initializer_list<value_type> il);
template <class InputIterator>
void assign(InputIterator first, InputIterator last);
+ template<container-compatible-range<T> R>
+ constexpr void assign_range(R&& rg); // C++23
void assign(size_type n, const value_type& u);
void assign(initializer_list<value_type> il);
@@ -218,6 +230,8 @@ public:
void push_back(const value_type& x);
template <class... Args> reference emplace_back(Args&&... args); // C++14; reference in C++17
+ template<container-compatible-range<T> R>
+ constexpr void append_range(R&& rg); // C++23
void pop_back();
template <class... Args> iterator emplace(const_iterator position, Args&&... args); // C++14
@@ -225,6 +239,8 @@ public:
iterator insert(const_iterator position, size_type n, const value_type& x);
template <class InputIterator>
iterator insert(const_iterator position, InputIterator first, InputIterator last);
+ template<container-compatible-range<T> R>
+ constexpr iterator insert_range(const_iterator position, R&& rg); // C++23
iterator insert(const_iterator position, initializer_list<value_type> il);
iterator erase(const_iterator position);
@@ -247,14 +263,21 @@ template <class InputIterator, class Allocator = allocator<typename iterator_tra
vector(InputIterator, InputIterator, Allocator = Allocator())
-> vector<typename iterator_traits<InputIterator>::value_type, Allocator>; // C++17
+template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
+ vector(from_range_t, R&&, Allocator = Allocator())
+ -> vector<ranges::range_value_t<R>, Allocator>; // C++23
+
template <class Allocator> struct hash<std::vector<bool, Allocator>>;
-template <class T, class Allocator> bool operator==(const vector<T,Allocator>& x, const vector<T,Allocator>& y);
-template <class T, class Allocator> bool operator< (const vector<T,Allocator>& x, const vector<T,Allocator>& y);
-template <class T, class Allocator> bool operator!=(const vector<T,Allocator>& x, const vector<T,Allocator>& y);
-template <class T, class Allocator> bool operator> (const vector<T,Allocator>& x, const vector<T,Allocator>& y);
-template <class T, class Allocator> bool operator>=(const vector<T,Allocator>& x, const vector<T,Allocator>& y);
-template <class T, class Allocator> bool operator<=(const vector<T,Allocator>& x, const vector<T,Allocator>& y);
+template <class T, class Allocator> bool operator==(const vector<T,Allocator>& x, const vector<T,Allocator>& y); // constexpr since C++20
+template <class T, class Allocator> bool operator!=(const vector<T,Allocator>& x, const vector<T,Allocator>& y); // removed in C++20
+template <class T, class Allocator> bool operator< (const vector<T,Allocator>& x, const vector<T,Allocator>& y); // removed in C++20
+template <class T, class Allocator> bool operator> (const vector<T,Allocator>& x, const vector<T,Allocator>& y); // removed in C++20
+template <class T, class Allocator> bool operator>=(const vector<T,Allocator>& x, const vector<T,Allocator>& y); // removed in C++20
+template <class T, class Allocator> bool operator<=(const vector<T,Allocator>& x, const vector<T,Allocator>& y); // removed in C++20
+template <class T, class Allocator> constexpr
+ constexpr synth-three-way-result<T> operator<=>(const vector<T, Allocator>& x,
+ const vector<T, Allocator>& y); // since C++20
template <class T, class Allocator>
void swap(vector<T,Allocator>& x, vector<T,Allocator>& y)
@@ -262,10 +285,10 @@ void swap(vector<T,Allocator>& x, vector<T,Allocator>& y)
template <class T, class Allocator, class U>
typename vector<T, Allocator>::size_type
-erase(vector<T, Allocator>& c, const U& value); // C++20
+erase(vector<T, Allocator>& c, const U& value); // since C++20
template <class T, class Allocator, class Predicate>
typename vector<T, Allocator>::size_type
-erase_if(vector<T, Allocator>& c, Predicate pred); // C++20
+erase_if(vector<T, Allocator>& c, Predicate pred); // since C++20
template<class T>
@@ -281,44 +304,57 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++
#include <__algorithm/copy.h>
#include <__algorithm/equal.h>
#include <__algorithm/fill_n.h>
+#include <__algorithm/iterator_operations.h>
#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lexicographical_compare_three_way.h>
#include <__algorithm/remove.h>
#include <__algorithm/remove_if.h>
#include <__algorithm/rotate.h>
#include <__algorithm/unwrap_iter.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__bit_reference>
#include <__concepts/same_as.h>
#include <__config>
-#include <__debug>
#include <__format/enable_insertable.h>
#include <__format/formatter.h>
+#include <__format/formatter_bool.h>
#include <__functional/hash.h>
#include <__functional/unary_function.h>
#include <__iterator/advance.h>
+#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/reverse_iterator.h>
#include <__iterator/wrap_iter.h>
+#include <__memory/addressof.h>
#include <__memory/allocate_at_least.h>
+#include <__memory/allocator_traits.h>
#include <__memory/pointer_traits.h>
#include <__memory/swap_allocator.h>
#include <__memory/temp_value.h>
#include <__memory/uninitialized_algorithms.h>
#include <__memory_resource/polymorphic_allocator.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/container_compatible_range.h>
+#include <__ranges/from_range.h>
+#include <__ranges/size.h>
#include <__split_buffer>
#include <__type_traits/is_allocator.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
#include <__type_traits/noexcept_move_assign_container.h>
+#include <__type_traits/type_identity.h>
#include <__utility/exception_guard.h>
#include <__utility/forward.h>
#include <__utility/move.h>
+#include <__utility/pair.h>
#include <__utility/swap.h>
#include <climits>
-#include <cstdlib>
#include <cstring>
#include <iosfwd> // for forward declaration of vector
#include <limits>
#include <stdexcept>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -341,7 +377,6 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
-
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _Allocator /* = allocator<_Tp> */>
@@ -381,7 +416,6 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
vector() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
{
- std::__debug_db_insert_c(this);
}
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(const allocator_type& __a)
#if _LIBCPP_STD_VER <= 14
@@ -391,10 +425,9 @@ public:
#endif
: __end_cap_(nullptr, __a)
{
- std::__debug_db_insert_c(this);
}
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n, const allocator_type& __a);
#endif
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(size_type __n, const value_type& __x);
@@ -404,7 +437,6 @@ public:
vector(size_type __n, const value_type& __x, const allocator_type& __a)
: __end_cap_(nullptr, __a)
{
- std::__debug_db_insert_c(this);
if (__n > 0)
{
__vallocate(__n);
@@ -413,12 +445,12 @@ public:
}
template <class _InputIterator,
- __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value &&
+ __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value &&
is_constructible<value_type, typename iterator_traits<_InputIterator>::reference>::value,
int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(_InputIterator __first, _InputIterator __last);
template <class _InputIterator,
- __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value &&
+ __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value &&
is_constructible<value_type, typename iterator_traits<_InputIterator>::reference>::value,
int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
@@ -426,29 +458,41 @@ public:
template <
class _ForwardIterator,
- __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value &&
+ __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value &&
is_constructible<value_type, typename iterator_traits<_ForwardIterator>::reference>::value,
int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(_ForwardIterator __first, _ForwardIterator __last);
template <class _ForwardIterator,
- __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value &&
+ __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value &&
is_constructible<value_type, typename iterator_traits<_ForwardIterator>::reference>::value,
int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a);
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI constexpr vector(from_range_t, _Range&& __range,
+ const allocator_type& __alloc = allocator_type()) : __end_cap_(nullptr, __alloc) {
+ if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
+ auto __n = static_cast<size_type>(ranges::distance(__range));
+ __init_with_size(ranges::begin(__range), ranges::end(__range), __n);
+
+ } else {
+ __init_with_sentinel(ranges::begin(__range), ranges::end(__range));
+ }
+ }
+#endif
+
private:
class __destroy_vector {
public:
- _LIBCPP_CONSTEXPR __destroy_vector(vector& __vec) : __vec_(__vec) {}
+ _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI __destroy_vector(vector& __vec) : __vec_(__vec) {}
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void operator()() {
- __vec_.__annotate_delete();
- std::__debug_db_erase_c(std::addressof(__vec_));
-
if (__vec_.__begin_ != nullptr) {
__vec_.__clear();
+ __vec_.__annotate_delete();
__alloc_traits::deallocate(__vec_.__alloc(), __vec_.__begin_, __vec_.capacity());
}
}
@@ -479,7 +523,7 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
vector(vector&& __x)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
noexcept;
#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
@@ -492,17 +536,31 @@ public:
_NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
template <class _InputIterator,
- __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value &&
+ __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value &&
is_constructible<value_type, typename iterator_traits<_InputIterator>::reference>::value,
int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void assign(_InputIterator __first, _InputIterator __last);
template <
class _ForwardIterator,
- __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value &&
+ __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value &&
is_constructible<value_type, typename iterator_traits<_ForwardIterator>::reference>::value,
int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void assign(_ForwardIterator __first, _ForwardIterator __last);
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr void assign_range(_Range&& __range) {
+ if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
+ auto __n = static_cast<size_type>(ranges::distance(__range));
+ __assign_with_size(ranges::begin(__range), ranges::end(__range), __n);
+
+ } else {
+ __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
+ }
+ }
+#endif
+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const_reference __u);
#ifndef _LIBCPP_CXX03_LANG
@@ -566,22 +624,22 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT
{
- _LIBCPP_ASSERT(!empty(), "front() called on an empty vector");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");
return *this->__begin_;
}
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT
{
- _LIBCPP_ASSERT(!empty(), "front() called on an empty vector");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");
return *this->__begin_;
}
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT
{
- _LIBCPP_ASSERT(!empty(), "back() called on an empty vector");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");
return *(this->__end_ - 1);
}
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT
{
- _LIBCPP_ASSERT(!empty(), "back() called on an empty vector");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");
return *(this->__end_ - 1);
}
@@ -599,12 +657,20 @@ public:
template <class... _Args>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
reference emplace_back(_Args&&... __args);
#else
void emplace_back(_Args&&... __args);
#endif
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr void append_range(_Range&& __range) {
+ insert_range(end(), std::forward<_Range>(__range));
+ }
+#endif
+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
void pop_back();
@@ -618,15 +684,29 @@ public:
iterator insert(const_iterator __position, size_type __n, const_reference __x);
template <class _InputIterator,
- __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value &&
+ __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value &&
is_constructible< value_type, typename iterator_traits<_InputIterator>::reference>::value,
int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator
insert(const_iterator __position, _InputIterator __first, _InputIterator __last);
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<_Tp> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr iterator insert_range(const_iterator __position, _Range&& __range) {
+ if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
+ auto __n = static_cast<size_type>(ranges::distance(__range));
+ return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n);
+
+ } else {
+ return __insert_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));
+ }
+ }
+#endif
+
template <
class _ForwardIterator,
- __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value &&
+ __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value &&
is_constructible< value_type, typename iterator_traits<_ForwardIterator>::reference>::value,
int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator
@@ -647,7 +727,6 @@ public:
size_type __old_size = size();
__clear();
__annotate_shrink(__old_size);
- std::__debug_db_invalidate_all(this);
}
#if _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED
@@ -667,23 +746,12 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
- bool __dereferenceable(const const_iterator* __i) const;
- bool __decrementable(const const_iterator* __i) const;
- bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
- bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
-
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
private:
pointer __begin_ = nullptr;
pointer __end_ = nullptr;
__compressed_pair<pointer, allocator_type> __end_cap_ =
__compressed_pair<pointer, allocator_type>(nullptr, __default_init_tag());
- _LIBCPP_HIDE_FROM_ABI void __invalidate_iterators_past(pointer __new_last);
-
// Allocate space for __n objects
// throws length_error if __n > max_size()
// throws (probably bad_alloc) if memory run out
@@ -707,9 +775,49 @@ private:
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
void __construct_at_end(size_type __n, const_reference __x);
- template <class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value, int> = 0>
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
- __construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n);
+ template <class _InputIterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ void __init_with_size(_InputIterator __first, _Sentinel __last, size_type __n) {
+ auto __guard = std::__make_exception_guard(__destroy_vector(*this));
+
+ if (__n > 0) {
+ __vallocate(__n);
+ __construct_at_end(__first, __last, __n);
+ }
+
+ __guard.__complete();
+ }
+
+ template <class _InputIterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ void __init_with_sentinel(_InputIterator __first, _Sentinel __last) {
+ auto __guard = std::__make_exception_guard(__destroy_vector(*this));
+
+ for (; __first != __last; ++__first)
+ emplace_back(*__first);
+
+ __guard.__complete();
+ }
+
+ template <class _Iterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ void __assign_with_sentinel(_Iterator __first, _Sentinel __last);
+
+ template <class _ForwardIterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ void __assign_with_size(_ForwardIterator __first, _Sentinel __last, difference_type __n);
+
+ template <class _InputIterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ iterator __insert_with_sentinel(const_iterator __position, _InputIterator __first, _Sentinel __last);
+
+ template <class _Iterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ iterator __insert_with_size(const_iterator __position, _Iterator __first, _Sentinel __last, difference_type __n);
+
+ template <class _InputIterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ void __construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n);
void __append_uninitialized(size_type __n);
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __append(size_type __n);
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __append(size_type __n, const_reference __x);
@@ -727,8 +835,6 @@ private:
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
void __destruct_at_end(pointer __new_last) _NOEXCEPT
{
- if (!__libcpp_is_constant_evaluated())
- __invalidate_iterators_past(__new_last);
size_type __old_size = size();
__base_destruct_at_end(__new_last);
__annotate_shrink(__old_size);
@@ -743,17 +849,19 @@ private:
inline void __emplace_back_slow_path(_Args&&... __args);
// The following functions are no-ops outside of AddressSanitizer mode.
- // We call annotatations only for the default Allocator because other allocators
- // may not meet the AddressSanitizer alignment constraints.
- // See the documentation for __sanitizer_annotate_contiguous_container for more details.
-#ifndef _LIBCPP_HAS_NO_ASAN
+ // We call annotations for every allocator, unless explicitly disabled.
+ //
+ // To disable annotations for a particular allocator, change value of
+ // __asan_annotate_container_with_allocator to false.
+ // For more details, see the "Using libc++" documentation page or
+ // the documentation for __sanitizer_annotate_contiguous_container.
+#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(_LIBCPP_NO_ASAN_CONTIGUOUS_CONTAINER_FEATURES)
_LIBCPP_CONSTEXPR_SINCE_CXX20
void __annotate_contiguous_container(const void *__beg, const void *__end,
const void *__old_mid,
const void *__new_mid) const
{
-
- if (!__libcpp_is_constant_evaluated() && __beg && is_same<allocator_type, __default_allocator_type>::value)
+ if (!__libcpp_is_constant_evaluated() && __beg != nullptr && __asan_annotate_container_with_allocator<_Allocator>::value)
__sanitizer_annotate_contiguous_container(__beg, __end, __old_mid, __new_mid);
}
#else
@@ -875,6 +983,7 @@ private:
if (__alloc() != __c.__alloc())
{
__clear();
+ __annotate_delete();
__alloc_traits::deallocate(__alloc(), this->__begin_, capacity());
this->__begin_ = this->__end_ = __end_cap() = nullptr;
}
@@ -901,7 +1010,7 @@ private:
#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Alloc>::value>
>
vector(_InputIterator, _InputIterator)
@@ -909,13 +1018,22 @@ vector(_InputIterator, _InputIterator)
template<class _InputIterator,
class _Alloc,
- class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
class = enable_if_t<__is_allocator<_Alloc>::value>
>
vector(_InputIterator, _InputIterator, _Alloc)
-> vector<__iter_value_type<_InputIterator>, _Alloc>;
#endif
+#if _LIBCPP_STD_VER >= 23
+template <ranges::input_range _Range,
+ class _Alloc = allocator<ranges::range_value_t<_Range>>,
+ class = enable_if_t<__is_allocator<_Alloc>::value>
+ >
+vector(from_range_t, _Range&&, _Alloc = _Alloc())
+ -> vector<ranges::range_value_t<_Range>, _Alloc>;
+#endif
+
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
void
@@ -931,7 +1049,6 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a
std::swap(this->__end_cap(), __v.__end_cap());
__v.__first_ = __v.__begin_;
__annotate_new(size());
- std::__debug_db_invalidate_all(this);
}
template <class _Tp, class _Allocator>
@@ -951,7 +1068,6 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a
std::swap(this->__end_cap(), __v.__end_cap());
__v.__first_ = __v.__begin_;
__annotate_new(size());
- std::__debug_db_invalidate_all(this);
return __r;
}
@@ -963,6 +1079,7 @@ vector<_Tp, _Allocator>::__vdeallocate() _NOEXCEPT
if (this->__begin_ != nullptr)
{
clear();
+ __annotate_delete();
__alloc_traits::deallocate(this->__alloc(), this->__begin_, capacity());
this->__begin_ = this->__end_ = this->__end_cap() = nullptr;
}
@@ -1030,10 +1147,9 @@ vector<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x)
}
template <class _Tp, class _Allocator>
-template <class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value, int> >
+template <class _InputIterator, class _Sentinel>
_LIBCPP_CONSTEXPR_SINCE_CXX20 void
-vector<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n)
-{
+vector<_Tp, _Allocator>::__construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n) {
_ConstructTransaction __tx(*this, __n);
__tx.__pos_ = std::__uninitialized_allocator_copy(__alloc(), __first, __last, __tx.__pos_);
}
@@ -1100,7 +1216,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
vector<_Tp, _Allocator>::vector(size_type __n)
{
auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- std::__debug_db_insert_c(this);
if (__n > 0)
{
__vallocate(__n);
@@ -1109,14 +1224,13 @@ vector<_Tp, _Allocator>::vector(size_type __n)
__guard.__complete();
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)
: __end_cap_(nullptr, __a)
{
auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- std::__debug_db_insert_c(this);
if (__n > 0)
{
__vallocate(__n);
@@ -1131,7 +1245,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x)
{
auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- std::__debug_db_insert_c(this);
if (__n > 0)
{
__vallocate(__n);
@@ -1141,69 +1254,47 @@ vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x)
}
template <class _Tp, class _Allocator>
-template <class _InputIterator, __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value &&
+template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value &&
is_constructible<_Tp, typename iterator_traits<_InputIterator>::reference>::value,
int> >
_LIBCPP_CONSTEXPR_SINCE_CXX20
vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last)
{
- auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- std::__debug_db_insert_c(this);
- for (; __first != __last; ++__first)
- emplace_back(*__first);
- __guard.__complete();
+ __init_with_sentinel(__first, __last);
}
template <class _Tp, class _Allocator>
-template <class _InputIterator, __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value &&
+template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value &&
is_constructible<_Tp, typename iterator_traits<_InputIterator>::reference>::value,
int> >
_LIBCPP_CONSTEXPR_SINCE_CXX20
vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a)
: __end_cap_(nullptr, __a)
{
- auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- std::__debug_db_insert_c(this);
- for (; __first != __last; ++__first)
- emplace_back(*__first);
- __guard.__complete();
+ __init_with_sentinel(__first, __last);
}
template <class _Tp, class _Allocator>
-template <class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value &&
+template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value &&
is_constructible<_Tp, typename iterator_traits<_ForwardIterator>::reference>::value,
int> >
_LIBCPP_CONSTEXPR_SINCE_CXX20
vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last)
{
- auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- std::__debug_db_insert_c(this);
- size_type __n = static_cast<size_type>(std::distance(__first, __last));
- if (__n > 0)
- {
- __vallocate(__n);
- __construct_at_end(__first, __last, __n);
- }
- __guard.__complete();
+ size_type __n = static_cast<size_type>(std::distance(__first, __last));
+ __init_with_size(__first, __last, __n);
}
template <class _Tp, class _Allocator>
-template <class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value &&
+template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value &&
is_constructible<_Tp, typename iterator_traits<_ForwardIterator>::reference>::value,
int> >
_LIBCPP_CONSTEXPR_SINCE_CXX20
vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a)
: __end_cap_(nullptr, __a)
{
- auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- std::__debug_db_insert_c(this);
- size_type __n = static_cast<size_type>(std::distance(__first, __last));
- if (__n > 0)
- {
- __vallocate(__n);
- __construct_at_end(__first, __last, __n);
- }
- __guard.__complete();
+ size_type __n = static_cast<size_type>(std::distance(__first, __last));
+ __init_with_size(__first, __last, __n);
}
template <class _Tp, class _Allocator>
@@ -1211,15 +1302,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
vector<_Tp, _Allocator>::vector(const vector& __x)
: __end_cap_(nullptr, __alloc_traits::select_on_container_copy_construction(__x.__alloc()))
{
- auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- std::__debug_db_insert_c(this);
- size_type __n = __x.size();
- if (__n > 0)
- {
- __vallocate(__n);
- __construct_at_end(__x.__begin_, __x.__end_, __n);
- }
- __guard.__complete();
+ __init_with_size(__x.__begin_, __x.__end_, __x.size());
}
template <class _Tp, class _Allocator>
@@ -1227,30 +1310,20 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
vector<_Tp, _Allocator>::vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
: __end_cap_(nullptr, __a)
{
- auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- std::__debug_db_insert_c(this);
- size_type __n = __x.size();
- if (__n > 0)
- {
- __vallocate(__n);
- __construct_at_end(__x.__begin_, __x.__end_, __n);
- }
- __guard.__complete();
+ __init_with_size(__x.__begin_, __x.__end_, __x.size());
}
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
inline _LIBCPP_HIDE_FROM_ABI
vector<_Tp, _Allocator>::vector(vector&& __x)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
noexcept
#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
#endif
: __end_cap_(nullptr, std::move(__x.__alloc()))
{
- std::__debug_db_insert_c(this);
- std::__debug_db_swap(this, std::addressof(__x));
this->__begin_ = __x.__begin_;
this->__end_ = __x.__end_;
this->__end_cap() = __x.__end_cap();
@@ -1263,14 +1336,12 @@ inline _LIBCPP_HIDE_FROM_ABI
vector<_Tp, _Allocator>::vector(vector&& __x, const __type_identity_t<allocator_type>& __a)
: __end_cap_(nullptr, __a)
{
- std::__debug_db_insert_c(this);
if (__a == __x.__alloc())
{
this->__begin_ = __x.__begin_;
this->__end_ = __x.__end_;
this->__end_cap() = __x.__end_cap();
__x.__begin_ = __x.__end_ = __x.__end_cap() = nullptr;
- std::__debug_db_swap(this, std::addressof(__x));
}
else
{
@@ -1289,7 +1360,6 @@ inline _LIBCPP_HIDE_FROM_ABI
vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il)
{
auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- std::__debug_db_insert_c(this);
if (__il.size() > 0)
{
__vallocate(__il.size());
@@ -1305,7 +1375,6 @@ vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il, const allocat
: __end_cap_(nullptr, __a)
{
auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- std::__debug_db_insert_c(this);
if (__il.size() > 0)
{
__vallocate(__il.size());
@@ -1355,7 +1424,6 @@ vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type)
this->__end_ = __c.__end_;
this->__end_cap() = __c.__end_cap();
__c.__begin_ = __c.__end_ = __c.__end_cap() = nullptr;
- std::__debug_db_swap(this, std::addressof(__c));
}
template <class _Tp, class _Allocator>
@@ -1373,40 +1441,52 @@ vector<_Tp, _Allocator>::operator=(const vector& __x)
}
template <class _Tp, class _Allocator>
-template <class _InputIterator, __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value &&
+template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value &&
is_constructible<_Tp, typename iterator_traits<_InputIterator>::reference>::value,
int> >
_LIBCPP_CONSTEXPR_SINCE_CXX20 void
vector<_Tp, _Allocator>::assign(_InputIterator __first, _InputIterator __last)
{
+ __assign_with_sentinel(__first, __last);
+}
+
+template <class _Tp, class _Allocator>
+template <class _Iterator, class _Sentinel>
+_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+void vector<_Tp, _Allocator>::__assign_with_sentinel(_Iterator __first, _Sentinel __last) {
clear();
for (; __first != __last; ++__first)
emplace_back(*__first);
}
template <class _Tp, class _Allocator>
-template <class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value &&
+template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value &&
is_constructible<_Tp, typename iterator_traits<_ForwardIterator>::reference>::value,
int> >
_LIBCPP_CONSTEXPR_SINCE_CXX20 void
vector<_Tp, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
{
- size_type __new_size = static_cast<size_type>(std::distance(__first, __last));
+ __assign_with_size(__first, __last, std::distance(__first, __last));
+}
+
+template <class _Tp, class _Allocator>
+template <class _ForwardIterator, class _Sentinel>
+_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+void vector<_Tp, _Allocator>::__assign_with_size(_ForwardIterator __first, _Sentinel __last, difference_type __n) {
+ size_type __new_size = static_cast<size_type>(__n);
if (__new_size <= capacity())
{
- _ForwardIterator __mid = __last;
- bool __growing = false;
if (__new_size > size())
{
- __growing = true;
- __mid = __first;
- std::advance(__mid, size());
- }
- pointer __m = std::copy(__first, __mid, this->__begin_);
- if (__growing)
+ _ForwardIterator __mid = std::next(__first, size());
+ std::copy(__first, __mid, this->__begin_);
__construct_at_end(__mid, __last, __new_size - size());
+ }
else
+ {
+ pointer __m = std::__copy<_ClassicAlgPolicy>(__first, __last, this->__begin_).second;
this->__destruct_at_end(__m);
+ }
}
else
{
@@ -1414,30 +1494,6 @@ vector<_Tp, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __las
__vallocate(__recommend(__new_size));
__construct_at_end(__first, __last, __new_size);
}
- std::__debug_db_invalidate_all(this);
-}
-
-template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-void
-vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u)
-{
- if (__n <= capacity())
- {
- size_type __s = size();
- std::fill_n(this->__begin_, std::min(__n, __s), __u);
- if (__n > __s)
- __construct_at_end(__n - __s, __u);
- else
- this->__destruct_at_end(this->__begin_ + __n);
- }
- else
- {
- __vdeallocate();
- __vallocate(__recommend(static_cast<size_type>(__n)));
- __construct_at_end(__n, __u);
- }
- std::__debug_db_invalidate_all(this);
}
// We need to save the make_iter function and replace all constructor calls with it
@@ -1470,6 +1526,28 @@ vector<_Tp, _Allocator>::__make_iter(const_pointer __p) const _NOEXCEPT
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
+void
+vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u)
+{
+ if (__n <= capacity())
+ {
+ size_type __s = size();
+ std::fill_n(this->__begin_, std::min(__n, __s), __u);
+ if (__n > __s)
+ __construct_at_end(__n - __s, __u);
+ else
+ this->__destruct_at_end(this->__begin_ + __n);
+ }
+ else
+ {
+ __vdeallocate();
+ __vallocate(__recommend(static_cast<size_type>(__n)));
+ __construct_at_end(__n, __u);
+ }
+}
+
+template <class _Tp, class _Allocator>
+_LIBCPP_CONSTEXPR_SINCE_CXX20
inline _LIBCPP_HIDE_FROM_ABI
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::begin() _NOEXCEPT
@@ -1510,7 +1588,7 @@ inline _LIBCPP_HIDE_FROM_ABI
typename vector<_Tp, _Allocator>::reference
vector<_Tp, _Allocator>::operator[](size_type __n) _NOEXCEPT
{
- _LIBCPP_ASSERT(__n < size(), "vector[] index out of bounds");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");
return this->__begin_[__n];
}
@@ -1520,7 +1598,7 @@ inline _LIBCPP_HIDE_FROM_ABI
typename vector<_Tp, _Allocator>::const_reference
vector<_Tp, _Allocator>::operator[](size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n < size(), "vector[] index out of bounds");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");
return this->__begin_[__n];
}
@@ -1566,19 +1644,19 @@ vector<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
{
if (capacity() > size())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
allocator_type& __a = this->__alloc();
__split_buffer<value_type, allocator_type&> __v(size(), size(), __a);
__swap_out_circular_buffer(__v);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -1642,7 +1720,7 @@ template <class _Tp, class _Allocator>
template <class... _Args>
_LIBCPP_CONSTEXPR_SINCE_CXX20
inline
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typename vector<_Tp, _Allocator>::reference
#else
void
@@ -1655,7 +1733,7 @@ vector<_Tp, _Allocator>::emplace_back(_Args&&... __args)
}
else
__emplace_back_slow_path(std::forward<_Args>(__args)...);
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return this->back();
#endif
}
@@ -1666,7 +1744,7 @@ inline
void
vector<_Tp, _Allocator>::pop_back()
{
- _LIBCPP_ASSERT(!empty(), "vector::pop_back called on an empty vector");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "vector::pop_back called on an empty vector");
this->__destruct_at_end(this->__end_ - 1);
}
@@ -1676,15 +1754,11 @@ inline _LIBCPP_HIDE_FROM_ABI
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::erase(const_iterator __position)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__position)) == this,
- "vector::erase(iterator) called with an iterator not referring to this vector");
- _LIBCPP_ASSERT(__position != end(),
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__position != end(),
"vector::erase(iterator) called with a non-dereferenceable iterator");
difference_type __ps = __position - cbegin();
pointer __p = this->__begin_ + __ps;
this->__destruct_at_end(std::move(__p + 1, this->__end_, __p));
- if (!__libcpp_is_constant_evaluated())
- this->__invalidate_iterators_past(__p - 1);
return __make_iter(__p);
}
@@ -1693,17 +1767,10 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__first)) == this,
- "vector::erase(iterator, iterator) called with an iterator not referring to this vector");
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__last)) == this,
- "vector::erase(iterator, iterator) called with an iterator not referring to this vector");
-
- _LIBCPP_ASSERT(__first <= __last, "vector::erase(first, last) called with invalid range");
+ _LIBCPP_ASSERT_VALID_INPUT_RANGE(__first <= __last, "vector::erase(first, last) called with invalid range");
pointer __p = this->__begin_ + (__first - begin());
if (__first != __last) {
this->__destruct_at_end(std::move(__p + (__last - __first), this->__end_, __p));
- if (!__libcpp_is_constant_evaluated())
- this->__invalidate_iterators_past(__p - 1);
}
return __make_iter(__p);
}
@@ -1733,8 +1800,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__position)) == this,
- "vector::insert(iterator, x) called with an iterator not referring to this vector");
pointer __p = this->__begin_ + (__position - begin());
// We can't compare unrelated pointers inside constant expressions
if (!__libcpp_is_constant_evaluated() && this->__end_ < this->__end_cap())
@@ -1767,8 +1832,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__position)) == this,
- "vector::insert(iterator, x) called with an iterator not referring to this vector");
pointer __p = this->__begin_ + (__position - begin());
if (this->__end_ < this->__end_cap())
{
@@ -1798,8 +1861,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__position)) == this,
- "vector::emplace(iterator, x) called with an iterator not referring to this vector");
pointer __p = this->__begin_ + (__position - begin());
if (this->__end_ < this->__end_cap())
{
@@ -1829,8 +1890,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_reference __x)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__position)) == this,
- "vector::insert(iterator, n, x) called with an iterator not referring to this vector");
pointer __p = this->__begin_ + (__position - begin());
if (__n > 0)
{
@@ -1864,16 +1923,21 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_
}
return __make_iter(__p);
}
-
template <class _Tp, class _Allocator>
-template <class _InputIterator, __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value &&
+template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value &&
is_constructible<_Tp, typename iterator_traits<_InputIterator>::reference>::value,
int> >
_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__position)) == this,
- "vector::insert(iterator, range) called with an iterator not referring to this vector");
+ return __insert_with_sentinel(__position, __first, __last);
+}
+
+template <class _Tp, class _Allocator>
+template <class _InputIterator, class _Sentinel>
+_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+typename vector<_Tp, _Allocator>::iterator
+vector<_Tp, _Allocator>::__insert_with_sentinel(const_iterator __position, _InputIterator __first, _Sentinel __last) {
difference_type __off = __position - begin();
pointer __p = this->__begin_ + __off;
allocator_type& __a = this->__alloc();
@@ -1885,24 +1949,24 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __firs
__split_buffer<value_type, allocator_type&> __v(__a);
if (__first != __last)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
- __v.__construct_at_end(__first, __last);
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ __v.__construct_at_end_with_sentinel(std::move(__first), std::move(__last));
difference_type __old_size = __old_last - this->__begin_;
difference_type __old_p = __p - this->__begin_;
reserve(__recommend(size() + __v.size()));
__p = this->__begin_ + __old_p;
__old_last = this->__begin_ + __old_size;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
erase(__make_iter(__old_last), end());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
__p = std::rotate(__p, __old_last, this->__end_);
insert(__make_iter(__p), std::make_move_iterator(__v.begin()),
@@ -1911,23 +1975,30 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __firs
}
template <class _Tp, class _Allocator>
-template <class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value &&
+template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value &&
is_constructible<_Tp, typename iterator_traits<_ForwardIterator>::reference>::value,
int> >
_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
{
- _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__position)) == this,
- "vector::insert(iterator, range) called with an iterator not referring to this vector");
+ return __insert_with_size(__position, __first, __last, std::distance(__first, __last));
+}
+
+template <class _Tp, class _Allocator>
+template <class _Iterator, class _Sentinel>
+_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+typename vector<_Tp, _Allocator>::iterator
+vector<_Tp, _Allocator>::__insert_with_size(const_iterator __position, _Iterator __first, _Sentinel __last,
+ difference_type __n) {
+ auto __insertion_size = __n;
pointer __p = this->__begin_ + (__position - begin());
- difference_type __n = std::distance(__first, __last);
if (__n > 0)
{
if (__n <= this->__end_cap() - this->__end_)
{
size_type __old_n = __n;
pointer __old_last = this->__end_;
- _ForwardIterator __m = __last;
+ _Iterator __m = std::next(__first, __n);
difference_type __dx = this->__end_ - __p;
if (__n > __dx)
{
@@ -1947,7 +2018,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __fi
{
allocator_type& __a = this->__alloc();
__split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), __p - this->__begin_, __a);
- __v.__construct_at_end(__first, __last);
+ __v.__construct_at_end_with_size(__first, __insertion_size);
__p = __swap_out_circular_buffer(__v, __p);
}
}
@@ -1966,6 +2037,18 @@ vector<_Tp, _Allocator>::resize(size_type __sz)
this->__destruct_at_end(this->__begin_ + __sz);
}
+template <class _Tp, class _Allocator>
+_LIBCPP_CONSTEXPR_SINCE_CXX20
+void
+vector<_Tp, _Allocator>::resize(size_type __sz, const_reference __x)
+{
+ size_type __cs = size();
+ if (__cs < __sz)
+ this->__append(__sz - __cs, __x);
+ else if (__cs > __sz)
+ this->__destruct_at_end(this->__begin_ + __sz);
+}
+
#if _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED
template <class _Tp, class _Allocator>
@@ -1986,18 +2069,6 @@ vector<_Tp, _Allocator>::resize_uninitialized(size_type __sz)
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
void
-vector<_Tp, _Allocator>::resize(size_type __sz, const_reference __x)
-{
- size_type __cs = size();
- if (__cs < __sz)
- this->__append(__sz - __cs, __x);
- else if (__cs > __sz)
- this->__destruct_at_end(this->__begin_ + __sz);
-}
-
-template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-void
vector<_Tp, _Allocator>::swap(vector& __x)
#if _LIBCPP_STD_VER >= 14
_NOEXCEPT
@@ -2006,16 +2077,15 @@ vector<_Tp, _Allocator>::swap(vector& __x)
__is_nothrow_swappable<allocator_type>::value)
#endif
{
- _LIBCPP_ASSERT(__alloc_traits::propagate_on_container_swap::value ||
- this->__alloc() == __x.__alloc(),
- "vector::swap: Either propagate_on_container_swap must be true"
- " or the allocators must compare equal");
+ _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__alloc_traits::propagate_on_container_swap::value ||
+ this->__alloc() == __x.__alloc(),
+ "vector::swap: Either propagate_on_container_swap must be true"
+ " or the allocators must compare equal");
std::swap(this->__begin_, __x.__begin_);
std::swap(this->__end_, __x.__end_);
std::swap(this->__end_cap(), __x.__end_cap());
std::__swap_allocator(this->__alloc(), __x.__alloc(),
integral_constant<bool,__alloc_traits::propagate_on_container_swap::value>());
- std::__debug_db_swap(this, std::addressof(__x));
}
template <class _Tp, class _Allocator>
@@ -2040,61 +2110,6 @@ vector<_Tp, _Allocator>::__invariants() const
return true;
}
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-
-template <class _Tp, class _Allocator>
-bool
-vector<_Tp, _Allocator>::__dereferenceable(const const_iterator* __i) const
-{
- return this->__begin_ <= __i->base() && __i->base() < this->__end_;
-}
-
-template <class _Tp, class _Allocator>
-bool
-vector<_Tp, _Allocator>::__decrementable(const const_iterator* __i) const
-{
- return this->__begin_ < __i->base() && __i->base() <= this->__end_;
-}
-
-template <class _Tp, class _Allocator>
-bool
-vector<_Tp, _Allocator>::__addable(const const_iterator* __i, ptrdiff_t __n) const
-{
- const_pointer __p = __i->base() + __n;
- return this->__begin_ <= __p && __p <= this->__end_;
-}
-
-template <class _Tp, class _Allocator>
-bool
-vector<_Tp, _Allocator>::__subscriptable(const const_iterator* __i, ptrdiff_t __n) const
-{
- const_pointer __p = __i->base() + __n;
- return this->__begin_ <= __p && __p < this->__end_;
-}
-
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-
-template <class _Tp, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI
-void
-vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
- __c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __p = __c->end_; __p != __c->beg_; ) {
- --__p;
- const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
- if (__i->base() > __new_last) {
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- std::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
- }
- }
- __get_db()->unlock();
-#else
- ((void)__new_last);
-#endif
-}
-
#if _YNDX_LIBCXX_ENABLE_VECTOR_BOOL_COMPRESSION == 1
// vector<bool>
@@ -2179,12 +2194,11 @@ public:
private:
class __destroy_vector {
public:
- _LIBCPP_CONSTEXPR __destroy_vector(vector& __vec) : __vec_(__vec) {}
+ _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI __destroy_vector(vector& __vec) : __vec_(__vec) {}
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void operator()() {
if (__vec_.__begin_ != nullptr)
__storage_traits::deallocate(__vec_.__alloc(), __vec_.__begin_, __vec_.__cap());
- std::__debug_db_invalidate_all(this);
}
private:
@@ -2195,23 +2209,40 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~vector() { __destroy_vector(*this)(); }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit vector(size_type __n);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit vector(size_type __n, const allocator_type& __a);
#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(size_type __n, const value_type& __v);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(size_type __n, const value_type& __v, const allocator_type& __a);
template <class _InputIterator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(_InputIterator __first, _InputIterator __last,
- typename enable_if<__is_exactly_cpp17_input_iterator<_InputIterator>::value>::type* = 0);
+ typename enable_if<__has_exactly_input_iterator_category<_InputIterator>::value>::type* = 0);
template <class _InputIterator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,
- typename enable_if<__is_exactly_cpp17_input_iterator<_InputIterator>::value>::type* = 0);
+ typename enable_if<__has_exactly_input_iterator_category<_InputIterator>::value>::type* = 0);
template <class _ForwardIterator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(_ForwardIterator __first, _ForwardIterator __last,
- typename enable_if<__is_cpp17_forward_iterator<_ForwardIterator>::value>::type* = 0);
+ typename enable_if<__has_forward_iterator_category<_ForwardIterator>::value>::type* = 0);
template <class _ForwardIterator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,
- typename enable_if<__is_cpp17_forward_iterator<_ForwardIterator>::value>::type* = 0);
+ typename enable_if<__has_forward_iterator_category<_ForwardIterator>::value>::type* = 0);
+
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<bool> _Range>
+ _LIBCPP_HIDE_FROM_ABI constexpr
+ vector(from_range_t, _Range&& __range, const allocator_type& __a = allocator_type())
+ : __begin_(nullptr),
+ __size_(0),
+ __cap_alloc_(0, static_cast<__storage_allocator>(__a)) {
+ if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
+ auto __n = static_cast<size_type>(ranges::distance(__range));
+ __init_with_size(ranges::begin(__range), ranges::end(__range), __n);
+
+ } else {
+ __init_with_sentinel(ranges::begin(__range), ranges::end(__range));
+ }
+ }
+#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(const vector& __v);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(const vector& __v, const allocator_type& __a);
@@ -2229,7 +2260,7 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
vector(vector&& __v)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
noexcept;
#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
@@ -2240,18 +2271,32 @@ public:
_NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
template <class _InputIterator>
- typename enable_if <__is_exactly_cpp17_input_iterator<_InputIterator>::value,
+ typename enable_if <__has_exactly_input_iterator_category<_InputIterator>::value,
void
>::type
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 assign(_InputIterator __first, _InputIterator __last);
template <class _ForwardIterator>
typename enable_if
<
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
+ __has_forward_iterator_category<_ForwardIterator>::value,
void
>::type
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 assign(_ForwardIterator __first, _ForwardIterator __last);
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<bool> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr void assign_range(_Range&& __range) {
+ if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
+ auto __n = static_cast<size_type>(ranges::distance(__range));
+ __assign_with_size(ranges::begin(__range), ranges::end(__range), __n);
+
+ } else {
+ __assign_with_sentinel(ranges::begin(__range), ranges::end(__range));
+ }
+ }
+#endif
+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void assign(size_type __n, const value_type& __x);
#ifndef _LIBCPP_CXX03_LANG
@@ -2326,24 +2371,32 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const {return __make_ref(__size_ - 1);}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void push_back(const value_type& __x);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference emplace_back(_Args&&... __args)
#else
_LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args)
#endif
{
push_back ( value_type ( std::forward<_Args>(__args)... ));
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return this->back();
#endif
}
#endif
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<bool> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr void append_range(_Range&& __range) {
+ insert_range(end(), std::forward<_Range>(__range));
+ }
+#endif
+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void pop_back() {--__size_;}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class... _Args>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator emplace(const_iterator __position, _Args&&... __args)
{ return insert ( __position, value_type ( std::forward<_Args>(__args)... )); }
@@ -2352,18 +2405,32 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __position, const value_type& __x);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __position, size_type __n, const value_type& __x);
template <class _InputIterator>
- typename enable_if <__is_exactly_cpp17_input_iterator<_InputIterator>::value,
+ typename enable_if <__has_exactly_input_iterator_category<_InputIterator>::value,
iterator
>::type
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert(const_iterator __position, _InputIterator __first, _InputIterator __last);
template <class _ForwardIterator>
typename enable_if
<
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
+ __has_forward_iterator_category<_ForwardIterator>::value,
iterator
>::type
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
+#if _LIBCPP_STD_VER >= 23
+ template <_ContainerCompatibleRange<bool> _Range>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr iterator insert_range(const_iterator __position, _Range&& __range) {
+ if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
+ auto __n = static_cast<size_type>(ranges::distance(__range));
+ return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n);
+
+ } else {
+ return __insert_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));
+ }
+ }
+#endif
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
iterator insert(const_iterator __position, initializer_list<value_type> __il)
@@ -2376,7 +2443,7 @@ public:
_LIBCPP_REINITIALIZES_OBJECT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void clear() _NOEXCEPT {__size_ = 0;}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(vector&)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(vector&)
#if _LIBCPP_STD_VER >= 14
_NOEXCEPT;
#else
@@ -2401,6 +2468,52 @@ private:
std::__throw_out_of_range("vector");
}
+ template <class _InputIterator, class _Sentinel>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ void __init_with_size(_InputIterator __first, _Sentinel __last, size_type __n) {
+ auto __guard = std::__make_exception_guard(__destroy_vector(*this));
+
+ if (__n > 0) {
+ __vallocate(__n);
+ __construct_at_end(std::move(__first), std::move(__last), __n);
+ }
+
+ __guard.__complete();
+ }
+
+ template <class _InputIterator, class _Sentinel>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ void __init_with_sentinel(_InputIterator __first, _Sentinel __last) {
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ try {
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ } catch (...) {
+ if (__begin_ != nullptr)
+ __storage_traits::deallocate(__alloc(), __begin_, __cap());
+ throw;
+ }
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ }
+
+ template <class _Iterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ void __assign_with_sentinel(_Iterator __first, _Sentinel __last);
+
+ template <class _ForwardIterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ void __assign_with_size(_ForwardIterator __first, _Sentinel __last, difference_type __ns);
+
+ template <class _InputIterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ iterator __insert_with_sentinel(const_iterator __position, _InputIterator __first, _Sentinel __last);
+
+ template <class _Iterator, class _Sentinel>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ iterator __insert_with_size(const_iterator __position, _Iterator __first, _Sentinel __last, difference_type __n);
+
// Allocate space for __n objects
// throws length_error if __n > max_size()
// throws (probably bad_alloc) if memory run out
@@ -2427,13 +2540,9 @@ private:
{return (__new_size + (__bits_per_word-1)) & ~((size_type)__bits_per_word-1);}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __recommend(size_type __new_size) const;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct_at_end(size_type __n, bool __x);
- template <class _ForwardIterator>
- typename enable_if
- <
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- void
- >::type
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __construct_at_end(_ForwardIterator __first, _ForwardIterator __last);
+ template <class _InputIterator, class _Sentinel>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ void __construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __append(size_type __n, const_reference __x);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
reference __make_ref(size_type __pos) _NOEXCEPT
@@ -2508,7 +2617,6 @@ vector<bool, _Allocator>::__vdeallocate() _NOEXCEPT
if (this->__begin_ != nullptr)
{
__storage_traits::deallocate(this->__alloc(), this->__begin_, __cap());
- std::__debug_db_invalidate_all(this);
this->__begin_ = nullptr;
this->__size_ = this->__cap() = 0;
}
@@ -2563,17 +2671,11 @@ vector<bool, _Allocator>::__construct_at_end(size_type __n, bool __x)
}
template <class _Allocator>
-template <class _ForwardIterator>
+template <class _InputIterator, class _Sentinel>
_LIBCPP_CONSTEXPR_SINCE_CXX20
-typename enable_if
-<
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- void
->::type
-vector<bool, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last)
-{
+void vector<bool, _Allocator>::__construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n) {
size_type __old_size = this->__size_;
- this->__size_ += std::distance(__first, __last);
+ this->__size_ += __n;
if (__old_size == 0 || ((__old_size - 1) / __bits_per_word) != ((this->__size_ - 1) / __bits_per_word))
{
if (this->__size_ <= __bits_per_word)
@@ -2581,7 +2683,7 @@ vector<bool, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardI
else
this->__begin_[(this->__size_ - 1) / __bits_per_word] = __storage_type(0);
}
- std::copy(__first, __last, __make_iter(__old_size));
+ std::__copy<_ClassicAlgPolicy>(__first, __last, __make_iter(__old_size));
}
template <class _Allocator>
@@ -2622,7 +2724,7 @@ vector<bool, _Allocator>::vector(size_type __n)
}
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
vector<bool, _Allocator>::vector(size_type __n, const allocator_type& __a)
@@ -2670,92 +2772,50 @@ template <class _Allocator>
template <class _InputIterator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
vector<bool, _Allocator>::vector(_InputIterator __first, _InputIterator __last,
- typename enable_if<__is_exactly_cpp17_input_iterator<_InputIterator>::value>::type*)
+ typename enable_if<__has_exactly_input_iterator_category<_InputIterator>::value>::type*)
: __begin_(nullptr),
__size_(0),
__cap_alloc_(0, __default_init_tag())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try
- {
-#endif // _LIBCPP_NO_EXCEPTIONS
- for (; __first != __last; ++__first)
- push_back(*__first);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- }
- catch (...)
- {
- if (__begin_ != nullptr)
- __storage_traits::deallocate(__alloc(), __begin_, __cap());
- std::__debug_db_invalidate_all(this);
- throw;
- }
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __init_with_sentinel(__first, __last);
}
template <class _Allocator>
template <class _InputIterator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
vector<bool, _Allocator>::vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,
- typename enable_if<__is_exactly_cpp17_input_iterator<_InputIterator>::value>::type*)
+ typename enable_if<__has_exactly_input_iterator_category<_InputIterator>::value>::type*)
: __begin_(nullptr),
__size_(0),
__cap_alloc_(0, static_cast<__storage_allocator>(__a))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try
- {
-#endif // _LIBCPP_NO_EXCEPTIONS
- for (; __first != __last; ++__first)
- push_back(*__first);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- }
- catch (...)
- {
- if (__begin_ != nullptr)
- __storage_traits::deallocate(__alloc(), __begin_, __cap());
- std::__debug_db_invalidate_all(this);
- throw;
- }
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __init_with_sentinel(__first, __last);
}
template <class _Allocator>
template <class _ForwardIterator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
vector<bool, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last,
- typename enable_if<__is_cpp17_forward_iterator<_ForwardIterator>::value>::type*)
+ typename enable_if<__has_forward_iterator_category<_ForwardIterator>::value>::type*)
: __begin_(nullptr),
__size_(0),
__cap_alloc_(0, __default_init_tag())
{
- auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- size_type __n = static_cast<size_type>(std::distance(__first, __last));
- if (__n > 0)
- {
- __vallocate(__n);
- __construct_at_end(__first, __last);
- }
- __guard.__complete();
+ auto __n = static_cast<size_type>(std::distance(__first, __last));
+ __init_with_size(__first, __last, __n);
}
template <class _Allocator>
template <class _ForwardIterator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
vector<bool, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,
- typename enable_if<__is_cpp17_forward_iterator<_ForwardIterator>::value>::type*)
+ typename enable_if<__has_forward_iterator_category<_ForwardIterator>::value>::type*)
: __begin_(nullptr),
__size_(0),
__cap_alloc_(0, static_cast<__storage_allocator>(__a))
{
- auto __guard = std::__make_exception_guard(__destroy_vector(*this));
- size_type __n = static_cast<size_type>(std::distance(__first, __last));
- if (__n > 0)
- {
- __vallocate(__n);
- __construct_at_end(__first, __last);
- }
- __guard.__complete();
+ auto __n = static_cast<size_type>(std::distance(__first, __last));
+ __init_with_size(__first, __last, __n);
}
#ifndef _LIBCPP_CXX03_LANG
@@ -2771,7 +2831,7 @@ vector<bool, _Allocator>::vector(initializer_list<value_type> __il)
if (__n > 0)
{
__vallocate(__n);
- __construct_at_end(__il.begin(), __il.end());
+ __construct_at_end(__il.begin(), __il.end(), __n);
}
}
@@ -2786,7 +2846,7 @@ vector<bool, _Allocator>::vector(initializer_list<value_type> __il, const alloca
if (__n > 0)
{
__vallocate(__n);
- __construct_at_end(__il.begin(), __il.end());
+ __construct_at_end(__il.begin(), __il.end(), __n);
}
}
@@ -2802,7 +2862,7 @@ vector<bool, _Allocator>::vector(const vector& __v)
if (__v.size() > 0)
{
__vallocate(__v.size());
- __construct_at_end(__v.begin(), __v.end());
+ __construct_at_end(__v.begin(), __v.end(), __v.size());
}
}
@@ -2816,7 +2876,7 @@ vector<bool, _Allocator>::vector(const vector& __v, const allocator_type& __a)
if (__v.size() > 0)
{
__vallocate(__v.size());
- __construct_at_end(__v.begin(), __v.end());
+ __construct_at_end(__v.begin(), __v.end(), __v.size());
}
}
@@ -2844,7 +2904,7 @@ vector<bool, _Allocator>::operator=(const vector& __v)
template <class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(vector&& __v)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_NOEXCEPT
#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
@@ -2875,7 +2935,7 @@ vector<bool, _Allocator>::vector(vector&& __v, const __type_identity_t<allocator
else if (__v.size() > 0)
{
__vallocate(__v.size());
- __construct_at_end(__v.begin(), __v.end());
+ __construct_at_end(__v.begin(), __v.end(), __v.size());
}
}
@@ -2933,16 +2993,22 @@ vector<bool, _Allocator>::assign(size_type __n, const value_type& __x)
}
std::fill_n(begin(), __n, __x);
}
- std::__debug_db_invalidate_all(this);
}
template <class _Allocator>
template <class _InputIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 typename enable_if <__is_exactly_cpp17_input_iterator<_InputIterator>::value,
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename enable_if <__has_exactly_input_iterator_category<_InputIterator>::value,
void
>::type
vector<bool, _Allocator>::assign(_InputIterator __first, _InputIterator __last)
{
+ __assign_with_sentinel(__first, __last);
+}
+
+template <class _Allocator>
+template <class _Iterator, class _Sentinel>
+_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+void vector<bool, _Allocator>::__assign_with_sentinel(_Iterator __first, _Sentinel __last) {
clear();
for (; __first != __last; ++__first)
push_back(*__first);
@@ -2953,14 +3019,22 @@ template <class _ForwardIterator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
typename enable_if
<
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
+ __has_forward_iterator_category<_ForwardIterator>::value,
void
>::type
vector<bool, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
{
+ __assign_with_size(__first, __last, std::distance(__first, __last));
+}
+
+template <class _Allocator>
+template <class _ForwardIterator, class _Sentinel>
+_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+void vector<bool, _Allocator>::__assign_with_size(_ForwardIterator __first, _Sentinel __last, difference_type __ns) {
+ _LIBCPP_ASSERT_VALID_INPUT_RANGE(__ns >= 0, "invalid range specified");
+
clear();
- difference_type __ns = std::distance(__first, __last);
- _LIBCPP_ASSERT(__ns >= 0, "invalid range specified");
+
const size_t __n = static_cast<size_type>(__ns);
if (__n)
{
@@ -2969,7 +3043,7 @@ vector<bool, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __la
__vdeallocate();
__vallocate(__n);
}
- __construct_at_end(__first, __last);
+ __construct_at_end(__first, __last, __n);
}
}
@@ -2983,9 +3057,8 @@ vector<bool, _Allocator>::reserve(size_type __n)
this->__throw_length_error();
vector __v(this->get_allocator());
__v.__vallocate(__n);
- __v.__construct_at_end(this->begin(), this->end());
+ __v.__construct_at_end(this->begin(), this->end(), this->size());
swap(__v);
- std::__debug_db_invalidate_all(this);
}
}
@@ -2995,17 +3068,17 @@ vector<bool, _Allocator>::shrink_to_fit() _NOEXCEPT
{
if (__external_cap_to_internal(size()) > __cap())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
vector(*this, allocator_type(__alloc())).swap(*this);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -3090,11 +3163,19 @@ vector<bool, _Allocator>::insert(const_iterator __position, size_type __n, const
template <class _Allocator>
template <class _InputIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 typename enable_if <__is_exactly_cpp17_input_iterator<_InputIterator>::value,
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename enable_if <__has_exactly_input_iterator_category<_InputIterator>::value,
typename vector<bool, _Allocator>::iterator
>::type
vector<bool, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last)
{
+ return __insert_with_sentinel(__position, __first, __last);
+}
+
+template <class _Allocator>
+template <class _InputIterator, class _Sentinel>
+_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+typename vector<bool, _Allocator>::iterator
+vector<bool, _Allocator>::__insert_with_sentinel(const_iterator __position, _InputIterator __first, _Sentinel __last) {
difference_type __off = __position - begin();
iterator __p = __const_iterator_cast(__position);
iterator __old_end = end();
@@ -3106,24 +3187,24 @@ vector<bool, _Allocator>::insert(const_iterator __position, _InputIterator __fir
vector __v(get_allocator());
if (__first != __last)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
- __v.assign(__first, __last);
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ __v.__assign_with_sentinel(std::move(__first), std::move(__last));
difference_type __old_size = static_cast<difference_type>(__old_end - begin());
difference_type __old_p = __p - begin();
reserve(__recommend(size() + __v.size()));
__p = begin() + __old_p;
__old_end = begin() + __old_size;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
erase(__old_end, end());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
__p = std::rotate(__p, __old_end, end());
insert(__p, __v.begin(), __v.end());
@@ -3135,13 +3216,21 @@ template <class _ForwardIterator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
typename enable_if
<
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
+ __has_forward_iterator_category<_ForwardIterator>::value,
typename vector<bool, _Allocator>::iterator
>::type
vector<bool, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
{
- const difference_type __n_signed = std::distance(__first, __last);
- _LIBCPP_ASSERT(__n_signed >= 0, "invalid range specified");
+ return __insert_with_size(__position, __first, __last, std::distance(__first, __last));
+}
+
+template <class _Allocator>
+template <class _ForwardIterator, class _Sentinel>
+_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+typename vector<bool, _Allocator>::iterator
+vector<bool, _Allocator>::__insert_with_size(const_iterator __position, _ForwardIterator __first, _Sentinel __last,
+ difference_type __n_signed) {
+ _LIBCPP_ASSERT_VALID_INPUT_RANGE(__n_signed >= 0, "invalid range specified");
const size_type __n = static_cast<size_type>(__n_signed);
iterator __r;
size_type __c = capacity();
@@ -3161,7 +3250,7 @@ vector<bool, _Allocator>::insert(const_iterator __position, _ForwardIterator __f
std::copy_backward(__position, cend(), __v.end());
swap(__v);
}
- std::copy(__first, __last, __r);
+ std::__copy<_ClassicAlgPolicy>(__first, __last, __r);
return __r;
}
@@ -3336,8 +3425,9 @@ operator==(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __
return __sz == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
inline _LIBCPP_HIDE_FROM_ABI
bool
operator!=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)
@@ -3346,7 +3436,6 @@ operator!=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __
}
template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
inline _LIBCPP_HIDE_FROM_ABI
bool
operator< (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)
@@ -3355,7 +3444,6 @@ operator< (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __
}
template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
inline _LIBCPP_HIDE_FROM_ABI
bool
operator> (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)
@@ -3364,7 +3452,6 @@ operator> (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __
}
template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
inline _LIBCPP_HIDE_FROM_ABI
bool
operator>=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)
@@ -3373,7 +3460,6 @@ operator>=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __
}
template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
inline _LIBCPP_HIDE_FROM_ABI
bool
operator<=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)
@@ -3381,6 +3467,17 @@ operator<=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __
return !(__y < __x);
}
+#else // _LIBCPP_STD_VER <= 17
+
+template <class _Tp, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI constexpr __synth_three_way_result<_Tp>
+operator<=>(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) {
+ return std::lexicographical_compare_three_way(
+ __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>);
+}
+
+#endif // _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
inline _LIBCPP_HIDE_FROM_ABI
@@ -3391,7 +3488,7 @@ swap(vector<_Tp, _Allocator>& __x, vector<_Tp, _Allocator>& __y)
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, class _Allocator, class _Up>
_LIBCPP_CONSTEXPR_SINCE_CXX20
inline _LIBCPP_HIDE_FROM_ABI typename vector<_Tp, _Allocator>::size_type
@@ -3417,15 +3514,15 @@ template <>
inline constexpr bool __format::__enable_insertable<vector<wchar_t>> = true;
#endif
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 20
-template <class _Tp, class CharT>
+#if _LIBCPP_STD_VER >= 23
+template <class _Tp, class _CharT>
// Since is-vector-bool-reference is only used once it's inlined here.
requires same_as<typename _Tp::__container, vector<bool, typename _Tp::__container::allocator_type>>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<_Tp, CharT> {
+struct _LIBCPP_TEMPLATE_VIS formatter<_Tp, _CharT> {
private:
- formatter<bool, CharT> __underlying_;
+ formatter<bool, _CharT> __underlying_;
public:
template <class _ParseContext>
@@ -3438,15 +3535,15 @@ public:
return __underlying_.format(__ref, __ctx);
}
};
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueT>
-using vector = std::vector<_ValueT, polymorphic_allocator<_ValueT>>;
+using vector _LIBCPP_AVAILABILITY_PMR = std::vector<_ValueT, polymorphic_allocator<_ValueT>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
@@ -3457,6 +3554,8 @@ _LIBCPP_POP_MACROS
# include <algorithm>
# include <atomic>
# include <concepts>
+# include <cstdlib>
+# include <type_traits>
# include <typeinfo>
# include <utility>
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/include/version b/contrib/libs/cxxsupp/libcxx/include/version
index a998eb56caf..fed4d6ec173 100644
--- a/contrib/libs/cxxsupp/libcxx/include/version
+++ b/contrib/libs/cxxsupp/libcxx/include/version
@@ -28,6 +28,8 @@ __cpp_lib_array_constexpr 201811L <array> <iterato
__cpp_lib_as_const 201510L <utility>
__cpp_lib_associative_heterogeneous_erasure 202110L <map> <set> <unordered_map>
<unordered_set>
+__cpp_lib_associative_heterogeneous_insertion 202306L <map> <set> <unordered_map>
+ <unordered_set>
__cpp_lib_assume_aligned 201811L <memory>
__cpp_lib_atomic_flag_test 201907L <atomic>
__cpp_lib_atomic_float 201711L <atomic>
@@ -38,10 +40,13 @@ __cpp_lib_atomic_shared_ptr 201711L <atomic>
__cpp_lib_atomic_value_initialization 201911L <atomic> <memory>
__cpp_lib_atomic_wait 201907L <atomic>
__cpp_lib_barrier 201907L <barrier>
-__cpp_lib_bind_back 202202L <functional>
-__cpp_lib_bind_front 201907L <functional>
+__cpp_lib_bind_back 202306L <functional>
+ 202202L // C++23
+__cpp_lib_bind_front 202306L <functional>
+ 201907L // C++20
__cpp_lib_bit_cast 201806L <bit>
__cpp_lib_bitops 201907L <bit>
+__cpp_lib_bitset 202306L <bitset>
__cpp_lib_bool_constant 201505L <type_traits>
__cpp_lib_bounded_array_traits 201902L <type_traits>
__cpp_lib_boyer_moore_searcher 201603L <functional>
@@ -72,6 +77,7 @@ __cpp_lib_constexpr_tuple 201811L <tuple>
__cpp_lib_constexpr_typeinfo 202106L <typeinfo>
__cpp_lib_constexpr_utility 201811L <utility>
__cpp_lib_constexpr_vector 201907L <vector>
+__cpp_lib_copyable_function 202306L <functional>
__cpp_lib_coroutine 201902L <coroutine>
__cpp_lib_destroying_delete 201806L <new>
__cpp_lib_enable_shared_from_this 201603L <memory>
@@ -82,15 +88,20 @@ __cpp_lib_erase_if 202002L <deque> <forward
__cpp_lib_exchange_function 201304L <utility>
__cpp_lib_execution 201902L <execution>
201603L // C++17
-__cpp_lib_expected 202202L <expected>
+__cpp_lib_expected 202211L <expected>
__cpp_lib_filesystem 201703L <filesystem>
__cpp_lib_format 202106L <format>
+__cpp_lib_format_ranges 202207L <format>
+__cpp_lib_formatters 202302L <stacktrace> <thread>
__cpp_lib_forward_like 202207L <utility>
+__cpp_lib_fstream_native_handle 202306L <fstream>
+__cpp_lib_function_ref 202306L <functional>
__cpp_lib_gcd_lcm 201606L <numeric>
__cpp_lib_generic_associative_lookup 201304L <map> <set>
__cpp_lib_generic_unordered_lookup 201811L <unordered_map> <unordered_set>
__cpp_lib_hardware_interference_size 201703L <new>
__cpp_lib_has_unique_object_representations 201606L <type_traits>
+__cpp_lib_hazard_pointer 202306L <hazard_pointer>
__cpp_lib_hypot 201603L <cmath>
__cpp_lib_incomplete_container_elements 201505L <forward_list> <list> <vector>
__cpp_lib_int_pow2 202002L <bit>
@@ -121,7 +132,9 @@ __cpp_lib_make_unique 201304L <memory>
__cpp_lib_map_try_emplace 201411L <map>
__cpp_lib_math_constants 201907L <numbers>
__cpp_lib_math_special_functions 201603L <cmath>
+__cpp_lib_mdspan 202207L <mdspan>
__cpp_lib_memory_resource 201603L <memory_resource>
+__cpp_lib_move_iterator_concept 202207L <iterator>
__cpp_lib_move_only_function 202110L <functional>
__cpp_lib_node_extract 201606L <map> <set> <unordered_map>
<unordered_set>
@@ -136,22 +149,26 @@ __cpp_lib_optional 202110L <optional>
__cpp_lib_out_ptr 202106L <memory>
__cpp_lib_parallel_algorithm 201603L <algorithm> <numeric>
__cpp_lib_polymorphic_allocator 201902L <memory_resource>
+__cpp_lib_print 202207L <ostream> <print>
__cpp_lib_quoted_string_io 201304L <iomanip>
-__cpp_lib_ranges 202106L <algorithm> <functional> <iterator>
+__cpp_lib_ranges 202207L <algorithm> <functional> <iterator>
<memory> <ranges>
__cpp_lib_ranges_as_rvalue 202207L <ranges>
__cpp_lib_ranges_chunk 202202L <ranges>
__cpp_lib_ranges_chunk_by 202202L <ranges>
__cpp_lib_ranges_iota 202202L <numeric>
__cpp_lib_ranges_join_with 202202L <ranges>
+__cpp_lib_ranges_repeat 202207L <ranges>
__cpp_lib_ranges_slide 202202L <ranges>
__cpp_lib_ranges_starts_ends_with 202106L <algorithm>
__cpp_lib_ranges_to_container 202202L <deque> <forward_list> <list>
- <map> <priority_queue> <queue>
+ <map> <queue> <ranges>
<set> <stack> <string>
<unordered_map> <unordered_set> <vector>
__cpp_lib_ranges_zip 202110L <ranges> <tuple> <utility>
+__cpp_lib_ratio 202306L <ratio>
__cpp_lib_raw_memory_algorithms 201606L <memory>
+__cpp_lib_rcu 202306L <rcu>
__cpp_lib_reference_from_temporary 202202L <type_traits>
__cpp_lib_remove_cvref 201711L <type_traits>
__cpp_lib_result_of_sfinae 201210L <functional> <type_traits>
@@ -166,10 +183,12 @@ __cpp_lib_shared_ptr_weak_type 201606L <memory>
__cpp_lib_shared_timed_mutex 201402L <shared_mutex>
__cpp_lib_shift 201806L <algorithm>
__cpp_lib_smart_ptr_for_overwrite 202002L <memory>
+__cpp_lib_smart_ptr_owner_equality 202306L <memory>
__cpp_lib_source_location 201907L <source_location>
__cpp_lib_span 202002L <span>
__cpp_lib_spanstream 202106L <spanstream>
__cpp_lib_ssize 201902L <iterator>
+__cpp_lib_sstream_from_string_view 202306L <sstream>
__cpp_lib_stacktrace 202011L <stacktrace>
__cpp_lib_starts_ends_with 201711L <string> <string_view>
__cpp_lib_stdatomic_h 202011L <stdatomic.h>
@@ -178,11 +197,14 @@ __cpp_lib_string_resize_and_overwrite 202110L <string>
__cpp_lib_string_udls 201304L <string>
__cpp_lib_string_view 201803L <string> <string_view>
201606L // C++17
+__cpp_lib_submdspan 202306L <mdspan>
__cpp_lib_syncbuf 201803L <syncstream>
+__cpp_lib_text_encoding 202306L <text_encoding>
__cpp_lib_three_way_comparison 201907L <compare>
__cpp_lib_to_address 201711L <memory>
__cpp_lib_to_array 201907L <array>
__cpp_lib_to_chars 201611L <charconv>
+__cpp_lib_to_string 202306L <string>
__cpp_lib_to_underlying 202102L <utility>
__cpp_lib_transformation_trait_aliases 201304L <type_traits>
__cpp_lib_transparent_operators 201510L <functional> <memory>
@@ -197,6 +219,7 @@ __cpp_lib_unreachable 202202L <utility>
__cpp_lib_unwrap_ref 201811L <functional>
__cpp_lib_variant 202102L <variant>
__cpp_lib_void_t 201411L <type_traits>
+__cpp_lib_within_lifetime 202306L <type_traits>
*/
@@ -209,7 +232,7 @@ __cpp_lib_void_t 201411L <type_traits>
// clang-format off
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
# define __cpp_lib_chrono_udls 201304L
# define __cpp_lib_complex_udls 201309L
# define __cpp_lib_exchange_function 201304L
@@ -224,7 +247,7 @@ __cpp_lib_void_t 201411L <type_traits>
# define __cpp_lib_quoted_string_io 201304L
# define __cpp_lib_result_of_sfinae 201210L
# define __cpp_lib_robust_nonmodifying_seq_ops 201304L
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# define __cpp_lib_shared_timed_mutex 201402L
# endif
# define __cpp_lib_string_udls 201304L
@@ -234,7 +257,7 @@ __cpp_lib_void_t 201411L <type_traits>
# define __cpp_lib_tuples_by_type 201304L
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
# define __cpp_lib_addressof_constexpr 201603L
# define __cpp_lib_allocator_traits_is_always_equal 201411L
# define __cpp_lib_any 201606L
@@ -253,7 +276,7 @@ __cpp_lib_void_t 201411L <type_traits>
# define __cpp_lib_clamp 201603L
# define __cpp_lib_enable_shared_from_this 201603L
// # define __cpp_lib_execution 201603L
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM_LIBRARY)
# define __cpp_lib_filesystem 201703L
# endif
# define __cpp_lib_gcd_lcm 201606L
@@ -272,7 +295,9 @@ __cpp_lib_void_t 201411L <type_traits>
# define __cpp_lib_make_from_tuple 201606L
# define __cpp_lib_map_try_emplace 201411L
// # define __cpp_lib_math_special_functions 201603L
-# define __cpp_lib_memory_resource 201603L
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# define __cpp_lib_memory_resource 201603L
+# endif
# define __cpp_lib_node_extract 201606L
# define __cpp_lib_nonmember_container_access 201411L
# define __cpp_lib_not_fn 201603L
@@ -281,7 +306,7 @@ __cpp_lib_void_t 201411L <type_traits>
# define __cpp_lib_raw_memory_algorithms 201606L
# define __cpp_lib_sample 201603L
# define __cpp_lib_scoped_lock 201703L
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# define __cpp_lib_shared_mutex 201505L
# endif
# define __cpp_lib_shared_ptr_arrays 201611L
@@ -301,7 +326,7 @@ __cpp_lib_void_t 201411L <type_traits>
# define __cpp_lib_void_t 201411L
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
# undef __cpp_lib_array_constexpr
# define __cpp_lib_array_constexpr 201811L
# define __cpp_lib_assume_aligned 201811L
@@ -311,15 +336,15 @@ __cpp_lib_void_t 201411L <type_traits>
// # define __cpp_lib_atomic_ref 201806L
// # define __cpp_lib_atomic_shared_ptr 201711L
# define __cpp_lib_atomic_value_initialization 201911L
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# define __cpp_lib_atomic_wait 201907L
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# define __cpp_lib_barrier 201907L
# endif
# define __cpp_lib_bind_front 201907L
# define __cpp_lib_bit_cast 201806L
-// # define __cpp_lib_bitops 201907L
+# define __cpp_lib_bitops 201907L
# define __cpp_lib_bounded_array_traits 201902L
# if !defined(_LIBCPP_HAS_NO_CHAR8_T)
# define __cpp_lib_char8_t 201907L
@@ -338,16 +363,14 @@ __cpp_lib_void_t 201411L <type_traits>
# define __cpp_lib_constexpr_utility 201811L
# define __cpp_lib_constexpr_vector 201907L
# define __cpp_lib_coroutine 201902L
-# if _LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
+# if _LIBCPP_STD_VER >= 20 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
# define __cpp_lib_destroying_delete 201806L
# endif
# define __cpp_lib_endian 201907L
# define __cpp_lib_erase_if 202002L
# undef __cpp_lib_execution
// # define __cpp_lib_execution 201902L
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
-// # define __cpp_lib_format 202106L
-# endif
+// # define __cpp_lib_format 202106L
# define __cpp_lib_generic_unordered_lookup 201811L
# define __cpp_lib_int_pow2 202002L
# define __cpp_lib_integer_comparison_functions 202002L
@@ -359,15 +382,18 @@ __cpp_lib_void_t 201411L <type_traits>
# if !defined(_LIBCPP_HAS_NO_THREADS)
// # define __cpp_lib_jthread 201911L
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# define __cpp_lib_latch 201907L
# endif
# define __cpp_lib_list_remove_return_type 201806L
# define __cpp_lib_math_constants 201907L
-# define __cpp_lib_polymorphic_allocator 201902L
-# define __cpp_lib_ranges 202106L
+# define __cpp_lib_move_iterator_concept 202207L
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# define __cpp_lib_polymorphic_allocator 201902L
+# endif
+# define __cpp_lib_ranges 202207L
# define __cpp_lib_remove_cvref 201711L
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# define __cpp_lib_semaphore 201907L
# endif
# undef __cpp_lib_shared_ptr_arrays
@@ -390,7 +416,7 @@ __cpp_lib_void_t 201411L <type_traits>
# define __cpp_lib_unwrap_ref 201811L
#endif
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
# define __cpp_lib_adaptor_iterator_pair_constructor 202106L
# define __cpp_lib_allocate_at_least 202106L
// # define __cpp_lib_associative_heterogeneous_erasure 202110L
@@ -401,23 +427,28 @@ __cpp_lib_void_t 201411L <type_traits>
// # define __cpp_lib_constexpr_cmath 202202L
# undef __cpp_lib_constexpr_memory
# define __cpp_lib_constexpr_memory 202202L
-// # define __cpp_lib_constexpr_typeinfo 202106L
-# define __cpp_lib_expected 202202L
+# define __cpp_lib_constexpr_typeinfo 202106L
+# define __cpp_lib_expected 202211L
+# define __cpp_lib_format_ranges 202207L
+// # define __cpp_lib_formatters 202302L
# define __cpp_lib_forward_like 202207L
-// # define __cpp_lib_invoke_r 202106L
+# define __cpp_lib_invoke_r 202106L
# define __cpp_lib_is_scoped_enum 202011L
+// # define __cpp_lib_mdspan 202207L
// # define __cpp_lib_move_only_function 202110L
# undef __cpp_lib_optional
# define __cpp_lib_optional 202110L
// # define __cpp_lib_out_ptr 202106L
+// # define __cpp_lib_print 202207L
# define __cpp_lib_ranges_as_rvalue 202207L
// # define __cpp_lib_ranges_chunk 202202L
// # define __cpp_lib_ranges_chunk_by 202202L
// # define __cpp_lib_ranges_iota 202202L
// # define __cpp_lib_ranges_join_with 202202L
+# define __cpp_lib_ranges_repeat 202207L
// # define __cpp_lib_ranges_slide 202202L
// # define __cpp_lib_ranges_starts_ends_with 202106L
-// # define __cpp_lib_ranges_to_container 202202L
+# define __cpp_lib_ranges_to_container 202202L
// # define __cpp_lib_ranges_zip 202110L
// # define __cpp_lib_reference_from_temporary 202202L
// # define __cpp_lib_spanstream 202106L
@@ -425,10 +456,31 @@ __cpp_lib_void_t 201411L <type_traits>
# define __cpp_lib_stdatomic_h 202011L
# define __cpp_lib_string_contains 202011L
# define __cpp_lib_string_resize_and_overwrite 202110L
+// # define __cpp_lib_to_string 202306L
# define __cpp_lib_to_underlying 202102L
# define __cpp_lib_unreachable 202202L
#endif
+#if _LIBCPP_STD_VER >= 26
+// # define __cpp_lib_associative_heterogeneous_insertion 202306L
+# undef __cpp_lib_bind_back
+// # define __cpp_lib_bind_back 202306L
+# undef __cpp_lib_bind_front
+# define __cpp_lib_bind_front 202306L
+// # define __cpp_lib_bitset 202306L
+// # define __cpp_lib_copyable_function 202306L
+// # define __cpp_lib_fstream_native_handle 202306L
+// # define __cpp_lib_function_ref 202306L
+// # define __cpp_lib_hazard_pointer 202306L
+# define __cpp_lib_ratio 202306L
+// # define __cpp_lib_rcu 202306L
+// # define __cpp_lib_smart_ptr_owner_equality 202306L
+// # define __cpp_lib_sstream_from_string_view 202306L
+// # define __cpp_lib_submdspan 202306L
+// # define __cpp_lib_text_encoding 202306L
+// # define __cpp_lib_within_lifetime 202306L
+#endif
+
// clang-format on
#endif // _LIBCPP_VERSIONH
diff --git a/contrib/libs/cxxsupp/libcxx/include/wchar.h b/contrib/libs/cxxsupp/libcxx/include/wchar.h
index c684508dc2c..eeccf3e937f 100644
--- a/contrib/libs/cxxsupp/libcxx/include/wchar.h
+++ b/contrib/libs/cxxsupp/libcxx/include/wchar.h
@@ -116,12 +116,16 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
# pragma GCC system_header
#endif
+// We define this here to support older versions of glibc <wchar.h> that do
+// not define this for clang.
#ifdef __cplusplus
#define __CORRECT_ISO_CPP_WCHAR_H_PROTO
#endif
# if __has_include_next(<wchar.h>)
# include_next <wchar.h>
+# else
+# include <__mbstate_t.h> // make sure we have mbstate_t regardless of the existence of <wchar.h>
# endif
// Determine whether we have const-correct overloads for wcschr and friends.
diff --git a/contrib/libs/cxxsupp/libcxx/src/algorithm.cpp b/contrib/libs/cxxsupp/libcxx/src/algorithm.cpp
index bd47e08b380..af9d60a8e27 100644
--- a/contrib/libs/cxxsupp/libcxx/src/algorithm.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/algorithm.cpp
@@ -7,11 +7,25 @@
//===----------------------------------------------------------------------===//
#include <algorithm>
+#include <bit>
_LIBCPP_BEGIN_NAMESPACE_STD
-// TODO(varconst): this currently doesn't benefit `ranges::sort` because it uses `ranges::less` instead of `__less`.
+template <class Comp, class RandomAccessIterator>
+void __sort(RandomAccessIterator first, RandomAccessIterator last, Comp comp) {
+ auto depth_limit = 2 * std::__bit_log2(static_cast<size_t>(last - first));
+ // Only use bitset partitioning for arithmetic types. We should also check
+ // that the default comparator is in use so that we are sure that there are no
+ // branches in the comparator.
+ std::__introsort<_ClassicAlgPolicy,
+ ranges::less,
+ RandomAccessIterator,
+ __use_branchless_sort<ranges::less, RandomAccessIterator>::value>(
+ first, last, ranges::less{}, depth_limit);
+}
+
+// clang-format off
template void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
@@ -29,25 +43,6 @@ template void __sort<__less<unsigned long long>&, unsigned long long*>(unsigned
template void __sort<__less<float>&, float*>(float*, float*, __less<float>&);
template void __sort<__less<double>&, double*>(double*, double*, __less<double>&);
template void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
-
-template bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&);
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
-#endif
-template bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
-template bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
-template bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&);
-template bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
-template bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&);
-template bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
-template bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&);
-template bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
-template bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
-template bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
-template bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&);
-template bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&);
-template bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
-
-template unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&);
+// clang-format on
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/src/algorithm_old.cpp b/contrib/libs/cxxsupp/libcxx/src/algorithm_old.cpp
new file mode 100644
index 00000000000..90cb7785cd6
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/algorithm_old.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <algorithm>
+
+namespace old_sort {
+
+// TODO(varconst): this currently doesn't benefit `ranges::sort` because it uses `ranges::less` instead of `__less`.
+
+template void __sort<std::__less<>&, char*>(char*, char*, std::__less<>&);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+template void __sort<std::__less<>&, wchar_t*>(wchar_t*, wchar_t*, std::__less<>&);
+#endif
+template void __sort<std::__less<>&, signed char*>(signed char*, signed char*, std::__less<>&);
+template void __sort<std::__less<>&, unsigned char*>(unsigned char*, unsigned char*, std::__less<>&);
+template void __sort<std::__less<>&, short*>(short*, short*, std::__less<>&);
+template void __sort<std::__less<>&, unsigned short*>(unsigned short*, unsigned short*, std::__less<>&);
+template void __sort<std::__less<>&, int*>(int*, int*, std::__less<>&);
+template void __sort<std::__less<>&, unsigned*>(unsigned*, unsigned*, std::__less<>&);
+template void __sort<std::__less<>&, long*>(long*, long*, std::__less<>&);
+template void __sort<std::__less<>&, unsigned long*>(unsigned long*, unsigned long*, std::__less<>&);
+template void __sort<std::__less<>&, long long*>(long long*, long long*, std::__less<>&);
+template void __sort<std::__less<>&, unsigned long long*>(unsigned long long*, unsigned long long*, std::__less<>&);
+template void __sort<std::__less<>&, float*>(float*, float*, std::__less<>&);
+template void __sort<std::__less<>&, double*>(double*, double*, std::__less<>&);
+template void __sort<std::__less<>&, long double*>(long double*, long double*, std::__less<>&);
+
+template bool __insertion_sort_incomplete<std::__less<>&, char*>(char*, char*, std::__less<>&);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+template bool __insertion_sort_incomplete<std::__less<>&, wchar_t*>(wchar_t*, wchar_t*, std::__less<>&);
+#endif
+template bool __insertion_sort_incomplete<std::__less<>&, signed char*>(signed char*, signed char*, std::__less<>&);
+template bool __insertion_sort_incomplete<std::__less<>&, unsigned char*>(unsigned char*, unsigned char*, std::__less<>&);
+template bool __insertion_sort_incomplete<std::__less<>&, short*>(short*, short*, std::__less<>&);
+template bool __insertion_sort_incomplete<std::__less<>&, unsigned short*>(unsigned short*, unsigned short*, std::__less<>&);
+template bool __insertion_sort_incomplete<std::__less<>&, int*>(int*, int*, std::__less<>&);
+template bool __insertion_sort_incomplete<std::__less<>&, unsigned*>(unsigned*, unsigned*, std::__less<>&);
+template bool __insertion_sort_incomplete<std::__less<>&, long*>(long*, long*, std::__less<>&);
+template bool __insertion_sort_incomplete<std::__less<>&, unsigned long*>(unsigned long*, unsigned long*, std::__less<>&);
+template bool __insertion_sort_incomplete<std::__less<>&, long long*>(long long*, long long*, std::__less<>&);
+template bool __insertion_sort_incomplete<std::__less<>&, unsigned long long*>(unsigned long long*, unsigned long long*, std::__less<>&);
+template bool __insertion_sort_incomplete<std::__less<>&, float*>(float*, float*, std::__less<>&);
+template bool __insertion_sort_incomplete<std::__less<>&, double*>(double*, double*, std::__less<>&);
+template bool __insertion_sort_incomplete<std::__less<>&, long double*>(long double*, long double*, std::__less<>&);
+
+template unsigned __sort5<std::__less<>&, long double*>(long double*, long double*, long double*, long double*, long double*, std::__less<>&);
+
+} // namespace old_sort
diff --git a/contrib/libs/cxxsupp/libcxx/src/any.cpp b/contrib/libs/cxxsupp/libcxx/src/any.cpp
index 9a101b44a71..36f95c0ec4f 100644
--- a/contrib/libs/cxxsupp/libcxx/src/any.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/any.cpp
@@ -21,7 +21,7 @@ const char* bad_any_cast::what() const noexcept {
// Even though it no longer exists in a header file
_LIBCPP_BEGIN_NAMESPACE_LFTS
-class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
+class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
{
public:
virtual const char* what() const noexcept;
diff --git a/contrib/libs/cxxsupp/libcxx/src/atomic.cpp b/contrib/libs/cxxsupp/libcxx/src/atomic.cpp
index 7777e888c00..a55249a15c2 100644
--- a/contrib/libs/cxxsupp/libcxx/src/atomic.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/atomic.cpp
@@ -9,11 +9,14 @@
#include <__config>
#ifndef _LIBCPP_HAS_NO_THREADS
+#include <__thread/timed_backoff_policy.h>
#include <atomic>
#include <climits>
#include <functional>
#include <thread>
+#include "include/apple_availability.h"
+
#ifdef __linux__
#include <unistd.h>
@@ -77,20 +80,25 @@ static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const vo
const_cast<__cxx_atomic_contention_t*>(__ptr), 0);
}
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) && __SIZEOF_LONG__ == 8
+/*
+ * Since __cxx_contention_t is int64_t even on 32bit FreeBSD
+ * platforms, we have to use umtx ops that work on the long type, and
+ * limit its use to architectures where long and int64_t are synonyms.
+ */
static void __libcpp_platform_wait_on_address(__cxx_atomic_contention_t const volatile* __ptr,
__cxx_contention_t __val)
{
_umtx_op(const_cast<__cxx_atomic_contention_t*>(__ptr),
- UMTX_OP_WAIT_UINT_PRIVATE, __val, NULL, NULL);
+ UMTX_OP_WAIT, __val, NULL, NULL);
}
static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const volatile* __ptr,
bool __notify_one)
{
_umtx_op(const_cast<__cxx_atomic_contention_t*>(__ptr),
- UMTX_OP_WAKE_PRIVATE, __notify_one ? 1 : INT_MAX, NULL, NULL);
+ UMTX_OP_WAKE, __notify_one ? 1 : INT_MAX, NULL, NULL);
}
#else // <- Add other operating systems here
diff --git a/contrib/libs/cxxsupp/libcxx/src/charconv.cpp b/contrib/libs/cxxsupp/libcxx/src/charconv.cpp
index d01ecddc466..aa52220413a 100644
--- a/contrib/libs/cxxsupp/libcxx/src/charconv.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/charconv.cpp
@@ -18,13 +18,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace __itoa
{
-_LIBCPP_FUNC_VIS char*
+_LIBCPP_EXPORTED_FROM_ABI char*
__u32toa(uint32_t value, char* buffer) noexcept
{
return __base_10_u32(buffer, value);
}
-_LIBCPP_FUNC_VIS char*
+_LIBCPP_EXPORTED_FROM_ABI char*
__u64toa(uint64_t value, char* buffer) noexcept
{
return __base_10_u64(buffer, value);
diff --git a/contrib/libs/cxxsupp/libcxx/src/chrono.cpp b/contrib/libs/cxxsupp/libcxx/src/chrono.cpp
index 0af89d6a526..f1596132024 100644
--- a/contrib/libs/cxxsupp/libcxx/src/chrono.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/chrono.cpp
@@ -12,9 +12,9 @@
#define _LARGE_TIME_API
#endif
-#include <cerrno> // errno
+#include <__system_error/system_error.h>
+#include <cerrno> // errno
#include <chrono>
-#include <system_error> // __throw_system_error
#if defined(__MVS__)
#include <__support/ibm/gettod_zos.h> // gettimeofdayMonotonic
@@ -24,15 +24,15 @@
#include "include/apple_availability.h"
#if __has_include(<unistd.h>)
-# include <unistd.h>
+# include <unistd.h> // _POSIX_TIMERS
#endif
#if __has_include(<sys/time.h>)
# include <sys/time.h> // for gettimeofday and timeval
#endif
-#if !defined(__APPLE__) && defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0
-# define _LIBCPP_USE_CLOCK_GETTIME
+#if defined(__APPLE__) || defined (__gnu_hurd__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
+# define _LIBCPP_HAS_CLOCK_GETTIME
#endif
#if defined(_LIBCPP_WIN32API)
@@ -116,7 +116,7 @@ static system_clock::time_point __libcpp_system_clock_now() {
return system_clock::time_point(duration_cast<system_clock::duration>(d - nt_to_unix_epoch));
}
-#elif defined(CLOCK_REALTIME) && defined(_LIBCPP_USE_CLOCK_GETTIME)
+#elif defined(_LIBCPP_HAS_CLOCK_GETTIME)
static system_clock::time_point __libcpp_system_clock_now() {
struct timespec tp;
@@ -167,59 +167,6 @@ system_clock::from_time_t(time_t t) noexcept
#if defined(__APPLE__)
-// TODO(ldionne):
-// This old implementation of steady_clock is retained until Chrome drops supports
-// for macOS < 10.12. The issue is that they link libc++ statically into their
-// application, which means that libc++ must support being built for such deployment
-// targets. See https://llvm.org/D74489 for details.
-#if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
- (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
- (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
- (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
-# define _LIBCPP_USE_OLD_MACH_ABSOLUTE_TIME
-#endif
-
-#if defined(_LIBCPP_USE_OLD_MACH_ABSOLUTE_TIME)
-
-// mach_absolute_time() * MachInfo.numer / MachInfo.denom is the number of
-// nanoseconds since the computer booted up. MachInfo.numer and MachInfo.denom
-// are run time constants supplied by the OS. This clock has no relationship
-// to the Gregorian calendar. It's main use is as a high resolution timer.
-
-// MachInfo.numer / MachInfo.denom is often 1 on the latest equipment. Specialize
-// for that case as an optimization.
-
-static steady_clock::rep steady_simplified() {
- return static_cast<steady_clock::rep>(mach_absolute_time());
-}
-static double compute_steady_factor() {
- mach_timebase_info_data_t MachInfo;
- mach_timebase_info(&MachInfo);
- return static_cast<double>(MachInfo.numer) / MachInfo.denom;
-}
-
-static steady_clock::rep steady_full() {
- static const double factor = compute_steady_factor();
- return static_cast<steady_clock::rep>(mach_absolute_time() * factor);
-}
-
-typedef steady_clock::rep (*FP)();
-
-static FP init_steady_clock() {
- mach_timebase_info_data_t MachInfo;
- mach_timebase_info(&MachInfo);
- if (MachInfo.numer == MachInfo.denom)
- return &steady_simplified;
- return &steady_full;
-}
-
-static steady_clock::time_point __libcpp_steady_clock_now() {
- static FP fp = init_steady_clock();
- return steady_clock::time_point(steady_clock::duration(fp()));
-}
-
-#else // vvvvv default behavior for Apple platforms vvvvv
-
// On Apple platforms, only CLOCK_UPTIME_RAW, CLOCK_MONOTONIC_RAW or
// mach_absolute_time are able to time functions in the nanosecond range.
// Furthermore, only CLOCK_MONOTONIC_RAW is truly monotonic, because it
@@ -232,8 +179,6 @@ static steady_clock::time_point __libcpp_steady_clock_now() {
return steady_clock::time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
}
-#endif
-
#elif defined(_LIBCPP_WIN32API)
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx says:
@@ -281,7 +226,7 @@ static steady_clock::time_point __libcpp_steady_clock_now() noexcept {
return steady_clock::time_point(nanoseconds(_zx_clock_get_monotonic()));
}
-# elif defined(CLOCK_MONOTONIC)
+# elif defined(_LIBCPP_HAS_CLOCK_GETTIME)
static steady_clock::time_point __libcpp_steady_clock_now() {
struct timespec tp;
diff --git a/contrib/libs/cxxsupp/libcxx/src/condition_variable.cpp b/contrib/libs/cxxsupp/libcxx/src/condition_variable.cpp
index b17c4cf6458..85f334e0245 100644
--- a/contrib/libs/cxxsupp/libcxx/src/condition_variable.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/condition_variable.cpp
@@ -12,7 +12,6 @@
#include <condition_variable>
#include <thread>
-#include <system_error>
#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
# pragma comment(lib, "pthread")
diff --git a/contrib/libs/cxxsupp/libcxx/src/condition_variable_destructor.cpp b/contrib/libs/cxxsupp/libcxx/src/condition_variable_destructor.cpp
index c217a09394f..333face19d5 100644
--- a/contrib/libs/cxxsupp/libcxx/src/condition_variable_destructor.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/condition_variable_destructor.cpp
@@ -24,7 +24,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#ifdef NEEDS_CONDVAR_DESTRUCTOR
-class _LIBCPP_TYPE_VIS condition_variable
+class _LIBCPP_EXPORTED_FROM_ABI condition_variable
{
__libcpp_condvar_t __cv_ = _LIBCPP_CONDVAR_INITIALIZER;
public:
diff --git a/contrib/libs/cxxsupp/libcxx/src/debug.cpp b/contrib/libs/cxxsupp/libcxx/src/debug.cpp
deleted file mode 100644
index 8f1d328f0e0..00000000000
--- a/contrib/libs/cxxsupp/libcxx/src/debug.cpp
+++ /dev/null
@@ -1,559 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#include <__assert>
-#include <__config>
-#include <__debug>
-#include <__hash_table>
-#include <algorithm>
-#include <cstdio>
-#include <functional>
-#include <string>
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-# include <mutex>
-# if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
-# pragma comment(lib, "pthread")
-# endif
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-_LIBCPP_FUNC_VIS
-__libcpp_db*
-__get_db()
-{
- static _LIBCPP_NO_DESTROY __libcpp_db db;
- return &db;
-}
-
-_LIBCPP_FUNC_VIS
-const __libcpp_db*
-__get_const_db()
-{
- return __get_db();
-}
-
-namespace
-{
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-typedef mutex mutex_type;
-typedef lock_guard<mutex_type> WLock;
-typedef lock_guard<mutex_type> RLock;
-
-mutex_type&
-mut()
-{
- static _LIBCPP_NO_DESTROY mutex_type m;
- return m;
-}
-#endif // !_LIBCPP_HAS_NO_THREADS
-
-} // unnamed namespace
-
-__i_node::~__i_node()
-{
- if (__next_)
- {
- __next_->~__i_node();
- free(__next_);
- }
-}
-
-__c_node::~__c_node()
-{
- free(beg_);
- if (__next_)
- {
- __next_->~__c_node();
- free(__next_);
- }
-}
-
-__libcpp_db::__libcpp_db()
- : __cbeg_(nullptr),
- __cend_(nullptr),
- __csz_(0),
- __ibeg_(nullptr),
- __iend_(nullptr),
- __isz_(0)
-{
-}
-
-__libcpp_db::~__libcpp_db()
-{
- if (__cbeg_)
- {
- for (__c_node** p = __cbeg_; p != __cend_; ++p)
- {
- if (*p != nullptr)
- {
- (*p)->~__c_node();
- free(*p);
- }
- }
- free(__cbeg_);
- }
- if (__ibeg_)
- {
- for (__i_node** p = __ibeg_; p != __iend_; ++p)
- {
- if (*p != nullptr)
- {
- (*p)->~__i_node();
- free(*p);
- }
- }
- free(__ibeg_);
- }
-}
-
-void*
-__libcpp_db::__find_c_from_i(void* __i) const
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- RLock _(mut());
-#endif
- __i_node* i = __find_iterator(__i);
- _LIBCPP_ASSERT(i != nullptr, "iterator not found in debug database.");
- return i->__c_ != nullptr ? i->__c_->__c_ : nullptr;
-}
-
-void
-__libcpp_db::__insert_ic(void* __i, const void* __c)
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- WLock _(mut());
-#endif
- if (__cbeg_ == __cend_)
- return;
- size_t hc = hash<const void*>()(__c) % static_cast<size_t>(__cend_ - __cbeg_);
- __c_node* c = __cbeg_[hc];
- if (c == nullptr)
- return;
- while (c->__c_ != __c)
- {
- c = c->__next_;
- if (c == nullptr)
- return;
- }
- __i_node* i = __insert_iterator(__i);
- c->__add(i);
- i->__c_ = c;
-}
-
-void
-__libcpp_db::__insert_c(void* __c, __libcpp_db::_InsertConstruct *__fn)
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- WLock _(mut());
-#endif
- if (__csz_ + 1 > static_cast<size_t>(__cend_ - __cbeg_))
- {
- size_t nc = __next_prime(2*static_cast<size_t>(__cend_ - __cbeg_) + 1);
- __c_node** cbeg = static_cast<__c_node**>(calloc(nc, sizeof(__c_node*)));
- if (cbeg == nullptr)
- __throw_bad_alloc();
-
- for (__c_node** p = __cbeg_; p != __cend_; ++p)
- {
- __c_node* q = *p;
- while (q != nullptr)
- {
- size_t h = hash<void*>()(q->__c_) % nc;
- __c_node* r = q->__next_;
- q->__next_ = cbeg[h];
- cbeg[h] = q;
- q = r;
- }
- }
- free(__cbeg_);
- __cbeg_ = cbeg;
- __cend_ = __cbeg_ + nc;
- }
- size_t hc = hash<void*>()(__c) % static_cast<size_t>(__cend_ - __cbeg_);
- __c_node* p = __cbeg_[hc];
- void *buf = malloc(sizeof(__c_node));
- if (buf == nullptr)
- __throw_bad_alloc();
- __cbeg_[hc] = __fn(buf, __c, p);
-
- ++__csz_;
-}
-
-void
-__libcpp_db::__erase_i(void* __i)
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- WLock _(mut());
-#endif
- if (__ibeg_ != __iend_)
- {
- size_t hi = hash<void*>()(__i) % static_cast<size_t>(__iend_ - __ibeg_);
- __i_node* p = __ibeg_[hi];
- if (p != nullptr)
- {
- __i_node* q = nullptr;
- while (p->__i_ != __i)
- {
- q = p;
- p = p->__next_;
- if (p == nullptr)
- return;
- }
- if (q == nullptr)
- __ibeg_[hi] = p->__next_;
- else
- q->__next_ = p->__next_;
- __c_node* c = p->__c_;
- --__isz_;
- if (c != nullptr)
- c->__remove(p);
- free(p);
- }
- }
-}
-
-void
-__libcpp_db::__invalidate_all(void* __c)
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- WLock _(mut());
-#endif
- if (__cend_ != __cbeg_)
- {
- size_t hc = hash<void*>()(__c) % static_cast<size_t>(__cend_ - __cbeg_);
- __c_node* p = __cbeg_[hc];
- if (p == nullptr)
- return;
- while (p->__c_ != __c)
- {
- p = p->__next_;
- if (p == nullptr)
- return;
- }
- while (p->end_ != p->beg_)
- {
- --p->end_;
- (*p->end_)->__c_ = nullptr;
- }
- }
-}
-
-__c_node*
-__libcpp_db::__find_c_and_lock(void* __c) const
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- mut().lock();
-#endif
- if (__cend_ == __cbeg_)
- {
-#ifndef _LIBCPP_HAS_NO_THREADS
- mut().unlock();
-#endif
- return nullptr;
- }
- size_t hc = hash<void*>()(__c) % static_cast<size_t>(__cend_ - __cbeg_);
- __c_node* p = __cbeg_[hc];
- if (p == nullptr)
- {
-#ifndef _LIBCPP_HAS_NO_THREADS
- mut().unlock();
-#endif
- return nullptr;
- }
- while (p->__c_ != __c)
- {
- p = p->__next_;
- if (p == nullptr)
- {
-#ifndef _LIBCPP_HAS_NO_THREADS
- mut().unlock();
-#endif
- return nullptr;
- }
- }
- return p;
-}
-
-__c_node*
-__libcpp_db::__find_c(void* __c) const
-{
- size_t hc = hash<void*>()(__c) % static_cast<size_t>(__cend_ - __cbeg_);
- __c_node* p = __cbeg_[hc];
- _LIBCPP_ASSERT(p != nullptr, "debug mode internal logic error __find_c A");
- while (p->__c_ != __c)
- {
- p = p->__next_;
- _LIBCPP_ASSERT(p != nullptr, "debug mode internal logic error __find_c B");
- }
- return p;
-}
-
-void
-__libcpp_db::unlock() const
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- mut().unlock();
-#endif
-}
-
-void
-__libcpp_db::__erase_c(void* __c)
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- WLock _(mut());
-#endif
- if (__cend_ != __cbeg_)
- {
- size_t hc = hash<void*>()(__c) % static_cast<size_t>(__cend_ - __cbeg_);
- __c_node* p = __cbeg_[hc];
- if (p == nullptr)
- return;
- __c_node* q = nullptr;
- _LIBCPP_ASSERT(p != nullptr, "debug mode internal logic error __erase_c A");
- while (p->__c_ != __c)
- {
- q = p;
- p = p->__next_;
- if (p == nullptr)
- return;
- _LIBCPP_ASSERT(p != nullptr, "debug mode internal logic error __erase_c B");
- }
- if (q == nullptr)
- __cbeg_[hc] = p->__next_;
- else
- q->__next_ = p->__next_;
- while (p->end_ != p->beg_)
- {
- --p->end_;
- (*p->end_)->__c_ = nullptr;
- }
- free(p->beg_);
- free(p);
- --__csz_;
- }
-}
-
-void
-__libcpp_db::__iterator_copy(void* __i, const void* __i0)
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- WLock _(mut());
-#endif
- __i_node* i = __find_iterator(__i);
- __i_node* i0 = __find_iterator(__i0);
- __c_node* c0 = i0 != nullptr ? i0->__c_ : nullptr;
- if (i == nullptr && i0 != nullptr)
- i = __insert_iterator(__i);
- __c_node* c = i != nullptr ? i->__c_ : nullptr;
- if (c != c0)
- {
- if (c != nullptr)
- c->__remove(i);
- if (i != nullptr)
- {
- i->__c_ = nullptr;
- if (c0 != nullptr)
- {
- i->__c_ = c0;
- i->__c_->__add(i);
- }
- }
- }
-}
-
-bool
-__libcpp_db::__dereferenceable(const void* __i) const
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- RLock _(mut());
-#endif
- __i_node* i = __find_iterator(__i);
- return i != nullptr && i->__c_ != nullptr && i->__c_->__dereferenceable(__i);
-}
-
-bool
-__libcpp_db::__decrementable(const void* __i) const
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- RLock _(mut());
-#endif
- __i_node* i = __find_iterator(__i);
- return i != nullptr && i->__c_ != nullptr && i->__c_->__decrementable(__i);
-}
-
-bool
-__libcpp_db::__addable(const void* __i, ptrdiff_t __n) const
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- RLock _(mut());
-#endif
- __i_node* i = __find_iterator(__i);
- return i != nullptr && i->__c_ != nullptr && i->__c_->__addable(__i, __n);
-}
-
-bool
-__libcpp_db::__subscriptable(const void* __i, ptrdiff_t __n) const
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- RLock _(mut());
-#endif
- __i_node* i = __find_iterator(__i);
- return i != nullptr && i->__c_ != nullptr && i->__c_->__subscriptable(__i, __n);
-}
-
-bool
-__libcpp_db::__less_than_comparable(const void* __i, const void* __j) const
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- RLock _(mut());
-#endif
- __i_node* i = __find_iterator(__i);
- __i_node* j = __find_iterator(__j);
- __c_node* ci = i != nullptr ? i->__c_ : nullptr;
- __c_node* cj = j != nullptr ? j->__c_ : nullptr;
- return ci == cj;
-}
-
-void
-__libcpp_db::swap(void* c1, void* c2)
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- WLock _(mut());
-#endif
- size_t hc = hash<void*>()(c1) % static_cast<size_t>(__cend_ - __cbeg_);
- __c_node* p1 = __cbeg_[hc];
- _LIBCPP_ASSERT(p1 != nullptr, "debug mode internal logic error swap A");
- while (p1->__c_ != c1)
- {
- p1 = p1->__next_;
- _LIBCPP_ASSERT(p1 != nullptr, "debug mode internal logic error swap B");
- }
- hc = hash<void*>()(c2) % static_cast<size_t>(__cend_ - __cbeg_);
- __c_node* p2 = __cbeg_[hc];
- _LIBCPP_ASSERT(p2 != nullptr, "debug mode internal logic error swap C");
- while (p2->__c_ != c2)
- {
- p2 = p2->__next_;
- _LIBCPP_ASSERT(p2 != nullptr, "debug mode internal logic error swap D");
- }
- std::swap(p1->beg_, p2->beg_);
- std::swap(p1->end_, p2->end_);
- std::swap(p1->cap_, p2->cap_);
- for (__i_node** p = p1->beg_; p != p1->end_; ++p)
- (*p)->__c_ = p1;
- for (__i_node** p = p2->beg_; p != p2->end_; ++p)
- (*p)->__c_ = p2;
-}
-
-void
-__libcpp_db::__insert_i(void* __i)
-{
-#ifndef _LIBCPP_HAS_NO_THREADS
- WLock _(mut());
-#endif
- __insert_iterator(__i);
-}
-
-void
-__c_node::__add(__i_node* i)
-{
- if (end_ == cap_)
- {
- size_t nc = 2*static_cast<size_t>(cap_ - beg_);
- if (nc == 0)
- nc = 1;
- __i_node** beg =
- static_cast<__i_node**>(malloc(nc * sizeof(__i_node*)));
- if (beg == nullptr)
- __throw_bad_alloc();
-
- if (nc > 1)
- memcpy(beg, beg_, nc/2*sizeof(__i_node*));
- free(beg_);
- beg_ = beg;
- end_ = beg_ + nc/2;
- cap_ = beg_ + nc;
- }
- *end_++ = i;
-}
-
-// private api
-
-_LIBCPP_HIDDEN
-__i_node*
-__libcpp_db::__insert_iterator(void* __i)
-{
- if (__isz_ + 1 > static_cast<size_t>(__iend_ - __ibeg_))
- {
- size_t nc = __next_prime(2*static_cast<size_t>(__iend_ - __ibeg_) + 1);
- __i_node** ibeg = static_cast<__i_node**>(calloc(nc, sizeof(__i_node*)));
- if (ibeg == nullptr)
- __throw_bad_alloc();
-
- for (__i_node** p = __ibeg_; p != __iend_; ++p)
- {
- __i_node* q = *p;
- while (q != nullptr)
- {
- size_t h = hash<void*>()(q->__i_) % nc;
- __i_node* r = q->__next_;
- q->__next_ = ibeg[h];
- ibeg[h] = q;
- q = r;
- }
- }
- free(__ibeg_);
- __ibeg_ = ibeg;
- __iend_ = __ibeg_ + nc;
- }
- size_t hi = hash<void*>()(__i) % static_cast<size_t>(__iend_ - __ibeg_);
- __i_node* p = __ibeg_[hi];
- __i_node* r = __ibeg_[hi] =
- static_cast<__i_node*>(malloc(sizeof(__i_node)));
- if (r == nullptr)
- __throw_bad_alloc();
-
- ::new(r) __i_node(__i, p, nullptr);
- ++__isz_;
- return r;
-}
-
-_LIBCPP_HIDDEN
-__i_node*
-__libcpp_db::__find_iterator(const void* __i) const
-{
- __i_node* r = nullptr;
- if (__ibeg_ != __iend_)
- {
- size_t h = hash<const void*>()(__i) % static_cast<size_t>(__iend_ - __ibeg_);
- for (__i_node* nd = __ibeg_[h]; nd != nullptr; nd = nd->__next_)
- {
- if (nd->__i_ == __i)
- {
- r = nd;
- break;
- }
- }
- }
- return r;
-}
-
-_LIBCPP_HIDDEN
-void
-__c_node::__remove(__i_node* p)
-{
- __i_node** r = find(beg_, end_, p);
- _LIBCPP_ASSERT(r != end_, "debug mode internal logic error __c_node::__remove");
- if (--end_ != r)
- memmove(r, r+1, static_cast<size_t>(end_ - r)*sizeof(__i_node*));
-}
-
-_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_entry.cpp b/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_entry.cpp
new file mode 100644
index 00000000000..4910d390d1e
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_entry.cpp
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <__config>
+#include <cstdint>
+#include <filesystem>
+#include <system_error>
+
+#include "file_descriptor.h"
+#include "posix_compat.h"
+#include "time_utils.h"
+
+_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+
+error_code directory_entry::__do_refresh() noexcept {
+ __data_.__reset();
+ error_code failure_ec;
+
+ detail::StatT full_st;
+ file_status st = detail::posix_lstat(__p_, full_st, &failure_ec);
+ if (!status_known(st)) {
+ __data_.__reset();
+ return failure_ec;
+ }
+
+ if (!_VSTD_FS::exists(st) || !_VSTD_FS::is_symlink(st)) {
+ __data_.__cache_type_ = directory_entry::_RefreshNonSymlink;
+ __data_.__type_ = st.type();
+ __data_.__non_sym_perms_ = st.permissions();
+ } else { // we have a symlink
+ __data_.__sym_perms_ = st.permissions();
+ // Get the information about the linked entity.
+ // Ignore errors from stat, since we don't want errors regarding symlink
+ // resolution to be reported to the user.
+ error_code ignored_ec;
+ st = detail::posix_stat(__p_, full_st, &ignored_ec);
+
+ __data_.__type_ = st.type();
+ __data_.__non_sym_perms_ = st.permissions();
+
+ // If we failed to resolve the link, then only partially populate the
+ // cache.
+ if (!status_known(st)) {
+ __data_.__cache_type_ = directory_entry::_RefreshSymlinkUnresolved;
+ return error_code{};
+ }
+ // Otherwise, we resolved the link, potentially as not existing.
+ // That's OK.
+ __data_.__cache_type_ = directory_entry::_RefreshSymlink;
+ }
+
+ if (_VSTD_FS::is_regular_file(st))
+ __data_.__size_ = static_cast<uintmax_t>(full_st.st_size);
+
+ if (_VSTD_FS::exists(st)) {
+ __data_.__nlink_ = static_cast<uintmax_t>(full_st.st_nlink);
+
+ // Attempt to extract the mtime, and fail if it's not representable using
+ // file_time_type. For now we ignore the error, as we'll report it when
+ // the value is actually used.
+ error_code ignored_ec;
+ __data_.__write_time_ =
+ detail::__extract_last_write_time(__p_, full_st, &ignored_ec);
+ }
+
+ return failure_ec;
+}
+
+_LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp b/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp
index 8d069cc080d..151fb2fb621 100644
--- a/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp
@@ -11,8 +11,18 @@
#include <errno.h>
#include <filesystem>
#include <stack>
+#include <utility>
-#include "filesystem_common.h"
+#include "error.h"
+#include "file_descriptor.h"
+
+#if defined(_LIBCPP_WIN32API)
+# define WIN32_LEAN_AND_MEAN
+# define NOMINMAX
+# include <windows.h>
+#else
+# include <dirent.h> // for DIR & friends
+#endif
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
@@ -182,7 +192,7 @@ directory_iterator::directory_iterator(const path& p, error_code* ec,
}
directory_iterator& directory_iterator::__increment(error_code* ec) {
- _LIBCPP_ASSERT(__imp_, "Attempting to increment an invalid iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__imp_, "Attempting to increment an invalid iterator");
ErrorHandler<void> err("directory_iterator::operator++()", ec);
error_code m_ec;
@@ -196,7 +206,7 @@ directory_iterator& directory_iterator::__increment(error_code* ec) {
}
directory_entry const& directory_iterator::__dereference() const {
- _LIBCPP_ASSERT(__imp_, "Attempting to dereference an invalid iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__imp_, "Attempting to dereference an invalid iterator");
return __imp_->__entry_;
}
@@ -225,7 +235,7 @@ recursive_directory_iterator::recursive_directory_iterator(
}
void recursive_directory_iterator::__pop(error_code* ec) {
- _LIBCPP_ASSERT(__imp_, "Popping the end iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__imp_, "Popping the end iterator");
if (ec)
ec->clear();
__imp_->__stack_.pop();
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/error.h b/contrib/libs/cxxsupp/libcxx/src/filesystem/error.h
new file mode 100644
index 00000000000..965e0eadcd0
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/error.h
@@ -0,0 +1,238 @@
+//===----------------------------------------------------------------------===////
+//
+// 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 FILESYSTEM_ERROR_H
+#define FILESYSTEM_ERROR_H
+
+#include <__assert>
+#include <__config>
+#include <cerrno>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdint>
+#include <filesystem>
+#include <string>
+#include <system_error>
+#include <utility> // __libcpp_unreachable
+
+#include "format_string.h"
+
+#if defined(_LIBCPP_WIN32API)
+# define WIN32_LEAN_AND_MEAN
+# define NOMINMAX
+# include <windows.h> // ERROR_* macros
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+
+namespace detail {
+
+#if defined(_LIBCPP_WIN32API)
+
+inline errc __win_err_to_errc(int err) {
+ constexpr struct {
+ DWORD win;
+ errc errc;
+ } win_error_mapping[] = {
+ {ERROR_ACCESS_DENIED, errc::permission_denied},
+ {ERROR_ALREADY_EXISTS, errc::file_exists},
+ {ERROR_BAD_NETPATH, errc::no_such_file_or_directory},
+ {ERROR_BAD_PATHNAME, errc::no_such_file_or_directory},
+ {ERROR_BAD_UNIT, errc::no_such_device},
+ {ERROR_BROKEN_PIPE, errc::broken_pipe},
+ {ERROR_BUFFER_OVERFLOW, errc::filename_too_long},
+ {ERROR_BUSY, errc::device_or_resource_busy},
+ {ERROR_BUSY_DRIVE, errc::device_or_resource_busy},
+ {ERROR_CANNOT_MAKE, errc::permission_denied},
+ {ERROR_CANTOPEN, errc::io_error},
+ {ERROR_CANTREAD, errc::io_error},
+ {ERROR_CANTWRITE, errc::io_error},
+ {ERROR_CURRENT_DIRECTORY, errc::permission_denied},
+ {ERROR_DEV_NOT_EXIST, errc::no_such_device},
+ {ERROR_DEVICE_IN_USE, errc::device_or_resource_busy},
+ {ERROR_DIR_NOT_EMPTY, errc::directory_not_empty},
+ {ERROR_DIRECTORY, errc::invalid_argument},
+ {ERROR_DISK_FULL, errc::no_space_on_device},
+ {ERROR_FILE_EXISTS, errc::file_exists},
+ {ERROR_FILE_NOT_FOUND, errc::no_such_file_or_directory},
+ {ERROR_HANDLE_DISK_FULL, errc::no_space_on_device},
+ {ERROR_INVALID_ACCESS, errc::permission_denied},
+ {ERROR_INVALID_DRIVE, errc::no_such_device},
+ {ERROR_INVALID_FUNCTION, errc::function_not_supported},
+ {ERROR_INVALID_HANDLE, errc::invalid_argument},
+ {ERROR_INVALID_NAME, errc::no_such_file_or_directory},
+ {ERROR_INVALID_PARAMETER, errc::invalid_argument},
+ {ERROR_LOCK_VIOLATION, errc::no_lock_available},
+ {ERROR_LOCKED, errc::no_lock_available},
+ {ERROR_NEGATIVE_SEEK, errc::invalid_argument},
+ {ERROR_NOACCESS, errc::permission_denied},
+ {ERROR_NOT_ENOUGH_MEMORY, errc::not_enough_memory},
+ {ERROR_NOT_READY, errc::resource_unavailable_try_again},
+ {ERROR_NOT_SAME_DEVICE, errc::cross_device_link},
+ {ERROR_NOT_SUPPORTED, errc::not_supported},
+ {ERROR_OPEN_FAILED, errc::io_error},
+ {ERROR_OPEN_FILES, errc::device_or_resource_busy},
+ {ERROR_OPERATION_ABORTED, errc::operation_canceled},
+ {ERROR_OUTOFMEMORY, errc::not_enough_memory},
+ {ERROR_PATH_NOT_FOUND, errc::no_such_file_or_directory},
+ {ERROR_READ_FAULT, errc::io_error},
+ {ERROR_REPARSE_TAG_INVALID, errc::invalid_argument},
+ {ERROR_RETRY, errc::resource_unavailable_try_again},
+ {ERROR_SEEK, errc::io_error},
+ {ERROR_SHARING_VIOLATION, errc::permission_denied},
+ {ERROR_TOO_MANY_OPEN_FILES, errc::too_many_files_open},
+ {ERROR_WRITE_FAULT, errc::io_error},
+ {ERROR_WRITE_PROTECT, errc::permission_denied},
+ };
+
+ for (const auto &pair : win_error_mapping)
+ if (pair.win == static_cast<DWORD>(err))
+ return pair.errc;
+ return errc::invalid_argument;
+}
+
+#endif // _LIBCPP_WIN32API
+
+inline error_code capture_errno() {
+ _LIBCPP_ASSERT_UNCATEGORIZED(errno != 0, "Expected errno to be non-zero");
+ return error_code(errno, generic_category());
+}
+
+#if defined(_LIBCPP_WIN32API)
+inline error_code make_windows_error(int err) {
+ return make_error_code(__win_err_to_errc(err));
+}
+#endif
+
+template <class T>
+T error_value();
+template <>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX14 void error_value<void>() {}
+template <>
+inline bool error_value<bool>() {
+ return false;
+}
+#if __SIZEOF_SIZE_T__ != __SIZEOF_LONG_LONG__
+template <>
+inline size_t error_value<size_t>() {
+ return size_t(-1);
+}
+#endif
+template <>
+inline uintmax_t error_value<uintmax_t>() {
+ return uintmax_t(-1);
+}
+template <>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX14 file_time_type error_value<file_time_type>() {
+ return file_time_type::min();
+}
+template <>
+inline path error_value<path>() {
+ return {};
+}
+
+template <class T>
+struct ErrorHandler {
+ const char* func_name_;
+ error_code* ec_ = nullptr;
+ const path* p1_ = nullptr;
+ const path* p2_ = nullptr;
+
+ ErrorHandler(const char* fname, error_code* ec, const path* p1 = nullptr,
+ const path* p2 = nullptr)
+ : func_name_(fname), ec_(ec), p1_(p1), p2_(p2) {
+ if (ec_)
+ ec_->clear();
+ }
+
+ T report(const error_code& ec) const {
+ if (ec_) {
+ *ec_ = ec;
+ return error_value<T>();
+ }
+ string what = string("in ") + func_name_;
+ switch (bool(p1_) + bool(p2_)) {
+ case 0:
+ __throw_filesystem_error(what, ec);
+ case 1:
+ __throw_filesystem_error(what, *p1_, ec);
+ case 2:
+ __throw_filesystem_error(what, *p1_, *p2_, ec);
+ }
+ __libcpp_unreachable();
+ }
+
+ _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 0)
+ void report_impl(const error_code& ec, const char* msg, va_list ap) const {
+ if (ec_) {
+ *ec_ = ec;
+ return;
+ }
+ string what =
+ string("in ") + func_name_ + ": " + detail::vformat_string(msg, ap);
+ switch (bool(p1_) + bool(p2_)) {
+ case 0:
+ __throw_filesystem_error(what, ec);
+ case 1:
+ __throw_filesystem_error(what, *p1_, ec);
+ case 2:
+ __throw_filesystem_error(what, *p1_, *p2_, ec);
+ }
+ __libcpp_unreachable();
+ }
+
+ _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4)
+ T report(const error_code& ec, const char* msg, ...) const {
+ va_list ap;
+ va_start(ap, msg);
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ try {
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ report_impl(ec, msg, ap);
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ } catch (...) {
+ va_end(ap);
+ throw;
+ }
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ va_end(ap);
+ return error_value<T>();
+ }
+
+ T report(errc const& err) const {
+ return report(make_error_code(err));
+ }
+
+ _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4)
+ T report(errc const& err, const char* msg, ...) const {
+ va_list ap;
+ va_start(ap, msg);
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ try {
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ report_impl(make_error_code(err), msg, ap);
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ } catch (...) {
+ va_end(ap);
+ throw;
+ }
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ va_end(ap);
+ return error_value<T>();
+ }
+
+private:
+ ErrorHandler(ErrorHandler const&) = delete;
+ ErrorHandler& operator=(ErrorHandler const&) = delete;
+};
+
+} // end namespace detail
+
+_LIBCPP_END_NAMESPACE_FILESYSTEM
+
+#endif // FILESYSTEM_ERROR_H
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/file_descriptor.h b/contrib/libs/cxxsupp/libcxx/src/filesystem/file_descriptor.h
new file mode 100644
index 00000000000..d3a668fa2e3
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/file_descriptor.h
@@ -0,0 +1,298 @@
+//===----------------------------------------------------------------------===////
+//
+// 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 FILESYSTEM_FILE_DESCRIPTOR_H
+#define FILESYSTEM_FILE_DESCRIPTOR_H
+
+#include <__config>
+#include <cstdint>
+#include <filesystem>
+#include <string_view>
+#include <system_error>
+#include <utility>
+
+#include "error.h"
+#include "posix_compat.h"
+#include "time_utils.h"
+
+#if defined(_LIBCPP_WIN32API)
+# define WIN32_LEAN_AND_MEAN
+# define NOMINMAX
+# include <windows.h>
+#else
+# include <dirent.h> // for DIR & friends
+# include <fcntl.h> // values for fchmodat
+# include <sys/stat.h>
+# include <sys/statvfs.h>
+# include <unistd.h>
+#endif // defined(_LIBCPP_WIN32API)
+
+_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+
+namespace detail {
+
+#if !defined(_LIBCPP_WIN32API)
+
+#if defined(DT_BLK)
+template <class DirEntT, class = decltype(DirEntT::d_type)>
+file_type get_file_type(DirEntT* ent, int) {
+ switch (ent->d_type) {
+ case DT_BLK:
+ return file_type::block;
+ case DT_CHR:
+ return file_type::character;
+ case DT_DIR:
+ return file_type::directory;
+ case DT_FIFO:
+ return file_type::fifo;
+ case DT_LNK:
+ return file_type::symlink;
+ case DT_REG:
+ return file_type::regular;
+ case DT_SOCK:
+ return file_type::socket;
+ // Unlike in lstat, hitting "unknown" here simply means that the underlying
+ // filesystem doesn't support d_type. Report is as 'none' so we correctly
+ // set the cache to empty.
+ case DT_UNKNOWN:
+ break;
+ }
+ return file_type::none;
+}
+#endif // defined(DT_BLK)
+
+template <class DirEntT>
+file_type get_file_type(DirEntT*, long) {
+ return file_type::none;
+}
+
+inline pair<string_view, file_type> posix_readdir(DIR* dir_stream,
+ error_code& ec) {
+ struct dirent* dir_entry_ptr = nullptr;
+ errno = 0; // zero errno in order to detect errors
+ ec.clear();
+ if ((dir_entry_ptr = ::readdir(dir_stream)) == nullptr) {
+ if (errno)
+ ec = capture_errno();
+ return {};
+ } else {
+ return {dir_entry_ptr->d_name, get_file_type(dir_entry_ptr, 0)};
+ }
+}
+
+#else // _LIBCPP_WIN32API
+
+inline file_type get_file_type(const WIN32_FIND_DATAW& data) {
+ if (data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT &&
+ data.dwReserved0 == IO_REPARSE_TAG_SYMLINK)
+ return file_type::symlink;
+ if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ return file_type::directory;
+ return file_type::regular;
+}
+inline uintmax_t get_file_size(const WIN32_FIND_DATAW& data) {
+ return (static_cast<uint64_t>(data.nFileSizeHigh) << 32) + data.nFileSizeLow;
+}
+inline file_time_type get_write_time(const WIN32_FIND_DATAW& data) {
+ ULARGE_INTEGER tmp;
+ const FILETIME& time = data.ftLastWriteTime;
+ tmp.u.LowPart = time.dwLowDateTime;
+ tmp.u.HighPart = time.dwHighDateTime;
+ return file_time_type(file_time_type::duration(tmp.QuadPart));
+}
+
+#endif // !_LIBCPP_WIN32API
+
+// POSIX HELPERS
+
+using value_type = path::value_type;
+using string_type = path::string_type;
+
+struct FileDescriptor {
+ const path& name;
+ int fd = -1;
+ StatT m_stat;
+ file_status m_status;
+
+ template <class... Args>
+ static FileDescriptor create(const path* p, error_code& ec, Args... args) {
+ ec.clear();
+ int fd;
+#ifdef _LIBCPP_WIN32API
+ // TODO: most of the filesystem implementation uses native Win32 calls
+ // (mostly via posix_compat.h). However, here we use the C-runtime APIs to
+ // open a file, because we subsequently pass the C-runtime fd to
+ // `std::[io]fstream::__open(int fd)` in order to implement copy_file.
+ //
+ // Because we're calling the windows C-runtime, win32 error codes are
+ // translated into C error numbers by the C runtime, and returned in errno,
+ // rather than being accessible directly via GetLastError.
+ //
+ // Ideally copy_file should be calling the Win32 CopyFile2 function, which
+ // works on paths, not open files -- at which point this FileDescriptor type
+ // will no longer be needed on windows at all.
+ fd = ::_wopen(p->c_str(), args...);
+#else
+ fd = open(p->c_str(), args...);
+#endif
+
+ if (fd == -1) {
+ ec = capture_errno();
+ return FileDescriptor{p};
+ }
+ return FileDescriptor(p, fd);
+ }
+
+ template <class... Args>
+ static FileDescriptor create_with_status(const path* p, error_code& ec,
+ Args... args) {
+ FileDescriptor fd = create(p, ec, args...);
+ if (!ec)
+ fd.refresh_status(ec);
+
+ return fd;
+ }
+
+ file_status get_status() const { return m_status; }
+ StatT const& get_stat() const { return m_stat; }
+
+ bool status_known() const { return _VSTD_FS::status_known(m_status); }
+
+ file_status refresh_status(error_code& ec);
+
+ void close() noexcept {
+ if (fd != -1) {
+#ifdef _LIBCPP_WIN32API
+ ::_close(fd);
+#else
+ ::close(fd);
+#endif
+ // FIXME: shouldn't this return an error_code?
+ }
+ fd = -1;
+ }
+
+ FileDescriptor(FileDescriptor&& other)
+ : name(other.name), fd(other.fd), m_stat(other.m_stat),
+ m_status(other.m_status) {
+ other.fd = -1;
+ other.m_status = file_status{};
+ }
+
+ ~FileDescriptor() { close(); }
+
+ FileDescriptor(FileDescriptor const&) = delete;
+ FileDescriptor& operator=(FileDescriptor const&) = delete;
+
+private:
+ explicit FileDescriptor(const path* p, int descriptor = -1) : name(*p), fd(descriptor) {}
+};
+
+inline perms posix_get_perms(const StatT& st) noexcept {
+ return static_cast<perms>(st.st_mode) & perms::mask;
+}
+
+inline file_status create_file_status(error_code& m_ec, path const& p,
+ const StatT& path_stat, error_code* ec) {
+ if (ec)
+ *ec = m_ec;
+ if (m_ec && (m_ec.value() == ENOENT || m_ec.value() == ENOTDIR)) {
+ return file_status(file_type::not_found);
+ } else if (m_ec) {
+ ErrorHandler<void> err("posix_stat", ec, &p);
+ err.report(m_ec, "failed to determine attributes for the specified path");
+ return file_status(file_type::none);
+ }
+ // else
+
+ file_status fs_tmp;
+ auto const mode = path_stat.st_mode;
+ if (S_ISLNK(mode))
+ fs_tmp.type(file_type::symlink);
+ else if (S_ISREG(mode))
+ fs_tmp.type(file_type::regular);
+ else if (S_ISDIR(mode))
+ fs_tmp.type(file_type::directory);
+ else if (S_ISBLK(mode))
+ fs_tmp.type(file_type::block);
+ else if (S_ISCHR(mode))
+ fs_tmp.type(file_type::character);
+ else if (S_ISFIFO(mode))
+ fs_tmp.type(file_type::fifo);
+ else if (S_ISSOCK(mode))
+ fs_tmp.type(file_type::socket);
+ else
+ fs_tmp.type(file_type::unknown);
+
+ fs_tmp.permissions(detail::posix_get_perms(path_stat));
+ return fs_tmp;
+}
+
+inline file_status posix_stat(path const& p, StatT& path_stat, error_code* ec) {
+ error_code m_ec;
+ if (detail::stat(p.c_str(), &path_stat) == -1)
+ m_ec = detail::capture_errno();
+ return create_file_status(m_ec, p, path_stat, ec);
+}
+
+inline file_status posix_stat(path const& p, error_code* ec) {
+ StatT path_stat;
+ return posix_stat(p, path_stat, ec);
+}
+
+inline file_status posix_lstat(path const& p, StatT& path_stat, error_code* ec) {
+ error_code m_ec;
+ if (detail::lstat(p.c_str(), &path_stat) == -1)
+ m_ec = detail::capture_errno();
+ return create_file_status(m_ec, p, path_stat, ec);
+}
+
+inline file_status posix_lstat(path const& p, error_code* ec) {
+ StatT path_stat;
+ return posix_lstat(p, path_stat, ec);
+}
+
+// http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html
+inline bool posix_ftruncate(const FileDescriptor& fd, off_t to_size, error_code& ec) {
+ if (detail::ftruncate(fd.fd, to_size) == -1) {
+ ec = capture_errno();
+ return true;
+ }
+ ec.clear();
+ return false;
+}
+
+inline bool posix_fchmod(const FileDescriptor& fd, const StatT& st, error_code& ec) {
+ if (detail::fchmod(fd.fd, st.st_mode) == -1) {
+ ec = capture_errno();
+ return true;
+ }
+ ec.clear();
+ return false;
+}
+
+inline bool stat_equivalent(const StatT& st1, const StatT& st2) {
+ return (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino);
+}
+
+inline file_status FileDescriptor::refresh_status(error_code& ec) {
+ // FD must be open and good.
+ m_status = file_status{};
+ m_stat = {};
+ error_code m_ec;
+ if (detail::fstat(fd, &m_stat) == -1)
+ m_ec = capture_errno();
+ m_status = create_file_status(m_ec, name, m_stat, &ec);
+ return m_status;
+}
+
+} // end namespace detail
+
+_LIBCPP_END_NAMESPACE_FILESYSTEM
+
+#endif // FILESYSTEM_FILE_DESCRIPTOR_H
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_clock.cpp b/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_clock.cpp
new file mode 100644
index 00000000000..fbb19ac68df
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_clock.cpp
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <__config>
+#include <chrono>
+#include <filesystem>
+#include <time.h>
+
+#if defined(_LIBCPP_WIN32API)
+# include "time_utils.h"
+#endif
+
+#if defined(_LIBCPP_WIN32API)
+# define WIN32_LEAN_AND_MEAN
+# define NOMINMAX
+# include <windows.h>
+#endif
+
+#if __has_include(<unistd.h>)
+# include <unistd.h> // _POSIX_TIMERS
+#endif
+
+#if __has_include(<sys/time.h>)
+# include <sys/time.h> // for gettimeofday and timeval
+#endif
+
+#if defined(__APPLE__) || defined (__gnu_hurd__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
+# define _LIBCPP_HAS_CLOCK_GETTIME
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+
+const bool _FilesystemClock::is_steady;
+
+_FilesystemClock::time_point _FilesystemClock::now() noexcept {
+ typedef chrono::duration<rep> __secs;
+#if defined(_LIBCPP_WIN32API)
+ typedef chrono::duration<rep, nano> __nsecs;
+ FILETIME time;
+ GetSystemTimeAsFileTime(&time);
+ detail::TimeSpec tp = detail::filetime_to_timespec(time);
+ return time_point(__secs(tp.tv_sec) +
+ chrono::duration_cast<duration>(__nsecs(tp.tv_nsec)));
+#elif defined(_LIBCPP_HAS_CLOCK_GETTIME)
+ typedef chrono::duration<rep, nano> __nsecs;
+ struct timespec tp;
+ if (0 != clock_gettime(CLOCK_REALTIME, &tp))
+ __throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed");
+ return time_point(__secs(tp.tv_sec) +
+ chrono::duration_cast<duration>(__nsecs(tp.tv_nsec)));
+#else
+ typedef chrono::duration<rep, micro> __microsecs;
+ timeval tv;
+ gettimeofday(&tv, 0);
+ return time_point(__secs(tv.tv_sec) + __microsecs(tv.tv_usec));
+#endif
+}
+
+_LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_common.h b/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_common.h
deleted file mode 100644
index 0e71569d871..00000000000
--- a/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_common.h
+++ /dev/null
@@ -1,613 +0,0 @@
-//===----------------------------------------------------------------------===////
-//
-// 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 FILESYSTEM_COMMON_H
-#define FILESYSTEM_COMMON_H
-
-#include <__assert>
-#include <__config>
-#include <array>
-#include <chrono>
-#include <climits>
-#include <cstdarg>
-#include <ctime>
-#include <filesystem>
-#include <ratio>
-#include <system_error>
-#include <utility>
-
-#if defined(_LIBCPP_WIN32API)
-# define WIN32_LEAN_AND_MEAN
-# define NOMINMAX
-# include <windows.h>
-#else
-# include <dirent.h> // for DIR & friends
-# include <fcntl.h> /* values for fchmodat */
-# include <sys/stat.h>
-# include <sys/statvfs.h>
-# include <sys/time.h> // for ::utimes as used in __last_write_time
-# include <unistd.h>
-#endif // defined(_LIBCPP_WIN32API)
-
-#include "../include/apple_availability.h"
-
-#if !defined(__APPLE__)
-// We can use the presence of UTIME_OMIT to detect platforms that provide
-// utimensat.
-#if defined(UTIME_OMIT)
-#define _LIBCPP_USE_UTIMENSAT
-#endif
-#endif
-
-_LIBCPP_DIAGNOSTIC_PUSH
-_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wunused-function")
-_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wunused-function")
-
-#if defined(_LIBCPP_WIN32API)
-# define PATHSTR(x) (L##x)
-# define PATH_CSTR_FMT "\"%ls\""
-#else
-# define PATHSTR(x) (x)
-# define PATH_CSTR_FMT "\"%s\""
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-
-namespace detail {
-
-#if defined(_LIBCPP_WIN32API)
-// Non anonymous, to allow access from two translation units.
-errc __win_err_to_errc(int err);
-#endif
-
-namespace {
-
-static _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 0) string
-format_string_impl(const char* msg, va_list ap) {
- array<char, 256> buf;
-
- va_list apcopy;
- va_copy(apcopy, ap);
- int ret = ::vsnprintf(buf.data(), buf.size(), msg, apcopy);
- va_end(apcopy);
-
- string result;
- if (static_cast<size_t>(ret) < buf.size()) {
- result.assign(buf.data(), static_cast<size_t>(ret));
- } else {
- // we did not provide a long enough buffer on our first attempt. The
- // return value is the number of bytes (excluding the null byte) that are
- // needed for formatting.
- size_t size_with_null = static_cast<size_t>(ret) + 1;
- result.__resize_default_init(size_with_null - 1);
- ret = ::vsnprintf(&result[0], size_with_null, msg, ap);
- _LIBCPP_ASSERT(static_cast<size_t>(ret) == (size_with_null - 1), "TODO");
- }
- return result;
-}
-
-static _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2) string
-format_string(const char* msg, ...) {
- string ret;
- va_list ap;
- va_start(ap, msg);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try {
-#endif // _LIBCPP_NO_EXCEPTIONS
- ret = format_string_impl(msg, ap);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- } catch (...) {
- va_end(ap);
- throw;
- }
-#endif // _LIBCPP_NO_EXCEPTIONS
- va_end(ap);
- return ret;
-}
-
-error_code capture_errno() {
- _LIBCPP_ASSERT(errno != 0, "Expected errno to be non-zero");
- return error_code(errno, generic_category());
-}
-
-#if defined(_LIBCPP_WIN32API)
-error_code make_windows_error(int err) {
- return make_error_code(__win_err_to_errc(err));
-}
-#endif
-
-template <class T>
-T error_value();
-template <>
-_LIBCPP_CONSTEXPR_SINCE_CXX14 void error_value<void>() {}
-template <>
-bool error_value<bool>() {
- return false;
-}
-#if __SIZEOF_SIZE_T__ != __SIZEOF_LONG_LONG__
-template <>
-size_t error_value<size_t>() {
- return size_t(-1);
-}
-#endif
-template <>
-uintmax_t error_value<uintmax_t>() {
- return uintmax_t(-1);
-}
-template <>
-_LIBCPP_CONSTEXPR_SINCE_CXX14 file_time_type error_value<file_time_type>() {
- return file_time_type::min();
-}
-template <>
-path error_value<path>() {
- return {};
-}
-
-template <class T>
-struct ErrorHandler {
- const char* func_name_;
- error_code* ec_ = nullptr;
- const path* p1_ = nullptr;
- const path* p2_ = nullptr;
-
- ErrorHandler(const char* fname, error_code* ec, const path* p1 = nullptr,
- const path* p2 = nullptr)
- : func_name_(fname), ec_(ec), p1_(p1), p2_(p2) {
- if (ec_)
- ec_->clear();
- }
-
- T report(const error_code& ec) const {
- if (ec_) {
- *ec_ = ec;
- return error_value<T>();
- }
- string what = string("in ") + func_name_;
- switch (bool(p1_) + bool(p2_)) {
- case 0:
- __throw_filesystem_error(what, ec);
- case 1:
- __throw_filesystem_error(what, *p1_, ec);
- case 2:
- __throw_filesystem_error(what, *p1_, *p2_, ec);
- }
- __libcpp_unreachable();
- }
-
- _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 0)
- void report_impl(const error_code& ec, const char* msg, va_list ap) const {
- if (ec_) {
- *ec_ = ec;
- return;
- }
- string what =
- string("in ") + func_name_ + ": " + format_string_impl(msg, ap);
- switch (bool(p1_) + bool(p2_)) {
- case 0:
- __throw_filesystem_error(what, ec);
- case 1:
- __throw_filesystem_error(what, *p1_, ec);
- case 2:
- __throw_filesystem_error(what, *p1_, *p2_, ec);
- }
- __libcpp_unreachable();
- }
-
- _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4)
- T report(const error_code& ec, const char* msg, ...) const {
- va_list ap;
- va_start(ap, msg);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try {
-#endif // _LIBCPP_NO_EXCEPTIONS
- report_impl(ec, msg, ap);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- } catch (...) {
- va_end(ap);
- throw;
- }
-#endif // _LIBCPP_NO_EXCEPTIONS
- va_end(ap);
- return error_value<T>();
- }
-
- T report(errc const& err) const {
- return report(make_error_code(err));
- }
-
- _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4)
- T report(errc const& err, const char* msg, ...) const {
- va_list ap;
- va_start(ap, msg);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try {
-#endif // _LIBCPP_NO_EXCEPTIONS
- report_impl(make_error_code(err), msg, ap);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- } catch (...) {
- va_end(ap);
- throw;
- }
-#endif // _LIBCPP_NO_EXCEPTIONS
- va_end(ap);
- return error_value<T>();
- }
-
-private:
- ErrorHandler(ErrorHandler const&) = delete;
- ErrorHandler& operator=(ErrorHandler const&) = delete;
-};
-
-using chrono::duration;
-using chrono::duration_cast;
-
-#if defined(_LIBCPP_WIN32API)
-// Various C runtime versions (UCRT, or the legacy msvcrt.dll used by
-// some mingw toolchains) provide different stat function implementations,
-// with a number of limitations with respect to what we want from the
-// stat function. Instead provide our own (in the anonymous detail namespace
-// in posix_compat.h) which does exactly what we want, along with our own
-// stat structure and flag macros.
-
-struct TimeSpec {
- int64_t tv_sec;
- int64_t tv_nsec;
-};
-struct StatT {
- unsigned st_mode;
- TimeSpec st_atim;
- TimeSpec st_mtim;
- uint64_t st_dev; // FILE_ID_INFO::VolumeSerialNumber
- struct FileIdStruct {
- unsigned char id[16]; // FILE_ID_INFO::FileId
- bool operator==(const FileIdStruct &other) const {
- for (int i = 0; i < 16; i++)
- if (id[i] != other.id[i])
- return false;
- return true;
- }
- } st_ino;
- uint32_t st_nlink;
- uintmax_t st_size;
-};
-
-#else
-using TimeSpec = struct timespec;
-using TimeVal = struct timeval;
-using StatT = struct stat;
-#endif
-
-template <class FileTimeT, class TimeT,
- bool IsFloat = is_floating_point<typename FileTimeT::rep>::value>
-struct time_util_base {
- using rep = typename FileTimeT::rep;
- using fs_duration = typename FileTimeT::duration;
- using fs_seconds = duration<rep>;
- using fs_nanoseconds = duration<rep, nano>;
- using fs_microseconds = duration<rep, micro>;
-
- static constexpr rep max_seconds =
- duration_cast<fs_seconds>(FileTimeT::duration::max()).count();
-
- static constexpr rep max_nsec =
- duration_cast<fs_nanoseconds>(FileTimeT::duration::max() -
- fs_seconds(max_seconds))
- .count();
-
- static constexpr rep min_seconds =
- duration_cast<fs_seconds>(FileTimeT::duration::min()).count();
-
- static constexpr rep min_nsec_timespec =
- duration_cast<fs_nanoseconds>(
- (FileTimeT::duration::min() - fs_seconds(min_seconds)) +
- fs_seconds(1))
- .count();
-
-private:
- static _LIBCPP_CONSTEXPR_SINCE_CXX14 fs_duration get_min_nsecs() {
- return duration_cast<fs_duration>(
- fs_nanoseconds(min_nsec_timespec) -
- duration_cast<fs_nanoseconds>(fs_seconds(1)));
- }
- // Static assert that these values properly round trip.
- static_assert(fs_seconds(min_seconds) + get_min_nsecs() ==
- FileTimeT::duration::min(),
- "value doesn't roundtrip");
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool check_range() {
- // This kinda sucks, but it's what happens when we don't have __int128_t.
- if (sizeof(TimeT) == sizeof(rep)) {
- typedef duration<long long, ratio<3600 * 24 * 365> > Years;
- return duration_cast<Years>(fs_seconds(max_seconds)) > Years(250) &&
- duration_cast<Years>(fs_seconds(min_seconds)) < Years(-250);
- }
- return max_seconds >= numeric_limits<TimeT>::max() &&
- min_seconds <= numeric_limits<TimeT>::min();
- }
- static_assert(check_range(), "the representable range is unacceptable small");
-};
-
-template <class FileTimeT, class TimeT>
-struct time_util_base<FileTimeT, TimeT, true> {
- using rep = typename FileTimeT::rep;
- using fs_duration = typename FileTimeT::duration;
- using fs_seconds = duration<rep>;
- using fs_nanoseconds = duration<rep, nano>;
- using fs_microseconds = duration<rep, micro>;
-
- static const rep max_seconds;
- static const rep max_nsec;
- static const rep min_seconds;
- static const rep min_nsec_timespec;
-};
-
-template <class FileTimeT, class TimeT>
-const typename FileTimeT::rep
- time_util_base<FileTimeT, TimeT, true>::max_seconds =
- duration_cast<fs_seconds>(FileTimeT::duration::max()).count();
-
-template <class FileTimeT, class TimeT>
-const typename FileTimeT::rep time_util_base<FileTimeT, TimeT, true>::max_nsec =
- duration_cast<fs_nanoseconds>(FileTimeT::duration::max() -
- fs_seconds(max_seconds))
- .count();
-
-template <class FileTimeT, class TimeT>
-const typename FileTimeT::rep
- time_util_base<FileTimeT, TimeT, true>::min_seconds =
- duration_cast<fs_seconds>(FileTimeT::duration::min()).count();
-
-template <class FileTimeT, class TimeT>
-const typename FileTimeT::rep
- time_util_base<FileTimeT, TimeT, true>::min_nsec_timespec =
- duration_cast<fs_nanoseconds>((FileTimeT::duration::min() -
- fs_seconds(min_seconds)) +
- fs_seconds(1))
- .count();
-
-template <class FileTimeT, class TimeT, class TimeSpecT>
-struct time_util : time_util_base<FileTimeT, TimeT> {
- using Base = time_util_base<FileTimeT, TimeT>;
- using Base::max_nsec;
- using Base::max_seconds;
- using Base::min_nsec_timespec;
- using Base::min_seconds;
-
- using typename Base::fs_duration;
- using typename Base::fs_microseconds;
- using typename Base::fs_nanoseconds;
- using typename Base::fs_seconds;
-
-public:
- template <class CType, class ChronoType>
- static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool checked_set(CType* out,
- ChronoType time) {
- using Lim = numeric_limits<CType>;
- if (time > Lim::max() || time < Lim::min())
- return false;
- *out = static_cast<CType>(time);
- return true;
- }
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool is_representable(TimeSpecT tm) {
- if (tm.tv_sec >= 0) {
- return tm.tv_sec < max_seconds ||
- (tm.tv_sec == max_seconds && tm.tv_nsec <= max_nsec);
- } else if (tm.tv_sec == (min_seconds - 1)) {
- return tm.tv_nsec >= min_nsec_timespec;
- } else {
- return tm.tv_sec >= min_seconds;
- }
- }
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool is_representable(FileTimeT tm) {
- auto secs = duration_cast<fs_seconds>(tm.time_since_epoch());
- auto nsecs = duration_cast<fs_nanoseconds>(tm.time_since_epoch() - secs);
- if (nsecs.count() < 0) {
- secs = secs + fs_seconds(1);
- nsecs = nsecs + fs_seconds(1);
- }
- using TLim = numeric_limits<TimeT>;
- if (secs.count() >= 0)
- return secs.count() <= TLim::max();
- return secs.count() >= TLim::min();
- }
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX14 FileTimeT
- convert_from_timespec(TimeSpecT tm) {
- if (tm.tv_sec >= 0 || tm.tv_nsec == 0) {
- return FileTimeT(fs_seconds(tm.tv_sec) +
- duration_cast<fs_duration>(fs_nanoseconds(tm.tv_nsec)));
- } else { // tm.tv_sec < 0
- auto adj_subsec = duration_cast<fs_duration>(fs_seconds(1) -
- fs_nanoseconds(tm.tv_nsec));
- auto Dur = fs_seconds(tm.tv_sec + 1) - adj_subsec;
- return FileTimeT(Dur);
- }
- }
-
- template <class SubSecT>
- static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
- set_times_checked(TimeT* sec_out, SubSecT* subsec_out, FileTimeT tp) {
- auto dur = tp.time_since_epoch();
- auto sec_dur = duration_cast<fs_seconds>(dur);
- auto subsec_dur = duration_cast<fs_nanoseconds>(dur - sec_dur);
- // The tv_nsec and tv_usec fields must not be negative so adjust accordingly
- if (subsec_dur.count() < 0) {
- if (sec_dur.count() > min_seconds) {
- sec_dur = sec_dur - fs_seconds(1);
- subsec_dur = subsec_dur + fs_seconds(1);
- } else {
- subsec_dur = fs_nanoseconds::zero();
- }
- }
- return checked_set(sec_out, sec_dur.count()) &&
- checked_set(subsec_out, subsec_dur.count());
- }
- static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool convert_to_timespec(TimeSpecT& dest,
- FileTimeT tp) {
- if (!is_representable(tp))
- return false;
- return set_times_checked(&dest.tv_sec, &dest.tv_nsec, tp);
- }
-};
-
-#if defined(_LIBCPP_WIN32API)
-using fs_time = time_util<file_time_type, int64_t, TimeSpec>;
-#else
-using fs_time = time_util<file_time_type, time_t, TimeSpec>;
-#endif
-
-#if defined(__APPLE__)
-inline TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }
-inline TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; }
-#elif defined(__MVS__)
-inline TimeSpec extract_mtime(StatT const& st) {
- TimeSpec TS = {st.st_mtime, 0};
- return TS;
-}
-inline TimeSpec extract_atime(StatT const& st) {
- TimeSpec TS = {st.st_atime, 0};
- return TS;
-}
-#elif defined(_AIX)
-inline TimeSpec extract_mtime(StatT const& st) {
- TimeSpec TS = {st.st_mtime, st.st_mtime_n};
- return TS;
-}
-inline TimeSpec extract_atime(StatT const& st) {
- TimeSpec TS = {st.st_atime, st.st_atime_n};
- return TS;
-}
-#else
-inline TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; }
-inline TimeSpec extract_atime(StatT const& st) { return st.st_atim; }
-#endif
-
-#if !defined(_LIBCPP_WIN32API)
-inline TimeVal make_timeval(TimeSpec const& ts) {
- using namespace chrono;
- auto Convert = [](long nsec) {
- using int_type = decltype(std::declval<TimeVal>().tv_usec);
- auto dur = duration_cast<microseconds>(nanoseconds(nsec)).count();
- return static_cast<int_type>(dur);
- };
- TimeVal TV = {};
- TV.tv_sec = ts.tv_sec;
- TV.tv_usec = Convert(ts.tv_nsec);
- return TV;
-}
-
-inline bool posix_utimes(const path& p, std::array<TimeSpec, 2> const& TS,
- error_code& ec) {
- TimeVal ConvertedTS[2] = {make_timeval(TS[0]), make_timeval(TS[1])};
- if (::utimes(p.c_str(), ConvertedTS) == -1) {
- ec = capture_errno();
- return true;
- }
- return false;
-}
-
-#if defined(_LIBCPP_USE_UTIMENSAT)
-bool posix_utimensat(const path& p, std::array<TimeSpec, 2> const& TS,
- error_code& ec) {
- if (::utimensat(AT_FDCWD, p.c_str(), TS.data(), 0) == -1) {
- ec = capture_errno();
- return true;
- }
- return false;
-}
-#endif
-
-bool set_file_times(const path& p, std::array<TimeSpec, 2> const& TS,
- error_code& ec) {
-#if !defined(_LIBCPP_USE_UTIMENSAT)
- return posix_utimes(p, TS, ec);
-#else
- return posix_utimensat(p, TS, ec);
-#endif
-}
-
-#if defined(DT_BLK)
-template <class DirEntT, class = decltype(DirEntT::d_type)>
-static file_type get_file_type(DirEntT* ent, int) {
- switch (ent->d_type) {
- case DT_BLK:
- return file_type::block;
- case DT_CHR:
- return file_type::character;
- case DT_DIR:
- return file_type::directory;
- case DT_FIFO:
- return file_type::fifo;
- case DT_LNK:
- return file_type::symlink;
- case DT_REG:
- return file_type::regular;
- case DT_SOCK:
- return file_type::socket;
- // Unlike in lstat, hitting "unknown" here simply means that the underlying
- // filesystem doesn't support d_type. Report is as 'none' so we correctly
- // set the cache to empty.
- case DT_UNKNOWN:
- break;
- }
- return file_type::none;
-}
-#endif // defined(DT_BLK)
-
-template <class DirEntT>
-static file_type get_file_type(DirEntT*, long) {
- return file_type::none;
-}
-
-static pair<string_view, file_type> posix_readdir(DIR* dir_stream,
- error_code& ec) {
- struct dirent* dir_entry_ptr = nullptr;
- errno = 0; // zero errno in order to detect errors
- ec.clear();
- if ((dir_entry_ptr = ::readdir(dir_stream)) == nullptr) {
- if (errno)
- ec = capture_errno();
- return {};
- } else {
- return {dir_entry_ptr->d_name, get_file_type(dir_entry_ptr, 0)};
- }
-}
-
-#else // _LIBCPP_WIN32API
-
-static file_type get_file_type(const WIN32_FIND_DATAW& data) {
- if (data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT &&
- data.dwReserved0 == IO_REPARSE_TAG_SYMLINK)
- return file_type::symlink;
- if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
- return file_type::directory;
- return file_type::regular;
-}
-static uintmax_t get_file_size(const WIN32_FIND_DATAW& data) {
- return (static_cast<uint64_t>(data.nFileSizeHigh) << 32) + data.nFileSizeLow;
-}
-static file_time_type get_write_time(const WIN32_FIND_DATAW& data) {
- ULARGE_INTEGER tmp;
- const FILETIME& time = data.ftLastWriteTime;
- tmp.u.LowPart = time.dwLowDateTime;
- tmp.u.HighPart = time.dwHighDateTime;
- return file_time_type(file_time_type::duration(tmp.QuadPart));
-}
-
-#endif // !_LIBCPP_WIN32API
-
-} // namespace
-} // end namespace detail
-
-_LIBCPP_END_NAMESPACE_FILESYSTEM
-
-_LIBCPP_DIAGNOSTIC_POP
-
-#endif // FILESYSTEM_COMMON_H
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_error.cpp b/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_error.cpp
new file mode 100644
index 00000000000..5faed3b89ef
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_error.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <__config>
+#include <__utility/unreachable.h>
+#include <filesystem>
+#include <system_error>
+
+#include "format_string.h"
+
+_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+
+filesystem_error::~filesystem_error() {}
+
+void filesystem_error::__create_what(int __num_paths) {
+ const char* derived_what = system_error::what();
+ __storage_->__what_ = [&]() -> string {
+ switch (__num_paths) {
+ case 0:
+ return detail::format_string("filesystem error: %s", derived_what);
+ case 1:
+ return detail::format_string("filesystem error: %s [" PATH_CSTR_FMT "]",
+ derived_what, path1().c_str());
+ case 2:
+ return detail::format_string("filesystem error: %s [" PATH_CSTR_FMT "] [" PATH_CSTR_FMT "]",
+ derived_what, path1().c_str(), path2().c_str());
+ }
+ __libcpp_unreachable();
+ }();
+}
+
+_LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/format_string.h b/contrib/libs/cxxsupp/libcxx/src/filesystem/format_string.h
new file mode 100644
index 00000000000..215d42421b2
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/format_string.h
@@ -0,0 +1,77 @@
+//===----------------------------------------------------------------------===////
+//
+// 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 FILESYSTEM_FORMAT_STRING_H
+#define FILESYSTEM_FORMAT_STRING_H
+
+#include <__assert>
+#include <__config>
+#include <array>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdio>
+#include <string>
+
+#if defined(_LIBCPP_WIN32API)
+# define PATHSTR(x) (L##x)
+# define PATH_CSTR_FMT "\"%ls\""
+#else
+# define PATHSTR(x) (x)
+# define PATH_CSTR_FMT "\"%s\""
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+
+namespace detail {
+
+inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 0) string vformat_string(const char* msg, va_list ap) {
+ array<char, 256> buf;
+
+ va_list apcopy;
+ va_copy(apcopy, ap);
+ int ret = ::vsnprintf(buf.data(), buf.size(), msg, apcopy);
+ va_end(apcopy);
+
+ string result;
+ if (static_cast<size_t>(ret) < buf.size()) {
+ result.assign(buf.data(), static_cast<size_t>(ret));
+ } else {
+ // we did not provide a long enough buffer on our first attempt. The
+ // return value is the number of bytes (excluding the null byte) that are
+ // needed for formatting.
+ size_t size_with_null = static_cast<size_t>(ret) + 1;
+ result.__resize_default_init(size_with_null - 1);
+ ret = ::vsnprintf(&result[0], size_with_null, msg, ap);
+ _LIBCPP_ASSERT_UNCATEGORIZED(static_cast<size_t>(ret) == (size_with_null - 1), "TODO");
+ }
+ return result;
+}
+
+inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2) string format_string(const char* msg, ...) {
+ string ret;
+ va_list ap;
+ va_start(ap, msg);
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ try {
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ ret = detail::vformat_string(msg, ap);
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ } catch (...) {
+ va_end(ap);
+ throw;
+ }
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ va_end(ap);
+ return ret;
+}
+
+} // end namespace detail
+
+_LIBCPP_END_NAMESPACE_FILESYSTEM
+
+#endif // FILESYSTEM_FORMAT_STRING_H
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp b/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp
index f9b74120e02..61f2cc572eb 100644
--- a/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include <__assert>
+#include <__config>
#include <__utility/unreachable.h>
#include <array>
#include <climits>
@@ -17,9 +18,11 @@
#include <type_traits>
#include <vector>
-#include "filesystem_common.h"
-
+#include "error.h"
+#include "file_descriptor.h"
+#include "path_parser.h"
#include "posix_compat.h"
+#include "time_utils.h"
#if defined(_LIBCPP_WIN32API)
# define WIN32_LEAN_AND_MEAN
@@ -45,599 +48,12 @@
# define _LIBCPP_FILESYSTEM_USE_FSTREAM
#endif
-#if !defined(CLOCK_REALTIME) && !defined(_LIBCPP_WIN32API)
-# include <sys/time.h> // for gettimeofday and timeval
-#endif
-
#if defined(__ELF__) && defined(_LIBCPP_LINK_RT_LIB)
# pragma comment(lib, "rt")
#endif
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-namespace {
-
-bool isSeparator(path::value_type C) {
- if (C == '/')
- return true;
-#if defined(_LIBCPP_WIN32API)
- if (C == '\\')
- return true;
-#endif
- return false;
-}
-
-bool isDriveLetter(path::value_type C) {
- return (C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z');
-}
-
-namespace parser {
-
-using string_view_t = path::__string_view;
-using string_view_pair = pair<string_view_t, string_view_t>;
-using PosPtr = path::value_type const*;
-
-struct PathParser {
- enum ParserState : unsigned char {
- // Zero is a special sentinel value used by default constructed iterators.
- PS_BeforeBegin = path::iterator::_BeforeBegin,
- PS_InRootName = path::iterator::_InRootName,
- PS_InRootDir = path::iterator::_InRootDir,
- PS_InFilenames = path::iterator::_InFilenames,
- PS_InTrailingSep = path::iterator::_InTrailingSep,
- PS_AtEnd = path::iterator::_AtEnd
- };
-
- const string_view_t Path;
- string_view_t RawEntry;
- ParserState State;
-
-private:
- PathParser(string_view_t P, ParserState State) noexcept : Path(P),
- State(State) {}
-
-public:
- PathParser(string_view_t P, string_view_t E, unsigned char S)
- : Path(P), RawEntry(E), State(static_cast<ParserState>(S)) {
- // S cannot be '0' or PS_BeforeBegin.
- }
-
- static PathParser CreateBegin(string_view_t P) noexcept {
- PathParser PP(P, PS_BeforeBegin);
- PP.increment();
- return PP;
- }
-
- static PathParser CreateEnd(string_view_t P) noexcept {
- PathParser PP(P, PS_AtEnd);
- return PP;
- }
-
- PosPtr peek() const noexcept {
- auto TkEnd = getNextTokenStartPos();
- auto End = getAfterBack();
- return TkEnd == End ? nullptr : TkEnd;
- }
-
- void increment() noexcept {
- const PosPtr End = getAfterBack();
- const PosPtr Start = getNextTokenStartPos();
- if (Start == End)
- return makeState(PS_AtEnd);
-
- switch (State) {
- case PS_BeforeBegin: {
- PosPtr TkEnd = consumeRootName(Start, End);
- if (TkEnd)
- return makeState(PS_InRootName, Start, TkEnd);
- }
- _LIBCPP_FALLTHROUGH();
- case PS_InRootName: {
- PosPtr TkEnd = consumeAllSeparators(Start, End);
- if (TkEnd)
- return makeState(PS_InRootDir, Start, TkEnd);
- else
- return makeState(PS_InFilenames, Start, consumeName(Start, End));
- }
- case PS_InRootDir:
- return makeState(PS_InFilenames, Start, consumeName(Start, End));
-
- case PS_InFilenames: {
- PosPtr SepEnd = consumeAllSeparators(Start, End);
- if (SepEnd != End) {
- PosPtr TkEnd = consumeName(SepEnd, End);
- if (TkEnd)
- return makeState(PS_InFilenames, SepEnd, TkEnd);
- }
- return makeState(PS_InTrailingSep, Start, SepEnd);
- }
-
- case PS_InTrailingSep:
- return makeState(PS_AtEnd);
-
- case PS_AtEnd:
- __libcpp_unreachable();
- }
- }
-
- void decrement() noexcept {
- const PosPtr REnd = getBeforeFront();
- const PosPtr RStart = getCurrentTokenStartPos() - 1;
- if (RStart == REnd) // we're decrementing the begin
- return makeState(PS_BeforeBegin);
-
- switch (State) {
- case PS_AtEnd: {
- // Try to consume a trailing separator or root directory first.
- if (PosPtr SepEnd = consumeAllSeparators(RStart, REnd)) {
- if (SepEnd == REnd)
- return makeState(PS_InRootDir, Path.data(), RStart + 1);
- PosPtr TkStart = consumeRootName(SepEnd, REnd);
- if (TkStart == REnd)
- return makeState(PS_InRootDir, RStart, RStart + 1);
- return makeState(PS_InTrailingSep, SepEnd + 1, RStart + 1);
- } else {
- PosPtr TkStart = consumeRootName(RStart, REnd);
- if (TkStart == REnd)
- return makeState(PS_InRootName, TkStart + 1, RStart + 1);
- TkStart = consumeName(RStart, REnd);
- return makeState(PS_InFilenames, TkStart + 1, RStart + 1);
- }
- }
- case PS_InTrailingSep:
- return makeState(PS_InFilenames, consumeName(RStart, REnd) + 1,
- RStart + 1);
- case PS_InFilenames: {
- PosPtr SepEnd = consumeAllSeparators(RStart, REnd);
- if (SepEnd == REnd)
- return makeState(PS_InRootDir, Path.data(), RStart + 1);
- PosPtr TkStart = consumeRootName(SepEnd ? SepEnd : RStart, REnd);
- if (TkStart == REnd) {
- if (SepEnd)
- return makeState(PS_InRootDir, SepEnd + 1, RStart + 1);
- return makeState(PS_InRootName, TkStart + 1, RStart + 1);
- }
- TkStart = consumeName(SepEnd, REnd);
- return makeState(PS_InFilenames, TkStart + 1, SepEnd + 1);
- }
- case PS_InRootDir:
- return makeState(PS_InRootName, Path.data(), RStart + 1);
- case PS_InRootName:
- case PS_BeforeBegin:
- __libcpp_unreachable();
- }
- }
-
- /// \brief Return a view with the "preferred representation" of the current
- /// element. For example trailing separators are represented as a '.'
- string_view_t operator*() const noexcept {
- switch (State) {
- case PS_BeforeBegin:
- case PS_AtEnd:
- return PATHSTR("");
- case PS_InRootDir:
- if (RawEntry[0] == '\\')
- return PATHSTR("\\");
- else
- return PATHSTR("/");
- case PS_InTrailingSep:
- return PATHSTR("");
- case PS_InRootName:
- case PS_InFilenames:
- return RawEntry;
- }
- __libcpp_unreachable();
- }
-
- explicit operator bool() const noexcept {
- return State != PS_BeforeBegin && State != PS_AtEnd;
- }
-
- PathParser& operator++() noexcept {
- increment();
- return *this;
- }
-
- PathParser& operator--() noexcept {
- decrement();
- return *this;
- }
-
- bool atEnd() const noexcept {
- return State == PS_AtEnd;
- }
-
- bool inRootDir() const noexcept {
- return State == PS_InRootDir;
- }
-
- bool inRootName() const noexcept {
- return State == PS_InRootName;
- }
-
- bool inRootPath() const noexcept {
- return inRootName() || inRootDir();
- }
-
-private:
- void makeState(ParserState NewState, PosPtr Start, PosPtr End) noexcept {
- State = NewState;
- RawEntry = string_view_t(Start, End - Start);
- }
- void makeState(ParserState NewState) noexcept {
- State = NewState;
- RawEntry = {};
- }
-
- PosPtr getAfterBack() const noexcept { return Path.data() + Path.size(); }
-
- PosPtr getBeforeFront() const noexcept { return Path.data() - 1; }
-
- /// \brief Return a pointer to the first character after the currently
- /// lexed element.
- PosPtr getNextTokenStartPos() const noexcept {
- switch (State) {
- case PS_BeforeBegin:
- return Path.data();
- case PS_InRootName:
- case PS_InRootDir:
- case PS_InFilenames:
- return &RawEntry.back() + 1;
- case PS_InTrailingSep:
- case PS_AtEnd:
- return getAfterBack();
- }
- __libcpp_unreachable();
- }
-
- /// \brief Return a pointer to the first character in the currently lexed
- /// element.
- PosPtr getCurrentTokenStartPos() const noexcept {
- switch (State) {
- case PS_BeforeBegin:
- case PS_InRootName:
- return &Path.front();
- case PS_InRootDir:
- case PS_InFilenames:
- case PS_InTrailingSep:
- return &RawEntry.front();
- case PS_AtEnd:
- return &Path.back() + 1;
- }
- __libcpp_unreachable();
- }
-
- // Consume all consecutive separators.
- PosPtr consumeAllSeparators(PosPtr P, PosPtr End) const noexcept {
- if (P == nullptr || P == End || !isSeparator(*P))
- return nullptr;
- const int Inc = P < End ? 1 : -1;
- P += Inc;
- while (P != End && isSeparator(*P))
- P += Inc;
- return P;
- }
-
- // Consume exactly N separators, or return nullptr.
- PosPtr consumeNSeparators(PosPtr P, PosPtr End, int N) const noexcept {
- PosPtr Ret = consumeAllSeparators(P, End);
- if (Ret == nullptr)
- return nullptr;
- if (P < End) {
- if (Ret == P + N)
- return Ret;
- } else {
- if (Ret == P - N)
- return Ret;
- }
- return nullptr;
- }
-
- PosPtr consumeName(PosPtr P, PosPtr End) const noexcept {
- PosPtr Start = P;
- if (P == nullptr || P == End || isSeparator(*P))
- return nullptr;
- const int Inc = P < End ? 1 : -1;
- P += Inc;
- while (P != End && !isSeparator(*P))
- P += Inc;
- if (P == End && Inc < 0) {
- // Iterating backwards and consumed all the rest of the input.
- // Check if the start of the string would have been considered
- // a root name.
- PosPtr RootEnd = consumeRootName(End + 1, Start);
- if (RootEnd)
- return RootEnd - 1;
- }
- return P;
- }
-
- PosPtr consumeDriveLetter(PosPtr P, PosPtr End) const noexcept {
- if (P == End)
- return nullptr;
- if (P < End) {
- if (P + 1 == End || !isDriveLetter(P[0]) || P[1] != ':')
- return nullptr;
- return P + 2;
- } else {
- if (P - 1 == End || !isDriveLetter(P[-1]) || P[0] != ':')
- return nullptr;
- return P - 2;
- }
- }
-
- PosPtr consumeNetworkRoot(PosPtr P, PosPtr End) const noexcept {
- if (P == End)
- return nullptr;
- if (P < End)
- return consumeName(consumeNSeparators(P, End, 2), End);
- else
- return consumeNSeparators(consumeName(P, End), End, 2);
- }
-
-#if defined(_LIBCPP_WIN32API)
- PosPtr consumeRootName(PosPtr P, PosPtr End) const noexcept {
- if (PosPtr Ret = consumeDriveLetter(P, End))
- return Ret;
- if (PosPtr Ret = consumeNetworkRoot(P, End))
- return Ret;
- return nullptr;
- }
-#else
- PosPtr consumeRootName(PosPtr /*P*/, PosPtr /*End*/) const noexcept {
- return nullptr;
- }
-#endif
-};
-
-string_view_pair separate_filename(string_view_t const& s) {
- if (s == PATHSTR(".") || s == PATHSTR("..") || s.empty())
- return string_view_pair{s, PATHSTR("")};
- auto pos = s.find_last_of('.');
- if (pos == string_view_t::npos || pos == 0)
- return string_view_pair{s, string_view_t{}};
- return string_view_pair{s.substr(0, pos), s.substr(pos)};
-}
-
-string_view_t createView(PosPtr S, PosPtr E) noexcept {
- return {S, static_cast<size_t>(E - S) + 1};
-}
-
-} // namespace parser
-} // namespace
-
-// POSIX HELPERS
-
-#if defined(_LIBCPP_WIN32API)
-namespace detail {
-
-errc __win_err_to_errc(int err) {
- constexpr struct {
- DWORD win;
- errc errc;
- } win_error_mapping[] = {
- {ERROR_ACCESS_DENIED, errc::permission_denied},
- {ERROR_ALREADY_EXISTS, errc::file_exists},
- {ERROR_BAD_NETPATH, errc::no_such_file_or_directory},
- {ERROR_BAD_PATHNAME, errc::no_such_file_or_directory},
- {ERROR_BAD_UNIT, errc::no_such_device},
- {ERROR_BROKEN_PIPE, errc::broken_pipe},
- {ERROR_BUFFER_OVERFLOW, errc::filename_too_long},
- {ERROR_BUSY, errc::device_or_resource_busy},
- {ERROR_BUSY_DRIVE, errc::device_or_resource_busy},
- {ERROR_CANNOT_MAKE, errc::permission_denied},
- {ERROR_CANTOPEN, errc::io_error},
- {ERROR_CANTREAD, errc::io_error},
- {ERROR_CANTWRITE, errc::io_error},
- {ERROR_CURRENT_DIRECTORY, errc::permission_denied},
- {ERROR_DEV_NOT_EXIST, errc::no_such_device},
- {ERROR_DEVICE_IN_USE, errc::device_or_resource_busy},
- {ERROR_DIR_NOT_EMPTY, errc::directory_not_empty},
- {ERROR_DIRECTORY, errc::invalid_argument},
- {ERROR_DISK_FULL, errc::no_space_on_device},
- {ERROR_FILE_EXISTS, errc::file_exists},
- {ERROR_FILE_NOT_FOUND, errc::no_such_file_or_directory},
- {ERROR_HANDLE_DISK_FULL, errc::no_space_on_device},
- {ERROR_INVALID_ACCESS, errc::permission_denied},
- {ERROR_INVALID_DRIVE, errc::no_such_device},
- {ERROR_INVALID_FUNCTION, errc::function_not_supported},
- {ERROR_INVALID_HANDLE, errc::invalid_argument},
- {ERROR_INVALID_NAME, errc::no_such_file_or_directory},
- {ERROR_INVALID_PARAMETER, errc::invalid_argument},
- {ERROR_LOCK_VIOLATION, errc::no_lock_available},
- {ERROR_LOCKED, errc::no_lock_available},
- {ERROR_NEGATIVE_SEEK, errc::invalid_argument},
- {ERROR_NOACCESS, errc::permission_denied},
- {ERROR_NOT_ENOUGH_MEMORY, errc::not_enough_memory},
- {ERROR_NOT_READY, errc::resource_unavailable_try_again},
- {ERROR_NOT_SAME_DEVICE, errc::cross_device_link},
- {ERROR_NOT_SUPPORTED, errc::not_supported},
- {ERROR_OPEN_FAILED, errc::io_error},
- {ERROR_OPEN_FILES, errc::device_or_resource_busy},
- {ERROR_OPERATION_ABORTED, errc::operation_canceled},
- {ERROR_OUTOFMEMORY, errc::not_enough_memory},
- {ERROR_PATH_NOT_FOUND, errc::no_such_file_or_directory},
- {ERROR_READ_FAULT, errc::io_error},
- {ERROR_REPARSE_TAG_INVALID, errc::invalid_argument},
- {ERROR_RETRY, errc::resource_unavailable_try_again},
- {ERROR_SEEK, errc::io_error},
- {ERROR_SHARING_VIOLATION, errc::permission_denied},
- {ERROR_TOO_MANY_OPEN_FILES, errc::too_many_files_open},
- {ERROR_WRITE_FAULT, errc::io_error},
- {ERROR_WRITE_PROTECT, errc::permission_denied},
- };
-
- for (const auto &pair : win_error_mapping)
- if (pair.win == static_cast<DWORD>(err))
- return pair.errc;
- return errc::invalid_argument;
-}
-
-} // namespace detail
-#endif
-
-namespace detail {
-namespace {
-
-using value_type = path::value_type;
-using string_type = path::string_type;
-
-struct FileDescriptor {
- const path& name;
- int fd = -1;
- StatT m_stat;
- file_status m_status;
-
- template <class... Args>
- static FileDescriptor create(const path* p, error_code& ec, Args... args) {
- ec.clear();
- int fd;
- if ((fd = detail::open(p->c_str(), args...)) == -1) {
- ec = capture_errno();
- return FileDescriptor{p};
- }
- return FileDescriptor(p, fd);
- }
-
- template <class... Args>
- static FileDescriptor create_with_status(const path* p, error_code& ec,
- Args... args) {
- FileDescriptor fd = create(p, ec, args...);
- if (!ec)
- fd.refresh_status(ec);
-
- return fd;
- }
-
- file_status get_status() const { return m_status; }
- StatT const& get_stat() const { return m_stat; }
-
- bool status_known() const { return _VSTD_FS::status_known(m_status); }
-
- file_status refresh_status(error_code& ec);
-
- void close() noexcept {
- if (fd != -1)
- detail::close(fd);
- fd = -1;
- }
-
- FileDescriptor(FileDescriptor&& other)
- : name(other.name), fd(other.fd), m_stat(other.m_stat),
- m_status(other.m_status) {
- other.fd = -1;
- other.m_status = file_status{};
- }
-
- ~FileDescriptor() { close(); }
-
- FileDescriptor(FileDescriptor const&) = delete;
- FileDescriptor& operator=(FileDescriptor const&) = delete;
-
-private:
- explicit FileDescriptor(const path* p, int fd = -1) : name(*p), fd(fd) {}
-};
-
-perms posix_get_perms(const StatT& st) noexcept {
- return static_cast<perms>(st.st_mode) & perms::mask;
-}
-
-file_status create_file_status(error_code& m_ec, path const& p,
- const StatT& path_stat, error_code* ec) {
- if (ec)
- *ec = m_ec;
- if (m_ec && (m_ec.value() == ENOENT || m_ec.value() == ENOTDIR)) {
- return file_status(file_type::not_found);
- } else if (m_ec) {
- ErrorHandler<void> err("posix_stat", ec, &p);
- err.report(m_ec, "failed to determine attributes for the specified path");
- return file_status(file_type::none);
- }
- // else
-
- file_status fs_tmp;
- auto const mode = path_stat.st_mode;
- if (S_ISLNK(mode))
- fs_tmp.type(file_type::symlink);
- else if (S_ISREG(mode))
- fs_tmp.type(file_type::regular);
- else if (S_ISDIR(mode))
- fs_tmp.type(file_type::directory);
- else if (S_ISBLK(mode))
- fs_tmp.type(file_type::block);
- else if (S_ISCHR(mode))
- fs_tmp.type(file_type::character);
- else if (S_ISFIFO(mode))
- fs_tmp.type(file_type::fifo);
- else if (S_ISSOCK(mode))
- fs_tmp.type(file_type::socket);
- else
- fs_tmp.type(file_type::unknown);
-
- fs_tmp.permissions(detail::posix_get_perms(path_stat));
- return fs_tmp;
-}
-
-file_status posix_stat(path const& p, StatT& path_stat, error_code* ec) {
- error_code m_ec;
- if (detail::stat(p.c_str(), &path_stat) == -1)
- m_ec = detail::capture_errno();
- return create_file_status(m_ec, p, path_stat, ec);
-}
-
-file_status posix_stat(path const& p, error_code* ec) {
- StatT path_stat;
- return posix_stat(p, path_stat, ec);
-}
-
-file_status posix_lstat(path const& p, StatT& path_stat, error_code* ec) {
- error_code m_ec;
- if (detail::lstat(p.c_str(), &path_stat) == -1)
- m_ec = detail::capture_errno();
- return create_file_status(m_ec, p, path_stat, ec);
-}
-
-file_status posix_lstat(path const& p, error_code* ec) {
- StatT path_stat;
- return posix_lstat(p, path_stat, ec);
-}
-
-// http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html
-bool posix_ftruncate(const FileDescriptor& fd, off_t to_size, error_code& ec) {
- if (detail::ftruncate(fd.fd, to_size) == -1) {
- ec = capture_errno();
- return true;
- }
- ec.clear();
- return false;
-}
-
-bool posix_fchmod(const FileDescriptor& fd, const StatT& st, error_code& ec) {
- if (detail::fchmod(fd.fd, st.st_mode) == -1) {
- ec = capture_errno();
- return true;
- }
- ec.clear();
- return false;
-}
-
-bool stat_equivalent(const StatT& st1, const StatT& st2) {
- return (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino);
-}
-
-file_status FileDescriptor::refresh_status(error_code& ec) {
- // FD must be open and good.
- m_status = file_status{};
- m_stat = {};
- error_code m_ec;
- if (detail::fstat(fd, &m_stat) == -1)
- m_ec = capture_errno();
- m_status = create_file_status(m_ec, name, m_stat, &ec);
- return m_status;
-}
-} // namespace
-} // end namespace detail
-
using detail::capture_errno;
using detail::ErrorHandler;
using detail::StatT;
@@ -646,51 +62,6 @@ using parser::createView;
using parser::PathParser;
using parser::string_view_t;
-const bool _FilesystemClock::is_steady;
-
-_FilesystemClock::time_point _FilesystemClock::now() noexcept {
- typedef chrono::duration<rep> __secs;
-#if defined(_LIBCPP_WIN32API)
- typedef chrono::duration<rep, nano> __nsecs;
- FILETIME time;
- GetSystemTimeAsFileTime(&time);
- TimeSpec tp = detail::filetime_to_timespec(time);
- return time_point(__secs(tp.tv_sec) +
- chrono::duration_cast<duration>(__nsecs(tp.tv_nsec)));
-#elif defined(CLOCK_REALTIME)
- typedef chrono::duration<rep, nano> __nsecs;
- struct timespec tp;
- if (0 != clock_gettime(CLOCK_REALTIME, &tp))
- __throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed");
- return time_point(__secs(tp.tv_sec) +
- chrono::duration_cast<duration>(__nsecs(tp.tv_nsec)));
-#else
- typedef chrono::duration<rep, micro> __microsecs;
- timeval tv;
- gettimeofday(&tv, 0);
- return time_point(__secs(tv.tv_sec) + __microsecs(tv.tv_usec));
-#endif // CLOCK_REALTIME
-}
-
-filesystem_error::~filesystem_error() {}
-
-void filesystem_error::__create_what(int __num_paths) {
- const char* derived_what = system_error::what();
- __storage_->__what_ = [&]() -> string {
- switch (__num_paths) {
- case 0:
- return detail::format_string("filesystem error: %s", derived_what);
- case 1:
- return detail::format_string("filesystem error: %s [" PATH_CSTR_FMT "]",
- derived_what, path1().c_str());
- case 2:
- return detail::format_string("filesystem error: %s [" PATH_CSTR_FMT "] [" PATH_CSTR_FMT "]",
- derived_what, path1().c_str(), path2().c_str());
- }
- __libcpp_unreachable();
- }();
-}
-
static path __do_absolute(const path& p, path* cwd, error_code* ec) {
if (ec)
ec->clear();
@@ -979,7 +350,7 @@ bool __copy_file(const path& from, const path& to, copy_options options,
return err.report(m_ec);
}
- if (!copy_file_impl(from_fd, to_fd, m_ec)) {
+ if (!detail::copy_file_impl(from_fd, to_fd, m_ec)) {
// FIXME: Remove the dest file if we failed, and it didn't exist previously.
return err.report(m_ec);
}
@@ -1108,7 +479,7 @@ path __current_path(error_code* ec) {
Deleter deleter = &::free;
#else
auto size = ::pathconf(".", _PC_PATH_MAX);
- _LIBCPP_ASSERT(size >= 0, "pathconf returned a 0 as max size");
+ _LIBCPP_ASSERT_UNCATEGORIZED(size >= 0, "pathconf returned a 0 as max size");
auto buff = unique_ptr<path::value_type[]>(new path::value_type[size + 1]);
path::value_type* ptr = buff.get();
@@ -1197,18 +568,6 @@ bool __fs_is_empty(const path& p, error_code* ec) {
__libcpp_unreachable();
}
-static file_time_type __extract_last_write_time(const path& p, const StatT& st,
- error_code* ec) {
- using detail::fs_time;
- ErrorHandler<file_time_type> err("last_write_time", ec, &p);
-
- auto ts = detail::extract_mtime(st);
- if (!fs_time::is_representable(ts))
- return err.report(errc::value_too_large);
-
- return fs_time::convert_from_timespec(ts);
-}
-
file_time_type __last_write_time(const path& p, error_code* ec) {
using namespace chrono;
ErrorHandler<file_time_type> err("last_write_time", ec, &p);
@@ -1218,7 +577,7 @@ file_time_type __last_write_time(const path& p, error_code* ec) {
detail::posix_stat(p, st, &m_ec);
if (m_ec)
return err.report(m_ec);
- return __extract_last_write_time(p, st, ec);
+ return detail::__extract_last_write_time(p, st, ec);
}
void __last_write_time(const path& p, file_time_type new_time, error_code* ec) {
@@ -1268,7 +627,7 @@ void __permissions(const path& p, perms prms, perm_options opts,
const bool resolve_symlinks = !has_opt(perm_options::nofollow);
const bool add_perms = has_opt(perm_options::add);
const bool remove_perms = has_opt(perm_options::remove);
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
(add_perms + remove_perms + has_opt(perm_options::replace)) == 1,
"One and only one of the perm_options constants replace, add, or remove "
"is present in opts");
@@ -1282,7 +641,7 @@ void __permissions(const path& p, perms prms, perm_options opts,
set_sym_perms = is_symlink(st);
if (m_ec)
return err.report(m_ec);
- _LIBCPP_ASSERT(st.permissions() != perms::unknown,
+ _LIBCPP_ASSERT_UNCATEGORIZED(st.permissions() != perms::unknown,
"Permissions unexpectedly unknown");
if (add_perms)
prms |= st.permissions();
@@ -1328,7 +687,7 @@ path __read_symlink(const path& p, error_code* ec) {
detail::SSizeT ret;
if ((ret = detail::readlink(p.c_str(), buff.get(), size)) == -1)
return err.report(capture_errno());
- _LIBCPP_ASSERT(ret > 0, "TODO");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ret > 0, "TODO");
if (static_cast<size_t>(ret) >= size)
return err.report(errc::value_too_large);
buff[ret] = 0;
@@ -1554,8 +913,13 @@ path __temp_directory_path(error_code* ec) {
for (auto& ep : env_paths)
if ((ret = getenv(ep)))
break;
- if (ret == nullptr)
+ if (ret == nullptr) {
+#if defined(__ANDROID__)
+ ret = "/data/local/tmp";
+#else
ret = "/tmp";
+#endif
+ }
path p(ret);
#endif
@@ -1608,500 +972,4 @@ path __weakly_canonical(const path& p, error_code* ec) {
return result.lexically_normal();
}
-///////////////////////////////////////////////////////////////////////////////
-// path definitions
-///////////////////////////////////////////////////////////////////////////////
-
-constexpr path::value_type path::preferred_separator;
-
-path& path::replace_extension(path const& replacement) {
- path p = extension();
- if (not p.empty()) {
- __pn_.erase(__pn_.size() - p.native().size());
- }
- if (!replacement.empty()) {
- if (replacement.native()[0] != '.') {
- __pn_ += PATHSTR(".");
- }
- __pn_.append(replacement.__pn_);
- }
- return *this;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// path.decompose
-
-string_view_t path::__root_name() const {
- auto PP = PathParser::CreateBegin(__pn_);
- if (PP.State == PathParser::PS_InRootName)
- return *PP;
- return {};
-}
-
-string_view_t path::__root_directory() const {
- auto PP = PathParser::CreateBegin(__pn_);
- if (PP.State == PathParser::PS_InRootName)
- ++PP;
- if (PP.State == PathParser::PS_InRootDir)
- return *PP;
- return {};
-}
-
-string_view_t path::__root_path_raw() const {
- auto PP = PathParser::CreateBegin(__pn_);
- if (PP.State == PathParser::PS_InRootName) {
- auto NextCh = PP.peek();
- if (NextCh && isSeparator(*NextCh)) {
- ++PP;
- return createView(__pn_.data(), &PP.RawEntry.back());
- }
- return PP.RawEntry;
- }
- if (PP.State == PathParser::PS_InRootDir)
- return *PP;
- return {};
-}
-
-static bool ConsumeRootName(PathParser *PP) {
- static_assert(PathParser::PS_BeforeBegin == 1 &&
- PathParser::PS_InRootName == 2,
- "Values for enums are incorrect");
- while (PP->State <= PathParser::PS_InRootName)
- ++(*PP);
- return PP->State == PathParser::PS_AtEnd;
-}
-
-static bool ConsumeRootDir(PathParser* PP) {
- static_assert(PathParser::PS_BeforeBegin == 1 &&
- PathParser::PS_InRootName == 2 &&
- PathParser::PS_InRootDir == 3, "Values for enums are incorrect");
- while (PP->State <= PathParser::PS_InRootDir)
- ++(*PP);
- return PP->State == PathParser::PS_AtEnd;
-}
-
-string_view_t path::__relative_path() const {
- auto PP = PathParser::CreateBegin(__pn_);
- if (ConsumeRootDir(&PP))
- return {};
- return createView(PP.RawEntry.data(), &__pn_.back());
-}
-
-string_view_t path::__parent_path() const {
- if (empty())
- return {};
- // Determine if we have a root path but not a relative path. In that case
- // return *this.
- {
- auto PP = PathParser::CreateBegin(__pn_);
- if (ConsumeRootDir(&PP))
- return __pn_;
- }
- // Otherwise remove a single element from the end of the path, and return
- // a string representing that path
- {
- auto PP = PathParser::CreateEnd(__pn_);
- --PP;
- if (PP.RawEntry.data() == __pn_.data())
- return {};
- --PP;
- return createView(__pn_.data(), &PP.RawEntry.back());
- }
-}
-
-string_view_t path::__filename() const {
- if (empty())
- return {};
- {
- PathParser PP = PathParser::CreateBegin(__pn_);
- if (ConsumeRootDir(&PP))
- return {};
- }
- return *(--PathParser::CreateEnd(__pn_));
-}
-
-string_view_t path::__stem() const {
- return parser::separate_filename(__filename()).first;
-}
-
-string_view_t path::__extension() const {
- return parser::separate_filename(__filename()).second;
-}
-
-////////////////////////////////////////////////////////////////////////////
-// path.gen
-
-enum PathPartKind : unsigned char {
- PK_None,
- PK_RootSep,
- PK_Filename,
- PK_Dot,
- PK_DotDot,
- PK_TrailingSep
-};
-
-static PathPartKind ClassifyPathPart(string_view_t Part) {
- if (Part.empty())
- return PK_TrailingSep;
- if (Part == PATHSTR("."))
- return PK_Dot;
- if (Part == PATHSTR(".."))
- return PK_DotDot;
- if (Part == PATHSTR("/"))
- return PK_RootSep;
-#if defined(_LIBCPP_WIN32API)
- if (Part == PATHSTR("\\"))
- return PK_RootSep;
-#endif
- return PK_Filename;
-}
-
-path path::lexically_normal() const {
- if (__pn_.empty())
- return *this;
-
- using PartKindPair = pair<string_view_t, PathPartKind>;
- vector<PartKindPair> Parts;
- // Guess as to how many elements the path has to avoid reallocating.
- Parts.reserve(32);
-
- // Track the total size of the parts as we collect them. This allows the
- // resulting path to reserve the correct amount of memory.
- size_t NewPathSize = 0;
- auto AddPart = [&](PathPartKind K, string_view_t P) {
- NewPathSize += P.size();
- Parts.emplace_back(P, K);
- };
- auto LastPartKind = [&]() {
- if (Parts.empty())
- return PK_None;
- return Parts.back().second;
- };
-
- bool MaybeNeedTrailingSep = false;
- // Build a stack containing the remaining elements of the path, popping off
- // elements which occur before a '..' entry.
- for (auto PP = PathParser::CreateBegin(__pn_); PP; ++PP) {
- auto Part = *PP;
- PathPartKind Kind = ClassifyPathPart(Part);
- switch (Kind) {
- case PK_Filename:
- case PK_RootSep: {
- // Add all non-dot and non-dot-dot elements to the stack of elements.
- AddPart(Kind, Part);
- MaybeNeedTrailingSep = false;
- break;
- }
- case PK_DotDot: {
- // Only push a ".." element if there are no elements preceding the "..",
- // or if the preceding element is itself "..".
- auto LastKind = LastPartKind();
- if (LastKind == PK_Filename) {
- NewPathSize -= Parts.back().first.size();
- Parts.pop_back();
- } else if (LastKind != PK_RootSep)
- AddPart(PK_DotDot, PATHSTR(".."));
- MaybeNeedTrailingSep = LastKind == PK_Filename;
- break;
- }
- case PK_Dot:
- case PK_TrailingSep: {
- MaybeNeedTrailingSep = true;
- break;
- }
- case PK_None:
- __libcpp_unreachable();
- }
- }
- // [fs.path.generic]p6.8: If the path is empty, add a dot.
- if (Parts.empty())
- return PATHSTR(".");
-
- // [fs.path.generic]p6.7: If the last filename is dot-dot, remove any
- // trailing directory-separator.
- bool NeedTrailingSep = MaybeNeedTrailingSep && LastPartKind() == PK_Filename;
-
- path Result;
- Result.__pn_.reserve(Parts.size() + NewPathSize + NeedTrailingSep);
- for (auto& PK : Parts)
- Result /= PK.first;
-
- if (NeedTrailingSep)
- Result /= PATHSTR("");
-
- Result.make_preferred();
- return Result;
-}
-
-static int DetermineLexicalElementCount(PathParser PP) {
- int Count = 0;
- for (; PP; ++PP) {
- auto Elem = *PP;
- if (Elem == PATHSTR(".."))
- --Count;
- else if (Elem != PATHSTR(".") && Elem != PATHSTR(""))
- ++Count;
- }
- return Count;
-}
-
-path path::lexically_relative(const path& base) const {
- { // perform root-name/root-directory mismatch checks
- auto PP = PathParser::CreateBegin(__pn_);
- auto PPBase = PathParser::CreateBegin(base.__pn_);
- auto CheckIterMismatchAtBase = [&]() {
- return PP.State != PPBase.State &&
- (PP.inRootPath() || PPBase.inRootPath());
- };
- if (PP.inRootName() && PPBase.inRootName()) {
- if (*PP != *PPBase)
- return {};
- } else if (CheckIterMismatchAtBase())
- return {};
-
- if (PP.inRootPath())
- ++PP;
- if (PPBase.inRootPath())
- ++PPBase;
- if (CheckIterMismatchAtBase())
- return {};
- }
-
- // Find the first mismatching element
- auto PP = PathParser::CreateBegin(__pn_);
- auto PPBase = PathParser::CreateBegin(base.__pn_);
- while (PP && PPBase && PP.State == PPBase.State && *PP == *PPBase) {
- ++PP;
- ++PPBase;
- }
-
- // If there is no mismatch, return ".".
- if (!PP && !PPBase)
- return ".";
-
- // Otherwise, determine the number of elements, 'n', which are not dot or
- // dot-dot minus the number of dot-dot elements.
- int ElemCount = DetermineLexicalElementCount(PPBase);
- if (ElemCount < 0)
- return {};
-
- // if n == 0 and (a == end() || a->empty()), returns path("."); otherwise
- if (ElemCount == 0 && (PP.atEnd() || *PP == PATHSTR("")))
- return PATHSTR(".");
-
- // return a path constructed with 'n' dot-dot elements, followed by the
- // elements of '*this' after the mismatch.
- path Result;
- // FIXME: Reserve enough room in Result that it won't have to re-allocate.
- while (ElemCount--)
- Result /= PATHSTR("..");
- for (; PP; ++PP)
- Result /= *PP;
- return Result;
-}
-
-////////////////////////////////////////////////////////////////////////////
-// path.comparisons
-static int CompareRootName(PathParser *LHS, PathParser *RHS) {
- if (!LHS->inRootName() && !RHS->inRootName())
- return 0;
-
- auto GetRootName = [](PathParser *Parser) -> string_view_t {
- return Parser->inRootName() ? **Parser : PATHSTR("");
- };
- int res = GetRootName(LHS).compare(GetRootName(RHS));
- ConsumeRootName(LHS);
- ConsumeRootName(RHS);
- return res;
-}
-
-static int CompareRootDir(PathParser *LHS, PathParser *RHS) {
- if (!LHS->inRootDir() && RHS->inRootDir())
- return -1;
- else if (LHS->inRootDir() && !RHS->inRootDir())
- return 1;
- else {
- ConsumeRootDir(LHS);
- ConsumeRootDir(RHS);
- return 0;
- }
-}
-
-static int CompareRelative(PathParser *LHSPtr, PathParser *RHSPtr) {
- auto &LHS = *LHSPtr;
- auto &RHS = *RHSPtr;
-
- int res;
- while (LHS && RHS) {
- if ((res = (*LHS).compare(*RHS)) != 0)
- return res;
- ++LHS;
- ++RHS;
- }
- return 0;
-}
-
-static int CompareEndState(PathParser *LHS, PathParser *RHS) {
- if (LHS->atEnd() && !RHS->atEnd())
- return -1;
- else if (!LHS->atEnd() && RHS->atEnd())
- return 1;
- return 0;
-}
-
-int path::__compare(string_view_t __s) const {
- auto LHS = PathParser::CreateBegin(__pn_);
- auto RHS = PathParser::CreateBegin(__s);
- int res;
-
- if ((res = CompareRootName(&LHS, &RHS)) != 0)
- return res;
-
- if ((res = CompareRootDir(&LHS, &RHS)) != 0)
- return res;
-
- if ((res = CompareRelative(&LHS, &RHS)) != 0)
- return res;
-
- return CompareEndState(&LHS, &RHS);
-}
-
-////////////////////////////////////////////////////////////////////////////
-// path.nonmembers
-size_t hash_value(const path& __p) noexcept {
- auto PP = PathParser::CreateBegin(__p.native());
- size_t hash_value = 0;
- hash<string_view_t> hasher;
- while (PP) {
- hash_value = __hash_combine(hash_value, hasher(*PP));
- ++PP;
- }
- return hash_value;
-}
-
-////////////////////////////////////////////////////////////////////////////
-// path.itr
-path::iterator path::begin() const {
- auto PP = PathParser::CreateBegin(__pn_);
- iterator it;
- it.__path_ptr_ = this;
- it.__state_ = static_cast<path::iterator::_ParserState>(PP.State);
- it.__entry_ = PP.RawEntry;
- it.__stashed_elem_.__assign_view(*PP);
- return it;
-}
-
-path::iterator path::end() const {
- iterator it{};
- it.__state_ = path::iterator::_AtEnd;
- it.__path_ptr_ = this;
- return it;
-}
-
-path::iterator& path::iterator::__increment() {
- PathParser PP(__path_ptr_->native(), __entry_, __state_);
- ++PP;
- __state_ = static_cast<_ParserState>(PP.State);
- __entry_ = PP.RawEntry;
- __stashed_elem_.__assign_view(*PP);
- return *this;
-}
-
-path::iterator& path::iterator::__decrement() {
- PathParser PP(__path_ptr_->native(), __entry_, __state_);
- --PP;
- __state_ = static_cast<_ParserState>(PP.State);
- __entry_ = PP.RawEntry;
- __stashed_elem_.__assign_view(*PP);
- return *this;
-}
-
-#if defined(_LIBCPP_WIN32API)
-////////////////////////////////////////////////////////////////////////////
-// Windows path conversions
-size_t __wide_to_char(const wstring &str, char *out, size_t outlen) {
- if (str.empty())
- return 0;
- ErrorHandler<size_t> err("__wide_to_char", nullptr);
- UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
- BOOL used_default = FALSE;
- int ret = WideCharToMultiByte(codepage, 0, str.data(), str.size(), out,
- outlen, nullptr, &used_default);
- if (ret <= 0 || used_default)
- return err.report(errc::illegal_byte_sequence);
- return ret;
-}
-
-size_t __char_to_wide(const string &str, wchar_t *out, size_t outlen) {
- if (str.empty())
- return 0;
- ErrorHandler<size_t> err("__char_to_wide", nullptr);
- UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
- int ret = MultiByteToWideChar(codepage, MB_ERR_INVALID_CHARS, str.data(),
- str.size(), out, outlen);
- if (ret <= 0)
- return err.report(errc::illegal_byte_sequence);
- return ret;
-}
-#endif
-
-
-///////////////////////////////////////////////////////////////////////////////
-// directory entry definitions
-///////////////////////////////////////////////////////////////////////////////
-
-error_code directory_entry::__do_refresh() noexcept {
- __data_.__reset();
- error_code failure_ec;
-
- StatT full_st;
- file_status st = detail::posix_lstat(__p_, full_st, &failure_ec);
- if (!status_known(st)) {
- __data_.__reset();
- return failure_ec;
- }
-
- if (!_VSTD_FS::exists(st) || !_VSTD_FS::is_symlink(st)) {
- __data_.__cache_type_ = directory_entry::_RefreshNonSymlink;
- __data_.__type_ = st.type();
- __data_.__non_sym_perms_ = st.permissions();
- } else { // we have a symlink
- __data_.__sym_perms_ = st.permissions();
- // Get the information about the linked entity.
- // Ignore errors from stat, since we don't want errors regarding symlink
- // resolution to be reported to the user.
- error_code ignored_ec;
- st = detail::posix_stat(__p_, full_st, &ignored_ec);
-
- __data_.__type_ = st.type();
- __data_.__non_sym_perms_ = st.permissions();
-
- // If we failed to resolve the link, then only partially populate the
- // cache.
- if (!status_known(st)) {
- __data_.__cache_type_ = directory_entry::_RefreshSymlinkUnresolved;
- return error_code{};
- }
- // Otherwise, we resolved the link, potentially as not existing.
- // That's OK.
- __data_.__cache_type_ = directory_entry::_RefreshSymlink;
- }
-
- if (_VSTD_FS::is_regular_file(st))
- __data_.__size_ = static_cast<uintmax_t>(full_st.st_size);
-
- if (_VSTD_FS::exists(st)) {
- __data_.__nlink_ = static_cast<uintmax_t>(full_st.st_nlink);
-
- // Attempt to extract the mtime, and fail if it's not representable using
- // file_time_type. For now we ignore the error, as we'll report it when
- // the value is actually used.
- error_code ignored_ec;
- __data_.__write_time_ =
- __extract_last_write_time(__p_, full_st, &ignored_ec);
- }
-
- return failure_ec;
-}
-
_LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/path.cpp b/contrib/libs/cxxsupp/libcxx/src/filesystem/path.cpp
new file mode 100644
index 00000000000..82f1ba7ba69
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/path.cpp
@@ -0,0 +1,460 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <__config>
+#include <filesystem>
+#include <vector>
+
+#include "error.h"
+#include "path_parser.h"
+
+_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+
+using detail::ErrorHandler;
+using parser::createView;
+using parser::PathParser;
+using parser::string_view_t;
+
+///////////////////////////////////////////////////////////////////////////////
+// path definitions
+///////////////////////////////////////////////////////////////////////////////
+
+constexpr path::value_type path::preferred_separator;
+
+path& path::replace_extension(path const& replacement) {
+ path p = extension();
+ if (not p.empty()) {
+ __pn_.erase(__pn_.size() - p.native().size());
+ }
+ if (!replacement.empty()) {
+ if (replacement.native()[0] != '.') {
+ __pn_ += PATHSTR(".");
+ }
+ __pn_.append(replacement.__pn_);
+ }
+ return *this;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// path.decompose
+
+string_view_t path::__root_name() const {
+ auto PP = PathParser::CreateBegin(__pn_);
+ if (PP.State == PathParser::PS_InRootName)
+ return *PP;
+ return {};
+}
+
+string_view_t path::__root_directory() const {
+ auto PP = PathParser::CreateBegin(__pn_);
+ if (PP.State == PathParser::PS_InRootName)
+ ++PP;
+ if (PP.State == PathParser::PS_InRootDir)
+ return *PP;
+ return {};
+}
+
+string_view_t path::__root_path_raw() const {
+ auto PP = PathParser::CreateBegin(__pn_);
+ if (PP.State == PathParser::PS_InRootName) {
+ auto NextCh = PP.peek();
+ if (NextCh && isSeparator(*NextCh)) {
+ ++PP;
+ return createView(__pn_.data(), &PP.RawEntry.back());
+ }
+ return PP.RawEntry;
+ }
+ if (PP.State == PathParser::PS_InRootDir)
+ return *PP;
+ return {};
+}
+
+static bool ConsumeRootName(PathParser *PP) {
+ static_assert(PathParser::PS_BeforeBegin == 1 &&
+ PathParser::PS_InRootName == 2,
+ "Values for enums are incorrect");
+ while (PP->State <= PathParser::PS_InRootName)
+ ++(*PP);
+ return PP->State == PathParser::PS_AtEnd;
+}
+
+static bool ConsumeRootDir(PathParser* PP) {
+ static_assert(PathParser::PS_BeforeBegin == 1 &&
+ PathParser::PS_InRootName == 2 &&
+ PathParser::PS_InRootDir == 3, "Values for enums are incorrect");
+ while (PP->State <= PathParser::PS_InRootDir)
+ ++(*PP);
+ return PP->State == PathParser::PS_AtEnd;
+}
+
+string_view_t path::__relative_path() const {
+ auto PP = PathParser::CreateBegin(__pn_);
+ if (ConsumeRootDir(&PP))
+ return {};
+ return createView(PP.RawEntry.data(), &__pn_.back());
+}
+
+string_view_t path::__parent_path() const {
+ if (empty())
+ return {};
+ // Determine if we have a root path but not a relative path. In that case
+ // return *this.
+ {
+ auto PP = PathParser::CreateBegin(__pn_);
+ if (ConsumeRootDir(&PP))
+ return __pn_;
+ }
+ // Otherwise remove a single element from the end of the path, and return
+ // a string representing that path
+ {
+ auto PP = PathParser::CreateEnd(__pn_);
+ --PP;
+ if (PP.RawEntry.data() == __pn_.data())
+ return {};
+ --PP;
+ return createView(__pn_.data(), &PP.RawEntry.back());
+ }
+}
+
+string_view_t path::__filename() const {
+ if (empty())
+ return {};
+ {
+ PathParser PP = PathParser::CreateBegin(__pn_);
+ if (ConsumeRootDir(&PP))
+ return {};
+ }
+ return *(--PathParser::CreateEnd(__pn_));
+}
+
+string_view_t path::__stem() const {
+ return parser::separate_filename(__filename()).first;
+}
+
+string_view_t path::__extension() const {
+ return parser::separate_filename(__filename()).second;
+}
+
+////////////////////////////////////////////////////////////////////////////
+// path.gen
+
+enum PathPartKind : unsigned char {
+ PK_None,
+ PK_RootSep,
+ PK_Filename,
+ PK_Dot,
+ PK_DotDot,
+ PK_TrailingSep
+};
+
+static PathPartKind ClassifyPathPart(string_view_t Part) {
+ if (Part.empty())
+ return PK_TrailingSep;
+ if (Part == PATHSTR("."))
+ return PK_Dot;
+ if (Part == PATHSTR(".."))
+ return PK_DotDot;
+ if (Part == PATHSTR("/"))
+ return PK_RootSep;
+#if defined(_LIBCPP_WIN32API)
+ if (Part == PATHSTR("\\"))
+ return PK_RootSep;
+#endif
+ return PK_Filename;
+}
+
+path path::lexically_normal() const {
+ if (__pn_.empty())
+ return *this;
+
+ using PartKindPair = pair<string_view_t, PathPartKind>;
+ vector<PartKindPair> Parts;
+ // Guess as to how many elements the path has to avoid reallocating.
+ Parts.reserve(32);
+
+ // Track the total size of the parts as we collect them. This allows the
+ // resulting path to reserve the correct amount of memory.
+ size_t NewPathSize = 0;
+ auto AddPart = [&](PathPartKind K, string_view_t P) {
+ NewPathSize += P.size();
+ Parts.emplace_back(P, K);
+ };
+ auto LastPartKind = [&]() {
+ if (Parts.empty())
+ return PK_None;
+ return Parts.back().second;
+ };
+
+ bool MaybeNeedTrailingSep = false;
+ // Build a stack containing the remaining elements of the path, popping off
+ // elements which occur before a '..' entry.
+ for (auto PP = PathParser::CreateBegin(__pn_); PP; ++PP) {
+ auto Part = *PP;
+ PathPartKind Kind = ClassifyPathPart(Part);
+ switch (Kind) {
+ case PK_Filename:
+ case PK_RootSep: {
+ // Add all non-dot and non-dot-dot elements to the stack of elements.
+ AddPart(Kind, Part);
+ MaybeNeedTrailingSep = false;
+ break;
+ }
+ case PK_DotDot: {
+ // Only push a ".." element if there are no elements preceding the "..",
+ // or if the preceding element is itself "..".
+ auto LastKind = LastPartKind();
+ if (LastKind == PK_Filename) {
+ NewPathSize -= Parts.back().first.size();
+ Parts.pop_back();
+ } else if (LastKind != PK_RootSep)
+ AddPart(PK_DotDot, PATHSTR(".."));
+ MaybeNeedTrailingSep = LastKind == PK_Filename;
+ break;
+ }
+ case PK_Dot:
+ case PK_TrailingSep: {
+ MaybeNeedTrailingSep = true;
+ break;
+ }
+ case PK_None:
+ __libcpp_unreachable();
+ }
+ }
+ // [fs.path.generic]p6.8: If the path is empty, add a dot.
+ if (Parts.empty())
+ return PATHSTR(".");
+
+ // [fs.path.generic]p6.7: If the last filename is dot-dot, remove any
+ // trailing directory-separator.
+ bool NeedTrailingSep = MaybeNeedTrailingSep && LastPartKind() == PK_Filename;
+
+ path Result;
+ Result.__pn_.reserve(Parts.size() + NewPathSize + NeedTrailingSep);
+ for (auto& PK : Parts)
+ Result /= PK.first;
+
+ if (NeedTrailingSep)
+ Result /= PATHSTR("");
+
+ Result.make_preferred();
+ return Result;
+}
+
+static int DetermineLexicalElementCount(PathParser PP) {
+ int Count = 0;
+ for (; PP; ++PP) {
+ auto Elem = *PP;
+ if (Elem == PATHSTR(".."))
+ --Count;
+ else if (Elem != PATHSTR(".") && Elem != PATHSTR(""))
+ ++Count;
+ }
+ return Count;
+}
+
+path path::lexically_relative(const path& base) const {
+ { // perform root-name/root-directory mismatch checks
+ auto PP = PathParser::CreateBegin(__pn_);
+ auto PPBase = PathParser::CreateBegin(base.__pn_);
+ auto CheckIterMismatchAtBase = [&]() {
+ return PP.State != PPBase.State &&
+ (PP.inRootPath() || PPBase.inRootPath());
+ };
+ if (PP.inRootName() && PPBase.inRootName()) {
+ if (*PP != *PPBase)
+ return {};
+ } else if (CheckIterMismatchAtBase())
+ return {};
+
+ if (PP.inRootPath())
+ ++PP;
+ if (PPBase.inRootPath())
+ ++PPBase;
+ if (CheckIterMismatchAtBase())
+ return {};
+ }
+
+ // Find the first mismatching element
+ auto PP = PathParser::CreateBegin(__pn_);
+ auto PPBase = PathParser::CreateBegin(base.__pn_);
+ while (PP && PPBase && PP.State == PPBase.State && *PP == *PPBase) {
+ ++PP;
+ ++PPBase;
+ }
+
+ // If there is no mismatch, return ".".
+ if (!PP && !PPBase)
+ return ".";
+
+ // Otherwise, determine the number of elements, 'n', which are not dot or
+ // dot-dot minus the number of dot-dot elements.
+ int ElemCount = DetermineLexicalElementCount(PPBase);
+ if (ElemCount < 0)
+ return {};
+
+ // if n == 0 and (a == end() || a->empty()), returns path("."); otherwise
+ if (ElemCount == 0 && (PP.atEnd() || *PP == PATHSTR("")))
+ return PATHSTR(".");
+
+ // return a path constructed with 'n' dot-dot elements, followed by the
+ // elements of '*this' after the mismatch.
+ path Result;
+ // FIXME: Reserve enough room in Result that it won't have to re-allocate.
+ while (ElemCount--)
+ Result /= PATHSTR("..");
+ for (; PP; ++PP)
+ Result /= *PP;
+ return Result;
+}
+
+////////////////////////////////////////////////////////////////////////////
+// path.comparisons
+static int CompareRootName(PathParser *LHS, PathParser *RHS) {
+ if (!LHS->inRootName() && !RHS->inRootName())
+ return 0;
+
+ auto GetRootName = [](PathParser *Parser) -> string_view_t {
+ return Parser->inRootName() ? **Parser : PATHSTR("");
+ };
+ int res = GetRootName(LHS).compare(GetRootName(RHS));
+ ConsumeRootName(LHS);
+ ConsumeRootName(RHS);
+ return res;
+}
+
+static int CompareRootDir(PathParser *LHS, PathParser *RHS) {
+ if (!LHS->inRootDir() && RHS->inRootDir())
+ return -1;
+ else if (LHS->inRootDir() && !RHS->inRootDir())
+ return 1;
+ else {
+ ConsumeRootDir(LHS);
+ ConsumeRootDir(RHS);
+ return 0;
+ }
+}
+
+static int CompareRelative(PathParser *LHSPtr, PathParser *RHSPtr) {
+ auto &LHS = *LHSPtr;
+ auto &RHS = *RHSPtr;
+
+ int res;
+ while (LHS && RHS) {
+ if ((res = (*LHS).compare(*RHS)) != 0)
+ return res;
+ ++LHS;
+ ++RHS;
+ }
+ return 0;
+}
+
+static int CompareEndState(PathParser *LHS, PathParser *RHS) {
+ if (LHS->atEnd() && !RHS->atEnd())
+ return -1;
+ else if (!LHS->atEnd() && RHS->atEnd())
+ return 1;
+ return 0;
+}
+
+int path::__compare(string_view_t __s) const {
+ auto LHS = PathParser::CreateBegin(__pn_);
+ auto RHS = PathParser::CreateBegin(__s);
+ int res;
+
+ if ((res = CompareRootName(&LHS, &RHS)) != 0)
+ return res;
+
+ if ((res = CompareRootDir(&LHS, &RHS)) != 0)
+ return res;
+
+ if ((res = CompareRelative(&LHS, &RHS)) != 0)
+ return res;
+
+ return CompareEndState(&LHS, &RHS);
+}
+
+////////////////////////////////////////////////////////////////////////////
+// path.nonmembers
+size_t hash_value(const path& __p) noexcept {
+ auto PP = PathParser::CreateBegin(__p.native());
+ size_t hash_value = 0;
+ hash<string_view_t> hasher;
+ while (PP) {
+ hash_value = __hash_combine(hash_value, hasher(*PP));
+ ++PP;
+ }
+ return hash_value;
+}
+
+////////////////////////////////////////////////////////////////////////////
+// path.itr
+path::iterator path::begin() const {
+ auto PP = PathParser::CreateBegin(__pn_);
+ iterator it;
+ it.__path_ptr_ = this;
+ it.__state_ = static_cast<path::iterator::_ParserState>(PP.State);
+ it.__entry_ = PP.RawEntry;
+ it.__stashed_elem_.__assign_view(*PP);
+ return it;
+}
+
+path::iterator path::end() const {
+ iterator it{};
+ it.__state_ = path::iterator::_AtEnd;
+ it.__path_ptr_ = this;
+ return it;
+}
+
+path::iterator& path::iterator::__increment() {
+ PathParser PP(__path_ptr_->native(), __entry_, __state_);
+ ++PP;
+ __state_ = static_cast<_ParserState>(PP.State);
+ __entry_ = PP.RawEntry;
+ __stashed_elem_.__assign_view(*PP);
+ return *this;
+}
+
+path::iterator& path::iterator::__decrement() {
+ PathParser PP(__path_ptr_->native(), __entry_, __state_);
+ --PP;
+ __state_ = static_cast<_ParserState>(PP.State);
+ __entry_ = PP.RawEntry;
+ __stashed_elem_.__assign_view(*PP);
+ return *this;
+}
+
+#if defined(_LIBCPP_WIN32API)
+////////////////////////////////////////////////////////////////////////////
+// Windows path conversions
+size_t __wide_to_char(const wstring &str, char *out, size_t outlen) {
+ if (str.empty())
+ return 0;
+ ErrorHandler<size_t> err("__wide_to_char", nullptr);
+ UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
+ BOOL used_default = FALSE;
+ int ret = WideCharToMultiByte(codepage, 0, str.data(), str.size(), out,
+ outlen, nullptr, &used_default);
+ if (ret <= 0 || used_default)
+ return err.report(errc::illegal_byte_sequence);
+ return ret;
+}
+
+size_t __char_to_wide(const string &str, wchar_t *out, size_t outlen) {
+ if (str.empty())
+ return 0;
+ ErrorHandler<size_t> err("__char_to_wide", nullptr);
+ UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
+ int ret = MultiByteToWideChar(codepage, MB_ERR_INVALID_CHARS, str.data(),
+ str.size(), out, outlen);
+ if (ret <= 0)
+ return err.report(errc::illegal_byte_sequence);
+ return ret;
+}
+#endif
+
+_LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/path_parser.h b/contrib/libs/cxxsupp/libcxx/src/filesystem/path_parser.h
new file mode 100644
index 00000000000..630391fe6b5
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/path_parser.h
@@ -0,0 +1,372 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 PATH_PARSER_H
+#define PATH_PARSER_H
+
+#include <__config>
+#include <__utility/unreachable.h>
+#include <cstddef>
+#include <filesystem>
+#include <utility>
+
+#include "format_string.h"
+
+_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+
+inline bool isSeparator(path::value_type C) {
+ if (C == '/')
+ return true;
+#if defined(_LIBCPP_WIN32API)
+ if (C == '\\')
+ return true;
+#endif
+ return false;
+}
+
+inline bool isDriveLetter(path::value_type C) {
+ return (C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z');
+}
+
+namespace parser {
+
+using string_view_t = path::__string_view;
+using string_view_pair = pair<string_view_t, string_view_t>;
+using PosPtr = path::value_type const*;
+
+struct PathParser {
+ enum ParserState : unsigned char {
+ // Zero is a special sentinel value used by default constructed iterators.
+ PS_BeforeBegin = path::iterator::_BeforeBegin,
+ PS_InRootName = path::iterator::_InRootName,
+ PS_InRootDir = path::iterator::_InRootDir,
+ PS_InFilenames = path::iterator::_InFilenames,
+ PS_InTrailingSep = path::iterator::_InTrailingSep,
+ PS_AtEnd = path::iterator::_AtEnd
+ };
+
+ const string_view_t Path;
+ string_view_t RawEntry;
+ ParserState State;
+
+private:
+ PathParser(string_view_t P, ParserState State) noexcept : Path(P),
+ State(State) {}
+
+public:
+ PathParser(string_view_t P, string_view_t E, unsigned char S)
+ : Path(P), RawEntry(E), State(static_cast<ParserState>(S)) {
+ // S cannot be '0' or PS_BeforeBegin.
+ }
+
+ static PathParser CreateBegin(string_view_t P) noexcept {
+ PathParser PP(P, PS_BeforeBegin);
+ PP.increment();
+ return PP;
+ }
+
+ static PathParser CreateEnd(string_view_t P) noexcept {
+ PathParser PP(P, PS_AtEnd);
+ return PP;
+ }
+
+ PosPtr peek() const noexcept {
+ auto TkEnd = getNextTokenStartPos();
+ auto End = getAfterBack();
+ return TkEnd == End ? nullptr : TkEnd;
+ }
+
+ void increment() noexcept {
+ const PosPtr End = getAfterBack();
+ const PosPtr Start = getNextTokenStartPos();
+ if (Start == End)
+ return makeState(PS_AtEnd);
+
+ switch (State) {
+ case PS_BeforeBegin: {
+ PosPtr TkEnd = consumeRootName(Start, End);
+ if (TkEnd)
+ return makeState(PS_InRootName, Start, TkEnd);
+ }
+ _LIBCPP_FALLTHROUGH();
+ case PS_InRootName: {
+ PosPtr TkEnd = consumeAllSeparators(Start, End);
+ if (TkEnd)
+ return makeState(PS_InRootDir, Start, TkEnd);
+ else
+ return makeState(PS_InFilenames, Start, consumeName(Start, End));
+ }
+ case PS_InRootDir:
+ return makeState(PS_InFilenames, Start, consumeName(Start, End));
+
+ case PS_InFilenames: {
+ PosPtr SepEnd = consumeAllSeparators(Start, End);
+ if (SepEnd != End) {
+ PosPtr TkEnd = consumeName(SepEnd, End);
+ if (TkEnd)
+ return makeState(PS_InFilenames, SepEnd, TkEnd);
+ }
+ return makeState(PS_InTrailingSep, Start, SepEnd);
+ }
+
+ case PS_InTrailingSep:
+ return makeState(PS_AtEnd);
+
+ case PS_AtEnd:
+ __libcpp_unreachable();
+ }
+ }
+
+ void decrement() noexcept {
+ const PosPtr REnd = getBeforeFront();
+ const PosPtr RStart = getCurrentTokenStartPos() - 1;
+ if (RStart == REnd) // we're decrementing the begin
+ return makeState(PS_BeforeBegin);
+
+ switch (State) {
+ case PS_AtEnd: {
+ // Try to consume a trailing separator or root directory first.
+ if (PosPtr SepEnd = consumeAllSeparators(RStart, REnd)) {
+ if (SepEnd == REnd)
+ return makeState(PS_InRootDir, Path.data(), RStart + 1);
+ PosPtr TkStart = consumeRootName(SepEnd, REnd);
+ if (TkStart == REnd)
+ return makeState(PS_InRootDir, RStart, RStart + 1);
+ return makeState(PS_InTrailingSep, SepEnd + 1, RStart + 1);
+ } else {
+ PosPtr TkStart = consumeRootName(RStart, REnd);
+ if (TkStart == REnd)
+ return makeState(PS_InRootName, TkStart + 1, RStart + 1);
+ TkStart = consumeName(RStart, REnd);
+ return makeState(PS_InFilenames, TkStart + 1, RStart + 1);
+ }
+ }
+ case PS_InTrailingSep:
+ return makeState(PS_InFilenames, consumeName(RStart, REnd) + 1,
+ RStart + 1);
+ case PS_InFilenames: {
+ PosPtr SepEnd = consumeAllSeparators(RStart, REnd);
+ if (SepEnd == REnd)
+ return makeState(PS_InRootDir, Path.data(), RStart + 1);
+ PosPtr TkStart = consumeRootName(SepEnd ? SepEnd : RStart, REnd);
+ if (TkStart == REnd) {
+ if (SepEnd)
+ return makeState(PS_InRootDir, SepEnd + 1, RStart + 1);
+ return makeState(PS_InRootName, TkStart + 1, RStart + 1);
+ }
+ TkStart = consumeName(SepEnd, REnd);
+ return makeState(PS_InFilenames, TkStart + 1, SepEnd + 1);
+ }
+ case PS_InRootDir:
+ return makeState(PS_InRootName, Path.data(), RStart + 1);
+ case PS_InRootName:
+ case PS_BeforeBegin:
+ __libcpp_unreachable();
+ }
+ }
+
+ /// \brief Return a view with the "preferred representation" of the current
+ /// element. For example trailing separators are represented as a '.'
+ string_view_t operator*() const noexcept {
+ switch (State) {
+ case PS_BeforeBegin:
+ case PS_AtEnd:
+ return PATHSTR("");
+ case PS_InRootDir:
+ if (RawEntry[0] == '\\')
+ return PATHSTR("\\");
+ else
+ return PATHSTR("/");
+ case PS_InTrailingSep:
+ return PATHSTR("");
+ case PS_InRootName:
+ case PS_InFilenames:
+ return RawEntry;
+ }
+ __libcpp_unreachable();
+ }
+
+ explicit operator bool() const noexcept {
+ return State != PS_BeforeBegin && State != PS_AtEnd;
+ }
+
+ PathParser& operator++() noexcept {
+ increment();
+ return *this;
+ }
+
+ PathParser& operator--() noexcept {
+ decrement();
+ return *this;
+ }
+
+ bool atEnd() const noexcept {
+ return State == PS_AtEnd;
+ }
+
+ bool inRootDir() const noexcept {
+ return State == PS_InRootDir;
+ }
+
+ bool inRootName() const noexcept {
+ return State == PS_InRootName;
+ }
+
+ bool inRootPath() const noexcept {
+ return inRootName() || inRootDir();
+ }
+
+private:
+ void makeState(ParserState NewState, PosPtr Start, PosPtr End) noexcept {
+ State = NewState;
+ RawEntry = string_view_t(Start, End - Start);
+ }
+ void makeState(ParserState NewState) noexcept {
+ State = NewState;
+ RawEntry = {};
+ }
+
+ PosPtr getAfterBack() const noexcept { return Path.data() + Path.size(); }
+
+ PosPtr getBeforeFront() const noexcept { return Path.data() - 1; }
+
+ /// \brief Return a pointer to the first character after the currently
+ /// lexed element.
+ PosPtr getNextTokenStartPos() const noexcept {
+ switch (State) {
+ case PS_BeforeBegin:
+ return Path.data();
+ case PS_InRootName:
+ case PS_InRootDir:
+ case PS_InFilenames:
+ return &RawEntry.back() + 1;
+ case PS_InTrailingSep:
+ case PS_AtEnd:
+ return getAfterBack();
+ }
+ __libcpp_unreachable();
+ }
+
+ /// \brief Return a pointer to the first character in the currently lexed
+ /// element.
+ PosPtr getCurrentTokenStartPos() const noexcept {
+ switch (State) {
+ case PS_BeforeBegin:
+ case PS_InRootName:
+ return &Path.front();
+ case PS_InRootDir:
+ case PS_InFilenames:
+ case PS_InTrailingSep:
+ return &RawEntry.front();
+ case PS_AtEnd:
+ return &Path.back() + 1;
+ }
+ __libcpp_unreachable();
+ }
+
+ // Consume all consecutive separators.
+ PosPtr consumeAllSeparators(PosPtr P, PosPtr End) const noexcept {
+ if (P == nullptr || P == End || !isSeparator(*P))
+ return nullptr;
+ const int Inc = P < End ? 1 : -1;
+ P += Inc;
+ while (P != End && isSeparator(*P))
+ P += Inc;
+ return P;
+ }
+
+ // Consume exactly N separators, or return nullptr.
+ PosPtr consumeNSeparators(PosPtr P, PosPtr End, int N) const noexcept {
+ PosPtr Ret = consumeAllSeparators(P, End);
+ if (Ret == nullptr)
+ return nullptr;
+ if (P < End) {
+ if (Ret == P + N)
+ return Ret;
+ } else {
+ if (Ret == P - N)
+ return Ret;
+ }
+ return nullptr;
+ }
+
+ PosPtr consumeName(PosPtr P, PosPtr End) const noexcept {
+ PosPtr Start = P;
+ if (P == nullptr || P == End || isSeparator(*P))
+ return nullptr;
+ const int Inc = P < End ? 1 : -1;
+ P += Inc;
+ while (P != End && !isSeparator(*P))
+ P += Inc;
+ if (P == End && Inc < 0) {
+ // Iterating backwards and consumed all the rest of the input.
+ // Check if the start of the string would have been considered
+ // a root name.
+ PosPtr RootEnd = consumeRootName(End + 1, Start);
+ if (RootEnd)
+ return RootEnd - 1;
+ }
+ return P;
+ }
+
+ PosPtr consumeDriveLetter(PosPtr P, PosPtr End) const noexcept {
+ if (P == End)
+ return nullptr;
+ if (P < End) {
+ if (P + 1 == End || !isDriveLetter(P[0]) || P[1] != ':')
+ return nullptr;
+ return P + 2;
+ } else {
+ if (P - 1 == End || !isDriveLetter(P[-1]) || P[0] != ':')
+ return nullptr;
+ return P - 2;
+ }
+ }
+
+ PosPtr consumeNetworkRoot(PosPtr P, PosPtr End) const noexcept {
+ if (P == End)
+ return nullptr;
+ if (P < End)
+ return consumeName(consumeNSeparators(P, End, 2), End);
+ else
+ return consumeNSeparators(consumeName(P, End), End, 2);
+ }
+
+#if defined(_LIBCPP_WIN32API)
+ PosPtr consumeRootName(PosPtr P, PosPtr End) const noexcept {
+ if (PosPtr Ret = consumeDriveLetter(P, End))
+ return Ret;
+ if (PosPtr Ret = consumeNetworkRoot(P, End))
+ return Ret;
+ return nullptr;
+ }
+#else
+ PosPtr consumeRootName(PosPtr /*P*/, PosPtr /*End*/) const noexcept {
+ return nullptr;
+ }
+#endif
+};
+
+inline string_view_pair separate_filename(string_view_t const& s) {
+ if (s == PATHSTR(".") || s == PATHSTR("..") || s.empty())
+ return string_view_pair{s, PATHSTR("")};
+ auto pos = s.find_last_of('.');
+ if (pos == string_view_t::npos || pos == 0)
+ return string_view_pair{s, string_view_t{}};
+ return string_view_pair{s.substr(0, pos), s.substr(pos)};
+}
+
+inline string_view_t createView(PosPtr S, PosPtr E) noexcept {
+ return {S, static_cast<size_t>(E - S) + 1};
+}
+
+} // namespace parser
+
+_LIBCPP_END_NAMESPACE_FILESYSTEM
+
+#endif // PATH_PARSER_H
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/posix_compat.h b/contrib/libs/cxxsupp/libcxx/src/filesystem/posix_compat.h
index 36116ec5a39..f11f41552e3 100644
--- a/contrib/libs/cxxsupp/libcxx/src/filesystem/posix_compat.h
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/posix_compat.h
@@ -24,9 +24,11 @@
#define POSIX_COMPAT_H
#include <__assert>
+#include <__config>
#include <filesystem>
-#include "filesystem_common.h"
+#include "error.h"
+#include "time_utils.h"
#if defined(_LIBCPP_WIN32API)
# define WIN32_LEAN_AND_MEAN
@@ -35,10 +37,13 @@
# include <io.h>
# include <winioctl.h>
#else
+# include <fcntl.h>
# include <unistd.h>
# include <sys/stat.h>
# include <sys/statvfs.h>
+# include <sys/time.h>
#endif
+#include <stdlib.h>
#include <time.h>
#if defined(_LIBCPP_WIN32API)
@@ -74,7 +79,6 @@ struct LIBCPP_REPARSE_DATA_BUFFER {
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
namespace detail {
-namespace {
#if defined(_LIBCPP_WIN32API)
@@ -118,36 +122,7 @@ namespace {
#define O_NONBLOCK 0
-
-// There were 369 years and 89 leap days from the Windows epoch
-// (1601) to the Unix epoch (1970).
-#define FILE_TIME_OFFSET_SECS (uint64_t(369 * 365 + 89) * (24 * 60 * 60))
-
-TimeSpec filetime_to_timespec(LARGE_INTEGER li) {
- TimeSpec ret;
- ret.tv_sec = li.QuadPart / 10000000 - FILE_TIME_OFFSET_SECS;
- ret.tv_nsec = (li.QuadPart % 10000000) * 100;
- return ret;
-}
-
-TimeSpec filetime_to_timespec(FILETIME ft) {
- LARGE_INTEGER li;
- li.LowPart = ft.dwLowDateTime;
- li.HighPart = ft.dwHighDateTime;
- return filetime_to_timespec(li);
-}
-
-FILETIME timespec_to_filetime(TimeSpec ts) {
- LARGE_INTEGER li;
- li.QuadPart =
- ts.tv_nsec / 100 + (ts.tv_sec + FILE_TIME_OFFSET_SECS) * 10000000;
- FILETIME ft;
- ft.dwLowDateTime = li.LowPart;
- ft.dwHighDateTime = li.HighPart;
- return ft;
-}
-
-int set_errno(int e = GetLastError()) {
+inline int set_errno(int e = GetLastError()) {
errno = static_cast<int>(__win_err_to_errc(e));
return -1;
}
@@ -170,7 +145,7 @@ private:
HANDLE h;
};
-int stat_handle(HANDLE h, StatT *buf) {
+inline int stat_handle(HANDLE h, StatT *buf) {
FILE_BASIC_INFO basic;
if (!GetFileInformationByHandleEx(h, FileBasicInfo, &basic, sizeof(basic)))
return set_errno();
@@ -208,7 +183,7 @@ int stat_handle(HANDLE h, StatT *buf) {
return 0;
}
-int stat_file(const wchar_t *path, StatT *buf, DWORD flags) {
+inline int stat_file(const wchar_t *path, StatT *buf, DWORD flags) {
WinHandle h(path, FILE_READ_ATTRIBUTES, flags);
if (!h)
return set_errno();
@@ -216,24 +191,26 @@ int stat_file(const wchar_t *path, StatT *buf, DWORD flags) {
return ret;
}
-int stat(const wchar_t *path, StatT *buf) { return stat_file(path, buf, 0); }
+inline int stat(const wchar_t *path, StatT *buf) { return stat_file(path, buf, 0); }
-int lstat(const wchar_t *path, StatT *buf) {
+inline int lstat(const wchar_t *path, StatT *buf) {
return stat_file(path, buf, FILE_FLAG_OPEN_REPARSE_POINT);
}
-int fstat(int fd, StatT *buf) {
+inline int fstat(int fd, StatT *buf) {
HANDLE h = reinterpret_cast<HANDLE>(_get_osfhandle(fd));
return stat_handle(h, buf);
}
-int mkdir(const wchar_t *path, int permissions) {
+inline int mkdir(const wchar_t *path, int permissions) {
(void)permissions;
- return _wmkdir(path);
+ if (!CreateDirectoryW(path, nullptr))
+ return set_errno();
+ return 0;
}
-int symlink_file_dir(const wchar_t *oldname, const wchar_t *newname,
- bool is_dir) {
+inline int symlink_file_dir(const wchar_t *oldname, const wchar_t *newname,
+ bool is_dir) {
path dest(oldname);
dest.make_preferred();
oldname = dest.c_str();
@@ -249,21 +226,21 @@ int symlink_file_dir(const wchar_t *oldname, const wchar_t *newname,
return set_errno();
}
-int symlink_file(const wchar_t *oldname, const wchar_t *newname) {
+inline int symlink_file(const wchar_t *oldname, const wchar_t *newname) {
return symlink_file_dir(oldname, newname, false);
}
-int symlink_dir(const wchar_t *oldname, const wchar_t *newname) {
+inline int symlink_dir(const wchar_t *oldname, const wchar_t *newname) {
return symlink_file_dir(oldname, newname, true);
}
-int link(const wchar_t *oldname, const wchar_t *newname) {
+inline int link(const wchar_t *oldname, const wchar_t *newname) {
if (CreateHardLinkW(newname, oldname, nullptr))
return 0;
return set_errno();
}
-int remove(const wchar_t *path) {
+inline int remove(const wchar_t *path) {
detail::WinHandle h(path, DELETE, FILE_FLAG_OPEN_REPARSE_POINT);
if (!h)
return set_errno();
@@ -274,7 +251,7 @@ int remove(const wchar_t *path) {
return 0;
}
-int truncate_handle(HANDLE h, off_t length) {
+inline int truncate_handle(HANDLE h, off_t length) {
LARGE_INTEGER size_param;
size_param.QuadPart = length;
if (!SetFilePointerEx(h, size_param, 0, FILE_BEGIN))
@@ -284,19 +261,19 @@ int truncate_handle(HANDLE h, off_t length) {
return 0;
}
-int ftruncate(int fd, off_t length) {
+inline int ftruncate(int fd, off_t length) {
HANDLE h = reinterpret_cast<HANDLE>(_get_osfhandle(fd));
return truncate_handle(h, length);
}
-int truncate(const wchar_t *path, off_t length) {
+inline int truncate(const wchar_t *path, off_t length) {
detail::WinHandle h(path, GENERIC_WRITE, 0);
if (!h)
return set_errno();
return truncate_handle(h, length);
}
-int rename(const wchar_t *from, const wchar_t *to) {
+inline int rename(const wchar_t *from, const wchar_t *to) {
if (!(MoveFileExW(from, to,
MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING |
MOVEFILE_WRITE_THROUGH)))
@@ -304,11 +281,11 @@ int rename(const wchar_t *from, const wchar_t *to) {
return 0;
}
-template <class... Args> int open(const wchar_t *filename, Args... args) {
- return _wopen(filename, args...);
+inline int chdir(const wchar_t* path) {
+ if (!SetCurrentDirectoryW(path))
+ return set_errno();
+ return 0;
}
-int close(int fd) { return _close(fd); }
-int chdir(const wchar_t *path) { return _wchdir(path); }
struct StatVFS {
uint64_t f_frsize;
@@ -317,7 +294,7 @@ struct StatVFS {
uint64_t f_bavail;
};
-int statvfs(const wchar_t *p, StatVFS *buf) {
+inline int statvfs(const wchar_t *p, StatVFS *buf) {
path dir = p;
while (true) {
error_code local_ec;
@@ -343,11 +320,29 @@ int statvfs(const wchar_t *p, StatVFS *buf) {
return 0;
}
-wchar_t *getcwd(wchar_t *buff, size_t size) { return _wgetcwd(buff, size); }
+inline wchar_t* getcwd([[maybe_unused]] wchar_t* in_buf, [[maybe_unused]] size_t in_size) {
+ // Only expected to be used with us allocating the buffer.
+ _LIBCPP_ASSERT(in_buf == nullptr, "Windows getcwd() assumes in_buf==nullptr");
+ _LIBCPP_ASSERT(in_size == 0, "Windows getcwd() assumes in_size==0");
+
+ size_t buff_size = MAX_PATH + 10;
+ std::unique_ptr<wchar_t, decltype(&::free)> buff(static_cast<wchar_t*>(malloc(buff_size * sizeof(wchar_t))), &::free);
+ DWORD retval = GetCurrentDirectoryW(buff_size, buff.get());
+ if (retval > buff_size) {
+ buff_size = retval;
+ buff.reset(static_cast<wchar_t*>(malloc(buff_size * sizeof(wchar_t))));
+ retval = GetCurrentDirectoryW(buff_size, buff.get());
+ }
+ if (!retval) {
+ set_errno();
+ return nullptr;
+ }
+ return buff.release();
+}
-wchar_t *realpath(const wchar_t *path, wchar_t *resolved_name) {
+inline wchar_t *realpath(const wchar_t *path, [[maybe_unused]] wchar_t *resolved_name) {
// Only expected to be used with us allocating the buffer.
- _LIBCPP_ASSERT(resolved_name == nullptr,
+ _LIBCPP_ASSERT_UNCATEGORIZED(resolved_name == nullptr,
"Windows realpath() assumes a null resolved_name");
WinHandle h(path, FILE_READ_ATTRIBUTES, 0);
@@ -386,7 +381,7 @@ wchar_t *realpath(const wchar_t *path, wchar_t *resolved_name) {
#define AT_SYMLINK_NOFOLLOW 1
using ModeT = int;
-int fchmod_handle(HANDLE h, int perms) {
+inline int fchmod_handle(HANDLE h, int perms) {
FILE_BASIC_INFO basic;
if (!GetFileInformationByHandleEx(h, FileBasicInfo, &basic, sizeof(basic)))
return set_errno();
@@ -400,7 +395,7 @@ int fchmod_handle(HANDLE h, int perms) {
return 0;
}
-int fchmodat(int fd, const wchar_t *path, int perms, int flag) {
+inline int fchmodat(int /*fd*/, const wchar_t *path, int perms, int flag) {
DWORD attributes = GetFileAttributesW(path);
if (attributes == INVALID_FILE_ATTRIBUTES)
return set_errno();
@@ -427,7 +422,7 @@ int fchmodat(int fd, const wchar_t *path, int perms, int flag) {
return 0;
}
-int fchmod(int fd, int perms) {
+inline int fchmod(int fd, int perms) {
HANDLE h = reinterpret_cast<HANDLE>(_get_osfhandle(fd));
return fchmod_handle(h, perms);
}
@@ -435,7 +430,7 @@ int fchmod(int fd, int perms) {
#define MAX_SYMLINK_SIZE MAXIMUM_REPARSE_DATA_BUFFER_SIZE
using SSizeT = ::int64_t;
-SSizeT readlink(const wchar_t *path, wchar_t *ret_buf, size_t bufsize) {
+inline SSizeT readlink(const wchar_t *path, wchar_t *ret_buf, size_t bufsize) {
uint8_t buf[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
detail::WinHandle h(path, FILE_READ_ATTRIBUTES, FILE_FLAG_OPEN_REPARSE_POINT);
if (!h)
@@ -479,14 +474,13 @@ SSizeT readlink(const wchar_t *path, wchar_t *ret_buf, size_t bufsize) {
}
#else
-int symlink_file(const char *oldname, const char *newname) {
+inline int symlink_file(const char *oldname, const char *newname) {
return ::symlink(oldname, newname);
}
-int symlink_dir(const char *oldname, const char *newname) {
+inline int symlink_dir(const char *oldname, const char *newname) {
return ::symlink(oldname, newname);
}
using ::chdir;
-using ::close;
using ::fchmod;
#if defined(AT_SYMLINK_NOFOLLOW) && defined(AT_FDCWD)
using ::fchmodat;
@@ -497,7 +491,6 @@ using ::getcwd;
using ::link;
using ::lstat;
using ::mkdir;
-using ::open;
using ::readlink;
using ::realpath;
using ::remove;
@@ -514,7 +507,6 @@ using SSizeT = ::ssize_t;
#endif
-} // namespace
} // end namespace detail
_LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/time_utils.h b/contrib/libs/cxxsupp/libcxx/src/filesystem/time_utils.h
new file mode 100644
index 00000000000..9177e1013d0
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/time_utils.h
@@ -0,0 +1,385 @@
+//===----------------------------------------------------------------------===////
+//
+// 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 FILESYSTEM_TIME_UTILS_H
+#define FILESYSTEM_TIME_UTILS_H
+
+#include <__config>
+#include <array>
+#include <chrono>
+#include <filesystem>
+#include <limits>
+#include <ratio>
+#include <system_error>
+#include <type_traits>
+#include <utility>
+
+#include "error.h"
+#include "format_string.h"
+
+#if defined(_LIBCPP_WIN32API)
+# define WIN32_LEAN_AND_MEAN
+# define NOMINMAX
+# include <windows.h>
+#else
+# include <fcntl.h>
+# include <sys/stat.h>
+# include <sys/time.h> // for ::utimes as used in __last_write_time
+#endif
+
+// We can use the presence of UTIME_OMIT to detect platforms that provide utimensat.
+#if defined(UTIME_OMIT)
+# define _LIBCPP_USE_UTIMENSAT
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+
+namespace detail {
+
+#if defined(_LIBCPP_WIN32API)
+// Various C runtime versions (UCRT, or the legacy msvcrt.dll used by
+// some mingw toolchains) provide different stat function implementations,
+// with a number of limitations with respect to what we want from the
+// stat function. Instead provide our own which does exactly what we want,
+// along with our own stat structure and flag macros.
+
+struct TimeSpec {
+ int64_t tv_sec;
+ int64_t tv_nsec;
+};
+struct StatT {
+ unsigned st_mode;
+ TimeSpec st_atim;
+ TimeSpec st_mtim;
+ uint64_t st_dev; // FILE_ID_INFO::VolumeSerialNumber
+ struct FileIdStruct {
+ unsigned char id[16]; // FILE_ID_INFO::FileId
+ bool operator==(const FileIdStruct &other) const {
+ for (int i = 0; i < 16; i++)
+ if (id[i] != other.id[i])
+ return false;
+ return true;
+ }
+ } st_ino;
+ uint32_t st_nlink;
+ uintmax_t st_size;
+};
+
+// There were 369 years and 89 leap days from the Windows epoch
+// (1601) to the Unix epoch (1970).
+#define FILE_TIME_OFFSET_SECS (uint64_t(369 * 365 + 89) * (24 * 60 * 60))
+
+inline TimeSpec filetime_to_timespec(LARGE_INTEGER li) {
+ TimeSpec ret;
+ ret.tv_sec = li.QuadPart / 10000000 - FILE_TIME_OFFSET_SECS;
+ ret.tv_nsec = (li.QuadPart % 10000000) * 100;
+ return ret;
+}
+
+inline TimeSpec filetime_to_timespec(FILETIME ft) {
+ LARGE_INTEGER li;
+ li.LowPart = ft.dwLowDateTime;
+ li.HighPart = ft.dwHighDateTime;
+ return filetime_to_timespec(li);
+}
+
+inline FILETIME timespec_to_filetime(TimeSpec ts) {
+ LARGE_INTEGER li;
+ li.QuadPart =
+ ts.tv_nsec / 100 + (ts.tv_sec + FILE_TIME_OFFSET_SECS) * 10000000;
+ FILETIME ft;
+ ft.dwLowDateTime = li.LowPart;
+ ft.dwHighDateTime = li.HighPart;
+ return ft;
+}
+
+#else
+using TimeSpec = struct timespec;
+using TimeVal = struct timeval;
+using StatT = struct stat;
+
+inline TimeVal make_timeval(TimeSpec const& ts) {
+ using namespace chrono;
+ auto Convert = [](long nsec) {
+ using int_type = decltype(std::declval<TimeVal>().tv_usec);
+ auto dur = duration_cast<microseconds>(nanoseconds(nsec)).count();
+ return static_cast<int_type>(dur);
+ };
+ TimeVal TV = {};
+ TV.tv_sec = ts.tv_sec;
+ TV.tv_usec = Convert(ts.tv_nsec);
+ return TV;
+}
+#endif
+
+using chrono::duration;
+using chrono::duration_cast;
+
+template <class FileTimeT, class TimeT,
+ bool IsFloat = is_floating_point<typename FileTimeT::rep>::value>
+struct time_util_base {
+ using rep = typename FileTimeT::rep;
+ using fs_duration = typename FileTimeT::duration;
+ using fs_seconds = duration<rep>;
+ using fs_nanoseconds = duration<rep, nano>;
+ using fs_microseconds = duration<rep, micro>;
+
+ static constexpr rep max_seconds =
+ duration_cast<fs_seconds>(FileTimeT::duration::max()).count();
+
+ static constexpr rep max_nsec =
+ duration_cast<fs_nanoseconds>(FileTimeT::duration::max() -
+ fs_seconds(max_seconds))
+ .count();
+
+ static constexpr rep min_seconds =
+ duration_cast<fs_seconds>(FileTimeT::duration::min()).count();
+
+ static constexpr rep min_nsec_timespec =
+ duration_cast<fs_nanoseconds>(
+ (FileTimeT::duration::min() - fs_seconds(min_seconds)) +
+ fs_seconds(1))
+ .count();
+
+private:
+ static _LIBCPP_CONSTEXPR fs_duration get_min_nsecs() {
+ return duration_cast<fs_duration>(
+ fs_nanoseconds(min_nsec_timespec) -
+ duration_cast<fs_nanoseconds>(fs_seconds(1)));
+ }
+ // Static assert that these values properly round trip.
+ static_assert(fs_seconds(min_seconds) + get_min_nsecs() ==
+ FileTimeT::duration::min(),
+ "value doesn't roundtrip");
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool check_range() {
+ // This kinda sucks, but it's what happens when we don't have __int128_t.
+ if (sizeof(TimeT) == sizeof(rep)) {
+ typedef duration<long long, ratio<3600 * 24 * 365> > Years;
+ return duration_cast<Years>(fs_seconds(max_seconds)) > Years(250) &&
+ duration_cast<Years>(fs_seconds(min_seconds)) < Years(-250);
+ }
+ return max_seconds >= numeric_limits<TimeT>::max() &&
+ min_seconds <= numeric_limits<TimeT>::min();
+ }
+#if _LIBCPP_STD_VER >= 14
+ static_assert(check_range(), "the representable range is unacceptable small");
+#endif
+};
+
+template <class FileTimeT, class TimeT>
+struct time_util_base<FileTimeT, TimeT, true> {
+ using rep = typename FileTimeT::rep;
+ using fs_duration = typename FileTimeT::duration;
+ using fs_seconds = duration<rep>;
+ using fs_nanoseconds = duration<rep, nano>;
+ using fs_microseconds = duration<rep, micro>;
+
+ static const rep max_seconds;
+ static const rep max_nsec;
+ static const rep min_seconds;
+ static const rep min_nsec_timespec;
+};
+
+template <class FileTimeT, class TimeT>
+const typename FileTimeT::rep
+ time_util_base<FileTimeT, TimeT, true>::max_seconds =
+ duration_cast<fs_seconds>(FileTimeT::duration::max()).count();
+
+template <class FileTimeT, class TimeT>
+const typename FileTimeT::rep time_util_base<FileTimeT, TimeT, true>::max_nsec =
+ duration_cast<fs_nanoseconds>(FileTimeT::duration::max() -
+ fs_seconds(max_seconds))
+ .count();
+
+template <class FileTimeT, class TimeT>
+const typename FileTimeT::rep
+ time_util_base<FileTimeT, TimeT, true>::min_seconds =
+ duration_cast<fs_seconds>(FileTimeT::duration::min()).count();
+
+template <class FileTimeT, class TimeT>
+const typename FileTimeT::rep
+ time_util_base<FileTimeT, TimeT, true>::min_nsec_timespec =
+ duration_cast<fs_nanoseconds>((FileTimeT::duration::min() -
+ fs_seconds(min_seconds)) +
+ fs_seconds(1))
+ .count();
+
+template <class FileTimeT, class TimeT, class TimeSpecT>
+struct time_util : time_util_base<FileTimeT, TimeT> {
+ using Base = time_util_base<FileTimeT, TimeT>;
+ using Base::max_nsec;
+ using Base::max_seconds;
+ using Base::min_nsec_timespec;
+ using Base::min_seconds;
+
+ using typename Base::fs_duration;
+ using typename Base::fs_microseconds;
+ using typename Base::fs_nanoseconds;
+ using typename Base::fs_seconds;
+
+public:
+ template <class CType, class ChronoType>
+ static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool checked_set(CType* out,
+ ChronoType time) {
+ using Lim = numeric_limits<CType>;
+ if (time > Lim::max() || time < Lim::min())
+ return false;
+ *out = static_cast<CType>(time);
+ return true;
+ }
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool is_representable(TimeSpecT tm) {
+ if (tm.tv_sec >= 0) {
+ return tm.tv_sec < max_seconds ||
+ (tm.tv_sec == max_seconds && tm.tv_nsec <= max_nsec);
+ } else if (tm.tv_sec == (min_seconds - 1)) {
+ return tm.tv_nsec >= min_nsec_timespec;
+ } else {
+ return tm.tv_sec >= min_seconds;
+ }
+ }
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool is_representable(FileTimeT tm) {
+ auto secs = duration_cast<fs_seconds>(tm.time_since_epoch());
+ auto nsecs = duration_cast<fs_nanoseconds>(tm.time_since_epoch() - secs);
+ if (nsecs.count() < 0) {
+ secs = secs + fs_seconds(1);
+ nsecs = nsecs + fs_seconds(1);
+ }
+ using TLim = numeric_limits<TimeT>;
+ if (secs.count() >= 0)
+ return secs.count() <= TLim::max();
+ return secs.count() >= TLim::min();
+ }
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX14 FileTimeT
+ convert_from_timespec(TimeSpecT tm) {
+ if (tm.tv_sec >= 0 || tm.tv_nsec == 0) {
+ return FileTimeT(fs_seconds(tm.tv_sec) +
+ duration_cast<fs_duration>(fs_nanoseconds(tm.tv_nsec)));
+ } else { // tm.tv_sec < 0
+ auto adj_subsec = duration_cast<fs_duration>(fs_seconds(1) -
+ fs_nanoseconds(tm.tv_nsec));
+ auto Dur = fs_seconds(tm.tv_sec + 1) - adj_subsec;
+ return FileTimeT(Dur);
+ }
+ }
+
+ template <class SubSecT>
+ static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
+ set_times_checked(TimeT* sec_out, SubSecT* subsec_out, FileTimeT tp) {
+ auto dur = tp.time_since_epoch();
+ auto sec_dur = duration_cast<fs_seconds>(dur);
+ auto subsec_dur = duration_cast<fs_nanoseconds>(dur - sec_dur);
+ // The tv_nsec and tv_usec fields must not be negative so adjust accordingly
+ if (subsec_dur.count() < 0) {
+ if (sec_dur.count() > min_seconds) {
+ sec_dur = sec_dur - fs_seconds(1);
+ subsec_dur = subsec_dur + fs_seconds(1);
+ } else {
+ subsec_dur = fs_nanoseconds::zero();
+ }
+ }
+ return checked_set(sec_out, sec_dur.count()) &&
+ checked_set(subsec_out, subsec_dur.count());
+ }
+ static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool convert_to_timespec(TimeSpecT& dest,
+ FileTimeT tp) {
+ if (!is_representable(tp))
+ return false;
+ return set_times_checked(&dest.tv_sec, &dest.tv_nsec, tp);
+ }
+};
+
+#if defined(_LIBCPP_WIN32API)
+using fs_time = time_util<file_time_type, int64_t, TimeSpec>;
+#else
+using fs_time = time_util<file_time_type, time_t, TimeSpec>;
+#endif
+
+#if defined(__APPLE__)
+inline TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }
+inline TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; }
+#elif defined(__MVS__)
+inline TimeSpec extract_mtime(StatT const& st) {
+ TimeSpec TS = {st.st_mtime, 0};
+ return TS;
+}
+inline TimeSpec extract_atime(StatT const& st) {
+ TimeSpec TS = {st.st_atime, 0};
+ return TS;
+}
+#elif defined(_AIX)
+inline TimeSpec extract_mtime(StatT const& st) {
+ TimeSpec TS = {st.st_mtime, st.st_mtime_n};
+ return TS;
+}
+inline TimeSpec extract_atime(StatT const& st) {
+ TimeSpec TS = {st.st_atime, st.st_atime_n};
+ return TS;
+}
+#else
+inline TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; }
+inline TimeSpec extract_atime(StatT const& st) { return st.st_atim; }
+#endif
+
+#ifndef _LIBCPP_HAS_NO_FILESYSTEM
+
+#if !defined(_LIBCPP_WIN32API)
+inline bool posix_utimes(const path& p, std::array<TimeSpec, 2> const& TS,
+ error_code& ec) {
+ TimeVal ConvertedTS[2] = {make_timeval(TS[0]), make_timeval(TS[1])};
+ if (::utimes(p.c_str(), ConvertedTS) == -1) {
+ ec = capture_errno();
+ return true;
+ }
+ return false;
+}
+
+#if defined(_LIBCPP_USE_UTIMENSAT)
+inline bool posix_utimensat(const path& p, std::array<TimeSpec, 2> const& TS,
+ error_code& ec) {
+ if (::utimensat(AT_FDCWD, p.c_str(), TS.data(), 0) == -1) {
+ ec = capture_errno();
+ return true;
+ }
+ return false;
+}
+#endif
+
+inline bool set_file_times(const path& p, std::array<TimeSpec, 2> const& TS,
+ error_code& ec) {
+#if !defined(_LIBCPP_USE_UTIMENSAT)
+ return posix_utimes(p, TS, ec);
+#else
+ return posix_utimensat(p, TS, ec);
+#endif
+}
+
+#endif // !_LIBCPP_WIN32API
+
+inline file_time_type __extract_last_write_time(const path& p, const StatT& st,
+ error_code* ec) {
+ using detail::fs_time;
+ ErrorHandler<file_time_type> err("last_write_time", ec, &p);
+
+ auto ts = detail::extract_mtime(st);
+ if (!fs_time::is_representable(ts))
+ return err.report(errc::value_too_large);
+
+ return fs_time::convert_from_timespec(ts);
+}
+
+#endif // !_LIBCPP_HAS_NO_FILESYSTEM
+
+} // end namespace detail
+
+_LIBCPP_END_NAMESPACE_FILESYSTEM
+
+#endif // FILESYSTEM_TIME_UTILS_H
diff --git a/contrib/libs/cxxsupp/libcxx/src/format.cpp b/contrib/libs/cxxsupp/libcxx/src/format.cpp
deleted file mode 100644
index 401cccf1721..00000000000
--- a/contrib/libs/cxxsupp/libcxx/src/format.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#include <format>
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-#ifndef _LIBCPP_INLINE_FORMAT_ERROR_DTOR
-format_error::~format_error() noexcept = default;
-#endif
-
-_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/src/future.cpp b/contrib/libs/cxxsupp/libcxx/src/future.cpp
index cdaa9382753..f8f466bd5a2 100644
--- a/contrib/libs/cxxsupp/libcxx/src/future.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/future.cpp
@@ -197,12 +197,12 @@ promise<void>::~promise()
{
if (__state_)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
if (!__state_->__has_value() && __state_->use_count() > 1)
__state_->set_exception(make_exception_ptr(
future_error(make_error_code(future_errc::broken_promise))
));
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__state_->__release_shared();
}
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/include/apple_availability.h b/contrib/libs/cxxsupp/libcxx/src/include/apple_availability.h
index 75bf79658d1..c8d158e990e 100644
--- a/contrib/libs/cxxsupp/libcxx/src/include/apple_availability.h
+++ b/contrib/libs/cxxsupp/libcxx/src/include/apple_availability.h
@@ -12,24 +12,6 @@
#if defined(__APPLE__)
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101300
-#define _LIBCPP_USE_UTIMENSAT
-#endif
-#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
-#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 110000
-#define _LIBCPP_USE_UTIMENSAT
-#endif
-#elif defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__)
-#if __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 110000
-#define _LIBCPP_USE_UTIMENSAT
-#endif
-#elif defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__)
-#if __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 40000
-#define _LIBCPP_USE_UTIMENSAT
-#endif
-#endif // __ENVIRONMENT_.*_VERSION_MIN_REQUIRED__
-
-#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500
#define _LIBCPP_USE_ULOCK
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/src/include/config_elast.h b/contrib/libs/cxxsupp/libcxx/src/include/config_elast.h
index bef26ec5019..a772ea7a01b 100644
--- a/contrib/libs/cxxsupp/libcxx/src/include/config_elast.h
+++ b/contrib/libs/cxxsupp/libcxx/src/include/config_elast.h
@@ -35,8 +35,6 @@
#define _LIBCPP_ELAST 4095
#elif defined(__APPLE__)
// No _LIBCPP_ELAST needed on Apple
-#elif defined(__sun__)
-#define _LIBCPP_ELAST ESTALE
#elif defined(__MVS__)
#define _LIBCPP_ELAST 1160
#elif defined(_LIBCPP_MSVCRT_LIKE)
diff --git a/contrib/libs/cxxsupp/libcxx/src/include/ryu/common.h b/contrib/libs/cxxsupp/libcxx/src/include/ryu/common.h
index c24115c2336..23cb7d3b773 100644
--- a/contrib/libs/cxxsupp/libcxx/src/include/ryu/common.h
+++ b/contrib/libs/cxxsupp/libcxx/src/include/ryu/common.h
@@ -43,7 +43,8 @@
// clang-format off
#include <__assert>
-#include "__config"
+#include <__config>
+#include <cstring>
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -51,7 +52,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// Function precondition: __v is not a 10-digit number.
// (f2s: 9 digits are sufficient for round-tripping.)
// (d2fixed: We print 9-digit blocks.)
- _LIBCPP_ASSERT(__v < 1000000000, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__v < 1000000000, "");
if (__v >= 100000000) { return 9; }
if (__v >= 10000000) { return 8; }
if (__v >= 1000000) { return 7; }
@@ -68,36 +69,36 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// This approximation works up to the point that the multiplication overflows at __e = 3529.
// If the multiplication were done in 64 bits, it would fail at 5^4004 which is just greater
// than 2^9297.
- _LIBCPP_ASSERT(__e >= 0, "");
- _LIBCPP_ASSERT(__e <= 3528, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__e >= 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__e <= 3528, "");
return static_cast<int32_t>(((static_cast<uint32_t>(__e) * 1217359) >> 19) + 1);
}
// Returns floor(log_10(2^__e)).
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __log10Pow2(const int32_t __e) {
// The first value this approximation fails for is 2^1651 which is just greater than 10^297.
- _LIBCPP_ASSERT(__e >= 0, "");
- _LIBCPP_ASSERT(__e <= 1650, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__e >= 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__e <= 1650, "");
return (static_cast<uint32_t>(__e) * 78913) >> 18;
}
// Returns floor(log_10(5^__e)).
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __log10Pow5(const int32_t __e) {
// The first value this approximation fails for is 5^2621 which is just greater than 10^1832.
- _LIBCPP_ASSERT(__e >= 0, "");
- _LIBCPP_ASSERT(__e <= 2620, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__e >= 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__e <= 2620, "");
return (static_cast<uint32_t>(__e) * 732923) >> 20;
}
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __float_to_bits(const float __f) {
uint32_t __bits = 0;
- _VSTD::memcpy(&__bits, &__f, sizeof(float));
+ std::memcpy(&__bits, &__f, sizeof(float));
return __bits;
}
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint64_t __double_to_bits(const double __d) {
uint64_t __bits = 0;
- _VSTD::memcpy(&__bits, &__d, sizeof(double));
+ std::memcpy(&__bits, &__d, sizeof(double));
return __bits;
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/include/ryu/d2s_intrinsics.h b/contrib/libs/cxxsupp/libcxx/src/include/ryu/d2s_intrinsics.h
index 762763f9b92..7697c32ff6e 100644
--- a/contrib/libs/cxxsupp/libcxx/src/include/ryu/d2s_intrinsics.h
+++ b/contrib/libs/cxxsupp/libcxx/src/include/ryu/d2s_intrinsics.h
@@ -63,7 +63,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// (The shift value is in the range [49, 58].)
// Check this here in case a future change requires larger shift
// values. In this case this function needs to be adjusted.
- _LIBCPP_ASSERT(__dist < 64, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__dist < 64, "");
return __shiftright128(__lo, __hi, static_cast<unsigned char>(__dist));
}
@@ -85,7 +85,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// (The shift value is in the range [49, 58].)
// Check this here in case a future change requires larger shift
// values. In this case this function needs to be adjusted.
- _LIBCPP_ASSERT(__dist < 64, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__dist < 64, "");
auto __temp = __lo | ((unsigned __int128)__hi << 64);
// For x64 128-bit shfits using the `shrd` instruction and two 64-bit
// registers, the shift value is modulo 64. Thus the `& 63` is free.
@@ -126,13 +126,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint64_t __ryu_shiftright128(const uint64_t __lo, const uint64_t __hi, const uint32_t __dist) {
// We don't need to handle the case __dist >= 64 here (see above).
- _LIBCPP_ASSERT(__dist < 64, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__dist < 64, "");
#ifdef _LIBCPP_64_BIT
- _LIBCPP_ASSERT(__dist > 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__dist > 0, "");
return (__hi << (64 - __dist)) | (__lo >> __dist);
#else // ^^^ 64-bit ^^^ / vvv 32-bit vvv
// Avoid a 64-bit shift by taking advantage of the range of shift values.
- _LIBCPP_ASSERT(__dist >= 32, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__dist >= 32, "");
return (__hi << (64 - __dist)) | (static_cast<uint32_t>(__lo >> 32) >> (__dist - 32));
#endif // ^^^ 32-bit ^^^
}
@@ -227,7 +227,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __pow5Factor(uint64_t __value) {
uint32_t __count = 0;
for (;;) {
- _LIBCPP_ASSERT(__value != 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__value != 0, "");
const uint64_t __q = __div5(__value);
const uint32_t __r = static_cast<uint32_t>(__value) - 5 * static_cast<uint32_t>(__q);
if (__r != 0) {
@@ -247,8 +247,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// Returns true if __value is divisible by 2^__p.
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline bool __multipleOfPowerOf2(const uint64_t __value, const uint32_t __p) {
- _LIBCPP_ASSERT(__value != 0, "");
- _LIBCPP_ASSERT(__p < 64, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__value != 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__p < 64, "");
// __builtin_ctzll doesn't appear to be faster here.
return (__value & ((1ull << __p) - 1)) == 0;
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/include/ryu/ryu.h b/contrib/libs/cxxsupp/libcxx/src/include/ryu/ryu.h
index cb44bd3fef0..3f4afa5d60c 100644
--- a/contrib/libs/cxxsupp/libcxx/src/include/ryu/ryu.h
+++ b/contrib/libs/cxxsupp/libcxx/src/include/ryu/ryu.h
@@ -47,8 +47,7 @@
#include <__charconv/chars_format.h>
#include <__charconv/to_chars_result.h>
#include <__config>
-#include <__debug>
-#include <__errc>
+#include <__system_error/errc.h>
#include <cstdint>
#include <cstring>
#include <type_traits>
diff --git a/contrib/libs/cxxsupp/libcxx/src/include/to_chars_floating_point.h b/contrib/libs/cxxsupp/libcxx/src/include/to_chars_floating_point.h
index b99d790f65c..e2409338b9d 100644
--- a/contrib/libs/cxxsupp/libcxx/src/include/to_chars_floating_point.h
+++ b/contrib/libs/cxxsupp/libcxx/src/include/to_chars_floating_point.h
@@ -269,7 +269,7 @@ to_chars_result _Floating_to_chars_hex_precision(
// * Print the leading hexit, then mask it away.
{
const uint32_t _Nibble = static_cast<uint32_t>(_Adjusted_mantissa >> _Adjusted_explicit_bits);
- _LIBCPP_ASSERT(_Nibble < 3, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Nibble < 3, "");
const char _Leading_hexit = static_cast<char>('0' + _Nibble);
*_First++ = _Leading_hexit;
@@ -288,12 +288,12 @@ to_chars_result _Floating_to_chars_hex_precision(
int32_t _Number_of_bits_remaining = _Adjusted_explicit_bits; // 24 for float, 52 for double
for (;;) {
- _LIBCPP_ASSERT(_Number_of_bits_remaining >= 4, "");
- _LIBCPP_ASSERT(_Number_of_bits_remaining % 4 == 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Number_of_bits_remaining >= 4, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Number_of_bits_remaining % 4 == 0, "");
_Number_of_bits_remaining -= 4;
const uint32_t _Nibble = static_cast<uint32_t>(_Adjusted_mantissa >> _Number_of_bits_remaining);
- _LIBCPP_ASSERT(_Nibble < 16, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Nibble < 16, "");
const char _Hexit = __itoa::_Charconv_digits[_Nibble];
*_First++ = _Hexit;
@@ -415,12 +415,12 @@ to_chars_result _Floating_to_chars_hex_shortest(
// '0' hexits, the same condition works (as we print the final hexit and mask it away); we don't need to test
// _Number_of_bits_remaining.
do {
- _LIBCPP_ASSERT(_Number_of_bits_remaining >= 4, "");
- _LIBCPP_ASSERT(_Number_of_bits_remaining % 4 == 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Number_of_bits_remaining >= 4, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Number_of_bits_remaining % 4 == 0, "");
_Number_of_bits_remaining -= 4;
const uint32_t _Nibble = static_cast<uint32_t>(_Adjusted_mantissa >> _Number_of_bits_remaining);
- _LIBCPP_ASSERT(_Nibble < 16, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Nibble < 16, "");
const char _Hexit = __itoa::_Charconv_digits[_Nibble];
if (_First == _Last) {
@@ -940,13 +940,13 @@ to_chars_result _Floating_to_chars_general_precision(
_Effective_precision = _VSTD::min(_Precision - (_Scientific_exponent_X + 1), _Max_fixed_precision);
const to_chars_result _Buf_result =
_Floating_to_chars_fixed_precision(_Buffer, _VSTD::end(_Buffer), _Value, _Effective_precision);
- _LIBCPP_ASSERT(_Buf_result.ec == errc{}, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Buf_result.ec == errc{}, "");
_Significand_last = _Buf_result.ptr;
} else {
_Effective_precision = _VSTD::min(_Precision - 1, _Max_scientific_precision);
const to_chars_result _Buf_result =
_Floating_to_chars_scientific_precision(_Buffer, _VSTD::end(_Buffer), _Value, _Effective_precision);
- _LIBCPP_ASSERT(_Buf_result.ec == errc{}, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Buf_result.ec == errc{}, "");
_Significand_last = _VSTD::find(_Buffer, _Buf_result.ptr, 'e');
_Exponent_first = _Significand_last;
_Exponent_last = _Buf_result.ptr;
@@ -992,10 +992,10 @@ to_chars_result _Floating_to_chars(
char* _First, char* const _Last, _Floating _Value, const chars_format _Fmt, const int _Precision) noexcept {
if constexpr (_Overload == _Floating_to_chars_overload::_Plain) {
- _LIBCPP_ASSERT(_Fmt == chars_format{}, ""); // plain overload must pass chars_format{} internally
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Fmt == chars_format{}, ""); // plain overload must pass chars_format{} internally
} else {
- _LIBCPP_ASSERT(_Fmt == chars_format::general || _Fmt == chars_format::scientific || _Fmt == chars_format::fixed
- || _Fmt == chars_format::hex,
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Fmt == chars_format::general || _Fmt == chars_format::scientific
+ || _Fmt == chars_format::fixed || _Fmt == chars_format::hex,
"invalid format in to_chars()");
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/ios.cpp b/contrib/libs/cxxsupp/libcxx/src/ios.cpp
index 870406b554d..bb62eb99487 100644
--- a/contrib/libs/cxxsupp/libcxx/src/ios.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/ios.cpp
@@ -413,20 +413,20 @@ void
ios_base::__set_badbit_and_consider_rethrow()
{
__rdstate_ |= badbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
if (__exceptions_ & badbit)
throw;
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
void
ios_base::__set_failbit_and_consider_rethrow()
{
__rdstate_ |= failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
if (__exceptions_ & failbit)
throw;
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
bool
diff --git a/contrib/libs/cxxsupp/libcxx/src/ios.instantiations.cpp b/contrib/libs/cxxsupp/libcxx/src/ios.instantiations.cpp
index ca77ce11fd2..01fe199acb3 100644
--- a/contrib/libs/cxxsupp/libcxx/src/ios.instantiations.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/ios.instantiations.cpp
@@ -37,7 +37,7 @@ template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringstream<char>
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostringstream<char>;
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istringstream<char>;
-#ifndef _LIBCPP_HAS_NO_FSTREAM
+#ifndef _LIBCPP_HAS_NO_FILESYSTEM
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ifstream<char>;
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ofstream<char>;
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_filebuf<char>;
diff --git a/contrib/libs/cxxsupp/libcxx/src/iostream.cpp b/contrib/libs/cxxsupp/libcxx/src/iostream.cpp
index 79dbd9a52b7..b0686c90991 100644
--- a/contrib/libs/cxxsupp/libcxx/src/iostream.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/iostream.cpp
@@ -7,10 +7,14 @@
//===----------------------------------------------------------------------===//
#include <__locale>
-#include <__std_stream>
+#include "std_stream.h"
#include <new>
#include <string>
+#ifdef _LIBCPP_MSVCRT_LIKE
+# include <__locale_dir/locale_base_api/locale_guard.h>
+#endif
+
#define _str(s) #s
#define str(s) _str(s)
#define _LIBCPP_ABI_NAMESPACE_STR str(_LIBCPP_ABI_NAMESPACE)
@@ -19,9 +23,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(__clang__)
_ALIGNAS_TYPE (istream) char _cin [sizeof(istream)];
-_LIBCPP_FUNC_VIS istream& cin = *reinterpret_cast<istream*>(_cin);
+_LIBCPP_EXPORTED_FROM_ABI istream& cin = *reinterpret_cast<istream*>(_cin);
#else
-_ALIGNAS_TYPE (istream) _LIBCPP_FUNC_VIS char cin[sizeof(istream)]
+_ALIGNAS_TYPE (istream) _LIBCPP_EXPORTED_FROM_ABI char cin[sizeof(istream)]
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
__asm__("?cin@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_istream@DU?$char_traits@D@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A")
#endif
@@ -33,9 +37,9 @@ static mbstate_t mb_cin;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(__clang__)
_ALIGNAS_TYPE (wistream) char _wcin [sizeof(wistream)];
-_LIBCPP_FUNC_VIS wistream& wcin = *reinterpret_cast<wistream*>(_wcin);
+_LIBCPP_EXPORTED_FROM_ABI wistream& wcin = *reinterpret_cast<wistream*>(_wcin);
#else
-_ALIGNAS_TYPE (wistream) _LIBCPP_FUNC_VIS char wcin[sizeof(wistream)]
+_ALIGNAS_TYPE (wistream) _LIBCPP_EXPORTED_FROM_ABI char wcin[sizeof(wistream)]
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
__asm__("?wcin@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_istream@_WU?$char_traits@_W@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A")
#endif
@@ -47,9 +51,9 @@ static mbstate_t mb_wcin;
#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(__clang__)
_ALIGNAS_TYPE (ostream) char _cout[sizeof(ostream)];
-_LIBCPP_FUNC_VIS ostream& cout = *reinterpret_cast<ostream*>(_cout);
+_LIBCPP_EXPORTED_FROM_ABI ostream& cout = *reinterpret_cast<ostream*>(_cout);
#else
-_ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cout[sizeof(ostream)]
+_ALIGNAS_TYPE (ostream) _LIBCPP_EXPORTED_FROM_ABI char cout[sizeof(ostream)]
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
__asm__("?cout@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@DU?$char_traits@D@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A")
#endif
@@ -61,9 +65,9 @@ static mbstate_t mb_cout;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(__clang__)
_ALIGNAS_TYPE (wostream) char _wcout[sizeof(wostream)];
-_LIBCPP_FUNC_VIS wostream& wcout = *reinterpret_cast<wostream*>(_wcout);
+_LIBCPP_EXPORTED_FROM_ABI wostream& wcout = *reinterpret_cast<wostream*>(_wcout);
#else
-_ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcout[sizeof(wostream)]
+_ALIGNAS_TYPE (wostream) _LIBCPP_EXPORTED_FROM_ABI char wcout[sizeof(wostream)]
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
__asm__("?wcout@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@_WU?$char_traits@_W@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A")
#endif
@@ -75,9 +79,9 @@ static mbstate_t mb_wcout;
#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(__clang__)
_ALIGNAS_TYPE (ostream) char _cerr[sizeof(ostream)];
-_LIBCPP_FUNC_VIS ostream& cerr = *reinterpret_cast<ostream*>(_cerr);
+_LIBCPP_EXPORTED_FROM_ABI ostream& cerr = *reinterpret_cast<ostream*>(_cerr);
#else
-_ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cerr[sizeof(ostream)]
+_ALIGNAS_TYPE (ostream) _LIBCPP_EXPORTED_FROM_ABI char cerr[sizeof(ostream)]
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
__asm__("?cerr@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@DU?$char_traits@D@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A")
#endif
@@ -89,9 +93,9 @@ static mbstate_t mb_cerr;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(__clang__)
_ALIGNAS_TYPE (wostream) char _wcerr[sizeof(wostream)];
-_LIBCPP_FUNC_VIS wostream& wcerr = *reinterpret_cast<wostream*>(_wcerr);
+_LIBCPP_EXPORTED_FROM_ABI wostream& wcerr = *reinterpret_cast<wostream*>(_wcerr);
#else
-_ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcerr[sizeof(wostream)]
+_ALIGNAS_TYPE (wostream) _LIBCPP_EXPORTED_FROM_ABI char wcerr[sizeof(wostream)]
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
__asm__("?wcerr@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@_WU?$char_traits@_W@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A")
#endif
@@ -103,9 +107,9 @@ static mbstate_t mb_wcerr;
#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(__clang__)
_ALIGNAS_TYPE (ostream) char _clog[sizeof(ostream)];
-_LIBCPP_FUNC_VIS ostream& clog = *reinterpret_cast<ostream*>(_clog);
+_LIBCPP_EXPORTED_FROM_ABI ostream& clog = *reinterpret_cast<ostream*>(_clog);
#else
-_ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char clog[sizeof(ostream)]
+_ALIGNAS_TYPE (ostream) _LIBCPP_EXPORTED_FROM_ABI char clog[sizeof(ostream)]
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
__asm__("?clog@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@DU?$char_traits@D@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A")
#endif
@@ -115,9 +119,9 @@ __asm__("?clog@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@DU?$char_tra
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(__clang__)
_ALIGNAS_TYPE (wostream) char _wclog[sizeof(wostream)];
-_LIBCPP_FUNC_VIS wostream& wclog = *reinterpret_cast<wostream*>(_wclog);
+_LIBCPP_EXPORTED_FROM_ABI wostream& wclog = *reinterpret_cast<wostream*>(_wclog);
#else
-_ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wclog[sizeof(wostream)]
+_ALIGNAS_TYPE (wostream) _LIBCPP_EXPORTED_FROM_ABI char wclog[sizeof(wostream)]
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
__asm__("?wclog@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@_WU?$char_traits@_W@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A")
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/src/legacy_pointer_safety.cpp b/contrib/libs/cxxsupp/libcxx/src/legacy_pointer_safety.cpp
index 5d2b04c121a..a9361ca879b 100644
--- a/contrib/libs/cxxsupp/libcxx/src/legacy_pointer_safety.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/legacy_pointer_safety.cpp
@@ -15,9 +15,9 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-_LIBCPP_FUNC_VIS void declare_reachable(void*) {}
-_LIBCPP_FUNC_VIS void declare_no_pointers(char*, size_t) {}
-_LIBCPP_FUNC_VIS void undeclare_no_pointers(char*, size_t) {}
-_LIBCPP_FUNC_VIS void* __undeclare_reachable(void* p) { return p; }
+_LIBCPP_EXPORTED_FROM_ABI void declare_reachable(void*) {}
+_LIBCPP_EXPORTED_FROM_ABI void declare_no_pointers(char*, size_t) {}
+_LIBCPP_EXPORTED_FROM_ABI void undeclare_no_pointers(char*, size_t) {}
+_LIBCPP_EXPORTED_FROM_ABI void* __undeclare_reachable(void* p) { return p; }
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/src/locale.cpp b/contrib/libs/cxxsupp/libcxx/src/locale.cpp
index c756c6fadfa..e274ede995b 100644
--- a/contrib/libs/cxxsupp/libcxx/src/locale.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/locale.cpp
@@ -6,13 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// On Solaris, we need to define something to make the C99 parts of localeconv
-// visible.
-#ifdef __sun__
-#define _LCONV_C99
-#endif
-
#include <__utility/unreachable.h>
+#include <__verbose_abort>
#include <algorithm>
#include <clocale>
#include <codecvt>
@@ -118,16 +113,27 @@ countof(const T * const begin, const T * const end)
_LIBCPP_NORETURN static void __throw_runtime_error(const string &msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw runtime_error(msg);
#else
- (void)msg;
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("runtime_error was thrown in -fno-exceptions mode with message \"%s\"", msg.c_str());
#endif
}
}
+string
+build_name(const string& other, const string& one, locale::category c) {
+ if (other == "*" || one == "*")
+ return "*";
+ if (c == locale::none || other == one)
+ return other;
+
+ // FIXME: Handle the more complicated cases, such as when the locale has
+ // different names for different categories.
+ return "*";
+}
+
const locale::category locale::none;
const locale::category locale::collate;
const locale::category locale::ctype;
@@ -236,10 +242,10 @@ locale::__imp::__imp(const string& name, size_t refs)
facets_(N),
name_(name)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
facets_ = locale::classic().__locale_->facets_;
for (unsigned i = 0; i < facets_.size(); ++i)
if (facets_[i])
@@ -286,7 +292,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
install(new messages_byname<wchar_t>(name_));
#endif
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -295,7 +301,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
facets_[i]->__release_shared();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
locale::__imp::__imp(const __imp& other)
@@ -309,17 +315,16 @@ locale::__imp::__imp(const __imp& other)
}
locale::__imp::__imp(const __imp& other, const string& name, locale::category c)
- : facets_(N),
- name_("*")
+ : facets_(N), name_(build_name(other.name_, name, c))
{
facets_ = other.facets_;
for (unsigned i = 0; i < facets_.size(); ++i)
if (facets_[i])
facets_[i]->__add_shared();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (c & locale::collate)
{
install(new collate_byname<char>(name));
@@ -380,7 +385,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
install(new messages_byname<wchar_t>(name));
#endif
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -389,7 +394,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
facets_[i]->__release_shared();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class F>
@@ -402,17 +407,16 @@ locale::__imp::install_from(const locale::__imp& one)
}
locale::__imp::__imp(const __imp& other, const __imp& one, locale::category c)
- : facets_(N),
- name_("*")
+ : facets_(N), name_(build_name(other.name_, one.name_, c))
{
facets_ = other.facets_;
for (unsigned i = 0; i < facets_.size(); ++i)
if (facets_[i])
facets_[i]->__add_shared();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (c & locale::collate)
{
install_from<_VSTD::collate<char> >(one);
@@ -489,7 +493,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
install_from<_VSTD::messages<wchar_t> >(one);
#endif
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -498,7 +502,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
facets_[i]->__release_shared();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
locale::__imp::__imp(const __imp& other, facet* f, long id)
@@ -1197,8 +1201,6 @@ ctype<char>::classic_table() noexcept
return _C_ctype_tab_ + 1;
#elif defined(__GLIBC__)
return _LIBCPP_GET_C_LOCALE->__ctype_b;
-#elif defined(__sun__)
- return __ctype_mask;
#elif defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
return __pctype_func();
#elif defined(__EMSCRIPTEN__)
@@ -1421,10 +1423,8 @@ ctype_byname<wchar_t>::do_is(const char_type* low, const char_type* high, mask*
if (iswxdigit_l(ch, __l_))
*vec |= xdigit;
#endif
-#if !defined(__sun__)
if (iswblank_l(ch, __l_))
*vec |= blank;
-#endif
}
}
return low;
@@ -6556,11 +6556,10 @@ void __do_nothing(void*) {}
void __throw_runtime_error(const char* msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw runtime_error(msg);
#else
- (void)msg;
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("runtime_error was thrown in -fno-exceptions mode with message \"%s\"", msg);
#endif
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/memory.cpp b/contrib/libs/cxxsupp/libcxx/src/memory.cpp
index 9c0ee5d6f32..4682f1267ac 100644
--- a/contrib/libs/cxxsupp/libcxx/src/memory.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/memory.cpp
@@ -29,8 +29,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-const allocator_arg_t allocator_arg = allocator_arg_t();
-
bad_weak_ptr::~bad_weak_ptr() noexcept {}
const char*
diff --git a/contrib/libs/cxxsupp/libcxx/src/memory_resource.cpp b/contrib/libs/cxxsupp/libcxx/src/memory_resource.cpp
index e00611dd1c9..3a80b84efae 100644
--- a/contrib/libs/cxxsupp/libcxx/src/memory_resource.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/memory_resource.cpp
@@ -37,7 +37,7 @@ static bool is_aligned_to(void* ptr, size_t align) {
}
#endif
-class _LIBCPP_TYPE_VIS __new_delete_memory_resource_imp : public memory_resource {
+class _LIBCPP_EXPORTED_FROM_ABI __new_delete_memory_resource_imp : public memory_resource {
void* do_allocate(size_t bytes, size_t align) override {
#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
return std::__libcpp_allocate(bytes, align);
@@ -60,7 +60,7 @@ class _LIBCPP_TYPE_VIS __new_delete_memory_resource_imp : public memory_resource
// null_memory_resource()
-class _LIBCPP_TYPE_VIS __null_memory_resource_imp : public memory_resource {
+class _LIBCPP_EXPORTED_FROM_ABI __null_memory_resource_imp : public memory_resource {
void* do_allocate(size_t, size_t) override { __throw_bad_alloc(); }
void do_deallocate(void*, size_t, size_t) override {}
bool do_is_equal(const memory_resource& other) const noexcept override { return &other == this; }
@@ -107,7 +107,7 @@ static memory_resource* __default_memory_resource(bool set = false, memory_resou
new_res = new_res ? new_res : new_delete_resource();
lock_guard<mutex> guard(res_lock);
memory_resource* old_res = res;
- res = new_res;
+ res = new_res;
return old_res;
} else {
lock_guard<mutex> guard(res_lock);
@@ -175,7 +175,7 @@ void* unsynchronized_pool_resource::__adhoc_pool::__do_allocate(memory_resource*
void unsynchronized_pool_resource::__adhoc_pool::__do_deallocate(
memory_resource* upstream, void* p, size_t bytes, size_t align) {
- _LIBCPP_ASSERT(__first_ != nullptr, "deallocating a block that was not allocated with this allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first_ != nullptr, "deallocating a block that was not allocated with this allocator");
if (__first_->__start_ == p) {
__chunk_footer* next = __first_->__next_;
upstream->deallocate(p, __first_->__allocation_size(), __first_->__align_);
@@ -189,7 +189,7 @@ void unsynchronized_pool_resource::__adhoc_pool::__do_deallocate(
return;
}
}
- _LIBCPP_ASSERT(false, "deallocating a block that was not allocated with this allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "deallocating a block that was not allocated with this allocator");
}
}
@@ -230,7 +230,7 @@ public:
}
void* __allocate_in_new_chunk(memory_resource* upstream, size_t block_size, size_t chunk_size) {
- _LIBCPP_ASSERT(chunk_size % block_size == 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(chunk_size % block_size == 0, "");
static_assert(__default_alignment >= alignof(std::max_align_t), "");
static_assert(__default_alignment >= alignof(__chunk_footer), "");
static_assert(__default_alignment >= alignof(__vacancy_header), "");
@@ -401,7 +401,8 @@ void unsynchronized_pool_resource::do_deallocate(void* p, size_t bytes, size_t a
if (i == __num_fixed_pools_)
return __adhoc_pool_.__do_deallocate(__res_, p, bytes, align);
else {
- _LIBCPP_ASSERT(__fixed_pools_ != nullptr, "deallocating a block that was not allocated with this allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __fixed_pools_ != nullptr, "deallocating a block that was not allocated with this allocator");
__fixed_pools_[i].__evacuate(p);
}
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/mutex.cpp b/contrib/libs/cxxsupp/libcxx/src/mutex.cpp
index f738cc013b3..e304b97e6eb 100644
--- a/contrib/libs/cxxsupp/libcxx/src/mutex.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/mutex.cpp
@@ -7,9 +7,9 @@
//===----------------------------------------------------------------------===//
#include <__assert>
+#include <__thread/id.h>
#include <limits>
#include <mutex>
-#include <system_error>
#if !defined(_LIBCPP_ABI_MICROSOFT)
#include "include/atomic_support.h"
@@ -28,10 +28,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_HAS_NO_THREADS
-const defer_lock_t defer_lock{};
-const try_to_lock_t try_to_lock{};
-const adopt_lock_t adopt_lock{};
-
// ~mutex is defined elsewhere
void
@@ -53,7 +49,7 @@ mutex::unlock() noexcept
{
int ec = __libcpp_mutex_unlock(&__m_);
(void)ec;
- _LIBCPP_ASSERT(ec == 0, "call to mutex::unlock failed");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ec == 0, "call to mutex::unlock failed");
}
// recursive_mutex
@@ -69,7 +65,7 @@ recursive_mutex::~recursive_mutex()
{
int e = __libcpp_recursive_mutex_destroy(&__m_);
(void)e;
- _LIBCPP_ASSERT(e == 0, "call to ~recursive_mutex() failed");
+ _LIBCPP_ASSERT_UNCATEGORIZED(e == 0, "call to ~recursive_mutex() failed");
}
void
@@ -85,7 +81,7 @@ recursive_mutex::unlock() noexcept
{
int e = __libcpp_recursive_mutex_unlock(&__m_);
(void)e;
- _LIBCPP_ASSERT(e == 0, "call to recursive_mutex::unlock() failed");
+ _LIBCPP_ASSERT_UNCATEGORIZED(e == 0, "call to recursive_mutex::unlock() failed");
}
bool
@@ -218,21 +214,21 @@ void __call_once(volatile once_flag::_State_type& flag, void* arg,
#if defined(_LIBCPP_HAS_NO_THREADS)
if (flag == 0)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
flag = 1;
func(arg);
flag = ~once_flag::_State_type(0);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
flag = 0;
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
#else // !_LIBCPP_HAS_NO_THREADS
__libcpp_mutex_lock(&mut);
@@ -240,10 +236,10 @@ void __call_once(volatile once_flag::_State_type& flag, void* arg,
__libcpp_condvar_wait(&cv, &mut);
if (flag == 0)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
#ifdef _LIBCPP_ABI_MICROSOFT
flag.store(once_flag::_State_type(1));
#else
@@ -260,7 +256,7 @@ void __call_once(volatile once_flag::_State_type& flag, void* arg,
#endif
__libcpp_mutex_unlock(&mut);
__libcpp_condvar_broadcast(&cv);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -274,7 +270,7 @@ void __call_once(volatile once_flag::_State_type& flag, void* arg,
__libcpp_condvar_broadcast(&cv);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
__libcpp_mutex_unlock(&mut);
diff --git a/contrib/libs/cxxsupp/libcxx/src/mutex_destructor.cpp b/contrib/libs/cxxsupp/libcxx/src/mutex_destructor.cpp
index 6850b6e6f49..d366a4e1b31 100644
--- a/contrib/libs/cxxsupp/libcxx/src/mutex_destructor.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/mutex_destructor.cpp
@@ -28,7 +28,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#ifdef NEEDS_MUTEX_DESTRUCTOR
-class _LIBCPP_TYPE_VIS mutex
+class _LIBCPP_EXPORTED_FROM_ABI mutex
{
__libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER;
diff --git a/contrib/libs/cxxsupp/libcxx/src/new.cpp b/contrib/libs/cxxsupp/libcxx/src/new.cpp
index 4351923cb54..6d5b2211985 100644
--- a/contrib/libs/cxxsupp/libcxx/src/new.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/new.cpp
@@ -6,53 +6,16 @@
//
//===----------------------------------------------------------------------===//
+#include <__memory/aligned_alloc.h>
+#include <cstdlib>
#include <new>
-#include <stdlib.h>
-#include "include/atomic_support.h"
+#if !defined(__GLIBCXX__) && !defined(_LIBCPP_ABI_VCRUNTIME)
-#if defined(_LIBCPP_ABI_MICROSOFT)
-# if !defined(_LIBCPP_ABI_VCRUNTIME)
-# include "support/runtime/new_handler_fallback.ipp"
-# endif
-#elif defined(LIBCXX_BUILDING_LIBCXXABI)
-# include <cxxabi.h>
-#elif defined(LIBCXX_BUILDING_LIBCXXRT)
-# include <cxxabi.h>
-# include "support/runtime/new_handler_fallback.ipp"
-#elif defined(__GLIBCXX__)
- // nothing to do
-#else
-# include "support/runtime/new_handler_fallback.ipp"
-#endif
-
-namespace std
-{
-
-#ifndef __GLIBCXX__
-const nothrow_t nothrow{};
-#endif
-
-#ifndef LIBSTDCXX
-
-void
-__throw_bad_alloc()
-{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_alloc();
-#else
- _VSTD::abort();
-#endif
-}
-
-#endif // !LIBSTDCXX
-
-} // std
-
-#if !defined(__GLIBCXX__) && \
- !defined(_LIBCPP_ABI_VCRUNTIME) && \
- !defined(_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS)
+// The code below is copied as-is into libc++abi's libcxxabi/src/stdlib_new_delete.cpp
+// file. The version in this file is the canonical one.
+// ------------------ BEGIN COPY ------------------
// Implement all new and delete operators as weak definitions
// in this shared library, so that they can be overridden by programs
// that define non-weak copies of the functions.
@@ -64,7 +27,7 @@ operator new(std::size_t size) _THROW_BAD_ALLOC
if (size == 0)
size = 1;
void* p;
- while ((p = ::malloc(size)) == nullptr)
+ while ((p = std::malloc(size)) == nullptr)
{
// If malloc fails and there is a new_handler,
// call it to try free up memory.
@@ -72,7 +35,7 @@ operator new(std::size_t size) _THROW_BAD_ALLOC
if (nh)
nh();
else
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw std::bad_alloc();
#else
#ifdef __EMSCRIPTEN__
@@ -95,17 +58,17 @@ void*
operator new(size_t size, const std::nothrow_t&) noexcept
{
void* p = nullptr;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
p = ::operator new(size);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return p;
}
@@ -121,17 +84,17 @@ void*
operator new[](size_t size, const std::nothrow_t&) noexcept
{
void* p = nullptr;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
p = ::operator new[](size);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return p;
}
@@ -139,7 +102,7 @@ _LIBCPP_WEAK
void
operator delete(void* ptr) noexcept
{
- ::free(ptr);
+ std::free(ptr);
}
_LIBCPP_WEAK
@@ -201,7 +164,7 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
if (nh)
nh();
else {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw std::bad_alloc();
#else
break;
@@ -216,17 +179,17 @@ void*
operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
void* p = nullptr;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
p = ::operator new(size, alignment);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return p;
}
@@ -242,17 +205,17 @@ void*
operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
void* p = nullptr;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
p = ::operator new[](size, alignment);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return p;
}
@@ -299,4 +262,6 @@ operator delete[] (void* ptr, size_t, std::align_val_t alignment) noexcept
}
#endif // !_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
-#endif // !__GLIBCXX__ && !_LIBCPP_ABI_VCRUNTIME && !_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS
+// ------------------ END COPY ------------------
+
+#endif // !__GLIBCXX__ && !_LIBCPP_ABI_VCRUNTIME
diff --git a/contrib/libs/cxxsupp/libcxx/src/new_handler.cpp b/contrib/libs/cxxsupp/libcxx/src/new_handler.cpp
new file mode 100644
index 00000000000..49c21d85f59
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/new_handler.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <new>
+
+#include "include/atomic_support.h"
+
+#if defined(_LIBCPP_ABI_MICROSOFT)
+# if !defined(_LIBCPP_ABI_VCRUNTIME)
+# define _LIBPCPP_DEFINE_NEW_HANDLER
+# endif
+#elif defined(LIBCXX_BUILDING_LIBCXXABI)
+// nothing to do, we use the one from libc++abi
+#elif defined(LIBCXXRT)
+# define _LIBPCPP_DEFINE_NEW_HANDLER
+#elif defined(__GLIBCXX__)
+// nothing to do, we use the one from libstdc++/libsupc++
+#else
+# define _LIBPCPP_DEFINE_NEW_HANDLER
+#endif
+
+#if defined(_LIBPCPP_DEFINE_NEW_HANDLER)
+
+namespace std { // purposefully not versioned
+
+static constinit std::new_handler __new_handler = nullptr;
+
+new_handler set_new_handler(new_handler handler) noexcept { return __libcpp_atomic_exchange(&__new_handler, handler); }
+
+new_handler get_new_handler() noexcept { return __libcpp_atomic_load(&__new_handler); }
+
+} // namespace std
+
+#endif // _LIBPCPP_DEFINE_NEW_HANDLER
diff --git a/contrib/libs/cxxsupp/libcxx/src/new_helpers.cpp b/contrib/libs/cxxsupp/libcxx/src/new_helpers.cpp
new file mode 100644
index 00000000000..45a0a661db0
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/new_helpers.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <cstdlib>
+#include <new>
+
+namespace std { // purposefully not versioned
+
+#ifndef __GLIBCXX__
+const nothrow_t nothrow{};
+#endif
+
+#ifndef LIBSTDCXX
+
+void __throw_bad_alloc() {
+# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ throw bad_alloc();
+# else
+ std::abort();
+# endif
+}
+
+#endif // !LIBSTDCXX
+
+} // namespace std
diff --git a/contrib/libs/cxxsupp/libcxx/src/optional.cpp b/contrib/libs/cxxsupp/libcxx/src/optional.cpp
index e2b5ccef99a..d0214981a2f 100644
--- a/contrib/libs/cxxsupp/libcxx/src/optional.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/optional.cpp
@@ -27,7 +27,7 @@ const char* bad_optional_access::what() const noexcept {
// Even though it no longer exists in a header file
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
-class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
+class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
: public std::logic_error
{
public:
diff --git a/contrib/libs/cxxsupp/libcxx/src/print.cpp b/contrib/libs/cxxsupp/libcxx/src/print.cpp
new file mode 100644
index 00000000000..3d8a4c291ee
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/print.cpp
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <__config>
+#include <cstdlib>
+#include <print>
+
+#if defined(_LIBCPP_WIN32API)
+# define WIN32_LEAN_AND_MEAN
+# define NOMINMAX
+# include <io.h>
+# include <windows.h>
+
+# include <__system_error/system_error.h>
+
+# include "filesystem/error.h"
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifdef _WIN32
+_LIBCPP_EXPORTED_FROM_ABI bool __is_windows_terminal(FILE* __stream) {
+ // Note the Standard does this in one call, but it's unclear whether
+ // an invalid handle is allowed when calling GetConsoleMode.
+ //
+ // https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/get-osfhandle?view=msvc-170
+ // https://learn.microsoft.com/en-us/windows/console/getconsolemode
+ intptr_t __handle = _get_osfhandle(fileno(__stream));
+ if (__handle == -1)
+ return false;
+
+ unsigned long __mode;
+ return GetConsoleMode(reinterpret_cast<void*>(__handle), &__mode);
+}
+
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+_LIBCPP_EXPORTED_FROM_ABI void
+__write_to_windows_console([[maybe_unused]] FILE* __stream, [[maybe_unused]] wstring_view __view) {
+ // https://learn.microsoft.com/en-us/windows/console/writeconsole
+ if (WriteConsoleW(reinterpret_cast<void*>(_get_osfhandle(fileno(__stream))), // clang-format aid
+ __view.data(),
+ __view.size(),
+ nullptr,
+ nullptr) == 0) {
+# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ // There is no __throw_system_error overload that takes an error code.
+ throw system_error{filesystem::detail::make_windows_error(GetLastError()), "failed to write formatted output"};
+# else // _LIBCPP_HAS_NO_EXCEPTIONS
+ std::abort();
+# endif // _LIBCPP_HAS_NO_EXCEPTIONS
+ }
+}
+# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+
+#endif // _WIN32
+
+_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/src/random.cpp b/contrib/libs/cxxsupp/libcxx/src/random.cpp
index 38732462cf5..dfac89f75b5 100644
--- a/contrib/libs/cxxsupp/libcxx/src/random.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/random.cpp
@@ -13,13 +13,9 @@
# define _CRT_RAND_S
#endif // defined(_LIBCPP_USING_WIN32_RANDOM)
+#include <__system_error/system_error.h>
#include <limits>
#include <random>
-#include <system_error>
-
-#if defined(__sun__)
-# define rename solaris_headers_are_broken
-#endif // defined(__sun__)
#include <errno.h>
#include <stdio.h>
diff --git a/contrib/libs/cxxsupp/libcxx/src/ryu/d2fixed.cpp b/contrib/libs/cxxsupp/libcxx/src/ryu/d2fixed.cpp
index c1a1f6cf9e0..3ae515d1dcc 100644
--- a/contrib/libs/cxxsupp/libcxx/src/ryu/d2fixed.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/ryu/d2fixed.cpp
@@ -43,7 +43,6 @@
#include <__config>
#include <charconv>
#include <cstring>
-#include <system_error>
#include "include/ryu/common.h"
#include "include/ryu/d2fixed.h"
@@ -103,8 +102,8 @@ inline constexpr int __POW10_ADDITIONAL_BITS = 120;
const uint64_t __s1low = __low2 + __high1 + __c1; // 128
const uint32_t __c2 = __s1low < __low2; // __high1 + __c1 can't overflow, so compare against __low2
const uint64_t __s1high = __high2 + __c2; // 192
- _LIBCPP_ASSERT(__j >= 128, "");
- _LIBCPP_ASSERT(__j <= 180, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__j >= 128, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__j <= 180, "");
#ifdef _LIBCPP_INTRINSIC128
const uint32_t __dist = static_cast<uint32_t>(__j - 128); // __dist: [0, 52]
const uint64_t __shiftedhigh = __s1high >> __dist;
@@ -135,19 +134,19 @@ void __append_n_digits(const uint32_t __olength, uint32_t __digits, char* const
__digits /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength - __i - 4, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength - __i - 4, __DIGIT_TABLE + __c1, 2);
__i += 4;
}
if (__digits >= 100) {
const uint32_t __c = (__digits % 100) << 1;
__digits /= 100;
- _VSTD::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c, 2);
__i += 2;
}
if (__digits >= 10) {
const uint32_t __c = __digits << 1;
- _VSTD::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c, 2);
} else {
__result[0] = static_cast<char>('0' + __digits);
}
@@ -164,14 +163,14 @@ _LIBCPP_HIDE_FROM_ABI inline void __append_d_digits(const uint32_t __olength, ui
__digits /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + __olength + 1 - __i - 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength + 1 - __i - 4, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength + 1 - __i - 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength + 1 - __i - 4, __DIGIT_TABLE + __c1, 2);
__i += 4;
}
if (__digits >= 100) {
const uint32_t __c = (__digits % 100) << 1;
__digits /= 100;
- _VSTD::memcpy(__result + __olength + 1 - __i - 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength + 1 - __i - 2, __DIGIT_TABLE + __c, 2);
__i += 2;
}
if (__digits >= 10) {
@@ -190,7 +189,7 @@ _LIBCPP_HIDE_FROM_ABI inline void __append_c_digits(const uint32_t __count, uint
for (; __i < __count - 1; __i += 2) {
const uint32_t __c = (__digits % 100) << 1;
__digits /= 100;
- _VSTD::memcpy(__result + __count - __i - 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __count - __i - 2, __DIGIT_TABLE + __c, 2);
}
if (__i < __count) {
const char __c = static_cast<char>('0' + (__digits % 10));
@@ -200,7 +199,7 @@ _LIBCPP_HIDE_FROM_ABI inline void __append_c_digits(const uint32_t __count, uint
void __append_nine_digits(uint32_t __digits, char* const __result) {
if (__digits == 0) {
- _VSTD::memset(__result, '0', 9);
+ std::memset(__result, '0', 9);
return;
}
@@ -213,8 +212,8 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
__digits /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + 7 - __i, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + 5 - __i, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + 7 - __i, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + 5 - __i, __DIGIT_TABLE + __c1, 2);
}
__result[0] = static_cast<char>('0' + __digits);
}
@@ -251,7 +250,7 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
*_First++ = '0';
if (__precision > 0) {
*_First++ = '.';
- _VSTD::memset(_First, '0', __precision);
+ std::memset(_First, '0', __precision);
_First += __precision;
}
return { _First, errc{} };
@@ -322,14 +321,14 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
if (_Last - _First < static_cast<ptrdiff_t>(__precision)) {
return { _Last, errc::value_too_large };
}
- _VSTD::memset(_First, '0', __precision);
+ std::memset(_First, '0', __precision);
_First += __precision;
} else if (__i < __MIN_BLOCK_2[__idx]) {
__i = __MIN_BLOCK_2[__idx];
if (_Last - _First < static_cast<ptrdiff_t>(9 * __i)) {
return { _Last, errc::value_too_large };
}
- _VSTD::memset(_First, '0', 9 * __i);
+ std::memset(_First, '0', 9 * __i);
_First += 9 * __i;
}
for (; __i < __blocks; ++__i) {
@@ -342,7 +341,7 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
if (_Last - _First < static_cast<ptrdiff_t>(__fill)) {
return { _Last, errc::value_too_large };
}
- _VSTD::memset(_First, '0', __fill);
+ std::memset(_First, '0', __fill);
_First += __fill;
break;
}
@@ -416,7 +415,7 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
if (_Last - _First < static_cast<ptrdiff_t>(__precision)) {
return { _Last, errc::value_too_large };
}
- _VSTD::memset(_First, '0', __precision);
+ std::memset(_First, '0', __precision);
_First += __precision;
}
return { _First, errc{} };
@@ -440,10 +439,10 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
*_First++ = '0';
if (__precision > 0) {
*_First++ = '.';
- _VSTD::memset(_First, '0', __precision);
+ std::memset(_First, '0', __precision);
_First += __precision;
}
- _VSTD::memcpy(_First, "e+00", 4);
+ std::memcpy(_First, "e+00", 4);
_First += 4;
return { _First, errc{} };
}
@@ -589,7 +588,7 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
return { _Last, errc::value_too_large };
}
if (__digits == 0) {
- _VSTD::memset(_First, '0', __maximum);
+ std::memset(_First, '0', __maximum);
} else {
__append_c_digits(__maximum, __digits, _First);
}
@@ -654,11 +653,11 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
if (__exp >= 100) {
const int32_t __c = __exp % 10;
- _VSTD::memcpy(_First, __DIGIT_TABLE + 2 * (__exp / 10), 2);
+ std::memcpy(_First, __DIGIT_TABLE + 2 * (__exp / 10), 2);
_First[2] = static_cast<char>('0' + __c);
_First += 3;
} else {
- _VSTD::memcpy(_First, __DIGIT_TABLE + 2 * __exp, 2);
+ std::memcpy(_First, __DIGIT_TABLE + 2 * __exp, 2);
_First += 2;
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/ryu/d2s.cpp b/contrib/libs/cxxsupp/libcxx/src/ryu/d2s.cpp
index 245c2eb5908..86d0b61848b 100644
--- a/contrib/libs/cxxsupp/libcxx/src/ryu/d2s.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/ryu/d2s.cpp
@@ -154,7 +154,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// The average output length is 16.38 digits, so we check high-to-low.
// Function precondition: __v is not an 18, 19, or 20-digit number.
// (17 digits are sufficient for round-tripping.)
- _LIBCPP_ASSERT(__v < 100000000000000000u, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__v < 100000000000000000u, "");
if (__v >= 10000000000000000u) { return 17; }
if (__v >= 1000000000000000u) { return 16; }
if (__v >= 100000000000000u) { return 15; }
@@ -527,10 +527,10 @@ struct __floating_decimal_64 {
const uint32_t __d0 = (__d % 100) << 1;
const uint32_t __d1 = (__d / 100) << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __d0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __d1, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __d0, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __d1, 2);
}
uint32_t __output2 = static_cast<uint32_t>(_Output);
while (__output2 >= 10000) {
@@ -542,35 +542,35 @@ struct __floating_decimal_64 {
__output2 /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
}
if (__output2 >= 100) {
const uint32_t __c = (__output2 % 100) << 1;
__output2 /= 100;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
}
if (__output2 >= 10) {
const uint32_t __c = __output2 << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
} else {
*--_Mid = static_cast<char>('0' + __output2);
}
if (_Ryu_exponent > 0) { // case "172900" with _Can_use_ryu
// Performance note: it might be more efficient to do this immediately after setting _Mid.
- _VSTD::memset(_First + __olength, '0', static_cast<size_t>(_Ryu_exponent));
+ std::memset(_First + __olength, '0', static_cast<size_t>(_Ryu_exponent));
} else if (_Ryu_exponent == 0) { // case "1729"
// Done!
} else if (_Whole_digits > 0) { // case "17.29"
// Performance note: moving digits might not be optimal.
- _VSTD::memmove(_First, _First + 1, static_cast<size_t>(_Whole_digits));
+ std::memmove(_First, _First + 1, static_cast<size_t>(_Whole_digits));
_First[_Whole_digits] = '.';
} else { // case "0.001729"
// Performance note: a larger memset() followed by overwriting '.' might be more efficient.
_First[0] = '0';
_First[1] = '.';
- _VSTD::memset(_First + 2, '0', static_cast<size_t>(-_Whole_digits));
+ std::memset(_First + 2, '0', static_cast<size_t>(-_Whole_digits));
}
return { _First + _Total_fixed_length, errc{} };
@@ -602,10 +602,10 @@ struct __floating_decimal_64 {
const uint32_t __c1 = (__c / 100) << 1;
const uint32_t __d0 = (__d % 100) << 1;
const uint32_t __d1 = (__d / 100) << 1;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
- _VSTD::memcpy(__result + __olength - __i - 5, __DIGIT_TABLE + __d0, 2);
- _VSTD::memcpy(__result + __olength - __i - 7, __DIGIT_TABLE + __d1, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength - __i - 5, __DIGIT_TABLE + __d0, 2);
+ std::memcpy(__result + __olength - __i - 7, __DIGIT_TABLE + __d1, 2);
__i += 8;
}
uint32_t __output2 = static_cast<uint32_t>(_Output);
@@ -618,14 +618,14 @@ struct __floating_decimal_64 {
__output2 /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
__i += 4;
}
if (__output2 >= 100) {
const uint32_t __c = (__output2 % 100) << 1;
__output2 /= 100;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c, 2);
__i += 2;
}
if (__output2 >= 10) {
@@ -657,11 +657,11 @@ struct __floating_decimal_64 {
if (_Scientific_exponent >= 100) {
const int32_t __c = _Scientific_exponent % 10;
- _VSTD::memcpy(__result + __index, __DIGIT_TABLE + 2 * (_Scientific_exponent / 10), 2);
+ std::memcpy(__result + __index, __DIGIT_TABLE + 2 * (_Scientific_exponent / 10), 2);
__result[__index + 2] = static_cast<char>('0' + __c);
__index += 3;
} else {
- _VSTD::memcpy(__result + __index, __DIGIT_TABLE + 2 * _Scientific_exponent, 2);
+ std::memcpy(__result + __index, __DIGIT_TABLE + 2 * _Scientific_exponent, 2);
__index += 2;
}
@@ -713,7 +713,7 @@ struct __floating_decimal_64 {
return { _Last, errc::value_too_large };
}
- _VSTD::memcpy(_First, "0e+00", 5);
+ std::memcpy(_First, "0e+00", 5);
return { _First + 5, errc{} };
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/ryu/f2s.cpp b/contrib/libs/cxxsupp/libcxx/src/ryu/f2s.cpp
index 3bcfe462c8f..7470dc63d74 100644
--- a/contrib/libs/cxxsupp/libcxx/src/ryu/f2s.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/ryu/f2s.cpp
@@ -86,7 +86,7 @@ inline constexpr uint64_t __FLOAT_POW5_SPLIT[47] = {
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __pow5Factor(uint32_t __value) {
uint32_t __count = 0;
for (;;) {
- _LIBCPP_ASSERT(__value != 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__value != 0, "");
const uint32_t __q = __value / 5;
const uint32_t __r = __value % 5;
if (__r != 0) {
@@ -105,14 +105,14 @@ inline constexpr uint64_t __FLOAT_POW5_SPLIT[47] = {
// Returns true if __value is divisible by 2^__p.
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline bool __multipleOfPowerOf2(const uint32_t __value, const uint32_t __p) {
- _LIBCPP_ASSERT(__value != 0, "");
- _LIBCPP_ASSERT(__p < 32, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__value != 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__p < 32, "");
// __builtin_ctz doesn't appear to be faster here.
return (__value & ((1u << __p) - 1)) == 0;
}
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __mulShift(const uint32_t __m, const uint64_t __factor, const int32_t __shift) {
- _LIBCPP_ASSERT(__shift > 32, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__shift > 32, "");
// The casts here help MSVC to avoid calls to the __allmul library
// function.
@@ -134,7 +134,7 @@ inline constexpr uint64_t __FLOAT_POW5_SPLIT[47] = {
#else // ^^^ 32-bit ^^^ / vvv 64-bit vvv
const uint64_t __sum = (__bits0 >> 32) + __bits1;
const uint64_t __shiftedSum = __sum >> (__shift - 32);
- _LIBCPP_ASSERT(__shiftedSum <= UINT32_MAX, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__shiftedSum <= UINT32_MAX, "");
return static_cast<uint32_t>(__shiftedSum);
#endif // ^^^ 64-bit ^^^
}
@@ -309,8 +309,8 @@ struct __floating_decimal_32 {
// Performance note: Long division appears to be faster than losslessly widening float to double and calling
// __d2fixed_buffered_n(). If __f2fixed_buffered_n() is implemented, it might be faster than long division.
- _LIBCPP_ASSERT(_Exponent2 > 0, "");
- _LIBCPP_ASSERT(_Exponent2 <= 104, ""); // because __ieeeExponent <= 254
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Exponent2 > 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Exponent2 <= 104, ""); // because __ieeeExponent <= 254
// Manually represent _Mantissa2 * 2^_Exponent2 as a large integer. _Mantissa2 is always 24 bits
// (due to the implicit bit), while _Exponent2 indicates a shift of at most 104 bits.
@@ -328,7 +328,7 @@ struct __floating_decimal_32 {
// _Maxidx is the index of the most significant nonzero element.
uint32_t _Maxidx = ((24 + static_cast<uint32_t>(_Exponent2) + 31) / 32) - 1;
- _LIBCPP_ASSERT(_Maxidx < _Data_size, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Maxidx < _Data_size, "");
const uint32_t _Bit_shift = static_cast<uint32_t>(_Exponent2) % 32;
if (_Bit_shift <= 8) { // _Mantissa2's 24 bits don't cross an element boundary
@@ -388,9 +388,9 @@ struct __floating_decimal_32 {
}
}
- _LIBCPP_ASSERT(_Data[0] != 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Data[0] != 0, "");
for (uint32_t _Idx = 1; _Idx < _Data_size; ++_Idx) {
- _LIBCPP_ASSERT(_Data[_Idx] == 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Data[_Idx] == 0, "");
}
const uint32_t _Data_olength = _Data[0] >= 1000000000 ? 10 : __decimalLength9(_Data[0]);
@@ -565,35 +565,35 @@ struct __floating_decimal_32 {
_Output /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
}
if (_Output >= 100) {
const uint32_t __c = (_Output % 100) << 1;
_Output /= 100;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
}
if (_Output >= 10) {
const uint32_t __c = _Output << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
} else {
*--_Mid = static_cast<char>('0' + _Output);
}
if (_Ryu_exponent > 0) { // case "172900" with _Can_use_ryu
// Performance note: it might be more efficient to do this immediately after setting _Mid.
- _VSTD::memset(_First + __olength, '0', static_cast<size_t>(_Ryu_exponent));
+ std::memset(_First + __olength, '0', static_cast<size_t>(_Ryu_exponent));
} else if (_Ryu_exponent == 0) { // case "1729"
// Done!
} else if (_Whole_digits > 0) { // case "17.29"
// Performance note: moving digits might not be optimal.
- _VSTD::memmove(_First, _First + 1, static_cast<size_t>(_Whole_digits));
+ std::memmove(_First, _First + 1, static_cast<size_t>(_Whole_digits));
_First[_Whole_digits] = '.';
} else { // case "0.001729"
// Performance note: a larger memset() followed by overwriting '.' might be more efficient.
_First[0] = '0';
_First[1] = '.';
- _VSTD::memset(_First + 2, '0', static_cast<size_t>(-_Whole_digits));
+ std::memset(_First + 2, '0', static_cast<size_t>(-_Whole_digits));
}
return { _First + _Total_fixed_length, errc{} };
@@ -617,14 +617,14 @@ struct __floating_decimal_32 {
_Output /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
__i += 4;
}
if (_Output >= 100) {
const uint32_t __c = (_Output % 100) << 1;
_Output /= 100;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c, 2);
__i += 2;
}
if (_Output >= 10) {
@@ -654,7 +654,7 @@ struct __floating_decimal_32 {
__result[__index++] = '+';
}
- _VSTD::memcpy(__result + __index, __DIGIT_TABLE + 2 * _Scientific_exponent, 2);
+ std::memcpy(__result + __index, __DIGIT_TABLE + 2 * _Scientific_exponent, 2);
__index += 2;
return { _First + _Total_scientific_length, errc{} };
@@ -673,7 +673,7 @@ struct __floating_decimal_32 {
return { _Last, errc::value_too_large };
}
- _VSTD::memcpy(_First, "0e+00", 5);
+ std::memcpy(_First, "0e+00", 5);
return { _First + 5, errc{} };
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/shared_mutex.cpp b/contrib/libs/cxxsupp/libcxx/src/shared_mutex.cpp
index 73d4dc1c1c7..49a51e02712 100644
--- a/contrib/libs/cxxsupp/libcxx/src/shared_mutex.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/shared_mutex.cpp
@@ -10,106 +10,86 @@
#ifndef _LIBCPP_HAS_NO_THREADS
-#include <shared_mutex>
-#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
-# pragma comment(lib, "pthread")
-#endif
+# include <mutex>
+# include <shared_mutex>
+# if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
+# pragma comment(lib, "pthread")
+# endif
_LIBCPP_BEGIN_NAMESPACE_STD
// Shared Mutex Base
-__shared_mutex_base::__shared_mutex_base()
- : __state_(0)
-{
-}
+__shared_mutex_base::__shared_mutex_base() : __state_(0) {}
// Exclusive ownership
-void
-__shared_mutex_base::lock()
-{
- unique_lock<mutex> lk(__mut_);
- while (__state_ & __write_entered_)
- __gate1_.wait(lk);
- __state_ |= __write_entered_;
- while (__state_ & __n_readers_)
- __gate2_.wait(lk);
+void __shared_mutex_base::lock() {
+ unique_lock<mutex> lk(__mut_);
+ while (__state_ & __write_entered_)
+ __gate1_.wait(lk);
+ __state_ |= __write_entered_;
+ while (__state_ & __n_readers_)
+ __gate2_.wait(lk);
}
-bool
-__shared_mutex_base::try_lock()
-{
- unique_lock<mutex> lk(__mut_);
- if (__state_ == 0)
- {
- __state_ = __write_entered_;
- return true;
- }
- return false;
+bool __shared_mutex_base::try_lock() {
+ unique_lock<mutex> lk(__mut_);
+ if (__state_ == 0) {
+ __state_ = __write_entered_;
+ return true;
+ }
+ return false;
}
-void
-__shared_mutex_base::unlock()
-{
- lock_guard<mutex> _(__mut_);
- __state_ = 0;
- __gate1_.notify_all();
+void __shared_mutex_base::unlock() {
+ lock_guard<mutex> _(__mut_);
+ __state_ = 0;
+ __gate1_.notify_all();
}
// Shared ownership
-void
-__shared_mutex_base::lock_shared()
-{
- unique_lock<mutex> lk(__mut_);
- while ((__state_ & __write_entered_) || (__state_ & __n_readers_) == __n_readers_)
- __gate1_.wait(lk);
- unsigned num_readers = (__state_ & __n_readers_) + 1;
- __state_ &= ~__n_readers_;
- __state_ |= num_readers;
-}
-
-bool
-__shared_mutex_base::try_lock_shared()
-{
- unique_lock<mutex> lk(__mut_);
- unsigned num_readers = __state_ & __n_readers_;
- if (!(__state_ & __write_entered_) && num_readers != __n_readers_)
- {
- ++num_readers;
- __state_ &= ~__n_readers_;
- __state_ |= num_readers;
- return true;
- }
- return false;
+void __shared_mutex_base::lock_shared() {
+ unique_lock<mutex> lk(__mut_);
+ while ((__state_ & __write_entered_) || (__state_ & __n_readers_) == __n_readers_)
+ __gate1_.wait(lk);
+ unsigned num_readers = (__state_ & __n_readers_) + 1;
+ __state_ &= ~__n_readers_;
+ __state_ |= num_readers;
}
-void
-__shared_mutex_base::unlock_shared()
-{
- lock_guard<mutex> _(__mut_);
- unsigned num_readers = (__state_ & __n_readers_) - 1;
+bool __shared_mutex_base::try_lock_shared() {
+ unique_lock<mutex> lk(__mut_);
+ unsigned num_readers = __state_ & __n_readers_;
+ if (!(__state_ & __write_entered_) && num_readers != __n_readers_) {
+ ++num_readers;
__state_ &= ~__n_readers_;
__state_ |= num_readers;
- if (__state_ & __write_entered_)
- {
- if (num_readers == 0)
- __gate2_.notify_one();
- }
- else
- {
- if (num_readers == __n_readers_ - 1)
- __gate1_.notify_one();
- }
+ return true;
+ }
+ return false;
}
+void __shared_mutex_base::unlock_shared() {
+ lock_guard<mutex> _(__mut_);
+ unsigned num_readers = (__state_ & __n_readers_) - 1;
+ __state_ &= ~__n_readers_;
+ __state_ |= num_readers;
+ if (__state_ & __write_entered_) {
+ if (num_readers == 0)
+ __gate2_.notify_one();
+ } else {
+ if (num_readers == __n_readers_ - 1)
+ __gate1_.notify_one();
+ }
+}
// Shared Timed Mutex
// These routines are here for ABI stability
shared_timed_mutex::shared_timed_mutex() : __base_() {}
-void shared_timed_mutex::lock() { return __base_.lock(); }
+void shared_timed_mutex::lock() { return __base_.lock(); }
bool shared_timed_mutex::try_lock() { return __base_.try_lock(); }
-void shared_timed_mutex::unlock() { return __base_.unlock(); }
+void shared_timed_mutex::unlock() { return __base_.unlock(); }
void shared_timed_mutex::lock_shared() { return __base_.lock_shared(); }
bool shared_timed_mutex::try_lock_shared() { return __base_.try_lock_shared(); }
void shared_timed_mutex::unlock_shared() { return __base_.unlock_shared(); }
diff --git a/contrib/libs/cxxsupp/libcxx/src/std_stream.h b/contrib/libs/cxxsupp/libcxx/src/std_stream.h
new file mode 100644
index 00000000000..0febf42c9ff
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/std_stream.h
@@ -0,0 +1,447 @@
+// -*- 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_STD_STREAM_H
+#define _LIBCPP_STD_STREAM_H
+
+#include <__config>
+#include <__locale>
+#include <cstdio>
+#include <istream>
+#include <ostream>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+static const int __limit = 8;
+
+// __stdinbuf
+
+template <class _CharT>
+class _LIBCPP_HIDDEN __stdinbuf
+ : public basic_streambuf<_CharT, char_traits<_CharT> >
+{
+public:
+ typedef _CharT char_type;
+ typedef char_traits<char_type> traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+ typedef typename traits_type::state_type state_type;
+
+ __stdinbuf(FILE* __fp, state_type* __st);
+
+protected:
+ virtual int_type underflow();
+ virtual int_type uflow();
+ virtual int_type pbackfail(int_type __c = traits_type::eof());
+ virtual void imbue(const locale& __loc);
+
+private:
+
+ FILE* __file_;
+ const codecvt<char_type, char, state_type>* __cv_;
+ state_type* __st_;
+ int __encoding_;
+ int_type __last_consumed_;
+ bool __last_consumed_is_next_;
+ bool __always_noconv_;
+
+#if defined(_LIBCPP_WIN32API)
+ static constexpr bool __is_win32api_wide_char = !is_same_v<_CharT, char>;
+#else
+ static constexpr bool __is_win32api_wide_char = false;
+#endif
+
+ __stdinbuf(const __stdinbuf&);
+ __stdinbuf& operator=(const __stdinbuf&);
+
+ int_type __getchar(bool __consume);
+};
+
+template <class _CharT>
+__stdinbuf<_CharT>::__stdinbuf(FILE* __fp, state_type* __st)
+ : __file_(__fp),
+ __st_(__st),
+ __last_consumed_(traits_type::eof()),
+ __last_consumed_is_next_(false)
+{
+ imbue(this->getloc());
+ // On Windows, in wchar_t mode, ignore the codecvt from the locale by
+ // default and assume noconv; this passes wchar_t through unmodified from
+ // getwc. If the user sets a custom locale with imbue(), that gets honored,
+ // the IO is done with getc() and converted with the provided codecvt.
+ if constexpr (__is_win32api_wide_char)
+ __always_noconv_ = true;
+}
+
+template <class _CharT>
+void
+__stdinbuf<_CharT>::imbue(const locale& __loc)
+{
+ __cv_ = &use_facet<codecvt<char_type, char, state_type> >(__loc);
+ __encoding_ = __cv_->encoding();
+ __always_noconv_ = __cv_->always_noconv();
+ if (__encoding_ > __limit)
+ __throw_runtime_error("unsupported locale for standard input");
+}
+
+template <class _CharT>
+typename __stdinbuf<_CharT>::int_type
+__stdinbuf<_CharT>::underflow()
+{
+ return __getchar(false);
+}
+
+template <class _CharT>
+typename __stdinbuf<_CharT>::int_type
+__stdinbuf<_CharT>::uflow()
+{
+ return __getchar(true);
+}
+
+static bool __do_getc(FILE *__fp, char *__pbuf) {
+ int __c = getc(__fp);
+ if (__c == EOF)
+ return false;
+ *__pbuf = static_cast<char>(__c);
+ return true;
+}
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+static bool __do_getc(FILE *__fp, wchar_t *__pbuf) {
+ wint_t __c = getwc(__fp);
+ if (__c == WEOF)
+ return false;
+ *__pbuf = static_cast<wchar_t>(__c);
+ return true;
+}
+#endif
+
+static bool __do_ungetc(int __c, FILE *__fp, char __dummy) {
+ if (ungetc(__c, __fp) == EOF)
+ return false;
+ return true;
+}
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+static bool __do_ungetc(std::wint_t __c, FILE *__fp, wchar_t __dummy) {
+ if (ungetwc(__c, __fp) == WEOF)
+ return false;
+ return true;
+}
+#endif
+
+template <class _CharT>
+typename __stdinbuf<_CharT>::int_type
+__stdinbuf<_CharT>::__getchar(bool __consume)
+{
+ if (__last_consumed_is_next_)
+ {
+ int_type __result = __last_consumed_;
+ if (__consume)
+ {
+ __last_consumed_ = traits_type::eof();
+ __last_consumed_is_next_ = false;
+ }
+ return __result;
+ }
+ if (__always_noconv_) {
+ char_type __1buf;
+ if (!__do_getc(__file_, &__1buf))
+ return traits_type::eof();
+ if (!__consume)
+ {
+ if (!__do_ungetc(traits_type::to_int_type(__1buf), __file_, __1buf))
+ return traits_type::eof();
+ }
+ else
+ __last_consumed_ = traits_type::to_int_type(__1buf);
+ return traits_type::to_int_type(__1buf);
+ }
+
+ char __extbuf[__limit];
+ int __nread = _VSTD::max(1, __encoding_);
+ for (int __i = 0; __i < __nread; ++__i)
+ {
+ int __c = getc(__file_);
+ if (__c == EOF)
+ return traits_type::eof();
+ __extbuf[__i] = static_cast<char>(__c);
+ }
+ char_type __1buf;
+ const char* __enxt;
+ char_type* __inxt;
+ codecvt_base::result __r;
+ do
+ {
+ state_type __sv_st = *__st_;
+ __r = __cv_->in(*__st_, __extbuf, __extbuf + __nread, __enxt,
+ &__1buf, &__1buf + 1, __inxt);
+ switch (__r)
+ {
+ case _VSTD::codecvt_base::ok:
+ break;
+ case codecvt_base::partial:
+ *__st_ = __sv_st;
+ if (__nread == sizeof(__extbuf))
+ return traits_type::eof();
+ {
+ int __c = getc(__file_);
+ if (__c == EOF)
+ return traits_type::eof();
+ __extbuf[__nread] = static_cast<char>(__c);
+ }
+ ++__nread;
+ break;
+ case codecvt_base::error:
+ return traits_type::eof();
+ case _VSTD::codecvt_base::noconv:
+ __1buf = static_cast<char_type>(__extbuf[0]);
+ break;
+ }
+ } while (__r == _VSTD::codecvt_base::partial);
+ if (!__consume)
+ {
+ for (int __i = __nread; __i > 0;)
+ {
+ if (ungetc(traits_type::to_int_type(__extbuf[--__i]), __file_) == EOF)
+ return traits_type::eof();
+ }
+ }
+ else
+ __last_consumed_ = traits_type::to_int_type(__1buf);
+ return traits_type::to_int_type(__1buf);
+}
+
+template <class _CharT>
+typename __stdinbuf<_CharT>::int_type
+__stdinbuf<_CharT>::pbackfail(int_type __c)
+{
+ if (traits_type::eq_int_type(__c, traits_type::eof()))
+ {
+ if (!__last_consumed_is_next_)
+ {
+ __c = __last_consumed_;
+ __last_consumed_is_next_ = !traits_type::eq_int_type(__last_consumed_,
+ traits_type::eof());
+ }
+ return __c;
+ }
+ if (__always_noconv_ && __last_consumed_is_next_) {
+ if (!__do_ungetc(__last_consumed_, __file_,
+ traits_type::to_char_type(__last_consumed_)))
+ return traits_type::eof();
+ } else if (__last_consumed_is_next_) {
+ char __extbuf[__limit];
+ char* __enxt;
+ const char_type __ci = traits_type::to_char_type(__last_consumed_);
+ const char_type* __inxt;
+ switch (__cv_->out(*__st_, &__ci, &__ci + 1, __inxt,
+ __extbuf, __extbuf + sizeof(__extbuf), __enxt))
+ {
+ case _VSTD::codecvt_base::ok:
+ break;
+ case _VSTD::codecvt_base::noconv:
+ __extbuf[0] = static_cast<char>(__last_consumed_);
+ __enxt = __extbuf + 1;
+ break;
+ case codecvt_base::partial:
+ case codecvt_base::error:
+ return traits_type::eof();
+ }
+ while (__enxt > __extbuf)
+ if (ungetc(*--__enxt, __file_) == EOF)
+ return traits_type::eof();
+ }
+ __last_consumed_ = __c;
+ __last_consumed_is_next_ = true;
+ return __c;
+}
+
+// __stdoutbuf
+
+template <class _CharT>
+class _LIBCPP_HIDDEN __stdoutbuf
+ : public basic_streambuf<_CharT, char_traits<_CharT> >
+{
+public:
+ typedef _CharT char_type;
+ typedef char_traits<char_type> traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+ typedef typename traits_type::state_type state_type;
+
+ __stdoutbuf(FILE* __fp, state_type* __st);
+
+protected:
+ virtual int_type overflow (int_type __c = traits_type::eof());
+ virtual streamsize xsputn(const char_type* __s, streamsize __n);
+ virtual int sync();
+ virtual void imbue(const locale& __loc);
+
+private:
+ FILE* __file_;
+ const codecvt<char_type, char, state_type>* __cv_;
+ state_type* __st_;
+ bool __always_noconv_;
+
+#if defined(_LIBCPP_WIN32API)
+ static constexpr bool __is_win32api_wide_char = !is_same_v<_CharT, char>;
+#else
+ static constexpr bool __is_win32api_wide_char = false;
+#endif
+
+ __stdoutbuf(const __stdoutbuf&);
+ __stdoutbuf& operator=(const __stdoutbuf&);
+};
+
+template <class _CharT>
+__stdoutbuf<_CharT>::__stdoutbuf(FILE* __fp, state_type* __st)
+ : __file_(__fp),
+ __cv_(&use_facet<codecvt<char_type, char, state_type> >(this->getloc())),
+ __st_(__st),
+ __always_noconv_(__cv_->always_noconv())
+{
+ // On Windows, in wchar_t mode, ignore the codecvt from the locale by
+ // default and assume noconv; this passes wchar_t through unmodified to
+ // fputwc, which handles it correctly depending on the actual mode of the
+ // output stream. If the user sets a custom locale with imbue(), that
+ // gets honored.
+ if constexpr (__is_win32api_wide_char)
+ __always_noconv_ = true;
+}
+
+static bool __do_fputc(char __c, FILE* __fp) {
+ if (fwrite(&__c, sizeof(__c), 1, __fp) != 1)
+ return false;
+ return true;
+}
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+static bool __do_fputc(wchar_t __c, FILE* __fp) {
+ // fputwc works regardless of wide/narrow mode of stdout, while
+ // fwrite of wchar_t only works if the stream actually has been set
+ // into wide mode.
+ if (fputwc(__c, __fp) == WEOF)
+ return false;
+ return true;
+}
+#endif
+
+template <class _CharT>
+typename __stdoutbuf<_CharT>::int_type
+__stdoutbuf<_CharT>::overflow(int_type __c)
+{
+ char __extbuf[__limit];
+ char_type __1buf;
+ if (!traits_type::eq_int_type(__c, traits_type::eof()))
+ {
+ __1buf = traits_type::to_char_type(__c);
+ if (__always_noconv_)
+ {
+ if (!__do_fputc(__1buf, __file_))
+ return traits_type::eof();
+ }
+ else
+ {
+ char* __extbe = __extbuf;
+ codecvt_base::result __r;
+ char_type* pbase = &__1buf;
+ char_type* pptr = pbase + 1;
+ do
+ {
+ const char_type* __e;
+ __r = __cv_->out(*__st_, pbase, pptr, __e,
+ __extbuf,
+ __extbuf + sizeof(__extbuf),
+ __extbe);
+ if (__e == pbase)
+ return traits_type::eof();
+ if (__r == codecvt_base::noconv)
+ {
+ if (fwrite(pbase, 1, 1, __file_) != 1)
+ return traits_type::eof();
+ }
+ else if (__r == codecvt_base::ok || __r == codecvt_base::partial)
+ {
+ size_t __nmemb = static_cast<size_t>(__extbe - __extbuf);
+ if (fwrite(__extbuf, 1, __nmemb, __file_) != __nmemb)
+ return traits_type::eof();
+ if (__r == codecvt_base::partial)
+ {
+ pbase = const_cast<char_type*>(__e);
+ }
+ }
+ else
+ return traits_type::eof();
+ } while (__r == codecvt_base::partial);
+ }
+ }
+ return traits_type::not_eof(__c);
+}
+
+template <class _CharT>
+streamsize
+__stdoutbuf<_CharT>::xsputn(const char_type* __s, streamsize __n)
+{
+ // For wchar_t on Windows, don't call fwrite(), but write characters one
+ // at a time with fputwc(); that works both when stdout is in the default
+ // mode and when it is set to Unicode mode.
+ if (__always_noconv_ && !__is_win32api_wide_char)
+ return fwrite(__s, sizeof(char_type), __n, __file_);
+ streamsize __i = 0;
+ for (; __i < __n; ++__i, ++__s)
+ if (overflow(traits_type::to_int_type(*__s)) == traits_type::eof())
+ break;
+ return __i;
+}
+
+template <class _CharT>
+int
+__stdoutbuf<_CharT>::sync()
+{
+ char __extbuf[__limit];
+ codecvt_base::result __r;
+ do
+ {
+ char* __extbe;
+ __r = __cv_->unshift(*__st_, __extbuf,
+ __extbuf + sizeof(__extbuf),
+ __extbe);
+ size_t __nmemb = static_cast<size_t>(__extbe - __extbuf);
+ if (fwrite(__extbuf, 1, __nmemb, __file_) != __nmemb)
+ return -1;
+ } while (__r == codecvt_base::partial);
+ if (__r == codecvt_base::error)
+ return -1;
+ if (fflush(__file_))
+ return -1;
+ return 0;
+}
+
+template <class _CharT>
+void
+__stdoutbuf<_CharT>::imbue(const locale& __loc)
+{
+ sync();
+ __cv_ = &use_facet<codecvt<char_type, char, state_type> >(__loc);
+ __always_noconv_ = __cv_->always_noconv();
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP_STD_STREAM_H
diff --git a/contrib/libs/cxxsupp/libcxx/src/stdexcept.cpp b/contrib/libs/cxxsupp/libcxx/src/stdexcept.cpp
index d08b6740db1..d5c91735768 100644
--- a/contrib/libs/cxxsupp/libcxx/src/stdexcept.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/stdexcept.cpp
@@ -9,7 +9,6 @@
#include <new>
#include <stdexcept>
#include <string>
-#include <system_error>
#ifdef _LIBCPP_ABI_VCRUNTIME
#include "support/runtime/stdexcept_vcruntime.ipp"
diff --git a/contrib/libs/cxxsupp/libcxx/src/string.cpp b/contrib/libs/cxxsupp/libcxx/src/string.cpp
index db211b22427..4f3de555e3a 100644
--- a/contrib/libs/cxxsupp/libcxx/src/string.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/string.cpp
@@ -12,7 +12,6 @@
#include <cstdlib>
#include <limits>
#include <stdexcept>
-#include <stdio.h>
#include <string>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -61,22 +60,12 @@ template string operator+<char, char_traits<char>, allocator<char>>(char const*,
namespace
{
-template<typename T>
-inline void throw_helper(const string& msg) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw T(msg);
-#else
- fprintf(stderr, "%s\n", msg.c_str());
- _VSTD::abort();
-#endif
-}
-
inline void throw_from_string_out_of_range(const string& func) {
- throw_helper<out_of_range>(func + ": out of range");
+ std::__throw_out_of_range((func + ": out of range").c_str());
}
inline void throw_from_string_invalid_arg(const string& func) {
- throw_helper<invalid_argument>(func + ": no conversion");
+ std::__throw_invalid_argument((func + ": no conversion").c_str());
}
// as_integer
@@ -357,7 +346,7 @@ S i_to_string(V v) {
constexpr size_t bufsize = numeric_limits<V>::digits10 + 2; // +1 for minus, +1 for digits10
char buf[bufsize];
const auto res = to_chars(buf, buf + bufsize, v);
- _LIBCPP_ASSERT(res.ec == errc(), "bufsize must be large enough to accomodate the value");
+ _LIBCPP_ASSERT_INTERNAL(res.ec == errc(), "bufsize must be large enough to accomodate the value");
return S(buf, res.ptr);
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/strstream.cpp b/contrib/libs/cxxsupp/libcxx/src/strstream.cpp
index 87c235a97a2..bc56cafa8f8 100644
--- a/contrib/libs/cxxsupp/libcxx/src/strstream.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/strstream.cpp
@@ -173,7 +173,7 @@ strstreambuf::overflow(int_type __c)
if (buf == nullptr)
return int_type(EOF);
if (old_size != 0) {
- _LIBCPP_ASSERT(eback(), "overflow copying from NULL");
+ _LIBCPP_ASSERT_UNCATEGORIZED(eback(), "overflow copying from NULL");
memcpy(buf, eback(), static_cast<size_t>(old_size));
}
ptrdiff_t ninp = gptr() - eback();
diff --git a/contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_fallback.ipp b/contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_fallback.ipp
index 100ee6da5e1..c14c3753385 100644
--- a/contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_fallback.ipp
+++ b/contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_fallback.ipp
@@ -52,15 +52,15 @@ _LIBCPP_NORETURN
void
terminate() noexcept
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
(*get_terminate())();
// handler should not return
fprintf(stderr, "terminate_handler unexpectedly returned\n");
::abort();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -68,7 +68,7 @@ terminate() noexcept
fprintf(stderr, "terminate_handler unexpectedly threw an exception\n");
::abort();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
#endif // !__EMSCRIPTEN__
diff --git a/contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_msvc.ipp b/contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_msvc.ipp
index 7e36c7068a2..0114d5adee1 100644
--- a/contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_msvc.ipp
+++ b/contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_msvc.ipp
@@ -57,15 +57,15 @@ terminate_handler get_terminate() noexcept {
_LIBCPP_NORETURN
void terminate() noexcept
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
(*get_terminate())();
// handler should not return
fprintf(stderr, "terminate_handler unexpectedly returned\n");
::abort();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -73,7 +73,7 @@ void terminate() noexcept
fprintf(stderr, "terminate_handler unexpectedly threw an exception\n");
::abort();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; }
diff --git a/contrib/libs/cxxsupp/libcxx/src/support/runtime/new_handler_fallback.ipp b/contrib/libs/cxxsupp/libcxx/src/support/runtime/new_handler_fallback.ipp
deleted file mode 100644
index 2ec408327d6..00000000000
--- a/contrib/libs/cxxsupp/libcxx/src/support/runtime/new_handler_fallback.ipp
+++ /dev/null
@@ -1,26 +0,0 @@
-// -*- 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
-//
-//===----------------------------------------------------------------------===//
-
-namespace std {
-
-static constinit std::new_handler __new_handler = nullptr;
-
-new_handler
-set_new_handler(new_handler handler) noexcept
-{
- return __libcpp_atomic_exchange(&__new_handler, handler);
-}
-
-new_handler
-get_new_handler() noexcept
-{
- return __libcpp_atomic_load(&__new_handler);
-}
-
-} // namespace std
diff --git a/contrib/libs/cxxsupp/libcxx/src/support/solaris/README b/contrib/libs/cxxsupp/libcxx/src/support/solaris/README
deleted file mode 100644
index 89c887a3b4a..00000000000
--- a/contrib/libs/cxxsupp/libcxx/src/support/solaris/README
+++ /dev/null
@@ -1,4 +0,0 @@
-This directory contains a partial implementation of the xlocale APIs for
-Solaris. Some portions are lifted from FreeBSD libc, and so are covered by a
-2-clause BSD license instead of the MIT/UUIC license that the rest of libc++ is
-distributed under.
diff --git a/contrib/libs/cxxsupp/libcxx/src/support/win32/locale_win32.cpp b/contrib/libs/cxxsupp/libcxx/src/support/win32/locale_win32.cpp
index 67f4d1341ab..2543686c907 100644
--- a/contrib/libs/cxxsupp/libcxx/src/support/win32/locale_win32.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/support/win32/locale_win32.cpp
@@ -11,6 +11,8 @@
#include <memory>
#include <type_traits>
+#include <__locale_dir/locale_base_api/locale_guard.h>
+
int __libcpp_vasprintf(char **sptr, const char *__restrict fmt, va_list ap);
using std::__libcpp_locale_guard;
diff --git a/contrib/libs/cxxsupp/libcxx/src/system_error.cpp b/contrib/libs/cxxsupp/libcxx/src/system_error.cpp
index ba5fa8f30b2..7875f59d880 100644
--- a/contrib/libs/cxxsupp/libcxx/src/system_error.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/system_error.cpp
@@ -12,6 +12,7 @@
#endif
#include <__assert>
+#include <__verbose_abort>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
@@ -103,7 +104,7 @@ handle_strerror_r_return(int strerror_return, char *buffer) {
if (new_errno == EINVAL)
return "";
- _LIBCPP_ASSERT(new_errno == ERANGE, "unexpected error from ::strerror_r");
+ _LIBCPP_ASSERT_UNCATEGORIZED(new_errno == ERANGE, "unexpected error from ::strerror_r");
// FIXME maybe? 'strerror_buff_size' is likely to exceed the
// maximum error size so ERANGE shouldn't be returned.
std::abort();
@@ -286,12 +287,10 @@ system_error::~system_error() noexcept
void
__throw_system_error(int ev, const char* what_arg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw system_error(error_code(ev, system_category()), what_arg);
#else
- (void)ev;
- (void)what_arg;
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("system_error was thrown in -fno-exceptions mode with error %i and message \"%s\"", ev, what_arg);
#endif
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/thread.cpp b/contrib/libs/cxxsupp/libcxx/src/thread.cpp
index ec4f65f9823..184b5ae8a18 100644
--- a/contrib/libs/cxxsupp/libcxx/src/thread.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/thread.cpp
@@ -10,6 +10,8 @@
#ifndef _LIBCPP_HAS_NO_THREADS
+#include <__thread/poll_with_backoff.h>
+#include <__thread/timed_backoff_policy.h>
#include <exception>
#include <future>
#include <limits>
diff --git a/contrib/libs/cxxsupp/libcxx/src/utility.cpp b/contrib/libs/cxxsupp/libcxx/src/utility.cpp
deleted file mode 100644
index 44433d11d7a..00000000000
--- a/contrib/libs/cxxsupp/libcxx/src/utility.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#include <utility>
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-const piecewise_construct_t piecewise_construct{};
-
-_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/src/valarray.cpp b/contrib/libs/cxxsupp/libcxx/src/valarray.cpp
index 5d63bc11846..f377e0f4e87 100644
--- a/contrib/libs/cxxsupp/libcxx/src/valarray.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/valarray.cpp
@@ -12,8 +12,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// These two symbols are part of the v1 ABI but not part of the >=v2 ABI.
#if _LIBCPP_ABI_VERSION == 1
-template _LIBCPP_FUNC_VIS valarray<size_t>::valarray(size_t);
-template _LIBCPP_FUNC_VIS valarray<size_t>::~valarray();
+template _LIBCPP_EXPORTED_FROM_ABI valarray<size_t>::valarray(size_t);
+template _LIBCPP_EXPORTED_FROM_ABI valarray<size_t>::~valarray();
#endif
template void valarray<size_t>::resize(size_t, size_t);
diff --git a/contrib/libs/cxxsupp/libcxx/ya.make b/contrib/libs/cxxsupp/libcxx/ya.make
index a1e7dad497c..e4bb75bacfd 100644
--- a/contrib/libs/cxxsupp/libcxx/ya.make
+++ b/contrib/libs/cxxsupp/libcxx/ya.make
@@ -5,7 +5,6 @@ LIBRARY()
LICENSE(
Apache-2.0 AND
Apache-2.0 WITH LLVM-exception AND
- BSD-2-Clause AND
BSL-1.0 AND
MIT AND
NCSA AND
@@ -16,7 +15,7 @@ LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
VERSION(2023-06-02)
-ORIGINAL_SOURCE(https://github.com/llvm/llvm-project/archive/185b81e034ba60081023b6e59504dfffb560f3e3.tar.gz)
+ORIGINAL_SOURCE(https://github.com/llvm/llvm-project/archive/308c816de5a47dd7d08a29f91b68381b45ed3552.tar.gz)
ADDINCL(
GLOBAL contrib/libs/cxxsupp/libcxx/include
@@ -214,6 +213,7 @@ ENDIF()
SRCS(
src/algorithm.cpp
+ src/algorithm_old.cpp
src/any.cpp
src/atomic.cpp
src/barrier.cpp
@@ -222,10 +222,13 @@ SRCS(
src/chrono.cpp
src/condition_variable.cpp
src/condition_variable_destructor.cpp
- src/debug.cpp
src/exception.cpp
+ src/filesystem/directory_entry.cpp
src/filesystem/directory_iterator.cpp
+ src/filesystem/filesystem_clock.cpp
+ src/filesystem/filesystem_error.cpp
src/filesystem/operations.cpp
+ src/filesystem/path.cpp
src/functional.cpp
src/future.cpp
src/hash.cpp
@@ -239,6 +242,7 @@ SRCS(
src/mutex.cpp
src/mutex_destructor.cpp
src/optional.cpp
+ src/print.cpp
src/random.cpp
src/random_shuffle.cpp
src/regex.cpp
@@ -252,24 +256,17 @@ SRCS(
src/system_error.cpp
src/thread.cpp
src/typeinfo.cpp
- src/utility.cpp
src/valarray.cpp
src/variant.cpp
src/vector.cpp
src/verbose_abort.cpp
)
-IF (NOT GCC)
- # compiling src/format.cpp requires -std=c++20,
- # yet our GCC version it too auld for this.
- SRCS(
- src/format.cpp
- )
-ENDIF()
-
IF (NOT OS_WINDOWS)
SRCS(
src/new.cpp
+ src/new_handler.cpp
+ src/new_helpers.cpp
)
ENDIF()
diff --git a/contrib/libs/cxxsupp/libcxxabi/src/fallback_malloc.cpp b/contrib/libs/cxxsupp/libcxxabi/src/fallback_malloc.cpp
index 7e356d9fe47..0443fd9e62a 100644
--- a/contrib/libs/cxxsupp/libcxxabi/src/fallback_malloc.cpp
+++ b/contrib/libs/cxxsupp/libcxxabi/src/fallback_malloc.cpp
@@ -15,6 +15,10 @@
#endif
#endif
+#ifdef __EMSCRIPTEN__
+#include <__memory/aligned_alloc.h>
+#endif
+
#include <stdlib.h> // for malloc, calloc, free
#include <string.h> // for memset
#include <new> // for std::__libcpp_aligned_{alloc,free}
diff --git a/contrib/libs/cxxsupp/libcxxabi/src/stdlib_new_delete.cpp b/contrib/libs/cxxsupp/libcxxabi/src/stdlib_new_delete.cpp
index 48e509ba2b3..3a04ad39b1f 100644
--- a/contrib/libs/cxxsupp/libcxxabi/src/stdlib_new_delete.cpp
+++ b/contrib/libs/cxxsupp/libcxxabi/src/stdlib_new_delete.cpp
@@ -12,6 +12,10 @@
#include <new>
#include <cstdlib>
+#ifdef __EMSCRIPTEN__
+#include <__memory/aligned_alloc.h>
+#endif
+
#if !defined(_THROW_BAD_ALLOC) || !defined(_LIBCXXABI_WEAK)
#error The _THROW_BAD_ALLOC and _LIBCXXABI_WEAK libc++ macros must \
already be defined by libc++.
diff --git a/contrib/libs/cxxsupp/libcxxabi/ya.make b/contrib/libs/cxxsupp/libcxxabi/ya.make
index d71d5b8ec25..1f739ea96f7 100644
--- a/contrib/libs/cxxsupp/libcxxabi/ya.make
+++ b/contrib/libs/cxxsupp/libcxxabi/ya.make
@@ -1,4 +1,4 @@
-# Generated by devtools/yamaker from nixpkgs 22.11.
+# Generated by devtools/yamaker from nixpkgs 23.05.
LIBRARY()
@@ -15,6 +15,10 @@ VERSION(14.0.6)
ORIGINAL_SOURCE(https://github.com/llvm/llvm-project/archive/llvmorg-14.0.6.tar.gz)
+PEERDIR(
+ library/cpp/sanitizer/include
+)
+
ADDINCL(
contrib/libs/cxxsupp/libcxxabi/include
contrib/libs/cxxsupp/libcxx/include
@@ -56,4 +60,12 @@ SRC_C_PIC(
-fno-lto
)
+IF (OS_EMSCRIPTEN)
+ CFLAGS(
+ -D_LIBCPP_SAFE_STATIC=
+ -D_LIBCXXABI_DTOR_FUNC=
+ -D__USING_WASM_EXCEPTIONS__
+ )
+ENDIF()
+
END()
diff --git a/contrib/libs/expat/Changes b/contrib/libs/expat/Changes
index e6717105695..a7d4caf9ac8 100644
--- a/contrib/libs/expat/Changes
+++ b/contrib/libs/expat/Changes
@@ -2,6 +2,120 @@ NOTE: We are looking for help with a few things:
https://github.com/libexpat/libexpat/labels/help%20wanted
If you can help, please get in touch. Thanks!
+Release 2.6.0 Tue February 6 2024
+ Security fixes:
+ #789 #814 CVE-2023-52425 -- Fix quadratic runtime issues with big tokens
+ that can cause denial of service, in partial where
+ dealing with compressed XML input. Applications
+ that parsed a document in one go -- a single call to
+ functions XML_Parse or XML_ParseBuffer -- were not affected.
+ The smaller the chunks/buffers you use for parsing
+ previously, the bigger the problem prior to the fix.
+ Backporters should be careful to no omit parts of
+ pull request #789 and to include earlier pull request #771,
+ in order to not break the fix.
+ #777 CVE-2023-52426 -- Fix billion laughs attacks for users
+ compiling *without* XML_DTD defined (which is not common).
+ Users with XML_DTD defined have been protected since
+ Expat >=2.4.0 (and that was CVE-2013-0340 back then).
+
+ Bug fixes:
+ #753 Fix parse-size-dependent "invalid token" error for
+ external entities that start with a byte order mark
+ #780 Fix NULL pointer dereference in setContext via
+ XML_ExternalEntityParserCreate for compilation with
+ XML_DTD undefined
+ #812 #813 Protect against closing entities out of order
+
+ Other changes:
+ #723 Improve support for arc4random/arc4random_buf
+ #771 #788 Improve buffer growth in XML_GetBuffer and XML_Parse
+ #761 #770 xmlwf: Support --help and --version
+ #759 #770 xmlwf: Support custom buffer size for XML_GetBuffer and read
+ #744 xmlwf: Improve language and URL clickability in help output
+ #673 examples: Add new example "element_declarations.c"
+ #764 Be stricter about macro XML_CONTEXT_BYTES at build time
+ #765 Make inclusion to expat_config.h consistent
+ #726 #727 Autotools: configure.ac: Support --disable-maintainer-mode
+ #678 #705 ..
+ #706 #733 #792 Autotools: Sync CMake templates with CMake 3.26
+ #795 Autotools: Make installation of shipped man page doc/xmlwf.1
+ independent of docbook2man availability
+ #815 Autotools|CMake: Add missing -DXML_STATIC to pkg-config file
+ section "Cflags.private" in order to fix compilation
+ against static libexpat using pkg-config on Windows
+ #724 #751 Autotools|CMake: Require a C99 compiler
+ (a de-facto requirement already since Expat 2.2.2 of 2017)
+ #793 Autotools|CMake: Fix PACKAGE_BUGREPORT variable
+ #750 #786 Autotools|CMake: Make test suite require a C++11 compiler
+ #749 CMake: Require CMake >=3.5.0
+ #672 CMake: Lowercase off_t and size_t to help a bug in Meson
+ #746 CMake: Sort xmlwf sources alphabetically
+ #785 CMake|Windows: Fix generation of DLL file version info
+ #790 CMake: Build tests/benchmark/benchmark.c as well for
+ a build with -DEXPAT_BUILD_TESTS=ON
+ #745 #757 docs: Document the importance of isFinal + adjust tests
+ accordingly
+ #736 docs: Improve use of "NULL" and "null"
+ #713 docs: Be specific about version of XML (XML 1.0r4)
+ and version of C (C99); (XML 1.0r5 will need a sponsor.)
+ #762 docs: reference.html: Promote function XML_ParseBuffer more
+ #779 docs: reference.html: Add HTML anchors to XML_* macros
+ #760 docs: reference.html: Upgrade to OK.css 1.2.0
+ #763 #739 docs: Fix typos
+ #696 docs|CI: Use HTTPS URLs instead of HTTP at various places
+ #669 #670 ..
+ #692 #703 ..
+ #733 #772 Address compiler warnings
+ #798 #800 Address clang-tidy warnings
+ #775 #776 Version info bumped from 9:10:8 (libexpat*.so.1.8.10)
+ to 10:0:9 (libexpat*.so.1.9.0); see https://verbump.de/
+ for what these numbers do
+
+ Infrastructure:
+ #700 #701 docs: Document security policy in file SECURITY.md
+ #766 docs: Improve parse buffer variables in-code documentation
+ #674 #738 ..
+ #740 #747 ..
+ #748 #781 #782 Refactor coverage and conformance tests
+ #714 #716 Refactor debug level variables to unsigned long
+ #671 Improve handling of empty environment variable value
+ in function getDebugLevel (without visible user effect)
+ #755 #774 ..
+ #758 #783 ..
+ #784 #787 tests: Improve test coverage with regard to parse chunk size
+ #660 #797 #801 Fuzzing: Improve fuzzing coverage
+ #367 #799 Fuzzing|CI: Start running OSS-Fuzz fuzzing regression tests
+ #698 #721 CI: Resolve some Travis CI leftovers
+ #669 CI: Be robust towards absence of Git tags
+ #693 #694 CI: Set permissions to "contents: read" for security
+ #709 CI: Pin all GitHub Actions to specific commits for security
+ #739 CI: Reject spelling errors using codespell
+ #798 CI: Enforce clang-tidy clean code
+ #773 #808 ..
+ #809 #810 CI: Upgrade Clang from 15 to 18
+ #796 CI: Start using Clang's Control Flow Integrity sanitizer
+ #675 #720 #722 CI: Adapt to breaking changes in GitHub Actions Ubuntu images
+ #689 CI: Adapt to breaking changes in Clang/LLVM Debian packaging
+ #763 CI: Adapt to breaking changes in codespell
+ #803 CI: Adapt to breaking changes in Cppcheck
+
+ Special thanks to:
+ Ivan Galkin
+ Joyce Brum
+ Philippe Antoine
+ Rhodri James
+ Snild Dolkow
+ spookyahell
+ Steven Garske
+ and
+ Clang AddressSanitizer
+ Clang UndefinedBehaviorSanitizer
+ codespell
+ GCC Farm Project
+ OSS-Fuzz
+ Sony Mobile
+
Release 2.5.0 Tue October 25 2022
Security fixes:
#616 #649 #650 CVE-2022-43680 -- Fix heap use-after-free after overeager
@@ -11,7 +125,7 @@ Release 2.5.0 Tue October 25 2022
arbitrary code execution.
Bug fixes:
- #612 #645 Fix curruption from undefined entities
+ #612 #645 Fix corruption from undefined entities
#613 #654 Fix case when parsing was suspended while processing nested
entities
#616 #652 #653 Stop leaking opening tag bindings after a closing tag
@@ -318,7 +432,7 @@ Release 2.4.2 Sun December 19 2021
see https://verbump.de/ for what these numbers do
Special thanks to:
- Dong-hee Na
+ Donghee Na
Joergen Ibsen
Kai Pastor
diff --git a/contrib/libs/expat/README.md b/contrib/libs/expat/README.md
index e5e237fc949..43c4f4f3dbb 100644
--- a/contrib/libs/expat/README.md
+++ b/contrib/libs/expat/README.md
@@ -1,13 +1,14 @@
-[![Run Linux Travis CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml)
+[![Run Linux CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat)
[![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions)
[![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/)
[![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases)
-# Expat, Release 2.5.0
+# Expat, Release 2.6.0
-This is Expat, a C library for parsing XML, started by
+This is Expat, a C99 library for parsing
+[XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by
[James Clark](https://en.wikipedia.org/wiki/James_Clark_%28programmer%29) in 1997.
Expat is a stream-oriented XML parser. This means that you register
handlers with the parser before starting the parse. These handlers
diff --git a/contrib/libs/expat/expat.h b/contrib/libs/expat/expat.h
index 1c83563cbf6..95464b0dd17 100644
--- a/contrib/libs/expat/expat.h
+++ b/contrib/libs/expat/expat.h
@@ -11,11 +11,13 @@
Copyright (c) 2000-2005 Fred L. Drake, Jr. <[email protected]>
Copyright (c) 2001-2002 Greg Stein <[email protected]>
Copyright (c) 2002-2016 Karl Waclawek <[email protected]>
- Copyright (c) 2016-2022 Sebastian Pipping <[email protected]>
+ Copyright (c) 2016-2024 Sebastian Pipping <[email protected]>
Copyright (c) 2016 Cristian Rodríguez <[email protected]>
Copyright (c) 2016 Thomas Beutlich <[email protected]>
Copyright (c) 2017 Rhodri James <[email protected]>
Copyright (c) 2022 Thijs Schreijer <[email protected]>
+ Copyright (c) 2023 Hanno Böck <[email protected]>
+ Copyright (c) 2023 Sony Corporation / Snild Dolkow <[email protected]>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -269,7 +271,7 @@ XML_ParserCreate_MM(const XML_Char *encoding,
const XML_Memory_Handling_Suite *memsuite,
const XML_Char *namespaceSeparator);
-/* Prepare a parser object to be re-used. This is particularly
+/* Prepare a parser object to be reused. This is particularly
valuable when memory allocation overhead is disproportionately high,
such as when a large number of small documnents need to be parsed.
All handlers are cleared from the parser, except for the
@@ -951,7 +953,7 @@ XMLPARSEAPI(XML_Index) XML_GetCurrentByteIndex(XML_Parser parser);
XMLPARSEAPI(int)
XML_GetCurrentByteCount(XML_Parser parser);
-/* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets
+/* If XML_CONTEXT_BYTES is >=1, returns the input buffer, sets
the integer pointed to by offset to the offset within this buffer
of the current parse position, and sets the integer pointed to by size
to the size of this buffer (the number of input bytes). Otherwise
@@ -1025,7 +1027,9 @@ enum XML_FeatureEnum {
XML_FEATURE_ATTR_INFO,
/* Added in Expat 2.4.0. */
XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT,
- XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT
+ XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT,
+ /* Added in Expat 2.6.0. */
+ XML_FEATURE_GE
/* Additional features must be added to the end of this enum. */
};
@@ -1038,23 +1042,29 @@ typedef struct {
XMLPARSEAPI(const XML_Feature *)
XML_GetFeatureList(void);
-#ifdef XML_DTD
-/* Added in Expat 2.4.0. */
+#if XML_GE == 1
+/* Added in Expat 2.4.0 for XML_DTD defined and
+ * added in Expat 2.6.0 for XML_GE == 1. */
XMLPARSEAPI(XML_Bool)
XML_SetBillionLaughsAttackProtectionMaximumAmplification(
XML_Parser parser, float maximumAmplificationFactor);
-/* Added in Expat 2.4.0. */
+/* Added in Expat 2.4.0 for XML_DTD defined and
+ * added in Expat 2.6.0 for XML_GE == 1. */
XMLPARSEAPI(XML_Bool)
XML_SetBillionLaughsAttackProtectionActivationThreshold(
XML_Parser parser, unsigned long long activationThresholdBytes);
#endif
+/* Added in Expat 2.6.0. */
+XMLPARSEAPI(XML_Bool)
+XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
+
/* Expat follows the semantic versioning convention.
- See http://semver.org.
+ See https://semver.org
*/
#define XML_MAJOR_VERSION 2
-#define XML_MINOR_VERSION 5
+#define XML_MINOR_VERSION 6
#define XML_MICRO_VERSION 0
#ifdef __cplusplus
diff --git a/contrib/libs/expat/expat_config.h b/contrib/libs/expat/expat_config.h
index 06406077d46..a5cf1d8a854 100644
--- a/contrib/libs/expat/expat_config.h
+++ b/contrib/libs/expat/expat_config.h
@@ -16,6 +16,9 @@
/* Define to 1 if you have the `arc4random_buf' function. */
/* #undef HAVE_ARC4RANDOM_BUF */
+/* define if the compiler supports basic C++11 syntax */
+#define HAVE_CXX11 1
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
@@ -74,13 +77,13 @@
#define PACKAGE "expat"
/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "[email protected]"
+#define PACKAGE_BUGREPORT "https://github.com/libexpat/libexpat/issues"
/* Define to the full name of this package. */
#define PACKAGE_NAME "expat"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "expat 2.5.0"
+#define PACKAGE_STRING "expat 2.6.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "expat"
@@ -89,7 +92,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "2.5.0"
+#define PACKAGE_VERSION "2.6.0"
/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
@@ -97,7 +100,7 @@
#define STDC_HEADERS 1
/* Version number of package */
-#define VERSION "2.5.0"
+#define VERSION "2.6.0"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
@@ -116,7 +119,7 @@
/* #undef XML_ATTR_INFO */
/* Define to specify how much context to retain around the current parse
- point. */
+ point, 0 to disable. */
#define XML_CONTEXT_BYTES 1024
/* Define to include code reading entropy from `/dev/urandom'. */
@@ -125,6 +128,9 @@
/* Define to make parameter entity parsing functionality available. */
#define XML_DTD 1
+/* Define as 1/0 to enable/disable support for general entities. */
+#define XML_GE 1
+
/* Define to make XML Namespaces functionality available. */
#define XML_NS 1
diff --git a/contrib/libs/expat/lib/internal.h b/contrib/libs/expat/lib/internal.h
index e09f533b23c..cce71e4c516 100644
--- a/contrib/libs/expat/lib/internal.h
+++ b/contrib/libs/expat/lib/internal.h
@@ -28,9 +28,10 @@
Copyright (c) 2002-2003 Fred L. Drake, Jr. <[email protected]>
Copyright (c) 2002-2006 Karl Waclawek <[email protected]>
Copyright (c) 2003 Greg Stein <[email protected]>
- Copyright (c) 2016-2022 Sebastian Pipping <[email protected]>
+ Copyright (c) 2016-2023 Sebastian Pipping <[email protected]>
Copyright (c) 2018 Yury Gribov <[email protected]>
Copyright (c) 2019 David Loffredo <[email protected]>
+ Copyright (c) 2023 Sony Corporation / Snild Dolkow <[email protected]>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -154,12 +155,15 @@ extern "C" {
void _INTERNAL_trim_to_complete_utf8_characters(const char *from,
const char **fromLimRef);
-#if defined(XML_DTD)
+#if XML_GE == 1
unsigned long long testingAccountingGetCountBytesDirect(XML_Parser parser);
unsigned long long testingAccountingGetCountBytesIndirect(XML_Parser parser);
const char *unsignedCharToPrintable(unsigned char c);
#endif
+extern XML_Bool g_reparseDeferralEnabledDefault; // written ONLY in runtests.c
+extern unsigned int g_parseAttempts; // used for testing only
+
#ifdef __cplusplus
}
#endif
diff --git a/contrib/libs/expat/lib/siphash.h b/contrib/libs/expat/lib/siphash.h
index 303283ad2de..a1ed99e687b 100644
--- a/contrib/libs/expat/lib/siphash.h
+++ b/contrib/libs/expat/lib/siphash.h
@@ -106,7 +106,7 @@
* if this code is included and compiled as C++; related GCC warning is:
* warning: use of C++11 long long integer constant [-Wlong-long]
*/
-#define _SIP_ULL(high, low) ((((uint64_t)high) << 32) | (low))
+#define SIP_ULL(high, low) ((((uint64_t)high) << 32) | (low))
#define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b))))
@@ -190,10 +190,10 @@ sip_round(struct siphash *H, const int rounds) {
static struct siphash *
sip24_init(struct siphash *H, const struct sipkey *key) {
- H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0];
- H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1];
- H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0];
- H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1];
+ H->v0 = SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0];
+ H->v1 = SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1];
+ H->v2 = SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0];
+ H->v3 = SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1];
H->p = H->buf;
H->c = 0;
diff --git a/contrib/libs/expat/lib/winconfig.h b/contrib/libs/expat/lib/winconfig.h
index 2ecd61b5b94..05805514ec7 100644
--- a/contrib/libs/expat/lib/winconfig.h
+++ b/contrib/libs/expat/lib/winconfig.h
@@ -9,7 +9,8 @@
Copyright (c) 2000 Clark Cooper <[email protected]>
Copyright (c) 2002 Greg Stein <[email protected]>
Copyright (c) 2005 Karl Waclawek <[email protected]>
- Copyright (c) 2017-2021 Sebastian Pipping <[email protected]>
+ Copyright (c) 2017-2023 Sebastian Pipping <[email protected]>
+ Copyright (c) 2023 Orgad Shaneh <[email protected]>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -35,7 +36,9 @@
#ifndef WINCONFIG_H
#define WINCONFIG_H
-#define WIN32_LEAN_AND_MEAN
+#ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
diff --git a/contrib/libs/expat/lib/xmlparse.c b/contrib/libs/expat/lib/xmlparse.c
index 0bd02844ccc..6b33b53c870 100644
--- a/contrib/libs/expat/lib/xmlparse.c
+++ b/contrib/libs/expat/lib/xmlparse.c
@@ -1,4 +1,4 @@
-/* 5ab094ffadd6edfc94c3eee53af44a86951f9f1f0933ada3114bbce2bfb02c99 (2.5.0+)
+/* 628e24d4966bedbd4800f6ed128d06d29703765b4bce12d3b7f099f90f842fc9 (2.6.0+)
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
@@ -13,7 +13,7 @@
Copyright (c) 2002-2016 Karl Waclawek <[email protected]>
Copyright (c) 2005-2009 Steven Solie <[email protected]>
Copyright (c) 2016 Eric Rahm <[email protected]>
- Copyright (c) 2016-2022 Sebastian Pipping <[email protected]>
+ Copyright (c) 2016-2024 Sebastian Pipping <[email protected]>
Copyright (c) 2016 Gaurav <[email protected]>
Copyright (c) 2016 Thomas Beutlich <[email protected]>
Copyright (c) 2016 Gustavo Grieco <[email protected]>
@@ -32,10 +32,13 @@
Copyright (c) 2019 David Loffredo <[email protected]>
Copyright (c) 2019-2020 Ben Wagner <[email protected]>
Copyright (c) 2019 Vadim Zeitlin <[email protected]>
- Copyright (c) 2021 Dong-hee Na <[email protected]>
+ Copyright (c) 2021 Donghee Na <[email protected]>
Copyright (c) 2022 Samanta Navarro <[email protected]>
Copyright (c) 2022 Jeffrey Walton <[email protected]>
Copyright (c) 2022 Jann Horn <[email protected]>
+ Copyright (c) 2022 Sean McBride <[email protected]>
+ Copyright (c) 2023 Owain Davies <[email protected]>
+ Copyright (c) 2023 Sony Corporation / Snild Dolkow <[email protected]>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -60,10 +63,25 @@
#define XML_BUILDING_EXPAT 1
-#include <expat_config.h>
+#include "expat_config.h"
-#if ! defined(_GNU_SOURCE)
-# define _GNU_SOURCE 1 /* syscall prototype */
+#if ! defined(XML_GE) || (1 - XML_GE - 1 == 2) || (XML_GE < 0) || (XML_GE > 1)
+# error XML_GE (for general entities) must be defined, non-empty, either 1 or 0 (0 to disable, 1 to enable; 1 is a common default)
+#endif
+
+#if defined(XML_DTD) && XML_GE == 0
+# error Either undefine XML_DTD or define XML_GE to 1.
+#endif
+
+#if ! defined(XML_CONTEXT_BYTES) || (1 - XML_CONTEXT_BYTES - 1 == 2) \
+ || (XML_CONTEXT_BYTES + 0 < 0)
+# error XML_CONTEXT_BYTES must be defined, non-empty and >=0 (0 to disable, >=1 to enable; 1024 is a common default)
+#endif
+
+#if defined(HAVE_SYSCALL_GETRANDOM)
+# if ! defined(_GNU_SOURCE)
+# define _GNU_SOURCE 1 /* syscall prototype */
+# endif
#endif
#ifdef _WIN32
@@ -73,6 +91,7 @@
# endif
#endif
+#include <stdbool.h>
#include <stddef.h>
#include <string.h> /* memset(), memcpy() */
#include <assert.h>
@@ -131,8 +150,8 @@
Your options include: \
* Linux >=3.17 + glibc >=2.25 (getrandom): HAVE_GETRANDOM, \
* Linux >=3.17 + glibc (including <2.25) (syscall SYS_getrandom): HAVE_SYSCALL_GETRANDOM, \
- * BSD / macOS >=10.7 (arc4random_buf): HAVE_ARC4RANDOM_BUF, \
- * BSD / macOS (including <10.7) (arc4random): HAVE_ARC4RANDOM, \
+ * BSD / macOS >=10.7 / glibc >=2.36 (arc4random_buf): HAVE_ARC4RANDOM_BUF, \
+ * BSD / macOS (including <10.7) / glibc >=2.36 (arc4random): HAVE_ARC4RANDOM, \
* libbsd (arc4random_buf): HAVE_ARC4RANDOM_BUF + HAVE_LIBBSD, \
* libbsd (arc4random): HAVE_ARC4RANDOM + HAVE_LIBBSD, \
* Linux (including <3.17) / BSD / macOS (including <10.7) / Solaris >=8 (/dev/urandom): XML_DEV_URANDOM, \
@@ -196,6 +215,8 @@ typedef char ICHAR;
/* Do safe (NULL-aware) pointer arithmetic */
#define EXPAT_SAFE_PTR_DIFF(p, q) (((p) && (q)) ? ((p) - (q)) : 0)
+#define EXPAT_MIN(a, b) (((a) < (b)) ? (a) : (b))
+
#include "internal.h"
#include "xmltok.h"
#include "xmlrole.h"
@@ -279,7 +300,7 @@ typedef struct {
XML_Parse()/XML_ParseBuffer(), the buffer is re-allocated to
contain the 'raw' name as well.
- A parser re-uses these structures, maintaining a list of allocated
+ A parser reuses these structures, maintaining a list of allocated
TAG objects in a free list.
*/
typedef struct tag {
@@ -408,12 +429,12 @@ enum XML_Account {
XML_ACCOUNT_NONE /* i.e. do not account, was accounted already */
};
-#ifdef XML_DTD
+#if XML_GE == 1
typedef unsigned long long XmlBigCount;
typedef struct accounting {
XmlBigCount countBytesDirect;
XmlBigCount countBytesIndirect;
- int debugLevel;
+ unsigned long debugLevel;
float maximumAmplificationFactor; // >=1.0
unsigned long long activationThresholdBytes;
} ACCOUNTING;
@@ -422,9 +443,9 @@ typedef struct entity_stats {
unsigned int countEverOpened;
unsigned int currentDepth;
unsigned int maximumDepthSeen;
- int debugLevel;
+ unsigned long debugLevel;
} ENTITY_STATS;
-#endif /* XML_DTD */
+#endif /* XML_GE == 1 */
typedef enum XML_Error PTRCALL Processor(XML_Parser parser, const char *start,
const char *end, const char **endPtr);
@@ -464,41 +485,47 @@ static enum XML_Error doContent(XML_Parser parser, int startTagLevel,
const ENCODING *enc, const char *start,
const char *end, const char **endPtr,
XML_Bool haveMore, enum XML_Account account);
-static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *,
+static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *enc,
const char **startPtr, const char *end,
const char **nextPtr, XML_Bool haveMore,
enum XML_Account account);
#ifdef XML_DTD
-static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *,
+static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *enc,
const char **startPtr, const char *end,
const char **nextPtr, XML_Bool haveMore);
#endif /* XML_DTD */
static void freeBindings(XML_Parser parser, BINDING *bindings);
-static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *,
- const char *s, TAG_NAME *tagNamePtr,
+static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc,
+ const char *attStr, TAG_NAME *tagNamePtr,
BINDING **bindingsPtr,
enum XML_Account account);
static enum XML_Error addBinding(XML_Parser parser, PREFIX *prefix,
const ATTRIBUTE_ID *attId, const XML_Char *uri,
BINDING **bindingsPtr);
-static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata,
- XML_Bool isId, const XML_Char *dfltValue,
- XML_Parser parser);
-static enum XML_Error storeAttributeValue(XML_Parser parser, const ENCODING *,
- XML_Bool isCdata, const char *,
- const char *, STRING_POOL *,
+static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId,
+ XML_Bool isCdata, XML_Bool isId,
+ const XML_Char *value, XML_Parser parser);
+static enum XML_Error storeAttributeValue(XML_Parser parser,
+ const ENCODING *enc, XML_Bool isCdata,
+ const char *ptr, const char *end,
+ STRING_POOL *pool,
enum XML_Account account);
-static enum XML_Error appendAttributeValue(XML_Parser parser, const ENCODING *,
- XML_Bool isCdata, const char *,
- const char *, STRING_POOL *,
+static enum XML_Error appendAttributeValue(XML_Parser parser,
+ const ENCODING *enc,
+ XML_Bool isCdata, const char *ptr,
+ const char *end, STRING_POOL *pool,
enum XML_Account account);
static ATTRIBUTE_ID *getAttributeId(XML_Parser parser, const ENCODING *enc,
const char *start, const char *end);
-static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *);
+static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType);
+#if XML_GE == 1
static enum XML_Error storeEntityValue(XML_Parser parser, const ENCODING *enc,
const char *start, const char *end,
enum XML_Account account);
+#else
+static enum XML_Error storeSelfEntityValue(XML_Parser parser, ENTITY *entity);
+#endif
static int reportProcessingInstruction(XML_Parser parser, const ENCODING *enc,
const char *start, const char *end);
static int reportComment(XML_Parser parser, const ENCODING *enc,
@@ -518,21 +545,22 @@ static void dtdDestroy(DTD *p, XML_Bool isDocEntity,
const XML_Memory_Handling_Suite *ms);
static int dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd,
const XML_Memory_Handling_Suite *ms);
-static int copyEntityTable(XML_Parser oldParser, HASH_TABLE *, STRING_POOL *,
- const HASH_TABLE *);
+static int copyEntityTable(XML_Parser oldParser, HASH_TABLE *newTable,
+ STRING_POOL *newPool, const HASH_TABLE *oldTable);
static NAMED *lookup(XML_Parser parser, HASH_TABLE *table, KEY name,
size_t createSize);
-static void FASTCALL hashTableInit(HASH_TABLE *,
+static void FASTCALL hashTableInit(HASH_TABLE *table,
const XML_Memory_Handling_Suite *ms);
-static void FASTCALL hashTableClear(HASH_TABLE *);
-static void FASTCALL hashTableDestroy(HASH_TABLE *);
-static void FASTCALL hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *);
-static NAMED *FASTCALL hashTableIterNext(HASH_TABLE_ITER *);
+static void FASTCALL hashTableClear(HASH_TABLE *table);
+static void FASTCALL hashTableDestroy(HASH_TABLE *table);
+static void FASTCALL hashTableIterInit(HASH_TABLE_ITER *iter,
+ const HASH_TABLE *table);
+static NAMED *FASTCALL hashTableIterNext(HASH_TABLE_ITER *iter);
-static void FASTCALL poolInit(STRING_POOL *,
+static void FASTCALL poolInit(STRING_POOL *pool,
const XML_Memory_Handling_Suite *ms);
-static void FASTCALL poolClear(STRING_POOL *);
-static void FASTCALL poolDestroy(STRING_POOL *);
+static void FASTCALL poolClear(STRING_POOL *pool);
+static void FASTCALL poolDestroy(STRING_POOL *pool);
static XML_Char *poolAppend(STRING_POOL *pool, const ENCODING *enc,
const char *ptr, const char *end);
static XML_Char *poolStoreString(STRING_POOL *pool, const ENCODING *enc,
@@ -562,7 +590,7 @@ static XML_Parser parserCreate(const XML_Char *encodingName,
static void parserInit(XML_Parser parser, const XML_Char *encodingName);
-#ifdef XML_DTD
+#if XML_GE == 1
static float accountingGetCurrentAmplification(XML_Parser rootParser);
static void accountingReportStats(XML_Parser originParser, const char *epilog);
static void accountingOnAbort(XML_Parser originParser);
@@ -585,13 +613,12 @@ static void entityTrackingOnClose(XML_Parser parser, ENTITY *entity,
static XML_Parser getRootParserOf(XML_Parser parser,
unsigned int *outLevelDiff);
-#endif /* XML_DTD */
+#endif /* XML_GE == 1 */
static unsigned long getDebugLevel(const char *variableName,
unsigned long defaultDebugLevel);
#define poolStart(pool) ((pool)->start)
-#define poolEnd(pool) ((pool)->ptr)
#define poolLength(pool) ((pool)->ptr - (pool)->start)
#define poolChop(pool) ((void)--(pool->ptr))
#define poolLastChar(pool) (((pool)->ptr)[-1])
@@ -602,21 +629,35 @@ static unsigned long getDebugLevel(const char *variableName,
? 0 \
: ((*((pool)->ptr)++ = c), 1))
+XML_Bool g_reparseDeferralEnabledDefault = XML_TRUE; // write ONLY in runtests.c
+unsigned int g_parseAttempts = 0; // used for testing only
+
struct XML_ParserStruct {
/* The first member must be m_userData so that the XML_GetUserData
macro works. */
void *m_userData;
void *m_handlerArg;
- char *m_buffer;
+
+ // How the four parse buffer pointers below relate in time and space:
+ //
+ // m_buffer <= m_bufferPtr <= m_bufferEnd <= m_bufferLim
+ // | | | |
+ // <--parsed-->| | |
+ // <---parsing--->| |
+ // <--unoccupied-->|
+ // <---------total-malloced/realloced-------->|
+
+ char *m_buffer; // malloc/realloc base pointer of parse buffer
const XML_Memory_Handling_Suite m_mem;
- /* first character to be parsed */
- const char *m_bufferPtr;
- /* past last character to be parsed */
- char *m_bufferEnd;
- /* allocated end of m_buffer */
- const char *m_bufferLim;
+ const char *m_bufferPtr; // first character to be parsed
+ char *m_bufferEnd; // past last character to be parsed
+ const char *m_bufferLim; // allocated end of m_buffer
+
XML_Index m_parseEndByteIndex;
const char *m_parseEndPtr;
+ size_t m_partialTokenBytesBefore; /* used in heuristic to avoid O(n^2) */
+ XML_Bool m_reparseDeferralEnabled;
+ int m_lastBufferRequestSize;
XML_Char *m_dataBuf;
XML_Char *m_dataBufEnd;
XML_StartElementHandler m_startElementHandler;
@@ -703,7 +744,7 @@ struct XML_ParserStruct {
enum XML_ParamEntityParsing m_paramEntityParsing;
#endif
unsigned long m_hash_secret_salt;
-#ifdef XML_DTD
+#if XML_GE == 1
ACCOUNTING m_accounting;
ENTITY_STATS m_entity_stats;
#endif
@@ -948,6 +989,47 @@ get_hash_secret_salt(XML_Parser parser) {
return parser->m_hash_secret_salt;
}
+static enum XML_Error
+callProcessor(XML_Parser parser, const char *start, const char *end,
+ const char **endPtr) {
+ const size_t have_now = EXPAT_SAFE_PTR_DIFF(end, start);
+
+ if (parser->m_reparseDeferralEnabled
+ && ! parser->m_parsingStatus.finalBuffer) {
+ // Heuristic: don't try to parse a partial token again until the amount of
+ // available data has increased significantly.
+ const size_t had_before = parser->m_partialTokenBytesBefore;
+ // ...but *do* try anyway if we're close to causing a reallocation.
+ size_t available_buffer
+ = EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer);
+#if XML_CONTEXT_BYTES > 0
+ available_buffer -= EXPAT_MIN(available_buffer, XML_CONTEXT_BYTES);
+#endif
+ available_buffer
+ += EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferEnd);
+ // m_lastBufferRequestSize is never assigned a value < 0, so the cast is ok
+ const bool enough
+ = (have_now >= 2 * had_before)
+ || ((size_t)parser->m_lastBufferRequestSize > available_buffer);
+
+ if (! enough) {
+ *endPtr = start; // callers may expect this to be set
+ return XML_ERROR_NONE;
+ }
+ }
+ g_parseAttempts += 1;
+ const enum XML_Error ret = parser->m_processor(parser, start, end, endPtr);
+ if (ret == XML_ERROR_NONE) {
+ // if we consumed nothing, remember what we had on this parse attempt.
+ if (*endPtr == start) {
+ parser->m_partialTokenBytesBefore = have_now;
+ } else {
+ parser->m_partialTokenBytesBefore = 0;
+ }
+ }
+ return ret;
+}
+
static XML_Bool /* only valid for root parser */
startParsing(XML_Parser parser) {
/* hash functions must be initialized before setContext() is called */
@@ -1129,6 +1211,9 @@ parserInit(XML_Parser parser, const XML_Char *encodingName) {
parser->m_bufferEnd = parser->m_buffer;
parser->m_parseEndByteIndex = 0;
parser->m_parseEndPtr = NULL;
+ parser->m_partialTokenBytesBefore = 0;
+ parser->m_reparseDeferralEnabled = g_reparseDeferralEnabledDefault;
+ parser->m_lastBufferRequestSize = 0;
parser->m_declElementType = NULL;
parser->m_declAttributeId = NULL;
parser->m_declEntity = NULL;
@@ -1163,7 +1248,7 @@ parserInit(XML_Parser parser, const XML_Char *encodingName) {
#endif
parser->m_hash_secret_salt = 0;
-#ifdef XML_DTD
+#if XML_GE == 1
memset(&parser->m_accounting, 0, sizeof(ACCOUNTING));
parser->m_accounting.debugLevel = getDebugLevel("EXPAT_ACCOUNTING_DEBUG", 0u);
parser->m_accounting.maximumAmplificationFactor
@@ -1298,6 +1383,7 @@ XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context,
to worry which hash secrets each table has.
*/
unsigned long oldhash_secret_salt;
+ XML_Bool oldReparseDeferralEnabled;
/* Validate the oldParser parameter before we pull everything out of it */
if (oldParser == NULL)
@@ -1342,6 +1428,7 @@ XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context,
to worry which hash secrets each table has.
*/
oldhash_secret_salt = parser->m_hash_secret_salt;
+ oldReparseDeferralEnabled = parser->m_reparseDeferralEnabled;
#ifdef XML_DTD
if (! context)
@@ -1394,6 +1481,7 @@ XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context,
parser->m_defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
parser->m_ns_triplets = oldns_triplets;
parser->m_hash_secret_salt = oldhash_secret_salt;
+ parser->m_reparseDeferralEnabled = oldReparseDeferralEnabled;
parser->m_parentParser = oldParser;
#ifdef XML_DTD
parser->m_paramEntityParsing = oldParamEntityParsing;
@@ -1848,55 +1936,8 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) {
parser->m_parsingStatus.parsing = XML_PARSING;
}
- if (len == 0) {
- parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal;
- if (! isFinal)
- return XML_STATUS_OK;
- parser->m_positionPtr = parser->m_bufferPtr;
- parser->m_parseEndPtr = parser->m_bufferEnd;
-
- /* If data are left over from last buffer, and we now know that these
- data are the final chunk of input, then we have to check them again
- to detect errors based on that fact.
- */
- parser->m_errorCode
- = parser->m_processor(parser, parser->m_bufferPtr,
- parser->m_parseEndPtr, &parser->m_bufferPtr);
-
- if (parser->m_errorCode == XML_ERROR_NONE) {
- switch (parser->m_parsingStatus.parsing) {
- case XML_SUSPENDED:
- /* It is hard to be certain, but it seems that this case
- * cannot occur. This code is cleaning up a previous parse
- * with no new data (since len == 0). Changing the parsing
- * state requires getting to execute a handler function, and
- * there doesn't seem to be an opportunity for that while in
- * this circumstance.
- *
- * Given the uncertainty, we retain the code but exclude it
- * from coverage tests.
- *
- * LCOV_EXCL_START
- */
- XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr,
- parser->m_bufferPtr, &parser->m_position);
- parser->m_positionPtr = parser->m_bufferPtr;
- return XML_STATUS_SUSPENDED;
- /* LCOV_EXCL_STOP */
- case XML_INITIALIZED:
- case XML_PARSING:
- parser->m_parsingStatus.parsing = XML_FINISHED;
- /* fall through */
- default:
- return XML_STATUS_OK;
- }
- }
- parser->m_eventEndPtr = parser->m_eventPtr;
- parser->m_processor = errorProcessor;
- return XML_STATUS_ERROR;
- }
-#ifndef XML_CONTEXT_BYTES
- else if (parser->m_bufferPtr == parser->m_bufferEnd) {
+#if XML_CONTEXT_BYTES == 0
+ if (parser->m_bufferPtr == parser->m_bufferEnd) {
const char *end;
int nLeftOver;
enum XML_Status result;
@@ -1907,12 +1948,15 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) {
parser->m_processor = errorProcessor;
return XML_STATUS_ERROR;
}
+ // though this isn't a buffer request, we assume that `len` is the app's
+ // preferred buffer fill size, and therefore save it here.
+ parser->m_lastBufferRequestSize = len;
parser->m_parseEndByteIndex += len;
parser->m_positionPtr = s;
parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal;
parser->m_errorCode
- = parser->m_processor(parser, s, parser->m_parseEndPtr = s + len, &end);
+ = callProcessor(parser, s, parser->m_parseEndPtr = s + len, &end);
if (parser->m_errorCode != XML_ERROR_NONE) {
parser->m_eventEndPtr = parser->m_eventPtr;
@@ -1939,23 +1983,25 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) {
&parser->m_position);
nLeftOver = s + len - end;
if (nLeftOver) {
- if (parser->m_buffer == NULL
- || nLeftOver > parser->m_bufferLim - parser->m_buffer) {
- /* avoid _signed_ integer overflow */
- char *temp = NULL;
- const int bytesToAllocate = (int)((unsigned)len * 2U);
- if (bytesToAllocate > 0) {
- temp = (char *)REALLOC(parser, parser->m_buffer, bytesToAllocate);
- }
- if (temp == NULL) {
- parser->m_errorCode = XML_ERROR_NO_MEMORY;
- parser->m_eventPtr = parser->m_eventEndPtr = NULL;
- parser->m_processor = errorProcessor;
- return XML_STATUS_ERROR;
- }
- parser->m_buffer = temp;
- parser->m_bufferLim = parser->m_buffer + bytesToAllocate;
+ // Back up and restore the parsing status to avoid XML_ERROR_SUSPENDED
+ // (and XML_ERROR_FINISHED) from XML_GetBuffer.
+ const enum XML_Parsing originalStatus = parser->m_parsingStatus.parsing;
+ parser->m_parsingStatus.parsing = XML_PARSING;
+ void *const temp = XML_GetBuffer(parser, nLeftOver);
+ parser->m_parsingStatus.parsing = originalStatus;
+ // GetBuffer may have overwritten this, but we want to remember what the
+ // app requested, not how many bytes were left over after parsing.
+ parser->m_lastBufferRequestSize = len;
+ if (temp == NULL) {
+ // NOTE: parser->m_errorCode has already been set by XML_GetBuffer().
+ parser->m_eventPtr = parser->m_eventEndPtr = NULL;
+ parser->m_processor = errorProcessor;
+ return XML_STATUS_ERROR;
}
+ // Since we know that the buffer was empty and XML_CONTEXT_BYTES is 0, we
+ // don't have any data to preserve, and can copy straight into the start
+ // of the buffer rather than the GetBuffer return pointer (which may be
+ // pointing further into the allocated buffer).
memcpy(parser->m_buffer, end, nLeftOver);
}
parser->m_bufferPtr = parser->m_buffer;
@@ -1966,16 +2012,15 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) {
parser->m_eventEndPtr = parser->m_bufferPtr;
return result;
}
-#endif /* not defined XML_CONTEXT_BYTES */
- else {
- void *buff = XML_GetBuffer(parser, len);
- if (buff == NULL)
- return XML_STATUS_ERROR;
- else {
- memcpy(buff, s, len);
- return XML_ParseBuffer(parser, len, isFinal);
- }
+#endif /* XML_CONTEXT_BYTES == 0 */
+ void *buff = XML_GetBuffer(parser, len);
+ if (buff == NULL)
+ return XML_STATUS_ERROR;
+ if (len > 0) {
+ assert(s != NULL); // make sure s==NULL && len!=0 was rejected above
+ memcpy(buff, s, len);
}
+ return XML_ParseBuffer(parser, len, isFinal);
}
enum XML_Status XMLCALL
@@ -2015,8 +2060,8 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal) {
parser->m_parseEndByteIndex += len;
parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal;
- parser->m_errorCode = parser->m_processor(
- parser, start, parser->m_parseEndPtr, &parser->m_bufferPtr);
+ parser->m_errorCode = callProcessor(parser, start, parser->m_parseEndPtr,
+ &parser->m_bufferPtr);
if (parser->m_errorCode != XML_ERROR_NONE) {
parser->m_eventEndPtr = parser->m_eventPtr;
@@ -2061,10 +2106,14 @@ XML_GetBuffer(XML_Parser parser, int len) {
default:;
}
- if (len > EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferEnd)) {
-#ifdef XML_CONTEXT_BYTES
+ // whether or not the request succeeds, `len` seems to be the app's preferred
+ // buffer fill size; remember it.
+ parser->m_lastBufferRequestSize = len;
+ if (len > EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferEnd)
+ || parser->m_buffer == NULL) {
+#if XML_CONTEXT_BYTES > 0
int keep;
-#endif /* defined XML_CONTEXT_BYTES */
+#endif /* XML_CONTEXT_BYTES > 0 */
/* Do not invoke signed arithmetic overflow: */
int neededSize = (int)((unsigned)len
+ (unsigned)EXPAT_SAFE_PTR_DIFF(
@@ -2073,7 +2122,7 @@ XML_GetBuffer(XML_Parser parser, int len) {
parser->m_errorCode = XML_ERROR_NO_MEMORY;
return NULL;
}
-#ifdef XML_CONTEXT_BYTES
+#if XML_CONTEXT_BYTES > 0
keep = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer);
if (keep > XML_CONTEXT_BYTES)
keep = XML_CONTEXT_BYTES;
@@ -2083,10 +2132,11 @@ XML_GetBuffer(XML_Parser parser, int len) {
return NULL;
}
neededSize += keep;
-#endif /* defined XML_CONTEXT_BYTES */
- if (neededSize
- <= EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_buffer)) {
-#ifdef XML_CONTEXT_BYTES
+#endif /* XML_CONTEXT_BYTES > 0 */
+ if (parser->m_buffer && parser->m_bufferPtr
+ && neededSize
+ <= EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_buffer)) {
+#if XML_CONTEXT_BYTES > 0
if (keep < EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer)) {
int offset
= (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer)
@@ -2099,19 +2149,17 @@ XML_GetBuffer(XML_Parser parser, int len) {
parser->m_bufferPtr -= offset;
}
#else
- if (parser->m_buffer && parser->m_bufferPtr) {
- memmove(parser->m_buffer, parser->m_bufferPtr,
- EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr));
- parser->m_bufferEnd
- = parser->m_buffer
- + EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr);
- parser->m_bufferPtr = parser->m_buffer;
- }
-#endif /* not defined XML_CONTEXT_BYTES */
+ memmove(parser->m_buffer, parser->m_bufferPtr,
+ EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr));
+ parser->m_bufferEnd
+ = parser->m_buffer
+ + EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr);
+ parser->m_bufferPtr = parser->m_buffer;
+#endif /* XML_CONTEXT_BYTES > 0 */
} else {
char *newBuf;
int bufferSize
- = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferPtr);
+ = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_buffer);
if (bufferSize == 0)
bufferSize = INIT_BUFFER_SIZE;
do {
@@ -2128,7 +2176,7 @@ XML_GetBuffer(XML_Parser parser, int len) {
return NULL;
}
parser->m_bufferLim = newBuf + bufferSize;
-#ifdef XML_CONTEXT_BYTES
+#if XML_CONTEXT_BYTES > 0
if (parser->m_bufferPtr) {
memcpy(newBuf, &parser->m_bufferPtr[-keep],
EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr)
@@ -2158,7 +2206,7 @@ XML_GetBuffer(XML_Parser parser, int len) {
parser->m_bufferEnd = newBuf;
}
parser->m_bufferPtr = parser->m_buffer = newBuf;
-#endif /* not defined XML_CONTEXT_BYTES */
+#endif /* XML_CONTEXT_BYTES > 0 */
}
parser->m_eventPtr = parser->m_eventEndPtr = NULL;
parser->m_positionPtr = NULL;
@@ -2208,7 +2256,7 @@ XML_ResumeParser(XML_Parser parser) {
}
parser->m_parsingStatus.parsing = XML_PARSING;
- parser->m_errorCode = parser->m_processor(
+ parser->m_errorCode = callProcessor(
parser, parser->m_bufferPtr, parser->m_parseEndPtr, &parser->m_bufferPtr);
if (parser->m_errorCode != XML_ERROR_NONE) {
@@ -2272,7 +2320,7 @@ XML_GetCurrentByteCount(XML_Parser parser) {
const char *XMLCALL
XML_GetInputContext(XML_Parser parser, int *offset, int *size) {
-#ifdef XML_CONTEXT_BYTES
+#if XML_CONTEXT_BYTES > 0
if (parser == NULL)
return NULL;
if (parser->m_eventPtr && parser->m_buffer) {
@@ -2286,7 +2334,7 @@ XML_GetInputContext(XML_Parser parser, int *offset, int *size) {
(void)parser;
(void)offset;
(void)size;
-#endif /* defined XML_CONTEXT_BYTES */
+#endif /* XML_CONTEXT_BYTES > 0 */
return (const char *)0;
}
@@ -2506,7 +2554,7 @@ XML_GetFeatureList(void) {
#ifdef XML_DTD
{XML_FEATURE_DTD, XML_L("XML_DTD"), 0},
#endif
-#ifdef XML_CONTEXT_BYTES
+#if XML_CONTEXT_BYTES > 0
{XML_FEATURE_CONTEXT_BYTES, XML_L("XML_CONTEXT_BYTES"),
XML_CONTEXT_BYTES},
#endif
@@ -2522,8 +2570,9 @@ XML_GetFeatureList(void) {
#ifdef XML_ATTR_INFO
{XML_FEATURE_ATTR_INFO, XML_L("XML_ATTR_INFO"), 0},
#endif
-#ifdef XML_DTD
- /* Added in Expat 2.4.0. */
+#if XML_GE == 1
+ /* Added in Expat 2.4.0 for XML_DTD defined and
+ * added in Expat 2.6.0 for XML_GE == 1. */
{XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT,
XML_L("XML_BLAP_MAX_AMP"),
(long int)
@@ -2531,13 +2580,15 @@ XML_GetFeatureList(void) {
{XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT,
XML_L("XML_BLAP_ACT_THRES"),
EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT},
+ /* Added in Expat 2.6.0. */
+ {XML_FEATURE_GE, XML_L("XML_GE"), 0},
#endif
{XML_FEATURE_END, NULL, 0}};
return features;
}
-#ifdef XML_DTD
+#if XML_GE == 1
XML_Bool XMLCALL
XML_SetBillionLaughsAttackProtectionMaximumAmplification(
XML_Parser parser, float maximumAmplificationFactor) {
@@ -2559,7 +2610,16 @@ XML_SetBillionLaughsAttackProtectionActivationThreshold(
parser->m_accounting.activationThresholdBytes = activationThresholdBytes;
return XML_TRUE;
}
-#endif /* XML_DTD */
+#endif /* XML_GE == 1 */
+
+XML_Bool XMLCALL
+XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled) {
+ if (parser != NULL && (enabled == XML_TRUE || enabled == XML_FALSE)) {
+ parser->m_reparseDeferralEnabled = enabled;
+ return XML_TRUE;
+ }
+ return XML_FALSE;
+}
/* Initially tag->rawName always points into the parse buffer;
for those TAG instances opened while the current parse buffer was
@@ -2581,7 +2641,7 @@ storeRawNames(XML_Parser parser) {
*/
if (tag->rawName == rawNameBuf)
break;
- /* For re-use purposes we need to ensure that the
+ /* For reuse purposes we need to ensure that the
size of tag->buf is a multiple of sizeof(XML_Char).
*/
rawNameLen = ROUND_UP(tag->rawNameLength, sizeof(XML_Char));
@@ -2645,13 +2705,13 @@ externalEntityInitProcessor2(XML_Parser parser, const char *start,
int tok = XmlContentTok(parser->m_encoding, start, end, &next);
switch (tok) {
case XML_TOK_BOM:
-#ifdef XML_DTD
+#if XML_GE == 1
if (! accountingDiffTolerated(parser, tok, start, next, __LINE__,
XML_ACCOUNT_DIRECT)) {
accountingOnAbort(parser);
return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
}
-#endif /* XML_DTD */
+#endif /* XML_GE == 1 */
/* If we are at the end of the buffer, this would cause the next stage,
i.e. externalEntityInitProcessor3, to pass control directly to
@@ -2765,7 +2825,7 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
for (;;) {
const char *next = s; /* XmlContentTok doesn't always set the last arg */
int tok = XmlContentTok(enc, s, end, &next);
-#ifdef XML_DTD
+#if XML_GE == 1
const char *accountAfter
= ((tok == XML_TOK_TRAILING_RSQB) || (tok == XML_TOK_TRAILING_CR))
? (haveMore ? s /* i.e. 0 bytes */ : end)
@@ -2831,14 +2891,14 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
XML_Char ch = (XML_Char)XmlPredefinedEntityName(
enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar);
if (ch) {
-#ifdef XML_DTD
+#if XML_GE == 1
/* NOTE: We are replacing 4-6 characters original input for 1 character
* so there is no amplification and hence recording without
* protection. */
accountingDiffTolerated(parser, tok, (char *)&ch,
((char *)&ch) + sizeof(XML_Char), __LINE__,
XML_ACCOUNT_ENTITY_EXPANSION);
-#endif /* XML_DTD */
+#endif /* XML_GE == 1 */
if (parser->m_characterDataHandler)
parser->m_characterDataHandler(parser->m_handlerArg, &ch, 1);
else if (parser->m_defaultHandler)
@@ -3039,13 +3099,13 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
if (parser->m_ns && localPart) {
/* localPart and prefix may have been overwritten in
tag->name.str, since this points to the binding->uri
- buffer which gets re-used; so we have to add them again
+ buffer which gets reused; so we have to add them again
*/
uri = (XML_Char *)tag->name.str + tag->name.uriLen;
/* don't need to check for space - already done in storeAtts() */
while (*localPart)
*uri++ = *localPart++;
- prefix = (XML_Char *)tag->name.prefix;
+ prefix = tag->name.prefix;
if (parser->m_ns_triplets && prefix) {
*uri++ = parser->m_namespaceSeparator;
while (*prefix)
@@ -3112,7 +3172,7 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
However, now we have a start/endCdataSectionHandler, so it seems
easier to let the user deal with this.
*/
- else if (0 && parser->m_characterDataHandler)
+ else if ((0) && parser->m_characterDataHandler)
parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf,
0);
/* END disabled code */
@@ -3141,8 +3201,8 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
(int)(dataPtr - (ICHAR *)parser->m_dataBuf));
} else
parser->m_characterDataHandler(
- parser->m_handlerArg, (XML_Char *)s,
- (int)((XML_Char *)end - (XML_Char *)s));
+ parser->m_handlerArg, (const XML_Char *)s,
+ (int)((const XML_Char *)end - (const XML_Char *)s));
} else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, end);
/* We are at the end of the final buffer, should we check for
@@ -3175,8 +3235,8 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
*eventPP = s;
}
} else
- charDataHandler(parser->m_handlerArg, (XML_Char *)s,
- (int)((XML_Char *)next - (XML_Char *)s));
+ charDataHandler(parser->m_handlerArg, (const XML_Char *)s,
+ (int)((const XML_Char *)next - (const XML_Char *)s));
} else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
} break;
@@ -4040,7 +4100,7 @@ doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
for (;;) {
const char *next = s; /* in case of XML_TOK_NONE or XML_TOK_PARTIAL */
int tok = XmlCdataSectionTok(enc, s, end, &next);
-#ifdef XML_DTD
+#if XML_GE == 1
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__, account)) {
accountingOnAbort(parser);
return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
@@ -4055,7 +4115,7 @@ doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
parser->m_endCdataSectionHandler(parser->m_handlerArg);
/* BEGIN disabled code */
/* see comment under XML_TOK_CDATA_SECT_OPEN */
- else if (0 && parser->m_characterDataHandler)
+ else if ((0) && parser->m_characterDataHandler)
parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf,
0);
/* END disabled code */
@@ -4091,8 +4151,8 @@ doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
*eventPP = s;
}
} else
- charDataHandler(parser->m_handlerArg, (XML_Char *)s,
- (int)((XML_Char *)next - (XML_Char *)s));
+ charDataHandler(parser->m_handlerArg, (const XML_Char *)s,
+ (int)((const XML_Char *)next - (const XML_Char *)s));
} else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
} break;
@@ -4192,7 +4252,7 @@ doIgnoreSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
*eventPP = s;
*startPtr = NULL;
tok = XmlIgnoreSectionTok(enc, s, end, &next);
-# ifdef XML_DTD
+# if XML_GE == 1
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__,
XML_ACCOUNT_DIRECT)) {
accountingOnAbort(parser);
@@ -4284,7 +4344,7 @@ processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *s,
const XML_Char *storedversion = NULL;
int standalone = -1;
-#ifdef XML_DTD
+#if XML_GE == 1
if (! accountingDiffTolerated(parser, XML_TOK_XML_DECL, s, next, __LINE__,
XML_ACCOUNT_DIRECT)) {
accountingOnAbort(parser);
@@ -4482,16 +4542,16 @@ entityValueInitProcessor(XML_Parser parser, const char *s, const char *end,
parser->m_processor = entityValueProcessor;
return entityValueProcessor(parser, next, end, nextPtr);
}
- /* If we are at the end of the buffer, this would cause XmlPrologTok to
- return XML_TOK_NONE on the next call, which would then cause the
- function to exit with *nextPtr set to s - that is what we want for other
- tokens, but not for the BOM - we would rather like to skip it;
- then, when this routine is entered the next time, XmlPrologTok will
- return XML_TOK_INVALID, since the BOM is still in the buffer
+ /* XmlPrologTok has now set the encoding based on the BOM it found, and we
+ must move s and nextPtr forward to consume the BOM.
+
+ If we didn't, and got XML_TOK_NONE from the next XmlPrologTok call, we
+ would leave the BOM in the buffer and return. On the next call to this
+ function, our XmlPrologTok call would return XML_TOK_INVALID, since it
+ is not valid to have multiple BOMs.
*/
- else if (tok == XML_TOK_BOM && next == end
- && ! parser->m_parsingStatus.finalBuffer) {
-# ifdef XML_DTD
+ else if (tok == XML_TOK_BOM) {
+# if XML_GE == 1
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__,
XML_ACCOUNT_DIRECT)) {
accountingOnAbort(parser);
@@ -4500,7 +4560,7 @@ entityValueInitProcessor(XML_Parser parser, const char *s, const char *end,
# endif
*nextPtr = next;
- return XML_ERROR_NONE;
+ s = next;
}
/* If we get this token, we have the start of what might be a
normal tag, but not a declaration (i.e. it doesn't begin with
@@ -4707,11 +4767,13 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
}
}
role = XmlTokenRole(&parser->m_prologState, tok, s, next, enc);
-#ifdef XML_DTD
+#if XML_GE == 1
switch (role) {
case XML_ROLE_INSTANCE_START: // bytes accounted in contentProcessor
case XML_ROLE_XML_DECL: // bytes accounted in processXmlDecl
- case XML_ROLE_TEXT_DECL: // bytes accounted in processXmlDecl
+# ifdef XML_DTD
+ case XML_ROLE_TEXT_DECL: // bytes accounted in processXmlDecl
+# endif
break;
default:
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__, account)) {
@@ -5029,6 +5091,9 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
break;
case XML_ROLE_ENTITY_VALUE:
if (dtd->keepProcessing) {
+#if XML_GE == 1
+ // This will store the given replacement text in
+ // parser->m_declEntity->textPtr.
enum XML_Error result
= storeEntityValue(parser, enc, s + enc->minBytesPerChar,
next - enc->minBytesPerChar, XML_ACCOUNT_NONE);
@@ -5049,6 +5114,25 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
poolDiscard(&dtd->entityValuePool);
if (result != XML_ERROR_NONE)
return result;
+#else
+ // This will store "&amp;entity123;" in parser->m_declEntity->textPtr
+ // to end up as "&entity123;" in the handler.
+ if (parser->m_declEntity != NULL) {
+ const enum XML_Error result
+ = storeSelfEntityValue(parser, parser->m_declEntity);
+ if (result != XML_ERROR_NONE)
+ return result;
+
+ if (parser->m_entityDeclHandler) {
+ *eventEndPP = s;
+ parser->m_entityDeclHandler(
+ parser->m_handlerArg, parser->m_declEntity->name,
+ parser->m_declEntity->is_param, parser->m_declEntity->textPtr,
+ parser->m_declEntity->textLen, parser->m_curBase, 0, 0, 0);
+ handleDefault = XML_FALSE;
+ }
+ }
+#endif
}
break;
case XML_ROLE_DOCTYPE_SYSTEM_ID:
@@ -5107,6 +5191,16 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
}
break;
case XML_ROLE_ENTITY_COMPLETE:
+#if XML_GE == 0
+ // This will store "&amp;entity123;" in entity->textPtr
+ // to end up as "&entity123;" in the handler.
+ if (parser->m_declEntity != NULL) {
+ const enum XML_Error result
+ = storeSelfEntityValue(parser, parser->m_declEntity);
+ if (result != XML_ERROR_NONE)
+ return result;
+ }
+#endif
if (dtd->keepProcessing && parser->m_declEntity
&& parser->m_entityDeclHandler) {
*eventEndPP = s;
@@ -5648,7 +5742,7 @@ epilogProcessor(XML_Parser parser, const char *s, const char *end,
for (;;) {
const char *next = NULL;
int tok = XmlPrologTok(parser->m_encoding, s, end, &next);
-#ifdef XML_DTD
+#if XML_GE == 1
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__,
XML_ACCOUNT_DIRECT)) {
accountingOnAbort(parser);
@@ -5728,7 +5822,7 @@ processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) {
return XML_ERROR_NO_MEMORY;
}
entity->open = XML_TRUE;
-#ifdef XML_DTD
+#if XML_GE == 1
entityTrackingOnOpen(parser, entity, __LINE__);
#endif
entity->processed = 0;
@@ -5761,10 +5855,10 @@ processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) {
if (textEnd != next && parser->m_parsingStatus.parsing == XML_SUSPENDED) {
entity->processed = (int)(next - textStart);
parser->m_processor = internalEntityProcessor;
- } else {
-#ifdef XML_DTD
+ } else if (parser->m_openInternalEntities->entity == entity) {
+#if XML_GE == 1
entityTrackingOnClose(parser, entity, __LINE__);
-#endif /* XML_DTD */
+#endif /* XML_GE == 1 */
entity->open = XML_FALSE;
parser->m_openInternalEntities = openEntity->next;
/* put openEntity back in list of free instances */
@@ -5813,7 +5907,7 @@ internalEntityProcessor(XML_Parser parser, const char *s, const char *end,
return result;
}
-#ifdef XML_DTD
+#if XML_GE == 1
entityTrackingOnClose(parser, entity, __LINE__);
#endif
entity->open = XML_FALSE;
@@ -5892,7 +5986,7 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
const char *next
= ptr; /* XmlAttributeValueTok doesn't always set the last arg */
int tok = XmlAttributeValueTok(enc, ptr, end, &next);
-#ifdef XML_DTD
+#if XML_GE == 1
if (! accountingDiffTolerated(parser, tok, ptr, next, __LINE__, account)) {
accountingOnAbort(parser);
return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
@@ -5957,14 +6051,14 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
XML_Char ch = (XML_Char)XmlPredefinedEntityName(
enc, ptr + enc->minBytesPerChar, next - enc->minBytesPerChar);
if (ch) {
-#ifdef XML_DTD
+#if XML_GE == 1
/* NOTE: We are replacing 4-6 characters original input for 1 character
* so there is no amplification and hence recording without
* protection. */
accountingDiffTolerated(parser, tok, (char *)&ch,
((char *)&ch) + sizeof(XML_Char), __LINE__,
XML_ACCOUNT_ENTITY_EXPANSION);
-#endif /* XML_DTD */
+#endif /* XML_GE == 1 */
if (! poolAppendChar(pool, ch))
return XML_ERROR_NO_MEMORY;
break;
@@ -6042,14 +6136,14 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
enum XML_Error result;
const XML_Char *textEnd = entity->textPtr + entity->textLen;
entity->open = XML_TRUE;
-#ifdef XML_DTD
+#if XML_GE == 1
entityTrackingOnOpen(parser, entity, __LINE__);
#endif
result = appendAttributeValue(parser, parser->m_internalEncoding,
isCdata, (const char *)entity->textPtr,
(const char *)textEnd, pool,
XML_ACCOUNT_ENTITY_EXPANSION);
-#ifdef XML_DTD
+#if XML_GE == 1
entityTrackingOnClose(parser, entity, __LINE__);
#endif
entity->open = XML_FALSE;
@@ -6079,6 +6173,7 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
/* not reached */
}
+#if XML_GE == 1
static enum XML_Error
storeEntityValue(XML_Parser parser, const ENCODING *enc,
const char *entityTextPtr, const char *entityTextEnd,
@@ -6086,12 +6181,12 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
DTD *const dtd = parser->m_dtd; /* save one level of indirection */
STRING_POOL *pool = &(dtd->entityValuePool);
enum XML_Error result = XML_ERROR_NONE;
-#ifdef XML_DTD
+# ifdef XML_DTD
int oldInEntityValue = parser->m_prologState.inEntityValue;
parser->m_prologState.inEntityValue = 1;
-#else
+# else
UNUSED_P(account);
-#endif /* XML_DTD */
+# endif /* XML_DTD */
/* never return Null for the value argument in EntityDeclHandler,
since this would indicate an external entity; therefore we
have to make sure that entityValuePool.start is not null */
@@ -6105,18 +6200,16 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
= entityTextPtr; /* XmlEntityValueTok doesn't always set the last arg */
int tok = XmlEntityValueTok(enc, entityTextPtr, entityTextEnd, &next);
-#ifdef XML_DTD
if (! accountingDiffTolerated(parser, tok, entityTextPtr, next, __LINE__,
account)) {
accountingOnAbort(parser);
result = XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
goto endEntityValue;
}
-#endif
switch (tok) {
case XML_TOK_PARAM_ENTITY_REF:
-#ifdef XML_DTD
+# ifdef XML_DTD
if (parser->m_isParamEntity || enc != parser->m_encoding) {
const XML_Char *name;
ENTITY *entity;
@@ -6178,7 +6271,7 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
}
break;
}
-#endif /* XML_DTD */
+# endif /* XML_DTD */
/* In the internal subset, PE references are not legal
within markup declarations, e.g entity values in this case. */
parser->m_eventPtr = entityTextPtr;
@@ -6259,12 +6352,38 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
entityTextPtr = next;
}
endEntityValue:
-#ifdef XML_DTD
+# ifdef XML_DTD
parser->m_prologState.inEntityValue = oldInEntityValue;
-#endif /* XML_DTD */
+# endif /* XML_DTD */
return result;
}
+#else /* XML_GE == 0 */
+
+static enum XML_Error
+storeSelfEntityValue(XML_Parser parser, ENTITY *entity) {
+ // This will store "&amp;entity123;" in entity->textPtr
+ // to end up as "&entity123;" in the handler.
+ const char *const entity_start = "&amp;";
+ const char *const entity_end = ";";
+
+ STRING_POOL *const pool = &(parser->m_dtd->entityValuePool);
+ if (! poolAppendString(pool, entity_start)
+ || ! poolAppendString(pool, entity->name)
+ || ! poolAppendString(pool, entity_end)) {
+ poolDiscard(pool);
+ return XML_ERROR_NO_MEMORY;
+ }
+
+ entity->textPtr = poolStart(pool);
+ entity->textLen = (int)(poolLength(pool));
+ poolFinish(pool);
+
+ return XML_ERROR_NONE;
+}
+
+#endif /* XML_GE == 0 */
+
static void FASTCALL
normalizeLines(XML_Char *s) {
XML_Char *p;
@@ -6375,8 +6494,9 @@ reportDefault(XML_Parser parser, const ENCODING *enc, const char *s,
} while ((convert_res != XML_CONVERT_COMPLETED)
&& (convert_res != XML_CONVERT_INPUT_INCOMPLETE));
} else
- parser->m_defaultHandler(parser->m_handlerArg, (XML_Char *)s,
- (int)((XML_Char *)end - (XML_Char *)s));
+ parser->m_defaultHandler(
+ parser->m_handlerArg, (const XML_Char *)s,
+ (int)((const XML_Char *)end - (const XML_Char *)s));
}
static int
@@ -6480,7 +6600,7 @@ getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start,
name = poolStoreString(&dtd->pool, enc, start, end);
if (! name)
return NULL;
- /* skip quotation mark - its storage will be re-used (like in name[-1]) */
+ /* skip quotation mark - its storage will be reused (like in name[-1]) */
++name;
id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, name,
sizeof(ATTRIBUTE_ID));
@@ -6630,6 +6750,10 @@ getContext(XML_Parser parser) {
static XML_Bool
setContext(XML_Parser parser, const XML_Char *context) {
+ if (context == NULL) {
+ return XML_FALSE;
+ }
+
DTD *const dtd = parser->m_dtd; /* save one level of indirection */
const XML_Char *s = context;
@@ -7220,7 +7344,7 @@ poolAppend(STRING_POOL *pool, const ENCODING *enc, const char *ptr,
return NULL;
for (;;) {
const enum XML_Convert_Result convert_res = XmlConvert(
- enc, &ptr, end, (ICHAR **)&(pool->ptr), (ICHAR *)pool->end);
+ enc, &ptr, end, (ICHAR **)&(pool->ptr), (const ICHAR *)pool->end);
if ((convert_res == XML_CONVERT_COMPLETED)
|| (convert_res == XML_CONVERT_INPUT_INCOMPLETE))
break;
@@ -7651,7 +7775,7 @@ copyString(const XML_Char *s, const XML_Memory_Handling_Suite *memsuite) {
return result;
}
-#ifdef XML_DTD
+#if XML_GE == 1
static float
accountingGetCurrentAmplification(XML_Parser rootParser) {
@@ -7672,7 +7796,7 @@ accountingReportStats(XML_Parser originParser, const char *epilog) {
const XML_Parser rootParser = getRootParserOf(originParser, NULL);
assert(! rootParser->m_parentParser);
- if (rootParser->m_accounting.debugLevel < 1) {
+ if (rootParser->m_accounting.debugLevel == 0u) {
return;
}
@@ -7709,7 +7833,7 @@ accountingReportDiff(XML_Parser rootParser,
/* Note: Performance is of no concern here */
const char *walker = before;
- if ((rootParser->m_accounting.debugLevel >= 3)
+ if ((rootParser->m_accounting.debugLevel >= 3u)
|| (after - before)
<= (ptrdiff_t)(contextLength + ellipsisLength + contextLength)) {
for (; walker < after; walker++) {
@@ -7774,7 +7898,7 @@ accountingDiffTolerated(XML_Parser originParser, int tok, const char *before,
|| (amplificationFactor
<= rootParser->m_accounting.maximumAmplificationFactor);
- if (rootParser->m_accounting.debugLevel >= 2) {
+ if (rootParser->m_accounting.debugLevel >= 2u) {
accountingReportStats(rootParser, "");
accountingReportDiff(rootParser, levelsAwayFromRootParser, before, after,
bytesMore, source_line, account);
@@ -7801,7 +7925,7 @@ static void
entityTrackingReportStats(XML_Parser rootParser, ENTITY *entity,
const char *action, int sourceLine) {
assert(! rootParser->m_parentParser);
- if (rootParser->m_entity_stats.debugLevel < 1)
+ if (rootParser->m_entity_stats.debugLevel == 0u)
return;
# if defined(XML_UNICODE)
@@ -8382,7 +8506,7 @@ unsignedCharToPrintable(unsigned char c) {
assert(0); /* never gets here */
}
-#endif /* XML_DTD */
+#endif /* XML_GE == 1 */
static unsigned long
getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) {
@@ -8393,9 +8517,9 @@ getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) {
const char *const value = valueOrNull;
errno = 0;
- char *afterValue = (char *)value;
+ char *afterValue = NULL;
unsigned long debugLevel = strtoul(value, &afterValue, 10);
- if ((errno != 0) || (afterValue[0] != '\0')) {
+ if ((errno != 0) || (afterValue == value) || (afterValue[0] != '\0')) {
errno = 0;
return defaultDebugLevel;
}
diff --git a/contrib/libs/expat/lib/xmlrole.c b/contrib/libs/expat/lib/xmlrole.c
index 3f0f5c150c6..2c48bf40867 100644
--- a/contrib/libs/expat/lib/xmlrole.c
+++ b/contrib/libs/expat/lib/xmlrole.c
@@ -12,10 +12,10 @@
Copyright (c) 2002-2006 Karl Waclawek <[email protected]>
Copyright (c) 2002-2003 Fred L. Drake, Jr. <[email protected]>
Copyright (c) 2005-2009 Steven Solie <[email protected]>
- Copyright (c) 2016-2021 Sebastian Pipping <[email protected]>
+ Copyright (c) 2016-2023 Sebastian Pipping <[email protected]>
Copyright (c) 2017 Rhodri James <[email protected]>
Copyright (c) 2019 David Loffredo <[email protected]>
- Copyright (c) 2021 Dong-hee Na <[email protected]>
+ Copyright (c) 2021 Donghee Na <[email protected]>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -38,7 +38,7 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include <expat_config.h>
+#include "expat_config.h"
#include <stddef.h>
diff --git a/contrib/libs/expat/lib/xmlrole.h b/contrib/libs/expat/lib/xmlrole.h
index d6e1fa150a1..a7904274c91 100644
--- a/contrib/libs/expat/lib/xmlrole.h
+++ b/contrib/libs/expat/lib/xmlrole.h
@@ -10,7 +10,7 @@
Copyright (c) 2000 Clark Cooper <[email protected]>
Copyright (c) 2002 Karl Waclawek <[email protected]>
Copyright (c) 2002 Fred L. Drake, Jr. <[email protected]>
- Copyright (c) 2017 Sebastian Pipping <[email protected]>
+ Copyright (c) 2017-2024 Sebastian Pipping <[email protected]>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -127,9 +127,9 @@ typedef struct prolog_state {
#endif /* XML_DTD */
} PROLOG_STATE;
-void XmlPrologStateInit(PROLOG_STATE *);
+void XmlPrologStateInit(PROLOG_STATE *state);
#ifdef XML_DTD
-void XmlPrologStateInitExternalEntity(PROLOG_STATE *);
+void XmlPrologStateInitExternalEntity(PROLOG_STATE *state);
#endif /* XML_DTD */
#define XmlTokenRole(state, tok, ptr, end, enc) \
diff --git a/contrib/libs/expat/lib/xmltok.c b/contrib/libs/expat/lib/xmltok.c
index 2b7012a58be..29a66d72cee 100644
--- a/contrib/libs/expat/lib/xmltok.c
+++ b/contrib/libs/expat/lib/xmltok.c
@@ -12,7 +12,7 @@
Copyright (c) 2002 Greg Stein <[email protected]>
Copyright (c) 2002-2016 Karl Waclawek <[email protected]>
Copyright (c) 2005-2009 Steven Solie <[email protected]>
- Copyright (c) 2016-2022 Sebastian Pipping <[email protected]>
+ Copyright (c) 2016-2024 Sebastian Pipping <[email protected]>
Copyright (c) 2016 Pascal Cuoq <[email protected]>
Copyright (c) 2016 Don Lewis <[email protected]>
Copyright (c) 2017 Rhodri James <[email protected]>
@@ -20,8 +20,10 @@
Copyright (c) 2017 Benbuck Nason <[email protected]>
Copyright (c) 2017 José Gutiérrez de la Concha <[email protected]>
Copyright (c) 2019 David Loffredo <[email protected]>
- Copyright (c) 2021 Dong-hee Na <[email protected]>
+ Copyright (c) 2021 Donghee Na <[email protected]>
Copyright (c) 2022 Martin Ettl <[email protected]>
+ Copyright (c) 2022 Sean McBride <[email protected]>
+ Copyright (c) 2023 Hanno Böck <[email protected]>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -44,7 +46,7 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include <expat_config.h>
+#include "expat_config.h"
#include <stddef.h>
#include <string.h> /* memcpy */
@@ -76,7 +78,7 @@
#define VTABLE VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16)
#define UCS2_GET_NAMING(pages, hi, lo) \
- (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1u << ((lo)&0x1F)))
+ (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1u << ((lo) & 0x1F)))
/* A 2 byte UTF-8 representation splits the characters 11 bits between
the bottom 5 and 6 bits of the bytes. We need 8 bits to index into
@@ -100,7 +102,7 @@
& (1u << (((byte)[2]) & 0x1F)))
/* Detection of invalid UTF-8 sequences is based on Table 3.1B
- of Unicode 3.2: http://www.unicode.org/unicode/reports/tr28/
+ of Unicode 3.2: https://www.unicode.org/unicode/reports/tr28/
with the additional restriction of not allowing the Unicode
code points 0xFFFF and 0xFFFE (sequences EF,BF,BF and EF,BF,BE).
Implementation details:
@@ -225,7 +227,7 @@ struct normal_encoding {
/* isNmstrt2 */ NULL, /* isNmstrt3 */ NULL, /* isNmstrt4 */ NULL, \
/* isInvalid2 */ NULL, /* isInvalid3 */ NULL, /* isInvalid4 */ NULL
-static int FASTCALL checkCharRefNumber(int);
+static int FASTCALL checkCharRefNumber(int result);
#include "xmltok_impl.h"
#include "ascii.h"
@@ -243,7 +245,7 @@ static int FASTCALL checkCharRefNumber(int);
#endif
#define SB_BYTE_TYPE(enc, p) \
- (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)])
+ (((const struct normal_encoding *)(enc))->type[(unsigned char)*(p)])
#ifdef XML_MIN_SIZE
static int PTRFASTCALL
@@ -407,7 +409,7 @@ utf8_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim,
unsigned short *to = *toP;
const char *from = *fromP;
while (from < fromLim && to < toLim) {
- switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) {
+ switch (SB_BYTE_TYPE(enc, from)) {
case BT_LEAD2:
if (fromLim - from < 2) {
res = XML_CONVERT_INPUT_INCOMPLETE;
@@ -715,31 +717,26 @@ unicode_byte_type(char hi, char lo) {
return res; \
}
-#define SET2(ptr, ch) (((ptr)[0] = ((ch)&0xff)), ((ptr)[1] = ((ch) >> 8)))
#define GET_LO(ptr) ((unsigned char)(ptr)[0])
#define GET_HI(ptr) ((unsigned char)(ptr)[1])
DEFINE_UTF16_TO_UTF8(little2_)
DEFINE_UTF16_TO_UTF16(little2_)
-#undef SET2
#undef GET_LO
#undef GET_HI
-#define SET2(ptr, ch) (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch)&0xFF)))
#define GET_LO(ptr) ((unsigned char)(ptr)[1])
#define GET_HI(ptr) ((unsigned char)(ptr)[0])
DEFINE_UTF16_TO_UTF8(big2_)
DEFINE_UTF16_TO_UTF16(big2_)
-#undef SET2
#undef GET_LO
#undef GET_HI
#define LITTLE2_BYTE_TYPE(enc, p) \
- ((p)[1] == 0 ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \
- : unicode_byte_type((p)[1], (p)[0]))
+ ((p)[1] == 0 ? SB_BYTE_TYPE(enc, p) : unicode_byte_type((p)[1], (p)[0]))
#define LITTLE2_BYTE_TO_ASCII(p) ((p)[1] == 0 ? (p)[0] : -1)
#define LITTLE2_CHAR_MATCHES(p, c) ((p)[1] == 0 && (p)[0] == (c))
#define LITTLE2_IS_NAME_CHAR_MINBPC(p) \
@@ -872,9 +869,7 @@ static const struct normal_encoding internal_little2_encoding
#endif
#define BIG2_BYTE_TYPE(enc, p) \
- ((p)[0] == 0 \
- ? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \
- : unicode_byte_type((p)[0], (p)[1]))
+ ((p)[0] == 0 ? SB_BYTE_TYPE(enc, p + 1) : unicode_byte_type((p)[0], (p)[1]))
#define BIG2_BYTE_TO_ASCII(p) ((p)[0] == 0 ? (p)[1] : -1)
#define BIG2_CHAR_MATCHES(p, c) ((p)[0] == 0 && (p)[1] == (c))
#define BIG2_IS_NAME_CHAR_MINBPC(p) \
diff --git a/contrib/libs/expat/lib/xmltok.h b/contrib/libs/expat/lib/xmltok.h
index 6f630c2f9ba..c51fce1ec15 100644
--- a/contrib/libs/expat/lib/xmltok.h
+++ b/contrib/libs/expat/lib/xmltok.h
@@ -10,7 +10,7 @@
Copyright (c) 2000 Clark Cooper <[email protected]>
Copyright (c) 2002 Fred L. Drake, Jr. <[email protected]>
Copyright (c) 2002-2005 Karl Waclawek <[email protected]>
- Copyright (c) 2016-2017 Sebastian Pipping <[email protected]>
+ Copyright (c) 2016-2024 Sebastian Pipping <[email protected]>
Copyright (c) 2017 Rhodri James <[email protected]>
Licensed under the MIT license:
@@ -289,7 +289,8 @@ int XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc,
const char **encodingNamePtr,
const ENCODING **namedEncodingPtr, int *standalonePtr);
-int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
+int XmlInitEncoding(INIT_ENCODING *p, const ENCODING **encPtr,
+ const char *name);
const ENCODING *XmlGetUtf8InternalEncoding(void);
const ENCODING *XmlGetUtf16InternalEncoding(void);
int FASTCALL XmlUtf8Encode(int charNumber, char *buf);
@@ -307,7 +308,8 @@ int XmlParseXmlDeclNS(int isGeneralTextEntity, const ENCODING *enc,
const char **encodingNamePtr,
const ENCODING **namedEncodingPtr, int *standalonePtr);
-int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
+int XmlInitEncodingNS(INIT_ENCODING *p, const ENCODING **encPtr,
+ const char *name);
const ENCODING *XmlGetUtf8InternalEncodingNS(void);
const ENCODING *XmlGetUtf16InternalEncodingNS(void);
ENCODING *XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert,
diff --git a/contrib/libs/expat/lib/xmltok_impl.c b/contrib/libs/expat/lib/xmltok_impl.c
index 1971d74bf8c..239a2d06c45 100644
--- a/contrib/libs/expat/lib/xmltok_impl.c
+++ b/contrib/libs/expat/lib/xmltok_impl.c
@@ -126,7 +126,7 @@
# endif
# define HAS_CHARS(enc, ptr, end, count) \
- ((end) - (ptr) >= ((count)*MINBPC(enc)))
+ ((end) - (ptr) >= ((count) * MINBPC(enc)))
# define HAS_CHAR(enc, ptr, end) HAS_CHARS(enc, ptr, end, 1)
diff --git a/contrib/libs/expat/ya.make b/contrib/libs/expat/ya.make
index b1370c43fba..3fbfd9bf42e 100644
--- a/contrib/libs/expat/ya.make
+++ b/contrib/libs/expat/ya.make
@@ -1,10 +1,10 @@
-# Generated by devtools/yamaker from nixpkgs 22.05.
+# Generated by devtools/yamaker from nixpkgs 22.11.
LIBRARY()
-VERSION(2.5.0)
+VERSION(2.6.0)
-ORIGINAL_SOURCE(https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.xz)
+ORIGINAL_SOURCE(https://github.com/libexpat/libexpat/releases/download/R_2_6_0/expat-2.6.0.tar.xz)
LICENSE(
CC0-1.0 AND
diff --git a/contrib/libs/farmhash/common.h b/contrib/libs/farmhash/common.h
index 7c6acfee331..31593e2f5ec 100644
--- a/contrib/libs/farmhash/common.h
+++ b/contrib/libs/farmhash/common.h
@@ -138,7 +138,7 @@
#elif defined(__sun) || defined(sun)
-#include <sys/byteorder.h>
+#error #include <sys/byteorder.h>
#undef bswap_32
#undef bswap_64
#define bswap_32(x) BSWAP_32(x)
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine_shims/tcp_client.cc b/contrib/libs/grpc/src/core/lib/iomgr/event_engine_shims/tcp_client.cc
index 5fe59d15623..ab7de1166be 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/event_engine_shims/tcp_client.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine_shims/tcp_client.cc
@@ -16,6 +16,7 @@
#include "src/core/lib/iomgr/event_engine_shims/tcp_client.h"
#include "y_absl/status/status.h"
+#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/string_view.h"
#include <grpc/event_engine/event_engine.h>
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc
index 0e73612db4b..27a9ed54d10 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc
@@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/impl/grpc_types.h>
#include "src/core/lib/iomgr/exec_ctx.h"
diff --git a/contrib/libs/icu/include/unicode/platform.h b/contrib/libs/icu/include/unicode/platform.h
index a997843660c..ed1cd25f1b6 100644
--- a/contrib/libs/icu/include/unicode/platform.h
+++ b/contrib/libs/icu/include/unicode/platform.h
@@ -186,7 +186,7 @@
* header file is included with stddef.h but on Solairs/GCC, the GCC version of stddef.h
* is included which does not include this header file.
*/
-# include <sys/isa_defs.h>
+# error #include <sys/isa_defs.h>
# endif
#elif defined(_AIX) || defined(__TOS_AIX__)
# define U_PLATFORM U_PF_AIX
diff --git a/contrib/libs/libpq/COPYRIGHT b/contrib/libs/libpq/COPYRIGHT
index d33e0f599df..16f9b46a3fe 100644
--- a/contrib/libs/libpq/COPYRIGHT
+++ b/contrib/libs/libpq/COPYRIGHT
@@ -1,7 +1,7 @@
PostgreSQL Database Management System
(formerly known as Postgres, then as Postgres95)
-Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
+Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
Portions Copyright (c) 1994, The Regents of the University of California
diff --git a/contrib/libs/libpq/src/common/scram-common.c b/contrib/libs/libpq/src/common/scram-common.c
index ef997ef6849..22ad9292185 100644
--- a/contrib/libs/libpq/src/common/scram-common.c
+++ b/contrib/libs/libpq/src/common/scram-common.c
@@ -22,6 +22,9 @@
#include "common/base64.h"
#include "common/hmac.h"
#include "common/scram-common.h"
+#ifndef FRONTEND
+#error #include "miscadmin.h"
+#endif
#include "port/pg_bswap.h"
/*
@@ -73,6 +76,14 @@ scram_SaltedPassword(const char *password,
/* Subsequent iterations */
for (i = 2; i <= iterations; i++)
{
+#ifndef FRONTEND
+ /*
+ * Make sure that this is interruptible as scram_iterations could be
+ * set to a large value.
+ */
+ CHECK_FOR_INTERRUPTS();
+#endif
+
if (pg_hmac_init(hmac_ctx, (uint8 *) password, password_len) < 0 ||
pg_hmac_update(hmac_ctx, (uint8 *) Ui_prev, key_length) < 0 ||
pg_hmac_final(hmac_ctx, Ui, key_length) < 0)
diff --git a/contrib/libs/libpq/src/common/wchar.c b/contrib/libs/libpq/src/common/wchar.c
index fb9d9f5c85f..fbac11deb4d 100644
--- a/contrib/libs/libpq/src/common/wchar.c
+++ b/contrib/libs/libpq/src/common/wchar.c
@@ -13,6 +13,7 @@
#include "c.h"
#include "mb/pg_wchar.h"
+#include "utils/ascii.h"
/*
diff --git a/contrib/libs/libpq/src/include/mb/pg_wchar.h b/contrib/libs/libpq/src/include/mb/pg_wchar.h
index 25276b199fe..06a56a41bb8 100644
--- a/contrib/libs/libpq/src/include/mb/pg_wchar.h
+++ b/contrib/libs/libpq/src/include/mb/pg_wchar.h
@@ -19,8 +19,6 @@
#ifndef PG_WCHAR_H
#define PG_WCHAR_H
-#include "port/simd.h"
-
/*
* The pg_wchar type
*/
@@ -702,71 +700,4 @@ extern int mic2latin_with_table(const unsigned char *mic, unsigned char *p,
extern WCHAR *pgwin32_message_to_UTF16(const char *str, int len, int *utf16len);
#endif
-
-/*
- * Verify a chunk of bytes for valid ASCII.
- *
- * Returns false if the input contains any zero bytes or bytes with the
- * high-bit set. Input len must be a multiple of the chunk size (8 or 16).
- */
-static inline bool
-is_valid_ascii(const unsigned char *s, int len)
-{
- const unsigned char *const s_end = s + len;
- Vector8 chunk;
- Vector8 highbit_cum = vector8_broadcast(0);
-#ifdef USE_NO_SIMD
- Vector8 zero_cum = vector8_broadcast(0x80);
-#endif
-
- Assert(len % sizeof(chunk) == 0);
-
- while (s < s_end)
- {
- vector8_load(&chunk, s);
-
- /* Capture any zero bytes in this chunk. */
-#ifdef USE_NO_SIMD
-
- /*
- * First, add 0x7f to each byte. This sets the high bit in each byte,
- * unless it was a zero. If any resulting high bits are zero, the
- * corresponding high bits in the zero accumulator will be cleared.
- *
- * If none of the bytes in the chunk had the high bit set, the max
- * value each byte can have after the addition is 0x7f + 0x7f = 0xfe,
- * and we don't need to worry about carrying over to the next byte. If
- * any input bytes did have the high bit set, it doesn't matter
- * because we check for those separately.
- */
- zero_cum &= (chunk + vector8_broadcast(0x7F));
-#else
-
- /*
- * Set all bits in each lane of the highbit accumulator where input
- * bytes are zero.
- */
- highbit_cum = vector8_or(highbit_cum,
- vector8_eq(chunk, vector8_broadcast(0)));
-#endif
-
- /* Capture all set bits in this chunk. */
- highbit_cum = vector8_or(highbit_cum, chunk);
-
- s += sizeof(chunk);
- }
-
- /* Check if any high bits in the high bit accumulator got set. */
- if (vector8_is_highbit_set(highbit_cum))
- return false;
-
-#ifdef USE_NO_SIMD
- /* Check if any high bits in the zero accumulator got cleared. */
- if (zero_cum != vector8_broadcast(0x80))
- return false;
-#endif
-
- return true;
-}
-
#endif /* PG_WCHAR_H */
diff --git a/contrib/libs/libpq/src/include/pg_config-linux.h b/contrib/libs/libpq/src/include/pg_config-linux.h
index afcf2967c55..b4592fa70af 100644
--- a/contrib/libs/libpq/src/include/pg_config-linux.h
+++ b/contrib/libs/libpq/src/include/pg_config-linux.h
@@ -32,7 +32,7 @@
#define BLCKSZ 8192
/* Saved arguments from configure */
-#define CONFIGURE_ARGS " '--prefix=/var/empty/postgresql-16.1' '--with-openssl' '--with-libxml' '--with-icu' '--sysconfdir=/etc' '--libdir=$(lib)/lib' '--with-system-tzdata=/var/empty/tzdata-2022f/share/zoneinfo' '--enable-debug' '--with-systemd' '--with-ossp-uuid' '--with-lz4' '--with-gssapi' '--without-gssapi' 'CC=cc' 'CXX=g++' 'PKG_CONFIG=pkg-config' 'PKG_CONFIG_PATH=/var/empty/libxcrypt-4.4.30/lib/pkgconfig:/var/empty/zlib-1.2.13-dev/lib/pkgconfig:/var/empty/ncurses-6.3-p20220507-dev/lib/pkgconfig:/var/empty/openssl-3.0.7-dev/lib/pkgconfig:/var/empty/libxml2-2.10.3-dev/lib/pkgconfig:/var/empty/icu4c-72.1-dev/lib/pkgconfig:/var/empty/lz4-1.9.4-dev/lib/pkgconfig:/var/empty/systemd-251.7-dev/lib/pkgconfig:/var/empty/systemd-251.7-dev/share/pkgconfig:/var/empty/libkrb5-1.20-dev/lib/pkgconfig:/var/empty/libossp-uuid-1.6.2/lib/pkgconfig'"
+#define CONFIGURE_ARGS " '--prefix=/var/empty/postgresql-16.2' '--with-openssl' '--with-libxml' '--with-icu' '--sysconfdir=/etc' '--libdir=$(lib)/lib' '--with-system-tzdata=/var/empty/tzdata-2022f/share/zoneinfo' '--enable-debug' '--with-systemd' '--with-ossp-uuid' '--with-lz4' '--with-gssapi' '--without-gssapi' 'CC=cc' 'CXX=g++' 'PKG_CONFIG=pkg-config' 'PKG_CONFIG_PATH=/var/empty/libxcrypt-4.4.30/lib/pkgconfig:/var/empty/zlib-1.2.13-dev/lib/pkgconfig:/var/empty/ncurses-6.3-p20220507-dev/lib/pkgconfig:/var/empty/openssl-3.0.7-dev/lib/pkgconfig:/var/empty/libxml2-2.10.3-dev/lib/pkgconfig:/var/empty/icu4c-72.1-dev/lib/pkgconfig:/var/empty/lz4-1.9.4-dev/lib/pkgconfig:/var/empty/systemd-251.7-dev/lib/pkgconfig:/var/empty/systemd-251.7-dev/share/pkgconfig:/var/empty/libkrb5-1.20-dev/lib/pkgconfig:/var/empty/libossp-uuid-1.6.2/lib/pkgconfig'"
/* Define to the default TCP port number on which the server listens and to
which clients will try to connect. This can be overridden at run-time, but
@@ -71,9 +71,6 @@
/* Define to 1 if you have the `backtrace_symbols' function. */
#define HAVE_BACKTRACE_SYMBOLS 1
-/* Define to 1 if you have the `BIO_get_data' function. */
-#define HAVE_BIO_GET_DATA 1
-
/* Define to 1 if you have the `BIO_meth_new' function. */
#define HAVE_BIO_METH_NEW 1
@@ -607,7 +604,7 @@
#define PACKAGE_NAME "PostgreSQL"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "PostgreSQL 16.1"
+#define PACKAGE_STRING "PostgreSQL 16.2"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "postgresql"
@@ -616,7 +613,7 @@
#define PACKAGE_URL "https://www.postgresql.org/"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "16.1"
+#define PACKAGE_VERSION "16.2"
/* Define to the name of a signed 128-bit integer type. */
#define PG_INT128_TYPE __int128
@@ -635,7 +632,7 @@
#define PG_MAJORVERSION_NUM 16
/* PostgreSQL minor version number */
-#define PG_MINORVERSION_NUM 1
+#define PG_MINORVERSION_NUM 2
/* Define to best printf format archetype, usually gnu_printf if available. */
#define PG_PRINTF_ATTRIBUTE gnu_printf
@@ -644,13 +641,13 @@
#define PG_USE_STDBOOL 1
/* PostgreSQL version as a string */
-#define PG_VERSION "16.1"
+#define PG_VERSION "16.2"
/* PostgreSQL version as a number */
-#define PG_VERSION_NUM 160001
+#define PG_VERSION_NUM 160002
/* A string containing the version number, platform, and C compiler */
-#define PG_VERSION_STR "PostgreSQL 16.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.3.0, 64-bit"
+#define PG_VERSION_STR "PostgreSQL 16.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.3.0, 64-bit"
/* Define to 1 to allow profiling output to be saved separately for each
process. */
diff --git a/contrib/libs/libpq/src/include/utils/ascii.h b/contrib/libs/libpq/src/include/utils/ascii.h
new file mode 100644
index 00000000000..7df024dad39
--- /dev/null
+++ b/contrib/libs/libpq/src/include/utils/ascii.h
@@ -0,0 +1,84 @@
+/*-----------------------------------------------------------------------
+ * ascii.h
+ *
+ * Portions Copyright (c) 1999-2023, PostgreSQL Global Development Group
+ *
+ * src/include/utils/ascii.h
+ *
+ *-----------------------------------------------------------------------
+ */
+
+#ifndef _ASCII_H_
+#define _ASCII_H_
+
+#include "port/simd.h"
+
+extern void ascii_safe_strlcpy(char *dest, const char *src, size_t destsiz);
+
+/*
+ * Verify a chunk of bytes for valid ASCII.
+ *
+ * Returns false if the input contains any zero bytes or bytes with the
+ * high-bit set. Input len must be a multiple of the chunk size (8 or 16).
+ */
+static inline bool
+is_valid_ascii(const unsigned char *s, int len)
+{
+ const unsigned char *const s_end = s + len;
+ Vector8 chunk;
+ Vector8 highbit_cum = vector8_broadcast(0);
+#ifdef USE_NO_SIMD
+ Vector8 zero_cum = vector8_broadcast(0x80);
+#endif
+
+ Assert(len % sizeof(chunk) == 0);
+
+ while (s < s_end)
+ {
+ vector8_load(&chunk, s);
+
+ /* Capture any zero bytes in this chunk. */
+#ifdef USE_NO_SIMD
+
+ /*
+ * First, add 0x7f to each byte. This sets the high bit in each byte,
+ * unless it was a zero. If any resulting high bits are zero, the
+ * corresponding high bits in the zero accumulator will be cleared.
+ *
+ * If none of the bytes in the chunk had the high bit set, the max
+ * value each byte can have after the addition is 0x7f + 0x7f = 0xfe,
+ * and we don't need to worry about carrying over to the next byte. If
+ * any input bytes did have the high bit set, it doesn't matter
+ * because we check for those separately.
+ */
+ zero_cum &= (chunk + vector8_broadcast(0x7F));
+#else
+
+ /*
+ * Set all bits in each lane of the highbit accumulator where input
+ * bytes are zero.
+ */
+ highbit_cum = vector8_or(highbit_cum,
+ vector8_eq(chunk, vector8_broadcast(0)));
+#endif
+
+ /* Capture all set bits in this chunk. */
+ highbit_cum = vector8_or(highbit_cum, chunk);
+
+ s += sizeof(chunk);
+ }
+
+ /* Check if any high bits in the high bit accumulator got set. */
+ if (vector8_is_highbit_set(highbit_cum))
+ return false;
+
+#ifdef USE_NO_SIMD
+ /* Check if any high bits in the zero accumulator got cleared. */
+ if (zero_cum != vector8_broadcast(0x80))
+ return false;
+#endif
+
+ return true;
+}
+
+#endif /* _ASCII_H_ */
diff --git a/contrib/libs/libpq/src/interfaces/libpq/fe-exec.c b/contrib/libs/libpq/src/interfaces/libpq/fe-exec.c
index 26564955d05..fb11997eff8 100644
--- a/contrib/libs/libpq/src/interfaces/libpq/fe-exec.c
+++ b/contrib/libs/libpq/src/interfaces/libpq/fe-exec.c
@@ -841,6 +841,8 @@ pqSaveWriteError(PGconn *conn)
* using whatever is in conn->errorMessage. In any case, clear the async
* result storage, and update our notion of how much error text has been
* returned to the application.
+ *
+ * Note that in no case (not even OOM) do we return NULL.
*/
PGresult *
pqPrepareAsyncResult(PGconn *conn)
@@ -2112,19 +2114,12 @@ PQgetResult(PGconn *conn)
break;
case PGASYNC_READY:
-
- /*
- * For any query type other than simple query protocol, we advance
- * the command queue here. This is because for simple query
- * protocol we can get the READY state multiple times before the
- * command is actually complete, since the command string can
- * contain many queries. In simple query protocol, the queue
- * advance is done by fe-protocol3 when it receives ReadyForQuery.
- */
- if (conn->cmd_queue_head &&
- conn->cmd_queue_head->queryclass != PGQUERY_SIMPLE)
- pqCommandQueueAdvance(conn);
res = pqPrepareAsyncResult(conn);
+
+ /* Advance the queue as appropriate */
+ pqCommandQueueAdvance(conn, false,
+ res->resultStatus == PGRES_PIPELINE_SYNC);
+
if (conn->pipelineStatus != PQ_PIPELINE_OFF)
{
/*
@@ -2144,7 +2139,7 @@ PQgetResult(PGconn *conn)
* (In other words: we don't return a NULL after a pipeline
* sync.)
*/
- if (res && res->resultStatus == PGRES_PIPELINE_SYNC)
+ if (res->resultStatus == PGRES_PIPELINE_SYNC)
pqPipelineProcessQueue(conn);
}
else
@@ -3012,18 +3007,44 @@ PQexitPipelineMode(PGconn *conn)
/*
* pqCommandQueueAdvance
- * Remove one query from the command queue, when we receive
- * all results from the server that pertain to it.
+ * Remove one query from the command queue, if appropriate.
+ *
+ * If we have received all results corresponding to the head element
+ * in the command queue, remove it.
+ *
+ * In simple query protocol we must not advance the command queue until the
+ * ReadyForQuery message has been received. This is because in simple mode a
+ * command can have multiple queries, and we must process result for all of
+ * them before moving on to the next command.
+ *
+ * Another consideration is synchronization during error processing in
+ * extended query protocol: we refuse to advance the queue past a SYNC queue
+ * element, unless the result we've received is also a SYNC. In particular
+ * this protects us from advancing when an error is received at an
+ * inappropriate moment.
*/
void
-pqCommandQueueAdvance(PGconn *conn)
+pqCommandQueueAdvance(PGconn *conn, bool isReadyForQuery, bool gotSync)
{
PGcmdQueueEntry *prevquery;
if (conn->cmd_queue_head == NULL)
return;
- /* delink from queue */
+ /*
+ * If processing a query of simple query protocol, we only advance the
+ * queue when we receive the ReadyForQuery message for it.
+ */
+ if (conn->cmd_queue_head->queryclass == PGQUERY_SIMPLE && !isReadyForQuery)
+ return;
+
+ /*
+ * If we're waiting for a SYNC, don't advance the queue until we get one.
+ */
+ if (conn->cmd_queue_head->queryclass == PGQUERY_SYNC && !gotSync)
+ return;
+
+ /* delink element from queue */
prevquery = conn->cmd_queue_head;
conn->cmd_queue_head = conn->cmd_queue_head->next;
@@ -3031,7 +3052,7 @@ pqCommandQueueAdvance(PGconn *conn)
if (conn->cmd_queue_head == NULL)
conn->cmd_queue_tail = NULL;
- /* and make it recyclable */
+ /* and make the queue element recyclable */
prevquery->next = NULL;
pqRecycleCmdQueueEntry(conn, prevquery);
}
@@ -3240,6 +3261,14 @@ PQsendFlushRequest(PGconn *conn)
return 0;
}
+ /*
+ * Give the data a push (in pipeline mode, only if we're past the size
+ * threshold). In nonblock mode, don't complain if we're unable to send
+ * it all; PQgetResult() will do any additional flushing needed.
+ */
+ if (pqPipelineFlush(conn) < 0)
+ return 0;
+
return 1;
}
diff --git a/contrib/libs/libpq/src/interfaces/libpq/fe-protocol3.c b/contrib/libs/libpq/src/interfaces/libpq/fe-protocol3.c
index 32b66d561cb..9c4aa7e2c78 100644
--- a/contrib/libs/libpq/src/interfaces/libpq/fe-protocol3.c
+++ b/contrib/libs/libpq/src/interfaces/libpq/fe-protocol3.c
@@ -236,13 +236,8 @@ pqParseInput3(PGconn *conn)
}
else
{
- /*
- * In simple query protocol, advance the command queue
- * (see PQgetResult).
- */
- if (conn->cmd_queue_head &&
- conn->cmd_queue_head->queryclass == PGQUERY_SIMPLE)
- pqCommandQueueAdvance(conn);
+ /* Advance the command queue and set us idle */
+ pqCommandQueueAdvance(conn, true, false);
conn->asyncStatus = PGASYNC_IDLE;
}
break;
diff --git a/contrib/libs/libpq/src/interfaces/libpq/fe-secure-openssl.c b/contrib/libs/libpq/src/interfaces/libpq/fe-secure-openssl.c
index 5c220e0e699..8b845994a1e 100644
--- a/contrib/libs/libpq/src/interfaces/libpq/fe-secure-openssl.c
+++ b/contrib/libs/libpq/src/interfaces/libpq/fe-secure-openssl.c
@@ -207,7 +207,7 @@ rloop:
*/
goto rloop;
case SSL_ERROR_SYSCALL:
- if (n < 0)
+ if (n < 0 && SOCK_ERRNO != 0)
{
result_errno = SOCK_ERRNO;
if (result_errno == EPIPE ||
@@ -308,7 +308,13 @@ pgtls_write(PGconn *conn, const void *ptr, size_t len)
n = 0;
break;
case SSL_ERROR_SYSCALL:
- if (n < 0)
+
+ /*
+ * If errno is still zero then assume it's a read EOF situation,
+ * and report EOF. (This seems possible because SSL_write can
+ * also do reads.)
+ */
+ if (n < 0 && SOCK_ERRNO != 0)
{
result_errno = SOCK_ERRNO;
if (result_errno == EPIPE || result_errno == ECONNRESET)
@@ -1523,11 +1529,12 @@ open_client_SSL(PGconn *conn)
* was using the system CA pool. For other errors, log
* them using the normal SYSCALL logging.
*/
- if (!save_errno && vcode == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY &&
+ if (save_errno == 0 &&
+ vcode == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY &&
strcmp(conn->sslrootcert, "system") == 0)
libpq_append_conn_error(conn, "SSL error: certificate verify failed: %s",
X509_verify_cert_error_string(vcode));
- else if (r == -1)
+ else if (r == -1 && save_errno != 0)
libpq_append_conn_error(conn, "SSL SYSCALL error: %s",
SOCK_STRERROR(save_errno, sebuf, sizeof(sebuf)));
else
@@ -1834,11 +1841,7 @@ PQsslAttribute(PGconn *conn, const char *attribute_name)
* to retry; do we need to adopt their logic for that?
*/
-#ifndef HAVE_BIO_GET_DATA
-#define BIO_get_data(bio) (bio->ptr)
-#define BIO_set_data(bio, data) (bio->ptr = data)
-#endif
-
+/* protected by ssl_config_mutex */
static BIO_METHOD *my_bio_methods;
static int
@@ -1846,7 +1849,7 @@ my_sock_read(BIO *h, char *buf, int size)
{
int res;
- res = pqsecure_raw_read((PGconn *) BIO_get_data(h), buf, size);
+ res = pqsecure_raw_read((PGconn *) BIO_get_app_data(h), buf, size);
BIO_clear_retry_flags(h);
if (res < 0)
{
@@ -1876,7 +1879,7 @@ my_sock_write(BIO *h, const char *buf, int size)
{
int res;
- res = pqsecure_raw_write((PGconn *) BIO_get_data(h), buf, size);
+ res = pqsecure_raw_write((PGconn *) BIO_get_app_data(h), buf, size);
BIO_clear_retry_flags(h);
if (res < 0)
{
@@ -1904,6 +1907,15 @@ my_sock_write(BIO *h, const char *buf, int size)
static BIO_METHOD *
my_BIO_s_socket(void)
{
+ BIO_METHOD *res;
+
+#ifdef ENABLE_THREAD_SAFETY
+ if (pthread_mutex_lock(&ssl_config_mutex))
+ return NULL;
+#endif
+
+ res = my_bio_methods;
+
if (!my_bio_methods)
{
BIO_METHOD *biom = (BIO_METHOD *) BIO_s_socket();
@@ -1912,39 +1924,58 @@ my_BIO_s_socket(void)
my_bio_index = BIO_get_new_index();
if (my_bio_index == -1)
- return NULL;
+ goto err;
my_bio_index |= (BIO_TYPE_DESCRIPTOR | BIO_TYPE_SOURCE_SINK);
- my_bio_methods = BIO_meth_new(my_bio_index, "libpq socket");
- if (!my_bio_methods)
- return NULL;
+ res = BIO_meth_new(my_bio_index, "libpq socket");
+ if (!res)
+ goto err;
/*
* As of this writing, these functions never fail. But check anyway,
* like OpenSSL's own examples do.
*/
- if (!BIO_meth_set_write(my_bio_methods, my_sock_write) ||
- !BIO_meth_set_read(my_bio_methods, my_sock_read) ||
- !BIO_meth_set_gets(my_bio_methods, BIO_meth_get_gets(biom)) ||
- !BIO_meth_set_puts(my_bio_methods, BIO_meth_get_puts(biom)) ||
- !BIO_meth_set_ctrl(my_bio_methods, BIO_meth_get_ctrl(biom)) ||
- !BIO_meth_set_create(my_bio_methods, BIO_meth_get_create(biom)) ||
- !BIO_meth_set_destroy(my_bio_methods, BIO_meth_get_destroy(biom)) ||
- !BIO_meth_set_callback_ctrl(my_bio_methods, BIO_meth_get_callback_ctrl(biom)))
+ if (!BIO_meth_set_write(res, my_sock_write) ||
+ !BIO_meth_set_read(res, my_sock_read) ||
+ !BIO_meth_set_gets(res, BIO_meth_get_gets(biom)) ||
+ !BIO_meth_set_puts(res, BIO_meth_get_puts(biom)) ||
+ !BIO_meth_set_ctrl(res, BIO_meth_get_ctrl(biom)) ||
+ !BIO_meth_set_create(res, BIO_meth_get_create(biom)) ||
+ !BIO_meth_set_destroy(res, BIO_meth_get_destroy(biom)) ||
+ !BIO_meth_set_callback_ctrl(res, BIO_meth_get_callback_ctrl(biom)))
{
- BIO_meth_free(my_bio_methods);
- my_bio_methods = NULL;
- return NULL;
+ goto err;
}
#else
- my_bio_methods = malloc(sizeof(BIO_METHOD));
- if (!my_bio_methods)
- return NULL;
- memcpy(my_bio_methods, biom, sizeof(BIO_METHOD));
- my_bio_methods->bread = my_sock_read;
- my_bio_methods->bwrite = my_sock_write;
+ res = malloc(sizeof(BIO_METHOD));
+ if (!res)
+ goto err;
+ memcpy(res, biom, sizeof(BIO_METHOD));
+ res->bread = my_sock_read;
+ res->bwrite = my_sock_write;
#endif
}
- return my_bio_methods;
+
+ my_bio_methods = res;
+
+#ifdef ENABLE_THREAD_SAFETY
+ pthread_mutex_unlock(&ssl_config_mutex);
+#endif
+
+ return res;
+
+err:
+#ifdef HAVE_BIO_METH_NEW
+ if (res)
+ BIO_meth_free(res);
+#else
+ if (res)
+ free(res);
+#endif
+
+#ifdef ENABLE_THREAD_SAFETY
+ pthread_mutex_unlock(&ssl_config_mutex);
+#endif
+ return NULL;
}
/* This should exactly match OpenSSL's SSL_set_fd except for using my BIO */
@@ -1967,7 +1998,7 @@ my_SSL_set_fd(PGconn *conn, int fd)
SSLerr(SSL_F_SSL_SET_FD, ERR_R_BUF_LIB);
goto err;
}
- BIO_set_data(bio, conn);
+ BIO_set_app_data(bio, conn);
SSL_set_bio(conn->ssl, bio, bio);
BIO_set_fd(bio, fd, BIO_NOCLOSE);
diff --git a/contrib/libs/libpq/src/interfaces/libpq/fe-secure.c b/contrib/libs/libpq/src/interfaces/libpq/fe-secure.c
index 8069e381424..8444f19f087 100644
--- a/contrib/libs/libpq/src/interfaces/libpq/fe-secure.c
+++ b/contrib/libs/libpq/src/interfaces/libpq/fe-secure.c
@@ -233,6 +233,8 @@ pqsecure_raw_read(PGconn *conn, void *ptr, size_t len)
int result_errno = 0;
char sebuf[PG_STRERROR_R_BUFLEN];
+ SOCK_ERRNO_SET(0);
+
n = recv(conn->sock, ptr, len, 0);
if (n < 0)
@@ -259,6 +261,11 @@ pqsecure_raw_read(PGconn *conn, void *ptr, size_t len)
"\tbefore or while processing the request.");
break;
+ case 0:
+ /* If errno didn't get set, treat it as regular EOF */
+ n = 0;
+ break;
+
default:
libpq_append_conn_error(conn, "could not receive data from server: %s",
SOCK_STRERROR(result_errno,
diff --git a/contrib/libs/libpq/src/interfaces/libpq/libpq-int.h b/contrib/libs/libpq/src/interfaces/libpq/libpq-int.h
index 0045f83cbfd..a951f4992be 100644
--- a/contrib/libs/libpq/src/interfaces/libpq/libpq-int.h
+++ b/contrib/libs/libpq/src/interfaces/libpq/libpq-int.h
@@ -585,8 +585,8 @@ struct pg_conn
int gss_SendLength; /* End of data available in gss_SendBuffer */
int gss_SendNext; /* Next index to send a byte from
* gss_SendBuffer */
- int gss_SendConsumed; /* Number of *unencrypted* bytes consumed
- * for current contents of gss_SendBuffer */
+ int gss_SendConsumed; /* Number of source bytes encrypted but
+ * not yet reported as sent */
char *gss_RecvBuffer; /* Received, encrypted data */
int gss_RecvLength; /* End of data available in gss_RecvBuffer */
char *gss_ResultBuffer; /* Decryption of data in gss_RecvBuffer */
@@ -705,7 +705,8 @@ extern void pqSaveMessageField(PGresult *res, char code,
extern void pqSaveParameterStatus(PGconn *conn, const char *name,
const char *value);
extern int pqRowProcessor(PGconn *conn, const char **errmsgp);
-extern void pqCommandQueueAdvance(PGconn *conn);
+extern void pqCommandQueueAdvance(PGconn *conn, bool isReadyForQuery,
+ bool gotSync);
extern int PQsendQueryContinue(PGconn *conn, const char *query);
/* === in fe-protocol3.c === */
diff --git a/contrib/libs/libpq/src/port/pg_config_paths.h b/contrib/libs/libpq/src/port/pg_config_paths.h
index 2e2db6a40ca..ba4db149b67 100644
--- a/contrib/libs/libpq/src/port/pg_config_paths.h
+++ b/contrib/libs/libpq/src/port/pg_config_paths.h
@@ -1,12 +1,12 @@
-#define PGBINDIR "/var/empty/postgresql-16.1/bin"
-#define PGSHAREDIR "/var/empty/postgresql-16.1/share"
+#define PGBINDIR "/var/empty/postgresql-16.2/bin"
+#define PGSHAREDIR "/var/empty/postgresql-16.2/share"
#define SYSCONFDIR "/etc/postgresql"
-#define INCLUDEDIR "/var/empty/postgresql-16.1/include"
-#define PKGINCLUDEDIR "/var/empty/postgresql-16.1/include"
-#define INCLUDEDIRSERVER "/var/empty/postgresql-16.1/include/server"
+#define INCLUDEDIR "/var/empty/postgresql-16.2/include"
+#define PKGINCLUDEDIR "/var/empty/postgresql-16.2/include"
+#define INCLUDEDIRSERVER "/var/empty/postgresql-16.2/include/server"
#define LIBDIR "/var/empty/tmp/out/lib"
#define PKGLIBDIR "/var/empty/tmp/out/lib/postgresql"
-#define LOCALEDIR "/var/empty/postgresql-16.1/share/locale"
-#define DOCDIR "/var/empty/postgresql-16.1/share/doc/"
-#define HTMLDIR "/var/empty/postgresql-16.1/share/doc/"
-#define MANDIR "/var/empty/postgresql-16.1/share/man"
+#define LOCALEDIR "/var/empty/postgresql-16.2/share/locale"
+#define DOCDIR "/var/empty/postgresql-16.2/share/doc/"
+#define HTMLDIR "/var/empty/postgresql-16.2/share/doc/"
+#define MANDIR "/var/empty/postgresql-16.2/share/man"
diff --git a/contrib/libs/libpq/ya.make b/contrib/libs/libpq/ya.make
index d7acd293f3a..66923a8a11a 100644
--- a/contrib/libs/libpq/ya.make
+++ b/contrib/libs/libpq/ya.make
@@ -13,9 +13,9 @@ LICENSE(
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(16.1)
+VERSION(16.2)
-ORIGINAL_SOURCE(https://github.com/postgres/postgres/archive/REL_16_1.tar.gz)
+ORIGINAL_SOURCE(https://github.com/postgres/postgres/archive/REL_16_2.tar.gz)
PEERDIR(
contrib/libs/libc_compat
diff --git a/contrib/libs/libunwind/src/Unwind-wasm.c b/contrib/libs/libunwind/src/Unwind-wasm.c
index f7f39d38b59..f1e8a04b80c 100644
--- a/contrib/libs/libunwind/src/Unwind-wasm.c
+++ b/contrib/libs/libunwind/src/Unwind-wasm.c
@@ -102,8 +102,8 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
}
/// Not used in Wasm.
-_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context,
- uintptr_t value) {}
+_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context __attribute__((unused)),
+ uintptr_t value __attribute__((unused))) {}
/// Called by personality handler to get LSDA for current frame.
_LIBUNWIND_EXPORT uintptr_t
@@ -116,7 +116,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {
/// Not used in Wasm.
_LIBUNWIND_EXPORT uintptr_t
-_Unwind_GetRegionStart(struct _Unwind_Context *context) {
+_Unwind_GetRegionStart(struct _Unwind_Context *context __attribute__((unused))) {
return 0;
}
diff --git a/contrib/libs/libunwind/ya.make b/contrib/libs/libunwind/ya.make
index b763d587fa5..e21c1bab9d8 100644
--- a/contrib/libs/libunwind/ya.make
+++ b/contrib/libs/libunwind/ya.make
@@ -35,7 +35,6 @@ NO_SANITIZE_COVERAGE()
CFLAGS(
GLOBAL -D_libunwind_
- -D_LIBUNWIND_IS_NATIVE_ONLY
-fno-exceptions
-fno-rtti
-funwind-tables
@@ -47,16 +46,32 @@ IF (SANITIZER_TYPE == memory)
)
ENDIF()
-SRCS(
- src/Unwind-EHABI.cpp
- src/Unwind-seh.cpp
- src/Unwind-sjlj.c
- src/Unwind-wasm.c
- src/UnwindLevel1-gcc-ext.c
- src/UnwindLevel1.c
- src/UnwindRegistersRestore.S
- src/UnwindRegistersSave.S
- src/libunwind.cpp
-)
+IF (NOT OS_EMSCRIPTEN)
+ CFLAGS(
+ -D_LIBUNWIND_IS_NATIVE_ONLY
+ )
+ SRCS(
+ src/Unwind-EHABI.cpp
+ src/Unwind-seh.cpp
+ src/Unwind-sjlj.c
+ src/Unwind-wasm.c
+ src/UnwindLevel1-gcc-ext.c
+ src/UnwindLevel1.c
+ src/UnwindRegistersRestore.S
+ src/UnwindRegistersSave.S
+ src/libunwind.cpp
+ )
+ELSEIF (OS_EMSCRIPTEN)
+ PEERDIR(
+ contrib/restricted/emscripten/include
+ )
+ CFLAGS(
+ -D__USING_WASM_EXCEPTIONS__
+ -D_LIBUNWIND_HIDE_SYMBOLS
+ )
+ SRCS(
+ src/Unwind-wasm.c
+ )
+ENDIF()
END()
diff --git a/contrib/libs/libxml/xmlmodule.c b/contrib/libs/libxml/xmlmodule.c
index 5091a59454e..51cab696679 100644
--- a/contrib/libs/libxml/xmlmodule.c
+++ b/contrib/libs/libxml/xmlmodule.c
@@ -410,7 +410,7 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
#ifdef HAVE_OS2
-#include <os2.h>
+#error #include <os2.h>
/*
* xmlModulePlatformOpen:
diff --git a/contrib/libs/llvm16/lib/IR/LegacyPassManager.cpp b/contrib/libs/llvm16/lib/IR/LegacyPassManager.cpp
index ef346517764..f9572cc2466 100644
--- a/contrib/libs/llvm16/lib/IR/LegacyPassManager.cpp
+++ b/contrib/libs/llvm16/lib/IR/LegacyPassManager.cpp
@@ -1414,7 +1414,10 @@ bool FPPassManager::runOnFunction(Function &F) {
FunctionPass *FP = getContainedPass(Index);
bool LocalChanged = false;
- llvm::TimeTraceScope PassScope("RunPass", FP->getPassName());
+ // Call getPassName only when required. The call itself is fairly cheap, but
+ // still virtual and repeated calling adds unnecessary overhead.
+ llvm::TimeTraceScope PassScope(
+ "RunPass", [FP]() { return std::string(FP->getPassName()); });
dumpPassInfo(FP, EXECUTION_MSG, ON_FUNCTION_MSG, F.getName());
dumpRequiredSet(FP);
diff --git a/contrib/libs/lzma/common/tuklib_integer.h b/contrib/libs/lzma/common/tuklib_integer.h
index 6dd2a5f701e..3fb797ee2ad 100644
--- a/contrib/libs/lzma/common/tuklib_integer.h
+++ b/contrib/libs/lzma/common/tuklib_integer.h
@@ -90,7 +90,7 @@
#elif defined(HAVE_SYS_BYTEORDER_H)
// Solaris
-# include <sys/byteorder.h>
+# error #include <sys/byteorder.h>
# ifdef BSWAP_16
# define bswap16(num) BSWAP_16(num)
# endif
diff --git a/contrib/libs/lzma/common/tuklib_physmem.c b/contrib/libs/lzma/common/tuklib_physmem.c
index 61c62eb71d5..af03ed8e65d 100644
--- a/contrib/libs/lzma/common/tuklib_physmem.c
+++ b/contrib/libs/lzma/common/tuklib_physmem.c
@@ -23,15 +23,15 @@
#elif defined(__OS2__)
# define INCL_DOSMISC
-# include <os2.h>
+# error #include <os2.h>
#elif defined(__DJGPP__)
# error #include <dpmi.h>
#elif defined(__VMS)
-# include <lib$routines.h>
-# include <syidef.h>
-# include <ssdef.h>
+# error #include <lib$routines.h>
+# error #include <syidef.h>
+# error #include <ssdef.h>
#elif defined(AMIGA) || defined(__AROS__)
# define __USE_INLINE__
diff --git a/contrib/libs/mimalloc/include/mimalloc-atomic.h b/contrib/libs/mimalloc/include/mimalloc-atomic.h
index dc48f0a2f00..f7cac357e28 100644
--- a/contrib/libs/mimalloc/include/mimalloc-atomic.h
+++ b/contrib/libs/mimalloc/include/mimalloc-atomic.h
@@ -312,7 +312,7 @@ static inline void mi_atomic_yield(void) {
#endif
#elif defined(__sun)
// Fallback for other archs
-#include <synch.h>
+#error #include <synch.h>
static inline void mi_atomic_yield(void) {
smt_pause();
}
diff --git a/contrib/libs/openldap/include/ldap_int_thread.h b/contrib/libs/openldap/include/ldap_int_thread.h
index 2c82d6825bb..cd2e636b5b7 100644
--- a/contrib/libs/openldap/include/ldap_int_thread.h
+++ b/contrib/libs/openldap/include/ldap_int_thread.h
@@ -112,7 +112,7 @@ LDAP_END_DECL
********************************************/
#include <thread.h>
-#include <synch.h>
+#error #include <synch.h>
LDAP_BEGIN_DECL
diff --git a/contrib/libs/openssl/apps/apps.c b/contrib/libs/openssl/apps/apps.c
index f2447fb0bef..6ef143477a5 100644
--- a/contrib/libs/openssl/apps/apps.c
+++ b/contrib/libs/openssl/apps/apps.c
@@ -2279,7 +2279,7 @@ double app_tminterval(int stop, int usertime)
#elif defined(OPENSSL_SYSTEM_VMS)
# include <time.h>
-# include <times.h>
+# error #include <times.h>
double app_tminterval(int stop, int usertime)
{
diff --git a/contrib/libs/openssl/apps/openssl.c b/contrib/libs/openssl/apps/openssl.c
index f35d57f2648..97b897305e6 100644
--- a/contrib/libs/openssl/apps/openssl.c
+++ b/contrib/libs/openssl/apps/openssl.c
@@ -24,7 +24,7 @@
#include <openssl/err.h>
/* Needed to get the other O_xxx flags. */
#ifdef OPENSSL_SYS_VMS
-# include <unixio.h>
+# error #include <unixio.h>
#endif
#include "apps.h"
#define INCLUDE_FUNCTION_TABLE
diff --git a/contrib/libs/openssl/crypto/LPdir_vms.c b/contrib/libs/openssl/crypto/LPdir_vms.c
index e35363fd661..73b2654da86 100644
--- a/contrib/libs/openssl/crypto/LPdir_vms.c
+++ b/contrib/libs/openssl/crypto/LPdir_vms.c
@@ -40,14 +40,14 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
-#include <descrip.h>
+#error #include <descrip.h>
#include <namdef.h>
-#include <rmsdef.h>
-#include <libfildef.h>
-#include <lib$routines.h>
+#error #include <rmsdef.h>
+#error #include <libfildef.h>
+#error #include <lib$routines.h>
#include <strdef.h>
-#include <str$routines.h>
-#include <stsdef.h>
+#error #include <str$routines.h>
+#error #include <stsdef.h>
#ifndef LPDIR_H
# include "LPdir.h"
#endif
diff --git a/contrib/libs/openssl/crypto/bio/bss_log.c b/contrib/libs/openssl/crypto/bio/bss_log.c
index b9579faaa2a..78298d0e4fd 100644
--- a/contrib/libs/openssl/crypto/bio/bss_log.c
+++ b/contrib/libs/openssl/crypto/bio/bss_log.c
@@ -26,9 +26,9 @@
#elif defined(OPENSSL_SYS_WIN32)
#elif defined(OPENSSL_SYS_VMS)
# include <opcdef.h>
-# include <descrip.h>
-# include <lib$routines.h>
-# include <starlet.h>
+# error #include <descrip.h>
+# error #include <lib$routines.h>
+# error #include <starlet.h>
/* Some compiler options may mask the declaration of "_malloc32". */
# if __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE
# if __INITIAL_POINTER_SIZE == 64
diff --git a/contrib/libs/openssl/crypto/dso/dso_vms.c b/contrib/libs/openssl/crypto/dso/dso_vms.c
index 9d1066f915a..237ccf6170e 100644
--- a/contrib/libs/openssl/crypto/dso/dso_vms.c
+++ b/contrib/libs/openssl/crypto/dso/dso_vms.c
@@ -13,12 +13,12 @@
# pragma message disable DOLLARID
# include <errno.h>
-# include <rms.h>
-# include <lib$routines.h>
-# include <libfisdef.h>
-# include <stsdef.h>
-# include <descrip.h>
-# include <starlet.h>
+# error #include <rms.h>
+# error #include <lib$routines.h>
+# error #include <libfisdef.h>
+# error #include <stsdef.h>
+# error #include <descrip.h>
+# error #include <starlet.h>
# include "../vms_rms.h"
/* Some compiler options may mask the declaration of "_malloc32". */
diff --git a/contrib/libs/openssl/crypto/rand/randfile.c b/contrib/libs/openssl/crypto/rand/randfile.c
index 229ce864a31..d79a8d9642d 100644
--- a/contrib/libs/openssl/crypto/rand/randfile.c
+++ b/contrib/libs/openssl/crypto/rand/randfile.c
@@ -20,7 +20,7 @@
#include <openssl/buffer.h>
#ifdef OPENSSL_SYS_VMS
-# include <unixio.h>
+# error #include <unixio.h>
#endif
#include <sys/types.h>
#ifndef OPENSSL_NO_POSIX_IO
diff --git a/contrib/libs/openssl/crypto/ui/ui_openssl.c b/contrib/libs/openssl/crypto/ui/ui_openssl.c
index 0f630a5bd96..03c4a148bf7 100644
--- a/contrib/libs/openssl/crypto/ui/ui_openssl.c
+++ b/contrib/libs/openssl/crypto/ui/ui_openssl.c
@@ -57,7 +57,7 @@
# include "internal/cryptlib.h"
# ifdef OPENSSL_SYS_VMS /* prototypes for sys$whatever */
-# include <starlet.h>
+# error #include <starlet.h>
# ifdef __DECC
# pragma message disable DOLLARID
# endif
@@ -140,10 +140,10 @@
# endif
# ifdef OPENSSL_SYS_VMS
-# include <ssdef.h>
-# include <iodef.h>
+# error #include <ssdef.h>
+# error #include <iodef.h>
# include <ttdef.h>
-# include <descrip.h>
+# error #include <descrip.h>
struct IOSB {
short iosb$w_value;
short iosb$w_count;
diff --git a/contrib/libs/openssl/crypto/ya.make b/contrib/libs/openssl/crypto/ya.make
index 21375033592..be3f2b7328d 100644
--- a/contrib/libs/openssl/crypto/ya.make
+++ b/contrib/libs/openssl/crypto/ya.make
@@ -151,17 +151,10 @@ IF (OS_LINUX AND ARCH_AARCH64 OR OS_LINUX AND ARCH_X86_64)
)
ENDIF()
-IF (OS_DARWIN AND ARCH_X86_64)
- CFLAGS(
- -D_REENTRANT
- )
-ENDIF()
-
IF (OS_DARWIN AND ARCH_ARM64)
CFLAGS(
-DL_ENDIAN
-DOPENSSL_PIC
- -D_REENTRANT
)
ENDIF()
@@ -179,11 +172,6 @@ IF (OS_WINDOWS)
ENDIF()
CFLAGS(
-DOPENSSL_SYS_WIN32
- -DUNICODE
- -DWIN32_LEAN_AND_MEAN
- -D_CRT_SECURE_NO_DEPRECATE
- -D_UNICODE
- -D_WINSOCK_DEPRECATED_NO_WARNINGS
/GF
)
ENDIF()
@@ -937,14 +925,6 @@ IF (OS_DARWIN AND ARCH_ARM64)
ENDIF()
IF (OS_LINUX AND ARCH_ARM7)
- IF (CLANG)
- # XXX: This is a workarond for 'out of range immediate fixup value'
- # error with clang integrated assembler:
- # https://github.com/openssl/openssl/issues/7878
- CFLAGS(
- -mno-thumb
- )
- ENDIF()
CFLAGS(
-DOPENSSL_PIC
-DOPENSSL_BN_ASM_GF2m
diff --git a/contrib/libs/openssl/include/internal/sockets.h b/contrib/libs/openssl/include/internal/sockets.h
index 4fc1aecdbb2..79bf1dfda6c 100644
--- a/contrib/libs/openssl/include/internal/sockets.h
+++ b/contrib/libs/openssl/include/internal/sockets.h
@@ -98,7 +98,7 @@ struct servent *PASCAL getservbyname(const char *, const char *);
/* ioctl is only in VMS > 7.0 and when socketshr is not used */
# include <sys/ioctl.h>
# endif
-# include <unixio.h>
+# error #include <unixio.h>
# if defined(TCPIP_TYPE_SOCKETSHR)
# include <socketshr.h>
# endif
diff --git a/contrib/libs/openssl/ya.make b/contrib/libs/openssl/ya.make
index 817efe54e12..e8d70a9a317 100644
--- a/contrib/libs/openssl/ya.make
+++ b/contrib/libs/openssl/ya.make
@@ -135,17 +135,10 @@ IF (OS_LINUX AND ARCH_AARCH64 OR OS_LINUX AND ARCH_X86_64 OR OS_ANDROID)
)
ENDIF()
-IF (OS_DARWIN AND ARCH_X86_64)
- CFLAGS(
- -D_REENTRANT
- )
-ENDIF()
-
IF (OS_DARWIN AND ARCH_ARM64)
CFLAGS(
-DL_ENDIAN
-DOPENSSL_PIC
- -D_REENTRANT
)
ENDIF()
@@ -163,11 +156,6 @@ IF (OS_WINDOWS)
ENDIF()
CFLAGS(
-DOPENSSL_SYS_WIN32
- -DUNICODE
- -DWIN32_LEAN_AND_MEAN
- -D_CRT_SECURE_NO_DEPRECATE
- -D_UNICODE
- -D_WINSOCK_DEPRECATED_NO_WARNINGS
/GF
)
ENDIF()
diff --git a/contrib/libs/poco/Foundation/src/FPEnvironment_DEC.cpp b/contrib/libs/poco/Foundation/src/FPEnvironment_DEC.cpp
index 037e28df76c..ebab43e906a 100644
--- a/contrib/libs/poco/Foundation/src/FPEnvironment_DEC.cpp
+++ b/contrib/libs/poco/Foundation/src/FPEnvironment_DEC.cpp
@@ -23,7 +23,7 @@
#include <fp.h>
#include <fp_class.h>
#if defined(__VMS)
-#include <starlet.h>
+#error #include <starlet.h>
#endif
#include "Poco/FPEnvironment_DEC.h"
diff --git a/contrib/libs/protobuf/src/google/protobuf/io/coded_stream.h b/contrib/libs/protobuf/src/google/protobuf/io/coded_stream.h
index 3c44e0568c1..64d4068f5fb 100644
--- a/contrib/libs/protobuf/src/google/protobuf/io/coded_stream.h
+++ b/contrib/libs/protobuf/src/google/protobuf/io/coded_stream.h
@@ -137,7 +137,7 @@
#elif defined(__FreeBSD__)
#include <sys/endian.h> // __BYTE_ORDER
#elif (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
-#include <sys/isa_defs.h> // __BYTE_ORDER
+#error #include <sys/isa_defs.h> // __BYTE_ORDER
#elif defined(_AIX) || defined(__TOS_AIX__)
#include <sys/machine.h> // BYTE_ORDER
#else
diff --git a/contrib/libs/protobuf/src/google/protobuf/stubs/port.h b/contrib/libs/protobuf/src/google/protobuf/stubs/port.h
index 4d2750814f6..c5159b19fc4 100644
--- a/contrib/libs/protobuf/src/google/protobuf/stubs/port.h
+++ b/contrib/libs/protobuf/src/google/protobuf/stubs/port.h
@@ -66,7 +66,7 @@
#elif defined(__FreeBSD__)
#include <sys/endian.h> // __BYTE_ORDER
#elif (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
-#include <sys/isa_defs.h> // __BYTE_ORDER
+#error #include <sys/isa_defs.h> // __BYTE_ORDER
#elif defined(_AIX) || defined(__TOS_AIX__)
#include <sys/machine.h> // BYTE_ORDER
#else
diff --git a/contrib/libs/python/Include/Python.h b/contrib/libs/python/Include/Python.h
index 5aa4c0b515a..e4e394a30cd 100644
--- a/contrib/libs/python/Include/Python.h
+++ b/contrib/libs/python/Include/Python.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/Python.h>
+#include <contrib/tools/python3/Include/Python.h>
#else
#include <contrib/tools/python/src/Include/Python.h>
#endif
diff --git a/contrib/libs/python/Include/abstract.h b/contrib/libs/python/Include/abstract.h
index 3073b25e256..6ec6fdd27ff 100644
--- a/contrib/libs/python/Include/abstract.h
+++ b/contrib/libs/python/Include/abstract.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/abstract.h>
+#include <contrib/tools/python3/Include/abstract.h>
#else
#include <contrib/tools/python/src/Include/abstract.h>
#endif
diff --git a/contrib/libs/python/Include/compile.h b/contrib/libs/python/Include/compile.h
index eb3595aab00..4d0a014413c 100644
--- a/contrib/libs/python/Include/compile.h
+++ b/contrib/libs/python/Include/compile.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/compile.h>
+#include <contrib/tools/python3/Include/compile.h>
#else
#include <contrib/tools/python/src/Include/compile.h>
#endif
diff --git a/contrib/libs/python/Include/datetime.h b/contrib/libs/python/Include/datetime.h
index b24acd56380..bf11bfd29b6 100644
--- a/contrib/libs/python/Include/datetime.h
+++ b/contrib/libs/python/Include/datetime.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/datetime.h>
+#include <contrib/tools/python3/Include/datetime.h>
#else
#include <contrib/tools/python/src/Include/datetime.h>
#endif
diff --git a/contrib/libs/python/Include/descrobject.h b/contrib/libs/python/Include/descrobject.h
index 5d450cf256a..55164c1b7b7 100644
--- a/contrib/libs/python/Include/descrobject.h
+++ b/contrib/libs/python/Include/descrobject.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/descrobject.h>
+#include <contrib/tools/python3/Include/descrobject.h>
#else
#include <contrib/tools/python/src/Include/descrobject.h>
#endif
diff --git a/contrib/libs/python/Include/frameobject.h b/contrib/libs/python/Include/frameobject.h
index 50168e372a2..d92b5e157fe 100644
--- a/contrib/libs/python/Include/frameobject.h
+++ b/contrib/libs/python/Include/frameobject.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/frameobject.h>
+#include <contrib/tools/python3/Include/frameobject.h>
#else
#include <contrib/tools/python/src/Include/frameobject.h>
#endif
diff --git a/contrib/libs/python/Include/internal/pycore_frame.h b/contrib/libs/python/Include/internal/pycore_frame.h
index 09ebc0ed139..80e07d19edd 100644
--- a/contrib/libs/python/Include/internal/pycore_frame.h
+++ b/contrib/libs/python/Include/internal/pycore_frame.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/internal/pycore_frame.h>
+#include <contrib/tools/python3/Include/internal/pycore_frame.h>
#else
#error "No <internal/pycore_frame.h> in Python2"
#endif
diff --git a/contrib/libs/python/Include/pyconfig.h b/contrib/libs/python/Include/pyconfig.h
index 3b13edb2ee6..9bb42954b26 100644
--- a/contrib/libs/python/Include/pyconfig.h
+++ b/contrib/libs/python/Include/pyconfig.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/pyconfig.h>
+#include <contrib/tools/python3/Include/pyconfig.h>
#else
#include <contrib/tools/python/src/Include/pyconfig.h>
#endif
diff --git a/contrib/libs/python/Include/pyerrors.h b/contrib/libs/python/Include/pyerrors.h
index 587690a2b28..9a9ec600ad3 100644
--- a/contrib/libs/python/Include/pyerrors.h
+++ b/contrib/libs/python/Include/pyerrors.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/pyerrors.h>
+#include <contrib/tools/python3/Include/pyerrors.h>
#else
#include <contrib/tools/python/src/Include/pyerrors.h>
#endif
diff --git a/contrib/libs/python/Include/pymem.h b/contrib/libs/python/Include/pymem.h
index 780aa553e13..f51871a02a3 100644
--- a/contrib/libs/python/Include/pymem.h
+++ b/contrib/libs/python/Include/pymem.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/pymem.h>
+#include <contrib/tools/python3/Include/pymem.h>
#else
#include <contrib/tools/python/src/Include/pymem.h>
#endif
diff --git a/contrib/libs/python/Include/pystate.h b/contrib/libs/python/Include/pystate.h
index 6601f2591b1..e37e92bff12 100644
--- a/contrib/libs/python/Include/pystate.h
+++ b/contrib/libs/python/Include/pystate.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/pystate.h>
+#include <contrib/tools/python3/Include/pystate.h>
#else
#include <contrib/tools/python/src/Include/pystate.h>
#endif
diff --git a/contrib/libs/python/Include/pythread.h b/contrib/libs/python/Include/pythread.h
index 3f3eae9530b..b56d6cbce7f 100644
--- a/contrib/libs/python/Include/pythread.h
+++ b/contrib/libs/python/Include/pythread.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/pythread.h>
+#include <contrib/tools/python3/Include/pythread.h>
#else
#include <contrib/tools/python/src/Include/pythread.h>
#endif
diff --git a/contrib/libs/python/Include/structmember.h b/contrib/libs/python/Include/structmember.h
index ab8d9c29245..e6477591b82 100644
--- a/contrib/libs/python/Include/structmember.h
+++ b/contrib/libs/python/Include/structmember.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/structmember.h>
+#include <contrib/tools/python3/Include/structmember.h>
#else
#include <contrib/tools/python/src/Include/structmember.h>
#endif
diff --git a/contrib/libs/python/Include/structseq.h b/contrib/libs/python/Include/structseq.h
index 02cadaaefe4..46e9df6674b 100644
--- a/contrib/libs/python/Include/structseq.h
+++ b/contrib/libs/python/Include/structseq.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/structseq.h>
+#include <contrib/tools/python3/Include/structseq.h>
#else
#include <contrib/tools/python/src/Include/structseq.h>
#endif
diff --git a/contrib/libs/python/Include/traceback.h b/contrib/libs/python/Include/traceback.h
index 284fc8ab7f5..51d9b6c771e 100644
--- a/contrib/libs/python/Include/traceback.h
+++ b/contrib/libs/python/Include/traceback.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/traceback.h>
+#include <contrib/tools/python3/Include/traceback.h>
#else
#include <contrib/tools/python/src/Include/traceback.h>
#endif
diff --git a/contrib/libs/python/Include/unicodeobject.h b/contrib/libs/python/Include/unicodeobject.h
index 172af650e1c..d5394ac4079 100644
--- a/contrib/libs/python/Include/unicodeobject.h
+++ b/contrib/libs/python/Include/unicodeobject.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef USE_PYTHON3
-#include <contrib/tools/python3/src/Include/unicodeobject.h>
+#include <contrib/tools/python3/Include/unicodeobject.h>
#else
#include <contrib/tools/python/src/Include/unicodeobject.h>
#endif
diff --git a/contrib/libs/python/ya.make b/contrib/libs/python/ya.make
index 69a087a1278..42524fc9c9c 100644
--- a/contrib/libs/python/ya.make
+++ b/contrib/libs/python/ya.make
@@ -34,8 +34,8 @@ IF (USE_ARCADIA_PYTHON)
GLOBAL -DUSE_PYTHON3
)
PEERDIR(
- contrib/tools/python3/lib
- contrib/tools/python3/src
+ contrib/tools/python3/lib2
+ contrib/tools/python3
library/python/runtime_py3
)
ENDIF()
diff --git a/contrib/libs/re2/re2/parse.cc b/contrib/libs/re2/re2/parse.cc
index c22f2725535..a3e580f6dbf 100644
--- a/contrib/libs/re2/re2/parse.cc
+++ b/contrib/libs/re2/re2/parse.cc
@@ -338,6 +338,20 @@ Rune CycleFoldRune(Rune r) {
}
// Add lo-hi to the class, along with their fold-equivalent characters.
+static void AddFoldedRangeLatin1(CharClassBuilder* cc, Rune lo, Rune hi) {
+ while (lo <= hi) {
+ cc->AddRange(lo, lo);
+ if ('A' <= lo && lo <= 'Z') {
+ cc->AddRange(lo - 'A' + 'a', lo - 'A' + 'a');
+ }
+ if ('a' <= lo && lo <= 'z') {
+ cc->AddRange(lo - 'a' + 'A', lo - 'a' + 'A');
+ }
+ lo++;
+ }
+}
+
+// Add lo-hi to the class, along with their fold-equivalent characters.
// If lo-hi is already in the class, assume that the fold-equivalent
// chars are there too, so there's no work to do.
static void AddFoldedRange(CharClassBuilder* cc, Rune lo, Rune hi, int depth) {
@@ -394,17 +408,26 @@ static void AddFoldedRange(CharClassBuilder* cc, Rune lo, Rune hi, int depth) {
// Pushes the literal rune r onto the stack.
bool Regexp::ParseState::PushLiteral(Rune r) {
// Do case folding if needed.
- if ((flags_ & FoldCase) && CycleFoldRune(r) != r) {
- Regexp* re = new Regexp(kRegexpCharClass, flags_ & ~FoldCase);
- re->ccb_ = new CharClassBuilder;
- Rune r1 = r;
- do {
- if (!(flags_ & NeverNL) || r != '\n') {
- re->ccb_->AddRange(r, r);
- }
- r = CycleFoldRune(r);
- } while (r != r1);
- return PushRegexp(re);
+ if (flags_ & FoldCase) {
+ if (flags_ & Latin1 && (('A' <= r && r <= 'Z') ||
+ ('a' <= r && r <= 'z'))) {
+ Regexp* re = new Regexp(kRegexpCharClass, flags_ & ~FoldCase);
+ re->ccb_ = new CharClassBuilder;
+ AddFoldedRangeLatin1(re->ccb_, r, r);
+ return PushRegexp(re);
+ }
+ if (!(flags_ & Latin1) && CycleFoldRune(r) != r) {
+ Regexp* re = new Regexp(kRegexpCharClass, flags_ & ~FoldCase);
+ re->ccb_ = new CharClassBuilder;
+ Rune r1 = r;
+ do {
+ if (!(flags_ & NeverNL) || r != '\n') {
+ re->ccb_->AddRange(r, r);
+ }
+ r = CycleFoldRune(r);
+ } while (r != r1);
+ return PushRegexp(re);
+ }
}
// Exclude newline if applicable.
@@ -776,7 +799,8 @@ Rune* Regexp::LeadingString(Regexp* re, int* nrune,
while (re->op() == kRegexpConcat && re->nsub() > 0)
re = re->sub()[0];
- *flags = static_cast<Regexp::ParseFlags>(re->parse_flags_ & Regexp::FoldCase);
+ *flags = static_cast<Regexp::ParseFlags>(re->parse_flags_ &
+ (Regexp::FoldCase | Regexp::Latin1));
if (re->op() == kRegexpLiteral) {
*nrune = 1;
@@ -1175,7 +1199,7 @@ void FactorAlternationImpl::Round3(Regexp** sub, int nsub,
if (re->op() == kRegexpCharClass) {
CharClass* cc = re->cc();
for (CharClass::iterator it = cc->begin(); it != cc->end(); ++it)
- ccb.AddRange(it->lo, it->hi);
+ ccb.AddRangeFlags(it->lo, it->hi, re->parse_flags());
} else if (re->op() == kRegexpLiteral) {
if (re->parse_flags() & Regexp::FoldCase) {
// AddFoldedRange() can terminate prematurely if the character class
@@ -1194,7 +1218,7 @@ void FactorAlternationImpl::Round3(Regexp** sub, int nsub,
}
re->Decref();
}
- Regexp* re = Regexp::NewCharClass(ccb.GetCharClass(), flags);
+ Regexp* re = Regexp::NewCharClass(ccb.GetCharClass(), flags & ~Regexp::FoldCase);
splices->emplace_back(re, sub + start, i - start);
}
@@ -1622,10 +1646,15 @@ void CharClassBuilder::AddRangeFlags(
}
// If folding case, add fold-equivalent characters too.
- if (parse_flags & Regexp::FoldCase)
- AddFoldedRange(this, lo, hi, 0);
- else
+ if (parse_flags & Regexp::FoldCase) {
+ if (parse_flags & Regexp::Latin1) {
+ AddFoldedRangeLatin1(this, lo, hi);
+ } else {
+ AddFoldedRange(this, lo, hi, 0);
+ }
+ } else {
AddRange(lo, hi);
+ }
}
// Look for a group with the given name.
diff --git a/contrib/libs/re2/re2/re2.h b/contrib/libs/re2/re2/re2.h
index cc76f382d81..672ebf9afaf 100644
--- a/contrib/libs/re2/re2/re2.h
+++ b/contrib/libs/re2/re2/re2.h
@@ -1018,7 +1018,7 @@ inline RE2::Arg RE2::Octal(T* ptr) {
}
// Silence warnings about missing initializers for members of LazyRE2.
-#if !defined(__clang__) && defined(__GNUC__)
+#if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
diff --git a/contrib/libs/re2/re2/testing/dump.cc b/contrib/libs/re2/re2/testing/dump.cc
index 5cddd233460..9e3c94a6962 100644
--- a/contrib/libs/re2/re2/testing/dump.cc
+++ b/contrib/libs/re2/re2/testing/dump.cc
@@ -96,17 +96,25 @@ static void DumpRegexpAppending(Regexp* re, std::string* s) {
break;
case kRegexpLiteral: {
Rune r = re->rune();
- char buf[UTFmax+1];
- buf[runetochar(buf, &r)] = 0;
- s->append(buf);
+ if (re->parse_flags() & Regexp::Latin1) {
+ s->push_back(r);
+ } else {
+ char buf[UTFmax+1];
+ buf[runetochar(buf, &r)] = 0;
+ s->append(buf);
+ }
break;
}
case kRegexpLiteralString:
for (int i = 0; i < re->nrunes(); i++) {
Rune r = re->runes()[i];
- char buf[UTFmax+1];
- buf[runetochar(buf, &r)] = 0;
- s->append(buf);
+ if (re->parse_flags() & Regexp::Latin1) {
+ s->push_back(r);
+ } else {
+ char buf[UTFmax+1];
+ buf[runetochar(buf, &r)] = 0;
+ s->append(buf);
+ }
}
break;
case kRegexpConcat:
diff --git a/contrib/libs/re2/re2/testing/parse_test.cc b/contrib/libs/re2/re2/testing/parse_test.cc
index 7684b62a49e..95294d5fffd 100644
--- a/contrib/libs/re2/re2/testing/parse_test.cc
+++ b/contrib/libs/re2/re2/testing/parse_test.cc
@@ -225,6 +225,29 @@ static Test tests[] = {
// Bug in Regexp::ToString() that emitted [^], which
// would (obviously) fail to parse when fed back in.
{ "[\\s\\S]", "cc{0-0x10ffff}" },
+
+ // As per https://github.com/google/re2/issues/477,
+ // there were long-standing bugs involving Latin-1.
+ // Here, we exercise it WITHOUT case folding...
+ { "\xa5\x64\xd1", "str{\xa5""d\xd1}", Regexp::Latin1 },
+ { "\xa5\xd1\x64", "str{\xa5\xd1""d}", Regexp::Latin1 },
+ { "\xa5\x64[\xd1\xd2]", "cat{str{\xa5""d}cc{0xd1-0xd2}}", Regexp::Latin1 },
+ { "\xa5[\xd1\xd2]\x64", "cat{lit{\xa5}cc{0xd1-0xd2}lit{d}}", Regexp::Latin1 },
+ { "\xa5\x64|\xa5\xd1", "cat{lit{\xa5}cc{0x64 0xd1}}", Regexp::Latin1 },
+ { "\xa5\xd1|\xa5\x64", "cat{lit{\xa5}cc{0x64 0xd1}}", Regexp::Latin1 },
+ { "\xa5\x64|\xa5[\xd1\xd2]", "cat{lit{\xa5}cc{0x64 0xd1-0xd2}}", Regexp::Latin1 },
+ { "\xa5[\xd1\xd2]|\xa5\x64", "cat{lit{\xa5}cc{0x64 0xd1-0xd2}}", Regexp::Latin1 },
+ // Here, we exercise it WITH case folding...
+ // 0x64 should fold to 0x44, but neither 0xD1 nor 0xD2
+ // should fold to 0xF1 and 0xF2, respectively.
+ { "\xa5\x64\xd1", "strfold{\xa5""d\xd1}", Regexp::Latin1 | Regexp::FoldCase },
+ { "\xa5\xd1\x64", "strfold{\xa5\xd1""d}", Regexp::Latin1 | Regexp::FoldCase },
+ { "\xa5\x64[\xd1\xd2]", "cat{strfold{\xa5""d}cc{0xd1-0xd2}}", Regexp::Latin1 | Regexp::FoldCase },
+ { "\xa5[\xd1\xd2]\x64", "cat{lit{\xa5}cc{0xd1-0xd2}litfold{d}}", Regexp::Latin1 | Regexp::FoldCase },
+ { "\xa5\x64|\xa5\xd1", "cat{lit{\xa5}cc{0x44 0x64 0xd1}}", Regexp::Latin1 | Regexp::FoldCase },
+ { "\xa5\xd1|\xa5\x64", "cat{lit{\xa5}cc{0x44 0x64 0xd1}}", Regexp::Latin1 | Regexp::FoldCase },
+ { "\xa5\x64|\xa5[\xd1\xd2]", "cat{lit{\xa5}cc{0x44 0x64 0xd1-0xd2}}", Regexp::Latin1 | Regexp::FoldCase },
+ { "\xa5[\xd1\xd2]|\xa5\x64", "cat{lit{\xa5}cc{0x44 0x64 0xd1-0xd2}}", Regexp::Latin1 | Regexp::FoldCase },
};
bool RegexpEqualTestingOnly(Regexp* a, Regexp* b) {
@@ -492,7 +515,7 @@ TEST(TestToString, EquivalentParse) {
// << " t=" << t << " regexp=" << tests[i].regexp;
// Test that if we parse the new regexp we get the same structure.
- Regexp* nre = Regexp::Parse(t, Regexp::MatchNL | Regexp::PerlX, &status);
+ Regexp* nre = Regexp::Parse(t, f, &status);
ASSERT_TRUE(nre != NULL) << " reparse " << t << " " << status.Text();
std::string ss = nre->Dump();
std::string tt = nre->ToString();
diff --git a/contrib/libs/re2/re2/testing/re2_test.cc b/contrib/libs/re2/re2/testing/re2_test.cc
index 151525f2d64..ddf8dbf8fb6 100644
--- a/contrib/libs/re2/re2/testing/re2_test.cc
+++ b/contrib/libs/re2/re2/testing/re2_test.cc
@@ -1658,4 +1658,23 @@ TEST(RE2, Issue310) {
ASSERT_EQ(m, "") << " got m='" << m << "', want ''";
}
+TEST(RE2, Issue477) {
+ // Regexp::LeadingString didn't output Latin1 into flags.
+ // In the given pattern, 0xA5 should be factored out, but
+ // shouldn't lose its Latin1-ness in the process. Because
+ // that was happening, the prefix for accel was 0xC2 0xA5
+ // instead of 0xA5. Note that the former doesn't occur in
+ // the given input and so replacements weren't occurring.
+
+ const char bytes[] = {
+ (char)0xa5, (char)0xd1, (char)0xa5, (char)0xd1,
+ (char)0x61, (char)0x63, (char)0xa5, (char)0x64,
+ };
+ std::string s(bytes, ABSL_ARRAYSIZE(bytes));
+ RE2 re("\xa5\xd1|\xa5\x64", RE2::Latin1);
+ int n = RE2::GlobalReplace(&s, re, "");
+ ASSERT_EQ(n, 3);
+ ASSERT_EQ(s, "\x61\x63");
+}
+
} // namespace re2
diff --git a/contrib/libs/re2/util/pcre.cc b/contrib/libs/re2/util/pcre.cc
index f54cb28f839..27aee3dc48f 100644
--- a/contrib/libs/re2/util/pcre.cc
+++ b/contrib/libs/re2/util/pcre.cc
@@ -21,7 +21,7 @@
#include "util/pcre.h"
// Silence warnings about the wacky formatting in the operator() functions.
-#if !defined(__clang__) && defined(__GNUC__)
+#if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#endif
diff --git a/contrib/libs/re2/ya.make b/contrib/libs/re2/ya.make
index 7f6fae30da8..da93062de9e 100644
--- a/contrib/libs/re2/ya.make
+++ b/contrib/libs/re2/ya.make
@@ -9,9 +9,9 @@ LICENSE(
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(2024-02-01)
+VERSION(2024-03-01)
-ORIGINAL_SOURCE(https://github.com/google/re2/archive/2024-02-01.tar.gz)
+ORIGINAL_SOURCE(https://github.com/google/re2/archive/2024-03-01.tar.gz)
PEERDIR(
contrib/restricted/abseil-cpp/absl/base
diff --git a/contrib/libs/t1ha/t1ha.h b/contrib/libs/t1ha/t1ha.h
index 9bb8d744966..8e5e588529a 100644
--- a/contrib/libs/t1ha/t1ha.h
+++ b/contrib/libs/t1ha/t1ha.h
@@ -258,7 +258,7 @@
defined(HAVE_MACHINE_ENDIAN_H) || __has_include(<machine/endian.h>)
#include <machine/endian.h>
#elif defined(HAVE_SYS_ISA_DEFS_H) || __has_include(<sys/isa_defs.h>)
-#include <sys/isa_defs.h>
+#error #include <sys/isa_defs.h>
#elif (defined(HAVE_SYS_TYPES_H) && defined(HAVE_SYS_ENDIAN_H)) || \
(__has_include(<sys/types.h>) && __has_include(<sys/endian.h>))
#include <sys/endian.h>
diff --git a/contrib/libs/zlib/zconf.h b/contrib/libs/zlib/zconf.h
index 58aea624905..b68680da957 100644
--- a/contrib/libs/zlib/zconf.h
+++ b/contrib/libs/zlib/zconf.h
@@ -498,7 +498,7 @@ typedef uLong FAR uLongf;
# if defined(Z_HAVE_UNISTD_H)
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
# ifdef VMS
-# include <unixio.h> /* for off_t */
+# error #include <unixio.h> /* for off_t */
# endif
# ifndef z_off_t
# define z_off_t off_t
diff --git a/contrib/python/MarkupSafe/py3/.dist-info/METADATA b/contrib/python/MarkupSafe/py3/.dist-info/METADATA
index c221b8e50e5..dfe37d52dfb 100644
--- a/contrib/python/MarkupSafe/py3/.dist-info/METADATA
+++ b/contrib/python/MarkupSafe/py3/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: MarkupSafe
-Version: 2.1.4
+Version: 2.1.5
Summary: Safely add untrusted strings to HTML/XML markup.
Home-page: https://palletsprojects.com/p/markupsafe/
Maintainer: Pallets
diff --git a/contrib/python/MarkupSafe/py3/markupsafe/__init__.py b/contrib/python/MarkupSafe/py3/markupsafe/__init__.py
index 2f401a81539..b40f24c66de 100644
--- a/contrib/python/MarkupSafe/py3/markupsafe/__init__.py
+++ b/contrib/python/MarkupSafe/py3/markupsafe/__init__.py
@@ -13,7 +13,7 @@ if t.TYPE_CHECKING:
_P = te.ParamSpec("_P")
-__version__ = "2.1.4"
+__version__ = "2.1.5"
def _simple_escaping_wrapper(func: "t.Callable[_P, str]") -> "t.Callable[_P, Markup]":
@@ -158,8 +158,7 @@ class Markup(str):
>>> Markup("Main &raquo;\t<em>About</em>").striptags()
'Main » About'
"""
- # collapse spaces
- value = " ".join(self.split())
+ value = str(self)
# Look for comments then tags separately. Otherwise, a comment that
# contains a tag would end early, leaving some of the comment behind.
@@ -193,6 +192,8 @@ class Markup(str):
value = f"{value[:start]}{value[end + 1:]}"
+ # collapse spaces
+ value = " ".join(value.split())
return self.__class__(value).unescape()
@classmethod
diff --git a/contrib/python/MarkupSafe/py3/tests/test_markupsafe.py b/contrib/python/MarkupSafe/py3/tests/test_markupsafe.py
index ea9a91873c8..94bea387954 100644
--- a/contrib/python/MarkupSafe/py3/tests/test_markupsafe.py
+++ b/contrib/python/MarkupSafe/py3/tests/test_markupsafe.py
@@ -73,7 +73,7 @@ def test_escaping(escape):
Markup(
"<!-- outer comment -->"
"<em>Foo &amp; Bar"
- "<!-- inner comment about <em> -->"
+ " <!-- inner comment about <em> -->\n "
"</em>"
"<!-- comment\nwith\nnewlines\n-->"
"<meta content='tag\nwith\nnewlines'>"
diff --git a/contrib/python/MarkupSafe/py3/ya.make b/contrib/python/MarkupSafe/py3/ya.make
index 3583a8035e2..f1664c93e8f 100644
--- a/contrib/python/MarkupSafe/py3/ya.make
+++ b/contrib/python/MarkupSafe/py3/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(2.1.4)
+VERSION(2.1.5)
LICENSE(BSD-3-Clause)
diff --git a/contrib/python/appnope/py3/.dist-info/METADATA b/contrib/python/appnope/py3/.dist-info/METADATA
index 9c7b7570602..76ef35d8e78 100644
--- a/contrib/python/appnope/py3/.dist-info/METADATA
+++ b/contrib/python/appnope/py3/.dist-info/METADATA
@@ -1,20 +1,15 @@
Metadata-Version: 2.1
Name: appnope
-Version: 0.1.3
+Version: 0.1.4
Summary: Disable App Nap on macOS >= 10.9
Home-page: http://github.com/minrk/appnope
Author: Min Ragan-Kelley
Author-email: [email protected]
License: BSD
-Platform: UNKNOWN
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: MacOS :: MacOS X
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.2
-Classifier: Programming Language :: Python :: 3.3
+Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
@@ -48,5 +43,3 @@ It uses ctypes to wrap a `[NSProcessInfo beginActivityWithOptions]` call to disa
To install:
pip install appnope
-
-
diff --git a/contrib/python/appnope/py3/appnope/__init__.py b/contrib/python/appnope/py3/appnope/__init__.py
index bcf87f4917b..c447f241855 100644
--- a/contrib/python/appnope/py3/appnope/__init__.py
+++ b/contrib/python/appnope/py3/appnope/__init__.py
@@ -1,13 +1,15 @@
-__version__ = '0.1.3'
+__version__ = "0.1.4"
import re
import sys
import platform
+
def _v(version_s):
- return tuple(int(s) for s in re.findall("\d+", version_s))
+ return tuple(int(s) for s in re.findall(r"\d+", version_s))
+
if sys.platform != "darwin" or _v(platform.mac_ver()[0]) < _v("10.9"):
- from ._dummy import *
+ from ._dummy import * # noqa
else:
- from ._nope import *
+ from ._nope import * # noqa
diff --git a/contrib/python/appnope/py3/appnope/_dummy.py b/contrib/python/appnope/py3/appnope/_dummy.py
index a55ec5bfcdc..a4ee06f89e0 100644
--- a/contrib/python/appnope/py3/appnope/_dummy.py
+++ b/contrib/python/appnope/py3/appnope/_dummy.py
@@ -1,30 +1,32 @@
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
# Copyright (C) 2013 Min RK
#
# Distributed under the terms of the 2-clause BSD License.
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
from contextlib import contextmanager
+
def beginActivityWithOptions(options, reason=""):
return
+
def endActivity(activity):
return
+
def nope():
return
+
def nap():
return
@contextmanager
-def nope_scope(
- options=0,
- reason="Because Reasons"
- ):
+def nope_scope(options=0, reason="Because Reasons"):
yield
+
def napping_allowed():
- return True \ No newline at end of file
+ return True
diff --git a/contrib/python/appnope/py3/appnope/_nope.py b/contrib/python/appnope/py3/appnope/_nope.py
index d83e826797b..10d1c056f43 100644
--- a/contrib/python/appnope/py3/appnope/_nope.py
+++ b/contrib/python/appnope/py3/appnope/_nope.py
@@ -1,16 +1,16 @@
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
# Copyright (C) 2013 Min RK
#
# Distributed under the terms of the 2-clause BSD License.
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
from contextlib import contextmanager
import ctypes
import ctypes.util
-objc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('objc'))
-_ = ctypes.cdll.LoadLibrary(ctypes.util.find_library('Foundation'))
+objc = ctypes.cdll.LoadLibrary(ctypes.util.find_library("objc"))
+_ = ctypes.cdll.LoadLibrary(ctypes.util.find_library("Foundation"))
void_p = ctypes.c_void_p
ull = ctypes.c_uint64
@@ -22,74 +22,82 @@ objc.objc_msgSend.argtypes = [void_p, void_p]
msg = objc.objc_msgSend
+
def _utf8(s):
"""ensure utf8 bytes"""
if not isinstance(s, bytes):
- s = s.encode('utf8')
+ s = s.encode("utf8")
return s
+
def n(name):
"""create a selector name (for methods)"""
return objc.sel_registerName(_utf8(name))
+
def C(classname):
"""get an ObjC Class by name"""
ret = objc.objc_getClass(_utf8(classname))
assert ret is not None, "Couldn't find Class %s" % classname
return ret
+
# constants from Foundation
-NSActivityIdleDisplaySleepDisabled = (1 << 40)
-NSActivityIdleSystemSleepDisabled = (1 << 20)
-NSActivitySuddenTerminationDisabled = (1 << 14)
-NSActivityAutomaticTerminationDisabled = (1 << 15)
-NSActivityUserInitiated = (0x00FFFFFF | NSActivityIdleSystemSleepDisabled)
-NSActivityUserInitiatedAllowingIdleSystemSleep = (NSActivityUserInitiated & ~NSActivityIdleSystemSleepDisabled)
-NSActivityBackground = 0x000000FF
-NSActivityLatencyCritical = 0xFF00000000
+NSActivityIdleDisplaySleepDisabled = 1 << 40
+NSActivityIdleSystemSleepDisabled = 1 << 20
+NSActivitySuddenTerminationDisabled = 1 << 14
+NSActivityAutomaticTerminationDisabled = 1 << 15
+NSActivityUserInitiated = 0x00FFFFFF | NSActivityIdleSystemSleepDisabled
+NSActivityUserInitiatedAllowingIdleSystemSleep = (
+ NSActivityUserInitiated & ~NSActivityIdleSystemSleepDisabled
+)
+NSActivityBackground = 0x000000FF
+NSActivityLatencyCritical = 0xFF00000000
+
def beginActivityWithOptions(options, reason=""):
"""Wrapper for:
-
- [ [ NSProcessInfo processInfo]
+
+ [ [ NSProcessInfo processInfo]
beginActivityWithOptions: (uint64)options
reason: (str)reason
]
"""
- NSProcessInfo = C('NSProcessInfo')
- NSString = C('NSString')
-
+ NSProcessInfo = C("NSProcessInfo")
+ NSString = C("NSString")
+
objc.objc_msgSend.argtypes = [void_p, void_p, void_p]
reason = msg(NSString, n("stringWithUTF8String:"), _utf8(reason))
objc.objc_msgSend.argtypes = [void_p, void_p]
- info = msg(NSProcessInfo, n('processInfo'))
+ info = msg(NSProcessInfo, n("processInfo"))
objc.objc_msgSend.argtypes = [void_p, void_p, ull, void_p]
- activity = msg(info,
- n('beginActivityWithOptions:reason:'),
- ull(options),
- void_p(reason)
+ activity = msg(
+ info, n("beginActivityWithOptions:reason:"), ull(options), void_p(reason)
)
return activity
+
def endActivity(activity):
"""end a process activity assertion"""
- NSProcessInfo = C('NSProcessInfo')
+ NSProcessInfo = C("NSProcessInfo")
objc.objc_msgSend.argtypes = [void_p, void_p]
- info = msg(NSProcessInfo, n('processInfo'))
+ info = msg(NSProcessInfo, n("processInfo"))
objc.objc_msgSend.argtypes = [void_p, void_p, void_p]
msg(info, n("endActivity:"), void_p(activity))
+
_theactivity = None
+
def nope():
"""disable App Nap by setting NSActivityUserInitiatedAllowingIdleSystemSleep"""
global _theactivity
_theactivity = beginActivityWithOptions(
- NSActivityUserInitiatedAllowingIdleSystemSleep,
- "Because Reasons"
+ NSActivityUserInitiatedAllowingIdleSystemSleep, "Because Reasons"
)
+
def nap():
"""end the caffeinated state started by `nope`"""
global _theactivity
@@ -97,17 +105,18 @@ def nap():
endActivity(_theactivity)
_theactivity = None
+
def napping_allowed():
"""is napping allowed?"""
return _theactivity is None
+
@contextmanager
def nope_scope(
- options=NSActivityUserInitiatedAllowingIdleSystemSleep,
- reason="Because Reasons"
- ):
+ options=NSActivityUserInitiatedAllowingIdleSystemSleep, reason="Because Reasons"
+):
"""context manager for beginActivityWithOptions.
-
+
Within this context, App Nap will be disabled.
"""
activity = beginActivityWithOptions(options, reason)
@@ -116,6 +125,7 @@ def nope_scope(
finally:
endActivity(activity)
+
__all__ = [
"NSActivityIdleDisplaySleepDisabled",
"NSActivityIdleSystemSleepDisabled",
diff --git a/contrib/python/appnope/py3/ya.make b/contrib/python/appnope/py3/ya.make
index bacfa9a91bb..a1901177d1c 100644
--- a/contrib/python/appnope/py3/ya.make
+++ b/contrib/python/appnope/py3/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(0.1.3)
+VERSION(0.1.4)
LICENSE(BSD-2-Clause)
diff --git a/contrib/python/fonttools/.dist-info/METADATA b/contrib/python/fonttools/.dist-info/METADATA
index f9e01c388f9..a711f82b4e9 100644
--- a/contrib/python/fonttools/.dist-info/METADATA
+++ b/contrib/python/fonttools/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: fonttools
-Version: 4.47.2
+Version: 4.49.0
Summary: Tools to manipulate font files
Home-page: http://github.com/fonttools/fonttools
Author: Just van Rossum
@@ -31,7 +31,7 @@ Requires-Python: >=3.8
License-File: LICENSE
Provides-Extra: all
Requires-Dist: fs <3,>=2.2.0 ; extra == 'all'
-Requires-Dist: lxml <5,>=4.0 ; extra == 'all'
+Requires-Dist: lxml >=4.0 ; extra == 'all'
Requires-Dist: zopfli >=0.1.4 ; extra == 'all'
Requires-Dist: lz4 >=1.7.4.2 ; extra == 'all'
Requires-Dist: pycairo ; extra == 'all'
@@ -52,7 +52,7 @@ Requires-Dist: pycairo ; extra == 'interpolatable'
Requires-Dist: scipy ; (platform_python_implementation != "PyPy") and extra == 'interpolatable'
Requires-Dist: munkres ; (platform_python_implementation == "PyPy") and extra == 'interpolatable'
Provides-Extra: lxml
-Requires-Dist: lxml <5,>=4.0 ; extra == 'lxml'
+Requires-Dist: lxml >=4.0 ; extra == 'lxml'
Provides-Extra: pathops
Requires-Dist: skia-pathops >=0.5.0 ; extra == 'pathops'
Provides-Extra: plot
@@ -118,7 +118,7 @@ Python 3 `venv <https://docs.python.org/3/library/venv.html>`__ module.
# create new virtual environment called e.g. 'fonttools-venv', or anything you like
python -m virtualenv fonttools-venv
- # source the `activate` shell script to enter the environment (Un*x); to exit, just type `deactivate`
+ # source the `activate` shell script to enter the environment (Unix-like); to exit, just type `deactivate`
. fonttools-venv/bin/activate
# to activate the virtual environment in Windows `cmd.exe`, do
@@ -375,6 +375,37 @@ Have fun!
Changelog
~~~~~~~~~
+4.49.0 (released 2024-02-15)
+----------------------------
+
+- [otlLib] Add API for building ``MATH`` table (#3446)
+
+4.48.1 (released 2024-02-06)
+----------------------------
+
+- Fixed uploading wheels to PyPI, no code changes since v4.48.0.
+
+4.48.0 (released 2024-02-06)
+----------------------------
+
+- [varLib] Do not log when there are no OTL tables to be merged.
+- [setup.py] Do not restrict lxml<5 any more, tests pass just fine with lxml>=5.
+- [feaLib] Remove glyph and class names length restrictions in FEA (#3424).
+- [roundingPens] Added ``transformRoundFunc`` parameter to the rounding pens to allow
+ for custom rounding of the components' transforms (#3426).
+- [feaLib] Keep declaration order of ligature components within a ligature set, instead
+ of sorting by glyph name (#3429).
+- [feaLib] Fixed ordering of alternates in ``aalt`` lookups, following the declaration
+ order of feature references within the ``aalt`` feature block (#3430).
+- [varLib.instancer] Fixed a bug in the instancer's IUP optimization (#3432).
+- [sbix] Support sbix glyphs with new graphicType "flip" (#3433).
+- [svgPathPen] Added ``--glyphs`` option to dump the SVG paths for the named glyphs
+ in the font (0572f78).
+- [designspaceLib] Added "description" attribute to ``<mappings>`` and ``<mapping>``
+ elements, and allow multiple ``<mappings>`` elements to group ``<mapping>`` elements
+ that are logically related (#3435, #3437).
+- [otlLib] Correctly choose the most compact GSUB contextual lookup format (#3439).
+
4.47.2 (released 2024-01-11)
----------------------------
@@ -697,10 +728,10 @@ Minor release to fix uploading wheels to PyPI.
----------------------------
- [varLib.instancer] Added support for L4 instancing, i.e. moving the default value of
- an axis while keeping it variable. Thanks Behdad! (#2728, #2861).
+ an axis while keeping it variable. Thanks Behdad! (#2728, #2861).
It's now also possible to restrict an axis min/max values beyond the current default
value, e.g. a font wght has min=100, def=400, max=900 and you want a partial VF that
- only varies between 500 and 700, you can now do that.
+ only varies between 500 and 700, you can now do that.
You can either specify two min/max values (wght=500:700), and the new default will be
set to either the minimum or maximum, depending on which one is closer to the current
default (e.g. 500 in this case). Or you can specify three values (e.g. wght=500:600:700)
@@ -708,7 +739,7 @@ Minor release to fix uploading wheels to PyPI.
- [otlLib/featureVars] Set a few Count values so one doesn't need to compile the font
to update them (#2860).
- [varLib.models] Make extrapolation work for 2-master models as well where one master
- is at the default location (#2843, #2846).
+ is at the default location (#2843, #2846).
Add optional extrapolate=False to normalizeLocation() (#2847, #2849).
- [varLib.cff] Fixed sub-optimal packing of CFF2 deltas by no longer rounding them to
integer (#2838).
diff --git a/contrib/python/fonttools/README.rst b/contrib/python/fonttools/README.rst
index d84282fc76a..2274fbdc694 100644
--- a/contrib/python/fonttools/README.rst
+++ b/contrib/python/fonttools/README.rst
@@ -44,7 +44,7 @@ Python 3 `venv <https://docs.python.org/3/library/venv.html>`__ module.
# create new virtual environment called e.g. 'fonttools-venv', or anything you like
python -m virtualenv fonttools-venv
- # source the `activate` shell script to enter the environment (Un*x); to exit, just type `deactivate`
+ # source the `activate` shell script to enter the environment (Unix-like); to exit, just type `deactivate`
. fonttools-venv/bin/activate
# to activate the virtual environment in Windows `cmd.exe`, do
diff --git a/contrib/python/fonttools/fontTools/__init__.py b/contrib/python/fonttools/fontTools/__init__.py
index 7410d3c7fe2..e6a745bd529 100644
--- a/contrib/python/fonttools/fontTools/__init__.py
+++ b/contrib/python/fonttools/fontTools/__init__.py
@@ -3,6 +3,6 @@ from fontTools.misc.loggingTools import configLogger
log = logging.getLogger(__name__)
-version = __version__ = "4.47.2"
+version = __version__ = "4.49.0"
__all__ = ["version", "log", "configLogger"]
diff --git a/contrib/python/fonttools/fontTools/afmLib.py b/contrib/python/fonttools/fontTools/afmLib.py
index e89646951c5..0aabf7f6356 100644
--- a/contrib/python/fonttools/fontTools/afmLib.py
+++ b/contrib/python/fonttools/fontTools/afmLib.py
@@ -45,7 +45,6 @@ Here is an example of using `afmLib` to read, modify and write an AFM file:
"""
-
import re
# every single line starts with a "word"
diff --git a/contrib/python/fonttools/fontTools/cffLib/__init__.py b/contrib/python/fonttools/fontTools/cffLib/__init__.py
index 644508c1553..0ad41c5674d 100644
--- a/contrib/python/fonttools/fontTools/cffLib/__init__.py
+++ b/contrib/python/fonttools/fontTools/cffLib/__init__.py
@@ -2880,7 +2880,6 @@ class PrivateDict(BaseDict):
class IndexedStrings(object):
-
"""SID -> string mapping."""
def __init__(self, file=None):
diff --git a/contrib/python/fonttools/fontTools/colorLib/builder.py b/contrib/python/fonttools/fontTools/colorLib/builder.py
index 442bc20e422..6e45e7a8850 100644
--- a/contrib/python/fonttools/fontTools/colorLib/builder.py
+++ b/contrib/python/fonttools/fontTools/colorLib/builder.py
@@ -2,6 +2,7 @@
colorLib.builder: Build COLR/CPAL tables from scratch
"""
+
import collections
import copy
import enum
@@ -298,11 +299,15 @@ def buildPaletteLabels(
labels: Iterable[_OptionalLocalizedString], nameTable: _n_a_m_e.table__n_a_m_e
) -> List[Optional[int]]:
return [
- nameTable.addMultilingualName(l, mac=False)
- if isinstance(l, dict)
- else C_P_A_L_.table_C_P_A_L_.NO_NAME_ID
- if l is None
- else nameTable.addMultilingualName({"en": l}, mac=False)
+ (
+ nameTable.addMultilingualName(l, mac=False)
+ if isinstance(l, dict)
+ else (
+ C_P_A_L_.table_C_P_A_L_.NO_NAME_ID
+ if l is None
+ else nameTable.addMultilingualName({"en": l}, mac=False)
+ )
+ )
for l in labels
]
diff --git a/contrib/python/fonttools/fontTools/config/__init__.py b/contrib/python/fonttools/fontTools/config/__init__.py
index c106fe51fc0..41ab8f75819 100644
--- a/contrib/python/fonttools/fontTools/config/__init__.py
+++ b/contrib/python/fonttools/fontTools/config/__init__.py
@@ -6,6 +6,7 @@ etc. If this file gets too big, split it into smaller files per-module.
An instance of the Config class can be attached to a TTFont object, so that
the various modules can access their configuration options from it.
"""
+
from textwrap import dedent
from fontTools.misc.configTools import *
diff --git a/contrib/python/fonttools/fontTools/designspaceLib/__init__.py b/contrib/python/fonttools/fontTools/designspaceLib/__init__.py
index 69d4912c091..342f1decd5d 100644
--- a/contrib/python/fonttools/fontTools/designspaceLib/__init__.py
+++ b/contrib/python/fonttools/fontTools/designspaceLib/__init__.py
@@ -476,7 +476,14 @@ class AxisMappingDescriptor(SimpleDescriptor):
_attrs = ["inputLocation", "outputLocation"]
- def __init__(self, *, inputLocation=None, outputLocation=None):
+ def __init__(
+ self,
+ *,
+ inputLocation=None,
+ outputLocation=None,
+ description=None,
+ groupDescription=None,
+ ):
self.inputLocation: SimpleLocationDict = inputLocation or {}
"""dict. Axis values for the input of the mapping, in design space coordinates.
@@ -491,6 +498,20 @@ class AxisMappingDescriptor(SimpleDescriptor):
.. versionadded:: 5.1
"""
+ self.description = description
+ """string. A description of the mapping.
+
+ varLib.
+
+ .. versionadded:: 5.2
+ """
+ self.groupDescription = groupDescription
+ """string. A description of the group of mappings.
+
+ varLib.
+
+ .. versionadded:: 5.2
+ """
class InstanceDescriptor(SimpleDescriptor):
@@ -1413,18 +1434,27 @@ class BaseDocWriter(object):
):
axesElement = ET.Element("axes")
if self.documentObject.elidedFallbackName is not None:
- axesElement.attrib[
- "elidedfallbackname"
- ] = self.documentObject.elidedFallbackName
+ axesElement.attrib["elidedfallbackname"] = (
+ self.documentObject.elidedFallbackName
+ )
self.root.append(axesElement)
for axisObject in self.documentObject.axes:
self._addAxis(axisObject)
if self.documentObject.axisMappings:
- mappingsElement = ET.Element("mappings")
- self.root.findall(".axes")[0].append(mappingsElement)
+ mappingsElement = None
+ lastGroup = object()
for mappingObject in self.documentObject.axisMappings:
+ if getattr(mappingObject, "groupDescription", None) != lastGroup:
+ if mappingsElement is not None:
+ self.root.findall(".axes")[0].append(mappingsElement)
+ lastGroup = getattr(mappingObject, "groupDescription", None)
+ mappingsElement = ET.Element("mappings")
+ if lastGroup is not None:
+ mappingsElement.attrib["description"] = lastGroup
self._addAxisMapping(mappingsElement, mappingObject)
+ if mappingsElement is not None:
+ self.root.findall(".axes")[0].append(mappingsElement)
if self.documentObject.locationLabels:
labelsElement = ET.Element("labels")
@@ -1586,6 +1616,8 @@ class BaseDocWriter(object):
def _addAxisMapping(self, mappingsElement, mappingObject):
mappingElement = ET.Element("mapping")
+ if getattr(mappingObject, "description", None) is not None:
+ mappingElement.attrib["description"] = mappingObject.description
for what in ("inputLocation", "outputLocation"):
whatObject = getattr(mappingObject, what, None)
if whatObject is None:
@@ -1744,17 +1776,17 @@ class BaseDocWriter(object):
if instanceObject.filename is not None:
instanceElement.attrib["filename"] = instanceObject.filename
if instanceObject.postScriptFontName is not None:
- instanceElement.attrib[
- "postscriptfontname"
- ] = instanceObject.postScriptFontName
+ instanceElement.attrib["postscriptfontname"] = (
+ instanceObject.postScriptFontName
+ )
if instanceObject.styleMapFamilyName is not None:
- instanceElement.attrib[
- "stylemapfamilyname"
- ] = instanceObject.styleMapFamilyName
+ instanceElement.attrib["stylemapfamilyname"] = (
+ instanceObject.styleMapFamilyName
+ )
if instanceObject.styleMapStyleName is not None:
- instanceElement.attrib[
- "stylemapstylename"
- ] = instanceObject.styleMapStyleName
+ instanceElement.attrib["stylemapstylename"] = (
+ instanceObject.styleMapStyleName
+ )
if self.effectiveFormatTuple < (5, 0):
# Deprecated members as of version 5.0
if instanceObject.glyphs:
@@ -2081,10 +2113,11 @@ class BaseDocReader(LogMixin):
self.documentObject.axes.append(axisObject)
self.axisDefaults[axisObject.name] = axisObject.default
- mappingsElement = self.root.find(".axes/mappings")
self.documentObject.axisMappings = []
- if mappingsElement is not None:
+ for mappingsElement in self.root.findall(".axes/mappings"):
+ groupDescription = mappingsElement.attrib.get("description")
for mappingElement in mappingsElement.findall("mapping"):
+ description = mappingElement.attrib.get("description")
inputElement = mappingElement.find("input")
outputElement = mappingElement.find("output")
inputLoc = {}
@@ -2098,7 +2131,10 @@ class BaseDocReader(LogMixin):
value = float(dimElement.attrib["xvalue"])
outputLoc[name] = value
axisMappingObject = self.axisMappingDescriptorClass(
- inputLocation=inputLoc, outputLocation=outputLoc
+ inputLocation=inputLoc,
+ outputLocation=outputLoc,
+ description=description,
+ groupDescription=groupDescription,
)
self.documentObject.axisMappings.append(axisMappingObject)
@@ -3279,3 +3315,23 @@ class DesignSpaceDocument(LogMixin, AsDictMixin):
finally:
for source, font in zip(self.sources, fonts):
source.font = font
+
+
+def main(args=None):
+ """Roundtrip .designspace file through the DesignSpaceDocument class"""
+
+ if args is None:
+ import sys
+
+ args = sys.argv[1:]
+
+ from argparse import ArgumentParser
+
+ parser = ArgumentParser(prog="designspaceLib", description=main.__doc__)
+ parser.add_argument("input")
+ parser.add_argument("output")
+
+ options = parser.parse_args(args)
+
+ ds = DesignSpaceDocument.fromfile(options.input)
+ ds.write(options.output)
diff --git a/contrib/python/fonttools/fontTools/designspaceLib/__main__.py b/contrib/python/fonttools/fontTools/designspaceLib/__main__.py
new file mode 100644
index 00000000000..8f5e44ea9e4
--- /dev/null
+++ b/contrib/python/fonttools/fontTools/designspaceLib/__main__.py
@@ -0,0 +1,6 @@
+import sys
+from fontTools.designspaceLib import main
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/contrib/python/fonttools/fontTools/designspaceLib/statNames.py b/contrib/python/fonttools/fontTools/designspaceLib/statNames.py
index a164169da69..1474e5fcf56 100644
--- a/contrib/python/fonttools/fontTools/designspaceLib/statNames.py
+++ b/contrib/python/fonttools/fontTools/designspaceLib/statNames.py
@@ -8,6 +8,7 @@ instance:
names = getStatNames(doc, instance.getFullUserLocation(doc))
print(names.styleNames)
"""
+
from __future__ import annotations
from dataclasses import dataclass
diff --git a/contrib/python/fonttools/fontTools/feaLib/builder.py b/contrib/python/fonttools/fontTools/feaLib/builder.py
index 36eed951480..7921a3f1793 100644
--- a/contrib/python/fonttools/fontTools/feaLib/builder.py
+++ b/contrib/python/fonttools/fontTools/feaLib/builder.py
@@ -285,7 +285,11 @@ class Builder(object):
def build_feature_aalt_(self):
if not self.aalt_features_ and not self.aalt_alternates_:
return
- alternates = {g: set(a) for g, a in self.aalt_alternates_.items()}
+ # > alternate glyphs will be sorted in the order that the source features
+ # > are named in the aalt definition, not the order of the feature definitions
+ # > in the file. Alternates defined explicitly ... will precede all others.
+ # https://github.com/fonttools/fonttools/issues/836
+ alternates = {g: list(a) for g, a in self.aalt_alternates_.items()}
for location, name in self.aalt_features_ + [(None, "aalt")]:
feature = [
(script, lang, feature, lookups)
@@ -302,17 +306,14 @@ class Builder(object):
lookuplist = [lookuplist]
for lookup in lookuplist:
for glyph, alts in lookup.getAlternateGlyphs().items():
- alternates.setdefault(glyph, set()).update(alts)
+ alts_for_glyph = alternates.setdefault(glyph, [])
+ alts_for_glyph.extend(
+ g for g in alts if g not in alts_for_glyph
+ )
single = {
- glyph: list(repl)[0] for glyph, repl in alternates.items() if len(repl) == 1
- }
- # TODO: Figure out the glyph alternate ordering used by makeotf.
- # https://github.com/fonttools/fonttools/issues/836
- multi = {
- glyph: sorted(repl, key=self.font.getGlyphID)
- for glyph, repl in alternates.items()
- if len(repl) > 1
+ glyph: repl[0] for glyph, repl in alternates.items() if len(repl) == 1
}
+ multi = {glyph: repl for glyph, repl in alternates.items() if len(repl) > 1}
if not single and not multi:
return
self.features_ = {
@@ -1249,8 +1250,9 @@ class Builder(object):
def add_single_subst(self, location, prefix, suffix, mapping, forceChain):
if self.cur_feature_name_ == "aalt":
for from_glyph, to_glyph in mapping.items():
- alts = self.aalt_alternates_.setdefault(from_glyph, set())
- alts.add(to_glyph)
+ alts = self.aalt_alternates_.setdefault(from_glyph, [])
+ if to_glyph not in alts:
+ alts.append(to_glyph)
return
if prefix or suffix or forceChain:
self.add_single_subst_chained_(location, prefix, suffix, mapping)
@@ -1303,8 +1305,8 @@ class Builder(object):
# GSUB 3
def add_alternate_subst(self, location, prefix, glyph, suffix, replacement):
if self.cur_feature_name_ == "aalt":
- alts = self.aalt_alternates_.setdefault(glyph, set())
- alts.update(replacement)
+ alts = self.aalt_alternates_.setdefault(glyph, [])
+ alts.extend(g for g in replacement if g not in alts)
return
if prefix or suffix:
chain = self.get_lookup_(location, ChainContextSubstBuilder)
@@ -1338,7 +1340,7 @@ class Builder(object):
# substitutions to be specified on target sequences that contain
# glyph classes, the implementation software will enumerate
# all specific glyph sequences if glyph classes are detected"
- for g in sorted(itertools.product(*glyphs)):
+ for g in itertools.product(*glyphs):
lookup.ligatures[g] = replacement
# GSUB 5/6
diff --git a/contrib/python/fonttools/fontTools/feaLib/lexer.py b/contrib/python/fonttools/fontTools/feaLib/lexer.py
index e0ae0aefeef..5867f70b380 100644
--- a/contrib/python/fonttools/fontTools/feaLib/lexer.py
+++ b/contrib/python/fonttools/fontTools/feaLib/lexer.py
@@ -111,10 +111,6 @@ class Lexer(object):
glyphclass = text[start + 1 : self.pos_]
if len(glyphclass) < 1:
raise FeatureLibError("Expected glyph class name", location)
- if len(glyphclass) > 63:
- raise FeatureLibError(
- "Glyph class names must not be longer than 63 characters", location
- )
if not Lexer.RE_GLYPHCLASS.match(glyphclass):
raise FeatureLibError(
"Glyph class names must consist of letters, digits, "
diff --git a/contrib/python/fonttools/fontTools/feaLib/parser.py b/contrib/python/fonttools/fontTools/feaLib/parser.py
index 8ffdf644c33..8cbe79592b1 100644
--- a/contrib/python/fonttools/fontTools/feaLib/parser.py
+++ b/contrib/python/fonttools/fontTools/feaLib/parser.py
@@ -2071,13 +2071,7 @@ class Parser(object):
def expect_glyph_(self):
self.advance_lexer_()
if self.cur_token_type_ is Lexer.NAME:
- self.cur_token_ = self.cur_token_.lstrip("\\")
- if len(self.cur_token_) > 63:
- raise FeatureLibError(
- "Glyph names must not be longer than 63 characters",
- self.cur_token_location_,
- )
- return self.cur_token_
+ return self.cur_token_.lstrip("\\")
elif self.cur_token_type_ is Lexer.CID:
return "cid%05d" % self.cur_token_
raise FeatureLibError("Expected a glyph name or CID", self.cur_token_location_)
diff --git a/contrib/python/fonttools/fontTools/merge/layout.py b/contrib/python/fonttools/fontTools/merge/layout.py
index 6b85cd50338..e1b504e6198 100644
--- a/contrib/python/fonttools/fontTools/merge/layout.py
+++ b/contrib/python/fonttools/fontTools/merge/layout.py
@@ -169,20 +169,16 @@ otTables.BaseTagList.mergeMap = {
"BaselineTag": sumLists,
}
-otTables.GDEF.mergeMap = (
- otTables.GSUB.mergeMap
-) = (
- otTables.GPOS.mergeMap
-) = otTables.BASE.mergeMap = otTables.JSTF.mergeMap = otTables.MATH.mergeMap = {
+otTables.GDEF.mergeMap = otTables.GSUB.mergeMap = otTables.GPOS.mergeMap = (
+ otTables.BASE.mergeMap
+) = otTables.JSTF.mergeMap = otTables.MATH.mergeMap = {
"*": mergeObjects,
"Version": max,
}
-ttLib.getTableClass("GDEF").mergeMap = ttLib.getTableClass(
- "GSUB"
-).mergeMap = ttLib.getTableClass("GPOS").mergeMap = ttLib.getTableClass(
- "BASE"
-).mergeMap = ttLib.getTableClass(
+ttLib.getTableClass("GDEF").mergeMap = ttLib.getTableClass("GSUB").mergeMap = (
+ ttLib.getTableClass("GPOS").mergeMap
+) = ttLib.getTableClass("BASE").mergeMap = ttLib.getTableClass(
"JSTF"
).mergeMap = ttLib.getTableClass(
"MATH"
diff --git a/contrib/python/fonttools/fontTools/misc/classifyTools.py b/contrib/python/fonttools/fontTools/misc/classifyTools.py
index 2235bbd7f8c..aed7ca68c4e 100644
--- a/contrib/python/fonttools/fontTools/misc/classifyTools.py
+++ b/contrib/python/fonttools/fontTools/misc/classifyTools.py
@@ -3,7 +3,6 @@
class Classifier(object):
-
"""
Main Classifier object, used to classify things into similar sets.
"""
diff --git a/contrib/python/fonttools/fontTools/misc/cliTools.py b/contrib/python/fonttools/fontTools/misc/cliTools.py
index 8322ea9ebb7..8a64235bf07 100644
--- a/contrib/python/fonttools/fontTools/misc/cliTools.py
+++ b/contrib/python/fonttools/fontTools/misc/cliTools.py
@@ -1,4 +1,5 @@
"""Collection of utilities for command-line interfaces and console scripts."""
+
import os
import re
diff --git a/contrib/python/fonttools/fontTools/misc/configTools.py b/contrib/python/fonttools/fontTools/misc/configTools.py
index 38bbada24a1..7eb1854fdf3 100644
--- a/contrib/python/fonttools/fontTools/misc/configTools.py
+++ b/contrib/python/fonttools/fontTools/misc/configTools.py
@@ -8,6 +8,7 @@ To create your own config system, you need to create an instance of
``options`` class variable set to your instance of Options.
"""
+
from __future__ import annotations
import logging
diff --git a/contrib/python/fonttools/fontTools/misc/dictTools.py b/contrib/python/fonttools/fontTools/misc/dictTools.py
index e3c0df73551..cd3d394c25b 100644
--- a/contrib/python/fonttools/fontTools/misc/dictTools.py
+++ b/contrib/python/fonttools/fontTools/misc/dictTools.py
@@ -1,6 +1,5 @@
"""Misc dict tools."""
-
__all__ = ["hashdict"]
diff --git a/contrib/python/fonttools/fontTools/misc/etree.py b/contrib/python/fonttools/fontTools/misc/etree.py
index 9d4a65c3601..d0967b5f52f 100644
--- a/contrib/python/fonttools/fontTools/misc/etree.py
+++ b/contrib/python/fonttools/fontTools/misc/etree.py
@@ -11,6 +11,7 @@ or subclasses built-in ElementTree classes to add features that are
only availble in lxml, like OrderedDict for attributes, pretty_print and
iterwalk.
"""
+
from fontTools.misc.textTools import tostr
diff --git a/contrib/python/fonttools/fontTools/misc/filenames.py b/contrib/python/fonttools/fontTools/misc/filenames.py
index d279f89cc82..ddedc5210fb 100644
--- a/contrib/python/fonttools/fontTools/misc/filenames.py
+++ b/contrib/python/fonttools/fontTools/misc/filenames.py
@@ -17,7 +17,6 @@ by Tal Leming and is copyright (c) 2005-2016, The RoboFab Developers:
- Just van Rossum
"""
-
illegalCharacters = r"\" * + / : < > ? [ \ ] | \0".split(" ")
illegalCharacters += [chr(i) for i in range(1, 32)]
illegalCharacters += [chr(0x7F)]
diff --git a/contrib/python/fonttools/fontTools/misc/textTools.py b/contrib/python/fonttools/fontTools/misc/textTools.py
index f7ca1acc9b7..f5484a83aa7 100644
--- a/contrib/python/fonttools/fontTools/misc/textTools.py
+++ b/contrib/python/fonttools/fontTools/misc/textTools.py
@@ -1,6 +1,5 @@
"""fontTools.misc.textTools.py -- miscellaneous routines."""
-
import ast
import string
diff --git a/contrib/python/fonttools/fontTools/misc/transform.py b/contrib/python/fonttools/fontTools/misc/transform.py
index f85b54b7312..0f9f3a5d8b7 100644
--- a/contrib/python/fonttools/fontTools/misc/transform.py
+++ b/contrib/python/fonttools/fontTools/misc/transform.py
@@ -76,7 +76,6 @@ def _normSinCos(v):
class Transform(NamedTuple):
-
"""2x2 transformation matrix plus offset, a.k.a. Affine transform.
Transform instances are immutable: all transforming methods, eg.
rotate(), return a new Transform instance.
diff --git a/contrib/python/fonttools/fontTools/misc/vector.py b/contrib/python/fonttools/fontTools/misc/vector.py
index 666ff15cf8b..02c62e6512a 100644
--- a/contrib/python/fonttools/fontTools/misc/vector.py
+++ b/contrib/python/fonttools/fontTools/misc/vector.py
@@ -8,7 +8,6 @@ __all__ = ["Vector"]
class Vector(tuple):
-
"""A math-like vector.
Represents an n-dimensional numeric vector. ``Vector`` objects support
diff --git a/contrib/python/fonttools/fontTools/otlLib/builder.py b/contrib/python/fonttools/fontTools/otlLib/builder.py
index 4b457f4d9f6..70fd87ab576 100644
--- a/contrib/python/fonttools/fontTools/otlLib/builder.py
+++ b/contrib/python/fonttools/fontTools/otlLib/builder.py
@@ -1,11 +1,13 @@
from collections import namedtuple, OrderedDict
import os
from fontTools.misc.fixedTools import fixedToFloat
+from fontTools.misc.roundTools import otRound
from fontTools import ttLib
from fontTools.ttLib.tables import otTables as ot
from fontTools.ttLib.tables.otBase import (
ValueRecord,
valueRecordFormatDict,
+ OTLOffsetOverflowError,
OTTableWriter,
CountReference,
)
@@ -350,16 +352,14 @@ class ChainContextualBuilder(LookupBuilder):
return [x for x in ruleset if len(x.rules) > 0]
def getCompiledSize_(self, subtables):
- size = 0
- for st in subtables:
- w = OTTableWriter()
- w["LookupType"] = CountReference(
- {"LookupType": st.LookupType}, "LookupType"
- )
- # We need to make a copy here because compiling
- # modifies the subtable (finalizing formats etc.)
- copy.deepcopy(st).compile(w, self.font)
- size += len(w.getAllData())
+ if not subtables:
+ return 0
+ # We need to make a copy here because compiling
+ # modifies the subtable (finalizing formats etc.)
+ table = self.buildLookup_(copy.deepcopy(subtables))
+ w = OTTableWriter()
+ table.compile(w, self.font)
+ size = len(w.getAllData())
return size
def build(self):
@@ -410,22 +410,23 @@ class ChainContextualBuilder(LookupBuilder):
if not ruleset.hasAnyGlyphClasses:
candidates[1] = [self.buildFormat1Subtable(ruleset, chaining)]
+ candidates_by_size = []
for i in [1, 2, 3]:
if candidates[i]:
try:
- self.getCompiledSize_(candidates[i])
- except Exception as e:
+ size = self.getCompiledSize_(candidates[i])
+ except OTLOffsetOverflowError as e:
log.warning(
"Contextual format %i at %s overflowed (%s)"
% (i, str(self.location), e)
)
- candidates[i] = None
+ else:
+ candidates_by_size.append((size, candidates[i]))
- candidates = [x for x in candidates if x is not None]
- if not candidates:
+ if not candidates_by_size:
raise OpenTypeLibError("All candidates overflowed", self.location)
- winner = min(candidates, key=self.getCompiledSize_)
+ _min_size, winner = min(candidates_by_size, key=lambda x: x[0])
subtables.extend(winner)
# If we are not chaining, lookup type will be automatically fixed by
@@ -774,7 +775,10 @@ class ChainContextSubstBuilder(ChainContextualBuilder):
if lookup is not None:
alts = lookup.getAlternateGlyphs()
for glyph, replacements in alts.items():
- result.setdefault(glyph, set()).update(replacements)
+ alts_for_glyph = result.setdefault(glyph, [])
+ alts_for_glyph.extend(
+ g for g in replacements if g not in alts_for_glyph
+ )
return result
def find_chainable_single_subst(self, mapping):
@@ -1238,7 +1242,7 @@ class SingleSubstBuilder(LookupBuilder):
return self.buildLookup_(subtables)
def getAlternateGlyphs(self):
- return {glyph: set([repl]) for glyph, repl in self.mapping.items()}
+ return {glyph: [repl] for glyph, repl in self.mapping.items()}
def add_subtable_break(self, location):
self.mapping[(self.SUBTABLE_BREAK_, location)] = self.SUBTABLE_BREAK_
@@ -1567,19 +1571,6 @@ def buildAlternateSubstSubtable(mapping):
return self
-def _getLigatureKey(components):
- # Computes a key for ordering ligatures in a GSUB Type-4 lookup.
-
- # When building the OpenType lookup, we need to make sure that
- # the longest sequence of components is listed first, so we
- # use the negative length as the primary key for sorting.
- # To make buildLigatureSubstSubtable() deterministic, we use the
- # component sequence as the secondary key.
-
- # For example, this will sort (f,f,f) < (f,f,i) < (f,f) < (f,i) < (f,l).
- return (-len(components), components)
-
-
def buildLigatureSubstSubtable(mapping):
"""Builds a ligature substitution (GSUB4) subtable.
@@ -1613,7 +1604,7 @@ def buildLigatureSubstSubtable(mapping):
# with fontTools >= 3.1:
# self.ligatures = dict(mapping)
self.ligatures = {}
- for components in sorted(mapping.keys(), key=_getLigatureKey):
+ for components in sorted(mapping.keys(), key=self._getLigatureSortKey):
ligature = ot.Ligature()
ligature.Component = components[1:]
ligature.CompCount = len(ligature.Component) + 1
@@ -2916,3 +2907,294 @@ def _addName(ttFont, value, minNameID=0, windows=True, mac=True):
return nameTable.addMultilingualName(
names, ttFont=ttFont, windows=windows, mac=mac, minNameID=minNameID
)
+
+
+def buildMathTable(
+ ttFont,
+ constants=None,
+ italicsCorrections=None,
+ topAccentAttachments=None,
+ extendedShapes=None,
+ mathKerns=None,
+ minConnectorOverlap=0,
+ vertGlyphVariants=None,
+ horizGlyphVariants=None,
+ vertGlyphAssembly=None,
+ horizGlyphAssembly=None,
+):
+ """
+ Add a 'MATH' table to 'ttFont'.
+
+ 'constants' is a dictionary of math constants. The keys are the constant
+ names from the MATH table specification (with capital first letter), and the
+ values are the constant values as numbers.
+
+ 'italicsCorrections' is a dictionary of italic corrections. The keys are the
+ glyph names, and the values are the italic corrections as numbers.
+
+ 'topAccentAttachments' is a dictionary of top accent attachments. The keys
+ are the glyph names, and the values are the top accent horizontal positions
+ as numbers.
+
+ 'extendedShapes' is a set of extended shape glyphs.
+
+ 'mathKerns' is a dictionary of math kerns. The keys are the glyph names, and
+ the values are dictionaries. The keys of these dictionaries are the side
+ names ('TopRight', 'TopLeft', 'BottomRight', 'BottomLeft'), and the values
+ are tuples of two lists. The first list contains the correction heights as
+ numbers, and the second list contains the kern values as numbers.
+
+ 'minConnectorOverlap' is the minimum connector overlap as a number.
+
+ 'vertGlyphVariants' is a dictionary of vertical glyph variants. The keys are
+ the glyph names, and the values are tuples of glyph name and full advance height.
+
+ 'horizGlyphVariants' is a dictionary of horizontal glyph variants. The keys
+ are the glyph names, and the values are tuples of glyph name and full
+ advance width.
+
+ 'vertGlyphAssembly' is a dictionary of vertical glyph assemblies. The keys
+ are the glyph names, and the values are tuples of assembly parts and italics
+ correction. The assembly parts are tuples of glyph name, flags, start
+ connector length, end connector length, and full advance height.
+
+ 'horizGlyphAssembly' is a dictionary of horizontal glyph assemblies. The
+ keys are the glyph names, and the values are tuples of assembly parts
+ and italics correction. The assembly parts are tuples of glyph name, flags,
+ start connector length, end connector length, and full advance width.
+
+ Where a number is expected, an integer or a float can be used. The floats
+ will be rounded.
+
+ Example::
+
+ constants = {
+ "ScriptPercentScaleDown": 70,
+ "ScriptScriptPercentScaleDown": 50,
+ "DelimitedSubFormulaMinHeight": 24,
+ "DisplayOperatorMinHeight": 60,
+ ...
+ }
+ italicsCorrections = {
+ "fitalic-math": 100,
+ "fbolditalic-math": 120,
+ ...
+ }
+ topAccentAttachments = {
+ "circumflexcomb": 500,
+ "acutecomb": 400,
+ "A": 300,
+ "B": 340,
+ ...
+ }
+ extendedShapes = {"parenleft", "parenright", ...}
+ mathKerns = {
+ "A": {
+ "TopRight": ([-50, -100], [10, 20, 30]),
+ "TopLeft": ([50, 100], [10, 20, 30]),
+ ...
+ },
+ ...
+ }
+ vertGlyphVariants = {
+ "parenleft": [("parenleft", 700), ("parenleft.size1", 1000), ...],
+ "parenright": [("parenright", 700), ("parenright.size1", 1000), ...],
+ ...
+ }
+ vertGlyphAssembly = {
+ "braceleft": [
+ (
+ ("braceleft.bottom", 0, 0, 200, 500),
+ ("braceleft.extender", 1, 200, 200, 200)),
+ ("braceleft.middle", 0, 100, 100, 700),
+ ("braceleft.extender", 1, 200, 200, 200),
+ ("braceleft.top", 0, 200, 0, 500),
+ ),
+ 100,
+ ],
+ ...
+ }
+ """
+ glyphMap = ttFont.getReverseGlyphMap()
+
+ ttFont["MATH"] = math = ttLib.newTable("MATH")
+ math.table = table = ot.MATH()
+ table.Version = 0x00010000
+ table.populateDefaults()
+
+ table.MathConstants = _buildMathConstants(constants)
+ table.MathGlyphInfo = _buildMathGlyphInfo(
+ glyphMap,
+ italicsCorrections,
+ topAccentAttachments,
+ extendedShapes,
+ mathKerns,
+ )
+ table.MathVariants = _buildMathVariants(
+ glyphMap,
+ minConnectorOverlap,
+ vertGlyphVariants,
+ horizGlyphVariants,
+ vertGlyphAssembly,
+ horizGlyphAssembly,
+ )
+
+
+def _buildMathConstants(constants):
+ if not constants:
+ return None
+
+ mathConstants = ot.MathConstants()
+ for conv in mathConstants.getConverters():
+ value = otRound(constants.get(conv.name, 0))
+ if conv.tableClass:
+ assert issubclass(conv.tableClass, ot.MathValueRecord)
+ value = _mathValueRecord(value)
+ setattr(mathConstants, conv.name, value)
+ return mathConstants
+
+
+def _buildMathGlyphInfo(
+ glyphMap,
+ italicsCorrections,
+ topAccentAttachments,
+ extendedShapes,
+ mathKerns,
+):
+ if not any([extendedShapes, italicsCorrections, topAccentAttachments, mathKerns]):
+ return None
+
+ info = ot.MathGlyphInfo()
+ info.populateDefaults()
+
+ if italicsCorrections:
+ coverage = buildCoverage(italicsCorrections.keys(), glyphMap)
+ info.MathItalicsCorrectionInfo = ot.MathItalicsCorrectionInfo()
+ info.MathItalicsCorrectionInfo.Coverage = coverage
+ info.MathItalicsCorrectionInfo.ItalicsCorrectionCount = len(coverage.glyphs)
+ info.MathItalicsCorrectionInfo.ItalicsCorrection = [
+ _mathValueRecord(italicsCorrections[n]) for n in coverage.glyphs
+ ]
+
+ if topAccentAttachments:
+ coverage = buildCoverage(topAccentAttachments.keys(), glyphMap)
+ info.MathTopAccentAttachment = ot.MathTopAccentAttachment()
+ info.MathTopAccentAttachment.TopAccentCoverage = coverage
+ info.MathTopAccentAttachment.TopAccentAttachmentCount = len(coverage.glyphs)
+ info.MathTopAccentAttachment.TopAccentAttachment = [
+ _mathValueRecord(topAccentAttachments[n]) for n in coverage.glyphs
+ ]
+
+ if extendedShapes:
+ info.ExtendedShapeCoverage = buildCoverage(extendedShapes, glyphMap)
+
+ if mathKerns:
+ coverage = buildCoverage(mathKerns.keys(), glyphMap)
+ info.MathKernInfo = ot.MathKernInfo()
+ info.MathKernInfo.MathKernCoverage = coverage
+ info.MathKernInfo.MathKernCount = len(coverage.glyphs)
+ info.MathKernInfo.MathKernInfoRecords = []
+ for glyph in coverage.glyphs:
+ record = ot.MathKernInfoRecord()
+ for side in {"TopRight", "TopLeft", "BottomRight", "BottomLeft"}:
+ if side in mathKerns[glyph]:
+ correctionHeights, kernValues = mathKerns[glyph][side]
+ assert len(correctionHeights) == len(kernValues) - 1
+ kern = ot.MathKern()
+ kern.HeightCount = len(correctionHeights)
+ kern.CorrectionHeight = [
+ _mathValueRecord(h) for h in correctionHeights
+ ]
+ kern.KernValue = [_mathValueRecord(v) for v in kernValues]
+ setattr(record, f"{side}MathKern", kern)
+ info.MathKernInfo.MathKernInfoRecords.append(record)
+
+ return info
+
+
+def _buildMathVariants(
+ glyphMap,
+ minConnectorOverlap,
+ vertGlyphVariants,
+ horizGlyphVariants,
+ vertGlyphAssembly,
+ horizGlyphAssembly,
+):
+ if not any(
+ [vertGlyphVariants, horizGlyphVariants, vertGlyphAssembly, horizGlyphAssembly]
+ ):
+ return None
+
+ variants = ot.MathVariants()
+ variants.populateDefaults()
+
+ variants.MinConnectorOverlap = minConnectorOverlap
+
+ if vertGlyphVariants or vertGlyphAssembly:
+ variants.VertGlyphCoverage, variants.VertGlyphConstruction = (
+ _buildMathGlyphConstruction(
+ glyphMap,
+ vertGlyphVariants,
+ vertGlyphAssembly,
+ )
+ )
+
+ if horizGlyphVariants or horizGlyphAssembly:
+ variants.HorizGlyphCoverage, variants.HorizGlyphConstruction = (
+ _buildMathGlyphConstruction(
+ glyphMap,
+ horizGlyphVariants,
+ horizGlyphAssembly,
+ )
+ )
+
+ return variants
+
+
+def _buildMathGlyphConstruction(glyphMap, variants, assemblies):
+ glyphs = set()
+ if variants:
+ glyphs.update(variants.keys())
+ if assemblies:
+ glyphs.update(assemblies.keys())
+ coverage = buildCoverage(glyphs, glyphMap)
+ constructions = []
+
+ for glyphName in coverage.glyphs:
+ construction = ot.MathGlyphConstruction()
+ construction.populateDefaults()
+
+ if variants and glyphName in variants:
+ construction.VariantCount = len(variants[glyphName])
+ construction.MathGlyphVariantRecord = []
+ for variantName, advance in variants[glyphName]:
+ record = ot.MathGlyphVariantRecord()
+ record.VariantGlyph = variantName
+ record.AdvanceMeasurement = otRound(advance)
+ construction.MathGlyphVariantRecord.append(record)
+
+ if assemblies and glyphName in assemblies:
+ parts, ic = assemblies[glyphName]
+ construction.GlyphAssembly = ot.GlyphAssembly()
+ construction.GlyphAssembly.ItalicsCorrection = _mathValueRecord(ic)
+ construction.GlyphAssembly.PartCount = len(parts)
+ construction.GlyphAssembly.PartRecords = []
+ for part in parts:
+ part_name, flags, start, end, advance = part
+ record = ot.GlyphPartRecord()
+ record.glyph = part_name
+ record.PartFlags = int(flags)
+ record.StartConnectorLength = otRound(start)
+ record.EndConnectorLength = otRound(end)
+ record.FullAdvance = otRound(advance)
+ construction.GlyphAssembly.PartRecords.append(record)
+
+ constructions.append(construction)
+
+ return coverage, constructions
+
+
+def _mathValueRecord(value):
+ value_record = ot.MathValueRecord()
+ value_record.Value = otRound(value)
+ return value_record
diff --git a/contrib/python/fonttools/fontTools/pens/basePen.py b/contrib/python/fonttools/fontTools/pens/basePen.py
index ac8abd40ced..5d2cf5032c5 100644
--- a/contrib/python/fonttools/fontTools/pens/basePen.py
+++ b/contrib/python/fonttools/fontTools/pens/basePen.py
@@ -148,7 +148,6 @@ class AbstractPen:
class NullPen(AbstractPen):
-
"""A pen that does nothing."""
def moveTo(self, pt):
@@ -187,7 +186,6 @@ class MissingComponentError(KeyError):
class DecomposingPen(LoggingPen):
-
"""Implements a 'addComponent' method that decomposes components
(i.e. draws them onto self as simple contours).
It can also be used as a mixin class (e.g. see ContourRecordingPen).
@@ -229,7 +227,6 @@ class DecomposingPen(LoggingPen):
class BasePen(DecomposingPen):
-
"""Base class for drawing pens. You must override _moveTo, _lineTo and
_curveToOne. You may additionally override _closePath, _endPath,
addComponent, addVarComponent, and/or _qCurveToOne. You should not
diff --git a/contrib/python/fonttools/fontTools/pens/boundsPen.py b/contrib/python/fonttools/fontTools/pens/boundsPen.py
index d833cc89b90..c92184413ea 100644
--- a/contrib/python/fonttools/fontTools/pens/boundsPen.py
+++ b/contrib/python/fonttools/fontTools/pens/boundsPen.py
@@ -7,7 +7,6 @@ __all__ = ["BoundsPen", "ControlBoundsPen"]
class ControlBoundsPen(BasePen):
-
"""Pen to calculate the "control bounds" of a shape. This is the
bounding box of all control points, so may be larger than the
actual bounding box if there are curves that don't have points
@@ -67,7 +66,6 @@ class ControlBoundsPen(BasePen):
class BoundsPen(ControlBoundsPen):
-
"""Pen to calculate the bounds of a shape. It calculates the
correct bounds even when the shape contains curves that don't
have points on their extremes. This is somewhat slower to compute
diff --git a/contrib/python/fonttools/fontTools/pens/filterPen.py b/contrib/python/fonttools/fontTools/pens/filterPen.py
index 81423109ae6..6c8712c2611 100644
--- a/contrib/python/fonttools/fontTools/pens/filterPen.py
+++ b/contrib/python/fonttools/fontTools/pens/filterPen.py
@@ -9,7 +9,6 @@ class _PassThruComponentsMixin(object):
class FilterPen(_PassThruComponentsMixin, AbstractPen):
-
"""Base class for pens that apply some transformation to the coordinates
they receive and pass them to another pen.
diff --git a/contrib/python/fonttools/fontTools/pens/hashPointPen.py b/contrib/python/fonttools/fontTools/pens/hashPointPen.py
index b82468ec9ca..f15dcabbfd5 100644
--- a/contrib/python/fonttools/fontTools/pens/hashPointPen.py
+++ b/contrib/python/fonttools/fontTools/pens/hashPointPen.py
@@ -31,6 +31,20 @@ class HashPointPen(AbstractPointPen):
> # The hash values are identical, the outline has not changed.
> # Compile the hinting code ...
> pass
+
+ If you want to compare a glyph from a source format which supports floating point
+ coordinates and transformations against a glyph from a format which has restrictions
+ on the precision of floats, e.g. UFO vs. TTF, you must use an appropriate rounding
+ function to make the values comparable. For TTF fonts with composites, this
+ construct can be used to make the transform values conform to F2Dot14:
+
+ > ttf_hash_pen = HashPointPen(ttf_glyph_width, ttFont.getGlyphSet())
+ > ttf_round_pen = RoundingPointPen(ttf_hash_pen, transformRoundFunc=partial(floatToFixedToFloat, precisionBits=14))
+ > ufo_hash_pen = HashPointPen(ufo_glyph.width, ufo)
+ > ttf_glyph.drawPoints(ttf_round_pen, ttFont["glyf"])
+ > ufo_round_pen = RoundingPointPen(ufo_hash_pen, transformRoundFunc=partial(floatToFixedToFloat, precisionBits=14))
+ > ufo_glyph.drawPoints(ufo_round_pen)
+ > assert ttf_hash_pen.hash == ufo_hash_pen.hash
"""
def __init__(self, glyphWidth=0, glyphSet=None):
diff --git a/contrib/python/fonttools/fontTools/pens/pointInsidePen.py b/contrib/python/fonttools/fontTools/pens/pointInsidePen.py
index 8a579ae4c93..e1fbbbcb1d5 100644
--- a/contrib/python/fonttools/fontTools/pens/pointInsidePen.py
+++ b/contrib/python/fonttools/fontTools/pens/pointInsidePen.py
@@ -10,7 +10,6 @@ __all__ = ["PointInsidePen"]
class PointInsidePen(BasePen):
-
"""This pen implements "point inside" testing: to test whether
a given point lies inside the shape (black) or outside (white).
Instances of this class can be recycled, as long as the
diff --git a/contrib/python/fonttools/fontTools/pens/quartzPen.py b/contrib/python/fonttools/fontTools/pens/quartzPen.py
index 6e1228d6f2b..2b8a927dc4f 100644
--- a/contrib/python/fonttools/fontTools/pens/quartzPen.py
+++ b/contrib/python/fonttools/fontTools/pens/quartzPen.py
@@ -9,7 +9,6 @@ __all__ = ["QuartzPen"]
class QuartzPen(BasePen):
-
"""A pen that creates a CGPath
Parameters
diff --git a/contrib/python/fonttools/fontTools/pens/recordingPen.py b/contrib/python/fonttools/fontTools/pens/recordingPen.py
index e24b65265af..4f44a4d59f4 100644
--- a/contrib/python/fonttools/fontTools/pens/recordingPen.py
+++ b/contrib/python/fonttools/fontTools/pens/recordingPen.py
@@ -1,4 +1,5 @@
"""Pen recording operations that can be accessed or replayed."""
+
from fontTools.pens.basePen import AbstractPen, DecomposingPen
from fontTools.pens.pointPen import AbstractPointPen
diff --git a/contrib/python/fonttools/fontTools/pens/reportLabPen.py b/contrib/python/fonttools/fontTools/pens/reportLabPen.py
index 2cb89c8bf4c..20c9065c71c 100644
--- a/contrib/python/fonttools/fontTools/pens/reportLabPen.py
+++ b/contrib/python/fonttools/fontTools/pens/reportLabPen.py
@@ -6,7 +6,6 @@ __all__ = ["ReportLabPen"]
class ReportLabPen(BasePen):
-
"""A pen for drawing onto a ``reportlab.graphics.shapes.Path`` object."""
def __init__(self, glyphSet, path=None):
diff --git a/contrib/python/fonttools/fontTools/pens/roundingPen.py b/contrib/python/fonttools/fontTools/pens/roundingPen.py
index 2a7c476c36f..176bcc7a55b 100644
--- a/contrib/python/fonttools/fontTools/pens/roundingPen.py
+++ b/contrib/python/fonttools/fontTools/pens/roundingPen.py
@@ -1,4 +1,4 @@
-from fontTools.misc.roundTools import otRound
+from fontTools.misc.roundTools import noRound, otRound
from fontTools.misc.transform import Transform
from fontTools.pens.filterPen import FilterPen, FilterPointPen
@@ -8,7 +8,9 @@ __all__ = ["RoundingPen", "RoundingPointPen"]
class RoundingPen(FilterPen):
"""
- Filter pen that rounds point coordinates and component XY offsets to integer.
+ Filter pen that rounds point coordinates and component XY offsets to integer. For
+ rounding the component transform values, a separate round function can be passed to
+ the pen.
>>> from fontTools.pens.recordingPen import RecordingPen
>>> recpen = RecordingPen()
@@ -28,9 +30,10 @@ class RoundingPen(FilterPen):
True
"""
- def __init__(self, outPen, roundFunc=otRound):
+ def __init__(self, outPen, roundFunc=otRound, transformRoundFunc=noRound):
super().__init__(outPen)
self.roundFunc = roundFunc
+ self.transformRoundFunc = transformRoundFunc
def moveTo(self, pt):
self._outPen.moveTo((self.roundFunc(pt[0]), self.roundFunc(pt[1])))
@@ -49,12 +52,16 @@ class RoundingPen(FilterPen):
)
def addComponent(self, glyphName, transformation):
+ xx, xy, yx, yy, dx, dy = transformation
self._outPen.addComponent(
glyphName,
Transform(
- *transformation[:4],
- self.roundFunc(transformation[4]),
- self.roundFunc(transformation[5]),
+ self.transformRoundFunc(xx),
+ self.transformRoundFunc(xy),
+ self.transformRoundFunc(yx),
+ self.transformRoundFunc(yy),
+ self.roundFunc(dx),
+ self.roundFunc(dy),
),
)
@@ -62,6 +69,8 @@ class RoundingPen(FilterPen):
class RoundingPointPen(FilterPointPen):
"""
Filter point pen that rounds point coordinates and component XY offsets to integer.
+ For rounding the component scale values, a separate round function can be passed to
+ the pen.
>>> from fontTools.pens.recordingPen import RecordingPointPen
>>> recpen = RecordingPointPen()
@@ -87,26 +96,35 @@ class RoundingPointPen(FilterPointPen):
True
"""
- def __init__(self, outPen, roundFunc=otRound):
+ def __init__(self, outPen, roundFunc=otRound, transformRoundFunc=noRound):
super().__init__(outPen)
self.roundFunc = roundFunc
+ self.transformRoundFunc = transformRoundFunc
- def addPoint(self, pt, segmentType=None, smooth=False, name=None, **kwargs):
+ def addPoint(
+ self, pt, segmentType=None, smooth=False, name=None, identifier=None, **kwargs
+ ):
self._outPen.addPoint(
(self.roundFunc(pt[0]), self.roundFunc(pt[1])),
segmentType=segmentType,
smooth=smooth,
name=name,
+ identifier=identifier,
**kwargs,
)
- def addComponent(self, baseGlyphName, transformation, **kwargs):
+ def addComponent(self, baseGlyphName, transformation, identifier=None, **kwargs):
+ xx, xy, yx, yy, dx, dy = transformation
self._outPen.addComponent(
- baseGlyphName,
- Transform(
- *transformation[:4],
- self.roundFunc(transformation[4]),
- self.roundFunc(transformation[5]),
+ baseGlyphName=baseGlyphName,
+ transformation=Transform(
+ self.transformRoundFunc(xx),
+ self.transformRoundFunc(xy),
+ self.transformRoundFunc(yx),
+ self.transformRoundFunc(yy),
+ self.roundFunc(dx),
+ self.roundFunc(dy),
),
+ identifier=identifier,
**kwargs,
)
diff --git a/contrib/python/fonttools/fontTools/pens/statisticsPen.py b/contrib/python/fonttools/fontTools/pens/statisticsPen.py
index 403ef39f9ec..699b14ca791 100644
--- a/contrib/python/fonttools/fontTools/pens/statisticsPen.py
+++ b/contrib/python/fonttools/fontTools/pens/statisticsPen.py
@@ -1,5 +1,6 @@
"""Pen calculating area, center of mass, variance and standard-deviation,
covariance and correlation, and slant, of glyph shapes."""
+
from math import sqrt, degrees, atan
from fontTools.pens.basePen import BasePen, OpenContourError
from fontTools.pens.momentsPen import MomentsPen
@@ -52,7 +53,6 @@ class StatisticsBase:
class StatisticsPen(StatisticsBase, MomentsPen):
-
"""Pen calculating area, center of mass, variance and
standard-deviation, covariance and correlation, and slant,
of glyph shapes.
@@ -91,7 +91,6 @@ class StatisticsPen(StatisticsBase, MomentsPen):
class StatisticsControlPen(StatisticsBase, BasePen):
-
"""Pen calculating area, center of mass, variance and
standard-deviation, covariance and correlation, and slant,
of glyph shapes, using the control polygon only.
diff --git a/contrib/python/fonttools/fontTools/pens/svgPathPen.py b/contrib/python/fonttools/fontTools/pens/svgPathPen.py
index 53b3683f2dc..29d41a8029f 100644
--- a/contrib/python/fonttools/fontTools/pens/svgPathPen.py
+++ b/contrib/python/fonttools/fontTools/pens/svgPathPen.py
@@ -220,13 +220,19 @@ def main(args=None):
"fonttools pens.svgPathPen", description="Generate SVG from text"
)
parser.add_argument("font", metavar="font.ttf", help="Font file.")
- parser.add_argument("text", metavar="text", help="Text string.")
+ parser.add_argument("text", metavar="text", nargs="?", help="Text string.")
parser.add_argument(
"-y",
metavar="<number>",
help="Face index into a collection to open. Zero based.",
)
parser.add_argument(
+ "--glyphs",
+ metavar="whitespace-separated list of glyph names",
+ type=str,
+ help="Glyphs to show. Exclusive with text option",
+ )
+ parser.add_argument(
"--variations",
metavar="AXIS=LOC",
default="",
@@ -241,6 +247,7 @@ def main(args=None):
font = TTFont(options.font, fontNumber=fontNumber)
text = options.text
+ glyphs = options.glyphs
location = {}
for tag_v in options.variations.split():
@@ -255,10 +262,17 @@ def main(args=None):
glyphset = font.getGlyphSet(location=location)
cmap = font["cmap"].getBestCmap()
+ if glyphs is not None and text is not None:
+ raise ValueError("Options --glyphs and --text are exclusive")
+
+ if glyphs is None:
+ glyphs = " ".join(cmap[ord(u)] for u in text)
+
+ glyphs = glyphs.split()
+
s = ""
width = 0
- for u in text:
- g = cmap[ord(u)]
+ for g in glyphs:
glyph = glyphset[g]
pen = SVGPathPen(glyphset)
diff --git a/contrib/python/fonttools/fontTools/pens/teePen.py b/contrib/python/fonttools/fontTools/pens/teePen.py
index 2828175a7c0..939f049b9fb 100644
--- a/contrib/python/fonttools/fontTools/pens/teePen.py
+++ b/contrib/python/fonttools/fontTools/pens/teePen.py
@@ -1,4 +1,5 @@
"""Pen multiplexing drawing to one or more pens."""
+
from fontTools.pens.basePen import AbstractPen
diff --git a/contrib/python/fonttools/fontTools/pens/transformPen.py b/contrib/python/fonttools/fontTools/pens/transformPen.py
index 2e572f612e6..ff98dbddb08 100644
--- a/contrib/python/fonttools/fontTools/pens/transformPen.py
+++ b/contrib/python/fonttools/fontTools/pens/transformPen.py
@@ -5,7 +5,6 @@ __all__ = ["TransformPen", "TransformPointPen"]
class TransformPen(FilterPen):
-
"""Pen that transforms all coordinates using a Affine transformation,
and passes them to another pen.
"""
diff --git a/contrib/python/fonttools/fontTools/subset/__init__.py b/contrib/python/fonttools/fontTools/subset/__init__.py
index 9b1758435c4..250a07ef1a8 100644
--- a/contrib/python/fonttools/fontTools/subset/__init__.py
+++ b/contrib/python/fonttools/fontTools/subset/__init__.py
@@ -3733,6 +3733,3 @@ __all__ = [
"parse_unicodes",
"main",
]
-
-if __name__ == "__main__":
- sys.exit(main())
diff --git a/contrib/python/fonttools/fontTools/svgLib/path/arc.py b/contrib/python/fonttools/fontTools/svgLib/path/arc.py
index 3e0a211e043..4b2aa5c97b8 100644
--- a/contrib/python/fonttools/fontTools/svgLib/path/arc.py
+++ b/contrib/python/fonttools/fontTools/svgLib/path/arc.py
@@ -4,6 +4,7 @@ The code is mostly adapted from Blink's SVGPathNormalizer::DecomposeArcToCubic
https://github.com/chromium/chromium/blob/93831f2/third_party/
blink/renderer/core/svg/svg_path_parser.cc#L169-L278
"""
+
from fontTools.misc.transform import Identity, Scale
from math import atan2, ceil, cos, fabs, isfinite, pi, radians, sin, sqrt, tan
diff --git a/contrib/python/fonttools/fontTools/t1Lib/__init__.py b/contrib/python/fonttools/fontTools/t1Lib/__init__.py
index a64f78097c2..0475881e914 100644
--- a/contrib/python/fonttools/fontTools/t1Lib/__init__.py
+++ b/contrib/python/fonttools/fontTools/t1Lib/__init__.py
@@ -15,6 +15,7 @@ write(path, data, kind='OTHER', dohex=False)
part should be written as hexadecimal or binary, but only if kind
is 'OTHER'.
"""
+
import fontTools
from fontTools.misc import eexec
from fontTools.misc.macCreatorType import getMacCreatorAndType
@@ -49,7 +50,6 @@ class T1Error(Exception):
class T1Font(object):
-
"""Type 1 font class.
Uses a minimal interpeter that supports just about enough PS to parse
diff --git a/contrib/python/fonttools/fontTools/ttLib/macUtils.py b/contrib/python/fonttools/fontTools/ttLib/macUtils.py
index 468a75ad6d2..0959a6fc277 100644
--- a/contrib/python/fonttools/fontTools/ttLib/macUtils.py
+++ b/contrib/python/fonttools/fontTools/ttLib/macUtils.py
@@ -1,4 +1,5 @@
"""ttLib.macUtils.py -- Various Mac-specific stuff."""
+
from io import BytesIO
from fontTools.misc.macRes import ResourceReader, ResourceError
@@ -35,7 +36,6 @@ def openTTFonts(path):
class SFNTResourceReader(BytesIO):
-
"""Simple read-only file wrapper for 'sfnt' resources."""
def __init__(self, path, res_name_or_index):
diff --git a/contrib/python/fonttools/fontTools/ttLib/removeOverlaps.py b/contrib/python/fonttools/fontTools/ttLib/removeOverlaps.py
index 624cd47b407..4795320669e 100644
--- a/contrib/python/fonttools/fontTools/ttLib/removeOverlaps.py
+++ b/contrib/python/fonttools/fontTools/ttLib/removeOverlaps.py
@@ -202,9 +202,11 @@ def removeOverlaps(
glyphNames = sorted(
glyphNames,
key=lambda name: (
- glyfTable[name].getCompositeMaxpValues(glyfTable).maxComponentDepth
- if glyfTable[name].isComposite()
- else 0,
+ (
+ glyfTable[name].getCompositeMaxpValues(glyfTable).maxComponentDepth
+ if glyfTable[name].isComposite()
+ else 0
+ ),
name,
),
)
diff --git a/contrib/python/fonttools/fontTools/ttLib/scaleUpem.py b/contrib/python/fonttools/fontTools/ttLib/scaleUpem.py
index 3f9b22af8f9..2909bfcb2c1 100644
--- a/contrib/python/fonttools/fontTools/ttLib/scaleUpem.py
+++ b/contrib/python/fonttools/fontTools/ttLib/scaleUpem.py
@@ -3,7 +3,6 @@
AAT and Graphite tables are not supported. CFF/CFF2 fonts
are de-subroutinized."""
-
from fontTools.ttLib.ttVisitor import TTVisitor
import fontTools.ttLib as ttLib
import fontTools.ttLib.tables.otBase as otBase
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/C_O_L_R_.py b/contrib/python/fonttools/fontTools/ttLib/tables/C_O_L_R_.py
index 2f03ec054fe..df857842cc3 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/C_O_L_R_.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/C_O_L_R_.py
@@ -7,7 +7,6 @@ from . import DefaultTable
class table_C_O_L_R_(DefaultTable.DefaultTable):
-
"""This table is structured so that you can treat it like a dictionary keyed by glyph name.
``ttFont['COLR'][<glyphName>]`` will return the color layers for any glyph.
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/O_S_2f_2.py b/contrib/python/fonttools/fontTools/ttLib/tables/O_S_2f_2.py
index edff91f58de..0c739bcc444 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/O_S_2f_2.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/O_S_2f_2.py
@@ -113,7 +113,6 @@ OS2_format_5_addition = bigendian + OS2_format_5_addition
class table_O_S_2f_2(DefaultTable.DefaultTable):
-
"""the OS/2 table"""
dependencies = ["head"]
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__0.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__0.py
index f15fc67bce3..77905822a8a 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__0.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__0.py
@@ -5,6 +5,7 @@ TSI0 is the index table containing the lengths and offsets for the glyph
programs and 'extra' programs ('fpgm', 'prep', and 'cvt') that are contained
in the TSI1 table.
"""
+
from . import DefaultTable
import struct
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__1.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__1.py
index 55aca33991b..a9d04a09b02 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__1.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__1.py
@@ -4,6 +4,7 @@ tool to store its hinting source data.
TSI1 contains the text of the glyph programs in the form of low-level assembly
code, as well as the 'extra' programs 'fpgm', 'ppgm' (i.e. 'prep'), and 'cvt'.
"""
+
from . import DefaultTable
from fontTools.misc.loggingTools import LogMixin
from fontTools.misc.textTools import strjoin, tobytes, tostr
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__2.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__2.py
index 4278be15564..163ef45226d 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__2.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__2.py
@@ -5,6 +5,7 @@ TSI2 is the index table containing the lengths and offsets for the glyph
programs that are contained in the TSI3 table. It uses the same format as
the TSI0 table.
"""
+
from fontTools import ttLib
superclass = ttLib.getTableClass("TSI0")
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__3.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__3.py
index 785ca23152f..604a7f0bebb 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__3.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__3.py
@@ -3,6 +3,7 @@ tool to store its hinting source data.
TSI3 contains the text of the glyph programs in the form of 'VTTTalk' code.
"""
+
from fontTools import ttLib
superclass = ttLib.getTableClass("TSI1")
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__5.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__5.py
index 5edc86a9cbc..d86798695ca 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__5.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__5.py
@@ -3,6 +3,7 @@ tool to store its hinting source data.
TSI5 contains the VTT character groups.
"""
+
from fontTools.misc.textTools import safeEval
from . import DefaultTable
import sys
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/TupleVariation.py b/contrib/python/fonttools/fontTools/ttLib/tables/TupleVariation.py
index 30d009906d7..027ac15342d 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/TupleVariation.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/TupleVariation.py
@@ -517,22 +517,22 @@ class TupleVariation(object):
return # no change
coordWidth = self.getCoordWidth()
self.coordinates = [
- None
- if d is None
- else d * scalar
- if coordWidth == 1
- else (d[0] * scalar, d[1] * scalar)
+ (
+ None
+ if d is None
+ else d * scalar if coordWidth == 1 else (d[0] * scalar, d[1] * scalar)
+ )
for d in self.coordinates
]
def roundDeltas(self):
coordWidth = self.getCoordWidth()
self.coordinates = [
- None
- if d is None
- else otRound(d)
- if coordWidth == 1
- else (otRound(d[0]), otRound(d[1]))
+ (
+ None
+ if d is None
+ else otRound(d) if coordWidth == 1 else (otRound(d[0]), otRound(d[1]))
+ )
for d in self.coordinates
]
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/V_O_R_G_.py b/contrib/python/fonttools/fontTools/ttLib/tables/V_O_R_G_.py
index 4508c137d6f..b08737b224b 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/V_O_R_G_.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/V_O_R_G_.py
@@ -4,7 +4,6 @@ import struct
class table_V_O_R_G_(DefaultTable.DefaultTable):
-
"""This table is structured so that you can treat it like a dictionary keyed by glyph name.
``ttFont['VORG'][<glyphName>]`` will return the vertical origin for any glyph.
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_k_e_r_n.py b/contrib/python/fonttools/fontTools/ttLib/tables/_k_e_r_n.py
index 8f55a311cd1..270b3b7e445 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/_k_e_r_n.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/_k_e_r_n.py
@@ -147,9 +147,9 @@ class KernTable_format_0(object):
except IndexError:
# Slower, but will not throw an IndexError on an invalid
# glyph id.
- kernTable[
- (ttFont.getGlyphName(left), ttFont.getGlyphName(right))
- ] = value
+ kernTable[(ttFont.getGlyphName(left), ttFont.getGlyphName(right))] = (
+ value
+ )
if len(data) > 6 * nPairs + 4: # Ignore up to 4 bytes excess
log.warning(
"excess data in 'kern' subtable: %d bytes", len(data) - 6 * nPairs
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/otBase.py b/contrib/python/fonttools/fontTools/ttLib/tables/otBase.py
index d565603b1f0..53abd13b48c 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/otBase.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/otBase.py
@@ -79,7 +79,6 @@ class RepackerState(IntEnum):
class BaseTTXConverter(DefaultTable):
-
"""Generic base class for TTX table converters. It functions as an
adapter between the TTX (ttLib actually) table model and the model
we use for OpenType tables, which is necessarily subtly different.
@@ -260,7 +259,6 @@ assert array.array("i").itemsize == 4, "Oops, file a bug against fonttools."
class OTTableReader(object):
-
"""Helper class to retrieve data from an OpenType table."""
__slots__ = ("data", "offset", "pos", "localState", "tableTag")
@@ -392,7 +390,6 @@ class OffsetToWriter(object):
class OTTableWriter(object):
-
"""Helper class to gather and assemble data for OpenType tables."""
def __init__(self, localState=None, tableTag=None):
@@ -882,7 +879,6 @@ def packUInt24(value):
class BaseTable(object):
-
"""Generic base class for all OpenType (sub)tables."""
def __getattr__(self, attr):
@@ -1210,7 +1206,6 @@ class BaseTable(object):
class FormatSwitchingBaseTable(BaseTable):
-
"""Minor specialization of BaseTable, for tables that have multiple
formats, eg. CoverageFormat1 vs. CoverageFormat2."""
@@ -1335,7 +1330,6 @@ valueRecordFormatDict = _buildDict()
class ValueRecordFactory(object):
-
"""Given a format code, this object convert ValueRecords."""
def __init__(self, valueFormat):
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/otConverters.py b/contrib/python/fonttools/fontTools/ttLib/tables/otConverters.py
index 390f1660e8f..afe4e538f43 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/otConverters.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/otConverters.py
@@ -146,7 +146,6 @@ class _LazyList(UserList):
class BaseConverter(object):
-
"""Base class for converter objects. Apart from the constructor, this
is an abstract class."""
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/otTables.py b/contrib/python/fonttools/fontTools/ttLib/tables/otTables.py
index 262f8d41876..3505f42337d 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/otTables.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/otTables.py
@@ -1123,6 +1123,35 @@ class LigatureSubst(FormatSwitchingBaseTable):
self.ligatures = ligatures
del self.Format # Don't need this anymore
+ @staticmethod
+ def _getLigatureSortKey(components):
+ # Computes a key for ordering ligatures in a GSUB Type-4 lookup.
+
+ # When building the OpenType lookup, we need to make sure that
+ # the longest sequence of components is listed first, so we
+ # use the negative length as the key for sorting.
+ # Note, we no longer need to worry about deterministic order because the
+ # ligature mapping `dict` remembers the insertion order, and this in
+ # turn depends on the order in which the ligatures are written in the FEA.
+ # Since python sort algorithm is stable, the ligatures of equal length
+ # will keep the relative order in which they appear in the feature file.
+ # For example, given the following ligatures (all starting with 'f' and
+ # thus belonging to the same LigatureSet):
+ #
+ # feature liga {
+ # sub f i by f_i;
+ # sub f f f by f_f_f;
+ # sub f f by f_f;
+ # sub f f i by f_f_i;
+ # } liga;
+ #
+ # this should sort to: f_f_f, f_f_i, f_i, f_f
+ # This is also what fea-rs does, see:
+ # https://github.com/adobe-type-tools/afdko/issues/1727
+ # https://github.com/fonttools/fonttools/issues/3428
+ # https://github.com/googlefonts/fontc/pull/680
+ return -len(components)
+
def preWrite(self, font):
self.Format = 1
ligatures = getattr(self, "ligatures", None)
@@ -1135,13 +1164,11 @@ class LigatureSubst(FormatSwitchingBaseTable):
# ligatures is map from components-sequence to lig-glyph
newLigatures = dict()
- for comps, lig in sorted(
- ligatures.items(), key=lambda item: (-len(item[0]), item[0])
- ):
+ for comps in sorted(ligatures.keys(), key=self._getLigatureSortKey):
ligature = Ligature()
ligature.Component = comps[1:]
ligature.CompCount = len(comps)
- ligature.LigGlyph = lig
+ ligature.LigGlyph = ligatures[comps]
newLigatures.setdefault(comps[0], []).append(ligature)
ligatures = newLigatures
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/otTraverse.py b/contrib/python/fonttools/fontTools/ttLib/tables/otTraverse.py
index bf22dcfdb50..ac942187235 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/otTraverse.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/otTraverse.py
@@ -1,4 +1,5 @@
"""Methods for traversing trees of otData-driven OpenType tables."""
+
from collections import deque
from typing import Callable, Deque, Iterable, List, Optional, Tuple
from .otBase import BaseTable
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/sbixGlyph.py b/contrib/python/fonttools/fontTools/ttLib/tables/sbixGlyph.py
index fd687a18808..b744a2a3bc8 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/sbixGlyph.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/sbixGlyph.py
@@ -54,6 +54,10 @@ class Glyph(object):
# pad with spaces
self.graphicType += " "[: (4 - len(self.graphicType))]
+ def is_reference_type(self):
+ """Returns True if this glyph is a reference to another glyph's image data."""
+ return self.graphicType == "dupe" or self.graphicType == "flip"
+
def decompile(self, ttFont):
self.glyphName = ttFont.getGlyphName(self.gid)
if self.rawdata is None:
@@ -71,7 +75,7 @@ class Glyph(object):
sbixGlyphHeaderFormat, self.rawdata[:sbixGlyphHeaderFormatSize], self
)
- if self.graphicType == "dupe":
+ if self.is_reference_type():
# this glyph is a reference to another glyph's image data
(gid,) = struct.unpack(">H", self.rawdata[sbixGlyphHeaderFormatSize:])
self.referenceGlyphName = ttFont.getGlyphName(gid)
@@ -94,7 +98,7 @@ class Glyph(object):
rawdata = b""
else:
rawdata = sstruct.pack(sbixGlyphHeaderFormat, self)
- if self.graphicType == "dupe":
+ if self.is_reference_type():
rawdata += struct.pack(">H", ttFont.getGlyphID(self.referenceGlyphName))
else:
assert self.imageData is not None
@@ -117,8 +121,8 @@ class Glyph(object):
originOffsetY=self.originOffsetY,
)
xmlWriter.newline()
- if self.graphicType == "dupe":
- # graphicType == "dupe" is a reference to another glyph id.
+ if self.is_reference_type():
+ # this glyph is a reference to another glyph id.
xmlWriter.simpletag("ref", glyphname=self.referenceGlyphName)
else:
xmlWriter.begintag("hexdata")
@@ -131,7 +135,7 @@ class Glyph(object):
def fromXML(self, name, attrs, content, ttFont):
if name == "ref":
- # glyph is a "dupe", i.e. a reference to another glyph's image data.
+ # this glyph i.e. a reference to another glyph's image data.
# in this case imageData contains the glyph id of the reference glyph
# get glyph id from glyphname
glyphname = safeEval("'''" + attrs["glyphname"] + "'''")
diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/ttProgram.py b/contrib/python/fonttools/fontTools/ttLib/tables/ttProgram.py
index 84aa63f3630..32a4ec8b20f 100644
--- a/contrib/python/fonttools/fontTools/ttLib/tables/ttProgram.py
+++ b/contrib/python/fonttools/fontTools/ttLib/tables/ttProgram.py
@@ -1,4 +1,5 @@
"""ttLib.tables.ttProgram.py -- Assembler/disassembler for TrueType bytecode programs."""
+
from __future__ import annotations
from fontTools.misc.textTools import num2binary, binary2num, readHex, strjoin
diff --git a/contrib/python/fonttools/fontTools/ttLib/ttCollection.py b/contrib/python/fonttools/fontTools/ttLib/ttCollection.py
index 70ed4b7a0db..f01bc42be31 100644
--- a/contrib/python/fonttools/fontTools/ttLib/ttCollection.py
+++ b/contrib/python/fonttools/fontTools/ttLib/ttCollection.py
@@ -8,7 +8,6 @@ log = logging.getLogger(__name__)
class TTCollection(object):
-
"""Object representing a TrueType Collection / OpenType Collection.
The main API is self.fonts being a list of TTFont instances.
diff --git a/contrib/python/fonttools/fontTools/ttLib/ttFont.py b/contrib/python/fonttools/fontTools/ttLib/ttFont.py
index c8c74fecfef..ad62a187de1 100644
--- a/contrib/python/fonttools/fontTools/ttLib/ttFont.py
+++ b/contrib/python/fonttools/fontTools/ttLib/ttFont.py
@@ -15,7 +15,6 @@ log = logging.getLogger(__name__)
class TTFont(object):
-
"""Represents a TrueType font.
The object manages file input and output, and offers a convenient way of
@@ -843,7 +842,6 @@ class TTFont(object):
class GlyphOrder(object):
-
"""A pseudo table. The glyph order isn't in the font as a separate
table, but it's nice to present it as such in the TTX format.
"""
diff --git a/contrib/python/fonttools/fontTools/ttLib/ttGlyphSet.py b/contrib/python/fonttools/fontTools/ttLib/ttGlyphSet.py
index 5d188d6a105..b4beb3e7661 100644
--- a/contrib/python/fonttools/fontTools/ttLib/ttGlyphSet.py
+++ b/contrib/python/fonttools/fontTools/ttLib/ttGlyphSet.py
@@ -17,7 +17,6 @@ from fontTools.pens.recordingPen import (
class _TTGlyphSet(Mapping):
-
"""Generic dict-like GlyphSet class that pulls metrics from hmtx and
glyph shape from TrueType or CFF.
"""
@@ -125,7 +124,6 @@ class _TTGlyphSetCFF(_TTGlyphSet):
class _TTGlyph(ABC):
-
"""Glyph object that supports the Pen protocol, meaning that it has
.draw() and .drawPoints() methods that take a pen object as their only
argument. Additionally there are 'width' and 'lsb' attributes, read from
diff --git a/contrib/python/fonttools/fontTools/ttx.py b/contrib/python/fonttools/fontTools/ttx.py
index d8c2a3a7585..e7a068748ba 100644
--- a/contrib/python/fonttools/fontTools/ttx.py
+++ b/contrib/python/fonttools/fontTools/ttx.py
@@ -103,7 +103,6 @@ Compile options
extension is available at https://pypi.python.org/pypi/zopfli
"""
-
from fontTools.ttLib import TTFont, TTLibError
from fontTools.misc.macCreatorType import getMacCreatorAndType
from fontTools.unicode import setUnicodeData
diff --git a/contrib/python/fonttools/fontTools/ufoLib/__init__.py b/contrib/python/fonttools/fontTools/ufoLib/__init__.py
index 1a456a206f8..c2d2b0b2666 100644
--- a/contrib/python/fonttools/fontTools/ufoLib/__init__.py
+++ b/contrib/python/fonttools/fontTools/ufoLib/__init__.py
@@ -197,7 +197,6 @@ class _UFOBaseIO:
class UFOReader(_UFOBaseIO):
-
"""
Read the various components of the .ufo.
@@ -881,7 +880,6 @@ class UFOReader(_UFOBaseIO):
class UFOWriter(UFOReader):
-
"""
Write the various components of the .ufo.
diff --git a/contrib/python/fonttools/fontTools/ufoLib/converters.py b/contrib/python/fonttools/fontTools/ufoLib/converters.py
index daccf782727..88a26c616a8 100644
--- a/contrib/python/fonttools/fontTools/ufoLib/converters.py
+++ b/contrib/python/fonttools/fontTools/ufoLib/converters.py
@@ -2,7 +2,6 @@
Conversion functions.
"""
-
# adapted from the UFO spec
diff --git a/contrib/python/fonttools/fontTools/ufoLib/etree.py b/contrib/python/fonttools/fontTools/ufoLib/etree.py
index 5054f8169a0..77e3c16e2b4 100644
--- a/contrib/python/fonttools/fontTools/ufoLib/etree.py
+++ b/contrib/python/fonttools/fontTools/ufoLib/etree.py
@@ -2,4 +2,5 @@
for the old ufoLib.etree module, which was moved to fontTools.misc.etree.
Please use the latter instead.
"""
+
from fontTools.misc.etree import *
diff --git a/contrib/python/fonttools/fontTools/ufoLib/glifLib.py b/contrib/python/fonttools/fontTools/ufoLib/glifLib.py
index 6dee9db302f..62e87db0df0 100644
--- a/contrib/python/fonttools/fontTools/ufoLib/glifLib.py
+++ b/contrib/python/fonttools/fontTools/ufoLib/glifLib.py
@@ -91,7 +91,6 @@ GLIFFormatVersion.__str__ = _VersionTupleEnumMixin.__str__
class Glyph:
-
"""
Minimal glyph object. It has no glyph attributes until either
the draw() or the drawPoints() method has been called.
@@ -123,7 +122,6 @@ class Glyph:
class GlyphSet(_UFOBaseIO):
-
"""
GlyphSet manages a set of .glif files inside one directory.
@@ -1228,9 +1226,9 @@ def _readGlyphFromTreeFormat2(
unicodes = []
guidelines = []
anchors = []
- haveSeenAdvance = (
- haveSeenImage
- ) = haveSeenOutline = haveSeenLib = haveSeenNote = False
+ haveSeenAdvance = haveSeenImage = haveSeenOutline = haveSeenLib = haveSeenNote = (
+ False
+ )
identifiers = set()
for element in tree:
if element.tag == "outline":
@@ -1883,7 +1881,6 @@ _transformationInfo = [
class GLIFPointPen(AbstractPointPen):
-
"""
Helper class using the PointPen protocol to write the <outline>
part of .glif files.
diff --git a/contrib/python/fonttools/fontTools/ufoLib/plistlib.py b/contrib/python/fonttools/fontTools/ufoLib/plistlib.py
index 1f52f20a2b4..38bb266b21d 100644
--- a/contrib/python/fonttools/fontTools/ufoLib/plistlib.py
+++ b/contrib/python/fonttools/fontTools/ufoLib/plistlib.py
@@ -2,6 +2,7 @@
for the old ufoLib.plistlib module, which was moved to fontTools.misc.plistlib.
Please use the latter instead.
"""
+
from fontTools.misc.plistlib import dump, dumps, load, loads
from fontTools.misc.textTools import tobytes
diff --git a/contrib/python/fonttools/fontTools/ufoLib/pointPen.py b/contrib/python/fonttools/fontTools/ufoLib/pointPen.py
index 3433fdbc96c..baef9a583ec 100644
--- a/contrib/python/fonttools/fontTools/ufoLib/pointPen.py
+++ b/contrib/python/fonttools/fontTools/ufoLib/pointPen.py
@@ -2,4 +2,5 @@
for the old ufoLib.pointPen module, which was moved to fontTools.pens.pointPen.
Please use the latter instead.
"""
+
from fontTools.pens.pointPen import *
diff --git a/contrib/python/fonttools/fontTools/ufoLib/utils.py b/contrib/python/fonttools/fontTools/ufoLib/utils.py
index 85878b47a11..45ec1c564b7 100644
--- a/contrib/python/fonttools/fontTools/ufoLib/utils.py
+++ b/contrib/python/fonttools/fontTools/ufoLib/utils.py
@@ -1,6 +1,7 @@
"""The module contains miscellaneous helpers.
It's not considered part of the public ufoLib API.
"""
+
import warnings
import functools
diff --git a/contrib/python/fonttools/fontTools/unicodedata/__init__.py b/contrib/python/fonttools/fontTools/unicodedata/__init__.py
index 808c9c722ec..06eb4619a93 100644
--- a/contrib/python/fonttools/fontTools/unicodedata/__init__.py
+++ b/contrib/python/fonttools/fontTools/unicodedata/__init__.py
@@ -201,15 +201,13 @@ T = TypeVar("T")
@overload
-def script_horizontal_direction(script_code: str, default: T) -> HorizDirection | T:
- ...
+def script_horizontal_direction(script_code: str, default: T) -> HorizDirection | T: ...
@overload
def script_horizontal_direction(
script_code: str, default: type[KeyError] = KeyError
-) -> HorizDirection:
- ...
+) -> HorizDirection: ...
def script_horizontal_direction(
diff --git a/contrib/python/fonttools/fontTools/varLib/__init__.py b/contrib/python/fonttools/fontTools/varLib/__init__.py
index 46834f64336..1e0f2ec2f46 100644
--- a/contrib/python/fonttools/fontTools/varLib/__init__.py
+++ b/contrib/python/fonttools/fontTools/varLib/__init__.py
@@ -18,6 +18,7 @@ Then you can make a variable-font this way:
API *will* change in near future.
"""
+
from typing import List
from fontTools.misc.vector import Vector
from fontTools.misc.roundTools import noRound, otRound
@@ -216,8 +217,6 @@ def _add_avar(font, axes, mappings, axisTags):
if mappings:
interesting = True
- hiddenAxes = [axis for axis in axes.values() if axis.hidden]
-
inputLocations = [
{
axes[name].tag: models.normalizeValue(v, vals_triples[axes[name].tag])
@@ -571,9 +570,11 @@ def _get_advance_metrics(
sparse_advance = 0xFFFF
for glyph in glyphOrder:
vhAdvances = [
- metrics[glyph][0]
- if glyph in metrics and metrics[glyph][0] != sparse_advance
- else None
+ (
+ metrics[glyph][0]
+ if glyph in metrics and metrics[glyph][0] != sparse_advance
+ else None
+ )
for metrics in advMetricses
]
vhAdvanceDeltasAndSupports[glyph] = masterModel.getDeltasAndSupports(
@@ -752,10 +753,14 @@ def _add_BASE(font, masterModel, master_ttfs, axisTags):
def _merge_OTL(font, model, master_fonts, axisTags):
+ otl_tags = ["GSUB", "GDEF", "GPOS"]
+ if not any(tag in font for tag in otl_tags):
+ return
+
log.info("Merging OpenType Layout tables")
merger = VariationMerger(model, axisTags, font)
- merger.mergeTables(font, master_fonts, ["GSUB", "GDEF", "GPOS"])
+ merger.mergeTables(font, master_fonts, otl_tags)
store = merger.store_builder.finish()
if not store:
return
diff --git a/contrib/python/fonttools/fontTools/varLib/featureVars.py b/contrib/python/fonttools/fontTools/varLib/featureVars.py
index 828b843594c..2e957f55859 100644
--- a/contrib/python/fonttools/fontTools/varLib/featureVars.py
+++ b/contrib/python/fonttools/fontTools/varLib/featureVars.py
@@ -3,6 +3,7 @@ https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#featurevariat
NOTE: The API is experimental and subject to change.
"""
+
from fontTools.misc.dictTools import hashdict
from fontTools.misc.intTools import bit_count
from fontTools.ttLib import newTable
diff --git a/contrib/python/fonttools/fontTools/varLib/instancer/__init__.py b/contrib/python/fonttools/fontTools/varLib/instancer/__init__.py
index d1cde0df7a9..89427dc5347 100644
--- a/contrib/python/fonttools/fontTools/varLib/instancer/__init__.py
+++ b/contrib/python/fonttools/fontTools/varLib/instancer/__init__.py
@@ -82,6 +82,7 @@ are supported, but support for CFF2 variable fonts will be added soon.
The discussion and implementation of these features are tracked at
https://github.com/fonttools/fonttools/issues/1537
"""
+
from fontTools.misc.fixedTools import (
floatToFixedToFloat,
strToFixedToFloat,
@@ -614,7 +615,7 @@ def _instantiateGvarGlyph(
if optimize:
isComposite = glyf[glyphname].isComposite()
for var in tupleVarStore:
- var.optimize(coordinates, endPts, isComposite)
+ var.optimize(coordinates, endPts, isComposite=isComposite)
def instantiateGvarGlyph(varfont, glyphname, axisLimits, optimize=True):
@@ -643,9 +644,11 @@ def instantiateGvar(varfont, axisLimits, optimize=True):
glyphnames = sorted(
glyf.glyphOrder,
key=lambda name: (
- glyf[name].getCompositeMaxpValues(glyf).maxComponentDepth
- if glyf[name].isComposite() or glyf[name].isVarComposite()
- else 0,
+ (
+ glyf[name].getCompositeMaxpValues(glyf).maxComponentDepth
+ if glyf[name].isComposite() or glyf[name].isVarComposite()
+ else 0
+ ),
name,
),
)
diff --git a/contrib/python/fonttools/fontTools/varLib/interpolate_layout.py b/contrib/python/fonttools/fontTools/varLib/interpolate_layout.py
index aa3f49c6ed0..798b29590d3 100644
--- a/contrib/python/fonttools/fontTools/varLib/interpolate_layout.py
+++ b/contrib/python/fonttools/fontTools/varLib/interpolate_layout.py
@@ -1,6 +1,7 @@
"""
Interpolate OpenType Layout tables (GDEF / GPOS / GSUB).
"""
+
from fontTools.ttLib import TTFont
from fontTools.varLib import models, VarLibError, load_designspace, load_masters
from fontTools.varLib.merger import InstancerMerger
diff --git a/contrib/python/fonttools/fontTools/varLib/merger.py b/contrib/python/fonttools/fontTools/varLib/merger.py
index 96029166a79..61122f4c67a 100644
--- a/contrib/python/fonttools/fontTools/varLib/merger.py
+++ b/contrib/python/fonttools/fontTools/varLib/merger.py
@@ -1,6 +1,7 @@
"""
Merge OpenType Layout tables (GDEF / GPOS / GSUB).
"""
+
import os
import copy
import enum
diff --git a/contrib/python/fonttools/fontTools/varLib/mutator.py b/contrib/python/fonttools/fontTools/varLib/mutator.py
index d1d123ab690..c7c37dabcab 100644
--- a/contrib/python/fonttools/fontTools/varLib/mutator.py
+++ b/contrib/python/fonttools/fontTools/varLib/mutator.py
@@ -3,6 +3,7 @@ Instantiate a variation font. Run, eg:
$ fonttools varLib.mutator ./NotoSansArabic-VF.ttf wght=140 wdth=85
"""
+
from fontTools.misc.fixedTools import floatToFixedToFloat, floatToFixed
from fontTools.misc.roundTools import otRound
from fontTools.pens.boundsPen import BoundsPen
@@ -198,9 +199,11 @@ def instantiateVariableFont(varfont, location, inplace=False, overlap=True):
glyphnames = sorted(
gvar.variations.keys(),
key=lambda name: (
- glyf[name].getCompositeMaxpValues(glyf).maxComponentDepth
- if glyf[name].isComposite() or glyf[name].isVarComposite()
- else 0,
+ (
+ glyf[name].getCompositeMaxpValues(glyf).maxComponentDepth
+ if glyf[name].isComposite() or glyf[name].isVarComposite()
+ else 0
+ ),
name,
),
)
@@ -304,9 +307,9 @@ def instantiateVariableFont(varfont, location, inplace=False, overlap=True):
if applies:
assert record.FeatureTableSubstitution.Version == 0x00010000
for rec in record.FeatureTableSubstitution.SubstitutionRecord:
- table.FeatureList.FeatureRecord[
- rec.FeatureIndex
- ].Feature = rec.Feature
+ table.FeatureList.FeatureRecord[rec.FeatureIndex].Feature = (
+ rec.Feature
+ )
break
del table.FeatureVariations
diff --git a/contrib/python/fonttools/ya.make b/contrib/python/fonttools/ya.make
index 4d380b556cb..e5986f9d036 100644
--- a/contrib/python/fonttools/ya.make
+++ b/contrib/python/fonttools/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(4.47.2)
+VERSION(4.49.0)
LICENSE(MIT)
@@ -41,6 +41,7 @@ PY_SRCS(
fontTools/cu2qu/errors.py
fontTools/cu2qu/ufo.py
fontTools/designspaceLib/__init__.py
+ fontTools/designspaceLib/__main__.py
fontTools/designspaceLib/split.py
fontTools/designspaceLib/statNames.py
fontTools/designspaceLib/types.py
diff --git a/contrib/python/google-auth/py3/.dist-info/METADATA b/contrib/python/google-auth/py3/.dist-info/METADATA
index 48bac82c9db..c8e96994cf3 100644
--- a/contrib/python/google-auth/py3/.dist-info/METADATA
+++ b/contrib/python/google-auth/py3/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: google-auth
-Version: 2.27.0
+Version: 2.28.0
Summary: Google Authentication Library
Home-page: https://github.com/googleapis/google-auth-library-python
Author: Google Cloud Platform
diff --git a/contrib/python/google-auth/py3/google/auth/compute_engine/_metadata.py b/contrib/python/google-auth/py3/google/auth/compute_engine/_metadata.py
index 1c884c3c43e..108cbfe9329 100644
--- a/contrib/python/google-auth/py3/google/auth/compute_engine/_metadata.py
+++ b/contrib/python/google-auth/py3/google/auth/compute_engine/_metadata.py
@@ -222,7 +222,7 @@ def get(
content = _helpers.from_bytes(response.data)
if response.status == http_client.NOT_FOUND and return_none_for_not_found_error:
- _LOGGER.info(
+ _LOGGER.debug(
"Compute Engine Metadata server call to %s returned 404, reason: %s",
path,
content,
diff --git a/contrib/python/google-auth/py3/google/auth/compute_engine/credentials.py b/contrib/python/google-auth/py3/google/auth/compute_engine/credentials.py
index 7541c1d8cfa..008b991bb95 100644
--- a/contrib/python/google-auth/py3/google/auth/compute_engine/credentials.py
+++ b/contrib/python/google-auth/py3/google/auth/compute_engine/credentials.py
@@ -28,7 +28,6 @@ from google.auth import iam
from google.auth import jwt
from google.auth import metrics
from google.auth.compute_engine import _metadata
-from google.auth.transport import requests as google_auth_requests
from google.oauth2 import _client
@@ -84,7 +83,6 @@ class Credentials(
self._scopes = scopes
self._default_scopes = default_scopes
self._universe_domain_cached = False
- self._universe_domain_request = google_auth_requests.Request()
if universe_domain:
self._universe_domain = universe_domain
self._universe_domain_cached = True
@@ -150,8 +148,11 @@ class Credentials(
def universe_domain(self):
if self._universe_domain_cached:
return self._universe_domain
+
+ from google.auth.transport import requests as google_auth_requests
+
self._universe_domain = _metadata.get_universe_domain(
- self._universe_domain_request
+ google_auth_requests.Request()
)
self._universe_domain_cached = True
return self._universe_domain
diff --git a/contrib/python/google-auth/py3/google/auth/credentials.py b/contrib/python/google-auth/py3/google/auth/credentials.py
index a4fa1829c72..27abd443dc0 100644
--- a/contrib/python/google-auth/py3/google/auth/credentials.py
+++ b/contrib/python/google-auth/py3/google/auth/credentials.py
@@ -24,6 +24,8 @@ from google.auth import exceptions
from google.auth import metrics
from google.auth._refresh_worker import RefreshThreadManager
+DEFAULT_UNIVERSE_DOMAIN = "googleapis.com"
+
class Credentials(metaclass=abc.ABCMeta):
"""Base class for all credentials.
@@ -57,7 +59,7 @@ class Credentials(metaclass=abc.ABCMeta):
"""Optional[dict]: Cache of a trust boundary response which has a list
of allowed regions and an encoded string representation of credentials
trust boundary."""
- self._universe_domain = "googleapis.com"
+ self._universe_domain = DEFAULT_UNIVERSE_DOMAIN
"""Optional[str]: The universe domain value, default is googleapis.com
"""
diff --git a/contrib/python/google-auth/py3/google/auth/downscoped.py b/contrib/python/google-auth/py3/google/auth/downscoped.py
index b4d9d386e50..ea75be90fe4 100644
--- a/contrib/python/google-auth/py3/google/auth/downscoped.py
+++ b/contrib/python/google-auth/py3/google/auth/downscoped.py
@@ -63,7 +63,7 @@ _STS_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:token-exchange"
# The token exchange requested_token_type. This is always an access_token.
_STS_REQUESTED_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:access_token"
# The STS token URL used to exchanged a short lived access token for a downscoped one.
-_STS_TOKEN_URL = "https://sts.googleapis.com/v1/token"
+_STS_TOKEN_URL_PATTERN = "https://sts.{}/v1/token"
# The subject token type to use when exchanging a short lived access token for a
# downscoped token.
_STS_SUBJECT_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:access_token"
@@ -437,7 +437,11 @@ class Credentials(credentials.CredentialsWithQuotaProject):
"""
def __init__(
- self, source_credentials, credential_access_boundary, quota_project_id=None
+ self,
+ source_credentials,
+ credential_access_boundary,
+ quota_project_id=None,
+ universe_domain=credentials.DEFAULT_UNIVERSE_DOMAIN,
):
"""Instantiates a downscoped credentials object using the provided source
credentials and credential access boundary rules.
@@ -456,6 +460,7 @@ class Credentials(credentials.CredentialsWithQuotaProject):
the upper bound of the permissions that are available on that resource and an
optional condition to further restrict permissions.
quota_project_id (Optional[str]): The optional quota project ID.
+ universe_domain (Optional[str]): The universe domain value, default is googleapis.com
Raises:
google.auth.exceptions.RefreshError: If the source credentials
return an error on token refresh.
@@ -467,7 +472,10 @@ class Credentials(credentials.CredentialsWithQuotaProject):
self._source_credentials = source_credentials
self._credential_access_boundary = credential_access_boundary
self._quota_project_id = quota_project_id
- self._sts_client = sts.Client(_STS_TOKEN_URL)
+ self._universe_domain = universe_domain or credentials.DEFAULT_UNIVERSE_DOMAIN
+ self._sts_client = sts.Client(
+ _STS_TOKEN_URL_PATTERN.format(self.universe_domain)
+ )
@_helpers.copy_docstring(credentials.Credentials)
def refresh(self, request):
diff --git a/contrib/python/google-auth/py3/google/auth/external_account.py b/contrib/python/google-auth/py3/google/auth/external_account.py
index c314ea799ea..0420883f86b 100644
--- a/contrib/python/google-auth/py3/google/auth/external_account.py
+++ b/contrib/python/google-auth/py3/google/auth/external_account.py
@@ -51,8 +51,6 @@ _STS_REQUESTED_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:access_token"
# Cloud resource manager URL used to retrieve project information.
_CLOUD_RESOURCE_MANAGER = "https://cloudresourcemanager.googleapis.com/v1/projects/"
-_DEFAULT_UNIVERSE_DOMAIN = "googleapis.com"
-
class Credentials(
credentials.Scoped,
@@ -83,7 +81,7 @@ class Credentials(
scopes=None,
default_scopes=None,
workforce_pool_user_project=None,
- universe_domain=_DEFAULT_UNIVERSE_DOMAIN,
+ universe_domain=credentials.DEFAULT_UNIVERSE_DOMAIN,
trust_boundary=None,
):
"""Instantiates an external account credentials object.
@@ -131,7 +129,7 @@ class Credentials(
self._scopes = scopes
self._default_scopes = default_scopes
self._workforce_pool_user_project = workforce_pool_user_project
- self._universe_domain = universe_domain or _DEFAULT_UNIVERSE_DOMAIN
+ self._universe_domain = universe_domain or credentials.DEFAULT_UNIVERSE_DOMAIN
self._trust_boundary = {
"locations": [],
"encoded_locations": "0x0",
@@ -513,7 +511,9 @@ class Credentials(
credential_source=info.get("credential_source"),
quota_project_id=info.get("quota_project_id"),
workforce_pool_user_project=info.get("workforce_pool_user_project"),
- universe_domain=info.get("universe_domain", _DEFAULT_UNIVERSE_DOMAIN),
+ universe_domain=info.get(
+ "universe_domain", credentials.DEFAULT_UNIVERSE_DOMAIN
+ ),
**kwargs
)
diff --git a/contrib/python/google-auth/py3/google/auth/external_account_authorized_user.py b/contrib/python/google-auth/py3/google/auth/external_account_authorized_user.py
index 526588f7e85..f73387172c2 100644
--- a/contrib/python/google-auth/py3/google/auth/external_account_authorized_user.py
+++ b/contrib/python/google-auth/py3/google/auth/external_account_authorized_user.py
@@ -43,7 +43,6 @@ from google.auth import exceptions
from google.oauth2 import sts
from google.oauth2 import utils
-_DEFAULT_UNIVERSE_DOMAIN = "googleapis.com"
_EXTERNAL_ACCOUNT_AUTHORIZED_USER_JSON_TYPE = "external_account_authorized_user"
@@ -76,7 +75,7 @@ class Credentials(
revoke_url=None,
scopes=None,
quota_project_id=None,
- universe_domain=_DEFAULT_UNIVERSE_DOMAIN,
+ universe_domain=credentials.DEFAULT_UNIVERSE_DOMAIN,
):
"""Instantiates a external account authorized user credentials object.
@@ -120,7 +119,7 @@ class Credentials(
self._revoke_url = revoke_url
self._quota_project_id = quota_project_id
self._scopes = scopes
- self._universe_domain = universe_domain or _DEFAULT_UNIVERSE_DOMAIN
+ self._universe_domain = universe_domain or credentials.DEFAULT_UNIVERSE_DOMAIN
if not self.valid and not self.can_refresh:
raise exceptions.InvalidOperation(
@@ -342,7 +341,9 @@ class Credentials(
revoke_url=info.get("revoke_url"),
quota_project_id=info.get("quota_project_id"),
scopes=info.get("scopes"),
- universe_domain=info.get("universe_domain", _DEFAULT_UNIVERSE_DOMAIN),
+ universe_domain=info.get(
+ "universe_domain", credentials.DEFAULT_UNIVERSE_DOMAIN
+ ),
**kwargs
)
diff --git a/contrib/python/google-auth/py3/google/auth/version.py b/contrib/python/google-auth/py3/google/auth/version.py
index e1fa722c811..9672a6c4127 100644
--- a/contrib/python/google-auth/py3/google/auth/version.py
+++ b/contrib/python/google-auth/py3/google/auth/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "2.27.0"
+__version__ = "2.28.0"
diff --git a/contrib/python/google-auth/py3/google/oauth2/credentials.py b/contrib/python/google-auth/py3/google/oauth2/credentials.py
index c239beed134..5ca00d4c5a5 100644
--- a/contrib/python/google-auth/py3/google/oauth2/credentials.py
+++ b/contrib/python/google-auth/py3/google/oauth2/credentials.py
@@ -49,7 +49,6 @@ _LOGGER = logging.getLogger(__name__)
# The Google OAuth 2.0 token endpoint. Used for authorized user credentials.
_GOOGLE_OAUTH2_TOKEN_ENDPOINT = "https://oauth2.googleapis.com/token"
-_DEFAULT_UNIVERSE_DOMAIN = "googleapis.com"
class Credentials(credentials.ReadOnlyScoped, credentials.CredentialsWithQuotaProject):
@@ -86,7 +85,7 @@ class Credentials(credentials.ReadOnlyScoped, credentials.CredentialsWithQuotaPr
enable_reauth_refresh=False,
granted_scopes=None,
trust_boundary=None,
- universe_domain=_DEFAULT_UNIVERSE_DOMAIN,
+ universe_domain=credentials.DEFAULT_UNIVERSE_DOMAIN,
account=None,
):
"""
@@ -150,7 +149,7 @@ class Credentials(credentials.ReadOnlyScoped, credentials.CredentialsWithQuotaPr
self.refresh_handler = refresh_handler
self._enable_reauth_refresh = enable_reauth_refresh
self._trust_boundary = trust_boundary
- self._universe_domain = universe_domain or _DEFAULT_UNIVERSE_DOMAIN
+ self._universe_domain = universe_domain or credentials.DEFAULT_UNIVERSE_DOMAIN
self._account = account or ""
def __getstate__(self):
@@ -187,7 +186,9 @@ class Credentials(credentials.ReadOnlyScoped, credentials.CredentialsWithQuotaPr
self._rapt_token = d.get("_rapt_token")
self._enable_reauth_refresh = d.get("_enable_reauth_refresh")
self._trust_boundary = d.get("_trust_boundary")
- self._universe_domain = d.get("_universe_domain") or _DEFAULT_UNIVERSE_DOMAIN
+ self._universe_domain = (
+ d.get("_universe_domain") or credentials.DEFAULT_UNIVERSE_DOMAIN
+ )
# The refresh_handler setter should be used to repopulate this.
self._refresh_handler = None
self._refresh_worker = None
@@ -373,7 +374,7 @@ class Credentials(credentials.ReadOnlyScoped, credentials.CredentialsWithQuotaPr
@_helpers.copy_docstring(credentials.Credentials)
def refresh(self, request):
- if self._universe_domain != _DEFAULT_UNIVERSE_DOMAIN:
+ if self._universe_domain != credentials.DEFAULT_UNIVERSE_DOMAIN:
raise exceptions.RefreshError(
"User credential refresh is only supported in the default "
"googleapis.com universe domain, but the current universe "
diff --git a/contrib/python/google-auth/py3/google/oauth2/service_account.py b/contrib/python/google-auth/py3/google/oauth2/service_account.py
index 4502c6f68c6..04fd7797ada 100644
--- a/contrib/python/google-auth/py3/google/oauth2/service_account.py
+++ b/contrib/python/google-auth/py3/google/oauth2/service_account.py
@@ -82,7 +82,6 @@ from google.auth import metrics
from google.oauth2 import _client
_DEFAULT_TOKEN_LIFETIME_SECS = 3600 # 1 hour in seconds
-_DEFAULT_UNIVERSE_DOMAIN = "googleapis.com"
_GOOGLE_OAUTH2_TOKEN_ENDPOINT = "https://oauth2.googleapis.com/token"
@@ -139,7 +138,7 @@ class Credentials(
quota_project_id=None,
additional_claims=None,
always_use_jwt_access=False,
- universe_domain=_DEFAULT_UNIVERSE_DOMAIN,
+ universe_domain=credentials.DEFAULT_UNIVERSE_DOMAIN,
trust_boundary=None,
):
"""
@@ -182,9 +181,9 @@ class Credentials(
self._quota_project_id = quota_project_id
self._token_uri = token_uri
self._always_use_jwt_access = always_use_jwt_access
- self._universe_domain = universe_domain or _DEFAULT_UNIVERSE_DOMAIN
+ self._universe_domain = universe_domain or credentials.DEFAULT_UNIVERSE_DOMAIN
- if universe_domain != _DEFAULT_UNIVERSE_DOMAIN:
+ if universe_domain != credentials.DEFAULT_UNIVERSE_DOMAIN:
self._always_use_jwt_access = True
self._jwt_credentials = None
@@ -216,7 +215,9 @@ class Credentials(
service_account_email=info["client_email"],
token_uri=info["token_uri"],
project_id=info.get("project_id"),
- universe_domain=info.get("universe_domain", _DEFAULT_UNIVERSE_DOMAIN),
+ universe_domain=info.get(
+ "universe_domain", credentials.DEFAULT_UNIVERSE_DOMAIN
+ ),
trust_boundary=info.get("trust_boundary"),
**kwargs
)
@@ -316,7 +317,7 @@ class Credentials(
"""
cred = self._make_copy()
if (
- cred._universe_domain != _DEFAULT_UNIVERSE_DOMAIN
+ cred._universe_domain != credentials.DEFAULT_UNIVERSE_DOMAIN
and not always_use_jwt_access
):
raise exceptions.InvalidValue(
@@ -329,7 +330,7 @@ class Credentials(
def with_universe_domain(self, universe_domain):
cred = self._make_copy()
cred._universe_domain = universe_domain
- if universe_domain != _DEFAULT_UNIVERSE_DOMAIN:
+ if universe_domain != credentials.DEFAULT_UNIVERSE_DOMAIN:
cred._always_use_jwt_access = True
return cred
@@ -427,7 +428,10 @@ class Credentials(
# created, try to create one with scopes
self._create_self_signed_jwt(None)
- if self._universe_domain != _DEFAULT_UNIVERSE_DOMAIN and self._subject:
+ if (
+ self._universe_domain != credentials.DEFAULT_UNIVERSE_DOMAIN
+ and self._subject
+ ):
raise exceptions.RefreshError(
"domain wide delegation is not supported for non-default universe domain"
)
@@ -556,7 +560,7 @@ class IDTokenCredentials(
target_audience,
additional_claims=None,
quota_project_id=None,
- universe_domain=_DEFAULT_UNIVERSE_DOMAIN,
+ universe_domain=credentials.DEFAULT_UNIVERSE_DOMAIN,
):
"""
Args:
@@ -588,11 +592,11 @@ class IDTokenCredentials(
self._use_iam_endpoint = False
if not universe_domain:
- self._universe_domain = _DEFAULT_UNIVERSE_DOMAIN
+ self._universe_domain = credentials.DEFAULT_UNIVERSE_DOMAIN
else:
self._universe_domain = universe_domain
- if universe_domain != _DEFAULT_UNIVERSE_DOMAIN:
+ if universe_domain != credentials.DEFAULT_UNIVERSE_DOMAIN:
self._use_iam_endpoint = True
if additional_claims is not None:
@@ -708,7 +712,10 @@ class IDTokenCredentials(
default and use_iam_endpoint is False.
"""
cred = self._make_copy()
- if cred._universe_domain != _DEFAULT_UNIVERSE_DOMAIN and not use_iam_endpoint:
+ if (
+ cred._universe_domain != credentials.DEFAULT_UNIVERSE_DOMAIN
+ and not use_iam_endpoint
+ ):
raise exceptions.InvalidValue(
"use_iam_endpoint should be True for non-default universe domain"
)
diff --git a/contrib/python/google-auth/py3/tests/compute_engine/test__metadata.py b/contrib/python/google-auth/py3/tests/compute_engine/test__metadata.py
index 5e037a940bd..35e3c089f90 100644
--- a/contrib/python/google-auth/py3/tests/compute_engine/test__metadata.py
+++ b/contrib/python/google-auth/py3/tests/compute_engine/test__metadata.py
@@ -400,6 +400,19 @@ def test_get_universe_domain_success():
assert universe_domain == "fake_universe_domain"
+def test_get_universe_domain_success_empty_response():
+ request = make_request("", headers={"content-type": "text/plain"})
+
+ universe_domain = _metadata.get_universe_domain(request)
+
+ request.assert_called_once_with(
+ method="GET",
+ url=_metadata._METADATA_ROOT + "universe/universe_domain",
+ headers=_metadata._METADATA_HEADERS,
+ )
+ assert universe_domain == "googleapis.com"
+
+
def test_get_universe_domain_not_found():
# Test that if the universe domain endpoint returns 404 error, we should
# use googleapis.com as the universe domain
diff --git a/contrib/python/google-auth/py3/tests/compute_engine/test_credentials.py b/contrib/python/google-auth/py3/tests/compute_engine/test_credentials.py
index f04bb1304a8..9cca317924e 100644
--- a/contrib/python/google-auth/py3/tests/compute_engine/test_credentials.py
+++ b/contrib/python/google-auth/py3/tests/compute_engine/test_credentials.py
@@ -257,16 +257,12 @@ class TestCredentials(object):
assert self.credentials.universe_domain == "fake_universe_domain"
assert self.credentials._universe_domain == "fake_universe_domain"
assert self.credentials._universe_domain_cached
- get_universe_domain.assert_called_once_with(
- self.credentials._universe_domain_request
- )
+ get_universe_domain.assert_called_once()
# calling the universe_domain property the second time should use the
# cached value instead of calling get_universe_domain
assert self.credentials.universe_domain == "fake_universe_domain"
- get_universe_domain.assert_called_once_with(
- self.credentials._universe_domain_request
- )
+ get_universe_domain.assert_called_once()
@mock.patch("google.auth.compute_engine._metadata.get_universe_domain")
def test_user_provided_universe_domain(self, get_universe_domain):
diff --git a/contrib/python/google-auth/py3/tests/oauth2/test_service_account.py b/contrib/python/google-auth/py3/tests/oauth2/test_service_account.py
index 8dd5f219be1..ce0c72fa0ab 100644
--- a/contrib/python/google-auth/py3/tests/oauth2/test_service_account.py
+++ b/contrib/python/google-auth/py3/tests/oauth2/test_service_account.py
@@ -24,6 +24,7 @@ from google.auth import crypt
from google.auth import exceptions
from google.auth import jwt
from google.auth import transport
+from google.auth.credentials import DEFAULT_UNIVERSE_DOMAIN
from google.oauth2 import service_account
@@ -59,7 +60,7 @@ class TestCredentials(object):
TOKEN_URI = "https://example.com/oauth2/token"
@classmethod
- def make_credentials(cls, universe_domain=service_account._DEFAULT_UNIVERSE_DOMAIN):
+ def make_credentials(cls, universe_domain=DEFAULT_UNIVERSE_DOMAIN):
return service_account.Credentials(
SIGNER,
cls.SERVICE_ACCOUNT_EMAIL,
@@ -71,7 +72,7 @@ class TestCredentials(object):
credentials = service_account.Credentials(
SIGNER, self.SERVICE_ACCOUNT_EMAIL, self.TOKEN_URI, universe_domain=None
)
- assert credentials.universe_domain == service_account._DEFAULT_UNIVERSE_DOMAIN
+ assert credentials.universe_domain == DEFAULT_UNIVERSE_DOMAIN
def test_from_service_account_info(self):
credentials = service_account.Credentials.from_service_account_info(
@@ -81,7 +82,7 @@ class TestCredentials(object):
assert credentials._signer.key_id == SERVICE_ACCOUNT_INFO["private_key_id"]
assert credentials.service_account_email == SERVICE_ACCOUNT_INFO["client_email"]
assert credentials._token_uri == SERVICE_ACCOUNT_INFO["token_uri"]
- assert credentials._universe_domain == service_account._DEFAULT_UNIVERSE_DOMAIN
+ assert credentials._universe_domain == DEFAULT_UNIVERSE_DOMAIN
assert not credentials._always_use_jwt_access
def test_from_service_account_info_non_gdu(self):
@@ -596,7 +597,7 @@ class TestIDTokenCredentials(object):
TARGET_AUDIENCE = "https://example.com"
@classmethod
- def make_credentials(cls, universe_domain=service_account._DEFAULT_UNIVERSE_DOMAIN):
+ def make_credentials(cls, universe_domain=DEFAULT_UNIVERSE_DOMAIN):
return service_account.IDTokenCredentials(
SIGNER,
cls.SERVICE_ACCOUNT_EMAIL,
@@ -613,7 +614,7 @@ class TestIDTokenCredentials(object):
self.TARGET_AUDIENCE,
universe_domain=None,
)
- assert credentials._universe_domain == service_account._DEFAULT_UNIVERSE_DOMAIN
+ assert credentials._universe_domain == DEFAULT_UNIVERSE_DOMAIN
def test_from_service_account_info(self):
credentials = service_account.IDTokenCredentials.from_service_account_info(
diff --git a/contrib/python/google-auth/py3/tests/test_aws.py b/contrib/python/google-auth/py3/tests/test_aws.py
index db2e984100f..3f358d52b09 100644
--- a/contrib/python/google-auth/py3/tests/test_aws.py
+++ b/contrib/python/google-auth/py3/tests/test_aws.py
@@ -26,7 +26,7 @@ from google.auth import aws
from google.auth import environment_vars
from google.auth import exceptions
from google.auth import transport
-
+from google.auth.credentials import DEFAULT_UNIVERSE_DOMAIN
IMPERSONATE_ACCESS_TOKEN_REQUEST_METRICS_HEADER_VALUE = (
"gl-python/3.7 auth/1.1 auth-request-type/at cred-type/imp"
@@ -75,7 +75,6 @@ REQUEST_PARAMS = '{"KeySchema":[{"KeyType":"HASH","AttributeName":"Id"}],"TableN
# Each tuple contains the following entries:
# region, time, credentials, original_request, signed_request
-DEFAULT_UNIVERSE_DOMAIN = "googleapis.com"
VALID_TOKEN_URLS = [
"https://sts.googleapis.com",
"https://us-east-1.sts.googleapis.com",
diff --git a/contrib/python/google-auth/py3/tests/test_downscoped.py b/contrib/python/google-auth/py3/tests/test_downscoped.py
index 8cc2a30d163..fe6e291c756 100644
--- a/contrib/python/google-auth/py3/tests/test_downscoped.py
+++ b/contrib/python/google-auth/py3/tests/test_downscoped.py
@@ -25,6 +25,7 @@ from google.auth import credentials
from google.auth import downscoped
from google.auth import exceptions
from google.auth import transport
+from google.auth.credentials import DEFAULT_UNIVERSE_DOMAIN
from google.auth.credentials import TokenState
@@ -447,7 +448,11 @@ class TestCredentialAccessBoundary(object):
class TestCredentials(object):
@staticmethod
- def make_credentials(source_credentials=SourceCredentials(), quota_project_id=None):
+ def make_credentials(
+ source_credentials=SourceCredentials(),
+ quota_project_id=None,
+ universe_domain=None,
+ ):
availability_condition = make_availability_condition(
EXPRESSION, TITLE, DESCRIPTION
)
@@ -458,7 +463,10 @@ class TestCredentials(object):
credential_access_boundary = make_credential_access_boundary(rules)
return downscoped.Credentials(
- source_credentials, credential_access_boundary, quota_project_id
+ source_credentials,
+ credential_access_boundary,
+ quota_project_id,
+ universe_domain,
)
@staticmethod
@@ -473,10 +481,12 @@ class TestCredentials(object):
return request
@staticmethod
- def assert_request_kwargs(request_kwargs, headers, request_data):
+ def assert_request_kwargs(
+ request_kwargs, headers, request_data, token_endpoint=TOKEN_EXCHANGE_ENDPOINT
+ ):
"""Asserts the request was called with the expected parameters.
"""
- assert request_kwargs["url"] == TOKEN_EXCHANGE_ENDPOINT
+ assert request_kwargs["url"] == token_endpoint
assert request_kwargs["method"] == "POST"
assert request_kwargs["headers"] == headers
assert request_kwargs["body"] is not None
@@ -496,6 +506,33 @@ class TestCredentials(object):
assert not credentials.expired
# No quota project ID set.
assert not credentials.quota_project_id
+ assert credentials.universe_domain == DEFAULT_UNIVERSE_DOMAIN
+
+ def test_default_state_with_explicit_none_value(self):
+ credentials = self.make_credentials(universe_domain=None)
+
+ # No token acquired yet.
+ assert not credentials.token
+ assert not credentials.valid
+ # Expiration hasn't been set yet.
+ assert not credentials.expiry
+ assert not credentials.expired
+ # No quota project ID set.
+ assert not credentials.quota_project_id
+ assert credentials.universe_domain == DEFAULT_UNIVERSE_DOMAIN
+
+ def test_create_with_customized_universe_domain(self):
+ test_universe_domain = "foo.com"
+ credentials = self.make_credentials(universe_domain=test_universe_domain)
+ # No token acquired yet.
+ assert not credentials.token
+ assert not credentials.valid
+ # Expiration hasn't been set yet.
+ assert not credentials.expiry
+ assert not credentials.expired
+ # No quota project ID set.
+ assert not credentials.quota_project_id
+ assert credentials.universe_domain == test_universe_domain
def test_with_quota_project(self):
credentials = self.make_credentials()
@@ -507,6 +544,49 @@ class TestCredentials(object):
assert quota_project_creds.quota_project_id == "project-foo"
@mock.patch("google.auth._helpers.utcnow", return_value=datetime.datetime.min)
+ def test_refresh_on_custom_universe(self, unused_utcnow):
+ test_universe_domain = "foo.com"
+ response = SUCCESS_RESPONSE.copy()
+ # Test custom expiration to confirm expiry is set correctly.
+ response["expires_in"] = 2800
+ expected_expiry = datetime.datetime.min + datetime.timedelta(
+ seconds=response["expires_in"]
+ )
+ headers = {"Content-Type": "application/x-www-form-urlencoded"}
+ request_data = {
+ "grant_type": GRANT_TYPE,
+ "subject_token": "ACCESS_TOKEN_1",
+ "subject_token_type": SUBJECT_TOKEN_TYPE,
+ "requested_token_type": REQUESTED_TOKEN_TYPE,
+ "options": urllib.parse.quote(json.dumps(CREDENTIAL_ACCESS_BOUNDARY_JSON)),
+ }
+ request = self.make_mock_request(status=http_client.OK, data=response)
+ source_credentials = SourceCredentials()
+ credentials = self.make_credentials(
+ source_credentials=source_credentials, universe_domain=test_universe_domain
+ )
+ token_exchange_endpoint = downscoped._STS_TOKEN_URL_PATTERN.format(
+ test_universe_domain
+ )
+
+ # Spy on calls to source credentials refresh to confirm the expected request
+ # instance is used.
+ with mock.patch.object(
+ source_credentials, "refresh", wraps=source_credentials.refresh
+ ) as wrapped_souce_cred_refresh:
+ credentials.refresh(request)
+
+ self.assert_request_kwargs(
+ request.call_args[1], headers, request_data, token_exchange_endpoint
+ )
+ assert credentials.valid
+ assert credentials.expiry == expected_expiry
+ assert not credentials.expired
+ assert credentials.token == response["access_token"]
+ # Confirm source credentials called with the same request instance.
+ wrapped_souce_cred_refresh.assert_called_with(request)
+
+ @mock.patch("google.auth._helpers.utcnow", return_value=datetime.datetime.min)
def test_refresh(self, unused_utcnow):
response = SUCCESS_RESPONSE.copy()
# Test custom expiration to confirm expiry is set correctly.
diff --git a/contrib/python/google-auth/py3/tests/test_external_account.py b/contrib/python/google-auth/py3/tests/test_external_account.py
index 7f33b1dfa2a..03a5014ce5b 100644
--- a/contrib/python/google-auth/py3/tests/test_external_account.py
+++ b/contrib/python/google-auth/py3/tests/test_external_account.py
@@ -24,9 +24,9 @@ from google.auth import _helpers
from google.auth import exceptions
from google.auth import external_account
from google.auth import transport
+from google.auth.credentials import DEFAULT_UNIVERSE_DOMAIN
from google.auth.credentials import TokenState
-
IMPERSONATE_ACCESS_TOKEN_REQUEST_METRICS_HEADER_VALUE = (
"gl-python/3.7 auth/1.1 auth-request-type/at cred-type/imp"
)
@@ -150,7 +150,7 @@ class TestCredentials(object):
default_scopes=None,
service_account_impersonation_url=None,
service_account_impersonation_options={},
- universe_domain=external_account._DEFAULT_UNIVERSE_DOMAIN,
+ universe_domain=DEFAULT_UNIVERSE_DOMAIN,
):
return CredentialsImpl(
audience=cls.AUDIENCE,
@@ -386,7 +386,7 @@ class TestCredentials(object):
quota_project_id=self.QUOTA_PROJECT_ID,
scopes=["email"],
default_scopes=["default2"],
- universe_domain=external_account._DEFAULT_UNIVERSE_DOMAIN,
+ universe_domain=DEFAULT_UNIVERSE_DOMAIN,
)
def test_with_token_uri(self):
@@ -474,7 +474,7 @@ class TestCredentials(object):
quota_project_id="project-foo",
scopes=self.SCOPES,
default_scopes=["default1"],
- universe_domain=external_account._DEFAULT_UNIVERSE_DOMAIN,
+ universe_domain=DEFAULT_UNIVERSE_DOMAIN,
)
def test_with_invalid_impersonation_target_principal(self):
@@ -504,7 +504,7 @@ class TestCredentials(object):
assert credentials.universe_domain == "dummy_universe.com"
credentials = self.make_credentials()
- assert credentials.universe_domain == external_account._DEFAULT_UNIVERSE_DOMAIN
+ assert credentials.universe_domain == DEFAULT_UNIVERSE_DOMAIN
def test_with_universe_domain(self):
credentials = self.make_credentials()
@@ -523,7 +523,7 @@ class TestCredentials(object):
"token_url": self.TOKEN_URL,
"credential_source": self.CREDENTIAL_SOURCE.copy(),
"workforce_pool_user_project": self.WORKFORCE_POOL_USER_PROJECT,
- "universe_domain": external_account._DEFAULT_UNIVERSE_DOMAIN,
+ "universe_domain": DEFAULT_UNIVERSE_DOMAIN,
}
def test_info_with_full_options(self):
@@ -548,7 +548,7 @@ class TestCredentials(object):
"quota_project_id": self.QUOTA_PROJECT_ID,
"client_id": CLIENT_ID,
"client_secret": CLIENT_SECRET,
- "universe_domain": external_account._DEFAULT_UNIVERSE_DOMAIN,
+ "universe_domain": DEFAULT_UNIVERSE_DOMAIN,
}
def test_service_account_email_without_impersonation(self):
diff --git a/contrib/python/google-auth/py3/tests/test_external_account_authorized_user.py b/contrib/python/google-auth/py3/tests/test_external_account_authorized_user.py
index 7213a23486c..743ee9c848d 100644
--- a/contrib/python/google-auth/py3/tests/test_external_account_authorized_user.py
+++ b/contrib/python/google-auth/py3/tests/test_external_account_authorized_user.py
@@ -22,6 +22,7 @@ import pytest # type: ignore
from google.auth import exceptions
from google.auth import external_account_authorized_user
from google.auth import transport
+from google.auth.credentials import DEFAULT_UNIVERSE_DOMAIN
TOKEN_URL = "https://sts.googleapis.com/v1/token"
TOKEN_INFO_URL = "https://sts.googleapis.com/v1/introspect"
@@ -45,7 +46,6 @@ BASIC_AUTH_ENCODING = "dXNlcm5hbWU6cGFzc3dvcmQ="
SCOPES = ["email", "profile"]
NOW = datetime.datetime(1990, 8, 27, 6, 54, 30)
FAKE_UNIVERSE_DOMAIN = "fake-universe-domain"
-DEFAULT_UNIVERSE_DOMAIN = external_account_authorized_user._DEFAULT_UNIVERSE_DOMAIN
class TestCredentials(object):
diff --git a/contrib/python/google-auth/py3/tests/test_identity_pool.py b/contrib/python/google-auth/py3/tests/test_identity_pool.py
index 2d10a5d2683..96be1d61c28 100644
--- a/contrib/python/google-auth/py3/tests/test_identity_pool.py
+++ b/contrib/python/google-auth/py3/tests/test_identity_pool.py
@@ -26,7 +26,7 @@ from google.auth import exceptions
from google.auth import identity_pool
from google.auth import metrics
from google.auth import transport
-
+from google.auth.credentials import DEFAULT_UNIVERSE_DOMAIN
CLIENT_ID = "username"
CLIENT_SECRET = "password"
@@ -68,8 +68,6 @@ WORKFORCE_AUDIENCE = (
WORKFORCE_SUBJECT_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:id_token"
WORKFORCE_POOL_USER_PROJECT = "WORKFORCE_POOL_USER_PROJECT_NUMBER"
-DEFAULT_UNIVERSE_DOMAIN = "googleapis.com"
-
VALID_TOKEN_URLS = [
"https://sts.googleapis.com",
"https://us-east-1.sts.googleapis.com",
diff --git a/contrib/python/google-auth/py3/tests/test_pluggable.py b/contrib/python/google-auth/py3/tests/test_pluggable.py
index 783bbcaec0f..24cd0e2ec9c 100644
--- a/contrib/python/google-auth/py3/tests/test_pluggable.py
+++ b/contrib/python/google-auth/py3/tests/test_pluggable.py
@@ -21,6 +21,7 @@ import pytest # type: ignore
from google.auth import exceptions
from google.auth import pluggable
+from google.auth.credentials import DEFAULT_UNIVERSE_DOMAIN
from .test__default import WORKFORCE_AUDIENCE
CLIENT_ID = "username"
@@ -45,7 +46,6 @@ TOKEN_URL = "https://sts.googleapis.com/v1/token"
TOKEN_INFO_URL = "https://sts.googleapis.com/v1/introspect"
SUBJECT_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:jwt"
AUDIENCE = "//iam.googleapis.com/projects/123456/locations/global/workloadIdentityPools/POOL_ID/providers/PROVIDER_ID"
-DEFAULT_UNIVERSE_DOMAIN = "googleapis.com"
VALID_TOKEN_URLS = [
"https://sts.googleapis.com",
diff --git a/contrib/python/google-auth/py3/ya.make b/contrib/python/google-auth/py3/ya.make
index 5ece69bc982..7863862fdcb 100644
--- a/contrib/python/google-auth/py3/ya.make
+++ b/contrib/python/google-auth/py3/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(2.27.0)
+VERSION(2.28.0)
LICENSE(Apache-2.0)
diff --git a/contrib/python/httpcore/.dist-info/METADATA b/contrib/python/httpcore/.dist-info/METADATA
index 07eab9de210..51de714c586 100644
--- a/contrib/python/httpcore/.dist-info/METADATA
+++ b/contrib/python/httpcore/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: httpcore
-Version: 1.0.2
+Version: 1.0.3
Summary: A minimal low-level HTTP client.
Project-URL: Documentation, https://www.encode.io/httpcore
Project-URL: Homepage, https://www.encode.io/httpcore/
@@ -33,7 +33,7 @@ Requires-Dist: h2<5,>=3; extra == 'http2'
Provides-Extra: socks
Requires-Dist: socksio==1.*; extra == 'socks'
Provides-Extra: trio
-Requires-Dist: trio<0.23.0,>=0.22.0; extra == 'trio'
+Requires-Dist: trio<0.24.0,>=0.22.0; extra == 'trio'
Description-Content-Type: text/markdown
# HTTP Core
@@ -153,7 +153,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
-## 1.0.2 (November 10th, 2023)
+## 1.0.3 (February 13th, 2024)
+
+- Fix support for async cancellations. (#880)
+- Fix trace extension when used with socks proxy. (#849)
+- Fix SSL context for connections using the "wss" scheme (#869)
+
+## 1.0.2 (November 10th, 2023)
- Fix `float("inf")` timeouts in `Event.wait` function. (#846)
diff --git a/contrib/python/httpcore/httpcore/__init__.py b/contrib/python/httpcore/httpcore/__init__.py
index eb3e577186b..3709fc4080c 100644
--- a/contrib/python/httpcore/httpcore/__init__.py
+++ b/contrib/python/httpcore/httpcore/__init__.py
@@ -130,7 +130,7 @@ __all__ = [
"WriteError",
]
-__version__ = "1.0.2"
+__version__ = "1.0.3"
__locals = locals()
diff --git a/contrib/python/httpcore/httpcore/_async/connection.py b/contrib/python/httpcore/httpcore/_async/connection.py
index 45ee22a63d0..2f439cf09c5 100644
--- a/contrib/python/httpcore/httpcore/_async/connection.py
+++ b/contrib/python/httpcore/httpcore/_async/connection.py
@@ -6,7 +6,7 @@ from typing import Iterable, Iterator, Optional, Type
from .._backends.auto import AutoBackend
from .._backends.base import SOCKET_OPTION, AsyncNetworkBackend, AsyncNetworkStream
-from .._exceptions import ConnectError, ConnectionNotAvailable, ConnectTimeout
+from .._exceptions import ConnectError, ConnectTimeout
from .._models import Origin, Request, Response
from .._ssl import default_ssl_context
from .._synchronization import AsyncLock
@@ -70,9 +70,9 @@ class AsyncHTTPConnection(AsyncConnectionInterface):
f"Attempted to send request to {request.url.origin} on connection to {self._origin}"
)
- async with self._request_lock:
- if self._connection is None:
- try:
+ try:
+ async with self._request_lock:
+ if self._connection is None:
stream = await self._connect(request)
ssl_object = stream.get_extra_info("ssl_object")
@@ -94,11 +94,9 @@ class AsyncHTTPConnection(AsyncConnectionInterface):
stream=stream,
keepalive_expiry=self._keepalive_expiry,
)
- except Exception as exc:
- self._connect_failed = True
- raise exc
- elif not self._connection.is_available():
- raise ConnectionNotAvailable()
+ except BaseException as exc:
+ self._connect_failed = True
+ raise exc
return await self._connection.handle_async_request(request)
@@ -137,7 +135,7 @@ class AsyncHTTPConnection(AsyncConnectionInterface):
)
trace.return_value = stream
- if self._origin.scheme == b"https":
+ if self._origin.scheme in (b"https", b"wss"):
ssl_context = (
default_ssl_context()
if self._ssl_context is None
diff --git a/contrib/python/httpcore/httpcore/_async/connection_pool.py b/contrib/python/httpcore/httpcore/_async/connection_pool.py
index 0320c6d80e4..018b0ba234f 100644
--- a/contrib/python/httpcore/httpcore/_async/connection_pool.py
+++ b/contrib/python/httpcore/httpcore/_async/connection_pool.py
@@ -1,31 +1,30 @@
import ssl
import sys
-import time
from types import TracebackType
from typing import AsyncIterable, AsyncIterator, Iterable, List, Optional, Type
from .._backends.auto import AutoBackend
from .._backends.base import SOCKET_OPTION, AsyncNetworkBackend
-from .._exceptions import ConnectionNotAvailable, PoolTimeout, UnsupportedProtocol
+from .._exceptions import ConnectionNotAvailable, UnsupportedProtocol
from .._models import Origin, Request, Response
-from .._synchronization import AsyncEvent, AsyncLock, AsyncShieldCancellation
+from .._synchronization import AsyncEvent, AsyncShieldCancellation, AsyncThreadLock
from .connection import AsyncHTTPConnection
from .interfaces import AsyncConnectionInterface, AsyncRequestInterface
-class RequestStatus:
- def __init__(self, request: Request):
+class AsyncPoolRequest:
+ def __init__(self, request: Request) -> None:
self.request = request
self.connection: Optional[AsyncConnectionInterface] = None
self._connection_acquired = AsyncEvent()
- def set_connection(self, connection: AsyncConnectionInterface) -> None:
- assert self.connection is None
+ def assign_to_connection(
+ self, connection: Optional[AsyncConnectionInterface]
+ ) -> None:
self.connection = connection
self._connection_acquired.set()
- def unset_connection(self) -> None:
- assert self.connection is not None
+ def clear_connection(self) -> None:
self.connection = None
self._connection_acquired = AsyncEvent()
@@ -37,6 +36,9 @@ class RequestStatus:
assert self.connection is not None
return self.connection
+ def is_queued(self) -> bool:
+ return self.connection is None
+
class AsyncConnectionPool(AsyncRequestInterface):
"""
@@ -107,14 +109,21 @@ class AsyncConnectionPool(AsyncRequestInterface):
self._local_address = local_address
self._uds = uds
- self._pool: List[AsyncConnectionInterface] = []
- self._requests: List[RequestStatus] = []
- self._pool_lock = AsyncLock()
self._network_backend = (
AutoBackend() if network_backend is None else network_backend
)
self._socket_options = socket_options
+ # The mutable state on a connection pool is the queue of incoming requests,
+ # and the set of connections that are servicing those requests.
+ self._connections: List[AsyncConnectionInterface] = []
+ self._requests: List[AsyncPoolRequest] = []
+
+ # We only mutate the state of the connection pool within an 'optional_thread_lock'
+ # context. This holds a threading lock unless we're running in async mode,
+ # in which case it is a no-op.
+ self._optional_thread_lock = AsyncThreadLock()
+
def create_connection(self, origin: Origin) -> AsyncConnectionInterface:
return AsyncHTTPConnection(
origin=origin,
@@ -145,64 +154,7 @@ class AsyncConnectionPool(AsyncRequestInterface):
]
```
"""
- return list(self._pool)
-
- async def _attempt_to_acquire_connection(self, status: RequestStatus) -> bool:
- """
- Attempt to provide a connection that can handle the given origin.
- """
- origin = status.request.url.origin
-
- # If there are queued requests in front of us, then don't acquire a
- # connection. We handle requests strictly in order.
- waiting = [s for s in self._requests if s.connection is None]
- if waiting and waiting[0] is not status:
- return False
-
- # Reuse an existing connection if one is currently available.
- for idx, connection in enumerate(self._pool):
- if connection.can_handle_request(origin) and connection.is_available():
- self._pool.pop(idx)
- self._pool.insert(0, connection)
- status.set_connection(connection)
- return True
-
- # If the pool is currently full, attempt to close one idle connection.
- if len(self._pool) >= self._max_connections:
- for idx, connection in reversed(list(enumerate(self._pool))):
- if connection.is_idle():
- await connection.aclose()
- self._pool.pop(idx)
- break
-
- # If the pool is still full, then we cannot acquire a connection.
- if len(self._pool) >= self._max_connections:
- return False
-
- # Otherwise create a new connection.
- connection = self.create_connection(origin)
- self._pool.insert(0, connection)
- status.set_connection(connection)
- return True
-
- async def _close_expired_connections(self) -> None:
- """
- Clean up the connection pool by closing off any connections that have expired.
- """
- # Close any connections that have expired their keep-alive time.
- for idx, connection in reversed(list(enumerate(self._pool))):
- if connection.has_expired():
- await connection.aclose()
- self._pool.pop(idx)
-
- # If the pool size exceeds the maximum number of allowed keep-alive connections,
- # then close off idle connections as required.
- pool_size = len(self._pool)
- for idx, connection in reversed(list(enumerate(self._pool))):
- if connection.is_idle() and pool_size > self._max_keepalive_connections:
- await connection.aclose()
- self._pool.pop(idx)
- pool_size -= 1
+ return list(self._connections)
async def handle_async_request(self, request: Request) -> Response:
"""
@@ -220,116 +172,147 @@ class AsyncConnectionPool(AsyncRequestInterface):
f"Request URL has an unsupported protocol '{scheme}://'."
)
- status = RequestStatus(request)
timeouts = request.extensions.get("timeout", {})
timeout = timeouts.get("pool", None)
- if timeout is not None:
- deadline = time.monotonic() + timeout
- else:
- deadline = float("inf")
-
- async with self._pool_lock:
- self._requests.append(status)
- await self._close_expired_connections()
- await self._attempt_to_acquire_connection(status)
-
- while True:
- try:
- connection = await status.wait_for_connection(timeout=timeout)
- except BaseException as exc:
- # If we timeout here, or if the task is cancelled, then make
- # sure to remove the request from the queue before bubbling
- # up the exception.
- async with self._pool_lock:
- # Ensure only remove when task exists.
- if status in self._requests:
- self._requests.remove(status)
- raise exc
-
- try:
- response = await connection.handle_async_request(request)
- except ConnectionNotAvailable:
- # The ConnectionNotAvailable exception is a special case, that
- # indicates we need to retry the request on a new connection.
- #
- # The most common case where this can occur is when multiple
- # requests are queued waiting for a single connection, which
- # might end up as an HTTP/2 connection, but which actually ends
- # up as HTTP/1.1.
- async with self._pool_lock:
- # Maintain our position in the request queue, but reset the
- # status so that the request becomes queued again.
- status.unset_connection()
- await self._attempt_to_acquire_connection(status)
- except BaseException as exc:
- with AsyncShieldCancellation():
- await self.response_closed(status)
- raise exc
- else:
- break
-
- timeout = deadline - time.monotonic()
- if timeout < 0:
- raise PoolTimeout # pragma: nocover
-
- # When we return the response, we wrap the stream in a special class
- # that handles notifying the connection pool once the response
- # has been released.
+ with self._optional_thread_lock:
+ # Add the incoming request to our request queue.
+ pool_request = AsyncPoolRequest(request)
+ self._requests.append(pool_request)
+
+ try:
+ while True:
+ with self._optional_thread_lock:
+ # Assign incoming requests to available connections,
+ # closing or creating new connections as required.
+ closing = self._assign_requests_to_connections()
+ await self._close_connections(closing)
+
+ # Wait until this request has an assigned connection.
+ connection = await pool_request.wait_for_connection(timeout=timeout)
+
+ try:
+ # Send the request on the assigned connection.
+ response = await connection.handle_async_request(
+ pool_request.request
+ )
+ except ConnectionNotAvailable:
+ # In some cases a connection may initially be available to
+ # handle a request, but then become unavailable.
+ #
+ # In this case we clear the connection and try again.
+ pool_request.clear_connection()
+ else:
+ break # pragma: nocover
+
+ except BaseException as exc:
+ with self._optional_thread_lock:
+ # For any exception or cancellation we remove the request from
+ # the queue, and then re-assign requests to connections.
+ self._requests.remove(pool_request)
+ closing = self._assign_requests_to_connections()
+
+ await self._close_connections(closing)
+ raise exc from None
+
+ # Return the response. Note that in this case we still have to manage
+ # the point at which the response is closed.
assert isinstance(response.stream, AsyncIterable)
return Response(
status=response.status,
headers=response.headers,
- content=ConnectionPoolByteStream(response.stream, self, status),
+ content=PoolByteStream(
+ stream=response.stream, pool_request=pool_request, pool=self
+ ),
extensions=response.extensions,
)
- async def response_closed(self, status: RequestStatus) -> None:
+ def _assign_requests_to_connections(self) -> List[AsyncConnectionInterface]:
"""
- This method acts as a callback once the request/response cycle is complete.
+ Manage the state of the connection pool, assigning incoming
+ requests to connections as available.
- It is called into from the `ConnectionPoolByteStream.aclose()` method.
- """
- assert status.connection is not None
- connection = status.connection
-
- async with self._pool_lock:
- # Update the state of the connection pool.
- if status in self._requests:
- self._requests.remove(status)
-
- if connection.is_closed() and connection in self._pool:
- self._pool.remove(connection)
-
- # Since we've had a response closed, it's possible we'll now be able
- # to service one or more requests that are currently pending.
- for status in self._requests:
- if status.connection is None:
- acquired = await self._attempt_to_acquire_connection(status)
- # If we could not acquire a connection for a queued request
- # then we don't need to check anymore requests that are
- # queued later behind it.
- if not acquired:
- break
-
- # Housekeeping.
- await self._close_expired_connections()
+ Called whenever a new request is added or removed from the pool.
- async def aclose(self) -> None:
+ Any closing connections are returned, allowing the I/O for closing
+ those connections to be handled seperately.
"""
- Close any connections in the pool.
- """
- async with self._pool_lock:
- for connection in self._pool:
+ closing_connections = []
+
+ # First we handle cleaning up any connections that are closed,
+ # have expired their keep-alive, or surplus idle connections.
+ for connection in list(self._connections):
+ if connection.is_closed():
+ # log: "removing closed connection"
+ self._connections.remove(connection)
+ elif connection.has_expired():
+ # log: "closing expired connection"
+ self._connections.remove(connection)
+ closing_connections.append(connection)
+ elif (
+ connection.is_idle()
+ and len([connection.is_idle() for connection in self._connections])
+ > self._max_keepalive_connections
+ ):
+ # log: "closing idle connection"
+ self._connections.remove(connection)
+ closing_connections.append(connection)
+
+ # Assign queued requests to connections.
+ queued_requests = [request for request in self._requests if request.is_queued()]
+ for pool_request in queued_requests:
+ origin = pool_request.request.url.origin
+ avilable_connections = [
+ connection
+ for connection in self._connections
+ if connection.can_handle_request(origin) and connection.is_available()
+ ]
+ idle_connections = [
+ connection for connection in self._connections if connection.is_idle()
+ ]
+
+ # There are three cases for how we may be able to handle the request:
+ #
+ # 1. There is an existing connection that can handle the request.
+ # 2. We can create a new connection to handle the request.
+ # 3. We can close an idle connection and then create a new connection
+ # to handle the request.
+ if avilable_connections:
+ # log: "reusing existing connection"
+ connection = avilable_connections[0]
+ pool_request.assign_to_connection(connection)
+ elif len(self._connections) < self._max_connections:
+ # log: "creating new connection"
+ connection = self.create_connection(origin)
+ self._connections.append(connection)
+ pool_request.assign_to_connection(connection)
+ elif idle_connections:
+ # log: "closing idle connection"
+ connection = idle_connections[0]
+ self._connections.remove(connection)
+ closing_connections.append(connection)
+ # log: "creating new connection"
+ connection = self.create_connection(origin)
+ self._connections.append(connection)
+ pool_request.assign_to_connection(connection)
+
+ return closing_connections
+
+ async def _close_connections(self, closing: List[AsyncConnectionInterface]) -> None:
+ # Close connections which have been removed from the pool.
+ with AsyncShieldCancellation():
+ for connection in closing:
await connection.aclose()
- self._pool = []
- self._requests = []
+
+ async def aclose(self) -> None:
+ # Explicitly close the connection pool.
+ # Clears all existing requests and connections.
+ with self._optional_thread_lock:
+ closing_connections = list(self._connections)
+ self._connections = []
+ await self._close_connections(closing_connections)
async def __aenter__(self) -> "AsyncConnectionPool":
- # Acquiring the pool lock here ensures that we have the
- # correct dependencies installed as early as possible.
- async with self._pool_lock:
- pass
return self
async def __aexit__(
@@ -340,31 +323,58 @@ class AsyncConnectionPool(AsyncRequestInterface):
) -> None:
await self.aclose()
+ def __repr__(self) -> str:
+ class_name = self.__class__.__name__
+ with self._optional_thread_lock:
+ request_is_queued = [request.is_queued() for request in self._requests]
+ connection_is_idle = [
+ connection.is_idle() for connection in self._connections
+ ]
+
+ num_active_requests = request_is_queued.count(False)
+ num_queued_requests = request_is_queued.count(True)
+ num_active_connections = connection_is_idle.count(False)
+ num_idle_connections = connection_is_idle.count(True)
+
+ requests_info = (
+ f"Requests: {num_active_requests} active, {num_queued_requests} queued"
+ )
+ connection_info = (
+ f"Connections: {num_active_connections} active, {num_idle_connections} idle"
+ )
+
+ return f"<{class_name} [{requests_info} | {connection_info}]>"
-class ConnectionPoolByteStream:
- """
- A wrapper around the response byte stream, that additionally handles
- notifying the connection pool when the response has been closed.
- """
+class PoolByteStream:
def __init__(
self,
stream: AsyncIterable[bytes],
+ pool_request: AsyncPoolRequest,
pool: AsyncConnectionPool,
- status: RequestStatus,
) -> None:
self._stream = stream
+ self._pool_request = pool_request
self._pool = pool
- self._status = status
+ self._closed = False
async def __aiter__(self) -> AsyncIterator[bytes]:
- async for part in self._stream:
- yield part
+ try:
+ async for part in self._stream:
+ yield part
+ except BaseException as exc:
+ await self.aclose()
+ raise exc from None
async def aclose(self) -> None:
- try:
- if hasattr(self._stream, "aclose"):
- await self._stream.aclose()
- finally:
+ if not self._closed:
+ self._closed = True
with AsyncShieldCancellation():
- await self._pool.response_closed(self._status)
+ if hasattr(self._stream, "aclose"):
+ await self._stream.aclose()
+
+ with self._pool._optional_thread_lock:
+ self._pool._requests.remove(self._pool_request)
+ closing = self._pool._assign_requests_to_connections()
+
+ await self._pool._close_connections(closing)
diff --git a/contrib/python/httpcore/httpcore/_async/http11.py b/contrib/python/httpcore/httpcore/_async/http11.py
index 32fa3a6f23f..a5eb480840d 100644
--- a/contrib/python/httpcore/httpcore/_async/http11.py
+++ b/contrib/python/httpcore/httpcore/_async/http11.py
@@ -10,7 +10,6 @@ from typing import (
Tuple,
Type,
Union,
- cast,
)
import h11
@@ -228,7 +227,7 @@ class AsyncHTTP11Connection(AsyncConnectionInterface):
self._h11_state.receive_data(data)
else:
# mypy fails to narrow the type in the above if statement above
- return cast(Union[h11.Event, Type[h11.PAUSED]], event)
+ return event # type: ignore[return-value]
async def _response_closed(self) -> None:
async with self._state_lock:
diff --git a/contrib/python/httpcore/httpcore/_async/socks_proxy.py b/contrib/python/httpcore/httpcore/_async/socks_proxy.py
index 08a065d6d1f..f839603fe50 100644
--- a/contrib/python/httpcore/httpcore/_async/socks_proxy.py
+++ b/contrib/python/httpcore/httpcore/_async/socks_proxy.py
@@ -228,7 +228,7 @@ class AsyncSocks5Connection(AsyncConnectionInterface):
"port": self._proxy_origin.port,
"timeout": timeout,
}
- with Trace("connect_tcp", logger, request, kwargs) as trace:
+ async with Trace("connect_tcp", logger, request, kwargs) as trace:
stream = await self._network_backend.connect_tcp(**kwargs)
trace.return_value = stream
@@ -239,7 +239,7 @@ class AsyncSocks5Connection(AsyncConnectionInterface):
"port": self._remote_origin.port,
"auth": self._proxy_auth,
}
- with Trace(
+ async with Trace(
"setup_socks5_connection", logger, request, kwargs
) as trace:
await _init_socks5_connection(**kwargs)
diff --git a/contrib/python/httpcore/httpcore/_sync/connection.py b/contrib/python/httpcore/httpcore/_sync/connection.py
index 81e4172a215..c3890f340c2 100644
--- a/contrib/python/httpcore/httpcore/_sync/connection.py
+++ b/contrib/python/httpcore/httpcore/_sync/connection.py
@@ -6,7 +6,7 @@ from typing import Iterable, Iterator, Optional, Type
from .._backends.sync import SyncBackend
from .._backends.base import SOCKET_OPTION, NetworkBackend, NetworkStream
-from .._exceptions import ConnectError, ConnectionNotAvailable, ConnectTimeout
+from .._exceptions import ConnectError, ConnectTimeout
from .._models import Origin, Request, Response
from .._ssl import default_ssl_context
from .._synchronization import Lock
@@ -70,9 +70,9 @@ class HTTPConnection(ConnectionInterface):
f"Attempted to send request to {request.url.origin} on connection to {self._origin}"
)
- with self._request_lock:
- if self._connection is None:
- try:
+ try:
+ with self._request_lock:
+ if self._connection is None:
stream = self._connect(request)
ssl_object = stream.get_extra_info("ssl_object")
@@ -94,11 +94,9 @@ class HTTPConnection(ConnectionInterface):
stream=stream,
keepalive_expiry=self._keepalive_expiry,
)
- except Exception as exc:
- self._connect_failed = True
- raise exc
- elif not self._connection.is_available():
- raise ConnectionNotAvailable()
+ except BaseException as exc:
+ self._connect_failed = True
+ raise exc
return self._connection.handle_request(request)
@@ -137,7 +135,7 @@ class HTTPConnection(ConnectionInterface):
)
trace.return_value = stream
- if self._origin.scheme == b"https":
+ if self._origin.scheme in (b"https", b"wss"):
ssl_context = (
default_ssl_context()
if self._ssl_context is None
diff --git a/contrib/python/httpcore/httpcore/_sync/connection_pool.py b/contrib/python/httpcore/httpcore/_sync/connection_pool.py
index ccfb8d22208..8dcf348cac7 100644
--- a/contrib/python/httpcore/httpcore/_sync/connection_pool.py
+++ b/contrib/python/httpcore/httpcore/_sync/connection_pool.py
@@ -1,31 +1,30 @@
import ssl
import sys
-import time
from types import TracebackType
from typing import Iterable, Iterator, Iterable, List, Optional, Type
from .._backends.sync import SyncBackend
from .._backends.base import SOCKET_OPTION, NetworkBackend
-from .._exceptions import ConnectionNotAvailable, PoolTimeout, UnsupportedProtocol
+from .._exceptions import ConnectionNotAvailable, UnsupportedProtocol
from .._models import Origin, Request, Response
-from .._synchronization import Event, Lock, ShieldCancellation
+from .._synchronization import Event, ShieldCancellation, ThreadLock
from .connection import HTTPConnection
from .interfaces import ConnectionInterface, RequestInterface
-class RequestStatus:
- def __init__(self, request: Request):
+class PoolRequest:
+ def __init__(self, request: Request) -> None:
self.request = request
self.connection: Optional[ConnectionInterface] = None
self._connection_acquired = Event()
- def set_connection(self, connection: ConnectionInterface) -> None:
- assert self.connection is None
+ def assign_to_connection(
+ self, connection: Optional[ConnectionInterface]
+ ) -> None:
self.connection = connection
self._connection_acquired.set()
- def unset_connection(self) -> None:
- assert self.connection is not None
+ def clear_connection(self) -> None:
self.connection = None
self._connection_acquired = Event()
@@ -37,6 +36,9 @@ class RequestStatus:
assert self.connection is not None
return self.connection
+ def is_queued(self) -> bool:
+ return self.connection is None
+
class ConnectionPool(RequestInterface):
"""
@@ -107,14 +109,21 @@ class ConnectionPool(RequestInterface):
self._local_address = local_address
self._uds = uds
- self._pool: List[ConnectionInterface] = []
- self._requests: List[RequestStatus] = []
- self._pool_lock = Lock()
self._network_backend = (
SyncBackend() if network_backend is None else network_backend
)
self._socket_options = socket_options
+ # The mutable state on a connection pool is the queue of incoming requests,
+ # and the set of connections that are servicing those requests.
+ self._connections: List[ConnectionInterface] = []
+ self._requests: List[PoolRequest] = []
+
+ # We only mutate the state of the connection pool within an 'optional_thread_lock'
+ # context. This holds a threading lock unless we're running in async mode,
+ # in which case it is a no-op.
+ self._optional_thread_lock = ThreadLock()
+
def create_connection(self, origin: Origin) -> ConnectionInterface:
return HTTPConnection(
origin=origin,
@@ -145,64 +154,7 @@ class ConnectionPool(RequestInterface):
]
```
"""
- return list(self._pool)
-
- def _attempt_to_acquire_connection(self, status: RequestStatus) -> bool:
- """
- Attempt to provide a connection that can handle the given origin.
- """
- origin = status.request.url.origin
-
- # If there are queued requests in front of us, then don't acquire a
- # connection. We handle requests strictly in order.
- waiting = [s for s in self._requests if s.connection is None]
- if waiting and waiting[0] is not status:
- return False
-
- # Reuse an existing connection if one is currently available.
- for idx, connection in enumerate(self._pool):
- if connection.can_handle_request(origin) and connection.is_available():
- self._pool.pop(idx)
- self._pool.insert(0, connection)
- status.set_connection(connection)
- return True
-
- # If the pool is currently full, attempt to close one idle connection.
- if len(self._pool) >= self._max_connections:
- for idx, connection in reversed(list(enumerate(self._pool))):
- if connection.is_idle():
- connection.close()
- self._pool.pop(idx)
- break
-
- # If the pool is still full, then we cannot acquire a connection.
- if len(self._pool) >= self._max_connections:
- return False
-
- # Otherwise create a new connection.
- connection = self.create_connection(origin)
- self._pool.insert(0, connection)
- status.set_connection(connection)
- return True
-
- def _close_expired_connections(self) -> None:
- """
- Clean up the connection pool by closing off any connections that have expired.
- """
- # Close any connections that have expired their keep-alive time.
- for idx, connection in reversed(list(enumerate(self._pool))):
- if connection.has_expired():
- connection.close()
- self._pool.pop(idx)
-
- # If the pool size exceeds the maximum number of allowed keep-alive connections,
- # then close off idle connections as required.
- pool_size = len(self._pool)
- for idx, connection in reversed(list(enumerate(self._pool))):
- if connection.is_idle() and pool_size > self._max_keepalive_connections:
- connection.close()
- self._pool.pop(idx)
- pool_size -= 1
+ return list(self._connections)
def handle_request(self, request: Request) -> Response:
"""
@@ -220,116 +172,147 @@ class ConnectionPool(RequestInterface):
f"Request URL has an unsupported protocol '{scheme}://'."
)
- status = RequestStatus(request)
timeouts = request.extensions.get("timeout", {})
timeout = timeouts.get("pool", None)
- if timeout is not None:
- deadline = time.monotonic() + timeout
- else:
- deadline = float("inf")
-
- with self._pool_lock:
- self._requests.append(status)
- self._close_expired_connections()
- self._attempt_to_acquire_connection(status)
-
- while True:
- try:
- connection = status.wait_for_connection(timeout=timeout)
- except BaseException as exc:
- # If we timeout here, or if the task is cancelled, then make
- # sure to remove the request from the queue before bubbling
- # up the exception.
- with self._pool_lock:
- # Ensure only remove when task exists.
- if status in self._requests:
- self._requests.remove(status)
- raise exc
-
- try:
- response = connection.handle_request(request)
- except ConnectionNotAvailable:
- # The ConnectionNotAvailable exception is a special case, that
- # indicates we need to retry the request on a new connection.
- #
- # The most common case where this can occur is when multiple
- # requests are queued waiting for a single connection, which
- # might end up as an HTTP/2 connection, but which actually ends
- # up as HTTP/1.1.
- with self._pool_lock:
- # Maintain our position in the request queue, but reset the
- # status so that the request becomes queued again.
- status.unset_connection()
- self._attempt_to_acquire_connection(status)
- except BaseException as exc:
- with ShieldCancellation():
- self.response_closed(status)
- raise exc
- else:
- break
-
- timeout = deadline - time.monotonic()
- if timeout < 0:
- raise PoolTimeout # pragma: nocover
-
- # When we return the response, we wrap the stream in a special class
- # that handles notifying the connection pool once the response
- # has been released.
+ with self._optional_thread_lock:
+ # Add the incoming request to our request queue.
+ pool_request = PoolRequest(request)
+ self._requests.append(pool_request)
+
+ try:
+ while True:
+ with self._optional_thread_lock:
+ # Assign incoming requests to available connections,
+ # closing or creating new connections as required.
+ closing = self._assign_requests_to_connections()
+ self._close_connections(closing)
+
+ # Wait until this request has an assigned connection.
+ connection = pool_request.wait_for_connection(timeout=timeout)
+
+ try:
+ # Send the request on the assigned connection.
+ response = connection.handle_request(
+ pool_request.request
+ )
+ except ConnectionNotAvailable:
+ # In some cases a connection may initially be available to
+ # handle a request, but then become unavailable.
+ #
+ # In this case we clear the connection and try again.
+ pool_request.clear_connection()
+ else:
+ break # pragma: nocover
+
+ except BaseException as exc:
+ with self._optional_thread_lock:
+ # For any exception or cancellation we remove the request from
+ # the queue, and then re-assign requests to connections.
+ self._requests.remove(pool_request)
+ closing = self._assign_requests_to_connections()
+
+ self._close_connections(closing)
+ raise exc from None
+
+ # Return the response. Note that in this case we still have to manage
+ # the point at which the response is closed.
assert isinstance(response.stream, Iterable)
return Response(
status=response.status,
headers=response.headers,
- content=ConnectionPoolByteStream(response.stream, self, status),
+ content=PoolByteStream(
+ stream=response.stream, pool_request=pool_request, pool=self
+ ),
extensions=response.extensions,
)
- def response_closed(self, status: RequestStatus) -> None:
+ def _assign_requests_to_connections(self) -> List[ConnectionInterface]:
"""
- This method acts as a callback once the request/response cycle is complete.
+ Manage the state of the connection pool, assigning incoming
+ requests to connections as available.
- It is called into from the `ConnectionPoolByteStream.close()` method.
- """
- assert status.connection is not None
- connection = status.connection
-
- with self._pool_lock:
- # Update the state of the connection pool.
- if status in self._requests:
- self._requests.remove(status)
-
- if connection.is_closed() and connection in self._pool:
- self._pool.remove(connection)
-
- # Since we've had a response closed, it's possible we'll now be able
- # to service one or more requests that are currently pending.
- for status in self._requests:
- if status.connection is None:
- acquired = self._attempt_to_acquire_connection(status)
- # If we could not acquire a connection for a queued request
- # then we don't need to check anymore requests that are
- # queued later behind it.
- if not acquired:
- break
-
- # Housekeeping.
- self._close_expired_connections()
+ Called whenever a new request is added or removed from the pool.
- def close(self) -> None:
+ Any closing connections are returned, allowing the I/O for closing
+ those connections to be handled seperately.
"""
- Close any connections in the pool.
- """
- with self._pool_lock:
- for connection in self._pool:
+ closing_connections = []
+
+ # First we handle cleaning up any connections that are closed,
+ # have expired their keep-alive, or surplus idle connections.
+ for connection in list(self._connections):
+ if connection.is_closed():
+ # log: "removing closed connection"
+ self._connections.remove(connection)
+ elif connection.has_expired():
+ # log: "closing expired connection"
+ self._connections.remove(connection)
+ closing_connections.append(connection)
+ elif (
+ connection.is_idle()
+ and len([connection.is_idle() for connection in self._connections])
+ > self._max_keepalive_connections
+ ):
+ # log: "closing idle connection"
+ self._connections.remove(connection)
+ closing_connections.append(connection)
+
+ # Assign queued requests to connections.
+ queued_requests = [request for request in self._requests if request.is_queued()]
+ for pool_request in queued_requests:
+ origin = pool_request.request.url.origin
+ avilable_connections = [
+ connection
+ for connection in self._connections
+ if connection.can_handle_request(origin) and connection.is_available()
+ ]
+ idle_connections = [
+ connection for connection in self._connections if connection.is_idle()
+ ]
+
+ # There are three cases for how we may be able to handle the request:
+ #
+ # 1. There is an existing connection that can handle the request.
+ # 2. We can create a new connection to handle the request.
+ # 3. We can close an idle connection and then create a new connection
+ # to handle the request.
+ if avilable_connections:
+ # log: "reusing existing connection"
+ connection = avilable_connections[0]
+ pool_request.assign_to_connection(connection)
+ elif len(self._connections) < self._max_connections:
+ # log: "creating new connection"
+ connection = self.create_connection(origin)
+ self._connections.append(connection)
+ pool_request.assign_to_connection(connection)
+ elif idle_connections:
+ # log: "closing idle connection"
+ connection = idle_connections[0]
+ self._connections.remove(connection)
+ closing_connections.append(connection)
+ # log: "creating new connection"
+ connection = self.create_connection(origin)
+ self._connections.append(connection)
+ pool_request.assign_to_connection(connection)
+
+ return closing_connections
+
+ def _close_connections(self, closing: List[ConnectionInterface]) -> None:
+ # Close connections which have been removed from the pool.
+ with ShieldCancellation():
+ for connection in closing:
connection.close()
- self._pool = []
- self._requests = []
+
+ def close(self) -> None:
+ # Explicitly close the connection pool.
+ # Clears all existing requests and connections.
+ with self._optional_thread_lock:
+ closing_connections = list(self._connections)
+ self._connections = []
+ self._close_connections(closing_connections)
def __enter__(self) -> "ConnectionPool":
- # Acquiring the pool lock here ensures that we have the
- # correct dependencies installed as early as possible.
- with self._pool_lock:
- pass
return self
def __exit__(
@@ -340,31 +323,58 @@ class ConnectionPool(RequestInterface):
) -> None:
self.close()
+ def __repr__(self) -> str:
+ class_name = self.__class__.__name__
+ with self._optional_thread_lock:
+ request_is_queued = [request.is_queued() for request in self._requests]
+ connection_is_idle = [
+ connection.is_idle() for connection in self._connections
+ ]
+
+ num_active_requests = request_is_queued.count(False)
+ num_queued_requests = request_is_queued.count(True)
+ num_active_connections = connection_is_idle.count(False)
+ num_idle_connections = connection_is_idle.count(True)
+
+ requests_info = (
+ f"Requests: {num_active_requests} active, {num_queued_requests} queued"
+ )
+ connection_info = (
+ f"Connections: {num_active_connections} active, {num_idle_connections} idle"
+ )
+
+ return f"<{class_name} [{requests_info} | {connection_info}]>"
-class ConnectionPoolByteStream:
- """
- A wrapper around the response byte stream, that additionally handles
- notifying the connection pool when the response has been closed.
- """
+class PoolByteStream:
def __init__(
self,
stream: Iterable[bytes],
+ pool_request: PoolRequest,
pool: ConnectionPool,
- status: RequestStatus,
) -> None:
self._stream = stream
+ self._pool_request = pool_request
self._pool = pool
- self._status = status
+ self._closed = False
def __iter__(self) -> Iterator[bytes]:
- for part in self._stream:
- yield part
+ try:
+ for part in self._stream:
+ yield part
+ except BaseException as exc:
+ self.close()
+ raise exc from None
def close(self) -> None:
- try:
- if hasattr(self._stream, "close"):
- self._stream.close()
- finally:
+ if not self._closed:
+ self._closed = True
with ShieldCancellation():
- self._pool.response_closed(self._status)
+ if hasattr(self._stream, "close"):
+ self._stream.close()
+
+ with self._pool._optional_thread_lock:
+ self._pool._requests.remove(self._pool_request)
+ closing = self._pool._assign_requests_to_connections()
+
+ self._pool._close_connections(closing)
diff --git a/contrib/python/httpcore/httpcore/_sync/http11.py b/contrib/python/httpcore/httpcore/_sync/http11.py
index 0cc100e3ffd..e108f88b124 100644
--- a/contrib/python/httpcore/httpcore/_sync/http11.py
+++ b/contrib/python/httpcore/httpcore/_sync/http11.py
@@ -10,7 +10,6 @@ from typing import (
Tuple,
Type,
Union,
- cast,
)
import h11
@@ -228,7 +227,7 @@ class HTTP11Connection(ConnectionInterface):
self._h11_state.receive_data(data)
else:
# mypy fails to narrow the type in the above if statement above
- return cast(Union[h11.Event, Type[h11.PAUSED]], event)
+ return event # type: ignore[return-value]
def _response_closed(self) -> None:
with self._state_lock:
diff --git a/contrib/python/httpcore/httpcore/_synchronization.py b/contrib/python/httpcore/httpcore/_synchronization.py
index 119d89fc0d5..9619a398351 100644
--- a/contrib/python/httpcore/httpcore/_synchronization.py
+++ b/contrib/python/httpcore/httpcore/_synchronization.py
@@ -45,6 +45,13 @@ def current_async_library() -> str:
class AsyncLock:
+ """
+ This is a standard lock.
+
+ In the sync case `Lock` provides thread locking.
+ In the async case `AsyncLock` provides async locking.
+ """
+
def __init__(self) -> None:
self._backend = ""
@@ -82,6 +89,26 @@ class AsyncLock:
self._anyio_lock.release()
+class AsyncThreadLock:
+ """
+ This is a threading-only lock for no-I/O contexts.
+
+ In the sync case `ThreadLock` provides thread locking.
+ In the async case `AsyncThreadLock` is a no-op.
+ """
+
+ def __enter__(self) -> "AsyncThreadLock":
+ return self
+
+ def __exit__(
+ self,
+ exc_type: Optional[Type[BaseException]] = None,
+ exc_value: Optional[BaseException] = None,
+ traceback: Optional[TracebackType] = None,
+ ) -> None:
+ pass
+
+
class AsyncEvent:
def __init__(self) -> None:
self._backend = ""
@@ -202,6 +229,13 @@ class AsyncShieldCancellation:
class Lock:
+ """
+ This is a standard lock.
+
+ In the sync case `Lock` provides thread locking.
+ In the async case `AsyncLock` provides async locking.
+ """
+
def __init__(self) -> None:
self._lock = threading.Lock()
@@ -218,6 +252,30 @@ class Lock:
self._lock.release()
+class ThreadLock:
+ """
+ This is a threading-only lock for no-I/O contexts.
+
+ In the sync case `ThreadLock` provides thread locking.
+ In the async case `AsyncThreadLock` is a no-op.
+ """
+
+ def __init__(self) -> None:
+ self._lock = threading.Lock()
+
+ def __enter__(self) -> "ThreadLock":
+ self._lock.acquire()
+ return self
+
+ def __exit__(
+ self,
+ exc_type: Optional[Type[BaseException]] = None,
+ exc_value: Optional[BaseException] = None,
+ traceback: Optional[TracebackType] = None,
+ ) -> None:
+ self._lock.release()
+
+
class Event:
def __init__(self) -> None:
self._event = threading.Event()
diff --git a/contrib/python/httpcore/ya.make b/contrib/python/httpcore/ya.make
index de7a3ac5a2f..e8408ed8933 100644
--- a/contrib/python/httpcore/ya.make
+++ b/contrib/python/httpcore/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(1.0.2)
+VERSION(1.0.3)
LICENSE(BSD-3-Clause)
diff --git a/contrib/python/hypothesis/py3/.dist-info/METADATA b/contrib/python/hypothesis/py3/.dist-info/METADATA
index 04454aaec74..26ae8b84813 100644
--- a/contrib/python/hypothesis/py3/.dist-info/METADATA
+++ b/contrib/python/hypothesis/py3/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: hypothesis
-Version: 6.97.4
+Version: 6.98.8
Summary: A library for property-based testing
Home-page: https://hypothesis.works
Author: David R. MacIver and Zac Hatfield-Dodds
@@ -53,7 +53,7 @@ Requires-Dist: pytz >=2014.1 ; extra == 'all'
Requires-Dist: redis >=3.0.0 ; extra == 'all'
Requires-Dist: rich >=9.0.0 ; extra == 'all'
Requires-Dist: backports.zoneinfo >=0.2.1 ; (python_version < "3.9") and extra == 'all'
-Requires-Dist: tzdata >=2023.4 ; (sys_platform == "win32") and extra == 'all'
+Requires-Dist: tzdata >=2024.1 ; (sys_platform == "win32" or sys_platform == "emscripten") and extra == 'all'
Provides-Extra: cli
Requires-Dist: click >=7.0 ; extra == 'cli'
Requires-Dist: black >=19.10b0 ; extra == 'cli'
@@ -82,7 +82,7 @@ Provides-Extra: redis
Requires-Dist: redis >=3.0.0 ; extra == 'redis'
Provides-Extra: zoneinfo
Requires-Dist: backports.zoneinfo >=0.2.1 ; (python_version < "3.9") and extra == 'zoneinfo'
-Requires-Dist: tzdata >=2023.4 ; (sys_platform == "win32") and extra == 'zoneinfo'
+Requires-Dist: tzdata >=2024.1 ; (sys_platform == "win32" or sys_platform == "emscripten") and extra == 'zoneinfo'
==========
Hypothesis
diff --git a/contrib/python/hypothesis/py3/hypothesis/control.py b/contrib/python/hypothesis/py3/hypothesis/control.py
index 92b26069c5a..ea085b0b551 100644
--- a/contrib/python/hypothesis/py3/hypothesis/control.py
+++ b/contrib/python/hypothesis/py3/hypothesis/control.py
@@ -10,8 +10,10 @@
import inspect
import math
+import random
from collections import defaultdict
-from typing import NoReturn, Union
+from contextlib import contextmanager
+from typing import Any, NoReturn, Union
from weakref import WeakKeyDictionary
from hypothesis import Verbosity, settings
@@ -19,6 +21,7 @@ from hypothesis._settings import note_deprecation
from hypothesis.errors import InvalidArgument, UnsatisfiedAssumption
from hypothesis.internal.compat import BaseExceptionGroup
from hypothesis.internal.conjecture.data import ConjectureData
+from hypothesis.internal.observability import TESTCASE_CALLBACKS
from hypothesis.internal.reflection import get_pretty_function_description
from hypothesis.internal.validation import check_type
from hypothesis.reporting import report, verbose_report
@@ -26,8 +29,9 @@ from hypothesis.utils.dynamicvariables import DynamicVariable
from hypothesis.vendor.pretty import IDKey, pretty
-def _calling_function_name(frame):
- return frame.f_back.f_code.co_name
+def _calling_function_location(what: str, frame: Any) -> str:
+ where = frame.f_back
+ return f"{what}() in {where.f_code.co_name} (line {where.f_lineno})"
def reject() -> NoReturn:
@@ -37,8 +41,11 @@ def reject() -> NoReturn:
since="2023-09-25",
has_codemod=False,
)
- f = _calling_function_name(inspect.currentframe())
- raise UnsatisfiedAssumption(f"reject() in {f}")
+ where = _calling_function_location("reject", inspect.currentframe())
+ if currently_in_test_context():
+ count = current_build_context().data._observability_predicates[where]
+ count["unsatisfied"] += 1
+ raise UnsatisfiedAssumption(where)
def assume(condition: object) -> bool:
@@ -54,9 +61,13 @@ def assume(condition: object) -> bool:
since="2023-09-25",
has_codemod=False,
)
- if not condition:
- f = _calling_function_name(inspect.currentframe())
- raise UnsatisfiedAssumption(f"failed to satisfy assume() in {f}")
+ if TESTCASE_CALLBACKS or not condition:
+ where = _calling_function_location("assume", inspect.currentframe())
+ if TESTCASE_CALLBACKS and currently_in_test_context():
+ predicates = current_build_context().data._observability_predicates
+ predicates[where]["satisfied" if condition else "unsatisfied"] += 1
+ if not condition:
+ raise UnsatisfiedAssumption(f"failed to satisfy {where}")
return True
@@ -82,6 +93,38 @@ def current_build_context() -> "BuildContext":
return context
+class RandomSeeder:
+ def __init__(self, seed):
+ self.seed = seed
+
+ def __repr__(self):
+ return f"RandomSeeder({self.seed!r})"
+
+
+class _Checker:
+ def __init__(self) -> None:
+ self.saw_global_random = False
+
+ def __call__(self, x):
+ self.saw_global_random |= isinstance(x, RandomSeeder)
+ return x
+
+
+@contextmanager
+def deprecate_random_in_strategy(fmt, *args):
+ _global_rand_state = random.getstate()
+ yield (checker := _Checker())
+ if _global_rand_state != random.getstate() and not checker.saw_global_random:
+ # raise InvalidDefinition
+ note_deprecation(
+ "Do not use the `random` module inside strategies; instead "
+ "consider `st.randoms()`, `st.sampled_from()`, etc. " + fmt.format(*args),
+ since="2024-02-05",
+ has_codemod=False,
+ stacklevel=1,
+ )
+
+
class BuildContext:
def __init__(self, data, *, is_final=False, close_on_capture=True):
assert isinstance(data, ConjectureData)
@@ -110,7 +153,8 @@ class BuildContext:
kwargs = {}
for k, s in kwarg_strategies.items():
start_idx = self.data.index
- obj = self.data.draw(s, observe_as=f"generate:{k}")
+ with deprecate_random_in_strategy("from {}={!r}", k, s) as check:
+ obj = check(self.data.draw(s, observe_as=f"generate:{k}"))
end_idx = self.data.index
kwargs[k] = obj
diff --git a/contrib/python/hypothesis/py3/hypothesis/core.py b/contrib/python/hypothesis/py3/hypothesis/core.py
index 601c33e176d..e000da174f3 100644
--- a/contrib/python/hypothesis/py3/hypothesis/core.py
+++ b/contrib/python/hypothesis/py3/hypothesis/core.py
@@ -91,6 +91,7 @@ from hypothesis.internal.healthcheck import fail_health_check
from hypothesis.internal.observability import (
OBSERVABILITY_COLLECT_COVERAGE,
TESTCASE_CALLBACKS,
+ _system_metadata,
deliver_json_blob,
make_testcase,
)
@@ -1066,7 +1067,6 @@ class StateForActualGivenExecution:
string_repr=self._string_repr,
arguments={**self._jsonable_arguments, **data._observability_args},
timing=self._timing_features,
- metadata={},
coverage=tractable_coverage_report(trace) or None,
)
deliver_json_blob(tc)
@@ -1195,7 +1195,11 @@ class StateForActualGivenExecution:
},
"timing": self._timing_features,
"coverage": None, # Not recorded when we're replaying the MFE
- "metadata": {"traceback": tb},
+ "metadata": {
+ "traceback": tb,
+ "predicates": ran_example._observability_predicates,
+ **_system_metadata(),
+ },
}
deliver_json_blob(tc)
# Whether or not replay actually raised the exception again, we want
diff --git a/contrib/python/hypothesis/py3/hypothesis/extra/_patching.py b/contrib/python/hypothesis/py3/hypothesis/extra/_patching.py
index 49b15ebc37e..8f53076d721 100644
--- a/contrib/python/hypothesis/py3/hypothesis/extra/_patching.py
+++ b/contrib/python/hypothesis/py3/hypothesis/extra/_patching.py
@@ -86,7 +86,7 @@ class AddExamplesCodemod(VisitorBasedCodemodCommand):
# Codemod the failing examples to Call nodes usable as decorators
self.fn_examples = {
- k: tuple(self.__call_node_to_example_dec(ex, via) for ex, via in nodes)
+ k: tuple(d for x in nodes if (d := self.__call_node_to_example_dec(*x)))
for k, nodes in fn_examples.items()
}
@@ -94,16 +94,20 @@ class AddExamplesCodemod(VisitorBasedCodemodCommand):
# If we have black installed, remove trailing comma, _unless_ there's a comment
node = node.with_changes(
func=self.decorator_func,
- args=[
- a.with_changes(
- comma=a.comma
- if m.findall(a.comma, m.Comment())
- else cst.MaybeSentinel.DEFAULT
- )
- for a in node.args
- ]
- if black
- else node.args,
+ args=(
+ [
+ a.with_changes(
+ comma=(
+ a.comma
+ if m.findall(a.comma, m.Comment())
+ else cst.MaybeSentinel.DEFAULT
+ )
+ )
+ for a in node.args
+ ]
+ if black
+ else node.args
+ ),
)
# Note: calling a method on a decorator requires PEP-614, i.e. Python 3.9+,
# but plumbing two cases through doesn't seem worth the trouble :-/
@@ -112,10 +116,13 @@ class AddExamplesCodemod(VisitorBasedCodemodCommand):
args=[cst.Arg(cst.SimpleString(repr(via)))],
)
if black: # pragma: no branch
- pretty = black.format_str(
- cst.Module([]).code_for_node(via),
- mode=black.FileMode(line_length=self.line_length),
- )
+ try:
+ pretty = black.format_str(
+ cst.Module([]).code_for_node(via),
+ mode=black.FileMode(line_length=self.line_length),
+ )
+ except ImportError:
+ return None # See https://github.com/psf/black/pull/4224
via = cst.parse_expression(pretty.strip())
return cst.Decorator(via)
diff --git a/contrib/python/hypothesis/py3/hypothesis/extra/codemods.py b/contrib/python/hypothesis/py3/hypothesis/extra/codemods.py
index b2828c31c3b..3de0580ada3 100644
--- a/contrib/python/hypothesis/py3/hypothesis/extra/codemods.py
+++ b/contrib/python/hypothesis/py3/hypothesis/extra/codemods.py
@@ -218,9 +218,11 @@ class HypothesisFixPositionalKeywonlyArgs(VisitorBasedCodemodCommand):
whitespace_after=cst.SimpleWhitespace(""),
)
newargs = [
- arg
- if arg.keyword or arg.star or p.kind is not Parameter.KEYWORD_ONLY
- else arg.with_changes(keyword=cst.Name(p.name), equal=assign_nospace)
+ (
+ arg
+ if arg.keyword or arg.star or p.kind is not Parameter.KEYWORD_ONLY
+ else arg.with_changes(keyword=cst.Name(p.name), equal=assign_nospace)
+ )
for p, arg in zip(params, updated_node.args)
]
return updated_node.with_changes(args=newargs)
diff --git a/contrib/python/hypothesis/py3/hypothesis/extra/ghostwriter.py b/contrib/python/hypothesis/py3/hypothesis/extra/ghostwriter.py
index 68e6a85c294..8917d5bd870 100644
--- a/contrib/python/hypothesis/py3/hypothesis/extra/ghostwriter.py
+++ b/contrib/python/hypothesis/py3/hypothesis/extra/ghostwriter.py
@@ -482,7 +482,6 @@ def _get_params(func: Callable) -> Dict[str, inspect.Parameter]:
kind = inspect.Parameter.KEYWORD_ONLY
continue # we omit *varargs, if there are any
if _iskeyword(arg.lstrip("*")) or not arg.lstrip("*").isidentifier():
- print(repr(args))
break # skip all subsequent params if this name is invalid
params.append(inspect.Parameter(name=arg, kind=kind))
@@ -588,6 +587,8 @@ def _imports_for_object(obj):
"""Return the imports for `obj`, which may be empty for e.g. lambdas"""
if isinstance(obj, (re.Pattern, re.Match)):
return {"re"}
+ if isinstance(obj, st.SearchStrategy):
+ return _imports_for_strategy(obj)
try:
if is_generic_type(obj):
if isinstance(obj, TypeVar):
@@ -606,19 +607,19 @@ def _imports_for_strategy(strategy):
# If we have a lazy from_type strategy, because unwrapping it gives us an
# error or invalid syntax, import that type and we're done.
if isinstance(strategy, LazyStrategy):
- if strategy.function.__name__ in (
- st.from_type.__name__,
- st.from_regex.__name__,
- ):
- return {
- imp
- for arg in set(strategy._LazyStrategy__args)
- | set(strategy._LazyStrategy__kwargs.values())
- for imp in _imports_for_object(arg)
- }
+ imports = {
+ imp
+ for arg in set(strategy._LazyStrategy__args)
+ | set(strategy._LazyStrategy__kwargs.values())
+ for imp in _imports_for_object(_strip_typevars(arg))
+ }
+ if re.match(r"from_(type|regex)\(", repr(strategy)):
+ if repr(strategy).startswith("from_type("):
+ return {module for module, _ in imports}
+ return imports
elif _get_module(strategy.function).startswith("hypothesis.extra."):
module = _get_module(strategy.function).replace("._array_helpers", ".numpy")
- return {(module, strategy.function.__name__)}
+ return {(module, strategy.function.__name__)} | imports
imports = set()
with warnings.catch_warnings():
@@ -672,6 +673,9 @@ def _valid_syntax_repr(strategy):
if isinstance(strategy, OneOfStrategy):
seen = set()
elems = []
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", SmallSearchSpaceWarning)
+ strategy.element_strategies # might warn on first access
for s in strategy.element_strategies:
if isinstance(s, SampledFromStrategy) and s.elements == (os.environ,):
continue
@@ -694,7 +698,11 @@ def _valid_syntax_repr(strategy):
# Return a syntactically-valid strategy repr, including fixing some
# strategy reprs and replacing invalid syntax reprs with `"nothing()"`.
# String-replace to hide the special case in from_type() for Decimal('snan')
- r = repr(strategy).replace(".filter(_can_hash)", "")
+ r = (
+ repr(strategy)
+ .replace(".filter(_can_hash)", "")
+ .replace("hypothesis.strategies.", "")
+ )
# Replace <unknown> with ... in confusing lambdas
r = re.sub(r"(lambda.*?: )(<unknown>)([,)])", r"\1...\3", r)
compile(r, "<string>", "eval")
@@ -724,9 +732,10 @@ def _get_module_helper(obj):
dots = [i for i, c in enumerate(module_name) if c == "."] + [None]
for idx in dots:
- if getattr(sys.modules.get(module_name[:idx]), obj.__name__, None) is obj:
- KNOWN_FUNCTION_LOCATIONS[obj] = module_name[:idx]
- return module_name[:idx]
+ for candidate in (module_name[:idx].lstrip("_"), module_name[:idx]):
+ if getattr(sys.modules.get(candidate), obj.__name__, None) is obj:
+ KNOWN_FUNCTION_LOCATIONS[obj] = candidate
+ return candidate
return module_name
@@ -755,7 +764,7 @@ def _get_qualname(obj, *, include_module=False):
def _write_call(
- func: Callable, *pass_variables: str, except_: Except, assign: str = ""
+ func: Callable, *pass_variables: str, except_: Except = Exception, assign: str = ""
) -> str:
"""Write a call to `func` with explicit and implicit arguments.
@@ -770,9 +779,11 @@ def _write_call(
subtypes of `except_`, which will be handled in an outer try-except block.
"""
args = ", ".join(
- (v or p.name)
- if p.kind is inspect.Parameter.POSITIONAL_ONLY
- else f"{p.name}={v or p.name}"
+ (
+ (v or p.name)
+ if p.kind is inspect.Parameter.POSITIONAL_ONLY
+ else f"{p.name}={v or p.name}"
+ )
for v, p in zip_longest(pass_variables, _get_params(func).values())
)
call = f"{_get_qualname(func, include_module=True)}({args})"
@@ -998,6 +1009,9 @@ def _parameter_to_annotation(parameter: Any) -> Optional[_AnnotationData]:
else:
type_name = str(parameter)
+ if type_name.startswith("hypothesis.strategies."):
+ return _AnnotationData(type_name.replace("hypothesis.strategies", "st"), set())
+
origin_type = get_origin(parameter)
# if not generic or no generic arguments
@@ -1043,9 +1057,6 @@ def _make_test(imports: ImportSet, body: str) -> str:
# Discarding "builtins." and "__main__" probably isn't particularly useful
# for user code, but important for making a good impression in demos.
body = body.replace("builtins.", "").replace("__main__.", "")
- body = body.replace("hypothesis.strategies.", "st.")
- if "st.from_type(typing." in body:
- imports.add("typing")
imports |= {("hypothesis", "given"), ("hypothesis", "strategies as st")}
if " reject()\n" in body:
imports.add(("hypothesis", "reject"))
@@ -1258,11 +1269,29 @@ def magic(
hints = get_type_hints(func)
hints.pop("return", None)
params = _get_params(func)
- if len(hints) == len(params) == 2:
- a, b = hints.values()
+ if (len(hints) == len(params) == 2) or (
+ _get_module(func) == "operator"
+ and "item" not in func.__name__
+ and tuple(params) in [("a", "b"), ("x", "y")]
+ ):
+ a, b = hints.values() or [Any, Any]
arg1, arg2 = params
if a == b and len(arg1) == len(arg2) <= 3:
- make_(_make_binop_body, func, annotate=annotate)
+ # https://en.wikipedia.org/wiki/Distributive_property#Other_examples
+ known = {
+ "mul": "add",
+ "matmul": "add",
+ "or_": "and_",
+ "and_": "or_",
+ }.get(func.__name__, "")
+ distributes_over = getattr(sys.modules[_get_module(func)], known, None)
+ make_(
+ _make_binop_body,
+ func,
+ commutative=func.__name__ != "matmul",
+ distributes_over=distributes_over,
+ annotate=annotate,
+ )
del by_name[name]
# Look for Numpy ufuncs or gufuncs, and write array-oriented tests for them.
@@ -1467,10 +1496,17 @@ def roundtrip(
return _make_test(*_make_roundtrip_body(funcs, except_, style, annotate))
-def _make_equiv_body(funcs, except_, style, annotate):
+def _get_varnames(funcs):
var_names = [f"result_{f.__name__}" for f in funcs]
if len(set(var_names)) < len(var_names):
- var_names = [f"result_{i}_{ f.__name__}" for i, f in enumerate(funcs)]
+ var_names = [f"result_{f.__name__}_{_get_module(f)}" for f in funcs]
+ if len(set(var_names)) < len(var_names):
+ var_names = [f"result_{i}_{f.__name__}" for i, f in enumerate(funcs)]
+ return var_names
+
+
+def _make_equiv_body(funcs, except_, style, annotate):
+ var_names = _get_varnames(funcs)
test_lines = [
_write_call(f, assign=vname, except_=except_)
for vname, f in zip(var_names, funcs)
@@ -1510,10 +1546,7 @@ else:
def _make_equiv_errors_body(funcs, except_, style, annotate):
- var_names = [f"result_{f.__name__}" for f in funcs]
- if len(set(var_names)) < len(var_names):
- var_names = [f"result_{i}_{ f.__name__}" for i, f in enumerate(funcs)]
-
+ var_names = _get_varnames(funcs)
first, *rest = funcs
first_call = _write_call(first, assign=var_names[0], except_=except_)
extra_imports, suppress = _exception_string(except_)
@@ -1713,18 +1746,11 @@ def _make_binop_body(
maker(
"associative",
"abc",
+ _write_call(func, "a", _write_call(func, "b", "c"), assign="left"),
_write_call(
func,
- "a",
- _write_call(func, "b", "c", except_=Exception),
- except_=Exception,
- assign="left",
- ),
- _write_call(
- func,
- _write_call(func, "a", "b", except_=Exception),
+ _write_call(func, "a", "b"),
"c",
- except_=Exception,
assign="right",
),
)
@@ -1732,8 +1758,8 @@ def _make_binop_body(
maker(
"commutative",
"ab",
- _write_call(func, "a", "b", except_=Exception, assign="left"),
- _write_call(func, "b", "a", except_=Exception, assign="right"),
+ _write_call(func, "a", "b", assign="left"),
+ _write_call(func, "b", "a", assign="right"),
)
if identity is not None:
# Guess that the identity element is the minimal example from our operands
@@ -1755,34 +1781,42 @@ def _make_binop_body(
compile(repr(identity), "<string>", "exec")
except SyntaxError:
identity = repr(identity) # type: ignore
- maker(
- "identity",
- "a",
+ identity_parts = [
+ f"{identity = }",
_assert_eq(
style,
"a",
- _write_call(func, "a", repr(identity), except_=Exception),
+ _write_call(func, "a", "identity"),
),
- )
+ _assert_eq(
+ style,
+ "a",
+ _write_call(func, "identity", "a"),
+ ),
+ ]
+ maker("identity", "a", "\n".join(identity_parts))
if distributes_over:
- maker(
- distributes_over.__name__ + "_distributes_over",
- "abc",
+ do = distributes_over
+ dist_parts = [
+ _write_call(func, "a", _write_call(do, "b", "c"), assign="left"),
_write_call(
- distributes_over,
- _write_call(func, "a", "b", except_=Exception),
- _write_call(func, "a", "c", except_=Exception),
- except_=Exception,
- assign="left",
+ do,
+ _write_call(func, "a", "b"),
+ _write_call(func, "a", "c"),
+ assign="ldist",
),
+ _assert_eq(style, "ldist", "left"),
+ "\n",
+ _write_call(func, _write_call(do, "a", "b"), "c", assign="right"),
_write_call(
- func,
- "a",
- _write_call(distributes_over, "b", "c", except_=Exception),
- except_=Exception,
- assign="right",
+ do,
+ _write_call(func, "a", "c"),
+ _write_call(func, "b", "c"),
+ assign="rdist",
),
- )
+ _assert_eq(style, "rdist", "right"),
+ ]
+ maker(do.__name__ + "_distributes_over", "abc", "\n".join(dist_parts))
_, operands_repr = _valid_syntax_repr(operands)
operands_repr = _st_strategy_names(operands_repr)
diff --git a/contrib/python/hypothesis/py3/hypothesis/extra/pandas/impl.py b/contrib/python/hypothesis/py3/hypothesis/extra/pandas/impl.py
index 4801b1ad467..7b53a8be42d 100644
--- a/contrib/python/hypothesis/py3/hypothesis/extra/pandas/impl.py
+++ b/contrib/python/hypothesis/py3/hypothesis/extra/pandas/impl.py
@@ -346,9 +346,11 @@ def series(
return pandas.Series(
(),
index=index,
- dtype=dtype
- if dtype is not None
- else draw(dtype_for_elements_strategy(elements)),
+ dtype=(
+ dtype
+ if dtype is not None
+ else draw(dtype_for_elements_strategy(elements))
+ ),
name=draw(name),
)
diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py
index 8b8462d24d4..cea40823be4 100644
--- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py
+++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py
@@ -30,6 +30,7 @@ from typing import (
Set,
Tuple,
Type,
+ TypedDict,
TypeVar,
Union,
)
@@ -163,6 +164,8 @@ NASTY_FLOATS.extend([-x for x in NASTY_FLOATS])
FLOAT_INIT_LOGIC_CACHE = LRUReusedCache(4096)
+DRAW_STRING_DEFAULT_MAX_SIZE = 10**10 # "arbitrarily large"
+
class Example:
"""Examples track the hierarchical structure of draws from the byte stream,
@@ -794,6 +797,34 @@ global_test_counter = 0
MAX_DEPTH = 100
+class IntegerKWargs(TypedDict):
+ min_value: Optional[int]
+ max_value: Optional[int]
+ weights: Optional[Sequence[float]]
+ shrink_towards: int
+
+
+class FloatKWargs(TypedDict):
+ min_value: float
+ max_value: float
+ allow_nan: bool
+ smallest_nonzero_magnitude: float
+
+
+class StringKWargs(TypedDict):
+ intervals: IntervalSet
+ min_size: int
+ max_size: Optional[int]
+
+
+class BytesKWargs(TypedDict):
+ size: int
+
+
+class BooleanKWargs(TypedDict):
+ p: float
+
+
class DataObserver:
"""Observer class for recording the behaviour of a
ConjectureData object, primarily used for tracking
@@ -810,18 +841,34 @@ class DataObserver:
Note that this is called after ``freeze`` has completed.
"""
- def draw_bits(self, n_bits: int, *, forced: bool, value: int) -> None:
- """Called when ``draw_bits`` is called on on the
- observed ``ConjectureData``.
- * ``n_bits`` is the number of bits drawn.
- * ``forced`` is True if the corresponding
- draw was forced or ``False`` otherwise.
- * ``value`` is the result that ``draw_bits`` returned.
- """
-
def kill_branch(self) -> None:
"""Mark this part of the tree as not worth re-exploring."""
+ def draw_integer(
+ self, value: int, *, was_forced: bool, kwargs: IntegerKWargs
+ ) -> None:
+ pass
+
+ def draw_float(
+ self, value: float, *, was_forced: bool, kwargs: FloatKWargs
+ ) -> None:
+ pass
+
+ def draw_string(
+ self, value: str, *, was_forced: bool, kwargs: StringKWargs
+ ) -> None:
+ pass
+
+ def draw_bytes(
+ self, value: bytes, *, was_forced: bool, kwargs: BytesKWargs
+ ) -> None:
+ pass
+
+ def draw_boolean(
+ self, value: bool, *, was_forced: bool, kwargs: BooleanKWargs
+ ) -> None:
+ pass
+
@dataclass_transform()
@attr.s(slots=True)
@@ -995,7 +1042,7 @@ class PrimitiveProvider:
assert min_value is not None
assert max_value is not None
- sampler = Sampler(weights)
+ sampler = Sampler(weights, observe=False)
gap = max_value - shrink_towards
forced_idx = None
@@ -1023,7 +1070,7 @@ class PrimitiveProvider:
probe = shrink_towards + self._draw_unbounded_integer(
forced=None if forced is None else forced - shrink_towards
)
- self._cd.stop_example(discard=max_value < probe)
+ self._cd.stop_example()
return probe
if max_value is None:
@@ -1034,7 +1081,7 @@ class PrimitiveProvider:
probe = shrink_towards + self._draw_unbounded_integer(
forced=None if forced is None else forced - shrink_towards
)
- self._cd.stop_example(discard=probe < min_value)
+ self._cd.stop_example()
return probe
return self._draw_bounded_integer(
@@ -1091,7 +1138,7 @@ class PrimitiveProvider:
assert pos_clamper is not None
clamped = pos_clamper(result)
if clamped != result and not (math.isnan(result) and allow_nan):
- self._cd.stop_example(discard=True)
+ self._cd.stop_example()
self._cd.start_example(DRAW_FLOAT_LABEL)
self._draw_float(forced=clamped)
result = clamped
@@ -1113,7 +1160,7 @@ class PrimitiveProvider:
forced: Optional[str] = None,
) -> str:
if max_size is None:
- max_size = 10**10 # "arbitrarily large"
+ max_size = DRAW_STRING_DEFAULT_MAX_SIZE
assert forced is None or min_size <= len(forced) <= max_size
@@ -1129,6 +1176,7 @@ class PrimitiveProvider:
max_size=max_size,
average_size=average_size,
forced=None if forced is None else len(forced),
+ observe=False,
)
while elements.more():
forced_i: Optional[int] = None
@@ -1264,7 +1312,7 @@ class PrimitiveProvider:
probe = self._cd.draw_bits(
bits, forced=None if forced is None else abs(forced - center)
)
- self._cd.stop_example(discard=probe > gap)
+ self._cd.stop_example()
if above:
result = center + probe
@@ -1356,7 +1404,7 @@ class PrimitiveProvider:
]
nasty_floats = [f for f in NASTY_FLOATS + boundary_values if permitted(f)]
weights = [0.2 * len(nasty_floats)] + [0.8] * len(nasty_floats)
- sampler = Sampler(weights) if nasty_floats else None
+ sampler = Sampler(weights, observe=False) if nasty_floats else None
pos_clamper = neg_clamper = None
if sign_aware_lte(0.0, max_value):
@@ -1450,6 +1498,9 @@ class ConjectureData:
self.arg_slices: Set[Tuple[int, int]] = set()
self.slice_comments: Dict[Tuple[int, int], str] = {}
self._observability_args: Dict[str, Any] = {}
+ self._observability_predicates: defaultdict = defaultdict(
+ lambda: {"satisfied": 0, "unsatisfied": 0}
+ )
self.extra_information = ExtraInformation()
@@ -1462,6 +1513,19 @@ class ConjectureData:
", frozen" if self.frozen else "",
)
+ # A bit of explanation of the `observe` argument in our draw_* functions.
+ #
+ # There are two types of draws: sub-ir and super-ir. For instance, some ir
+ # nodes use `many`, which in turn calls draw_boolean. But some strategies
+ # also use many, at the super-ir level. We don't want to write sub-ir draws
+ # to the DataTree (and consequently use them when computing novel prefixes),
+ # since they are fully recorded by writing the ir node itself.
+ # But super-ir draws are not included in the ir node, so we do want to write
+ # these to the tree.
+ #
+ # `observe` formalizes this distinction. The draw will only be written to
+ # the DataTree if observe is True.
+
def draw_integer(
self,
min_value: Optional[int] = None,
@@ -1471,6 +1535,7 @@ class ConjectureData:
weights: Optional[Sequence[float]] = None,
shrink_towards: int = 0,
forced: Optional[int] = None,
+ observe: bool = True,
) -> int:
# Validate arguments
if weights is not None:
@@ -1491,13 +1556,18 @@ class ConjectureData:
if forced is not None and max_value is not None:
assert forced <= max_value
- return self.provider.draw_integer(
- min_value=min_value,
- max_value=max_value,
- weights=weights,
- shrink_towards=shrink_towards,
- forced=forced,
- )
+ kwargs: IntegerKWargs = {
+ "min_value": min_value,
+ "max_value": max_value,
+ "weights": weights,
+ "shrink_towards": shrink_towards,
+ }
+ value = self.provider.draw_integer(**kwargs, forced=forced)
+ if observe:
+ self.observer.draw_integer(
+ value, was_forced=forced is not None, kwargs=kwargs
+ )
+ return value
def draw_float(
self,
@@ -1511,6 +1581,7 @@ class ConjectureData:
# width: Literal[16, 32, 64] = 64,
# exclude_min and exclude_max handled higher up,
forced: Optional[float] = None,
+ observe: bool = True,
) -> float:
assert smallest_nonzero_magnitude > 0
assert not math.isnan(min_value)
@@ -1518,15 +1589,22 @@ class ConjectureData:
if forced is not None:
assert allow_nan or not math.isnan(forced)
- assert math.isnan(forced) or min_value <= forced <= max_value
+ assert math.isnan(forced) or (
+ sign_aware_lte(min_value, forced) and sign_aware_lte(forced, max_value)
+ )
- return self.provider.draw_float(
- min_value=min_value,
- max_value=max_value,
- allow_nan=allow_nan,
- smallest_nonzero_magnitude=smallest_nonzero_magnitude,
- forced=forced,
- )
+ kwargs: FloatKWargs = {
+ "min_value": min_value,
+ "max_value": max_value,
+ "allow_nan": allow_nan,
+ "smallest_nonzero_magnitude": smallest_nonzero_magnitude,
+ }
+ value = self.provider.draw_float(**kwargs, forced=forced)
+ if observe:
+ self.observer.draw_float(
+ value, kwargs=kwargs, was_forced=forced is not None
+ )
+ return value
def draw_string(
self,
@@ -1535,19 +1613,44 @@ class ConjectureData:
min_size: int = 0,
max_size: Optional[int] = None,
forced: Optional[str] = None,
+ observe: bool = True,
) -> str:
assert forced is None or min_size <= len(forced)
- return self.provider.draw_string(
- intervals, min_size=min_size, max_size=max_size, forced=forced
- )
- def draw_bytes(self, size: int, *, forced: Optional[bytes] = None) -> bytes:
+ kwargs: StringKWargs = {
+ "intervals": intervals,
+ "min_size": min_size,
+ "max_size": max_size,
+ }
+ value = self.provider.draw_string(**kwargs, forced=forced)
+ if observe:
+ self.observer.draw_string(
+ value, kwargs=kwargs, was_forced=forced is not None
+ )
+ return value
+
+ def draw_bytes(
+ self,
+ # TODO move to min_size and max_size here.
+ size: int,
+ *,
+ forced: Optional[bytes] = None,
+ observe: bool = True,
+ ) -> bytes:
assert forced is None or len(forced) == size
assert size >= 0
- return self.provider.draw_bytes(size, forced=forced)
+ kwargs: BytesKWargs = {"size": size}
+ value = self.provider.draw_bytes(**kwargs, forced=forced)
+ if observe:
+ self.observer.draw_bytes(
+ value, kwargs=kwargs, was_forced=forced is not None
+ )
+ return value
- def draw_boolean(self, p: float = 0.5, *, forced: Optional[bool] = None) -> bool:
+ def draw_boolean(
+ self, p: float = 0.5, *, forced: Optional[bool] = None, observe: bool = True
+ ) -> bool:
# Internally, we treat probabilities lower than 1 / 2**64 as
# unconditionally false.
#
@@ -1558,7 +1661,13 @@ class ConjectureData:
if forced is False:
assert p < (1 - 2 ** (-64))
- return self.provider.draw_boolean(p, forced=forced)
+ kwargs: BooleanKWargs = {"p": p}
+ value = self.provider.draw_boolean(**kwargs, forced=forced)
+ if observe:
+ self.observer.draw_boolean(
+ value, kwargs=kwargs, was_forced=forced is not None
+ )
+ return value
def as_result(self) -> Union[ConjectureResult, _Overrun]:
"""Convert the result of running this test into
@@ -1575,9 +1684,11 @@ class ConjectureData:
examples=self.examples,
blocks=self.blocks,
output=self.output,
- extra_information=self.extra_information
- if self.extra_information.has_information()
- else None,
+ extra_information=(
+ self.extra_information
+ if self.extra_information.has_information()
+ else None
+ ),
has_discards=self.has_discards,
target_observations=self.target_observations,
tags=frozenset(self.tags),
@@ -1730,9 +1841,15 @@ class ConjectureData:
self.buffer = bytes(self.buffer)
self.observer.conclude_test(self.status, self.interesting_origin)
- def choice(self, values: Sequence[T], *, forced: Optional[T] = None) -> T:
+ def choice(
+ self,
+ values: Sequence[T],
+ *,
+ forced: Optional[T] = None,
+ observe: bool = True,
+ ) -> T:
forced_i = None if forced is None else values.index(forced)
- i = self.draw_integer(0, len(values) - 1, forced=forced_i)
+ i = self.draw_integer(0, len(values) - 1, forced=forced_i, observe=observe)
return values[i]
def draw_bits(self, n: int, *, forced: Optional[int] = None) -> int:
@@ -1769,7 +1886,6 @@ class ConjectureData:
buf = bytes(buf)
result = int_from_bytes(buf)
- self.observer.draw_bits(n, forced=forced is not None, value=result)
self.__example_record.draw_bits(n, forced)
initial = self.index
diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/datatree.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/datatree.py
index d82ed3ca67c..a9a6e5b196d 100644
--- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/datatree.py
+++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/datatree.py
@@ -8,17 +8,38 @@
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.
+import itertools
+import math
+from typing import TYPE_CHECKING, List, Literal, Optional, Union
+
import attr
from hypothesis.errors import Flaky, HypothesisException, StopTest
+from hypothesis.internal import floats as flt
from hypothesis.internal.compat import int_to_bytes
from hypothesis.internal.conjecture.data import (
+ BooleanKWargs,
+ BytesKWargs,
ConjectureData,
DataObserver,
+ FloatKWargs,
+ IntegerKWargs,
Status,
- bits_to_bytes,
+ StringKWargs,
)
-from hypothesis.internal.conjecture.junkdrawer import IntList
+from hypothesis.internal.floats import count_between_floats, float_to_int, int_to_float
+
+if TYPE_CHECKING:
+ from typing import TypeAlias
+else:
+ TypeAlias = object
+
+IRType: TypeAlias = Union[int, str, bool, float, bytes]
+IRKWargsType: TypeAlias = Union[
+ IntegerKWargs, FloatKWargs, StringKWargs, BytesKWargs, BooleanKWargs
+]
+# this would be "IRTypeType", but that's just confusing.
+IRLiteralType: TypeAlias = Literal["integer", "string", "boolean", "float", "bytes"]
class PreviouslyUnseenBehaviour(HypothesisException):
@@ -51,12 +72,15 @@ class Branch:
"""Represents a transition where multiple choices can be made as to what
to drawn."""
- bit_length = attr.ib()
+ kwargs = attr.ib()
+ ir_type = attr.ib()
children = attr.ib(repr=False)
@property
def max_children(self):
- return 1 << self.bit_length
+ max_children = compute_max_children(self.ir_type, self.kwargs)
+ assert max_children > 0
+ return max_children
@attr.s(slots=True, frozen=True)
@@ -67,61 +91,276 @@ class Conclusion:
interesting_origin = attr.ib()
+# The number of max children where, beyond this, it is practically impossible
+# for hypothesis to saturate / explore all children nodes in a reasonable time
+# frame. We use this to bail out of expensive max children computations early,
+# where the numbers involved are so large that we know they will be larger than
+# this number.
+#
+# Note that it's ok for us to underestimate the number of max children of a node
+# by using this. We just may think the node is exhausted when in fact it has more
+# possible children to be explored. This has the potential to finish generation
+# early due to exhausting the entire tree, but that is quite unlikely: (1) the
+# number of examples would have to be quite high, and (2) the tree would have to
+# contain only one or two nodes, or generate_novel_prefix would simply switch to
+# exploring another non-exhausted node.
+#
+# Also note that we may sometimes compute max children above this value. In other
+# words, this is *not* a hard maximum on the computed max children. It's the point
+# where further computation is not beneficial - but sometimes doing that computation
+# unconditionally is cheaper than estimating against this value.
+#
+# The one case where this may be detrimental is fuzzing, where the throughput of
+# examples is so high that it really may saturate important nodes. We'll cross
+# that bridge when we come to it.
+MAX_CHILDREN_EFFECTIVELY_INFINITE = 100_000
+
+
+def compute_max_children(ir_type, kwargs):
+ from hypothesis.internal.conjecture.data import DRAW_STRING_DEFAULT_MAX_SIZE
+
+ if ir_type == "integer":
+ min_value = kwargs["min_value"]
+ max_value = kwargs["max_value"]
+ weights = kwargs["weights"]
+
+ if min_value is None and max_value is None:
+ # full 128 bit range.
+ return 2**128 - 1
+ if min_value is not None and max_value is not None:
+ # count between min/max value.
+ n = max_value - min_value + 1
+ # remove any values with a zero probability of being drawn (weight=0).
+ if weights is not None:
+ n -= sum(weight == 0 for weight in weights)
+ return n
+
+ # hard case: only one bound was specified. Here we probe either upwards
+ # or downwards with our full 128 bit generation, but only half of these
+ # (plus one for the case of generating zero) result in a probe in the
+ # direction we want. ((2**128 - 1) // 2) + 1 == 2 ** 127
+ assert (min_value is None) ^ (max_value is None)
+ return 2**127
+ elif ir_type == "boolean":
+ p = kwargs["p"]
+ # probabilities of 0 or 1 (or effectively 0 or 1) only have one choice.
+ if p <= 2 ** (-64) or p >= (1 - 2 ** (-64)):
+ return 1
+ return 2
+ elif ir_type == "bytes":
+ return 2 ** (8 * kwargs["size"])
+ elif ir_type == "string":
+ min_size = kwargs["min_size"]
+ max_size = kwargs["max_size"]
+ intervals = kwargs["intervals"]
+
+ if max_size is None:
+ max_size = DRAW_STRING_DEFAULT_MAX_SIZE
+
+ if len(intervals) == 0:
+ # Special-case the empty alphabet to avoid an error in math.log(0).
+ # Only possibility is the empty string.
+ return 1
+
+ # We want to estimate if we're going to have more children than
+ # MAX_CHILDREN_EFFECTIVELY_INFINITE, without computing a potentially
+ # extremely expensive pow. We'll check if the number of strings in
+ # the largest string size alone is enough to put us over this limit.
+ # We'll also employ a trick of estimating against log, which is cheaper
+ # than computing a pow.
+ #
+ # x = max_size
+ # y = len(intervals)
+ # n = MAX_CHILDREN_EFFECTIVELY_INFINITE
+ #
+ # x**y > n
+ # <=> log(x**y) > log(n)
+ # <=> y * log(x) > log(n)
+
+ # avoid math.log(1) == 0 and incorrectly failing the below estimate,
+ # even when we definitely are too large.
+ if len(intervals) == 1:
+ definitely_too_large = max_size > MAX_CHILDREN_EFFECTIVELY_INFINITE
+ else:
+ definitely_too_large = max_size * math.log(len(intervals)) > math.log(
+ MAX_CHILDREN_EFFECTIVELY_INFINITE
+ )
+
+ if definitely_too_large:
+ return MAX_CHILDREN_EFFECTIVELY_INFINITE
+
+ # number of strings of length k, for each k in [min_size, max_size].
+ return sum(len(intervals) ** k for k in range(min_size, max_size + 1))
+
+ elif ir_type == "float":
+ return count_between_floats(kwargs["min_value"], kwargs["max_value"])
+
+ raise NotImplementedError(f"unhandled ir_type {ir_type}")
+
+
+# In theory, this is a strict superset of the functionality of compute_max_children;
+#
+# assert len(all_children(ir_type, kwargs)) == compute_max_children(ir_type, kwargs)
+#
+# In practice, we maintain two distinct implementations for efficiency and space
+# reasons. If you just need the number of children, it is cheaper to use
+# compute_max_children than to reify the list of children (only to immediately
+# throw it away).
+def all_children(ir_type, kwargs):
+ if ir_type == "integer":
+ min_value = kwargs["min_value"]
+ max_value = kwargs["max_value"]
+ weights = kwargs["weights"]
+ # it's a bit annoying (but completely feasible) to implement the cases
+ # other than "both sides bounded" here. We haven't needed to yet because
+ # in practice we don't struggle with unbounded integer generation.
+ assert min_value is not None
+ assert max_value is not None
+
+ if weights is None:
+ yield from range(min_value, max_value + 1)
+ else:
+ # skip any values with a corresponding weight of 0 (can never be drawn).
+ for weight, n in zip(weights, range(min_value, max_value + 1)):
+ if weight == 0:
+ continue
+ yield n
+
+ if ir_type == "boolean":
+ p = kwargs["p"]
+ if p <= 2 ** (-64):
+ yield False
+ elif p >= (1 - 2 ** (-64)):
+ yield True
+ else:
+ yield from [False, True]
+ if ir_type == "bytes":
+ size = kwargs["size"]
+ yield from (int_to_bytes(i, size) for i in range(2 ** (8 * size)))
+ if ir_type == "string":
+ min_size = kwargs["min_size"]
+ max_size = kwargs["max_size"]
+ intervals = kwargs["intervals"]
+
+ # written unidiomatically in order to handle the case of max_size=inf.
+ size = min_size
+ while size <= max_size:
+ for ords in itertools.product(intervals, repeat=size):
+ yield "".join(chr(n) for n in ords)
+ size += 1
+ if ir_type == "float":
+
+ def floats_between(a, b):
+ for n in range(float_to_int(a), float_to_int(b) + 1):
+ yield int_to_float(n)
+
+ min_value = kwargs["min_value"]
+ max_value = kwargs["max_value"]
+
+ if flt.is_negative(min_value):
+ if flt.is_negative(max_value):
+ # if both are negative, have to invert order
+ yield from floats_between(max_value, min_value)
+ else:
+ yield from floats_between(-0.0, min_value)
+ yield from floats_between(0.0, max_value)
+ else:
+ yield from floats_between(min_value, max_value)
+
+
@attr.s(slots=True)
class TreeNode:
- """Node in a tree that corresponds to previous interactions with
- a ``ConjectureData`` object according to some fixed test function.
-
- This is functionally a variant patricia trie.
- See https://en.wikipedia.org/wiki/Radix_tree for the general idea,
- but what this means in particular here is that we have a very deep
- but very lightly branching tree and rather than store this as a fully
- recursive structure we flatten prefixes and long branches into
- lists. This significantly compacts the storage requirements.
-
- A single ``TreeNode`` corresponds to a previously seen sequence
- of calls to ``ConjectureData`` which we have never seen branch,
- followed by a ``transition`` which describes what happens next.
"""
+ A node, or collection of directly descended nodes, in a DataTree.
+
+ We store the DataTree as a radix tree (https://en.wikipedia.org/wiki/Radix_tree),
+ which means that nodes that are the only child of their parent are collapsed
+ into their parent to save space.
+
+ Conceptually, you can unfold a single TreeNode storing n values in its lists
+ into a sequence of n nodes, each a child of the last. In other words,
+ (kwargs[i], values[i], ir_types[i]) corresponds to the single node at index
+ i.
+
+ Note that if a TreeNode represents a choice (i.e. the nodes cannot be compacted
+ via the radix tree definition), then its lists will be empty and it will
+ store a `Branch` representing that choce in its `transition`.
+
+ Examples
+ --------
+
+ Consider sequentially drawing a boolean, then an integer.
+
+ data.draw_boolean()
+ data.draw_integer(1, 3)
+
+ If we draw True and then 2, the tree may conceptually look like this.
+
+ ┌──────┐
+ │ root │
+ └──┬───┘
+ ┌──┴───┐
+ │ True │
+ └──┬───┘
+ ┌──┴───┐
+ │ 2 │
+ └──────┘
+
+ But since 2 is the only child of True, we will compact these nodes and store
+ them as a single TreeNode.
+
+ ┌──────┐
+ │ root │
+ └──┬───┘
+ ┌────┴──────┐
+ │ [True, 2] │
+ └───────────┘
+
+ If we then draw True and then 3, True will have multiple children and we
+ can no longer store this compacted representation. We would call split_at(0)
+ on the [True, 2] node to indicate that we need to add a choice at 0-index
+ node (True).
- # Records the previous sequence of calls to ``data.draw_bits``,
- # with the ``n_bits`` argument going in ``bit_lengths`` and the
- # values seen in ``values``. These should always have the same
- # length.
- bit_lengths = attr.ib(factory=IntList)
- values = attr.ib(factory=IntList)
-
- # The indices of of the calls to ``draw_bits`` that we have stored
- # where ``forced`` is not None. Stored as None if no indices
- # have been forced, purely for space saving reasons (we force
- # quite rarely).
- __forced = attr.ib(default=None, init=False)
-
- # What happens next after observing this sequence of calls.
- # Either:
+ ┌──────┐
+ │ root │
+ └──┬───┘
+ ┌──┴───┐
+ ┌─┤ True ├─┐
+ │ └──────┘ │
+ ┌─┴─┐ ┌─┴─┐
+ │ 2 │ │ 3 │
+ └───┘ └───┘
+ """
+
+ # The kwargs, value, and ir_types of the nodes stored here. These always
+ # have the same length. The values at index i belong to node i.
+ kwargs: List[IRKWargsType] = attr.ib(factory=list)
+ values: List[IRType] = attr.ib(factory=list)
+ ir_types: List[IRLiteralType] = attr.ib(factory=list)
+
+ # The indices of nodes which had forced values.
#
- # * ``None``, indicating we don't know yet.
- # * A ``Branch`` object indicating that there is a ``draw_bits``
- # call that we have seen take multiple outcomes there.
- # * A ``Conclusion`` object indicating that ``conclude_test``
- # was called here.
- transition = attr.ib(default=None)
-
- # A tree node is exhausted if every possible sequence of
- # draws below it has been explored. We store this information
- # on a field and update it when performing operations that
- # could change the answer.
+ # Stored as None if no indices have been forced, purely for space saving
+ # reasons (we force quite rarely).
+ __forced: Optional[set] = attr.ib(default=None, init=False)
+
+ # What happens next after drawing these nodes. (conceptually, "what is the
+ # child/children of the last node stored here").
#
- # A node may start exhausted, e.g. because it it leads
- # immediately to a conclusion, but can only go from
- # non-exhausted to exhausted when one of its children
- # becomes exhausted or it is marked as a conclusion.
+ # One of:
+ # - None (we don't know yet)
+ # - Branch (we have seen multiple possible outcomes here)
+ # - Conclusion (ConjectureData.conclude_test was called here)
+ # - Killed (this branch is valid and may even have children, but should not
+ # be explored when generating novel prefixes)
+ transition: Union[None, Branch, Conclusion, Killed] = attr.ib(default=None)
+
+ # A tree node is exhausted if every possible sequence of draws below it has
+ # been explored. We only update this when performing operations that could
+ # change the answer.
#
- # Therefore we only need to check whether we need to update
- # this field when the node is first created in ``split_at``
- # or when we have walked a path through this node to a
- # conclusion in ``TreeRecordingObserver``.
- is_exhausted = attr.ib(default=False, init=False)
+ # See also TreeNode.check_exhausted.
+ is_exhausted: bool = attr.ib(default=False, init=False)
@property
def forced(self):
@@ -130,17 +369,21 @@ class TreeNode:
return self.__forced
def mark_forced(self, i):
- """Note that the value at index ``i`` was forced."""
+ """
+ Note that the draw at node i was forced.
+ """
assert 0 <= i < len(self.values)
if self.__forced is None:
self.__forced = set()
self.__forced.add(i)
def split_at(self, i):
- """Splits the tree so that it can incorporate
- a decision at the ``draw_bits`` call corresponding
- to position ``i``, or raises ``Flaky`` if that was
- meant to be a forced node."""
+ """
+ Splits the tree so that it can incorporate a decision at the draw call
+ corresponding to the node at position i.
+
+ Raises Flaky if node i was forced.
+ """
if i in self.forced:
inconsistent_generation()
@@ -150,26 +393,58 @@ class TreeNode:
key = self.values[i]
child = TreeNode(
- bit_lengths=self.bit_lengths[i + 1 :],
+ ir_types=self.ir_types[i + 1 :],
+ kwargs=self.kwargs[i + 1 :],
values=self.values[i + 1 :],
transition=self.transition,
)
- self.transition = Branch(bit_length=self.bit_lengths[i], children={key: child})
+ self.transition = Branch(
+ kwargs=self.kwargs[i], ir_type=self.ir_types[i], children={key: child}
+ )
if self.__forced is not None:
child.__forced = {j - i - 1 for j in self.__forced if j > i}
self.__forced = {j for j in self.__forced if j < i}
child.check_exhausted()
+ del self.ir_types[i:]
del self.values[i:]
- del self.bit_lengths[i:]
- assert len(self.values) == len(self.bit_lengths) == i
+ del self.kwargs[i:]
+ assert len(self.values) == len(self.kwargs) == len(self.ir_types) == i
def check_exhausted(self):
- """Recalculates ``self.is_exhausted`` if necessary then returns
- it."""
+ """
+ Recalculates is_exhausted if necessary, and then returns it.
+
+ A node is exhausted if:
+ - Its transition is Conclusion or Killed
+ - It has the maximum number of children (i.e. we have found all of its
+ possible children), and all its children are exhausted
+
+ Therefore, we only need to compute this for a node when:
+ - We first create it in split_at
+ - We set its transition to either Conclusion or Killed
+ (TreeRecordingObserver.conclude_test or TreeRecordingObserver.kill_branch)
+ - We exhaust any of its children
+ """
+
if (
+ # a node cannot go from is_exhausted -> not is_exhausted.
not self.is_exhausted
- and len(self.forced) == len(self.values)
+ # if we don't know what happens after this node, we don't have
+ # enough information to tell if it's exhausted.
and self.transition is not None
+ # if there are still any nodes left which are the only child of their
+ # parent (len(self.values) > 0), then this TreeNode must be not
+ # exhausted, unless all of those nodes were forced.
+ #
+ # This is because we maintain an invariant of only adding nodes to
+ # DataTree which have at least 2 possible values, so we know that if
+ # they do not have any siblings that we still have more choices to
+ # discover.
+ #
+ # (We actually *do* currently add single-valued nodes to the tree,
+ # but immediately split them into a transition to avoid falsifying
+ # this check. this is a bit of a hack.)
+ and len(self.forced) == len(self.values)
):
if isinstance(self.transition, (Conclusion, Killed)):
self.is_exhausted = True
@@ -181,16 +456,159 @@ class TreeNode:
class DataTree:
- """Tracks the tree structure of a collection of ConjectureData
- objects, for use in ConjectureRunner."""
+ """
+ A DataTree tracks the structured history of draws in some test function,
+ across multiple ConjectureData objects.
+
+ This information is used by ConjectureRunner to generate novel prefixes of
+ this tree (see generate_novel_prefix). A novel prefix is a sequence of draws
+ which the tree has not seen before, and therefore the ConjectureRunner has
+ not generated as an input to the test function before.
+
+ DataTree tracks the following:
+
+ - Draws, at the ir level (with some ir_type, e.g. "integer")
+ - ConjectureData.draw_integer()
+ - ConjectureData.draw_float()
+ - ConjectureData.draw_string()
+ - ConjectureData.draw_boolean()
+ - ConjectureData.draw_bytes()
+ - Test conclusions (with some Status, e.g. Status.VALID)
+ - ConjectureData.conclude_test()
+
+ A DataTree is — surprise — a *tree*. A node in this tree is either a draw with
+ some value, a test conclusion with some Status, or a special `Killed` value,
+ which denotes that further draws may exist beyond this node but should not be
+ considered worth exploring when generating novel prefixes. A node is a leaf
+ iff it is a conclusion or Killed.
+
+ A branch from node A to node B indicates that we have previously seen some
+ sequence (a, b) of draws, where a and b are the values in nodes A and B.
+ Similar intuition holds for conclusion and Killed nodes.
+
+ Examples
+ --------
+
+ To see how a DataTree gets built through successive sets of draws, consider
+ the following code that calls through to some ConjecutreData object `data`.
+ The first call can be either True or False, and the second call can be any
+ integer in the range [1, 3].
+
+ data.draw_boolean()
+ data.draw_integer(1, 3)
+
+ To start, the corresponding DataTree object is completely empty.
+
+ ┌──────┐
+ │ root │
+ └──────┘
+
+ We happen to draw True and then 2 in the above code. The tree tracks this.
+ (2 also connects to a child Conclusion node with Status.VALID since it's the
+ final draw in the code. I'll omit Conclusion nodes in diagrams for brevity.)
+
+ ┌──────┐
+ │ root │
+ └──┬───┘
+ ┌──┴───┐
+ │ True │
+ └──┬───┘
+ ┌──┴───┐
+ │ 2 │
+ └──────┘
+
+ This is a very boring tree so far! But now we happen to draw False and
+ then 1. This causes a split in the tree. Remember, DataTree tracks history
+ over all invocations of a function, not just one. The end goal is to know
+ what invocations haven't been tried yet, after all.
+
+ ┌──────┐
+ ┌───┤ root ├───┐
+ │ └──────┘ │
+ ┌──┴───┐ ┌─┴─────┐
+ │ True │ │ False │
+ └──┬───┘ └──┬────┘
+ ┌─┴─┐ ┌─┴─┐
+ │ 2 │ │ 1 │
+ └───┘ └───┘
+
+ If we were to ask DataTree for a novel prefix at this point, it might
+ generate any of (True, 1), (True, 3), (False, 2), or (False, 3).
+
+ Note that the novel prefix stops as soon as it generates a novel node. For
+ instance, if we had generated a novel prefix back when the tree was only
+ root -> True -> 2, we could have gotten any of (True, 1), (True, 3), or
+ (False). But we could *not* have gotten (False, n), because both False and
+ n were novel at that point, and we stop at the first novel node — False.
+
+ I won't belabor this example. Here's what the tree looks like when fully
+ explored:
+
+ ┌──────┐
+ ┌──────┤ root ├──────┐
+ │ └──────┘ │
+ ┌──┴───┐ ┌─┴─────┐
+ ┌──┤ True ├──┐ ┌───┤ False ├──┐
+ │ └──┬───┘ │ │ └──┬────┘ │
+ ┌─┴─┐ ┌─┴─┐ ┌─┴─┐ ┌─┴─┐ ┌─┴─┐ ┌─┴─┐
+ │ 1 │ │ 2 │ │ 3 │ │ 1 │ │ 2 │ │ 3 │
+ └───┘ └───┘ └───┘ └───┘ └───┘ └───┘
+
+ You could imagine much more complicated trees than this arising in practice,
+ and indeed they do. In particular, the tree need not be balanced or 'nice'
+ like the tree above. For instance,
+
+ b = data.draw_boolean()
+ if b:
+ data.draw_integer(1, 3)
+
+ results in a tree with the entire right part lopped off, and False leading
+ straight to a conclusion node with Status.VALID. As another example,
+
+ n = data.draw_integers()
+ assume(n >= 3)
+ data.draw_string()
+
+ results in a tree with the 0, 1, and 2 nodes leading straight to a
+ conclusion node with Status.INVALID, and the rest branching off into all
+ the possibilities of draw_string.
+
+ Notes
+ -----
+
+ The above examples are slightly simplified and are intended to convey
+ intuition. In practice, there are some implementation details to be aware
+ of.
+
+ - In draw nodes, we store the kwargs used in addition to the value drawn.
+ E.g. the node corresponding to data.draw_float(min_value=1.0, max_value=1.5)
+ would store {"min_value": 1.0, "max_value": 1.5, ...} (default values for
+ other kwargs omitted).
+
+ The kwargs parameters have the potential to change both the range of
+ possible outputs of a node, and the probability distribution within that
+ range, so we need to use these when drawing in DataTree as well. We draw
+ values using these kwargs when (1) generating a novel value for a node
+ and (2) choosing a random child when traversing the tree.
+
+ - For space efficiency, rather than tracking the full tree structure, we
+ store DataTree as a radix tree. This is conceptually equivalent (radix
+ trees can always be "unfolded" to the full tree) but it means the internal
+ representation may differ in practice.
+
+ See TreeNode for more information.
+ """
def __init__(self):
self.root = TreeNode()
+ self._children_cache = {}
@property
def is_exhausted(self):
- """Returns True if every possible node is dead and thus the language
- described must have been fully explored."""
+ """
+ Returns True if every node is exhausted, and therefore the tree has
+ been fully explored.
+ """
return self.root.is_exhausted
def generate_novel_prefix(self, random):
@@ -201,26 +619,43 @@ class DataTree:
for it to be uniform at random, but previous attempts to do that
have proven too expensive.
"""
+
assert not self.is_exhausted
novel_prefix = bytearray()
- def append_int(n_bits, value):
- novel_prefix.extend(int_to_bytes(value, bits_to_bytes(n_bits)))
+ def append_buf(buf):
+ novel_prefix.extend(buf)
current_node = self.root
while True:
assert not current_node.is_exhausted
- for i, (n_bits, value) in enumerate(
- zip(current_node.bit_lengths, current_node.values)
+ for i, (ir_type, kwargs, value) in enumerate(
+ zip(current_node.ir_types, current_node.kwargs, current_node.values)
):
if i in current_node.forced:
- append_int(n_bits, value)
+ if ir_type == "float":
+ value = int_to_float(value)
+ (_value, buf) = self._draw(
+ ir_type, kwargs, forced=value, random=random
+ )
+ append_buf(buf)
else:
+ attempts = 0
while True:
- k = random.getrandbits(n_bits)
- if k != value:
- append_int(n_bits, k)
+ if attempts <= 10:
+ (v, buf) = self._draw(ir_type, kwargs, random=random)
+ else:
+ (v, buf) = self._draw_from_cache(
+ ir_type, kwargs, key=id(current_node), random=random
+ )
+
+ if v != value:
+ append_buf(buf)
break
+ attempts += 1
+ self._reject_child(
+ ir_type, kwargs, child=v, key=id(current_node)
+ )
# We've now found a value that is allowed to
# vary, so what follows is not fixed.
return bytes(novel_prefix)
@@ -230,27 +665,37 @@ class DataTree:
return bytes(novel_prefix)
branch = current_node.transition
assert isinstance(branch, Branch)
- n_bits = branch.bit_length
- check_counter = 0
+ attempts = 0
while True:
- k = random.getrandbits(n_bits)
+ if attempts <= 10:
+ (v, buf) = self._draw(
+ branch.ir_type, branch.kwargs, random=random
+ )
+ else:
+ (v, buf) = self._draw_from_cache(
+ branch.ir_type, branch.kwargs, key=id(branch), random=random
+ )
try:
- child = branch.children[k]
+ child = branch.children[v]
except KeyError:
- append_int(n_bits, k)
+ append_buf(buf)
return bytes(novel_prefix)
if not child.is_exhausted:
- append_int(n_bits, k)
+ append_buf(buf)
current_node = child
break
- check_counter += 1
+ attempts += 1
+ self._reject_child(
+ branch.ir_type, branch.kwargs, child=v, key=id(branch)
+ )
+
# We don't expect this assertion to ever fire, but coverage
# wants the loop inside to run if you have branch checking
# on, hence the pragma.
assert ( # pragma: no cover
- check_counter != 1000
- or len(branch.children) < (2**n_bits)
+ attempts != 1000
+ or len(branch.children) < branch.max_children
or any(not v.is_exhausted for v in branch.children.values())
)
@@ -274,13 +719,22 @@ class DataTree:
or ``start_example`` as these are not currently recorded in the
tree. This will likely change in future."""
node = self.root
+
+ def draw(ir_type, kwargs, *, forced=None):
+ draw_func = getattr(data, f"draw_{ir_type}")
+ value = draw_func(**kwargs, forced=forced)
+
+ if ir_type == "float":
+ value = float_to_int(value)
+ return value
+
try:
while True:
- for i, (n_bits, previous) in enumerate(
- zip(node.bit_lengths, node.values)
+ for i, (ir_type, kwargs, previous) in enumerate(
+ zip(node.ir_types, node.kwargs, node.values)
):
- v = data.draw_bits(
- n_bits, forced=node.values[i] if i in node.forced else None
+ v = draw(
+ ir_type, kwargs, forced=previous if i in node.forced else None
)
if v != previous:
raise PreviouslyUnseenBehaviour
@@ -290,7 +744,7 @@ class DataTree:
elif node.transition is None:
raise PreviouslyUnseenBehaviour
elif isinstance(node.transition, Branch):
- v = data.draw_bits(node.transition.bit_length)
+ v = draw(node.transition.ir_type, node.transition.kwargs)
try:
node = node.transition.children[v]
except KeyError as err:
@@ -305,6 +759,97 @@ class DataTree:
def new_observer(self):
return TreeRecordingObserver(self)
+ def _draw(self, ir_type, kwargs, *, random, forced=None):
+ # we should possibly pull out BUFFER_SIZE to a common file to avoid this
+ # circular import.
+ from hypothesis.internal.conjecture.engine import BUFFER_SIZE
+
+ cd = ConjectureData(max_length=BUFFER_SIZE, prefix=b"", random=random)
+ draw_func = getattr(cd, f"draw_{ir_type}")
+
+ value = draw_func(**kwargs, forced=forced)
+ buf = cd.buffer
+
+ # using floats as keys into branch.children breaks things, because
+ # e.g. hash(0.0) == hash(-0.0) would collide as keys when they are
+ # in fact distinct child branches.
+ # To distinguish floats here we'll use their bits representation. This
+ # entails some bookkeeping such that we're careful about when the
+ # float key is in its bits form (as a key into branch.children) and
+ # when it is in its float form (as a value we want to write to the
+ # buffer), and converting between the two forms as appropriate.
+ if ir_type == "float":
+ value = float_to_int(value)
+ return (value, buf)
+
+ def _get_children_cache(self, ir_type, kwargs, *, key):
+ # cache the state of the children generator per node/branch (passed as
+ # `key` here), such that we track which children we've already tried
+ # for this branch across draws.
+ # We take advantage of python generators here as one-way iterables,
+ # so each time we iterate we implicitly store our position in the
+ # children generator and don't re-draw children. `children` is the
+ # concrete list of children draw from the generator that we will work
+ # with. Whenever we need to top up this list, we will draw a new value
+ # from the generator.
+ if key not in self._children_cache:
+ generator = all_children(ir_type, kwargs)
+ children = []
+ rejected = set()
+ self._children_cache[key] = (generator, children, rejected)
+
+ return self._children_cache[key]
+
+ def _draw_from_cache(self, ir_type, kwargs, *, key, random):
+ (generator, children, rejected) = self._get_children_cache(
+ ir_type, kwargs, key=key
+ )
+ # Keep a stock of 100 potentially-valid children at all times.
+ # This number is chosen to balance memory/speed vs randomness. Ideally
+ # we would sample uniformly from all not-yet-rejected children, but
+ # computing and storing said children is not free.
+ # no-branch because coverage of the fall-through case here is a bit
+ # annoying.
+ if len(children) < 100: # pragma: no branch
+ for v in generator:
+ if ir_type == "float":
+ v = float_to_int(v)
+ if v in rejected:
+ continue
+ children.append(v)
+ if len(children) >= 100:
+ break
+
+ forced = random.choice(children)
+ if ir_type == "float":
+ forced = int_to_float(forced)
+ (value, buf) = self._draw(ir_type, kwargs, forced=forced, random=random)
+ return (value, buf)
+
+ def _reject_child(self, ir_type, kwargs, *, child, key):
+ (_generator, children, rejected) = self._get_children_cache(
+ ir_type, kwargs, key=key
+ )
+ rejected.add(child)
+ # we remove a child from the list of possible children *only* when it is
+ # rejected, and not when it is initially drawn in _draw_from_cache. The
+ # reason is that a child being drawn does not guarantee that child will
+ # be used in a way such that it is written back to the tree, so it needs
+ # to be available for future draws until we are certain it has been
+ # used.
+ #
+ # For instance, if we generated novel prefixes in a loop (but never used
+ # those prefixes to generate new values!) then we don't want to remove
+ # the drawn children from the available pool until they are actually
+ # used.
+ #
+ # This does result in a small inefficiency: we may draw a child,
+ # immediately use it (so we know it cannot be drawn again), but still
+ # wait to draw and reject it here, because DataTree cannot guarantee
+ # the drawn child has been used.
+ if child in children:
+ children.remove(child)
+
class TreeRecordingObserver(DataObserver):
def __init__(self, tree):
@@ -313,13 +858,49 @@ class TreeRecordingObserver(DataObserver):
self.__trail = [self.__current_node]
self.killed = False
- def draw_bits(self, n_bits, forced, value):
+ def draw_integer(
+ self, value: int, *, was_forced: bool, kwargs: IntegerKWargs
+ ) -> None:
+ self.draw_value("integer", value, was_forced=was_forced, kwargs=kwargs)
+
+ def draw_float(
+ self, value: float, *, was_forced: bool, kwargs: FloatKWargs
+ ) -> None:
+ self.draw_value("float", value, was_forced=was_forced, kwargs=kwargs)
+
+ def draw_string(
+ self, value: str, *, was_forced: bool, kwargs: StringKWargs
+ ) -> None:
+ self.draw_value("string", value, was_forced=was_forced, kwargs=kwargs)
+
+ def draw_bytes(
+ self, value: bytes, *, was_forced: bool, kwargs: BytesKWargs
+ ) -> None:
+ self.draw_value("bytes", value, was_forced=was_forced, kwargs=kwargs)
+
+ def draw_boolean(
+ self, value: bool, *, was_forced: bool, kwargs: BooleanKWargs
+ ) -> None:
+ self.draw_value("boolean", value, was_forced=was_forced, kwargs=kwargs)
+
+ def draw_value(
+ self,
+ ir_type: IRLiteralType,
+ value: IRType,
+ *,
+ was_forced: bool,
+ kwargs: IRKWargsType,
+ ) -> None:
i = self.__index_in_current_node
self.__index_in_current_node += 1
node = self.__current_node
- assert len(node.bit_lengths) == len(node.values)
- if i < len(node.bit_lengths):
- if n_bits != node.bit_lengths[i]:
+
+ if isinstance(value, float):
+ value = float_to_int(value)
+
+ assert len(node.kwargs) == len(node.values) == len(node.ir_types)
+ if i < len(node.values):
+ if ir_type != node.ir_types[i] or kwargs != node.kwargs[i]:
inconsistent_generation()
# Note that we don't check whether a previously
# forced value is now free. That will be caught
@@ -327,23 +908,43 @@ class TreeRecordingObserver(DataObserver):
# may pass silently. This is acceptable because it
# means we skip a hash set lookup on every
# draw and that's a pretty niche failure mode.
- if forced and i not in node.forced:
+ if was_forced and i not in node.forced:
inconsistent_generation()
if value != node.values[i]:
node.split_at(i)
assert i == len(node.values)
new_node = TreeNode()
- branch = node.transition
- branch.children[value] = new_node
+ node.transition.children[value] = new_node
self.__current_node = new_node
self.__index_in_current_node = 0
else:
trans = node.transition
if trans is None:
- node.bit_lengths.append(n_bits)
+ node.ir_types.append(ir_type)
+ node.kwargs.append(kwargs)
node.values.append(value)
- if forced:
+ if was_forced:
node.mark_forced(i)
+ # generate_novel_prefix assumes the following invariant: any one
+ # of the series of draws in a particular node can vary, i.e. the
+ # max number of children is at least 2. However, some draws are
+ # pseudo-choices and only have a single value, such as
+ # integers(0, 0).
+ #
+ # Currently, we address this by forcefully splitting such
+ # single-valued nodes into a transition when we see them. An
+ # exception to this is if it was forced: forced pseudo-choices
+ # do not cause the above issue because they inherently cannot
+ # vary, and moreover they trip other invariants about never
+ # splitting forced nodes.
+ #
+ # An alternative is not writing such choices to the tree at
+ # all, and thus guaranteeing that each node has at least 2 max
+ # children.
+ if compute_max_children(ir_type, kwargs) == 1 and not was_forced:
+ node.split_at(i)
+ self.__current_node = node.transition.children[value]
+ self.__index_in_current_node = 0
elif isinstance(trans, Conclusion):
assert trans.status != Status.OVERRUN
# We tried to draw where history says we should have
@@ -351,7 +952,7 @@ class TreeRecordingObserver(DataObserver):
inconsistent_generation()
else:
assert isinstance(trans, Branch), trans
- if n_bits != trans.bit_length:
+ if ir_type != trans.ir_type or kwargs != trans.kwargs:
inconsistent_generation()
try:
self.__current_node = trans.children[value]
diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/engine.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/engine.py
index 99a170ca647..2a011a8b118 100644
--- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/engine.py
+++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/engine.py
@@ -47,6 +47,13 @@ MUTATION_POOL_SIZE = 100
MIN_TEST_CALLS = 10
BUFFER_SIZE = 8 * 1024
+# If the shrinking phase takes more than five minutes, abort it early and print
+# a warning. Many CI systems will kill a build after around ten minutes with
+# no output, and appearing to hang isn't great for interactive use either -
+# showing partially-shrunk examples is better than quitting with no examples!
+# (but make it monkeypatchable, for the rare users who need to keep on shrinking)
+MAX_SHRINKING_SECONDS = 300
+
@attr.s
class HealthCheckState:
@@ -811,9 +818,8 @@ class ConjectureRunner:
)
assert ex1.end <= ex2.start
- replacements = [data.buffer[e.start : e.end] for e in [ex1, ex2]]
-
- replacement = self.random.choice(replacements)
+ e = self.random.choice([ex1, ex2])
+ replacement = data.buffer[e.start : e.end]
try:
# We attempt to replace both the the examples with
@@ -822,7 +828,7 @@ class ConjectureRunner:
# wrong - labels matching are only a best guess as to
# whether the two are equivalent - but it doesn't
# really matter. It may not achieve the desired result
- # but it's still a perfectly acceptable choice sequence.
+ # but it's still a perfectly acceptable choice sequence
# to try.
new_data = self.cached_test_function(
data.buffer[: ex1.start]
@@ -922,7 +928,7 @@ class ConjectureRunner:
)
def new_conjecture_data_for_buffer(self, buffer):
- return ConjectureData.for_buffer(buffer, observer=self.tree.new_observer())
+ return self.new_conjecture_data(buffer, max_length=len(buffer))
def shrink_interesting_examples(self):
"""If we've found interesting examples, try to replace each of them
@@ -935,12 +941,7 @@ class ConjectureRunner:
return
self.debug("Shrinking interesting examples")
-
- # If the shrinking phase takes more than five minutes, abort it early and print
- # a warning. Many CI systems will kill a build after around ten minutes with
- # no output, and appearing to hang isn't great for interactive use either -
- # showing partially-shrunk examples is better than quitting with no examples!
- self.finish_shrinking_deadline = time.perf_counter() + 300
+ self.finish_shrinking_deadline = time.perf_counter() + MAX_SHRINKING_SECONDS
for prev_data in sorted(
self.interesting_examples.values(), key=lambda d: sort_key(d.buffer)
diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/junkdrawer.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/junkdrawer.py
index ec12b028b83..4a2140eccd2 100644
--- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/junkdrawer.py
+++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/junkdrawer.py
@@ -110,12 +110,10 @@ class IntList(Sequence[int]):
return len(self.__underlying)
@overload
- def __getitem__(self, i: int) -> int:
- ... # pragma: no cover
+ def __getitem__(self, i: int) -> int: ... # pragma: no cover
@overload
- def __getitem__(self, i: slice) -> "IntList":
- ... # pragma: no cover
+ def __getitem__(self, i: slice) -> "IntList": ... # pragma: no cover
def __getitem__(self, i: Union[int, slice]) -> "Union[int, IntList]":
if isinstance(i, slice):
@@ -245,7 +243,7 @@ class LazySequenceCopy:
return i
-def clamp(lower: int, value: int, upper: int) -> int:
+def clamp(lower: float, value: float, upper: float) -> float:
"""Given a value and lower/upper bounds, 'clamp' the value so that
it satisfies lower <= value <= upper."""
return max(lower, min(value, upper))
diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/shrinker.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/shrinker.py
index 39a515d2962..b762b89c96a 100644
--- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/shrinker.py
+++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/shrinker.py
@@ -627,16 +627,16 @@ class Shrinker:
# This *can't* be a shrink because none of the components were.
assert shrink_target is self.shrink_target
if result.status == Status.VALID:
- self.shrink_target.slice_comments[
- (0, 0)
- ] = "The test sometimes passed when commented parts were varied together."
+ self.shrink_target.slice_comments[(0, 0)] = (
+ "The test sometimes passed when commented parts were varied together."
+ )
break # Test passed, this param can't vary freely.
elif self.__predicate(result): # pragma: no branch
n_same_failures_together += 1
if n_same_failures_together >= 100:
- self.shrink_target.slice_comments[
- (0, 0)
- ] = "The test always failed when commented parts were varied together."
+ self.shrink_target.slice_comments[(0, 0)] = (
+ "The test always failed when commented parts were varied together."
+ )
break
def greedy_shrink(self):
diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/utils.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/utils.py
index 61f9d742bb0..5e77437a789 100644
--- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/utils.py
+++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/utils.py
@@ -101,13 +101,12 @@ class Sampler:
table: List[Tuple[int, int, float]] # (base_idx, alt_idx, alt_chance)
- def __init__(self, weights: Sequence[float]):
- n = len(weights)
+ def __init__(self, weights: Sequence[float], *, observe: bool = True):
+ self.observe = observe
+ n = len(weights)
table: "list[list[int | float | None]]" = [[i, None, None] for i in range(n)]
-
total = sum(weights)
-
num_type = type(total)
zero = num_type(0) # type: ignore
@@ -179,7 +178,7 @@ class Sampler:
)
)
base, alternate, alternate_chance = data.choice(
- self.table, forced=forced_choice
+ self.table, forced=forced_choice, observe=self.observe
)
forced_use_alternate = None
if forced is not None:
@@ -189,7 +188,9 @@ class Sampler:
forced_use_alternate = forced == alternate and alternate_chance > 0
assert forced == base or forced_use_alternate
- use_alternate = data.draw_boolean(alternate_chance, forced=forced_use_alternate)
+ use_alternate = data.draw_boolean(
+ alternate_chance, forced=forced_use_alternate, observe=self.observe
+ )
data.stop_example()
if use_alternate:
assert forced is None or alternate == forced, (forced, alternate)
@@ -200,7 +201,7 @@ class Sampler:
INT_SIZES = (8, 16, 32, 64, 128)
-INT_SIZES_SAMPLER = Sampler((4.0, 8.0, 1.0, 1.0, 0.5))
+INT_SIZES_SAMPLER = Sampler((4.0, 8.0, 1.0, 1.0, 0.5), observe=False)
class many:
@@ -223,6 +224,7 @@ class many:
average_size: Union[int, float],
*,
forced: Optional[int] = None,
+ observe: bool = True,
) -> None:
assert 0 <= min_size <= average_size <= max_size
assert forced is None or min_size <= forced <= max_size
@@ -236,17 +238,17 @@ class many:
self.drawn = False
self.force_stop = False
self.rejected = False
+ self.observe = observe
def more(self) -> bool:
"""Should I draw another element to add to the collection?"""
if self.drawn:
- self.data.stop_example(discard=self.rejected)
+ self.data.stop_example()
self.drawn = True
self.rejected = False
self.data.start_example(ONE_FROM_MANY_LABEL)
-
if self.min_size == self.max_size:
# if we have to hit an exact size, draw unconditionally until that
# point, and no further.
@@ -265,7 +267,7 @@ class many:
elif self.forced_size is not None:
forced_result = self.count < self.forced_size
should_continue = self.data.draw_boolean(
- self.p_continue, forced=forced_result
+ self.p_continue, forced=forced_result, observe=self.observe
)
if should_continue:
diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/escalation.py b/contrib/python/hypothesis/py3/hypothesis/internal/escalation.py
index 9261d2aefc4..c3c678d2391 100644
--- a/contrib/python/hypothesis/py3/hypothesis/internal/escalation.py
+++ b/contrib/python/hypothesis/py3/hypothesis/internal/escalation.py
@@ -142,9 +142,11 @@ class InterestingOrigin(NamedTuple):
# to support introspection when debugging, so we can use that unconditionally.
cls.from_exception(exception.__context__) if exception.__context__ else (),
# We distinguish exception groups by the inner exceptions, as for __context__
- tuple(map(cls.from_exception, exception.exceptions))
- if isinstance(exception, BaseExceptionGroup)
- else (),
+ (
+ tuple(map(cls.from_exception, exception.exceptions))
+ if isinstance(exception, BaseExceptionGroup)
+ else ()
+ ),
)
diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/observability.py b/contrib/python/hypothesis/py3/hypothesis/internal/observability.py
index eb083f8be19..98753985f10 100644
--- a/contrib/python/hypothesis/py3/hypothesis/internal/observability.py
+++ b/contrib/python/hypothesis/py3/hypothesis/internal/observability.py
@@ -13,8 +13,10 @@
import json
import os
import sys
+import time
import warnings
from datetime import date, timedelta
+from functools import lru_cache
from typing import Callable, Dict, List, Optional
from hypothesis.configuration import storage_directory
@@ -38,7 +40,6 @@ def make_testcase(
string_repr: str = "<unknown>",
arguments: Optional[dict] = None,
timing: Dict[str, float],
- metadata: Optional[dict] = None,
coverage: Optional[Dict[str, List[int]]] = None,
) -> dict:
if data.interesting_origin:
@@ -68,8 +69,9 @@ def make_testcase(
},
"timing": timing,
"metadata": {
- **(metadata or {}),
"traceback": getattr(data.extra_information, "_expected_traceback", None),
+ "predicates": data._observability_predicates,
+ **_system_metadata(),
},
"coverage": coverage,
}
@@ -87,6 +89,18 @@ def _deliver_to_file(value): # pragma: no cover
f.write(json.dumps(value) + "\n")
+_imported_at = time.time()
+
+
+@lru_cache
+def _system_metadata():
+ return {
+ "sys.argv": sys.argv,
+ "os.getpid()": os.getpid(),
+ "imported_at": _imported_at,
+ }
+
+
OBSERVABILITY_COLLECT_COVERAGE = (
"HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY_NOCOVER" not in os.environ
)
diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/reflection.py b/contrib/python/hypothesis/py3/hypothesis/internal/reflection.py
index e62ab28f36a..a829f097be5 100644
--- a/contrib/python/hypothesis/py3/hypothesis/internal/reflection.py
+++ b/contrib/python/hypothesis/py3/hypothesis/internal/reflection.py
@@ -23,6 +23,7 @@ import warnings
from functools import partial, wraps
from io import StringIO
from keyword import iskeyword
+from random import _inst as global_random_instance
from tokenize import COMMENT, detect_encoding, generate_tokens, untokenize
from types import ModuleType
from typing import TYPE_CHECKING, Any, Callable
@@ -446,6 +447,8 @@ def get_pretty_function_description(f):
# Some objects, like `builtins.abs` are of BuiltinMethodType but have
# their module as __self__. This might include c-extensions generally?
if not (self is None or inspect.isclass(self) or inspect.ismodule(self)):
+ if self is global_random_instance:
+ return f"random.{name}"
return f"{self!r}.{name}"
elif isinstance(name, str) and getattr(dict, name, object()) is f:
# special case for keys/values views in from_type() / ghostwriter output
diff --git a/contrib/python/hypothesis/py3/hypothesis/provisional.py b/contrib/python/hypothesis/py3/hypothesis/provisional.py
index dec1abfc612..a6f1c4afc5c 100644
--- a/contrib/python/hypothesis/py3/hypothesis/provisional.py
+++ b/contrib/python/hypothesis/py3/hypothesis/provisional.py
@@ -146,9 +146,11 @@ def domains(
_url_fragments_strategy = (
st.lists(
st.builds(
- lambda char, encode: f"%{ord(char):02X}"
- if (encode or char not in FRAGMENT_SAFE_CHARACTERS)
- else char,
+ lambda char, encode: (
+ f"%{ord(char):02X}"
+ if (encode or char not in FRAGMENT_SAFE_CHARACTERS)
+ else char
+ ),
st.characters(min_codepoint=0, max_codepoint=255),
st.booleans(),
),
diff --git a/contrib/python/hypothesis/py3/hypothesis/stateful.py b/contrib/python/hypothesis/py3/hypothesis/stateful.py
index 39ce653981c..2ae58151617 100644
--- a/contrib/python/hypothesis/py3/hypothesis/stateful.py
+++ b/contrib/python/hypothesis/py3/hypothesis/stateful.py
@@ -116,6 +116,7 @@ def run_state_machine_as_test(state_machine_factory, *, settings=None, _min_step
machine = factory()
check_type(RuleBasedStateMachine, machine, "state_machine_factory()")
cd.hypothesis_runner = machine
+ machine._observability_predicates = cd._observability_predicates # alias
print_steps = (
current_build_context().is_final or current_verbosity() >= Verbosity.debug
@@ -232,11 +233,12 @@ class StateMachineMeta(type):
class RuleBasedStateMachine(metaclass=StateMachineMeta):
"""A RuleBasedStateMachine gives you a structured way to define state machines.
- The idea is that a state machine carries a bunch of types of data
- divided into Bundles, and has a set of rules which may read data
- from bundles (or just from normal strategies) and push data onto
- bundles. At any given point a random applicable rule will be
- executed.
+ The idea is that a state machine carries the system under test and some supporting
+ data. This data can be stored in instance variables or
+ divided into Bundles. The state machine has a set of rules which may read data
+ from bundles (or just from normal strategies), push data onto
+ bundles, change the state of the machine, or verify properties.
+ At any given point a random applicable rule will be executed.
"""
_rules_per_class: ClassVar[Dict[type, List[classmethod]]] = {}
@@ -458,6 +460,27 @@ class BundleReferenceStrategy(SearchStrategy):
class Bundle(SearchStrategy[Ex]):
+ """A collection of values for use in stateful testing.
+
+ Bundles are a kind of strategy where values can be added by rules,
+ and (like any strategy) used as inputs to future rules.
+
+ The ``name`` argument they are passed is the they are referred to
+ internally by the state machine; no two bundles may have
+ the same name. It is idiomatic to use the attribute
+ being assigned to as the name of the Bundle::
+
+ class MyStateMachine(RuleBasedStateMachine):
+ keys = Bundle("keys")
+
+ Bundles can contain the same value more than once; this becomes
+ relevant when using :func:`~hypothesis.stateful.consumes` to remove
+ values again.
+
+ If the ``consume`` argument is set to True, then all values that are
+ drawn from this bundle will be consumed (as above) when requested.
+ """
+
def __init__(self, name: str, *, consume: bool = False) -> None:
self.name = name
self.__reference_strategy = BundleReferenceStrategy(name, consume=consume)
@@ -637,7 +660,7 @@ def rule(
``targets`` will define where the end result of this function should go. If
both are empty then the end result will be discarded.
- ``target`` must be a Bundle, or if the result should go to multiple
+ ``target`` must be a Bundle, or if the result should be replicated to multiple
bundles you can pass a tuple of them as the ``targets`` argument.
It is invalid to use both arguments for a single rule. If the result
should go to exactly one of several bundles, define a separate rule for
@@ -941,8 +964,14 @@ class RuleStrategy(SearchStrategy):
return (rule, data.draw(rule.arguments_strategy))
def is_valid(self, rule):
- if not all(precond(self.machine) for precond in rule.preconditions):
- return False
+ predicates = self.machine._observability_predicates
+ desc = f"{self.machine.__class__.__qualname__}, rule {rule.function.__name__},"
+ for pred in rule.preconditions:
+ meets_precond = pred(self.machine)
+ where = f"{desc} precondition {get_pretty_function_description(pred)}"
+ predicates[where]["satisfied" if meets_precond else "unsatisfied"] += 1
+ if not meets_precond:
+ return False
for b in rule.bundles:
bundle = self.machine.bundle(b.name)
diff --git a/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/core.py b/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/core.py
index 234b8de822e..1efe75caec6 100644
--- a/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/core.py
+++ b/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/core.py
@@ -53,7 +53,13 @@ from uuid import UUID
import attr
from hypothesis._settings import note_deprecation
-from hypothesis.control import cleanup, current_build_context, note
+from hypothesis.control import (
+ RandomSeeder,
+ cleanup,
+ current_build_context,
+ deprecate_random_in_strategy,
+ note,
+)
from hypothesis.errors import (
HypothesisSideeffectWarning,
HypothesisWarning,
@@ -111,7 +117,7 @@ from hypothesis.strategies._internal.collections import (
from hypothesis.strategies._internal.deferred import DeferredStrategy
from hypothesis.strategies._internal.functions import FunctionStrategy
from hypothesis.strategies._internal.lazy import LazyStrategy, unwrap_strategies
-from hypothesis.strategies._internal.misc import just, none, nothing
+from hypothesis.strategies._internal.misc import BooleansStrategy, just, none, nothing
from hypothesis.strategies._internal.numbers import (
IntegersStrategy,
Real,
@@ -152,14 +158,14 @@ else:
@cacheable
-@defines_strategy()
+@defines_strategy(force_reusable_values=True)
def booleans() -> SearchStrategy[bool]:
"""Returns a strategy which generates instances of :class:`python:bool`.
Examples from this strategy will shrink towards ``False`` (i.e.
shrinking will replace ``True`` with ``False`` where possible).
"""
- return SampledFromStrategy([False, True], repr_="booleans()")
+ return BooleansStrategy()
@overload
@@ -998,14 +1004,6 @@ def randoms(
)
-class RandomSeeder:
- def __init__(self, seed):
- self.seed = seed
-
- def __repr__(self):
- return f"RandomSeeder({self.seed!r})"
-
-
class RandomModule(SearchStrategy):
def do_draw(self, data):
# It would be unsafe to do run this method more than once per test case,
@@ -1835,9 +1833,11 @@ def _composite(f):
params = params[1:]
newsig = sig.replace(
parameters=params,
- return_annotation=SearchStrategy
- if sig.return_annotation is sig.empty
- else SearchStrategy[sig.return_annotation],
+ return_annotation=(
+ SearchStrategy
+ if sig.return_annotation is sig.empty
+ else SearchStrategy[sig.return_annotation]
+ ),
)
@defines_strategy()
@@ -2104,6 +2104,10 @@ def runner(*, default: Any = not_set) -> SearchStrategy[Any]:
The exact meaning depends on the entry point, but it will usually be the
associated 'self' value for it.
+ If you are using this in a rule for stateful testing, this strategy
+ will return the instance of the :class:`~hypothesis.stateful.RuleBasedStateMachine`
+ that the rule is running for.
+
If there is no current test runner and a default is provided, return
that default. If no default is provided, raises InvalidArgument.
@@ -2134,7 +2138,8 @@ class DataObject:
self.count += 1
printer = RepresentationPrinter(context=current_build_context())
desc = f"Draw {self.count}{'' if label is None else f' ({label})'}: "
- result = self.conjecture_data.draw(strategy, observe_as=f"generate:{desc}")
+ with deprecate_random_in_strategy("{}from {!r}", desc, strategy):
+ result = self.conjecture_data.draw(strategy, observe_as=f"generate:{desc}")
if TESTCASE_CALLBACKS:
self.conjecture_data._observability_args[desc] = to_jsonable(result)
diff --git a/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/misc.py b/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/misc.py
index ad37107f732..3d0b0c97e08 100644
--- a/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/misc.py
+++ b/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/misc.py
@@ -116,3 +116,11 @@ def nothing() -> SearchStrategy:
Examples from this strategy do not shrink (because there are none).
"""
return NOTHING
+
+
+class BooleansStrategy(SearchStrategy):
+ def do_draw(self, data):
+ return data.draw_boolean()
+
+ def __repr__(self):
+ return "booleans()"
diff --git a/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/utils.py b/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/utils.py
index bd56d2287ea..066c2b65815 100644
--- a/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/utils.py
+++ b/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/utils.py
@@ -17,6 +17,7 @@ import attr
from hypothesis.internal.cache import LRUReusedCache
from hypothesis.internal.compat import dataclass_asdict
+from hypothesis.internal.conjecture.junkdrawer import clamp
from hypothesis.internal.floats import float_to_int
from hypothesis.internal.reflection import proxies
from hypothesis.vendor.pretty import pretty
@@ -160,6 +161,9 @@ def to_jsonable(obj: object) -> object:
"""
if isinstance(obj, (str, int, float, bool, type(None))):
if isinstance(obj, int) and abs(obj) >= 2**63:
+ # Silently clamp very large ints to max_float, to avoid
+ # OverflowError when casting to float.
+ obj = clamp(-sys.float_info.max, obj, sys.float_info.max)
return float(obj)
return obj
if isinstance(obj, (list, tuple, set, frozenset)):
@@ -172,6 +176,14 @@ def to_jsonable(obj: object) -> object:
for k, v in obj.items()
}
+ # Hey, might as well try calling a .to_json() method - it works for Pandas!
+ # We try this before the below general-purpose handlers to give folks a
+ # chance to control this behavior on their custom classes.
+ try:
+ return to_jsonable(obj.to_json()) # type: ignore
+ except Exception:
+ pass
+
# Special handling for dataclasses, attrs, and pydantic classes
if (
(dcs := sys.modules.get("dataclasses"))
@@ -184,11 +196,5 @@ def to_jsonable(obj: object) -> object:
if (pyd := sys.modules.get("pydantic")) and isinstance(obj, pyd.BaseModel):
return to_jsonable(obj.model_dump())
- # Hey, might as well try calling a .to_json() method - it works for Pandas!
- try:
- return to_jsonable(obj.to_json()) # type: ignore
- except Exception:
- pass
-
# If all else fails, we'll just pretty-print as a string.
return pretty(obj)
diff --git a/contrib/python/hypothesis/py3/hypothesis/vendor/pretty.py b/contrib/python/hypothesis/py3/hypothesis/vendor/pretty.py
index 056f1795d33..35451b99611 100644
--- a/contrib/python/hypothesis/py3/hypothesis/vendor/pretty.py
+++ b/contrib/python/hypothesis/py3/hypothesis/vendor/pretty.py
@@ -764,7 +764,7 @@ def for_type_by_name(type_module, type_name, func):
"""Add a pretty printer for a type specified by the module and name of a
type rather than the type object itself."""
key = (type_module, type_name)
- oldfunc = _deferred_type_pprinters.get(key, None)
+ oldfunc = _deferred_type_pprinters.get(key)
_deferred_type_pprinters[key] = func
return oldfunc
diff --git a/contrib/python/hypothesis/py3/hypothesis/vendor/tlds-alpha-by-domain.txt b/contrib/python/hypothesis/py3/hypothesis/vendor/tlds-alpha-by-domain.txt
index 589b768abd4..167e07e0e72 100644
--- a/contrib/python/hypothesis/py3/hypothesis/vendor/tlds-alpha-by-domain.txt
+++ b/contrib/python/hypothesis/py3/hypothesis/vendor/tlds-alpha-by-domain.txt
@@ -1,4 +1,4 @@
-# Version 2023122300, Last Updated Sat Dec 23 07:07:01 2023 UTC
+# Version 2024021000, Last Updated Sat Feb 10 07:07:02 2024 UTC
AAA
AARP
ABB
@@ -96,7 +96,6 @@ BA
BABY
BAIDU
BANAMEX
-BANANAREPUBLIC
BAND
BANK
BAR
@@ -261,7 +260,6 @@ COFFEE
COLLEGE
COLOGNE
COM
-COMCAST
COMMBANK
COMMUNITY
COMPANY
@@ -855,7 +853,6 @@ OFFICE
OKINAWA
OLAYAN
OLAYANGROUP
-OLDNAVY
OLLO
OM
OMEGA
@@ -1276,7 +1273,6 @@ WTC
WTF
XBOX
XEROX
-XFINITY
XIHUAN
XIN
XN--11B4C3D
diff --git a/contrib/python/hypothesis/py3/hypothesis/version.py b/contrib/python/hypothesis/py3/hypothesis/version.py
index 10be5636281..6aafd5421cc 100644
--- a/contrib/python/hypothesis/py3/hypothesis/version.py
+++ b/contrib/python/hypothesis/py3/hypothesis/version.py
@@ -8,5 +8,5 @@
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.
-__version_info__ = (6, 97, 4)
+__version_info__ = (6, 98, 8)
__version__ = ".".join(map(str, __version_info__))
diff --git a/contrib/python/hypothesis/py3/ya.make b/contrib/python/hypothesis/py3/ya.make
index e0530c7a9e0..1678e159c96 100644
--- a/contrib/python/hypothesis/py3/ya.make
+++ b/contrib/python/hypothesis/py3/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(6.97.4)
+VERSION(6.98.8)
LICENSE(MPL-2.0)
diff --git a/contrib/python/numpy/py2/numpy/core/include/numpy/npy_math.h b/contrib/python/numpy/py2/numpy/core/include/numpy/npy_math.h
index 582390cdcb8..71951264fbe 100644
--- a/contrib/python/numpy/py2/numpy/core/include/numpy/npy_math.h
+++ b/contrib/python/numpy/py2/numpy/core/include/numpy/npy_math.h
@@ -7,7 +7,7 @@ extern "C" {
#include <math.h>
#ifdef __SUNPRO_CC
-#include <sunmath.h>
+#error #include <sunmath.h>
#endif
#ifdef HAVE_NPY_CONFIG_H
#include <npy_config.h>
diff --git a/contrib/python/psutil/py2/psutil/_psaix.py b/contrib/python/psutil/py2/psutil/_psaix.py
new file mode 100644
index 00000000000..7160ecd63af
--- /dev/null
+++ b/contrib/python/psutil/py2/psutil/_psaix.py
@@ -0,0 +1,552 @@
+# Copyright (c) 2009, Giampaolo Rodola'
+# Copyright (c) 2017, Arnon Yaari
+# All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""AIX platform implementation."""
+
+import functools
+import glob
+import os
+import re
+import subprocess
+import sys
+from collections import namedtuple
+
+from . import _common
+from . import _psposix
+from . import _psutil_aix as cext
+from . import _psutil_posix as cext_posix
+from ._common import AccessDenied
+from ._common import conn_to_ntuple
+from ._common import get_procfs_path
+from ._common import memoize_when_activated
+from ._common import NIC_DUPLEX_FULL
+from ._common import NIC_DUPLEX_HALF
+from ._common import NIC_DUPLEX_UNKNOWN
+from ._common import NoSuchProcess
+from ._common import usage_percent
+from ._common import ZombieProcess
+from ._compat import FileNotFoundError
+from ._compat import PermissionError
+from ._compat import ProcessLookupError
+from ._compat import PY3
+
+
+__extra__all__ = ["PROCFS_PATH"]
+
+
+# =====================================================================
+# --- globals
+# =====================================================================
+
+
+HAS_THREADS = hasattr(cext, "proc_threads")
+HAS_NET_IO_COUNTERS = hasattr(cext, "net_io_counters")
+HAS_PROC_IO_COUNTERS = hasattr(cext, "proc_io_counters")
+
+PAGE_SIZE = cext_posix.getpagesize()
+AF_LINK = cext_posix.AF_LINK
+
+PROC_STATUSES = {
+ cext.SIDL: _common.STATUS_IDLE,
+ cext.SZOMB: _common.STATUS_ZOMBIE,
+ cext.SACTIVE: _common.STATUS_RUNNING,
+ cext.SSWAP: _common.STATUS_RUNNING, # TODO what status is this?
+ cext.SSTOP: _common.STATUS_STOPPED,
+}
+
+TCP_STATUSES = {
+ cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED,
+ cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT,
+ cext.TCPS_SYN_RCVD: _common.CONN_SYN_RECV,
+ cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1,
+ cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2,
+ cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT,
+ cext.TCPS_CLOSED: _common.CONN_CLOSE,
+ cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT,
+ cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK,
+ cext.TCPS_LISTEN: _common.CONN_LISTEN,
+ cext.TCPS_CLOSING: _common.CONN_CLOSING,
+ cext.PSUTIL_CONN_NONE: _common.CONN_NONE,
+}
+
+proc_info_map = dict(
+ ppid=0,
+ rss=1,
+ vms=2,
+ create_time=3,
+ nice=4,
+ num_threads=5,
+ status=6,
+ ttynr=7)
+
+
+# =====================================================================
+# --- named tuples
+# =====================================================================
+
+
+# psutil.Process.memory_info()
+pmem = namedtuple('pmem', ['rss', 'vms'])
+# psutil.Process.memory_full_info()
+pfullmem = pmem
+# psutil.Process.cpu_times()
+scputimes = namedtuple('scputimes', ['user', 'system', 'idle', 'iowait'])
+# psutil.virtual_memory()
+svmem = namedtuple('svmem', ['total', 'available', 'percent', 'used', 'free'])
+
+
+# =====================================================================
+# --- memory
+# =====================================================================
+
+
+def virtual_memory():
+ total, avail, free, pinned, inuse = cext.virtual_mem()
+ percent = usage_percent((total - avail), total, round_=1)
+ return svmem(total, avail, percent, inuse, free)
+
+
+def swap_memory():
+ """Swap system memory as a (total, used, free, sin, sout) tuple."""
+ total, free, sin, sout = cext.swap_mem()
+ used = total - free
+ percent = usage_percent(used, total, round_=1)
+ return _common.sswap(total, used, free, percent, sin, sout)
+
+
+# =====================================================================
+# --- CPU
+# =====================================================================
+
+
+def cpu_times():
+ """Return system-wide CPU times as a named tuple"""
+ ret = cext.per_cpu_times()
+ return scputimes(*[sum(x) for x in zip(*ret)])
+
+
+def per_cpu_times():
+ """Return system per-CPU times as a list of named tuples"""
+ ret = cext.per_cpu_times()
+ return [scputimes(*x) for x in ret]
+
+
+def cpu_count_logical():
+ """Return the number of logical CPUs in the system."""
+ try:
+ return os.sysconf("SC_NPROCESSORS_ONLN")
+ except ValueError:
+ # mimic os.cpu_count() behavior
+ return None
+
+
+def cpu_count_physical():
+ cmd = "lsdev -Cc processor"
+ p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ if PY3:
+ stdout, stderr = [x.decode(sys.stdout.encoding)
+ for x in (stdout, stderr)]
+ if p.returncode != 0:
+ raise RuntimeError("%r command error\n%s" % (cmd, stderr))
+ processors = stdout.strip().splitlines()
+ return len(processors) or None
+
+
+def cpu_stats():
+ """Return various CPU stats as a named tuple."""
+ ctx_switches, interrupts, soft_interrupts, syscalls = cext.cpu_stats()
+ return _common.scpustats(
+ ctx_switches, interrupts, soft_interrupts, syscalls)
+
+
+# =====================================================================
+# --- disks
+# =====================================================================
+
+
+disk_io_counters = cext.disk_io_counters
+disk_usage = _psposix.disk_usage
+
+
+def disk_partitions(all=False):
+ """Return system disk partitions."""
+ # TODO - the filtering logic should be better checked so that
+ # it tries to reflect 'df' as much as possible
+ retlist = []
+ partitions = cext.disk_partitions()
+ for partition in partitions:
+ device, mountpoint, fstype, opts = partition
+ if device == 'none':
+ device = ''
+ if not all:
+ # Differently from, say, Linux, we don't have a list of
+ # common fs types so the best we can do, AFAIK, is to
+ # filter by filesystem having a total size > 0.
+ if not disk_usage(mountpoint).total:
+ continue
+ maxfile = maxpath = None # set later
+ ntuple = _common.sdiskpart(device, mountpoint, fstype, opts,
+ maxfile, maxpath)
+ retlist.append(ntuple)
+ return retlist
+
+
+# =====================================================================
+# --- network
+# =====================================================================
+
+
+net_if_addrs = cext_posix.net_if_addrs
+
+if HAS_NET_IO_COUNTERS:
+ net_io_counters = cext.net_io_counters
+
+
+def net_connections(kind, _pid=-1):
+ """Return socket connections. If pid == -1 return system-wide
+ connections (as opposed to connections opened by one process only).
+ """
+ cmap = _common.conn_tmap
+ if kind not in cmap:
+ raise ValueError("invalid %r kind argument; choose between %s"
+ % (kind, ', '.join([repr(x) for x in cmap])))
+ families, types = _common.conn_tmap[kind]
+ rawlist = cext.net_connections(_pid)
+ ret = []
+ for item in rawlist:
+ fd, fam, type_, laddr, raddr, status, pid = item
+ if fam not in families:
+ continue
+ if type_ not in types:
+ continue
+ nt = conn_to_ntuple(fd, fam, type_, laddr, raddr, status,
+ TCP_STATUSES, pid=pid if _pid == -1 else None)
+ ret.append(nt)
+ return ret
+
+
+def net_if_stats():
+ """Get NIC stats (isup, duplex, speed, mtu)."""
+ duplex_map = {"Full": NIC_DUPLEX_FULL,
+ "Half": NIC_DUPLEX_HALF}
+ names = set([x[0] for x in net_if_addrs()])
+ ret = {}
+ for name in names:
+ isup, mtu = cext.net_if_stats(name)
+
+ # try to get speed and duplex
+ # TODO: rewrite this in C (entstat forks, so use truss -f to follow.
+ # looks like it is using an undocumented ioctl?)
+ duplex = ""
+ speed = 0
+ p = subprocess.Popen(["/usr/bin/entstat", "-d", name],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ if PY3:
+ stdout, stderr = [x.decode(sys.stdout.encoding)
+ for x in (stdout, stderr)]
+ if p.returncode == 0:
+ re_result = re.search(
+ r"Running: (\d+) Mbps.*?(\w+) Duplex", stdout)
+ if re_result is not None:
+ speed = int(re_result.group(1))
+ duplex = re_result.group(2)
+
+ duplex = duplex_map.get(duplex, NIC_DUPLEX_UNKNOWN)
+ ret[name] = _common.snicstats(isup, duplex, speed, mtu)
+ return ret
+
+
+# =====================================================================
+# --- other system functions
+# =====================================================================
+
+
+def boot_time():
+ """The system boot time expressed in seconds since the epoch."""
+ return cext.boot_time()
+
+
+def users():
+ """Return currently connected users as a list of namedtuples."""
+ retlist = []
+ rawlist = cext.users()
+ localhost = (':0.0', ':0')
+ for item in rawlist:
+ user, tty, hostname, tstamp, user_process, pid = item
+ # note: the underlying C function includes entries about
+ # system boot, run level and others. We might want
+ # to use them in the future.
+ if not user_process:
+ continue
+ if hostname in localhost:
+ hostname = 'localhost'
+ nt = _common.suser(user, tty, hostname, tstamp, pid)
+ retlist.append(nt)
+ return retlist
+
+
+# =====================================================================
+# --- processes
+# =====================================================================
+
+
+def pids():
+ """Returns a list of PIDs currently running on the system."""
+ return [int(x) for x in os.listdir(get_procfs_path()) if x.isdigit()]
+
+
+def pid_exists(pid):
+ """Check for the existence of a unix pid."""
+ return os.path.exists(os.path.join(get_procfs_path(), str(pid), "psinfo"))
+
+
+def wrap_exceptions(fun):
+ """Call callable into a try/except clause and translate ENOENT,
+ EACCES and EPERM in NoSuchProcess or AccessDenied exceptions.
+ """
+ @functools.wraps(fun)
+ def wrapper(self, *args, **kwargs):
+ try:
+ return fun(self, *args, **kwargs)
+ except (FileNotFoundError, ProcessLookupError):
+ # ENOENT (no such file or directory) gets raised on open().
+ # ESRCH (no such process) can get raised on read() if
+ # process is gone in meantime.
+ if not pid_exists(self.pid):
+ raise NoSuchProcess(self.pid, self._name)
+ else:
+ raise ZombieProcess(self.pid, self._name, self._ppid)
+ except PermissionError:
+ raise AccessDenied(self.pid, self._name)
+ return wrapper
+
+
+class Process(object):
+ """Wrapper class around underlying C implementation."""
+
+ __slots__ = ["pid", "_name", "_ppid", "_procfs_path", "_cache"]
+
+ def __init__(self, pid):
+ self.pid = pid
+ self._name = None
+ self._ppid = None
+ self._procfs_path = get_procfs_path()
+
+ def oneshot_enter(self):
+ self._proc_basic_info.cache_activate(self)
+ self._proc_cred.cache_activate(self)
+
+ def oneshot_exit(self):
+ self._proc_basic_info.cache_deactivate(self)
+ self._proc_cred.cache_deactivate(self)
+
+ @wrap_exceptions
+ @memoize_when_activated
+ def _proc_basic_info(self):
+ return cext.proc_basic_info(self.pid, self._procfs_path)
+
+ @wrap_exceptions
+ @memoize_when_activated
+ def _proc_cred(self):
+ return cext.proc_cred(self.pid, self._procfs_path)
+
+ @wrap_exceptions
+ def name(self):
+ if self.pid == 0:
+ return "swapper"
+ # note: max 16 characters
+ return cext.proc_name(self.pid, self._procfs_path).rstrip("\x00")
+
+ @wrap_exceptions
+ def exe(self):
+ # there is no way to get executable path in AIX other than to guess,
+ # and guessing is more complex than what's in the wrapping class
+ cmdline = self.cmdline()
+ if not cmdline:
+ return ''
+ exe = cmdline[0]
+ if os.path.sep in exe:
+ # relative or absolute path
+ if not os.path.isabs(exe):
+ # if cwd has changed, we're out of luck - this may be wrong!
+ exe = os.path.abspath(os.path.join(self.cwd(), exe))
+ if (os.path.isabs(exe) and
+ os.path.isfile(exe) and
+ os.access(exe, os.X_OK)):
+ return exe
+ # not found, move to search in PATH using basename only
+ exe = os.path.basename(exe)
+ # search for exe name PATH
+ for path in os.environ["PATH"].split(":"):
+ possible_exe = os.path.abspath(os.path.join(path, exe))
+ if (os.path.isfile(possible_exe) and
+ os.access(possible_exe, os.X_OK)):
+ return possible_exe
+ return ''
+
+ @wrap_exceptions
+ def cmdline(self):
+ return cext.proc_args(self.pid)
+
+ @wrap_exceptions
+ def environ(self):
+ return cext.proc_environ(self.pid)
+
+ @wrap_exceptions
+ def create_time(self):
+ return self._proc_basic_info()[proc_info_map['create_time']]
+
+ @wrap_exceptions
+ def num_threads(self):
+ return self._proc_basic_info()[proc_info_map['num_threads']]
+
+ if HAS_THREADS:
+ @wrap_exceptions
+ def threads(self):
+ rawlist = cext.proc_threads(self.pid)
+ retlist = []
+ for thread_id, utime, stime in rawlist:
+ ntuple = _common.pthread(thread_id, utime, stime)
+ retlist.append(ntuple)
+ # The underlying C implementation retrieves all OS threads
+ # and filters them by PID. At this point we can't tell whether
+ # an empty list means there were no connections for process or
+ # process is no longer active so we force NSP in case the PID
+ # is no longer there.
+ if not retlist:
+ # will raise NSP if process is gone
+ os.stat('%s/%s' % (self._procfs_path, self.pid))
+ return retlist
+
+ @wrap_exceptions
+ def connections(self, kind='inet'):
+ ret = net_connections(kind, _pid=self.pid)
+ # The underlying C implementation retrieves all OS connections
+ # and filters them by PID. At this point we can't tell whether
+ # an empty list means there were no connections for process or
+ # process is no longer active so we force NSP in case the PID
+ # is no longer there.
+ if not ret:
+ # will raise NSP if process is gone
+ os.stat('%s/%s' % (self._procfs_path, self.pid))
+ return ret
+
+ @wrap_exceptions
+ def nice_get(self):
+ return cext_posix.getpriority(self.pid)
+
+ @wrap_exceptions
+ def nice_set(self, value):
+ return cext_posix.setpriority(self.pid, value)
+
+ @wrap_exceptions
+ def ppid(self):
+ self._ppid = self._proc_basic_info()[proc_info_map['ppid']]
+ return self._ppid
+
+ @wrap_exceptions
+ def uids(self):
+ real, effective, saved, _, _, _ = self._proc_cred()
+ return _common.puids(real, effective, saved)
+
+ @wrap_exceptions
+ def gids(self):
+ _, _, _, real, effective, saved = self._proc_cred()
+ return _common.puids(real, effective, saved)
+
+ @wrap_exceptions
+ def cpu_times(self):
+ cpu_times = cext.proc_cpu_times(self.pid, self._procfs_path)
+ return _common.pcputimes(*cpu_times)
+
+ @wrap_exceptions
+ def terminal(self):
+ ttydev = self._proc_basic_info()[proc_info_map['ttynr']]
+ # convert from 64-bit dev_t to 32-bit dev_t and then map the device
+ ttydev = (((ttydev & 0x0000FFFF00000000) >> 16) | (ttydev & 0xFFFF))
+ # try to match rdev of /dev/pts/* files ttydev
+ for dev in glob.glob("/dev/**/*"):
+ if os.stat(dev).st_rdev == ttydev:
+ return dev
+ return None
+
+ @wrap_exceptions
+ def cwd(self):
+ procfs_path = self._procfs_path
+ try:
+ result = os.readlink("%s/%s/cwd" % (procfs_path, self.pid))
+ return result.rstrip('/')
+ except FileNotFoundError:
+ os.stat("%s/%s" % (procfs_path, self.pid)) # raise NSP or AD
+ return None
+
+ @wrap_exceptions
+ def memory_info(self):
+ ret = self._proc_basic_info()
+ rss = ret[proc_info_map['rss']] * 1024
+ vms = ret[proc_info_map['vms']] * 1024
+ return pmem(rss, vms)
+
+ memory_full_info = memory_info
+
+ @wrap_exceptions
+ def status(self):
+ code = self._proc_basic_info()[proc_info_map['status']]
+ # XXX is '?' legit? (we're not supposed to return it anyway)
+ return PROC_STATUSES.get(code, '?')
+
+ def open_files(self):
+ # TODO rewrite without using procfiles (stat /proc/pid/fd/* and then
+ # find matching name of the inode)
+ p = subprocess.Popen(["/usr/bin/procfiles", "-n", str(self.pid)],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ if PY3:
+ stdout, stderr = [x.decode(sys.stdout.encoding)
+ for x in (stdout, stderr)]
+ if "no such process" in stderr.lower():
+ raise NoSuchProcess(self.pid, self._name)
+ procfiles = re.findall(r"(\d+): S_IFREG.*\s*.*name:(.*)\n", stdout)
+ retlist = []
+ for fd, path in procfiles:
+ path = path.strip()
+ if path.startswith("//"):
+ path = path[1:]
+ if path.lower() == "cannot be retrieved":
+ continue
+ retlist.append(_common.popenfile(path, int(fd)))
+ return retlist
+
+ @wrap_exceptions
+ def num_fds(self):
+ if self.pid == 0: # no /proc/0/fd
+ return 0
+ return len(os.listdir("%s/%s/fd" % (self._procfs_path, self.pid)))
+
+ @wrap_exceptions
+ def num_ctx_switches(self):
+ return _common.pctxsw(
+ *cext.proc_num_ctx_switches(self.pid))
+
+ @wrap_exceptions
+ def wait(self, timeout=None):
+ return _psposix.wait_pid(self.pid, timeout, self._name)
+
+ if HAS_PROC_IO_COUNTERS:
+ @wrap_exceptions
+ def io_counters(self):
+ try:
+ rc, wc, rb, wb = cext.proc_io_counters(self.pid)
+ except OSError:
+ # if process is terminated, proc_io_counters returns OSError
+ # instead of NSP
+ if not pid_exists(self.pid):
+ raise NoSuchProcess(self.pid, self._name)
+ raise
+ return _common.pio(rc, wc, rb, wb)
diff --git a/contrib/python/psutil/py2/psutil/_psbsd.py b/contrib/python/psutil/py2/psutil/_psbsd.py
new file mode 100644
index 00000000000..764463e980e
--- /dev/null
+++ b/contrib/python/psutil/py2/psutil/_psbsd.py
@@ -0,0 +1,917 @@
+# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""FreeBSD, OpenBSD and NetBSD platforms implementation."""
+
+import contextlib
+import errno
+import functools
+import os
+import xml.etree.ElementTree as ET
+from collections import namedtuple
+from collections import defaultdict
+
+from . import _common
+from . import _psposix
+from . import _psutil_bsd as cext
+from . import _psutil_posix as cext_posix
+from ._common import AccessDenied
+from ._common import conn_tmap
+from ._common import conn_to_ntuple
+from ._common import FREEBSD
+from ._common import memoize
+from ._common import memoize_when_activated
+from ._common import NETBSD
+from ._common import NoSuchProcess
+from ._common import OPENBSD
+from ._common import usage_percent
+from ._common import ZombieProcess
+from ._compat import FileNotFoundError
+from ._compat import PermissionError
+from ._compat import ProcessLookupError
+from ._compat import which
+
+
+__extra__all__ = []
+
+
+# =====================================================================
+# --- globals
+# =====================================================================
+
+
+if FREEBSD:
+ PROC_STATUSES = {
+ cext.SIDL: _common.STATUS_IDLE,
+ cext.SRUN: _common.STATUS_RUNNING,
+ cext.SSLEEP: _common.STATUS_SLEEPING,
+ cext.SSTOP: _common.STATUS_STOPPED,
+ cext.SZOMB: _common.STATUS_ZOMBIE,
+ cext.SWAIT: _common.STATUS_WAITING,
+ cext.SLOCK: _common.STATUS_LOCKED,
+ }
+elif OPENBSD:
+ PROC_STATUSES = {
+ cext.SIDL: _common.STATUS_IDLE,
+ cext.SSLEEP: _common.STATUS_SLEEPING,
+ cext.SSTOP: _common.STATUS_STOPPED,
+ # According to /usr/include/sys/proc.h SZOMB is unused.
+ # test_zombie_process() shows that SDEAD is the right
+ # equivalent. Also it appears there's no equivalent of
+ # psutil.STATUS_DEAD. SDEAD really means STATUS_ZOMBIE.
+ # cext.SZOMB: _common.STATUS_ZOMBIE,
+ cext.SDEAD: _common.STATUS_ZOMBIE,
+ cext.SZOMB: _common.STATUS_ZOMBIE,
+ # From http://www.eecs.harvard.edu/~margo/cs161/videos/proc.h.txt
+ # OpenBSD has SRUN and SONPROC: SRUN indicates that a process
+ # is runnable but *not* yet running, i.e. is on a run queue.
+ # SONPROC indicates that the process is actually executing on
+ # a CPU, i.e. it is no longer on a run queue.
+ # As such we'll map SRUN to STATUS_WAKING and SONPROC to
+ # STATUS_RUNNING
+ cext.SRUN: _common.STATUS_WAKING,
+ cext.SONPROC: _common.STATUS_RUNNING,
+ }
+elif NETBSD:
+ PROC_STATUSES = {
+ cext.SIDL: _common.STATUS_IDLE,
+ cext.SSLEEP: _common.STATUS_SLEEPING,
+ cext.SSTOP: _common.STATUS_STOPPED,
+ cext.SZOMB: _common.STATUS_ZOMBIE,
+ cext.SRUN: _common.STATUS_WAKING,
+ cext.SONPROC: _common.STATUS_RUNNING,
+ }
+
+TCP_STATUSES = {
+ cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED,
+ cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT,
+ cext.TCPS_SYN_RECEIVED: _common.CONN_SYN_RECV,
+ cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1,
+ cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2,
+ cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT,
+ cext.TCPS_CLOSED: _common.CONN_CLOSE,
+ cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT,
+ cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK,
+ cext.TCPS_LISTEN: _common.CONN_LISTEN,
+ cext.TCPS_CLOSING: _common.CONN_CLOSING,
+ cext.PSUTIL_CONN_NONE: _common.CONN_NONE,
+}
+
+PAGESIZE = cext_posix.getpagesize()
+AF_LINK = cext_posix.AF_LINK
+
+HAS_PER_CPU_TIMES = hasattr(cext, "per_cpu_times")
+HAS_PROC_NUM_THREADS = hasattr(cext, "proc_num_threads")
+HAS_PROC_OPEN_FILES = hasattr(cext, 'proc_open_files')
+HAS_PROC_NUM_FDS = hasattr(cext, 'proc_num_fds')
+
+kinfo_proc_map = dict(
+ ppid=0,
+ status=1,
+ real_uid=2,
+ effective_uid=3,
+ saved_uid=4,
+ real_gid=5,
+ effective_gid=6,
+ saved_gid=7,
+ ttynr=8,
+ create_time=9,
+ ctx_switches_vol=10,
+ ctx_switches_unvol=11,
+ read_io_count=12,
+ write_io_count=13,
+ user_time=14,
+ sys_time=15,
+ ch_user_time=16,
+ ch_sys_time=17,
+ rss=18,
+ vms=19,
+ memtext=20,
+ memdata=21,
+ memstack=22,
+ cpunum=23,
+ name=24,
+)
+
+
+# =====================================================================
+# --- named tuples
+# =====================================================================
+
+
+# psutil.virtual_memory()
+svmem = namedtuple(
+ 'svmem', ['total', 'available', 'percent', 'used', 'free',
+ 'active', 'inactive', 'buffers', 'cached', 'shared', 'wired'])
+# psutil.cpu_times()
+scputimes = namedtuple(
+ 'scputimes', ['user', 'nice', 'system', 'idle', 'irq'])
+# psutil.Process.memory_info()
+pmem = namedtuple('pmem', ['rss', 'vms', 'text', 'data', 'stack'])
+# psutil.Process.memory_full_info()
+pfullmem = pmem
+# psutil.Process.cpu_times()
+pcputimes = namedtuple('pcputimes',
+ ['user', 'system', 'children_user', 'children_system'])
+# psutil.Process.memory_maps(grouped=True)
+pmmap_grouped = namedtuple(
+ 'pmmap_grouped', 'path rss, private, ref_count, shadow_count')
+# psutil.Process.memory_maps(grouped=False)
+pmmap_ext = namedtuple(
+ 'pmmap_ext', 'addr, perms path rss, private, ref_count, shadow_count')
+# psutil.disk_io_counters()
+if FREEBSD:
+ sdiskio = namedtuple('sdiskio', ['read_count', 'write_count',
+ 'read_bytes', 'write_bytes',
+ 'read_time', 'write_time',
+ 'busy_time'])
+else:
+ sdiskio = namedtuple('sdiskio', ['read_count', 'write_count',
+ 'read_bytes', 'write_bytes'])
+
+
+# =====================================================================
+# --- memory
+# =====================================================================
+
+
+def virtual_memory():
+ """System virtual memory as a namedtuple."""
+ mem = cext.virtual_mem()
+ total, free, active, inactive, wired, cached, buffers, shared = mem
+ if NETBSD:
+ # On NetBSD buffers and shared mem is determined via /proc.
+ # The C ext set them to 0.
+ with open('/proc/meminfo', 'rb') as f:
+ for line in f:
+ if line.startswith(b'Buffers:'):
+ buffers = int(line.split()[1]) * 1024
+ elif line.startswith(b'MemShared:'):
+ shared = int(line.split()[1]) * 1024
+ avail = inactive + cached + free
+ used = active + wired + cached
+ percent = usage_percent((total - avail), total, round_=1)
+ return svmem(total, avail, percent, used, free,
+ active, inactive, buffers, cached, shared, wired)
+
+
+def swap_memory():
+ """System swap memory as (total, used, free, sin, sout) namedtuple."""
+ total, used, free, sin, sout = cext.swap_mem()
+ percent = usage_percent(used, total, round_=1)
+ return _common.sswap(total, used, free, percent, sin, sout)
+
+
+# =====================================================================
+# --- CPU
+# =====================================================================
+
+
+def cpu_times():
+ """Return system per-CPU times as a namedtuple"""
+ user, nice, system, idle, irq = cext.cpu_times()
+ return scputimes(user, nice, system, idle, irq)
+
+
+if HAS_PER_CPU_TIMES:
+ def per_cpu_times():
+ """Return system CPU times as a namedtuple"""
+ ret = []
+ for cpu_t in cext.per_cpu_times():
+ user, nice, system, idle, irq = cpu_t
+ item = scputimes(user, nice, system, idle, irq)
+ ret.append(item)
+ return ret
+else:
+ # XXX
+ # Ok, this is very dirty.
+ # On FreeBSD < 8 we cannot gather per-cpu information, see:
+ # https://github.com/giampaolo/psutil/issues/226
+ # If num cpus > 1, on first call we return single cpu times to avoid a
+ # crash at psutil import time.
+ # Next calls will fail with NotImplementedError
+ def per_cpu_times():
+ """Return system CPU times as a namedtuple"""
+ if cpu_count_logical() == 1:
+ return [cpu_times()]
+ if per_cpu_times.__called__:
+ raise NotImplementedError("supported only starting from FreeBSD 8")
+ per_cpu_times.__called__ = True
+ return [cpu_times()]
+
+ per_cpu_times.__called__ = False
+
+
+def cpu_count_logical():
+ """Return the number of logical CPUs in the system."""
+ return cext.cpu_count_logical()
+
+
+if OPENBSD or NETBSD:
+ def cpu_count_physical():
+ # OpenBSD and NetBSD do not implement this.
+ return 1 if cpu_count_logical() == 1 else None
+else:
+ def cpu_count_physical():
+ """Return the number of physical CPUs in the system."""
+ # From the C module we'll get an XML string similar to this:
+ # http://manpages.ubuntu.com/manpages/precise/man4/smp.4freebsd.html
+ # We may get None in case "sysctl kern.sched.topology_spec"
+ # is not supported on this BSD version, in which case we'll mimic
+ # os.cpu_count() and return None.
+ ret = None
+ s = cext.cpu_count_phys()
+ if s is not None:
+ # get rid of padding chars appended at the end of the string
+ index = s.rfind("</groups>")
+ if index != -1:
+ s = s[:index + 9]
+ root = ET.fromstring(s)
+ try:
+ ret = len(root.findall('group/children/group/cpu')) or None
+ finally:
+ # needed otherwise it will memleak
+ root.clear()
+ if not ret:
+ # If logical CPUs are 1 it's obvious we'll have only 1
+ # physical CPU.
+ if cpu_count_logical() == 1:
+ return 1
+ return ret
+
+
+def cpu_stats():
+ """Return various CPU stats as a named tuple."""
+ if FREEBSD:
+ # Note: the C ext is returning some metrics we are not exposing:
+ # traps.
+ ctxsw, intrs, soft_intrs, syscalls, traps = cext.cpu_stats()
+ elif NETBSD:
+ # XXX
+ # Note about intrs: the C extension returns 0. intrs
+ # can be determined via /proc/stat; it has the same value as
+ # soft_intrs thought so the kernel is faking it (?).
+ #
+ # Note about syscalls: the C extension always sets it to 0 (?).
+ #
+ # Note: the C ext is returning some metrics we are not exposing:
+ # traps, faults and forks.
+ ctxsw, intrs, soft_intrs, syscalls, traps, faults, forks = \
+ cext.cpu_stats()
+ with open('/proc/stat', 'rb') as f:
+ for line in f:
+ if line.startswith(b'intr'):
+ intrs = int(line.split()[1])
+ elif OPENBSD:
+ # Note: the C ext is returning some metrics we are not exposing:
+ # traps, faults and forks.
+ ctxsw, intrs, soft_intrs, syscalls, traps, faults, forks = \
+ cext.cpu_stats()
+ return _common.scpustats(ctxsw, intrs, soft_intrs, syscalls)
+
+
+# =====================================================================
+# --- disks
+# =====================================================================
+
+
+def disk_partitions(all=False):
+ """Return mounted disk partitions as a list of namedtuples.
+ 'all' argument is ignored, see:
+ https://github.com/giampaolo/psutil/issues/906
+ """
+ retlist = []
+ partitions = cext.disk_partitions()
+ for partition in partitions:
+ device, mountpoint, fstype, opts = partition
+ maxfile = maxpath = None # set later
+ ntuple = _common.sdiskpart(device, mountpoint, fstype, opts,
+ maxfile, maxpath)
+ retlist.append(ntuple)
+ return retlist
+
+
+disk_usage = _psposix.disk_usage
+disk_io_counters = cext.disk_io_counters
+
+
+# =====================================================================
+# --- network
+# =====================================================================
+
+
+net_io_counters = cext.net_io_counters
+net_if_addrs = cext_posix.net_if_addrs
+
+
+def net_if_stats():
+ """Get NIC stats (isup, duplex, speed, mtu)."""
+ names = net_io_counters().keys()
+ ret = {}
+ for name in names:
+ try:
+ mtu = cext_posix.net_if_mtu(name)
+ isup = cext_posix.net_if_is_running(name)
+ duplex, speed = cext_posix.net_if_duplex_speed(name)
+ except OSError as err:
+ # https://github.com/giampaolo/psutil/issues/1279
+ if err.errno != errno.ENODEV:
+ raise
+ else:
+ if hasattr(_common, 'NicDuplex'):
+ duplex = _common.NicDuplex(duplex)
+ ret[name] = _common.snicstats(isup, duplex, speed, mtu)
+ return ret
+
+
+def net_connections(kind):
+ """System-wide network connections."""
+ if OPENBSD:
+ ret = []
+ for pid in pids():
+ try:
+ cons = Process(pid).connections(kind)
+ except (NoSuchProcess, ZombieProcess):
+ continue
+ else:
+ for conn in cons:
+ conn = list(conn)
+ conn.append(pid)
+ ret.append(_common.sconn(*conn))
+ return ret
+
+ if kind not in _common.conn_tmap:
+ raise ValueError("invalid %r kind argument; choose between %s"
+ % (kind, ', '.join([repr(x) for x in conn_tmap])))
+ families, types = conn_tmap[kind]
+ ret = set()
+ if NETBSD:
+ rawlist = cext.net_connections(-1)
+ else:
+ rawlist = cext.net_connections()
+ for item in rawlist:
+ fd, fam, type, laddr, raddr, status, pid = item
+ # TODO: apply filter at C level
+ if fam in families and type in types:
+ nt = conn_to_ntuple(fd, fam, type, laddr, raddr, status,
+ TCP_STATUSES, pid)
+ ret.add(nt)
+ return list(ret)
+
+
+# =====================================================================
+# --- sensors
+# =====================================================================
+
+
+if FREEBSD:
+
+ def sensors_battery():
+ """Return battery info."""
+ try:
+ percent, minsleft, power_plugged = cext.sensors_battery()
+ except NotImplementedError:
+ # See: https://github.com/giampaolo/psutil/issues/1074
+ return None
+ power_plugged = power_plugged == 1
+ if power_plugged:
+ secsleft = _common.POWER_TIME_UNLIMITED
+ elif minsleft == -1:
+ secsleft = _common.POWER_TIME_UNKNOWN
+ else:
+ secsleft = minsleft * 60
+ return _common.sbattery(percent, secsleft, power_plugged)
+
+ def sensors_temperatures():
+ "Return CPU cores temperatures if available, else an empty dict."
+ ret = defaultdict(list)
+ num_cpus = cpu_count_logical()
+ for cpu in range(num_cpus):
+ try:
+ current, high = cext.sensors_cpu_temperature(cpu)
+ if high <= 0:
+ high = None
+ name = "Core %s" % cpu
+ ret["coretemp"].append(
+ _common.shwtemp(name, current, high, high))
+ except NotImplementedError:
+ pass
+
+ return ret
+
+ def cpu_freq():
+ """Return frequency metrics for CPUs. As of Dec 2018 only
+ CPU 0 appears to be supported by FreeBSD and all other cores
+ match the frequency of CPU 0.
+ """
+ ret = []
+ num_cpus = cpu_count_logical()
+ for cpu in range(num_cpus):
+ try:
+ current, available_freq = cext.cpu_frequency(cpu)
+ except NotImplementedError:
+ continue
+ if available_freq:
+ try:
+ min_freq = int(available_freq.split(" ")[-1].split("/")[0])
+ except(IndexError, ValueError):
+ min_freq = None
+ try:
+ max_freq = int(available_freq.split(" ")[0].split("/")[0])
+ except(IndexError, ValueError):
+ max_freq = None
+ ret.append(_common.scpufreq(current, min_freq, max_freq))
+ return ret
+
+
+# =====================================================================
+# --- other system functions
+# =====================================================================
+
+
+def boot_time():
+ """The system boot time expressed in seconds since the epoch."""
+ return cext.boot_time()
+
+
+def users():
+ """Return currently connected users as a list of namedtuples."""
+ retlist = []
+ rawlist = cext.users()
+ for item in rawlist:
+ user, tty, hostname, tstamp, pid = item
+ if pid == -1:
+ assert OPENBSD
+ pid = None
+ if tty == '~':
+ continue # reboot or shutdown
+ nt = _common.suser(user, tty or None, hostname, tstamp, pid)
+ retlist.append(nt)
+ return retlist
+
+
+# =====================================================================
+# --- processes
+# =====================================================================
+
+
+@memoize
+def _pid_0_exists():
+ try:
+ Process(0).name()
+ except NoSuchProcess:
+ return False
+ except AccessDenied:
+ return True
+ else:
+ return True
+
+
+def pids():
+ """Returns a list of PIDs currently running on the system."""
+ ret = cext.pids()
+ if OPENBSD and (0 not in ret) and _pid_0_exists():
+ # On OpenBSD the kernel does not return PID 0 (neither does
+ # ps) but it's actually querable (Process(0) will succeed).
+ ret.insert(0, 0)
+ return ret
+
+
+if OPENBSD or NETBSD:
+ def pid_exists(pid):
+ """Return True if pid exists."""
+ exists = _psposix.pid_exists(pid)
+ if not exists:
+ # We do this because _psposix.pid_exists() lies in case of
+ # zombie processes.
+ return pid in pids()
+ else:
+ return True
+else:
+ pid_exists = _psposix.pid_exists
+
+
+def is_zombie(pid):
+ try:
+ st = cext.proc_oneshot_info(pid)[kinfo_proc_map['status']]
+ return st == cext.SZOMB
+ except Exception:
+ return False
+
+
+def wrap_exceptions(fun):
+ """Decorator which translates bare OSError exceptions into
+ NoSuchProcess and AccessDenied.
+ """
+ @functools.wraps(fun)
+ def wrapper(self, *args, **kwargs):
+ try:
+ return fun(self, *args, **kwargs)
+ except ProcessLookupError:
+ if is_zombie(self.pid):
+ raise ZombieProcess(self.pid, self._name, self._ppid)
+ else:
+ raise NoSuchProcess(self.pid, self._name)
+ except PermissionError:
+ raise AccessDenied(self.pid, self._name)
+ except OSError:
+ if self.pid == 0:
+ if 0 in pids():
+ raise AccessDenied(self.pid, self._name)
+ else:
+ raise
+ raise
+ return wrapper
+
+
+def wrap_exceptions_procfs(inst):
+ """Same as above, for routines relying on reading /proc fs."""
+ try:
+ yield
+ except (ProcessLookupError, FileNotFoundError):
+ # ENOENT (no such file or directory) gets raised on open().
+ # ESRCH (no such process) can get raised on read() if
+ # process is gone in meantime.
+ if is_zombie(inst.pid):
+ raise ZombieProcess(inst.pid, inst._name, inst._ppid)
+ else:
+ raise NoSuchProcess(inst.pid, inst._name)
+ except PermissionError:
+ raise AccessDenied(inst.pid, inst._name)
+
+
+class Process(object):
+ """Wrapper class around underlying C implementation."""
+
+ __slots__ = ["pid", "_name", "_ppid", "_cache"]
+
+ def __init__(self, pid):
+ self.pid = pid
+ self._name = None
+ self._ppid = None
+
+ def _assert_alive(self):
+ """Raise NSP if the process disappeared on us."""
+ # For those C function who do not raise NSP, possibly returning
+ # incorrect or incomplete result.
+ cext.proc_name(self.pid)
+
+ @wrap_exceptions
+ @memoize_when_activated
+ def oneshot(self):
+ """Retrieves multiple process info in one shot as a raw tuple."""
+ ret = cext.proc_oneshot_info(self.pid)
+ assert len(ret) == len(kinfo_proc_map)
+ return ret
+
+ def oneshot_enter(self):
+ self.oneshot.cache_activate(self)
+
+ def oneshot_exit(self):
+ self.oneshot.cache_deactivate(self)
+
+ @wrap_exceptions
+ def name(self):
+ name = self.oneshot()[kinfo_proc_map['name']]
+ return name if name is not None else cext.proc_name(self.pid)
+
+ @wrap_exceptions
+ def exe(self):
+ if FREEBSD:
+ if self.pid == 0:
+ return '' # else NSP
+ return cext.proc_exe(self.pid)
+ elif NETBSD:
+ if self.pid == 0:
+ # /proc/0 dir exists but /proc/0/exe doesn't
+ return ""
+ with wrap_exceptions_procfs(self):
+ return os.readlink("/proc/%s/exe" % self.pid)
+ else:
+ # OpenBSD: exe cannot be determined; references:
+ # https://chromium.googlesource.com/chromium/src/base/+/
+ # master/base_paths_posix.cc
+ # We try our best guess by using which against the first
+ # cmdline arg (may return None).
+ cmdline = self.cmdline()
+ if cmdline:
+ return which(cmdline[0]) or ""
+ else:
+ return ""
+
+ @wrap_exceptions
+ def cmdline(self):
+ if OPENBSD and self.pid == 0:
+ return [] # ...else it crashes
+ elif NETBSD:
+ # XXX - most of the times the underlying sysctl() call on Net
+ # and Open BSD returns a truncated string.
+ # Also /proc/pid/cmdline behaves the same so it looks
+ # like this is a kernel bug.
+ try:
+ return cext.proc_cmdline(self.pid)
+ except OSError as err:
+ if err.errno == errno.EINVAL:
+ if is_zombie(self.pid):
+ raise ZombieProcess(self.pid, self._name, self._ppid)
+ elif not pid_exists(self.pid):
+ raise NoSuchProcess(self.pid, self._name, self._ppid)
+ else:
+ # XXX: this happens with unicode tests. It means the C
+ # routine is unable to decode invalid unicode chars.
+ return []
+ else:
+ raise
+ else:
+ return cext.proc_cmdline(self.pid)
+
+ @wrap_exceptions
+ def environ(self):
+ return cext.proc_environ(self.pid)
+
+ @wrap_exceptions
+ def terminal(self):
+ tty_nr = self.oneshot()[kinfo_proc_map['ttynr']]
+ tmap = _psposix.get_terminal_map()
+ try:
+ return tmap[tty_nr]
+ except KeyError:
+ return None
+
+ @wrap_exceptions
+ def ppid(self):
+ self._ppid = self.oneshot()[kinfo_proc_map['ppid']]
+ return self._ppid
+
+ @wrap_exceptions
+ def uids(self):
+ rawtuple = self.oneshot()
+ return _common.puids(
+ rawtuple[kinfo_proc_map['real_uid']],
+ rawtuple[kinfo_proc_map['effective_uid']],
+ rawtuple[kinfo_proc_map['saved_uid']])
+
+ @wrap_exceptions
+ def gids(self):
+ rawtuple = self.oneshot()
+ return _common.pgids(
+ rawtuple[kinfo_proc_map['real_gid']],
+ rawtuple[kinfo_proc_map['effective_gid']],
+ rawtuple[kinfo_proc_map['saved_gid']])
+
+ @wrap_exceptions
+ def cpu_times(self):
+ rawtuple = self.oneshot()
+ return _common.pcputimes(
+ rawtuple[kinfo_proc_map['user_time']],
+ rawtuple[kinfo_proc_map['sys_time']],
+ rawtuple[kinfo_proc_map['ch_user_time']],
+ rawtuple[kinfo_proc_map['ch_sys_time']])
+
+ if FREEBSD:
+ @wrap_exceptions
+ def cpu_num(self):
+ return self.oneshot()[kinfo_proc_map['cpunum']]
+
+ @wrap_exceptions
+ def memory_info(self):
+ rawtuple = self.oneshot()
+ return pmem(
+ rawtuple[kinfo_proc_map['rss']],
+ rawtuple[kinfo_proc_map['vms']],
+ rawtuple[kinfo_proc_map['memtext']],
+ rawtuple[kinfo_proc_map['memdata']],
+ rawtuple[kinfo_proc_map['memstack']])
+
+ memory_full_info = memory_info
+
+ @wrap_exceptions
+ def create_time(self):
+ return self.oneshot()[kinfo_proc_map['create_time']]
+
+ @wrap_exceptions
+ def num_threads(self):
+ if HAS_PROC_NUM_THREADS:
+ # FreeBSD
+ return cext.proc_num_threads(self.pid)
+ else:
+ return len(self.threads())
+
+ @wrap_exceptions
+ def num_ctx_switches(self):
+ rawtuple = self.oneshot()
+ return _common.pctxsw(
+ rawtuple[kinfo_proc_map['ctx_switches_vol']],
+ rawtuple[kinfo_proc_map['ctx_switches_unvol']])
+
+ @wrap_exceptions
+ def threads(self):
+ # Note: on OpenSBD this (/dev/mem) requires root access.
+ rawlist = cext.proc_threads(self.pid)
+ retlist = []
+ for thread_id, utime, stime in rawlist:
+ ntuple = _common.pthread(thread_id, utime, stime)
+ retlist.append(ntuple)
+ if OPENBSD:
+ self._assert_alive()
+ return retlist
+
+ @wrap_exceptions
+ def connections(self, kind='inet'):
+ if kind not in conn_tmap:
+ raise ValueError("invalid %r kind argument; choose between %s"
+ % (kind, ', '.join([repr(x) for x in conn_tmap])))
+
+ if NETBSD:
+ families, types = conn_tmap[kind]
+ ret = []
+ rawlist = cext.net_connections(self.pid)
+ for item in rawlist:
+ fd, fam, type, laddr, raddr, status, pid = item
+ assert pid == self.pid
+ if fam in families and type in types:
+ nt = conn_to_ntuple(fd, fam, type, laddr, raddr, status,
+ TCP_STATUSES)
+ ret.append(nt)
+ self._assert_alive()
+ return list(ret)
+
+ families, types = conn_tmap[kind]
+ rawlist = cext.proc_connections(self.pid, families, types)
+ ret = []
+ for item in rawlist:
+ fd, fam, type, laddr, raddr, status = item
+ nt = conn_to_ntuple(fd, fam, type, laddr, raddr, status,
+ TCP_STATUSES)
+ ret.append(nt)
+
+ if OPENBSD:
+ self._assert_alive()
+
+ return ret
+
+ @wrap_exceptions
+ def wait(self, timeout=None):
+ return _psposix.wait_pid(self.pid, timeout, self._name)
+
+ @wrap_exceptions
+ def nice_get(self):
+ return cext_posix.getpriority(self.pid)
+
+ @wrap_exceptions
+ def nice_set(self, value):
+ return cext_posix.setpriority(self.pid, value)
+
+ @wrap_exceptions
+ def status(self):
+ code = self.oneshot()[kinfo_proc_map['status']]
+ # XXX is '?' legit? (we're not supposed to return it anyway)
+ return PROC_STATUSES.get(code, '?')
+
+ @wrap_exceptions
+ def io_counters(self):
+ rawtuple = self.oneshot()
+ return _common.pio(
+ rawtuple[kinfo_proc_map['read_io_count']],
+ rawtuple[kinfo_proc_map['write_io_count']],
+ -1,
+ -1)
+
+ @wrap_exceptions
+ def cwd(self):
+ """Return process current working directory."""
+ # sometimes we get an empty string, in which case we turn
+ # it into None
+ if OPENBSD and self.pid == 0:
+ return None # ...else it would raise EINVAL
+ elif NETBSD or HAS_PROC_OPEN_FILES:
+ # FreeBSD < 8 does not support functions based on
+ # kinfo_getfile() and kinfo_getvmmap()
+ return cext.proc_cwd(self.pid) or None
+ else:
+ raise NotImplementedError(
+ "supported only starting from FreeBSD 8" if
+ FREEBSD else "")
+
+ nt_mmap_grouped = namedtuple(
+ 'mmap', 'path rss, private, ref_count, shadow_count')
+ nt_mmap_ext = namedtuple(
+ 'mmap', 'addr, perms path rss, private, ref_count, shadow_count')
+
+ def _not_implemented(self):
+ raise NotImplementedError
+
+ # FreeBSD < 8 does not support functions based on kinfo_getfile()
+ # and kinfo_getvmmap()
+ if HAS_PROC_OPEN_FILES:
+ @wrap_exceptions
+ def open_files(self):
+ """Return files opened by process as a list of namedtuples."""
+ rawlist = cext.proc_open_files(self.pid)
+ return [_common.popenfile(path, fd) for path, fd in rawlist]
+ else:
+ open_files = _not_implemented
+
+ # FreeBSD < 8 does not support functions based on kinfo_getfile()
+ # and kinfo_getvmmap()
+ if HAS_PROC_NUM_FDS:
+ @wrap_exceptions
+ def num_fds(self):
+ """Return the number of file descriptors opened by this process."""
+ ret = cext.proc_num_fds(self.pid)
+ if NETBSD:
+ self._assert_alive()
+ return ret
+ else:
+ num_fds = _not_implemented
+
+ # --- FreeBSD only APIs
+
+ if FREEBSD:
+
+ @wrap_exceptions
+ def cpu_affinity_get(self):
+ return cext.proc_cpu_affinity_get(self.pid)
+
+ @wrap_exceptions
+ def cpu_affinity_set(self, cpus):
+ # Pre-emptively check if CPUs are valid because the C
+ # function has a weird behavior in case of invalid CPUs,
+ # see: https://github.com/giampaolo/psutil/issues/586
+ allcpus = tuple(range(len(per_cpu_times())))
+ for cpu in cpus:
+ if cpu not in allcpus:
+ raise ValueError("invalid CPU #%i (choose between %s)"
+ % (cpu, allcpus))
+ try:
+ cext.proc_cpu_affinity_set(self.pid, cpus)
+ except OSError as err:
+ # 'man cpuset_setaffinity' about EDEADLK:
+ # <<the call would leave a thread without a valid CPU to run
+ # on because the set does not overlap with the thread's
+ # anonymous mask>>
+ if err.errno in (errno.EINVAL, errno.EDEADLK):
+ for cpu in cpus:
+ if cpu not in allcpus:
+ raise ValueError(
+ "invalid CPU #%i (choose between %s)" % (
+ cpu, allcpus))
+ raise
+
+ @wrap_exceptions
+ def memory_maps(self):
+ return cext.proc_memory_maps(self.pid)
+
+ @wrap_exceptions
+ def rlimit(self, resource, limits=None):
+ if limits is None:
+ return cext.proc_getrlimit(self.pid, resource)
+ else:
+ if len(limits) != 2:
+ raise ValueError(
+ "second argument must be a (soft, hard) tuple, "
+ "got %s" % repr(limits))
+ soft, hard = limits
+ return cext.proc_setrlimit(self.pid, resource, soft, hard)
diff --git a/contrib/python/psutil/py2/psutil/_pssunos.py b/contrib/python/psutil/py2/psutil/_pssunos.py
new file mode 100644
index 00000000000..5618bd44600
--- /dev/null
+++ b/contrib/python/psutil/py2/psutil/_pssunos.py
@@ -0,0 +1,727 @@
+# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Sun OS Solaris platform implementation."""
+
+import errno
+import functools
+import os
+import socket
+import subprocess
+import sys
+from collections import namedtuple
+from socket import AF_INET
+
+from . import _common
+from . import _psposix
+from . import _psutil_posix as cext_posix
+from . import _psutil_sunos as cext
+from ._common import AccessDenied
+from ._common import AF_INET6
+from ._common import debug
+from ._common import get_procfs_path
+from ._common import isfile_strict
+from ._common import memoize_when_activated
+from ._common import NoSuchProcess
+from ._common import sockfam_to_enum
+from ._common import socktype_to_enum
+from ._common import usage_percent
+from ._common import ZombieProcess
+from ._compat import b
+from ._compat import FileNotFoundError
+from ._compat import PermissionError
+from ._compat import ProcessLookupError
+from ._compat import PY3
+
+
+__extra__all__ = ["CONN_IDLE", "CONN_BOUND", "PROCFS_PATH"]
+
+
+# =====================================================================
+# --- globals
+# =====================================================================
+
+
+PAGE_SIZE = cext_posix.getpagesize()
+AF_LINK = cext_posix.AF_LINK
+IS_64_BIT = sys.maxsize > 2**32
+
+CONN_IDLE = "IDLE"
+CONN_BOUND = "BOUND"
+
+PROC_STATUSES = {
+ cext.SSLEEP: _common.STATUS_SLEEPING,
+ cext.SRUN: _common.STATUS_RUNNING,
+ cext.SZOMB: _common.STATUS_ZOMBIE,
+ cext.SSTOP: _common.STATUS_STOPPED,
+ cext.SIDL: _common.STATUS_IDLE,
+ cext.SONPROC: _common.STATUS_RUNNING, # same as run
+ cext.SWAIT: _common.STATUS_WAITING,
+}
+
+TCP_STATUSES = {
+ cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED,
+ cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT,
+ cext.TCPS_SYN_RCVD: _common.CONN_SYN_RECV,
+ cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1,
+ cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2,
+ cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT,
+ cext.TCPS_CLOSED: _common.CONN_CLOSE,
+ cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT,
+ cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK,
+ cext.TCPS_LISTEN: _common.CONN_LISTEN,
+ cext.TCPS_CLOSING: _common.CONN_CLOSING,
+ cext.PSUTIL_CONN_NONE: _common.CONN_NONE,
+ cext.TCPS_IDLE: CONN_IDLE, # sunos specific
+ cext.TCPS_BOUND: CONN_BOUND, # sunos specific
+}
+
+proc_info_map = dict(
+ ppid=0,
+ rss=1,
+ vms=2,
+ create_time=3,
+ nice=4,
+ num_threads=5,
+ status=6,
+ ttynr=7,
+ uid=8,
+ euid=9,
+ gid=10,
+ egid=11)
+
+
+# =====================================================================
+# --- named tuples
+# =====================================================================
+
+
+# psutil.cpu_times()
+scputimes = namedtuple('scputimes', ['user', 'system', 'idle', 'iowait'])
+# psutil.cpu_times(percpu=True)
+pcputimes = namedtuple('pcputimes',
+ ['user', 'system', 'children_user', 'children_system'])
+# psutil.virtual_memory()
+svmem = namedtuple('svmem', ['total', 'available', 'percent', 'used', 'free'])
+# psutil.Process.memory_info()
+pmem = namedtuple('pmem', ['rss', 'vms'])
+pfullmem = pmem
+# psutil.Process.memory_maps(grouped=True)
+pmmap_grouped = namedtuple('pmmap_grouped',
+ ['path', 'rss', 'anonymous', 'locked'])
+# psutil.Process.memory_maps(grouped=False)
+pmmap_ext = namedtuple(
+ 'pmmap_ext', 'addr perms ' + ' '.join(pmmap_grouped._fields))
+
+
+# =====================================================================
+# --- memory
+# =====================================================================
+
+
+def virtual_memory():
+ """Report virtual memory metrics."""
+ # we could have done this with kstat, but IMHO this is good enough
+ total = os.sysconf('SC_PHYS_PAGES') * PAGE_SIZE
+ # note: there's no difference on Solaris
+ free = avail = os.sysconf('SC_AVPHYS_PAGES') * PAGE_SIZE
+ used = total - free
+ percent = usage_percent(used, total, round_=1)
+ return svmem(total, avail, percent, used, free)
+
+
+def swap_memory():
+ """Report swap memory metrics."""
+ sin, sout = cext.swap_mem()
+ # XXX
+ # we are supposed to get total/free by doing so:
+ # http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/
+ # usr/src/cmd/swap/swap.c
+ # ...nevertheless I can't manage to obtain the same numbers as 'swap'
+ # cmdline utility, so let's parse its output (sigh!)
+ p = subprocess.Popen(['/usr/bin/env', 'PATH=/usr/sbin:/sbin:%s' %
+ os.environ['PATH'], 'swap', '-l'],
+ stdout=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ if PY3:
+ stdout = stdout.decode(sys.stdout.encoding)
+ if p.returncode != 0:
+ raise RuntimeError("'swap -l' failed (retcode=%s)" % p.returncode)
+
+ lines = stdout.strip().split('\n')[1:]
+ if not lines:
+ raise RuntimeError('no swap device(s) configured')
+ total = free = 0
+ for line in lines:
+ line = line.split()
+ t, f = line[3:4]
+ total += int(int(t) * 512)
+ free += int(int(f) * 512)
+ used = total - free
+ percent = usage_percent(used, total, round_=1)
+ return _common.sswap(total, used, free, percent,
+ sin * PAGE_SIZE, sout * PAGE_SIZE)
+
+
+# =====================================================================
+# --- CPU
+# =====================================================================
+
+
+def cpu_times():
+ """Return system-wide CPU times as a named tuple"""
+ ret = cext.per_cpu_times()
+ return scputimes(*[sum(x) for x in zip(*ret)])
+
+
+def per_cpu_times():
+ """Return system per-CPU times as a list of named tuples"""
+ ret = cext.per_cpu_times()
+ return [scputimes(*x) for x in ret]
+
+
+def cpu_count_logical():
+ """Return the number of logical CPUs in the system."""
+ try:
+ return os.sysconf("SC_NPROCESSORS_ONLN")
+ except ValueError:
+ # mimic os.cpu_count() behavior
+ return None
+
+
+def cpu_count_physical():
+ """Return the number of physical CPUs in the system."""
+ return cext.cpu_count_phys()
+
+
+def cpu_stats():
+ """Return various CPU stats as a named tuple."""
+ ctx_switches, interrupts, syscalls, traps = cext.cpu_stats()
+ soft_interrupts = 0
+ return _common.scpustats(ctx_switches, interrupts, soft_interrupts,
+ syscalls)
+
+
+# =====================================================================
+# --- disks
+# =====================================================================
+
+
+disk_io_counters = cext.disk_io_counters
+disk_usage = _psposix.disk_usage
+
+
+def disk_partitions(all=False):
+ """Return system disk partitions."""
+ # TODO - the filtering logic should be better checked so that
+ # it tries to reflect 'df' as much as possible
+ retlist = []
+ partitions = cext.disk_partitions()
+ for partition in partitions:
+ device, mountpoint, fstype, opts = partition
+ if device == 'none':
+ device = ''
+ if not all:
+ # Differently from, say, Linux, we don't have a list of
+ # common fs types so the best we can do, AFAIK, is to
+ # filter by filesystem having a total size > 0.
+ try:
+ if not disk_usage(mountpoint).total:
+ continue
+ except OSError as err:
+ # https://github.com/giampaolo/psutil/issues/1674
+ debug("skipping %r: %r" % (mountpoint, err))
+ continue
+ maxfile = maxpath = None # set later
+ ntuple = _common.sdiskpart(device, mountpoint, fstype, opts,
+ maxfile, maxpath)
+ retlist.append(ntuple)
+ return retlist
+
+
+# =====================================================================
+# --- network
+# =====================================================================
+
+
+net_io_counters = cext.net_io_counters
+net_if_addrs = cext_posix.net_if_addrs
+
+
+def net_connections(kind, _pid=-1):
+ """Return socket connections. If pid == -1 return system-wide
+ connections (as opposed to connections opened by one process only).
+ Only INET sockets are returned (UNIX are not).
+ """
+ cmap = _common.conn_tmap.copy()
+ if _pid == -1:
+ cmap.pop('unix', 0)
+ if kind not in cmap:
+ raise ValueError("invalid %r kind argument; choose between %s"
+ % (kind, ', '.join([repr(x) for x in cmap])))
+ families, types = _common.conn_tmap[kind]
+ rawlist = cext.net_connections(_pid)
+ ret = set()
+ for item in rawlist:
+ fd, fam, type_, laddr, raddr, status, pid = item
+ if fam not in families:
+ continue
+ if type_ not in types:
+ continue
+ # TODO: refactor and use _common.conn_to_ntuple.
+ if fam in (AF_INET, AF_INET6):
+ if laddr:
+ laddr = _common.addr(*laddr)
+ if raddr:
+ raddr = _common.addr(*raddr)
+ status = TCP_STATUSES[status]
+ fam = sockfam_to_enum(fam)
+ type_ = socktype_to_enum(type_)
+ if _pid == -1:
+ nt = _common.sconn(fd, fam, type_, laddr, raddr, status, pid)
+ else:
+ nt = _common.pconn(fd, fam, type_, laddr, raddr, status)
+ ret.add(nt)
+ return list(ret)
+
+
+def net_if_stats():
+ """Get NIC stats (isup, duplex, speed, mtu)."""
+ ret = cext.net_if_stats()
+ for name, items in ret.items():
+ isup, duplex, speed, mtu = items
+ if hasattr(_common, 'NicDuplex'):
+ duplex = _common.NicDuplex(duplex)
+ ret[name] = _common.snicstats(isup, duplex, speed, mtu)
+ return ret
+
+
+# =====================================================================
+# --- other system functions
+# =====================================================================
+
+
+def boot_time():
+ """The system boot time expressed in seconds since the epoch."""
+ return cext.boot_time()
+
+
+def users():
+ """Return currently connected users as a list of namedtuples."""
+ retlist = []
+ rawlist = cext.users()
+ localhost = (':0.0', ':0')
+ for item in rawlist:
+ user, tty, hostname, tstamp, user_process, pid = item
+ # note: the underlying C function includes entries about
+ # system boot, run level and others. We might want
+ # to use them in the future.
+ if not user_process:
+ continue
+ if hostname in localhost:
+ hostname = 'localhost'
+ nt = _common.suser(user, tty, hostname, tstamp, pid)
+ retlist.append(nt)
+ return retlist
+
+
+# =====================================================================
+# --- processes
+# =====================================================================
+
+
+def pids():
+ """Returns a list of PIDs currently running on the system."""
+ return [int(x) for x in os.listdir(b(get_procfs_path())) if x.isdigit()]
+
+
+def pid_exists(pid):
+ """Check for the existence of a unix pid."""
+ return _psposix.pid_exists(pid)
+
+
+def wrap_exceptions(fun):
+ """Call callable into a try/except clause and translate ENOENT,
+ EACCES and EPERM in NoSuchProcess or AccessDenied exceptions.
+ """
+ @functools.wraps(fun)
+ def wrapper(self, *args, **kwargs):
+ try:
+ return fun(self, *args, **kwargs)
+ except (FileNotFoundError, ProcessLookupError):
+ # ENOENT (no such file or directory) gets raised on open().
+ # ESRCH (no such process) can get raised on read() if
+ # process is gone in meantime.
+ if not pid_exists(self.pid):
+ raise NoSuchProcess(self.pid, self._name)
+ else:
+ raise ZombieProcess(self.pid, self._name, self._ppid)
+ except PermissionError:
+ raise AccessDenied(self.pid, self._name)
+ except OSError:
+ if self.pid == 0:
+ if 0 in pids():
+ raise AccessDenied(self.pid, self._name)
+ else:
+ raise
+ raise
+ return wrapper
+
+
+class Process(object):
+ """Wrapper class around underlying C implementation."""
+
+ __slots__ = ["pid", "_name", "_ppid", "_procfs_path", "_cache"]
+
+ def __init__(self, pid):
+ self.pid = pid
+ self._name = None
+ self._ppid = None
+ self._procfs_path = get_procfs_path()
+
+ def _assert_alive(self):
+ """Raise NSP if the process disappeared on us."""
+ # For those C function who do not raise NSP, possibly returning
+ # incorrect or incomplete result.
+ os.stat('%s/%s' % (self._procfs_path, self.pid))
+
+ def oneshot_enter(self):
+ self._proc_name_and_args.cache_activate(self)
+ self._proc_basic_info.cache_activate(self)
+ self._proc_cred.cache_activate(self)
+
+ def oneshot_exit(self):
+ self._proc_name_and_args.cache_deactivate(self)
+ self._proc_basic_info.cache_deactivate(self)
+ self._proc_cred.cache_deactivate(self)
+
+ @wrap_exceptions
+ @memoize_when_activated
+ def _proc_name_and_args(self):
+ return cext.proc_name_and_args(self.pid, self._procfs_path)
+
+ @wrap_exceptions
+ @memoize_when_activated
+ def _proc_basic_info(self):
+ if self.pid == 0 and not \
+ os.path.exists('%s/%s/psinfo' % (self._procfs_path, self.pid)):
+ raise AccessDenied(self.pid)
+ ret = cext.proc_basic_info(self.pid, self._procfs_path)
+ assert len(ret) == len(proc_info_map)
+ return ret
+
+ @wrap_exceptions
+ @memoize_when_activated
+ def _proc_cred(self):
+ return cext.proc_cred(self.pid, self._procfs_path)
+
+ @wrap_exceptions
+ def name(self):
+ # note: max len == 15
+ return self._proc_name_and_args()[0]
+
+ @wrap_exceptions
+ def exe(self):
+ try:
+ return os.readlink(
+ "%s/%s/path/a.out" % (self._procfs_path, self.pid))
+ except OSError:
+ pass # continue and guess the exe name from the cmdline
+ # Will be guessed later from cmdline but we want to explicitly
+ # invoke cmdline here in order to get an AccessDenied
+ # exception if the user has not enough privileges.
+ self.cmdline()
+ return ""
+
+ @wrap_exceptions
+ def cmdline(self):
+ return self._proc_name_and_args()[1].split(' ')
+
+ @wrap_exceptions
+ def environ(self):
+ return cext.proc_environ(self.pid, self._procfs_path)
+
+ @wrap_exceptions
+ def create_time(self):
+ return self._proc_basic_info()[proc_info_map['create_time']]
+
+ @wrap_exceptions
+ def num_threads(self):
+ return self._proc_basic_info()[proc_info_map['num_threads']]
+
+ @wrap_exceptions
+ def nice_get(self):
+ # Note #1: getpriority(3) doesn't work for realtime processes.
+ # Psinfo is what ps uses, see:
+ # https://github.com/giampaolo/psutil/issues/1194
+ return self._proc_basic_info()[proc_info_map['nice']]
+
+ @wrap_exceptions
+ def nice_set(self, value):
+ if self.pid in (2, 3):
+ # Special case PIDs: internally setpriority(3) return ESRCH
+ # (no such process), no matter what.
+ # The process actually exists though, as it has a name,
+ # creation time, etc.
+ raise AccessDenied(self.pid, self._name)
+ return cext_posix.setpriority(self.pid, value)
+
+ @wrap_exceptions
+ def ppid(self):
+ self._ppid = self._proc_basic_info()[proc_info_map['ppid']]
+ return self._ppid
+
+ @wrap_exceptions
+ def uids(self):
+ try:
+ real, effective, saved, _, _, _ = self._proc_cred()
+ except AccessDenied:
+ real = self._proc_basic_info()[proc_info_map['uid']]
+ effective = self._proc_basic_info()[proc_info_map['euid']]
+ saved = None
+ return _common.puids(real, effective, saved)
+
+ @wrap_exceptions
+ def gids(self):
+ try:
+ _, _, _, real, effective, saved = self._proc_cred()
+ except AccessDenied:
+ real = self._proc_basic_info()[proc_info_map['gid']]
+ effective = self._proc_basic_info()[proc_info_map['egid']]
+ saved = None
+ return _common.puids(real, effective, saved)
+
+ @wrap_exceptions
+ def cpu_times(self):
+ try:
+ times = cext.proc_cpu_times(self.pid, self._procfs_path)
+ except OSError as err:
+ if err.errno == errno.EOVERFLOW and not IS_64_BIT:
+ # We may get here if we attempt to query a 64bit process
+ # with a 32bit python.
+ # Error originates from read() and also tools like "cat"
+ # fail in the same way (!).
+ # Since there simply is no way to determine CPU times we
+ # return 0.0 as a fallback. See:
+ # https://github.com/giampaolo/psutil/issues/857
+ times = (0.0, 0.0, 0.0, 0.0)
+ else:
+ raise
+ return _common.pcputimes(*times)
+
+ @wrap_exceptions
+ def cpu_num(self):
+ return cext.proc_cpu_num(self.pid, self._procfs_path)
+
+ @wrap_exceptions
+ def terminal(self):
+ procfs_path = self._procfs_path
+ hit_enoent = False
+ tty = wrap_exceptions(
+ self._proc_basic_info()[proc_info_map['ttynr']])
+ if tty != cext.PRNODEV:
+ for x in (0, 1, 2, 255):
+ try:
+ return os.readlink(
+ '%s/%d/path/%d' % (procfs_path, self.pid, x))
+ except FileNotFoundError:
+ hit_enoent = True
+ continue
+ if hit_enoent:
+ self._assert_alive()
+
+ @wrap_exceptions
+ def cwd(self):
+ # /proc/PID/path/cwd may not be resolved by readlink() even if
+ # it exists (ls shows it). If that's the case and the process
+ # is still alive return None (we can return None also on BSD).
+ # Reference: http://goo.gl/55XgO
+ procfs_path = self._procfs_path
+ try:
+ return os.readlink("%s/%s/path/cwd" % (procfs_path, self.pid))
+ except FileNotFoundError:
+ os.stat("%s/%s" % (procfs_path, self.pid)) # raise NSP or AD
+ return None
+
+ @wrap_exceptions
+ def memory_info(self):
+ ret = self._proc_basic_info()
+ rss = ret[proc_info_map['rss']] * 1024
+ vms = ret[proc_info_map['vms']] * 1024
+ return pmem(rss, vms)
+
+ memory_full_info = memory_info
+
+ @wrap_exceptions
+ def status(self):
+ code = self._proc_basic_info()[proc_info_map['status']]
+ # XXX is '?' legit? (we're not supposed to return it anyway)
+ return PROC_STATUSES.get(code, '?')
+
+ @wrap_exceptions
+ def threads(self):
+ procfs_path = self._procfs_path
+ ret = []
+ tids = os.listdir('%s/%d/lwp' % (procfs_path, self.pid))
+ hit_enoent = False
+ for tid in tids:
+ tid = int(tid)
+ try:
+ utime, stime = cext.query_process_thread(
+ self.pid, tid, procfs_path)
+ except EnvironmentError as err:
+ if err.errno == errno.EOVERFLOW and not IS_64_BIT:
+ # We may get here if we attempt to query a 64bit process
+ # with a 32bit python.
+ # Error originates from read() and also tools like "cat"
+ # fail in the same way (!).
+ # Since there simply is no way to determine CPU times we
+ # return 0.0 as a fallback. See:
+ # https://github.com/giampaolo/psutil/issues/857
+ continue
+ # ENOENT == thread gone in meantime
+ if err.errno == errno.ENOENT:
+ hit_enoent = True
+ continue
+ raise
+ else:
+ nt = _common.pthread(tid, utime, stime)
+ ret.append(nt)
+ if hit_enoent:
+ self._assert_alive()
+ return ret
+
+ @wrap_exceptions
+ def open_files(self):
+ retlist = []
+ hit_enoent = False
+ procfs_path = self._procfs_path
+ pathdir = '%s/%d/path' % (procfs_path, self.pid)
+ for fd in os.listdir('%s/%d/fd' % (procfs_path, self.pid)):
+ path = os.path.join(pathdir, fd)
+ if os.path.islink(path):
+ try:
+ file = os.readlink(path)
+ except FileNotFoundError:
+ hit_enoent = True
+ continue
+ else:
+ if isfile_strict(file):
+ retlist.append(_common.popenfile(file, int(fd)))
+ if hit_enoent:
+ self._assert_alive()
+ return retlist
+
+ def _get_unix_sockets(self, pid):
+ """Get UNIX sockets used by process by parsing 'pfiles' output."""
+ # TODO: rewrite this in C (...but the damn netstat source code
+ # does not include this part! Argh!!)
+ cmd = "pfiles %s" % pid
+ p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ if PY3:
+ stdout, stderr = [x.decode(sys.stdout.encoding)
+ for x in (stdout, stderr)]
+ if p.returncode != 0:
+ if 'permission denied' in stderr.lower():
+ raise AccessDenied(self.pid, self._name)
+ if 'no such process' in stderr.lower():
+ raise NoSuchProcess(self.pid, self._name)
+ raise RuntimeError("%r command error\n%s" % (cmd, stderr))
+
+ lines = stdout.split('\n')[2:]
+ for i, line in enumerate(lines):
+ line = line.lstrip()
+ if line.startswith('sockname: AF_UNIX'):
+ path = line.split(' ', 2)[2]
+ type = lines[i - 2].strip()
+ if type == 'SOCK_STREAM':
+ type = socket.SOCK_STREAM
+ elif type == 'SOCK_DGRAM':
+ type = socket.SOCK_DGRAM
+ else:
+ type = -1
+ yield (-1, socket.AF_UNIX, type, path, "", _common.CONN_NONE)
+
+ @wrap_exceptions
+ def connections(self, kind='inet'):
+ ret = net_connections(kind, _pid=self.pid)
+ # The underlying C implementation retrieves all OS connections
+ # and filters them by PID. At this point we can't tell whether
+ # an empty list means there were no connections for process or
+ # process is no longer active so we force NSP in case the PID
+ # is no longer there.
+ if not ret:
+ # will raise NSP if process is gone
+ os.stat('%s/%s' % (self._procfs_path, self.pid))
+
+ # UNIX sockets
+ if kind in ('all', 'unix'):
+ ret.extend([_common.pconn(*conn) for conn in
+ self._get_unix_sockets(self.pid)])
+ return ret
+
+ nt_mmap_grouped = namedtuple('mmap', 'path rss anon locked')
+ nt_mmap_ext = namedtuple('mmap', 'addr perms path rss anon locked')
+
+ @wrap_exceptions
+ def memory_maps(self):
+ def toaddr(start, end):
+ return '%s-%s' % (hex(start)[2:].strip('L'),
+ hex(end)[2:].strip('L'))
+
+ procfs_path = self._procfs_path
+ retlist = []
+ try:
+ rawlist = cext.proc_memory_maps(self.pid, procfs_path)
+ except OSError as err:
+ if err.errno == errno.EOVERFLOW and not IS_64_BIT:
+ # We may get here if we attempt to query a 64bit process
+ # with a 32bit python.
+ # Error originates from read() and also tools like "cat"
+ # fail in the same way (!).
+ # Since there simply is no way to determine CPU times we
+ # return 0.0 as a fallback. See:
+ # https://github.com/giampaolo/psutil/issues/857
+ return []
+ else:
+ raise
+ hit_enoent = False
+ for item in rawlist:
+ addr, addrsize, perm, name, rss, anon, locked = item
+ addr = toaddr(addr, addrsize)
+ if not name.startswith('['):
+ try:
+ name = os.readlink(
+ '%s/%s/path/%s' % (procfs_path, self.pid, name))
+ except OSError as err:
+ if err.errno == errno.ENOENT:
+ # sometimes the link may not be resolved by
+ # readlink() even if it exists (ls shows it).
+ # If that's the case we just return the
+ # unresolved link path.
+ # This seems an incosistency with /proc similar
+ # to: http://goo.gl/55XgO
+ name = '%s/%s/path/%s' % (procfs_path, self.pid, name)
+ hit_enoent = True
+ else:
+ raise
+ retlist.append((addr, perm, name, rss, anon, locked))
+ if hit_enoent:
+ self._assert_alive()
+ return retlist
+
+ @wrap_exceptions
+ def num_fds(self):
+ return len(os.listdir("%s/%s/fd" % (self._procfs_path, self.pid)))
+
+ @wrap_exceptions
+ def num_ctx_switches(self):
+ return _common.pctxsw(
+ *cext.proc_num_ctx_switches(self.pid, self._procfs_path))
+
+ @wrap_exceptions
+ def wait(self, timeout=None):
+ return _psposix.wait_pid(self.pid, timeout, self._name)
diff --git a/contrib/python/psutil/py2/psutil/_psutil_posix.c b/contrib/python/psutil/py2/psutil/_psutil_posix.c
index 305cec76d10..3447fc9017b 100644
--- a/contrib/python/psutil/py2/psutil/_psutil_posix.c
+++ b/contrib/python/psutil/py2/psutil/_psutil_posix.c
@@ -18,9 +18,9 @@
#include <unistd.h>
#ifdef PSUTIL_SUNOS10
- #include "arch/solaris/v10/ifaddrs.h"
+ #error #include "arch/solaris/v10/ifaddrs.h"
#elif PSUTIL_AIX
- #include "arch/aix/ifaddrs.h"
+ #error #include "arch/aix/ifaddrs.h"
#else
#include <ifaddrs.h>
#endif
diff --git a/contrib/python/psutil/py2/psutil/arch/aix/ifaddrs.h b/contrib/python/psutil/py2/psutil/arch/aix/ifaddrs.h
deleted file mode 100644
index e15802bf7b2..00000000000
--- a/contrib/python/psutil/py2/psutil/arch/aix/ifaddrs.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2017, Arnon Yaari
- * All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/*! Based on code from
- https://lists.samba.org/archive/samba-technical/2009-February/063079.html
-!*/
-
-
-#ifndef GENERIC_AIX_IFADDRS_H
-#define GENERIC_AIX_IFADDRS_H
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#undef ifa_dstaddr
-#undef ifa_broadaddr
-#define ifa_broadaddr ifa_dstaddr
-
-struct ifaddrs {
- struct ifaddrs *ifa_next;
- char *ifa_name;
- unsigned int ifa_flags;
- struct sockaddr *ifa_addr;
- struct sockaddr *ifa_netmask;
- struct sockaddr *ifa_dstaddr;
-};
-
-extern int getifaddrs(struct ifaddrs **);
-extern void freeifaddrs(struct ifaddrs *);
-#endif
diff --git a/contrib/python/psutil/py2/psutil/arch/osx/ya.make b/contrib/python/psutil/py2/psutil/arch/osx/ya.make
deleted file mode 100644
index 613c49f9245..00000000000
--- a/contrib/python/psutil/py2/psutil/arch/osx/ya.make
+++ /dev/null
@@ -1,9 +0,0 @@
-PY23_NATIVE_LIBRARY()
-
-LICENSE(BSD-3-Clause)
-
-SRCS(
- process_info.c
-)
-
-END()
diff --git a/contrib/python/psutil/py2/psutil/arch/solaris/v10/ifaddrs.h b/contrib/python/psutil/py2/psutil/arch/solaris/v10/ifaddrs.h
deleted file mode 100644
index 0953a9b99a0..00000000000
--- a/contrib/python/psutil/py2/psutil/arch/solaris/v10/ifaddrs.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Reference: https://lists.samba.org/archive/samba-technical/2009-February/063079.html */
-
-
-#ifndef __IFADDRS_H__
-#define __IFADDRS_H__
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#undef ifa_dstaddr
-#undef ifa_broadaddr
-#define ifa_broadaddr ifa_dstaddr
-
-struct ifaddrs {
- struct ifaddrs *ifa_next;
- char *ifa_name;
- unsigned int ifa_flags;
- struct sockaddr *ifa_addr;
- struct sockaddr *ifa_netmask;
- struct sockaddr *ifa_dstaddr;
-};
-
-extern int getifaddrs(struct ifaddrs **);
-extern void freeifaddrs(struct ifaddrs *);
-
-#endif
diff --git a/contrib/python/psutil/py2/test/test.py b/contrib/python/psutil/py2/test/test.py
deleted file mode 100644
index 4f5a0e50d89..00000000000
--- a/contrib/python/psutil/py2/test/test.py
+++ /dev/null
@@ -1,4 +0,0 @@
-from library.python.import_test import check_imports
-test_imports = lambda: check_imports(no_check=['psutil._ps*'])
-#from psutil._psutil_posix import net_if_addrs
-
diff --git a/contrib/python/psutil/py2/test/ya.make b/contrib/python/psutil/py2/test/ya.make
deleted file mode 100644
index 20d09c1d70d..00000000000
--- a/contrib/python/psutil/py2/test/ya.make
+++ /dev/null
@@ -1,8 +0,0 @@
-PY2TEST()
-PEERDIR(
- contrib/python/psutil
- library/python/import_test
-)
-TEST_SRCS(test.py)
-NO_LINT()
-END()
diff --git a/contrib/python/psutil/py2/ya.make b/contrib/python/psutil/py2/ya.make
index ddc88f1692b..0e3d24c4d04 100644
--- a/contrib/python/psutil/py2/ya.make
+++ b/contrib/python/psutil/py2/ya.make
@@ -1,58 +1,75 @@
PY2_LIBRARY()
+VERSION(5.8.0)
+
LICENSE(BSD-3-Clause)
-VERSION(5.8.0)
+NO_COMPILER_WARNINGS()
-NO_UTIL()
+NO_LINT()
-SRCDIR(contrib/python/psutil/py2/psutil)
+NO_CHECK_IMPORTS(
+ psutil._psaix
+ psutil._psbsd
+ psutil._psosx
+ psutil._pssunos
+ psutil._psutil_bsd
+ psutil._psutil_common
+ psutil._psutil_osx
+ psutil._psutil_sunos
+ psutil._psutil_windows
+ psutil._pswindows
+)
-NO_COMPILER_WARNINGS()
+NO_UTIL()
CFLAGS(
-DPSUTIL_VERSION=580
)
-IF (OS_LINUX OR OS_DARWIN)
- CFLAGS(
- -DPSUTIL_POSIX=1
- )
- SRCS(
- _psutil_common.c
- _psutil_posix.c
- )
- PY_REGISTER(psutil._psutil_posix)
-ENDIF ()
+SRCS(
+ psutil/_psutil_common.c
+)
IF (OS_LINUX)
CFLAGS(
+ -DPSUTIL_POSIX=1
-DPSUTIL_LINUX=1
)
SRCS(
- _psutil_linux.c
+ psutil/_psutil_linux.c
+ psutil/_psutil_posix.c
)
- PY_REGISTER(psutil._psutil_linux)
-ENDIF ()
+
+ PY_REGISTER(
+ psutil._psutil_linux
+ psutil._psutil_posix
+ )
+ENDIF()
IF (OS_DARWIN)
CFLAGS(
+ -DPSUTIL_POSIX=1
-DPSUTIL_OSX=1
)
- EXTRALIBS("-framework CoreFoundation -framework IOKit")
-
- PEERDIR(
- contrib/python/psutil/py2/psutil/arch/osx
+ LDFLAGS(
+ -framework CoreFoundation
+ -framework IOKit
)
SRCS(
- _psutil_osx.c
+ psutil/_psutil_osx.c
+ psutil/_psutil_posix.c
+ psutil/arch/osx/process_info.c
)
- PY_REGISTER(psutil._psutil_osx)
-ENDIF ()
+ PY_REGISTER(
+ psutil._psutil_osx
+ psutil._psutil_posix
+ )
+ENDIF()
IF (OS_WINDOWS)
CFLAGS(
@@ -68,80 +85,42 @@ IF (OS_WINDOWS)
)
SRCS(
- _psutil_common.c
- _psutil_windows.c
- arch/windows/cpu.c
- arch/windows/disk.c
- arch/windows/net.c
- arch/windows/process_handles.c
- arch/windows/process_info.c
- arch/windows/process_utils.c
- arch/windows/security.c
- arch/windows/services.c
- arch/windows/socks.c
- arch/windows/wmi.c
+ psutil/_psutil_windows.c
+ psutil/arch/windows/cpu.c
+ psutil/arch/windows/disk.c
+ psutil/arch/windows/net.c
+ psutil/arch/windows/process_handles.c
+ psutil/arch/windows/process_info.c
+ psutil/arch/windows/process_utils.c
+ psutil/arch/windows/security.c
+ psutil/arch/windows/services.c
+ psutil/arch/windows/socks.c
+ psutil/arch/windows/wmi.c
)
- PY_REGISTER(psutil._psutil_windows)
-ENDIF ()
-
-NO_CHECK_IMPORTS(
- psutil._psbsd
- psutil._psosx
- psutil._pssunos
- psutil._psutil_bsd
- psutil._psutil_common
- psutil._psutil_osx
- psutil._psutil_sunos
- psutil._psutil_windows
- psutil._pswindows
-)
+ PY_REGISTER(
+ psutil._psutil_windows
+ )
+ENDIF()
PY_SRCS(
TOP_LEVEL
psutil/__init__.py
psutil/_common.py
psutil/_compat.py
+ psutil/_psaix.py
+ psutil/_psbsd.py
+ psutil/_pslinux.py
+ psutil/_psosx.py
+ psutil/_psposix.py
+ psutil/_pssunos.py
+ psutil/_pswindows.py
)
-IF (OS_LINUX OR OS_DARWIN)
- PY_SRCS(
- TOP_LEVEL
- psutil/_psposix.py
- )
-ENDIF ()
-
-IF (OS_LINUX)
- PY_SRCS(
- TOP_LEVEL
- psutil/_pslinux.py
- )
-ENDIF ()
-
-IF (OS_DARWIN)
- PY_SRCS(
- TOP_LEVEL
- psutil/_psosx.py
- )
-ENDIF ()
-
-IF (OS_WINDOWS)
- PY_SRCS(
- TOP_LEVEL
- psutil/_pswindows.py
- )
-ENDIF ()
-
RESOURCE_FILES(
PREFIX contrib/python/psutil/py2/
.dist-info/METADATA
.dist-info/top_level.txt
)
-NO_LINT()
-
END()
-
-RECURSE_FOR_TESTS(
- test
-)
diff --git a/contrib/python/psutil/py3/psutil/_psaix.py b/contrib/python/psutil/py3/psutil/_psaix.py
new file mode 100644
index 00000000000..7160ecd63af
--- /dev/null
+++ b/contrib/python/psutil/py3/psutil/_psaix.py
@@ -0,0 +1,552 @@
+# Copyright (c) 2009, Giampaolo Rodola'
+# Copyright (c) 2017, Arnon Yaari
+# All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""AIX platform implementation."""
+
+import functools
+import glob
+import os
+import re
+import subprocess
+import sys
+from collections import namedtuple
+
+from . import _common
+from . import _psposix
+from . import _psutil_aix as cext
+from . import _psutil_posix as cext_posix
+from ._common import AccessDenied
+from ._common import conn_to_ntuple
+from ._common import get_procfs_path
+from ._common import memoize_when_activated
+from ._common import NIC_DUPLEX_FULL
+from ._common import NIC_DUPLEX_HALF
+from ._common import NIC_DUPLEX_UNKNOWN
+from ._common import NoSuchProcess
+from ._common import usage_percent
+from ._common import ZombieProcess
+from ._compat import FileNotFoundError
+from ._compat import PermissionError
+from ._compat import ProcessLookupError
+from ._compat import PY3
+
+
+__extra__all__ = ["PROCFS_PATH"]
+
+
+# =====================================================================
+# --- globals
+# =====================================================================
+
+
+HAS_THREADS = hasattr(cext, "proc_threads")
+HAS_NET_IO_COUNTERS = hasattr(cext, "net_io_counters")
+HAS_PROC_IO_COUNTERS = hasattr(cext, "proc_io_counters")
+
+PAGE_SIZE = cext_posix.getpagesize()
+AF_LINK = cext_posix.AF_LINK
+
+PROC_STATUSES = {
+ cext.SIDL: _common.STATUS_IDLE,
+ cext.SZOMB: _common.STATUS_ZOMBIE,
+ cext.SACTIVE: _common.STATUS_RUNNING,
+ cext.SSWAP: _common.STATUS_RUNNING, # TODO what status is this?
+ cext.SSTOP: _common.STATUS_STOPPED,
+}
+
+TCP_STATUSES = {
+ cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED,
+ cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT,
+ cext.TCPS_SYN_RCVD: _common.CONN_SYN_RECV,
+ cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1,
+ cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2,
+ cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT,
+ cext.TCPS_CLOSED: _common.CONN_CLOSE,
+ cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT,
+ cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK,
+ cext.TCPS_LISTEN: _common.CONN_LISTEN,
+ cext.TCPS_CLOSING: _common.CONN_CLOSING,
+ cext.PSUTIL_CONN_NONE: _common.CONN_NONE,
+}
+
+proc_info_map = dict(
+ ppid=0,
+ rss=1,
+ vms=2,
+ create_time=3,
+ nice=4,
+ num_threads=5,
+ status=6,
+ ttynr=7)
+
+
+# =====================================================================
+# --- named tuples
+# =====================================================================
+
+
+# psutil.Process.memory_info()
+pmem = namedtuple('pmem', ['rss', 'vms'])
+# psutil.Process.memory_full_info()
+pfullmem = pmem
+# psutil.Process.cpu_times()
+scputimes = namedtuple('scputimes', ['user', 'system', 'idle', 'iowait'])
+# psutil.virtual_memory()
+svmem = namedtuple('svmem', ['total', 'available', 'percent', 'used', 'free'])
+
+
+# =====================================================================
+# --- memory
+# =====================================================================
+
+
+def virtual_memory():
+ total, avail, free, pinned, inuse = cext.virtual_mem()
+ percent = usage_percent((total - avail), total, round_=1)
+ return svmem(total, avail, percent, inuse, free)
+
+
+def swap_memory():
+ """Swap system memory as a (total, used, free, sin, sout) tuple."""
+ total, free, sin, sout = cext.swap_mem()
+ used = total - free
+ percent = usage_percent(used, total, round_=1)
+ return _common.sswap(total, used, free, percent, sin, sout)
+
+
+# =====================================================================
+# --- CPU
+# =====================================================================
+
+
+def cpu_times():
+ """Return system-wide CPU times as a named tuple"""
+ ret = cext.per_cpu_times()
+ return scputimes(*[sum(x) for x in zip(*ret)])
+
+
+def per_cpu_times():
+ """Return system per-CPU times as a list of named tuples"""
+ ret = cext.per_cpu_times()
+ return [scputimes(*x) for x in ret]
+
+
+def cpu_count_logical():
+ """Return the number of logical CPUs in the system."""
+ try:
+ return os.sysconf("SC_NPROCESSORS_ONLN")
+ except ValueError:
+ # mimic os.cpu_count() behavior
+ return None
+
+
+def cpu_count_physical():
+ cmd = "lsdev -Cc processor"
+ p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ if PY3:
+ stdout, stderr = [x.decode(sys.stdout.encoding)
+ for x in (stdout, stderr)]
+ if p.returncode != 0:
+ raise RuntimeError("%r command error\n%s" % (cmd, stderr))
+ processors = stdout.strip().splitlines()
+ return len(processors) or None
+
+
+def cpu_stats():
+ """Return various CPU stats as a named tuple."""
+ ctx_switches, interrupts, soft_interrupts, syscalls = cext.cpu_stats()
+ return _common.scpustats(
+ ctx_switches, interrupts, soft_interrupts, syscalls)
+
+
+# =====================================================================
+# --- disks
+# =====================================================================
+
+
+disk_io_counters = cext.disk_io_counters
+disk_usage = _psposix.disk_usage
+
+
+def disk_partitions(all=False):
+ """Return system disk partitions."""
+ # TODO - the filtering logic should be better checked so that
+ # it tries to reflect 'df' as much as possible
+ retlist = []
+ partitions = cext.disk_partitions()
+ for partition in partitions:
+ device, mountpoint, fstype, opts = partition
+ if device == 'none':
+ device = ''
+ if not all:
+ # Differently from, say, Linux, we don't have a list of
+ # common fs types so the best we can do, AFAIK, is to
+ # filter by filesystem having a total size > 0.
+ if not disk_usage(mountpoint).total:
+ continue
+ maxfile = maxpath = None # set later
+ ntuple = _common.sdiskpart(device, mountpoint, fstype, opts,
+ maxfile, maxpath)
+ retlist.append(ntuple)
+ return retlist
+
+
+# =====================================================================
+# --- network
+# =====================================================================
+
+
+net_if_addrs = cext_posix.net_if_addrs
+
+if HAS_NET_IO_COUNTERS:
+ net_io_counters = cext.net_io_counters
+
+
+def net_connections(kind, _pid=-1):
+ """Return socket connections. If pid == -1 return system-wide
+ connections (as opposed to connections opened by one process only).
+ """
+ cmap = _common.conn_tmap
+ if kind not in cmap:
+ raise ValueError("invalid %r kind argument; choose between %s"
+ % (kind, ', '.join([repr(x) for x in cmap])))
+ families, types = _common.conn_tmap[kind]
+ rawlist = cext.net_connections(_pid)
+ ret = []
+ for item in rawlist:
+ fd, fam, type_, laddr, raddr, status, pid = item
+ if fam not in families:
+ continue
+ if type_ not in types:
+ continue
+ nt = conn_to_ntuple(fd, fam, type_, laddr, raddr, status,
+ TCP_STATUSES, pid=pid if _pid == -1 else None)
+ ret.append(nt)
+ return ret
+
+
+def net_if_stats():
+ """Get NIC stats (isup, duplex, speed, mtu)."""
+ duplex_map = {"Full": NIC_DUPLEX_FULL,
+ "Half": NIC_DUPLEX_HALF}
+ names = set([x[0] for x in net_if_addrs()])
+ ret = {}
+ for name in names:
+ isup, mtu = cext.net_if_stats(name)
+
+ # try to get speed and duplex
+ # TODO: rewrite this in C (entstat forks, so use truss -f to follow.
+ # looks like it is using an undocumented ioctl?)
+ duplex = ""
+ speed = 0
+ p = subprocess.Popen(["/usr/bin/entstat", "-d", name],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ if PY3:
+ stdout, stderr = [x.decode(sys.stdout.encoding)
+ for x in (stdout, stderr)]
+ if p.returncode == 0:
+ re_result = re.search(
+ r"Running: (\d+) Mbps.*?(\w+) Duplex", stdout)
+ if re_result is not None:
+ speed = int(re_result.group(1))
+ duplex = re_result.group(2)
+
+ duplex = duplex_map.get(duplex, NIC_DUPLEX_UNKNOWN)
+ ret[name] = _common.snicstats(isup, duplex, speed, mtu)
+ return ret
+
+
+# =====================================================================
+# --- other system functions
+# =====================================================================
+
+
+def boot_time():
+ """The system boot time expressed in seconds since the epoch."""
+ return cext.boot_time()
+
+
+def users():
+ """Return currently connected users as a list of namedtuples."""
+ retlist = []
+ rawlist = cext.users()
+ localhost = (':0.0', ':0')
+ for item in rawlist:
+ user, tty, hostname, tstamp, user_process, pid = item
+ # note: the underlying C function includes entries about
+ # system boot, run level and others. We might want
+ # to use them in the future.
+ if not user_process:
+ continue
+ if hostname in localhost:
+ hostname = 'localhost'
+ nt = _common.suser(user, tty, hostname, tstamp, pid)
+ retlist.append(nt)
+ return retlist
+
+
+# =====================================================================
+# --- processes
+# =====================================================================
+
+
+def pids():
+ """Returns a list of PIDs currently running on the system."""
+ return [int(x) for x in os.listdir(get_procfs_path()) if x.isdigit()]
+
+
+def pid_exists(pid):
+ """Check for the existence of a unix pid."""
+ return os.path.exists(os.path.join(get_procfs_path(), str(pid), "psinfo"))
+
+
+def wrap_exceptions(fun):
+ """Call callable into a try/except clause and translate ENOENT,
+ EACCES and EPERM in NoSuchProcess or AccessDenied exceptions.
+ """
+ @functools.wraps(fun)
+ def wrapper(self, *args, **kwargs):
+ try:
+ return fun(self, *args, **kwargs)
+ except (FileNotFoundError, ProcessLookupError):
+ # ENOENT (no such file or directory) gets raised on open().
+ # ESRCH (no such process) can get raised on read() if
+ # process is gone in meantime.
+ if not pid_exists(self.pid):
+ raise NoSuchProcess(self.pid, self._name)
+ else:
+ raise ZombieProcess(self.pid, self._name, self._ppid)
+ except PermissionError:
+ raise AccessDenied(self.pid, self._name)
+ return wrapper
+
+
+class Process(object):
+ """Wrapper class around underlying C implementation."""
+
+ __slots__ = ["pid", "_name", "_ppid", "_procfs_path", "_cache"]
+
+ def __init__(self, pid):
+ self.pid = pid
+ self._name = None
+ self._ppid = None
+ self._procfs_path = get_procfs_path()
+
+ def oneshot_enter(self):
+ self._proc_basic_info.cache_activate(self)
+ self._proc_cred.cache_activate(self)
+
+ def oneshot_exit(self):
+ self._proc_basic_info.cache_deactivate(self)
+ self._proc_cred.cache_deactivate(self)
+
+ @wrap_exceptions
+ @memoize_when_activated
+ def _proc_basic_info(self):
+ return cext.proc_basic_info(self.pid, self._procfs_path)
+
+ @wrap_exceptions
+ @memoize_when_activated
+ def _proc_cred(self):
+ return cext.proc_cred(self.pid, self._procfs_path)
+
+ @wrap_exceptions
+ def name(self):
+ if self.pid == 0:
+ return "swapper"
+ # note: max 16 characters
+ return cext.proc_name(self.pid, self._procfs_path).rstrip("\x00")
+
+ @wrap_exceptions
+ def exe(self):
+ # there is no way to get executable path in AIX other than to guess,
+ # and guessing is more complex than what's in the wrapping class
+ cmdline = self.cmdline()
+ if not cmdline:
+ return ''
+ exe = cmdline[0]
+ if os.path.sep in exe:
+ # relative or absolute path
+ if not os.path.isabs(exe):
+ # if cwd has changed, we're out of luck - this may be wrong!
+ exe = os.path.abspath(os.path.join(self.cwd(), exe))
+ if (os.path.isabs(exe) and
+ os.path.isfile(exe) and
+ os.access(exe, os.X_OK)):
+ return exe
+ # not found, move to search in PATH using basename only
+ exe = os.path.basename(exe)
+ # search for exe name PATH
+ for path in os.environ["PATH"].split(":"):
+ possible_exe = os.path.abspath(os.path.join(path, exe))
+ if (os.path.isfile(possible_exe) and
+ os.access(possible_exe, os.X_OK)):
+ return possible_exe
+ return ''
+
+ @wrap_exceptions
+ def cmdline(self):
+ return cext.proc_args(self.pid)
+
+ @wrap_exceptions
+ def environ(self):
+ return cext.proc_environ(self.pid)
+
+ @wrap_exceptions
+ def create_time(self):
+ return self._proc_basic_info()[proc_info_map['create_time']]
+
+ @wrap_exceptions
+ def num_threads(self):
+ return self._proc_basic_info()[proc_info_map['num_threads']]
+
+ if HAS_THREADS:
+ @wrap_exceptions
+ def threads(self):
+ rawlist = cext.proc_threads(self.pid)
+ retlist = []
+ for thread_id, utime, stime in rawlist:
+ ntuple = _common.pthread(thread_id, utime, stime)
+ retlist.append(ntuple)
+ # The underlying C implementation retrieves all OS threads
+ # and filters them by PID. At this point we can't tell whether
+ # an empty list means there were no connections for process or
+ # process is no longer active so we force NSP in case the PID
+ # is no longer there.
+ if not retlist:
+ # will raise NSP if process is gone
+ os.stat('%s/%s' % (self._procfs_path, self.pid))
+ return retlist
+
+ @wrap_exceptions
+ def connections(self, kind='inet'):
+ ret = net_connections(kind, _pid=self.pid)
+ # The underlying C implementation retrieves all OS connections
+ # and filters them by PID. At this point we can't tell whether
+ # an empty list means there were no connections for process or
+ # process is no longer active so we force NSP in case the PID
+ # is no longer there.
+ if not ret:
+ # will raise NSP if process is gone
+ os.stat('%s/%s' % (self._procfs_path, self.pid))
+ return ret
+
+ @wrap_exceptions
+ def nice_get(self):
+ return cext_posix.getpriority(self.pid)
+
+ @wrap_exceptions
+ def nice_set(self, value):
+ return cext_posix.setpriority(self.pid, value)
+
+ @wrap_exceptions
+ def ppid(self):
+ self._ppid = self._proc_basic_info()[proc_info_map['ppid']]
+ return self._ppid
+
+ @wrap_exceptions
+ def uids(self):
+ real, effective, saved, _, _, _ = self._proc_cred()
+ return _common.puids(real, effective, saved)
+
+ @wrap_exceptions
+ def gids(self):
+ _, _, _, real, effective, saved = self._proc_cred()
+ return _common.puids(real, effective, saved)
+
+ @wrap_exceptions
+ def cpu_times(self):
+ cpu_times = cext.proc_cpu_times(self.pid, self._procfs_path)
+ return _common.pcputimes(*cpu_times)
+
+ @wrap_exceptions
+ def terminal(self):
+ ttydev = self._proc_basic_info()[proc_info_map['ttynr']]
+ # convert from 64-bit dev_t to 32-bit dev_t and then map the device
+ ttydev = (((ttydev & 0x0000FFFF00000000) >> 16) | (ttydev & 0xFFFF))
+ # try to match rdev of /dev/pts/* files ttydev
+ for dev in glob.glob("/dev/**/*"):
+ if os.stat(dev).st_rdev == ttydev:
+ return dev
+ return None
+
+ @wrap_exceptions
+ def cwd(self):
+ procfs_path = self._procfs_path
+ try:
+ result = os.readlink("%s/%s/cwd" % (procfs_path, self.pid))
+ return result.rstrip('/')
+ except FileNotFoundError:
+ os.stat("%s/%s" % (procfs_path, self.pid)) # raise NSP or AD
+ return None
+
+ @wrap_exceptions
+ def memory_info(self):
+ ret = self._proc_basic_info()
+ rss = ret[proc_info_map['rss']] * 1024
+ vms = ret[proc_info_map['vms']] * 1024
+ return pmem(rss, vms)
+
+ memory_full_info = memory_info
+
+ @wrap_exceptions
+ def status(self):
+ code = self._proc_basic_info()[proc_info_map['status']]
+ # XXX is '?' legit? (we're not supposed to return it anyway)
+ return PROC_STATUSES.get(code, '?')
+
+ def open_files(self):
+ # TODO rewrite without using procfiles (stat /proc/pid/fd/* and then
+ # find matching name of the inode)
+ p = subprocess.Popen(["/usr/bin/procfiles", "-n", str(self.pid)],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ if PY3:
+ stdout, stderr = [x.decode(sys.stdout.encoding)
+ for x in (stdout, stderr)]
+ if "no such process" in stderr.lower():
+ raise NoSuchProcess(self.pid, self._name)
+ procfiles = re.findall(r"(\d+): S_IFREG.*\s*.*name:(.*)\n", stdout)
+ retlist = []
+ for fd, path in procfiles:
+ path = path.strip()
+ if path.startswith("//"):
+ path = path[1:]
+ if path.lower() == "cannot be retrieved":
+ continue
+ retlist.append(_common.popenfile(path, int(fd)))
+ return retlist
+
+ @wrap_exceptions
+ def num_fds(self):
+ if self.pid == 0: # no /proc/0/fd
+ return 0
+ return len(os.listdir("%s/%s/fd" % (self._procfs_path, self.pid)))
+
+ @wrap_exceptions
+ def num_ctx_switches(self):
+ return _common.pctxsw(
+ *cext.proc_num_ctx_switches(self.pid))
+
+ @wrap_exceptions
+ def wait(self, timeout=None):
+ return _psposix.wait_pid(self.pid, timeout, self._name)
+
+ if HAS_PROC_IO_COUNTERS:
+ @wrap_exceptions
+ def io_counters(self):
+ try:
+ rc, wc, rb, wb = cext.proc_io_counters(self.pid)
+ except OSError:
+ # if process is terminated, proc_io_counters returns OSError
+ # instead of NSP
+ if not pid_exists(self.pid):
+ raise NoSuchProcess(self.pid, self._name)
+ raise
+ return _common.pio(rc, wc, rb, wb)
diff --git a/contrib/python/psutil/py3/psutil/_psbsd.py b/contrib/python/psutil/py3/psutil/_psbsd.py
new file mode 100644
index 00000000000..764463e980e
--- /dev/null
+++ b/contrib/python/psutil/py3/psutil/_psbsd.py
@@ -0,0 +1,917 @@
+# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""FreeBSD, OpenBSD and NetBSD platforms implementation."""
+
+import contextlib
+import errno
+import functools
+import os
+import xml.etree.ElementTree as ET
+from collections import namedtuple
+from collections import defaultdict
+
+from . import _common
+from . import _psposix
+from . import _psutil_bsd as cext
+from . import _psutil_posix as cext_posix
+from ._common import AccessDenied
+from ._common import conn_tmap
+from ._common import conn_to_ntuple
+from ._common import FREEBSD
+from ._common import memoize
+from ._common import memoize_when_activated
+from ._common import NETBSD
+from ._common import NoSuchProcess
+from ._common import OPENBSD
+from ._common import usage_percent
+from ._common import ZombieProcess
+from ._compat import FileNotFoundError
+from ._compat import PermissionError
+from ._compat import ProcessLookupError
+from ._compat import which
+
+
+__extra__all__ = []
+
+
+# =====================================================================
+# --- globals
+# =====================================================================
+
+
+if FREEBSD:
+ PROC_STATUSES = {
+ cext.SIDL: _common.STATUS_IDLE,
+ cext.SRUN: _common.STATUS_RUNNING,
+ cext.SSLEEP: _common.STATUS_SLEEPING,
+ cext.SSTOP: _common.STATUS_STOPPED,
+ cext.SZOMB: _common.STATUS_ZOMBIE,
+ cext.SWAIT: _common.STATUS_WAITING,
+ cext.SLOCK: _common.STATUS_LOCKED,
+ }
+elif OPENBSD:
+ PROC_STATUSES = {
+ cext.SIDL: _common.STATUS_IDLE,
+ cext.SSLEEP: _common.STATUS_SLEEPING,
+ cext.SSTOP: _common.STATUS_STOPPED,
+ # According to /usr/include/sys/proc.h SZOMB is unused.
+ # test_zombie_process() shows that SDEAD is the right
+ # equivalent. Also it appears there's no equivalent of
+ # psutil.STATUS_DEAD. SDEAD really means STATUS_ZOMBIE.
+ # cext.SZOMB: _common.STATUS_ZOMBIE,
+ cext.SDEAD: _common.STATUS_ZOMBIE,
+ cext.SZOMB: _common.STATUS_ZOMBIE,
+ # From http://www.eecs.harvard.edu/~margo/cs161/videos/proc.h.txt
+ # OpenBSD has SRUN and SONPROC: SRUN indicates that a process
+ # is runnable but *not* yet running, i.e. is on a run queue.
+ # SONPROC indicates that the process is actually executing on
+ # a CPU, i.e. it is no longer on a run queue.
+ # As such we'll map SRUN to STATUS_WAKING and SONPROC to
+ # STATUS_RUNNING
+ cext.SRUN: _common.STATUS_WAKING,
+ cext.SONPROC: _common.STATUS_RUNNING,
+ }
+elif NETBSD:
+ PROC_STATUSES = {
+ cext.SIDL: _common.STATUS_IDLE,
+ cext.SSLEEP: _common.STATUS_SLEEPING,
+ cext.SSTOP: _common.STATUS_STOPPED,
+ cext.SZOMB: _common.STATUS_ZOMBIE,
+ cext.SRUN: _common.STATUS_WAKING,
+ cext.SONPROC: _common.STATUS_RUNNING,
+ }
+
+TCP_STATUSES = {
+ cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED,
+ cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT,
+ cext.TCPS_SYN_RECEIVED: _common.CONN_SYN_RECV,
+ cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1,
+ cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2,
+ cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT,
+ cext.TCPS_CLOSED: _common.CONN_CLOSE,
+ cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT,
+ cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK,
+ cext.TCPS_LISTEN: _common.CONN_LISTEN,
+ cext.TCPS_CLOSING: _common.CONN_CLOSING,
+ cext.PSUTIL_CONN_NONE: _common.CONN_NONE,
+}
+
+PAGESIZE = cext_posix.getpagesize()
+AF_LINK = cext_posix.AF_LINK
+
+HAS_PER_CPU_TIMES = hasattr(cext, "per_cpu_times")
+HAS_PROC_NUM_THREADS = hasattr(cext, "proc_num_threads")
+HAS_PROC_OPEN_FILES = hasattr(cext, 'proc_open_files')
+HAS_PROC_NUM_FDS = hasattr(cext, 'proc_num_fds')
+
+kinfo_proc_map = dict(
+ ppid=0,
+ status=1,
+ real_uid=2,
+ effective_uid=3,
+ saved_uid=4,
+ real_gid=5,
+ effective_gid=6,
+ saved_gid=7,
+ ttynr=8,
+ create_time=9,
+ ctx_switches_vol=10,
+ ctx_switches_unvol=11,
+ read_io_count=12,
+ write_io_count=13,
+ user_time=14,
+ sys_time=15,
+ ch_user_time=16,
+ ch_sys_time=17,
+ rss=18,
+ vms=19,
+ memtext=20,
+ memdata=21,
+ memstack=22,
+ cpunum=23,
+ name=24,
+)
+
+
+# =====================================================================
+# --- named tuples
+# =====================================================================
+
+
+# psutil.virtual_memory()
+svmem = namedtuple(
+ 'svmem', ['total', 'available', 'percent', 'used', 'free',
+ 'active', 'inactive', 'buffers', 'cached', 'shared', 'wired'])
+# psutil.cpu_times()
+scputimes = namedtuple(
+ 'scputimes', ['user', 'nice', 'system', 'idle', 'irq'])
+# psutil.Process.memory_info()
+pmem = namedtuple('pmem', ['rss', 'vms', 'text', 'data', 'stack'])
+# psutil.Process.memory_full_info()
+pfullmem = pmem
+# psutil.Process.cpu_times()
+pcputimes = namedtuple('pcputimes',
+ ['user', 'system', 'children_user', 'children_system'])
+# psutil.Process.memory_maps(grouped=True)
+pmmap_grouped = namedtuple(
+ 'pmmap_grouped', 'path rss, private, ref_count, shadow_count')
+# psutil.Process.memory_maps(grouped=False)
+pmmap_ext = namedtuple(
+ 'pmmap_ext', 'addr, perms path rss, private, ref_count, shadow_count')
+# psutil.disk_io_counters()
+if FREEBSD:
+ sdiskio = namedtuple('sdiskio', ['read_count', 'write_count',
+ 'read_bytes', 'write_bytes',
+ 'read_time', 'write_time',
+ 'busy_time'])
+else:
+ sdiskio = namedtuple('sdiskio', ['read_count', 'write_count',
+ 'read_bytes', 'write_bytes'])
+
+
+# =====================================================================
+# --- memory
+# =====================================================================
+
+
+def virtual_memory():
+ """System virtual memory as a namedtuple."""
+ mem = cext.virtual_mem()
+ total, free, active, inactive, wired, cached, buffers, shared = mem
+ if NETBSD:
+ # On NetBSD buffers and shared mem is determined via /proc.
+ # The C ext set them to 0.
+ with open('/proc/meminfo', 'rb') as f:
+ for line in f:
+ if line.startswith(b'Buffers:'):
+ buffers = int(line.split()[1]) * 1024
+ elif line.startswith(b'MemShared:'):
+ shared = int(line.split()[1]) * 1024
+ avail = inactive + cached + free
+ used = active + wired + cached
+ percent = usage_percent((total - avail), total, round_=1)
+ return svmem(total, avail, percent, used, free,
+ active, inactive, buffers, cached, shared, wired)
+
+
+def swap_memory():
+ """System swap memory as (total, used, free, sin, sout) namedtuple."""
+ total, used, free, sin, sout = cext.swap_mem()
+ percent = usage_percent(used, total, round_=1)
+ return _common.sswap(total, used, free, percent, sin, sout)
+
+
+# =====================================================================
+# --- CPU
+# =====================================================================
+
+
+def cpu_times():
+ """Return system per-CPU times as a namedtuple"""
+ user, nice, system, idle, irq = cext.cpu_times()
+ return scputimes(user, nice, system, idle, irq)
+
+
+if HAS_PER_CPU_TIMES:
+ def per_cpu_times():
+ """Return system CPU times as a namedtuple"""
+ ret = []
+ for cpu_t in cext.per_cpu_times():
+ user, nice, system, idle, irq = cpu_t
+ item = scputimes(user, nice, system, idle, irq)
+ ret.append(item)
+ return ret
+else:
+ # XXX
+ # Ok, this is very dirty.
+ # On FreeBSD < 8 we cannot gather per-cpu information, see:
+ # https://github.com/giampaolo/psutil/issues/226
+ # If num cpus > 1, on first call we return single cpu times to avoid a
+ # crash at psutil import time.
+ # Next calls will fail with NotImplementedError
+ def per_cpu_times():
+ """Return system CPU times as a namedtuple"""
+ if cpu_count_logical() == 1:
+ return [cpu_times()]
+ if per_cpu_times.__called__:
+ raise NotImplementedError("supported only starting from FreeBSD 8")
+ per_cpu_times.__called__ = True
+ return [cpu_times()]
+
+ per_cpu_times.__called__ = False
+
+
+def cpu_count_logical():
+ """Return the number of logical CPUs in the system."""
+ return cext.cpu_count_logical()
+
+
+if OPENBSD or NETBSD:
+ def cpu_count_physical():
+ # OpenBSD and NetBSD do not implement this.
+ return 1 if cpu_count_logical() == 1 else None
+else:
+ def cpu_count_physical():
+ """Return the number of physical CPUs in the system."""
+ # From the C module we'll get an XML string similar to this:
+ # http://manpages.ubuntu.com/manpages/precise/man4/smp.4freebsd.html
+ # We may get None in case "sysctl kern.sched.topology_spec"
+ # is not supported on this BSD version, in which case we'll mimic
+ # os.cpu_count() and return None.
+ ret = None
+ s = cext.cpu_count_phys()
+ if s is not None:
+ # get rid of padding chars appended at the end of the string
+ index = s.rfind("</groups>")
+ if index != -1:
+ s = s[:index + 9]
+ root = ET.fromstring(s)
+ try:
+ ret = len(root.findall('group/children/group/cpu')) or None
+ finally:
+ # needed otherwise it will memleak
+ root.clear()
+ if not ret:
+ # If logical CPUs are 1 it's obvious we'll have only 1
+ # physical CPU.
+ if cpu_count_logical() == 1:
+ return 1
+ return ret
+
+
+def cpu_stats():
+ """Return various CPU stats as a named tuple."""
+ if FREEBSD:
+ # Note: the C ext is returning some metrics we are not exposing:
+ # traps.
+ ctxsw, intrs, soft_intrs, syscalls, traps = cext.cpu_stats()
+ elif NETBSD:
+ # XXX
+ # Note about intrs: the C extension returns 0. intrs
+ # can be determined via /proc/stat; it has the same value as
+ # soft_intrs thought so the kernel is faking it (?).
+ #
+ # Note about syscalls: the C extension always sets it to 0 (?).
+ #
+ # Note: the C ext is returning some metrics we are not exposing:
+ # traps, faults and forks.
+ ctxsw, intrs, soft_intrs, syscalls, traps, faults, forks = \
+ cext.cpu_stats()
+ with open('/proc/stat', 'rb') as f:
+ for line in f:
+ if line.startswith(b'intr'):
+ intrs = int(line.split()[1])
+ elif OPENBSD:
+ # Note: the C ext is returning some metrics we are not exposing:
+ # traps, faults and forks.
+ ctxsw, intrs, soft_intrs, syscalls, traps, faults, forks = \
+ cext.cpu_stats()
+ return _common.scpustats(ctxsw, intrs, soft_intrs, syscalls)
+
+
+# =====================================================================
+# --- disks
+# =====================================================================
+
+
+def disk_partitions(all=False):
+ """Return mounted disk partitions as a list of namedtuples.
+ 'all' argument is ignored, see:
+ https://github.com/giampaolo/psutil/issues/906
+ """
+ retlist = []
+ partitions = cext.disk_partitions()
+ for partition in partitions:
+ device, mountpoint, fstype, opts = partition
+ maxfile = maxpath = None # set later
+ ntuple = _common.sdiskpart(device, mountpoint, fstype, opts,
+ maxfile, maxpath)
+ retlist.append(ntuple)
+ return retlist
+
+
+disk_usage = _psposix.disk_usage
+disk_io_counters = cext.disk_io_counters
+
+
+# =====================================================================
+# --- network
+# =====================================================================
+
+
+net_io_counters = cext.net_io_counters
+net_if_addrs = cext_posix.net_if_addrs
+
+
+def net_if_stats():
+ """Get NIC stats (isup, duplex, speed, mtu)."""
+ names = net_io_counters().keys()
+ ret = {}
+ for name in names:
+ try:
+ mtu = cext_posix.net_if_mtu(name)
+ isup = cext_posix.net_if_is_running(name)
+ duplex, speed = cext_posix.net_if_duplex_speed(name)
+ except OSError as err:
+ # https://github.com/giampaolo/psutil/issues/1279
+ if err.errno != errno.ENODEV:
+ raise
+ else:
+ if hasattr(_common, 'NicDuplex'):
+ duplex = _common.NicDuplex(duplex)
+ ret[name] = _common.snicstats(isup, duplex, speed, mtu)
+ return ret
+
+
+def net_connections(kind):
+ """System-wide network connections."""
+ if OPENBSD:
+ ret = []
+ for pid in pids():
+ try:
+ cons = Process(pid).connections(kind)
+ except (NoSuchProcess, ZombieProcess):
+ continue
+ else:
+ for conn in cons:
+ conn = list(conn)
+ conn.append(pid)
+ ret.append(_common.sconn(*conn))
+ return ret
+
+ if kind not in _common.conn_tmap:
+ raise ValueError("invalid %r kind argument; choose between %s"
+ % (kind, ', '.join([repr(x) for x in conn_tmap])))
+ families, types = conn_tmap[kind]
+ ret = set()
+ if NETBSD:
+ rawlist = cext.net_connections(-1)
+ else:
+ rawlist = cext.net_connections()
+ for item in rawlist:
+ fd, fam, type, laddr, raddr, status, pid = item
+ # TODO: apply filter at C level
+ if fam in families and type in types:
+ nt = conn_to_ntuple(fd, fam, type, laddr, raddr, status,
+ TCP_STATUSES, pid)
+ ret.add(nt)
+ return list(ret)
+
+
+# =====================================================================
+# --- sensors
+# =====================================================================
+
+
+if FREEBSD:
+
+ def sensors_battery():
+ """Return battery info."""
+ try:
+ percent, minsleft, power_plugged = cext.sensors_battery()
+ except NotImplementedError:
+ # See: https://github.com/giampaolo/psutil/issues/1074
+ return None
+ power_plugged = power_plugged == 1
+ if power_plugged:
+ secsleft = _common.POWER_TIME_UNLIMITED
+ elif minsleft == -1:
+ secsleft = _common.POWER_TIME_UNKNOWN
+ else:
+ secsleft = minsleft * 60
+ return _common.sbattery(percent, secsleft, power_plugged)
+
+ def sensors_temperatures():
+ "Return CPU cores temperatures if available, else an empty dict."
+ ret = defaultdict(list)
+ num_cpus = cpu_count_logical()
+ for cpu in range(num_cpus):
+ try:
+ current, high = cext.sensors_cpu_temperature(cpu)
+ if high <= 0:
+ high = None
+ name = "Core %s" % cpu
+ ret["coretemp"].append(
+ _common.shwtemp(name, current, high, high))
+ except NotImplementedError:
+ pass
+
+ return ret
+
+ def cpu_freq():
+ """Return frequency metrics for CPUs. As of Dec 2018 only
+ CPU 0 appears to be supported by FreeBSD and all other cores
+ match the frequency of CPU 0.
+ """
+ ret = []
+ num_cpus = cpu_count_logical()
+ for cpu in range(num_cpus):
+ try:
+ current, available_freq = cext.cpu_frequency(cpu)
+ except NotImplementedError:
+ continue
+ if available_freq:
+ try:
+ min_freq = int(available_freq.split(" ")[-1].split("/")[0])
+ except(IndexError, ValueError):
+ min_freq = None
+ try:
+ max_freq = int(available_freq.split(" ")[0].split("/")[0])
+ except(IndexError, ValueError):
+ max_freq = None
+ ret.append(_common.scpufreq(current, min_freq, max_freq))
+ return ret
+
+
+# =====================================================================
+# --- other system functions
+# =====================================================================
+
+
+def boot_time():
+ """The system boot time expressed in seconds since the epoch."""
+ return cext.boot_time()
+
+
+def users():
+ """Return currently connected users as a list of namedtuples."""
+ retlist = []
+ rawlist = cext.users()
+ for item in rawlist:
+ user, tty, hostname, tstamp, pid = item
+ if pid == -1:
+ assert OPENBSD
+ pid = None
+ if tty == '~':
+ continue # reboot or shutdown
+ nt = _common.suser(user, tty or None, hostname, tstamp, pid)
+ retlist.append(nt)
+ return retlist
+
+
+# =====================================================================
+# --- processes
+# =====================================================================
+
+
+@memoize
+def _pid_0_exists():
+ try:
+ Process(0).name()
+ except NoSuchProcess:
+ return False
+ except AccessDenied:
+ return True
+ else:
+ return True
+
+
+def pids():
+ """Returns a list of PIDs currently running on the system."""
+ ret = cext.pids()
+ if OPENBSD and (0 not in ret) and _pid_0_exists():
+ # On OpenBSD the kernel does not return PID 0 (neither does
+ # ps) but it's actually querable (Process(0) will succeed).
+ ret.insert(0, 0)
+ return ret
+
+
+if OPENBSD or NETBSD:
+ def pid_exists(pid):
+ """Return True if pid exists."""
+ exists = _psposix.pid_exists(pid)
+ if not exists:
+ # We do this because _psposix.pid_exists() lies in case of
+ # zombie processes.
+ return pid in pids()
+ else:
+ return True
+else:
+ pid_exists = _psposix.pid_exists
+
+
+def is_zombie(pid):
+ try:
+ st = cext.proc_oneshot_info(pid)[kinfo_proc_map['status']]
+ return st == cext.SZOMB
+ except Exception:
+ return False
+
+
+def wrap_exceptions(fun):
+ """Decorator which translates bare OSError exceptions into
+ NoSuchProcess and AccessDenied.
+ """
+ @functools.wraps(fun)
+ def wrapper(self, *args, **kwargs):
+ try:
+ return fun(self, *args, **kwargs)
+ except ProcessLookupError:
+ if is_zombie(self.pid):
+ raise ZombieProcess(self.pid, self._name, self._ppid)
+ else:
+ raise NoSuchProcess(self.pid, self._name)
+ except PermissionError:
+ raise AccessDenied(self.pid, self._name)
+ except OSError:
+ if self.pid == 0:
+ if 0 in pids():
+ raise AccessDenied(self.pid, self._name)
+ else:
+ raise
+ raise
+ return wrapper
+
+
+def wrap_exceptions_procfs(inst):
+ """Same as above, for routines relying on reading /proc fs."""
+ try:
+ yield
+ except (ProcessLookupError, FileNotFoundError):
+ # ENOENT (no such file or directory) gets raised on open().
+ # ESRCH (no such process) can get raised on read() if
+ # process is gone in meantime.
+ if is_zombie(inst.pid):
+ raise ZombieProcess(inst.pid, inst._name, inst._ppid)
+ else:
+ raise NoSuchProcess(inst.pid, inst._name)
+ except PermissionError:
+ raise AccessDenied(inst.pid, inst._name)
+
+
+class Process(object):
+ """Wrapper class around underlying C implementation."""
+
+ __slots__ = ["pid", "_name", "_ppid", "_cache"]
+
+ def __init__(self, pid):
+ self.pid = pid
+ self._name = None
+ self._ppid = None
+
+ def _assert_alive(self):
+ """Raise NSP if the process disappeared on us."""
+ # For those C function who do not raise NSP, possibly returning
+ # incorrect or incomplete result.
+ cext.proc_name(self.pid)
+
+ @wrap_exceptions
+ @memoize_when_activated
+ def oneshot(self):
+ """Retrieves multiple process info in one shot as a raw tuple."""
+ ret = cext.proc_oneshot_info(self.pid)
+ assert len(ret) == len(kinfo_proc_map)
+ return ret
+
+ def oneshot_enter(self):
+ self.oneshot.cache_activate(self)
+
+ def oneshot_exit(self):
+ self.oneshot.cache_deactivate(self)
+
+ @wrap_exceptions
+ def name(self):
+ name = self.oneshot()[kinfo_proc_map['name']]
+ return name if name is not None else cext.proc_name(self.pid)
+
+ @wrap_exceptions
+ def exe(self):
+ if FREEBSD:
+ if self.pid == 0:
+ return '' # else NSP
+ return cext.proc_exe(self.pid)
+ elif NETBSD:
+ if self.pid == 0:
+ # /proc/0 dir exists but /proc/0/exe doesn't
+ return ""
+ with wrap_exceptions_procfs(self):
+ return os.readlink("/proc/%s/exe" % self.pid)
+ else:
+ # OpenBSD: exe cannot be determined; references:
+ # https://chromium.googlesource.com/chromium/src/base/+/
+ # master/base_paths_posix.cc
+ # We try our best guess by using which against the first
+ # cmdline arg (may return None).
+ cmdline = self.cmdline()
+ if cmdline:
+ return which(cmdline[0]) or ""
+ else:
+ return ""
+
+ @wrap_exceptions
+ def cmdline(self):
+ if OPENBSD and self.pid == 0:
+ return [] # ...else it crashes
+ elif NETBSD:
+ # XXX - most of the times the underlying sysctl() call on Net
+ # and Open BSD returns a truncated string.
+ # Also /proc/pid/cmdline behaves the same so it looks
+ # like this is a kernel bug.
+ try:
+ return cext.proc_cmdline(self.pid)
+ except OSError as err:
+ if err.errno == errno.EINVAL:
+ if is_zombie(self.pid):
+ raise ZombieProcess(self.pid, self._name, self._ppid)
+ elif not pid_exists(self.pid):
+ raise NoSuchProcess(self.pid, self._name, self._ppid)
+ else:
+ # XXX: this happens with unicode tests. It means the C
+ # routine is unable to decode invalid unicode chars.
+ return []
+ else:
+ raise
+ else:
+ return cext.proc_cmdline(self.pid)
+
+ @wrap_exceptions
+ def environ(self):
+ return cext.proc_environ(self.pid)
+
+ @wrap_exceptions
+ def terminal(self):
+ tty_nr = self.oneshot()[kinfo_proc_map['ttynr']]
+ tmap = _psposix.get_terminal_map()
+ try:
+ return tmap[tty_nr]
+ except KeyError:
+ return None
+
+ @wrap_exceptions
+ def ppid(self):
+ self._ppid = self.oneshot()[kinfo_proc_map['ppid']]
+ return self._ppid
+
+ @wrap_exceptions
+ def uids(self):
+ rawtuple = self.oneshot()
+ return _common.puids(
+ rawtuple[kinfo_proc_map['real_uid']],
+ rawtuple[kinfo_proc_map['effective_uid']],
+ rawtuple[kinfo_proc_map['saved_uid']])
+
+ @wrap_exceptions
+ def gids(self):
+ rawtuple = self.oneshot()
+ return _common.pgids(
+ rawtuple[kinfo_proc_map['real_gid']],
+ rawtuple[kinfo_proc_map['effective_gid']],
+ rawtuple[kinfo_proc_map['saved_gid']])
+
+ @wrap_exceptions
+ def cpu_times(self):
+ rawtuple = self.oneshot()
+ return _common.pcputimes(
+ rawtuple[kinfo_proc_map['user_time']],
+ rawtuple[kinfo_proc_map['sys_time']],
+ rawtuple[kinfo_proc_map['ch_user_time']],
+ rawtuple[kinfo_proc_map['ch_sys_time']])
+
+ if FREEBSD:
+ @wrap_exceptions
+ def cpu_num(self):
+ return self.oneshot()[kinfo_proc_map['cpunum']]
+
+ @wrap_exceptions
+ def memory_info(self):
+ rawtuple = self.oneshot()
+ return pmem(
+ rawtuple[kinfo_proc_map['rss']],
+ rawtuple[kinfo_proc_map['vms']],
+ rawtuple[kinfo_proc_map['memtext']],
+ rawtuple[kinfo_proc_map['memdata']],
+ rawtuple[kinfo_proc_map['memstack']])
+
+ memory_full_info = memory_info
+
+ @wrap_exceptions
+ def create_time(self):
+ return self.oneshot()[kinfo_proc_map['create_time']]
+
+ @wrap_exceptions
+ def num_threads(self):
+ if HAS_PROC_NUM_THREADS:
+ # FreeBSD
+ return cext.proc_num_threads(self.pid)
+ else:
+ return len(self.threads())
+
+ @wrap_exceptions
+ def num_ctx_switches(self):
+ rawtuple = self.oneshot()
+ return _common.pctxsw(
+ rawtuple[kinfo_proc_map['ctx_switches_vol']],
+ rawtuple[kinfo_proc_map['ctx_switches_unvol']])
+
+ @wrap_exceptions
+ def threads(self):
+ # Note: on OpenSBD this (/dev/mem) requires root access.
+ rawlist = cext.proc_threads(self.pid)
+ retlist = []
+ for thread_id, utime, stime in rawlist:
+ ntuple = _common.pthread(thread_id, utime, stime)
+ retlist.append(ntuple)
+ if OPENBSD:
+ self._assert_alive()
+ return retlist
+
+ @wrap_exceptions
+ def connections(self, kind='inet'):
+ if kind not in conn_tmap:
+ raise ValueError("invalid %r kind argument; choose between %s"
+ % (kind, ', '.join([repr(x) for x in conn_tmap])))
+
+ if NETBSD:
+ families, types = conn_tmap[kind]
+ ret = []
+ rawlist = cext.net_connections(self.pid)
+ for item in rawlist:
+ fd, fam, type, laddr, raddr, status, pid = item
+ assert pid == self.pid
+ if fam in families and type in types:
+ nt = conn_to_ntuple(fd, fam, type, laddr, raddr, status,
+ TCP_STATUSES)
+ ret.append(nt)
+ self._assert_alive()
+ return list(ret)
+
+ families, types = conn_tmap[kind]
+ rawlist = cext.proc_connections(self.pid, families, types)
+ ret = []
+ for item in rawlist:
+ fd, fam, type, laddr, raddr, status = item
+ nt = conn_to_ntuple(fd, fam, type, laddr, raddr, status,
+ TCP_STATUSES)
+ ret.append(nt)
+
+ if OPENBSD:
+ self._assert_alive()
+
+ return ret
+
+ @wrap_exceptions
+ def wait(self, timeout=None):
+ return _psposix.wait_pid(self.pid, timeout, self._name)
+
+ @wrap_exceptions
+ def nice_get(self):
+ return cext_posix.getpriority(self.pid)
+
+ @wrap_exceptions
+ def nice_set(self, value):
+ return cext_posix.setpriority(self.pid, value)
+
+ @wrap_exceptions
+ def status(self):
+ code = self.oneshot()[kinfo_proc_map['status']]
+ # XXX is '?' legit? (we're not supposed to return it anyway)
+ return PROC_STATUSES.get(code, '?')
+
+ @wrap_exceptions
+ def io_counters(self):
+ rawtuple = self.oneshot()
+ return _common.pio(
+ rawtuple[kinfo_proc_map['read_io_count']],
+ rawtuple[kinfo_proc_map['write_io_count']],
+ -1,
+ -1)
+
+ @wrap_exceptions
+ def cwd(self):
+ """Return process current working directory."""
+ # sometimes we get an empty string, in which case we turn
+ # it into None
+ if OPENBSD and self.pid == 0:
+ return None # ...else it would raise EINVAL
+ elif NETBSD or HAS_PROC_OPEN_FILES:
+ # FreeBSD < 8 does not support functions based on
+ # kinfo_getfile() and kinfo_getvmmap()
+ return cext.proc_cwd(self.pid) or None
+ else:
+ raise NotImplementedError(
+ "supported only starting from FreeBSD 8" if
+ FREEBSD else "")
+
+ nt_mmap_grouped = namedtuple(
+ 'mmap', 'path rss, private, ref_count, shadow_count')
+ nt_mmap_ext = namedtuple(
+ 'mmap', 'addr, perms path rss, private, ref_count, shadow_count')
+
+ def _not_implemented(self):
+ raise NotImplementedError
+
+ # FreeBSD < 8 does not support functions based on kinfo_getfile()
+ # and kinfo_getvmmap()
+ if HAS_PROC_OPEN_FILES:
+ @wrap_exceptions
+ def open_files(self):
+ """Return files opened by process as a list of namedtuples."""
+ rawlist = cext.proc_open_files(self.pid)
+ return [_common.popenfile(path, fd) for path, fd in rawlist]
+ else:
+ open_files = _not_implemented
+
+ # FreeBSD < 8 does not support functions based on kinfo_getfile()
+ # and kinfo_getvmmap()
+ if HAS_PROC_NUM_FDS:
+ @wrap_exceptions
+ def num_fds(self):
+ """Return the number of file descriptors opened by this process."""
+ ret = cext.proc_num_fds(self.pid)
+ if NETBSD:
+ self._assert_alive()
+ return ret
+ else:
+ num_fds = _not_implemented
+
+ # --- FreeBSD only APIs
+
+ if FREEBSD:
+
+ @wrap_exceptions
+ def cpu_affinity_get(self):
+ return cext.proc_cpu_affinity_get(self.pid)
+
+ @wrap_exceptions
+ def cpu_affinity_set(self, cpus):
+ # Pre-emptively check if CPUs are valid because the C
+ # function has a weird behavior in case of invalid CPUs,
+ # see: https://github.com/giampaolo/psutil/issues/586
+ allcpus = tuple(range(len(per_cpu_times())))
+ for cpu in cpus:
+ if cpu not in allcpus:
+ raise ValueError("invalid CPU #%i (choose between %s)"
+ % (cpu, allcpus))
+ try:
+ cext.proc_cpu_affinity_set(self.pid, cpus)
+ except OSError as err:
+ # 'man cpuset_setaffinity' about EDEADLK:
+ # <<the call would leave a thread without a valid CPU to run
+ # on because the set does not overlap with the thread's
+ # anonymous mask>>
+ if err.errno in (errno.EINVAL, errno.EDEADLK):
+ for cpu in cpus:
+ if cpu not in allcpus:
+ raise ValueError(
+ "invalid CPU #%i (choose between %s)" % (
+ cpu, allcpus))
+ raise
+
+ @wrap_exceptions
+ def memory_maps(self):
+ return cext.proc_memory_maps(self.pid)
+
+ @wrap_exceptions
+ def rlimit(self, resource, limits=None):
+ if limits is None:
+ return cext.proc_getrlimit(self.pid, resource)
+ else:
+ if len(limits) != 2:
+ raise ValueError(
+ "second argument must be a (soft, hard) tuple, "
+ "got %s" % repr(limits))
+ soft, hard = limits
+ return cext.proc_setrlimit(self.pid, resource, soft, hard)
diff --git a/contrib/python/psutil/py3/psutil/_pssunos.py b/contrib/python/psutil/py3/psutil/_pssunos.py
new file mode 100644
index 00000000000..5618bd44600
--- /dev/null
+++ b/contrib/python/psutil/py3/psutil/_pssunos.py
@@ -0,0 +1,727 @@
+# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Sun OS Solaris platform implementation."""
+
+import errno
+import functools
+import os
+import socket
+import subprocess
+import sys
+from collections import namedtuple
+from socket import AF_INET
+
+from . import _common
+from . import _psposix
+from . import _psutil_posix as cext_posix
+from . import _psutil_sunos as cext
+from ._common import AccessDenied
+from ._common import AF_INET6
+from ._common import debug
+from ._common import get_procfs_path
+from ._common import isfile_strict
+from ._common import memoize_when_activated
+from ._common import NoSuchProcess
+from ._common import sockfam_to_enum
+from ._common import socktype_to_enum
+from ._common import usage_percent
+from ._common import ZombieProcess
+from ._compat import b
+from ._compat import FileNotFoundError
+from ._compat import PermissionError
+from ._compat import ProcessLookupError
+from ._compat import PY3
+
+
+__extra__all__ = ["CONN_IDLE", "CONN_BOUND", "PROCFS_PATH"]
+
+
+# =====================================================================
+# --- globals
+# =====================================================================
+
+
+PAGE_SIZE = cext_posix.getpagesize()
+AF_LINK = cext_posix.AF_LINK
+IS_64_BIT = sys.maxsize > 2**32
+
+CONN_IDLE = "IDLE"
+CONN_BOUND = "BOUND"
+
+PROC_STATUSES = {
+ cext.SSLEEP: _common.STATUS_SLEEPING,
+ cext.SRUN: _common.STATUS_RUNNING,
+ cext.SZOMB: _common.STATUS_ZOMBIE,
+ cext.SSTOP: _common.STATUS_STOPPED,
+ cext.SIDL: _common.STATUS_IDLE,
+ cext.SONPROC: _common.STATUS_RUNNING, # same as run
+ cext.SWAIT: _common.STATUS_WAITING,
+}
+
+TCP_STATUSES = {
+ cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED,
+ cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT,
+ cext.TCPS_SYN_RCVD: _common.CONN_SYN_RECV,
+ cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1,
+ cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2,
+ cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT,
+ cext.TCPS_CLOSED: _common.CONN_CLOSE,
+ cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT,
+ cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK,
+ cext.TCPS_LISTEN: _common.CONN_LISTEN,
+ cext.TCPS_CLOSING: _common.CONN_CLOSING,
+ cext.PSUTIL_CONN_NONE: _common.CONN_NONE,
+ cext.TCPS_IDLE: CONN_IDLE, # sunos specific
+ cext.TCPS_BOUND: CONN_BOUND, # sunos specific
+}
+
+proc_info_map = dict(
+ ppid=0,
+ rss=1,
+ vms=2,
+ create_time=3,
+ nice=4,
+ num_threads=5,
+ status=6,
+ ttynr=7,
+ uid=8,
+ euid=9,
+ gid=10,
+ egid=11)
+
+
+# =====================================================================
+# --- named tuples
+# =====================================================================
+
+
+# psutil.cpu_times()
+scputimes = namedtuple('scputimes', ['user', 'system', 'idle', 'iowait'])
+# psutil.cpu_times(percpu=True)
+pcputimes = namedtuple('pcputimes',
+ ['user', 'system', 'children_user', 'children_system'])
+# psutil.virtual_memory()
+svmem = namedtuple('svmem', ['total', 'available', 'percent', 'used', 'free'])
+# psutil.Process.memory_info()
+pmem = namedtuple('pmem', ['rss', 'vms'])
+pfullmem = pmem
+# psutil.Process.memory_maps(grouped=True)
+pmmap_grouped = namedtuple('pmmap_grouped',
+ ['path', 'rss', 'anonymous', 'locked'])
+# psutil.Process.memory_maps(grouped=False)
+pmmap_ext = namedtuple(
+ 'pmmap_ext', 'addr perms ' + ' '.join(pmmap_grouped._fields))
+
+
+# =====================================================================
+# --- memory
+# =====================================================================
+
+
+def virtual_memory():
+ """Report virtual memory metrics."""
+ # we could have done this with kstat, but IMHO this is good enough
+ total = os.sysconf('SC_PHYS_PAGES') * PAGE_SIZE
+ # note: there's no difference on Solaris
+ free = avail = os.sysconf('SC_AVPHYS_PAGES') * PAGE_SIZE
+ used = total - free
+ percent = usage_percent(used, total, round_=1)
+ return svmem(total, avail, percent, used, free)
+
+
+def swap_memory():
+ """Report swap memory metrics."""
+ sin, sout = cext.swap_mem()
+ # XXX
+ # we are supposed to get total/free by doing so:
+ # http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/
+ # usr/src/cmd/swap/swap.c
+ # ...nevertheless I can't manage to obtain the same numbers as 'swap'
+ # cmdline utility, so let's parse its output (sigh!)
+ p = subprocess.Popen(['/usr/bin/env', 'PATH=/usr/sbin:/sbin:%s' %
+ os.environ['PATH'], 'swap', '-l'],
+ stdout=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ if PY3:
+ stdout = stdout.decode(sys.stdout.encoding)
+ if p.returncode != 0:
+ raise RuntimeError("'swap -l' failed (retcode=%s)" % p.returncode)
+
+ lines = stdout.strip().split('\n')[1:]
+ if not lines:
+ raise RuntimeError('no swap device(s) configured')
+ total = free = 0
+ for line in lines:
+ line = line.split()
+ t, f = line[3:4]
+ total += int(int(t) * 512)
+ free += int(int(f) * 512)
+ used = total - free
+ percent = usage_percent(used, total, round_=1)
+ return _common.sswap(total, used, free, percent,
+ sin * PAGE_SIZE, sout * PAGE_SIZE)
+
+
+# =====================================================================
+# --- CPU
+# =====================================================================
+
+
+def cpu_times():
+ """Return system-wide CPU times as a named tuple"""
+ ret = cext.per_cpu_times()
+ return scputimes(*[sum(x) for x in zip(*ret)])
+
+
+def per_cpu_times():
+ """Return system per-CPU times as a list of named tuples"""
+ ret = cext.per_cpu_times()
+ return [scputimes(*x) for x in ret]
+
+
+def cpu_count_logical():
+ """Return the number of logical CPUs in the system."""
+ try:
+ return os.sysconf("SC_NPROCESSORS_ONLN")
+ except ValueError:
+ # mimic os.cpu_count() behavior
+ return None
+
+
+def cpu_count_physical():
+ """Return the number of physical CPUs in the system."""
+ return cext.cpu_count_phys()
+
+
+def cpu_stats():
+ """Return various CPU stats as a named tuple."""
+ ctx_switches, interrupts, syscalls, traps = cext.cpu_stats()
+ soft_interrupts = 0
+ return _common.scpustats(ctx_switches, interrupts, soft_interrupts,
+ syscalls)
+
+
+# =====================================================================
+# --- disks
+# =====================================================================
+
+
+disk_io_counters = cext.disk_io_counters
+disk_usage = _psposix.disk_usage
+
+
+def disk_partitions(all=False):
+ """Return system disk partitions."""
+ # TODO - the filtering logic should be better checked so that
+ # it tries to reflect 'df' as much as possible
+ retlist = []
+ partitions = cext.disk_partitions()
+ for partition in partitions:
+ device, mountpoint, fstype, opts = partition
+ if device == 'none':
+ device = ''
+ if not all:
+ # Differently from, say, Linux, we don't have a list of
+ # common fs types so the best we can do, AFAIK, is to
+ # filter by filesystem having a total size > 0.
+ try:
+ if not disk_usage(mountpoint).total:
+ continue
+ except OSError as err:
+ # https://github.com/giampaolo/psutil/issues/1674
+ debug("skipping %r: %r" % (mountpoint, err))
+ continue
+ maxfile = maxpath = None # set later
+ ntuple = _common.sdiskpart(device, mountpoint, fstype, opts,
+ maxfile, maxpath)
+ retlist.append(ntuple)
+ return retlist
+
+
+# =====================================================================
+# --- network
+# =====================================================================
+
+
+net_io_counters = cext.net_io_counters
+net_if_addrs = cext_posix.net_if_addrs
+
+
+def net_connections(kind, _pid=-1):
+ """Return socket connections. If pid == -1 return system-wide
+ connections (as opposed to connections opened by one process only).
+ Only INET sockets are returned (UNIX are not).
+ """
+ cmap = _common.conn_tmap.copy()
+ if _pid == -1:
+ cmap.pop('unix', 0)
+ if kind not in cmap:
+ raise ValueError("invalid %r kind argument; choose between %s"
+ % (kind, ', '.join([repr(x) for x in cmap])))
+ families, types = _common.conn_tmap[kind]
+ rawlist = cext.net_connections(_pid)
+ ret = set()
+ for item in rawlist:
+ fd, fam, type_, laddr, raddr, status, pid = item
+ if fam not in families:
+ continue
+ if type_ not in types:
+ continue
+ # TODO: refactor and use _common.conn_to_ntuple.
+ if fam in (AF_INET, AF_INET6):
+ if laddr:
+ laddr = _common.addr(*laddr)
+ if raddr:
+ raddr = _common.addr(*raddr)
+ status = TCP_STATUSES[status]
+ fam = sockfam_to_enum(fam)
+ type_ = socktype_to_enum(type_)
+ if _pid == -1:
+ nt = _common.sconn(fd, fam, type_, laddr, raddr, status, pid)
+ else:
+ nt = _common.pconn(fd, fam, type_, laddr, raddr, status)
+ ret.add(nt)
+ return list(ret)
+
+
+def net_if_stats():
+ """Get NIC stats (isup, duplex, speed, mtu)."""
+ ret = cext.net_if_stats()
+ for name, items in ret.items():
+ isup, duplex, speed, mtu = items
+ if hasattr(_common, 'NicDuplex'):
+ duplex = _common.NicDuplex(duplex)
+ ret[name] = _common.snicstats(isup, duplex, speed, mtu)
+ return ret
+
+
+# =====================================================================
+# --- other system functions
+# =====================================================================
+
+
+def boot_time():
+ """The system boot time expressed in seconds since the epoch."""
+ return cext.boot_time()
+
+
+def users():
+ """Return currently connected users as a list of namedtuples."""
+ retlist = []
+ rawlist = cext.users()
+ localhost = (':0.0', ':0')
+ for item in rawlist:
+ user, tty, hostname, tstamp, user_process, pid = item
+ # note: the underlying C function includes entries about
+ # system boot, run level and others. We might want
+ # to use them in the future.
+ if not user_process:
+ continue
+ if hostname in localhost:
+ hostname = 'localhost'
+ nt = _common.suser(user, tty, hostname, tstamp, pid)
+ retlist.append(nt)
+ return retlist
+
+
+# =====================================================================
+# --- processes
+# =====================================================================
+
+
+def pids():
+ """Returns a list of PIDs currently running on the system."""
+ return [int(x) for x in os.listdir(b(get_procfs_path())) if x.isdigit()]
+
+
+def pid_exists(pid):
+ """Check for the existence of a unix pid."""
+ return _psposix.pid_exists(pid)
+
+
+def wrap_exceptions(fun):
+ """Call callable into a try/except clause and translate ENOENT,
+ EACCES and EPERM in NoSuchProcess or AccessDenied exceptions.
+ """
+ @functools.wraps(fun)
+ def wrapper(self, *args, **kwargs):
+ try:
+ return fun(self, *args, **kwargs)
+ except (FileNotFoundError, ProcessLookupError):
+ # ENOENT (no such file or directory) gets raised on open().
+ # ESRCH (no such process) can get raised on read() if
+ # process is gone in meantime.
+ if not pid_exists(self.pid):
+ raise NoSuchProcess(self.pid, self._name)
+ else:
+ raise ZombieProcess(self.pid, self._name, self._ppid)
+ except PermissionError:
+ raise AccessDenied(self.pid, self._name)
+ except OSError:
+ if self.pid == 0:
+ if 0 in pids():
+ raise AccessDenied(self.pid, self._name)
+ else:
+ raise
+ raise
+ return wrapper
+
+
+class Process(object):
+ """Wrapper class around underlying C implementation."""
+
+ __slots__ = ["pid", "_name", "_ppid", "_procfs_path", "_cache"]
+
+ def __init__(self, pid):
+ self.pid = pid
+ self._name = None
+ self._ppid = None
+ self._procfs_path = get_procfs_path()
+
+ def _assert_alive(self):
+ """Raise NSP if the process disappeared on us."""
+ # For those C function who do not raise NSP, possibly returning
+ # incorrect or incomplete result.
+ os.stat('%s/%s' % (self._procfs_path, self.pid))
+
+ def oneshot_enter(self):
+ self._proc_name_and_args.cache_activate(self)
+ self._proc_basic_info.cache_activate(self)
+ self._proc_cred.cache_activate(self)
+
+ def oneshot_exit(self):
+ self._proc_name_and_args.cache_deactivate(self)
+ self._proc_basic_info.cache_deactivate(self)
+ self._proc_cred.cache_deactivate(self)
+
+ @wrap_exceptions
+ @memoize_when_activated
+ def _proc_name_and_args(self):
+ return cext.proc_name_and_args(self.pid, self._procfs_path)
+
+ @wrap_exceptions
+ @memoize_when_activated
+ def _proc_basic_info(self):
+ if self.pid == 0 and not \
+ os.path.exists('%s/%s/psinfo' % (self._procfs_path, self.pid)):
+ raise AccessDenied(self.pid)
+ ret = cext.proc_basic_info(self.pid, self._procfs_path)
+ assert len(ret) == len(proc_info_map)
+ return ret
+
+ @wrap_exceptions
+ @memoize_when_activated
+ def _proc_cred(self):
+ return cext.proc_cred(self.pid, self._procfs_path)
+
+ @wrap_exceptions
+ def name(self):
+ # note: max len == 15
+ return self._proc_name_and_args()[0]
+
+ @wrap_exceptions
+ def exe(self):
+ try:
+ return os.readlink(
+ "%s/%s/path/a.out" % (self._procfs_path, self.pid))
+ except OSError:
+ pass # continue and guess the exe name from the cmdline
+ # Will be guessed later from cmdline but we want to explicitly
+ # invoke cmdline here in order to get an AccessDenied
+ # exception if the user has not enough privileges.
+ self.cmdline()
+ return ""
+
+ @wrap_exceptions
+ def cmdline(self):
+ return self._proc_name_and_args()[1].split(' ')
+
+ @wrap_exceptions
+ def environ(self):
+ return cext.proc_environ(self.pid, self._procfs_path)
+
+ @wrap_exceptions
+ def create_time(self):
+ return self._proc_basic_info()[proc_info_map['create_time']]
+
+ @wrap_exceptions
+ def num_threads(self):
+ return self._proc_basic_info()[proc_info_map['num_threads']]
+
+ @wrap_exceptions
+ def nice_get(self):
+ # Note #1: getpriority(3) doesn't work for realtime processes.
+ # Psinfo is what ps uses, see:
+ # https://github.com/giampaolo/psutil/issues/1194
+ return self._proc_basic_info()[proc_info_map['nice']]
+
+ @wrap_exceptions
+ def nice_set(self, value):
+ if self.pid in (2, 3):
+ # Special case PIDs: internally setpriority(3) return ESRCH
+ # (no such process), no matter what.
+ # The process actually exists though, as it has a name,
+ # creation time, etc.
+ raise AccessDenied(self.pid, self._name)
+ return cext_posix.setpriority(self.pid, value)
+
+ @wrap_exceptions
+ def ppid(self):
+ self._ppid = self._proc_basic_info()[proc_info_map['ppid']]
+ return self._ppid
+
+ @wrap_exceptions
+ def uids(self):
+ try:
+ real, effective, saved, _, _, _ = self._proc_cred()
+ except AccessDenied:
+ real = self._proc_basic_info()[proc_info_map['uid']]
+ effective = self._proc_basic_info()[proc_info_map['euid']]
+ saved = None
+ return _common.puids(real, effective, saved)
+
+ @wrap_exceptions
+ def gids(self):
+ try:
+ _, _, _, real, effective, saved = self._proc_cred()
+ except AccessDenied:
+ real = self._proc_basic_info()[proc_info_map['gid']]
+ effective = self._proc_basic_info()[proc_info_map['egid']]
+ saved = None
+ return _common.puids(real, effective, saved)
+
+ @wrap_exceptions
+ def cpu_times(self):
+ try:
+ times = cext.proc_cpu_times(self.pid, self._procfs_path)
+ except OSError as err:
+ if err.errno == errno.EOVERFLOW and not IS_64_BIT:
+ # We may get here if we attempt to query a 64bit process
+ # with a 32bit python.
+ # Error originates from read() and also tools like "cat"
+ # fail in the same way (!).
+ # Since there simply is no way to determine CPU times we
+ # return 0.0 as a fallback. See:
+ # https://github.com/giampaolo/psutil/issues/857
+ times = (0.0, 0.0, 0.0, 0.0)
+ else:
+ raise
+ return _common.pcputimes(*times)
+
+ @wrap_exceptions
+ def cpu_num(self):
+ return cext.proc_cpu_num(self.pid, self._procfs_path)
+
+ @wrap_exceptions
+ def terminal(self):
+ procfs_path = self._procfs_path
+ hit_enoent = False
+ tty = wrap_exceptions(
+ self._proc_basic_info()[proc_info_map['ttynr']])
+ if tty != cext.PRNODEV:
+ for x in (0, 1, 2, 255):
+ try:
+ return os.readlink(
+ '%s/%d/path/%d' % (procfs_path, self.pid, x))
+ except FileNotFoundError:
+ hit_enoent = True
+ continue
+ if hit_enoent:
+ self._assert_alive()
+
+ @wrap_exceptions
+ def cwd(self):
+ # /proc/PID/path/cwd may not be resolved by readlink() even if
+ # it exists (ls shows it). If that's the case and the process
+ # is still alive return None (we can return None also on BSD).
+ # Reference: http://goo.gl/55XgO
+ procfs_path = self._procfs_path
+ try:
+ return os.readlink("%s/%s/path/cwd" % (procfs_path, self.pid))
+ except FileNotFoundError:
+ os.stat("%s/%s" % (procfs_path, self.pid)) # raise NSP or AD
+ return None
+
+ @wrap_exceptions
+ def memory_info(self):
+ ret = self._proc_basic_info()
+ rss = ret[proc_info_map['rss']] * 1024
+ vms = ret[proc_info_map['vms']] * 1024
+ return pmem(rss, vms)
+
+ memory_full_info = memory_info
+
+ @wrap_exceptions
+ def status(self):
+ code = self._proc_basic_info()[proc_info_map['status']]
+ # XXX is '?' legit? (we're not supposed to return it anyway)
+ return PROC_STATUSES.get(code, '?')
+
+ @wrap_exceptions
+ def threads(self):
+ procfs_path = self._procfs_path
+ ret = []
+ tids = os.listdir('%s/%d/lwp' % (procfs_path, self.pid))
+ hit_enoent = False
+ for tid in tids:
+ tid = int(tid)
+ try:
+ utime, stime = cext.query_process_thread(
+ self.pid, tid, procfs_path)
+ except EnvironmentError as err:
+ if err.errno == errno.EOVERFLOW and not IS_64_BIT:
+ # We may get here if we attempt to query a 64bit process
+ # with a 32bit python.
+ # Error originates from read() and also tools like "cat"
+ # fail in the same way (!).
+ # Since there simply is no way to determine CPU times we
+ # return 0.0 as a fallback. See:
+ # https://github.com/giampaolo/psutil/issues/857
+ continue
+ # ENOENT == thread gone in meantime
+ if err.errno == errno.ENOENT:
+ hit_enoent = True
+ continue
+ raise
+ else:
+ nt = _common.pthread(tid, utime, stime)
+ ret.append(nt)
+ if hit_enoent:
+ self._assert_alive()
+ return ret
+
+ @wrap_exceptions
+ def open_files(self):
+ retlist = []
+ hit_enoent = False
+ procfs_path = self._procfs_path
+ pathdir = '%s/%d/path' % (procfs_path, self.pid)
+ for fd in os.listdir('%s/%d/fd' % (procfs_path, self.pid)):
+ path = os.path.join(pathdir, fd)
+ if os.path.islink(path):
+ try:
+ file = os.readlink(path)
+ except FileNotFoundError:
+ hit_enoent = True
+ continue
+ else:
+ if isfile_strict(file):
+ retlist.append(_common.popenfile(file, int(fd)))
+ if hit_enoent:
+ self._assert_alive()
+ return retlist
+
+ def _get_unix_sockets(self, pid):
+ """Get UNIX sockets used by process by parsing 'pfiles' output."""
+ # TODO: rewrite this in C (...but the damn netstat source code
+ # does not include this part! Argh!!)
+ cmd = "pfiles %s" % pid
+ p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ if PY3:
+ stdout, stderr = [x.decode(sys.stdout.encoding)
+ for x in (stdout, stderr)]
+ if p.returncode != 0:
+ if 'permission denied' in stderr.lower():
+ raise AccessDenied(self.pid, self._name)
+ if 'no such process' in stderr.lower():
+ raise NoSuchProcess(self.pid, self._name)
+ raise RuntimeError("%r command error\n%s" % (cmd, stderr))
+
+ lines = stdout.split('\n')[2:]
+ for i, line in enumerate(lines):
+ line = line.lstrip()
+ if line.startswith('sockname: AF_UNIX'):
+ path = line.split(' ', 2)[2]
+ type = lines[i - 2].strip()
+ if type == 'SOCK_STREAM':
+ type = socket.SOCK_STREAM
+ elif type == 'SOCK_DGRAM':
+ type = socket.SOCK_DGRAM
+ else:
+ type = -1
+ yield (-1, socket.AF_UNIX, type, path, "", _common.CONN_NONE)
+
+ @wrap_exceptions
+ def connections(self, kind='inet'):
+ ret = net_connections(kind, _pid=self.pid)
+ # The underlying C implementation retrieves all OS connections
+ # and filters them by PID. At this point we can't tell whether
+ # an empty list means there were no connections for process or
+ # process is no longer active so we force NSP in case the PID
+ # is no longer there.
+ if not ret:
+ # will raise NSP if process is gone
+ os.stat('%s/%s' % (self._procfs_path, self.pid))
+
+ # UNIX sockets
+ if kind in ('all', 'unix'):
+ ret.extend([_common.pconn(*conn) for conn in
+ self._get_unix_sockets(self.pid)])
+ return ret
+
+ nt_mmap_grouped = namedtuple('mmap', 'path rss anon locked')
+ nt_mmap_ext = namedtuple('mmap', 'addr perms path rss anon locked')
+
+ @wrap_exceptions
+ def memory_maps(self):
+ def toaddr(start, end):
+ return '%s-%s' % (hex(start)[2:].strip('L'),
+ hex(end)[2:].strip('L'))
+
+ procfs_path = self._procfs_path
+ retlist = []
+ try:
+ rawlist = cext.proc_memory_maps(self.pid, procfs_path)
+ except OSError as err:
+ if err.errno == errno.EOVERFLOW and not IS_64_BIT:
+ # We may get here if we attempt to query a 64bit process
+ # with a 32bit python.
+ # Error originates from read() and also tools like "cat"
+ # fail in the same way (!).
+ # Since there simply is no way to determine CPU times we
+ # return 0.0 as a fallback. See:
+ # https://github.com/giampaolo/psutil/issues/857
+ return []
+ else:
+ raise
+ hit_enoent = False
+ for item in rawlist:
+ addr, addrsize, perm, name, rss, anon, locked = item
+ addr = toaddr(addr, addrsize)
+ if not name.startswith('['):
+ try:
+ name = os.readlink(
+ '%s/%s/path/%s' % (procfs_path, self.pid, name))
+ except OSError as err:
+ if err.errno == errno.ENOENT:
+ # sometimes the link may not be resolved by
+ # readlink() even if it exists (ls shows it).
+ # If that's the case we just return the
+ # unresolved link path.
+ # This seems an incosistency with /proc similar
+ # to: http://goo.gl/55XgO
+ name = '%s/%s/path/%s' % (procfs_path, self.pid, name)
+ hit_enoent = True
+ else:
+ raise
+ retlist.append((addr, perm, name, rss, anon, locked))
+ if hit_enoent:
+ self._assert_alive()
+ return retlist
+
+ @wrap_exceptions
+ def num_fds(self):
+ return len(os.listdir("%s/%s/fd" % (self._procfs_path, self.pid)))
+
+ @wrap_exceptions
+ def num_ctx_switches(self):
+ return _common.pctxsw(
+ *cext.proc_num_ctx_switches(self.pid, self._procfs_path))
+
+ @wrap_exceptions
+ def wait(self, timeout=None):
+ return _psposix.wait_pid(self.pid, timeout, self._name)
diff --git a/contrib/python/psutil/py3/psutil/_psutil_posix.c b/contrib/python/psutil/py3/psutil/_psutil_posix.c
index 305cec76d10..3447fc9017b 100644
--- a/contrib/python/psutil/py3/psutil/_psutil_posix.c
+++ b/contrib/python/psutil/py3/psutil/_psutil_posix.c
@@ -18,9 +18,9 @@
#include <unistd.h>
#ifdef PSUTIL_SUNOS10
- #include "arch/solaris/v10/ifaddrs.h"
+ #error #include "arch/solaris/v10/ifaddrs.h"
#elif PSUTIL_AIX
- #include "arch/aix/ifaddrs.h"
+ #error #include "arch/aix/ifaddrs.h"
#else
#include <ifaddrs.h>
#endif
diff --git a/contrib/python/psutil/py3/psutil/arch/aix/ifaddrs.h b/contrib/python/psutil/py3/psutil/arch/aix/ifaddrs.h
deleted file mode 100644
index e15802bf7b2..00000000000
--- a/contrib/python/psutil/py3/psutil/arch/aix/ifaddrs.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2017, Arnon Yaari
- * All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/*! Based on code from
- https://lists.samba.org/archive/samba-technical/2009-February/063079.html
-!*/
-
-
-#ifndef GENERIC_AIX_IFADDRS_H
-#define GENERIC_AIX_IFADDRS_H
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#undef ifa_dstaddr
-#undef ifa_broadaddr
-#define ifa_broadaddr ifa_dstaddr
-
-struct ifaddrs {
- struct ifaddrs *ifa_next;
- char *ifa_name;
- unsigned int ifa_flags;
- struct sockaddr *ifa_addr;
- struct sockaddr *ifa_netmask;
- struct sockaddr *ifa_dstaddr;
-};
-
-extern int getifaddrs(struct ifaddrs **);
-extern void freeifaddrs(struct ifaddrs *);
-#endif
diff --git a/contrib/python/psutil/py3/psutil/arch/osx/ya.make b/contrib/python/psutil/py3/psutil/arch/osx/ya.make
deleted file mode 100644
index 613c49f9245..00000000000
--- a/contrib/python/psutil/py3/psutil/arch/osx/ya.make
+++ /dev/null
@@ -1,9 +0,0 @@
-PY23_NATIVE_LIBRARY()
-
-LICENSE(BSD-3-Clause)
-
-SRCS(
- process_info.c
-)
-
-END()
diff --git a/contrib/python/psutil/py3/psutil/arch/solaris/v10/ifaddrs.h b/contrib/python/psutil/py3/psutil/arch/solaris/v10/ifaddrs.h
deleted file mode 100644
index 0953a9b99a0..00000000000
--- a/contrib/python/psutil/py3/psutil/arch/solaris/v10/ifaddrs.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Reference: https://lists.samba.org/archive/samba-technical/2009-February/063079.html */
-
-
-#ifndef __IFADDRS_H__
-#define __IFADDRS_H__
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#undef ifa_dstaddr
-#undef ifa_broadaddr
-#define ifa_broadaddr ifa_dstaddr
-
-struct ifaddrs {
- struct ifaddrs *ifa_next;
- char *ifa_name;
- unsigned int ifa_flags;
- struct sockaddr *ifa_addr;
- struct sockaddr *ifa_netmask;
- struct sockaddr *ifa_dstaddr;
-};
-
-extern int getifaddrs(struct ifaddrs **);
-extern void freeifaddrs(struct ifaddrs *);
-
-#endif
diff --git a/contrib/python/psutil/py3/test/test.py b/contrib/python/psutil/py3/test/test.py
deleted file mode 100644
index 4f5a0e50d89..00000000000
--- a/contrib/python/psutil/py3/test/test.py
+++ /dev/null
@@ -1,4 +0,0 @@
-from library.python.import_test import check_imports
-test_imports = lambda: check_imports(no_check=['psutil._ps*'])
-#from psutil._psutil_posix import net_if_addrs
-
diff --git a/contrib/python/psutil/py3/test/ya.make b/contrib/python/psutil/py3/test/ya.make
deleted file mode 100644
index 72d9c04afc8..00000000000
--- a/contrib/python/psutil/py3/test/ya.make
+++ /dev/null
@@ -1,8 +0,0 @@
-PY3TEST()
-PEERDIR(
- contrib/python/psutil
- library/python/import_test
-)
-TEST_SRCS(test.py)
-NO_LINT()
-END()
diff --git a/contrib/python/psutil/py3/ya.make b/contrib/python/psutil/py3/ya.make
index d90f7e52f24..16c79983b7f 100644
--- a/contrib/python/psutil/py3/ya.make
+++ b/contrib/python/psutil/py3/ya.make
@@ -1,58 +1,75 @@
PY3_LIBRARY()
+VERSION(5.8.0)
+
LICENSE(BSD-3-Clause)
-VERSION(5.8.0)
+NO_COMPILER_WARNINGS()
-NO_UTIL()
+NO_LINT()
-SRCDIR(contrib/python/psutil/py3/psutil)
+NO_CHECK_IMPORTS(
+ psutil._psaix
+ psutil._psbsd
+ psutil._psosx
+ psutil._pssunos
+ psutil._psutil_bsd
+ psutil._psutil_common
+ psutil._psutil_osx
+ psutil._psutil_sunos
+ psutil._psutil_windows
+ psutil._pswindows
+)
-NO_COMPILER_WARNINGS()
+NO_UTIL()
CFLAGS(
-DPSUTIL_VERSION=580
)
-IF (OS_LINUX OR OS_DARWIN)
- CFLAGS(
- -DPSUTIL_POSIX=1
- )
- SRCS(
- _psutil_common.c
- _psutil_posix.c
- )
- PY_REGISTER(psutil._psutil_posix)
-ENDIF ()
+SRCS(
+ psutil/_psutil_common.c
+)
IF (OS_LINUX)
CFLAGS(
+ -DPSUTIL_POSIX=1
-DPSUTIL_LINUX=1
)
SRCS(
- _psutil_linux.c
+ psutil/_psutil_linux.c
+ psutil/_psutil_posix.c
)
- PY_REGISTER(psutil._psutil_linux)
-ENDIF ()
+
+ PY_REGISTER(
+ psutil._psutil_linux
+ psutil._psutil_posix
+ )
+ENDIF()
IF (OS_DARWIN)
CFLAGS(
+ -DPSUTIL_POSIX=1
-DPSUTIL_OSX=1
)
- EXTRALIBS("-framework CoreFoundation -framework IOKit")
-
- PEERDIR(
- contrib/python/psutil/py3/psutil/arch/osx
+ LDFLAGS(
+ -framework CoreFoundation
+ -framework IOKit
)
SRCS(
- _psutil_osx.c
+ psutil/_psutil_osx.c
+ psutil/_psutil_posix.c
+ psutil/arch/osx/process_info.c
)
- PY_REGISTER(psutil._psutil_osx)
-ENDIF ()
+ PY_REGISTER(
+ psutil._psutil_osx
+ psutil._psutil_posix
+ )
+ENDIF()
IF (OS_WINDOWS)
CFLAGS(
@@ -68,80 +85,42 @@ IF (OS_WINDOWS)
)
SRCS(
- _psutil_common.c
- _psutil_windows.c
- arch/windows/cpu.c
- arch/windows/disk.c
- arch/windows/net.c
- arch/windows/process_handles.c
- arch/windows/process_info.c
- arch/windows/process_utils.c
- arch/windows/security.c
- arch/windows/services.c
- arch/windows/socks.c
- arch/windows/wmi.c
+ psutil/_psutil_windows.c
+ psutil/arch/windows/cpu.c
+ psutil/arch/windows/disk.c
+ psutil/arch/windows/net.c
+ psutil/arch/windows/process_handles.c
+ psutil/arch/windows/process_info.c
+ psutil/arch/windows/process_utils.c
+ psutil/arch/windows/security.c
+ psutil/arch/windows/services.c
+ psutil/arch/windows/socks.c
+ psutil/arch/windows/wmi.c
)
- PY_REGISTER(psutil._psutil_windows)
-ENDIF ()
-
-NO_CHECK_IMPORTS(
- psutil._psbsd
- psutil._psosx
- psutil._pssunos
- psutil._psutil_bsd
- psutil._psutil_common
- psutil._psutil_osx
- psutil._psutil_sunos
- psutil._psutil_windows
- psutil._pswindows
-)
+ PY_REGISTER(
+ psutil._psutil_windows
+ )
+ENDIF()
PY_SRCS(
TOP_LEVEL
psutil/__init__.py
psutil/_common.py
psutil/_compat.py
+ psutil/_psaix.py
+ psutil/_psbsd.py
+ psutil/_pslinux.py
+ psutil/_psosx.py
+ psutil/_psposix.py
+ psutil/_pssunos.py
+ psutil/_pswindows.py
)
-IF (OS_LINUX OR OS_DARWIN)
- PY_SRCS(
- TOP_LEVEL
- psutil/_psposix.py
- )
-ENDIF ()
-
-IF (OS_LINUX)
- PY_SRCS(
- TOP_LEVEL
- psutil/_pslinux.py
- )
-ENDIF ()
-
-IF (OS_DARWIN)
- PY_SRCS(
- TOP_LEVEL
- psutil/_psosx.py
- )
-ENDIF ()
-
-IF (OS_WINDOWS)
- PY_SRCS(
- TOP_LEVEL
- psutil/_pswindows.py
- )
-ENDIF ()
-
RESOURCE_FILES(
PREFIX contrib/python/psutil/py3/
.dist-info/METADATA
.dist-info/top_level.txt
)
-NO_LINT()
-
END()
-
-RECURSE_FOR_TESTS(
- test
-)
diff --git a/contrib/python/responses/py3/.dist-info/METADATA b/contrib/python/responses/py3/.dist-info/METADATA
index 6daec58b171..c658b290658 100644
--- a/contrib/python/responses/py3/.dist-info/METADATA
+++ b/contrib/python/responses/py3/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: responses
-Version: 0.24.1
+Version: 0.25.0
Summary: A utility library for mocking out the `requests` Python library.
Home-page: https://github.com/getsentry/responses
Author: David Cramer
@@ -19,6 +19,7 @@ Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development
Requires-Python: >=3.8
Description-Content-Type: text/x-rst
@@ -1273,6 +1274,7 @@ If you are using the ``Retry`` features of ``urllib3`` and want to cover scenari
import responses
from responses import registries
+ from urllib3.util import Retry
@responses.activate(registry=registries.OrderedRegistry)
diff --git a/contrib/python/responses/py3/README.rst b/contrib/python/responses/py3/README.rst
index e2096c6cae6..9b255076b76 100644
--- a/contrib/python/responses/py3/README.rst
+++ b/contrib/python/responses/py3/README.rst
@@ -1232,6 +1232,7 @@ If you are using the ``Retry`` features of ``urllib3`` and want to cover scenari
import responses
from responses import registries
+ from urllib3.util import Retry
@responses.activate(registry=registries.OrderedRegistry)
diff --git a/contrib/python/responses/py3/responses/matchers.py b/contrib/python/responses/py3/responses/matchers.py
index 78980fe307f..20af1be693b 100644
--- a/contrib/python/responses/py3/responses/matchers.py
+++ b/contrib/python/responses/py3/responses/matchers.py
@@ -4,8 +4,9 @@ import re
from json.decoder import JSONDecodeError
from typing import Any
from typing import Callable
-from typing import Dict
from typing import List
+from typing import Mapping
+from typing import MutableMapping
from typing import Optional
from typing import Pattern
from typing import Tuple
@@ -17,7 +18,7 @@ from requests import PreparedRequest
from urllib3.util.url import parse_url
-def _create_key_val_str(input_dict: Union[Dict[Any, Any], Any]) -> str:
+def _create_key_val_str(input_dict: Union[Mapping[Any, Any], Any]) -> str:
"""
Returns string of format {'key': val, 'key2': val2}
Function is called recursively for nested dictionaries
@@ -57,8 +58,8 @@ def _create_key_val_str(input_dict: Union[Dict[Any, Any], Any]) -> str:
def _filter_dict_recursively(
- dict1: Dict[Any, Any], dict2: Dict[Any, Any]
-) -> Dict[Any, Any]:
+ dict1: Mapping[Any, Any], dict2: Mapping[Any, Any]
+) -> Mapping[Any, Any]:
filtered_dict = {}
for k, val in dict1.items():
if k in dict2:
@@ -70,7 +71,7 @@ def _filter_dict_recursively(
def urlencoded_params_matcher(
- params: Optional[Dict[str, str]], *, allow_blank: bool = False
+ params: Optional[Mapping[str, str]], *, allow_blank: bool = False
) -> Callable[..., Any]:
"""
Matches URL encoded data
@@ -100,7 +101,7 @@ def urlencoded_params_matcher(
def json_params_matcher(
- params: Optional[Union[Dict[str, Any], List[Any]]], *, strict_match: bool = True
+ params: Optional[Union[Mapping[str, Any], List[Any]]], *, strict_match: bool = True
) -> Callable[..., Any]:
"""Matches JSON encoded data of request body.
@@ -192,7 +193,7 @@ def fragment_identifier_matcher(identifier: Optional[str]) -> Callable[..., Any]
def query_param_matcher(
- params: Optional[Dict[str, Any]], *, strict_match: bool = True
+ params: Optional[MutableMapping[str, Any]], *, strict_match: bool = True
) -> Callable[..., Any]:
"""Matcher to match 'params' argument in request.
@@ -276,7 +277,7 @@ def query_string_matcher(query: Optional[str]) -> Callable[..., Any]:
return match
-def request_kwargs_matcher(kwargs: Optional[Dict[str, Any]]) -> Callable[..., Any]:
+def request_kwargs_matcher(kwargs: Optional[Mapping[str, Any]]) -> Callable[..., Any]:
"""
Matcher to match keyword arguments provided to request
@@ -308,7 +309,7 @@ def request_kwargs_matcher(kwargs: Optional[Dict[str, Any]]) -> Callable[..., An
def multipart_matcher(
- files: Dict[str, Any], data: Optional[Dict[str, str]] = None
+ files: Mapping[str, Any], data: Optional[Mapping[str, str]] = None
) -> Callable[..., Any]:
"""
Matcher to match 'multipart/form-data' content-type.
@@ -392,7 +393,7 @@ def multipart_matcher(
def header_matcher(
- headers: Dict[str, Union[str, Pattern[str]]], strict_match: bool = False
+ headers: Mapping[str, Union[str, Pattern[str]]], strict_match: bool = False
) -> Callable[..., Any]:
"""
Matcher to match 'headers' argument in request using the responses library.
@@ -408,7 +409,7 @@ def header_matcher(
:return: (func) matcher
"""
- def _compare_with_regex(request_headers: Union[Dict[Any, Any], Any]) -> bool:
+ def _compare_with_regex(request_headers: Union[Mapping[Any, Any], Any]) -> bool:
if strict_match and len(request_headers) != len(headers):
return False
@@ -420,13 +421,13 @@ def header_matcher(
else:
if not v == request_headers[k]:
return False
- elif strict_match:
+ else:
return False
return True
def match(request: PreparedRequest) -> Tuple[bool, str]:
- request_headers: Union[Dict[Any, Any], Any] = request.headers or {}
+ request_headers: Union[Mapping[Any, Any], Any] = request.headers or {}
if not strict_match:
# filter down to just the headers specified in the matcher
diff --git a/contrib/python/responses/py3/ya.make b/contrib/python/responses/py3/ya.make
index 4a0969de936..ffa133acdfd 100644
--- a/contrib/python/responses/py3/ya.make
+++ b/contrib/python/responses/py3/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(0.24.1)
+VERSION(0.25.0)
LICENSE(Apache-2.0)
diff --git a/contrib/python/setuptools/py3/.dist-info/METADATA b/contrib/python/setuptools/py3/.dist-info/METADATA
index a12855b0916..6abcbef24b4 100644
--- a/contrib/python/setuptools/py3/.dist-info/METADATA
+++ b/contrib/python/setuptools/py3/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: setuptools
-Version: 69.0.3
+Version: 69.1.0
Summary: Easily download, build, install, upgrade, and uninstall Python packages
Home-page: https://github.com/pypa/setuptools
Author: Python Packaging Authority
@@ -51,6 +51,7 @@ Requires-Dist: filelock >=3.4.0 ; extra == 'testing'
Requires-Dist: ini2toml[lite] >=0.9 ; extra == 'testing'
Requires-Dist: tomli-w >=1.0.0 ; extra == 'testing'
Requires-Dist: pytest-timeout ; extra == 'testing'
+Requires-Dist: pytest-home >=0.5 ; extra == 'testing'
Provides-Extra: testing-integration
Requires-Dist: pytest ; extra == 'testing-integration'
Requires-Dist: pytest-xdist ; extra == 'testing-integration'
@@ -63,11 +64,10 @@ Requires-Dist: jaraco.envs >=2.2 ; extra == 'testing-integration'
Requires-Dist: build[virtualenv] >=1.0.3 ; extra == 'testing-integration'
Requires-Dist: filelock >=3.4.0 ; extra == 'testing-integration'
Requires-Dist: packaging >=23.1 ; extra == 'testing-integration'
-Requires-Dist: pytest-black >=0.3.7 ; (platform_python_implementation != "PyPy") and extra == 'testing'
Requires-Dist: pytest-cov ; (platform_python_implementation != "PyPy") and extra == 'testing'
Requires-Dist: pytest-mypy >=0.9.1 ; (platform_python_implementation != "PyPy") and extra == 'testing'
Requires-Dist: jaraco.develop >=7.21 ; (python_version >= "3.9" and sys_platform != "cygwin") and extra == 'testing'
-Requires-Dist: pytest-ruff ; (sys_platform != "cygwin") and extra == 'testing'
+Requires-Dist: pytest-ruff >=0.2.1 ; (sys_platform != "cygwin") and extra == 'testing'
Requires-Dist: pytest-perf ; (sys_platform != "cygwin") and extra == 'testing'
.. image:: https://img.shields.io/pypi/v/setuptools.svg
@@ -83,14 +83,10 @@ Requires-Dist: pytest-perf ; (sys_platform != "cygwin") and extra == 'testing'
:target: https://github.com/astral-sh/ruff
:alt: Ruff
-.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
- :target: https://github.com/psf/black
- :alt: Code style: Black
-
.. image:: https://img.shields.io/readthedocs/setuptools/latest.svg
:target: https://setuptools.pypa.io
-.. image:: https://img.shields.io/badge/skeleton-2023-informational
+.. image:: https://img.shields.io/badge/skeleton-2024-informational
:target: https://blog.jaraco.com/skeleton
.. image:: https://img.shields.io/codecov/c/github/pypa/setuptools/master.svg?logo=codecov&logoColor=white
@@ -103,10 +99,9 @@ Requires-Dist: pytest-perf ; (sys_platform != "cygwin") and extra == 'testing'
:target: https://discord.com/channels/803025117553754132/815945031150993468
:alt: Discord
-See the `Installation Instructions
-<https://packaging.python.org/installing/>`_ in the Python Packaging
-User's Guide for instructions on installing, upgrading, and uninstalling
-Setuptools.
+See the `Quickstart <https://setuptools.pypa.io/en/latest/userguide/quickstart.html>`_
+and the `User's Guide <https://setuptools.pypa.io/en/latest/userguide/>`_ for
+instructions on how to use Setuptools.
Questions and comments should be directed to `GitHub Discussions
<https://github.com/pypa/setuptools/discussions>`_.
diff --git a/contrib/python/setuptools/py3/README.rst b/contrib/python/setuptools/py3/README.rst
index 92c7dc6e876..eec6e35531d 100644
--- a/contrib/python/setuptools/py3/README.rst
+++ b/contrib/python/setuptools/py3/README.rst
@@ -11,14 +11,10 @@
:target: https://github.com/astral-sh/ruff
:alt: Ruff
-.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
- :target: https://github.com/psf/black
- :alt: Code style: Black
-
.. image:: https://img.shields.io/readthedocs/setuptools/latest.svg
:target: https://setuptools.pypa.io
-.. image:: https://img.shields.io/badge/skeleton-2023-informational
+.. image:: https://img.shields.io/badge/skeleton-2024-informational
:target: https://blog.jaraco.com/skeleton
.. image:: https://img.shields.io/codecov/c/github/pypa/setuptools/master.svg?logo=codecov&logoColor=white
@@ -31,10 +27,9 @@
:target: https://discord.com/channels/803025117553754132/815945031150993468
:alt: Discord
-See the `Installation Instructions
-<https://packaging.python.org/installing/>`_ in the Python Packaging
-User's Guide for instructions on installing, upgrading, and uninstalling
-Setuptools.
+See the `Quickstart <https://setuptools.pypa.io/en/latest/userguide/quickstart.html>`_
+and the `User's Guide <https://setuptools.pypa.io/en/latest/userguide/>`_ for
+instructions on how to use Setuptools.
Questions and comments should be directed to `GitHub Discussions
<https://github.com/pypa/setuptools/discussions>`_.
diff --git a/contrib/python/setuptools/py3/_distutils_hack/__init__.py b/contrib/python/setuptools/py3/_distutils_hack/__init__.py
index b951c2defd0..4d3f09b0ae9 100644
--- a/contrib/python/setuptools/py3/_distutils_hack/__init__.py
+++ b/contrib/python/setuptools/py3/_distutils_hack/__init__.py
@@ -3,16 +3,9 @@ import sys
import os
-is_pypy = '__pypy__' in sys.builtin_module_names
-
-
def warn_distutils_present():
if 'distutils' not in sys.modules:
return
- if is_pypy and sys.version_info < (3, 7):
- # PyPy for 3.6 unconditionally imports distutils, so bypass the warning
- # https://foss.heptapod.net/pypy/pypy/-/blob/be829135bc0d758997b3566062999ee8b23872b4/lib-python/3/site.py#L250
- return
import warnings
warnings.warn(
@@ -90,7 +83,7 @@ class DistutilsMetaFinder:
# optimization: only consider top level modules and those
# found in the CPython test suite.
if path is not None and not fullname.startswith('test.'):
- return
+ return None
method_name = 'spec_for_{fullname}'.format(**locals())
method = getattr(self, method_name, lambda: None)
@@ -98,7 +91,7 @@ class DistutilsMetaFinder:
def spec_for_distutils(self):
if self.is_cpython():
- return
+ return None
import importlib
import importlib.abc
@@ -115,7 +108,7 @@ class DistutilsMetaFinder:
# setuptools from the path but only after the hook
# has been loaded. Ref #2980.
# In either case, fall back to stdlib behavior.
- return
+ return None
class DistutilsLoader(importlib.abc.Loader):
def create_module(self, spec):
diff --git a/contrib/python/setuptools/py3/pkg_resources/__init__.py b/contrib/python/setuptools/py3/pkg_resources/__init__.py
index f41d46c6340..d83283ff1c7 100644
--- a/contrib/python/setuptools/py3/pkg_resources/__init__.py
+++ b/contrib/python/setuptools/py3/pkg_resources/__init__.py
@@ -18,11 +18,16 @@ This module is deprecated. Users are directed to :mod:`importlib.resources`,
"""
import sys
+
+if sys.version_info < (3, 8):
+ raise RuntimeError("Python 3.8 or later is required")
+
import os
import io
import time
import re
import types
+from typing import Protocol
import zipfile
import zipimport
import warnings
@@ -41,18 +46,10 @@ import inspect
import ntpath
import posixpath
import importlib
+import importlib.machinery
from pkgutil import get_importer
-try:
- import _imp
-except ImportError:
- # Python 3.2 compatibility
- import imp as _imp
-
-try:
- FileExistsError
-except NameError:
- FileExistsError = OSError
+import _imp
# capture these to bypass sandboxing
from os import utime
@@ -68,14 +65,6 @@ except ImportError:
from os import open as os_open
from os.path import isdir, split
-try:
- import importlib.machinery as importlib_machinery
-
- # access attribute to force import under delayed import mechanisms.
- importlib_machinery.__name__
-except ImportError:
- importlib_machinery = None
-
from pkg_resources.extern.jaraco.text import (
yield_lines,
drop_comment,
@@ -91,9 +80,6 @@ __import__('pkg_resources.extern.packaging.requirements')
__import__('pkg_resources.extern.packaging.markers')
__import__('pkg_resources.extern.packaging.utils')
-if sys.version_info < (3, 5):
- raise RuntimeError("Python 3.5 or later is required")
-
# declare some globals that will be defined later to
# satisfy the linters.
require = None
@@ -407,20 +393,18 @@ def get_provider(moduleOrReq):
return _find_adapter(_provider_factories, loader)(module)
-def _macos_vers(_cache=[]):
- if not _cache:
- version = platform.mac_ver()[0]
- # fallback for MacPorts
- if version == '':
- plist = '/System/Library/CoreServices/SystemVersion.plist'
- if os.path.exists(plist):
- if hasattr(plistlib, 'readPlist'):
- plist_content = plistlib.readPlist(plist)
- if 'ProductVersion' in plist_content:
- version = plist_content['ProductVersion']
-
- _cache.append(version.split('.'))
- return _cache[0]
[email protected]_cache(maxsize=None)
+def _macos_vers():
+ version = platform.mac_ver()[0]
+ # fallback for MacPorts
+ if version == '':
+ plist = '/System/Library/CoreServices/SystemVersion.plist'
+ if os.path.exists(plist):
+ with open(plist, 'rb') as fh:
+ plist_content = plistlib.load(fh)
+ if 'ProductVersion' in plist_content:
+ version = plist_content['ProductVersion']
+ return version.split('.')
def _macos_arch(machine):
@@ -546,54 +530,54 @@ def get_entry_info(dist, group, name):
return get_distribution(dist).get_entry_info(group, name)
-class IMetadataProvider:
- def has_metadata(name):
+class IMetadataProvider(Protocol):
+ def has_metadata(self, name):
"""Does the package's distribution contain the named metadata?"""
- def get_metadata(name):
+ def get_metadata(self, name):
"""The named metadata resource as a string"""
- def get_metadata_lines(name):
+ def get_metadata_lines(self, name):
"""Yield named metadata resource as list of non-blank non-comment lines
Leading and trailing whitespace is stripped from each line, and lines
with ``#`` as the first non-blank character are omitted."""
- def metadata_isdir(name):
+ def metadata_isdir(self, name):
"""Is the named metadata a directory? (like ``os.path.isdir()``)"""
- def metadata_listdir(name):
+ def metadata_listdir(self, name):
"""List of metadata names in the directory (like ``os.listdir()``)"""
- def run_script(script_name, namespace):
+ def run_script(self, script_name, namespace):
"""Execute the named script in the supplied namespace dictionary"""
-class IResourceProvider(IMetadataProvider):
+class IResourceProvider(IMetadataProvider, Protocol):
"""An object that provides access to package resources"""
- def get_resource_filename(manager, resource_name):
+ def get_resource_filename(self, manager, resource_name):
"""Return a true filesystem path for `resource_name`
`manager` must be an ``IResourceManager``"""
- def get_resource_stream(manager, resource_name):
+ def get_resource_stream(self, manager, resource_name):
"""Return a readable file-like object for `resource_name`
`manager` must be an ``IResourceManager``"""
- def get_resource_string(manager, resource_name):
+ def get_resource_string(self, manager, resource_name):
"""Return a string containing the contents of `resource_name`
`manager` must be an ``IResourceManager``"""
- def has_resource(resource_name):
+ def has_resource(self, resource_name):
"""Does the package contain the named resource?"""
- def resource_isdir(resource_name):
+ def resource_isdir(self, resource_name):
"""Is the named resource a directory? (like ``os.path.isdir()``)"""
- def resource_listdir(resource_name):
+ def resource_listdir(self, resource_name):
"""List of resource names in the directory (like ``os.listdir()``)"""
@@ -1143,8 +1127,7 @@ class Environment:
None is returned instead. This method is a hook that allows subclasses
to attempt other ways of obtaining a distribution before falling back
to the `installer` argument."""
- if installer is not None:
- return installer(requirement)
+ return installer(requirement) if installer else None
def __iter__(self):
"""Yield the unique project names of the available distributions"""
@@ -1734,7 +1717,7 @@ class DefaultProvider(EggProvider):
'SourcelessFileLoader',
)
for name in loader_names:
- loader_cls = getattr(importlib_machinery, name, type(None))
+ loader_cls = getattr(importlib.machinery, name, type(None))
register_loader_type(loader_cls, cls)
@@ -1895,7 +1878,7 @@ class ZipProvider(EggProvider):
try:
rename(tmpnam, real_path)
- except os.error:
+ except OSError:
if os.path.isfile(real_path):
if self._is_current(real_path, zip_path):
# the file became current since it was checked above,
@@ -1908,7 +1891,7 @@ class ZipProvider(EggProvider):
return real_path
raise
- except os.error:
+ except OSError:
# report a user-friendly error
manager.extraction_error()
@@ -2229,7 +2212,7 @@ def resolve_egg_link(path):
if hasattr(pkgutil, 'ImpImporter'):
register_finder(pkgutil.ImpImporter, find_on_path)
-register_finder(importlib_machinery.FileFinder, find_on_path)
+register_finder(importlib.machinery.FileFinder, find_on_path)
_declare_state('dict', _namespace_handlers={})
_declare_state('dict', _namespace_packages={})
@@ -2396,7 +2379,7 @@ if hasattr(pkgutil, 'ImpImporter'):
register_namespace_handler(pkgutil.ImpImporter, file_ns_handler)
register_namespace_handler(zipimport.zipimporter, file_ns_handler)
-register_namespace_handler(importlib_machinery.FileFinder, file_ns_handler)
+register_namespace_handler(importlib.machinery.FileFinder, file_ns_handler)
def null_ns_handler(importer, path_item, packageName, module):
@@ -2422,12 +2405,9 @@ def _cygwin_patch(filename): # pragma: nocover
return os.path.abspath(filename) if sys.platform == 'cygwin' else filename
-def _normalize_cached(filename, _cache={}):
- try:
- return _cache[filename]
- except KeyError:
- _cache[filename] = result = normalize_path(filename)
- return result
[email protected]_cache(maxsize=None)
+def _normalize_cached(filename):
+ return normalize_path(filename)
def _is_egg_path(path):
@@ -2852,9 +2832,7 @@ class Distribution:
def _get_version(self):
lines = self._get_metadata(self.PKG_INFO)
- version = _version_from_file(lines)
-
- return version
+ return _version_from_file(lines)
def activate(self, path=None, replace=False):
"""Ensure distribution is importable on `path` (default=sys.path)"""
@@ -2901,7 +2879,7 @@ class Distribution:
def __dir__(self):
return list(
- set(super(Distribution, self).__dir__())
+ set(super().__dir__())
| set(attr for attr in self._provider.__dir__() if not attr.startswith('_'))
)
@@ -3168,7 +3146,7 @@ class RequirementParseError(packaging.requirements.InvalidRequirement):
class Requirement(packaging.requirements.Requirement):
def __init__(self, requirement_string):
"""DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!"""
- super(Requirement, self).__init__(requirement_string)
+ super().__init__(requirement_string)
self.unsafe_name = self.name
project_name = safe_name(self.name)
self.project_name, self.key = project_name, project_name.lower()
@@ -3229,6 +3207,7 @@ def _find_adapter(registry, ob):
for t in types:
if t in registry:
return registry[t]
+ return None
def ensure_directory(path):
diff --git a/contrib/python/setuptools/py3/setuptools/_core_metadata.py b/contrib/python/setuptools/py3/setuptools/_core_metadata.py
index 6c904c3c777..4bf3c7c947c 100644
--- a/contrib/python/setuptools/py3/setuptools/_core_metadata.py
+++ b/contrib/python/setuptools/py3/setuptools/_core_metadata.py
@@ -3,6 +3,7 @@ Handling of Core Metadata for Python packages (including reading and writing).
See: https://packaging.python.org/en/latest/specifications/core-metadata/
"""
+
import os
import stat
import textwrap
diff --git a/contrib/python/setuptools/py3/setuptools/_normalization.py b/contrib/python/setuptools/py3/setuptools/_normalization.py
index aa9274f093f..8f211b8bfb0 100644
--- a/contrib/python/setuptools/py3/setuptools/_normalization.py
+++ b/contrib/python/setuptools/py3/setuptools/_normalization.py
@@ -2,6 +2,7 @@
Helpers for normalization as expected in wheel/sdist/module file names
and core metadata
"""
+
import re
from pathlib import Path
from typing import Union
@@ -119,6 +120,21 @@ def filename_component(value: str) -> str:
return value.replace("-", "_").strip("_")
+def filename_component_broken(value: str) -> str:
+ """
+ Produce the incorrect filename component for compatibility.
+
+ See pypa/setuptools#4167 for detailed analysis.
+
+ TODO: replace this with filename_component after pip 24 is
+ nearly-ubiquitous.
+
+ >>> filename_component_broken('foo_bar-baz')
+ 'foo-bar-baz'
+ """
+ return value.replace('_', '-')
+
+
def safer_name(value: str) -> str:
"""Like ``safe_name`` but can be used as filename component for wheel"""
# See bdist_wheel.safer_name
diff --git a/contrib/python/setuptools/py3/setuptools/_reqs.py b/contrib/python/setuptools/py3/setuptools/_reqs.py
index 7d7130d50ef..9f83437033c 100644
--- a/contrib/python/setuptools/py3/setuptools/_reqs.py
+++ b/contrib/python/setuptools/py3/setuptools/_reqs.py
@@ -24,13 +24,11 @@ def parse_strings(strs: _StrOrIter) -> Iterator[str]:
@overload
-def parse(strs: _StrOrIter) -> Iterator[Requirement]:
- ...
+def parse(strs: _StrOrIter) -> Iterator[Requirement]: ...
@overload
-def parse(strs: _StrOrIter, parser: Callable[[str], _T]) -> Iterator[_T]:
- ...
+def parse(strs: _StrOrIter, parser: Callable[[str], _T]) -> Iterator[_T]: ...
def parse(strs, parser=parse_req):
diff --git a/contrib/python/setuptools/py3/setuptools/build_meta.py b/contrib/python/setuptools/py3/setuptools/build_meta.py
index 6da80d70b86..0a0abfdae0d 100644
--- a/contrib/python/setuptools/py3/setuptools/build_meta.py
+++ b/contrib/python/setuptools/py3/setuptools/build_meta.py
@@ -121,16 +121,16 @@ def _file_with_extension(directory, extension):
raise ValueError(
'No distribution was found. Ensure that `setup.py` '
'is not empty and that it calls `setup()`.'
- )
+ ) from None
return file
def _open_setup_script(setup_script):
if not os.path.exists(setup_script):
# Supply a default setup.py
- return io.StringIO(u"from setuptools import setup; setup()")
+ return io.StringIO("from setuptools import setup; setup()")
- return getattr(tokenize, 'open', open)(setup_script)
+ return tokenize.open(setup_script)
@contextlib.contextmanager
@@ -477,7 +477,7 @@ class _BuildMetaLegacyBackend(_BuildMetaBackend):
sys.argv[0] = setup_script
try:
- super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
+ super().run_setup(setup_script=setup_script)
finally:
# While PEP 517 frontends should be calling each hook in a fresh
# subprocess according to the standard (and thus it should not be
diff --git a/contrib/python/setuptools/py3/setuptools/command/_requirestxt.py b/contrib/python/setuptools/py3/setuptools/command/_requirestxt.py
index 32bae2c4b4f..7b732b11abf 100644
--- a/contrib/python/setuptools/py3/setuptools/command/_requirestxt.py
+++ b/contrib/python/setuptools/py3/setuptools/command/_requirestxt.py
@@ -6,6 +6,7 @@ The ``requires.txt`` file has an specific format:
See https://setuptools.pypa.io/en/latest/deprecated/python_eggs.html#requires-txt
"""
+
import io
from collections import defaultdict
from itertools import filterfalse
diff --git a/contrib/python/setuptools/py3/setuptools/command/bdist_egg.py b/contrib/python/setuptools/py3/setuptools/command/bdist_egg.py
index bdece56bc9d..3687efdf9c6 100644
--- a/contrib/python/setuptools/py3/setuptools/command/bdist_egg.py
+++ b/contrib/python/setuptools/py3/setuptools/command/bdist_egg.py
@@ -232,9 +232,11 @@ class bdist_egg(Command):
remove_tree(self.bdist_dir, dry_run=self.dry_run)
# Add to 'Distribution.dist_files' so that the "upload" command works
- getattr(self.distribution, 'dist_files', []).append(
- ('bdist_egg', get_python_version(), self.egg_output)
- )
+ getattr(self.distribution, 'dist_files', []).append((
+ 'bdist_egg',
+ get_python_version(),
+ self.egg_output,
+ ))
def zap_pyfiles(self):
log.info("Removing .py files from temporary directory")
@@ -319,8 +321,7 @@ def walk_egg(egg_dir):
if 'EGG-INFO' in dirs:
dirs.remove('EGG-INFO')
yield base, dirs, files
- for bdf in walker:
- yield bdf
+ yield from walker
def analyze_egg(egg_dir, stubs):
@@ -368,10 +369,7 @@ def scan_module(egg_dir, base, name, stubs):
return True # Extension module
pkg = base[len(egg_dir) + 1 :].replace(os.sep, '.')
module = pkg + (pkg and '.' or '') + os.path.splitext(name)[0]
- if sys.version_info < (3, 7):
- skip = 12 # skip magic & date & file size
- else:
- skip = 16 # skip magic & reserved? & date & file size
+ skip = 16 # skip magic & reserved? & date & file size
f = open(filename, 'rb')
f.read(skip)
code = marshal.load(f)
@@ -404,14 +402,12 @@ def scan_module(egg_dir, base, name, stubs):
def iter_symbols(code):
"""Yield names and strings used by `code` and its nested code objects"""
- for name in code.co_names:
- yield name
+ yield from code.co_names
for const in code.co_consts:
if isinstance(const, str):
yield const
elif isinstance(const, CodeType):
- for name in iter_symbols(const):
- yield name
+ yield from iter_symbols(const)
def can_scan():
@@ -423,6 +419,7 @@ def can_scan():
"Please ask the author to include a 'zip_safe'"
" setting (either True or False) in the package's setup.py"
)
+ return False
# Attribute names of options for commands that might need to be convinced to
diff --git a/contrib/python/setuptools/py3/setuptools/command/bdist_rpm.py b/contrib/python/setuptools/py3/setuptools/command/bdist_rpm.py
index 30b7c233853..70ed6b6097f 100644
--- a/contrib/python/setuptools/py3/setuptools/command/bdist_rpm.py
+++ b/contrib/python/setuptools/py3/setuptools/command/bdist_rpm.py
@@ -30,11 +30,10 @@ class bdist_rpm(orig.bdist_rpm):
def _make_spec_file(self):
spec = orig.bdist_rpm._make_spec_file(self)
- spec = [
+ return [
line.replace(
"setup.py install ",
"setup.py install --single-version-externally-managed ",
).replace("%setup", "%setup -n %{name}-%{unmangled_version}")
for line in spec
]
- return spec
diff --git a/contrib/python/setuptools/py3/setuptools/command/build.py b/contrib/python/setuptools/py3/setuptools/command/build.py
index 0f1d688e179..afda7e3be92 100644
--- a/contrib/python/setuptools/py3/setuptools/command/build.py
+++ b/contrib/python/setuptools/py3/setuptools/command/build.py
@@ -1,17 +1,8 @@
-import sys
-from typing import TYPE_CHECKING, List, Dict
+from typing import Dict, List, Protocol
from distutils.command.build import build as _build
from ..warnings import SetuptoolsDeprecationWarning
-if sys.version_info >= (3, 8):
- from typing import Protocol
-elif TYPE_CHECKING:
- from typing_extensions import Protocol
-else:
- from abc import ABC as Protocol
-
-
_ORIGINAL_SUBCOMMANDS = {"build_py", "build_clib", "build_ext", "build_scripts"}
diff --git a/contrib/python/setuptools/py3/setuptools/command/build_ext.py b/contrib/python/setuptools/py3/setuptools/command/build_ext.py
index 9a80781cf4e..780afe3aece 100644
--- a/contrib/python/setuptools/py3/setuptools/command/build_ext.py
+++ b/contrib/python/setuptools/py3/setuptools/command/build_ext.py
@@ -37,9 +37,9 @@ def _customize_compiler_for_shlib(compiler):
tmp = _CONFIG_VARS.copy()
try:
# XXX Help! I don't have any idea whether these are right...
- _CONFIG_VARS[
- 'LDSHARED'
- ] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
+ _CONFIG_VARS['LDSHARED'] = (
+ "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
+ )
_CONFIG_VARS['CCSHARED'] = " -dynamiclib"
_CONFIG_VARS['SO'] = ".dylib"
customize_compiler(compiler)
@@ -76,6 +76,7 @@ def get_abi3_suffix():
return suffix
elif suffix == '.pyd': # Windows
return suffix
+ return None
class build_ext(_build_ext):
@@ -157,7 +158,7 @@ class build_ext(_build_ext):
if fullname in self.ext_map:
ext = self.ext_map[fullname]
- use_abi3 = getattr(ext, 'py_limited_api') and get_abi3_suffix()
+ use_abi3 = ext.py_limited_api and get_abi3_suffix()
if use_abi3:
filename = filename[: -len(so_ext)]
so_ext = get_abi3_suffix()
@@ -341,33 +342,30 @@ class build_ext(_build_ext):
if not self.dry_run:
f = open(stub_file, 'w')
f.write(
- '\n'.join(
- [
- "def __bootstrap__():",
- " global __bootstrap__, __file__, __loader__",
- " import sys, os, pkg_resources, importlib.util"
- + if_dl(", dl"),
- " __file__ = pkg_resources.resource_filename"
- "(__name__,%r)" % os.path.basename(ext._file_name),
- " del __bootstrap__",
- " if '__loader__' in globals():",
- " del __loader__",
- if_dl(" old_flags = sys.getdlopenflags()"),
- " old_dir = os.getcwd()",
- " try:",
- " os.chdir(os.path.dirname(__file__))",
- if_dl(" sys.setdlopenflags(dl.RTLD_NOW)"),
- " spec = importlib.util.spec_from_file_location(",
- " __name__, __file__)",
- " mod = importlib.util.module_from_spec(spec)",
- " spec.loader.exec_module(mod)",
- " finally:",
- if_dl(" sys.setdlopenflags(old_flags)"),
- " os.chdir(old_dir)",
- "__bootstrap__()",
- "", # terminal \n
- ]
- )
+ '\n'.join([
+ "def __bootstrap__():",
+ " global __bootstrap__, __file__, __loader__",
+ " import sys, os, pkg_resources, importlib.util" + if_dl(", dl"),
+ " __file__ = pkg_resources.resource_filename"
+ "(__name__,%r)" % os.path.basename(ext._file_name),
+ " del __bootstrap__",
+ " if '__loader__' in globals():",
+ " del __loader__",
+ if_dl(" old_flags = sys.getdlopenflags()"),
+ " old_dir = os.getcwd()",
+ " try:",
+ " os.chdir(os.path.dirname(__file__))",
+ if_dl(" sys.setdlopenflags(dl.RTLD_NOW)"),
+ " spec = importlib.util.spec_from_file_location(",
+ " __name__, __file__)",
+ " mod = importlib.util.module_from_spec(spec)",
+ " spec.loader.exec_module(mod)",
+ " finally:",
+ if_dl(" sys.setdlopenflags(old_flags)"),
+ " os.chdir(old_dir)",
+ "__bootstrap__()",
+ "", # terminal \n
+ ])
)
f.close()
if compile:
diff --git a/contrib/python/setuptools/py3/setuptools/command/build_py.py b/contrib/python/setuptools/py3/setuptools/command/build_py.py
index cbdd05aab0e..3f40b060b3a 100644
--- a/contrib/python/setuptools/py3/setuptools/command/build_py.py
+++ b/contrib/python/setuptools/py3/setuptools/command/build_py.py
@@ -288,7 +288,7 @@ class build_py(orig.build_py):
return list(unique_everseen(keepers))
@staticmethod
- def _get_platform_patterns(spec, package, src_dir, extra_patterns=[]):
+ def _get_platform_patterns(spec, package, src_dir, extra_patterns=()):
"""
yield platform-specific path patterns (suitable for glob
or fn_match) from a glob-based spec (such as
diff --git a/contrib/python/setuptools/py3/setuptools/command/develop.py b/contrib/python/setuptools/py3/setuptools/command/develop.py
index ea3e48e55c1..d8c1b49b3dc 100644
--- a/contrib/python/setuptools/py3/setuptools/command/develop.py
+++ b/contrib/python/setuptools/py3/setuptools/command/develop.py
@@ -5,6 +5,7 @@ import os
import glob
from setuptools.command.easy_install import easy_install
+from setuptools import _normalization
from setuptools import _path
from setuptools import namespaces
import setuptools
@@ -52,7 +53,9 @@ class develop(namespaces.DevelopInstaller, easy_install):
# pick up setup-dir .egg files only: no .egg-info
self.package_index.scan(glob.glob('*.egg'))
- egg_link_fn = ei.egg_name + '.egg-link'
+ egg_link_fn = (
+ _normalization.filename_component_broken(ei.egg_name) + '.egg-link'
+ )
self.egg_link = os.path.join(self.install_dir, egg_link_fn)
self.egg_base = ei.egg_base
if self.egg_path is None:
@@ -157,6 +160,8 @@ class develop(namespaces.DevelopInstaller, easy_install):
script_text = strm.read()
self.install_script(dist, script_name, script_text, script_path)
+ return None
+
def install_wrapper_scripts(self, dist):
dist = VersionlessRequirement(dist)
return easy_install.install_wrapper_scripts(self, dist)
diff --git a/contrib/python/setuptools/py3/setuptools/command/dist_info.py b/contrib/python/setuptools/py3/setuptools/command/dist_info.py
index 5ef322168c4..f5061afaaf7 100644
--- a/contrib/python/setuptools/py3/setuptools/command/dist_info.py
+++ b/contrib/python/setuptools/py3/setuptools/command/dist_info.py
@@ -5,7 +5,6 @@ As defined in the wheel specification
import os
import shutil
-import sys
from contextlib import contextmanager
from distutils import log
from distutils.core import Command
@@ -77,7 +76,7 @@ class dist_info(Command):
if requires_bkp:
bkp_name = f"{dir_path}.__bkp__"
_rm(bkp_name, ignore_errors=True)
- _copy(dir_path, bkp_name, dirs_exist_ok=True, symlinks=True)
+ shutil.copytree(dir_path, bkp_name, dirs_exist_ok=True, symlinks=True)
try:
yield
finally:
@@ -103,9 +102,3 @@ class dist_info(Command):
def _rm(dir_name, **opts):
if os.path.isdir(dir_name):
shutil.rmtree(dir_name, **opts)
-
-
-def _copy(src, dst, **opts):
- if sys.version_info < (3, 8):
- opts.pop("dirs_exist_ok", None)
- shutil.copytree(src, dst, **opts)
diff --git a/contrib/python/setuptools/py3/setuptools/command/easy_install.py b/contrib/python/setuptools/py3/setuptools/command/easy_install.py
index 5d6fd5ca71c..cc0c4091231 100644
--- a/contrib/python/setuptools/py3/setuptools/command/easy_install.py
+++ b/contrib/python/setuptools/py3/setuptools/command/easy_install.py
@@ -74,7 +74,7 @@ from pkg_resources import (
DEVELOP_DIST,
)
import pkg_resources
-from .. import py312compat
+from ..compat import py311
from .._path import ensure_directory
from ..extern.jaraco.text import yield_lines
@@ -245,31 +245,26 @@ class easy_install(Command):
self.config_vars = dict(sysconfig.get_config_vars())
- self.config_vars.update(
- {
- 'dist_name': self.distribution.get_name(),
- 'dist_version': self.distribution.get_version(),
- 'dist_fullname': self.distribution.get_fullname(),
- 'py_version': py_version,
- 'py_version_short': (
- f'{sys.version_info.major}.{sys.version_info.minor}'
- ),
- 'py_version_nodot': f'{sys.version_info.major}{sys.version_info.minor}',
- 'sys_prefix': self.config_vars['prefix'],
- 'sys_exec_prefix': self.config_vars['exec_prefix'],
- # Only python 3.2+ has abiflags
- 'abiflags': getattr(sys, 'abiflags', ''),
- 'platlibdir': getattr(sys, 'platlibdir', 'lib'),
- }
- )
+ self.config_vars.update({
+ 'dist_name': self.distribution.get_name(),
+ 'dist_version': self.distribution.get_version(),
+ 'dist_fullname': self.distribution.get_fullname(),
+ 'py_version': py_version,
+ 'py_version_short': f'{sys.version_info.major}.{sys.version_info.minor}',
+ 'py_version_nodot': f'{sys.version_info.major}{sys.version_info.minor}',
+ 'sys_prefix': self.config_vars['prefix'],
+ 'sys_exec_prefix': self.config_vars['exec_prefix'],
+ # Only POSIX systems have abiflags
+ 'abiflags': getattr(sys, 'abiflags', ''),
+ # Only python 3.9+ has platlibdir
+ 'platlibdir': getattr(sys, 'platlibdir', 'lib'),
+ })
with contextlib.suppress(AttributeError):
# only for distutils outside stdlib
- self.config_vars.update(
- {
- 'implementation_lower': install._get_implementation().lower(),
- 'implementation': install._get_implementation(),
- }
- )
+ self.config_vars.update({
+ 'implementation_lower': install._get_implementation().lower(),
+ 'implementation': install._get_implementation(),
+ })
# pypa/distutils#113 Python 3.9 compat
self.config_vars.setdefault(
@@ -668,7 +663,7 @@ class easy_install(Command):
@contextlib.contextmanager
def _tmpdir(self):
- tmpdir = tempfile.mkdtemp(prefix=u"easy_install-")
+ tmpdir = tempfile.mkdtemp(prefix="easy_install-")
try:
# cast to str as workaround for #709 and #710 and #712
yield str(tmpdir)
@@ -746,6 +741,7 @@ class easy_install(Command):
for dist in dists:
if dist in spec:
return dist
+ return None
def select_scheme(self, name):
try:
@@ -1028,9 +1024,9 @@ class easy_install(Command):
f.close()
script_dir = os.path.join(_egg_info, 'scripts')
# delete entry-point scripts to avoid duping
- self.delete_blockers(
- [os.path.join(script_dir, args[0]) for args in ScriptWriter.get_args(dist)]
- )
+ self.delete_blockers([
+ os.path.join(script_dir, args[0]) for args in ScriptWriter.get_args(dist)
+ ])
# Build .egg file from tmpdir
bdist_egg.make_zipfile(
egg_path,
@@ -1433,24 +1429,20 @@ def get_site_dirs():
if sys.platform in ('os2emx', 'riscos'):
sitedirs.append(os.path.join(prefix, "Lib", "site-packages"))
elif os.sep == '/':
- sitedirs.extend(
- [
- os.path.join(
- prefix,
- "lib",
- "python{}.{}".format(*sys.version_info),
- "site-packages",
- ),
- os.path.join(prefix, "lib", "site-python"),
- ]
- )
- else:
- sitedirs.extend(
- [
+ sitedirs.extend([
+ os.path.join(
prefix,
- os.path.join(prefix, "lib", "site-packages"),
- ]
- )
+ "lib",
+ "python{}.{}".format(*sys.version_info),
+ "site-packages",
+ ),
+ os.path.join(prefix, "lib", "site-python"),
+ ])
+ else:
+ sitedirs.extend([
+ prefix,
+ os.path.join(prefix, "lib", "site-packages"),
+ ])
if sys.platform != 'darwin':
continue
@@ -1482,9 +1474,7 @@ def get_site_dirs():
with contextlib.suppress(AttributeError):
sitedirs.extend(site.getsitepackages())
- sitedirs = list(map(normalize_path, sitedirs))
-
- return sitedirs
+ return list(map(normalize_path, sitedirs))
def expand_paths(inputs): # noqa: C901 # is too complex (11) # FIXME
@@ -1678,9 +1668,11 @@ class PthDistributions(Environment):
last_paths.remove(path)
# also, re-check that all paths are still valid before saving them
for path in self.paths[:]:
- if path not in last_paths and not path.startswith(
- ('import ', 'from ', '#')
- ):
+ if path not in last_paths and not path.startswith((
+ 'import ',
+ 'from ',
+ '#',
+ )):
absolute_path = os.path.join(self.basedir, path)
if not os.path.exists(absolute_path):
self.paths.remove(path)
@@ -1751,8 +1743,7 @@ class RewritePthDistributions(PthDistributions):
@classmethod
def _wrap_lines(cls, lines):
yield cls.prelude
- for line in lines:
- yield line
+ yield from lines
yield cls.postlude
prelude = _one_liner(
@@ -2032,7 +2023,7 @@ def chmod(path, mode):
log.debug("changing mode of %s to %o", path, mode)
try:
_chmod(path, mode)
- except os.error as e:
+ except OSError as e:
log.debug("chmod failed: %s", e)
@@ -2188,8 +2179,7 @@ class ScriptWriter:
cls._ensure_safe_name(name)
script_text = cls.template % locals()
args = cls._get_script_args(type_, name, header, script_text)
- for res in args:
- yield res
+ yield from args
@staticmethod
def _ensure_safe_name(name):
@@ -2339,7 +2329,7 @@ def load_launcher_manifest(name):
def _rmtree(path, ignore_errors=False, onexc=auto_chmod):
- return py312compat.shutil_rmtree(path, ignore_errors, onexc)
+ return py311.shutil_rmtree(path, ignore_errors, onexc)
def current_umask():
diff --git a/contrib/python/setuptools/py3/setuptools/command/editable_wheel.py b/contrib/python/setuptools/py3/setuptools/command/editable_wheel.py
index 79c839f8f02..8a4ae7928f2 100644
--- a/contrib/python/setuptools/py3/setuptools/command/editable_wheel.py
+++ b/contrib/python/setuptools/py3/setuptools/command/editable_wheel.py
@@ -19,7 +19,7 @@ import traceback
from contextlib import suppress
from enum import Enum
from inspect import cleandoc
-from itertools import chain
+from itertools import chain, starmap
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import (
@@ -30,6 +30,7 @@ from typing import (
List,
Mapping,
Optional,
+ Protocol,
Tuple,
TypeVar,
Union,
@@ -54,13 +55,6 @@ from .build_py import build_py as build_py_cls
if TYPE_CHECKING:
from wheel.wheelfile import WheelFile # noqa
-if sys.version_info >= (3, 8):
- from typing import Protocol
-elif TYPE_CHECKING:
- from typing_extensions import Protocol
-else:
- from abc import ABC as Protocol
-
_Path = Union[str, Path]
_P = TypeVar("_P", bound=_Path)
_logger = logging.getLogger(__name__)
@@ -384,14 +378,13 @@ class editable_wheel(Command):
class EditableStrategy(Protocol):
- def __call__(self, wheel: "WheelFile", files: List[str], mapping: Dict[str, str]):
- ...
+ def __call__(
+ self, wheel: "WheelFile", files: List[str], mapping: Dict[str, str]
+ ): ...
- def __enter__(self):
- ...
+ def __enter__(self): ...
- def __exit__(self, _exc_type, _exc_value, _traceback):
- ...
+ def __exit__(self, _exc_type, _exc_value, _traceback): ...
class _StaticPth:
@@ -401,7 +394,7 @@ class _StaticPth:
self.path_entries = path_entries
def __call__(self, wheel: "WheelFile", files: List[str], mapping: Dict[str, str]):
- entries = "\n".join((str(p.resolve()) for p in self.path_entries))
+ entries = "\n".join(str(p.resolve()) for p in self.path_entries)
contents = _encode_pth(f"{entries}\n")
wheel.writestr(f"__editable__.{self.name}.pth", contents)
@@ -413,8 +406,7 @@ class _StaticPth:
_logger.warning(msg + _LENIENT_WARNING)
return self
- def __exit__(self, _exc_type, _exc_value, _traceback):
- ...
+ def __exit__(self, _exc_type, _exc_value, _traceback): ...
class _LinkTree(_StaticPth):
@@ -608,7 +600,7 @@ def _simple_layout(
layout = {pkg: find_package_path(pkg, package_dir, project_dir) for pkg in packages}
if not layout:
return set(package_dir) in ({}, {""})
- parent = os.path.commonpath([_parent_path(k, v) for k, v in layout.items()])
+ parent = os.path.commonpath(starmap(_parent_path, layout.items()))
return all(
_path.same_path(Path(parent, *key.split('.')), value)
for key, value in layout.items()
diff --git a/contrib/python/setuptools/py3/setuptools/command/egg_info.py b/contrib/python/setuptools/py3/setuptools/command/egg_info.py
index 7c7f57aaf86..62d2feea9b4 100644
--- a/contrib/python/setuptools/py3/setuptools/command/egg_info.py
+++ b/contrib/python/setuptools/py3/setuptools/command/egg_info.py
@@ -385,9 +385,8 @@ class FileList(_FileList):
try:
process_action = action_map[action]
except KeyError:
- raise DistutilsInternalError(
- "this cannot happen: invalid action '{action!s}'".format(action=action),
- )
+ msg = f"Invalid MANIFEST.in: unknown action {action!r} in {line!r}"
+ raise DistutilsInternalError(msg) from None
# OK, now we know that the action is valid and we have the
# right number of words on the line for that action -- so we
@@ -700,9 +699,9 @@ write_setup_requirements = _requirestxt.write_setup_requirements
def write_toplevel_names(cmd, basename, filename):
- pkgs = dict.fromkeys(
- [k.split('.', 1)[0] for k in cmd.distribution.iter_distribution_names()]
- )
+ pkgs = dict.fromkeys([
+ k.split('.', 1)[0] for k in cmd.distribution.iter_distribution_names()
+ ])
cmd.write_file("top-level names", filename, '\n'.join(sorted(pkgs)) + '\n')
diff --git a/contrib/python/setuptools/py3/setuptools/command/install.py b/contrib/python/setuptools/py3/setuptools/command/install.py
index 606cce9d898..b97a9b4713f 100644
--- a/contrib/python/setuptools/py3/setuptools/command/install.py
+++ b/contrib/python/setuptools/py3/setuptools/command/install.py
@@ -71,6 +71,7 @@ class install(orig.install):
# command without --root or --single-version-externally-managed
self.path_file = None
self.extra_dirs = ''
+ return None
def run(self):
# Explicit request for old-style install? Just do it
@@ -83,6 +84,8 @@ class install(orig.install):
else:
self.do_egg_install()
+ return None
+
@staticmethod
def _called_from_setup(run_frame):
"""
@@ -114,6 +117,8 @@ class install(orig.install):
return caller_module == 'distutils.dist' and info.function == 'run_commands'
+ return False
+
def do_egg_install(self):
easy_install = self.distribution.get_command_class('easy_install')
diff --git a/contrib/python/setuptools/py3/setuptools/command/sdist.py b/contrib/python/setuptools/py3/setuptools/command/sdist.py
index 5f45fb5deec..d455f44c5eb 100644
--- a/contrib/python/setuptools/py3/setuptools/command/sdist.py
+++ b/contrib/python/setuptools/py3/setuptools/command/sdist.py
@@ -1,7 +1,6 @@
from distutils import log
import distutils.command.sdist as orig
import os
-import sys
import contextlib
from itertools import chain
@@ -14,8 +13,7 @@ _default_revctrl = list
def walk_revctrl(dirname=''):
"""Find all files under revision control"""
for ep in metadata.entry_points(group='setuptools.file_finders'):
- for item in ep.load()(dirname):
- yield item
+ yield from ep.load()(dirname)
class sdist(orig.sdist):
@@ -72,14 +70,6 @@ class sdist(orig.sdist):
def initialize_options(self):
orig.sdist.initialize_options(self)
- self._default_to_gztar()
-
- def _default_to_gztar(self):
- # only needed on Python prior to 3.6.
- if sys.version_info >= (3, 6, 0, 'beta', 1):
- return
- self.formats = ['gztar']
-
def make_distribution(self):
"""
Workaround for #516
@@ -106,7 +96,7 @@ class sdist(orig.sdist):
yield
finally:
if orig_val is not NoValue:
- setattr(os, 'link', orig_val)
+ os.link = orig_val
def add_defaults(self):
super().add_defaults()
@@ -190,7 +180,7 @@ class sdist(orig.sdist):
with open(self.manifest, 'rb') as fp:
first_line = fp.readline()
- return first_line != '# file GENERATED by distutils, do NOT edit\n'.encode()
+ return first_line != b'# file GENERATED by distutils, do NOT edit\n'
def read_manifest(self):
"""Read the manifest file (named by 'self.manifest') and use it to
diff --git a/contrib/python/setuptools/py3/setuptools/command/test.py b/contrib/python/setuptools/py3/setuptools/command/test.py
index 5fce6660c07..0a128f2a7a5 100644
--- a/contrib/python/setuptools/py3/setuptools/command/test.py
+++ b/contrib/python/setuptools/py3/setuptools/command/test.py
@@ -132,7 +132,7 @@ class test(Command):
func()
@contextlib.contextmanager
- def project_on_sys_path(self, include_dists=[]):
+ def project_on_sys_path(self, include_dists=()):
self.run_command('egg_info')
# Build extensions in-place
diff --git a/contrib/tools/python3/src/Lib/email/mime/__init__.py b/contrib/python/setuptools/py3/setuptools/compat/__init__.py
index e69de29bb2d..e69de29bb2d 100644
--- a/contrib/tools/python3/src/Lib/email/mime/__init__.py
+++ b/contrib/python/setuptools/py3/setuptools/compat/__init__.py
diff --git a/contrib/python/setuptools/py3/setuptools/compat/py310.py b/contrib/python/setuptools/py3/setuptools/compat/py310.py
new file mode 100644
index 00000000000..f7d53d6de94
--- /dev/null
+++ b/contrib/python/setuptools/py3/setuptools/compat/py310.py
@@ -0,0 +1,10 @@
+import sys
+
+
+__all__ = ['tomllib']
+
+
+if sys.version_info >= (3, 11):
+ import tomllib
+else: # pragma: no cover
+ from setuptools.extern import tomli as tomllib
diff --git a/contrib/python/setuptools/py3/setuptools/py312compat.py b/contrib/python/setuptools/py3/setuptools/compat/py311.py
index 28175b1f750..28175b1f750 100644
--- a/contrib/python/setuptools/py3/setuptools/py312compat.py
+++ b/contrib/python/setuptools/py3/setuptools/compat/py311.py
diff --git a/contrib/python/setuptools/py3/setuptools/config/__init__.py b/contrib/python/setuptools/py3/setuptools/config/__init__.py
index ffea394436b..fcc7d008d6c 100644
--- a/contrib/python/setuptools/py3/setuptools/config/__init__.py
+++ b/contrib/python/setuptools/py3/setuptools/config/__init__.py
@@ -1,6 +1,7 @@
"""For backward compatibility, expose main functions from
``setuptools.config.setupcfg``
"""
+
from functools import wraps
from typing import Callable, TypeVar, cast
diff --git a/contrib/python/setuptools/py3/setuptools/config/_apply_pyprojecttoml.py b/contrib/python/setuptools/py3/setuptools/config/_apply_pyprojecttoml.py
index 80318d5d0b7..32fb00131e8 100644
--- a/contrib/python/setuptools/py3/setuptools/config/_apply_pyprojecttoml.py
+++ b/contrib/python/setuptools/py3/setuptools/config/_apply_pyprojecttoml.py
@@ -7,6 +7,7 @@ need to be processed before being applied.
**PRIVATE MODULE**: API reserved for setuptools internal usage only.
"""
+
import logging
import os
from collections.abc import Mapping
@@ -240,7 +241,7 @@ def _unify_entry_points(project_table: dict):
if group # now we can skip empty groups
}
# Sometimes this will set `project["entry-points"] = {}`, and that is
- # intentional (for reseting configurations that are missing `dynamic`).
+ # intentional (for resetting configurations that are missing `dynamic`).
def _copy_command_options(pyproject: dict, dist: "Distribution", filename: _Path):
@@ -408,7 +409,7 @@ _RESET_PREVIOUSLY_DEFINED: dict = {
"scripts": {},
"gui-scripts": {},
"dependencies": [],
- "optional-dependencies": [],
+ "optional-dependencies": {},
}
@@ -423,7 +424,7 @@ class _MissingDynamic(SetuptoolsWarning):
According to the spec (see the link below), however, setuptools CANNOT
consider this value unless `{field}` is listed as `dynamic`.
- https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
+ https://packaging.python.org/en/latest/specifications/pyproject-toml/#declaring-project-metadata-the-project-table
To prevent this problem, you can list `{field}` under `dynamic` or alternatively
remove the `[project]` table from your file and rely entirely on other means of
diff --git a/contrib/python/setuptools/py3/setuptools/config/_validate_pyproject/error_reporting.py b/contrib/python/setuptools/py3/setuptools/config/_validate_pyproject/error_reporting.py
index f78e4838fb3..d44e290e36c 100644
--- a/contrib/python/setuptools/py3/setuptools/config/_validate_pyproject/error_reporting.py
+++ b/contrib/python/setuptools/py3/setuptools/config/_validate_pyproject/error_reporting.py
@@ -24,7 +24,7 @@ _SKIP_DETAILS = (
"must not be there",
)
-_NEED_DETAILS = {"anyOf", "oneOf", "anyOf", "contains", "propertyNames", "not", "items"}
+_NEED_DETAILS = {"anyOf", "oneOf", "allOf", "contains", "propertyNames", "not", "items"}
_CAMEL_CASE_SPLITTER = re.compile(r"\W+|([A-Z][^A-Z\W]*)")
_IDENTIFIER = re.compile(r"^[\w_]+$", re.I)
diff --git a/contrib/python/setuptools/py3/setuptools/config/expand.py b/contrib/python/setuptools/py3/setuptools/config/expand.py
index 1bc71de5463..b48fc1187ea 100644
--- a/contrib/python/setuptools/py3/setuptools/config/expand.py
+++ b/contrib/python/setuptools/py3/setuptools/config/expand.py
@@ -17,6 +17,7 @@ functions among several configuration file formats.
**PRIVATE MODULE**: API reserved for setuptools internal usage only.
"""
+
import ast
import importlib
import os
diff --git a/contrib/python/setuptools/py3/setuptools/config/pyprojecttoml.py b/contrib/python/setuptools/py3/setuptools/config/pyprojecttoml.py
index 379ef222f91..9b9788eff4d 100644
--- a/contrib/python/setuptools/py3/setuptools/config/pyprojecttoml.py
+++ b/contrib/python/setuptools/py3/setuptools/config/pyprojecttoml.py
@@ -8,6 +8,7 @@ To read project metadata, consider using
For simple scenarios, you can also try parsing the file directly
with the help of ``tomllib`` or ``tomli``.
"""
+
import logging
import os
from contextlib import contextmanager
@@ -28,10 +29,10 @@ _logger = logging.getLogger(__name__)
def load_file(filepath: _Path) -> dict:
- from setuptools.extern import tomli # type: ignore
+ from ..compat.py310 import tomllib
with open(filepath, "rb") as file:
- return tomli.load(file)
+ return tomllib.load(file)
def validate(config: dict, filepath: _Path) -> bool:
diff --git a/contrib/python/setuptools/py3/setuptools/config/setupcfg.py b/contrib/python/setuptools/py3/setuptools/config/setupcfg.py
index 1a0e4154b92..a7f02714cb2 100644
--- a/contrib/python/setuptools/py3/setuptools/config/setupcfg.py
+++ b/contrib/python/setuptools/py3/setuptools/config/setupcfg.py
@@ -8,6 +8,7 @@ To read project metadata, consider using
For simple scenarios, you can also try parsing the file directly
with the help of ``configparser``.
"""
+
import contextlib
import functools
import os
@@ -282,8 +283,8 @@ class ConfigHandler(Generic[Target]):
try:
current_value = getattr(target_obj, option_name)
- except AttributeError:
- raise KeyError(option_name)
+ except AttributeError as e:
+ raise KeyError(option_name) from e
if current_value:
# Already inhabited. Skipping.
@@ -581,11 +582,11 @@ class ConfigMetadataHandler(ConfigHandler["DistributionMetadata"]):
# accidentally include newlines and other unintended content
try:
Version(version)
- except InvalidVersion:
+ except InvalidVersion as e:
raise OptionError(
f'Version loaded from {value} does not '
f'comply with PEP 440: {version}'
- )
+ ) from e
return version
@@ -694,9 +695,9 @@ class ConfigOptionsHandler(ConfigHandler["Distribution"]):
valid_keys = ['where', 'include', 'exclude']
- find_kwargs = dict(
- [(k, v) for k, v in section_data.items() if k in valid_keys and v]
- )
+ find_kwargs = dict([
+ (k, v) for k, v in section_data.items() if k in valid_keys and v
+ ])
where = find_kwargs.get('where')
if where is not None:
diff --git a/contrib/python/setuptools/py3/setuptools/depends.py b/contrib/python/setuptools/py3/setuptools/depends.py
index 42907d9bd47..c0ca84d4046 100644
--- a/contrib/python/setuptools/py3/setuptools/depends.py
+++ b/contrib/python/setuptools/py3/setuptools/depends.py
@@ -159,6 +159,8 @@ def extract_constant(code, symbol, default=-1):
else:
const = default
+ return None
+
def _update_globals():
"""
diff --git a/contrib/python/setuptools/py3/setuptools/discovery.py b/contrib/python/setuptools/py3/setuptools/discovery.py
index 25962863b93..50a948750fc 100644
--- a/contrib/python/setuptools/py3/setuptools/discovery.py
+++ b/contrib/python/setuptools/py3/setuptools/discovery.py
@@ -485,7 +485,7 @@ class ConfigDiscovery:
"""
if self.dist.metadata.name or self.dist.name:
# get_name() is not reliable (can return "UNKNOWN")
- return None
+ return
log.debug("No `name` configuration, performing automatic discovery")
diff --git a/contrib/python/setuptools/py3/setuptools/dist.py b/contrib/python/setuptools/py3/setuptools/dist.py
index 222e8a7623c..d5787ed4745 100644
--- a/contrib/python/setuptools/py3/setuptools/dist.py
+++ b/contrib/python/setuptools/py3/setuptools/dist.py
@@ -87,7 +87,7 @@ def check_nsp(dist, attr, value):
SetuptoolsDeprecationWarning.emit(
"The namespace_packages parameter is deprecated.",
"Please replace its usage with implicit namespaces (PEP 420).",
- see_docs="references/keywords.html#keyword-namespace-packages"
+ see_docs="references/keywords.html#keyword-namespace-packages",
# TODO: define due_date, it may break old packages that are no longer
# maintained (e.g. sphinxcontrib extensions) when installed from source.
# Warning officially introduced in May 2022, however the deprecation
@@ -778,6 +778,8 @@ class Distribution(_Distribution):
if p == package or p.startswith(pfx):
return True
+ return False
+
def _exclude_misc(self, name, value):
"""Handle 'exclude()' for list/tuple attrs without a special handler"""
if not isinstance(value, sequence):
@@ -912,11 +914,9 @@ class Distribution(_Distribution):
def iter_distribution_names(self):
"""Yield all packages, modules, and extension names in distribution"""
- for pkg in self.packages or ():
- yield pkg
+ yield from self.packages or ()
- for module in self.py_modules or ():
- yield module
+ yield from self.py_modules or ()
for ext in self.ext_modules or ():
if isinstance(ext, tuple):
diff --git a/contrib/python/setuptools/py3/setuptools/glob.py b/contrib/python/setuptools/py3/setuptools/glob.py
index 647b9bc6ed2..a184c0b643b 100644
--- a/contrib/python/setuptools/py3/setuptools/glob.py
+++ b/contrib/python/setuptools/py3/setuptools/glob.py
@@ -113,8 +113,7 @@ def glob0(dirname, basename):
def glob2(dirname, pattern):
assert _isrecursive(pattern)
yield pattern[:0]
- for x in _rlistdir(dirname):
- yield x
+ yield from _rlistdir(dirname)
# Recursively yields relative pathnames inside a literal directory.
@@ -126,7 +125,7 @@ def _rlistdir(dirname):
dirname = os.curdir
try:
names = os.listdir(dirname)
- except os.error:
+ except OSError:
return
for x in names:
yield x
@@ -160,7 +159,7 @@ def escape(pathname):
# Metacharacters do not work in the drive part and shouldn't be escaped.
drive, pathname = os.path.splitdrive(pathname)
if isinstance(pathname, bytes):
- pathname = magic_check_bytes.sub(br'[\1]', pathname)
+ pathname = magic_check_bytes.sub(rb'[\1]', pathname)
else:
pathname = magic_check.sub(r'[\1]', pathname)
return drive + pathname
diff --git a/contrib/python/setuptools/py3/setuptools/installer.py b/contrib/python/setuptools/py3/setuptools/installer.py
index e83f959a1b7..a6aff723c2d 100644
--- a/contrib/python/setuptools/py3/setuptools/installer.py
+++ b/contrib/python/setuptools/py3/setuptools/installer.py
@@ -107,10 +107,9 @@ def _fetch_build_egg_no_warn(dist, req): # noqa: C901 # is too complex (16) #
dist_metadata = pkg_resources.PathMetadata(
dist_location, os.path.join(dist_location, 'EGG-INFO')
)
- dist = pkg_resources.Distribution.from_filename(
+ return pkg_resources.Distribution.from_filename(
dist_location, metadata=dist_metadata
)
- return dist
def strip_marker(req):
diff --git a/contrib/python/setuptools/py3/setuptools/monkey.py b/contrib/python/setuptools/py3/setuptools/monkey.py
index 6c8a2f12f6d..da0993506c3 100644
--- a/contrib/python/setuptools/py3/setuptools/monkey.py
+++ b/contrib/python/setuptools/py3/setuptools/monkey.py
@@ -66,21 +66,6 @@ def patch_all():
# we can't patch distutils.cmd, alas
distutils.core.Command = setuptools.Command
- has_issue_12885 = sys.version_info <= (3, 5, 3)
-
- if has_issue_12885:
- # fix findall bug in distutils (https://bugs.python.org/issue12885)
- distutils.filelist.findall = setuptools.findall
-
- needs_warehouse = (3, 4) < sys.version_info < (3, 4, 6) or (
- 3,
- 5,
- ) < sys.version_info <= (3, 5, 3)
-
- if needs_warehouse:
- warehouse = 'https://upload.pypi.org/legacy/'
- distutils.config.PyPIRCCommand.DEFAULT_REPOSITORY = warehouse
-
_patch_distribution_metadata()
# Install Distribution throughout the distutils
@@ -130,7 +115,7 @@ def patch_func(replacement, target_mod, func_name):
def get_unpatched_function(candidate):
- return getattr(candidate, 'unpatched')
+ return candidate.unpatched
def patch_for_msvc_specialized_compiler():
@@ -138,8 +123,7 @@ def patch_for_msvc_specialized_compiler():
Patch functions in distutils to use standalone Microsoft Visual C++
compilers.
"""
- # import late to avoid circular imports on Python < 3.5
- msvc = import_module('setuptools.msvc')
+ from . import msvc
if platform.system() != 'Windows':
# Compilers only available on Microsoft Windows
diff --git a/contrib/python/setuptools/py3/setuptools/msvc.py b/contrib/python/setuptools/py3/setuptools/msvc.py
index a910a64b68a..53fe7b0de14 100644
--- a/contrib/python/setuptools/py3/setuptools/msvc.py
+++ b/contrib/python/setuptools/py3/setuptools/msvc.py
@@ -12,7 +12,6 @@ This may also support compilers shipped with compatible Visual Studio versions.
"""
import json
-from io import open
from os import listdir, pathsep
from os.path import join, isfile, isdir, dirname
from subprocess import CalledProcessError
@@ -93,21 +92,17 @@ def _msvc14_find_vc2017():
# Workaround for `-requiresAny` (only available on VS 2017 > 15.6)
with contextlib.suppress(CalledProcessError, OSError, UnicodeDecodeError):
path = (
- subprocess.check_output(
- [
- join(
- root, "Microsoft Visual Studio", "Installer", "vswhere.exe"
- ),
- "-latest",
- "-prerelease",
- "-requires",
- component,
- "-property",
- "installationPath",
- "-products",
- "*",
- ]
- )
+ subprocess.check_output([
+ join(root, "Microsoft Visual Studio", "Installer", "vswhere.exe"),
+ "-latest",
+ "-prerelease",
+ "-requires",
+ component,
+ "-property",
+ "installationPath",
+ "-products",
+ "*",
+ ])
.decode(encoding="mbcs", errors="strict")
.strip()
)
@@ -582,6 +577,7 @@ class RegistryInfo:
finally:
if bkey:
closekey(bkey)
+ return None
class SystemInfo:
@@ -694,9 +690,9 @@ class SystemInfo:
listdir(join(vs_path, r'VC\Tools\MSVC'))
# Store version and path
- vs_versions[
- self._as_float_version(state['installationVersion'])
- ] = vs_path
+ vs_versions[self._as_float_version(state['installationVersion'])] = (
+ vs_path
+ )
except (OSError, KeyError):
# Skip if "state.json" file is missing or bad format
@@ -828,6 +824,7 @@ class SystemInfo:
return '8.1', '8.1a'
elif self.vs_ver >= 14.0:
return '10.0', '8.1'
+ return None
@property
def WindowsSdkLastVersion(self):
@@ -919,6 +916,8 @@ class SystemInfo:
if execpath:
return execpath
+ return None
+
@property
def FSharpInstallDir(self):
"""
@@ -951,6 +950,8 @@ class SystemInfo:
if sdkdir:
return sdkdir or ''
+ return None
+
@property
def UniversalCRTSdkLastVersion(self):
"""
diff --git a/contrib/python/setuptools/py3/setuptools/namespaces.py b/contrib/python/setuptools/py3/setuptools/namespaces.py
index 3332f864aeb..e8f2941d45a 100644
--- a/contrib/python/setuptools/py3/setuptools/namespaces.py
+++ b/contrib/python/setuptools/py3/setuptools/namespaces.py
@@ -42,12 +42,11 @@ class Installer:
_nspkg_tmpl = (
"import sys, types, os",
- "has_mfs = sys.version_info > (3, 5)",
"p = os.path.join(%(root)s, *%(pth)r)",
- "importlib = has_mfs and __import__('importlib.util')",
- "has_mfs and __import__('importlib.machinery')",
+ "importlib = __import__('importlib.util')",
+ "__import__('importlib.machinery')",
(
- "m = has_mfs and "
+ "m = "
"sys.modules.setdefault(%(pkg)r, "
"importlib.util.module_from_spec("
"importlib.machinery.PathFinder.find_spec(%(pkg)r, "
diff --git a/contrib/python/setuptools/py3/setuptools/package_index.py b/contrib/python/setuptools/py3/setuptools/package_index.py
index 3cedd5105cd..271aa97f71a 100644
--- a/contrib/python/setuptools/py3/setuptools/package_index.py
+++ b/contrib/python/setuptools/py3/setuptools/package_index.py
@@ -112,15 +112,13 @@ def egg_info_for_url(url):
def distros_for_url(url, metadata=None):
"""Yield egg or source distribution objects that might be found at a URL"""
base, fragment = egg_info_for_url(url)
- for dist in distros_for_location(url, base, metadata):
- yield dist
+ yield from distros_for_location(url, base, metadata)
if fragment:
match = EGG_FRAGMENT.match(fragment)
if match:
- for dist in interpret_distro_name(
+ yield from interpret_distro_name(
url, match.group(1), metadata, precedence=CHECKOUT_DIST
- ):
- yield dist
+ )
def distros_for_location(location, basename, metadata=None):
@@ -321,7 +319,7 @@ class PackageIndex(Environment):
try:
parse_version(dist.version)
except Exception:
- return
+ return None
return super().add(dist)
# FIXME: 'PackageIndex.process_url' is too complex (14)
@@ -408,6 +406,7 @@ class PackageIndex(Environment):
raise DistutilsError(msg % url)
else:
self.warn(msg, url)
+ return False
def scan_egg_links(self, search_path):
dirs = filter(os.path.isdir, search_path)
@@ -516,7 +515,7 @@ class PackageIndex(Environment):
if dist in requirement:
return dist
self.debug("%s does not match %s", requirement, dist)
- return super(PackageIndex, self).obtain(requirement, installer)
+ return super().obtain(requirement, installer)
def check_hash(self, checker, filename, tfp):
"""
@@ -650,6 +649,8 @@ class PackageIndex(Environment):
if os.path.exists(dist.download_location):
return dist
+ return None
+
if force_scan:
self.prescan()
self.find_packages(requirement)
@@ -673,6 +674,7 @@ class PackageIndex(Environment):
(source and "a source distribution of " or ""),
requirement,
)
+ return None
else:
self.info("Best match: %s", dist)
return dist.clone(location=dist.download_location)
@@ -1036,6 +1038,7 @@ class PyPIConfig(configparser.RawConfigParser):
for repository, cred in self.creds_by_repository.items():
if url.startswith(repository):
return cred
+ return None
def open_with_auth(url, opener=urllib.request.urlopen):
diff --git a/contrib/python/setuptools/py3/setuptools/sandbox.py b/contrib/python/setuptools/py3/setuptools/sandbox.py
index 017c897b86a..7634b1320b1 100644
--- a/contrib/python/setuptools/py3/setuptools/sandbox.py
+++ b/contrib/python/setuptools/py3/setuptools/sandbox.py
@@ -115,7 +115,7 @@ class UnpickleableException(Exception):
class ExceptionSaver:
"""
- A Context Manager that will save an exception, serialized, and restore it
+ A Context Manager that will save an exception, serialize, and restore it
later.
"""
@@ -124,7 +124,7 @@ class ExceptionSaver:
def __exit__(self, type, exc, tb):
if not exc:
- return
+ return False
# dump the exception
self._saved = UnpickleableException.dump(type, exc)
@@ -408,23 +408,21 @@ else:
class DirectorySandbox(AbstractSandbox):
"""Restrict operations to a single subdirectory - pseudo-chroot"""
- write_ops = dict.fromkeys(
- [
- "open",
- "chmod",
- "chown",
- "mkdir",
- "remove",
- "unlink",
- "rmdir",
- "utime",
- "lchown",
- "chroot",
- "mkfifo",
- "mknod",
- "tempnam",
- ]
- )
+ write_ops = dict.fromkeys([
+ "open",
+ "chmod",
+ "chown",
+ "mkdir",
+ "remove",
+ "unlink",
+ "rmdir",
+ "utime",
+ "lchown",
+ "chroot",
+ "mkfifo",
+ "mknod",
+ "tempnam",
+ ])
_exception_patterns = []
"exempt writing to paths that match the pattern"
diff --git a/contrib/python/setuptools/py3/setuptools/unicode_utils.py b/contrib/python/setuptools/py3/setuptools/unicode_utils.py
index e84e65e3e14..d43dcc11f91 100644
--- a/contrib/python/setuptools/py3/setuptools/unicode_utils.py
+++ b/contrib/python/setuptools/py3/setuptools/unicode_utils.py
@@ -18,7 +18,7 @@ def decompose(path):
def filesys_decode(path):
"""
Ensure that the given path is decoded,
- NONE when no expected encoding works
+ ``None`` when no expected encoding works
"""
if isinstance(path, str):
@@ -33,6 +33,8 @@ def filesys_decode(path):
except UnicodeDecodeError:
continue
+ return None
+
def try_encode(string, enc):
"turn unicode encoding into a functional routine"
diff --git a/contrib/python/setuptools/py3/setuptools/wheel.py b/contrib/python/setuptools/py3/setuptools/wheel.py
index c6eabddc1f1..9861b5cf1cf 100644
--- a/contrib/python/setuptools/py3/setuptools/wheel.py
+++ b/contrib/python/setuptools/py3/setuptools/wheel.py
@@ -38,7 +38,7 @@ def _get_supported_tags():
def unpack(src_dir, dst_dir):
- '''Move everything under `src_dir` to `dst_dir`, and delete the former.'''
+ """Move everything under `src_dir` to `dst_dir`, and delete the former."""
for dirpath, dirnames, filenames in os.walk(src_dir):
subdir = os.path.relpath(dirpath, src_dir)
for f in filenames:
@@ -83,7 +83,7 @@ class Wheel:
setattr(self, k, v)
def tags(self):
- '''List tags (py_version, abi, platform) supported by this wheel.'''
+ """List tags (py_version, abi, platform) supported by this wheel."""
return itertools.product(
self.py_version.split('.'),
self.abi.split('.'),
@@ -91,7 +91,7 @@ class Wheel:
)
def is_compatible(self):
- '''Is the wheel compatible with the current platform?'''
+ """Is the wheel compatible with the current platform?"""
return next((True for t in self.tags() if t in _get_supported_tags()), False)
def egg_name(self):
@@ -115,7 +115,7 @@ class Wheel:
raise ValueError("unsupported wheel format. .dist-info not found")
def install_as_egg(self, destination_eggdir):
- '''Install wheel as an egg directory.'''
+ """Install wheel as an egg directory."""
with zipfile.ZipFile(self.filename) as zf:
self._install_as_egg(destination_eggdir, zf)
diff --git a/contrib/python/setuptools/py3/ya.make b/contrib/python/setuptools/py3/ya.make
index 2cb2a8b26c9..564d2688755 100644
--- a/contrib/python/setuptools/py3/ya.make
+++ b/contrib/python/setuptools/py3/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(69.0.3)
+VERSION(69.1.0)
LICENSE(MIT)
@@ -213,6 +213,9 @@ PY_SRCS(
setuptools/command/test.py
setuptools/command/upload.py
setuptools/command/upload_docs.py
+ setuptools/compat/__init__.py
+ setuptools/compat/py310.py
+ setuptools/compat/py311.py
setuptools/config/__init__.py
setuptools/config/_apply_pyprojecttoml.py
setuptools/config/_validate_pyproject/__init__.py
@@ -240,7 +243,6 @@ PY_SRCS(
setuptools/msvc.py
setuptools/namespaces.py
setuptools/package_index.py
- setuptools/py312compat.py
setuptools/sandbox.py
setuptools/unicode_utils.py
setuptools/version.py
diff --git a/contrib/python/types-protobuf/ya.make b/contrib/python/types-protobuf/ya.make
index 6632bf34262..9ba2128ebd2 100644
--- a/contrib/python/types-protobuf/ya.make
+++ b/contrib/python/types-protobuf/ya.make
@@ -11,16 +11,9 @@ NO_LINT()
PY_SRCS(
TOP_LEVEL
google-stubs/protobuf/__init__.pyi
- google-stubs/protobuf/any_pb2.pyi
- google-stubs/protobuf/api_pb2.pyi
google-stubs/protobuf/compiler/__init__.pyi
- google-stubs/protobuf/compiler/plugin_pb2.pyi
google-stubs/protobuf/descriptor.pyi
- google-stubs/protobuf/descriptor_pb2.pyi
google-stubs/protobuf/descriptor_pool.pyi
- google-stubs/protobuf/duration_pb2.pyi
- google-stubs/protobuf/empty_pb2.pyi
- google-stubs/protobuf/field_mask_pb2.pyi
google-stubs/protobuf/internal/__init__.pyi
google-stubs/protobuf/internal/api_implementation.pyi
google-stubs/protobuf/internal/builder.pyi
@@ -39,14 +32,9 @@ PY_SRCS(
google-stubs/protobuf/message_factory.pyi
google-stubs/protobuf/reflection.pyi
google-stubs/protobuf/service.pyi
- google-stubs/protobuf/source_context_pb2.pyi
- google-stubs/protobuf/struct_pb2.pyi
google-stubs/protobuf/symbol_database.pyi
google-stubs/protobuf/text_format.pyi
- google-stubs/protobuf/timestamp_pb2.pyi
- google-stubs/protobuf/type_pb2.pyi
google-stubs/protobuf/util/__init__.pyi
- google-stubs/protobuf/wrappers_pb2.pyi
)
RESOURCE_FILES(
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/algorithm.h b/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/algorithm.h
index 8cbd1790720..077093aaefe 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/algorithm.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/algorithm.h
@@ -31,92 +31,17 @@
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
-namespace algorithm_internal {
-
-// Performs comparisons with operator==, similar to C++14's `std::equal_to<>`.
-struct EqualTo {
- template <typename T, typename U>
- bool operator()(const T& a, const U& b) const {
- return a == b;
- }
-};
-
-template <typename InputIter1, typename InputIter2, typename Pred>
-bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2,
- InputIter2 last2, Pred pred, std::input_iterator_tag,
- std::input_iterator_tag) {
- while (true) {
- if (first1 == last1) return first2 == last2;
- if (first2 == last2) return false;
- if (!pred(*first1, *first2)) return false;
- ++first1;
- ++first2;
- }
-}
-
-template <typename InputIter1, typename InputIter2, typename Pred>
-bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2,
- InputIter2 last2, Pred&& pred, std::random_access_iterator_tag,
- std::random_access_iterator_tag) {
- return (last1 - first1 == last2 - first2) &&
- std::equal(first1, last1, first2, std::forward<Pred>(pred));
-}
-
-// When we are using our own internal predicate that just applies operator==, we
-// forward to the non-predicate form of std::equal. This enables an optimization
-// in libstdc++ that can result in std::memcmp being used for integer types.
-template <typename InputIter1, typename InputIter2>
-bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2,
- InputIter2 last2, algorithm_internal::EqualTo /* unused */,
- std::random_access_iterator_tag,
- std::random_access_iterator_tag) {
- return (last1 - first1 == last2 - first2) &&
- std::equal(first1, last1, first2);
-}
-
-template <typename It>
-It RotateImpl(It first, It middle, It last, std::true_type) {
- return std::rotate(first, middle, last);
-}
-
-template <typename It>
-It RotateImpl(It first, It middle, It last, std::false_type) {
- std::rotate(first, middle, last);
- return std::next(first, std::distance(middle, last));
-}
-
-} // namespace algorithm_internal
-
// equal()
+// rotate()
//
-// Compares the equality of two ranges specified by pairs of iterators, using
-// the given predicate, returning true iff for each corresponding iterator i1
-// and i2 in the first and second range respectively, pred(*i1, *i2) == true
-//
-// This comparison takes at most min(`last1` - `first1`, `last2` - `first2`)
-// invocations of the predicate. Additionally, if InputIter1 and InputIter2 are
-// both random-access iterators, and `last1` - `first1` != `last2` - `first2`,
-// then the predicate is never invoked and the function returns false.
+// Historical note: Abseil once provided implementations of these algorithms
+// prior to their adoption in C++14. New code should prefer to use the std
+// variants.
//
-// This is a C++11-compatible implementation of C++14 `std::equal`. See
-// https://en.cppreference.com/w/cpp/algorithm/equal for more information.
-template <typename InputIter1, typename InputIter2, typename Pred>
-bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2,
- InputIter2 last2, Pred&& pred) {
- return algorithm_internal::EqualImpl(
- first1, last1, first2, last2, std::forward<Pred>(pred),
- typename std::iterator_traits<InputIter1>::iterator_category{},
- typename std::iterator_traits<InputIter2>::iterator_category{});
-}
-
-// Overload of equal() that performs comparison of two ranges specified by pairs
-// of iterators using operator==.
-template <typename InputIter1, typename InputIter2>
-bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2,
- InputIter2 last2) {
- return y_absl::equal(first1, last1, first2, last2,
- algorithm_internal::EqualTo{});
-}
+// See the documentation for the STL <algorithm> header for more information:
+// https://en.cppreference.com/w/cpp/header/algorithm
+using std::equal;
+using std::rotate;
// linear_search()
//
@@ -133,26 +58,6 @@ bool linear_search(InputIterator first, InputIterator last,
return std::find(first, last, value) != last;
}
-// rotate()
-//
-// Performs a left rotation on a range of elements (`first`, `last`) such that
-// `middle` is now the first element. `rotate()` returns an iterator pointing to
-// the first element before rotation. This function is exactly the same as
-// `std::rotate`, but fixes a bug in gcc
-// <= 4.9 where `std::rotate` returns `void` instead of an iterator.
-//
-// The complexity of this algorithm is the same as that of `std::rotate`, but if
-// `ForwardIterator` is not a random-access iterator, then `y_absl::rotate`
-// performs an additional pass over the range to construct the return value.
-template <typename ForwardIterator>
-ForwardIterator rotate(ForwardIterator first, ForwardIterator middle,
- ForwardIterator last) {
- return algorithm_internal::RotateImpl(
- first, middle, last,
- std::is_same<decltype(std::rotate(first, middle, last)),
- ForwardIterator>());
-}
-
Y_ABSL_NAMESPACE_END
} // namespace y_absl
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/container.h b/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/container.h
index b97a3fefb0e..09864bb8688 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/container.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/container.h
@@ -52,6 +52,7 @@
#include "y_absl/algorithm/algorithm.h"
#include "y_absl/base/macros.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/meta/type_traits.h"
namespace y_absl {
@@ -116,18 +117,6 @@ template <class Key, class Hash, class KeyEqual, class Allocator>
struct IsUnorderedContainer<std::unordered_set<Key, Hash, KeyEqual, Allocator>>
: std::true_type {};
-// container_algorithm_internal::c_size. It is meant for internal use only.
-
-template <class C>
-auto c_size(C& c) -> decltype(c.size()) {
- return c.size();
-}
-
-template <class T, std::size_t N>
-constexpr std::size_t c_size(T (&)[N]) {
- return N;
-}
-
} // namespace container_algorithm_internal
// PUBLIC API
@@ -348,20 +337,10 @@ container_algorithm_internal::ContainerDifferenceType<const C> c_count_if(
template <typename C1, typename C2>
container_algorithm_internal::ContainerIterPairType<C1, C2> c_mismatch(C1& c1,
C2& c2) {
- auto first1 = container_algorithm_internal::c_begin(c1);
- auto last1 = container_algorithm_internal::c_end(c1);
- auto first2 = container_algorithm_internal::c_begin(c2);
- auto last2 = container_algorithm_internal::c_end(c2);
-
- for (; first1 != last1 && first2 != last2; ++first1, (void)++first2) {
- // Negates equality because Cpp17EqualityComparable doesn't require clients
- // to overload both `operator==` and `operator!=`.
- if (!(*first1 == *first2)) {
- break;
- }
- }
-
- return std::make_pair(first1, first2);
+ return std::mismatch(container_algorithm_internal::c_begin(c1),
+ container_algorithm_internal::c_end(c1),
+ container_algorithm_internal::c_begin(c2),
+ container_algorithm_internal::c_end(c2));
}
// Overload of c_mismatch() for using a predicate evaluation other than `==` as
@@ -370,56 +349,33 @@ container_algorithm_internal::ContainerIterPairType<C1, C2> c_mismatch(C1& c1,
template <typename C1, typename C2, typename BinaryPredicate>
container_algorithm_internal::ContainerIterPairType<C1, C2> c_mismatch(
C1& c1, C2& c2, BinaryPredicate pred) {
- auto first1 = container_algorithm_internal::c_begin(c1);
- auto last1 = container_algorithm_internal::c_end(c1);
- auto first2 = container_algorithm_internal::c_begin(c2);
- auto last2 = container_algorithm_internal::c_end(c2);
-
- for (; first1 != last1 && first2 != last2; ++first1, (void)++first2) {
- if (!pred(*first1, *first2)) {
- break;
- }
- }
-
- return std::make_pair(first1, first2);
+ return std::mismatch(container_algorithm_internal::c_begin(c1),
+ container_algorithm_internal::c_end(c1),
+ container_algorithm_internal::c_begin(c2),
+ container_algorithm_internal::c_end(c2), pred);
}
// c_equal()
//
// Container-based version of the <algorithm> `std::equal()` function to
// test whether two containers are equal.
-//
-// NOTE: the semantics of c_equal() are slightly different than those of
-// equal(): while the latter iterates over the second container only up to the
-// size of the first container, c_equal() also checks whether the container
-// sizes are equal. This better matches expectations about c_equal() based on
-// its signature.
-//
-// Example:
-// vector v1 = <1, 2, 3>;
-// vector v2 = <1, 2, 3, 4>;
-// equal(std::begin(v1), std::end(v1), std::begin(v2)) returns true
-// c_equal(v1, v2) returns false
-
template <typename C1, typename C2>
bool c_equal(const C1& c1, const C2& c2) {
- return ((container_algorithm_internal::c_size(c1) ==
- container_algorithm_internal::c_size(c2)) &&
- std::equal(container_algorithm_internal::c_begin(c1),
- container_algorithm_internal::c_end(c1),
- container_algorithm_internal::c_begin(c2)));
+ return std::equal(container_algorithm_internal::c_begin(c1),
+ container_algorithm_internal::c_end(c1),
+ container_algorithm_internal::c_begin(c2),
+ container_algorithm_internal::c_end(c2));
}
// Overload of c_equal() for using a predicate evaluation other than `==` as
// the function's test condition.
template <typename C1, typename C2, typename BinaryPredicate>
bool c_equal(const C1& c1, const C2& c2, BinaryPredicate&& pred) {
- return ((container_algorithm_internal::c_size(c1) ==
- container_algorithm_internal::c_size(c2)) &&
- std::equal(container_algorithm_internal::c_begin(c1),
- container_algorithm_internal::c_end(c1),
- container_algorithm_internal::c_begin(c2),
- std::forward<BinaryPredicate>(pred)));
+ return std::equal(container_algorithm_internal::c_begin(c1),
+ container_algorithm_internal::c_end(c1),
+ container_algorithm_internal::c_begin(c2),
+ container_algorithm_internal::c_end(c2),
+ std::forward<BinaryPredicate>(pred));
}
// c_is_permutation()
@@ -428,20 +384,20 @@ bool c_equal(const C1& c1, const C2& c2, BinaryPredicate&& pred) {
// to test whether a container is a permutation of another.
template <typename C1, typename C2>
bool c_is_permutation(const C1& c1, const C2& c2) {
- using std::begin;
- using std::end;
- return c1.size() == c2.size() &&
- std::is_permutation(begin(c1), end(c1), begin(c2));
+ return std::is_permutation(container_algorithm_internal::c_begin(c1),
+ container_algorithm_internal::c_end(c1),
+ container_algorithm_internal::c_begin(c2),
+ container_algorithm_internal::c_end(c2));
}
// Overload of c_is_permutation() for using a predicate evaluation other than
// `==` as the function's test condition.
template <typename C1, typename C2, typename BinaryPredicate>
bool c_is_permutation(const C1& c1, const C2& c2, BinaryPredicate&& pred) {
- using std::begin;
- using std::end;
- return c1.size() == c2.size() &&
- std::is_permutation(begin(c1), end(c1), begin(c2),
+ return std::is_permutation(container_algorithm_internal::c_begin(c1),
+ container_algorithm_internal::c_end(c1),
+ container_algorithm_internal::c_begin(c2),
+ container_algorithm_internal::c_end(c2),
std::forward<BinaryPredicate>(pred));
}
@@ -818,6 +774,36 @@ void c_shuffle(RandomAccessContainer& c, UniformRandomBitGenerator&& gen) {
std::forward<UniformRandomBitGenerator>(gen));
}
+// c_sample()
+//
+// Container-based version of the <algorithm> `std::sample()` function to
+// randomly sample elements from the container without replacement using a
+// `gen()` uniform random number generator and write them to an iterator range.
+template <typename C, typename OutputIterator, typename Distance,
+ typename UniformRandomBitGenerator>
+OutputIterator c_sample(const C& c, OutputIterator result, Distance n,
+ UniformRandomBitGenerator&& gen) {
+#if defined(__cpp_lib_sample) && __cpp_lib_sample >= 201603L
+ return std::sample(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c), result, n,
+ std::forward<UniformRandomBitGenerator>(gen));
+#else
+ // Fall back to a stable selection-sampling implementation.
+ auto first = container_algorithm_internal::c_begin(c);
+ Distance unsampled_elements = c_distance(c);
+ n = (std::min)(n, unsampled_elements);
+ for (; n != 0; ++first) {
+ Distance r =
+ std::uniform_int_distribution<Distance>(0, --unsampled_elements)(gen);
+ if (r < n) {
+ *result++ = *first;
+ --n;
+ }
+ }
+ return result;
+#endif
+}
+
//------------------------------------------------------------------------------
// <algorithm> Partition functions
//------------------------------------------------------------------------------
@@ -1657,7 +1643,7 @@ bool c_prev_permutation(C& c, LessThan&& comp) {
//
// Container-based version of the <numeric> `std::iota()` function
// to compute successive values of `value`, as if incremented with `++value`
-// after each element is written. and write them to the container.
+// after each element is written, and write them to the container.
template <typename Sequence, typename T>
void c_iota(Sequence& sequence, const T& value) {
std::iota(container_algorithm_internal::c_begin(sequence),
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/ya.make
index 3b66e3e4004..939d0737310 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/ya.make
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/ya.make
@@ -6,9 +6,9 @@ LICENSE(Apache-2.0)
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(20230802.1)
+VERSION(20240116.1)
-ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20230802.1.tar.gz)
+ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz)
NO_RUNTIME()
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/attributes.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/attributes.h
index f507057b1ec..8865a7a294f 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/attributes.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/attributes.h
@@ -687,7 +687,7 @@
// When deprecating Abseil code, it is sometimes necessary to turn off the
// warning within Abseil, until the deprecated code is actually removed. The
-// deprecated code can be surrounded with these directives to acheive that
+// deprecated code can be surrounded with these directives to achieve that
// result.
//
// class Y_ABSL_DEPRECATED("Use Bar instead") Foo;
@@ -747,9 +747,52 @@
#define Y_ABSL_CONST_INIT
#endif
-// These annotations are not available yet due to fear of breaking code.
-#define Y_ABSL_ATTRIBUTE_PURE_FUNCTION
-#define Y_ABSL_ATTRIBUTE_CONST_FUNCTION
+// Y_ABSL_ATTRIBUTE_PURE_FUNCTION
+//
+// Y_ABSL_ATTRIBUTE_PURE_FUNCTION is used to annotate declarations of "pure"
+// functions. A function is pure if its return value is only a function of its
+// arguments. The pure attribute prohibits a function from modifying the state
+// of the program that is observable by means other than inspecting the
+// function's return value. Declaring such functions with the pure attribute
+// allows the compiler to avoid emitting some calls in repeated invocations of
+// the function with the same argument values.
+//
+// Example:
+//
+// Y_ABSL_ATTRIBUTE_PURE_FUNCTION TString FormatTime(Time t);
+#if Y_ABSL_HAVE_CPP_ATTRIBUTE(gnu::pure)
+#define Y_ABSL_ATTRIBUTE_PURE_FUNCTION [[gnu::pure]]
+#elif Y_ABSL_HAVE_ATTRIBUTE(pure)
+#define Y_ABSL_ATTRIBUTE_PURE_FUNCTION __attribute__((pure))
+#else
+// If the attribute isn't defined, we'll fallback to Y_ABSL_MUST_USE_RESULT since
+// pure functions are useless if its return is ignored.
+#define Y_ABSL_ATTRIBUTE_PURE_FUNCTION Y_ABSL_MUST_USE_RESULT
+#endif
+
+// Y_ABSL_ATTRIBUTE_CONST_FUNCTION
+//
+// Y_ABSL_ATTRIBUTE_CONST_FUNCTION is used to annotate declarations of "const"
+// functions. A const function is similar to a pure function, with one
+// exception: Pure functions may return value that depend on a non-volatile
+// object that isn't provided as a function argument, while the const function
+// is guaranteed to return the same result given the same arguments.
+//
+// Example:
+//
+// Y_ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToInt64Milliseconds(Duration d);
+#if defined(_MSC_VER) && !defined(__clang__)
+// Put the MSVC case first since MSVC seems to parse const as a C++ keyword.
+#define Y_ABSL_ATTRIBUTE_CONST_FUNCTION Y_ABSL_ATTRIBUTE_PURE_FUNCTION
+#elif Y_ABSL_HAVE_CPP_ATTRIBUTE(gnu::const)
+#define Y_ABSL_ATTRIBUTE_CONST_FUNCTION [[gnu::const]]
+#elif Y_ABSL_HAVE_ATTRIBUTE(const)
+#define Y_ABSL_ATTRIBUTE_CONST_FUNCTION __attribute__((const))
+#else
+// Since const functions are more restrictive pure function, we'll fallback to a
+// pure function if the const attribute is not handled.
+#define Y_ABSL_ATTRIBUTE_CONST_FUNCTION Y_ABSL_ATTRIBUTE_PURE_FUNCTION
+#endif
// Y_ABSL_ATTRIBUTE_LIFETIME_BOUND indicates that a resource owned by a function
// parameter or implicit object parameter is retained by the return value of the
@@ -800,15 +843,11 @@
// See also the upstream documentation:
// https://clang.llvm.org/docs/AttributeReference.html#trivial-abi
//
-#if Y_ABSL_HAVE_CPP_ATTRIBUTE(clang::trivial_abi)
-#define Y_ABSL_ATTRIBUTE_TRIVIAL_ABI [[clang::trivial_abi]]
-#define Y_ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI 1
-#elif Y_ABSL_HAVE_ATTRIBUTE(trivial_abi)
-#define Y_ABSL_ATTRIBUTE_TRIVIAL_ABI __attribute__((trivial_abi))
-#define Y_ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI 1
-#else
+// b/321691395 - This is currently disabled in open-source builds since
+// compiler support differs. If system libraries compiled with GCC are mixed
+// with libraries compiled with Clang, types will have different ideas about
+// their ABI, leading to hard to debug crashes.
#define Y_ABSL_ATTRIBUTE_TRIVIAL_ABI
-#endif
// Y_ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS
//
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h
index 5121c2f8de0..dcf83a06eef 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h
@@ -37,6 +37,7 @@
#include "y_absl/base/internal/scheduling_mode.h"
#include "y_absl/base/internal/spinlock_wait.h"
#include "y_absl/base/macros.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/base/optimization.h"
#include "y_absl/base/port.h"
@@ -46,7 +47,8 @@ Y_ABSL_NAMESPACE_BEGIN
class once_flag;
namespace base_internal {
-std::atomic<uint32_t>* ControlWord(y_absl::once_flag* flag);
+y_absl::Nonnull<std::atomic<uint32_t>*> ControlWord(
+ y_absl::Nonnull<y_absl::once_flag*> flag);
} // namespace base_internal
// call_once()
@@ -89,7 +91,8 @@ class once_flag {
once_flag& operator=(const once_flag&) = delete;
private:
- friend std::atomic<uint32_t>* base_internal::ControlWord(once_flag* flag);
+ friend y_absl::Nonnull<std::atomic<uint32_t>*> base_internal::ControlWord(
+ y_absl::Nonnull<once_flag*> flag);
std::atomic<uint32_t> control_;
};
@@ -103,7 +106,8 @@ namespace base_internal {
// Like call_once, but uses KERNEL_ONLY scheduling. Intended to be used to
// initialize entities used by the scheduler implementation.
template <typename Callable, typename... Args>
-void LowLevelCallOnce(y_absl::once_flag* flag, Callable&& fn, Args&&... args);
+void LowLevelCallOnce(y_absl::Nonnull<y_absl::once_flag*> flag, Callable&& fn,
+ Args&&... args);
// Disables scheduling while on stack when scheduling mode is non-cooperative.
// No effect for cooperative scheduling modes.
@@ -143,10 +147,10 @@ enum {
};
template <typename Callable, typename... Args>
-Y_ABSL_ATTRIBUTE_NOINLINE
-void CallOnceImpl(std::atomic<uint32_t>* control,
- base_internal::SchedulingMode scheduling_mode, Callable&& fn,
- Args&&... args) {
+Y_ABSL_ATTRIBUTE_NOINLINE void CallOnceImpl(
+ y_absl::Nonnull<std::atomic<uint32_t>*> control,
+ base_internal::SchedulingMode scheduling_mode, Callable&& fn,
+ Args&&... args) {
#ifndef NDEBUG
{
uint32_t old_control = control->load(std::memory_order_relaxed);
@@ -185,12 +189,14 @@ void CallOnceImpl(std::atomic<uint32_t>* control,
} // else *control is already kOnceDone
}
-inline std::atomic<uint32_t>* ControlWord(once_flag* flag) {
+inline y_absl::Nonnull<std::atomic<uint32_t>*> ControlWord(
+ y_absl::Nonnull<once_flag*> flag) {
return &flag->control_;
}
template <typename Callable, typename... Args>
-void LowLevelCallOnce(y_absl::once_flag* flag, Callable&& fn, Args&&... args) {
+void LowLevelCallOnce(y_absl::Nonnull<y_absl::once_flag*> flag, Callable&& fn,
+ Args&&... args) {
std::atomic<uint32_t>* once = base_internal::ControlWord(flag);
uint32_t s = once->load(std::memory_order_acquire);
if (Y_ABSL_PREDICT_FALSE(s != base_internal::kOnceDone)) {
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/casts.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/casts.h
index caa36943984..2ea54b10f35 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/casts.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/casts.h
@@ -90,7 +90,7 @@ Y_ABSL_NAMESPACE_BEGIN
//
// Such implicit cast chaining may be useful within template logic.
template <typename To>
-constexpr To implicit_cast(typename y_absl::internal::identity_t<To> to) {
+constexpr To implicit_cast(typename y_absl::internal::type_identity_t<To> to) {
return to;
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h
index 136edbe64e8..839c2715268 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h
@@ -75,6 +75,12 @@
#define Y_ABSL_INTERNAL_CPLUSPLUS_LANG __cplusplus
#endif
+#if defined(Y_ABSL_INTERNAL_CPLUSPLUS_LANG) && \
+ Y_ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L
+// Include library feature test macros.
+#include <version>
+#endif
+
#if defined(__APPLE__)
// Included for TARGET_OS_IPHONE, __IPHONE_OS_VERSION_MIN_REQUIRED,
// __IPHONE_8_0.
@@ -111,7 +117,7 @@
//
// LTS releases can be obtained from
// https://github.com/abseil/abseil-cpp/releases.
-#define Y_ABSL_LTS_RELEASE_VERSION 20230802
+#define Y_ABSL_LTS_RELEASE_VERSION 20240116
#define Y_ABSL_LTS_RELEASE_PATCH_LEVEL 1
// Helper macro to convert a CPP variable to a string literal.
@@ -332,8 +338,8 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#ifdef Y_ABSL_HAVE_INTRINSIC_INT128
#error Y_ABSL_HAVE_INTRINSIC_INT128 cannot be directly set
#elif defined(__SIZEOF_INT128__)
-#if (defined(__clang__) && !defined(_WIN32)) || \
- (defined(__CUDACC__) && __CUDACC_VER_MAJOR__ >= 9) || \
+#if (defined(__clang__) && !defined(_WIN32)) || \
+ (defined(__CUDACC__) && __CUDACC_VER_MAJOR__ >= 9) || \
(defined(__GNUC__) && !defined(__clang__) && !defined(__CUDACC__))
#define Y_ABSL_HAVE_INTRINSIC_INT128 1
#elif defined(__CUDACC__)
@@ -395,7 +401,7 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// Windows _WIN32
// NaCL __native_client__
// AsmJS __asmjs__
-// WebAssembly __wasm__
+// WebAssembly (Emscripten) __EMSCRIPTEN__
// Fuchsia __Fuchsia__
//
// Note that since Android defines both __ANDROID__ and __linux__, one
@@ -407,11 +413,11 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// POSIX.1-2001.
#ifdef Y_ABSL_HAVE_MMAP
#error Y_ABSL_HAVE_MMAP cannot be directly set
-#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
- defined(_AIX) || defined(__ros__) || defined(__native_client__) || \
- defined(__asmjs__) || defined(__wasm__) || defined(__Fuchsia__) || \
- defined(__sun) || defined(__ASYLO__) || defined(__myriad2__) || \
- defined(__HAIKU__) || defined(__OpenBSD__) || defined(__NetBSD__) || \
+#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
+ defined(_AIX) || defined(__ros__) || defined(__native_client__) || \
+ defined(__asmjs__) || defined(__EMSCRIPTEN__) || defined(__Fuchsia__) || \
+ defined(__sun) || defined(__ASYLO__) || defined(__myriad2__) || \
+ defined(__HAIKU__) || defined(__OpenBSD__) || defined(__NetBSD__) || \
defined(__QNX__) || defined(__VXWORKS__) || defined(__hexagon__)
#define Y_ABSL_HAVE_MMAP 1
#endif
@@ -484,6 +490,8 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-crt/misc/alarm.c
#elif defined(__EMSCRIPTEN__)
// emscripten doesn't support signals
+#elif defined(__wasi__)
+// WASI doesn't support signals
#elif defined(__Fuchsia__)
// Signals don't exist on fuchsia.
#elif defined(__native_client__)
@@ -536,14 +544,14 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// and
// https://github.com/llvm/llvm-project/commit/0bc451e7e137c4ccadcd3377250874f641ca514a
// The second has the actually correct versions, thus, is what we copy here.
-#if defined(__APPLE__) && \
- ((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
- __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101300) || \
- (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
- __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 120000) || \
- (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && \
- __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 50000) || \
- (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && \
+#if defined(__APPLE__) && \
+ ((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101300) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 120000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 50000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && \
__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 120000))
#define Y_ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE 1
#else
@@ -555,7 +563,7 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// Checks whether C++17 std::any is available.
#ifdef Y_ABSL_HAVE_STD_ANY
#error "Y_ABSL_HAVE_STD_ANY cannot be directly set."
-#elif defined(__cpp_lib_any)
+#elif defined(__cpp_lib_any) && __cpp_lib_any >= 201606L
#define Y_ABSL_HAVE_STD_ANY 1
#elif defined(Y_ABSL_INTERNAL_CPLUSPLUS_LANG) && \
Y_ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L && \
@@ -568,9 +576,9 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// Checks whether C++17 std::optional is available.
#ifdef Y_ABSL_HAVE_STD_OPTIONAL
#error "Y_ABSL_HAVE_STD_OPTIONAL cannot be directly set."
-#elif defined(__cpp_lib_optional)
+#elif defined(__cpp_lib_optional) && __cpp_lib_optional >= 202106L
#define Y_ABSL_HAVE_STD_OPTIONAL 1
-#elif defined(Y_ABSL_INTERNAL_CPLUSPLUS_LANG) && \
+#elif defined(Y_ABSL_INTERNAL_CPLUSPLUS_LANG) && \
Y_ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L && \
!Y_ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE
#define Y_ABSL_HAVE_STD_OPTIONAL 1
@@ -581,7 +589,7 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// Checks whether C++17 std::variant is available.
#ifdef Y_ABSL_HAVE_STD_VARIANT
#error "Y_ABSL_HAVE_STD_VARIANT cannot be directly set."
-#elif defined(__cpp_lib_variant)
+#elif defined(__cpp_lib_variant) && __cpp_lib_variant >= 201606L
#define Y_ABSL_HAVE_STD_VARIANT 1
#elif defined(Y_ABSL_INTERNAL_CPLUSPLUS_LANG) && \
Y_ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L && \
@@ -596,13 +604,29 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#error "Y_ABSL_HAVE_STD_STRING_VIEW cannot be directly set."
#elif defined(__NVCC__)
#define Y_ABSL_HAVE_STD_STRING_VIEW 1
-#elif defined(__cpp_lib_string_view)
+#elif defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L
#define Y_ABSL_HAVE_STD_STRING_VIEW 1
#elif defined(Y_ABSL_INTERNAL_CPLUSPLUS_LANG) && \
Y_ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L
#define Y_ABSL_HAVE_STD_STRING_VIEW 1
#endif
+// Y_ABSL_HAVE_STD_ORDERING
+//
+// Checks whether C++20 std::{partial,weak,strong}_ordering are available.
+//
+// __cpp_lib_three_way_comparison is missing on libc++
+// (https://github.com/llvm/llvm-project/issues/73953) so treat it as defined
+// when building in C++20 mode.
+#ifdef Y_ABSL_HAVE_STD_ORDERING
+#error "Y_ABSL_HAVE_STD_ORDERING cannot be directly set."
+#elif (defined(__cpp_lib_three_way_comparison) && \
+ __cpp_lib_three_way_comparison >= 201907L) || \
+ (defined(Y_ABSL_INTERNAL_CPLUSPLUS_LANG) && \
+ Y_ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L)
+#define Y_ABSL_HAVE_STD_ORDERING 1
+#endif
+
// Y_ABSL_USES_STD_ANY
//
// Indicates whether y_absl::any is an alias for std::any.
@@ -665,6 +689,22 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#error options.h is misconfigured.
#endif
+// Y_ABSL_USES_STD_ORDERING
+//
+// Indicates whether y_absl::{partial,weak,strong}_ordering are aliases for the
+// std:: ordering types.
+#if !defined(Y_ABSL_OPTION_USE_STD_ORDERING)
+#error options.h is misconfigured.
+#elif Y_ABSL_OPTION_USE_STD_ORDERING == 0 || \
+ (Y_ABSL_OPTION_USE_STD_ORDERING == 2 && !defined(Y_ABSL_HAVE_STD_ORDERING))
+#undef Y_ABSL_USES_STD_ORDERING
+#elif Y_ABSL_OPTION_USE_STD_ORDERING == 1 || \
+ (Y_ABSL_OPTION_USE_STD_ORDERING == 2 && defined(Y_ABSL_HAVE_STD_ORDERING))
+#define Y_ABSL_USES_STD_ORDERING 1
+#else
+#error options.h is misconfigured.
+#endif
+
// In debug mode, MSVC 2017's std::variant throws a EXCEPTION_ACCESS_VIOLATION
// SEH exception from emplace for variant<SomeStruct> when constructing the
// struct can throw. This defeats some of variant_test and
@@ -847,11 +887,30 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// RTTI support.
#ifdef Y_ABSL_INTERNAL_HAS_RTTI
#error Y_ABSL_INTERNAL_HAS_RTTI cannot be directly set
-#elif (defined(__GNUC__) && defined(__GXX_RTTI)) || \
- (defined(_MSC_VER) && defined(_CPPRTTI)) || \
- (!defined(__GNUC__) && !defined(_MSC_VER))
+#elif Y_ABSL_HAVE_FEATURE(cxx_rtti)
+#define Y_ABSL_INTERNAL_HAS_RTTI 1
+#elif defined(__GNUC__) && defined(__GXX_RTTI)
#define Y_ABSL_INTERNAL_HAS_RTTI 1
-#endif // !defined(__GNUC__) || defined(__GXX_RTTI)
+#elif defined(_MSC_VER) && defined(_CPPRTTI)
+#define Y_ABSL_INTERNAL_HAS_RTTI 1
+#elif !defined(__GNUC__) && !defined(_MSC_VER)
+// Unknown compiler, default to RTTI
+#define Y_ABSL_INTERNAL_HAS_RTTI 1
+#endif
+
+// `Y_ABSL_INTERNAL_HAS_CXA_DEMANGLE` determines whether `abi::__cxa_demangle` is
+// available.
+#ifdef Y_ABSL_INTERNAL_HAS_CXA_DEMANGLE
+#error Y_ABSL_INTERNAL_HAS_CXA_DEMANGLE cannot be directly set
+#elif defined(OS_ANDROID) && (defined(__i386__) || defined(__x86_64__))
+#define Y_ABSL_INTERNAL_HAS_CXA_DEMANGLE 0
+#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && \
+ (__GNUC__ >= 4 || (__GNUC__ >= 3 && __GNUC_MINOR__ >= 4)) && \
+ !defined(__mips__)
+#define Y_ABSL_INTERNAL_HAS_CXA_DEMANGLE 1
+#elif defined(__clang__) && !defined(_MSC_VER)
+#define Y_ABSL_INTERNAL_HAS_CXA_DEMANGLE 1
+#endif
// Y_ABSL_INTERNAL_HAVE_SSE is used for compile-time detection of SSE support.
// See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html for an overview of
@@ -938,8 +997,8 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#if __EMSCRIPTEN_tiny__ >= 1000
#error __EMSCRIPTEN_tiny__ is too big to fit in Y_ABSL_INTERNAL_EMSCRIPTEN_VERSION
#endif
-#define Y_ABSL_INTERNAL_EMSCRIPTEN_VERSION \
- ((__EMSCRIPTEN_major__)*1000000 + (__EMSCRIPTEN_minor__)*1000 + \
+#define Y_ABSL_INTERNAL_EMSCRIPTEN_VERSION \
+ ((__EMSCRIPTEN_major__) * 1000000 + (__EMSCRIPTEN_minor__) * 1000 + \
(__EMSCRIPTEN_tiny__))
#endif
#endif
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/endian.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/endian.h
index e8ac2d6c3d9..3c400153d7e 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/endian.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/endian.h
@@ -22,6 +22,7 @@
#include "y_absl/base/casts.h"
#include "y_absl/base/config.h"
#include "y_absl/base/internal/unaligned_access.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/base/port.h"
namespace y_absl {
@@ -160,27 +161,27 @@ inline int64_t ToHost(int64_t x) {
}
// Functions to do unaligned loads and stores in little-endian order.
-inline uint16_t Load16(const void *p) {
+inline uint16_t Load16(y_absl::Nonnull<const void *> p) {
return ToHost16(Y_ABSL_INTERNAL_UNALIGNED_LOAD16(p));
}
-inline void Store16(void *p, uint16_t v) {
+inline void Store16(y_absl::Nonnull<void *> p, uint16_t v) {
Y_ABSL_INTERNAL_UNALIGNED_STORE16(p, FromHost16(v));
}
-inline uint32_t Load32(const void *p) {
+inline uint32_t Load32(y_absl::Nonnull<const void *> p) {
return ToHost32(Y_ABSL_INTERNAL_UNALIGNED_LOAD32(p));
}
-inline void Store32(void *p, uint32_t v) {
+inline void Store32(y_absl::Nonnull<void *> p, uint32_t v) {
Y_ABSL_INTERNAL_UNALIGNED_STORE32(p, FromHost32(v));
}
-inline uint64_t Load64(const void *p) {
+inline uint64_t Load64(y_absl::Nonnull<const void *> p) {
return ToHost64(Y_ABSL_INTERNAL_UNALIGNED_LOAD64(p));
}
-inline void Store64(void *p, uint64_t v) {
+inline void Store64(y_absl::Nonnull<void *> p, uint64_t v) {
Y_ABSL_INTERNAL_UNALIGNED_STORE64(p, FromHost64(v));
}
@@ -250,27 +251,27 @@ inline int64_t ToHost(int64_t x) {
}
// Functions to do unaligned loads and stores in big-endian order.
-inline uint16_t Load16(const void *p) {
+inline uint16_t Load16(y_absl::Nonnull<const void *> p) {
return ToHost16(Y_ABSL_INTERNAL_UNALIGNED_LOAD16(p));
}
-inline void Store16(void *p, uint16_t v) {
+inline void Store16(y_absl::Nonnull<void *> p, uint16_t v) {
Y_ABSL_INTERNAL_UNALIGNED_STORE16(p, FromHost16(v));
}
-inline uint32_t Load32(const void *p) {
+inline uint32_t Load32(y_absl::Nonnull<const void *> p) {
return ToHost32(Y_ABSL_INTERNAL_UNALIGNED_LOAD32(p));
}
-inline void Store32(void *p, uint32_t v) {
+inline void Store32(y_absl::Nonnull<void *>p, uint32_t v) {
Y_ABSL_INTERNAL_UNALIGNED_STORE32(p, FromHost32(v));
}
-inline uint64_t Load64(const void *p) {
+inline uint64_t Load64(y_absl::Nonnull<const void *> p) {
return ToHost64(Y_ABSL_INTERNAL_UNALIGNED_LOAD64(p));
}
-inline void Store64(void *p, uint64_t v) {
+inline void Store64(y_absl::Nonnull<void *> p, uint64_t v) {
Y_ABSL_INTERNAL_UNALIGNED_STORE64(p, FromHost64(v));
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/identity.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/identity.h
index edf314d798b..e04d5e4c0f1 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/identity.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/identity.h
@@ -22,13 +22,15 @@ namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
namespace internal {
+// This is a back-fill of C++20's `std::type_identity`.
template <typename T>
-struct identity {
+struct type_identity {
typedef T type;
};
+// This is a back-fill of C++20's `std::type_identity_t`.
template <typename T>
-using identity_t = typename identity<T>::type;
+using type_identity_t = typename type_identity<T>::type;
} // namespace internal
Y_ABSL_NAMESPACE_END
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/inline_variable.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/inline_variable.h
index 4f822973e4c..fbe2bb6445f 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/inline_variable.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/inline_variable.h
@@ -63,12 +63,12 @@
// Bug: https://bugs.llvm.org/show_bug.cgi?id=35862
//
// Note:
-// identity_t is used here so that the const and name are in the
+// type_identity_t is used here so that the const and name are in the
// appropriate place for pointer types, reference types, function pointer
// types, etc..
#if defined(__clang__)
#define Y_ABSL_INTERNAL_EXTERN_DECL(type, name) \
- extern const ::y_absl::internal::identity_t<type> name;
+ extern const ::y_absl::internal::type_identity_t<type> name;
#else // Otherwise, just define the macro to do nothing.
#define Y_ABSL_INTERNAL_EXTERN_DECL(type, name)
#endif // defined(__clang__)
@@ -76,30 +76,31 @@
// See above comment at top of file for details.
#define Y_ABSL_INTERNAL_INLINE_CONSTEXPR(type, name, init) \
Y_ABSL_INTERNAL_EXTERN_DECL(type, name) \
- inline constexpr ::y_absl::internal::identity_t<type> name = init
+ inline constexpr ::y_absl::internal::type_identity_t<type> name = init
#else
// See above comment at top of file for details.
//
// Note:
-// identity_t is used here so that the const and name are in the
+// type_identity_t is used here so that the const and name are in the
// appropriate place for pointer types, reference types, function pointer
// types, etc..
-#define Y_ABSL_INTERNAL_INLINE_CONSTEXPR(var_type, name, init) \
- template <class /*AbslInternalDummy*/ = void> \
- struct AbslInternalInlineVariableHolder##name { \
- static constexpr ::y_absl::internal::identity_t<var_type> kInstance = init; \
- }; \
- \
- template <class AbslInternalDummy> \
- constexpr ::y_absl::internal::identity_t<var_type> \
- AbslInternalInlineVariableHolder##name<AbslInternalDummy>::kInstance; \
- \
- static constexpr const ::y_absl::internal::identity_t<var_type>& \
- name = /* NOLINT */ \
- AbslInternalInlineVariableHolder##name<>::kInstance; \
- static_assert(sizeof(void (*)(decltype(name))) != 0, \
+#define Y_ABSL_INTERNAL_INLINE_CONSTEXPR(var_type, name, init) \
+ template <class /*AbslInternalDummy*/ = void> \
+ struct AbslInternalInlineVariableHolder##name { \
+ static constexpr ::y_absl::internal::type_identity_t<var_type> kInstance = \
+ init; \
+ }; \
+ \
+ template <class AbslInternalDummy> \
+ constexpr ::y_absl::internal::type_identity_t<var_type> \
+ AbslInternalInlineVariableHolder##name<AbslInternalDummy>::kInstance; \
+ \
+ static constexpr const ::y_absl::internal::type_identity_t<var_type>& \
+ name = /* NOLINT */ \
+ AbslInternalInlineVariableHolder##name<>::kInstance; \
+ static_assert(sizeof(void (*)(decltype(name))) != 0, \
"Silence unused variable warnings.")
#endif // __cpp_inline_variables
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.cc
index 420f88661ad..c8697f52c92 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.cc
@@ -329,7 +329,7 @@ size_t GetPageSize() {
SYSTEM_INFO system_info;
GetSystemInfo(&system_info);
return std::max(system_info.dwPageSize, system_info.dwAllocationGranularity);
-#elif defined(__wasm__) || defined(__asmjs__)
+#elif defined(__wasm__) || defined(__asmjs__) || defined(__hexagon__)
return getpagesize();
#else
return static_cast<size_t>(sysconf(_SC_PAGESIZE));
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/nullability_impl.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/nullability_impl.h
new file mode 100644
index 00000000000..17cd15fc172
--- /dev/null
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/nullability_impl.h
@@ -0,0 +1,106 @@
+// Copyright 2023 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef Y_ABSL_BASE_INTERNAL_NULLABILITY_IMPL_H_
+#define Y_ABSL_BASE_INTERNAL_NULLABILITY_IMPL_H_
+
+#include <memory>
+#include <type_traits>
+
+#include "y_absl/base/attributes.h"
+#include "y_absl/meta/type_traits.h"
+
+namespace y_absl {
+
+namespace nullability_internal {
+
+// `IsNullabilityCompatible` checks whether its first argument is a class
+// explicitly tagged as supporting nullability annotations. The tag is the type
+// declaration `absl_nullability_compatible`.
+template <typename, typename = void>
+struct IsNullabilityCompatible : std::false_type {};
+
+template <typename T>
+struct IsNullabilityCompatible<
+ T, y_absl::void_t<typename T::absl_nullability_compatible>> : std::true_type {
+};
+
+template <typename T>
+constexpr bool IsSupportedType = IsNullabilityCompatible<T>::value;
+
+template <typename T>
+constexpr bool IsSupportedType<T*> = true;
+
+template <typename T, typename U>
+constexpr bool IsSupportedType<T U::*> = true;
+
+template <typename T, typename... Deleter>
+constexpr bool IsSupportedType<std::unique_ptr<T, Deleter...>> = true;
+
+template <typename T>
+constexpr bool IsSupportedType<std::shared_ptr<T>> = true;
+
+template <typename T>
+struct EnableNullable {
+ static_assert(nullability_internal::IsSupportedType<std::remove_cv_t<T>>,
+ "Template argument must be a raw or supported smart pointer "
+ "type. See y_absl/base/nullability.h.");
+ using type = T;
+};
+
+template <typename T>
+struct EnableNonnull {
+ static_assert(nullability_internal::IsSupportedType<std::remove_cv_t<T>>,
+ "Template argument must be a raw or supported smart pointer "
+ "type. See y_absl/base/nullability.h.");
+ using type = T;
+};
+
+template <typename T>
+struct EnableNullabilityUnknown {
+ static_assert(nullability_internal::IsSupportedType<std::remove_cv_t<T>>,
+ "Template argument must be a raw or supported smart pointer "
+ "type. See y_absl/base/nullability.h.");
+ using type = T;
+};
+
+// Note: we do not apply Clang nullability attributes (e.g. _Nullable). These
+// only support raw pointers, and conditionally enabling them only for raw
+// pointers inhibits template arg deduction. Ideally, they would support all
+// pointer-like types.
+template <typename T, typename = typename EnableNullable<T>::type>
+using NullableImpl
+#if Y_ABSL_HAVE_CPP_ATTRIBUTE(clang::annotate)
+ [[clang::annotate("Nullable")]]
+#endif
+ = T;
+
+template <typename T, typename = typename EnableNonnull<T>::type>
+using NonnullImpl
+#if Y_ABSL_HAVE_CPP_ATTRIBUTE(clang::annotate)
+ [[clang::annotate("Nonnull")]]
+#endif
+ = T;
+
+template <typename T, typename = typename EnableNullabilityUnknown<T>::type>
+using NullabilityUnknownImpl
+#if Y_ABSL_HAVE_CPP_ATTRIBUTE(clang::annotate)
+ [[clang::annotate("Nullability_Unspecified")]]
+#endif
+ = T;
+
+} // namespace nullability_internal
+} // namespace y_absl
+
+#endif // Y_ABSL_BASE_INTERNAL_NULLABILITY_IMPL_H_
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.cc
index a820cd17159..7ddf743de3f 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.cc
@@ -42,8 +42,9 @@
// This preprocessor token is also defined in raw_io.cc. If you need to copy
// this, consider moving both to config.h instead.
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
- defined(__Fuchsia__) || defined(__native_client__) || \
- defined(__OpenBSD__) || defined(__EMSCRIPTEN__) || defined(__ASYLO__)
+ defined(__hexagon__) || defined(__Fuchsia__) || \
+ defined(__native_client__) || defined(__OpenBSD__) || \
+ defined(__EMSCRIPTEN__) || defined(__ASYLO__)
#include <unistd.h>
@@ -56,8 +57,7 @@
// Y_ABSL_HAVE_SYSCALL_WRITE is defined when the platform provides the syscall
// syscall(SYS_write, /*int*/ fd, /*char* */ buf, /*size_t*/ len);
// for low level operations that want to avoid libc.
-#if (defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && \
- !defined(__ANDROID__)
+#if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
#include <sys/syscall.h>
#define Y_ABSL_HAVE_SYSCALL_WRITE 1
#define Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED 1
@@ -93,8 +93,7 @@ constexpr char kTruncated[] = " ... (message truncated)\n";
bool VADoRawLog(char** buf, int* size, const char* format, va_list ap)
Y_ABSL_PRINTF_ATTRIBUTE(3, 0);
bool VADoRawLog(char** buf, int* size, const char* format, va_list ap) {
- if (*size < 0)
- return false;
+ if (*size < 0) return false;
int n = vsnprintf(*buf, static_cast<size_t>(*size), format, ap);
bool result = true;
if (n < 0 || n > *size) {
@@ -122,8 +121,7 @@ constexpr int kLogBufSize = 3000;
bool DoRawLog(char** buf, int* size, const char* format, ...)
Y_ABSL_PRINTF_ATTRIBUTE(3, 4);
bool DoRawLog(char** buf, int* size, const char* format, ...) {
- if (*size < 0)
- return false;
+ if (*size < 0) return false;
va_list ap;
va_start(ap, format);
int n = vsnprintf(*buf, static_cast<size_t>(*size), format, ap);
@@ -242,8 +240,8 @@ void AsyncSignalSafeWriteError(const char* s, size_t len) {
_write(/* stderr */ 2, s, static_cast<unsigned>(len));
#else
// stderr logging unsupported on this platform
- (void) s;
- (void) len;
+ (void)s;
+ (void)len;
#endif
}
@@ -258,7 +256,7 @@ void RawLog(y_absl::LogSeverity severity, const char* file, int line,
bool RawLoggingFullySupported() {
#ifdef Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED
return true;
-#else // !Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED
+#else // !Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED
return false;
#endif // !Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.h
index c44bb9dfcc3..8282ce64af9 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.h
@@ -108,6 +108,7 @@
#define Y_ABSL_RAW_LOG_INTERNAL_WARNING ::y_absl::LogSeverity::kWarning
#define Y_ABSL_RAW_LOG_INTERNAL_ERROR ::y_absl::LogSeverity::kError
#define Y_ABSL_RAW_LOG_INTERNAL_FATAL ::y_absl::LogSeverity::kFatal
+#define Y_ABSL_RAW_LOG_INTERNAL_DFATAL ::y_absl::kLogDebugFatal
#define Y_ABSL_RAW_LOG_INTERNAL_LEVEL(severity) \
::y_absl::NormalizeLogSeverity(severity)
@@ -115,6 +116,7 @@
#define Y_ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_WARNING
#define Y_ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_ERROR
#define Y_ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL Y_ABSL_UNREACHABLE()
+#define Y_ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_DFATAL
#define Y_ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_LEVEL(severity)
namespace y_absl {
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.h
index f77fbfb8147..b2e0ee8bbc0 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.h
@@ -19,10 +19,10 @@
// - for use by Abseil internal code that Mutex itself depends on
// - for async signal safety (see below)
-// SpinLock is async signal safe. If a spinlock is used within a signal
-// handler, all code that acquires the lock must ensure that the signal cannot
-// arrive while they are holding the lock. Typically, this is done by blocking
-// the signal.
+// SpinLock with a base_internal::SchedulingMode::SCHEDULE_KERNEL_ONLY is async
+// signal safe. If a spinlock is used within a signal handler, all code that
+// acquires the lock must ensure that the signal cannot arrive while they are
+// holding the lock. Typically, this is done by blocking the signal.
//
// Threads waiting on a SpinLock may be woken in an arbitrary order.
@@ -41,6 +41,14 @@
#include "y_absl/base/internal/tsan_mutex_interface.h"
#include "y_absl/base/thread_annotations.h"
+namespace tcmalloc {
+namespace tcmalloc_internal {
+
+class AllocationGuardSpinLockHolder;
+
+} // namespace tcmalloc_internal
+} // namespace tcmalloc
+
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
namespace base_internal {
@@ -137,6 +145,7 @@ class Y_ABSL_LOCKABLE SpinLock {
// Provide access to protected method above. Use for testing only.
friend struct SpinLockTest;
+ friend class tcmalloc::tcmalloc_internal::AllocationGuardSpinLockHolder;
private:
// lockword_ is used to store the following:
@@ -171,6 +180,10 @@ class Y_ABSL_LOCKABLE SpinLock {
return scheduling_mode == base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL;
}
+ bool IsCooperative() const {
+ return lockword_.load(std::memory_order_relaxed) & kSpinLockCooperative;
+ }
+
uint32_t TryLockInternal(uint32_t lock_value, uint32_t wait_cycles);
void SlowLock() Y_ABSL_ATTRIBUTE_COLD;
void SlowUnlock(uint32_t lock_value) Y_ABSL_ATTRIBUTE_COLD;
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_annotations.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_annotations.h
deleted file mode 100644
index 380e2924fd4..00000000000
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_annotations.h
+++ /dev/null
@@ -1,280 +0,0 @@
-// Copyright 2019 The Abseil Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// -----------------------------------------------------------------------------
-// File: thread_annotations.h
-// -----------------------------------------------------------------------------
-//
-// WARNING: This is a backwards compatible header and it will be removed after
-// the migration to prefixed thread annotations is finished; please include
-// "y_absl/base/thread_annotations.h".
-//
-// This header file contains macro definitions for thread safety annotations
-// that allow developers to document the locking policies of multi-threaded
-// code. The annotations can also help program analysis tools to identify
-// potential thread safety issues.
-//
-// These annotations are implemented using compiler attributes. Using the macros
-// defined here instead of raw attributes allow for portability and future
-// compatibility.
-//
-// When referring to mutexes in the arguments of the attributes, you should
-// use variable names or more complex expressions (e.g. my_object->mutex_)
-// that evaluate to a concrete mutex object whenever possible. If the mutex
-// you want to refer to is not in scope, you may use a member pointer
-// (e.g. &MyClass::mutex_) to refer to a mutex in some (unknown) object.
-
-#ifndef Y_ABSL_BASE_INTERNAL_THREAD_ANNOTATIONS_H_
-#define Y_ABSL_BASE_INTERNAL_THREAD_ANNOTATIONS_H_
-
-// Y_ABSL_LEGACY_THREAD_ANNOTATIONS is a *temporary* compatibility macro that can
-// be defined on the compile command-line to restore the legacy spellings of the
-// thread annotations macros/functions. The macros in this file are available
-// under Y_ABSL_ prefixed spellings in y_absl/base/thread_annotations.h. This macro
-// and the legacy spellings will be removed in the future.
-#ifdef Y_ABSL_LEGACY_THREAD_ANNOTATIONS
-
-#if defined(__clang__)
-#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
-#else
-#define THREAD_ANNOTATION_ATTRIBUTE__(x) // no-op
-#endif
-
-// GUARDED_BY()
-//
-// Documents if a shared field or global variable needs to be protected by a
-// mutex. GUARDED_BY() allows the user to specify a particular mutex that
-// should be held when accessing the annotated variable.
-//
-// Although this annotation (and PT_GUARDED_BY, below) cannot be applied to
-// local variables, a local variable and its associated mutex can often be
-// combined into a small class or struct, thereby allowing the annotation.
-//
-// Example:
-//
-// class Foo {
-// Mutex mu_;
-// int p1_ GUARDED_BY(mu_);
-// ...
-// };
-#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
-
-// PT_GUARDED_BY()
-//
-// Documents if the memory location pointed to by a pointer should be guarded
-// by a mutex when dereferencing the pointer.
-//
-// Example:
-// class Foo {
-// Mutex mu_;
-// int *p1_ PT_GUARDED_BY(mu_);
-// ...
-// };
-//
-// Note that a pointer variable to a shared memory location could itself be a
-// shared variable.
-//
-// Example:
-//
-// // `q_`, guarded by `mu1_`, points to a shared memory location that is
-// // guarded by `mu2_`:
-// int *q_ GUARDED_BY(mu1_) PT_GUARDED_BY(mu2_);
-#define PT_GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
-
-// ACQUIRED_AFTER() / ACQUIRED_BEFORE()
-//
-// Documents the acquisition order between locks that can be held
-// simultaneously by a thread. For any two locks that need to be annotated
-// to establish an acquisition order, only one of them needs the annotation.
-// (i.e. You don't have to annotate both locks with both ACQUIRED_AFTER
-// and ACQUIRED_BEFORE.)
-//
-// As with GUARDED_BY, this is only applicable to mutexes that are shared
-// fields or global variables.
-//
-// Example:
-//
-// Mutex m1_;
-// Mutex m2_ ACQUIRED_AFTER(m1_);
-#define ACQUIRED_AFTER(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(__VA_ARGS__))
-
-#define ACQUIRED_BEFORE(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(__VA_ARGS__))
-
-// EXCLUSIVE_LOCKS_REQUIRED() / SHARED_LOCKS_REQUIRED()
-//
-// Documents a function that expects a mutex to be held prior to entry.
-// The mutex is expected to be held both on entry to, and exit from, the
-// function.
-//
-// An exclusive lock allows read-write access to the guarded data member(s), and
-// only one thread can acquire a lock exclusively at any one time. A shared lock
-// allows read-only access, and any number of threads can acquire a shared lock
-// concurrently.
-//
-// Generally, non-const methods should be annotated with
-// EXCLUSIVE_LOCKS_REQUIRED, while const methods should be annotated with
-// SHARED_LOCKS_REQUIRED.
-//
-// Example:
-//
-// Mutex mu1, mu2;
-// int a GUARDED_BY(mu1);
-// int b GUARDED_BY(mu2);
-//
-// void foo() EXCLUSIVE_LOCKS_REQUIRED(mu1, mu2) { ... }
-// void bar() const SHARED_LOCKS_REQUIRED(mu1, mu2) { ... }
-#define EXCLUSIVE_LOCKS_REQUIRED(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__))
-
-#define SHARED_LOCKS_REQUIRED(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(shared_locks_required(__VA_ARGS__))
-
-// LOCKS_EXCLUDED()
-//
-// Documents the locks acquired in the body of the function. These locks
-// cannot be held when calling this function (as Abseil's `Mutex` locks are
-// non-reentrant).
-#define LOCKS_EXCLUDED(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__))
-
-// LOCK_RETURNED()
-//
-// Documents a function that returns a mutex without acquiring it. For example,
-// a public getter method that returns a pointer to a private mutex should
-// be annotated with LOCK_RETURNED.
-#define LOCK_RETURNED(x) \
- THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
-
-// LOCKABLE
-//
-// Documents if a class/type is a lockable type (such as the `Mutex` class).
-#define LOCKABLE \
- THREAD_ANNOTATION_ATTRIBUTE__(lockable)
-
-// SCOPED_LOCKABLE
-//
-// Documents if a class does RAII locking (such as the `MutexLock` class).
-// The constructor should use `LOCK_FUNCTION()` to specify the mutex that is
-// acquired, and the destructor should use `UNLOCK_FUNCTION()` with no
-// arguments; the analysis will assume that the destructor unlocks whatever the
-// constructor locked.
-#define SCOPED_LOCKABLE \
- THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
-
-// EXCLUSIVE_LOCK_FUNCTION()
-//
-// Documents functions that acquire a lock in the body of a function, and do
-// not release it.
-#define EXCLUSIVE_LOCK_FUNCTION(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(exclusive_lock_function(__VA_ARGS__))
-
-// SHARED_LOCK_FUNCTION()
-//
-// Documents functions that acquire a shared (reader) lock in the body of a
-// function, and do not release it.
-#define SHARED_LOCK_FUNCTION(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(shared_lock_function(__VA_ARGS__))
-
-// UNLOCK_FUNCTION()
-//
-// Documents functions that expect a lock to be held on entry to the function,
-// and release it in the body of the function.
-#define UNLOCK_FUNCTION(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(unlock_function(__VA_ARGS__))
-
-// EXCLUSIVE_TRYLOCK_FUNCTION() / SHARED_TRYLOCK_FUNCTION()
-//
-// Documents functions that try to acquire a lock, and return success or failure
-// (or a non-boolean value that can be interpreted as a boolean).
-// The first argument should be `true` for functions that return `true` on
-// success, or `false` for functions that return `false` on success. The second
-// argument specifies the mutex that is locked on success. If unspecified, this
-// mutex is assumed to be `this`.
-#define EXCLUSIVE_TRYLOCK_FUNCTION(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(exclusive_trylock_function(__VA_ARGS__))
-
-#define SHARED_TRYLOCK_FUNCTION(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(shared_trylock_function(__VA_ARGS__))
-
-// ASSERT_EXCLUSIVE_LOCK() / ASSERT_SHARED_LOCK()
-//
-// Documents functions that dynamically check to see if a lock is held, and fail
-// if it is not held.
-#define ASSERT_EXCLUSIVE_LOCK(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(assert_exclusive_lock(__VA_ARGS__))
-
-#define ASSERT_SHARED_LOCK(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_lock(__VA_ARGS__))
-
-// NO_THREAD_SAFETY_ANALYSIS
-//
-// Turns off thread safety checking within the body of a particular function.
-// This annotation is used to mark functions that are known to be correct, but
-// the locking behavior is more complicated than the analyzer can handle.
-#define NO_THREAD_SAFETY_ANALYSIS \
- THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
-
-//------------------------------------------------------------------------------
-// Tool-Supplied Annotations
-//------------------------------------------------------------------------------
-
-// TS_UNCHECKED should be placed around lock expressions that are not valid
-// C++ syntax, but which are present for documentation purposes. These
-// annotations will be ignored by the analysis.
-#define TS_UNCHECKED(x) ""
-
-// TS_FIXME is used to mark lock expressions that are not valid C++ syntax.
-// It is used by automated tools to mark and disable invalid expressions.
-// The annotation should either be fixed, or changed to TS_UNCHECKED.
-#define TS_FIXME(x) ""
-
-// Like NO_THREAD_SAFETY_ANALYSIS, this turns off checking within the body of
-// a particular function. However, this attribute is used to mark functions
-// that are incorrect and need to be fixed. It is used by automated tools to
-// avoid breaking the build when the analysis is updated.
-// Code owners are expected to eventually fix the routine.
-#define NO_THREAD_SAFETY_ANALYSIS_FIXME NO_THREAD_SAFETY_ANALYSIS
-
-// Similar to NO_THREAD_SAFETY_ANALYSIS_FIXME, this macro marks a GUARDED_BY
-// annotation that needs to be fixed, because it is producing thread safety
-// warning. It disables the GUARDED_BY.
-#define GUARDED_BY_FIXME(x)
-
-// Disables warnings for a single read operation. This can be used to avoid
-// warnings when it is known that the read is not actually involved in a race,
-// but the compiler cannot confirm that.
-#define Y_TS_UNCHECKED_READ(x) thread_safety_analysis::y_ts_unchecked_read(x)
-
-
-namespace thread_safety_analysis {
-
-// Takes a reference to a guarded data member, and returns an unguarded
-// reference.
-template <typename T>
-inline const T& y_ts_unchecked_read(const T& v) NO_THREAD_SAFETY_ANALYSIS {
- return v;
-}
-
-template <typename T>
-inline T& y_ts_unchecked_read(T& v) NO_THREAD_SAFETY_ANALYSIS {
- return v;
-}
-
-} // namespace thread_safety_analysis
-
-#endif // defined(Y_ABSL_LEGACY_THREAD_ANNOTATIONS)
-
-#endif // Y_ABSL_BASE_INTERNAL_THREAD_ANNOTATIONS_H_
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.cc
index c834f4879a4..0b95a331d12 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.cc
@@ -16,8 +16,12 @@
#if !defined(_WIN32) || defined(__MINGW32__)
#include <pthread.h>
+#ifndef __wasi__
+// WASI does not provide this header, either way we disable use
+// of signals with it below.
#include <signal.h>
#endif
+#endif
#include <atomic>
#include <cassert>
@@ -80,10 +84,12 @@ void SetCurrentThreadIdentity(ThreadIdentity* identity,
y_absl::call_once(init_thread_identity_key_once, AllocateThreadIdentityKey,
reclaimer);
-#if defined(__EMSCRIPTEN__) || defined(__MINGW32__) || defined(__hexagon__)
- // Emscripten and MinGW pthread implementations does not support signals.
- // See https://kripken.github.io/emscripten-site/docs/porting/pthreads.html
- // for more information.
+#if defined(__wasi__) || defined(__EMSCRIPTEN__) || defined(__MINGW32__) || \
+ defined(__hexagon__)
+ // Emscripten, WASI and MinGW pthread implementations does not support
+ // signals. See
+ // https://kripken.github.io/emscripten-site/docs/porting/pthreads.html for
+ // more information.
pthread_setspecific(thread_identity_pthread_key,
reinterpret_cast<void*>(identity));
#else
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unaligned_access.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unaligned_access.h
index 3820dde7378..c2190fce06c 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unaligned_access.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unaligned_access.h
@@ -23,6 +23,7 @@
#include "y_absl/base/attributes.h"
#include "y_absl/base/config.h"
+#include "y_absl/base/nullability.h"
// unaligned APIs
@@ -35,29 +36,35 @@ namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
namespace base_internal {
-inline uint16_t UnalignedLoad16(const void *p) {
+inline uint16_t UnalignedLoad16(y_absl::Nonnull<const void *> p) {
uint16_t t;
memcpy(&t, p, sizeof t);
return t;
}
-inline uint32_t UnalignedLoad32(const void *p) {
+inline uint32_t UnalignedLoad32(y_absl::Nonnull<const void *> p) {
uint32_t t;
memcpy(&t, p, sizeof t);
return t;
}
-inline uint64_t UnalignedLoad64(const void *p) {
+inline uint64_t UnalignedLoad64(y_absl::Nonnull<const void *> p) {
uint64_t t;
memcpy(&t, p, sizeof t);
return t;
}
-inline void UnalignedStore16(void *p, uint16_t v) { memcpy(p, &v, sizeof v); }
+inline void UnalignedStore16(y_absl::Nonnull<void *> p, uint16_t v) {
+ memcpy(p, &v, sizeof v);
+}
-inline void UnalignedStore32(void *p, uint32_t v) { memcpy(p, &v, sizeof v); }
+inline void UnalignedStore32(y_absl::Nonnull<void *> p, uint32_t v) {
+ memcpy(p, &v, sizeof v);
+}
-inline void UnalignedStore64(void *p, uint64_t v) { memcpy(p, &v, sizeof v); }
+inline void UnalignedStore64(y_absl::Nonnull<void *> p, uint64_t v) {
+ memcpy(p, &v, sizeof v);
+}
} // namespace base_internal
Y_ABSL_NAMESPACE_END
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.cc
index 890fa4eb6a6..a5cc4e6a14a 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.cc
@@ -17,6 +17,7 @@
#include <ostream>
#include "y_absl/base/attributes.h"
+#include "y_absl/base/config.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.h
index 1fc55e82238..44c2bd08a34 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.h
@@ -64,6 +64,8 @@ Y_ABSL_NAMESPACE_BEGIN
// --my_log_level=info
// --my_log_level=0
//
+// `DFATAL` and `kLogDebugFatal` are similarly accepted.
+//
// Unparsing a flag produces the same result as `y_absl::LogSeverityName()` for
// the standard levels and a base-ten integer otherwise.
enum class LogSeverity : int {
@@ -82,18 +84,28 @@ constexpr std::array<y_absl::LogSeverity, 4> LogSeverities() {
y_absl::LogSeverity::kError, y_absl::LogSeverity::kFatal}};
}
+// `y_absl::kLogDebugFatal` equals `y_absl::LogSeverity::kFatal` in debug builds
+// (i.e. when `NDEBUG` is not defined) and `y_absl::LogSeverity::kError`
+// otherwise. Avoid ODR-using this variable as it has internal linkage and thus
+// distinct storage in different TUs.
+#ifdef NDEBUG
+static constexpr y_absl::LogSeverity kLogDebugFatal = y_absl::LogSeverity::kError;
+#else
+static constexpr y_absl::LogSeverity kLogDebugFatal = y_absl::LogSeverity::kFatal;
+#endif
+
// LogSeverityName()
//
// Returns the all-caps string representation (e.g. "INFO") of the specified
// severity level if it is one of the standard levels and "UNKNOWN" otherwise.
constexpr const char* LogSeverityName(y_absl::LogSeverity s) {
- return s == y_absl::LogSeverity::kInfo
- ? "INFO"
- : s == y_absl::LogSeverity::kWarning
- ? "WARNING"
- : s == y_absl::LogSeverity::kError
- ? "ERROR"
- : s == y_absl::LogSeverity::kFatal ? "FATAL" : "UNKNOWN";
+ switch (s) {
+ case y_absl::LogSeverity::kInfo: return "INFO";
+ case y_absl::LogSeverity::kWarning: return "WARNING";
+ case y_absl::LogSeverity::kError: return "ERROR";
+ case y_absl::LogSeverity::kFatal: return "FATAL";
+ }
+ return "UNKNOWN";
}
// NormalizeLogSeverity()
@@ -101,9 +113,10 @@ constexpr const char* LogSeverityName(y_absl::LogSeverity s) {
// Values less than `kInfo` normalize to `kInfo`; values greater than `kFatal`
// normalize to `kError` (**NOT** `kFatal`).
constexpr y_absl::LogSeverity NormalizeLogSeverity(y_absl::LogSeverity s) {
- return s < y_absl::LogSeverity::kInfo
- ? y_absl::LogSeverity::kInfo
- : s > y_absl::LogSeverity::kFatal ? y_absl::LogSeverity::kError : s;
+ y_absl::LogSeverity n = s;
+ if (n < y_absl::LogSeverity::kInfo) n = y_absl::LogSeverity::kInfo;
+ if (n > y_absl::LogSeverity::kFatal) n = y_absl::LogSeverity::kError;
+ return n;
}
constexpr y_absl::LogSeverity NormalizeLogSeverity(int s) {
return y_absl::NormalizeLogSeverity(static_cast<y_absl::LogSeverity>(s));
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/no_destructor.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/no_destructor.h
new file mode 100644
index 00000000000..03dff922c60
--- /dev/null
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/no_destructor.h
@@ -0,0 +1,217 @@
+// Copyright 2023 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// -----------------------------------------------------------------------------
+// File: no_destructor.h
+// -----------------------------------------------------------------------------
+//
+// This header file defines the y_absl::NoDestructor<T> wrapper for defining a
+// static type that does not need to be destructed upon program exit. Instead,
+// such an object survives during program exit (and can be safely accessed at
+// any time).
+//
+// Objects of such type, if constructed safely and under the right conditions,
+// provide two main benefits over other alternatives:
+//
+// * Global objects not normally allowed due to concerns of destruction order
+// (i.e. no "complex globals") can be safely allowed, provided that such
+// objects can be constant initialized.
+// * Function scope static objects can be optimized to avoid heap allocation,
+// pointer chasing, and allow lazy construction.
+//
+// See below for complete details.
+
+
+#ifndef Y_ABSL_BASE_NO_DESTRUCTOR_H_
+#define Y_ABSL_BASE_NO_DESTRUCTOR_H_
+
+#include <new>
+#include <type_traits>
+#include <utility>
+
+#include "y_absl/base/config.h"
+
+namespace y_absl {
+Y_ABSL_NAMESPACE_BEGIN
+
+// y_absl::NoDestructor<T>
+//
+// NoDestructor<T> is a wrapper around an object of type T that behaves as an
+// object of type T but never calls T's destructor. NoDestructor<T> makes it
+// safer and/or more efficient to use such objects in static storage contexts:
+// as global or function scope static variables.
+//
+// An instance of y_absl::NoDestructor<T> has similar type semantics to an
+// instance of T:
+//
+// * Constructs in the same manner as an object of type T through perfect
+// forwarding.
+// * Provides pointer/reference semantic access to the object of type T via
+// `->`, `*`, and `get()`.
+// (Note that `const NoDestructor<T>` works like a pointer to const `T`.)
+//
+// An object of type NoDestructor<T> should be defined in static storage:
+// as either a global static object, or as a function scope static variable.
+//
+// Additionally, NoDestructor<T> provides the following benefits:
+//
+// * Never calls T's destructor for the object
+// * If the object is a function-local static variable, the type can be
+// lazily constructed.
+//
+// An object of type NoDestructor<T> is "trivially destructible" in the notion
+// that its destructor is never run. Provided that an object of this type can be
+// safely initialized and does not need to be cleaned up on program shutdown,
+// NoDestructor<T> allows you to define global static variables, since Google's
+// C++ style guide ban on such objects doesn't apply to objects that are
+// trivially destructible.
+//
+// Usage as Global Static Variables
+//
+// NoDestructor<T> allows declaration of a global object with a non-trivial
+// constructor in static storage without needing to add a destructor.
+// However, such objects still need to worry about initialization order, so
+// such objects should be const initialized:
+//
+// // Global or namespace scope.
+// Y_ABSL_CONST_INIT y_absl::NoDestructor<MyRegistry> reg{"foo", "bar", 8008};
+//
+// Note that if your object already has a trivial destructor, you don't need to
+// use NoDestructor<T>.
+//
+// Usage as Function Scope Static Variables
+//
+// Function static objects will be lazily initialized within static storage:
+//
+// // Function scope.
+// const TString& MyString() {
+// static const y_absl::NoDestructor<TString> x("foo");
+// return *x;
+// }
+//
+// For function static variables, NoDestructor avoids heap allocation and can be
+// inlined in static storage, resulting in exactly-once, thread-safe
+// construction of an object, and very fast access thereafter (the cost is a few
+// extra cycles).
+//
+// Using NoDestructor<T> in this manner is generally better than other patterns
+// which require pointer chasing:
+//
+// // Prefer using y_absl::NoDestructor<T> instead for the static variable.
+// const TString& MyString() {
+// static const TString* x = new TString("foo");
+// return *x;
+// }
+//
+template <typename T>
+class NoDestructor {
+ public:
+ // Forwards arguments to the T's constructor: calls T(args...).
+ template <typename... Ts,
+ // Disable this overload when it might collide with copy/move.
+ typename std::enable_if<!std::is_same<void(std::decay_t<Ts>&...),
+ void(NoDestructor&)>::value,
+ int>::type = 0>
+ explicit constexpr NoDestructor(Ts&&... args)
+ : impl_(std::forward<Ts>(args)...) {}
+
+ // Forwards copy and move construction for T. Enables usage like this:
+ // static NoDestructor<std::array<string, 3>> x{{{"1", "2", "3"}}};
+ // static NoDestructor<std::vector<int>> x{{1, 2, 3}};
+ explicit constexpr NoDestructor(const T& x) : impl_(x) {}
+ explicit constexpr NoDestructor(T&& x)
+ : impl_(std::move(x)) {}
+
+ // No copying.
+ NoDestructor(const NoDestructor&) = delete;
+ NoDestructor& operator=(const NoDestructor&) = delete;
+
+ // Pretend to be a smart pointer to T with deep constness.
+ // Never returns a null pointer.
+ T& operator*() { return *get(); }
+ T* operator->() { return get(); }
+ T* get() { return impl_.get(); }
+ const T& operator*() const { return *get(); }
+ const T* operator->() const { return get(); }
+ const T* get() const { return impl_.get(); }
+
+ private:
+ class DirectImpl {
+ public:
+ template <typename... Args>
+ explicit constexpr DirectImpl(Args&&... args)
+ : value_(std::forward<Args>(args)...) {}
+ const T* get() const { return &value_; }
+ T* get() { return &value_; }
+
+ private:
+ T value_;
+ };
+
+ class PlacementImpl {
+ public:
+ template <typename... Args>
+ explicit PlacementImpl(Args&&... args) {
+ new (&space_) T(std::forward<Args>(args)...);
+ }
+ const T* get() const {
+ return Launder(reinterpret_cast<const T*>(&space_));
+ }
+ T* get() { return Launder(reinterpret_cast<T*>(&space_)); }
+
+ private:
+ template <typename P>
+ static P* Launder(P* p) {
+#if defined(__cpp_lib_launder) && __cpp_lib_launder >= 201606L
+ return std::launder(p);
+#elif Y_ABSL_HAVE_BUILTIN(__builtin_launder)
+ return __builtin_launder(p);
+#else
+ // When `std::launder` or equivalent are not available, we rely on
+ // undefined behavior, which works as intended on Abseil's officially
+ // supported platforms as of Q3 2023.
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstrict-aliasing"
+#endif
+ return p;
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+#endif
+ }
+
+ alignas(T) unsigned char space_[sizeof(T)];
+ };
+
+ // If the object is trivially destructible we use a member directly to avoid
+ // potential once-init runtime initialization. It somewhat defeats the
+ // purpose of NoDestructor in this case, but this makes the class more
+ // friendly to generic code.
+ std::conditional_t<std::is_trivially_destructible<T>::value, DirectImpl,
+ PlacementImpl>
+ impl_;
+};
+
+#ifdef Y_ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
+// Provide 'Class Template Argument Deduction': the type of NoDestructor's T
+// will be the same type as the argument passed to NoDestructor's constructor.
+template <typename T>
+NoDestructor(T) -> NoDestructor<T>;
+#endif // Y_ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
+
+Y_ABSL_NAMESPACE_END
+} // namespace y_absl
+
+#endif // Y_ABSL_BASE_NO_DESTRUCTOR_H_
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/nullability.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/nullability.h
new file mode 100644
index 00000000000..4930eb7ac50
--- /dev/null
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/nullability.h
@@ -0,0 +1,224 @@
+// Copyright 2023 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// -----------------------------------------------------------------------------
+// File: nullability.h
+// -----------------------------------------------------------------------------
+//
+// This header file defines a set of "templated annotations" for designating the
+// expected nullability of pointers. These annotations allow you to designate
+// pointers in one of three classification states:
+//
+// * "Non-null" (for pointers annotated `Nonnull<T>`), indicating that it is
+// invalid for the given pointer to ever be null.
+// * "Nullable" (for pointers annotated `Nullable<T>`), indicating that it is
+// valid for the given pointer to be null.
+// * "Unknown" (for pointers annotated `NullabilityUnknown<T>`), indicating
+// that the given pointer has not been yet classified as either nullable or
+// non-null. This is the default state of unannotated pointers.
+//
+// NOTE: unannotated pointers implicitly bear the annotation
+// `NullabilityUnknown<T>`; you should rarely, if ever, see this annotation used
+// in the codebase explicitly.
+//
+// -----------------------------------------------------------------------------
+// Nullability and Contracts
+// -----------------------------------------------------------------------------
+//
+// These nullability annotations allow you to more clearly specify contracts on
+// software components by narrowing the *preconditions*, *postconditions*, and
+// *invariants* of pointer state(s) in any given interface. It then depends on
+// context who is responsible for fulfilling the annotation's requirements.
+//
+// For example, a function may receive a pointer argument. Designating that
+// pointer argument as "non-null" tightens the precondition of the contract of
+// that function. It is then the responsibility of anyone calling such a
+// function to ensure that the passed pointer is not null.
+//
+// Similarly, a function may have a pointer as a return value. Designating that
+// return value as "non-null" tightens the postcondition of the contract of that
+// function. In this case, however, it is the responsibility of the function
+// itself to ensure that the returned pointer is not null.
+//
+// Clearly defining these contracts allows providers (and consumers) of such
+// pointers to have more confidence in their null state. If a function declares
+// a return value as "non-null", for example, the caller should not need to
+// check whether the returned value is `nullptr`; it can simply assume the
+// pointer is valid.
+//
+// Of course most interfaces already have expectations on the nullability state
+// of pointers, and these expectations are, in effect, a contract; often,
+// however, those contracts are either poorly or partially specified, assumed,
+// or misunderstood. These nullability annotations are designed to allow you to
+// formalize those contracts within the codebase.
+//
+// -----------------------------------------------------------------------------
+// Using Nullability Annotations
+// -----------------------------------------------------------------------------
+//
+// It is important to note that these annotations are not distinct strong
+// *types*. They are alias templates defined to be equal to the underlying
+// pointer type. A pointer annotated `Nonnull<T*>`, for example, is simply a
+// pointer of type `T*`. Each annotation acts as a form of documentation about
+// the contract for the given pointer. Each annotation requires providers or
+// consumers of these pointers across API boundaries to take appropriate steps
+// when setting or using these pointers:
+//
+// * "Non-null" pointers should never be null. It is the responsibility of the
+// provider of this pointer to ensure that the pointer may never be set to
+// null. Consumers of such pointers can treat such pointers as non-null.
+// * "Nullable" pointers may or may not be null. Consumers of such pointers
+// should precede any usage of that pointer (e.g. a dereference operation)
+// with a a `nullptr` check.
+// * "Unknown" pointers may be either "non-null" or "nullable" but have not been
+// definitively determined to be in either classification state. Providers of
+// such pointers across API boundaries should determine -- over time -- to
+// annotate the pointer in either of the above two states. Consumers of such
+// pointers across an API boundary should continue to treat such pointers as
+// they currently do.
+//
+// Example:
+//
+// // PaySalary() requires the passed pointer to an `Employee` to be non-null.
+// void PaySalary(y_absl::Nonnull<Employee *> e) {
+// pay(e->salary); // OK to dereference
+// }
+//
+// // CompleteTransaction() guarantees the returned pointer to an `Account` to
+// // be non-null.
+// y_absl::Nonnull<Account *> balance CompleteTransaction(double fee) {
+// ...
+// }
+//
+// // Note that specifying a nullability annotation does not prevent someone
+// // from violating the contract:
+//
+// Nullable<Employee *> find(Map& employees, std::string_view name);
+//
+// void g(Map& employees) {
+// Employee *e = find(employees, "Pat");
+// // `e` can now be null.
+// PaySalary(e); // Violates contract, but compiles!
+// }
+//
+// Nullability annotations, in other words, are useful for defining and
+// narrowing contracts; *enforcement* of those contracts depends on use and any
+// additional (static or dynamic analysis) tooling.
+//
+// NOTE: The "unknown" annotation state indicates that a pointer's contract has
+// not yet been positively identified. The unknown state therefore acts as a
+// form of documentation of your technical debt, and a codebase that adopts
+// nullability annotations should aspire to annotate every pointer as either
+// "non-null" or "nullable".
+//
+// -----------------------------------------------------------------------------
+// Applicability of Nullability Annotations
+// -----------------------------------------------------------------------------
+//
+// By default, nullability annotations are applicable to raw and smart
+// pointers. User-defined types can indicate compatibility with nullability
+// annotations by providing an `absl_nullability_compatible` nested type. The
+// actual definition of this inner type is not relevant as it is used merely as
+// a marker. It is common to use a using declaration of
+// `absl_nullability_compatible` set to void.
+//
+// // Example:
+// struct MyPtr {
+// using absl_nullability_compatible = void;
+// ...
+// };
+//
+// DISCLAIMER:
+// ===========================================================================
+// These nullability annotations are primarily a human readable signal about the
+// intended contract of the pointer. They are not *types* and do not currently
+// provide any correctness guarantees. For example, a pointer annotated as
+// `Nonnull<T*>` is *not guaranteed* to be non-null, and the compiler won't
+// alert or prevent assignment of a `Nullable<T*>` to a `Nonnull<T*>`.
+// ===========================================================================
+#ifndef Y_ABSL_BASE_NULLABILITY_H_
+#define Y_ABSL_BASE_NULLABILITY_H_
+
+#include "y_absl/base/internal/nullability_impl.h"
+
+namespace y_absl {
+
+// y_absl::Nonnull
+//
+// The indicated pointer is never null. It is the responsibility of the provider
+// of this pointer across an API boundary to ensure that the pointer is never be
+// set to null. Consumers of this pointer across an API boundary may safely
+// dereference the pointer.
+//
+// Example:
+//
+// // `employee` is designated as not null.
+// void PaySalary(y_absl::Nonnull<Employee *> employee) {
+// pay(*employee); // OK to dereference
+// }
+template <typename T>
+using Nonnull = nullability_internal::NonnullImpl<T>;
+
+// y_absl::Nullable
+//
+// The indicated pointer may, by design, be either null or non-null. Consumers
+// of this pointer across an API boundary should perform a `nullptr` check
+// before performing any operation using the pointer.
+//
+// Example:
+//
+// // `employee` may be null.
+// void PaySalary(y_absl::Nullable<Employee *> employee) {
+// if (employee != nullptr) {
+// Pay(*employee); // OK to dereference
+// }
+// }
+template <typename T>
+using Nullable = nullability_internal::NullableImpl<T>;
+
+// y_absl::NullabilityUnknown (default)
+//
+// The indicated pointer has not yet been determined to be definitively
+// "non-null" or "nullable." Providers of such pointers across API boundaries
+// should, over time, annotate such pointers as either "non-null" or "nullable."
+// Consumers of these pointers across an API boundary should treat such pointers
+// with the same caution they treat currently unannotated pointers. Most
+// existing code will have "unknown" pointers, which should eventually be
+// migrated into one of the above two nullability states: `Nonnull<T>` or
+// `Nullable<T>`.
+//
+// NOTE: Because this annotation is the global default state, pointers without
+// any annotation are assumed to have "unknown" semantics. This assumption is
+// designed to minimize churn and reduce clutter within the codebase.
+//
+// Example:
+//
+// // `employee`s nullability state is unknown.
+// void PaySalary(y_absl::NullabilityUnknown<Employee *> employee) {
+// Pay(*employee); // Potentially dangerous. API provider should investigate.
+// }
+//
+// Note that a pointer without an annotation, by default, is assumed to have the
+// annotation `NullabilityUnknown`.
+//
+// // `employee`s nullability state is unknown.
+// void PaySalary(Employee* employee) {
+// Pay(*employee); // Potentially dangerous. API provider should investigate.
+// }
+template <typename T>
+using NullabilityUnknown = nullability_internal::NullabilityUnknownImpl<T>;
+
+} // namespace y_absl
+
+#endif // Y_ABSL_BASE_NULLABILITY_H_
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/optimization.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/optimization.h
index bffc0dcd5bf..2fdcacfd725 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/optimization.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/optimization.h
@@ -25,6 +25,7 @@
#include <assert.h>
#include "y_absl/base/config.h"
+#include "y_absl/base/options.h"
// Y_ABSL_BLOCK_TAIL_CALL_OPTIMIZATION
//
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/options.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/options.h
index c8805bce3c3..84f6d4df445 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/options.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/options.h
@@ -176,6 +176,32 @@
#define Y_ABSL_OPTION_USE_STD_VARIANT 2
+// Y_ABSL_OPTION_USE_STD_ORDERING
+//
+// This option controls whether y_absl::{partial,weak,strong}_ordering are
+// implemented as aliases to the std:: ordering types, or as an independent
+// implementation.
+//
+// A value of 0 means to use Abseil's implementation. This requires only C++11
+// support, and is expected to work on every toolchain we support.
+//
+// A value of 1 means to use aliases. This requires that all code using Abseil
+// is built in C++20 mode or later.
+//
+// A value of 2 means to detect the C++ version being used to compile Abseil,
+// and use an alias only if working std:: ordering types are available. This
+// option is useful when you are building your program from source. It should
+// not be used otherwise -- for example, if you are distributing Abseil in a
+// binary package manager -- since in mode 2, they will name different types,
+// with different mangled names and binary layout, depending on the compiler
+// flags passed by the end user. For more info, see
+// https://abseil.io/about/design/dropin-types.
+//
+// User code should not inspect this macro. To check in the preprocessor if
+// the ordering types are aliases of std:: ordering types, use the feature macro
+// Y_ABSL_USES_STD_ORDERING.
+
+#define Y_ABSL_OPTION_USE_STD_ORDERING 2
// Y_ABSL_OPTION_USE_INLINE_NAMESPACE
// Y_ABSL_OPTION_INLINE_NAMESPACE_NAME
@@ -200,7 +226,7 @@
// allowed.
#define Y_ABSL_OPTION_USE_INLINE_NAMESPACE 1
-#define Y_ABSL_OPTION_INLINE_NAMESPACE_NAME lts_y_20230802
+#define Y_ABSL_OPTION_INLINE_NAMESPACE_NAME lts_y_20240116
// Y_ABSL_OPTION_HARDENED
//
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/prefetch.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/prefetch.h
index 1d30f015472..53f25bbd06f 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/prefetch.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/prefetch.h
@@ -24,17 +24,19 @@
#ifndef Y_ABSL_BASE_PREFETCH_H_
#define Y_ABSL_BASE_PREFETCH_H_
+#include "y_absl/base/attributes.h"
#include "y_absl/base/config.h"
#if defined(Y_ABSL_INTERNAL_HAVE_SSE)
#include <xmmintrin.h>
#endif
-#if defined(_MSC_VER) && _MSC_VER >= 1900 && \
- (defined(_M_X64) || defined(_M_IX86))
+#if defined(_MSC_VER)
#include <intrin.h>
+#if defined(Y_ABSL_INTERNAL_HAVE_SSE)
#pragma intrinsic(_mm_prefetch)
#endif
+#endif
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
@@ -140,21 +142,24 @@ void PrefetchToLocalCacheForWrite(const void* addr);
// See __builtin_prefetch:
// https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html.
//
-inline void PrefetchToLocalCache(const void* addr) {
+Y_ABSL_ATTRIBUTE_ALWAYS_INLINE inline void PrefetchToLocalCache(
+ const void* addr) {
__builtin_prefetch(addr, 0, 3);
}
-inline void PrefetchToLocalCacheNta(const void* addr) {
+Y_ABSL_ATTRIBUTE_ALWAYS_INLINE inline void PrefetchToLocalCacheNta(
+ const void* addr) {
__builtin_prefetch(addr, 0, 0);
}
-inline void PrefetchToLocalCacheForWrite(const void* addr) {
+Y_ABSL_ATTRIBUTE_ALWAYS_INLINE inline void PrefetchToLocalCacheForWrite(
+ const void* addr) {
// [x86] gcc/clang don't generate PREFETCHW for __builtin_prefetch(.., 1)
// unless -march=broadwell or newer; this is not generally the default, so we
// manually emit prefetchw. PREFETCHW is recognized as a no-op on older Intel
// processors and has been present on AMD processors since the K6-2.
-#if defined(__x86_64__)
- asm("prefetchw (%0)" : : "r"(addr));
+#if defined(__x86_64__) && !defined(__PRFCHW__)
+ asm("prefetchw %0" : : "m"(*reinterpret_cast<const char*>(addr)));
#else
__builtin_prefetch(addr, 1, 3);
#endif
@@ -164,15 +169,18 @@ inline void PrefetchToLocalCacheForWrite(const void* addr) {
#define Y_ABSL_HAVE_PREFETCH 1
-inline void PrefetchToLocalCache(const void* addr) {
+Y_ABSL_ATTRIBUTE_ALWAYS_INLINE inline void PrefetchToLocalCache(
+ const void* addr) {
_mm_prefetch(reinterpret_cast<const char*>(addr), _MM_HINT_T0);
}
-inline void PrefetchToLocalCacheNta(const void* addr) {
+Y_ABSL_ATTRIBUTE_ALWAYS_INLINE inline void PrefetchToLocalCacheNta(
+ const void* addr) {
_mm_prefetch(reinterpret_cast<const char*>(addr), _MM_HINT_NTA);
}
-inline void PrefetchToLocalCacheForWrite(const void* addr) {
+Y_ABSL_ATTRIBUTE_ALWAYS_INLINE inline void PrefetchToLocalCacheForWrite(
+ const void* addr) {
#if defined(_MM_HINT_ET0)
_mm_prefetch(reinterpret_cast<const char*>(addr), _MM_HINT_ET0);
#elif !defined(_MSC_VER) && defined(__x86_64__)
@@ -180,15 +188,18 @@ inline void PrefetchToLocalCacheForWrite(const void* addr) {
// up, PREFETCHW is recognized as a no-op on older Intel processors
// and has been present on AMD processors since the K6-2. We have this
// disabled for MSVC compilers as this miscompiles on older MSVC compilers.
- asm("prefetchw (%0)" : : "r"(addr));
+ asm("prefetchw %0" : : "m"(*reinterpret_cast<const char*>(addr)));
#endif
}
#else
-inline void PrefetchToLocalCache(const void* addr) {}
-inline void PrefetchToLocalCacheNta(const void* addr) {}
-inline void PrefetchToLocalCacheForWrite(const void* addr) {}
+Y_ABSL_ATTRIBUTE_ALWAYS_INLINE inline void PrefetchToLocalCache(
+ const void* addr) {}
+Y_ABSL_ATTRIBUTE_ALWAYS_INLINE inline void PrefetchToLocalCacheNta(
+ const void* addr) {}
+Y_ABSL_ATTRIBUTE_ALWAYS_INLINE inline void PrefetchToLocalCacheForWrite(
+ const void* addr) {}
#endif
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/thread_annotations.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/thread_annotations.h
index 864784143ce..6c48341221f 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/thread_annotations.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/thread_annotations.h
@@ -36,8 +36,6 @@
#include "y_absl/base/attributes.h"
#include "y_absl/base/config.h"
-// TODO(mbonadei): Remove after the backward compatibility period.
-#include "y_absl/base/internal/thread_annotations.h" // IWYU pragma: export
// Y_ABSL_GUARDED_BY()
//
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/flat_hash_map.h b/contrib/restricted/abseil-cpp-tstring/y_absl/container/flat_hash_map.h
index c271317a983..c71b6402a7f 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/container/flat_hash_map.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/container/flat_hash_map.h
@@ -64,7 +64,7 @@ struct FlatHashMapPolicy;
// `insert()`, provided that the map is provided a compatible heterogeneous
// hashing function and equality operator.
// * Invalidates any references and pointers to elements within the table after
-// `rehash()`.
+// `rehash()` and when the table is moved.
// * Contains a `capacity()` member function indicating the number of element
// slots (open, deleted, and empty) within the hash map.
// * Returns `void` from the `erase(iterator)` overload.
@@ -579,9 +579,9 @@ struct FlatHashMapPolicy {
}
template <class Allocator>
- static void transfer(Allocator* alloc, slot_type* new_slot,
+ static auto transfer(Allocator* alloc, slot_type* new_slot,
slot_type* old_slot) {
- slot_policy::transfer(alloc, new_slot, old_slot);
+ return slot_policy::transfer(alloc, new_slot, old_slot);
}
template <class F, class... Args>
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/flat_hash_set.h b/contrib/restricted/abseil-cpp-tstring/y_absl/container/flat_hash_set.h
index 5599a0019a0..c9d414d6caf 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/container/flat_hash_set.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/container/flat_hash_set.h
@@ -60,7 +60,7 @@ struct FlatHashSetPolicy;
// that the set is provided a compatible heterogeneous hashing function and
// equality operator.
// * Invalidates any references and pointers to elements within the table after
-// `rehash()`.
+// `rehash()` and when the table is moved.
// * Contains a `capacity()` member function indicating the number of element
// slots (open, deleted, and empty) within the hash set.
// * Returns `void` from the `erase(iterator)` overload.
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/common_policy_traits.h b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/common_policy_traits.h
index e669efacd9a..cdc3b07f32b 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/common_policy_traits.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/common_policy_traits.h
@@ -93,11 +93,13 @@ struct common_policy_traits {
struct Rank0 : Rank1 {};
// Use auto -> decltype as an enabler.
+ // P::transfer returns std::true_type if transfer uses memcpy (e.g. in
+ // node_slot_policy).
template <class Alloc, class P = Policy>
static auto transfer_impl(Alloc* alloc, slot_type* new_slot,
slot_type* old_slot, Rank0)
- -> decltype((void)P::transfer(alloc, new_slot, old_slot)) {
- P::transfer(alloc, new_slot, old_slot);
+ -> decltype(P::transfer(alloc, new_slot, old_slot)) {
+ return P::transfer(alloc, new_slot, old_slot);
}
#if defined(__cpp_lib_launder) && __cpp_lib_launder >= 201606
// This overload returns true_type for the trait below.
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/container_memory.h b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/container_memory.h
index 19a64716be5..82bb3ebde07 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/container_memory.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/container_memory.h
@@ -122,10 +122,10 @@ auto TupleRefImpl(T&& t, y_absl::index_sequence<Is...>)
// Returns a tuple of references to the elements of the input tuple. T must be a
// tuple.
template <class T>
-auto TupleRef(T&& t) -> decltype(
- TupleRefImpl(std::forward<T>(t),
- y_absl::make_index_sequence<
- std::tuple_size<typename std::decay<T>::type>::value>())) {
+auto TupleRef(T&& t) -> decltype(TupleRefImpl(
+ std::forward<T>(t),
+ y_absl::make_index_sequence<
+ std::tuple_size<typename std::decay<T>::type>::value>())) {
return TupleRefImpl(
std::forward<T>(t),
y_absl::make_index_sequence<
@@ -156,8 +156,8 @@ void ConstructFromTuple(Alloc* alloc, T* ptr, Tuple&& t) {
// Constructs T using the args specified in the tuple and calls F with the
// constructed value.
template <class T, class Tuple, class F>
-decltype(std::declval<F>()(std::declval<T>())) WithConstructed(
- Tuple&& t, F&& f) {
+decltype(std::declval<F>()(std::declval<T>())) WithConstructed(Tuple&& t,
+ F&& f) {
return memory_internal::WithConstructedImpl<T>(
std::forward<Tuple>(t),
y_absl::make_index_sequence<
@@ -423,16 +423,19 @@ struct map_slot_policy {
}
template <class Allocator>
- static void transfer(Allocator* alloc, slot_type* new_slot,
+ static auto transfer(Allocator* alloc, slot_type* new_slot,
slot_type* old_slot) {
+ auto is_relocatable =
+ typename y_absl::is_trivially_relocatable<value_type>::type();
+
emplace(new_slot);
#if defined(__cpp_lib_launder) && __cpp_lib_launder >= 201606
- if (y_absl::is_trivially_relocatable<value_type>()) {
+ if (is_relocatable) {
// TODO(b/247130232,b/251814870): remove casts after fixing warnings.
std::memcpy(static_cast<void*>(std::launder(&new_slot->value)),
static_cast<const void*>(&old_slot->value),
sizeof(value_type));
- return;
+ return is_relocatable;
}
#endif
@@ -444,6 +447,7 @@ struct map_slot_policy {
std::move(old_slot->value));
}
destroy(alloc, old_slot);
+ return is_relocatable;
}
};
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/hashtablez_sampler.h b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/hashtablez_sampler.h
index 95353663f2a..32f64a22a62 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/hashtablez_sampler.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/hashtablez_sampler.h
@@ -137,18 +137,7 @@ class HashtablezInfoHandle {
UnsampleSlow(info_);
}
- HashtablezInfoHandle(const HashtablezInfoHandle&) = delete;
- HashtablezInfoHandle& operator=(const HashtablezInfoHandle&) = delete;
-
- HashtablezInfoHandle(HashtablezInfoHandle&& o) noexcept
- : info_(y_absl::exchange(o.info_, nullptr)) {}
- HashtablezInfoHandle& operator=(HashtablezInfoHandle&& o) noexcept {
- if (Y_ABSL_PREDICT_FALSE(info_ != nullptr)) {
- UnsampleSlow(info_);
- }
- info_ = y_absl::exchange(o.info_, nullptr);
- return *this;
- }
+ inline bool IsSampled() const { return Y_ABSL_PREDICT_FALSE(info_ != nullptr); }
inline void RecordStorageChanged(size_t size, size_t capacity) {
if (Y_ABSL_PREDICT_TRUE(info_ == nullptr)) return;
@@ -198,6 +187,7 @@ class HashtablezInfoHandle {
explicit HashtablezInfoHandle(std::nullptr_t) {}
inline void Unregister() {}
+ inline bool IsSampled() const { return false; }
inline void RecordStorageChanged(size_t /*size*/, size_t /*capacity*/) {}
inline void RecordRehash(size_t /*total_probe_length*/) {}
inline void RecordReservation(size_t /*target_capacity*/) {}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/inlined_vector.h b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/inlined_vector.h
index 7820cf1f9ca..67fffc4f797 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/inlined_vector.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/inlined_vector.h
@@ -26,6 +26,7 @@
#include <utility>
#include "y_absl/base/attributes.h"
+#include "y_absl/base/config.h"
#include "y_absl/base/macros.h"
#include "y_absl/container/internal/compressed_tuple.h"
#include "y_absl/memory/memory.h"
@@ -384,7 +385,17 @@ class Storage {
bool GetIsAllocated() const { return GetSizeAndIsAllocated() & 1; }
- Pointer<A> GetAllocatedData() { return data_.allocated.allocated_data; }
+ Pointer<A> GetAllocatedData() {
+ // GCC 12 has a false-positive -Wmaybe-uninitialized warning here.
+#if Y_ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
+ return data_.allocated.allocated_data;
+#if Y_ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
+#pragma GCC diagnostic pop
+#endif
+ }
ConstPointer<A> GetAllocatedData() const {
return data_.allocated.allocated_data;
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/layout.h b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/layout.h
deleted file mode 100644
index b7faf1b329d..00000000000
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/layout.h
+++ /dev/null
@@ -1,743 +0,0 @@
-// Copyright 2018 The Abseil Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// MOTIVATION AND TUTORIAL
-//
-// If you want to put in a single heap allocation N doubles followed by M ints,
-// it's easy if N and M are known at compile time.
-//
-// struct S {
-// double a[N];
-// int b[M];
-// };
-//
-// S* p = new S;
-//
-// But what if N and M are known only in run time? Class template Layout to the
-// rescue! It's a portable generalization of the technique known as struct hack.
-//
-// // This object will tell us everything we need to know about the memory
-// // layout of double[N] followed by int[M]. It's structurally identical to
-// // size_t[2] that stores N and M. It's very cheap to create.
-// const Layout<double, int> layout(N, M);
-//
-// // Allocate enough memory for both arrays. `AllocSize()` tells us how much
-// // memory is needed. We are free to use any allocation function we want as
-// // long as it returns aligned memory.
-// std::unique_ptr<unsigned char[]> p(new unsigned char[layout.AllocSize()]);
-//
-// // Obtain the pointer to the array of doubles.
-// // Equivalent to `reinterpret_cast<double*>(p.get())`.
-// //
-// // We could have written layout.Pointer<0>(p) instead. If all the types are
-// // unique you can use either form, but if some types are repeated you must
-// // use the index form.
-// double* a = layout.Pointer<double>(p.get());
-//
-// // Obtain the pointer to the array of ints.
-// // Equivalent to `reinterpret_cast<int*>(p.get() + N * 8)`.
-// int* b = layout.Pointer<int>(p);
-//
-// If we are unable to specify sizes of all fields, we can pass as many sizes as
-// we can to `Partial()`. In return, it'll allow us to access the fields whose
-// locations and sizes can be computed from the provided information.
-// `Partial()` comes in handy when the array sizes are embedded into the
-// allocation.
-//
-// // size_t[1] containing N, size_t[1] containing M, double[N], int[M].
-// using L = Layout<size_t, size_t, double, int>;
-//
-// unsigned char* Allocate(size_t n, size_t m) {
-// const L layout(1, 1, n, m);
-// unsigned char* p = new unsigned char[layout.AllocSize()];
-// *layout.Pointer<0>(p) = n;
-// *layout.Pointer<1>(p) = m;
-// return p;
-// }
-//
-// void Use(unsigned char* p) {
-// // First, extract N and M.
-// // Specify that the first array has only one element. Using `prefix` we
-// // can access the first two arrays but not more.
-// constexpr auto prefix = L::Partial(1);
-// size_t n = *prefix.Pointer<0>(p);
-// size_t m = *prefix.Pointer<1>(p);
-//
-// // Now we can get pointers to the payload.
-// const L layout(1, 1, n, m);
-// double* a = layout.Pointer<double>(p);
-// int* b = layout.Pointer<int>(p);
-// }
-//
-// The layout we used above combines fixed-size with dynamically-sized fields.
-// This is quite common. Layout is optimized for this use case and generates
-// optimal code. All computations that can be performed at compile time are
-// indeed performed at compile time.
-//
-// Efficiency tip: The order of fields matters. In `Layout<T1, ..., TN>` try to
-// ensure that `alignof(T1) >= ... >= alignof(TN)`. This way you'll have no
-// padding in between arrays.
-//
-// You can manually override the alignment of an array by wrapping the type in
-// `Aligned<T, N>`. `Layout<..., Aligned<T, N>, ...>` has exactly the same API
-// and behavior as `Layout<..., T, ...>` except that the first element of the
-// array of `T` is aligned to `N` (the rest of the elements follow without
-// padding). `N` cannot be less than `alignof(T)`.
-//
-// `AllocSize()` and `Pointer()` are the most basic methods for dealing with
-// memory layouts. Check out the reference or code below to discover more.
-//
-// EXAMPLE
-//
-// // Immutable move-only string with sizeof equal to sizeof(void*). The
-// // string size and the characters are kept in the same heap allocation.
-// class CompactString {
-// public:
-// CompactString(const char* s = "") {
-// const size_t size = strlen(s);
-// // size_t[1] followed by char[size + 1].
-// const L layout(1, size + 1);
-// p_.reset(new unsigned char[layout.AllocSize()]);
-// // If running under ASAN, mark the padding bytes, if any, to catch
-// // memory errors.
-// layout.PoisonPadding(p_.get());
-// // Store the size in the allocation.
-// *layout.Pointer<size_t>(p_.get()) = size;
-// // Store the characters in the allocation.
-// memcpy(layout.Pointer<char>(p_.get()), s, size + 1);
-// }
-//
-// size_t size() const {
-// // Equivalent to reinterpret_cast<size_t&>(*p).
-// return *L::Partial().Pointer<size_t>(p_.get());
-// }
-//
-// const char* c_str() const {
-// // Equivalent to reinterpret_cast<char*>(p.get() + sizeof(size_t)).
-// // The argument in Partial(1) specifies that we have size_t[1] in front
-// // of the characters.
-// return L::Partial(1).Pointer<char>(p_.get());
-// }
-//
-// private:
-// // Our heap allocation contains a size_t followed by an array of chars.
-// using L = Layout<size_t, char>;
-// std::unique_ptr<unsigned char[]> p_;
-// };
-//
-// int main() {
-// CompactString s = "hello";
-// assert(s.size() == 5);
-// assert(strcmp(s.c_str(), "hello") == 0);
-// }
-//
-// DOCUMENTATION
-//
-// The interface exported by this file consists of:
-// - class `Layout<>` and its public members.
-// - The public members of class `internal_layout::LayoutImpl<>`. That class
-// isn't intended to be used directly, and its name and template parameter
-// list are internal implementation details, but the class itself provides
-// most of the functionality in this file. See comments on its members for
-// detailed documentation.
-//
-// `Layout<T1,... Tn>::Partial(count1,..., countm)` (where `m` <= `n`) returns a
-// `LayoutImpl<>` object. `Layout<T1,..., Tn> layout(count1,..., countn)`
-// creates a `Layout` object, which exposes the same functionality by inheriting
-// from `LayoutImpl<>`.
-
-#ifndef Y_ABSL_CONTAINER_INTERNAL_LAYOUT_H_
-#define Y_ABSL_CONTAINER_INTERNAL_LAYOUT_H_
-
-#include <assert.h>
-#include <stddef.h>
-#include <stdint.h>
-
-#include <ostream>
-#include <util/generic/string.h>
-#include <tuple>
-#include <type_traits>
-#include <typeinfo>
-#include <utility>
-
-#include "y_absl/base/config.h"
-#include "y_absl/meta/type_traits.h"
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/types/span.h"
-#include "y_absl/utility/utility.h"
-
-#ifdef Y_ABSL_HAVE_ADDRESS_SANITIZER
-#include <sanitizer/asan_interface.h>
-#endif
-
-#if defined(__GXX_RTTI)
-#define Y_ABSL_INTERNAL_HAS_CXA_DEMANGLE
-#endif
-
-#ifdef Y_ABSL_INTERNAL_HAS_CXA_DEMANGLE
-#include <cxxabi.h>
-#endif
-
-namespace y_absl {
-Y_ABSL_NAMESPACE_BEGIN
-namespace container_internal {
-
-// A type wrapper that instructs `Layout` to use the specific alignment for the
-// array. `Layout<..., Aligned<T, N>, ...>` has exactly the same API
-// and behavior as `Layout<..., T, ...>` except that the first element of the
-// array of `T` is aligned to `N` (the rest of the elements follow without
-// padding).
-//
-// Requires: `N >= alignof(T)` and `N` is a power of 2.
-template <class T, size_t N>
-struct Aligned;
-
-namespace internal_layout {
-
-template <class T>
-struct NotAligned {};
-
-template <class T, size_t N>
-struct NotAligned<const Aligned<T, N>> {
- static_assert(sizeof(T) == 0, "Aligned<T, N> cannot be const-qualified");
-};
-
-template <size_t>
-using IntToSize = size_t;
-
-template <class>
-using TypeToSize = size_t;
-
-template <class T>
-struct Type : NotAligned<T> {
- using type = T;
-};
-
-template <class T, size_t N>
-struct Type<Aligned<T, N>> {
- using type = T;
-};
-
-template <class T>
-struct SizeOf : NotAligned<T>, std::integral_constant<size_t, sizeof(T)> {};
-
-template <class T, size_t N>
-struct SizeOf<Aligned<T, N>> : std::integral_constant<size_t, sizeof(T)> {};
-
-// Note: workaround for https://gcc.gnu.org/PR88115
-template <class T>
-struct AlignOf : NotAligned<T> {
- static constexpr size_t value = alignof(T);
-};
-
-template <class T, size_t N>
-struct AlignOf<Aligned<T, N>> {
- static_assert(N % alignof(T) == 0,
- "Custom alignment can't be lower than the type's alignment");
- static constexpr size_t value = N;
-};
-
-// Does `Ts...` contain `T`?
-template <class T, class... Ts>
-using Contains = y_absl::disjunction<std::is_same<T, Ts>...>;
-
-template <class From, class To>
-using CopyConst =
- typename std::conditional<std::is_const<From>::value, const To, To>::type;
-
-// Note: We're not qualifying this with y_absl:: because it doesn't compile under
-// MSVC.
-template <class T>
-using SliceType = Span<T>;
-
-// This namespace contains no types. It prevents functions defined in it from
-// being found by ADL.
-namespace adl_barrier {
-
-template <class Needle, class... Ts>
-constexpr size_t Find(Needle, Needle, Ts...) {
- static_assert(!Contains<Needle, Ts...>(), "Duplicate element type");
- return 0;
-}
-
-template <class Needle, class T, class... Ts>
-constexpr size_t Find(Needle, T, Ts...) {
- return adl_barrier::Find(Needle(), Ts()...) + 1;
-}
-
-constexpr bool IsPow2(size_t n) { return !(n & (n - 1)); }
-
-// Returns `q * m` for the smallest `q` such that `q * m >= n`.
-// Requires: `m` is a power of two. It's enforced by IsLegalElementType below.
-constexpr size_t Align(size_t n, size_t m) { return (n + m - 1) & ~(m - 1); }
-
-constexpr size_t Min(size_t a, size_t b) { return b < a ? b : a; }
-
-constexpr size_t Max(size_t a) { return a; }
-
-template <class... Ts>
-constexpr size_t Max(size_t a, size_t b, Ts... rest) {
- return adl_barrier::Max(b < a ? a : b, rest...);
-}
-
-template <class T>
-TString TypeName() {
- TString out;
- int status = 0;
- char* demangled = nullptr;
-#ifdef Y_ABSL_INTERNAL_HAS_CXA_DEMANGLE
- demangled = abi::__cxa_demangle(typeid(T).name(), nullptr, nullptr, &status);
-#endif
- if (status == 0 && demangled != nullptr) { // Demangling succeeded.
- y_absl::StrAppend(&out, "<", demangled, ">");
- free(demangled);
- } else {
-#if defined(__GXX_RTTI) || defined(_CPPRTTI)
- y_absl::StrAppend(&out, "<", typeid(T).name(), ">");
-#endif
- }
- return out;
-}
-
-} // namespace adl_barrier
-
-template <bool C>
-using EnableIf = typename std::enable_if<C, int>::type;
-
-// Can `T` be a template argument of `Layout`?
-template <class T>
-using IsLegalElementType = std::integral_constant<
- bool, !std::is_reference<T>::value && !std::is_volatile<T>::value &&
- !std::is_reference<typename Type<T>::type>::value &&
- !std::is_volatile<typename Type<T>::type>::value &&
- adl_barrier::IsPow2(AlignOf<T>::value)>;
-
-template <class Elements, class SizeSeq, class OffsetSeq>
-class LayoutImpl;
-
-// Public base class of `Layout` and the result type of `Layout::Partial()`.
-//
-// `Elements...` contains all template arguments of `Layout` that created this
-// instance.
-//
-// `SizeSeq...` is `[0, NumSizes)` where `NumSizes` is the number of arguments
-// passed to `Layout::Partial()` or `Layout::Layout()`.
-//
-// `OffsetSeq...` is `[0, NumOffsets)` where `NumOffsets` is
-// `Min(sizeof...(Elements), NumSizes + 1)` (the number of arrays for which we
-// can compute offsets).
-template <class... Elements, size_t... SizeSeq, size_t... OffsetSeq>
-class LayoutImpl<std::tuple<Elements...>, y_absl::index_sequence<SizeSeq...>,
- y_absl::index_sequence<OffsetSeq...>> {
- private:
- static_assert(sizeof...(Elements) > 0, "At least one field is required");
- static_assert(y_absl::conjunction<IsLegalElementType<Elements>...>::value,
- "Invalid element type (see IsLegalElementType)");
-
- enum {
- NumTypes = sizeof...(Elements),
- NumSizes = sizeof...(SizeSeq),
- NumOffsets = sizeof...(OffsetSeq),
- };
-
- // These are guaranteed by `Layout`.
- static_assert(NumOffsets == adl_barrier::Min(NumTypes, NumSizes + 1),
- "Internal error");
- static_assert(NumTypes > 0, "Internal error");
-
- // Returns the index of `T` in `Elements...`. Results in a compilation error
- // if `Elements...` doesn't contain exactly one instance of `T`.
- template <class T>
- static constexpr size_t ElementIndex() {
- static_assert(Contains<Type<T>, Type<typename Type<Elements>::type>...>(),
- "Type not found");
- return adl_barrier::Find(Type<T>(),
- Type<typename Type<Elements>::type>()...);
- }
-
- template <size_t N>
- using ElementAlignment =
- AlignOf<typename std::tuple_element<N, std::tuple<Elements...>>::type>;
-
- public:
- // Element types of all arrays packed in a tuple.
- using ElementTypes = std::tuple<typename Type<Elements>::type...>;
-
- // Element type of the Nth array.
- template <size_t N>
- using ElementType = typename std::tuple_element<N, ElementTypes>::type;
-
- constexpr explicit LayoutImpl(IntToSize<SizeSeq>... sizes)
- : size_{sizes...} {}
-
- // Alignment of the layout, equal to the strictest alignment of all elements.
- // All pointers passed to the methods of layout must be aligned to this value.
- static constexpr size_t Alignment() {
- return adl_barrier::Max(AlignOf<Elements>::value...);
- }
-
- // Offset in bytes of the Nth array.
- //
- // // int[3], 4 bytes of padding, double[4].
- // Layout<int, double> x(3, 4);
- // assert(x.Offset<0>() == 0); // The ints starts from 0.
- // assert(x.Offset<1>() == 16); // The doubles starts from 16.
- //
- // Requires: `N <= NumSizes && N < sizeof...(Ts)`.
- template <size_t N, EnableIf<N == 0> = 0>
- constexpr size_t Offset() const {
- return 0;
- }
-
- template <size_t N, EnableIf<N != 0> = 0>
- constexpr size_t Offset() const {
- static_assert(N < NumOffsets, "Index out of bounds");
- return adl_barrier::Align(
- Offset<N - 1>() + SizeOf<ElementType<N - 1>>::value * size_[N - 1],
- ElementAlignment<N>::value);
- }
-
- // Offset in bytes of the array with the specified element type. There must
- // be exactly one such array and its zero-based index must be at most
- // `NumSizes`.
- //
- // // int[3], 4 bytes of padding, double[4].
- // Layout<int, double> x(3, 4);
- // assert(x.Offset<int>() == 0); // The ints starts from 0.
- // assert(x.Offset<double>() == 16); // The doubles starts from 16.
- template <class T>
- constexpr size_t Offset() const {
- return Offset<ElementIndex<T>()>();
- }
-
- // Offsets in bytes of all arrays for which the offsets are known.
- constexpr std::array<size_t, NumOffsets> Offsets() const {
- return {{Offset<OffsetSeq>()...}};
- }
-
- // The number of elements in the Nth array. This is the Nth argument of
- // `Layout::Partial()` or `Layout::Layout()` (zero-based).
- //
- // // int[3], 4 bytes of padding, double[4].
- // Layout<int, double> x(3, 4);
- // assert(x.Size<0>() == 3);
- // assert(x.Size<1>() == 4);
- //
- // Requires: `N < NumSizes`.
- template <size_t N>
- constexpr size_t Size() const {
- static_assert(N < NumSizes, "Index out of bounds");
- return size_[N];
- }
-
- // The number of elements in the array with the specified element type.
- // There must be exactly one such array and its zero-based index must be
- // at most `NumSizes`.
- //
- // // int[3], 4 bytes of padding, double[4].
- // Layout<int, double> x(3, 4);
- // assert(x.Size<int>() == 3);
- // assert(x.Size<double>() == 4);
- template <class T>
- constexpr size_t Size() const {
- return Size<ElementIndex<T>()>();
- }
-
- // The number of elements of all arrays for which they are known.
- constexpr std::array<size_t, NumSizes> Sizes() const {
- return {{Size<SizeSeq>()...}};
- }
-
- // Pointer to the beginning of the Nth array.
- //
- // `Char` must be `[const] [signed|unsigned] char`.
- //
- // // int[3], 4 bytes of padding, double[4].
- // Layout<int, double> x(3, 4);
- // unsigned char* p = new unsigned char[x.AllocSize()];
- // int* ints = x.Pointer<0>(p);
- // double* doubles = x.Pointer<1>(p);
- //
- // Requires: `N <= NumSizes && N < sizeof...(Ts)`.
- // Requires: `p` is aligned to `Alignment()`.
- template <size_t N, class Char>
- CopyConst<Char, ElementType<N>>* Pointer(Char* p) const {
- using C = typename std::remove_const<Char>::type;
- static_assert(
- std::is_same<C, char>() || std::is_same<C, unsigned char>() ||
- std::is_same<C, signed char>(),
- "The argument must be a pointer to [const] [signed|unsigned] char");
- constexpr size_t alignment = Alignment();
- (void)alignment;
- assert(reinterpret_cast<uintptr_t>(p) % alignment == 0);
- return reinterpret_cast<CopyConst<Char, ElementType<N>>*>(p + Offset<N>());
- }
-
- // Pointer to the beginning of the array with the specified element type.
- // There must be exactly one such array and its zero-based index must be at
- // most `NumSizes`.
- //
- // `Char` must be `[const] [signed|unsigned] char`.
- //
- // // int[3], 4 bytes of padding, double[4].
- // Layout<int, double> x(3, 4);
- // unsigned char* p = new unsigned char[x.AllocSize()];
- // int* ints = x.Pointer<int>(p);
- // double* doubles = x.Pointer<double>(p);
- //
- // Requires: `p` is aligned to `Alignment()`.
- template <class T, class Char>
- CopyConst<Char, T>* Pointer(Char* p) const {
- return Pointer<ElementIndex<T>()>(p);
- }
-
- // Pointers to all arrays for which pointers are known.
- //
- // `Char` must be `[const] [signed|unsigned] char`.
- //
- // // int[3], 4 bytes of padding, double[4].
- // Layout<int, double> x(3, 4);
- // unsigned char* p = new unsigned char[x.AllocSize()];
- //
- // int* ints;
- // double* doubles;
- // std::tie(ints, doubles) = x.Pointers(p);
- //
- // Requires: `p` is aligned to `Alignment()`.
- //
- // Note: We're not using ElementType alias here because it does not compile
- // under MSVC.
- template <class Char>
- std::tuple<CopyConst<
- Char, typename std::tuple_element<OffsetSeq, ElementTypes>::type>*...>
- Pointers(Char* p) const {
- return std::tuple<CopyConst<Char, ElementType<OffsetSeq>>*...>(
- Pointer<OffsetSeq>(p)...);
- }
-
- // The Nth array.
- //
- // `Char` must be `[const] [signed|unsigned] char`.
- //
- // // int[3], 4 bytes of padding, double[4].
- // Layout<int, double> x(3, 4);
- // unsigned char* p = new unsigned char[x.AllocSize()];
- // Span<int> ints = x.Slice<0>(p);
- // Span<double> doubles = x.Slice<1>(p);
- //
- // Requires: `N < NumSizes`.
- // Requires: `p` is aligned to `Alignment()`.
- template <size_t N, class Char>
- SliceType<CopyConst<Char, ElementType<N>>> Slice(Char* p) const {
- return SliceType<CopyConst<Char, ElementType<N>>>(Pointer<N>(p), Size<N>());
- }
-
- // The array with the specified element type. There must be exactly one
- // such array and its zero-based index must be less than `NumSizes`.
- //
- // `Char` must be `[const] [signed|unsigned] char`.
- //
- // // int[3], 4 bytes of padding, double[4].
- // Layout<int, double> x(3, 4);
- // unsigned char* p = new unsigned char[x.AllocSize()];
- // Span<int> ints = x.Slice<int>(p);
- // Span<double> doubles = x.Slice<double>(p);
- //
- // Requires: `p` is aligned to `Alignment()`.
- template <class T, class Char>
- SliceType<CopyConst<Char, T>> Slice(Char* p) const {
- return Slice<ElementIndex<T>()>(p);
- }
-
- // All arrays with known sizes.
- //
- // `Char` must be `[const] [signed|unsigned] char`.
- //
- // // int[3], 4 bytes of padding, double[4].
- // Layout<int, double> x(3, 4);
- // unsigned char* p = new unsigned char[x.AllocSize()];
- //
- // Span<int> ints;
- // Span<double> doubles;
- // std::tie(ints, doubles) = x.Slices(p);
- //
- // Requires: `p` is aligned to `Alignment()`.
- //
- // Note: We're not using ElementType alias here because it does not compile
- // under MSVC.
- template <class Char>
- std::tuple<SliceType<CopyConst<
- Char, typename std::tuple_element<SizeSeq, ElementTypes>::type>>...>
- Slices(Char* p) const {
- // Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63875 (fixed
- // in 6.1).
- (void)p;
- return std::tuple<SliceType<CopyConst<Char, ElementType<SizeSeq>>>...>(
- Slice<SizeSeq>(p)...);
- }
-
- // The size of the allocation that fits all arrays.
- //
- // // int[3], 4 bytes of padding, double[4].
- // Layout<int, double> x(3, 4);
- // unsigned char* p = new unsigned char[x.AllocSize()]; // 48 bytes
- //
- // Requires: `NumSizes == sizeof...(Ts)`.
- constexpr size_t AllocSize() const {
- static_assert(NumTypes == NumSizes, "You must specify sizes of all fields");
- return Offset<NumTypes - 1>() +
- SizeOf<ElementType<NumTypes - 1>>::value * size_[NumTypes - 1];
- }
-
- // If built with --config=asan, poisons padding bytes (if any) in the
- // allocation. The pointer must point to a memory block at least
- // `AllocSize()` bytes in length.
- //
- // `Char` must be `[const] [signed|unsigned] char`.
- //
- // Requires: `p` is aligned to `Alignment()`.
- template <class Char, size_t N = NumOffsets - 1, EnableIf<N == 0> = 0>
- void PoisonPadding(const Char* p) const {
- Pointer<0>(p); // verify the requirements on `Char` and `p`
- }
-
- template <class Char, size_t N = NumOffsets - 1, EnableIf<N != 0> = 0>
- void PoisonPadding(const Char* p) const {
- static_assert(N < NumOffsets, "Index out of bounds");
- (void)p;
-#ifdef Y_ABSL_HAVE_ADDRESS_SANITIZER
- PoisonPadding<Char, N - 1>(p);
- // The `if` is an optimization. It doesn't affect the observable behaviour.
- if (ElementAlignment<N - 1>::value % ElementAlignment<N>::value) {
- size_t start =
- Offset<N - 1>() + SizeOf<ElementType<N - 1>>::value * size_[N - 1];
- ASAN_POISON_MEMORY_REGION(p + start, Offset<N>() - start);
- }
-#endif
- }
-
- // Human-readable description of the memory layout. Useful for debugging.
- // Slow.
- //
- // // char[5], 3 bytes of padding, int[3], 4 bytes of padding, followed
- // // by an unknown number of doubles.
- // auto x = Layout<char, int, double>::Partial(5, 3);
- // assert(x.DebugString() ==
- // "@0<char>(1)[5]; @8<int>(4)[3]; @24<double>(8)");
- //
- // Each field is in the following format: @offset<type>(sizeof)[size] (<type>
- // may be missing depending on the target platform). For example,
- // @8<int>(4)[3] means that at offset 8 we have an array of ints, where each
- // int is 4 bytes, and we have 3 of those ints. The size of the last field may
- // be missing (as in the example above). Only fields with known offsets are
- // described. Type names may differ across platforms: one compiler might
- // produce "unsigned*" where another produces "unsigned int *".
- TString DebugString() const {
- const auto offsets = Offsets();
- const size_t sizes[] = {SizeOf<ElementType<OffsetSeq>>::value...};
- const TString types[] = {
- adl_barrier::TypeName<ElementType<OffsetSeq>>()...};
- TString res = y_absl::StrCat("@0", types[0], "(", sizes[0], ")");
- for (size_t i = 0; i != NumOffsets - 1; ++i) {
- y_absl::StrAppend(&res, "[", size_[i], "]; @", offsets[i + 1], types[i + 1],
- "(", sizes[i + 1], ")");
- }
- // NumSizes is a constant that may be zero. Some compilers cannot see that
- // inside the if statement "size_[NumSizes - 1]" must be valid.
- int last = static_cast<int>(NumSizes) - 1;
- if (NumTypes == NumSizes && last >= 0) {
- y_absl::StrAppend(&res, "[", size_[last], "]");
- }
- return res;
- }
-
- private:
- // Arguments of `Layout::Partial()` or `Layout::Layout()`.
- size_t size_[NumSizes > 0 ? NumSizes : 1];
-};
-
-template <size_t NumSizes, class... Ts>
-using LayoutType = LayoutImpl<
- std::tuple<Ts...>, y_absl::make_index_sequence<NumSizes>,
- y_absl::make_index_sequence<adl_barrier::Min(sizeof...(Ts), NumSizes + 1)>>;
-
-} // namespace internal_layout
-
-// Descriptor of arrays of various types and sizes laid out in memory one after
-// another. See the top of the file for documentation.
-//
-// Check out the public API of internal_layout::LayoutImpl above. The type is
-// internal to the library but its methods are public, and they are inherited
-// by `Layout`.
-template <class... Ts>
-class Layout : public internal_layout::LayoutType<sizeof...(Ts), Ts...> {
- public:
- static_assert(sizeof...(Ts) > 0, "At least one field is required");
- static_assert(
- y_absl::conjunction<internal_layout::IsLegalElementType<Ts>...>::value,
- "Invalid element type (see IsLegalElementType)");
-
- // The result type of `Partial()` with `NumSizes` arguments.
- template <size_t NumSizes>
- using PartialType = internal_layout::LayoutType<NumSizes, Ts...>;
-
- // `Layout` knows the element types of the arrays we want to lay out in
- // memory but not the number of elements in each array.
- // `Partial(size1, ..., sizeN)` allows us to specify the latter. The
- // resulting immutable object can be used to obtain pointers to the
- // individual arrays.
- //
- // It's allowed to pass fewer array sizes than the number of arrays. E.g.,
- // if all you need is to the offset of the second array, you only need to
- // pass one argument -- the number of elements in the first array.
- //
- // // int[3] followed by 4 bytes of padding and an unknown number of
- // // doubles.
- // auto x = Layout<int, double>::Partial(3);
- // // doubles start at byte 16.
- // assert(x.Offset<1>() == 16);
- //
- // If you know the number of elements in all arrays, you can still call
- // `Partial()` but it's more convenient to use the constructor of `Layout`.
- //
- // Layout<int, double> x(3, 5);
- //
- // Note: The sizes of the arrays must be specified in number of elements,
- // not in bytes.
- //
- // Requires: `sizeof...(Sizes) <= sizeof...(Ts)`.
- // Requires: all arguments are convertible to `size_t`.
- template <class... Sizes>
- static constexpr PartialType<sizeof...(Sizes)> Partial(Sizes&&... sizes) {
- static_assert(sizeof...(Sizes) <= sizeof...(Ts), "");
- return PartialType<sizeof...(Sizes)>(y_absl::forward<Sizes>(sizes)...);
- }
-
- // Creates a layout with the sizes of all arrays specified. If you know
- // only the sizes of the first N arrays (where N can be zero), you can use
- // `Partial()` defined above. The constructor is essentially equivalent to
- // calling `Partial()` and passing in all array sizes; the constructor is
- // provided as a convenient abbreviation.
- //
- // Note: The sizes of the arrays must be specified in number of elements,
- // not in bytes.
- constexpr explicit Layout(internal_layout::TypeToSize<Ts>... sizes)
- : internal_layout::LayoutType<sizeof...(Ts), Ts...>(sizes...) {}
-};
-
-} // namespace container_internal
-Y_ABSL_NAMESPACE_END
-} // namespace y_absl
-
-#endif // Y_ABSL_CONTAINER_INTERNAL_LAYOUT_H_
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_map.h b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_map.h
index e1a6097b680..d442b3189ef 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_map.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_map.h
@@ -19,6 +19,8 @@
#include <type_traits>
#include <utility>
+#include "y_absl/base/attributes.h"
+#include "y_absl/base/config.h"
#include "y_absl/base/internal/throw_delegate.h"
#include "y_absl/container/internal/container_memory.h"
#include "y_absl/container/internal/raw_hash_set.h" // IWYU pragma: export
@@ -175,13 +177,20 @@ class raw_hash_map : public raw_hash_set<Policy, Hash, Eq, Alloc> {
template <class K = key_type, class P = Policy, K* = nullptr>
MappedReference<P> operator[](key_arg<K>&& key)
Y_ABSL_ATTRIBUTE_LIFETIME_BOUND {
- return Policy::value(&*try_emplace(std::forward<K>(key)).first);
+ // It is safe to use unchecked_deref here because try_emplace
+ // will always return an iterator pointing to a valid item in the table,
+ // since it inserts if nothing is found for the given key.
+ return Policy::value(
+ &this->unchecked_deref(try_emplace(std::forward<K>(key)).first));
}
template <class K = key_type, class P = Policy>
MappedReference<P> operator[](const key_arg<K>& key)
Y_ABSL_ATTRIBUTE_LIFETIME_BOUND {
- return Policy::value(&*try_emplace(key).first);
+ // It is safe to use unchecked_deref here because try_emplace
+ // will always return an iterator pointing to a valid item in the table,
+ // since it inserts if nothing is found for the given key.
+ return Policy::value(&this->unchecked_deref(try_emplace(key).first));
}
private:
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set.cc
index dd84bf6cd97..bb19ecf63e2 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set.cc
@@ -17,11 +17,13 @@
#include <atomic>
#include <cassert>
#include <cstddef>
+#include <cstdint>
#include <cstring>
#include "y_absl/base/attributes.h"
#include "y_absl/base/config.h"
#include "y_absl/base/dynamic_annotations.h"
+#include "y_absl/container/internal/container_memory.h"
#include "y_absl/hash/hash.h"
namespace y_absl {
@@ -67,6 +69,16 @@ inline size_t RandomSeed() {
return value ^ static_cast<size_t>(reinterpret_cast<uintptr_t>(&counter));
}
+bool ShouldRehashForBugDetection(const ctrl_t* ctrl, size_t capacity) {
+ // Note: we can't use the abseil-random library because abseil-random
+ // depends on swisstable. We want to return true with probability
+ // `min(1, RehashProbabilityConstant() / capacity())`. In order to do this,
+ // we probe based on a random hash and see if the offset is less than
+ // RehashProbabilityConstant().
+ return probe(ctrl, capacity, y_absl::HashOf(RandomSeed())).offset() <
+ RehashProbabilityConstant();
+}
+
} // namespace
GenerationType* EmptyGeneration() {
@@ -84,13 +96,12 @@ bool CommonFieldsGenerationInfoEnabled::
size_t capacity) const {
if (reserved_growth_ == kReservedGrowthJustRanOut) return true;
if (reserved_growth_ > 0) return false;
- // Note: we can't use the abseil-random library because abseil-random
- // depends on swisstable. We want to return true with probability
- // `min(1, RehashProbabilityConstant() / capacity())`. In order to do this,
- // we probe based on a random hash and see if the offset is less than
- // RehashProbabilityConstant().
- return probe(ctrl, capacity, y_absl::HashOf(RandomSeed())).offset() <
- RehashProbabilityConstant();
+ return ShouldRehashForBugDetection(ctrl, capacity);
+}
+
+bool CommonFieldsGenerationInfoEnabled::should_rehash_for_bug_detection_on_move(
+ const ctrl_t* ctrl, size_t capacity) const {
+ return ShouldRehashForBugDetection(ctrl, capacity);
}
bool ShouldInsertBackwards(size_t hash, const ctrl_t* ctrl) {
@@ -117,14 +128,6 @@ FindInfo find_first_non_full_outofline(const CommonFields& common,
return find_first_non_full(common, hash);
}
-// Returns the address of the ith slot in slots where each slot occupies
-// slot_size.
-static inline void* SlotAddress(void* slot_array, size_t slot,
- size_t slot_size) {
- return reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(slot_array) +
- (slot * slot_size));
-}
-
// Returns the address of the slot just after slot assuming each slot has the
// specified size.
static inline void* NextSlot(void* slot, size_t slot_size) {
@@ -218,26 +221,35 @@ void DropDeletesWithoutResize(CommonFields& common,
common.infoz().RecordRehash(total_probe_length);
}
-void EraseMetaOnly(CommonFields& c, ctrl_t* it, size_t slot_size) {
- assert(IsFull(*it) && "erasing a dangling iterator");
- c.set_size(c.size() - 1);
- const auto index = static_cast<size_t>(it - c.control());
+static bool WasNeverFull(CommonFields& c, size_t index) {
+ if (is_single_group(c.capacity())) {
+ return true;
+ }
const size_t index_before = (index - Group::kWidth) & c.capacity();
- const auto empty_after = Group(it).MaskEmpty();
+ const auto empty_after = Group(c.control() + index).MaskEmpty();
const auto empty_before = Group(c.control() + index_before).MaskEmpty();
// We count how many consecutive non empties we have to the right and to the
// left of `it`. If the sum is >= kWidth then there is at least one probe
// window that might have seen a full group.
- bool was_never_full = empty_before && empty_after &&
- static_cast<size_t>(empty_after.TrailingZeros()) +
- empty_before.LeadingZeros() <
- Group::kWidth;
-
- SetCtrl(c, index, was_never_full ? ctrl_t::kEmpty : ctrl_t::kDeleted,
- slot_size);
- c.set_growth_left(c.growth_left() + (was_never_full ? 1 : 0));
+ return empty_before && empty_after &&
+ static_cast<size_t>(empty_after.TrailingZeros()) +
+ empty_before.LeadingZeros() <
+ Group::kWidth;
+}
+
+void EraseMetaOnly(CommonFields& c, size_t index, size_t slot_size) {
+ assert(IsFull(c.control()[index]) && "erasing a dangling iterator");
+ c.decrement_size();
c.infoz().RecordErase();
+
+ if (WasNeverFull(c, index)) {
+ SetCtrl(c, index, ctrl_t::kEmpty, slot_size);
+ c.set_growth_left(c.growth_left() + 1);
+ return;
+ }
+
+ SetCtrl(c, index, ctrl_t::kDeleted, slot_size);
}
void ClearBackingArray(CommonFields& c, const PolicyFunctions& policy,
@@ -245,19 +257,124 @@ void ClearBackingArray(CommonFields& c, const PolicyFunctions& policy,
c.set_size(0);
if (reuse) {
ResetCtrl(c, policy.slot_size);
+ ResetGrowthLeft(c);
c.infoz().RecordStorageChanged(0, c.capacity());
} else {
+ // We need to record infoz before calling dealloc, which will unregister
+ // infoz.
+ c.infoz().RecordClearedReservation();
+ c.infoz().RecordStorageChanged(0, 0);
(*policy.dealloc)(c, policy);
c.set_control(EmptyGroup());
c.set_generation_ptr(EmptyGeneration());
c.set_slots(nullptr);
c.set_capacity(0);
- c.infoz().RecordClearedReservation();
- assert(c.size() == 0);
- c.infoz().RecordStorageChanged(0, 0);
}
}
+void HashSetResizeHelper::GrowIntoSingleGroupShuffleControlBytes(
+ ctrl_t* new_ctrl, size_t new_capacity) const {
+ assert(is_single_group(new_capacity));
+ constexpr size_t kHalfWidth = Group::kWidth / 2;
+ assert(old_capacity_ < kHalfWidth);
+
+ const size_t half_old_capacity = old_capacity_ / 2;
+
+ // NOTE: operations are done with compile time known size = kHalfWidth.
+ // Compiler optimizes that into single ASM operation.
+
+ // Copy second half of bytes to the beginning.
+ // We potentially copy more bytes in order to have compile time known size.
+ // Mirrored bytes from the old_ctrl_ will also be copied.
+ // In case of old_capacity_ == 3, we will copy 1st element twice.
+ // Examples:
+ // old_ctrl = 0S0EEEEEEE...
+ // new_ctrl = S0EEEEEEEE...
+ //
+ // old_ctrl = 01S01EEEEE...
+ // new_ctrl = 1S01EEEEEE...
+ //
+ // old_ctrl = 0123456S0123456EE...
+ // new_ctrl = 456S0123?????????...
+ std::memcpy(new_ctrl, old_ctrl_ + half_old_capacity + 1, kHalfWidth);
+ // Clean up copied kSentinel from old_ctrl.
+ new_ctrl[half_old_capacity] = ctrl_t::kEmpty;
+
+ // Clean up damaged or uninitialized bytes.
+
+ // Clean bytes after the intended size of the copy.
+ // Example:
+ // new_ctrl = 1E01EEEEEEE????
+ // *new_ctrl= 1E0EEEEEEEE????
+ // position /
+ std::memset(new_ctrl + old_capacity_ + 1, static_cast<int8_t>(ctrl_t::kEmpty),
+ kHalfWidth);
+ // Clean non-mirrored bytes that are not initialized.
+ // For small old_capacity that may be inside of mirrored bytes zone.
+ // Examples:
+ // new_ctrl = 1E0EEEEEEEE??????????....
+ // *new_ctrl= 1E0EEEEEEEEEEEEE?????....
+ // position /
+ //
+ // new_ctrl = 456E0123???????????...
+ // *new_ctrl= 456E0123EEEEEEEE???...
+ // position /
+ std::memset(new_ctrl + kHalfWidth, static_cast<int8_t>(ctrl_t::kEmpty),
+ kHalfWidth);
+ // Clean last mirrored bytes that are not initialized
+ // and will not be overwritten by mirroring.
+ // Examples:
+ // new_ctrl = 1E0EEEEEEEEEEEEE????????
+ // *new_ctrl= 1E0EEEEEEEEEEEEEEEEEEEEE
+ // position S /
+ //
+ // new_ctrl = 456E0123EEEEEEEE???????????????
+ // *new_ctrl= 456E0123EEEEEEEE???????EEEEEEEE
+ // position S /
+ std::memset(new_ctrl + new_capacity + kHalfWidth,
+ static_cast<int8_t>(ctrl_t::kEmpty), kHalfWidth);
+
+ // Create mirrored bytes. old_capacity_ < kHalfWidth
+ // Example:
+ // new_ctrl = 456E0123EEEEEEEE???????EEEEEEEE
+ // *new_ctrl= 456E0123EEEEEEEE456E0123EEEEEEE
+ // position S/
+ ctrl_t g[kHalfWidth];
+ std::memcpy(g, new_ctrl, kHalfWidth);
+ std::memcpy(new_ctrl + new_capacity + 1, g, kHalfWidth);
+
+ // Finally set sentinel to its place.
+ new_ctrl[new_capacity] = ctrl_t::kSentinel;
+}
+
+void HashSetResizeHelper::GrowIntoSingleGroupShuffleTransferableSlots(
+ void* old_slots, void* new_slots, size_t slot_size) const {
+ assert(old_capacity_ > 0);
+ const size_t half_old_capacity = old_capacity_ / 2;
+
+ SanitizerUnpoisonMemoryRegion(old_slots, slot_size * old_capacity_);
+ std::memcpy(new_slots,
+ SlotAddress(old_slots, half_old_capacity + 1, slot_size),
+ slot_size * half_old_capacity);
+ std::memcpy(SlotAddress(new_slots, half_old_capacity + 1, slot_size),
+ old_slots, slot_size * (half_old_capacity + 1));
+}
+
+void HashSetResizeHelper::GrowSizeIntoSingleGroupTransferable(
+ CommonFields& c, void* old_slots, size_t slot_size) {
+ assert(old_capacity_ < Group::kWidth / 2);
+ assert(is_single_group(c.capacity()));
+ assert(IsGrowingIntoSingleGroupApplicable(old_capacity_, c.capacity()));
+
+ GrowIntoSingleGroupShuffleControlBytes(c.control(), c.capacity());
+ GrowIntoSingleGroupShuffleTransferableSlots(old_slots, c.slot_array(),
+ slot_size);
+
+ // We poison since GrowIntoSingleGroupShuffleTransferableSlots
+ // may leave empty slots unpoisoned.
+ PoisonSingleGroupEmptySlots(c, slot_size);
+}
+
} // namespace container_internal
Y_ABSL_NAMESPACE_END
} // namespace y_absl
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set.h b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set.h
index 1ac9c5184db..eb2ef632c2e 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set.h
@@ -62,6 +62,9 @@
// pseudo-struct:
//
// struct BackingArray {
+// // Sampling handler. This field isn't present when the sampling is
+// // disabled or this allocation hasn't been selected for sampling.
+// HashtablezInfoHandle infoz_;
// // The number of elements we can insert before growing the capacity.
// size_t growth_left;
// // Control bytes for the "real" slots.
@@ -175,25 +178,29 @@
#define Y_ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_
#include <algorithm>
+#include <cassert>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstring>
+#include <initializer_list>
#include <iterator>
#include <limits>
#include <memory>
-#include <util/generic/string.h>
#include <tuple>
#include <type_traits>
#include <utility>
+#include "y_absl/base/attributes.h"
#include "y_absl/base/config.h"
#include "y_absl/base/internal/endian.h"
#include "y_absl/base/internal/raw_logging.h"
+#include "y_absl/base/macros.h"
#include "y_absl/base/optimization.h"
+#include "y_absl/base/options.h"
#include "y_absl/base/port.h"
#include "y_absl/base/prefetch.h"
-#include "y_absl/container/internal/common.h"
+#include "y_absl/container/internal/common.h" // IWYU pragma: export // for node_handle
#include "y_absl/container/internal/compressed_tuple.h"
#include "y_absl/container/internal/container_memory.h"
#include "y_absl/container/internal/hash_policy_traits.h"
@@ -227,6 +234,7 @@ namespace container_internal {
#ifdef Y_ABSL_SWISSTABLE_ENABLE_GENERATIONS
#error Y_ABSL_SWISSTABLE_ENABLE_GENERATIONS cannot be directly set
#elif defined(Y_ABSL_HAVE_ADDRESS_SANITIZER) || \
+ defined(Y_ABSL_HAVE_HWADDRESS_SANITIZER) || \
defined(Y_ABSL_HAVE_MEMORY_SANITIZER)
// When compiled in sanitizer mode, we add generation integers to the backing
// array and iterators. In the backing array, we store the generation between
@@ -262,8 +270,21 @@ void SwapAlloc(AllocType& lhs, AllocType& rhs,
swap(lhs, rhs);
}
template <typename AllocType>
-void SwapAlloc(AllocType& /*lhs*/, AllocType& /*rhs*/,
- std::false_type /* propagate_on_container_swap */) {}
+void SwapAlloc(AllocType& lhs, AllocType& rhs,
+ std::false_type /* propagate_on_container_swap */) {
+ (void)lhs;
+ (void)rhs;
+ assert(lhs == rhs &&
+ "It's UB to call swap with unequal non-propagating allocators.");
+}
+
+template <typename AllocType>
+void CopyAlloc(AllocType& lhs, AllocType& rhs,
+ std::true_type /* propagate_alloc */) {
+ lhs = rhs;
+}
+template <typename AllocType>
+void CopyAlloc(AllocType&, AllocType&, std::false_type /* propagate_alloc */) {}
// The state for a probe sequence.
//
@@ -361,7 +382,7 @@ uint32_t TrailingZeros(T x) {
// width of an abstract bit in the representation.
// This mask provides operations for any number of real bits set in an abstract
// bit. To add iteration on top of that, implementation must guarantee no more
-// than one real bit is set in an abstract bit.
+// than the most significant real bit is set in a set abstract bit.
template <class T, int SignificantBits, int Shift = 0>
class NonIterableBitMask {
public:
@@ -388,7 +409,9 @@ class NonIterableBitMask {
uint32_t LeadingZeros() const {
constexpr int total_significant_bits = SignificantBits << Shift;
constexpr int extra_bits = sizeof(T) * 8 - total_significant_bits;
- return static_cast<uint32_t>(countl_zero(mask_ << extra_bits)) >> Shift;
+ return static_cast<uint32_t>(
+ countl_zero(static_cast<T>(mask_ << extra_bits))) >>
+ Shift;
}
T mask_;
@@ -418,6 +441,10 @@ class BitMask : public NonIterableBitMask<T, SignificantBits, Shift> {
using const_iterator = BitMask;
BitMask& operator++() {
+ if (Shift == 3) {
+ constexpr uint64_t msbs = 0x8080808080808080ULL;
+ this->mask_ &= msbs;
+ }
this->mask_ &= (this->mask_ - 1);
return *this;
}
@@ -590,29 +617,39 @@ struct GroupSse2Impl {
}
// Returns a bitmask representing the positions of slots that match hash.
- BitMask<uint32_t, kWidth> Match(h2_t hash) const {
+ BitMask<uint16_t, kWidth> Match(h2_t hash) const {
auto match = _mm_set1_epi8(static_cast<char>(hash));
- return BitMask<uint32_t, kWidth>(
- static_cast<uint32_t>(_mm_movemask_epi8(_mm_cmpeq_epi8(match, ctrl))));
+ BitMask<uint16_t, kWidth> result = BitMask<uint16_t, kWidth>(0);
+ result = BitMask<uint16_t, kWidth>(
+ static_cast<uint16_t>(_mm_movemask_epi8(_mm_cmpeq_epi8(match, ctrl))));
+ return result;
}
// Returns a bitmask representing the positions of empty slots.
- NonIterableBitMask<uint32_t, kWidth> MaskEmpty() const {
+ NonIterableBitMask<uint16_t, kWidth> MaskEmpty() const {
#ifdef Y_ABSL_INTERNAL_HAVE_SSSE3
// This only works because ctrl_t::kEmpty is -128.
- return NonIterableBitMask<uint32_t, kWidth>(
- static_cast<uint32_t>(_mm_movemask_epi8(_mm_sign_epi8(ctrl, ctrl))));
+ return NonIterableBitMask<uint16_t, kWidth>(
+ static_cast<uint16_t>(_mm_movemask_epi8(_mm_sign_epi8(ctrl, ctrl))));
#else
auto match = _mm_set1_epi8(static_cast<char>(ctrl_t::kEmpty));
- return NonIterableBitMask<uint32_t, kWidth>(
- static_cast<uint32_t>(_mm_movemask_epi8(_mm_cmpeq_epi8(match, ctrl))));
+ return NonIterableBitMask<uint16_t, kWidth>(
+ static_cast<uint16_t>(_mm_movemask_epi8(_mm_cmpeq_epi8(match, ctrl))));
#endif
}
+ // Returns a bitmask representing the positions of full slots.
+ // Note: for `is_small()` tables group may contain the "same" slot twice:
+ // original and mirrored.
+ BitMask<uint16_t, kWidth> MaskFull() const {
+ return BitMask<uint16_t, kWidth>(
+ static_cast<uint16_t>(_mm_movemask_epi8(ctrl) ^ 0xffff));
+ }
+
// Returns a bitmask representing the positions of empty or deleted slots.
- NonIterableBitMask<uint32_t, kWidth> MaskEmptyOrDeleted() const {
+ NonIterableBitMask<uint16_t, kWidth> MaskEmptyOrDeleted() const {
auto special = _mm_set1_epi8(static_cast<char>(ctrl_t::kSentinel));
- return NonIterableBitMask<uint32_t, kWidth>(static_cast<uint32_t>(
+ return NonIterableBitMask<uint16_t, kWidth>(static_cast<uint16_t>(
_mm_movemask_epi8(_mm_cmpgt_epi8_fixed(special, ctrl))));
}
@@ -651,9 +688,8 @@ struct GroupAArch64Impl {
BitMask<uint64_t, kWidth, 3> Match(h2_t hash) const {
uint8x8_t dup = vdup_n_u8(hash);
auto mask = vceq_u8(ctrl, dup);
- constexpr uint64_t msbs = 0x8080808080808080ULL;
return BitMask<uint64_t, kWidth, 3>(
- vget_lane_u64(vreinterpret_u64_u8(mask), 0) & msbs);
+ vget_lane_u64(vreinterpret_u64_u8(mask), 0));
}
NonIterableBitMask<uint64_t, kWidth, 3> MaskEmpty() const {
@@ -665,6 +701,17 @@ struct GroupAArch64Impl {
return NonIterableBitMask<uint64_t, kWidth, 3>(mask);
}
+ // Returns a bitmask representing the positions of full slots.
+ // Note: for `is_small()` tables group may contain the "same" slot twice:
+ // original and mirrored.
+ BitMask<uint64_t, kWidth, 3> MaskFull() const {
+ uint64_t mask = vget_lane_u64(
+ vreinterpret_u64_u8(vcge_s8(vreinterpret_s8_u8(ctrl),
+ vdup_n_s8(static_cast<int8_t>(0)))),
+ 0);
+ return BitMask<uint64_t, kWidth, 3>(mask);
+ }
+
NonIterableBitMask<uint64_t, kWidth, 3> MaskEmptyOrDeleted() const {
uint64_t mask =
vget_lane_u64(vreinterpret_u64_u8(vcgt_s8(
@@ -729,13 +776,21 @@ struct GroupPortableImpl {
NonIterableBitMask<uint64_t, kWidth, 3> MaskEmpty() const {
constexpr uint64_t msbs = 0x8080808080808080ULL;
- return NonIterableBitMask<uint64_t, kWidth, 3>((ctrl & (~ctrl << 6)) &
+ return NonIterableBitMask<uint64_t, kWidth, 3>((ctrl & ~(ctrl << 6)) &
msbs);
}
+ // Returns a bitmask representing the positions of full slots.
+ // Note: for `is_small()` tables group may contain the "same" slot twice:
+ // original and mirrored.
+ BitMask<uint64_t, kWidth, 3> MaskFull() const {
+ constexpr uint64_t msbs = 0x8080808080808080ULL;
+ return BitMask<uint64_t, kWidth, 3>((ctrl ^ msbs) & msbs);
+ }
+
NonIterableBitMask<uint64_t, kWidth, 3> MaskEmptyOrDeleted() const {
constexpr uint64_t msbs = 0x8080808080808080ULL;
- return NonIterableBitMask<uint64_t, kWidth, 3>((ctrl & (~ctrl << 7)) &
+ return NonIterableBitMask<uint64_t, kWidth, 3>((ctrl & ~(ctrl << 7)) &
msbs);
}
@@ -760,10 +815,21 @@ struct GroupPortableImpl {
#ifdef Y_ABSL_INTERNAL_HAVE_SSE2
using Group = GroupSse2Impl;
+using GroupEmptyOrDeleted = GroupSse2Impl;
#elif defined(Y_ABSL_INTERNAL_HAVE_ARM_NEON) && defined(Y_ABSL_IS_LITTLE_ENDIAN)
using Group = GroupAArch64Impl;
+// For Aarch64, we use the portable implementation for counting and masking
+// empty or deleted group elements. This is to avoid the latency of moving
+// between data GPRs and Neon registers when it does not provide a benefit.
+// Using Neon is profitable when we call Match(), but is not when we don't,
+// which is the case when we do *EmptyOrDeleted operations. It is difficult to
+// make a similar approach beneficial on other architectures such as x86 since
+// they have much lower GPR <-> vector register transfer latency and 16-wide
+// Groups.
+using GroupEmptyOrDeleted = GroupPortableImpl;
#else
using Group = GroupPortableImpl;
+using GroupEmptyOrDeleted = GroupPortableImpl;
#endif
// When there is an insertion with no reserved growth, we rehash with
@@ -802,15 +868,19 @@ class CommonFieldsGenerationInfoEnabled {
// whenever reserved_growth_ is zero.
bool should_rehash_for_bug_detection_on_insert(const ctrl_t* ctrl,
size_t capacity) const;
+ // Similar to above, except that we don't depend on reserved_growth_.
+ bool should_rehash_for_bug_detection_on_move(const ctrl_t* ctrl,
+ size_t capacity) const;
void maybe_increment_generation_on_insert() {
if (reserved_growth_ == kReservedGrowthJustRanOut) reserved_growth_ = 0;
if (reserved_growth_ > 0) {
if (--reserved_growth_ == 0) reserved_growth_ = kReservedGrowthJustRanOut;
} else {
- *generation_ = NextGeneration(*generation_);
+ increment_generation();
}
}
+ void increment_generation() { *generation_ = NextGeneration(*generation_); }
void reset_reserved_growth(size_t reservation, size_t size) {
reserved_growth_ = reservation - size;
}
@@ -856,7 +926,11 @@ class CommonFieldsGenerationInfoDisabled {
bool should_rehash_for_bug_detection_on_insert(const ctrl_t*, size_t) const {
return false;
}
+ bool should_rehash_for_bug_detection_on_move(const ctrl_t*, size_t) const {
+ return false;
+ }
void maybe_increment_generation_on_insert() {}
+ void increment_generation() {}
void reset_reserved_growth(size_t, size_t) {}
size_t reserved_growth() const { return 0; }
void set_reserved_growth(size_t) {}
@@ -909,9 +983,11 @@ using HashSetIteratorGenerationInfo = HashSetIteratorGenerationInfoDisabled;
// A valid capacity is a non-zero integer `2^m - 1`.
inline bool IsValidCapacity(size_t n) { return ((n + 1) & n) == 0 && n > 0; }
-// Computes the offset from the start of the backing allocation of the control
-// bytes. growth_left is stored at the beginning of the backing array.
-inline size_t ControlOffset() { return sizeof(size_t); }
+// Computes the offset from the start of the backing allocation of control.
+// infoz and growth_left are stored at the beginning of the backing array.
+inline size_t ControlOffset(bool has_infoz) {
+ return (has_infoz ? sizeof(HashtablezInfoHandle) : 0) + sizeof(size_t);
+}
// Returns the number of "cloned control bytes".
//
@@ -922,24 +998,26 @@ constexpr size_t NumClonedBytes() { return Group::kWidth - 1; }
// Given the capacity of a table, computes the offset (from the start of the
// backing allocation) of the generation counter (if it exists).
-inline size_t GenerationOffset(size_t capacity) {
+inline size_t GenerationOffset(size_t capacity, bool has_infoz) {
assert(IsValidCapacity(capacity));
const size_t num_control_bytes = capacity + 1 + NumClonedBytes();
- return ControlOffset() + num_control_bytes;
+ return ControlOffset(has_infoz) + num_control_bytes;
}
// Given the capacity of a table, computes the offset (from the start of the
// backing allocation) at which the slots begin.
-inline size_t SlotOffset(size_t capacity, size_t slot_align) {
+inline size_t SlotOffset(size_t capacity, size_t slot_align, bool has_infoz) {
assert(IsValidCapacity(capacity));
- return (GenerationOffset(capacity) + NumGenerationBytes() + slot_align - 1) &
+ return (GenerationOffset(capacity, has_infoz) + NumGenerationBytes() +
+ slot_align - 1) &
(~slot_align + 1);
}
// Given the capacity of a table, computes the total size of the backing
// array.
-inline size_t AllocSize(size_t capacity, size_t slot_size, size_t slot_align) {
- return SlotOffset(capacity, slot_align) + capacity * slot_size;
+inline size_t AllocSize(size_t capacity, size_t slot_size, size_t slot_align,
+ bool has_infoz) {
+ return SlotOffset(capacity, slot_align, has_infoz) + capacity * slot_size;
}
// CommonFields hold the fields in raw_hash_set that do not depend
@@ -954,28 +1032,15 @@ class CommonFields : public CommonFieldsGenerationInfo {
CommonFields& operator=(const CommonFields&) = delete;
// Movable
- CommonFields(CommonFields&& that)
- : CommonFieldsGenerationInfo(
- std::move(static_cast<CommonFieldsGenerationInfo&&>(that))),
- // Explicitly copying fields into "this" and then resetting "that"
- // fields generates less code then calling y_absl::exchange per field.
- control_(that.control()),
- slots_(that.slot_array()),
- capacity_(that.capacity()),
- compressed_tuple_(that.size(), std::move(that.infoz())) {
- that.set_control(EmptyGroup());
- that.set_slots(nullptr);
- that.set_capacity(0);
- that.set_size(0);
- }
+ CommonFields(CommonFields&& that) = default;
CommonFields& operator=(CommonFields&&) = default;
ctrl_t* control() const { return control_; }
void set_control(ctrl_t* c) { control_ = c; }
void* backing_array_start() const {
- // growth_left is stored before control bytes.
+ // growth_left (and maybe infoz) is stored before control bytes.
assert(reinterpret_cast<uintptr_t>(control()) % alignof(size_t) == 0);
- return control() - sizeof(size_t);
+ return control() - ControlOffset(has_infoz());
}
// Note: we can't use slots() because Qt defines "slots" as a macro.
@@ -983,8 +1048,18 @@ class CommonFields : public CommonFieldsGenerationInfo {
void set_slots(void* s) { slots_ = s; }
// The number of filled slots.
- size_t size() const { return compressed_tuple_.template get<0>(); }
- void set_size(size_t s) { compressed_tuple_.template get<0>() = s; }
+ size_t size() const { return size_ >> HasInfozShift(); }
+ void set_size(size_t s) {
+ size_ = (s << HasInfozShift()) | (size_ & HasInfozMask());
+ }
+ void increment_size() {
+ assert(size() < capacity());
+ size_ += size_t{1} << HasInfozShift();
+ }
+ void decrement_size() {
+ assert(size() > 0);
+ size_ -= size_t{1} << HasInfozShift();
+ }
// The total number of available slots.
size_t capacity() const { return capacity_; }
@@ -996,28 +1071,52 @@ class CommonFields : public CommonFieldsGenerationInfo {
// The number of slots we can still fill without needing to rehash.
// This is stored in the heap allocation before the control bytes.
size_t growth_left() const {
- return *reinterpret_cast<size_t*>(backing_array_start());
+ const size_t* gl_ptr = reinterpret_cast<size_t*>(control()) - 1;
+ assert(reinterpret_cast<uintptr_t>(gl_ptr) % alignof(size_t) == 0);
+ return *gl_ptr;
}
void set_growth_left(size_t gl) {
- *reinterpret_cast<size_t*>(backing_array_start()) = gl;
+ size_t* gl_ptr = reinterpret_cast<size_t*>(control()) - 1;
+ assert(reinterpret_cast<uintptr_t>(gl_ptr) % alignof(size_t) == 0);
+ *gl_ptr = gl;
}
- HashtablezInfoHandle& infoz() { return compressed_tuple_.template get<1>(); }
- const HashtablezInfoHandle& infoz() const {
- return compressed_tuple_.template get<1>();
+ bool has_infoz() const {
+ return Y_ABSL_PREDICT_FALSE((size_ & HasInfozMask()) != 0);
+ }
+ void set_has_infoz(bool has_infoz) {
+ size_ = (size() << HasInfozShift()) | static_cast<size_t>(has_infoz);
+ }
+
+ HashtablezInfoHandle infoz() {
+ return has_infoz()
+ ? *reinterpret_cast<HashtablezInfoHandle*>(backing_array_start())
+ : HashtablezInfoHandle();
+ }
+ void set_infoz(HashtablezInfoHandle infoz) {
+ assert(has_infoz());
+ *reinterpret_cast<HashtablezInfoHandle*>(backing_array_start()) = infoz;
}
bool should_rehash_for_bug_detection_on_insert() const {
return CommonFieldsGenerationInfo::
should_rehash_for_bug_detection_on_insert(control(), capacity());
}
+ bool should_rehash_for_bug_detection_on_move() const {
+ return CommonFieldsGenerationInfo::
+ should_rehash_for_bug_detection_on_move(control(), capacity());
+ }
+ void maybe_increment_generation_on_move() {
+ if (capacity() == 0) return;
+ increment_generation();
+ }
void reset_reserved_growth(size_t reservation) {
CommonFieldsGenerationInfo::reset_reserved_growth(reservation, size());
}
// The size of the backing array allocation.
size_t alloc_size(size_t slot_size, size_t slot_align) const {
- return AllocSize(capacity(), slot_size, slot_align);
+ return AllocSize(capacity(), slot_size, slot_align, has_infoz());
}
// Returns the number of control bytes set to kDeleted. For testing only.
@@ -1027,9 +1126,14 @@ class CommonFields : public CommonFieldsGenerationInfo {
}
private:
- // TODO(b/259599413): Investigate removing some of these fields:
+ // We store the has_infoz bit in the lowest bit of size_.
+ static constexpr size_t HasInfozShift() { return 1; }
+ static constexpr size_t HasInfozMask() {
+ return (size_t{1} << HasInfozShift()) - 1;
+ }
+
+ // TODO(b/182800944): Investigate removing some of these fields:
// - control/slots can be derived from each other
- // - we can use 6 bits for capacity since it's always a power of two minus 1
// The control bytes (and, also, a pointer near to the base of the backing
// array).
@@ -1044,12 +1148,16 @@ class CommonFields : public CommonFieldsGenerationInfo {
// `control`. May be null for empty tables.
void* slots_ = nullptr;
+ // The number of slots in the backing array. This is always 2^N-1 for an
+ // integer N. NOTE: we tried experimenting with compressing the capacity and
+ // storing it together with size_: (a) using 6 bits to store the corresponding
+ // power (N in 2^N-1), and (b) storing 2^N as the most significant bit of
+ // size_ and storing size in the low bits. Both of these experiments were
+ // regressions, presumably because we need capacity to do find operations.
size_t capacity_ = 0;
- // Bundle together size and HashtablezInfoHandle to ensure EBO for
- // HashtablezInfoHandle when sampling is turned off.
- y_absl::container_internal::CompressedTuple<size_t, HashtablezInfoHandle>
- compressed_tuple_{0u, HashtablezInfoHandle{}};
+ // The size and also has one bit that stores whether we have infoz.
+ size_t size_ = 0;
};
template <class Policy, class Hash, class Eq, class Alloc>
@@ -1139,35 +1247,39 @@ inline void AssertIsFull(const ctrl_t* ctrl, GenerationType generation,
const GenerationType* generation_ptr,
const char* operation) {
if (!SwisstableDebugEnabled()) return;
- if (ctrl == nullptr) {
- Y_ABSL_INTERNAL_LOG(FATAL,
- TString(operation) + " called on end() iterator.");
- }
- if (ctrl == EmptyGroup()) {
- Y_ABSL_INTERNAL_LOG(FATAL, TString(operation) +
- " called on default-constructed iterator.");
+ // `SwisstableDebugEnabled()` is also true for release builds with hardening
+ // enabled. To minimize their impact in those builds:
+ // - use `Y_ABSL_PREDICT_FALSE()` to provide a compiler hint for code layout
+ // - use `Y_ABSL_RAW_LOG()` with a format string to reduce code size and improve
+ // the chances that the hot paths will be inlined.
+ if (Y_ABSL_PREDICT_FALSE(ctrl == nullptr)) {
+ Y_ABSL_RAW_LOG(FATAL, "%s called on end() iterator.", operation);
+ }
+ if (Y_ABSL_PREDICT_FALSE(ctrl == EmptyGroup())) {
+ Y_ABSL_RAW_LOG(FATAL, "%s called on default-constructed iterator.",
+ operation);
}
if (SwisstableGenerationsEnabled()) {
- if (generation != *generation_ptr) {
- Y_ABSL_INTERNAL_LOG(FATAL,
- TString(operation) +
- " called on invalid iterator. The table could have "
- "rehashed since this iterator was initialized.");
+ if (Y_ABSL_PREDICT_FALSE(generation != *generation_ptr)) {
+ Y_ABSL_RAW_LOG(FATAL,
+ "%s called on invalid iterator. The table could have "
+ "rehashed or moved since this iterator was initialized.",
+ operation);
}
- if (!IsFull(*ctrl)) {
- Y_ABSL_INTERNAL_LOG(
+ if (Y_ABSL_PREDICT_FALSE(!IsFull(*ctrl))) {
+ Y_ABSL_RAW_LOG(
FATAL,
- TString(operation) +
- " called on invalid iterator. The element was likely erased.");
+ "%s called on invalid iterator. The element was likely erased.",
+ operation);
}
} else {
- if (!IsFull(*ctrl)) {
- Y_ABSL_INTERNAL_LOG(
+ if (Y_ABSL_PREDICT_FALSE(!IsFull(*ctrl))) {
+ Y_ABSL_RAW_LOG(
FATAL,
- TString(operation) +
- " called on invalid iterator. The element might have been erased "
- "or the table might have rehashed. Consider running with "
- "--config=asan to diagnose rehashing issues.");
+ "%s called on invalid iterator. The element might have been erased "
+ "or the table might have rehashed. Consider running with "
+ "--config=asan to diagnose rehashing issues.",
+ operation);
}
}
}
@@ -1180,13 +1292,13 @@ inline void AssertIsValidForComparison(const ctrl_t* ctrl,
const bool ctrl_is_valid_for_comparison =
ctrl == nullptr || ctrl == EmptyGroup() || IsFull(*ctrl);
if (SwisstableGenerationsEnabled()) {
- if (generation != *generation_ptr) {
- Y_ABSL_INTERNAL_LOG(FATAL,
- "Invalid iterator comparison. The table could have "
- "rehashed since this iterator was initialized.");
+ if (Y_ABSL_PREDICT_FALSE(generation != *generation_ptr)) {
+ Y_ABSL_RAW_LOG(FATAL,
+ "Invalid iterator comparison. The table could have rehashed "
+ "or moved since this iterator was initialized.");
}
- if (!ctrl_is_valid_for_comparison) {
- Y_ABSL_INTERNAL_LOG(
+ if (Y_ABSL_PREDICT_FALSE(!ctrl_is_valid_for_comparison)) {
+ Y_ABSL_RAW_LOG(
FATAL, "Invalid iterator comparison. The element was likely erased.");
}
} else {
@@ -1226,10 +1338,15 @@ inline void AssertSameContainer(const ctrl_t* ctrl_a, const ctrl_t* ctrl_b,
const GenerationType* generation_ptr_a,
const GenerationType* generation_ptr_b) {
if (!SwisstableDebugEnabled()) return;
+ // `SwisstableDebugEnabled()` is also true for release builds with hardening
+ // enabled. To minimize their impact in those builds:
+ // - use `Y_ABSL_PREDICT_FALSE()` to provide a compiler hint for code layout
+ // - use `Y_ABSL_RAW_LOG()` with a format string to reduce code size and improve
+ // the chances that the hot paths will be inlined.
const bool a_is_default = ctrl_a == EmptyGroup();
const bool b_is_default = ctrl_b == EmptyGroup();
- if (a_is_default != b_is_default) {
- Y_ABSL_INTERNAL_LOG(
+ if (Y_ABSL_PREDICT_FALSE(a_is_default != b_is_default)) {
+ Y_ABSL_RAW_LOG(
FATAL,
"Invalid iterator comparison. Comparing default-constructed iterator "
"with non-default-constructed iterator.");
@@ -1237,36 +1354,36 @@ inline void AssertSameContainer(const ctrl_t* ctrl_a, const ctrl_t* ctrl_b,
if (a_is_default && b_is_default) return;
if (SwisstableGenerationsEnabled()) {
- if (generation_ptr_a == generation_ptr_b) return;
+ if (Y_ABSL_PREDICT_TRUE(generation_ptr_a == generation_ptr_b)) return;
const bool a_is_empty = IsEmptyGeneration(generation_ptr_a);
const bool b_is_empty = IsEmptyGeneration(generation_ptr_b);
if (a_is_empty != b_is_empty) {
- Y_ABSL_INTERNAL_LOG(FATAL,
- "Invalid iterator comparison. Comparing iterator from "
- "a non-empty hashtable with an iterator from an empty "
- "hashtable.");
+ Y_ABSL_RAW_LOG(FATAL,
+ "Invalid iterator comparison. Comparing iterator from a "
+ "non-empty hashtable with an iterator from an empty "
+ "hashtable.");
}
if (a_is_empty && b_is_empty) {
- Y_ABSL_INTERNAL_LOG(FATAL,
- "Invalid iterator comparison. Comparing iterators from "
- "different empty hashtables.");
+ Y_ABSL_RAW_LOG(FATAL,
+ "Invalid iterator comparison. Comparing iterators from "
+ "different empty hashtables.");
}
const bool a_is_end = ctrl_a == nullptr;
const bool b_is_end = ctrl_b == nullptr;
if (a_is_end || b_is_end) {
- Y_ABSL_INTERNAL_LOG(FATAL,
- "Invalid iterator comparison. Comparing iterator with "
- "an end() iterator from a different hashtable.");
+ Y_ABSL_RAW_LOG(FATAL,
+ "Invalid iterator comparison. Comparing iterator with an "
+ "end() iterator from a different hashtable.");
}
- Y_ABSL_INTERNAL_LOG(FATAL,
- "Invalid iterator comparison. Comparing non-end() "
- "iterators from different hashtables.");
+ Y_ABSL_RAW_LOG(FATAL,
+ "Invalid iterator comparison. Comparing non-end() iterators "
+ "from different hashtables.");
} else {
Y_ABSL_HARDENING_ASSERT(
AreItersFromSameContainer(ctrl_a, ctrl_b, slot_a, slot_b) &&
"Invalid iterator comparison. The iterators may be from different "
- "containers or the container might have rehashed. Consider running "
- "with --config=asan to diagnose rehashing issues.");
+ "containers or the container might have rehashed or moved. Consider "
+ "running with --config=asan to diagnose issues.");
}
}
@@ -1289,6 +1406,12 @@ struct FindInfo {
// `ShouldInsertBackwards()` for small tables.
inline bool is_small(size_t capacity) { return capacity < Group::kWidth - 1; }
+// Whether a table fits entirely into a probing group.
+// Arbitrary order of elements in such tables is correct.
+inline bool is_single_group(size_t capacity) {
+ return capacity <= Group::kWidth;
+}
+
// Begins a probing operation on `common.control`, using `hash`.
inline probe_seq<Group::kWidth> probe(const ctrl_t* ctrl, const size_t capacity,
size_t hash) {
@@ -1310,7 +1433,7 @@ inline FindInfo find_first_non_full(const CommonFields& common, size_t hash) {
auto seq = probe(common, hash);
const ctrl_t* ctrl = common.control();
while (true) {
- Group g{ctrl + seq.offset()};
+ GroupEmptyOrDeleted g{ctrl + seq.offset()};
auto mask = g.MaskEmptyOrDeleted();
if (mask) {
#if !defined(NDEBUG)
@@ -1351,7 +1474,6 @@ inline void ResetCtrl(CommonFields& common, size_t slot_size) {
capacity + 1 + NumClonedBytes());
ctrl[capacity] = ctrl_t::kSentinel;
SanitizerPoisonMemoryRegion(common.slot_array(), slot_size * capacity);
- ResetGrowthLeft(common);
}
// Sets `ctrl[i]` to `h`.
@@ -1386,38 +1508,263 @@ constexpr size_t BackingArrayAlignment(size_t align_of_slot) {
return (std::max)(align_of_slot, alignof(size_t));
}
-template <typename Alloc, size_t SizeOfSlot, size_t AlignOfSlot>
-Y_ABSL_ATTRIBUTE_NOINLINE void InitializeSlots(CommonFields& c, Alloc alloc) {
- assert(c.capacity());
- // Folks with custom allocators often make unwarranted assumptions about the
- // behavior of their classes vis-a-vis trivial destructability and what
- // calls they will or won't make. Avoid sampling for people with custom
- // allocators to get us out of this mess. This is not a hard guarantee but
- // a workaround while we plan the exact guarantee we want to provide.
- const size_t sample_size =
- (std::is_same<Alloc, std::allocator<char>>::value &&
- c.slot_array() == nullptr)
- ? SizeOfSlot
- : 0;
-
- const size_t cap = c.capacity();
- const size_t alloc_size = AllocSize(cap, SizeOfSlot, AlignOfSlot);
- // growth_left (which is a size_t) is stored with the backing array.
- char* mem = static_cast<char*>(
- Allocate<BackingArrayAlignment(AlignOfSlot)>(&alloc, alloc_size));
- const GenerationType old_generation = c.generation();
- c.set_generation_ptr(
- reinterpret_cast<GenerationType*>(mem + GenerationOffset(cap)));
- c.set_generation(NextGeneration(old_generation));
- c.set_control(reinterpret_cast<ctrl_t*>(mem + ControlOffset()));
- c.set_slots(mem + SlotOffset(cap, AlignOfSlot));
- ResetCtrl(c, SizeOfSlot);
- if (sample_size) {
- c.infoz() = Sample(sample_size);
- }
- c.infoz().RecordStorageChanged(c.size(), cap);
+// Returns the address of the ith slot in slots where each slot occupies
+// slot_size.
+inline void* SlotAddress(void* slot_array, size_t slot, size_t slot_size) {
+ return reinterpret_cast<void*>(reinterpret_cast<char*>(slot_array) +
+ (slot * slot_size));
}
+// Helper class to perform resize of the hash set.
+//
+// It contains special optimizations for small group resizes.
+// See GrowIntoSingleGroupShuffleControlBytes for details.
+class HashSetResizeHelper {
+ public:
+ explicit HashSetResizeHelper(CommonFields& c)
+ : old_ctrl_(c.control()),
+ old_capacity_(c.capacity()),
+ had_infoz_(c.has_infoz()) {}
+
+ // Optimized for small groups version of `find_first_non_full` applicable
+ // only right after calling `raw_hash_set::resize`.
+ // It has implicit assumption that `resize` will call
+ // `GrowSizeIntoSingleGroup*` in case `IsGrowingIntoSingleGroupApplicable`.
+ // Falls back to `find_first_non_full` in case of big groups, so it is
+ // safe to use after `rehash_and_grow_if_necessary`.
+ static FindInfo FindFirstNonFullAfterResize(const CommonFields& c,
+ size_t old_capacity,
+ size_t hash) {
+ if (!IsGrowingIntoSingleGroupApplicable(old_capacity, c.capacity())) {
+ return find_first_non_full(c, hash);
+ }
+ // Find a location for the new element non-deterministically.
+ // Note that any position is correct.
+ // It will located at `half_old_capacity` or one of the other
+ // empty slots with approximately 50% probability each.
+ size_t offset = probe(c, hash).offset();
+
+ // Note that we intentionally use unsigned int underflow.
+ if (offset - (old_capacity + 1) >= old_capacity) {
+ // Offset fall on kSentinel or into the mostly occupied first half.
+ offset = old_capacity / 2;
+ }
+ assert(IsEmpty(c.control()[offset]));
+ return FindInfo{offset, 0};
+ }
+
+ ctrl_t* old_ctrl() const { return old_ctrl_; }
+ size_t old_capacity() const { return old_capacity_; }
+
+ // Allocates a backing array for the hashtable.
+ // Reads `capacity` and updates all other fields based on the result of
+ // the allocation.
+ //
+ // It also may do the folowing actions:
+ // 1. initialize control bytes
+ // 2. initialize slots
+ // 3. deallocate old slots.
+ //
+ // We are bundling a lot of functionality
+ // in one Y_ABSL_ATTRIBUTE_NOINLINE function in order to minimize binary code
+ // duplication in raw_hash_set<>::resize.
+ //
+ // `c.capacity()` must be nonzero.
+ // POSTCONDITIONS:
+ // 1. CommonFields is initialized.
+ //
+ // if IsGrowingIntoSingleGroupApplicable && TransferUsesMemcpy
+ // Both control bytes and slots are fully initialized.
+ // old_slots are deallocated.
+ // infoz.RecordRehash is called.
+ //
+ // if IsGrowingIntoSingleGroupApplicable && !TransferUsesMemcpy
+ // Control bytes are fully initialized.
+ // infoz.RecordRehash is called.
+ // GrowSizeIntoSingleGroup must be called to finish slots initialization.
+ //
+ // if !IsGrowingIntoSingleGroupApplicable
+ // Control bytes are initialized to empty table via ResetCtrl.
+ // raw_hash_set<>::resize must insert elements regularly.
+ // infoz.RecordRehash is called if old_capacity == 0.
+ //
+ // Returns IsGrowingIntoSingleGroupApplicable result to avoid recomputation.
+ template <typename Alloc, size_t SizeOfSlot, bool TransferUsesMemcpy,
+ size_t AlignOfSlot>
+ Y_ABSL_ATTRIBUTE_NOINLINE bool InitializeSlots(CommonFields& c, void* old_slots,
+ Alloc alloc) {
+ assert(c.capacity());
+ // Folks with custom allocators often make unwarranted assumptions about the
+ // behavior of their classes vis-a-vis trivial destructability and what
+ // calls they will or won't make. Avoid sampling for people with custom
+ // allocators to get us out of this mess. This is not a hard guarantee but
+ // a workaround while we plan the exact guarantee we want to provide.
+ const size_t sample_size =
+ (std::is_same<Alloc, std::allocator<char>>::value &&
+ c.slot_array() == nullptr)
+ ? SizeOfSlot
+ : 0;
+ HashtablezInfoHandle infoz =
+ sample_size > 0 ? Sample(sample_size) : c.infoz();
+
+ const bool has_infoz = infoz.IsSampled();
+ const size_t cap = c.capacity();
+ const size_t alloc_size =
+ AllocSize(cap, SizeOfSlot, AlignOfSlot, has_infoz);
+ char* mem = static_cast<char*>(
+ Allocate<BackingArrayAlignment(AlignOfSlot)>(&alloc, alloc_size));
+ const GenerationType old_generation = c.generation();
+ c.set_generation_ptr(reinterpret_cast<GenerationType*>(
+ mem + GenerationOffset(cap, has_infoz)));
+ c.set_generation(NextGeneration(old_generation));
+ c.set_control(reinterpret_cast<ctrl_t*>(mem + ControlOffset(has_infoz)));
+ c.set_slots(mem + SlotOffset(cap, AlignOfSlot, has_infoz));
+ ResetGrowthLeft(c);
+
+ const bool grow_single_group =
+ IsGrowingIntoSingleGroupApplicable(old_capacity_, c.capacity());
+ if (old_capacity_ != 0 && grow_single_group) {
+ if (TransferUsesMemcpy) {
+ GrowSizeIntoSingleGroupTransferable(c, old_slots, SizeOfSlot);
+ DeallocateOld<AlignOfSlot>(alloc, SizeOfSlot, old_slots);
+ } else {
+ GrowIntoSingleGroupShuffleControlBytes(c.control(), c.capacity());
+ }
+ } else {
+ ResetCtrl(c, SizeOfSlot);
+ }
+
+ c.set_has_infoz(has_infoz);
+ if (has_infoz) {
+ infoz.RecordStorageChanged(c.size(), cap);
+ if (grow_single_group || old_capacity_ == 0) {
+ infoz.RecordRehash(0);
+ }
+ c.set_infoz(infoz);
+ }
+ return grow_single_group;
+ }
+
+ // Relocates slots into new single group consistent with
+ // GrowIntoSingleGroupShuffleControlBytes.
+ //
+ // PRECONDITIONS:
+ // 1. GrowIntoSingleGroupShuffleControlBytes was already called.
+ template <class PolicyTraits, class Alloc>
+ void GrowSizeIntoSingleGroup(CommonFields& c, Alloc& alloc_ref,
+ typename PolicyTraits::slot_type* old_slots) {
+ assert(old_capacity_ < Group::kWidth / 2);
+ assert(IsGrowingIntoSingleGroupApplicable(old_capacity_, c.capacity()));
+ using slot_type = typename PolicyTraits::slot_type;
+ assert(is_single_group(c.capacity()));
+
+ auto* new_slots = reinterpret_cast<slot_type*>(c.slot_array());
+
+ size_t shuffle_bit = old_capacity_ / 2 + 1;
+ for (size_t i = 0; i < old_capacity_; ++i) {
+ if (IsFull(old_ctrl_[i])) {
+ size_t new_i = i ^ shuffle_bit;
+ SanitizerUnpoisonMemoryRegion(new_slots + new_i, sizeof(slot_type));
+ PolicyTraits::transfer(&alloc_ref, new_slots + new_i, old_slots + i);
+ }
+ }
+ PoisonSingleGroupEmptySlots(c, sizeof(slot_type));
+ }
+
+ // Deallocates old backing array.
+ template <size_t AlignOfSlot, class CharAlloc>
+ void DeallocateOld(CharAlloc alloc_ref, size_t slot_size, void* old_slots) {
+ SanitizerUnpoisonMemoryRegion(old_slots, slot_size * old_capacity_);
+ Deallocate<BackingArrayAlignment(AlignOfSlot)>(
+ &alloc_ref, old_ctrl_ - ControlOffset(had_infoz_),
+ AllocSize(old_capacity_, slot_size, AlignOfSlot, had_infoz_));
+ }
+
+ private:
+ // Returns true if `GrowSizeIntoSingleGroup` can be used for resizing.
+ static bool IsGrowingIntoSingleGroupApplicable(size_t old_capacity,
+ size_t new_capacity) {
+ // NOTE that `old_capacity < new_capacity` in order to have
+ // `old_capacity < Group::kWidth / 2` to make faster copies of 8 bytes.
+ return is_single_group(new_capacity) && old_capacity < new_capacity;
+ }
+
+ // Relocates control bytes and slots into new single group for
+ // transferable objects.
+ // Must be called only if IsGrowingIntoSingleGroupApplicable returned true.
+ void GrowSizeIntoSingleGroupTransferable(CommonFields& c, void* old_slots,
+ size_t slot_size);
+
+ // Shuffle control bits deterministically to the next capacity.
+ // Returns offset for newly added element with given hash.
+ //
+ // PRECONDITIONs:
+ // 1. new_ctrl is allocated for new_capacity,
+ // but not initialized.
+ // 2. new_capacity is a single group.
+ //
+ // All elements are transferred into the first `old_capacity + 1` positions
+ // of the new_ctrl. Elements are rotated by `old_capacity_ / 2 + 1` positions
+ // in order to change an order and keep it non deterministic.
+ // Although rotation itself deterministic, position of the new added element
+ // will be based on `H1` and is not deterministic.
+ //
+ // Examples:
+ // S = kSentinel, E = kEmpty
+ //
+ // old_ctrl = SEEEEEEEE...
+ // new_ctrl = ESEEEEEEE...
+ //
+ // old_ctrl = 0SEEEEEEE...
+ // new_ctrl = E0ESE0EEE...
+ //
+ // old_ctrl = 012S012EEEEEEEEE...
+ // new_ctrl = 2E01EEES2E01EEE...
+ //
+ // old_ctrl = 0123456S0123456EEEEEEEEEEE...
+ // new_ctrl = 456E0123EEEEEES456E0123EEE...
+ void GrowIntoSingleGroupShuffleControlBytes(ctrl_t* new_ctrl,
+ size_t new_capacity) const;
+
+ // Shuffle trivially transferable slots in the way consistent with
+ // GrowIntoSingleGroupShuffleControlBytes.
+ //
+ // PRECONDITIONs:
+ // 1. old_capacity must be non-zero.
+ // 2. new_ctrl is fully initialized using
+ // GrowIntoSingleGroupShuffleControlBytes.
+ // 3. new_slots is allocated and *not* poisoned.
+ //
+ // POSTCONDITIONS:
+ // 1. new_slots are transferred from old_slots_ consistent with
+ // GrowIntoSingleGroupShuffleControlBytes.
+ // 2. Empty new_slots are *not* poisoned.
+ void GrowIntoSingleGroupShuffleTransferableSlots(void* old_slots,
+ void* new_slots,
+ size_t slot_size) const;
+
+ // Poison empty slots that were transferred using the deterministic algorithm
+ // described above.
+ // PRECONDITIONs:
+ // 1. new_ctrl is fully initialized using
+ // GrowIntoSingleGroupShuffleControlBytes.
+ // 2. new_slots is fully initialized consistent with
+ // GrowIntoSingleGroupShuffleControlBytes.
+ void PoisonSingleGroupEmptySlots(CommonFields& c, size_t slot_size) const {
+ // poison non full items
+ for (size_t i = 0; i < c.capacity(); ++i) {
+ if (!IsFull(c.control()[i])) {
+ SanitizerPoisonMemoryRegion(SlotAddress(c.slot_array(), i, slot_size),
+ slot_size);
+ }
+ }
+ }
+
+ ctrl_t* old_ctrl_;
+ size_t old_capacity_;
+ bool had_infoz_;
+};
+
// PolicyFunctions bundles together some information for a particular
// raw_hash_set<T, ...> instantiation. This information is passed to
// type-erased functions that want to do small amounts of type-specific
@@ -1442,7 +1789,7 @@ void ClearBackingArray(CommonFields& c, const PolicyFunctions& policy,
bool reuse);
// Type-erased version of raw_hash_set::erase_meta_only.
-void EraseMetaOnly(CommonFields& c, ctrl_t* it, size_t slot_size);
+void EraseMetaOnly(CommonFields& c, size_t index, size_t slot_size);
// Function to place in PolicyFunctions::dealloc for raw_hash_sets
// that are using std::allocator. This allows us to share the same
@@ -1456,6 +1803,7 @@ Y_ABSL_ATTRIBUTE_NOINLINE void DeallocateStandard(CommonFields& common,
policy.slot_size * common.capacity());
std::allocator<char> alloc;
+ common.infoz().Unregister();
Deallocate<BackingArrayAlignment(AlignOfSlot)>(
&alloc, common.backing_array_start(),
common.alloc_size(policy.slot_size, AlignOfSlot));
@@ -1534,6 +1882,11 @@ class raw_hash_set {
using AllocTraits = y_absl::allocator_traits<allocator_type>;
using SlotAlloc = typename y_absl::allocator_traits<
allocator_type>::template rebind_alloc<slot_type>;
+ // People are often sloppy with the exact type of their allocator (sometimes
+ // it has an extra const or is missing the pair, but rebinds made it work
+ // anyway).
+ using CharAlloc =
+ typename y_absl::allocator_traits<Alloc>::template rebind_alloc<char>;
using SlotAllocTraits = typename y_absl::allocator_traits<
allocator_type>::template rebind_traits<slot_type>;
@@ -1590,7 +1943,7 @@ class raw_hash_set {
// PRECONDITION: not an end() iterator.
reference operator*() const {
AssertIsFull(ctrl_, generation(), generation_ptr(), "operator*()");
- return PolicyTraits::element(slot_);
+ return unchecked_deref();
}
// PRECONDITION: not an end() iterator.
@@ -1645,13 +1998,17 @@ class raw_hash_set {
// If a sentinel is reached, we null `ctrl_` out instead.
void skip_empty_or_deleted() {
while (IsEmptyOrDeleted(*ctrl_)) {
- uint32_t shift = Group{ctrl_}.CountLeadingEmptyOrDeleted();
+ uint32_t shift =
+ GroupEmptyOrDeleted{ctrl_}.CountLeadingEmptyOrDeleted();
ctrl_ += shift;
slot_ += shift;
}
if (Y_ABSL_PREDICT_FALSE(*ctrl_ == ctrl_t::kSentinel)) ctrl_ = nullptr;
}
+ ctrl_t* control() const { return ctrl_; }
+ slot_type* slot() const { return slot_; }
+
// We use EmptyGroup() for default-constructed iterators so that they can
// be distinguished from end iterators, which have nullptr ctrl_.
ctrl_t* ctrl_ = EmptyGroup();
@@ -1660,10 +2017,23 @@ class raw_hash_set {
union {
slot_type* slot_;
};
+
+ // An equality check which skips ABSL Hardening iterator invalidation
+ // checks.
+ // Should be used when the lifetimes of the iterators are well-enough
+ // understood to prove that they cannot be invalid.
+ bool unchecked_equals(const iterator& b) { return ctrl_ == b.control(); }
+
+ // Dereferences the iterator without ABSL Hardening iterator invalidation
+ // checks.
+ reference unchecked_deref() const { return PolicyTraits::element(slot_); }
};
class const_iterator {
friend class raw_hash_set;
+ template <class Container, typename Enabler>
+ friend struct y_absl::container_internal::hashtable_debug_internal::
+ HashtableDebugAccess;
public:
using iterator_category = typename iterator::iterator_category;
@@ -1697,8 +2067,14 @@ class raw_hash_set {
const GenerationType* gen)
: inner_(const_cast<ctrl_t*>(ctrl), const_cast<slot_type*>(slot), gen) {
}
+ ctrl_t* control() const { return inner_.control(); }
+ slot_type* slot() const { return inner_.slot(); }
iterator inner_;
+
+ bool unchecked_equals(const const_iterator& b) {
+ return inner_.unchecked_equals(b.inner_);
+ }
};
using node_type = node_handle<Policy, hash_policy_traits<Policy>, Alloc>;
@@ -1717,8 +2093,7 @@ class raw_hash_set {
const allocator_type& alloc = allocator_type())
: settings_(CommonFields{}, hash, eq, alloc) {
if (bucket_count) {
- common().set_capacity(NormalizeCapacity(bucket_count));
- initialize_slots();
+ resize(NormalizeCapacity(bucket_count));
}
}
@@ -1843,28 +2218,35 @@ class raw_hash_set {
: // Hash, equality and allocator are copied instead of moved because
// `that` must be left valid. If Hash is std::function<Key>, moving it
// would create a nullptr functor that cannot be called.
- settings_(y_absl::exchange(that.common(), CommonFields{}),
- that.hash_ref(), that.eq_ref(), that.alloc_ref()) {}
+ // TODO(b/296061262): move instead of copying hash/eq/alloc.
+ // Note: we avoid using exchange for better generated code.
+ settings_(std::move(that.common()), that.hash_ref(), that.eq_ref(),
+ that.alloc_ref()) {
+ that.common() = CommonFields{};
+ maybe_increment_generation_or_rehash_on_move();
+ }
raw_hash_set(raw_hash_set&& that, const allocator_type& a)
: settings_(CommonFields{}, that.hash_ref(), that.eq_ref(), a) {
if (a == that.alloc_ref()) {
std::swap(common(), that.common());
+ maybe_increment_generation_or_rehash_on_move();
} else {
- reserve(that.size());
- // Note: this will copy elements of dense_set and unordered_set instead of
- // moving them. This can be fixed if it ever becomes an issue.
- for (auto& elem : that) insert(std::move(elem));
+ move_elements_allocs_unequal(std::move(that));
}
}
raw_hash_set& operator=(const raw_hash_set& that) {
- raw_hash_set tmp(that,
- AllocTraits::propagate_on_container_copy_assignment::value
- ? that.alloc_ref()
- : alloc_ref());
- swap(tmp);
- return *this;
+ if (Y_ABSL_PREDICT_FALSE(this == &that)) return *this;
+ constexpr bool propagate_alloc =
+ AllocTraits::propagate_on_container_copy_assignment::value;
+ // TODO(ezb): maybe avoid allocating a new backing array if this->capacity()
+ // is an exact match for that.size(). If this->capacity() is too big, then
+ // it would make iteration very slow to reuse the allocation. Maybe we can
+ // do the same heuristic as clear() and reuse if it's small enough.
+ raw_hash_set tmp(that, propagate_alloc ? that.alloc_ref() : alloc_ref());
+ // NOLINTNEXTLINE: not returning *this for performance.
+ return assign_impl<propagate_alloc>(std::move(tmp));
}
raw_hash_set& operator=(raw_hash_set&& that) noexcept(
@@ -1879,19 +2261,7 @@ class raw_hash_set {
typename AllocTraits::propagate_on_container_move_assignment());
}
- ~raw_hash_set() {
- const size_t cap = capacity();
- if (!cap) return;
- destroy_slots();
-
- // Unpoison before returning the memory to the allocator.
- SanitizerUnpoisonMemoryRegion(slot_array(), sizeof(slot_type) * cap);
- Deallocate<BackingArrayAlignment(alignof(slot_type))>(
- &alloc_ref(), common().backing_array_start(),
- AllocSize(cap, sizeof(slot_type), alignof(slot_type)));
-
- infoz().Unregister();
- }
+ ~raw_hash_set() { destructor_impl(); }
iterator begin() Y_ABSL_ATTRIBUTE_LIFETIME_BOUND {
auto it = iterator_at(0);
@@ -1937,17 +2307,6 @@ class raw_hash_set {
common().set_reservation_size(0);
}
- inline void destroy_slots() {
- const size_t cap = capacity();
- const ctrl_t* ctrl = control();
- slot_type* slot = slot_array();
- for (size_t i = 0; i != cap; ++i) {
- if (IsFull(ctrl[i])) {
- PolicyTraits::destroy(&alloc_ref(), slot + i);
- }
- }
- }
-
// This overload kicks in when the argument is an rvalue of insertable and
// decomposable type other than init_type.
//
@@ -2075,7 +2434,7 @@ class raw_hash_set {
alignas(slot_type) unsigned char raw[sizeof(slot_type)];
slot_type* slot = reinterpret_cast<slot_type*>(&raw);
- PolicyTraits::construct(&alloc_ref(), slot, std::forward<Args>(args)...);
+ construct(slot, std::forward<Args>(args)...);
const auto& elem = PolicyTraits::element(slot);
return PolicyTraits::apply(InsertSlot<true>{*this, std::move(*slot)}, elem);
}
@@ -2179,8 +2538,8 @@ class raw_hash_set {
// This overload is necessary because otherwise erase<K>(const K&) would be
// a better match if non-const iterator is passed as an argument.
void erase(iterator it) {
- AssertIsFull(it.ctrl_, it.generation(), it.generation_ptr(), "erase()");
- PolicyTraits::destroy(&alloc_ref(), it.slot_);
+ AssertIsFull(it.control(), it.generation(), it.generation_ptr(), "erase()");
+ destroy(it.slot());
erase_meta_only(it);
}
@@ -2211,8 +2570,8 @@ class raw_hash_set {
assert(this != &src);
for (auto it = src.begin(), e = src.end(); it != e;) {
auto next = std::next(it);
- if (PolicyTraits::apply(InsertSlot<false>{*this, std::move(*it.slot_)},
- PolicyTraits::element(it.slot_))
+ if (PolicyTraits::apply(InsertSlot<false>{*this, std::move(*it.slot())},
+ PolicyTraits::element(it.slot()))
.second) {
src.erase_meta_only(it);
}
@@ -2226,10 +2585,9 @@ class raw_hash_set {
}
node_type extract(const_iterator position) {
- AssertIsFull(position.inner_.ctrl_, position.inner_.generation(),
+ AssertIsFull(position.control(), position.inner_.generation(),
position.inner_.generation_ptr(), "extract()");
- auto node =
- CommonAccess::Transfer<node_type>(alloc_ref(), position.inner_.slot_);
+ auto node = CommonAccess::Transfer<node_type>(alloc_ref(), position.slot());
erase_meta_only(position);
return node;
}
@@ -2364,7 +2722,11 @@ class raw_hash_set {
template <class K = key_type>
bool contains(const key_arg<K>& key) const {
- return find(key) != end();
+ // Here neither the iterator returned by `find()` nor `end()` can be invalid
+ // outside of potential thread-safety issues.
+ // `find()`'s return value is constructed, used, and then destructed
+ // all in this context.
+ return !find(key).unchecked_equals(end());
}
template <class K = key_type>
@@ -2400,8 +2762,10 @@ class raw_hash_set {
const raw_hash_set* outer = &a;
const raw_hash_set* inner = &b;
if (outer->capacity() > inner->capacity()) std::swap(outer, inner);
- for (const value_type& elem : *outer)
- if (!inner->has_element(elem)) return false;
+ for (const value_type& elem : *outer) {
+ auto it = PolicyTraits::apply(FindElement{*inner}, elem);
+ if (it == inner->end() || !(*it == elem)) return false;
+ }
return true;
}
@@ -2471,10 +2835,9 @@ class raw_hash_set {
std::pair<iterator, bool> operator()(const K& key, Args&&...) && {
auto res = s.find_or_prepare_insert(key);
if (res.second) {
- PolicyTraits::transfer(&s.alloc_ref(), s.slot_array() + res.first,
- &slot);
+ s.transfer(s.slot_array() + res.first, &slot);
} else if (do_destroy) {
- PolicyTraits::destroy(&s.alloc_ref(), &slot);
+ s.destroy(&slot);
}
return {s.iterator_at(res.first), res.second};
}
@@ -2483,58 +2846,111 @@ class raw_hash_set {
slot_type&& slot;
};
+ // TODO(b/303305702): re-enable reentrant validation.
+ template <typename... Args>
+ inline void construct(slot_type* slot, Args&&... args) {
+ PolicyTraits::construct(&alloc_ref(), slot, std::forward<Args>(args)...);
+ }
+ inline void destroy(slot_type* slot) {
+ PolicyTraits::destroy(&alloc_ref(), slot);
+ }
+ inline void transfer(slot_type* to, slot_type* from) {
+ PolicyTraits::transfer(&alloc_ref(), to, from);
+ }
+
+ inline void destroy_slots() {
+ const size_t cap = capacity();
+ const ctrl_t* ctrl = control();
+ slot_type* slot = slot_array();
+ for (size_t i = 0; i != cap; ++i) {
+ if (IsFull(ctrl[i])) {
+ destroy(slot + i);
+ }
+ }
+ }
+
+ inline void dealloc() {
+ assert(capacity() != 0);
+ // Unpoison before returning the memory to the allocator.
+ SanitizerUnpoisonMemoryRegion(slot_array(), sizeof(slot_type) * capacity());
+ infoz().Unregister();
+ Deallocate<BackingArrayAlignment(alignof(slot_type))>(
+ &alloc_ref(), common().backing_array_start(),
+ common().alloc_size(sizeof(slot_type), alignof(slot_type)));
+ }
+
+ inline void destructor_impl() {
+ if (capacity() == 0) return;
+ destroy_slots();
+ dealloc();
+ }
+
// Erases, but does not destroy, the value pointed to by `it`.
//
// This merely updates the pertinent control byte. This can be used in
// conjunction with Policy::transfer to move the object to another place.
void erase_meta_only(const_iterator it) {
- EraseMetaOnly(common(), it.inner_.ctrl_, sizeof(slot_type));
+ EraseMetaOnly(common(), static_cast<size_t>(it.control() - control()),
+ sizeof(slot_type));
}
- // Allocates a backing array for `self` and initializes its control bytes.
- // This reads `capacity` and updates all other fields based on the result of
- // the allocation.
+ // Resizes table to the new capacity and move all elements to the new
+ // positions accordingly.
//
- // This does not free the currently held array; `capacity` must be nonzero.
- inline void initialize_slots() {
- // People are often sloppy with the exact type of their allocator (sometimes
- // it has an extra const or is missing the pair, but rebinds made it work
- // anyway).
- using CharAlloc =
- typename y_absl::allocator_traits<Alloc>::template rebind_alloc<char>;
- InitializeSlots<CharAlloc, sizeof(slot_type), alignof(slot_type)>(
- common(), CharAlloc(alloc_ref()));
- }
-
+ // Note that for better performance instead of
+ // find_first_non_full(common(), hash),
+ // HashSetResizeHelper::FindFirstNonFullAfterResize(
+ // common(), old_capacity, hash)
+ // can be called right after `resize`.
Y_ABSL_ATTRIBUTE_NOINLINE void resize(size_t new_capacity) {
assert(IsValidCapacity(new_capacity));
- auto* old_ctrl = control();
+ HashSetResizeHelper resize_helper(common());
auto* old_slots = slot_array();
- const size_t old_capacity = common().capacity();
common().set_capacity(new_capacity);
- initialize_slots();
-
- auto* new_slots = slot_array();
- size_t total_probe_length = 0;
- for (size_t i = 0; i != old_capacity; ++i) {
- if (IsFull(old_ctrl[i])) {
- size_t hash = PolicyTraits::apply(HashElement{hash_ref()},
- PolicyTraits::element(old_slots + i));
- auto target = find_first_non_full(common(), hash);
- size_t new_i = target.offset;
- total_probe_length += target.probe_length;
- SetCtrl(common(), new_i, H2(hash), sizeof(slot_type));
- PolicyTraits::transfer(&alloc_ref(), new_slots + new_i, old_slots + i);
- }
+ // Note that `InitializeSlots` does different number initialization steps
+ // depending on the values of `transfer_uses_memcpy` and capacities.
+ // Refer to the comment in `InitializeSlots` for more details.
+ const bool grow_single_group =
+ resize_helper.InitializeSlots<CharAlloc, sizeof(slot_type),
+ PolicyTraits::transfer_uses_memcpy(),
+ alignof(slot_type)>(
+ common(), const_cast<std::remove_const_t<slot_type>*>(old_slots),
+ CharAlloc(alloc_ref()));
+
+ if (resize_helper.old_capacity() == 0) {
+ // InitializeSlots did all the work including infoz().RecordRehash().
+ return;
}
- if (old_capacity) {
- SanitizerUnpoisonMemoryRegion(old_slots,
- sizeof(slot_type) * old_capacity);
- Deallocate<BackingArrayAlignment(alignof(slot_type))>(
- &alloc_ref(), old_ctrl - ControlOffset(),
- AllocSize(old_capacity, sizeof(slot_type), alignof(slot_type)));
+
+ if (grow_single_group) {
+ if (PolicyTraits::transfer_uses_memcpy()) {
+ // InitializeSlots did all the work.
+ return;
+ }
+ // We want GrowSizeIntoSingleGroup to be called here in order to make
+ // InitializeSlots not depend on PolicyTraits.
+ resize_helper.GrowSizeIntoSingleGroup<PolicyTraits>(common(), alloc_ref(),
+ old_slots);
+ } else {
+ // InitializeSlots prepares control bytes to correspond to empty table.
+ auto* new_slots = slot_array();
+ size_t total_probe_length = 0;
+ for (size_t i = 0; i != resize_helper.old_capacity(); ++i) {
+ if (IsFull(resize_helper.old_ctrl()[i])) {
+ size_t hash = PolicyTraits::apply(
+ HashElement{hash_ref()}, PolicyTraits::element(old_slots + i));
+ auto target = find_first_non_full(common(), hash);
+ size_t new_i = target.offset;
+ total_probe_length += target.probe_length;
+ SetCtrl(common(), new_i, H2(hash), sizeof(slot_type));
+ transfer(new_slots + new_i, old_slots + i);
+ }
+ }
+ infoz().RecordRehash(total_probe_length);
}
- infoz().RecordRehash(total_probe_length);
+ resize_helper.DeallocateOld<alignof(slot_type)>(
+ CharAlloc(alloc_ref()), sizeof(slot_type),
+ const_cast<std::remove_const_t<slot_type>*>(old_slots));
}
// Prunes control bytes to remove as many tombstones as possible.
@@ -2604,36 +3020,64 @@ class raw_hash_set {
}
}
- bool has_element(const value_type& elem) const {
- size_t hash = PolicyTraits::apply(HashElement{hash_ref()}, elem);
- auto seq = probe(common(), hash);
- const ctrl_t* ctrl = control();
- while (true) {
- Group g{ctrl + seq.offset()};
- for (uint32_t i : g.Match(H2(hash))) {
- if (Y_ABSL_PREDICT_TRUE(
- PolicyTraits::element(slot_array() + seq.offset(i)) == elem))
- return true;
- }
- if (Y_ABSL_PREDICT_TRUE(g.MaskEmpty())) return false;
- seq.next();
- assert(seq.index() <= capacity() && "full table!");
+ void maybe_increment_generation_or_rehash_on_move() {
+ common().maybe_increment_generation_on_move();
+ if (!empty() && common().should_rehash_for_bug_detection_on_move()) {
+ resize(capacity());
}
- return false;
}
- // TODO(alkis): Optimize this assuming *this and that don't overlap.
- raw_hash_set& move_assign(raw_hash_set&& that, std::true_type) {
- raw_hash_set tmp(std::move(that));
- swap(tmp);
+ template<bool propagate_alloc>
+ raw_hash_set& assign_impl(raw_hash_set&& that) {
+ // We don't bother checking for this/that aliasing. We just need to avoid
+ // breaking the invariants in that case.
+ destructor_impl();
+ common() = std::move(that.common());
+ // TODO(b/296061262): move instead of copying hash/eq/alloc.
+ hash_ref() = that.hash_ref();
+ eq_ref() = that.eq_ref();
+ CopyAlloc(alloc_ref(), that.alloc_ref(),
+ std::integral_constant<bool, propagate_alloc>());
+ that.common() = CommonFields{};
+ maybe_increment_generation_or_rehash_on_move();
return *this;
}
- raw_hash_set& move_assign(raw_hash_set&& that, std::false_type) {
- raw_hash_set tmp(std::move(that), alloc_ref());
- swap(tmp);
+
+ raw_hash_set& move_elements_allocs_unequal(raw_hash_set&& that) {
+ const size_t size = that.size();
+ if (size == 0) return *this;
+ reserve(size);
+ for (iterator it = that.begin(); it != that.end(); ++it) {
+ insert(std::move(PolicyTraits::element(it.slot())));
+ that.destroy(it.slot());
+ }
+ that.dealloc();
+ that.common() = CommonFields{};
+ maybe_increment_generation_or_rehash_on_move();
return *this;
}
+ raw_hash_set& move_assign(raw_hash_set&& that,
+ std::true_type /*propagate_alloc*/) {
+ return assign_impl<true>(std::move(that));
+ }
+ raw_hash_set& move_assign(raw_hash_set&& that,
+ std::false_type /*propagate_alloc*/) {
+ if (alloc_ref() == that.alloc_ref()) {
+ return assign_impl<false>(std::move(that));
+ }
+ // Aliasing can't happen here because allocs would compare equal above.
+ assert(this != &that);
+ destructor_impl();
+ // We can't take over that's memory so we need to move each element.
+ // While moving elements, this should have that's hash/eq so copy hash/eq
+ // before moving elements.
+ // TODO(b/296061262): move instead of copying hash/eq.
+ hash_ref() = that.hash_ref();
+ eq_ref() = that.eq_ref();
+ return move_elements_allocs_unequal(std::move(that));
+ }
+
protected:
// Attempts to find `key` in the table; if it isn't found, returns a slot that
// the value can be inserted into, with the control byte already set to
@@ -2675,10 +3119,19 @@ class raw_hash_set {
if (!rehash_for_bug_detection &&
Y_ABSL_PREDICT_FALSE(growth_left() == 0 &&
!IsDeleted(control()[target.offset]))) {
+ size_t old_capacity = capacity();
rehash_and_grow_if_necessary();
- target = find_first_non_full(common(), hash);
+ // NOTE: It is safe to use `FindFirstNonFullAfterResize`.
+ // `FindFirstNonFullAfterResize` must be called right after resize.
+ // `rehash_and_grow_if_necessary` may *not* call `resize`
+ // and perform `drop_deletes_without_resize` instead. But this
+ // could happen only on big tables.
+ // For big tables `FindFirstNonFullAfterResize` will always
+ // fallback to normal `find_first_non_full`, so it is safe to use it.
+ target = HashSetResizeHelper::FindFirstNonFullAfterResize(
+ common(), old_capacity, hash);
}
- common().set_size(common().size() + 1);
+ common().increment_size();
set_growth_left(growth_left() - IsEmpty(control()[target.offset]));
SetCtrl(common(), target.offset, H2(hash), sizeof(slot_type));
common().maybe_increment_generation_on_insert();
@@ -2696,8 +3149,7 @@ class raw_hash_set {
// POSTCONDITION: *m.iterator_at(i) == value_type(forward<Args>(args)...).
template <class... Args>
void emplace_at(size_t i, Args&&... args) {
- PolicyTraits::construct(&alloc_ref(), slot_array() + i,
- std::forward<Args>(args)...);
+ construct(slot_array() + i, std::forward<Args>(args)...);
assert(PolicyTraits::apply(FindElement{*this}, *iterator_at(i)) ==
iterator_at(i) &&
@@ -2711,6 +3163,8 @@ class raw_hash_set {
return {control() + i, slot_array() + i, common().generation_ptr()};
}
+ reference unchecked_deref(iterator it) { return it.unchecked_deref(); }
+
private:
friend struct RawHashSetTestOnlyAccess;
@@ -2743,7 +3197,7 @@ class raw_hash_set {
slot_type* slot_array() const {
return static_cast<slot_type*>(common().slot_array());
}
- HashtablezInfoHandle& infoz() { return common().infoz(); }
+ HashtablezInfoHandle infoz() { return common().infoz(); }
hasher& hash_ref() { return settings_.template get<1>(); }
const hasher& hash_ref() const { return settings_.template get<1>(); }
@@ -2763,8 +3217,7 @@ class raw_hash_set {
}
static void transfer_slot_fn(void* set, void* dst, void* src) {
auto* h = static_cast<raw_hash_set*>(set);
- PolicyTraits::transfer(&h->alloc_ref(), static_cast<slot_type*>(dst),
- static_cast<slot_type*>(src));
+ h->transfer(static_cast<slot_type*>(dst), static_cast<slot_type*>(src));
}
// Note: dealloc_fn will only be used if we have a non-standard allocator.
static void dealloc_fn(CommonFields& common, const PolicyFunctions&) {
@@ -2774,6 +3227,7 @@ class raw_hash_set {
SanitizerUnpoisonMemoryRegion(common.slot_array(),
sizeof(slot_type) * common.capacity());
+ common.infoz().Unregister();
Deallocate<BackingArrayAlignment(alignof(slot_type))>(
&set->alloc_ref(), common.backing_array_start(),
common.alloc_size(sizeof(slot_type), alignof(slot_type)));
@@ -2847,33 +3301,18 @@ struct HashtableDebugAccess<Set, y_absl::void_t<typename Set::raw_hash_set>> {
static size_t AllocatedByteSize(const Set& c) {
size_t capacity = c.capacity();
if (capacity == 0) return 0;
- size_t m = AllocSize(capacity, sizeof(Slot), alignof(Slot));
+ size_t m = c.common().alloc_size(sizeof(Slot), alignof(Slot));
size_t per_slot = Traits::space_used(static_cast<const Slot*>(nullptr));
if (per_slot != ~size_t{}) {
m += per_slot * c.size();
} else {
- const ctrl_t* ctrl = c.control();
- for (size_t i = 0; i != capacity; ++i) {
- if (container_internal::IsFull(ctrl[i])) {
- m += Traits::space_used(c.slot_array() + i);
- }
+ for (auto it = c.begin(); it != c.end(); ++it) {
+ m += Traits::space_used(it.slot());
}
}
return m;
}
-
- static size_t LowerBoundAllocatedByteSize(size_t size) {
- size_t capacity = GrowthToLowerboundCapacity(size);
- if (capacity == 0) return 0;
- size_t m =
- AllocSize(NormalizeCapacity(capacity), sizeof(Slot), alignof(Slot));
- size_t per_slot = Traits::space_used(static_cast<const Slot*>(nullptr));
- if (per_slot != ~size_t{}) {
- m += per_slot * size;
- }
- return m;
- }
};
} // namespace hashtable_debug_internal
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/cpu_detect.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/cpu_detect.cc
index 3a9e335643d..7901c9bde32 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/cpu_detect.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/cpu_detect.cc
@@ -189,8 +189,14 @@ CpuType GetAmdCpuType() {
break;
case 0x19:
switch (model_num) {
+ case 0x0: // Stepping Ax
case 0x1: // Stepping B0
return CpuType::kAmdMilan;
+ case 0x10: // Stepping A0
+ case 0x11: // Stepping B0
+ return CpuType::kAmdGenoa;
+ case 0x44: // Stepping A0
+ return CpuType::kAmdRyzenV3000;
default:
return CpuType::kUnknown;
}
@@ -237,8 +243,26 @@ CpuType GetCpuType() {
Y_ABSL_INTERNAL_AARCH64_ID_REG_READ(MIDR_EL1, midr);
uint32_t implementer = (midr >> 24) & 0xff;
uint32_t part_number = (midr >> 4) & 0xfff;
- if (implementer == 0x41 && part_number == 0xd0c) {
- return CpuType::kArmNeoverseN1;
+ switch (implementer) {
+ case 0x41:
+ switch (part_number) {
+ case 0xd0c: return CpuType::kArmNeoverseN1;
+ case 0xd40: return CpuType::kArmNeoverseV1;
+ case 0xd49: return CpuType::kArmNeoverseN2;
+ case 0xd4f: return CpuType::kArmNeoverseV2;
+ default:
+ return CpuType::kUnknown;
+ }
+ break;
+ case 0xc0:
+ switch (part_number) {
+ case 0xac3: return CpuType::kAmpereSiryn;
+ default:
+ return CpuType::kUnknown;
+ }
+ break;
+ default:
+ return CpuType::kUnknown;
}
}
return CpuType::kUnknown;
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/cpu_detect.h b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/cpu_detect.h
index 55539d9a52b..f0becc833d0 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/cpu_detect.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/cpu_detect.h
@@ -29,6 +29,8 @@ enum class CpuType {
kAmdRome,
kAmdNaples,
kAmdMilan,
+ kAmdGenoa,
+ kAmdRyzenV3000,
kIntelCascadelakeXeon,
kIntelSkylakeXeon,
kIntelBroadwell,
@@ -37,6 +39,10 @@ enum class CpuType {
kIntelSandybridge,
kIntelWestmere,
kArmNeoverseN1,
+ kArmNeoverseV1,
+ kAmpereSiryn,
+ kArmNeoverseN2,
+ kArmNeoverseV2
};
// Returns the type of host CPU this code is running on. Returns kUnknown if
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc32_x86_arm_combined_simd.h b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc32_x86_arm_combined_simd.h
index 699d1971113..0e53b0f5735 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc32_x86_arm_combined_simd.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc32_x86_arm_combined_simd.h
@@ -59,6 +59,8 @@ namespace crc_internal {
#if defined(Y_ABSL_CRC_INTERNAL_HAVE_ARM_SIMD)
using V128 = uint64x2_t;
#else
+// Note: Do not use __m128i_u, it is not portable.
+// Use V128_LoadU() perform an unaligned load from __m128i*.
using V128 = __m128i;
#endif
@@ -78,6 +80,9 @@ V128 V128_Load(const V128* src);
// Load 128 bits of integer data. |src| does not need to be aligned.
V128 V128_LoadU(const V128* src);
+// Store 128 bits of integer data. |src| must be 16-byte aligned.
+void V128_Store(V128* dst, V128 data);
+
// Polynomially multiplies the high 64 bits of |l| and |r|.
V128 V128_PMulHi(const V128 l, const V128 r);
@@ -109,6 +114,10 @@ V128 V128_ShiftRight(const V128 l);
template <int imm>
int V128_Extract32(const V128 l);
+// Extracts a 64-bit integer from |l|, selected with |imm|.
+template <int imm>
+uint64_t V128_Extract64(const V128 l);
+
// Extracts the low 64 bits from V128.
int64_t V128_Low64(const V128 l);
@@ -139,6 +148,8 @@ inline V128 V128_Load(const V128* src) { return _mm_load_si128(src); }
inline V128 V128_LoadU(const V128* src) { return _mm_loadu_si128(src); }
+inline void V128_Store(V128* dst, V128 data) { _mm_store_si128(dst, data); }
+
inline V128 V128_PMulHi(const V128 l, const V128 r) {
return _mm_clmulepi64_si128(l, r, 0x11);
}
@@ -173,6 +184,11 @@ inline int V128_Extract32(const V128 l) {
return _mm_extract_epi32(l, imm);
}
+template <int imm>
+inline uint64_t V128_Extract64(const V128 l) {
+ return static_cast<uint64_t>(_mm_extract_epi64(l, imm));
+}
+
inline int64_t V128_Low64(const V128 l) { return _mm_cvtsi128_si64(l); }
inline V128 V128_ShiftLeft64(const V128 l, const V128 r) {
@@ -203,10 +219,14 @@ inline V128 V128_LoadU(const V128* src) {
return vld1q_u64(reinterpret_cast<const uint64_t*>(src));
}
+inline void V128_Store(V128* dst, V128 data) {
+ vst1q_u64(reinterpret_cast<uint64_t*>(dst), data);
+}
+
// Using inline assembly as clang does not generate the pmull2 instruction and
// performance drops by 15-20%.
-// TODO(b/193678732): Investigate why the compiler decides not to generate
-// such instructions and why it becomes so much worse.
+// TODO(b/193678732): Investigate why there is a slight performance hit when
+// using intrinsics instead of inline assembly.
inline V128 V128_PMulHi(const V128 l, const V128 r) {
uint64x2_t res;
__asm__ __volatile__("pmull2 %0.1q, %1.2d, %2.2d \n\t"
@@ -215,10 +235,14 @@ inline V128 V128_PMulHi(const V128 l, const V128 r) {
return res;
}
+// TODO(b/193678732): Investigate why the compiler decides to move the constant
+// loop multiplicands from GPR to Neon registers every loop iteration.
inline V128 V128_PMulLow(const V128 l, const V128 r) {
- return reinterpret_cast<V128>(vmull_p64(
- reinterpret_cast<poly64_t>(vget_low_p64(vreinterpretq_p64_u64(l))),
- reinterpret_cast<poly64_t>(vget_low_p64(vreinterpretq_p64_u64(r)))));
+ uint64x2_t res;
+ __asm__ __volatile__("pmull %0.1q, %1.1d, %2.1d \n\t"
+ : "=w"(res)
+ : "w"(l), "w"(r));
+ return res;
}
inline V128 V128_PMul01(const V128 l, const V128 r) {
@@ -252,6 +276,11 @@ inline int V128_Extract32(const V128 l) {
return vgetq_lane_s32(vreinterpretq_s32_u64(l), imm);
}
+template <int imm>
+inline uint64_t V128_Extract64(const V128 l) {
+ return vgetq_lane_u64(l, imm);
+}
+
inline int64_t V128_Low64(const V128 l) {
return vgetq_lane_s64(vreinterpretq_s64_u64(l), 0);
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy.h b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy.h
index 520a49c879d..6b8a1a74ac9 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy.h
@@ -20,12 +20,15 @@
#include "y_absl/base/config.h"
#include "y_absl/crc/crc32c.h"
+#include "y_absl/crc/internal/crc32_x86_arm_combined_simd.h"
// Defined if the class AcceleratedCrcMemcpyEngine exists.
-#if defined(__x86_64__) && defined(__SSE4_2__)
-#define Y_ABSL_INTERNAL_HAVE_X86_64_ACCELERATED_CRC_MEMCPY_ENGINE 1
-#elif defined(_MSC_VER) && defined(__AVX__)
+// TODO(b/299127771): Consider relaxing the pclmul requirement once the other
+// intrinsics are conditionally compiled without it.
+#if defined(Y_ABSL_CRC_INTERNAL_HAVE_X86_SIMD)
#define Y_ABSL_INTERNAL_HAVE_X86_64_ACCELERATED_CRC_MEMCPY_ENGINE 1
+#elif defined(Y_ABSL_CRC_INTERNAL_HAVE_ARM_SIMD)
+#define Y_ABSL_INTERNAL_HAVE_ARM_ACCELERATED_CRC_MEMCPY_ENGINE 1
#endif
namespace y_absl {
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy_fallback.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy_fallback.cc
index 58d921d3161..cf03a5e10cd 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy_fallback.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy_fallback.cc
@@ -54,7 +54,8 @@ y_absl::crc32c_t FallbackCrcMemcpyEngine::Compute(void* __restrict dst,
}
// Compile the following only if we don't have
-#ifndef Y_ABSL_INTERNAL_HAVE_X86_64_ACCELERATED_CRC_MEMCPY_ENGINE
+#if !defined(Y_ABSL_INTERNAL_HAVE_X86_64_ACCELERATED_CRC_MEMCPY_ENGINE) && \
+ !defined(Y_ABSL_INTERNAL_HAVE_ARM_ACCELERATED_CRC_MEMCPY_ENGINE)
CrcMemcpy::ArchSpecificEngines CrcMemcpy::GetArchSpecificEngines() {
CrcMemcpy::ArchSpecificEngines engines;
@@ -68,7 +69,8 @@ std::unique_ptr<CrcMemcpyEngine> CrcMemcpy::GetTestEngine(int /*vector*/,
return std::make_unique<FallbackCrcMemcpyEngine>();
}
-#endif // Y_ABSL_INTERNAL_HAVE_X86_64_ACCELERATED_CRC_MEMCPY_ENGINE
+#endif // !Y_ABSL_INTERNAL_HAVE_X86_64_ACCELERATED_CRC_MEMCPY_ENGINE &&
+ // !Y_ABSL_INTERNAL_HAVE_ARM_ACCELERATED_CRC_MEMCPY_ENGINE
} // namespace crc_internal
Y_ABSL_NAMESPACE_END
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy_x86_64.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy_x86_64.cc
deleted file mode 100644
index fa20a9eb147..00000000000
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy_x86_64.cc
+++ /dev/null
@@ -1,432 +0,0 @@
-// Copyright 2022 The Abseil Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Simultaneous memcopy and CRC-32C for x86-64. Uses integer registers because
-// XMM registers do not support the CRC instruction (yet). While copying,
-// compute the running CRC of the data being copied.
-//
-// It is assumed that any CPU running this code has SSE4.2 instructions
-// available (for CRC32C). This file will do nothing if that is not true.
-//
-// The CRC instruction has a 3-byte latency, and we are stressing the ALU ports
-// here (unlike a traditional memcopy, which has almost no ALU use), so we will
-// need to copy in such a way that the CRC unit is used efficiently. We have two
-// regimes in this code:
-// 1. For operations of size < kCrcSmallSize, do the CRC then the memcpy
-// 2. For operations of size > kCrcSmallSize:
-// a) compute an initial CRC + copy on a small amount of data to align the
-// destination pointer on a 16-byte boundary.
-// b) Split the data into 3 main regions and a tail (smaller than 48 bytes)
-// c) Do the copy and CRC of the 3 main regions, interleaving (start with
-// full cache line copies for each region, then move to single 16 byte
-// pieces per region).
-// d) Combine the CRCs with CRC32C::Concat.
-// e) Copy the tail and extend the CRC with the CRC of the tail.
-// This method is not ideal for op sizes between ~1k and ~8k because CRC::Concat
-// takes a significant amount of time. A medium-sized approach could be added
-// using 3 CRCs over fixed-size blocks where the zero-extensions required for
-// CRC32C::Concat can be precomputed.
-
-#ifdef __SSE4_2__
-#include <immintrin.h>
-#endif
-
-#ifdef _MSC_VER
-#include <intrin.h>
-#endif
-
-#include <array>
-#include <cstddef>
-#include <cstdint>
-#include <type_traits>
-
-#include "y_absl/base/dynamic_annotations.h"
-#include "y_absl/base/optimization.h"
-#include "y_absl/base/prefetch.h"
-#include "y_absl/crc/crc32c.h"
-#include "y_absl/crc/internal/cpu_detect.h"
-#include "y_absl/crc/internal/crc_memcpy.h"
-#include "y_absl/strings/string_view.h"
-
-#ifdef Y_ABSL_INTERNAL_HAVE_X86_64_ACCELERATED_CRC_MEMCPY_ENGINE
-
-namespace y_absl {
-Y_ABSL_NAMESPACE_BEGIN
-namespace crc_internal {
-
-namespace {
-
-inline crc32c_t ShortCrcCopy(char* dst, const char* src, std::size_t length,
- crc32c_t crc) {
- // Small copy: just go 1 byte at a time: being nice to the branch predictor
- // is more important here than anything else
- uint32_t crc_uint32 = static_cast<uint32_t>(crc);
- for (std::size_t i = 0; i < length; i++) {
- uint8_t data = *reinterpret_cast<const uint8_t*>(src);
- crc_uint32 = _mm_crc32_u8(crc_uint32, data);
- *reinterpret_cast<uint8_t*>(dst) = data;
- ++src;
- ++dst;
- }
- return crc32c_t{crc_uint32};
-}
-
-constexpr size_t kIntLoadsPerVec = sizeof(__m128i) / sizeof(uint64_t);
-
-// Common function for copying the tails of multiple large regions.
-template <size_t vec_regions, size_t int_regions>
-inline void LargeTailCopy(crc32c_t* crcs, char** dst, const char** src,
- size_t region_size, size_t copy_rounds) {
- std::array<__m128i, vec_regions> data;
- std::array<uint64_t, kIntLoadsPerVec * int_regions> int_data;
-
- while (copy_rounds > 0) {
- for (size_t i = 0; i < vec_regions; i++) {
- size_t region = i;
-
- auto* vsrc =
- reinterpret_cast<const __m128i*>(*src + region_size * region);
- auto* vdst = reinterpret_cast<__m128i*>(*dst + region_size * region);
-
- // Load the blocks, unaligned
- data[i] = _mm_loadu_si128(vsrc);
-
- // Store the blocks, aligned
- _mm_store_si128(vdst, data[i]);
-
- // Compute the running CRC
- crcs[region] = crc32c_t{static_cast<uint32_t>(
- _mm_crc32_u64(static_cast<uint32_t>(crcs[region]),
- static_cast<uint64_t>(_mm_extract_epi64(data[i], 0))))};
- crcs[region] = crc32c_t{static_cast<uint32_t>(
- _mm_crc32_u64(static_cast<uint32_t>(crcs[region]),
- static_cast<uint64_t>(_mm_extract_epi64(data[i], 1))))};
- }
-
- for (size_t i = 0; i < int_regions; i++) {
- size_t region = vec_regions + i;
-
- auto* usrc =
- reinterpret_cast<const uint64_t*>(*src + region_size * region);
- auto* udst = reinterpret_cast<uint64_t*>(*dst + region_size * region);
-
- for (size_t j = 0; j < kIntLoadsPerVec; j++) {
- size_t data_index = i * kIntLoadsPerVec + j;
-
- int_data[data_index] = *(usrc + j);
- crcs[region] = crc32c_t{static_cast<uint32_t>(_mm_crc32_u64(
- static_cast<uint32_t>(crcs[region]), int_data[data_index]))};
-
- *(udst + j) = int_data[data_index];
- }
- }
-
- // Increment pointers
- *src += sizeof(__m128i);
- *dst += sizeof(__m128i);
- --copy_rounds;
- }
-}
-
-} // namespace
-
-template <size_t vec_regions, size_t int_regions>
-class AcceleratedCrcMemcpyEngine : public CrcMemcpyEngine {
- public:
- AcceleratedCrcMemcpyEngine() = default;
- AcceleratedCrcMemcpyEngine(const AcceleratedCrcMemcpyEngine&) = delete;
- AcceleratedCrcMemcpyEngine operator=(const AcceleratedCrcMemcpyEngine&) =
- delete;
-
- crc32c_t Compute(void* __restrict dst, const void* __restrict src,
- std::size_t length, crc32c_t initial_crc) const override;
-};
-
-template <size_t vec_regions, size_t int_regions>
-crc32c_t AcceleratedCrcMemcpyEngine<vec_regions, int_regions>::Compute(
- void* __restrict dst, const void* __restrict src, std::size_t length,
- crc32c_t initial_crc) const {
- constexpr std::size_t kRegions = vec_regions + int_regions;
- constexpr uint32_t kCrcDataXor = uint32_t{0xffffffff};
- constexpr std::size_t kBlockSize = sizeof(__m128i);
- constexpr std::size_t kCopyRoundSize = kRegions * kBlockSize;
-
- // Number of blocks per cacheline.
- constexpr std::size_t kBlocksPerCacheLine = Y_ABSL_CACHELINE_SIZE / kBlockSize;
-
- char* dst_bytes = static_cast<char*>(dst);
- const char* src_bytes = static_cast<const char*>(src);
-
- // Make sure that one prefetch per big block is enough to cover the whole
- // dataset, and we don't prefetch too much.
- static_assert(Y_ABSL_CACHELINE_SIZE % kBlockSize == 0,
- "Cache lines are not divided evenly into blocks, may have "
- "unintended behavior!");
-
- // Experimentally-determined boundary between a small and large copy.
- // Below this number, spin-up and concatenation of CRCs takes enough time that
- // it kills the throughput gains of using 3 regions and wide vectors.
- constexpr size_t kCrcSmallSize = 256;
-
- // Experimentally-determined prefetch distance. Main loop copies will
- // prefeth data 2 cache lines ahead.
- constexpr std::size_t kPrefetchAhead = 2 * Y_ABSL_CACHELINE_SIZE;
-
- // Small-size CRC-memcpy : just do CRC + memcpy
- if (length < kCrcSmallSize) {
- crc32c_t crc =
- ExtendCrc32c(initial_crc, y_absl::string_view(src_bytes, length));
- memcpy(dst, src, length);
- return crc;
- }
-
- // Start work on the CRC: undo the XOR from the previous calculation or set up
- // the initial value of the CRC.
- // initial_crc ^= kCrcDataXor;
- initial_crc = crc32c_t{static_cast<uint32_t>(initial_crc) ^ kCrcDataXor};
-
- // Do an initial alignment copy, so we can use aligned store instructions to
- // the destination pointer. We align the destination pointer because the
- // penalty for an unaligned load is small compared to the penalty of an
- // unaligned store on modern CPUs.
- std::size_t bytes_from_last_aligned =
- reinterpret_cast<uintptr_t>(dst) & (kBlockSize - 1);
- if (bytes_from_last_aligned != 0) {
- std::size_t bytes_for_alignment = kBlockSize - bytes_from_last_aligned;
-
- // Do the short-sized copy and CRC.
- initial_crc =
- ShortCrcCopy(dst_bytes, src_bytes, bytes_for_alignment, initial_crc);
- src_bytes += bytes_for_alignment;
- dst_bytes += bytes_for_alignment;
- length -= bytes_for_alignment;
- }
-
- // We are going to do the copy and CRC in kRegions regions to make sure that
- // we can saturate the CRC unit. The CRCs will be combined at the end of the
- // run. Copying will use the SSE registers, and we will extract words from
- // the SSE registers to add to the CRC. Initially, we run the loop one full
- // cache line per region at a time, in order to insert prefetches.
-
- // Initialize CRCs for kRegions regions.
- crc32c_t crcs[kRegions];
- crcs[0] = initial_crc;
- for (size_t i = 1; i < kRegions; i++) {
- crcs[i] = crc32c_t{kCrcDataXor};
- }
-
- // Find the number of rounds to copy and the region size. Also compute the
- // tail size here.
- size_t copy_rounds = length / kCopyRoundSize;
-
- // Find the size of each region and the size of the tail.
- const std::size_t region_size = copy_rounds * kBlockSize;
- const std::size_t tail_size = length - (kRegions * region_size);
-
- // Holding registers for data in each region.
- std::array<__m128i, vec_regions> vec_data;
- std::array<uint64_t, int_regions * kIntLoadsPerVec> int_data;
-
- // Main loop.
- while (copy_rounds > kBlocksPerCacheLine) {
- // Prefetch kPrefetchAhead bytes ahead of each pointer.
- for (size_t i = 0; i < kRegions; i++) {
- y_absl::PrefetchToLocalCache(src_bytes + kPrefetchAhead + region_size * i);
- y_absl::PrefetchToLocalCache(dst_bytes + kPrefetchAhead + region_size * i);
- }
-
- // Load and store data, computing CRC on the way.
- for (size_t i = 0; i < kBlocksPerCacheLine; i++) {
- // Copy and CRC the data for the CRC regions.
- for (size_t j = 0; j < vec_regions; j++) {
- // Cycle which regions get vector load/store and integer load/store, to
- // engage prefetching logic around vector load/stores and save issue
- // slots by using the integer registers.
- size_t region = (j + i) % kRegions;
-
- auto* vsrc =
- reinterpret_cast<const __m128i*>(src_bytes + region_size * region);
- auto* vdst =
- reinterpret_cast<__m128i*>(dst_bytes + region_size * region);
-
- // Load and CRC data.
- vec_data[j] = _mm_loadu_si128(vsrc + i);
- crcs[region] = crc32c_t{static_cast<uint32_t>(_mm_crc32_u64(
- static_cast<uint32_t>(crcs[region]),
- static_cast<uint64_t>(_mm_extract_epi64(vec_data[j], 0))))};
- crcs[region] = crc32c_t{static_cast<uint32_t>(_mm_crc32_u64(
- static_cast<uint32_t>(crcs[region]),
- static_cast<uint64_t>(_mm_extract_epi64(vec_data[j], 1))))};
-
- // Store the data.
- _mm_store_si128(vdst + i, vec_data[j]);
- }
-
- // Preload the partial CRCs for the CLMUL subregions.
- for (size_t j = 0; j < int_regions; j++) {
- // Cycle which regions get vector load/store and integer load/store, to
- // engage prefetching logic around vector load/stores and save issue
- // slots by using the integer registers.
- size_t region = (j + vec_regions + i) % kRegions;
-
- auto* usrc =
- reinterpret_cast<const uint64_t*>(src_bytes + region_size * region);
- auto* udst =
- reinterpret_cast<uint64_t*>(dst_bytes + region_size * region);
-
- for (size_t k = 0; k < kIntLoadsPerVec; k++) {
- size_t data_index = j * kIntLoadsPerVec + k;
-
- // Load and CRC the data.
- int_data[data_index] = *(usrc + i * kIntLoadsPerVec + k);
- crcs[region] = crc32c_t{static_cast<uint32_t>(_mm_crc32_u64(
- static_cast<uint32_t>(crcs[region]), int_data[data_index]))};
-
- // Store the data.
- *(udst + i * kIntLoadsPerVec + k) = int_data[data_index];
- }
- }
- }
-
- // Increment pointers
- src_bytes += kBlockSize * kBlocksPerCacheLine;
- dst_bytes += kBlockSize * kBlocksPerCacheLine;
- copy_rounds -= kBlocksPerCacheLine;
- }
-
- // Copy and CRC the tails of each region.
- LargeTailCopy<vec_regions, int_regions>(crcs, &dst_bytes, &src_bytes,
- region_size, copy_rounds);
-
- // Move the source and destination pointers to the end of the region
- src_bytes += region_size * (kRegions - 1);
- dst_bytes += region_size * (kRegions - 1);
-
- // Finalize the first CRCs: XOR the internal CRCs by the XOR mask to undo the
- // XOR done before doing block copy + CRCs.
- for (size_t i = 0; i + 1 < kRegions; i++) {
- crcs[i] = crc32c_t{static_cast<uint32_t>(crcs[i]) ^ kCrcDataXor};
- }
-
- // Build a CRC of the first kRegions - 1 regions.
- crc32c_t full_crc = crcs[0];
- for (size_t i = 1; i + 1 < kRegions; i++) {
- full_crc = ConcatCrc32c(full_crc, crcs[i], region_size);
- }
-
- // Copy and CRC the tail through the XMM registers.
- std::size_t tail_blocks = tail_size / kBlockSize;
- LargeTailCopy<0, 1>(&crcs[kRegions - 1], &dst_bytes, &src_bytes, 0,
- tail_blocks);
-
- // Final tail copy for under 16 bytes.
- crcs[kRegions - 1] =
- ShortCrcCopy(dst_bytes, src_bytes, tail_size - tail_blocks * kBlockSize,
- crcs[kRegions - 1]);
-
- // Finalize and concatenate the final CRC, then return.
- crcs[kRegions - 1] =
- crc32c_t{static_cast<uint32_t>(crcs[kRegions - 1]) ^ kCrcDataXor};
- return ConcatCrc32c(full_crc, crcs[kRegions - 1], region_size + tail_size);
-}
-
-CrcMemcpy::ArchSpecificEngines CrcMemcpy::GetArchSpecificEngines() {
-#ifdef UNDEFINED_BEHAVIOR_SANITIZER
- // UBSAN does not play nicely with unaligned loads (which we use a lot).
- // Get the underlying architecture.
- CpuType cpu_type = GetCpuType();
- switch (cpu_type) {
- case CpuType::kUnknown:
- case CpuType::kAmdRome:
- case CpuType::kAmdNaples:
- case CpuType::kIntelCascadelakeXeon:
- case CpuType::kIntelSkylakeXeon:
- case CpuType::kIntelSkylake:
- case CpuType::kIntelBroadwell:
- case CpuType::kIntelHaswell:
- case CpuType::kIntelIvybridge:
- return {
- /*.temporal=*/new FallbackCrcMemcpyEngine(),
- /*.non_temporal=*/new CrcNonTemporalMemcpyAVXEngine(),
- };
- // INTEL_SANDYBRIDGE performs better with SSE than AVX.
- case CpuType::kIntelSandybridge:
- return {
- /*.temporal=*/new FallbackCrcMemcpyEngine(),
- /*.non_temporal=*/new CrcNonTemporalMemcpyEngine(),
- };
- default:
- return {/*.temporal=*/new FallbackCrcMemcpyEngine(),
- /*.non_temporal=*/new FallbackCrcMemcpyEngine()};
- }
-#else
- // Get the underlying architecture.
- CpuType cpu_type = GetCpuType();
- switch (cpu_type) {
- // On Zen 2, PEXTRQ uses 2 micro-ops, including one on the vector store port
- // which data movement from the vector registers to the integer registers
- // (where CRC32C happens) to crowd the same units as vector stores. As a
- // result, using that path exclusively causes bottlenecking on this port.
- // We can avoid this bottleneck by using the integer side of the CPU for
- // most operations rather than the vector side. We keep a vector region to
- // engage some of the prefetching logic in the cache hierarchy which seems
- // to give vector instructions special treatment. These prefetch units see
- // strided access to each region, and do the right thing.
- case CpuType::kAmdRome:
- case CpuType::kAmdNaples:
- return {
- /*.temporal=*/new AcceleratedCrcMemcpyEngine<1, 2>(),
- /*.non_temporal=*/new CrcNonTemporalMemcpyAVXEngine(),
- };
- // PCLMULQDQ is slow and we don't have wide enough issue width to take
- // advantage of it. For an unknown architecture, don't risk using CLMULs.
- case CpuType::kIntelCascadelakeXeon:
- case CpuType::kIntelSkylakeXeon:
- case CpuType::kIntelSkylake:
- case CpuType::kIntelBroadwell:
- case CpuType::kIntelHaswell:
- case CpuType::kIntelIvybridge:
- return {
- /*.temporal=*/new AcceleratedCrcMemcpyEngine<3, 0>(),
- /*.non_temporal=*/new CrcNonTemporalMemcpyAVXEngine(),
- };
- // INTEL_SANDYBRIDGE performs better with SSE than AVX.
- case CpuType::kIntelSandybridge:
- return {
- /*.temporal=*/new AcceleratedCrcMemcpyEngine<3, 0>(),
- /*.non_temporal=*/new CrcNonTemporalMemcpyEngine(),
- };
- default:
- return {/*.temporal=*/new FallbackCrcMemcpyEngine(),
- /*.non_temporal=*/new FallbackCrcMemcpyEngine()};
- }
-#endif // UNDEFINED_BEHAVIOR_SANITIZER
-}
-
-// For testing, allow the user to specify which engine they want.
-std::unique_ptr<CrcMemcpyEngine> CrcMemcpy::GetTestEngine(int vector,
- int integer) {
- if (vector == 3 && integer == 0) {
- return std::make_unique<AcceleratedCrcMemcpyEngine<3, 0>>();
- } else if (vector == 1 && integer == 2) {
- return std::make_unique<AcceleratedCrcMemcpyEngine<1, 2>>();
- }
- return nullptr;
-}
-
-} // namespace crc_internal
-Y_ABSL_NAMESPACE_END
-} // namespace y_absl
-
-#endif // Y_ABSL_INTERNAL_HAVE_X86_64_ACCELERATED_CRC_MEMCPY_ENGINE
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy_x86_arm_combined.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy_x86_arm_combined.cc
new file mode 100644
index 00000000000..e88e235cd47
--- /dev/null
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_memcpy_x86_arm_combined.cc
@@ -0,0 +1,450 @@
+// Copyright 2022 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Simultaneous memcopy and CRC-32C for x86-64 and ARM 64. Uses integer
+// registers because XMM registers do not support the CRC instruction (yet).
+// While copying, compute the running CRC of the data being copied.
+//
+// It is assumed that any CPU running this code has SSE4.2 instructions
+// available (for CRC32C). This file will do nothing if that is not true.
+//
+// The CRC instruction has a 3-byte latency, and we are stressing the ALU ports
+// here (unlike a traditional memcopy, which has almost no ALU use), so we will
+// need to copy in such a way that the CRC unit is used efficiently. We have two
+// regimes in this code:
+// 1. For operations of size < kCrcSmallSize, do the CRC then the memcpy
+// 2. For operations of size > kCrcSmallSize:
+// a) compute an initial CRC + copy on a small amount of data to align the
+// destination pointer on a 16-byte boundary.
+// b) Split the data into 3 main regions and a tail (smaller than 48 bytes)
+// c) Do the copy and CRC of the 3 main regions, interleaving (start with
+// full cache line copies for each region, then move to single 16 byte
+// pieces per region).
+// d) Combine the CRCs with CRC32C::Concat.
+// e) Copy the tail and extend the CRC with the CRC of the tail.
+// This method is not ideal for op sizes between ~1k and ~8k because CRC::Concat
+// takes a significant amount of time. A medium-sized approach could be added
+// using 3 CRCs over fixed-size blocks where the zero-extensions required for
+// CRC32C::Concat can be precomputed.
+
+#ifdef __SSE4_2__
+#include <immintrin.h>
+#endif
+
+#ifdef _MSC_VER
+#include <intrin.h>
+#endif
+
+#include <array>
+#include <cstddef>
+#include <cstdint>
+#include <cstring>
+#include <memory>
+
+#include "y_absl/base/config.h"
+#include "y_absl/base/optimization.h"
+#include "y_absl/base/prefetch.h"
+#include "y_absl/crc/crc32c.h"
+#include "y_absl/crc/internal/cpu_detect.h"
+#include "y_absl/crc/internal/crc32_x86_arm_combined_simd.h"
+#include "y_absl/crc/internal/crc_memcpy.h"
+#include "y_absl/strings/string_view.h"
+
+#if defined(Y_ABSL_INTERNAL_HAVE_X86_64_ACCELERATED_CRC_MEMCPY_ENGINE) || \
+ defined(Y_ABSL_INTERNAL_HAVE_ARM_ACCELERATED_CRC_MEMCPY_ENGINE)
+
+namespace y_absl {
+Y_ABSL_NAMESPACE_BEGIN
+namespace crc_internal {
+
+namespace {
+
+inline crc32c_t ShortCrcCopy(char* dst, const char* src, std::size_t length,
+ crc32c_t crc) {
+ // Small copy: just go 1 byte at a time: being nice to the branch predictor
+ // is more important here than anything else
+ uint32_t crc_uint32 = static_cast<uint32_t>(crc);
+ for (std::size_t i = 0; i < length; i++) {
+ uint8_t data = *reinterpret_cast<const uint8_t*>(src);
+ crc_uint32 = CRC32_u8(crc_uint32, data);
+ *reinterpret_cast<uint8_t*>(dst) = data;
+ ++src;
+ ++dst;
+ }
+ return crc32c_t{crc_uint32};
+}
+
+constexpr size_t kIntLoadsPerVec = sizeof(V128) / sizeof(uint64_t);
+
+// Common function for copying the tails of multiple large regions.
+template <size_t vec_regions, size_t int_regions>
+inline void LargeTailCopy(crc32c_t* crcs, char** dst, const char** src,
+ size_t region_size, size_t copy_rounds) {
+ std::array<V128, vec_regions> data;
+ std::array<uint64_t, kIntLoadsPerVec * int_regions> int_data;
+
+ while (copy_rounds > 0) {
+ for (size_t i = 0; i < vec_regions; i++) {
+ size_t region = i;
+
+ auto* vsrc = reinterpret_cast<const V128*>(*src + region_size * region);
+ auto* vdst = reinterpret_cast<V128*>(*dst + region_size * region);
+
+ // Load the blocks, unaligned
+ data[i] = V128_LoadU(vsrc);
+
+ // Store the blocks, aligned
+ V128_Store(vdst, data[i]);
+
+ // Compute the running CRC
+ crcs[region] = crc32c_t{static_cast<uint32_t>(
+ CRC32_u64(static_cast<uint32_t>(crcs[region]),
+ static_cast<uint64_t>(V128_Extract64<0>(data[i]))))};
+ crcs[region] = crc32c_t{static_cast<uint32_t>(
+ CRC32_u64(static_cast<uint32_t>(crcs[region]),
+ static_cast<uint64_t>(V128_Extract64<1>(data[i]))))};
+ }
+
+ for (size_t i = 0; i < int_regions; i++) {
+ size_t region = vec_regions + i;
+
+ auto* usrc =
+ reinterpret_cast<const uint64_t*>(*src + region_size * region);
+ auto* udst = reinterpret_cast<uint64_t*>(*dst + region_size * region);
+
+ for (size_t j = 0; j < kIntLoadsPerVec; j++) {
+ size_t data_index = i * kIntLoadsPerVec + j;
+
+ int_data[data_index] = *(usrc + j);
+ crcs[region] = crc32c_t{static_cast<uint32_t>(CRC32_u64(
+ static_cast<uint32_t>(crcs[region]), int_data[data_index]))};
+
+ *(udst + j) = int_data[data_index];
+ }
+ }
+
+ // Increment pointers
+ *src += sizeof(V128);
+ *dst += sizeof(V128);
+ --copy_rounds;
+ }
+}
+
+} // namespace
+
+template <size_t vec_regions, size_t int_regions>
+class AcceleratedCrcMemcpyEngine : public CrcMemcpyEngine {
+ public:
+ AcceleratedCrcMemcpyEngine() = default;
+ AcceleratedCrcMemcpyEngine(const AcceleratedCrcMemcpyEngine&) = delete;
+ AcceleratedCrcMemcpyEngine operator=(const AcceleratedCrcMemcpyEngine&) =
+ delete;
+
+ crc32c_t Compute(void* __restrict dst, const void* __restrict src,
+ std::size_t length, crc32c_t initial_crc) const override;
+};
+
+template <size_t vec_regions, size_t int_regions>
+crc32c_t AcceleratedCrcMemcpyEngine<vec_regions, int_regions>::Compute(
+ void* __restrict dst, const void* __restrict src, std::size_t length,
+ crc32c_t initial_crc) const {
+ constexpr std::size_t kRegions = vec_regions + int_regions;
+ static_assert(kRegions > 0, "Must specify at least one region.");
+ constexpr uint32_t kCrcDataXor = uint32_t{0xffffffff};
+ constexpr std::size_t kBlockSize = sizeof(V128);
+ constexpr std::size_t kCopyRoundSize = kRegions * kBlockSize;
+
+ // Number of blocks per cacheline.
+ constexpr std::size_t kBlocksPerCacheLine = Y_ABSL_CACHELINE_SIZE / kBlockSize;
+
+ char* dst_bytes = static_cast<char*>(dst);
+ const char* src_bytes = static_cast<const char*>(src);
+
+ // Make sure that one prefetch per big block is enough to cover the whole
+ // dataset, and we don't prefetch too much.
+ static_assert(Y_ABSL_CACHELINE_SIZE % kBlockSize == 0,
+ "Cache lines are not divided evenly into blocks, may have "
+ "unintended behavior!");
+
+ // Experimentally-determined boundary between a small and large copy.
+ // Below this number, spin-up and concatenation of CRCs takes enough time that
+ // it kills the throughput gains of using 3 regions and wide vectors.
+ constexpr size_t kCrcSmallSize = 256;
+
+ // Experimentally-determined prefetch distance. Main loop copies will
+ // prefeth data 2 cache lines ahead.
+ constexpr std::size_t kPrefetchAhead = 2 * Y_ABSL_CACHELINE_SIZE;
+
+ // Small-size CRC-memcpy : just do CRC + memcpy
+ if (length < kCrcSmallSize) {
+ crc32c_t crc =
+ ExtendCrc32c(initial_crc, y_absl::string_view(src_bytes, length));
+ memcpy(dst, src, length);
+ return crc;
+ }
+
+ // Start work on the CRC: undo the XOR from the previous calculation or set up
+ // the initial value of the CRC.
+ // initial_crc ^= kCrcDataXor;
+ initial_crc = crc32c_t{static_cast<uint32_t>(initial_crc) ^ kCrcDataXor};
+
+ // Do an initial alignment copy, so we can use aligned store instructions to
+ // the destination pointer. We align the destination pointer because the
+ // penalty for an unaligned load is small compared to the penalty of an
+ // unaligned store on modern CPUs.
+ std::size_t bytes_from_last_aligned =
+ reinterpret_cast<uintptr_t>(dst) & (kBlockSize - 1);
+ if (bytes_from_last_aligned != 0) {
+ std::size_t bytes_for_alignment = kBlockSize - bytes_from_last_aligned;
+
+ // Do the short-sized copy and CRC.
+ initial_crc =
+ ShortCrcCopy(dst_bytes, src_bytes, bytes_for_alignment, initial_crc);
+ src_bytes += bytes_for_alignment;
+ dst_bytes += bytes_for_alignment;
+ length -= bytes_for_alignment;
+ }
+
+ // We are going to do the copy and CRC in kRegions regions to make sure that
+ // we can saturate the CRC unit. The CRCs will be combined at the end of the
+ // run. Copying will use the SSE registers, and we will extract words from
+ // the SSE registers to add to the CRC. Initially, we run the loop one full
+ // cache line per region at a time, in order to insert prefetches.
+
+ // Initialize CRCs for kRegions regions.
+ crc32c_t crcs[kRegions];
+ crcs[0] = initial_crc;
+ for (size_t i = 1; i < kRegions; i++) {
+ crcs[i] = crc32c_t{kCrcDataXor};
+ }
+
+ // Find the number of rounds to copy and the region size. Also compute the
+ // tail size here.
+ size_t copy_rounds = length / kCopyRoundSize;
+
+ // Find the size of each region and the size of the tail.
+ const std::size_t region_size = copy_rounds * kBlockSize;
+ const std::size_t tail_size = length - (kRegions * region_size);
+
+ // Holding registers for data in each region.
+ std::array<V128, vec_regions> vec_data;
+ std::array<uint64_t, int_regions * kIntLoadsPerVec> int_data;
+
+ // Main loop.
+ while (copy_rounds > kBlocksPerCacheLine) {
+ // Prefetch kPrefetchAhead bytes ahead of each pointer.
+ for (size_t i = 0; i < kRegions; i++) {
+ y_absl::PrefetchToLocalCache(src_bytes + kPrefetchAhead + region_size * i);
+#ifdef Y_ABSL_INTERNAL_HAVE_X86_64_ACCELERATED_CRC_MEMCPY_ENGINE
+ // TODO(b/297082454): investigate dropping prefetch on x86.
+ y_absl::PrefetchToLocalCache(dst_bytes + kPrefetchAhead + region_size * i);
+#endif
+ }
+
+ // Load and store data, computing CRC on the way.
+ for (size_t i = 0; i < kBlocksPerCacheLine; i++) {
+ // Copy and CRC the data for the CRC regions.
+ for (size_t j = 0; j < vec_regions; j++) {
+ // Cycle which regions get vector load/store and integer load/store, to
+ // engage prefetching logic around vector load/stores and save issue
+ // slots by using the integer registers.
+ size_t region = (j + i) % kRegions;
+
+ auto* vsrc =
+ reinterpret_cast<const V128*>(src_bytes + region_size * region);
+ auto* vdst = reinterpret_cast<V128*>(dst_bytes + region_size * region);
+
+ // Load and CRC data.
+ vec_data[j] = V128_LoadU(vsrc + i);
+ crcs[region] = crc32c_t{static_cast<uint32_t>(
+ CRC32_u64(static_cast<uint32_t>(crcs[region]),
+ static_cast<uint64_t>(V128_Extract64<0>(vec_data[j]))))};
+ crcs[region] = crc32c_t{static_cast<uint32_t>(
+ CRC32_u64(static_cast<uint32_t>(crcs[region]),
+ static_cast<uint64_t>(V128_Extract64<1>(vec_data[j]))))};
+
+ // Store the data.
+ V128_Store(vdst + i, vec_data[j]);
+ }
+
+ // Preload the partial CRCs for the CLMUL subregions.
+ for (size_t j = 0; j < int_regions; j++) {
+ // Cycle which regions get vector load/store and integer load/store, to
+ // engage prefetching logic around vector load/stores and save issue
+ // slots by using the integer registers.
+ size_t region = (j + vec_regions + i) % kRegions;
+
+ auto* usrc =
+ reinterpret_cast<const uint64_t*>(src_bytes + region_size * region);
+ auto* udst =
+ reinterpret_cast<uint64_t*>(dst_bytes + region_size * region);
+
+ for (size_t k = 0; k < kIntLoadsPerVec; k++) {
+ size_t data_index = j * kIntLoadsPerVec + k;
+
+ // Load and CRC the data.
+ int_data[data_index] = *(usrc + i * kIntLoadsPerVec + k);
+ crcs[region] = crc32c_t{static_cast<uint32_t>(CRC32_u64(
+ static_cast<uint32_t>(crcs[region]), int_data[data_index]))};
+
+ // Store the data.
+ *(udst + i * kIntLoadsPerVec + k) = int_data[data_index];
+ }
+ }
+ }
+
+ // Increment pointers
+ src_bytes += kBlockSize * kBlocksPerCacheLine;
+ dst_bytes += kBlockSize * kBlocksPerCacheLine;
+ copy_rounds -= kBlocksPerCacheLine;
+ }
+
+ // Copy and CRC the tails of each region.
+ LargeTailCopy<vec_regions, int_regions>(crcs, &dst_bytes, &src_bytes,
+ region_size, copy_rounds);
+
+ // Move the source and destination pointers to the end of the region
+ src_bytes += region_size * (kRegions - 1);
+ dst_bytes += region_size * (kRegions - 1);
+
+ // Copy and CRC the tail through the XMM registers.
+ std::size_t tail_blocks = tail_size / kBlockSize;
+ LargeTailCopy<0, 1>(&crcs[kRegions - 1], &dst_bytes, &src_bytes, 0,
+ tail_blocks);
+
+ // Final tail copy for under 16 bytes.
+ crcs[kRegions - 1] =
+ ShortCrcCopy(dst_bytes, src_bytes, tail_size - tail_blocks * kBlockSize,
+ crcs[kRegions - 1]);
+
+ if (kRegions == 1) {
+ // If there is only one region, finalize and return its CRC.
+ return crc32c_t{static_cast<uint32_t>(crcs[0]) ^ kCrcDataXor};
+ }
+
+ // Finalize the first CRCs: XOR the internal CRCs by the XOR mask to undo the
+ // XOR done before doing block copy + CRCs.
+ for (size_t i = 0; i + 1 < kRegions; i++) {
+ crcs[i] = crc32c_t{static_cast<uint32_t>(crcs[i]) ^ kCrcDataXor};
+ }
+
+ // Build a CRC of the first kRegions - 1 regions.
+ crc32c_t full_crc = crcs[0];
+ for (size_t i = 1; i + 1 < kRegions; i++) {
+ full_crc = ConcatCrc32c(full_crc, crcs[i], region_size);
+ }
+
+ // Finalize and concatenate the final CRC, then return.
+ crcs[kRegions - 1] =
+ crc32c_t{static_cast<uint32_t>(crcs[kRegions - 1]) ^ kCrcDataXor};
+ return ConcatCrc32c(full_crc, crcs[kRegions - 1], region_size + tail_size);
+}
+
+CrcMemcpy::ArchSpecificEngines CrcMemcpy::GetArchSpecificEngines() {
+#ifdef UNDEFINED_BEHAVIOR_SANITIZER
+ // UBSAN does not play nicely with unaligned loads (which we use a lot).
+ // Get the underlying architecture.
+ CpuType cpu_type = GetCpuType();
+ switch (cpu_type) {
+ case CpuType::kAmdRome:
+ case CpuType::kAmdNaples:
+ case CpuType::kAmdMilan:
+ case CpuType::kAmdGenoa:
+ case CpuType::kAmdRyzenV3000:
+ case CpuType::kIntelCascadelakeXeon:
+ case CpuType::kIntelSkylakeXeon:
+ case CpuType::kIntelSkylake:
+ case CpuType::kIntelBroadwell:
+ case CpuType::kIntelHaswell:
+ case CpuType::kIntelIvybridge:
+ return {
+ /*.temporal=*/new FallbackCrcMemcpyEngine(),
+ /*.non_temporal=*/new CrcNonTemporalMemcpyAVXEngine(),
+ };
+ // INTEL_SANDYBRIDGE performs better with SSE than AVX.
+ case CpuType::kIntelSandybridge:
+ return {
+ /*.temporal=*/new FallbackCrcMemcpyEngine(),
+ /*.non_temporal=*/new CrcNonTemporalMemcpyEngine(),
+ };
+ default:
+ return {/*.temporal=*/new FallbackCrcMemcpyEngine(),
+ /*.non_temporal=*/new FallbackCrcMemcpyEngine()};
+ }
+#else
+ // Get the underlying architecture.
+ CpuType cpu_type = GetCpuType();
+ switch (cpu_type) {
+ // On Zen 2, PEXTRQ uses 2 micro-ops, including one on the vector store port
+ // which data movement from the vector registers to the integer registers
+ // (where CRC32C happens) to crowd the same units as vector stores. As a
+ // result, using that path exclusively causes bottlenecking on this port.
+ // We can avoid this bottleneck by using the integer side of the CPU for
+ // most operations rather than the vector side. We keep a vector region to
+ // engage some of the prefetching logic in the cache hierarchy which seems
+ // to give vector instructions special treatment. These prefetch units see
+ // strided access to each region, and do the right thing.
+ case CpuType::kAmdRome:
+ case CpuType::kAmdNaples:
+ case CpuType::kAmdMilan:
+ case CpuType::kAmdGenoa:
+ case CpuType::kAmdRyzenV3000:
+ return {
+ /*.temporal=*/new AcceleratedCrcMemcpyEngine<1, 2>(),
+ /*.non_temporal=*/new CrcNonTemporalMemcpyAVXEngine(),
+ };
+ // PCLMULQDQ is slow and we don't have wide enough issue width to take
+ // advantage of it. For an unknown architecture, don't risk using CLMULs.
+ case CpuType::kIntelCascadelakeXeon:
+ case CpuType::kIntelSkylakeXeon:
+ case CpuType::kIntelSkylake:
+ case CpuType::kIntelBroadwell:
+ case CpuType::kIntelHaswell:
+ case CpuType::kIntelIvybridge:
+ return {
+ /*.temporal=*/new AcceleratedCrcMemcpyEngine<3, 0>(),
+ /*.non_temporal=*/new CrcNonTemporalMemcpyAVXEngine(),
+ };
+ // INTEL_SANDYBRIDGE performs better with SSE than AVX.
+ case CpuType::kIntelSandybridge:
+ return {
+ /*.temporal=*/new AcceleratedCrcMemcpyEngine<3, 0>(),
+ /*.non_temporal=*/new CrcNonTemporalMemcpyEngine(),
+ };
+ default:
+ return {/*.temporal=*/new FallbackCrcMemcpyEngine(),
+ /*.non_temporal=*/new FallbackCrcMemcpyEngine()};
+ }
+#endif // UNDEFINED_BEHAVIOR_SANITIZER
+}
+
+// For testing, allow the user to specify which engine they want.
+std::unique_ptr<CrcMemcpyEngine> CrcMemcpy::GetTestEngine(int vector,
+ int integer) {
+ if (vector == 3 && integer == 0) {
+ return std::make_unique<AcceleratedCrcMemcpyEngine<3, 0>>();
+ } else if (vector == 1 && integer == 2) {
+ return std::make_unique<AcceleratedCrcMemcpyEngine<1, 2>>();
+ } else if (vector == 1 && integer == 0) {
+ return std::make_unique<AcceleratedCrcMemcpyEngine<1, 0>>();
+ }
+ return nullptr;
+}
+
+} // namespace crc_internal
+Y_ABSL_NAMESPACE_END
+} // namespace y_absl
+
+#endif // Y_ABSL_INTERNAL_HAVE_X86_64_ACCELERATED_CRC_MEMCPY_ENGINE ||
+ // Y_ABSL_INTERNAL_HAVE_ARM_ACCELERATED_CRC_MEMCPY_ENGINE
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_x86_arm_combined.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_x86_arm_combined.cc
index 4ab374da9cd..d72151a5f17 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_x86_arm_combined.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/crc/internal/crc_x86_arm_combined.cc
@@ -16,14 +16,14 @@
#include <cstddef>
#include <cstdint>
+#include <memory>
+#include <vector>
#include "y_absl/base/attributes.h"
#include "y_absl/base/config.h"
-#include "y_absl/base/dynamic_annotations.h"
#include "y_absl/base/internal/endian.h"
#include "y_absl/base/prefetch.h"
#include "y_absl/crc/internal/cpu_detect.h"
-#include "y_absl/crc/internal/crc.h"
#include "y_absl/crc/internal/crc32_x86_arm_combined_simd.h"
#include "y_absl/crc/internal/crc_internal.h"
#include "y_absl/memory/memory.h"
@@ -634,8 +634,16 @@ CRCImpl* TryNewCRC32AcceleratedX86ARMCombined() {
return new CRC32AcceleratedX86ARMCombinedMultipleStreams<
3, 0, CutoffStrategy::Fold3>();
case CpuType::kArmNeoverseN1:
+ case CpuType::kArmNeoverseN2:
+ case CpuType::kArmNeoverseV1:
return new CRC32AcceleratedX86ARMCombinedMultipleStreams<
1, 1, CutoffStrategy::Unroll64CRC>();
+ case CpuType::kAmpereSiryn:
+ return new CRC32AcceleratedX86ARMCombinedMultipleStreams<
+ 3, 2, CutoffStrategy::Fold3>();
+ case CpuType::kArmNeoverseV2:
+ return new CRC32AcceleratedX86ARMCombinedMultipleStreams<
+ 1, 2, CutoffStrategy::Unroll64CRC>();
#if defined(__aarch64__)
default:
// Not all ARM processors support the needed instructions, so check here
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/failure_signal_handler.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/failure_signal_handler.cc
index ab8b62dda2d..cd983d5118c 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/failure_signal_handler.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/failure_signal_handler.cc
@@ -54,7 +54,7 @@
#include "y_absl/debugging/internal/examine_stack.h"
#include "y_absl/debugging/stacktrace.h"
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__wasi__)
#define Y_ABSL_HAVE_SIGACTION
// Apple WatchOS and TVOS don't allow sigaltstack
// Apple macOS has sigaltstack, but using it makes backtrace() unusable.
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/address_is_readable.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/address_is_readable.cc
index 3e0ce9fc6c9..3cddf64deaa 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/address_is_readable.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/address_is_readable.cc
@@ -50,8 +50,10 @@ namespace debugging_internal {
// NOTE: any new system calls here may also require sandbox reconfiguration.
//
bool AddressIsReadable(const void *addr) {
- // Align address on 8-byte boundary. On aarch64, checking last
- // byte before inaccessible page returned unexpected EFAULT.
+ // rt_sigprocmask below checks 8 contiguous bytes. If addr resides in the
+ // last 7 bytes of a page (unaligned), rt_sigprocmask would additionally
+ // check the readability of the next page, which is not desired. Align
+ // address on 8-byte boundary to check only the current page.
const uintptr_t u_addr = reinterpret_cast<uintptr_t>(addr) & ~uintptr_t{7};
addr = reinterpret_cast<const void *>(u_addr);
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/demangle.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/demangle.cc
index d9a1e33ed86..f79c798eef5 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/demangle.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/demangle.cc
@@ -21,7 +21,15 @@
#include <cstdint>
#include <cstdio>
+#include <cstdlib>
#include <limits>
+#include <util/generic/string.h>
+
+#include "y_absl/base/config.h"
+
+#if Y_ABSL_INTERNAL_HAS_CXA_DEMANGLE
+#include <cxxabi.h>
+#endif
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
@@ -1983,6 +1991,22 @@ bool Demangle(const char* mangled, char* out, size_t out_size) {
state.parse_state.out_cur_idx > 0;
}
+TString DemangleString(const char* mangled) {
+ TString out;
+ int status = 0;
+ char* demangled = nullptr;
+#if Y_ABSL_INTERNAL_HAS_CXA_DEMANGLE
+ demangled = abi::__cxa_demangle(mangled, nullptr, nullptr, &status);
+#endif
+ if (status == 0 && demangled != nullptr) {
+ out.append(demangled);
+ free(demangled);
+ } else {
+ out.append(mangled);
+ }
+ return out;
+}
+
} // namespace debugging_internal
Y_ABSL_NAMESPACE_END
} // namespace y_absl
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/demangle.h b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/demangle.h
index 5ed51a15478..6acfee2c508 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/demangle.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/demangle.h
@@ -12,13 +12,23 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// An async-signal-safe and thread-safe demangler for Itanium C++ ABI
-// (aka G++ V3 ABI).
+#ifndef Y_ABSL_DEBUGGING_INTERNAL_DEMANGLE_H_
+#define Y_ABSL_DEBUGGING_INTERNAL_DEMANGLE_H_
+
+#include <util/generic/string.h>
+#include "y_absl/base/config.h"
+
+namespace y_absl {
+Y_ABSL_NAMESPACE_BEGIN
+namespace debugging_internal {
+
+// Demangle `mangled`. On success, return true and write the
+// demangled symbol name to `out`. Otherwise, return false.
+// `out` is modified even if demangling is unsuccessful.
//
-// The demangler is implemented to be used in async signal handlers to
-// symbolize stack traces. We cannot use libstdc++'s
-// abi::__cxa_demangle() in such signal handlers since it's not async
-// signal safe (it uses malloc() internally).
+// This function provides an alternative to libstdc++'s abi::__cxa_demangle,
+// which is not async signal safe (it uses malloc internally). It's intended to
+// be used in async signal handlers to symbolize stack traces.
//
// Note that this demangler doesn't support full demangling. More
// specifically, it doesn't print types of function parameters and
@@ -30,40 +40,32 @@
//
// Example:
//
-// | Mangled Name | The Demangler | abi::__cxa_demangle()
-// |---------------|---------------|-----------------------
-// | _Z1fv | f() | f()
-// | _Z1fi | f() | f(int)
-// | _Z3foo3bar | foo() | foo(bar)
-// | _Z1fIiEvi | f<>() | void f<int>(int)
-// | _ZN1N1fE | N::f | N::f
-// | _ZN3Foo3BarEv | Foo::Bar() | Foo::Bar()
-// | _Zrm1XS_" | operator%() | operator%(X, X)
-// | _ZN3FooC1Ev | Foo::Foo() | Foo::Foo()
-// | _Z1fSs | f() | f(std::basic_string<char,
-// | | | std::char_traits<char>,
-// | | | std::allocator<char> >)
+// | Mangled Name | Demangle | DemangleString
+// |---------------|-------------|-----------------------
+// | _Z1fv | f() | f()
+// | _Z1fi | f() | f(int)
+// | _Z3foo3bar | foo() | foo(bar)
+// | _Z1fIiEvi | f<>() | void f<int>(int)
+// | _ZN1N1fE | N::f | N::f
+// | _ZN3Foo3BarEv | Foo::Bar() | Foo::Bar()
+// | _Zrm1XS_" | operator%() | operator%(X, X)
+// | _ZN3FooC1Ev | Foo::Foo() | Foo::Foo()
+// | _Z1fSs | f() | f(std::basic_string<char,
+// | | | std::char_traits<char>,
+// | | | std::allocator<char> >)
//
// See the unit test for more examples.
//
// Note: we might want to write demanglers for ABIs other than Itanium
// C++ ABI in the future.
-//
-
-#ifndef Y_ABSL_DEBUGGING_INTERNAL_DEMANGLE_H_
-#define Y_ABSL_DEBUGGING_INTERNAL_DEMANGLE_H_
-
-#include "y_absl/base/config.h"
-
-namespace y_absl {
-Y_ABSL_NAMESPACE_BEGIN
-namespace debugging_internal {
-
-// Demangle `mangled`. On success, return true and write the
-// demangled symbol name to `out`. Otherwise, return false.
-// `out` is modified even if demangling is unsuccessful.
bool Demangle(const char* mangled, char* out, size_t out_size);
+// A wrapper around `abi::__cxa_demangle()`. On success, returns the demangled
+// name. On failure, returns the input mangled name.
+//
+// This function is not async-signal-safe.
+TString DemangleString(const char* mangled);
+
} // namespace debugging_internal
Y_ABSL_NAMESPACE_END
} // namespace y_absl
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/stacktrace_aarch64-inl.inc b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/stacktrace_aarch64-inl.inc
index 04531613f8a..7c7c0304e34 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/stacktrace_aarch64-inl.inc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/stacktrace_aarch64-inl.inc
@@ -4,6 +4,7 @@
// Generate stack tracer for aarch64
#if defined(__linux__)
+#include <signal.h>
#include <sys/mman.h>
#include <ucontext.h>
#include <unistd.h>
@@ -70,7 +71,7 @@ static const unsigned char* GetKernelRtSigreturnAddress() {
// Compute the size of a stack frame in [low..high). We assume that
// low < high. Return size of kUnknownFrameSize.
template<typename T>
-static inline size_t ComputeStackFrameSize(const T* low,
+static size_t ComputeStackFrameSize(const T* low,
const T* high) {
const char* low_char_ptr = reinterpret_cast<const char *>(low);
const char* high_char_ptr = reinterpret_cast<const char *>(high);
@@ -78,6 +79,20 @@ static inline size_t ComputeStackFrameSize(const T* low,
: kUnknownFrameSize;
}
+// Saves stack info that is expensive to calculate to avoid recalculating per frame.
+struct StackInfo {
+ uintptr_t stack_low;
+ uintptr_t stack_high;
+ uintptr_t sig_stack_low;
+ uintptr_t sig_stack_high;
+};
+
+static bool InsideSignalStack(void** ptr, const StackInfo* stack_info) {
+ uintptr_t comparable_ptr = reinterpret_cast<uintptr_t>(ptr);
+ return (comparable_ptr >= stack_info->sig_stack_low &&
+ comparable_ptr < stack_info->sig_stack_high);
+}
+
// Given a pointer to a stack frame, locate and return the calling
// stackframe, or return null if no stackframe can be found. Perform sanity
// checks (the strictness of which is controlled by the boolean parameter
@@ -86,9 +101,8 @@ template<bool STRICT_UNWINDING, bool WITH_CONTEXT>
Y_ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack.
Y_ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack.
static void **NextStackFrame(void **old_frame_pointer, const void *uc,
- size_t stack_low, size_t stack_high) {
+ const StackInfo *stack_info) {
void **new_frame_pointer = reinterpret_cast<void**>(*old_frame_pointer);
- bool check_frame_size = true;
#if defined(__linux__)
if (WITH_CONTEXT && uc != nullptr) {
@@ -114,10 +128,6 @@ static void **NextStackFrame(void **old_frame_pointer, const void *uc,
if (!y_absl::debugging_internal::AddressIsReadable(
new_frame_pointer))
return nullptr;
-
- // Skip frame size check if we return from a signal. We may be using a
- // an alternate stack for signals.
- check_frame_size = false;
}
}
#endif
@@ -126,9 +136,11 @@ static void **NextStackFrame(void **old_frame_pointer, const void *uc,
if ((reinterpret_cast<uintptr_t>(new_frame_pointer) & 7) != 0)
return nullptr;
- // Check frame size. In strict mode, we assume frames to be under
- // 100,000 bytes. In non-strict mode, we relax the limit to 1MB.
- if (check_frame_size) {
+ // Only check the size if both frames are in the same stack.
+ if (InsideSignalStack(new_frame_pointer, stack_info) ==
+ InsideSignalStack(old_frame_pointer, stack_info)) {
+ // Check frame size. In strict mode, we assume frames to be under
+ // 100,000 bytes. In non-strict mode, we relax the limit to 1MB.
const size_t max_size = STRICT_UNWINDING ? 100000 : 1000000;
const size_t frame_size =
ComputeStackFrameSize(old_frame_pointer, new_frame_pointer);
@@ -136,15 +148,21 @@ static void **NextStackFrame(void **old_frame_pointer, const void *uc,
return nullptr;
// A very large frame may mean corrupt memory or an erroneous frame
// pointer. But also maybe just a plain-old large frame. Assume that if the
- // frame is within the known stack, then it is valid.
+ // frame is within a known stack, then it is valid.
if (frame_size > max_size) {
- if (stack_high < kUnknownStackEnd &&
+ size_t stack_low = stack_info->stack_low;
+ size_t stack_high = stack_info->stack_high;
+ if (InsideSignalStack(new_frame_pointer, stack_info)) {
+ stack_low = stack_info->sig_stack_low;
+ stack_high = stack_info->sig_stack_high;
+ }
+ if (stack_high < kUnknownStackEnd &&
static_cast<size_t>(getpagesize()) < stack_low) {
const uintptr_t new_fp_u =
reinterpret_cast<uintptr_t>(new_frame_pointer);
// Stack bounds are known.
if (!(stack_low < new_fp_u && new_fp_u <= stack_high)) {
- // new_frame_pointer is not within the known stack.
+ // new_frame_pointer is not within a known stack.
return nullptr;
}
} else {
@@ -158,6 +176,9 @@ static void **NextStackFrame(void **old_frame_pointer, const void *uc,
}
template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
+// We count on the bottom frame being this one. See the comment
+// at prev_return_address
+Y_ABSL_ATTRIBUTE_NOINLINE
Y_ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack.
Y_ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack.
static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count,
@@ -171,8 +192,11 @@ static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count,
int n = 0;
// Assume that the first page is not stack.
- size_t stack_low = static_cast<size_t>(getpagesize());
- size_t stack_high = kUnknownStackEnd;
+ StackInfo stack_info;
+ stack_info.stack_low = static_cast<uintptr_t>(getpagesize());
+ stack_info.stack_high = kUnknownStackEnd;
+ stack_info.sig_stack_low = stack_info.stack_low;
+ stack_info.sig_stack_high = kUnknownStackEnd;
// The frame pointer points to low address of a frame. The first 64-bit
// word of a frame points to the next frame up the call chain, which normally
@@ -207,7 +231,7 @@ static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count,
// that is as complete as possible (even if it contains a few bogus
// entries in some rare cases).
frame_pointer = NextStackFrame<!IS_STACK_FRAMES, IS_WITH_CONTEXT>(
- frame_pointer, ucp, stack_low, stack_high);
+ frame_pointer, ucp, &stack_info);
}
if (min_dropped_frames != nullptr) {
@@ -222,7 +246,7 @@ static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count,
num_dropped_frames++;
}
frame_pointer = NextStackFrame<!IS_STACK_FRAMES, IS_WITH_CONTEXT>(
- frame_pointer, ucp, stack_low, stack_high);
+ frame_pointer, ucp, &stack_info);
}
*min_dropped_frames = num_dropped_frames;
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/symbolize_elf.inc b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/symbolize_elf.inc
index 81e31e01c8e..bb5c12458bf 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/symbolize_elf.inc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/symbolize_elf.inc
@@ -289,6 +289,30 @@ ObjFile *AddrMap::Add() {
return new (&obj_[size_++]) ObjFile;
}
+class CachingFile {
+ public:
+ // Setup reader for fd that uses buf[0, buf_size-1] as a cache.
+ CachingFile(int fd, char *buf, size_t buf_size)
+ : fd_(fd),
+ cache_(buf),
+ cache_size_(buf_size),
+ cache_start_(0),
+ cache_limit_(0) {}
+
+ int fd() const { return fd_; }
+ ssize_t ReadFromOffset(void *buf, size_t count, off_t offset);
+ bool ReadFromOffsetExact(void *buf, size_t count, off_t offset);
+
+ private:
+ // Bytes [cache_start_, cache_limit_-1] from fd_ are stored in
+ // a prefix of cache_[0, cache_size_-1].
+ int fd_;
+ char *cache_;
+ size_t cache_size_;
+ off_t cache_start_;
+ off_t cache_limit_;
+};
+
// ---------------------------------------------------------------
enum FindSymbolResult { SYMBOL_NOT_FOUND = 1, SYMBOL_TRUNCATED, SYMBOL_FOUND };
@@ -330,6 +354,7 @@ class Symbolizer {
SYMBOL_BUF_SIZE = 3072,
TMP_BUF_SIZE = 1024,
SYMBOL_CACHE_LINES = 128,
+ FILE_CACHE_SIZE = 8192,
};
AddrMap addr_map_;
@@ -338,6 +363,7 @@ class Symbolizer {
bool addr_map_read_;
char symbol_buf_[SYMBOL_BUF_SIZE];
+ char file_cache_[FILE_CACHE_SIZE];
// tmp_buf_ will be used to store arrays of ElfW(Shdr) and ElfW(Sym)
// so we ensure that tmp_buf_ is properly aligned to store either.
@@ -436,34 +462,58 @@ static ssize_t ReadPersistent(int fd, void *buf, size_t count) {
return static_cast<ssize_t>(num_bytes);
}
-// Read up to "count" bytes from "offset" in the file pointed by file
-// descriptor "fd" into the buffer starting at "buf". On success,
-// return the number of bytes read. Otherwise, return -1.
-static ssize_t ReadFromOffset(const int fd, void *buf, const size_t count,
- const off_t offset) {
- off_t off = lseek(fd, offset, SEEK_SET);
- if (off == (off_t)-1) {
- Y_ABSL_RAW_LOG(WARNING, "lseek(%d, %jd, SEEK_SET) failed: errno=%d", fd,
- static_cast<intmax_t>(offset), errno);
- return -1;
+// Read up to "count" bytes from "offset" into the buffer starting at "buf",
+// while handling short reads and EINTR. On success, return the number of bytes
+// read. Otherwise, return -1.
+ssize_t CachingFile::ReadFromOffset(void *buf, size_t count, off_t offset) {
+ char *dst = static_cast<char *>(buf);
+ size_t read = 0;
+ while (read < count) {
+ // Look in cache first.
+ if (offset >= cache_start_ && offset < cache_limit_) {
+ const char *hit_start = &cache_[offset - cache_start_];
+ const size_t n =
+ std::min(count - read, static_cast<size_t>(cache_limit_ - offset));
+ memcpy(dst, hit_start, n);
+ dst += n;
+ read += static_cast<size_t>(n);
+ offset += static_cast<off_t>(n);
+ continue;
+ }
+
+ cache_start_ = 0;
+ cache_limit_ = 0;
+ ssize_t n = pread(fd_, cache_, cache_size_, offset);
+ if (n < 0) {
+ if (errno == EINTR) {
+ continue;
+ }
+ Y_ABSL_RAW_LOG(WARNING, "read failed: errno=%d", errno);
+ return -1;
+ }
+ if (n == 0) { // Reached EOF.
+ break;
+ }
+
+ cache_start_ = offset;
+ cache_limit_ = offset + static_cast<off_t>(n);
+ // Next iteration will copy from cache into dst.
}
- return ReadPersistent(fd, buf, count);
+ return static_cast<ssize_t>(read);
}
-// Try reading exactly "count" bytes from "offset" bytes in a file
-// pointed by "fd" into the buffer starting at "buf" while handling
-// short reads and EINTR. On success, return true. Otherwise, return
-// false.
-static bool ReadFromOffsetExact(const int fd, void *buf, const size_t count,
- const off_t offset) {
- ssize_t len = ReadFromOffset(fd, buf, count, offset);
+// Try reading exactly "count" bytes from "offset" bytes into the buffer
+// starting at "buf" while handling short reads and EINTR. On success, return
+// true. Otherwise, return false.
+bool CachingFile::ReadFromOffsetExact(void *buf, size_t count, off_t offset) {
+ ssize_t len = ReadFromOffset(buf, count, offset);
return len >= 0 && static_cast<size_t>(len) == count;
}
// Returns elf_header.e_type if the file pointed by fd is an ELF binary.
-static int FileGetElfType(const int fd) {
+static int FileGetElfType(CachingFile *file) {
ElfW(Ehdr) elf_header;
- if (!ReadFromOffsetExact(fd, &elf_header, sizeof(elf_header), 0)) {
+ if (!file->ReadFromOffsetExact(&elf_header, sizeof(elf_header), 0)) {
return -1;
}
if (memcmp(elf_header.e_ident, ELFMAG, SELFMAG) != 0) {
@@ -478,8 +528,8 @@ static int FileGetElfType(const int fd) {
// To keep stack consumption low, we would like this function to not get
// inlined.
static Y_ABSL_ATTRIBUTE_NOINLINE bool GetSectionHeaderByType(
- const int fd, ElfW(Half) sh_num, const off_t sh_offset, ElfW(Word) type,
- ElfW(Shdr) * out, char *tmp_buf, size_t tmp_buf_size) {
+ CachingFile *file, ElfW(Half) sh_num, const off_t sh_offset,
+ ElfW(Word) type, ElfW(Shdr) * out, char *tmp_buf, size_t tmp_buf_size) {
ElfW(Shdr) *buf = reinterpret_cast<ElfW(Shdr) *>(tmp_buf);
const size_t buf_entries = tmp_buf_size / sizeof(buf[0]);
const size_t buf_bytes = buf_entries * sizeof(buf[0]);
@@ -490,7 +540,7 @@ static Y_ABSL_ATTRIBUTE_NOINLINE bool GetSectionHeaderByType(
const size_t num_bytes_to_read =
(buf_bytes > num_bytes_left) ? num_bytes_left : buf_bytes;
const off_t offset = sh_offset + static_cast<off_t>(i * sizeof(buf[0]));
- const ssize_t len = ReadFromOffset(fd, buf, num_bytes_to_read, offset);
+ const ssize_t len = file->ReadFromOffset(buf, num_bytes_to_read, offset);
if (len < 0) {
Y_ABSL_RAW_LOG(
WARNING,
@@ -524,11 +574,17 @@ static Y_ABSL_ATTRIBUTE_NOINLINE bool GetSectionHeaderByType(
// but there has (as yet) been no need for anything longer either.
const int kMaxSectionNameLen = 64;
+// Small cache to use for miscellaneous file reads.
+const int kSmallFileCacheSize = 100;
+
bool ForEachSection(int fd,
const std::function<bool(y_absl::string_view name,
const ElfW(Shdr) &)> &callback) {
+ char buf[kSmallFileCacheSize];
+ CachingFile file(fd, buf, sizeof(buf));
+
ElfW(Ehdr) elf_header;
- if (!ReadFromOffsetExact(fd, &elf_header, sizeof(elf_header), 0)) {
+ if (!file.ReadFromOffsetExact(&elf_header, sizeof(elf_header), 0)) {
return false;
}
@@ -540,7 +596,7 @@ bool ForEachSection(int fd,
ElfW(Shdr) shstrtab;
off_t shstrtab_offset = static_cast<off_t>(elf_header.e_shoff) +
elf_header.e_shentsize * elf_header.e_shstrndx;
- if (!ReadFromOffsetExact(fd, &shstrtab, sizeof(shstrtab), shstrtab_offset)) {
+ if (!file.ReadFromOffsetExact(&shstrtab, sizeof(shstrtab), shstrtab_offset)) {
return false;
}
@@ -548,13 +604,13 @@ bool ForEachSection(int fd,
ElfW(Shdr) out;
off_t section_header_offset =
static_cast<off_t>(elf_header.e_shoff) + elf_header.e_shentsize * i;
- if (!ReadFromOffsetExact(fd, &out, sizeof(out), section_header_offset)) {
+ if (!file.ReadFromOffsetExact(&out, sizeof(out), section_header_offset)) {
return false;
}
off_t name_offset = static_cast<off_t>(shstrtab.sh_offset) + out.sh_name;
char header_name[kMaxSectionNameLen];
ssize_t n_read =
- ReadFromOffset(fd, &header_name, kMaxSectionNameLen, name_offset);
+ file.ReadFromOffset(&header_name, kMaxSectionNameLen, name_offset);
if (n_read < 0) {
return false;
} else if (n_read > kMaxSectionNameLen) {
@@ -584,8 +640,10 @@ bool GetSectionHeaderByName(int fd, const char *name, size_t name_len,
return false;
}
+ char buf[kSmallFileCacheSize];
+ CachingFile file(fd, buf, sizeof(buf));
ElfW(Ehdr) elf_header;
- if (!ReadFromOffsetExact(fd, &elf_header, sizeof(elf_header), 0)) {
+ if (!file.ReadFromOffsetExact(&elf_header, sizeof(elf_header), 0)) {
return false;
}
@@ -597,18 +655,18 @@ bool GetSectionHeaderByName(int fd, const char *name, size_t name_len,
ElfW(Shdr) shstrtab;
off_t shstrtab_offset = static_cast<off_t>(elf_header.e_shoff) +
elf_header.e_shentsize * elf_header.e_shstrndx;
- if (!ReadFromOffsetExact(fd, &shstrtab, sizeof(shstrtab), shstrtab_offset)) {
+ if (!file.ReadFromOffsetExact(&shstrtab, sizeof(shstrtab), shstrtab_offset)) {
return false;
}
for (int i = 0; i < elf_header.e_shnum; ++i) {
off_t section_header_offset =
static_cast<off_t>(elf_header.e_shoff) + elf_header.e_shentsize * i;
- if (!ReadFromOffsetExact(fd, out, sizeof(*out), section_header_offset)) {
+ if (!file.ReadFromOffsetExact(out, sizeof(*out), section_header_offset)) {
return false;
}
off_t name_offset = static_cast<off_t>(shstrtab.sh_offset) + out->sh_name;
- ssize_t n_read = ReadFromOffset(fd, &header_name, name_len, name_offset);
+ ssize_t n_read = file.ReadFromOffset(&header_name, name_len, name_offset);
if (n_read < 0) {
return false;
} else if (static_cast<size_t>(n_read) != name_len) {
@@ -683,7 +741,7 @@ static const char *ComputeOffset(const char *base, ptrdiff_t offset) {
// To keep stack consumption low, we would like this function to not get
// inlined.
static Y_ABSL_ATTRIBUTE_NOINLINE FindSymbolResult FindSymbol(
- const void *const pc, const int fd, char *out, size_t out_size,
+ const void *const pc, CachingFile *file, char *out, size_t out_size,
ptrdiff_t relocation, const ElfW(Shdr) * strtab, const ElfW(Shdr) * symtab,
const ElfW(Shdr) * opd, char *tmp_buf, size_t tmp_buf_size) {
if (symtab == nullptr) {
@@ -716,7 +774,7 @@ static Y_ABSL_ATTRIBUTE_NOINLINE FindSymbolResult FindSymbol(
const size_t entries_in_chunk =
std::min(num_remaining_symbols, buf_entries);
const size_t bytes_in_chunk = entries_in_chunk * sizeof(buf[0]);
- const ssize_t len = ReadFromOffset(fd, buf, bytes_in_chunk, offset);
+ const ssize_t len = file->ReadFromOffset(buf, bytes_in_chunk, offset);
SAFE_ASSERT(len >= 0);
SAFE_ASSERT(static_cast<size_t>(len) % sizeof(buf[0]) == 0);
const size_t num_symbols_in_buf = static_cast<size_t>(len) / sizeof(buf[0]);
@@ -772,12 +830,12 @@ static Y_ABSL_ATTRIBUTE_NOINLINE FindSymbolResult FindSymbol(
if (found_match) {
const off_t off =
static_cast<off_t>(strtab->sh_offset) + best_match.st_name;
- const ssize_t n_read = ReadFromOffset(fd, out, out_size, off);
+ const ssize_t n_read = file->ReadFromOffset(out, out_size, off);
if (n_read <= 0) {
// This should never happen.
Y_ABSL_RAW_LOG(WARNING,
- "Unable to read from fd %d at offset %lld: n_read = %zd", fd,
- static_cast<long long>(off), n_read);
+ "Unable to read from fd %d at offset %lld: n_read = %zd",
+ file->fd(), static_cast<long long>(off), n_read);
return SYMBOL_NOT_FOUND;
}
Y_ABSL_RAW_CHECK(static_cast<size_t>(n_read) <= out_size,
@@ -827,22 +885,24 @@ FindSymbolResult Symbolizer::GetSymbolFromObjectFile(
}
}
+ CachingFile file(obj.fd, file_cache_, sizeof(file_cache_));
+
// Consult a regular symbol table, then fall back to the dynamic symbol table.
for (const auto symbol_table_type : {SHT_SYMTAB, SHT_DYNSYM}) {
- if (!GetSectionHeaderByType(obj.fd, obj.elf_header.e_shnum,
+ if (!GetSectionHeaderByType(&file, obj.elf_header.e_shnum,
static_cast<off_t>(obj.elf_header.e_shoff),
static_cast<ElfW(Word)>(symbol_table_type),
&symtab, tmp_buf, tmp_buf_size)) {
continue;
}
- if (!ReadFromOffsetExact(
- obj.fd, &strtab, sizeof(strtab),
+ if (!file.ReadFromOffsetExact(
+ &strtab, sizeof(strtab),
static_cast<off_t>(obj.elf_header.e_shoff +
symtab.sh_link * sizeof(symtab)))) {
continue;
}
const FindSymbolResult rc =
- FindSymbol(pc, obj.fd, out, out_size, relocation, &strtab, &symtab,
+ FindSymbol(pc, &file, out, out_size, relocation, &strtab, &symtab,
opd_ptr, tmp_buf, tmp_buf_size);
if (rc != SYMBOL_NOT_FOUND) {
return rc;
@@ -1323,15 +1383,19 @@ static bool MaybeInitializeObjFile(ObjFile *obj) {
Y_ABSL_RAW_LOG(WARNING, "%s: open failed: errno=%d", obj->filename, errno);
return false;
}
- obj->elf_type = FileGetElfType(obj->fd);
+
+ char buf[kSmallFileCacheSize];
+ CachingFile file(obj->fd, buf, sizeof(buf));
+
+ obj->elf_type = FileGetElfType(&file);
if (obj->elf_type < 0) {
Y_ABSL_RAW_LOG(WARNING, "%s: wrong elf type: %d", obj->filename,
obj->elf_type);
return false;
}
- if (!ReadFromOffsetExact(obj->fd, &obj->elf_header, sizeof(obj->elf_header),
- 0)) {
+ if (!file.ReadFromOffsetExact(&obj->elf_header, sizeof(obj->elf_header),
+ 0)) {
Y_ABSL_RAW_LOG(WARNING, "%s: failed to read elf header", obj->filename);
return false;
}
@@ -1341,7 +1405,7 @@ static bool MaybeInitializeObjFile(ObjFile *obj) {
size_t num_interesting_load_segments = 0;
for (int j = 0; j < phnum; j++) {
ElfW(Phdr) phdr;
- if (!ReadFromOffsetExact(obj->fd, &phdr, sizeof(phdr), phoff)) {
+ if (!file.ReadFromOffsetExact(&phdr, sizeof(phdr), phoff)) {
Y_ABSL_RAW_LOG(WARNING, "%s: failed to read program header %d",
obj->filename, j);
return false;
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/declare.h b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/declare.h
index 0b36402496d..ec2964c7e33 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/declare.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/declare.h
@@ -40,13 +40,8 @@ class Flag;
// Flag
//
// Forward declaration of the `y_absl::Flag` type for use in defining the macro.
-#if defined(_MSC_VER) && !defined(__clang__)
-template <typename T>
-class Flag;
-#else
template <typename T>
using Flag = flags_internal::Flag<T>;
-#endif
Y_ABSL_NAMESPACE_END
} // namespace y_absl
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/flag.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/flag.cc
deleted file mode 100644
index 9bc5137f3e3..00000000000
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/flag.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// Copyright 2019 The Abseil Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "y_absl/flags/flag.h"
-
-#include "y_absl/base/config.h"
-
-namespace y_absl {
-Y_ABSL_NAMESPACE_BEGIN
-
-// This global mutex protects on-demand construction of flag objects in MSVC
-// builds.
-#if defined(_MSC_VER) && !defined(__clang__)
-
-namespace flags_internal {
-
-Y_ABSL_CONST_INIT static y_absl::Mutex construction_guard(y_absl::kConstInit);
-
-y_absl::Mutex* GetGlobalConstructionGuard() { return &construction_guard; }
-
-} // namespace flags_internal
-
-#endif
-
-Y_ABSL_NAMESPACE_END
-} // namespace y_absl
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/flag.h b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/flag.h
index 65448650d33..68a649b0891 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/flag.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/flag.h
@@ -71,12 +71,9 @@ Y_ABSL_NAMESPACE_BEGIN
// For type support of Abseil Flags, see the marshalling.h header file, which
// discusses supported standard types, optional flags, and additional Abseil
// type support.
-#if !defined(_MSC_VER) || defined(__clang__)
+
template <typename T>
using Flag = flags_internal::Flag<T>;
-#else
-#include "y_absl/flags/internal/flag_msvc.inc"
-#endif
// GetFlag()
//
@@ -196,18 +193,12 @@ Y_ABSL_NAMESPACE_END
// -----------------------------------------------------------------------------
// Y_ABSL_FLAG_IMPL macro definition conditional on Y_ABSL_FLAGS_STRIP_NAMES
-#if !defined(_MSC_VER) || defined(__clang__)
#define Y_ABSL_FLAG_IMPL_FLAG_PTR(flag) flag
#define Y_ABSL_FLAG_IMPL_HELP_ARG(name) \
y_absl::flags_internal::HelpArg<AbslFlagHelpGenFor##name>( \
FLAGS_help_storage_##name)
#define Y_ABSL_FLAG_IMPL_DEFAULT_ARG(Type, name) \
y_absl::flags_internal::DefaultArg<Type, AbslFlagDefaultGenFor##name>(0)
-#else
-#define Y_ABSL_FLAG_IMPL_FLAG_PTR(flag) flag.GetImpl()
-#define Y_ABSL_FLAG_IMPL_HELP_ARG(name) &AbslFlagHelpGenFor##name::NonConst
-#define Y_ABSL_FLAG_IMPL_DEFAULT_ARG(Type, name) &AbslFlagDefaultGenFor##name::Gen
-#endif
#if Y_ABSL_FLAGS_STRIP_NAMES
#define Y_ABSL_FLAG_IMPL_FLAGNAME(txt) ""
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/flag.h b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/flag.h
index 6e3e99dbe10..ecccfe0edb1 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/flag.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/flag.h
@@ -54,13 +54,8 @@ template <typename T>
class Flag;
} // namespace flags_internal
-#if defined(_MSC_VER) && !defined(__clang__)
-template <typename T>
-class Flag;
-#else
template <typename T>
using Flag = flags_internal::Flag<T>;
-#endif
template <typename T>
Y_ABSL_MUST_USE_RESULT T GetFlag(const y_absl::Flag<T>& flag);
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/flag_msvc.inc b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/flag_msvc.inc
deleted file mode 100644
index 53ac6c91833..00000000000
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/flag_msvc.inc
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// Copyright 2021 The Abseil Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Do not include this file directly.
-// Include y_absl/flags/flag.h instead.
-
-// MSVC debug builds do not implement initialization with constexpr constructors
-// correctly. To work around this we add a level of indirection, so that the
-// class `y_absl::Flag` contains an `internal::Flag*` (instead of being an alias
-// to that class) and dynamically allocates an instance when necessary. We also
-// forward all calls to internal::Flag methods via trampoline methods. In this
-// setup the `y_absl::Flag` class does not have constructor and virtual methods,
-// all the data members are public and thus MSVC is able to initialize it at
-// link time. To deal with multiple threads accessing the flag for the first
-// time concurrently we use an atomic boolean indicating if flag object is
-// initialized. We also employ the double-checked locking pattern where the
-// second level of protection is a global Mutex, so if two threads attempt to
-// construct the flag concurrently only one wins.
-//
-// This solution is based on a recommendation here:
-// https://developercommunity.visualstudio.com/content/problem/336946/class-with-constexpr-constructor-not-using-static.html?childToView=648454#comment-648454
-
-namespace flags_internal {
-y_absl::Mutex* GetGlobalConstructionGuard();
-} // namespace flags_internal
-
-// Public methods of `y_absl::Flag<T>` are NOT part of the Abseil Flags API.
-// See https://abseil.io/docs/cpp/guides/flags
-template <typename T>
-class Flag {
- public:
- // No constructor and destructor to ensure this is an aggregate type.
- // Visual Studio 2015 still requires the constructor for class to be
- // constexpr initializable.
-#if _MSC_VER <= 1900
- constexpr Flag(const char* name, const char* filename,
- const flags_internal::HelpGenFunc help_gen,
- const flags_internal::FlagDfltGenFunc default_value_gen)
- : name_(name),
- filename_(filename),
- help_gen_(help_gen),
- default_value_gen_(default_value_gen),
- inited_(false),
- impl_(nullptr) {}
-#endif
-
- flags_internal::Flag<T>& GetImpl() const {
- if (!inited_.load(std::memory_order_acquire)) {
- y_absl::MutexLock l(flags_internal::GetGlobalConstructionGuard());
-
- if (inited_.load(std::memory_order_acquire)) {
- return *impl_;
- }
-
- impl_ = new flags_internal::Flag<T>(
- name_, filename_,
- {flags_internal::FlagHelpMsg(help_gen_),
- flags_internal::FlagHelpKind::kGenFunc},
- {flags_internal::FlagDefaultSrc(default_value_gen_),
- flags_internal::FlagDefaultKind::kGenFunc});
- inited_.store(true, std::memory_order_release);
- }
-
- return *impl_;
- }
-
- // Public methods of `y_absl::Flag<T>` are NOT part of the Abseil Flags API.
- // See https://abseil.io/docs/cpp/guides/flags
- bool IsRetired() const { return GetImpl().IsRetired(); }
- y_absl::string_view Name() const { return GetImpl().Name(); }
- TString Help() const { return GetImpl().Help(); }
- bool IsModified() const { return GetImpl().IsModified(); }
- bool IsSpecifiedOnCommandLine() const {
- return GetImpl().IsSpecifiedOnCommandLine();
- }
- TString Filename() const { return GetImpl().Filename(); }
- TString DefaultValue() const { return GetImpl().DefaultValue(); }
- TString CurrentValue() const { return GetImpl().CurrentValue(); }
- template <typename U>
- inline bool IsOfType() const {
- return GetImpl().template IsOfType<U>();
- }
- T Get() const {
- return flags_internal::FlagImplPeer::InvokeGet<T>(GetImpl());
- }
- void Set(const T& v) {
- flags_internal::FlagImplPeer::InvokeSet(GetImpl(), v);
- }
- void InvokeCallback() { GetImpl().InvokeCallback(); }
-
- const CommandLineFlag& Reflect() const {
- return flags_internal::FlagImplPeer::InvokeReflect(GetImpl());
- }
-
- // The data members are logically private, but they need to be public for
- // this to be an aggregate type.
- const char* name_;
- const char* filename_;
- const flags_internal::HelpGenFunc help_gen_;
- const flags_internal::FlagDfltGenFunc default_value_gen_;
-
- mutable std::atomic<bool> inited_;
- mutable flags_internal::Flag<T>* impl_;
-};
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/usage.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/usage.cc
index c654945141a..7f1d74eefa8 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/usage.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/internal/usage.cc
@@ -27,7 +27,10 @@
#include <utility>
#include <vector>
+#include "y_absl/base/attributes.h"
#include "y_absl/base/config.h"
+#include "y_absl/base/const_init.h"
+#include "y_absl/base/thread_annotations.h"
#include "y_absl/flags/commandlineflag.h"
#include "y_absl/flags/flag.h"
#include "y_absl/flags/internal/flag.h"
@@ -40,6 +43,8 @@
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/str_split.h"
#include "y_absl/strings/string_view.h"
+#include "y_absl/strings/strip.h"
+#include "y_absl/synchronization/mutex.h"
// Dummy global variables to prevent anyone else defining these.
bool FLAGS_help = false;
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/marshalling.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/marshalling.cc
index d3c1a399754..d42d739c28b 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/marshalling.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/marshalling.cc
@@ -247,6 +247,14 @@ bool AbslParseFlag(y_absl::string_view text, y_absl::LogSeverity* dst,
*err = "no value provided";
return false;
}
+ if (y_absl::EqualsIgnoreCase(text, "dfatal")) {
+ *dst = y_absl::kLogDebugFatal;
+ return true;
+ }
+ if (y_absl::EqualsIgnoreCase(text, "klogdebugfatal")) {
+ *dst = y_absl::kLogDebugFatal;
+ return true;
+ }
if (text.front() == 'k' || text.front() == 'K') text.remove_prefix(1);
if (y_absl::EqualsIgnoreCase(text, "info")) {
*dst = y_absl::LogSeverity::kInfo;
@@ -269,7 +277,8 @@ bool AbslParseFlag(y_absl::string_view text, y_absl::LogSeverity* dst,
*dst = static_cast<y_absl::LogSeverity>(numeric_value);
return true;
}
- *err = "only integers and y_absl::LogSeverity enumerators are accepted";
+ *err =
+ "only integers, y_absl::LogSeverity enumerators, and DFATAL are accepted";
return false;
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/parse.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/parse.cc
index 4365d0952a8..56bfefc734a 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/parse.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/parse.cc
@@ -637,7 +637,7 @@ void ReportUnrecognizedFlags(
// --------------------------------------------------------------------
bool WasPresentOnCommandLine(y_absl::string_view flag_name) {
- y_absl::MutexLock l(&specified_flags_guard);
+ y_absl::ReaderMutexLock l(&specified_flags_guard);
Y_ABSL_INTERNAL_CHECK(specified_flags != nullptr,
"ParseCommandLine is not invoked yet");
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/reflection.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/reflection.cc
index 87766122498..61d52e61216 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/reflection.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/reflection.cc
@@ -21,6 +21,7 @@
#include <util/generic/string.h>
#include "y_absl/base/config.h"
+#include "y_absl/base/no_destructor.h"
#include "y_absl/base/thread_annotations.h"
#include "y_absl/container/flat_hash_map.h"
#include "y_absl/flags/commandlineflag.h"
@@ -169,7 +170,7 @@ void FlagRegistry::RegisterFlag(CommandLineFlag& flag, const char* filename) {
}
FlagRegistry& FlagRegistry::GlobalRegistry() {
- static FlagRegistry* global_registry = new FlagRegistry;
+ static y_absl::NoDestructor<FlagRegistry> global_registry;
return *global_registry;
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/ya.make
index f8e0a201f77..8187762d93a 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/flags/ya.make
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/flags/ya.make
@@ -28,7 +28,6 @@ NO_COMPILER_WARNINGS()
SRCS(
commandlineflag.cc
- flag.cc
internal/commandlineflag.cc
internal/flag.cc
internal/private_handle_accessor.cc
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/functional/function_ref.h b/contrib/restricted/abseil-cpp-tstring/y_absl/functional/function_ref.h
index 33a0e20a269..59e4a614e25 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/functional/function_ref.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/functional/function_ref.h
@@ -137,6 +137,14 @@ class FunctionRef<R(Args...)> {
y_absl::functional_internal::Invoker<R, Args...> invoker_;
};
+// Allow const qualified function signatures. Since FunctionRef requires
+// constness anyway we can just make this a no-op.
+template <typename R, typename... Args>
+class FunctionRef<R(Args...) const> : public FunctionRef<R(Args...)> {
+ public:
+ using FunctionRef<R(Args...)>::FunctionRef;
+};
+
Y_ABSL_NAMESPACE_END
} // namespace y_absl
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/functional/internal/any_invocable.h b/contrib/restricted/abseil-cpp-tstring/y_absl/functional/internal/any_invocable.h
index f3a79186d85..009a54c6b66 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/functional/internal/any_invocable.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/functional/internal/any_invocable.h
@@ -215,8 +215,8 @@ T& ObjectInLocalStorage(TypeErasedState* const state) {
// behavior, which works as intended on Abseil's officially supported
// platforms as of Q2 2022.
#if !defined(__clang__) && defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
return *reinterpret_cast<T*>(&state->storage);
#if !defined(__clang__) && defined(__GNUC__)
@@ -526,10 +526,10 @@ class CoreImpl {
// Since this is template-heavy code, we prefer to disable these warnings
// locally instead of adding yet another overload of this function.
#if !defined(__clang__) && defined(__GNUC__)
+#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Waddress"
#pragma GCC diagnostic ignored "-Wnonnull-compare"
-#pragma GCC diagnostic push
#endif
if (static_cast<RemoveCVRef<QualDecayedTRef>>(f) == nullptr) {
#if !defined(__clang__) && defined(__GNUC__)
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/functional/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/functional/ya.make
index 3b66e3e4004..939d0737310 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/functional/ya.make
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/functional/ya.make
@@ -6,9 +6,9 @@ LICENSE(Apache-2.0)
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(20230802.1)
+VERSION(20240116.1)
-ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20230802.1.tar.gz)
+ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz)
NO_RUNTIME()
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal/hash.h b/contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal/hash.h
index 8250eba6c22..b289e1fa5f0 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal/hash.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal/hash.h
@@ -19,6 +19,11 @@
#ifndef Y_ABSL_HASH_INTERNAL_HASH_H_
#define Y_ABSL_HASH_INTERNAL_HASH_H_
+#ifdef __APPLE__
+#include <Availability.h>
+#include <TargetConditionals.h>
+#endif
+
#include <algorithm>
#include <array>
#include <bitset>
@@ -56,6 +61,11 @@
#include "y_absl/types/variant.h"
#include "y_absl/utility/utility.h"
+#if Y_ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L && \
+ !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
+#include <filesystem> // NOLINT
+#endif
+
#ifdef Y_ABSL_HAVE_STD_STRING_VIEW
#include <string_view>
#endif
@@ -409,9 +419,23 @@ AbslHashValue(H hash_state, LongDouble value) {
return H::combine(std::move(hash_state), category);
}
+// Without this overload, an array decays to a pointer and we hash that, which
+// is not likely to be what the caller intended.
+template <typename H, typename T, size_t N>
+H AbslHashValue(H hash_state, T (&)[N]) {
+ static_assert(
+ sizeof(T) == -1,
+ "Hashing C arrays is not allowed. For string literals, wrap the literal "
+ "in y_absl::string_view(). To hash the array contents, use "
+ "y_absl::MakeSpan() or make the array an std::array. To hash the array "
+ "address, use &array[0].");
+ return hash_state;
+}
+
// AbslHashValue() for hashing pointers
template <typename H, typename T>
-H AbslHashValue(H hash_state, T* ptr) {
+std::enable_if_t<std::is_pointer<T>::value, H> AbslHashValue(H hash_state,
+ T ptr) {
auto v = reinterpret_cast<uintptr_t>(ptr);
// Due to alignment, pointers tend to have low bits as zero, and the next few
// bits follow a pattern since they are also multiples of some base value.
@@ -564,6 +588,29 @@ H AbslHashValue(H hash_state, std::basic_string_view<Char> str) {
#endif // Y_ABSL_HAVE_STD_STRING_VIEW
+#if defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703L && \
+ !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) && \
+ (!defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) || \
+ __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130000)
+
+#define Y_ABSL_INTERNAL_STD_FILESYSTEM_PATH_HASH_AVAILABLE 1
+
+// Support std::filesystem::path. The SFINAE is required because some string
+// types are implicitly convertible to std::filesystem::path.
+template <typename Path, typename H,
+ typename = y_absl::enable_if_t<
+ std::is_same_v<Path, std::filesystem::path>>>
+H AbslHashValue(H hash_state, const Path& path) {
+ // This is implemented by deferring to the standard library to compute the
+ // hash. The standard library requires that for two paths, `p1 == p2`, then
+ // `hash_value(p1) == hash_value(p2)`. `AbslHashValue` has the same
+ // requirement. Since `operator==` does platform specific matching, deferring
+ // to the standard library is the simplest approach.
+ return H::combine(std::move(hash_state), std::filesystem::hash_value(path));
+}
+
+#endif // Y_ABSL_INTERNAL_STD_FILESYSTEM_PATH_HASH_AVAILABLE
+
// -----------------------------------------------------------------------------
// AbslHashValue for Sequence Containers
// -----------------------------------------------------------------------------
@@ -818,7 +865,7 @@ AbslHashValue(H hash_state, const y_absl::variant<T...>& v) {
template <typename H, size_t N>
H AbslHashValue(H hash_state, const std::bitset<N>& set) {
typename H::AbslInternalPiecewiseCombiner combiner;
- for (int i = 0; i < N; i++) {
+ for (size_t i = 0; i < N; i++) {
unsigned char c = static_cast<unsigned char>(set[i]);
hash_state = combiner.add_buffer(std::move(hash_state), &c, sizeof(c));
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/memory/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/memory/ya.make
index 839a6cf6c79..9599f83eeb2 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/memory/ya.make
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/memory/ya.make
@@ -6,9 +6,9 @@ LICENSE(Apache-2.0)
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(20230802.1)
+VERSION(20240116.1)
-ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20230802.1.tar.gz)
+ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz)
PEERDIR(
contrib/restricted/abseil-cpp-tstring/y_absl/meta
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/meta/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/meta/ya.make
index 59f86edce78..3c9373d1efc 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/meta/ya.make
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/meta/ya.make
@@ -6,9 +6,9 @@ LICENSE(Apache-2.0)
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(20230802.1)
+VERSION(20240116.1)
-ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20230802.1.tar.gz)
+ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz)
PEERDIR(
contrib/restricted/abseil-cpp-tstring/y_absl/base
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/bits.h b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/bits.h
index 2d20293c904..e1ab1ed025d 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/bits.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/bits.h
@@ -49,9 +49,19 @@
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
-#if !(defined(__cpp_lib_bitops) && __cpp_lib_bitops >= 201907L)
-// rotating
+// https://github.com/llvm/llvm-project/issues/64544
+// libc++ had the wrong signature for std::rotl and std::rotr
+// prior to libc++ 18.0.
+//
+#if (defined(__cpp_lib_bitops) && __cpp_lib_bitops >= 201907L) && \
+ (!defined(_LIBCPP_VERSION) || _LIBCPP_VERSION >= 180000)
+using std::rotl;
+using std::rotr;
+
+#else
+
+// Rotating functions
template <class T>
Y_ABSL_MUST_USE_RESULT constexpr
typename std::enable_if<std::is_unsigned<T>::value, T>::type
@@ -66,6 +76,22 @@ Y_ABSL_MUST_USE_RESULT constexpr
return numeric_internal::RotateRight(x, s);
}
+#endif
+
+// https://github.com/llvm/llvm-project/issues/64544
+// libc++ had the wrong signature for std::rotl and std::rotr
+// prior to libc++ 18.0.
+//
+#if (defined(__cpp_lib_bitops) && __cpp_lib_bitops >= 201907L)
+
+using std::countl_one;
+using std::countl_zero;
+using std::countr_one;
+using std::countr_zero;
+using std::popcount;
+
+#else
+
// Counting functions
//
// While these functions are typically constexpr, on some platforms, they may
@@ -107,19 +133,18 @@ Y_ABSL_INTERNAL_CONSTEXPR_POPCOUNT inline
popcount(T x) noexcept {
return numeric_internal::Popcount(x);
}
-#else // defined(__cpp_lib_bitops) && __cpp_lib_bitops >= 201907L
-
-using std::countl_one;
-using std::countl_zero;
-using std::countr_one;
-using std::countr_zero;
-using std::popcount;
-using std::rotl;
-using std::rotr;
#endif
-#if !(defined(__cpp_lib_int_pow2) && __cpp_lib_int_pow2 >= 202002L)
+#if (defined(__cpp_lib_int_pow2) && __cpp_lib_int_pow2 >= 202002L)
+
+using std::bit_ceil;
+using std::bit_floor;
+using std::bit_width;
+using std::has_single_bit;
+
+#else
+
// Returns: true if x is an integral power of two; false otherwise.
template <class T>
constexpr inline typename std::enable_if<std::is_unsigned<T>::value, bool>::type
@@ -162,12 +187,6 @@ Y_ABSL_INTERNAL_CONSTEXPR_CLZ inline
return has_single_bit(x) ? T{1} << (bit_width(x) - 1)
: numeric_internal::BitCeilNonPowerOf2(x);
}
-#else // defined(__cpp_lib_int_pow2) && __cpp_lib_int_pow2 >= 202002L
-
-using std::bit_ceil;
-using std::bit_floor;
-using std::bit_width;
-using std::has_single_bit;
#endif
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/random/distributions.h b/contrib/restricted/abseil-cpp-tstring/y_absl/random/distributions.h
index f4f327f393d..ddd1b9ce6e6 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/random/distributions.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/random/distributions.h
@@ -362,7 +362,7 @@ RealType Gaussian(URBG&& urbg, // NOLINT(runtime/references)
// If `lo` is nonzero then this distribution is shifted to the desired interval,
// so LogUniform(lo, hi, b) is equivalent to LogUniform(0, hi-lo, b)+lo.
//
-// See http://ecolego.facilia.se/ecolego/show/Log-Uniform%20Distribution
+// See https://en.wikipedia.org/wiki/Log-normal_distribution
//
// Example:
//
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/status_internal.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/status_internal.cc
new file mode 100644
index 00000000000..133f8e3d506
--- /dev/null
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/status_internal.cc
@@ -0,0 +1,248 @@
+// Copyright 2023 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "y_absl/status/internal/status_internal.h"
+
+#include <atomic>
+#include <cassert>
+#include <cstddef>
+#include <cstdint>
+#include <cstdio>
+#include <cstring>
+#include <memory>
+#include <util/generic/string.h>
+#include <utility>
+
+#include "y_absl/base/attributes.h"
+#include "y_absl/base/config.h"
+#include "y_absl/base/macros.h"
+#include "y_absl/base/nullability.h"
+#include "y_absl/debugging/stacktrace.h"
+#include "y_absl/debugging/symbolize.h"
+#include "y_absl/memory/memory.h"
+#include "y_absl/status/status.h"
+#include "y_absl/status/status_payload_printer.h"
+#include "y_absl/strings/cord.h"
+#include "y_absl/strings/escaping.h"
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_split.h"
+#include "y_absl/strings/string_view.h"
+#include "y_absl/types/optional.h"
+
+namespace y_absl {
+Y_ABSL_NAMESPACE_BEGIN
+namespace status_internal {
+
+void StatusRep::Unref() const {
+ // Fast path: if ref==1, there is no need for a RefCountDec (since
+ // this is the only reference and therefore no other thread is
+ // allowed to be mucking with r).
+ if (ref_.load(std::memory_order_acquire) == 1 ||
+ ref_.fetch_sub(1, std::memory_order_acq_rel) - 1 == 0) {
+ delete this;
+ }
+}
+
+static y_absl::optional<size_t> FindPayloadIndexByUrl(
+ const Payloads* payloads, y_absl::string_view type_url) {
+ if (payloads == nullptr) return y_absl::nullopt;
+
+ for (size_t i = 0; i < payloads->size(); ++i) {
+ if ((*payloads)[i].type_url == type_url) return i;
+ }
+
+ return y_absl::nullopt;
+}
+
+y_absl::optional<y_absl::Cord> StatusRep::GetPayload(
+ y_absl::string_view type_url) const {
+ y_absl::optional<size_t> index =
+ status_internal::FindPayloadIndexByUrl(payloads_.get(), type_url);
+ if (index.has_value()) return (*payloads_)[index.value()].payload;
+
+ return y_absl::nullopt;
+}
+
+void StatusRep::SetPayload(y_absl::string_view type_url, y_absl::Cord payload) {
+ if (payloads_ == nullptr) {
+ payloads_ = y_absl::make_unique<status_internal::Payloads>();
+ }
+
+ y_absl::optional<size_t> index =
+ status_internal::FindPayloadIndexByUrl(payloads_.get(), type_url);
+ if (index.has_value()) {
+ (*payloads_)[index.value()].payload = std::move(payload);
+ return;
+ }
+
+ payloads_->push_back({TString(type_url), std::move(payload)});
+}
+
+StatusRep::EraseResult StatusRep::ErasePayload(y_absl::string_view type_url) {
+ y_absl::optional<size_t> index =
+ status_internal::FindPayloadIndexByUrl(payloads_.get(), type_url);
+ if (!index.has_value()) return {false, Status::PointerToRep(this)};
+ payloads_->erase(payloads_->begin() + index.value());
+ if (payloads_->empty() && message_.empty()) {
+ // Special case: If this can be represented inlined, it MUST be inlined
+ // (== depends on this behavior).
+ EraseResult result = {true, Status::CodeToInlinedRep(code_)};
+ Unref();
+ return result;
+ }
+ return {true, Status::PointerToRep(this)};
+}
+
+void StatusRep::ForEachPayload(
+ y_absl::FunctionRef<void(y_absl::string_view, const y_absl::Cord&)> visitor)
+ const {
+ if (auto* payloads = payloads_.get()) {
+ bool in_reverse =
+ payloads->size() > 1 && reinterpret_cast<uintptr_t>(payloads) % 13 > 6;
+
+ for (size_t index = 0; index < payloads->size(); ++index) {
+ const auto& elem =
+ (*payloads)[in_reverse ? payloads->size() - 1 - index : index];
+
+#ifdef NDEBUG
+ visitor(elem.type_url, elem.payload);
+#else
+ // In debug mode invalidate the type url to prevent users from relying on
+ // this string lifetime.
+
+ // NOLINTNEXTLINE intentional extra conversion to force temporary.
+ visitor(TString(elem.type_url), elem.payload);
+#endif // NDEBUG
+ }
+ }
+}
+
+TString StatusRep::ToString(StatusToStringMode mode) const {
+ TString text;
+ y_absl::StrAppend(&text, y_absl::StatusCodeToString(code()), ": ", message());
+
+ const bool with_payload = (mode & StatusToStringMode::kWithPayload) ==
+ StatusToStringMode::kWithPayload;
+
+ if (with_payload) {
+ status_internal::StatusPayloadPrinter printer =
+ status_internal::GetStatusPayloadPrinter();
+ this->ForEachPayload([&](y_absl::string_view type_url,
+ const y_absl::Cord& payload) {
+ y_absl::optional<TString> result;
+ if (printer) result = printer(type_url, payload);
+ y_absl::StrAppend(
+ &text, " [", type_url, "='",
+ result.has_value() ? *result : y_absl::CHexEscape(TString(payload)),
+ "']");
+ });
+ }
+
+ return text;
+}
+
+bool StatusRep::operator==(const StatusRep& other) const {
+ assert(this != &other);
+ if (code_ != other.code_) return false;
+ if (message_ != other.message_) return false;
+ const status_internal::Payloads* this_payloads = payloads_.get();
+ const status_internal::Payloads* other_payloads = other.payloads_.get();
+
+ const status_internal::Payloads no_payloads;
+ const status_internal::Payloads* larger_payloads =
+ this_payloads ? this_payloads : &no_payloads;
+ const status_internal::Payloads* smaller_payloads =
+ other_payloads ? other_payloads : &no_payloads;
+ if (larger_payloads->size() < smaller_payloads->size()) {
+ std::swap(larger_payloads, smaller_payloads);
+ }
+ if ((larger_payloads->size() - smaller_payloads->size()) > 1) return false;
+ // Payloads can be ordered differently, so we can't just compare payload
+ // vectors.
+ for (const auto& payload : *larger_payloads) {
+
+ bool found = false;
+ for (const auto& other_payload : *smaller_payloads) {
+ if (payload.type_url == other_payload.type_url) {
+ if (payload.payload != other_payload.payload) {
+ return false;
+ }
+ found = true;
+ break;
+ }
+ }
+ if (!found) return false;
+ }
+ return true;
+}
+
+y_absl::Nonnull<StatusRep*> StatusRep::CloneAndUnref() const {
+ // Optimization: no need to create a clone if we already have a refcount of 1.
+ if (ref_.load(std::memory_order_acquire) == 1) {
+ // All StatusRep instances are heap allocated and mutable, therefore this
+ // const_cast will never cast away const from a stack instance.
+ //
+ // CloneAndUnref is the only method that doesn't involve an external cast to
+ // get a mutable StatusRep* from the uintptr_t rep stored in Status.
+ return const_cast<StatusRep*>(this);
+ }
+ std::unique_ptr<status_internal::Payloads> payloads;
+ if (payloads_) {
+ payloads = y_absl::make_unique<status_internal::Payloads>(*payloads_);
+ }
+ auto* new_rep = new StatusRep(code_, message_, std::move(payloads));
+ Unref();
+ return new_rep;
+}
+
+// Convert canonical code to a value known to this binary.
+y_absl::StatusCode MapToLocalCode(int value) {
+ y_absl::StatusCode code = static_cast<y_absl::StatusCode>(value);
+ switch (code) {
+ case y_absl::StatusCode::kOk:
+ case y_absl::StatusCode::kCancelled:
+ case y_absl::StatusCode::kUnknown:
+ case y_absl::StatusCode::kInvalidArgument:
+ case y_absl::StatusCode::kDeadlineExceeded:
+ case y_absl::StatusCode::kNotFound:
+ case y_absl::StatusCode::kAlreadyExists:
+ case y_absl::StatusCode::kPermissionDenied:
+ case y_absl::StatusCode::kResourceExhausted:
+ case y_absl::StatusCode::kFailedPrecondition:
+ case y_absl::StatusCode::kAborted:
+ case y_absl::StatusCode::kOutOfRange:
+ case y_absl::StatusCode::kUnimplemented:
+ case y_absl::StatusCode::kInternal:
+ case y_absl::StatusCode::kUnavailable:
+ case y_absl::StatusCode::kDataLoss:
+ case y_absl::StatusCode::kUnauthenticated:
+ return code;
+ default:
+ return y_absl::StatusCode::kUnknown;
+ }
+}
+
+y_absl::Nonnull<TString*> MakeCheckFailString(
+ y_absl::Nonnull<const y_absl::Status*> status,
+ y_absl::Nonnull<const char*> prefix) {
+ return new TString(
+ y_absl::StrCat(prefix, " (",
+ status->ToString(StatusToStringMode::kWithEverything), ")"));
+}
+
+} // namespace status_internal
+
+Y_ABSL_NAMESPACE_END
+} // namespace y_absl
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/status_internal.h b/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/status_internal.h
index fc84f20aa97..70d0c322d01 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/status_internal.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/status_internal.h
@@ -14,13 +14,19 @@
#ifndef Y_ABSL_STATUS_INTERNAL_STATUS_INTERNAL_H_
#define Y_ABSL_STATUS_INTERNAL_STATUS_INTERNAL_H_
+#include <atomic>
+#include <cstdint>
#include <memory>
#include <util/generic/string.h>
#include <utility>
#include "y_absl/base/attributes.h"
+#include "y_absl/base/config.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/container/inlined_vector.h"
#include "y_absl/strings/cord.h"
+#include "y_absl/strings/string_view.h"
+#include "y_absl/types/optional.h"
#ifndef SWIG
// Disabled for SWIG as it doesn't parse attributes correctly.
@@ -32,9 +38,9 @@ Y_ABSL_NAMESPACE_BEGIN
// TODO(b/176172494): Y_ABSL_MUST_USE_RESULT should expand to the more strict
// [[nodiscard]]. For now, just use [[nodiscard]] directly when it is available.
#if Y_ABSL_HAVE_CPP_ATTRIBUTE(nodiscard)
-class [[nodiscard]] Status;
+class [[nodiscard]] Y_ABSL_ATTRIBUTE_TRIVIAL_ABI Status;
#else
-class Y_ABSL_MUST_USE_RESULT Status;
+class Y_ABSL_MUST_USE_RESULT Y_ABSL_ATTRIBUTE_TRIVIAL_ABI Status;
#endif
Y_ABSL_NAMESPACE_END
} // namespace y_absl
@@ -44,6 +50,7 @@ namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
enum class StatusCode : int;
+enum class StatusToStringMode : int;
namespace status_internal {
@@ -56,22 +63,54 @@ struct Payload {
using Payloads = y_absl::InlinedVector<Payload, 1>;
// Reference-counted representation of Status data.
-struct StatusRep {
+class StatusRep {
+ public:
StatusRep(y_absl::StatusCode code_arg, y_absl::string_view message_arg,
std::unique_ptr<status_internal::Payloads> payloads_arg)
- : ref(int32_t{1}),
- code(code_arg),
- message(message_arg),
- payloads(std::move(payloads_arg)) {}
-
- std::atomic<int32_t> ref;
- y_absl::StatusCode code;
+ : ref_(int32_t{1}),
+ code_(code_arg),
+ message_(message_arg),
+ payloads_(std::move(payloads_arg)) {}
+
+ y_absl::StatusCode code() const { return code_; }
+ const TString& message() const { return message_; }
+
+ // Ref and unref are const to allow access through a const pointer, and are
+ // used during copying operations.
+ void Ref() const { ref_.fetch_add(1, std::memory_order_relaxed); }
+ void Unref() const;
+
+ // Payload methods correspond to the same methods in y_absl::Status.
+ y_absl::optional<y_absl::Cord> GetPayload(y_absl::string_view type_url) const;
+ void SetPayload(y_absl::string_view type_url, y_absl::Cord payload);
+ struct EraseResult {
+ bool erased;
+ uintptr_t new_rep;
+ };
+ EraseResult ErasePayload(y_absl::string_view type_url);
+ void ForEachPayload(
+ y_absl::FunctionRef<void(y_absl::string_view, const y_absl::Cord&)> visitor)
+ const;
+
+ TString ToString(StatusToStringMode mode) const;
+
+ bool operator==(const StatusRep& other) const;
+ bool operator!=(const StatusRep& other) const { return !(*this == other); }
+
+ // Returns an equivalent heap allocated StatusRep with refcount 1.
+ //
+ // `this` is not safe to be used after calling as it may have been deleted.
+ y_absl::Nonnull<StatusRep*> CloneAndUnref() const;
+
+ private:
+ mutable std::atomic<int32_t> ref_;
+ y_absl::StatusCode code_;
// As an internal implementation detail, we guarantee that if status.message()
// is non-empty, then the resulting string_view is null terminated.
// This is required to implement 'StatusMessageAsCStr(...)'
- TString message;
- std::unique_ptr<status_internal::Payloads> payloads;
+ TString message_;
+ std::unique_ptr<status_internal::Payloads> payloads_;
};
y_absl::StatusCode MapToLocalCode(int value);
@@ -80,8 +119,10 @@ y_absl::StatusCode MapToLocalCode(int value);
// suitable for output as an error message in assertion/`CHECK()` failures.
//
// This is an internal implementation detail for Abseil logging.
-TString* MakeCheckFailString(const y_absl::Status* status,
- const char* prefix);
+Y_ABSL_ATTRIBUTE_PURE_FUNCTION
+y_absl::Nonnull<TString*> MakeCheckFailString(
+ y_absl::Nonnull<const y_absl::Status*> status,
+ y_absl::Nonnull<const char*> prefix);
} // namespace status_internal
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/statusor_internal.h b/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/statusor_internal.h
index 811afe05aff..fa22190dbde 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/statusor_internal.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/statusor_internal.h
@@ -14,12 +14,15 @@
#ifndef Y_ABSL_STATUS_INTERNAL_STATUSOR_INTERNAL_H_
#define Y_ABSL_STATUS_INTERNAL_STATUSOR_INTERNAL_H_
+#include <cstdint>
#include <type_traits>
#include <utility>
#include "y_absl/base/attributes.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/meta/type_traits.h"
#include "y_absl/status/status.h"
+#include "y_absl/strings/string_view.h"
#include "y_absl/utility/utility.h"
namespace y_absl {
@@ -123,7 +126,7 @@ using IsForwardingAssignmentValid = y_absl::disjunction<
class Helper {
public:
// Move type-agnostic error handling to the .cc.
- static void HandleInvalidStatusCtorArg(Status*);
+ static void HandleInvalidStatusCtorArg(y_absl::Nonnull<Status*>);
Y_ABSL_ATTRIBUTE_NORETURN static void Crash(const y_absl::Status& status);
};
@@ -131,7 +134,8 @@ class Helper {
// the constructor.
// This abstraction is here mostly for the gcc performance fix.
template <typename T, typename... Args>
-Y_ABSL_ATTRIBUTE_NONNULL(1) void PlacementNew(void* p, Args&&... args) {
+Y_ABSL_ATTRIBUTE_NONNULL(1)
+void PlacementNew(y_absl::Nonnull<void*> p, Args&&... args) {
new (p) T(std::forward<Args>(args)...);
}
@@ -377,6 +381,53 @@ struct MoveAssignBase<T, false> {
Y_ABSL_ATTRIBUTE_NORETURN void ThrowBadStatusOrAccess(y_absl::Status status);
+// Used to introduce jitter into the output of printing functions for
+// `StatusOr` (i.e. `AbslStringify` and `operator<<`).
+class StringifyRandom {
+ enum BracesType {
+ kBareParens = 0,
+ kSpaceParens,
+ kBareBrackets,
+ kSpaceBrackets,
+ };
+
+ // Returns a random `BracesType` determined once per binary load.
+ static BracesType RandomBraces() {
+ static const BracesType kRandomBraces = static_cast<BracesType>(
+ (reinterpret_cast<uintptr_t>(&kRandomBraces) >> 4) % 4);
+ return kRandomBraces;
+ }
+
+ public:
+ static inline y_absl::string_view OpenBrackets() {
+ switch (RandomBraces()) {
+ case kBareParens:
+ return "(";
+ case kSpaceParens:
+ return "( ";
+ case kBareBrackets:
+ return "[";
+ case kSpaceBrackets:
+ return "[ ";
+ }
+ return "(";
+ }
+
+ static inline y_absl::string_view CloseBrackets() {
+ switch (RandomBraces()) {
+ case kBareParens:
+ return ")";
+ case kSpaceParens:
+ return " )";
+ case kBareBrackets:
+ return "]";
+ case kSpaceBrackets:
+ return " ]";
+ }
+ return ")";
+ }
+};
+
} // namespace internal_statusor
Y_ABSL_NAMESPACE_END
} // namespace y_absl
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.cc
index 73bf4d343b6..41655b15e24 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.cc
@@ -15,23 +15,37 @@
#include <errno.h>
-#include <cassert>
-#include <utility>
-
+#include <atomic>
+#include <cstddef>
+#include <cstdint>
+#include <cstring>
+#include <memory>
+#include <ostream>
+#include <util/generic/string.h>
+
+#include "y_absl/base/attributes.h"
+#include "y_absl/base/config.h"
#include "y_absl/base/internal/raw_logging.h"
#include "y_absl/base/internal/strerror.h"
#include "y_absl/base/macros.h"
+#include "y_absl/base/no_destructor.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/debugging/stacktrace.h"
#include "y_absl/debugging/symbolize.h"
-#include "y_absl/status/status_payload_printer.h"
-#include "y_absl/strings/escaping.h"
+#include "y_absl/status/internal/status_internal.h"
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/str_format.h"
#include "y_absl/strings/str_split.h"
+#include "y_absl/strings/string_view.h"
+#include "y_absl/types/optional.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
+static_assert(
+ alignof(status_internal::StatusRep) >= 4,
+ "y_absl::Status assumes it can use the bottom 2 bits of a StatusRep*.");
+
TString StatusCodeToString(StatusCode code) {
switch (code) {
case StatusCode::kOk:
@@ -77,146 +91,18 @@ std::ostream& operator<<(std::ostream& os, StatusCode code) {
return os << StatusCodeToString(code);
}
-namespace status_internal {
-
-static y_absl::optional<size_t> FindPayloadIndexByUrl(
- const Payloads* payloads, y_absl::string_view type_url) {
- if (payloads == nullptr) return y_absl::nullopt;
-
- for (size_t i = 0; i < payloads->size(); ++i) {
- if ((*payloads)[i].type_url == type_url) return i;
- }
-
- return y_absl::nullopt;
-}
-
-// Convert canonical code to a value known to this binary.
-y_absl::StatusCode MapToLocalCode(int value) {
- y_absl::StatusCode code = static_cast<y_absl::StatusCode>(value);
- switch (code) {
- case y_absl::StatusCode::kOk:
- case y_absl::StatusCode::kCancelled:
- case y_absl::StatusCode::kUnknown:
- case y_absl::StatusCode::kInvalidArgument:
- case y_absl::StatusCode::kDeadlineExceeded:
- case y_absl::StatusCode::kNotFound:
- case y_absl::StatusCode::kAlreadyExists:
- case y_absl::StatusCode::kPermissionDenied:
- case y_absl::StatusCode::kResourceExhausted:
- case y_absl::StatusCode::kFailedPrecondition:
- case y_absl::StatusCode::kAborted:
- case y_absl::StatusCode::kOutOfRange:
- case y_absl::StatusCode::kUnimplemented:
- case y_absl::StatusCode::kInternal:
- case y_absl::StatusCode::kUnavailable:
- case y_absl::StatusCode::kDataLoss:
- case y_absl::StatusCode::kUnauthenticated:
- return code;
- default:
- return y_absl::StatusCode::kUnknown;
- }
-}
-} // namespace status_internal
-
-y_absl::optional<y_absl::Cord> Status::GetPayload(
- y_absl::string_view type_url) const {
- const auto* payloads = GetPayloads();
- y_absl::optional<size_t> index =
- status_internal::FindPayloadIndexByUrl(payloads, type_url);
- if (index.has_value()) return (*payloads)[index.value()].payload;
-
- return y_absl::nullopt;
-}
-
-void Status::SetPayload(y_absl::string_view type_url, y_absl::Cord payload) {
- if (ok()) return;
-
- PrepareToModify();
-
- status_internal::StatusRep* rep = RepToPointer(rep_);
- if (!rep->payloads) {
- rep->payloads = y_absl::make_unique<status_internal::Payloads>();
- }
-
- y_absl::optional<size_t> index =
- status_internal::FindPayloadIndexByUrl(rep->payloads.get(), type_url);
- if (index.has_value()) {
- (*rep->payloads)[index.value()].payload = std::move(payload);
- return;
- }
-
- rep->payloads->push_back({TString(type_url), std::move(payload)});
-}
-
-bool Status::ErasePayload(y_absl::string_view type_url) {
- y_absl::optional<size_t> index =
- status_internal::FindPayloadIndexByUrl(GetPayloads(), type_url);
- if (index.has_value()) {
- PrepareToModify();
- GetPayloads()->erase(GetPayloads()->begin() + index.value());
- if (GetPayloads()->empty() && message().empty()) {
- // Special case: If this can be represented inlined, it MUST be
- // inlined (EqualsSlow depends on this behavior).
- StatusCode c = static_cast<StatusCode>(raw_code());
- Unref(rep_);
- rep_ = CodeToInlinedRep(c);
- }
- return true;
- }
-
- return false;
-}
-
-void Status::ForEachPayload(
- y_absl::FunctionRef<void(y_absl::string_view, const y_absl::Cord&)> visitor)
- const {
- if (auto* payloads = GetPayloads()) {
- bool in_reverse =
- payloads->size() > 1 && reinterpret_cast<uintptr_t>(payloads) % 13 > 6;
-
- for (size_t index = 0; index < payloads->size(); ++index) {
- const auto& elem =
- (*payloads)[in_reverse ? payloads->size() - 1 - index : index];
-
-#ifdef NDEBUG
- visitor(elem.type_url, elem.payload);
-#else
- // In debug mode invalidate the type url to prevent users from relying on
- // this string lifetime.
-
- // NOLINTNEXTLINE intentional extra conversion to force temporary.
- visitor(TString(elem.type_url), elem.payload);
-#endif // NDEBUG
- }
- }
-}
-
-const TString* Status::EmptyString() {
- static union EmptyString {
- TString str;
- ~EmptyString() {}
- } empty = {{}};
- return &empty.str;
+y_absl::Nonnull<const TString*> Status::EmptyString() {
+ static const y_absl::NoDestructor<TString> kEmpty;
+ return kEmpty.get();
}
#ifdef Y_ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL
constexpr const char Status::kMovedFromString[];
#endif
-const TString* Status::MovedFromString() {
- static TString* moved_from_string = new TString(kMovedFromString);
- return moved_from_string;
-}
-
-void Status::UnrefNonInlined(uintptr_t rep) {
- status_internal::StatusRep* r = RepToPointer(rep);
- // Fast path: if ref==1, there is no need for a RefCountDec (since
- // this is the only reference and therefore no other thread is
- // allowed to be mucking with r).
- if (r->ref.load(std::memory_order_acquire) == 1 ||
- r->ref.fetch_sub(1, std::memory_order_acq_rel) - 1 == 0) {
- delete r;
- }
+y_absl::Nonnull<const TString*> Status::MovedFromString() {
+ static const y_absl::NoDestructor<TString> kMovedFrom(kMovedFromString);
+ return kMovedFrom.get();
}
Status::Status(y_absl::StatusCode code, y_absl::string_view msg)
@@ -226,97 +112,20 @@ Status::Status(y_absl::StatusCode code, y_absl::string_view msg)
}
}
-int Status::raw_code() const {
- if (IsInlined(rep_)) {
- return static_cast<int>(InlinedRepToCode(rep_));
+y_absl::Nonnull<status_internal::StatusRep*> Status::PrepareToModify(
+ uintptr_t rep) {
+ if (IsInlined(rep)) {
+ return new status_internal::StatusRep(InlinedRepToCode(rep),
+ y_absl::string_view(), nullptr);
}
- status_internal::StatusRep* rep = RepToPointer(rep_);
- return static_cast<int>(rep->code);
+ return RepToPointer(rep)->CloneAndUnref();
}
-y_absl::StatusCode Status::code() const {
- return status_internal::MapToLocalCode(raw_code());
-}
-
-void Status::PrepareToModify() {
- Y_ABSL_RAW_CHECK(!ok(), "PrepareToModify shouldn't be called on OK status.");
- if (IsInlined(rep_)) {
- rep_ = PointerToRep(new status_internal::StatusRep(
- static_cast<y_absl::StatusCode>(raw_code()), y_absl::string_view(),
- nullptr));
- return;
+TString Status::ToStringSlow(uintptr_t rep, StatusToStringMode mode) {
+ if (IsInlined(rep)) {
+ return y_absl::StrCat(y_absl::StatusCodeToString(InlinedRepToCode(rep)), ": ");
}
-
- uintptr_t rep_i = rep_;
- status_internal::StatusRep* rep = RepToPointer(rep_);
- if (rep->ref.load(std::memory_order_acquire) != 1) {
- std::unique_ptr<status_internal::Payloads> payloads;
- if (rep->payloads) {
- payloads = y_absl::make_unique<status_internal::Payloads>(*rep->payloads);
- }
- status_internal::StatusRep* const new_rep = new status_internal::StatusRep(
- rep->code, message(), std::move(payloads));
- rep_ = PointerToRep(new_rep);
- UnrefNonInlined(rep_i);
- }
-}
-
-bool Status::EqualsSlow(const y_absl::Status& a, const y_absl::Status& b) {
- if (IsInlined(a.rep_) != IsInlined(b.rep_)) return false;
- if (a.message() != b.message()) return false;
- if (a.raw_code() != b.raw_code()) return false;
- if (a.GetPayloads() == b.GetPayloads()) return true;
-
- const status_internal::Payloads no_payloads;
- const status_internal::Payloads* larger_payloads =
- a.GetPayloads() ? a.GetPayloads() : &no_payloads;
- const status_internal::Payloads* smaller_payloads =
- b.GetPayloads() ? b.GetPayloads() : &no_payloads;
- if (larger_payloads->size() < smaller_payloads->size()) {
- std::swap(larger_payloads, smaller_payloads);
- }
- if ((larger_payloads->size() - smaller_payloads->size()) > 1) return false;
- // Payloads can be ordered differently, so we can't just compare payload
- // vectors.
- for (const auto& payload : *larger_payloads) {
-
- bool found = false;
- for (const auto& other_payload : *smaller_payloads) {
- if (payload.type_url == other_payload.type_url) {
- if (payload.payload != other_payload.payload) {
- return false;
- }
- found = true;
- break;
- }
- }
- if (!found) return false;
- }
- return true;
-}
-
-TString Status::ToStringSlow(StatusToStringMode mode) const {
- TString text;
- y_absl::StrAppend(&text, y_absl::StatusCodeToString(code()), ": ", message());
-
- const bool with_payload = (mode & StatusToStringMode::kWithPayload) ==
- StatusToStringMode::kWithPayload;
-
- if (with_payload) {
- status_internal::StatusPayloadPrinter printer =
- status_internal::GetStatusPayloadPrinter();
- this->ForEachPayload([&](y_absl::string_view type_url,
- const y_absl::Cord& payload) {
- y_absl::optional<TString> result;
- if (printer) result = printer(type_url, payload);
- y_absl::StrAppend(
- &text, " [", type_url, "='",
- result.has_value() ? *result : y_absl::CHexEscape(TString(payload)),
- "']");
- });
- }
-
- return text;
+ return RepToPointer(rep)->ToString(mode);
}
std::ostream& operator<<(std::ostream& os, const Status& x) {
@@ -605,18 +414,7 @@ Status ErrnoToStatus(int error_number, y_absl::string_view message) {
MessageForErrnoToStatus(error_number, message));
}
-namespace status_internal {
-
-TString* MakeCheckFailString(const y_absl::Status* status,
- const char* prefix) {
- return new TString(
- y_absl::StrCat(prefix, " (",
- status->ToString(StatusToStringMode::kWithEverything), ")"));
-}
-
-} // namespace status_internal
-
-const char* StatusMessageAsCStr(const Status& status) {
+y_absl::Nonnull<const char*> StatusMessageAsCStr(const Status& status) {
// As an internal implementation detail, we guarantee that if status.message()
// is non-empty, then the resulting string_view is null terminated.
auto sv_message = status.message();
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.h b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.h
index b7f96e7c741..d2d9d3742b6 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.h
@@ -51,10 +51,17 @@
#ifndef Y_ABSL_STATUS_STATUS_H_
#define Y_ABSL_STATUS_STATUS_H_
+#include <cassert>
+#include <cstdint>
#include <ostream>
#include <util/generic/string.h>
#include <utility>
+#include "y_absl/base/attributes.h"
+#include "y_absl/base/config.h"
+#include "y_absl/base/macros.h"
+#include "y_absl/base/nullability.h"
+#include "y_absl/base/optimization.h"
#include "y_absl/functional/function_ref.h"
#include "y_absl/status/internal/status_internal.h"
#include "y_absl/strings/cord.h"
@@ -421,7 +428,7 @@ inline StatusToStringMode& operator^=(StatusToStringMode& lhs,
// Returned Status objects may not be ignored. status_internal.h has a forward
// declaration of the form
// class Y_ABSL_MUST_USE_RESULT Status;
-class Status final {
+class Y_ABSL_ATTRIBUTE_TRIVIAL_ABI Status final {
public:
// Constructors
@@ -516,6 +523,12 @@ class Status final {
TString ToString(
StatusToStringMode mode = StatusToStringMode::kDefault) const;
+ // Support `y_absl::StrCat`, `y_absl::StrFormat`, etc.
+ template <typename Sink>
+ friend void AbslStringify(Sink& sink, const Status& status) {
+ sink.Append(status.ToString(StatusToStringMode::kWithEverything));
+ }
+
// Status::IgnoreError()
//
// Ignores any errors. This method does nothing except potentially suppress
@@ -602,56 +615,57 @@ class Status final {
// code, and an empty error message.
explicit Status(y_absl::StatusCode code);
- static void UnrefNonInlined(uintptr_t rep);
+ // Underlying constructor for status from a rep_.
+ explicit Status(uintptr_t rep) : rep_(rep) {}
+
static void Ref(uintptr_t rep);
static void Unref(uintptr_t rep);
// REQUIRES: !ok()
- // Ensures rep_ is not shared with any other Status.
- void PrepareToModify();
-
- const status_internal::Payloads* GetPayloads() const;
- status_internal::Payloads* GetPayloads();
-
- static bool EqualsSlow(const y_absl::Status& a, const y_absl::Status& b);
+ // Ensures rep is not inlined or shared with any other Status.
+ static y_absl::Nonnull<status_internal::StatusRep*> PrepareToModify(
+ uintptr_t rep);
// MSVC 14.0 limitation requires the const.
static constexpr const char kMovedFromString[] =
"Status accessed after move.";
- static const TString* EmptyString();
- static const TString* MovedFromString();
+ static y_absl::Nonnull<const TString*> EmptyString();
+ static y_absl::Nonnull<const TString*> MovedFromString();
// Returns whether rep contains an inlined representation.
// See rep_ for details.
- static bool IsInlined(uintptr_t rep);
+ static constexpr bool IsInlined(uintptr_t rep);
// Indicates whether this Status was the rhs of a move operation. See rep_
// for details.
- static bool IsMovedFrom(uintptr_t rep);
- static uintptr_t MovedFromRep();
+ static constexpr bool IsMovedFrom(uintptr_t rep);
+ static constexpr uintptr_t MovedFromRep();
// Convert between error::Code and the inlined uintptr_t representation used
// by rep_. See rep_ for details.
- static uintptr_t CodeToInlinedRep(y_absl::StatusCode code);
- static y_absl::StatusCode InlinedRepToCode(uintptr_t rep);
+ static constexpr uintptr_t CodeToInlinedRep(y_absl::StatusCode code);
+ static constexpr y_absl::StatusCode InlinedRepToCode(uintptr_t rep);
// Converts between StatusRep* and the external uintptr_t representation used
// by rep_. See rep_ for details.
static uintptr_t PointerToRep(status_internal::StatusRep* r);
- static status_internal::StatusRep* RepToPointer(uintptr_t r);
+ static y_absl::Nonnull<const status_internal::StatusRep*> RepToPointer(
+ uintptr_t r);
- TString ToStringSlow(StatusToStringMode mode) const;
+ static TString ToStringSlow(uintptr_t rep, StatusToStringMode mode);
// Status supports two different representations.
- // - When the low bit is off it is an inlined representation.
+ // - When the low bit is set it is an inlined representation.
// It uses the canonical error space, no message or payload.
// The error code is (rep_ >> 2).
// The (rep_ & 2) bit is the "moved from" indicator, used in IsMovedFrom().
- // - When the low bit is on it is an external representation.
+ // - When the low bit is off it is an external representation.
// In this case all the data comes from a heap allocated Rep object.
- // (rep_ - 1) is a status_internal::StatusRep* pointer to that structure.
+ // rep_ is a status_internal::StatusRep* pointer to that structure.
uintptr_t rep_;
+
+ friend class status_internal::StatusRep;
};
// OkStatus()
@@ -755,11 +769,11 @@ Status ErrnoToStatus(int error_number, y_absl::string_view message);
// Implementation details follow
//------------------------------------------------------------------------------
-inline Status::Status() : rep_(CodeToInlinedRep(y_absl::StatusCode::kOk)) {}
+inline Status::Status() : Status(y_absl::StatusCode::kOk) {}
-inline Status::Status(y_absl::StatusCode code) : rep_(CodeToInlinedRep(code)) {}
+inline Status::Status(y_absl::StatusCode code) : Status(CodeToInlinedRep(code)) {}
-inline Status::Status(const Status& x) : rep_(x.rep_) { Ref(rep_); }
+inline Status::Status(const Status& x) : Status(x.rep_) { Ref(rep_); }
inline Status& Status::operator=(const Status& x) {
uintptr_t old_rep = rep_;
@@ -771,7 +785,7 @@ inline Status& Status::operator=(const Status& x) {
return *this;
}
-inline Status::Status(Status&& x) noexcept : rep_(x.rep_) {
+inline Status::Status(Status&& x) noexcept : Status(x.rep_) {
x.rep_ = MovedFromRep();
}
@@ -803,15 +817,27 @@ inline bool Status::ok() const {
return rep_ == CodeToInlinedRep(y_absl::StatusCode::kOk);
}
+inline y_absl::StatusCode Status::code() const {
+ return status_internal::MapToLocalCode(raw_code());
+}
+
+inline int Status::raw_code() const {
+ if (IsInlined(rep_)) return static_cast<int>(InlinedRepToCode(rep_));
+ return static_cast<int>(RepToPointer(rep_)->code());
+}
+
inline y_absl::string_view Status::message() const {
return !IsInlined(rep_)
- ? RepToPointer(rep_)->message
+ ? RepToPointer(rep_)->message()
: (IsMovedFrom(rep_) ? y_absl::string_view(kMovedFromString)
: y_absl::string_view());
}
inline bool operator==(const Status& lhs, const Status& rhs) {
- return lhs.rep_ == rhs.rep_ || Status::EqualsSlow(lhs, rhs);
+ if (lhs.rep_ == rhs.rep_) return true;
+ if (Status::IsInlined(lhs.rep_)) return false;
+ if (Status::IsInlined(rhs.rep_)) return false;
+ return *Status::RepToPointer(lhs.rep_) == *Status::RepToPointer(rhs.rep_);
}
inline bool operator!=(const Status& lhs, const Status& rhs) {
@@ -819,7 +845,7 @@ inline bool operator!=(const Status& lhs, const Status& rhs) {
}
inline TString Status::ToString(StatusToStringMode mode) const {
- return ok() ? "OK" : ToStringSlow(mode);
+ return ok() ? "OK" : ToStringSlow(rep_, mode);
}
inline void Status::IgnoreError() const {
@@ -831,52 +857,68 @@ inline void swap(y_absl::Status& a, y_absl::Status& b) {
swap(a.rep_, b.rep_);
}
-inline const status_internal::Payloads* Status::GetPayloads() const {
- return IsInlined(rep_) ? nullptr : RepToPointer(rep_)->payloads.get();
+inline y_absl::optional<y_absl::Cord> Status::GetPayload(
+ y_absl::string_view type_url) const {
+ if (IsInlined(rep_)) return y_absl::nullopt;
+ return RepToPointer(rep_)->GetPayload(type_url);
}
-inline status_internal::Payloads* Status::GetPayloads() {
- return IsInlined(rep_) ? nullptr : RepToPointer(rep_)->payloads.get();
+inline void Status::SetPayload(y_absl::string_view type_url, y_absl::Cord payload) {
+ if (ok()) return;
+ status_internal::StatusRep* rep = PrepareToModify(rep_);
+ rep->SetPayload(type_url, std::move(payload));
+ rep_ = PointerToRep(rep);
}
-inline bool Status::IsInlined(uintptr_t rep) { return (rep & 1) == 0; }
-
-inline bool Status::IsMovedFrom(uintptr_t rep) {
- return IsInlined(rep) && (rep & 2) != 0;
+inline bool Status::ErasePayload(y_absl::string_view type_url) {
+ if (IsInlined(rep_)) return false;
+ status_internal::StatusRep* rep = PrepareToModify(rep_);
+ auto res = rep->ErasePayload(type_url);
+ rep_ = res.new_rep;
+ return res.erased;
}
-inline uintptr_t Status::MovedFromRep() {
- return CodeToInlinedRep(y_absl::StatusCode::kInternal) | 2;
+inline void Status::ForEachPayload(
+ y_absl::FunctionRef<void(y_absl::string_view, const y_absl::Cord&)> visitor)
+ const {
+ if (IsInlined(rep_)) return;
+ RepToPointer(rep_)->ForEachPayload(visitor);
}
-inline uintptr_t Status::CodeToInlinedRep(y_absl::StatusCode code) {
- return static_cast<uintptr_t>(code) << 2;
+constexpr bool Status::IsInlined(uintptr_t rep) { return (rep & 1) != 0; }
+
+constexpr bool Status::IsMovedFrom(uintptr_t rep) { return (rep & 2) != 0; }
+
+constexpr uintptr_t Status::CodeToInlinedRep(y_absl::StatusCode code) {
+ return (static_cast<uintptr_t>(code) << 2) + 1;
}
-inline y_absl::StatusCode Status::InlinedRepToCode(uintptr_t rep) {
- assert(IsInlined(rep));
+constexpr y_absl::StatusCode Status::InlinedRepToCode(uintptr_t rep) {
+ Y_ABSL_ASSERT(IsInlined(rep));
return static_cast<y_absl::StatusCode>(rep >> 2);
}
-inline status_internal::StatusRep* Status::RepToPointer(uintptr_t rep) {
+constexpr uintptr_t Status::MovedFromRep() {
+ return CodeToInlinedRep(y_absl::StatusCode::kInternal) | 2;
+}
+
+inline y_absl::Nonnull<const status_internal::StatusRep*> Status::RepToPointer(
+ uintptr_t rep) {
assert(!IsInlined(rep));
- return reinterpret_cast<status_internal::StatusRep*>(rep - 1);
+ return reinterpret_cast<const status_internal::StatusRep*>(rep);
}
-inline uintptr_t Status::PointerToRep(status_internal::StatusRep* rep) {
- return reinterpret_cast<uintptr_t>(rep) + 1;
+inline uintptr_t Status::PointerToRep(
+ y_absl::Nonnull<status_internal::StatusRep*> rep) {
+ return reinterpret_cast<uintptr_t>(rep);
}
inline void Status::Ref(uintptr_t rep) {
- if (!IsInlined(rep)) {
- RepToPointer(rep)->ref.fetch_add(1, std::memory_order_relaxed);
- }
+ if (!IsInlined(rep)) RepToPointer(rep)->Ref();
}
inline void Status::Unref(uintptr_t rep) {
- if (!IsInlined(rep)) {
- UnrefNonInlined(rep);
- }
+ if (!IsInlined(rep)) RepToPointer(rep)->Unref();
}
inline Status OkStatus() { return Status(); }
@@ -892,7 +934,7 @@ inline Status CancelledError() { return Status(y_absl::StatusCode::kCancelled);
// If the status's message is empty, the empty string is returned.
//
// StatusMessageAsCStr exists for C support. Use `status.message()` in C++.
-const char* StatusMessageAsCStr(
+y_absl::Nonnull<const char*> StatusMessageAsCStr(
const Status& status Y_ABSL_ATTRIBUTE_LIFETIME_BOUND);
Y_ABSL_NAMESPACE_END
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.cc
index ae3803ed48c..1c8381c0d99 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.cc
@@ -13,9 +13,7 @@
// limitations under the License.
#include "y_absl/status/status_payload_printer.h"
-#include <atomic>
-
-#include "y_absl/base/attributes.h"
+#include "y_absl/base/config.h"
#include "y_absl/base/internal/atomic_hook.h"
namespace y_absl {
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.h b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.h
index 3ecb62fc216..04174d2aef5 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.h
@@ -16,6 +16,7 @@
#include <util/generic/string.h>
+#include "y_absl/base/nullability.h"
#include "y_absl/strings/cord.h"
#include "y_absl/strings/string_view.h"
#include "y_absl/types/optional.h"
@@ -34,8 +35,8 @@ namespace status_internal {
// NOTE: This is an internal API and the design is subject to change in the
// future in a non-backward-compatible way. Since it's only meant for debugging
// purpose, you should not rely on it in any critical logic.
-using StatusPayloadPrinter = y_absl::optional<TString> (*)(y_absl::string_view,
- const y_absl::Cord&);
+using StatusPayloadPrinter = y_absl::Nullable<y_absl::optional<TString> (*)(
+ y_absl::string_view, const y_absl::Cord&)>;
// Sets the global payload printer. Only one printer should be set per process.
// If multiple printers are set, it's undefined which one will be used.
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.cc
index f9dce7c12d4..777e1ab8a5d 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.cc
@@ -17,7 +17,10 @@
#include <utility>
#include "y_absl/base/call_once.h"
+#include "y_absl/base/config.h"
#include "y_absl/base/internal/raw_logging.h"
+#include "y_absl/base/nullability.h"
+#include "y_absl/status/internal/statusor_internal.h"
#include "y_absl/status/status.h"
#include "y_absl/strings/str_cat.h"
@@ -52,7 +55,7 @@ BadStatusOrAccess& BadStatusOrAccess::operator=(BadStatusOrAccess&& other) {
BadStatusOrAccess::BadStatusOrAccess(BadStatusOrAccess&& other)
: status_(std::move(other.status_)) {}
-const char* BadStatusOrAccess::what() const noexcept {
+y_absl::Nonnull<const char*> BadStatusOrAccess::what() const noexcept {
InitWhat();
return what_.c_str();
}
@@ -67,7 +70,7 @@ void BadStatusOrAccess::InitWhat() const {
namespace internal_statusor {
-void Helper::HandleInvalidStatusCtorArg(y_absl::Status* status) {
+void Helper::HandleInvalidStatusCtorArg(y_absl::Nonnull<y_absl::Status*> status) {
const char* kMessage =
"An OK status is not a valid constructor argument to StatusOr<T>";
#ifdef NDEBUG
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.h b/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.h
index a9c2a83ebc5..d12ed41d151 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.h
@@ -39,15 +39,20 @@
#include <exception>
#include <initializer_list>
#include <new>
+#include <ostream>
#include <util/generic/string.h>
#include <type_traits>
#include <utility>
#include "y_absl/base/attributes.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/base/call_once.h"
#include "y_absl/meta/type_traits.h"
#include "y_absl/status/internal/statusor_internal.h"
#include "y_absl/status/status.h"
+#include "y_absl/strings/has_absl_stringify.h"
+#include "y_absl/strings/has_ostream_operator.h"
+#include "y_absl/strings/str_format.h"
#include "y_absl/types/variant.h"
#include "y_absl/utility/utility.h"
@@ -88,7 +93,7 @@ class BadStatusOrAccess : public std::exception {
//
// The pointer of this string is guaranteed to be valid until any non-const
// function is invoked on the exception object.
- const char* what() const noexcept override;
+ y_absl::Nonnull<const char*> what() const noexcept override;
// BadStatusOrAccess::status()
//
@@ -650,6 +655,41 @@ bool operator!=(const StatusOr<T>& lhs, const StatusOr<T>& rhs) {
return !(lhs == rhs);
}
+// Prints the `value` or the status in brackets to `os`.
+//
+// Requires `T` supports `operator<<`. Do not rely on the output format which
+// may change without notice.
+template <typename T, typename std::enable_if<
+ y_absl::HasOstreamOperator<T>::value, int>::type = 0>
+std::ostream& operator<<(std::ostream& os, const StatusOr<T>& status_or) {
+ if (status_or.ok()) {
+ os << status_or.value();
+ } else {
+ os << internal_statusor::StringifyRandom::OpenBrackets()
+ << status_or.status()
+ << internal_statusor::StringifyRandom::CloseBrackets();
+ }
+ return os;
+}
+
+// As above, but supports `StrCat`, `StrFormat`, etc.
+//
+// Requires `T` has `AbslStringify`. Do not rely on the output format which
+// may change without notice.
+template <
+ typename Sink, typename T,
+ typename std::enable_if<y_absl::HasAbslStringify<T>::value, int>::type = 0>
+void AbslStringify(Sink& sink, const StatusOr<T>& status_or) {
+ if (status_or.ok()) {
+ y_absl::Format(&sink, "%v", status_or.value());
+ } else {
+ y_absl::Format(&sink, "%s%v%s",
+ internal_statusor::StringifyRandom::OpenBrackets(),
+ status_or.status(),
+ internal_statusor::StringifyRandom::CloseBrackets());
+ }
+}
+
//------------------------------------------------------------------------------
// Implementation details for StatusOr<T>
//------------------------------------------------------------------------------
@@ -750,13 +790,13 @@ T&& StatusOr<T>::operator*() && {
}
template <typename T>
-const T* StatusOr<T>::operator->() const {
+y_absl::Nonnull<const T*> StatusOr<T>::operator->() const {
this->EnsureOk();
return &this->data_;
}
template <typename T>
-T* StatusOr<T>::operator->() {
+y_absl::Nonnull<T*> StatusOr<T>::operator->() {
this->EnsureOk();
return &this->data_;
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/status/ya.make
index e68ee292af2..27096368a29 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/ya.make
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/ya.make
@@ -24,6 +24,7 @@ ADDINCL(
NO_COMPILER_WARNINGS()
SRCS(
+ internal/status_internal.cc
status.cc
status_payload_printer.cc
)
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/ascii.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/ascii.cc
index 47d07e60234..0d8a1d838ed 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/ascii.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/ascii.cc
@@ -15,8 +15,13 @@
#include "y_absl/strings/ascii.h"
#include <climits>
+#include <cstdint>
#include <cstring>
#include <util/generic/string.h>
+#include <type_traits>
+
+#include "y_absl/base/config.h"
+#include "y_absl/base/nullability.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
@@ -157,8 +162,74 @@ Y_ABSL_DLL const char kToUpper[256] = {
};
// clang-format on
+template <class T>
+static constexpr T BroadcastByte(unsigned char value) {
+ static_assert(std::is_integral<T>::value && sizeof(T) <= sizeof(uint64_t) &&
+ std::is_unsigned<T>::value,
+ "only unsigned integers up to 64-bit allowed");
+ T result = value;
+ constexpr size_t result_bit_width = sizeof(result) * CHAR_BIT;
+ result |= result << ((CHAR_BIT << 0) & (result_bit_width - 1));
+ result |= result << ((CHAR_BIT << 1) & (result_bit_width - 1));
+ result |= result << ((CHAR_BIT << 2) & (result_bit_width - 1));
+ return result;
+}
+
+// Returns whether `c` is in the a-z/A-Z range (w.r.t. `ToUpper`).
+// Implemented by:
+// 1. Pushing the a-z/A-Z range to [SCHAR_MIN, SCHAR_MIN + 26).
+// 2. Comparing to SCHAR_MIN + 26.
+template <bool ToUpper>
+constexpr bool AsciiInAZRange(unsigned char c) {
+ constexpr unsigned char sub = (ToUpper ? 'a' : 'A') - SCHAR_MIN;
+ constexpr signed char threshold = SCHAR_MIN + 26; // 26 = alphabet size.
+ // Using unsigned arithmetic as overflows/underflows are well defined.
+ unsigned char u = c - sub;
+ // Using signed cmp, as SIMD unsigned cmp isn't available in many platforms.
+ return static_cast<signed char>(u) < threshold;
+}
+
template <bool ToUpper>
-constexpr void AsciiStrCaseFold(char* p, char* end) {
+static constexpr char* PartialAsciiStrCaseFold(y_absl::Nonnull<char*> p,
+ y_absl::Nonnull<char*> end) {
+ using vec_t = size_t;
+ const size_t n = static_cast<size_t>(end - p);
+
+ // SWAR algorithm: http://0x80.pl/notesen/2016-01-06-swar-swap-case.html
+ constexpr char ch_a = ToUpper ? 'a' : 'A', ch_z = ToUpper ? 'z' : 'Z';
+ char* const swar_end = p + (n / sizeof(vec_t)) * sizeof(vec_t);
+ while (p < swar_end) {
+ vec_t v = vec_t();
+
+ // memcpy the vector, but constexpr
+ for (size_t i = 0; i < sizeof(vec_t); ++i) {
+ v |= static_cast<vec_t>(static_cast<unsigned char>(p[i]))
+ << (i * CHAR_BIT);
+ }
+
+ constexpr unsigned int msb = 1u << (CHAR_BIT - 1);
+ const vec_t v_msb = v & BroadcastByte<vec_t>(msb);
+ const vec_t v_nonascii_mask = (v_msb << 1) - (v_msb >> (CHAR_BIT - 1));
+ const vec_t v_nonascii = v & v_nonascii_mask;
+ const vec_t v_ascii = v & ~v_nonascii_mask;
+ const vec_t a = v_ascii + BroadcastByte<vec_t>(msb - ch_a - 0),
+ z = v_ascii + BroadcastByte<vec_t>(msb - ch_z - 1);
+ v = v_nonascii | (v_ascii ^ ((a ^ z) & BroadcastByte<vec_t>(msb)) >> 2);
+
+ // memcpy the vector, but constexpr
+ for (size_t i = 0; i < sizeof(vec_t); ++i) {
+ p[i] = static_cast<char>(v >> (i * CHAR_BIT));
+ }
+
+ p += sizeof(v);
+ }
+
+ return p;
+}
+
+template <bool ToUpper>
+static constexpr void AsciiStrCaseFold(y_absl::Nonnull<char*> p,
+ y_absl::Nonnull<char*> end) {
// The upper- and lowercase versions of ASCII characters differ by only 1 bit.
// When we need to flip the case, we can xor with this bit to achieve the
// desired result. Note that the choice of 'a' and 'A' here is arbitrary. We
@@ -166,16 +237,17 @@ constexpr void AsciiStrCaseFold(char* p, char* end) {
// have the same single bit difference.
constexpr unsigned char kAsciiCaseBitFlip = 'a' ^ 'A';
- constexpr char ch_a = ToUpper ? 'a' : 'A';
- constexpr char ch_z = ToUpper ? 'z' : 'Z';
- for (; p < end; ++p) {
+ using vec_t = size_t;
+ // TODO(b/316380338): When FDO becomes able to vectorize these,
+ // revert this manual optimization and just leave the naive loop.
+ if (static_cast<size_t>(end - p) >= sizeof(vec_t)) {
+ p = ascii_internal::PartialAsciiStrCaseFold<ToUpper>(p, end);
+ }
+ while (p < end) {
unsigned char v = static_cast<unsigned char>(*p);
- // We use & instead of && to ensure this always stays branchless
- // We use static_cast<int> to suppress -Wbitwise-instead-of-logical
- bool is_in_range = static_cast<bool>(static_cast<int>(ch_a <= v) &
- static_cast<int>(v <= ch_z));
- v ^= is_in_range ? kAsciiCaseBitFlip : 0;
+ v ^= AsciiInAZRange<ToUpper>(v) ? kAsciiCaseBitFlip : 0;
*p = static_cast<char>(v);
+ ++p;
}
}
@@ -205,17 +277,17 @@ static_assert(ValidateAsciiCasefold() == 0, "error in case conversion");
} // namespace ascii_internal
-void AsciiStrToLower(TString* s) {
+void AsciiStrToLower(y_absl::Nonnull<TString*> s) {
char* p = &(*s)[0]; // Guaranteed to be valid for empty strings
return ascii_internal::AsciiStrCaseFold<false>(p, p + s->size());
}
-void AsciiStrToUpper(TString* s) {
+void AsciiStrToUpper(y_absl::Nonnull<TString*> s) {
char* p = &(*s)[0]; // Guaranteed to be valid for empty strings
return ascii_internal::AsciiStrCaseFold<true>(p, p + s->size());
}
-void RemoveExtraAsciiWhitespace(TString* str) {
+void RemoveExtraAsciiWhitespace(y_absl::Nonnull<TString*> str) {
auto stripped = StripAsciiWhitespace(*str);
if (stripped.empty()) {
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/ascii.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/ascii.h
index 02a6185ae62..94de417dbfa 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/ascii.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/ascii.h
@@ -53,10 +53,12 @@
#define Y_ABSL_STRINGS_ASCII_H_
#include <algorithm>
+#include <cstddef>
#include <util/generic/string.h>
#include "y_absl/base/attributes.h"
#include "y_absl/base/config.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/strings/string_view.h"
namespace y_absl {
@@ -165,7 +167,7 @@ inline char ascii_tolower(unsigned char c) {
}
// Converts the characters in `s` to lowercase, changing the contents of `s`.
-void AsciiStrToLower(TString* s);
+void AsciiStrToLower(y_absl::Nonnull<TString*> s);
// Creates a lowercase string from a given y_absl::string_view.
Y_ABSL_MUST_USE_RESULT inline TString AsciiStrToLower(y_absl::string_view s) {
@@ -183,7 +185,7 @@ inline char ascii_toupper(unsigned char c) {
}
// Converts the characters in `s` to uppercase, changing the contents of `s`.
-void AsciiStrToUpper(TString* s);
+void AsciiStrToUpper(y_absl::Nonnull<TString*> s);
// Creates an uppercase string from a given y_absl::string_view.
Y_ABSL_MUST_USE_RESULT inline TString AsciiStrToUpper(y_absl::string_view s) {
@@ -201,7 +203,7 @@ Y_ABSL_MUST_USE_RESULT inline y_absl::string_view StripLeadingAsciiWhitespace(
}
// Strips in place whitespace from the beginning of the given string.
-inline void StripLeadingAsciiWhitespace(TString* str) {
+inline void StripLeadingAsciiWhitespace(y_absl::Nonnull<TString*> str) {
auto it = std::find_if_not(str->cbegin(), str->cend(), y_absl::ascii_isspace);
str->erase(str->begin(), it);
}
@@ -215,7 +217,7 @@ Y_ABSL_MUST_USE_RESULT inline y_absl::string_view StripTrailingAsciiWhitespace(
}
// Strips in place whitespace from the end of the given string
-inline void StripTrailingAsciiWhitespace(TString* str) {
+inline void StripTrailingAsciiWhitespace(y_absl::Nonnull<TString*> str) {
auto it = std::find_if_not(str->rbegin(), str->rend(), y_absl::ascii_isspace);
str->erase(static_cast<size_t>(str->rend() - it));
}
@@ -228,13 +230,13 @@ Y_ABSL_MUST_USE_RESULT inline y_absl::string_view StripAsciiWhitespace(
}
// Strips in place whitespace from both ends of the given string
-inline void StripAsciiWhitespace(TString* str) {
+inline void StripAsciiWhitespace(y_absl::Nonnull<TString*> str) {
StripTrailingAsciiWhitespace(str);
StripLeadingAsciiWhitespace(str);
}
// Removes leading, trailing, and consecutive internal whitespace.
-void RemoveExtraAsciiWhitespace(TString*);
+void RemoveExtraAsciiWhitespace(y_absl::Nonnull<TString*> str);
Y_ABSL_NAMESPACE_END
} // namespace y_absl
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/charconv.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/charconv.cc
index a31acf1f3c5..fdfbd475e7b 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/charconv.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/charconv.cc
@@ -16,12 +16,14 @@
#include <algorithm>
#include <cassert>
-#include <cmath>
-#include <cstring>
+#include <cstddef>
+#include <cstdint>
#include <limits>
+#include <system_error> // NOLINT(build/c++11)
#include "y_absl/base/casts.h"
#include "y_absl/base/config.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/numeric/bits.h"
#include "y_absl/numeric/int128.h"
#include "y_absl/strings/internal/charconv_bigint.h"
@@ -118,7 +120,7 @@ struct FloatTraits<double> {
// Parsing a smaller N will produce something finite.
static constexpr int kEiselLemireMaxExclusiveExp10 = 309;
- static double MakeNan(const char* tagp) {
+ static double MakeNan(y_absl::Nonnull<const char*> tagp) {
#if Y_ABSL_HAVE_BUILTIN(__builtin_nan)
// Use __builtin_nan() if available since it has a fix for
// https://bugs.llvm.org/show_bug.cgi?id=37778
@@ -191,7 +193,7 @@ struct FloatTraits<float> {
static constexpr int kEiselLemireMinInclusiveExp10 = -46 - 18;
static constexpr int kEiselLemireMaxExclusiveExp10 = 39;
- static float MakeNan(const char* tagp) {
+ static float MakeNan(y_absl::Nonnull<const char*> tagp) {
#if Y_ABSL_HAVE_BUILTIN(__builtin_nanf)
// Use __builtin_nanf() if available since it has a fix for
// https://bugs.llvm.org/show_bug.cgi?id=37778
@@ -343,7 +345,7 @@ int NormalizedShiftSize(int mantissa_width, int binary_exponent) {
// `value` must be wider than the requested bit width.
//
// Returns the number of bits shifted.
-int TruncateToBitWidth(int bit_width, uint128* value) {
+int TruncateToBitWidth(int bit_width, y_absl::Nonnull<uint128*> value) {
const int current_bit_width = BitWidth(*value);
const int shift = current_bit_width - bit_width;
*value >>= shift;
@@ -355,7 +357,7 @@ int TruncateToBitWidth(int bit_width, uint128* value) {
// the appropriate double, and returns true.
template <typename FloatType>
bool HandleEdgeCase(const strings_internal::ParsedFloat& input, bool negative,
- FloatType* value) {
+ y_absl::Nonnull<FloatType*> value) {
if (input.type == strings_internal::FloatType::kNan) {
// A bug in both clang < 7 and gcc would cause the compiler to optimize
// away the buffer we are building below. Declaring the buffer volatile
@@ -404,7 +406,8 @@ bool HandleEdgeCase(const strings_internal::ParsedFloat& input, bool negative,
// number is stored in *value.
template <typename FloatType>
void EncodeResult(const CalculatedFloat& calculated, bool negative,
- y_absl::from_chars_result* result, FloatType* value) {
+ y_absl::Nonnull<y_absl::from_chars_result*> result,
+ y_absl::Nonnull<FloatType*> value) {
if (calculated.exponent == kOverflow) {
result->ec = std::errc::result_out_of_range;
*value = negative ? -std::numeric_limits<FloatType>::max()
@@ -450,7 +453,7 @@ void EncodeResult(const CalculatedFloat& calculated, bool negative,
// Zero and negative values of `shift` are accepted, in which case the word is
// shifted left, as necessary.
uint64_t ShiftRightAndRound(uint128 value, int shift, bool input_exact,
- bool* output_exact) {
+ y_absl::Nonnull<bool*> output_exact) {
if (shift <= 0) {
*output_exact = input_exact;
return static_cast<uint64_t>(value << -shift);
@@ -684,7 +687,8 @@ CalculatedFloat CalculateFromParsedDecimal(
// this function returns false) is both fast and correct.
template <typename FloatType>
bool EiselLemire(const strings_internal::ParsedFloat& input, bool negative,
- FloatType* value, std::errc* ec) {
+ y_absl::Nonnull<FloatType*> value,
+ y_absl::Nonnull<std::errc*> ec) {
uint64_t man = input.mantissa;
int exp10 = input.exponent;
if (exp10 < FloatTraits<FloatType>::kEiselLemireMinInclusiveExp10) {
@@ -857,7 +861,8 @@ bool EiselLemire(const strings_internal::ParsedFloat& input, bool negative,
}
template <typename FloatType>
-from_chars_result FromCharsImpl(const char* first, const char* last,
+from_chars_result FromCharsImpl(y_absl::Nonnull<const char*> first,
+ y_absl::Nonnull<const char*> last,
FloatType& value, chars_format fmt_flags) {
from_chars_result result;
result.ptr = first; // overwritten on successful parse
@@ -943,12 +948,14 @@ from_chars_result FromCharsImpl(const char* first, const char* last,
}
} // namespace
-from_chars_result from_chars(const char* first, const char* last, double& value,
+from_chars_result from_chars(y_absl::Nonnull<const char*> first,
+ y_absl::Nonnull<const char*> last, double& value,
chars_format fmt) {
return FromCharsImpl(first, last, value, fmt);
}
-from_chars_result from_chars(const char* first, const char* last, float& value,
+from_chars_result from_chars(y_absl::Nonnull<const char*> first,
+ y_absl::Nonnull<const char*> last, float& value,
chars_format fmt) {
return FromCharsImpl(first, last, value, fmt);
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/charconv.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/charconv.h
index 46c5dc95ba5..52d5f4ab99c 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/charconv.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/charconv.h
@@ -18,6 +18,7 @@
#include <system_error> // NOLINT(build/c++11)
#include "y_absl/base/config.h"
+#include "y_absl/base/nullability.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
@@ -44,7 +45,7 @@ enum class chars_format {
// characters that were successfully parsed. If none was found, `ptr` is set
// to the `first` argument to from_chars.
struct from_chars_result {
- const char* ptr;
+ y_absl::Nonnull<const char*> ptr;
std::errc ec;
};
@@ -76,11 +77,13 @@ struct from_chars_result {
// format that strtod() accepts, except that a "0x" prefix is NOT matched.
// (In particular, in `hex` mode, the input "0xff" results in the largest
// matching pattern "0".)
-y_absl::from_chars_result from_chars(const char* first, const char* last,
+y_absl::from_chars_result from_chars(y_absl::Nonnull<const char*> first,
+ y_absl::Nonnull<const char*> last,
double& value, // NOLINT
chars_format fmt = chars_format::general);
-y_absl::from_chars_result from_chars(const char* first, const char* last,
+y_absl::from_chars_result from_chars(y_absl::Nonnull<const char*> first,
+ y_absl::Nonnull<const char*> last,
float& value, // NOLINT
chars_format fmt = chars_format::general);
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/charset.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/charset.h
new file mode 100644
index 00000000000..1d602f340fa
--- /dev/null
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/charset.h
@@ -0,0 +1,164 @@
+// Copyright 2022 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// -----------------------------------------------------------------------------
+// File: charset.h
+// -----------------------------------------------------------------------------
+//
+// This file contains y_absl::CharSet, a fast, bit-vector set of 8-bit unsigned
+// characters.
+//
+// Instances can be initialized as constexpr constants. For example:
+//
+// constexpr y_absl::CharSet kJustX = y_absl::CharSet::Char('x');
+// constexpr y_absl::CharSet kMySymbols = y_absl::CharSet("$@!");
+// constexpr y_absl::CharSet kLetters = y_absl::CharSet::Range('a', 'z');
+//
+// Multiple instances can be combined that still forms a constexpr expression.
+// For example:
+//
+// constexpr y_absl::CharSet kLettersAndNumbers =
+// y_absl::CharSet::Range('a', 'z') | y_absl::CharSet::Range('0', '9');
+//
+// Several pre-defined character classes are available that mirror the methods
+// from <cctype>. For example:
+//
+// constexpr y_absl::CharSet kLettersAndWhitespace =
+// y_absl::CharSet::AsciiAlphabet() | y_absl::CharSet::AsciiWhitespace();
+//
+// To check membership, use the .contains method, e.g.
+//
+// y_absl::CharSet hex_letters("abcdef");
+// hex_letters.contains('a'); // true
+// hex_letters.contains('g'); // false
+
+#ifndef Y_ABSL_STRINGS_CHARSET_H_
+#define Y_ABSL_STRINGS_CHARSET_H_
+
+#include <cstddef>
+#include <cstdint>
+#include <cstring>
+
+#include "y_absl/base/macros.h"
+#include "y_absl/base/port.h"
+#include "y_absl/strings/string_view.h"
+
+namespace y_absl {
+
+class CharSet {
+ public:
+ constexpr CharSet() : m_() {}
+
+ // Initializes with a given string_view.
+ constexpr explicit CharSet(y_absl::string_view str) : m_() {
+ for (char c : str) {
+ SetChar(static_cast<unsigned char>(c));
+ }
+ }
+
+ constexpr bool contains(char c) const {
+ return ((m_[static_cast<unsigned char>(c) / 64] >>
+ (static_cast<unsigned char>(c) % 64)) &
+ 0x1) == 0x1;
+ }
+
+ constexpr bool empty() const {
+ for (uint64_t c : m_) {
+ if (c != 0) return false;
+ }
+ return true;
+ }
+
+ // Containing only a single specified char.
+ static constexpr CharSet Char(char x) {
+ return CharSet(CharMaskForWord(x, 0), CharMaskForWord(x, 1),
+ CharMaskForWord(x, 2), CharMaskForWord(x, 3));
+ }
+
+ // Containing all the chars in the closed interval [lo,hi].
+ static constexpr CharSet Range(char lo, char hi) {
+ return CharSet(RangeForWord(lo, hi, 0), RangeForWord(lo, hi, 1),
+ RangeForWord(lo, hi, 2), RangeForWord(lo, hi, 3));
+ }
+
+ friend constexpr CharSet operator&(const CharSet& a, const CharSet& b) {
+ return CharSet(a.m_[0] & b.m_[0], a.m_[1] & b.m_[1], a.m_[2] & b.m_[2],
+ a.m_[3] & b.m_[3]);
+ }
+
+ friend constexpr CharSet operator|(const CharSet& a, const CharSet& b) {
+ return CharSet(a.m_[0] | b.m_[0], a.m_[1] | b.m_[1], a.m_[2] | b.m_[2],
+ a.m_[3] | b.m_[3]);
+ }
+
+ friend constexpr CharSet operator~(const CharSet& a) {
+ return CharSet(~a.m_[0], ~a.m_[1], ~a.m_[2], ~a.m_[3]);
+ }
+
+ // Mirrors the char-classifying predicates in <cctype>.
+ static constexpr CharSet AsciiUppercase() { return CharSet::Range('A', 'Z'); }
+ static constexpr CharSet AsciiLowercase() { return CharSet::Range('a', 'z'); }
+ static constexpr CharSet AsciiDigits() { return CharSet::Range('0', '9'); }
+ static constexpr CharSet AsciiAlphabet() {
+ return AsciiLowercase() | AsciiUppercase();
+ }
+ static constexpr CharSet AsciiAlphanumerics() {
+ return AsciiDigits() | AsciiAlphabet();
+ }
+ static constexpr CharSet AsciiHexDigits() {
+ return AsciiDigits() | CharSet::Range('A', 'F') | CharSet::Range('a', 'f');
+ }
+ static constexpr CharSet AsciiPrintable() {
+ return CharSet::Range(0x20, 0x7e);
+ }
+ static constexpr CharSet AsciiWhitespace() { return CharSet("\t\n\v\f\r "); }
+ static constexpr CharSet AsciiPunctuation() {
+ return AsciiPrintable() & ~AsciiWhitespace() & ~AsciiAlphanumerics();
+ }
+
+ private:
+ constexpr CharSet(uint64_t b0, uint64_t b1, uint64_t b2, uint64_t b3)
+ : m_{b0, b1, b2, b3} {}
+
+ static constexpr uint64_t RangeForWord(char lo, char hi, uint64_t word) {
+ return OpenRangeFromZeroForWord(static_cast<unsigned char>(hi) + 1, word) &
+ ~OpenRangeFromZeroForWord(static_cast<unsigned char>(lo), word);
+ }
+
+ // All the chars in the specified word of the range [0, upper).
+ static constexpr uint64_t OpenRangeFromZeroForWord(uint64_t upper,
+ uint64_t word) {
+ return (upper <= 64 * word) ? 0
+ : (upper >= 64 * (word + 1))
+ ? ~static_cast<uint64_t>(0)
+ : (~static_cast<uint64_t>(0) >> (64 - upper % 64));
+ }
+
+ static constexpr uint64_t CharMaskForWord(char x, uint64_t word) {
+ return (static_cast<unsigned char>(x) / 64 == word)
+ ? (static_cast<uint64_t>(1)
+ << (static_cast<unsigned char>(x) % 64))
+ : 0;
+ }
+
+ constexpr void SetChar(unsigned char c) {
+ m_[c / 64] |= static_cast<uint64_t>(1) << (c % 64);
+ }
+
+ uint64_t m_[4];
+};
+
+} // namespace y_absl
+
+#endif // Y_ABSL_STRINGS_CHARSET_H_
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord.cc
index dd647a89f87..a1e7c30bca0 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord.cc
@@ -15,27 +15,33 @@
#include "y_absl/strings/cord.h"
#include <algorithm>
-#include <atomic>
+#include <cassert>
#include <cstddef>
+#include <cstdint>
#include <cstdio>
#include <cstdlib>
+#include <cstring>
#include <iomanip>
#include <ios>
#include <iostream>
#include <limits>
+#include <memory>
#include <ostream>
#include <sstream>
-#include <type_traits>
-#include <unordered_set>
-#include <vector>
+#include <util/generic/string.h>
+#include <utility>
-#include "y_absl/base/casts.h"
+#include "y_absl/base/attributes.h"
+#include "y_absl/base/config.h"
+#include "y_absl/base/internal/endian.h"
#include "y_absl/base/internal/raw_logging.h"
#include "y_absl/base/macros.h"
-#include "y_absl/base/port.h"
-#include "y_absl/container/fixed_array.h"
+#include "y_absl/base/optimization.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/container/inlined_vector.h"
+#include "y_absl/crc/crc32c.h"
#include "y_absl/crc/internal/crc_cord_state.h"
+#include "y_absl/functional/function_ref.h"
#include "y_absl/strings/cord_buffer.h"
#include "y_absl/strings/escaping.h"
#include "y_absl/strings/internal/cord_data_edge.h"
@@ -43,13 +49,14 @@
#include "y_absl/strings/internal/cord_rep_btree.h"
#include "y_absl/strings/internal/cord_rep_crc.h"
#include "y_absl/strings/internal/cord_rep_flat.h"
-#include "y_absl/strings/internal/cordz_statistics.h"
-#include "y_absl/strings/internal/cordz_update_scope.h"
#include "y_absl/strings/internal/cordz_update_tracker.h"
#include "y_absl/strings/internal/resize_uninitialized.h"
+#include "y_absl/strings/match.h"
#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_join.h"
#include "y_absl/strings/string_view.h"
+#include "y_absl/strings/strip.h"
+#include "y_absl/types/optional.h"
+#include "y_absl/types/span.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
@@ -68,29 +75,21 @@ using ::y_absl::cord_internal::kMinFlatLength;
using ::y_absl::cord_internal::kInlinedVectorSize;
using ::y_absl::cord_internal::kMaxBytesToCopy;
-static void DumpNode(CordRep* rep, bool include_data, std::ostream* os,
- int indent = 0);
-static bool VerifyNode(CordRep* root, CordRep* start_node,
- bool full_validation);
-
-static inline CordRep* VerifyTree(CordRep* node) {
- // Verification is expensive, so only do it in debug mode.
- // Even in debug mode we normally do only light validation.
- // If you are debugging Cord itself, you should define the
- // macro EXTRA_CORD_VALIDATION, e.g. by adding
- // --copt=-DEXTRA_CORD_VALIDATION to the blaze line.
-#ifdef EXTRA_CORD_VALIDATION
- assert(node == nullptr || VerifyNode(node, node, /*full_validation=*/true));
-#else // EXTRA_CORD_VALIDATION
- assert(node == nullptr || VerifyNode(node, node, /*full_validation=*/false));
-#endif // EXTRA_CORD_VALIDATION
- static_cast<void>(&VerifyNode);
+static void DumpNode(y_absl::Nonnull<CordRep*> rep, bool include_data,
+ y_absl::Nonnull<std::ostream*> os, int indent = 0);
+static bool VerifyNode(y_absl::Nonnull<CordRep*> root,
+ y_absl::Nonnull<CordRep*> start_node);
+static inline y_absl::Nullable<CordRep*> VerifyTree(
+ y_absl::Nullable<CordRep*> node) {
+ assert(node == nullptr || VerifyNode(node, node));
+ static_cast<void>(&VerifyNode);
return node;
}
-static CordRepFlat* CreateFlat(const char* data, size_t length,
- size_t alloc_hint) {
+static y_absl::Nonnull<CordRepFlat*> CreateFlat(y_absl::Nonnull<const char*> data,
+ size_t length,
+ size_t alloc_hint) {
CordRepFlat* flat = CordRepFlat::New(length + alloc_hint);
flat->length = length;
memcpy(flat->Data(), data, length);
@@ -99,7 +98,8 @@ static CordRepFlat* CreateFlat(const char* data, size_t length,
// Creates a new flat or Btree out of the specified array.
// The returned node has a refcount of 1.
-static CordRep* NewBtree(const char* data, size_t length, size_t alloc_hint) {
+static y_absl::Nonnull<CordRep*> NewBtree(y_absl::Nonnull<const char*> data,
+ size_t length, size_t alloc_hint) {
if (length <= kMaxFlatLength) {
return CreateFlat(data, length, alloc_hint);
}
@@ -112,14 +112,16 @@ static CordRep* NewBtree(const char* data, size_t length, size_t alloc_hint) {
// Create a new tree out of the specified array.
// The returned node has a refcount of 1.
-static CordRep* NewTree(const char* data, size_t length, size_t alloc_hint) {
+static y_absl::Nullable<CordRep*> NewTree(y_absl::Nullable<const char*> data,
+ size_t length, size_t alloc_hint) {
if (length == 0) return nullptr;
return NewBtree(data, length, alloc_hint);
}
namespace cord_internal {
-void InitializeCordRepExternal(y_absl::string_view data, CordRepExternal* rep) {
+void InitializeCordRepExternal(y_absl::string_view data,
+ y_absl::Nonnull<CordRepExternal*> rep) {
assert(!data.empty());
rep->length = data.size();
rep->tag = EXTERNAL;
@@ -133,7 +135,7 @@ void InitializeCordRepExternal(y_absl::string_view data, CordRepExternal* rep) {
// and not wasteful, we move the string into an external cord rep, preserving
// the already allocated string contents.
// Requires the provided string length to be larger than `kMaxInline`.
-static CordRep* CordRepFromString(TString&& src) {
+static y_absl::Nonnull<CordRep*> CordRepFromString(TString&& src) {
assert(src.length() > cord_internal::kMaxInline);
if (
// String is short: copy data to avoid external block overhead.
@@ -165,12 +167,13 @@ static CordRep* CordRepFromString(TString&& src) {
constexpr unsigned char Cord::InlineRep::kMaxInline;
#endif
-inline void Cord::InlineRep::set_data(const char* data, size_t n) {
+inline void Cord::InlineRep::set_data(y_absl::Nonnull<const char*> data,
+ size_t n) {
static_assert(kMaxInline == 15, "set_data is hard-coded for a length of 15");
data_.set_inline_data(data, n);
}
-inline char* Cord::InlineRep::set_data(size_t n) {
+inline y_absl::Nonnull<char*> Cord::InlineRep::set_data(size_t n) {
assert(n <= kMaxInline);
ResetToEmpty();
set_inline_size(n);
@@ -194,13 +197,13 @@ inline void Cord::InlineRep::remove_prefix(size_t n) {
// Returns `rep` converted into a CordRepBtree.
// Directly returns `rep` if `rep` is already a CordRepBtree.
-static CordRepBtree* ForceBtree(CordRep* rep) {
+static y_absl::Nonnull<CordRepBtree*> ForceBtree(CordRep* rep) {
return rep->IsBtree()
? rep->btree()
: CordRepBtree::Create(cord_internal::RemoveCrcNode(rep));
}
-void Cord::InlineRep::AppendTreeToInlined(CordRep* tree,
+void Cord::InlineRep::AppendTreeToInlined(y_absl::Nonnull<CordRep*> tree,
MethodIdentifier method) {
assert(!is_tree());
if (!data_.is_empty()) {
@@ -210,14 +213,16 @@ void Cord::InlineRep::AppendTreeToInlined(CordRep* tree,
EmplaceTree(tree, method);
}
-void Cord::InlineRep::AppendTreeToTree(CordRep* tree, MethodIdentifier method) {
+void Cord::InlineRep::AppendTreeToTree(y_absl::Nonnull<CordRep*> tree,
+ MethodIdentifier method) {
assert(is_tree());
const CordzUpdateScope scope(data_.cordz_info(), method);
tree = CordRepBtree::Append(ForceBtree(data_.as_tree()), tree);
SetTree(tree, scope);
}
-void Cord::InlineRep::AppendTree(CordRep* tree, MethodIdentifier method) {
+void Cord::InlineRep::AppendTree(y_absl::Nonnull<CordRep*> tree,
+ MethodIdentifier method) {
assert(tree != nullptr);
assert(tree->length != 0);
assert(!tree->IsCrc());
@@ -228,7 +233,7 @@ void Cord::InlineRep::AppendTree(CordRep* tree, MethodIdentifier method) {
}
}
-void Cord::InlineRep::PrependTreeToInlined(CordRep* tree,
+void Cord::InlineRep::PrependTreeToInlined(y_absl::Nonnull<CordRep*> tree,
MethodIdentifier method) {
assert(!is_tree());
if (!data_.is_empty()) {
@@ -238,7 +243,7 @@ void Cord::InlineRep::PrependTreeToInlined(CordRep* tree,
EmplaceTree(tree, method);
}
-void Cord::InlineRep::PrependTreeToTree(CordRep* tree,
+void Cord::InlineRep::PrependTreeToTree(y_absl::Nonnull<CordRep*> tree,
MethodIdentifier method) {
assert(is_tree());
const CordzUpdateScope scope(data_.cordz_info(), method);
@@ -246,7 +251,8 @@ void Cord::InlineRep::PrependTreeToTree(CordRep* tree,
SetTree(tree, scope);
}
-void Cord::InlineRep::PrependTree(CordRep* tree, MethodIdentifier method) {
+void Cord::InlineRep::PrependTree(y_absl::Nonnull<CordRep*> tree,
+ MethodIdentifier method) {
assert(tree != nullptr);
assert(tree->length != 0);
assert(!tree->IsCrc());
@@ -261,8 +267,9 @@ void Cord::InlineRep::PrependTree(CordRep* tree, MethodIdentifier method) {
// suitable leaf is found, the function will update the length field for all
// nodes to account for the size increase. The append region address will be
// written to region and the actual size increase will be written to size.
-static inline bool PrepareAppendRegion(CordRep* root, char** region,
- size_t* size, size_t max_length) {
+static inline bool PrepareAppendRegion(
+ y_absl::Nonnull<CordRep*> root, y_absl::Nonnull<y_absl::Nullable<char*>*> region,
+ y_absl::Nonnull<size_t*> size, size_t max_length) {
if (root->IsBtree() && root->refcount.IsOne()) {
Span<char> span = root->btree()->GetAppendBuffer(max_length);
if (!span.empty()) {
@@ -465,11 +472,11 @@ void Cord::InlineRep::AppendArray(y_absl::string_view src,
CommitTree(root, rep, scope, method);
}
-inline CordRep* Cord::TakeRep() const& {
+inline y_absl::Nonnull<CordRep*> Cord::TakeRep() const& {
return CordRep::Ref(contents_.tree());
}
-inline CordRep* Cord::TakeRep() && {
+inline y_absl::Nonnull<CordRep*> Cord::TakeRep() && {
CordRep* rep = contents_.tree();
contents_.clear();
return rep;
@@ -527,7 +534,7 @@ inline void Cord::AppendImpl(C&& src) {
contents_.AppendTree(rep, CordzUpdateTracker::kAppendCord);
}
-static CordRep::ExtractResult ExtractAppendBuffer(CordRep* rep,
+static CordRep::ExtractResult ExtractAppendBuffer(y_absl::Nonnull<CordRep*> rep,
size_t min_capacity) {
switch (rep->tag) {
case cord_internal::BTREE:
@@ -573,13 +580,9 @@ CordBuffer Cord::GetAppendBufferSlowPath(size_t block_size, size_t capacity,
return CreateAppendBuffer(contents_.data_, block_size, capacity);
}
-void Cord::Append(const Cord& src) {
- AppendImpl(src);
-}
+void Cord::Append(const Cord& src) { AppendImpl(src); }
-void Cord::Append(Cord&& src) {
- AppendImpl(std::move(src));
-}
+void Cord::Append(Cord&& src) { AppendImpl(std::move(src)); }
template <typename T, Cord::EnableIfString<T>>
void Cord::Append(T&& src) {
@@ -778,8 +781,9 @@ int ClampResult(int memcmp_res) {
return static_cast<int>(memcmp_res > 0) - static_cast<int>(memcmp_res < 0);
}
-int CompareChunks(y_absl::string_view* lhs, y_absl::string_view* rhs,
- size_t* size_to_compare) {
+int CompareChunks(y_absl::Nonnull<y_absl::string_view*> lhs,
+ y_absl::Nonnull<y_absl::string_view*> rhs,
+ y_absl::Nonnull<size_t*> size_to_compare) {
size_t compared_size = std::min(lhs->size(), rhs->size());
assert(*size_to_compare >= compared_size);
*size_to_compare -= compared_size;
@@ -877,7 +881,8 @@ void Cord::SetExpectedChecksum(uint32_t crc) {
SetCrcCordState(std::move(state));
}
-const crc_internal::CrcCordState* Cord::MaybeGetCrcCordState() const {
+y_absl::Nullable<const crc_internal::CrcCordState*> Cord::MaybeGetCrcCordState()
+ const {
if (!contents_.is_tree() || !contents_.tree()->IsCrc()) {
return nullptr;
}
@@ -894,7 +899,8 @@ y_absl::optional<uint32_t> Cord::ExpectedChecksum() const {
inline int Cord::CompareSlowPath(y_absl::string_view rhs, size_t compared_size,
size_t size_to_compare) const {
- auto advance = [](Cord::ChunkIterator* it, y_absl::string_view* chunk) {
+ auto advance = [](y_absl::Nonnull<Cord::ChunkIterator*> it,
+ y_absl::Nonnull<y_absl::string_view*> chunk) {
if (!chunk->empty()) return true;
++*it;
if (it->bytes_remaining_ == 0) return false;
@@ -924,7 +930,8 @@ inline int Cord::CompareSlowPath(y_absl::string_view rhs, size_t compared_size,
inline int Cord::CompareSlowPath(const Cord& rhs, size_t compared_size,
size_t size_to_compare) const {
- auto advance = [](Cord::ChunkIterator* it, y_absl::string_view* chunk) {
+ auto advance = [](y_absl::Nonnull<Cord::ChunkIterator*> it,
+ y_absl::Nonnull<y_absl::string_view*> chunk) {
if (!chunk->empty()) return true;
++*it;
if (it->bytes_remaining_ == 0) return false;
@@ -1046,7 +1053,7 @@ Cord::operator TString() const {
return s;
}
-void CopyCordToString(const Cord& src, TString* dst) {
+void CopyCordToString(const Cord& src, y_absl::Nonnull<TString*> dst) {
if (!src.contents_.is_tree()) {
src.contents_.CopyTo(dst);
} else {
@@ -1055,7 +1062,7 @@ void CopyCordToString(const Cord& src, TString* dst) {
}
}
-void Cord::CopyToArraySlowPath(char* dst) const {
+void Cord::CopyToArraySlowPath(y_absl::Nonnull<char*> dst) const {
assert(contents_.is_tree());
y_absl::string_view fragment;
if (GetFlatAux(contents_.tree(), &fragment)) {
@@ -1165,6 +1172,194 @@ char Cord::operator[](size_t i) const {
}
}
+namespace {
+
+// Tests whether the sequence of chunks beginning at `position` starts with
+// `needle`.
+//
+// REQUIRES: remaining `y_absl::Cord` starting at `position` is greater than or
+// equal to `needle.size()`.
+bool IsSubstringInCordAt(y_absl::Cord::CharIterator position,
+ y_absl::string_view needle) {
+ auto haystack_chunk = y_absl::Cord::ChunkRemaining(position);
+ while (true) {
+ // Precondition is that `y_absl::Cord::ChunkRemaining(position)` is not
+ // empty. This assert will trigger if that is not true.
+ assert(!haystack_chunk.empty());
+ auto min_length = std::min(haystack_chunk.size(), needle.size());
+ if (!y_absl::ConsumePrefix(&needle, haystack_chunk.substr(0, min_length))) {
+ return false;
+ }
+ if (needle.empty()) {
+ return true;
+ }
+ y_absl::Cord::Advance(&position, min_length);
+ haystack_chunk = y_absl::Cord::ChunkRemaining(position);
+ }
+}
+
+} // namespace
+
+// A few options how this could be implemented:
+// (a) Flatten the Cord and find, i.e.
+// haystack.Flatten().find(needle)
+// For large 'haystack' (where Cord makes sense to be used), this copies
+// the whole 'haystack' and can be slow.
+// (b) Use std::search, i.e.
+// std::search(haystack.char_begin(), haystack.char_end(),
+// needle.begin(), needle.end())
+// This avoids the copy, but compares one byte at a time, and branches a
+// lot every time it has to advance. It is also not possible to use
+// std::search as is, because CharIterator is only an input iterator, not a
+// forward iterator.
+// (c) Use string_view::find in each fragment, and specifically handle fragment
+// boundaries.
+//
+// This currently implements option (b).
+y_absl::Cord::CharIterator y_absl::Cord::FindImpl(CharIterator it,
+ y_absl::string_view needle) const {
+ // Ensure preconditions are met by callers first.
+
+ // Needle must not be empty.
+ assert(!needle.empty());
+ // Haystack must be at least as large as needle.
+ assert(it.chunk_iterator_.bytes_remaining_ >= needle.size());
+
+ // Cord is a sequence of chunks. To find `needle` we go chunk by chunk looking
+ // for the first char of needle, up until we have advanced `N` defined as
+ // `haystack.size() - needle.size()`. If we find the first char of needle at
+ // `P` and `P` is less than `N`, we then call `IsSubstringInCordAt` to
+ // see if this is the needle. If not, we advance to `P + 1` and try again.
+ while (it.chunk_iterator_.bytes_remaining_ >= needle.size()) {
+ auto haystack_chunk = Cord::ChunkRemaining(it);
+ assert(!haystack_chunk.empty());
+ // Look for the first char of `needle` in the current chunk.
+ auto idx = haystack_chunk.find(needle.front());
+ if (idx == y_absl::string_view::npos) {
+ // No potential match in this chunk, advance past it.
+ Cord::Advance(&it, haystack_chunk.size());
+ continue;
+ }
+ // We found the start of a potential match in the chunk. Advance the
+ // iterator and haystack chunk to the match the position.
+ Cord::Advance(&it, idx);
+ // Check if there is enough haystack remaining to actually have a match.
+ if (it.chunk_iterator_.bytes_remaining_ < needle.size()) {
+ break;
+ }
+ // Check if this is `needle`.
+ if (IsSubstringInCordAt(it, needle)) {
+ return it;
+ }
+ // No match, increment the iterator for the next attempt.
+ Cord::Advance(&it, 1);
+ }
+ // If we got here, we did not find `needle`.
+ return char_end();
+}
+
+y_absl::Cord::CharIterator y_absl::Cord::Find(y_absl::string_view needle) const {
+ if (needle.empty()) {
+ return char_begin();
+ }
+ if (needle.size() > size()) {
+ return char_end();
+ }
+ if (needle.size() == size()) {
+ return *this == needle ? char_begin() : char_end();
+ }
+ return FindImpl(char_begin(), needle);
+}
+
+namespace {
+
+// Tests whether the sequence of chunks beginning at `haystack` starts with the
+// sequence of chunks beginning at `needle_begin` and extending to `needle_end`.
+//
+// REQUIRES: remaining `y_absl::Cord` starting at `position` is greater than or
+// equal to `needle_end - needle_begin` and `advance`.
+bool IsSubcordInCordAt(y_absl::Cord::CharIterator haystack,
+ y_absl::Cord::CharIterator needle_begin,
+ y_absl::Cord::CharIterator needle_end) {
+ while (needle_begin != needle_end) {
+ auto haystack_chunk = y_absl::Cord::ChunkRemaining(haystack);
+ assert(!haystack_chunk.empty());
+ auto needle_chunk = y_absl::Cord::ChunkRemaining(needle_begin);
+ auto min_length = std::min(haystack_chunk.size(), needle_chunk.size());
+ if (haystack_chunk.substr(0, min_length) !=
+ needle_chunk.substr(0, min_length)) {
+ return false;
+ }
+ y_absl::Cord::Advance(&haystack, min_length);
+ y_absl::Cord::Advance(&needle_begin, min_length);
+ }
+ return true;
+}
+
+// Tests whether the sequence of chunks beginning at `position` starts with the
+// cord `needle`.
+//
+// REQUIRES: remaining `y_absl::Cord` starting at `position` is greater than or
+// equal to `needle.size()`.
+bool IsSubcordInCordAt(y_absl::Cord::CharIterator position,
+ const y_absl::Cord& needle) {
+ return IsSubcordInCordAt(position, needle.char_begin(), needle.char_end());
+}
+
+} // namespace
+
+y_absl::Cord::CharIterator y_absl::Cord::Find(const y_absl::Cord& needle) const {
+ if (needle.empty()) {
+ return char_begin();
+ }
+ const auto needle_size = needle.size();
+ if (needle_size > size()) {
+ return char_end();
+ }
+ if (needle_size == size()) {
+ return *this == needle ? char_begin() : char_end();
+ }
+ const auto needle_chunk = Cord::ChunkRemaining(needle.char_begin());
+ auto haystack_it = char_begin();
+ while (true) {
+ haystack_it = FindImpl(haystack_it, needle_chunk);
+ if (haystack_it == char_end() ||
+ haystack_it.chunk_iterator_.bytes_remaining_ < needle_size) {
+ break;
+ }
+ // We found the first chunk of `needle` at `haystack_it` but not the entire
+ // subcord. Advance past the first chunk and check for the remainder.
+ auto haystack_advanced_it = haystack_it;
+ auto needle_it = needle.char_begin();
+ Cord::Advance(&haystack_advanced_it, needle_chunk.size());
+ Cord::Advance(&needle_it, needle_chunk.size());
+ if (IsSubcordInCordAt(haystack_advanced_it, needle_it, needle.char_end())) {
+ return haystack_it;
+ }
+ Cord::Advance(&haystack_it, 1);
+ if (haystack_it.chunk_iterator_.bytes_remaining_ < needle_size) {
+ break;
+ }
+ if (haystack_it.chunk_iterator_.bytes_remaining_ == needle_size) {
+ // Special case, if there is exactly `needle_size` bytes remaining, the
+ // subcord is either at `haystack_it` or not at all.
+ if (IsSubcordInCordAt(haystack_it, needle)) {
+ return haystack_it;
+ }
+ break;
+ }
+ }
+ return char_end();
+}
+
+bool Cord::Contains(y_absl::string_view rhs) const {
+ return rhs.empty() || Find(rhs) != char_end();
+}
+
+bool Cord::Contains(const y_absl::Cord& rhs) const {
+ return rhs.empty() || Find(rhs) != char_end();
+}
+
y_absl::string_view Cord::FlattenSlowPath() {
assert(contents_.is_tree());
size_t total_size = size();
@@ -1193,7 +1388,8 @@ y_absl::string_view Cord::FlattenSlowPath() {
return y_absl::string_view(new_buffer, total_size);
}
-/* static */ bool Cord::GetFlatAux(CordRep* rep, y_absl::string_view* fragment) {
+/* static */ bool Cord::GetFlatAux(y_absl::Nonnull<CordRep*> rep,
+ y_absl::Nonnull<y_absl::string_view*> fragment) {
assert(rep != nullptr);
if (rep->length == 0) {
*fragment = y_absl::string_view();
@@ -1227,7 +1423,7 @@ y_absl::string_view Cord::FlattenSlowPath() {
}
/* static */ void Cord::ForEachChunkAux(
- y_absl::cord_internal::CordRep* rep,
+ y_absl::Nonnull<y_absl::cord_internal::CordRep*> rep,
y_absl::FunctionRef<void(y_absl::string_view)> callback) {
assert(rep != nullptr);
if (rep->length == 0) return;
@@ -1252,8 +1448,8 @@ y_absl::string_view Cord::FlattenSlowPath() {
}
}
-static void DumpNode(CordRep* rep, bool include_data, std::ostream* os,
- int indent) {
+static void DumpNode(y_absl::Nonnull<CordRep*> rep, bool include_data,
+ y_absl::Nonnull<std::ostream*> os, int indent) {
const int kIndentStep = 1;
y_absl::InlinedVector<CordRep*, kInlinedVectorSize> stack;
y_absl::InlinedVector<int, kInlinedVectorSize> indents;
@@ -1289,7 +1485,7 @@ static void DumpNode(CordRep* rep, bool include_data, std::ostream* os,
*os << y_absl::CEscape(TString(rep->flat()->Data(), rep->length));
*os << "]\n";
} else {
- CordRepBtree::Dump(rep, /*label=*/ "", include_data, *os);
+ CordRepBtree::Dump(rep, /*label=*/"", include_data, *os);
}
}
if (leaf) {
@@ -1303,16 +1499,17 @@ static void DumpNode(CordRep* rep, bool include_data, std::ostream* os,
Y_ABSL_INTERNAL_CHECK(indents.empty(), "");
}
-static TString ReportError(CordRep* root, CordRep* node) {
+static TString ReportError(y_absl::Nonnull<CordRep*> root,
+ y_absl::Nonnull<CordRep*> node) {
std::ostringstream buf;
buf << "Error at node " << node << " in:";
DumpNode(root, true, &buf);
return TString(buf.str());
}
-static bool VerifyNode(CordRep* root, CordRep* start_node,
- bool /* full_validation */) {
- y_absl::InlinedVector<CordRep*, 2> worklist;
+static bool VerifyNode(y_absl::Nonnull<CordRep*> root,
+ y_absl::Nonnull<CordRep*> start_node) {
+ y_absl::InlinedVector<y_absl::Nonnull<CordRep*>, 2> worklist;
worklist.push_back(start_node);
do {
CordRep* node = worklist.back();
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord.h
index 2a81405c4ae..e1ece243820 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord.h
@@ -74,6 +74,7 @@
#include "y_absl/base/internal/endian.h"
#include "y_absl/base/internal/per_thread_tls.h"
#include "y_absl/base/macros.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/base/port.h"
#include "y_absl/container/inlined_vector.h"
#include "y_absl/crc/internal/crc_cord_state.h"
@@ -86,7 +87,6 @@
#include "y_absl/strings/internal/cord_rep_btree.h"
#include "y_absl/strings/internal/cord_rep_btree_reader.h"
#include "y_absl/strings/internal/cord_rep_crc.h"
-#include "y_absl/strings/internal/cord_rep_ring.h"
#include "y_absl/strings/internal/cordz_functions.h"
#include "y_absl/strings/internal/cordz_info.h"
#include "y_absl/strings/internal/cordz_statistics.h"
@@ -103,7 +103,7 @@ class Cord;
class CordTestPeer;
template <typename Releaser>
Cord MakeCordFromExternal(y_absl::string_view, Releaser&&);
-void CopyCordToString(const Cord& src, TString* dst);
+void CopyCordToString(const Cord& src, y_absl::Nonnull<TString*> dst);
// Cord memory accounting modes
enum class CordMemoryAccounting {
@@ -120,8 +120,8 @@ enum class CordMemoryAccounting {
//
// For example:
// y_absl::Cord cord;
- // cord.append(some_other_cord);
- // cord.append(some_other_cord);
+ // cord.Append(some_other_cord);
+ // cord.Append(some_other_cord);
// // Counts `some_other_cord` twice:
// cord.EstimatedMemoryUsage(kTotal);
// // Counts `some_other_cord` once:
@@ -362,7 +362,7 @@ class Cord {
// Cord::empty()
//
- // Determines whether the given Cord is empty, returning `true` is so.
+ // Determines whether the given Cord is empty, returning `true` if so.
bool empty() const;
// Cord::EstimatedMemoryUsage()
@@ -396,6 +396,12 @@ class Cord {
bool EndsWith(y_absl::string_view rhs) const;
bool EndsWith(const Cord& rhs) const;
+ // Cord::Contains()
+ //
+ // Determines whether the Cord contains the passed string data `rhs`.
+ bool Contains(y_absl::string_view rhs) const;
+ bool Contains(const Cord& rhs) const;
+
// Cord::operator TString()
//
// Converts a Cord into a `TString()`. This operator is marked explicit to
@@ -411,7 +417,8 @@ class Cord {
// guarantee that pointers previously returned by `dst->data()` remain valid
// even if `*dst` had enough capacity to hold `src`. If `*dst` is a new
// object, prefer to simply use the conversion operator to `TString`.
- friend void CopyCordToString(const Cord& src, TString* dst);
+ friend void CopyCordToString(const Cord& src,
+ y_absl::Nonnull<TString*> dst);
class CharIterator;
@@ -448,7 +455,7 @@ class Cord {
using iterator_category = std::input_iterator_tag;
using value_type = y_absl::string_view;
using difference_type = ptrdiff_t;
- using pointer = const value_type*;
+ using pointer = y_absl::Nonnull<const value_type*>;
using reference = value_type;
ChunkIterator() = default;
@@ -468,14 +475,14 @@ class Cord {
using CordRepBtree = y_absl::cord_internal::CordRepBtree;
using CordRepBtreeReader = y_absl::cord_internal::CordRepBtreeReader;
- // Constructs a `begin()` iterator from `tree`. `tree` must not be null.
- explicit ChunkIterator(cord_internal::CordRep* tree);
+ // Constructs a `begin()` iterator from `tree`.
+ explicit ChunkIterator(y_absl::Nonnull<cord_internal::CordRep*> tree);
// Constructs a `begin()` iterator from `cord`.
- explicit ChunkIterator(const Cord* cord);
+ explicit ChunkIterator(y_absl::Nonnull<const Cord*> cord);
// Initializes this instance from a tree. Invoked by constructors.
- void InitTree(cord_internal::CordRep* tree);
+ void InitTree(y_absl::Nonnull<cord_internal::CordRep*> tree);
// Removes `n` bytes from `current_chunk_`. Expects `n` to be smaller than
// `current_chunk_.size()`.
@@ -493,7 +500,7 @@ class Cord {
// The current leaf, or `nullptr` if the iterator points to short data.
// If the current chunk is a substring node, current_leaf_ points to the
// underlying flat or external node.
- y_absl::cord_internal::CordRep* current_leaf_ = nullptr;
+ y_absl::Nullable<y_absl::cord_internal::CordRep*> current_leaf_ = nullptr;
// The number of bytes left in the `Cord` over which we are iterating.
size_t bytes_remaining_ = 0;
@@ -515,7 +522,7 @@ class Cord {
// y_absl::string_view s) {
// return std::find(c.chunk_begin(), c.chunk_end(), s);
// }
- ChunkIterator chunk_begin() const;
+ ChunkIterator chunk_begin() const Y_ABSL_ATTRIBUTE_LIFETIME_BOUND;
// Cord::chunk_end()
//
@@ -524,7 +531,7 @@ class Cord {
// Generally, prefer using `Cord::Chunks()` within a range-based for loop for
// iterating over the chunks of a Cord. This method may be useful for getting
// a `ChunkIterator` where range-based for-loops may not be available.
- ChunkIterator chunk_end() const;
+ ChunkIterator chunk_end() const Y_ABSL_ATTRIBUTE_LIFETIME_BOUND;
//----------------------------------------------------------------------------
// Cord::ChunkRange
@@ -550,13 +557,13 @@ class Cord {
using iterator = ChunkIterator;
using const_iterator = ChunkIterator;
- explicit ChunkRange(const Cord* cord) : cord_(cord) {}
+ explicit ChunkRange(y_absl::Nonnull<const Cord*> cord) : cord_(cord) {}
ChunkIterator begin() const;
ChunkIterator end() const;
private:
- const Cord* cord_;
+ y_absl::Nonnull<const Cord*> cord_;
};
// Cord::Chunks()
@@ -578,7 +585,7 @@ class Cord {
// // The temporary Cord returned by CordFactory has been destroyed!
// }
// }
- ChunkRange Chunks() const;
+ ChunkRange Chunks() const Y_ABSL_ATTRIBUTE_LIFETIME_BOUND;
//----------------------------------------------------------------------------
// Cord::CharIterator
@@ -609,7 +616,7 @@ class Cord {
using iterator_category = std::input_iterator_tag;
using value_type = char;
using difference_type = ptrdiff_t;
- using pointer = const char*;
+ using pointer = y_absl::Nonnull<const char*>;
using reference = const char&;
CharIterator() = default;
@@ -624,7 +631,8 @@ class Cord {
friend Cord;
private:
- explicit CharIterator(const Cord* cord) : chunk_iterator_(cord) {}
+ explicit CharIterator(y_absl::Nonnull<const Cord*> cord)
+ : chunk_iterator_(cord) {}
ChunkIterator chunk_iterator_;
};
@@ -635,14 +643,14 @@ class Cord {
// advanced as a separate `Cord`. `n_bytes` must be less than or equal to the
// number of bytes within the Cord; otherwise, behavior is undefined. It is
// valid to pass `char_end()` and `0`.
- static Cord AdvanceAndRead(CharIterator* it, size_t n_bytes);
+ static Cord AdvanceAndRead(y_absl::Nonnull<CharIterator*> it, size_t n_bytes);
// Cord::Advance()
//
// Advances the `Cord::CharIterator` by `n_bytes`. `n_bytes` must be less than
// or equal to the number of bytes remaining within the Cord; otherwise,
// behavior is undefined. It is valid to pass `char_end()` and `0`.
- static void Advance(CharIterator* it, size_t n_bytes);
+ static void Advance(y_absl::Nonnull<CharIterator*> it, size_t n_bytes);
// Cord::ChunkRemaining()
//
@@ -658,7 +666,7 @@ class Cord {
// Generally, prefer using `Cord::Chars()` within a range-based for loop for
// iterating over the chunks of a Cord. This method may be useful for getting
// a `CharIterator` where range-based for-loops may not be available.
- CharIterator char_begin() const;
+ CharIterator char_begin() const Y_ABSL_ATTRIBUTE_LIFETIME_BOUND;
// Cord::char_end()
//
@@ -667,7 +675,7 @@ class Cord {
// Generally, prefer using `Cord::Chars()` within a range-based for loop for
// iterating over the chunks of a Cord. This method may be useful for getting
// a `CharIterator` where range-based for-loops are not useful.
- CharIterator char_end() const;
+ CharIterator char_end() const Y_ABSL_ATTRIBUTE_LIFETIME_BOUND;
// Cord::CharRange
//
@@ -691,13 +699,13 @@ class Cord {
using iterator = CharIterator;
using const_iterator = CharIterator;
- explicit CharRange(const Cord* cord) : cord_(cord) {}
+ explicit CharRange(y_absl::Nonnull<const Cord*> cord) : cord_(cord) {}
CharIterator begin() const;
CharIterator end() const;
private:
- const Cord* cord_;
+ y_absl::Nonnull<const Cord*> cord_;
};
// Cord::Chars()
@@ -719,7 +727,7 @@ class Cord {
// // The temporary Cord returned by CordFactory has been destroyed!
// }
// }
- CharRange Chars() const;
+ CharRange Chars() const Y_ABSL_ATTRIBUTE_LIFETIME_BOUND;
// Cord::operator[]
//
@@ -737,20 +745,38 @@ class Cord {
//
// If this cord's representation is a single flat array, returns a
// string_view referencing that array. Otherwise returns nullopt.
- y_absl::optional<y_absl::string_view> TryFlat() const;
+ y_absl::optional<y_absl::string_view> TryFlat() const
+ Y_ABSL_ATTRIBUTE_LIFETIME_BOUND;
// Cord::Flatten()
//
// Flattens the cord into a single array and returns a view of the data.
//
// If the cord was already flat, the contents are not modified.
- y_absl::string_view Flatten();
+ y_absl::string_view Flatten() Y_ABSL_ATTRIBUTE_LIFETIME_BOUND;
+
+ // Cord::Find()
+ //
+ // Returns an iterator to the first occurrance of the substring `needle`.
+ //
+ // If the substring `needle` does not occur, `Cord::char_end()` is returned.
+ CharIterator Find(y_absl::string_view needle) const;
+ CharIterator Find(const y_absl::Cord& needle) const;
// Supports y_absl::Cord as a sink object for y_absl::Format().
- friend void AbslFormatFlush(y_absl::Cord* cord, y_absl::string_view part) {
+ friend void AbslFormatFlush(y_absl::Nonnull<y_absl::Cord*> cord,
+ y_absl::string_view part) {
cord->Append(part);
}
+ // Support automatic stringification with y_absl::StrCat and y_absl::StrFormat.
+ template <typename Sink>
+ friend void AbslStringify(Sink& sink, const y_absl::Cord& cord) {
+ for (y_absl::string_view chunk : cord.Chunks()) {
+ sink.Append(chunk);
+ }
+ }
+
// Cord::SetExpectedChecksum()
//
// Stores a checksum value with this non-empty cord instance, for later
@@ -809,7 +835,8 @@ class Cord {
friend bool operator==(const Cord& lhs, const Cord& rhs);
friend bool operator==(const Cord& lhs, y_absl::string_view rhs);
- friend const CordzInfo* GetCordzInfoForTesting(const Cord& cord);
+ friend y_absl::Nullable<const CordzInfo*> GetCordzInfoForTesting(
+ const Cord& cord);
// Calls the provided function once for each cord chunk, in order. Unlike
// Chunks(), this API will not allocate memory.
@@ -836,20 +863,22 @@ class Cord {
InlineRep& operator=(const InlineRep& src);
InlineRep& operator=(InlineRep&& src) noexcept;
- explicit constexpr InlineRep(y_absl::string_view sv, CordRep* rep);
+ explicit constexpr InlineRep(y_absl::string_view sv,
+ y_absl::Nullable<CordRep*> rep);
- void Swap(InlineRep* rhs);
- bool empty() const;
+ void Swap(y_absl::Nonnull<InlineRep*> rhs);
size_t size() const;
- const char* data() const; // Returns nullptr if holding pointer
- void set_data(const char* data, size_t n); // Discards pointer, if any
- char* set_data(size_t n); // Write data to the result
+ // Returns nullptr if holding pointer
+ y_absl::Nullable<const char*> data() const;
+ // Discards pointer, if any
+ void set_data(y_absl::Nonnull<const char*> data, size_t n);
+ y_absl::Nonnull<char*> set_data(size_t n); // Write data to the result
// Returns nullptr if holding bytes
- y_absl::cord_internal::CordRep* tree() const;
- y_absl::cord_internal::CordRep* as_tree() const;
- const char* as_chars() const;
+ y_absl::Nullable<y_absl::cord_internal::CordRep*> tree() const;
+ y_absl::Nonnull<y_absl::cord_internal::CordRep*> as_tree() const;
+ y_absl::Nonnull<const char*> as_chars() const;
// Returns non-null iff was holding a pointer
- y_absl::cord_internal::CordRep* clear();
+ y_absl::Nullable<y_absl::cord_internal::CordRep*> clear();
// Converts to pointer if necessary.
void reduce_size(size_t n); // REQUIRES: holding data
void remove_prefix(size_t n); // REQUIRES: holding data
@@ -858,46 +887,52 @@ class Cord {
// Creates a CordRepFlat instance from the current inlined data with `extra'
// bytes of desired additional capacity.
- CordRepFlat* MakeFlatWithExtraCapacity(size_t extra);
+ y_absl::Nonnull<CordRepFlat*> MakeFlatWithExtraCapacity(size_t extra);
// Sets the tree value for this instance. `rep` must not be null.
// Requires the current instance to hold a tree, and a lock to be held on
// any CordzInfo referenced by this instance. The latter is enforced through
// the CordzUpdateScope argument. If the current instance is sampled, then
// the CordzInfo instance is updated to reference the new `rep` value.
- void SetTree(CordRep* rep, const CordzUpdateScope& scope);
+ void SetTree(y_absl::Nonnull<CordRep*> rep, const CordzUpdateScope& scope);
// Identical to SetTree(), except that `rep` is allowed to be null, in
// which case the current instance is reset to an empty value.
- void SetTreeOrEmpty(CordRep* rep, const CordzUpdateScope& scope);
+ void SetTreeOrEmpty(y_absl::Nullable<CordRep*> rep,
+ const CordzUpdateScope& scope);
// Sets the tree value for this instance, and randomly samples this cord.
// This function disregards existing contents in `data_`, and should be
// called when a Cord is 'promoted' from an 'uninitialized' or 'inlined'
// value to a non-inlined (tree / ring) value.
- void EmplaceTree(CordRep* rep, MethodIdentifier method);
+ void EmplaceTree(y_absl::Nonnull<CordRep*> rep, MethodIdentifier method);
// Identical to EmplaceTree, except that it copies the parent stack from
// the provided `parent` data if the parent is sampled.
- void EmplaceTree(CordRep* rep, const InlineData& parent,
+ void EmplaceTree(y_absl::Nonnull<CordRep*> rep, const InlineData& parent,
MethodIdentifier method);
// Commits the change of a newly created, or updated `rep` root value into
// this cord. `old_rep` indicates the old (inlined or tree) value of the
// cord, and determines if the commit invokes SetTree() or EmplaceTree().
- void CommitTree(const CordRep* old_rep, CordRep* rep,
- const CordzUpdateScope& scope, MethodIdentifier method);
-
- void AppendTreeToInlined(CordRep* tree, MethodIdentifier method);
- void AppendTreeToTree(CordRep* tree, MethodIdentifier method);
- void AppendTree(CordRep* tree, MethodIdentifier method);
- void PrependTreeToInlined(CordRep* tree, MethodIdentifier method);
- void PrependTreeToTree(CordRep* tree, MethodIdentifier method);
- void PrependTree(CordRep* tree, MethodIdentifier method);
+ void CommitTree(y_absl::Nullable<const CordRep*> old_rep,
+ y_absl::Nonnull<CordRep*> rep, const CordzUpdateScope& scope,
+ MethodIdentifier method);
+
+ void AppendTreeToInlined(y_absl::Nonnull<CordRep*> tree,
+ MethodIdentifier method);
+ void AppendTreeToTree(y_absl::Nonnull<CordRep*> tree,
+ MethodIdentifier method);
+ void AppendTree(y_absl::Nonnull<CordRep*> tree, MethodIdentifier method);
+ void PrependTreeToInlined(y_absl::Nonnull<CordRep*> tree,
+ MethodIdentifier method);
+ void PrependTreeToTree(y_absl::Nonnull<CordRep*> tree,
+ MethodIdentifier method);
+ void PrependTree(y_absl::Nonnull<CordRep*> tree, MethodIdentifier method);
bool IsSame(const InlineRep& other) const { return data_ == other.data_; }
- void CopyTo(TString* dst) const {
+ void CopyTo(y_absl::Nonnull<TString*> dst) const {
// memcpy is much faster when operating on a known size. On most supported
// platforms, the small string optimization is large enough that resizing
// to 15 bytes does not cause a memory allocation.
@@ -909,7 +944,7 @@ class Cord {
}
// Copies the inline contents into `dst`. Assumes the cord is not empty.
- void CopyToArray(char* dst) const;
+ void CopyToArray(y_absl::Nonnull<char*> dst) const;
bool is_tree() const { return data_.is_tree(); }
@@ -922,12 +957,12 @@ class Cord {
}
// Returns the profiled CordzInfo, or nullptr if not sampled.
- y_absl::cord_internal::CordzInfo* cordz_info() const {
+ y_absl::Nullable<y_absl::cord_internal::CordzInfo*> cordz_info() const {
return data_.cordz_info();
}
- // Sets the profiled CordzInfo. `cordz_info` must not be null.
- void set_cordz_info(cord_internal::CordzInfo* cordz_info) {
+ // Sets the profiled CordzInfo.
+ void set_cordz_info(y_absl::Nonnull<cord_internal::CordzInfo*> cordz_info) {
assert(cordz_info != nullptr);
data_.set_cordz_info(cordz_info);
}
@@ -959,19 +994,19 @@ class Cord {
InlineRep contents_;
// Helper for GetFlat() and TryFlat().
- static bool GetFlatAux(y_absl::cord_internal::CordRep* rep,
- y_absl::string_view* fragment);
+ static bool GetFlatAux(y_absl::Nonnull<y_absl::cord_internal::CordRep*> rep,
+ y_absl::Nonnull<y_absl::string_view*> fragment);
// Helper for ForEachChunk().
static void ForEachChunkAux(
- y_absl::cord_internal::CordRep* rep,
+ y_absl::Nonnull<y_absl::cord_internal::CordRep*> rep,
y_absl::FunctionRef<void(y_absl::string_view)> callback);
// The destructor for non-empty Cords.
void DestroyCordSlow();
// Out-of-line implementation of slower parts of logic.
- void CopyToArraySlowPath(char* dst) const;
+ void CopyToArraySlowPath(y_absl::Nonnull<char*> dst) const;
int CompareSlowPath(y_absl::string_view rhs, size_t compared_size,
size_t size_to_compare) const;
int CompareSlowPath(const Cord& rhs, size_t compared_size,
@@ -988,8 +1023,8 @@ class Cord {
// Returns a new reference to contents_.tree(), or steals an existing
// reference if called on an rvalue.
- y_absl::cord_internal::CordRep* TakeRep() const&;
- y_absl::cord_internal::CordRep* TakeRep() &&;
+ y_absl::Nonnull<y_absl::cord_internal::CordRep*> TakeRep() const&;
+ y_absl::Nonnull<y_absl::cord_internal::CordRep*> TakeRep() &&;
// Helper for Append().
template <typename C>
@@ -1026,7 +1061,10 @@ class Cord {
friend class CrcCord;
void SetCrcCordState(crc_internal::CrcCordState state);
- const crc_internal::CrcCordState* MaybeGetCrcCordState() const;
+ y_absl::Nullable<const crc_internal::CrcCordState*> MaybeGetCrcCordState()
+ const;
+
+ CharIterator FindImpl(CharIterator it, y_absl::string_view needle) const;
};
Y_ABSL_NAMESPACE_END
@@ -1045,13 +1083,15 @@ namespace cord_internal {
// Does non-template-specific `CordRepExternal` initialization.
// Requires `data` to be non-empty.
-void InitializeCordRepExternal(y_absl::string_view data, CordRepExternal* rep);
+void InitializeCordRepExternal(y_absl::string_view data,
+ y_absl::Nonnull<CordRepExternal*> rep);
// Creates a new `CordRep` that owns `data` and `releaser` and returns a pointer
// to it. Requires `data` to be non-empty.
template <typename Releaser>
// NOLINTNEXTLINE - suppress clang-tidy raw pointer return.
-CordRep* NewExternalRep(y_absl::string_view data, Releaser&& releaser) {
+y_absl::Nonnull<CordRep*> NewExternalRep(y_absl::string_view data,
+ Releaser&& releaser) {
assert(!data.empty());
using ReleaserType = y_absl::decay_t<Releaser>;
CordRepExternal* rep = new CordRepExternalImpl<ReleaserType>(
@@ -1063,7 +1103,7 @@ CordRep* NewExternalRep(y_absl::string_view data, Releaser&& releaser) {
// Overload for function reference types that dispatches using a function
// pointer because there are no `alignof()` or `sizeof()` a function reference.
// NOLINTNEXTLINE - suppress clang-tidy raw pointer return.
-inline CordRep* NewExternalRep(y_absl::string_view data,
+inline y_absl::Nonnull<CordRep*> NewExternalRep(y_absl::string_view data,
void (&releaser)(y_absl::string_view)) {
return NewExternalRep(data, &releaser);
}
@@ -1086,7 +1126,8 @@ Cord MakeCordFromExternal(y_absl::string_view data, Releaser&& releaser) {
return cord;
}
-constexpr Cord::InlineRep::InlineRep(y_absl::string_view sv, CordRep* rep)
+constexpr Cord::InlineRep::InlineRep(y_absl::string_view sv,
+ y_absl::Nullable<CordRep*> rep)
: data_(sv, rep) {}
inline Cord::InlineRep::InlineRep(const Cord::InlineRep& src)
@@ -1125,28 +1166,30 @@ inline Cord::InlineRep& Cord::InlineRep::operator=(
return *this;
}
-inline void Cord::InlineRep::Swap(Cord::InlineRep* rhs) {
+inline void Cord::InlineRep::Swap(y_absl::Nonnull<Cord::InlineRep*> rhs) {
if (rhs == this) {
return;
}
std::swap(data_, rhs->data_);
}
-inline const char* Cord::InlineRep::data() const {
+inline y_absl::Nullable<const char*> Cord::InlineRep::data() const {
return is_tree() ? nullptr : data_.as_chars();
}
-inline const char* Cord::InlineRep::as_chars() const {
+inline y_absl::Nonnull<const char*> Cord::InlineRep::as_chars() const {
assert(!data_.is_tree());
return data_.as_chars();
}
-inline y_absl::cord_internal::CordRep* Cord::InlineRep::as_tree() const {
+inline y_absl::Nonnull<y_absl::cord_internal::CordRep*> Cord::InlineRep::as_tree()
+ const {
assert(data_.is_tree());
return data_.as_tree();
}
-inline y_absl::cord_internal::CordRep* Cord::InlineRep::tree() const {
+inline y_absl::Nullable<y_absl::cord_internal::CordRep*> Cord::InlineRep::tree()
+ const {
if (is_tree()) {
return as_tree();
} else {
@@ -1154,14 +1197,12 @@ inline y_absl::cord_internal::CordRep* Cord::InlineRep::tree() const {
}
}
-inline bool Cord::InlineRep::empty() const { return data_.is_empty(); }
-
inline size_t Cord::InlineRep::size() const {
return is_tree() ? as_tree()->length : inline_size();
}
-inline cord_internal::CordRepFlat* Cord::InlineRep::MakeFlatWithExtraCapacity(
- size_t extra) {
+inline y_absl::Nonnull<cord_internal::CordRepFlat*>
+Cord::InlineRep::MakeFlatWithExtraCapacity(size_t extra) {
static_assert(cord_internal::kMinFlatLength >= sizeof(data_), "");
size_t len = data_.inline_size();
auto* result = CordRepFlat::New(len + extra);
@@ -1170,20 +1211,21 @@ inline cord_internal::CordRepFlat* Cord::InlineRep::MakeFlatWithExtraCapacity(
return result;
}
-inline void Cord::InlineRep::EmplaceTree(CordRep* rep,
+inline void Cord::InlineRep::EmplaceTree(y_absl::Nonnull<CordRep*> rep,
MethodIdentifier method) {
assert(rep);
data_.make_tree(rep);
CordzInfo::MaybeTrackCord(data_, method);
}
-inline void Cord::InlineRep::EmplaceTree(CordRep* rep, const InlineData& parent,
+inline void Cord::InlineRep::EmplaceTree(y_absl::Nonnull<CordRep*> rep,
+ const InlineData& parent,
MethodIdentifier method) {
data_.make_tree(rep);
CordzInfo::MaybeTrackCord(data_, parent, method);
}
-inline void Cord::InlineRep::SetTree(CordRep* rep,
+inline void Cord::InlineRep::SetTree(y_absl::Nonnull<CordRep*> rep,
const CordzUpdateScope& scope) {
assert(rep);
assert(data_.is_tree());
@@ -1191,7 +1233,7 @@ inline void Cord::InlineRep::SetTree(CordRep* rep,
scope.SetCordRep(rep);
}
-inline void Cord::InlineRep::SetTreeOrEmpty(CordRep* rep,
+inline void Cord::InlineRep::SetTreeOrEmpty(y_absl::Nullable<CordRep*> rep,
const CordzUpdateScope& scope) {
assert(data_.is_tree());
if (rep) {
@@ -1202,7 +1244,8 @@ inline void Cord::InlineRep::SetTreeOrEmpty(CordRep* rep,
scope.SetCordRep(rep);
}
-inline void Cord::InlineRep::CommitTree(const CordRep* old_rep, CordRep* rep,
+inline void Cord::InlineRep::CommitTree(y_absl::Nullable<const CordRep*> old_rep,
+ y_absl::Nonnull<CordRep*> rep,
const CordzUpdateScope& scope,
MethodIdentifier method) {
if (old_rep) {
@@ -1212,7 +1255,7 @@ inline void Cord::InlineRep::CommitTree(const CordRep* old_rep, CordRep* rep,
}
}
-inline y_absl::cord_internal::CordRep* Cord::InlineRep::clear() {
+inline y_absl::Nullable<y_absl::cord_internal::CordRep*> Cord::InlineRep::clear() {
if (is_tree()) {
CordzInfo::MaybeUntrackCord(cordz_info());
}
@@ -1221,7 +1264,7 @@ inline y_absl::cord_internal::CordRep* Cord::InlineRep::clear() {
return result;
}
-inline void Cord::InlineRep::CopyToArray(char* dst) const {
+inline void Cord::InlineRep::CopyToArray(y_absl::Nonnull<char*> dst) const {
assert(!is_tree());
size_t n = inline_size();
assert(n != 0);
@@ -1402,7 +1445,8 @@ inline bool Cord::StartsWith(y_absl::string_view rhs) const {
return EqualsImpl(rhs, rhs_size);
}
-inline void Cord::ChunkIterator::InitTree(cord_internal::CordRep* tree) {
+inline void Cord::ChunkIterator::InitTree(
+ y_absl::Nonnull<cord_internal::CordRep*> tree) {
tree = cord_internal::SkipCrcNode(tree);
if (tree->tag == cord_internal::BTREE) {
current_chunk_ = btree_reader_.Init(tree->btree());
@@ -1412,12 +1456,13 @@ inline void Cord::ChunkIterator::InitTree(cord_internal::CordRep* tree) {
}
}
-inline Cord::ChunkIterator::ChunkIterator(cord_internal::CordRep* tree) {
+inline Cord::ChunkIterator::ChunkIterator(
+ y_absl::Nonnull<cord_internal::CordRep*> tree) {
bytes_remaining_ = tree->length;
InitTree(tree);
}
-inline Cord::ChunkIterator::ChunkIterator(const Cord* cord) {
+inline Cord::ChunkIterator::ChunkIterator(y_absl::Nonnull<const Cord*> cord) {
if (CordRep* tree = cord->contents_.tree()) {
bytes_remaining_ = tree->length;
if (Y_ABSL_PREDICT_TRUE(bytes_remaining_ != 0)) {
@@ -1557,12 +1602,13 @@ inline Cord::CharIterator::pointer Cord::CharIterator::operator->() const {
return chunk_iterator_->data();
}
-inline Cord Cord::AdvanceAndRead(CharIterator* it, size_t n_bytes) {
+inline Cord Cord::AdvanceAndRead(y_absl::Nonnull<CharIterator*> it,
+ size_t n_bytes) {
assert(it != nullptr);
return it->chunk_iterator_.AdvanceAndReadBytes(n_bytes);
}
-inline void Cord::Advance(CharIterator* it, size_t n_bytes) {
+inline void Cord::Advance(y_absl::Nonnull<CharIterator*> it, size_t n_bytes) {
assert(it != nullptr);
it->chunk_iterator_.AdvanceBytes(n_bytes);
}
@@ -1618,7 +1664,7 @@ inline bool operator>=(const Cord& x, const Cord& y) {
// Nonmember Cord-to-y_absl::string_view relational operators.
//
// Due to implicit conversions, these also enable comparisons of Cord with
-// with TString, ::string, and const char*.
+// TString and const char*.
inline bool operator==(const Cord& lhs, y_absl::string_view rhs) {
size_t lhs_size = lhs.size();
size_t rhs_size = rhs.size();
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord_analysis.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord_analysis.cc
index 47e268f7a41..22456befdc1 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord_analysis.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord_analysis.cc
@@ -14,23 +14,17 @@
#include "y_absl/strings/cord_analysis.h"
+#include <cassert>
#include <cstddef>
#include <cstdint>
#include <unordered_set>
-#include "y_absl/base/attributes.h"
#include "y_absl/base/config.h"
-#include "y_absl/container/inlined_vector.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/strings/internal/cord_data_edge.h"
#include "y_absl/strings/internal/cord_internal.h"
#include "y_absl/strings/internal/cord_rep_btree.h"
#include "y_absl/strings/internal/cord_rep_crc.h"
-#include "y_absl/strings/internal/cord_rep_flat.h"
-#include "y_absl/strings/internal/cord_rep_ring.h"
-//
-#include "y_absl/base/macros.h"
-#include "y_absl/base/port.h"
-#include "y_absl/functional/function_ref.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
@@ -45,13 +39,15 @@ enum class Mode { kFairShare, kTotal, kTotalMorePrecise };
template <Mode mode>
struct CordRepRef {
// Instantiates a CordRepRef instance.
- explicit CordRepRef(const CordRep* r) : rep(r) {}
+ explicit CordRepRef(y_absl::Nonnull<const CordRep*> r) : rep(r) {}
// Creates a child reference holding the provided child.
// Overloaded to add cumulative reference count for kFairShare.
- CordRepRef Child(const CordRep* child) const { return CordRepRef(child); }
+ CordRepRef Child(y_absl::Nonnull<const CordRep*> child) const {
+ return CordRepRef(child);
+ }
- const CordRep* rep;
+ y_absl::Nonnull<const CordRep*> rep;
};
// RawUsage holds the computed total number of bytes.
@@ -70,11 +66,10 @@ template <>
struct RawUsage<Mode::kTotalMorePrecise> {
size_t total = 0;
// TODO(b/289250880): Replace this with a flat_hash_set.
- std::unordered_set<const CordRep*> counted;
+ std::unordered_set<y_absl::Nonnull<const CordRep*>> counted;
void Add(size_t size, CordRepRef<Mode::kTotalMorePrecise> repref) {
- if (counted.find(repref.rep) == counted.end()) {
- counted.insert(repref.rep);
+ if (counted.insert(repref.rep).second) {
total += size;
}
}
@@ -95,15 +90,15 @@ double MaybeDiv(double d, refcount_t refcount) {
template <>
struct CordRepRef<Mode::kFairShare> {
// Creates a CordRepRef with the provided rep and top (parent) fraction.
- explicit CordRepRef(const CordRep* r, double frac = 1.0)
+ explicit CordRepRef(y_absl::Nonnull<const CordRep*> r, double frac = 1.0)
: rep(r), fraction(MaybeDiv(frac, r->refcount.Get())) {}
// Returns a CordRepRef with a fraction of `this->fraction / child.refcount`
- CordRepRef Child(const CordRep* child) const {
+ CordRepRef Child(y_absl::Nonnull<const CordRep*> child) const {
return CordRepRef(child, fraction);
}
- const CordRep* rep;
+ y_absl::Nonnull<const CordRep*> rep;
double fraction;
};
@@ -138,16 +133,6 @@ void AnalyzeDataEdge(CordRepRef<mode> rep, RawUsage<mode>& raw_usage) {
raw_usage.Add(size, rep);
}
-// Computes the memory size of the provided Ring tree.
-template <Mode mode>
-void AnalyzeRing(CordRepRef<mode> rep, RawUsage<mode>& raw_usage) {
- const CordRepRing* ring = rep.rep->ring();
- raw_usage.Add(CordRepRing::AllocSize(ring->capacity()), rep);
- ring->ForEach([&](CordRepRing::index_type pos) {
- AnalyzeDataEdge(rep.Child(ring->entry_child(pos)), raw_usage);
- });
-}
-
// Computes the memory size of the provided Btree tree.
template <Mode mode>
void AnalyzeBtree(CordRepRef<mode> rep, RawUsage<mode>& raw_usage) {
@@ -165,7 +150,7 @@ void AnalyzeBtree(CordRepRef<mode> rep, RawUsage<mode>& raw_usage) {
}
template <Mode mode>
-size_t GetEstimatedUsage(const CordRep* rep) {
+size_t GetEstimatedUsage(y_absl::Nonnull<const CordRep*> rep) {
// Zero initialized memory usage totals.
RawUsage<mode> raw_usage;
@@ -175,6 +160,9 @@ size_t GetEstimatedUsage(const CordRep* rep) {
// Consume the top level CRC node if present.
if (repref.rep->tag == CRC) {
raw_usage.Add(sizeof(CordRepCrc), repref);
+ if (repref.rep->crc()->child == nullptr) {
+ return static_cast<size_t>(raw_usage.total);
+ }
repref = repref.Child(repref.rep->crc()->child);
}
@@ -182,8 +170,6 @@ size_t GetEstimatedUsage(const CordRep* rep) {
AnalyzeDataEdge(repref, raw_usage);
} else if (repref.rep->tag == BTREE) {
AnalyzeBtree(repref, raw_usage);
- } else if (repref.rep->tag == RING) {
- AnalyzeRing(repref, raw_usage);
} else {
assert(false);
}
@@ -193,15 +179,15 @@ size_t GetEstimatedUsage(const CordRep* rep) {
} // namespace
-size_t GetEstimatedMemoryUsage(const CordRep* rep) {
+size_t GetEstimatedMemoryUsage(y_absl::Nonnull<const CordRep*> rep) {
return GetEstimatedUsage<Mode::kTotal>(rep);
}
-size_t GetEstimatedFairShareMemoryUsage(const CordRep* rep) {
+size_t GetEstimatedFairShareMemoryUsage(y_absl::Nonnull<const CordRep*> rep) {
return GetEstimatedUsage<Mode::kFairShare>(rep);
}
-size_t GetMorePreciseMemoryUsage(const CordRep* rep) {
+size_t GetMorePreciseMemoryUsage(y_absl::Nonnull<const CordRep*> rep) {
return GetEstimatedUsage<Mode::kTotalMorePrecise>(rep);
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord_analysis.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord_analysis.h
index 07e31dae770..bcd728c8580 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord_analysis.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord_analysis.h
@@ -19,6 +19,7 @@
#include <cstdint>
#include "y_absl/base/config.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/strings/internal/cord_internal.h"
namespace y_absl {
@@ -28,7 +29,7 @@ namespace cord_internal {
// Returns the *approximate* number of bytes held in full or in part by this
// Cord (which may not remain the same between invocations). Cords that share
// memory could each be "charged" independently for the same shared memory.
-size_t GetEstimatedMemoryUsage(const CordRep* rep);
+size_t GetEstimatedMemoryUsage(y_absl::Nonnull<const CordRep*> rep);
// Returns the *approximate* number of bytes held in full or in part by this
// Cord for the distinct memory held by this cord. This is similar to
@@ -46,13 +47,13 @@ size_t GetEstimatedMemoryUsage(const CordRep* rep);
//
// This is more expensive than `GetEstimatedMemoryUsage()` as it requires
// deduplicating all memory references.
-size_t GetMorePreciseMemoryUsage(const CordRep* rep);
+size_t GetMorePreciseMemoryUsage(y_absl::Nonnull<const CordRep*> rep);
// Returns the *approximate* number of bytes held in full or in part by this
// CordRep weighted by the sharing ratio of that data. For example, if some data
// edge is shared by 4 different Cords, then each cord is attribute 1/4th of
// the total memory usage as a 'fair share' of the total memory usage.
-size_t GetEstimatedFairShareMemoryUsage(const CordRep* rep);
+size_t GetEstimatedFairShareMemoryUsage(y_absl::Nonnull<const CordRep*> rep);
} // namespace cord_internal
Y_ABSL_NAMESPACE_END
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/escaping.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/escaping.cc
index eb5f4bbb69d..28fa5ad9695 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/escaping.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/escaping.cc
@@ -16,21 +16,22 @@
#include <algorithm>
#include <cassert>
+#include <cstddef>
#include <cstdint>
#include <cstring>
-#include <iterator>
#include <limits>
#include <util/generic/string.h>
-#include "y_absl/base/internal/endian.h"
+#include "y_absl/base/config.h"
#include "y_absl/base/internal/raw_logging.h"
#include "y_absl/base/internal/unaligned_access.h"
-#include "y_absl/strings/internal/char_map.h"
+#include "y_absl/strings/ascii.h"
+#include "y_absl/strings/charset.h"
#include "y_absl/strings/internal/escaping.h"
#include "y_absl/strings/internal/resize_uninitialized.h"
#include "y_absl/strings/internal/utf8.h"
+#include "y_absl/strings/numbers.h"
#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_join.h"
#include "y_absl/strings/string_view.h"
namespace y_absl {
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/has_absl_stringify.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/has_absl_stringify.h
new file mode 100644
index 00000000000..1ee2e96f99c
--- /dev/null
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/has_absl_stringify.h
@@ -0,0 +1,63 @@
+// Copyright 2022 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef Y_ABSL_STRINGS_HAS_ABSL_STRINGIFY_H_
+#define Y_ABSL_STRINGS_HAS_ABSL_STRINGIFY_H_
+
+#include <type_traits>
+#include <utility>
+
+#include "y_absl/strings/string_view.h"
+
+namespace y_absl {
+Y_ABSL_NAMESPACE_BEGIN
+
+namespace strings_internal {
+
+// This is an empty class not intended to be used. It exists so that
+// `HasAbslStringify` can reference a universal class rather than needing to be
+// copied for each new sink.
+class UnimplementedSink {
+ public:
+ void Append(size_t count, char ch);
+
+ void Append(string_view v);
+
+ // Support `y_absl::Format(&sink, format, args...)`.
+ friend void AbslFormatFlush(UnimplementedSink* sink, y_absl::string_view v);
+};
+
+} // namespace strings_internal
+
+// `HasAbslStringify<T>` detects if type `T` supports the `AbslStringify()`
+// customization point (see
+// https://abseil.io/docs/cpp/guides/format#abslstringify for the
+// documentation).
+//
+// Note that there are types that can be `StrCat`-ed that do not use the
+// `AbslStringify` customization point (for example, `int`).
+
+template <typename T, typename = void>
+struct HasAbslStringify : std::false_type {};
+
+template <typename T>
+struct HasAbslStringify<
+ T, std::enable_if_t<std::is_void<decltype(AbslStringify(
+ std::declval<strings_internal::UnimplementedSink&>(),
+ std::declval<const T&>()))>::value>> : std::true_type {};
+
+Y_ABSL_NAMESPACE_END
+} // namespace y_absl
+
+#endif // Y_ABSL_STRINGS_HAS_ABSL_STRINGIFY_H_
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/has_ostream_operator.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/has_ostream_operator.h
new file mode 100644
index 00000000000..5671a572cdb
--- /dev/null
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/has_ostream_operator.h
@@ -0,0 +1,42 @@
+// Copyright 2023 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef Y_ABSL_STRINGS_HAS_OSTREAM_OPERATOR_H_
+#define Y_ABSL_STRINGS_HAS_OSTREAM_OPERATOR_H_
+
+#include <ostream>
+#include <type_traits>
+#include <utility>
+
+#include "y_absl/base/config.h"
+
+namespace y_absl {
+Y_ABSL_NAMESPACE_BEGIN
+
+// Detects if type `T` supports streaming to `std::ostream`s with `operator<<`.
+
+template <typename T, typename = void>
+struct HasOstreamOperator : std::false_type {};
+
+template <typename T>
+struct HasOstreamOperator<
+ T, std::enable_if_t<std::is_same<
+ std::ostream&, decltype(std::declval<std::ostream&>()
+ << std::declval<const T&>())>::value>>
+ : std::true_type {};
+
+Y_ABSL_NAMESPACE_END
+} // namespace y_absl
+
+#endif // Y_ABSL_STRINGS_HAS_OSTREAM_OPERATOR_H_
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/char_map.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/char_map.h
deleted file mode 100644
index ef761ab03d6..00000000000
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/char_map.h
+++ /dev/null
@@ -1,158 +0,0 @@
-// Copyright 2017 The Abseil Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Character Map Class
-//
-// A fast, bit-vector map for 8-bit unsigned characters.
-// This class is useful for non-character purposes as well.
-
-#ifndef Y_ABSL_STRINGS_INTERNAL_CHAR_MAP_H_
-#define Y_ABSL_STRINGS_INTERNAL_CHAR_MAP_H_
-
-#include <cstddef>
-#include <cstdint>
-#include <cstring>
-
-#include "y_absl/base/macros.h"
-#include "y_absl/base/port.h"
-
-namespace y_absl {
-Y_ABSL_NAMESPACE_BEGIN
-namespace strings_internal {
-
-class Charmap {
- public:
- constexpr Charmap() : m_() {}
-
- // Initializes with a given char*. Note that NUL is not treated as
- // a terminator, but rather a char to be flicked.
- Charmap(const char* str, int len) : m_() {
- while (len--) SetChar(*str++);
- }
-
- // Initializes with a given char*. NUL is treated as a terminator
- // and will not be in the charmap.
- explicit Charmap(const char* str) : m_() {
- while (*str) SetChar(*str++);
- }
-
- constexpr bool contains(unsigned char c) const {
- return (m_[c / 64] >> (c % 64)) & 0x1;
- }
-
- // Returns true if and only if a character exists in both maps.
- bool IntersectsWith(const Charmap& c) const {
- for (size_t i = 0; i < Y_ABSL_ARRAYSIZE(m_); ++i) {
- if ((m_[i] & c.m_[i]) != 0) return true;
- }
- return false;
- }
-
- bool IsZero() const {
- for (uint64_t c : m_) {
- if (c != 0) return false;
- }
- return true;
- }
-
- // Containing only a single specified char.
- static constexpr Charmap Char(char x) {
- return Charmap(CharMaskForWord(x, 0), CharMaskForWord(x, 1),
- CharMaskForWord(x, 2), CharMaskForWord(x, 3));
- }
-
- // Containing all the chars in the C-string 's'.
- static constexpr Charmap FromString(const char* s) {
- Charmap ret;
- while (*s) ret = ret | Char(*s++);
- return ret;
- }
-
- // Containing all the chars in the closed interval [lo,hi].
- static constexpr Charmap Range(char lo, char hi) {
- return Charmap(RangeForWord(lo, hi, 0), RangeForWord(lo, hi, 1),
- RangeForWord(lo, hi, 2), RangeForWord(lo, hi, 3));
- }
-
- friend constexpr Charmap operator&(const Charmap& a, const Charmap& b) {
- return Charmap(a.m_[0] & b.m_[0], a.m_[1] & b.m_[1], a.m_[2] & b.m_[2],
- a.m_[3] & b.m_[3]);
- }
-
- friend constexpr Charmap operator|(const Charmap& a, const Charmap& b) {
- return Charmap(a.m_[0] | b.m_[0], a.m_[1] | b.m_[1], a.m_[2] | b.m_[2],
- a.m_[3] | b.m_[3]);
- }
-
- friend constexpr Charmap operator~(const Charmap& a) {
- return Charmap(~a.m_[0], ~a.m_[1], ~a.m_[2], ~a.m_[3]);
- }
-
- private:
- constexpr Charmap(uint64_t b0, uint64_t b1, uint64_t b2, uint64_t b3)
- : m_{b0, b1, b2, b3} {}
-
- static constexpr uint64_t RangeForWord(char lo, char hi, uint64_t word) {
- return OpenRangeFromZeroForWord(static_cast<unsigned char>(hi) + 1, word) &
- ~OpenRangeFromZeroForWord(static_cast<unsigned char>(lo), word);
- }
-
- // All the chars in the specified word of the range [0, upper).
- static constexpr uint64_t OpenRangeFromZeroForWord(uint64_t upper,
- uint64_t word) {
- return (upper <= 64 * word)
- ? 0
- : (upper >= 64 * (word + 1))
- ? ~static_cast<uint64_t>(0)
- : (~static_cast<uint64_t>(0) >> (64 - upper % 64));
- }
-
- static constexpr uint64_t CharMaskForWord(char x, uint64_t word) {
- const auto unsigned_x = static_cast<unsigned char>(x);
- return (unsigned_x / 64 == word)
- ? (static_cast<uint64_t>(1) << (unsigned_x % 64))
- : 0;
- }
-
- void SetChar(char c) {
- const auto unsigned_c = static_cast<unsigned char>(c);
- m_[unsigned_c / 64] |= static_cast<uint64_t>(1) << (unsigned_c % 64);
- }
-
- uint64_t m_[4];
-};
-
-// Mirror the char-classifying predicates in <cctype>
-constexpr Charmap UpperCharmap() { return Charmap::Range('A', 'Z'); }
-constexpr Charmap LowerCharmap() { return Charmap::Range('a', 'z'); }
-constexpr Charmap DigitCharmap() { return Charmap::Range('0', '9'); }
-constexpr Charmap AlphaCharmap() { return LowerCharmap() | UpperCharmap(); }
-constexpr Charmap AlnumCharmap() { return DigitCharmap() | AlphaCharmap(); }
-constexpr Charmap XDigitCharmap() {
- return DigitCharmap() | Charmap::Range('A', 'F') | Charmap::Range('a', 'f');
-}
-constexpr Charmap PrintCharmap() { return Charmap::Range(0x20, 0x7e); }
-constexpr Charmap SpaceCharmap() { return Charmap::FromString("\t\n\v\f\r "); }
-constexpr Charmap CntrlCharmap() {
- return Charmap::Range(0, 0x7f) & ~PrintCharmap();
-}
-constexpr Charmap BlankCharmap() { return Charmap::FromString("\t "); }
-constexpr Charmap GraphCharmap() { return PrintCharmap() & ~SpaceCharmap(); }
-constexpr Charmap PunctCharmap() { return GraphCharmap() & ~AlnumCharmap(); }
-
-} // namespace strings_internal
-Y_ABSL_NAMESPACE_END
-} // namespace y_absl
-
-#endif // Y_ABSL_STRINGS_INTERNAL_CHAR_MAP_H_
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_internal.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_internal.cc
index 8c6e79a066d..dba37418cbe 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_internal.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_internal.cc
@@ -22,15 +22,12 @@
#include "y_absl/strings/internal/cord_rep_btree.h"
#include "y_absl/strings/internal/cord_rep_crc.h"
#include "y_absl/strings/internal/cord_rep_flat.h"
-#include "y_absl/strings/internal/cord_rep_ring.h"
#include "y_absl/strings/str_cat.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
namespace cord_internal {
-Y_ABSL_CONST_INIT std::atomic<bool> cord_ring_buffer_enabled(
- kCordEnableRingBufferDefault);
Y_ABSL_CONST_INIT std::atomic<bool> shallow_subcords_enabled(
kCordShallowSubcordsDefault);
@@ -47,9 +44,6 @@ void CordRep::Destroy(CordRep* rep) {
if (rep->tag == BTREE) {
CordRepBtree::Destroy(rep->btree());
return;
- } else if (rep->tag == RING) {
- CordRepRing::Destroy(rep->ring());
- return;
} else if (rep->tag == EXTERNAL) {
CordRepExternal::Delete(rep);
return;
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_internal.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_internal.h
index edbc682e206..7a03ba33377 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_internal.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_internal.h
@@ -55,24 +55,15 @@ struct CordRepExternal;
struct CordRepFlat;
struct CordRepSubstring;
struct CordRepCrc;
-class CordRepRing;
class CordRepBtree;
class CordzInfo;
// Default feature enable states for cord ring buffers
-enum CordFeatureDefaults {
- kCordEnableRingBufferDefault = false,
- kCordShallowSubcordsDefault = false
-};
+enum CordFeatureDefaults { kCordShallowSubcordsDefault = false };
-extern std::atomic<bool> cord_ring_buffer_enabled;
extern std::atomic<bool> shallow_subcords_enabled;
-inline void enable_cord_ring_buffer(bool enable) {
- cord_ring_buffer_enabled.store(enable, std::memory_order_relaxed);
-}
-
inline void enable_shallow_subcords(bool enable) {
shallow_subcords_enabled.store(enable, std::memory_order_relaxed);
}
@@ -110,8 +101,16 @@ inline void SmallMemmove(char* dst, const char* src, size_t n) {
if (nullify_tail) {
memset(dst + 7, 0, 8);
}
+ // GCC 12 has a false-positive -Wstringop-overflow warning here.
+#if Y_ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#endif
memcpy(dst, &buf1, 8);
memcpy(dst + n - 8, &buf2, 8);
+#if Y_ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
+#pragma GCC diagnostic pop
+#endif
} else if (n >= 4) {
uint32_t buf1;
uint32_t buf2;
@@ -158,18 +157,18 @@ class RefcountAndFlags {
// false. Always returns false when the immortal bit is set.
inline bool Decrement() {
int32_t refcount = count_.load(std::memory_order_acquire);
- assert((refcount & kRefcountMask) > 0 || refcount & kImmortalFlag);
+ assert(refcount > 0 || refcount & kImmortalFlag);
return refcount != kRefIncrement &&
- (count_.fetch_sub(kRefIncrement, std::memory_order_acq_rel) &
- kHighRefcountMask) != 0;
+ count_.fetch_sub(kRefIncrement, std::memory_order_acq_rel) !=
+ kRefIncrement;
}
// Same as Decrement but expect that refcount is greater than 1.
inline bool DecrementExpectHighRefcount() {
int32_t refcount =
count_.fetch_sub(kRefIncrement, std::memory_order_acq_rel);
- assert((refcount & kRefcountMask) > 0 || refcount & kImmortalFlag);
- return (refcount & kHighRefcountMask) != 0;
+ assert(refcount > 0 || refcount & kImmortalFlag);
+ return refcount != kRefIncrement;
}
// Returns the current reference count using acquire semantics.
@@ -185,10 +184,9 @@ class RefcountAndFlags {
// This call performs the test for a reference count of one, and
// performs the memory barrier needed for the owning thread
// to act on the object, knowing that it has exclusive access to the
- // object. Always returns false when the immortal bit is set.
+ // object. Always returns false when the immortal bit is set.
inline bool IsOne() {
- return (count_.load(std::memory_order_acquire) & kRefcountMask) ==
- kRefIncrement;
+ return count_.load(std::memory_order_acquire) == kRefIncrement;
}
bool IsImmortal() const {
@@ -196,32 +194,15 @@ class RefcountAndFlags {
}
private:
- // We reserve the bottom bits for flags.
+ // We reserve the bottom bit for flag.
// kImmortalBit indicates that this entity should never be collected; it is
// used for the StringConstant constructor to avoid collecting immutable
// constant cords.
- // kReservedFlag is reserved for future use.
enum Flags {
- kNumFlags = 2,
+ kNumFlags = 1,
kImmortalFlag = 0x1,
- kReservedFlag = 0x2,
kRefIncrement = (1 << kNumFlags),
-
- // Bitmask to use when checking refcount by equality. This masks out
- // all flags except kImmortalFlag, which is part of the refcount for
- // purposes of equality. (A refcount of 0 or 1 does not count as 0 or 1
- // if the immortal bit is set.)
- kRefcountMask = ~kReservedFlag,
-
- // Bitmask to use when checking if refcount is equal to 1 and not
- // immortal when decrementing the refcount. This masks out kRefIncrement and
- // all flags except kImmortalFlag. If the masked RefcountAndFlags is 0, we
- // assume the refcount is equal to 1, since we know it's not immortal and
- // not greater than 1. If the masked RefcountAndFlags is not 0, we can
- // assume the refcount is not equal to 1 since either a higher bit in the
- // refcount is set, or kImmortal is set.
- kHighRefcountMask = kRefcountMask & ~kRefIncrement,
};
std::atomic<int32_t> count_;
@@ -233,7 +214,7 @@ enum CordRepKind {
SUBSTRING = 1,
CRC = 2,
BTREE = 3,
- RING = 4,
+ UNUSED_4 = 4,
EXTERNAL = 5,
// We have different tags for different sized flat arrays,
@@ -252,12 +233,8 @@ enum CordRepKind {
// There are various locations where we want to check if some rep is a 'plain'
// data edge, i.e. an external or flat rep. By having FLAT == EXTERNAL + 1, we
// can perform this check in a single branch as 'tag >= EXTERNAL'
-// Likewise, we have some locations where we check for 'ring or external/flat',
-// so likewise align RING to EXTERNAL.
// Note that we can leave this optimization to the compiler. The compiler will
// DTRT when it sees a condition like `tag == EXTERNAL || tag >= FLAT`.
-static_assert(RING == BTREE + 1, "BTREE and RING not consecutive");
-static_assert(EXTERNAL == RING + 1, "BTREE and EXTERNAL not consecutive");
static_assert(FLAT == EXTERNAL + 1, "EXTERNAL and FLAT not consecutive");
struct CordRep {
@@ -301,15 +278,12 @@ struct CordRep {
// # LINT.ThenChange(cord_rep_btree.h:copy_raw)
// Returns true if this instance's tag matches the requested type.
- constexpr bool IsRing() const { return tag == RING; }
constexpr bool IsSubstring() const { return tag == SUBSTRING; }
constexpr bool IsCrc() const { return tag == CRC; }
constexpr bool IsExternal() const { return tag == EXTERNAL; }
constexpr bool IsFlat() const { return tag >= FLAT; }
constexpr bool IsBtree() const { return tag == BTREE; }
- inline CordRepRing* ring();
- inline const CordRepRing* ring() const;
inline CordRepSubstring* substring();
inline const CordRepSubstring* substring() const;
inline CordRepCrc* crc();
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_ring.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_ring.cc
deleted file mode 100644
index f05aa5ffa7c..00000000000
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_ring.cc
+++ /dev/null
@@ -1,773 +0,0 @@
-// Copyright 2020 The Abseil Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-#include "y_absl/strings/internal/cord_rep_ring.h"
-
-#include <cassert>
-#include <cstddef>
-#include <cstdint>
-#include <iostream>
-#include <limits>
-#include <memory>
-#include <util/generic/string.h>
-
-#include "y_absl/base/internal/raw_logging.h"
-#include "y_absl/base/internal/throw_delegate.h"
-#include "y_absl/base/macros.h"
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/internal/cord_internal.h"
-#include "y_absl/strings/internal/cord_rep_consume.h"
-#include "y_absl/strings/internal/cord_rep_flat.h"
-
-namespace y_absl {
-Y_ABSL_NAMESPACE_BEGIN
-namespace cord_internal {
-
-namespace {
-
-using index_type = CordRepRing::index_type;
-
-enum class Direction { kForward, kReversed };
-
-inline bool IsFlatOrExternal(CordRep* rep) {
- return rep->IsFlat() || rep->IsExternal();
-}
-
-// Verifies that n + extra <= kMaxCapacity: throws std::length_error otherwise.
-inline void CheckCapacity(size_t n, size_t extra) {
- if (Y_ABSL_PREDICT_FALSE(extra > CordRepRing::kMaxCapacity - n)) {
- base_internal::ThrowStdLengthError("Maximum capacity exceeded");
- }
-}
-
-// Creates a flat from the provided string data, allocating up to `extra`
-// capacity in the returned flat depending on kMaxFlatLength limitations.
-// Requires `len` to be less or equal to `kMaxFlatLength`
-CordRepFlat* CreateFlat(const char* s, size_t n, size_t extra = 0) { // NOLINT
- assert(n <= kMaxFlatLength);
- auto* rep = CordRepFlat::New(n + extra);
- rep->length = n;
- memcpy(rep->Data(), s, n);
- return rep;
-}
-
-// Unrefs the entries in `[head, tail)`.
-// Requires all entries to be a FLAT or EXTERNAL node.
-void UnrefEntries(const CordRepRing* rep, index_type head, index_type tail) {
- rep->ForEach(head, tail, [rep](index_type ix) {
- CordRep* child = rep->entry_child(ix);
- if (!child->refcount.Decrement()) {
- if (child->tag >= FLAT) {
- CordRepFlat::Delete(child->flat());
- } else {
- CordRepExternal::Delete(child->external());
- }
- }
- });
-}
-
-} // namespace
-
-std::ostream& operator<<(std::ostream& s, const CordRepRing& rep) {
- // Note: 'pos' values are defined as size_t (for overflow reasons), but that
- // prints really awkward for small prepended values such as -5. ssize_t is not
- // portable (POSIX), so we use ptrdiff_t instead to cast to signed values.
- s << " CordRepRing(" << &rep << ", length = " << rep.length
- << ", head = " << rep.head_ << ", tail = " << rep.tail_
- << ", cap = " << rep.capacity_ << ", rc = " << rep.refcount.Get()
- << ", begin_pos_ = " << static_cast<ptrdiff_t>(rep.begin_pos_) << ") {\n";
- CordRepRing::index_type head = rep.head();
- do {
- CordRep* child = rep.entry_child(head);
- s << " entry[" << head << "] length = " << rep.entry_length(head)
- << ", child " << child << ", clen = " << child->length
- << ", tag = " << static_cast<int>(child->tag)
- << ", rc = " << child->refcount.Get()
- << ", offset = " << rep.entry_data_offset(head)
- << ", end_pos = " << static_cast<ptrdiff_t>(rep.entry_end_pos(head))
- << "\n";
- head = rep.advance(head);
- } while (head != rep.tail());
- return s << "}\n";
-}
-
-void CordRepRing::AddDataOffset(index_type index, size_t n) {
- entry_data_offset()[index] += static_cast<offset_type>(n);
-}
-
-void CordRepRing::SubLength(index_type index, size_t n) {
- entry_end_pos()[index] -= n;
-}
-
-class CordRepRing::Filler {
- public:
- Filler(CordRepRing* rep, index_type pos) : rep_(rep), head_(pos), pos_(pos) {}
-
- index_type head() const { return head_; }
- index_type pos() const { return pos_; }
-
- void Add(CordRep* child, size_t offset, pos_type end_pos) {
- rep_->entry_end_pos()[pos_] = end_pos;
- rep_->entry_child()[pos_] = child;
- rep_->entry_data_offset()[pos_] = static_cast<offset_type>(offset);
- pos_ = rep_->advance(pos_);
- }
-
- private:
- CordRepRing* rep_;
- index_type head_;
- index_type pos_;
-};
-
-#ifdef Y_ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL
-constexpr size_t CordRepRing::kMaxCapacity;
-#endif
-
-bool CordRepRing::IsValid(std::ostream& output) const {
- if (capacity_ == 0) {
- output << "capacity == 0";
- return false;
- }
-
- if (head_ >= capacity_ || tail_ >= capacity_) {
- output << "head " << head_ << " and/or tail " << tail_ << "exceed capacity "
- << capacity_;
- return false;
- }
-
- const index_type back = retreat(tail_);
- size_t pos_length = Distance(begin_pos_, entry_end_pos(back));
- if (pos_length != length) {
- output << "length " << length << " does not match positional length "
- << pos_length << " from begin_pos " << begin_pos_ << " and entry["
- << back << "].end_pos " << entry_end_pos(back);
- return false;
- }
-
- index_type head = head_;
- pos_type begin_pos = begin_pos_;
- do {
- pos_type end_pos = entry_end_pos(head);
- size_t entry_length = Distance(begin_pos, end_pos);
- if (entry_length == 0) {
- output << "entry[" << head << "] has an invalid length " << entry_length
- << " from begin_pos " << begin_pos << " and end_pos " << end_pos;
- return false;
- }
-
- CordRep* child = entry_child(head);
- if (child == nullptr) {
- output << "entry[" << head << "].child == nullptr";
- return false;
- }
- if (child->tag < FLAT && child->tag != EXTERNAL) {
- output << "entry[" << head << "].child has an invalid tag "
- << static_cast<int>(child->tag);
- return false;
- }
-
- size_t offset = entry_data_offset(head);
- if (offset >= child->length || entry_length > child->length - offset) {
- output << "entry[" << head << "] has offset " << offset
- << " and entry length " << entry_length
- << " which are outside of the child's length of " << child->length;
- return false;
- }
-
- begin_pos = end_pos;
- head = advance(head);
- } while (head != tail_);
-
- return true;
-}
-
-#ifdef EXTRA_CORD_RING_VALIDATION
-CordRepRing* CordRepRing::Validate(CordRepRing* rep, const char* file,
- int line) {
- if (!rep->IsValid(std::cerr)) {
- std::cerr << "\nERROR: CordRepRing corrupted";
- if (line) std::cerr << " at line " << line;
- if (file) std::cerr << " in file " << file;
- std::cerr << "\nContent = " << *rep;
- abort();
- }
- return rep;
-}
-#endif // EXTRA_CORD_RING_VALIDATION
-
-CordRepRing* CordRepRing::New(size_t capacity, size_t extra) {
- CheckCapacity(capacity, extra);
-
- size_t size = AllocSize(capacity += extra);
- void* mem = ::operator new(size);
- auto* rep = new (mem) CordRepRing(static_cast<index_type>(capacity));
- rep->tag = RING;
- rep->capacity_ = static_cast<index_type>(capacity);
- rep->begin_pos_ = 0;
- return rep;
-}
-
-void CordRepRing::SetCapacityForTesting(size_t capacity) {
- // Adjust for the changed layout
- assert(capacity <= capacity_);
- assert(head() == 0 || head() < tail());
- memmove(Layout::Partial(capacity).Pointer<1>(data_) + head(),
- Layout::Partial(capacity_).Pointer<1>(data_) + head(),
- entries() * sizeof(Layout::ElementType<1>));
- memmove(Layout::Partial(capacity, capacity).Pointer<2>(data_) + head(),
- Layout::Partial(capacity_, capacity_).Pointer<2>(data_) + head(),
- entries() * sizeof(Layout::ElementType<2>));
- capacity_ = static_cast<index_type>(capacity);
-}
-
-void CordRepRing::Delete(CordRepRing* rep) {
- assert(rep != nullptr && rep->IsRing());
-#if defined(__cpp_sized_deallocation)
- size_t size = AllocSize(rep->capacity_);
- rep->~CordRepRing();
- ::operator delete(rep, size);
-#else
- rep->~CordRepRing();
- ::operator delete(rep);
-#endif
-}
-
-void CordRepRing::Destroy(CordRepRing* rep) {
- UnrefEntries(rep, rep->head(), rep->tail());
- Delete(rep);
-}
-
-template <bool ref>
-void CordRepRing::Fill(const CordRepRing* src, index_type head,
- index_type tail) {
- this->length = src->length;
- head_ = 0;
- tail_ = advance(0, src->entries(head, tail));
- begin_pos_ = src->begin_pos_;
-
- // TODO(mvels): there may be opportunities here for large buffers.
- auto* dst_pos = entry_end_pos();
- auto* dst_child = entry_child();
- auto* dst_offset = entry_data_offset();
- src->ForEach(head, tail, [&](index_type index) {
- *dst_pos++ = src->entry_end_pos(index);
- CordRep* child = src->entry_child(index);
- *dst_child++ = ref ? CordRep::Ref(child) : child;
- *dst_offset++ = src->entry_data_offset(index);
- });
-}
-
-CordRepRing* CordRepRing::Copy(CordRepRing* rep, index_type head,
- index_type tail, size_t extra) {
- CordRepRing* newrep = CordRepRing::New(rep->entries(head, tail), extra);
- newrep->Fill<true>(rep, head, tail);
- CordRep::Unref(rep);
- return newrep;
-}
-
-CordRepRing* CordRepRing::Mutable(CordRepRing* rep, size_t extra) {
- // Get current number of entries, and check for max capacity.
- size_t entries = rep->entries();
-
- if (!rep->refcount.IsOne()) {
- return Copy(rep, rep->head(), rep->tail(), extra);
- } else if (entries + extra > rep->capacity()) {
- const size_t min_grow = rep->capacity() + rep->capacity() / 2;
- const size_t min_extra = (std::max)(extra, min_grow - entries);
- CordRepRing* newrep = CordRepRing::New(entries, min_extra);
- newrep->Fill<false>(rep, rep->head(), rep->tail());
- CordRepRing::Delete(rep);
- return newrep;
- } else {
- return rep;
- }
-}
-
-Span<char> CordRepRing::GetAppendBuffer(size_t size) {
- assert(refcount.IsOne());
- index_type back = retreat(tail_);
- CordRep* child = entry_child(back);
- if (child->tag >= FLAT && child->refcount.IsOne()) {
- size_t capacity = child->flat()->Capacity();
- pos_type end_pos = entry_end_pos(back);
- size_t data_offset = entry_data_offset(back);
- size_t entry_length = Distance(entry_begin_pos(back), end_pos);
- size_t used = data_offset + entry_length;
- if (size_t n = (std::min)(capacity - used, size)) {
- child->length = data_offset + entry_length + n;
- entry_end_pos()[back] = end_pos + n;
- this->length += n;
- return {child->flat()->Data() + used, n};
- }
- }
- return {nullptr, 0};
-}
-
-Span<char> CordRepRing::GetPrependBuffer(size_t size) {
- assert(refcount.IsOne());
- CordRep* child = entry_child(head_);
- size_t data_offset = entry_data_offset(head_);
- if (data_offset && child->refcount.IsOne() && child->tag >= FLAT) {
- size_t n = (std::min)(data_offset, size);
- this->length += n;
- begin_pos_ -= n;
- data_offset -= n;
- entry_data_offset()[head_] = static_cast<offset_type>(data_offset);
- return {child->flat()->Data() + data_offset, n};
- }
- return {nullptr, 0};
-}
-
-CordRepRing* CordRepRing::CreateFromLeaf(CordRep* child, size_t offset,
- size_t len, size_t extra) {
- CordRepRing* rep = CordRepRing::New(1, extra);
- rep->head_ = 0;
- rep->tail_ = rep->advance(0);
- rep->length = len;
- rep->entry_end_pos()[0] = len;
- rep->entry_child()[0] = child;
- rep->entry_data_offset()[0] = static_cast<offset_type>(offset);
- return Validate(rep);
-}
-
-CordRepRing* CordRepRing::CreateSlow(CordRep* child, size_t extra) {
- CordRepRing* rep = nullptr;
- Consume(child, [&](CordRep* child_arg, size_t offset, size_t len) {
- if (IsFlatOrExternal(child_arg)) {
- rep = rep ? AppendLeaf(rep, child_arg, offset, len)
- : CreateFromLeaf(child_arg, offset, len, extra);
- } else if (rep) {
- rep = AddRing<AddMode::kAppend>(rep, child_arg->ring(), offset, len);
- } else if (offset == 0 && child_arg->length == len) {
- rep = Mutable(child_arg->ring(), extra);
- } else {
- rep = SubRing(child_arg->ring(), offset, len, extra);
- }
- });
- return Validate(rep, nullptr, __LINE__);
-}
-
-CordRepRing* CordRepRing::Create(CordRep* child, size_t extra) {
- size_t length = child->length;
- if (IsFlatOrExternal(child)) {
- return CreateFromLeaf(child, 0, length, extra);
- }
- if (child->IsRing()) {
- return Mutable(child->ring(), extra);
- }
- return CreateSlow(child, extra);
-}
-
-template <CordRepRing::AddMode mode>
-CordRepRing* CordRepRing::AddRing(CordRepRing* rep, CordRepRing* ring,
- size_t offset, size_t len) {
- assert(offset < ring->length);
- constexpr bool append = mode == AddMode::kAppend;
- Position head = ring->Find(offset);
- Position tail = ring->FindTail(head.index, offset + len);
- const index_type entries = ring->entries(head.index, tail.index);
-
- rep = Mutable(rep, entries);
-
- // The delta for making ring[head].end_pos into 'len - offset'
- const pos_type delta_length =
- (append ? rep->begin_pos_ + rep->length : rep->begin_pos_ - len) -
- ring->entry_begin_pos(head.index) - head.offset;
-
- // Start filling at `tail`, or `entries` before `head`
- Filler filler(rep, append ? rep->tail_ : rep->retreat(rep->head_, entries));
-
- if (ring->refcount.IsOne()) {
- // Copy entries from source stealing the ref and adjusting the end position.
- // Commit the filler as this is no-op.
- ring->ForEach(head.index, tail.index, [&](index_type ix) {
- filler.Add(ring->entry_child(ix), ring->entry_data_offset(ix),
- ring->entry_end_pos(ix) + delta_length);
- });
-
- // Unref entries we did not copy over, and delete source.
- if (head.index != ring->head_) UnrefEntries(ring, ring->head_, head.index);
- if (tail.index != ring->tail_) UnrefEntries(ring, tail.index, ring->tail_);
- CordRepRing::Delete(ring);
- } else {
- ring->ForEach(head.index, tail.index, [&](index_type ix) {
- CordRep* child = ring->entry_child(ix);
- filler.Add(child, ring->entry_data_offset(ix),
- ring->entry_end_pos(ix) + delta_length);
- CordRep::Ref(child);
- });
- CordRepRing::Unref(ring);
- }
-
- if (head.offset) {
- // Increase offset of first 'source' entry appended or prepended.
- // This is always the entry in `filler.head()`
- rep->AddDataOffset(filler.head(), head.offset);
- }
-
- if (tail.offset) {
- // Reduce length of last 'source' entry appended or prepended.
- // This is always the entry tailed by `filler.pos()`
- rep->SubLength(rep->retreat(filler.pos()), tail.offset);
- }
-
- // Commit changes
- rep->length += len;
- if (append) {
- rep->tail_ = filler.pos();
- } else {
- rep->head_ = filler.head();
- rep->begin_pos_ -= len;
- }
-
- return Validate(rep);
-}
-
-CordRepRing* CordRepRing::AppendSlow(CordRepRing* rep, CordRep* child) {
- Consume(child, [&rep](CordRep* child_arg, size_t offset, size_t len) {
- if (child_arg->IsRing()) {
- rep = AddRing<AddMode::kAppend>(rep, child_arg->ring(), offset, len);
- } else {
- rep = AppendLeaf(rep, child_arg, offset, len);
- }
- });
- return rep;
-}
-
-CordRepRing* CordRepRing::AppendLeaf(CordRepRing* rep, CordRep* child,
- size_t offset, size_t len) {
- rep = Mutable(rep, 1);
- index_type back = rep->tail_;
- const pos_type begin_pos = rep->begin_pos_ + rep->length;
- rep->tail_ = rep->advance(rep->tail_);
- rep->length += len;
- rep->entry_end_pos()[back] = begin_pos + len;
- rep->entry_child()[back] = child;
- rep->entry_data_offset()[back] = static_cast<offset_type>(offset);
- return Validate(rep, nullptr, __LINE__);
-}
-
-CordRepRing* CordRepRing::Append(CordRepRing* rep, CordRep* child) {
- size_t length = child->length;
- if (IsFlatOrExternal(child)) {
- return AppendLeaf(rep, child, 0, length);
- }
- if (child->IsRing()) {
- return AddRing<AddMode::kAppend>(rep, child->ring(), 0, length);
- }
- return AppendSlow(rep, child);
-}
-
-CordRepRing* CordRepRing::PrependSlow(CordRepRing* rep, CordRep* child) {
- ReverseConsume(child, [&](CordRep* child_arg, size_t offset, size_t len) {
- if (IsFlatOrExternal(child_arg)) {
- rep = PrependLeaf(rep, child_arg, offset, len);
- } else {
- rep = AddRing<AddMode::kPrepend>(rep, child_arg->ring(), offset, len);
- }
- });
- return Validate(rep);
-}
-
-CordRepRing* CordRepRing::PrependLeaf(CordRepRing* rep, CordRep* child,
- size_t offset, size_t len) {
- rep = Mutable(rep, 1);
- index_type head = rep->retreat(rep->head_);
- pos_type end_pos = rep->begin_pos_;
- rep->head_ = head;
- rep->length += len;
- rep->begin_pos_ -= len;
- rep->entry_end_pos()[head] = end_pos;
- rep->entry_child()[head] = child;
- rep->entry_data_offset()[head] = static_cast<offset_type>(offset);
- return Validate(rep);
-}
-
-CordRepRing* CordRepRing::Prepend(CordRepRing* rep, CordRep* child) {
- size_t length = child->length;
- if (IsFlatOrExternal(child)) {
- return PrependLeaf(rep, child, 0, length);
- }
- if (child->IsRing()) {
- return AddRing<AddMode::kPrepend>(rep, child->ring(), 0, length);
- }
- return PrependSlow(rep, child);
-}
-
-CordRepRing* CordRepRing::Append(CordRepRing* rep, y_absl::string_view data,
- size_t extra) {
- if (rep->refcount.IsOne()) {
- Span<char> avail = rep->GetAppendBuffer(data.length());
- if (!avail.empty()) {
- memcpy(avail.data(), data.data(), avail.length());
- data.remove_prefix(avail.length());
- }
- }
- if (data.empty()) return Validate(rep);
-
- const size_t flats = (data.length() - 1) / kMaxFlatLength + 1;
- rep = Mutable(rep, flats);
-
- Filler filler(rep, rep->tail_);
- pos_type pos = rep->begin_pos_ + rep->length;
-
- while (data.length() >= kMaxFlatLength) {
- auto* flat = CreateFlat(data.data(), kMaxFlatLength);
- filler.Add(flat, 0, pos += kMaxFlatLength);
- data.remove_prefix(kMaxFlatLength);
- }
-
- if (data.length()) {
- auto* flat = CreateFlat(data.data(), data.length(), extra);
- filler.Add(flat, 0, pos += data.length());
- }
-
- rep->length = pos - rep->begin_pos_;
- rep->tail_ = filler.pos();
-
- return Validate(rep);
-}
-
-CordRepRing* CordRepRing::Prepend(CordRepRing* rep, y_absl::string_view data,
- size_t extra) {
- if (rep->refcount.IsOne()) {
- Span<char> avail = rep->GetPrependBuffer(data.length());
- if (!avail.empty()) {
- const char* tail = data.data() + data.length() - avail.length();
- memcpy(avail.data(), tail, avail.length());
- data.remove_suffix(avail.length());
- }
- }
- if (data.empty()) return rep;
-
- const size_t flats = (data.length() - 1) / kMaxFlatLength + 1;
- rep = Mutable(rep, flats);
- pos_type pos = rep->begin_pos_;
- Filler filler(rep, rep->retreat(rep->head_, static_cast<index_type>(flats)));
-
- size_t first_size = data.size() - (flats - 1) * kMaxFlatLength;
- CordRepFlat* flat = CordRepFlat::New(first_size + extra);
- flat->length = first_size + extra;
- memcpy(flat->Data() + extra, data.data(), first_size);
- data.remove_prefix(first_size);
- filler.Add(flat, extra, pos);
- pos -= first_size;
-
- while (!data.empty()) {
- assert(data.size() >= kMaxFlatLength);
- flat = CreateFlat(data.data(), kMaxFlatLength);
- filler.Add(flat, 0, pos);
- pos -= kMaxFlatLength;
- data.remove_prefix(kMaxFlatLength);
- }
-
- rep->head_ = filler.head();
- rep->length += rep->begin_pos_ - pos;
- rep->begin_pos_ = pos;
-
- return Validate(rep);
-}
-
-// 32 entries is 32 * sizeof(pos_type) = 4 cache lines on x86
-static constexpr index_type kBinarySearchThreshold = 32;
-static constexpr index_type kBinarySearchEndCount = 8;
-
-template <bool wrap>
-CordRepRing::index_type CordRepRing::FindBinary(index_type head,
- index_type tail,
- size_t offset) const {
- index_type count = tail + (wrap ? capacity_ : 0) - head;
- do {
- count = (count - 1) / 2;
- assert(count < entries(head, tail_));
- index_type mid = wrap ? advance(head, count) : head + count;
- index_type after_mid = wrap ? advance(mid) : mid + 1;
- bool larger = (offset >= entry_end_offset(mid));
- head = larger ? after_mid : head;
- tail = larger ? tail : mid;
- assert(head != tail);
- } while (Y_ABSL_PREDICT_TRUE(count > kBinarySearchEndCount));
- return head;
-}
-
-CordRepRing::Position CordRepRing::FindSlow(index_type head,
- size_t offset) const {
- index_type tail = tail_;
-
- // Binary search until we are good for linear search
- // Optimize for branchless / non wrapping ops
- if (tail > head) {
- index_type count = tail - head;
- if (count > kBinarySearchThreshold) {
- head = FindBinary<false>(head, tail, offset);
- }
- } else {
- index_type count = capacity_ + tail - head;
- if (count > kBinarySearchThreshold) {
- head = FindBinary<true>(head, tail, offset);
- }
- }
-
- pos_type pos = entry_begin_pos(head);
- pos_type end_pos = entry_end_pos(head);
- while (offset >= Distance(begin_pos_, end_pos)) {
- head = advance(head);
- pos = end_pos;
- end_pos = entry_end_pos(head);
- }
-
- return {head, offset - Distance(begin_pos_, pos)};
-}
-
-CordRepRing::Position CordRepRing::FindTailSlow(index_type head,
- size_t offset) const {
- index_type tail = tail_;
- const size_t tail_offset = offset - 1;
-
- // Binary search until we are good for linear search
- // Optimize for branchless / non wrapping ops
- if (tail > head) {
- index_type count = tail - head;
- if (count > kBinarySearchThreshold) {
- head = FindBinary<false>(head, tail, tail_offset);
- }
- } else {
- index_type count = capacity_ + tail - head;
- if (count > kBinarySearchThreshold) {
- head = FindBinary<true>(head, tail, tail_offset);
- }
- }
-
- size_t end_offset = entry_end_offset(head);
- while (tail_offset >= end_offset) {
- head = advance(head);
- end_offset = entry_end_offset(head);
- }
-
- return {advance(head), end_offset - offset};
-}
-
-char CordRepRing::GetCharacter(size_t offset) const {
- assert(offset < length);
-
- Position pos = Find(offset);
- size_t data_offset = entry_data_offset(pos.index) + pos.offset;
- return GetRepData(entry_child(pos.index))[data_offset];
-}
-
-CordRepRing* CordRepRing::SubRing(CordRepRing* rep, size_t offset,
- size_t len, size_t extra) {
- assert(offset <= rep->length);
- assert(offset <= rep->length - len);
-
- if (len == 0) {
- CordRep::Unref(rep);
- return nullptr;
- }
-
- // Find position of first byte
- Position head = rep->Find(offset);
- Position tail = rep->FindTail(head.index, offset + len);
- const size_t new_entries = rep->entries(head.index, tail.index);
-
- if (rep->refcount.IsOne() && extra <= (rep->capacity() - new_entries)) {
- // We adopt a privately owned rep and no extra entries needed.
- if (head.index != rep->head_) UnrefEntries(rep, rep->head_, head.index);
- if (tail.index != rep->tail_) UnrefEntries(rep, tail.index, rep->tail_);
- rep->head_ = head.index;
- rep->tail_ = tail.index;
- } else {
- // Copy subset to new rep
- rep = Copy(rep, head.index, tail.index, extra);
- head.index = rep->head_;
- tail.index = rep->tail_;
- }
-
- // Adjust begin_pos and length
- rep->length = len;
- rep->begin_pos_ += offset;
-
- // Adjust head and tail blocks
- if (head.offset) {
- rep->AddDataOffset(head.index, head.offset);
- }
- if (tail.offset) {
- rep->SubLength(rep->retreat(tail.index), tail.offset);
- }
-
- return Validate(rep);
-}
-
-CordRepRing* CordRepRing::RemovePrefix(CordRepRing* rep, size_t len,
- size_t extra) {
- assert(len <= rep->length);
- if (len == rep->length) {
- CordRep::Unref(rep);
- return nullptr;
- }
-
- Position head = rep->Find(len);
- if (rep->refcount.IsOne()) {
- if (head.index != rep->head_) UnrefEntries(rep, rep->head_, head.index);
- rep->head_ = head.index;
- } else {
- rep = Copy(rep, head.index, rep->tail_, extra);
- head.index = rep->head_;
- }
-
- // Adjust begin_pos and length
- rep->length -= len;
- rep->begin_pos_ += len;
-
- // Adjust head block
- if (head.offset) {
- rep->AddDataOffset(head.index, head.offset);
- }
-
- return Validate(rep);
-}
-
-CordRepRing* CordRepRing::RemoveSuffix(CordRepRing* rep, size_t len,
- size_t extra) {
- assert(len <= rep->length);
-
- if (len == rep->length) {
- CordRep::Unref(rep);
- return nullptr;
- }
-
- Position tail = rep->FindTail(rep->length - len);
- if (rep->refcount.IsOne()) {
- // We adopt a privately owned rep, scrub.
- if (tail.index != rep->tail_) UnrefEntries(rep, tail.index, rep->tail_);
- rep->tail_ = tail.index;
- } else {
- // Copy subset to new rep
- rep = Copy(rep, rep->head_, tail.index, extra);
- tail.index = rep->tail_;
- }
-
- // Adjust length
- rep->length -= len;
-
- // Adjust tail block
- if (tail.offset) {
- rep->SubLength(rep->retreat(tail.index), tail.offset);
- }
-
- return Validate(rep);
-}
-
-} // namespace cord_internal
-Y_ABSL_NAMESPACE_END
-} // namespace y_absl
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_ring.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_ring.h
deleted file mode 100644
index c7698e6fd8a..00000000000
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_ring.h
+++ /dev/null
@@ -1,607 +0,0 @@
-// Copyright 2020 The Abseil Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef Y_ABSL_STRINGS_INTERNAL_CORD_REP_RING_H_
-#define Y_ABSL_STRINGS_INTERNAL_CORD_REP_RING_H_
-
-#include <cassert>
-#include <cstddef>
-#include <cstdint>
-#include <iosfwd>
-#include <limits>
-#include <memory>
-
-#include "y_absl/container/internal/layout.h"
-#include "y_absl/strings/internal/cord_internal.h"
-#include "y_absl/strings/internal/cord_rep_flat.h"
-
-namespace y_absl {
-Y_ABSL_NAMESPACE_BEGIN
-namespace cord_internal {
-
-// All operations modifying a ring buffer are implemented as static methods
-// requiring a CordRepRing instance with a reference adopted by the method.
-//
-// The methods return the modified ring buffer, which may be equal to the input
-// if the input was not shared, and having large enough capacity to accommodate
-// any newly added node(s). Otherwise, a copy of the input rep with the new
-// node(s) added is returned.
-//
-// Any modification on non shared ring buffers with enough capacity will then
-// require minimum atomic operations. Caller should where possible provide
-// reasonable `extra` hints for both anticipated extra `flat` byte space, as
-// well as anticipated extra nodes required for complex operations.
-//
-// Example of code creating a ring buffer, adding some data to it,
-// and discarding the buffer when done:
-//
-// void FunWithRings() {
-// // Create ring with 3 flats
-// CordRep* flat = CreateFlat("Hello");
-// CordRepRing* ring = CordRepRing::Create(flat, 2);
-// ring = CordRepRing::Append(ring, CreateFlat(" "));
-// ring = CordRepRing::Append(ring, CreateFlat("world"));
-// DoSomethingWithRing(ring);
-// CordRep::Unref(ring);
-// }
-//
-// Example of code Copying an existing ring buffer and modifying it:
-//
-// void MoreFunWithRings(CordRepRing* src) {
-// CordRepRing* ring = CordRep::Ref(src)->ring();
-// ring = CordRepRing::Append(ring, CreateFlat("Hello"));
-// ring = CordRepRing::Append(ring, CreateFlat(" "));
-// ring = CordRepRing::Append(ring, CreateFlat("world"));
-// DoSomethingWithRing(ring);
-// CordRep::Unref(ring);
-// }
-//
-class CordRepRing : public CordRep {
- public:
- // `pos_type` represents a 'logical position'. A CordRepRing instance has a
- // `begin_pos` (default 0), and each node inside the buffer will have an
- // `end_pos` which is the `end_pos` of the previous node (or `begin_pos`) plus
- // this node's length. The purpose is to allow for a binary search on this
- // position, while allowing O(1) prepend and append operations.
- using pos_type = size_t;
-
- // `index_type` is the type for the `head`, `tail` and `capacity` indexes.
- // Ring buffers are limited to having no more than four billion entries.
- using index_type = uint32_t;
-
- // `offset_type` is the type for the data offset inside a child rep's data.
- using offset_type = uint32_t;
-
- // Position holds the node index and relative offset into the node for
- // some physical offset in the contained data as returned by the Find()
- // and FindTail() methods.
- struct Position {
- index_type index;
- size_t offset;
- };
-
- // The maximum # of child nodes that can be hosted inside a CordRepRing.
- static constexpr size_t kMaxCapacity = (std::numeric_limits<uint32_t>::max)();
-
- // CordRepring can not be default constructed, moved, copied or assigned.
- CordRepRing() = delete;
- CordRepRing(const CordRepRing&) = delete;
- CordRepRing& operator=(const CordRepRing&) = delete;
-
- // Returns true if this instance is valid, false if some or all of the
- // invariants are broken. Intended for debug purposes only.
- // `output` receives an explanation of the broken invariants.
- bool IsValid(std::ostream& output) const;
-
- // Returns the size in bytes for a CordRepRing with `capacity' entries.
- static constexpr size_t AllocSize(size_t capacity);
-
- // Returns the distance in bytes from `pos` to `end_pos`.
- static constexpr size_t Distance(pos_type pos, pos_type end_pos);
-
- // Creates a new ring buffer from the provided `rep`. Adopts a reference
- // on `rep`. The returned ring buffer has a capacity of at least `extra + 1`
- static CordRepRing* Create(CordRep* child, size_t extra = 0);
-
- // `head`, `tail` and `capacity` indexes defining the ring buffer boundaries.
- index_type head() const { return head_; }
- index_type tail() const { return tail_; }
- index_type capacity() const { return capacity_; }
-
- // Returns the number of entries in this instance.
- index_type entries() const { return entries(head_, tail_); }
-
- // Returns the logical begin position of this instance.
- pos_type begin_pos() const { return begin_pos_; }
-
- // Returns the number of entries for a given head-tail range.
- // Requires `head` and `tail` values to be less than `capacity()`.
- index_type entries(index_type head, index_type tail) const {
- assert(head < capacity_ && tail < capacity_);
- return tail - head + ((tail > head) ? 0 : capacity_);
- }
-
- // Returns the logical end position of entry `index`.
- pos_type const& entry_end_pos(index_type index) const {
- assert(IsValidIndex(index));
- return Layout::Partial().Pointer<0>(data_)[index];
- }
-
- // Returns the child pointer of entry `index`.
- CordRep* const& entry_child(index_type index) const {
- assert(IsValidIndex(index));
- return Layout::Partial(capacity()).Pointer<1>(data_)[index];
- }
-
- // Returns the data offset of entry `index`
- offset_type const& entry_data_offset(index_type index) const {
- assert(IsValidIndex(index));
- return Layout::Partial(capacity(), capacity()).Pointer<2>(data_)[index];
- }
-
- // Appends the provided child node to the `rep` instance.
- // Adopts a reference from `rep` and `child` which may not be null.
- // If the provided child is a FLAT or EXTERNAL node, or a SUBSTRING node
- // containing a FLAT or EXTERNAL node, then flat or external the node is added
- // 'as is', with an offset added for the SUBSTRING case.
- // If the provided child is a RING or CONCAT tree, or a SUBSTRING of a RING or
- // CONCAT tree, then all child nodes not excluded by any start offset or
- // length values are added recursively.
- static CordRepRing* Append(CordRepRing* rep, CordRep* child);
-
- // Appends the provided string data to the `rep` instance.
- // This function will attempt to utilize any remaining capacity in the last
- // node of the input if that node is not shared (directly or indirectly), and
- // of type FLAT. Remaining data will be added as one or more FLAT nodes.
- // Any last node added to the ring buffer will be allocated with up to
- // `extra` bytes of capacity for (anticipated) subsequent append actions.
- static CordRepRing* Append(CordRepRing* rep, string_view data,
- size_t extra = 0);
-
- // Prepends the provided child node to the `rep` instance.
- // Adopts a reference from `rep` and `child` which may not be null.
- // If the provided child is a FLAT or EXTERNAL node, or a SUBSTRING node
- // containing a FLAT or EXTERNAL node, then flat or external the node is
- // prepended 'as is', with an optional offset added for the SUBSTRING case.
- // If the provided child is a RING or CONCAT tree, or a SUBSTRING of a RING
- // or CONCAT tree, then all child nodes not excluded by any start offset or
- // length values are added recursively.
- static CordRepRing* Prepend(CordRepRing* rep, CordRep* child);
-
- // Prepends the provided string data to the `rep` instance.
- // This function will attempt to utilize any remaining capacity in the first
- // node of the input if that node is not shared (directly or indirectly), and
- // of type FLAT. Remaining data will be added as one or more FLAT nodes.
- // Any first node prepnded to the ring buffer will be allocated with up to
- // `extra` bytes of capacity for (anticipated) subsequent prepend actions.
- static CordRepRing* Prepend(CordRepRing* rep, string_view data,
- size_t extra = 0);
-
- // Returns a span referencing potentially unused capacity in the last node.
- // The returned span may be empty if no such capacity is available, or if the
- // current instance is shared. Else, a span of size `n <= size` is returned.
- // If non empty, the ring buffer is adjusted to the new length, with the newly
- // added capacity left uninitialized. Callers should assign a value to the
- // entire span before any other operations on this instance.
- Span<char> GetAppendBuffer(size_t size);
-
- // Returns a span referencing potentially unused capacity in the first node.
- // This function is identical to GetAppendBuffer except that it returns a span
- // referencing up to `size` capacity directly before the existing data.
- Span<char> GetPrependBuffer(size_t size);
-
- // Returns a cord ring buffer containing `len` bytes of data starting at
- // `offset`. If the input is not shared, this function will remove all head
- // and tail child nodes outside of the requested range, and adjust the new
- // head and tail nodes as required. If the input is shared, this function
- // returns a new instance sharing some or all of the nodes from the input.
- static CordRepRing* SubRing(CordRepRing* r, size_t offset, size_t len,
- size_t extra = 0);
-
- // Returns a cord ring buffer with the first `len` bytes removed.
- // If the input is not shared, this function will remove all head child nodes
- // fully inside the first `length` bytes, and adjust the new head as required.
- // If the input is shared, this function returns a new instance sharing some
- // or all of the nodes from the input.
- static CordRepRing* RemoveSuffix(CordRepRing* r, size_t len,
- size_t extra = 0);
-
- // Returns a cord ring buffer with the last `len` bytes removed.
- // If the input is not shared, this function will remove all head child nodes
- // fully inside the first `length` bytes, and adjust the new head as required.
- // If the input is shared, this function returns a new instance sharing some
- // or all of the nodes from the input.
- static CordRepRing* RemovePrefix(CordRepRing* r, size_t len,
- size_t extra = 0);
-
- // Returns the character at `offset`. Requires that `offset < length`.
- char GetCharacter(size_t offset) const;
-
- // Returns true if this instance manages a single contiguous buffer, in which
- // case the (optional) output parameter `fragment` is set. Otherwise, the
- // function returns false, and `fragment` is left unchanged.
- bool IsFlat(y_absl::string_view* fragment) const;
-
- // Returns true if the data starting at `offset` with length `len` is
- // managed by this instance inside a single contiguous buffer, in which case
- // the (optional) output parameter `fragment` is set to the contiguous memory
- // starting at offset `offset` with length `length`. Otherwise, the function
- // returns false, and `fragment` is left unchanged.
- bool IsFlat(size_t offset, size_t len, y_absl::string_view* fragment) const;
-
- // Testing only: set capacity to requested capacity.
- void SetCapacityForTesting(size_t capacity);
-
- // Returns the CordRep data pointer for the provided CordRep.
- // Requires that the provided `rep` is either a FLAT or EXTERNAL CordRep.
- static const char* GetLeafData(const CordRep* rep);
-
- // Returns the CordRep data pointer for the provided CordRep.
- // Requires that `rep` is either a FLAT, EXTERNAL, or SUBSTRING CordRep.
- static const char* GetRepData(const CordRep* rep);
-
- // Advances the provided position, wrapping around capacity as needed.
- // Requires `index` < capacity()
- inline index_type advance(index_type index) const;
-
- // Advances the provided position by 'n`, wrapping around capacity as needed.
- // Requires `index` < capacity() and `n` <= capacity.
- inline index_type advance(index_type index, index_type n) const;
-
- // Retreats the provided position, wrapping around 0 as needed.
- // Requires `index` < capacity()
- inline index_type retreat(index_type index) const;
-
- // Retreats the provided position by 'n', wrapping around 0 as needed.
- // Requires `index` < capacity()
- inline index_type retreat(index_type index, index_type n) const;
-
- // Returns the logical begin position of entry `index`
- pos_type const& entry_begin_pos(index_type index) const {
- return (index == head_) ? begin_pos_ : entry_end_pos(retreat(index));
- }
-
- // Returns the physical start offset of entry `index`
- size_t entry_start_offset(index_type index) const {
- return Distance(begin_pos_, entry_begin_pos(index));
- }
-
- // Returns the physical end offset of entry `index`
- size_t entry_end_offset(index_type index) const {
- return Distance(begin_pos_, entry_end_pos(index));
- }
-
- // Returns the data length for entry `index`
- size_t entry_length(index_type index) const {
- return Distance(entry_begin_pos(index), entry_end_pos(index));
- }
-
- // Returns the data for entry `index`
- y_absl::string_view entry_data(index_type index) const;
-
- // Returns the position for `offset` as {index, prefix}. `index` holds the
- // index of the entry at the specified offset and `prefix` holds the relative
- // offset inside that entry.
- // Requires `offset` < length.
- //
- // For example we can implement GetCharacter(offset) as:
- // char GetCharacter(size_t offset) {
- // Position pos = this->Find(offset);
- // return this->entry_data(pos.pos)[pos.offset];
- // }
- inline Position Find(size_t offset) const;
-
- // Find starting at `head`
- inline Position Find(index_type head, size_t offset) const;
-
- // Returns the tail position for `offset` as {tail index, suffix}.
- // `tail index` holds holds the index of the entry holding the offset directly
- // before 'offset` advanced by one. 'suffix` holds the relative offset from
- // that relative offset in the entry to the end of the entry.
- // For example, FindTail(length) will return {tail(), 0}, FindTail(length - 5)
- // will return {retreat(tail), 5)} provided the preceding entry contains at
- // least 5 bytes of data.
- // Requires offset >= 1 && offset <= length.
- //
- // This function is very useful in functions that need to clip the end of some
- // ring buffer such as 'RemovePrefix'.
- // For example, we could implement RemovePrefix for non shared instances as:
- // void RemoveSuffix(size_t n) {
- // Position pos = FindTail(length - n);
- // UnrefEntries(pos.pos, this->tail_);
- // this->tail_ = pos.pos;
- // entry(retreat(pos.pos)).end_pos -= pos.offset;
- // }
- inline Position FindTail(size_t offset) const;
-
- // Find tail starting at `head`
- inline Position FindTail(index_type head, size_t offset) const;
-
- // Invokes f(index_type index) for each entry inside the range [head, tail>
- template <typename F>
- void ForEach(index_type head, index_type tail, F&& f) const {
- index_type n1 = (tail > head) ? tail : capacity_;
- for (index_type i = head; i < n1; ++i) f(i);
- if (tail <= head) {
- for (index_type i = 0; i < tail; ++i) f(i);
- }
- }
-
- // Invokes f(index_type index) for each entry inside this instance.
- template <typename F>
- void ForEach(F&& f) const {
- ForEach(head_, tail_, std::forward<F>(f));
- }
-
- // Dump this instance's data tp stream `s` in human readable format, excluding
- // the actual data content itself. Intended for debug purposes only.
- friend std::ostream& operator<<(std::ostream& s, const CordRepRing& rep);
-
- private:
- enum class AddMode { kAppend, kPrepend };
-
- using Layout = container_internal::Layout<pos_type, CordRep*, offset_type>;
-
- class Filler;
- class Transaction;
- class CreateTransaction;
-
- static constexpr size_t kLayoutAlignment = Layout::Partial().Alignment();
-
- // Creates a new CordRepRing.
- explicit CordRepRing(index_type capacity) : capacity_(capacity) {}
-
- // Returns true if `index` is a valid index into this instance.
- bool IsValidIndex(index_type index) const;
-
- // Debug use only: validates the provided CordRepRing invariants.
- // Verification of all CordRepRing methods can be enabled by defining
- // EXTRA_CORD_RING_VALIDATION, i.e.: `--copts=-DEXTRA_CORD_RING_VALIDATION`
- // Verification is VERY expensive, so only do it for debugging purposes.
- static CordRepRing* Validate(CordRepRing* rep, const char* file = nullptr,
- int line = 0);
-
- // Allocates a CordRepRing large enough to hold `capacity + extra' entries.
- // The returned capacity may be larger if the allocated memory allows for it.
- // The maximum capacity of a CordRepRing is capped at kMaxCapacity.
- // Throws `std::length_error` if `capacity + extra' exceeds kMaxCapacity.
- static CordRepRing* New(size_t capacity, size_t extra);
-
- // Deallocates (but does not destroy) the provided ring buffer.
- static void Delete(CordRepRing* rep);
-
- // Destroys the provided ring buffer, decrementing the reference count of all
- // contained child CordReps. The provided 1\`rep` should have a ref count of
- // one (pre decrement destroy call observing `refcount.IsOne()`) or zero
- // (post decrement destroy call observing `!refcount.Decrement()`).
- static void Destroy(CordRepRing* rep);
-
- // Returns a mutable reference to the logical end position array.
- pos_type* entry_end_pos() {
- return Layout::Partial().Pointer<0>(data_);
- }
-
- // Returns a mutable reference to the child pointer array.
- CordRep** entry_child() {
- return Layout::Partial(capacity()).Pointer<1>(data_);
- }
-
- // Returns a mutable reference to the data offset array.
- offset_type* entry_data_offset() {
- return Layout::Partial(capacity(), capacity()).Pointer<2>(data_);
- }
-
- // Find implementations for the non fast path 0 / length cases.
- Position FindSlow(index_type head, size_t offset) const;
- Position FindTailSlow(index_type head, size_t offset) const;
-
- // Finds the index of the first node that is inside a reasonable distance
- // of the node at `offset` from which we can continue with a linear search.
- template <bool wrap>
- index_type FindBinary(index_type head, index_type tail, size_t offset) const;
-
- // Fills the current (initialized) instance from the provided source, copying
- // entries [head, tail). Adds a reference to copied entries if `ref` is true.
- template <bool ref>
- void Fill(const CordRepRing* src, index_type head, index_type tail);
-
- // Create a copy of 'rep', copying all entries [head, tail), allocating room
- // for `extra` entries. Adds a reference on all copied entries.
- static CordRepRing* Copy(CordRepRing* rep, index_type head, index_type tail,
- size_t extra = 0);
-
- // Returns a Mutable CordRepRing reference from `rep` with room for at least
- // `extra` additional nodes. Adopts a reference count from `rep`.
- // This function will return `rep` if, and only if:
- // - rep.entries + extra <= rep.capacity
- // - rep.refcount == 1
- // Otherwise, this function will create a new copy of `rep` with additional
- // capacity to satisfy `extra` extra nodes, and unref the old `rep` instance.
- //
- // If a new CordRepRing can not be allocated, or the new capacity would exceed
- // the maximum capacity, then the input is consumed only, and an exception is
- // thrown.
- static CordRepRing* Mutable(CordRepRing* rep, size_t extra);
-
- // Slow path for Append(CordRepRing* rep, CordRep* child). This function is
- // exercised if the provided `child` in Append() is not a leaf node, i.e., a
- // ring buffer or old (concat) cord tree.
- static CordRepRing* AppendSlow(CordRepRing* rep, CordRep* child);
-
- // Appends the provided leaf node. Requires `child` to be FLAT or EXTERNAL.
- static CordRepRing* AppendLeaf(CordRepRing* rep, CordRep* child,
- size_t offset, size_t length);
-
- // Prepends the provided leaf node. Requires `child` to be FLAT or EXTERNAL.
- static CordRepRing* PrependLeaf(CordRepRing* rep, CordRep* child,
- size_t offset, size_t length);
-
- // Slow path for Prepend(CordRepRing* rep, CordRep* child). This function is
- // exercised if the provided `child` in Prepend() is not a leaf node, i.e., a
- // ring buffer or old (concat) cord tree.
- static CordRepRing* PrependSlow(CordRepRing* rep, CordRep* child);
-
- // Slow path for Create(CordRep* child, size_t extra). This function is
- // exercised if the provided `child` in Prepend() is not a leaf node, i.e., a
- // ring buffer or old (concat) cord tree.
- static CordRepRing* CreateSlow(CordRep* child, size_t extra);
-
- // Creates a new ring buffer from the provided `child` leaf node. Requires
- // `child` to be FLAT or EXTERNAL. on `rep`.
- // The returned ring buffer has a capacity of at least `1 + extra`
- static CordRepRing* CreateFromLeaf(CordRep* child, size_t offset,
- size_t length, size_t extra);
-
- // Appends or prepends (depending on AddMode) the ring buffer in `ring' to
- // `rep` starting at `offset` with length `len`.
- template <AddMode mode>
- static CordRepRing* AddRing(CordRepRing* rep, CordRepRing* ring,
- size_t offset, size_t len);
-
- // Increases the data offset for entry `index` by `n`.
- void AddDataOffset(index_type index, size_t n);
-
- // Decreases the length for entry `index` by `n`.
- void SubLength(index_type index, size_t n);
-
- index_type head_;
- index_type tail_;
- index_type capacity_;
- pos_type begin_pos_;
-
- alignas(kLayoutAlignment) char data_[kLayoutAlignment];
-
- friend struct CordRep;
-};
-
-constexpr size_t CordRepRing::AllocSize(size_t capacity) {
- return sizeof(CordRepRing) - sizeof(data_) +
- Layout(capacity, capacity, capacity).AllocSize();
-}
-
-inline constexpr size_t CordRepRing::Distance(pos_type pos, pos_type end_pos) {
- return (end_pos - pos);
-}
-
-inline const char* CordRepRing::GetLeafData(const CordRep* rep) {
- return rep->tag != EXTERNAL ? rep->flat()->Data() : rep->external()->base;
-}
-
-inline const char* CordRepRing::GetRepData(const CordRep* rep) {
- if (rep->tag >= FLAT) return rep->flat()->Data();
- if (rep->tag == EXTERNAL) return rep->external()->base;
- return GetLeafData(rep->substring()->child) + rep->substring()->start;
-}
-
-inline CordRepRing::index_type CordRepRing::advance(index_type index) const {
- assert(index < capacity_);
- return ++index == capacity_ ? 0 : index;
-}
-
-inline CordRepRing::index_type CordRepRing::advance(index_type index,
- index_type n) const {
- assert(index < capacity_ && n <= capacity_);
- return (index += n) >= capacity_ ? index - capacity_ : index;
-}
-
-inline CordRepRing::index_type CordRepRing::retreat(index_type index) const {
- assert(index < capacity_);
- return (index > 0 ? index : capacity_) - 1;
-}
-
-inline CordRepRing::index_type CordRepRing::retreat(index_type index,
- index_type n) const {
- assert(index < capacity_ && n <= capacity_);
- return index >= n ? index - n : capacity_ - n + index;
-}
-
-inline y_absl::string_view CordRepRing::entry_data(index_type index) const {
- size_t data_offset = entry_data_offset(index);
- return {GetRepData(entry_child(index)) + data_offset, entry_length(index)};
-}
-
-inline bool CordRepRing::IsValidIndex(index_type index) const {
- if (index >= capacity_) return false;
- return (tail_ > head_) ? (index >= head_ && index < tail_)
- : (index >= head_ || index < tail_);
-}
-
-#ifndef EXTRA_CORD_RING_VALIDATION
-inline CordRepRing* CordRepRing::Validate(CordRepRing* rep,
- const char* /*file*/, int /*line*/) {
- return rep;
-}
-#endif
-
-inline CordRepRing::Position CordRepRing::Find(size_t offset) const {
- assert(offset < length);
- return (offset == 0) ? Position{head_, 0} : FindSlow(head_, offset);
-}
-
-inline CordRepRing::Position CordRepRing::Find(index_type head,
- size_t offset) const {
- assert(offset < length);
- assert(IsValidIndex(head) && offset >= entry_start_offset(head));
- return (offset == 0) ? Position{head_, 0} : FindSlow(head, offset);
-}
-
-inline CordRepRing::Position CordRepRing::FindTail(size_t offset) const {
- assert(offset > 0 && offset <= length);
- return (offset == length) ? Position{tail_, 0} : FindTailSlow(head_, offset);
-}
-
-inline CordRepRing::Position CordRepRing::FindTail(index_type head,
- size_t offset) const {
- assert(offset > 0 && offset <= length);
- assert(IsValidIndex(head) && offset >= entry_start_offset(head) + 1);
- return (offset == length) ? Position{tail_, 0} : FindTailSlow(head, offset);
-}
-
-// Now that CordRepRing is defined, we can define CordRep's helper casts:
-inline CordRepRing* CordRep::ring() {
- assert(IsRing());
- return static_cast<CordRepRing*>(this);
-}
-
-inline const CordRepRing* CordRep::ring() const {
- assert(IsRing());
- return static_cast<const CordRepRing*>(this);
-}
-
-inline bool CordRepRing::IsFlat(y_absl::string_view* fragment) const {
- if (entries() == 1) {
- if (fragment) *fragment = entry_data(head());
- return true;
- }
- return false;
-}
-
-inline bool CordRepRing::IsFlat(size_t offset, size_t len,
- y_absl::string_view* fragment) const {
- const Position pos = Find(offset);
- const y_absl::string_view data = entry_data(pos.index);
- if (data.length() >= len && data.length() - len >= pos.offset) {
- if (fragment) *fragment = data.substr(pos.offset, len);
- return true;
- }
- return false;
-}
-
-std::ostream& operator<<(std::ostream& s, const CordRepRing& rep);
-
-} // namespace cord_internal
-Y_ABSL_NAMESPACE_END
-} // namespace y_absl
-
-#endif // Y_ABSL_STRINGS_INTERNAL_CORD_REP_RING_H_
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_info.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_info.cc
index 4e39a98f4a4..6c3c0e6c22b 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_info.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_info.cc
@@ -21,7 +21,6 @@
#include "y_absl/strings/internal/cord_internal.h"
#include "y_absl/strings/internal/cord_rep_btree.h"
#include "y_absl/strings/internal/cord_rep_crc.h"
-#include "y_absl/strings/internal/cord_rep_ring.h"
#include "y_absl/strings/internal/cordz_handle.h"
#include "y_absl/strings/internal/cordz_statistics.h"
#include "y_absl/strings/internal/cordz_update_tracker.h"
@@ -33,8 +32,6 @@ namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
namespace cord_internal {
-using ::y_absl::base_internal::SpinLockHolder;
-
#ifdef Y_ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL
constexpr size_t CordzInfo::kMaxStackDepth;
#endif
@@ -79,6 +76,8 @@ class CordRepAnalyzer {
// adds the results to `statistics`. Note that node counts and memory sizes
// are not initialized, computed values are added to any existing values.
void AnalyzeCordRep(const CordRep* rep) {
+ Y_ABSL_ASSERT(rep != nullptr);
+
// Process all linear nodes.
// As per the class comments, use refcout - 1 on the top level node, as the
// top level node is assumed to be referenced only for analysis purposes.
@@ -86,7 +85,7 @@ class CordRepAnalyzer {
RepRef repref{rep, (refcount > 1) ? refcount - 1 : 1};
// Process the top level CRC node, if present.
- if (repref.rep->tag == CRC) {
+ if (repref.tag() == CRC) {
statistics_.node_count++;
statistics_.node_counts.crc++;
memory_usage_.Add(sizeof(CordRepCrc), repref.refcount);
@@ -96,15 +95,14 @@ class CordRepAnalyzer {
// Process all top level linear nodes (substrings and flats).
repref = CountLinearReps(repref, memory_usage_);
- if (repref.rep != nullptr) {
- if (repref.rep->tag == RING) {
- AnalyzeRing(repref);
- } else if (repref.rep->tag == BTREE) {
+ switch (repref.tag()) {
+ case CordRepKind::BTREE:
AnalyzeBtree(repref);
- } else {
- // We should have either a concat, btree, or ring node if not null.
- assert(false);
- }
+ break;
+ default:
+ // We should have a btree node if not null.
+ Y_ABSL_ASSERT(repref.tag() == CordRepKind::UNUSED_0);
+ break;
}
// Adds values to output
@@ -122,11 +120,19 @@ class CordRepAnalyzer {
const CordRep* rep;
size_t refcount;
- // Returns a 'child' RepRef which contains the cumulative reference count of
- // this instance multiplied by the child's reference count.
+ // Returns a 'child' RepRef which contains the cumulative reference count
+ // of this instance multiplied by the child's reference count. Returns a
+ // nullptr RepRef value with a refcount of 0 if `child` is nullptr.
RepRef Child(const CordRep* child) const {
+ if (child == nullptr) return RepRef{nullptr, 0};
return RepRef{child, refcount * child->refcount.Get()};
}
+
+ // Returns the tag of this rep, or UNUSED_0 if this instance is null
+ constexpr CordRepKind tag() const {
+ Y_ABSL_ASSERT(rep == nullptr || rep->tag != CordRepKind::UNUSED_0);
+ return rep ? static_cast<CordRepKind>(rep->tag) : CordRepKind::UNUSED_0;
+ }
};
// Memory usage values
@@ -167,7 +173,7 @@ class CordRepAnalyzer {
// buffers where we count children unrounded.
RepRef CountLinearReps(RepRef rep, MemoryUsage& memory_usage) {
// Consume all substrings
- while (rep.rep->tag == SUBSTRING) {
+ while (rep.tag() == SUBSTRING) {
statistics_.node_count++;
statistics_.node_counts.substring++;
memory_usage.Add(sizeof(CordRepSubstring), rep.refcount);
@@ -175,7 +181,7 @@ class CordRepAnalyzer {
}
// Consume possible FLAT
- if (rep.rep->tag >= FLAT) {
+ if (rep.tag() >= FLAT) {
size_t size = rep.rep->flat()->AllocatedSize();
CountFlat(size);
memory_usage.Add(size, rep.refcount);
@@ -183,7 +189,7 @@ class CordRepAnalyzer {
}
// Consume possible external
- if (rep.rep->tag == EXTERNAL) {
+ if (rep.tag() == EXTERNAL) {
statistics_.node_count++;
statistics_.node_counts.external++;
size_t size = rep.rep->length + sizeof(CordRepExternalImpl<intptr_t>);
@@ -194,17 +200,6 @@ class CordRepAnalyzer {
return rep;
}
- // Analyzes the provided ring.
- void AnalyzeRing(RepRef rep) {
- statistics_.node_count++;
- statistics_.node_counts.ring++;
- const CordRepRing* ring = rep.rep->ring();
- memory_usage_.Add(CordRepRing::AllocSize(ring->capacity()), rep.refcount);
- ring->ForEach([&](CordRepRing::index_type pos) {
- CountLinearReps(rep.Child(ring->entry_child(pos)), memory_usage_);
- });
- }
-
// Analyzes the provided btree.
void AnalyzeBtree(RepRef rep) {
statistics_.node_count++;
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/has_absl_stringify.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/has_absl_stringify.h
deleted file mode 100644
index bf0b91d8a98..00000000000
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/has_absl_stringify.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2022 The Abseil Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef Y_ABSL_STRINGS_INTERNAL_HAS_ABSL_STRINGIFY_H_
-#define Y_ABSL_STRINGS_INTERNAL_HAS_ABSL_STRINGIFY_H_
-#include <util/generic/string.h>
-#include <type_traits>
-#include <utility>
-
-#include "y_absl/strings/string_view.h"
-
-namespace y_absl {
-Y_ABSL_NAMESPACE_BEGIN
-
-namespace strings_internal {
-
-// This is an empty class not intended to be used. It exists so that
-// `HasAbslStringify` can reference a universal class rather than needing to be
-// copied for each new sink.
-class UnimplementedSink {
- public:
- void Append(size_t count, char ch);
-
- void Append(string_view v);
-
- // Support `y_absl::Format(&sink, format, args...)`.
- friend void AbslFormatFlush(UnimplementedSink* sink, y_absl::string_view v);
-};
-
-template <typename T, typename = void>
-struct HasAbslStringify : std::false_type {};
-
-template <typename T>
-struct HasAbslStringify<
- T, std::enable_if_t<std::is_void<decltype(AbslStringify(
- std::declval<strings_internal::UnimplementedSink&>(),
- std::declval<const T&>()))>::value>> : std::true_type {};
-
-} // namespace strings_internal
-
-Y_ABSL_NAMESPACE_END
-} // namespace y_absl
-
-#endif // Y_ABSL_STRINGS_INTERNAL_HAS_ABSL_STRINGIFY_H_
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/memutil.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/memutil.cc
index 5b30b22ee16..92850083010 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/memutil.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/memutil.cc
@@ -27,10 +27,18 @@ int memcasecmp(const char* s1, const char* s2, size_t len) {
const unsigned char* us2 = reinterpret_cast<const unsigned char*>(s2);
for (size_t i = 0; i < len; i++) {
- const int diff =
- int{static_cast<unsigned char>(y_absl::ascii_tolower(us1[i]))} -
- int{static_cast<unsigned char>(y_absl::ascii_tolower(us2[i]))};
- if (diff != 0) return diff;
+ unsigned char c1 = us1[i];
+ unsigned char c2 = us2[i];
+ // If bytes are the same, they will be the same when converted to lower.
+ // So we only need to convert if bytes are not equal.
+ // NOTE(b/308193381): We do not use `y_absl::ascii_tolower` here in order
+ // to avoid its lookup table and improve performance.
+ if (c1 != c2) {
+ c1 = c1 >= 'A' && c1 <= 'Z' ? c1 - 'A' + 'a' : c1;
+ c2 = c2 >= 'A' && c2 <= 'Z' ? c2 - 'A' + 'a' : c2;
+ const int diff = int{c1} - int{c2};
+ if (diff != 0) return diff;
+ }
}
return 0;
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/arg.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/arg.cc
index b28eb4cbf92..b1548bbb92a 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/arg.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/arg.cc
@@ -18,15 +18,28 @@
//
#include "y_absl/strings/internal/str_format/arg.h"
+#include <algorithm>
#include <cassert>
-#include <cerrno>
+#include <cstddef>
+#include <cstdint>
#include <cstdlib>
+#include <cstring>
+#include <cwchar>
#include <util/generic/string.h>
#include <type_traits>
-#include "y_absl/base/port.h"
+#include "y_absl/base/config.h"
+#include "y_absl/base/optimization.h"
+#include "y_absl/container/fixed_array.h"
+#include "y_absl/numeric/int128.h"
+#include "y_absl/strings/internal/str_format/extension.h"
#include "y_absl/strings/internal/str_format/float_conversion.h"
#include "y_absl/strings/numbers.h"
+#include "y_absl/strings/string_view.h"
+
+#if defined(Y_ABSL_HAVE_STD_STRING_VIEW)
+#include <string_view>
+#endif
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
@@ -298,6 +311,83 @@ inline bool ConvertStringArg(string_view v, const FormatConversionSpecImpl conv,
conv.has_left_flag());
}
+struct ShiftState {
+ bool saw_high_surrogate = false;
+ uint8_t bits = 0;
+};
+
+// Converts `v` from UTF-16 or UTF-32 to UTF-8 and writes to `buf`. `buf` is
+// assumed to have enough space for the output. `s` is used to carry state
+// between successive calls with a UTF-16 surrogate pair. Returns the number of
+// chars written, or `static_cast<size_t>(-1)` on failure.
+//
+// This is basically std::wcrtomb(), but always outputting UTF-8 instead of
+// respecting the current locale.
+inline size_t WideToUtf8(wchar_t wc, char *buf, ShiftState &s) {
+ const auto v = static_cast<uint32_t>(wc);
+ if (v < 0x80) {
+ *buf = static_cast<char>(v);
+ return 1;
+ } else if (v < 0x800) {
+ *buf++ = static_cast<char>(0xc0 | (v >> 6));
+ *buf = static_cast<char>(0x80 | (v & 0x3f));
+ return 2;
+ } else if (v < 0xd800 || (v - 0xe000) < 0x2000) {
+ *buf++ = static_cast<char>(0xe0 | (v >> 12));
+ *buf++ = static_cast<char>(0x80 | ((v >> 6) & 0x3f));
+ *buf = static_cast<char>(0x80 | (v & 0x3f));
+ return 3;
+ } else if ((v - 0x10000) < 0x100000) {
+ *buf++ = static_cast<char>(0xf0 | (v >> 18));
+ *buf++ = static_cast<char>(0x80 | ((v >> 12) & 0x3f));
+ *buf++ = static_cast<char>(0x80 | ((v >> 6) & 0x3f));
+ *buf = static_cast<char>(0x80 | (v & 0x3f));
+ return 4;
+ } else if (v < 0xdc00) {
+ s.saw_high_surrogate = true;
+ s.bits = static_cast<uint8_t>(v & 0x3);
+ const uint8_t high_bits = ((v >> 6) & 0xf) + 1;
+ *buf++ = static_cast<char>(0xf0 | (high_bits >> 2));
+ *buf =
+ static_cast<char>(0x80 | static_cast<uint8_t>((high_bits & 0x3) << 4) |
+ static_cast<uint8_t>((v >> 2) & 0xf));
+ return 2;
+ } else if (v < 0xe000 && s.saw_high_surrogate) {
+ *buf++ = static_cast<char>(0x80 | static_cast<uint8_t>(s.bits << 4) |
+ static_cast<uint8_t>((v >> 6) & 0xf));
+ *buf = static_cast<char>(0x80 | (v & 0x3f));
+ s.saw_high_surrogate = false;
+ s.bits = 0;
+ return 2;
+ } else {
+ return static_cast<size_t>(-1);
+ }
+}
+
+inline bool ConvertStringArg(const wchar_t *v,
+ size_t len,
+ const FormatConversionSpecImpl conv,
+ FormatSinkImpl *sink) {
+ FixedArray<char> mb(len * 4);
+ ShiftState s;
+ size_t chars_written = 0;
+ for (size_t i = 0; i < len; ++i) {
+ const size_t chars = WideToUtf8(v[i], &mb[chars_written], s);
+ if (chars == static_cast<size_t>(-1)) { return false; }
+ chars_written += chars;
+ }
+ return ConvertStringArg(string_view(mb.data(), chars_written), conv, sink);
+}
+
+bool ConvertWCharTImpl(wchar_t v, const FormatConversionSpecImpl conv,
+ FormatSinkImpl *sink) {
+ char mb[4];
+ ShiftState s;
+ const size_t chars_written = WideToUtf8(v, mb, s);
+ return chars_written != static_cast<size_t>(-1) && !s.saw_high_surrogate &&
+ ConvertStringArg(string_view(mb, chars_written), conv, sink);
+}
+
} // namespace
bool ConvertBoolArg(bool v, FormatSinkImpl *sink) {
@@ -316,11 +406,14 @@ bool ConvertIntArg(T v, FormatConversionSpecImpl conv, FormatSinkImpl *sink) {
// This odd casting is due to a bug in -Wswitch behavior in gcc49 which causes
// it to complain about a switch/case type mismatch, even though both are
- // FormatConverionChar. Likely this is because at this point
+ // FormatConversionChar. Likely this is because at this point
// FormatConversionChar is declared, but not defined.
switch (static_cast<uint8_t>(conv.conversion_char())) {
case static_cast<uint8_t>(FormatConversionCharInternal::c):
- return ConvertCharImpl(static_cast<char>(v), conv, sink);
+ return (std::is_same<T, wchar_t>::value ||
+ (conv.length_mod() == LengthMod::l))
+ ? ConvertWCharTImpl(static_cast<wchar_t>(v), conv, sink)
+ : ConvertCharImpl(static_cast<char>(v), conv, sink);
case static_cast<uint8_t>(FormatConversionCharInternal::o):
as_digits.PrintAsOct(static_cast<U>(v));
@@ -372,6 +465,8 @@ template bool ConvertIntArg<signed char>(signed char v,
template bool ConvertIntArg<unsigned char>(unsigned char v,
FormatConversionSpecImpl conv,
FormatSinkImpl *sink);
+template bool ConvertIntArg<wchar_t>(wchar_t v, FormatConversionSpecImpl conv,
+ FormatSinkImpl *sink);
template bool ConvertIntArg<short>(short v, // NOLINT
FormatConversionSpecImpl conv,
FormatSinkImpl *sink);
@@ -403,16 +498,29 @@ StringConvertResult FormatConvertImpl(const TString &v,
return {ConvertStringArg(v, conv, sink)};
}
+StringConvertResult FormatConvertImpl(const std::wstring &v,
+ const FormatConversionSpecImpl conv,
+ FormatSinkImpl *sink) {
+ return {ConvertStringArg(v.data(), v.size(), conv, sink)};
+}
+
StringConvertResult FormatConvertImpl(string_view v,
const FormatConversionSpecImpl conv,
FormatSinkImpl *sink) {
return {ConvertStringArg(v, conv, sink)};
}
-ArgConvertResult<FormatConversionCharSetUnion(
- FormatConversionCharSetInternal::s, FormatConversionCharSetInternal::p)>
-FormatConvertImpl(const char *v, const FormatConversionSpecImpl conv,
- FormatSinkImpl *sink) {
+#if defined(Y_ABSL_HAVE_STD_STRING_VIEW)
+StringConvertResult FormatConvertImpl(std::wstring_view v,
+ const FormatConversionSpecImpl conv,
+ FormatSinkImpl* sink) {
+ return {ConvertStringArg(v.data(), v.size(), conv, sink)};
+}
+#endif
+
+StringPtrConvertResult FormatConvertImpl(const char* v,
+ const FormatConversionSpecImpl conv,
+ FormatSinkImpl* sink) {
if (conv.conversion_char() == FormatConversionCharInternal::p)
return {FormatConvertImpl(VoidPtr(v), conv, sink).value};
size_t len;
@@ -427,6 +535,30 @@ FormatConvertImpl(const char *v, const FormatConversionSpecImpl conv,
return {ConvertStringArg(string_view(v, len), conv, sink)};
}
+StringPtrConvertResult FormatConvertImpl(const wchar_t* v,
+ const FormatConversionSpecImpl conv,
+ FormatSinkImpl* sink) {
+ if (conv.conversion_char() == FormatConversionCharInternal::p) {
+ return {FormatConvertImpl(VoidPtr(v), conv, sink).value};
+ }
+ size_t len;
+ if (v == nullptr) {
+ len = 0;
+ } else if (conv.precision() < 0) {
+ len = std::wcslen(v);
+ } else {
+ // If precision is set, we look for the NUL-terminator on the valid range.
+ len = static_cast<size_t>(std::find(v, v + conv.precision(), L'\0') - v);
+ }
+ return {ConvertStringArg(v, len, conv, sink)};
+}
+
+StringPtrConvertResult FormatConvertImpl(std::nullptr_t,
+ const FormatConversionSpecImpl conv,
+ FormatSinkImpl* sink) {
+ return FormatConvertImpl(static_cast<const char*>(nullptr), conv, sink);
+}
+
// ==================== Raw pointers ====================
ArgConvertResult<FormatConversionCharSetInternal::p> FormatConvertImpl(
VoidPtr v, const FormatConversionSpecImpl conv, FormatSinkImpl *sink) {
@@ -461,6 +593,11 @@ CharConvertResult FormatConvertImpl(char v, const FormatConversionSpecImpl conv,
FormatSinkImpl *sink) {
return {ConvertIntArg(v, conv, sink)};
}
+CharConvertResult FormatConvertImpl(wchar_t v,
+ const FormatConversionSpecImpl conv,
+ FormatSinkImpl* sink) {
+ return {ConvertIntArg(v, conv, sink)};
+}
// ==================== Ints ====================
IntegralConvertResult FormatConvertImpl(signed char v,
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/arg.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/arg.h
index 5eb9c7fd243..d75bd4b8bbd 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/arg.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/arg.h
@@ -19,8 +19,9 @@
#include <wchar.h>
#include <algorithm>
+#include <cstddef>
+#include <cstdint>
#include <cstdio>
-#include <iomanip>
#include <limits>
#include <memory>
#include <sstream>
@@ -29,13 +30,18 @@
#include <type_traits>
#include <utility>
-#include "y_absl/base/port.h"
+#include "y_absl/base/config.h"
+#include "y_absl/base/optimization.h"
#include "y_absl/meta/type_traits.h"
#include "y_absl/numeric/int128.h"
-#include "y_absl/strings/internal/has_absl_stringify.h"
+#include "y_absl/strings/has_absl_stringify.h"
#include "y_absl/strings/internal/str_format/extension.h"
#include "y_absl/strings/string_view.h"
+#if defined(Y_ABSL_HAVE_STD_STRING_VIEW)
+#include <string_view>
+#endif
+
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
@@ -98,6 +104,9 @@ extern template bool ConvertIntArg<signed char>(signed char v,
extern template bool ConvertIntArg<unsigned char>(unsigned char v,
FormatConversionSpecImpl conv,
FormatSinkImpl* sink);
+extern template bool ConvertIntArg<wchar_t>(wchar_t v,
+ FormatConversionSpecImpl conv,
+ FormatSinkImpl* sink);
extern template bool ConvertIntArg<short>(short v, // NOLINT
FormatConversionSpecImpl conv,
FormatSinkImpl* sink);
@@ -159,6 +168,7 @@ template <typename T>
auto FormatConvertImpl(const T& v, FormatConversionSpecImpl,
FormatSinkImpl* sink)
-> std::enable_if_t<!std::is_enum<T>::value &&
+ !std::is_same<T, y_absl::Cord>::value &&
std::is_void<decltype(AbslStringify(
std::declval<FormatSink&>(), v))>::value,
ArgConvertResult<FormatConversionCharSetInternal::v>> {
@@ -203,30 +213,49 @@ constexpr FormatConversionCharSet ExtractCharSet(ArgConvertResult<C>) {
return C;
}
-using StringConvertResult = ArgConvertResult<FormatConversionCharSetUnion(
- FormatConversionCharSetInternal::s, FormatConversionCharSetInternal::v)>;
ArgConvertResult<FormatConversionCharSetInternal::p> FormatConvertImpl(
VoidPtr v, FormatConversionSpecImpl conv, FormatSinkImpl* sink);
// Strings.
+using StringConvertResult = ArgConvertResult<FormatConversionCharSetUnion(
+ FormatConversionCharSetInternal::s,
+ FormatConversionCharSetInternal::v)>;
StringConvertResult FormatConvertImpl(const TString& v,
FormatConversionSpecImpl conv,
FormatSinkImpl* sink);
+StringConvertResult FormatConvertImpl(const std::wstring& v,
+ FormatConversionSpecImpl conv,
+ FormatSinkImpl* sink);
StringConvertResult FormatConvertImpl(string_view v,
FormatConversionSpecImpl conv,
FormatSinkImpl* sink);
-#if defined(Y_ABSL_HAVE_STD_STRING_VIEW) && !defined(Y_ABSL_USES_STD_STRING_VIEW)
+#if defined(Y_ABSL_HAVE_STD_STRING_VIEW)
+StringConvertResult FormatConvertImpl(std::wstring_view v,
+ FormatConversionSpecImpl conv,
+ FormatSinkImpl* sink);
+#if !defined(Y_ABSL_USES_STD_STRING_VIEW)
inline StringConvertResult FormatConvertImpl(std::string_view v,
FormatConversionSpecImpl conv,
FormatSinkImpl* sink) {
return FormatConvertImpl(y_absl::string_view(v.data(), v.size()), conv, sink);
}
-#endif // Y_ABSL_HAVE_STD_STRING_VIEW && !Y_ABSL_USES_STD_STRING_VIEW
-
-ArgConvertResult<FormatConversionCharSetUnion(
- FormatConversionCharSetInternal::s, FormatConversionCharSetInternal::p)>
-FormatConvertImpl(const char* v, const FormatConversionSpecImpl conv,
- FormatSinkImpl* sink);
+#endif // !Y_ABSL_USES_STD_STRING_VIEW
+#endif // Y_ABSL_HAVE_STD_STRING_VIEW
+
+using StringPtrConvertResult = ArgConvertResult<FormatConversionCharSetUnion(
+ FormatConversionCharSetInternal::s,
+ FormatConversionCharSetInternal::p)>;
+StringPtrConvertResult FormatConvertImpl(const char* v,
+ FormatConversionSpecImpl conv,
+ FormatSinkImpl* sink);
+StringPtrConvertResult FormatConvertImpl(const wchar_t* v,
+ FormatConversionSpecImpl conv,
+ FormatSinkImpl* sink);
+// This overload is needed to disambiguate, since `nullptr` could match either
+// of the other overloads equally well.
+StringPtrConvertResult FormatConvertImpl(std::nullptr_t,
+ FormatConversionSpecImpl conv,
+ FormatSinkImpl* sink);
template <class AbslCord, typename std::enable_if<std::is_same<
AbslCord, y_absl::Cord>::value>::type* = nullptr>
@@ -280,6 +309,9 @@ FloatingConvertResult FormatConvertImpl(long double v,
// Chars.
CharConvertResult FormatConvertImpl(char v, FormatConversionSpecImpl conv,
FormatSinkImpl* sink);
+CharConvertResult FormatConvertImpl(wchar_t v,
+ FormatConversionSpecImpl conv,
+ FormatSinkImpl* sink);
// Ints.
IntegralConvertResult FormatConvertImpl(signed char v,
@@ -334,7 +366,7 @@ IntegralConvertResult FormatConvertImpl(T v, FormatConversionSpecImpl conv,
template <typename T>
typename std::enable_if<std::is_enum<T>::value &&
!HasUserDefinedConvert<T>::value &&
- !strings_internal::HasAbslStringify<T>::value,
+ !HasAbslStringify<T>::value,
IntegralConvertResult>::type
FormatConvertImpl(T v, FormatConversionSpecImpl conv, FormatSinkImpl* sink);
@@ -442,6 +474,7 @@ class FormatArgImpl {
// Anything with a user-defined Convert will get its own vtable.
// For everything else:
// - Decay char* and char arrays into `const char*`
+ // - Decay wchar_t* and wchar_t arrays into `const wchar_t*`
// - Decay any other pointer to `const void*`
// - Decay all enums to the integral promotion of their underlying type.
// - Decay function pointers to void*.
@@ -449,20 +482,23 @@ class FormatArgImpl {
struct DecayType {
static constexpr bool kHasUserDefined =
str_format_internal::HasUserDefinedConvert<T>::value ||
- strings_internal::HasAbslStringify<T>::value;
+ HasAbslStringify<T>::value;
using type = typename std::conditional<
!kHasUserDefined && std::is_convertible<T, const char*>::value,
const char*,
- typename std::conditional<!kHasUserDefined &&
- std::is_convertible<T, VoidPtr>::value,
- VoidPtr, const T&>::type>::type;
+ typename std::conditional<
+ !kHasUserDefined && std::is_convertible<T, const wchar_t*>::value,
+ const wchar_t*,
+ typename std::conditional<
+ !kHasUserDefined && std::is_convertible<T, VoidPtr>::value,
+ VoidPtr,
+ const T&>::type>::type>::type;
};
template <typename T>
- struct DecayType<T,
- typename std::enable_if<
- !str_format_internal::HasUserDefinedConvert<T>::value &&
- !strings_internal::HasAbslStringify<T>::value &&
- std::is_enum<T>::value>::type> {
+ struct DecayType<
+ T, typename std::enable_if<
+ !str_format_internal::HasUserDefinedConvert<T>::value &&
+ !HasAbslStringify<T>::value && std::is_enum<T>::value>::type> {
using type = decltype(+typename std::underlying_type<T>::type());
};
@@ -587,7 +623,7 @@ class FormatArgImpl {
E template bool FormatArgImpl::Dispatch<T>(Data, FormatConversionSpecImpl, \
void*)
-#define Y_ABSL_INTERNAL_FORMAT_DISPATCH_OVERLOADS_EXPAND_(...) \
+#define Y_ABSL_INTERNAL_FORMAT_DISPATCH_OVERLOADS_EXPAND_NO_WSTRING_VIEW_(...) \
Y_ABSL_INTERNAL_FORMAT_DISPATCH_INSTANTIATE_(str_format_internal::VoidPtr, \
__VA_ARGS__); \
Y_ABSL_INTERNAL_FORMAT_DISPATCH_INSTANTIATE_(bool, __VA_ARGS__); \
@@ -613,7 +649,19 @@ class FormatArgImpl {
Y_ABSL_INTERNAL_FORMAT_DISPATCH_INSTANTIATE_(long double, __VA_ARGS__); \
Y_ABSL_INTERNAL_FORMAT_DISPATCH_INSTANTIATE_(const char*, __VA_ARGS__); \
Y_ABSL_INTERNAL_FORMAT_DISPATCH_INSTANTIATE_(TString, __VA_ARGS__); \
- Y_ABSL_INTERNAL_FORMAT_DISPATCH_INSTANTIATE_(string_view, __VA_ARGS__)
+ Y_ABSL_INTERNAL_FORMAT_DISPATCH_INSTANTIATE_(string_view, __VA_ARGS__); \
+ Y_ABSL_INTERNAL_FORMAT_DISPATCH_INSTANTIATE_(const wchar_t*, __VA_ARGS__); \
+ Y_ABSL_INTERNAL_FORMAT_DISPATCH_INSTANTIATE_(std::wstring, __VA_ARGS__)
+
+#if defined(Y_ABSL_HAVE_STD_STRING_VIEW)
+#define Y_ABSL_INTERNAL_FORMAT_DISPATCH_OVERLOADS_EXPAND_(...) \
+ Y_ABSL_INTERNAL_FORMAT_DISPATCH_OVERLOADS_EXPAND_NO_WSTRING_VIEW_( \
+ __VA_ARGS__); \
+ Y_ABSL_INTERNAL_FORMAT_DISPATCH_INSTANTIATE_(std::wstring_view, __VA_ARGS__)
+#else
+#define Y_ABSL_INTERNAL_FORMAT_DISPATCH_OVERLOADS_EXPAND_(...) \
+ Y_ABSL_INTERNAL_FORMAT_DISPATCH_OVERLOADS_EXPAND_NO_WSTRING_VIEW_(__VA_ARGS__)
+#endif
Y_ABSL_INTERNAL_FORMAT_DISPATCH_OVERLOADS_EXPAND_(extern);
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/bind.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/bind.cc
index 745bd12ab22..322f47b1608 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/bind.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/bind.cc
@@ -14,10 +14,24 @@
#include "y_absl/strings/internal/str_format/bind.h"
+#include <algorithm>
+#include <cassert>
#include <cerrno>
+#include <cstddef>
+#include <cstdio>
+#include <ios>
#include <limits>
+#include <ostream>
#include <sstream>
#include <util/generic/string.h>
+#include "y_absl/base/config.h"
+#include "y_absl/base/optimization.h"
+#include "y_absl/strings/internal/str_format/arg.h"
+#include "y_absl/strings/internal/str_format/constexpr_parser.h"
+#include "y_absl/strings/internal/str_format/extension.h"
+#include "y_absl/strings/internal/str_format/output.h"
+#include "y_absl/strings/string_view.h"
+#include "y_absl/types/span.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
@@ -90,6 +104,8 @@ inline bool ArgContext::Bind(const UnboundConversion* unbound,
} else {
FormatConversionSpecImplFriend::SetFlags(unbound->flags, bound);
}
+
+ FormatConversionSpecImplFriend::SetLengthMod(unbound->length_mod, bound);
} else {
FormatConversionSpecImplFriend::SetFlags(unbound->flags, bound);
FormatConversionSpecImplFriend::SetWidth(-1, bound);
@@ -215,7 +231,7 @@ TString& AppendPack(TString* out, const UntypedFormatSpecImpl format,
return *out;
}
-TString FormatPack(const UntypedFormatSpecImpl format,
+TString FormatPack(UntypedFormatSpecImpl format,
y_absl::Span<const FormatArgImpl> args) {
TString out;
if (Y_ABSL_PREDICT_FALSE(!FormatUntyped(&out, format, args))) {
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/bind.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/bind.h
index ec12caedaeb..39058de4876 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/bind.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/bind.h
@@ -15,16 +15,19 @@
#ifndef Y_ABSL_STRINGS_INTERNAL_STR_FORMAT_BIND_H_
#define Y_ABSL_STRINGS_INTERNAL_STR_FORMAT_BIND_H_
-#include <array>
+#include <cassert>
#include <cstdio>
-#include <sstream>
+#include <ostream>
#include <util/generic/string.h>
-#include "y_absl/base/port.h"
+#include "y_absl/base/config.h"
#include "y_absl/container/inlined_vector.h"
#include "y_absl/strings/internal/str_format/arg.h"
#include "y_absl/strings/internal/str_format/checker.h"
+#include "y_absl/strings/internal/str_format/constexpr_parser.h"
+#include "y_absl/strings/internal/str_format/extension.h"
#include "y_absl/strings/internal/str_format/parser.h"
+#include "y_absl/strings/string_view.h"
#include "y_absl/types/span.h"
#include "y_absl/utility/utility.h"
@@ -203,7 +206,7 @@ bool FormatUntyped(FormatRawSinkImpl raw_sink, UntypedFormatSpecImpl format,
TString& AppendPack(TString* out, UntypedFormatSpecImpl format,
y_absl::Span<const FormatArgImpl> args);
-TString FormatPack(const UntypedFormatSpecImpl format,
+TString FormatPack(UntypedFormatSpecImpl format,
y_absl::Span<const FormatArgImpl> args);
int FprintF(std::FILE* output, UntypedFormatSpecImpl format,
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/constexpr_parser.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/constexpr_parser.h
index 17703f59335..93df2880903 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/constexpr_parser.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/constexpr_parser.h
@@ -17,17 +17,18 @@
#include <cassert>
#include <cstdint>
+#include <cstdio>
#include <limits>
+#include "y_absl/base/config.h"
#include "y_absl/base/const_init.h"
+#include "y_absl/base/optimization.h"
#include "y_absl/strings/internal/str_format/extension.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
namespace str_format_internal {
-enum class LengthMod : std::uint8_t { h, hh, l, ll, L, j, z, t, q, none };
-
// The analyzed properties of a single specified conversion.
struct UnboundConversion {
// This is a user defined default constructor on purpose to skip the
@@ -306,7 +307,6 @@ constexpr const char* ConsumeConversion(const char* pos, const char* const end,
if (Y_ABSL_PREDICT_FALSE(!tag.is_length())) return nullptr;
// It is a length modifier.
- using str_format_internal::LengthMod;
LengthMod length_mod = tag.as_length();
Y_ABSL_FORMAT_PARSER_INTERNAL_GET_CHAR();
if (c == 'h' && length_mod == LengthMod::h) {
@@ -322,6 +322,11 @@ constexpr const char* ConsumeConversion(const char* pos, const char* const end,
if (Y_ABSL_PREDICT_FALSE(c == 'v')) return nullptr;
if (Y_ABSL_PREDICT_FALSE(!tag.is_conv())) return nullptr;
+
+ // `wchar_t` args are marked non-basic so `Bind()` will copy the length mod.
+ if (conv->length_mod == LengthMod::l && c == 'c') {
+ conv->flags = conv->flags | Flags::kNonBasic;
+ }
}
#undef Y_ABSL_FORMAT_PARSER_INTERNAL_GET_CHAR
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/extension.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/extension.h
index 20aa033e650..84d5c370c0a 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/extension.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/extension.h
@@ -16,16 +16,14 @@
#ifndef Y_ABSL_STRINGS_INTERNAL_STR_FORMAT_EXTENSION_H_
#define Y_ABSL_STRINGS_INTERNAL_STR_FORMAT_EXTENSION_H_
-#include <limits.h>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <ostream>
+#include <util/generic/string.h>
#include "y_absl/base/config.h"
-#include "y_absl/base/port.h"
-#include "y_absl/meta/type_traits.h"
#include "y_absl/strings/internal/str_format/output.h"
#include "y_absl/strings/string_view.h"
@@ -34,6 +32,7 @@ Y_ABSL_NAMESPACE_BEGIN
enum class FormatConversionChar : uint8_t;
enum class FormatConversionCharSet : uint64_t;
+enum class LengthMod : std::uint8_t { h, hh, l, ll, L, j, z, t, q, none };
namespace str_format_internal {
@@ -139,7 +138,8 @@ enum class Flags : uint8_t {
kAlt = 1 << 3,
kZero = 1 << 4,
// This is not a real flag. It just exists to turn off kBasic when no other
- // flags are set. This is for when width/precision are specified.
+ // flags are set. This is for when width/precision are specified, or a length
+ // modifier affects the behavior ("%lc").
kNonBasic = 1 << 5,
};
@@ -285,6 +285,8 @@ class FormatConversionSpecImpl {
bool has_alt_flag() const { return FlagsContains(flags_, Flags::kAlt); }
bool has_zero_flag() const { return FlagsContains(flags_, Flags::kZero); }
+ LengthMod length_mod() const { return length_mod_; }
+
FormatConversionChar conversion_char() const {
// Keep this field first in the struct . It generates better code when
// accessing it when ConversionSpec is passed by value in registers.
@@ -310,6 +312,7 @@ class FormatConversionSpecImpl {
friend struct str_format_internal::FormatConversionSpecImplFriend;
FormatConversionChar conv_ = FormatConversionCharInternal::kNone;
Flags flags_;
+ LengthMod length_mod_ = LengthMod::none;
int width_;
int precision_;
};
@@ -318,6 +321,9 @@ struct FormatConversionSpecImplFriend final {
static void SetFlags(Flags f, FormatConversionSpecImpl* conv) {
conv->flags_ = f;
}
+ static void SetLengthMod(LengthMod l, FormatConversionSpecImpl* conv) {
+ conv->length_mod_ = l;
+ }
static void SetConversionChar(FormatConversionChar c,
FormatConversionSpecImpl* conv) {
conv->conv_ = c;
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/parser.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/parser.h
index d3bf515b1f6..e58bd0145ff 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/parser.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/parser.h
@@ -15,22 +15,23 @@
#ifndef Y_ABSL_STRINGS_INTERNAL_STR_FORMAT_PARSER_H_
#define Y_ABSL_STRINGS_INTERNAL_STR_FORMAT_PARSER_H_
-#include <limits.h>
#include <stddef.h>
#include <stdlib.h>
#include <cassert>
-#include <cstdint>
+#include <cstring>
#include <initializer_list>
-#include <iosfwd>
-#include <iterator>
#include <memory>
#include <util/generic/string.h>
+#include <utility>
#include <vector>
+#include "y_absl/base/config.h"
+#include "y_absl/base/optimization.h"
#include "y_absl/strings/internal/str_format/checker.h"
#include "y_absl/strings/internal/str_format/constexpr_parser.h"
#include "y_absl/strings/internal/str_format/extension.h"
+#include "y_absl/strings/string_view.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/match.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/match.cc
index 02ae2b23f57..665a12ceefd 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/match.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/match.cc
@@ -17,10 +17,13 @@
#include <algorithm>
#include <cstdint>
+#include "y_absl/base/config.h"
#include "y_absl/base/internal/endian.h"
+#include "y_absl/base/optimization.h"
#include "y_absl/numeric/bits.h"
#include "y_absl/strings/ascii.h"
#include "y_absl/strings/internal/memutil.h"
+#include "y_absl/strings/string_view.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/numbers.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/numbers.cc
index d607026d01e..a200efb10b7 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/numbers.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/numbers.cc
@@ -20,32 +20,36 @@
#include <algorithm>
#include <cassert>
#include <cfloat> // for DBL_DIG and FLT_DIG
+#include <climits>
#include <cmath> // for HUGE_VAL
+#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iterator>
#include <limits>
-#include <memory>
+#include <system_error> // NOLINT(build/c++11)
+#include <type_traits>
#include <utility>
#include "y_absl/base/attributes.h"
+#include "y_absl/base/config.h"
#include "y_absl/base/internal/endian.h"
#include "y_absl/base/internal/raw_logging.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/base/optimization.h"
#include "y_absl/numeric/bits.h"
+#include "y_absl/numeric/int128.h"
#include "y_absl/strings/ascii.h"
#include "y_absl/strings/charconv.h"
-#include "y_absl/strings/escaping.h"
-#include "y_absl/strings/internal/memutil.h"
#include "y_absl/strings/match.h"
-#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/string_view.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
-bool SimpleAtof(y_absl::string_view str, float* out) {
+bool SimpleAtof(y_absl::string_view str, y_absl::Nonnull<float*> out) {
*out = 0.0;
str = StripAsciiWhitespace(str);
// std::from_chars doesn't accept an initial +, but SimpleAtof does, so if one
@@ -76,7 +80,7 @@ bool SimpleAtof(y_absl::string_view str, float* out) {
return true;
}
-bool SimpleAtod(y_absl::string_view str, double* out) {
+bool SimpleAtod(y_absl::string_view str, y_absl::Nonnull<double*> out) {
*out = 0.0;
str = StripAsciiWhitespace(str);
// std::from_chars doesn't accept an initial +, but SimpleAtod does, so if one
@@ -107,7 +111,7 @@ bool SimpleAtod(y_absl::string_view str, double* out) {
return true;
}
-bool SimpleAtob(y_absl::string_view str, bool* out) {
+bool SimpleAtob(y_absl::string_view str, y_absl::Nonnull<bool*> out) {
Y_ABSL_RAW_CHECK(out != nullptr, "Output pointer must not be nullptr.");
if (EqualsIgnoreCase(str, "true") || EqualsIgnoreCase(str, "t") ||
EqualsIgnoreCase(str, "yes") || EqualsIgnoreCase(str, "y") ||
@@ -155,29 +159,71 @@ constexpr uint32_t kTwoZeroBytes = 0x0101 * '0';
constexpr uint64_t kFourZeroBytes = 0x01010101 * '0';
constexpr uint64_t kEightZeroBytes = 0x0101010101010101ull * '0';
-// * 103 / 1024 is a division by 10 for values from 0 to 99. It's also a
-// division of a structure [k takes 2 bytes][m takes 2 bytes], then * 103 / 1024
-// will be [k / 10][m / 10]. It allows parallel division.
-constexpr uint64_t kDivisionBy10Mul = 103u;
+template <typename T>
+constexpr T Pow(T base, uint32_t n) {
+ // Exponentiation by squaring
+ return static_cast<T>((n > 1 ? Pow(base * base, n >> 1) : static_cast<T>(1)) *
+ ((n & 1) ? base : static_cast<T>(1)));
+}
+
+// Given n, calculates C where the following holds for all 0 <= x < Pow(100, n):
+// x / Pow(10, n) == x * C / Pow(2, n * 10)
+// In other words, it allows us to divide by a power of 10 via a single
+// multiplication and bit shifts, assuming the input will be smaller than the
+// square of that power of 10.
+template <typename T>
+constexpr T ComputePowerOf100DivisionCoefficient(uint32_t n) {
+ if (n > 4) {
+ // This doesn't work for large powers of 100, due to overflow
+ abort();
+ }
+ T denom = 16 - 1;
+ T num = (denom + 1) - 10;
+ T gcd = 3; // Greatest common divisor of numerator and denominator
+ denom = Pow(denom / gcd, n);
+ num = Pow(num / gcd, 9 * n);
+ T quotient = num / denom;
+ if (num % denom >= denom / 2) {
+ // Round up, since the remainder is more than half the denominator
+ ++quotient;
+ }
+ return quotient;
+}
+
+// * kDivisionBy10Mul / kDivisionBy10Div is a division by 10 for values from 0
+// to 99. It's also a division of a structure [k takes 2 bytes][m takes 2
+// bytes], then * kDivisionBy10Mul / kDivisionBy10Div will be [k / 10][m / 10].
+// It allows parallel division.
+constexpr uint64_t kDivisionBy10Mul =
+ ComputePowerOf100DivisionCoefficient<uint64_t>(1);
+static_assert(kDivisionBy10Mul == 103,
+ "division coefficient for 10 is incorrect");
constexpr uint64_t kDivisionBy10Div = 1 << 10;
-// * 10486 / 1048576 is a division by 100 for values from 0 to 9999.
-constexpr uint64_t kDivisionBy100Mul = 10486u;
+// * kDivisionBy100Mul / kDivisionBy100Div is a division by 100 for values from
+// 0 to 9999.
+constexpr uint64_t kDivisionBy100Mul =
+ ComputePowerOf100DivisionCoefficient<uint64_t>(2);
+static_assert(kDivisionBy100Mul == 10486,
+ "division coefficient for 100 is incorrect");
constexpr uint64_t kDivisionBy100Div = 1 << 20;
-// Encode functions write the ASCII output of input `n` to `out_str`.
-inline char* EncodeHundred(uint32_t n, char* out_str) {
- int num_digits = static_cast<int>(n - 10) >> 8;
- uint32_t base = kTwoZeroBytes;
- uint32_t div10 = (n * kDivisionBy10Mul) / kDivisionBy10Div;
- uint32_t mod10 = n - 10u * div10;
- base += div10 + (mod10 << 8);
- base >>= num_digits & 8;
- little_endian::Store16(out_str, static_cast<uint16_t>(base));
- return out_str + 2 + num_digits;
+static_assert(ComputePowerOf100DivisionCoefficient<uint64_t>(3) == 1073742,
+ "division coefficient for 1000 is incorrect");
+
+// Same as `PrepareEightDigits`, but produces 2 digits for integers < 100.
+inline uint32_t PrepareTwoDigitsImpl(uint32_t i, bool reversed) {
+ assert(i < 100);
+ uint32_t div10 = (i * kDivisionBy10Mul) / kDivisionBy10Div;
+ uint32_t mod10 = i - 10u * div10;
+ return (div10 << (reversed ? 8 : 0)) + (mod10 << (reversed ? 0 : 8));
+}
+inline uint32_t PrepareTwoDigits(uint32_t i) {
+ return PrepareTwoDigitsImpl(i, false);
}
-inline char* EncodeTenThousand(uint32_t n, char* out_str) {
+// Same as `PrepareEightDigits`, but produces 4 digits for integers < 10000.
+inline uint32_t PrepareFourDigitsImpl(uint32_t n, bool reversed) {
// We split lower 2 digits and upper 2 digits of n into 2 byte consecutive
// blocks. 123 -> [\0\1][\0\23]. We divide by 10 both blocks
// (it's 1 division + zeroing upper bits), and compute modulo 10 as well "in
@@ -185,146 +231,335 @@ inline char* EncodeTenThousand(uint32_t n, char* out_str) {
// strip trailing zeros, add ASCII '0000' and return.
uint32_t div100 = (n * kDivisionBy100Mul) / kDivisionBy100Div;
uint32_t mod100 = n - 100ull * div100;
- uint32_t hundreds = (mod100 << 16) + div100;
+ uint32_t hundreds =
+ (mod100 << (reversed ? 0 : 16)) + (div100 << (reversed ? 16 : 0));
uint32_t tens = (hundreds * kDivisionBy10Mul) / kDivisionBy10Div;
tens &= (0xFull << 16) | 0xFull;
- tens += (hundreds - 10ull * tens) << 8;
- Y_ABSL_ASSUME(tens != 0);
- // The result can contain trailing zero bits, we need to strip them to a first
- // significant byte in a final representation. For example, for n = 123, we
- // have tens to have representation \0\1\2\3. We do `& -8` to round
- // to a multiple to 8 to strip zero bytes, not all zero bits.
- // countr_zero to help.
- // 0 minus 8 to make MSVC happy.
- uint32_t zeroes = static_cast<uint32_t>(y_absl::countr_zero(tens)) & (0 - 8ull);
- tens += kFourZeroBytes;
- tens >>= zeroes;
- little_endian::Store32(out_str, tens);
- return out_str + sizeof(tens) - zeroes / 8;
+ tens = (tens << (reversed ? 8 : 0)) +
+ static_cast<uint32_t>((hundreds - 10ull * tens) << (reversed ? 0 : 8));
+ return tens;
+}
+inline uint32_t PrepareFourDigits(uint32_t n) {
+ return PrepareFourDigitsImpl(n, false);
+}
+inline uint32_t PrepareFourDigitsReversed(uint32_t n) {
+ return PrepareFourDigitsImpl(n, true);
}
-// Prepare functions return an integer that should be written to out_str
-// (but possibly include trailing zeros).
-// For hi < 10000, lo < 10000 returns uint64_t as encoded in ASCII with
-// possibly trailing zeroes of the number hi * 10000 + lo.
-inline uint64_t PrepareTenThousands(uint64_t hi, uint64_t lo) {
- uint64_t merged = hi | (lo << 32);
+// Helper function to produce an ASCII representation of `i`.
+//
+// Function returns an 8-byte integer which when summed with `kEightZeroBytes`,
+// can be treated as a printable buffer with ascii representation of `i`,
+// possibly with leading zeros.
+//
+// Example:
+//
+// uint64_t buffer = PrepareEightDigits(102030) + kEightZeroBytes;
+// char* ascii = reinterpret_cast<char*>(&buffer);
+// // Note two leading zeros:
+// EXPECT_EQ(y_absl::string_view(ascii, 8), "00102030");
+//
+// If `Reversed` is set to true, the result becomes reversed to "03020100".
+//
+// Pre-condition: `i` must be less than 100000000.
+inline uint64_t PrepareEightDigitsImpl(uint32_t i, bool reversed) {
+ Y_ABSL_ASSUME(i < 10000'0000);
+ // Prepare 2 blocks of 4 digits "in parallel".
+ uint32_t hi = i / 10000;
+ uint32_t lo = i % 10000;
+ uint64_t merged = (uint64_t{hi} << (reversed ? 32 : 0)) |
+ (uint64_t{lo} << (reversed ? 0 : 32));
uint64_t div100 = ((merged * kDivisionBy100Mul) / kDivisionBy100Div) &
((0x7Full << 32) | 0x7Full);
uint64_t mod100 = merged - 100ull * div100;
- uint64_t hundreds = (mod100 << 16) + div100;
+ uint64_t hundreds =
+ (mod100 << (reversed ? 0 : 16)) + (div100 << (reversed ? 16 : 0));
uint64_t tens = (hundreds * kDivisionBy10Mul) / kDivisionBy10Div;
tens &= (0xFull << 48) | (0xFull << 32) | (0xFull << 16) | 0xFull;
- tens += (hundreds - 10ull * tens) << 8;
+ tens = (tens << (reversed ? 8 : 0)) +
+ ((hundreds - 10ull * tens) << (reversed ? 0 : 8));
return tens;
}
+inline uint64_t PrepareEightDigits(uint32_t i) {
+ return PrepareEightDigitsImpl(i, false);
+}
+inline uint64_t PrepareEightDigitsReversed(uint32_t i) {
+ return PrepareEightDigitsImpl(i, true);
+}
+
+template <typename T, typename BackwardIt>
+class FastUIntToStringConverter {
+ static_assert(
+ std::is_same<T, decltype(+std::declval<T>())>::value,
+ "to avoid code bloat, only instantiate this for int and larger types");
+ static_assert(std::is_unsigned<T>::value,
+ "this class is only for unsigned types");
+
+ public:
+ // Outputs the given number backward (like with std::copy_backward),
+ // starting from the end of the string.
+ // The number of digits in the number must have been already measured and
+ // passed *exactly*, otherwise the behavior is undefined.
+ // (This is an optimization, as calculating the number of digits again would
+ // slow down the hot path.)
+ // Returns an iterator to the start of the suffix that was appended.
+ static BackwardIt FastIntToBufferBackward(T v, BackwardIt end) {
+ // THIS IS A HOT FUNCTION with a very deliberate structure to exploit branch
+ // prediction and shorten the critical path for smaller numbers.
+ // Do not move around the if/else blocks or attempt to simplify it
+ // without benchmarking any changes.
+
+ if (v < 10) {
+ goto AT_LEAST_1 /* NOTE: mandatory for the 0 case */;
+ }
+ if (v < 1000) {
+ goto AT_LEAST_10;
+ }
+ if (v < 10000000) {
+ goto AT_LEAST_1000;
+ }
+
+ if (v >= 100000000 / 10) {
+ if (v >= 10000000000000000 / 10) {
+ DoFastIntToBufferBackward<8>(v, end);
+ }
+ DoFastIntToBufferBackward<8>(v, end);
+ }
+
+ if (v >= 10000 / 10) {
+ AT_LEAST_1000:
+ DoFastIntToBufferBackward<4>(v, end);
+ }
+
+ if (v >= 100 / 10) {
+ AT_LEAST_10:
+ DoFastIntToBufferBackward<2>(v, end);
+ }
-inline char* EncodeFullU32(uint32_t n, char* out_str) {
- if (n < 100'000'000) {
- uint64_t bottom = PrepareTenThousands(n / 10000, n % 10000);
- Y_ABSL_ASSUME(bottom != 0);
- // 0 minus 8 to make MSVC happy.
- uint32_t zeroes = static_cast<uint32_t>(y_absl::countr_zero(bottom))
- & (0 - 8ull);
- uint64_t bottom_res = bottom + kEightZeroBytes;
- bottom_res >>= zeroes;
- little_endian::Store64(out_str, bottom_res);
- return out_str + sizeof(bottom) - zeroes / 8;
+ if (v >= 10 / 10) {
+ AT_LEAST_1:
+ end = DoFastIntToBufferBackward(v, end, std::integral_constant<int, 1>());
+ }
+ return end;
}
- uint32_t top = n / 100'000'000;
- n %= 100'000'000;
- uint64_t bottom = PrepareTenThousands(n / 10000, n % 10000);
- uint64_t bottom_res = bottom + kEightZeroBytes;
- out_str = EncodeHundred(top, out_str);
- little_endian::Store64(out_str, bottom_res);
- return out_str + sizeof(bottom);
-}
-} // namespace
+ private:
+ // Only assume pointers are contiguous for now. String and vector iterators
+ // could be special-cased as well, but there's no need for them here.
+ // With C++20 we can probably switch to std::contiguous_iterator_tag.
+ static constexpr bool kIsContiguousIterator =
+ std::is_pointer<BackwardIt>::value;
+
+ template <int Exponent>
+ static void DoFastIntToBufferBackward(T& v, BackwardIt& end) {
+ constexpr T kModulus = Pow<T>(10, Exponent);
+ T remainder = static_cast<T>(v % kModulus);
+ v = static_cast<T>(v / kModulus);
+ end = DoFastIntToBufferBackward(remainder, end,
+ std::integral_constant<int, Exponent>());
+ }
-void numbers_internal::PutTwoDigits(uint32_t i, char* buf) {
- assert(i < 100);
- uint32_t base = kTwoZeroBytes;
- uint32_t div10 = (i * kDivisionBy10Mul) / kDivisionBy10Div;
- uint32_t mod10 = i - 10u * div10;
- base += div10 + (mod10 << 8);
- little_endian::Store16(buf, static_cast<uint16_t>(base));
-}
+ static BackwardIt DoFastIntToBufferBackward(const T&, BackwardIt end,
+ std::integral_constant<int, 0>) {
+ return end;
+ }
-char* numbers_internal::FastIntToBuffer(uint32_t n, char* out_str) {
- if (n < 100) {
- out_str = EncodeHundred(n, out_str);
- goto set_last_zero;
+ static BackwardIt DoFastIntToBufferBackward(T v, BackwardIt end,
+ std::integral_constant<int, 1>) {
+ *--end = static_cast<char>('0' + v);
+ return DoFastIntToBufferBackward(v, end, std::integral_constant<int, 0>());
}
- if (n < 10000) {
- out_str = EncodeTenThousand(n, out_str);
- goto set_last_zero;
+
+ static BackwardIt DoFastIntToBufferBackward(T v, BackwardIt end,
+ std::integral_constant<int, 4>) {
+ if (kIsContiguousIterator) {
+ const uint32_t digits =
+ PrepareFourDigits(static_cast<uint32_t>(v)) + kFourZeroBytes;
+ end -= sizeof(digits);
+ little_endian::Store32(&*end, digits);
+ } else {
+ uint32_t digits =
+ PrepareFourDigitsReversed(static_cast<uint32_t>(v)) + kFourZeroBytes;
+ for (size_t i = 0; i < sizeof(digits); ++i) {
+ *--end = static_cast<char>(digits);
+ digits >>= CHAR_BIT;
+ }
+ }
+ return end;
}
- out_str = EncodeFullU32(n, out_str);
-set_last_zero:
- *out_str = '\0';
- return out_str;
-}
-char* numbers_internal::FastIntToBuffer(int32_t i, char* buffer) {
- uint32_t u = static_cast<uint32_t>(i);
- if (i < 0) {
- *buffer++ = '-';
- // We need to do the negation in modular (i.e., "unsigned")
- // arithmetic; MSVC++ apparently warns for plain "-u", so
- // we write the equivalent expression "0 - u" instead.
- u = 0 - u;
+ static BackwardIt DoFastIntToBufferBackward(T v, BackwardIt end,
+ std::integral_constant<int, 8>) {
+ if (kIsContiguousIterator) {
+ const uint64_t digits =
+ PrepareEightDigits(static_cast<uint32_t>(v)) + kEightZeroBytes;
+ end -= sizeof(digits);
+ little_endian::Store64(&*end, digits);
+ } else {
+ uint64_t digits = PrepareEightDigitsReversed(static_cast<uint32_t>(v)) +
+ kEightZeroBytes;
+ for (size_t i = 0; i < sizeof(digits); ++i) {
+ *--end = static_cast<char>(digits);
+ digits >>= CHAR_BIT;
+ }
+ }
+ return end;
}
- return numbers_internal::FastIntToBuffer(u, buffer);
-}
-char* numbers_internal::FastIntToBuffer(uint64_t i, char* buffer) {
- uint32_t u32 = static_cast<uint32_t>(i);
- if (u32 == i) return numbers_internal::FastIntToBuffer(u32, buffer);
-
- // 10**9 < 2**32 <= i < 10**10, we can do 2+8
- uint64_t div08 = i / 100'000'000ull;
- uint64_t mod08 = i % 100'000'000ull;
- uint64_t mod_result =
- PrepareTenThousands(mod08 / 10000, mod08 % 10000) + kEightZeroBytes;
- if (i < 10'000'000'000ull) {
- buffer = EncodeHundred(static_cast<uint32_t>(div08), buffer);
- little_endian::Store64(buffer, mod_result);
- buffer += 8;
- goto set_last_zero;
+ template <int Digits>
+ static BackwardIt DoFastIntToBufferBackward(
+ T v, BackwardIt end, std::integral_constant<int, Digits>) {
+ constexpr int kLogModulus = Digits - Digits / 2;
+ constexpr T kModulus = Pow(static_cast<T>(10), kLogModulus);
+ bool is_safe_to_use_division_trick = Digits <= 8;
+ T quotient, remainder;
+ if (is_safe_to_use_division_trick) {
+ constexpr uint64_t kCoefficient =
+ ComputePowerOf100DivisionCoefficient<uint64_t>(kLogModulus);
+ quotient = (v * kCoefficient) >> (10 * kLogModulus);
+ remainder = v - quotient * kModulus;
+ } else {
+ quotient = v / kModulus;
+ remainder = v % kModulus;
+ }
+ end = DoFastIntToBufferBackward(remainder, end,
+ std::integral_constant<int, kLogModulus>());
+ return DoFastIntToBufferBackward(
+ quotient, end, std::integral_constant<int, Digits - kLogModulus>());
}
+};
- // i < 10**16, in this case 8+8
- if (i < 10'000'000'000'000'000ull) {
- buffer = EncodeFullU32(static_cast<uint32_t>(div08), buffer);
- little_endian::Store64(buffer, mod_result);
- buffer += 8;
- goto set_last_zero;
- } else {
- // 4 + 8 + 8
- uint64_t div016 = i / 10'000'000'000'000'000ull;
- buffer = EncodeTenThousand(static_cast<uint32_t>(div016), buffer);
- uint64_t mid_result = div08 - div016 * 100'000'000ull;
- mid_result = PrepareTenThousands(mid_result / 10000, mid_result % 10000) +
- kEightZeroBytes;
- little_endian::Store64(buffer, mid_result);
- buffer += 8;
- little_endian::Store64(buffer, mod_result);
- buffer += 8;
- goto set_last_zero;
+// Returns an iterator to the start of the suffix that was appended
+template <typename T, typename BackwardIt>
+std::enable_if_t<std::is_unsigned<T>::value, BackwardIt>
+DoFastIntToBufferBackward(T v, BackwardIt end, uint32_t digits) {
+ using PromotedT = std::decay_t<decltype(+v)>;
+ using Converter = FastUIntToStringConverter<PromotedT, BackwardIt>;
+ (void)digits;
+ return Converter().FastIntToBufferBackward(v, end);
+}
+
+template <typename T, typename BackwardIt>
+std::enable_if_t<std::is_signed<T>::value, BackwardIt>
+DoFastIntToBufferBackward(T v, BackwardIt end, uint32_t digits) {
+ if (y_absl::numbers_internal::IsNegative(v)) {
+ // Store the minus sign *before* we produce the number itself, not after.
+ // This gets us a tail call.
+ end[-static_cast<ptrdiff_t>(digits) - 1] = '-';
}
-set_last_zero:
- *buffer = '\0';
+ return DoFastIntToBufferBackward(
+ y_absl::numbers_internal::UnsignedAbsoluteValue(v), end, digits);
+}
+
+template <class T>
+std::enable_if_t<std::is_integral<T>::value, int>
+GetNumDigitsOrNegativeIfNegativeImpl(T v) {
+ const auto /* either bool or std::false_type */ is_negative =
+ y_absl::numbers_internal::IsNegative(v);
+ const int digits = static_cast<int>(y_absl::numbers_internal::Base10Digits(
+ y_absl::numbers_internal::UnsignedAbsoluteValue(v)));
+ return is_negative ? ~digits : digits;
+}
+
+} // namespace
+
+void numbers_internal::PutTwoDigits(uint32_t i, y_absl::Nonnull<char*> buf) {
+ little_endian::Store16(
+ buf, static_cast<uint16_t>(PrepareTwoDigits(i) + kTwoZeroBytes));
+}
+
+y_absl::Nonnull<char*> numbers_internal::FastIntToBuffer(
+ uint32_t i, y_absl::Nonnull<char*> buffer) {
+ const uint32_t digits = y_absl::numbers_internal::Base10Digits(i);
+ buffer += digits;
+ *buffer = '\0'; // We're going backward, so store this first
+ FastIntToBufferBackward(i, buffer, digits);
return buffer;
}
-char* numbers_internal::FastIntToBuffer(int64_t i, char* buffer) {
- uint64_t u = static_cast<uint64_t>(i);
- if (i < 0) {
- *buffer++ = '-';
- u = 0 - u;
- }
- return numbers_internal::FastIntToBuffer(u, buffer);
+y_absl::Nonnull<char*> numbers_internal::FastIntToBuffer(
+ int32_t i, y_absl::Nonnull<char*> buffer) {
+ buffer += static_cast<int>(i < 0);
+ uint32_t digits = y_absl::numbers_internal::Base10Digits(
+ y_absl::numbers_internal::UnsignedAbsoluteValue(i));
+ buffer += digits;
+ *buffer = '\0'; // We're going backward, so store this first
+ FastIntToBufferBackward(i, buffer, digits);
+ return buffer;
+}
+
+y_absl::Nonnull<char*> numbers_internal::FastIntToBuffer(
+ uint64_t i, y_absl::Nonnull<char*> buffer) {
+ uint32_t digits = y_absl::numbers_internal::Base10Digits(i);
+ buffer += digits;
+ *buffer = '\0'; // We're going backward, so store this first
+ FastIntToBufferBackward(i, buffer, digits);
+ return buffer;
+}
+
+y_absl::Nonnull<char*> numbers_internal::FastIntToBuffer(
+ int64_t i, y_absl::Nonnull<char*> buffer) {
+ buffer += static_cast<int>(i < 0);
+ uint32_t digits = y_absl::numbers_internal::Base10Digits(
+ y_absl::numbers_internal::UnsignedAbsoluteValue(i));
+ buffer += digits;
+ *buffer = '\0'; // We're going backward, so store this first
+ FastIntToBufferBackward(i, buffer, digits);
+ return buffer;
+}
+
+y_absl::Nonnull<char*> numbers_internal::FastIntToBufferBackward(
+ uint32_t i, y_absl::Nonnull<char*> buffer_end, uint32_t exact_digit_count) {
+ return DoFastIntToBufferBackward(i, buffer_end, exact_digit_count);
+}
+
+y_absl::Nonnull<char*> numbers_internal::FastIntToBufferBackward(
+ int32_t i, y_absl::Nonnull<char*> buffer_end, uint32_t exact_digit_count) {
+ return DoFastIntToBufferBackward(i, buffer_end, exact_digit_count);
+}
+
+y_absl::Nonnull<char*> numbers_internal::FastIntToBufferBackward(
+ uint64_t i, y_absl::Nonnull<char*> buffer_end, uint32_t exact_digit_count) {
+ return DoFastIntToBufferBackward(i, buffer_end, exact_digit_count);
+}
+
+y_absl::Nonnull<char*> numbers_internal::FastIntToBufferBackward(
+ int64_t i, y_absl::Nonnull<char*> buffer_end, uint32_t exact_digit_count) {
+ return DoFastIntToBufferBackward(i, buffer_end, exact_digit_count);
+}
+
+int numbers_internal::GetNumDigitsOrNegativeIfNegative(signed char v) {
+ return GetNumDigitsOrNegativeIfNegativeImpl(v);
+}
+int numbers_internal::GetNumDigitsOrNegativeIfNegative(unsigned char v) {
+ return GetNumDigitsOrNegativeIfNegativeImpl(v);
+}
+int numbers_internal::GetNumDigitsOrNegativeIfNegative(short v) { // NOLINT
+ return GetNumDigitsOrNegativeIfNegativeImpl(v);
+}
+int numbers_internal::GetNumDigitsOrNegativeIfNegative(
+ unsigned short v) { // NOLINT
+ return GetNumDigitsOrNegativeIfNegativeImpl(v);
+}
+int numbers_internal::GetNumDigitsOrNegativeIfNegative(int v) {
+ return GetNumDigitsOrNegativeIfNegativeImpl(v);
+}
+int numbers_internal::GetNumDigitsOrNegativeIfNegative(unsigned int v) {
+ return GetNumDigitsOrNegativeIfNegativeImpl(v);
+}
+int numbers_internal::GetNumDigitsOrNegativeIfNegative(long v) { // NOLINT
+ return GetNumDigitsOrNegativeIfNegativeImpl(v);
+}
+int numbers_internal::GetNumDigitsOrNegativeIfNegative(
+ unsigned long v) { // NOLINT
+ return GetNumDigitsOrNegativeIfNegativeImpl(v);
+}
+int numbers_internal::GetNumDigitsOrNegativeIfNegative(long long v) { // NOLINT
+ return GetNumDigitsOrNegativeIfNegativeImpl(v);
+}
+int numbers_internal::GetNumDigitsOrNegativeIfNegative(
+ unsigned long long v) { // NOLINT
+ return GetNumDigitsOrNegativeIfNegativeImpl(v);
}
// Given a 128-bit number expressed as a pair of uint64_t, high half first,
@@ -534,7 +769,8 @@ static ExpDigits SplitToSix(const double value) {
// Helper function for fast formatting of floating-point.
// The result is the same as "%g", a.k.a. "%.6g".
-size_t numbers_internal::SixDigitsToBuffer(double d, char* const buffer) {
+size_t numbers_internal::SixDigitsToBuffer(double d,
+ y_absl::Nonnull<char*> const buffer) {
static_assert(std::numeric_limits<float>::is_iec559,
"IEEE-754/IEC-559 support only");
@@ -681,9 +917,10 @@ static const int8_t kAsciiToInt[256] = {
36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36};
// Parse the sign and optional hex or oct prefix in text.
-inline bool safe_parse_sign_and_base(y_absl::string_view* text /*inout*/,
- int* base_ptr /*inout*/,
- bool* negative_ptr /*output*/) {
+inline bool safe_parse_sign_and_base(
+ y_absl::Nonnull<y_absl::string_view*> text /*inout*/,
+ y_absl::Nonnull<int*> base_ptr /*inout*/,
+ y_absl::Nonnull<bool*> negative_ptr /*output*/) {
if (text->data() == nullptr) {
return false;
}
@@ -968,7 +1205,7 @@ Y_ABSL_CONST_INIT const IntType LookupTables<IntType>::kVminOverBase[] =
template <typename IntType>
inline bool safe_parse_positive_int(y_absl::string_view text, int base,
- IntType* value_p) {
+ y_absl::Nonnull<IntType*> value_p) {
IntType value = 0;
const IntType vmax = std::numeric_limits<IntType>::max();
assert(vmax > 0);
@@ -1005,7 +1242,7 @@ inline bool safe_parse_positive_int(y_absl::string_view text, int base,
template <typename IntType>
inline bool safe_parse_negative_int(y_absl::string_view text, int base,
- IntType* value_p) {
+ y_absl::Nonnull<IntType*> value_p) {
IntType value = 0;
const IntType vmin = std::numeric_limits<IntType>::min();
assert(vmin < 0);
@@ -1049,8 +1286,8 @@ inline bool safe_parse_negative_int(y_absl::string_view text, int base,
// Input format based on POSIX.1-2008 strtol
// http://pubs.opengroup.org/onlinepubs/9699919799/functions/strtol.html
template <typename IntType>
-inline bool safe_int_internal(y_absl::string_view text, IntType* value_p,
- int base) {
+inline bool safe_int_internal(y_absl::string_view text,
+ y_absl::Nonnull<IntType*> value_p, int base) {
*value_p = 0;
bool negative;
if (!safe_parse_sign_and_base(&text, &base, &negative)) {
@@ -1064,8 +1301,8 @@ inline bool safe_int_internal(y_absl::string_view text, IntType* value_p,
}
template <typename IntType>
-inline bool safe_uint_internal(y_absl::string_view text, IntType* value_p,
- int base) {
+inline bool safe_uint_internal(y_absl::string_view text,
+ y_absl::Nonnull<IntType*> value_p, int base) {
*value_p = 0;
bool negative;
if (!safe_parse_sign_and_base(&text, &base, &negative) || negative) {
@@ -1099,27 +1336,33 @@ Y_ABSL_CONST_INIT Y_ABSL_DLL const char kHexTable[513] =
"e0e1e2e3e4e5e6e7e8e9eaebecedeeef"
"f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff";
-bool safe_strto32_base(y_absl::string_view text, int32_t* value, int base) {
+bool safe_strto32_base(y_absl::string_view text, y_absl::Nonnull<int32_t*> value,
+ int base) {
return safe_int_internal<int32_t>(text, value, base);
}
-bool safe_strto64_base(y_absl::string_view text, int64_t* value, int base) {
+bool safe_strto64_base(y_absl::string_view text, y_absl::Nonnull<int64_t*> value,
+ int base) {
return safe_int_internal<int64_t>(text, value, base);
}
-bool safe_strto128_base(y_absl::string_view text, int128* value, int base) {
+bool safe_strto128_base(y_absl::string_view text, y_absl::Nonnull<int128*> value,
+ int base) {
return safe_int_internal<y_absl::int128>(text, value, base);
}
-bool safe_strtou32_base(y_absl::string_view text, uint32_t* value, int base) {
+bool safe_strtou32_base(y_absl::string_view text, y_absl::Nonnull<uint32_t*> value,
+ int base) {
return safe_uint_internal<uint32_t>(text, value, base);
}
-bool safe_strtou64_base(y_absl::string_view text, uint64_t* value, int base) {
+bool safe_strtou64_base(y_absl::string_view text, y_absl::Nonnull<uint64_t*> value,
+ int base) {
return safe_uint_internal<uint64_t>(text, value, base);
}
-bool safe_strtou128_base(y_absl::string_view text, uint128* value, int base) {
+bool safe_strtou128_base(y_absl::string_view text, y_absl::Nonnull<uint128*> value,
+ int base) {
return safe_uint_internal<y_absl::uint128>(text, value, base);
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/numbers.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/numbers.h
index c0f1a756428..737a0f0308c 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/numbers.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/numbers.h
@@ -32,6 +32,7 @@
#endif
#include <cstddef>
+#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <ctime>
@@ -39,9 +40,12 @@
#include <util/generic/string.h>
#include <type_traits>
+#include "y_absl/base/attributes.h"
#include "y_absl/base/config.h"
#include "y_absl/base/internal/endian.h"
#include "y_absl/base/macros.h"
+#include "y_absl/base/nullability.h"
+#include "y_absl/base/optimization.h"
#include "y_absl/base/port.h"
#include "y_absl/numeric/bits.h"
#include "y_absl/numeric/int128.h"
@@ -59,7 +63,8 @@ Y_ABSL_NAMESPACE_BEGIN
// encountered, this function returns `false`, leaving `out` in an unspecified
// state.
template <typename int_type>
-Y_ABSL_MUST_USE_RESULT bool SimpleAtoi(y_absl::string_view str, int_type* out);
+Y_ABSL_MUST_USE_RESULT bool SimpleAtoi(y_absl::string_view str,
+ y_absl::Nonnull<int_type*> out);
// SimpleAtof()
//
@@ -70,7 +75,8 @@ Y_ABSL_MUST_USE_RESULT bool SimpleAtoi(y_absl::string_view str, int_type* out);
// allowed formats for `str`, except SimpleAtof() is locale-independent and will
// always use the "C" locale. If any errors are encountered, this function
// returns `false`, leaving `out` in an unspecified state.
-Y_ABSL_MUST_USE_RESULT bool SimpleAtof(y_absl::string_view str, float* out);
+Y_ABSL_MUST_USE_RESULT bool SimpleAtof(y_absl::string_view str,
+ y_absl::Nonnull<float*> out);
// SimpleAtod()
//
@@ -81,7 +87,8 @@ Y_ABSL_MUST_USE_RESULT bool SimpleAtof(y_absl::string_view str, float* out);
// allowed formats for `str`, except SimpleAtod is locale-independent and will
// always use the "C" locale. If any errors are encountered, this function
// returns `false`, leaving `out` in an unspecified state.
-Y_ABSL_MUST_USE_RESULT bool SimpleAtod(y_absl::string_view str, double* out);
+Y_ABSL_MUST_USE_RESULT bool SimpleAtod(y_absl::string_view str,
+ y_absl::Nonnull<double*> out);
// SimpleAtob()
//
@@ -91,7 +98,8 @@ Y_ABSL_MUST_USE_RESULT bool SimpleAtod(y_absl::string_view str, double* out);
// are interpreted as boolean `false`: "false", "f", "no", "n", "0". If any
// errors are encountered, this function returns `false`, leaving `out` in an
// unspecified state.
-Y_ABSL_MUST_USE_RESULT bool SimpleAtob(y_absl::string_view str, bool* out);
+Y_ABSL_MUST_USE_RESULT bool SimpleAtob(y_absl::string_view str,
+ y_absl::Nonnull<bool*> out);
// SimpleHexAtoi()
//
@@ -104,13 +112,14 @@ Y_ABSL_MUST_USE_RESULT bool SimpleAtob(y_absl::string_view str, bool* out);
// by this function. If any errors are encountered, this function returns
// `false`, leaving `out` in an unspecified state.
template <typename int_type>
-Y_ABSL_MUST_USE_RESULT bool SimpleHexAtoi(y_absl::string_view str, int_type* out);
+Y_ABSL_MUST_USE_RESULT bool SimpleHexAtoi(y_absl::string_view str,
+ y_absl::Nonnull<int_type*> out);
// Overloads of SimpleHexAtoi() for 128 bit integers.
-Y_ABSL_MUST_USE_RESULT inline bool SimpleHexAtoi(y_absl::string_view str,
- y_absl::int128* out);
-Y_ABSL_MUST_USE_RESULT inline bool SimpleHexAtoi(y_absl::string_view str,
- y_absl::uint128* out);
+Y_ABSL_MUST_USE_RESULT inline bool SimpleHexAtoi(
+ y_absl::string_view str, y_absl::Nonnull<y_absl::int128*> out);
+Y_ABSL_MUST_USE_RESULT inline bool SimpleHexAtoi(
+ y_absl::string_view str, y_absl::Nonnull<y_absl::uint128*> out);
Y_ABSL_NAMESPACE_END
} // namespace y_absl
@@ -132,42 +141,136 @@ Y_ABSL_DLL extern const char
// PutTwoDigits(42, buf);
// // buf[0] == '4'
// // buf[1] == '2'
-void PutTwoDigits(uint32_t i, char* buf);
+void PutTwoDigits(uint32_t i, y_absl::Nonnull<char*> buf);
// safe_strto?() functions for implementing SimpleAtoi()
-bool safe_strto32_base(y_absl::string_view text, int32_t* value, int base);
-bool safe_strto64_base(y_absl::string_view text, int64_t* value, int base);
-bool safe_strto128_base(y_absl::string_view text, y_absl::int128* value,
- int base);
-bool safe_strtou32_base(y_absl::string_view text, uint32_t* value, int base);
-bool safe_strtou64_base(y_absl::string_view text, uint64_t* value, int base);
-bool safe_strtou128_base(y_absl::string_view text, y_absl::uint128* value,
- int base);
+bool safe_strto32_base(y_absl::string_view text, y_absl::Nonnull<int32_t*> value,
+ int base);
+bool safe_strto64_base(y_absl::string_view text, y_absl::Nonnull<int64_t*> value,
+ int base);
+bool safe_strto128_base(y_absl::string_view text,
+ y_absl::Nonnull<y_absl::int128*> value, int base);
+bool safe_strtou32_base(y_absl::string_view text, y_absl::Nonnull<uint32_t*> value,
+ int base);
+bool safe_strtou64_base(y_absl::string_view text, y_absl::Nonnull<uint64_t*> value,
+ int base);
+bool safe_strtou128_base(y_absl::string_view text,
+ y_absl::Nonnull<y_absl::uint128*> value, int base);
static const int kFastToBufferSize = 32;
static const int kSixDigitsToBufferSize = 16;
+template <class T>
+std::enable_if_t<!std::is_unsigned<T>::value, bool> IsNegative(const T& v) {
+ return v < T();
+}
+
+template <class T>
+std::enable_if_t<std::is_unsigned<T>::value, std::false_type> IsNegative(
+ const T&) {
+ // The integer is unsigned, so return a compile-time constant.
+ // This can help the optimizer avoid having to prove bool to be false later.
+ return std::false_type();
+}
+
+template <class T>
+std::enable_if_t<std::is_unsigned<std::decay_t<T>>::value, T&&>
+UnsignedAbsoluteValue(T&& v Y_ABSL_ATTRIBUTE_LIFETIME_BOUND) {
+ // The value is unsigned; just return the original.
+ return std::forward<T>(v);
+}
+
+template <class T>
+Y_ABSL_ATTRIBUTE_CONST_FUNCTION
+ std::enable_if_t<!std::is_unsigned<T>::value, std::make_unsigned_t<T>>
+ UnsignedAbsoluteValue(T v) {
+ using U = std::make_unsigned_t<T>;
+ return IsNegative(v) ? U() - static_cast<U>(v) : static_cast<U>(v);
+}
+
+// Returns the number of base-10 digits in the given number.
+// Note that this strictly counts digits. It does not count the sign.
+// The `initial_digits` parameter is the starting point, which is normally equal
+// to 1 because the number of digits in 0 is 1 (a special case).
+// However, callers may e.g. wish to change it to 2 to account for the sign.
+template <typename T>
+std::enable_if_t<std::is_unsigned<T>::value, uint32_t> Base10Digits(
+ T v, const uint32_t initial_digits = 1) {
+ uint32_t r = initial_digits;
+ // If code size becomes an issue, the 'if' stage can be removed for a minor
+ // performance loss.
+ for (;;) {
+ if (Y_ABSL_PREDICT_TRUE(v < 10 * 10)) {
+ r += (v >= 10);
+ break;
+ }
+ if (Y_ABSL_PREDICT_TRUE(v < 1000 * 10)) {
+ r += (v >= 1000) + 2;
+ break;
+ }
+ if (Y_ABSL_PREDICT_TRUE(v < 100000 * 10)) {
+ r += (v >= 100000) + 4;
+ break;
+ }
+ r += 6;
+ v = static_cast<T>(v / 1000000);
+ }
+ return r;
+}
+
+template <typename T>
+std::enable_if_t<std::is_signed<T>::value, uint32_t> Base10Digits(
+ T v, uint32_t r = 1) {
+ // Branchlessly add 1 to account for a minus sign.
+ r += static_cast<uint32_t>(IsNegative(v));
+ return Base10Digits(UnsignedAbsoluteValue(v), r);
+}
+
+// These functions return the number of base-10 digits, but multiplied by -1 if
+// the input itself is negative. This is handy and efficient for later usage,
+// since the bitwise complement of the result becomes equal to the number of
+// characters required.
+Y_ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative(
+ signed char v);
+Y_ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative(
+ unsigned char v);
+Y_ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative(
+ short v); // NOLINT
+Y_ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative(
+ unsigned short v); // NOLINT
+Y_ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative(int v);
+Y_ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative(
+ unsigned int v);
+Y_ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative(
+ long v); // NOLINT
+Y_ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative(
+ unsigned long v); // NOLINT
+Y_ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative(
+ long long v); // NOLINT
+Y_ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative(
+ unsigned long long v); // NOLINT
+
// Helper function for fast formatting of floating-point values.
// The result is the same as printf's "%g", a.k.a. "%.6g"; that is, six
// significant digits are returned, trailing zeros are removed, and numbers
// outside the range 0.0001-999999 are output using scientific notation
// (1.23456e+06). This routine is heavily optimized.
// Required buffer size is `kSixDigitsToBufferSize`.
-size_t SixDigitsToBuffer(double d, char* buffer);
+size_t SixDigitsToBuffer(double d, y_absl::Nonnull<char*> buffer);
-// These functions are intended for speed. All functions take an output buffer
+// All of these functions take an output buffer
// as an argument and return a pointer to the last byte they wrote, which is the
// terminating '\0'. At most `kFastToBufferSize` bytes are written.
-char* FastIntToBuffer(int32_t, char*);
-char* FastIntToBuffer(uint32_t, char*);
-char* FastIntToBuffer(int64_t, char*);
-char* FastIntToBuffer(uint64_t, char*);
+y_absl::Nonnull<char*> FastIntToBuffer(int32_t i, y_absl::Nonnull<char*> buffer);
+y_absl::Nonnull<char*> FastIntToBuffer(uint32_t i, y_absl::Nonnull<char*> buffer);
+y_absl::Nonnull<char*> FastIntToBuffer(int64_t i, y_absl::Nonnull<char*> buffer);
+y_absl::Nonnull<char*> FastIntToBuffer(uint64_t i, y_absl::Nonnull<char*> buffer);
// For enums and integer types that are not an exact match for the types above,
// use templates to call the appropriate one of the four overloads above.
template <typename int_type>
-char* FastIntToBuffer(int_type i, char* buffer) {
+y_absl::Nonnull<char*> FastIntToBuffer(int_type i, y_absl::Nonnull<char*> buffer) {
static_assert(sizeof(i) <= 64 / 8,
"FastIntToBuffer works only with 64-bit-or-less integers.");
// TODO(jorg): This signed-ness check is used because it works correctly
@@ -191,10 +294,63 @@ char* FastIntToBuffer(int_type i, char* buffer) {
}
}
+// These functions do NOT add any null-terminator.
+// They return a pointer to the beginning of the written string.
+// The digit counts provided must *exactly* match the number of base-10 digits
+// in the number, or the behavior is undefined.
+// (i.e. do NOT count the minus sign, or over- or under-count the digits.)
+y_absl::Nonnull<char*> FastIntToBufferBackward(int32_t i,
+ y_absl::Nonnull<char*> buffer_end,
+ uint32_t exact_digit_count);
+y_absl::Nonnull<char*> FastIntToBufferBackward(uint32_t i,
+ y_absl::Nonnull<char*> buffer_end,
+ uint32_t exact_digit_count);
+y_absl::Nonnull<char*> FastIntToBufferBackward(int64_t i,
+ y_absl::Nonnull<char*> buffer_end,
+ uint32_t exact_digit_count);
+y_absl::Nonnull<char*> FastIntToBufferBackward(uint64_t i,
+ y_absl::Nonnull<char*> buffer_end,
+ uint32_t exact_digit_count);
+
+// For enums and integer types that are not an exact match for the types above,
+// use templates to call the appropriate one of the four overloads above.
+template <typename int_type>
+y_absl::Nonnull<char*> FastIntToBufferBackward(int_type i,
+ y_absl::Nonnull<char*> buffer_end,
+ uint32_t exact_digit_count) {
+ static_assert(
+ sizeof(i) <= 64 / 8,
+ "FastIntToBufferBackward works only with 64-bit-or-less integers.");
+ // This signed-ness check is used because it works correctly
+ // with enums, and it also serves to check that int_type is not a pointer.
+ // If one day something like std::is_signed<enum E> works, switch to it.
+ // These conditions are constexpr bools to suppress MSVC warning C4127.
+ constexpr bool kIsSigned = static_cast<int_type>(1) - 2 < 0;
+ constexpr bool kUse64Bit = sizeof(i) > 32 / 8;
+ if (kIsSigned) {
+ if (kUse64Bit) {
+ return FastIntToBufferBackward(static_cast<int64_t>(i), buffer_end,
+ exact_digit_count);
+ } else {
+ return FastIntToBufferBackward(static_cast<int32_t>(i), buffer_end,
+ exact_digit_count);
+ }
+ } else {
+ if (kUse64Bit) {
+ return FastIntToBufferBackward(static_cast<uint64_t>(i), buffer_end,
+ exact_digit_count);
+ } else {
+ return FastIntToBufferBackward(static_cast<uint32_t>(i), buffer_end,
+ exact_digit_count);
+ }
+ }
+}
+
// Implementation of SimpleAtoi, generalized to support arbitrary base (used
// with base different from 10 elsewhere in Abseil implementation).
template <typename int_type>
-Y_ABSL_MUST_USE_RESULT bool safe_strtoi_base(y_absl::string_view s, int_type* out,
+Y_ABSL_MUST_USE_RESULT bool safe_strtoi_base(y_absl::string_view s,
+ y_absl::Nonnull<int_type*> out,
int base) {
static_assert(sizeof(*out) == 4 || sizeof(*out) == 8,
"SimpleAtoi works only with 32-bit or 64-bit integers.");
@@ -237,7 +393,7 @@ Y_ABSL_MUST_USE_RESULT bool safe_strtoi_base(y_absl::string_view s, int_type* ou
// without the terminating null character. Thus `out` must be of length >= 16.
// Returns the number of non-pad digits of the output (it can never be zero
// since 0 has one digit).
-inline size_t FastHexToBufferZeroPad16(uint64_t val, char* out) {
+inline size_t FastHexToBufferZeroPad16(uint64_t val, y_absl::Nonnull<char*> out) {
#ifdef Y_ABSL_INTERNAL_HAVE_SSSE3
uint64_t be = y_absl::big_endian::FromHost64(val);
const auto kNibbleMask = _mm_set1_epi8(0xf);
@@ -263,32 +419,34 @@ inline size_t FastHexToBufferZeroPad16(uint64_t val, char* out) {
} // namespace numbers_internal
template <typename int_type>
-Y_ABSL_MUST_USE_RESULT bool SimpleAtoi(y_absl::string_view str, int_type* out) {
+Y_ABSL_MUST_USE_RESULT bool SimpleAtoi(y_absl::string_view str,
+ y_absl::Nonnull<int_type*> out) {
return numbers_internal::safe_strtoi_base(str, out, 10);
}
Y_ABSL_MUST_USE_RESULT inline bool SimpleAtoi(y_absl::string_view str,
- y_absl::int128* out) {
+ y_absl::Nonnull<y_absl::int128*> out) {
return numbers_internal::safe_strto128_base(str, out, 10);
}
Y_ABSL_MUST_USE_RESULT inline bool SimpleAtoi(y_absl::string_view str,
- y_absl::uint128* out) {
+ y_absl::Nonnull<y_absl::uint128*> out) {
return numbers_internal::safe_strtou128_base(str, out, 10);
}
template <typename int_type>
-Y_ABSL_MUST_USE_RESULT bool SimpleHexAtoi(y_absl::string_view str, int_type* out) {
+Y_ABSL_MUST_USE_RESULT bool SimpleHexAtoi(y_absl::string_view str,
+ y_absl::Nonnull<int_type*> out) {
return numbers_internal::safe_strtoi_base(str, out, 16);
}
-Y_ABSL_MUST_USE_RESULT inline bool SimpleHexAtoi(y_absl::string_view str,
- y_absl::int128* out) {
+Y_ABSL_MUST_USE_RESULT inline bool SimpleHexAtoi(
+ y_absl::string_view str, y_absl::Nonnull<y_absl::int128*> out) {
return numbers_internal::safe_strto128_base(str, out, 16);
}
-Y_ABSL_MUST_USE_RESULT inline bool SimpleHexAtoi(y_absl::string_view str,
- y_absl::uint128* out) {
+Y_ABSL_MUST_USE_RESULT inline bool SimpleHexAtoi(
+ y_absl::string_view str, y_absl::Nonnull<y_absl::uint128*> out) {
return numbers_internal::safe_strtou128_base(str, out, 16);
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_cat.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_cat.cc
index 36ebfbeb1f2..2f74723a54b 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_cat.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_cat.cc
@@ -16,13 +16,15 @@
#include <assert.h>
-#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <cstring>
+#include <initializer_list>
#include <util/generic/string.h>
+#include <type_traits>
-#include "y_absl/strings/ascii.h"
+#include "y_absl/base/config.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/strings/internal/resize_uninitialized.h"
#include "y_absl/strings/numbers.h"
#include "y_absl/strings/string_view.h"
@@ -30,6 +32,7 @@
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
+
// ----------------------------------------------------------------------
// StrCat()
// This merges the given strings or integers, with no delimiter. This
@@ -37,9 +40,10 @@ Y_ABSL_NAMESPACE_BEGIN
// of a mix of raw C strings, string_views, strings, and integer values.
// ----------------------------------------------------------------------
+namespace {
// Append is merely a version of memcpy that returns the address of the byte
// after the area just overwritten.
-static char* Append(char* out, const AlphaNum& x) {
+y_absl::Nonnull<char*> Append(y_absl::Nonnull<char*> out, const AlphaNum& x) {
// memcpy is allowed to overwrite arbitrary memory, so doing this after the
// call would force an extra fetch of x.size().
char* after = out + x.size();
@@ -49,6 +53,8 @@ static char* Append(char* out, const AlphaNum& x) {
return after;
}
+} // namespace
+
TString StrCat(const AlphaNum& a, const AlphaNum& b) {
TString result;
y_absl::strings_internal::STLStringResizeUninitialized(&result,
@@ -92,6 +98,130 @@ TString StrCat(const AlphaNum& a, const AlphaNum& b, const AlphaNum& c,
namespace strings_internal {
// Do not call directly - these are not part of the public API.
+void STLStringAppendUninitializedAmortized(TString* dest,
+ size_t to_append) {
+ strings_internal::AppendUninitializedTraits<TString>::Append(dest,
+ to_append);
+}
+
+template <typename Integer>
+std::enable_if_t<std::is_integral<Integer>::value, TString> IntegerToString(
+ Integer i) {
+ TString str;
+ const auto /* either bool or std::false_type */ is_negative =
+ y_absl::numbers_internal::IsNegative(i);
+ const uint32_t digits = y_absl::numbers_internal::Base10Digits(
+ y_absl::numbers_internal::UnsignedAbsoluteValue(i));
+ y_absl::strings_internal::STLStringResizeUninitialized(
+ &str, digits + static_cast<uint32_t>(is_negative));
+ y_absl::numbers_internal::FastIntToBufferBackward(i, &str[str.size()], digits);
+ return str;
+}
+
+template <>
+TString IntegerToString(long i) { // NOLINT
+ if (sizeof(i) <= sizeof(int)) {
+ return IntegerToString(static_cast<int>(i));
+ } else {
+ return IntegerToString(static_cast<long long>(i)); // NOLINT
+ }
+}
+
+template <>
+TString IntegerToString(unsigned long i) { // NOLINT
+ if (sizeof(i) <= sizeof(unsigned int)) {
+ return IntegerToString(static_cast<unsigned int>(i));
+ } else {
+ return IntegerToString(static_cast<unsigned long long>(i)); // NOLINT
+ }
+}
+
+template <typename Float>
+std::enable_if_t<std::is_floating_point<Float>::value, TString>
+FloatToString(Float f) {
+ TString result;
+ strings_internal::STLStringResizeUninitialized(
+ &result, numbers_internal::kSixDigitsToBufferSize);
+ char* start = &result[0];
+ result.erase(numbers_internal::SixDigitsToBuffer(f, start));
+ return result;
+}
+
+TString SingleArgStrCat(int x) { return IntegerToString(x); }
+TString SingleArgStrCat(unsigned int x) { return IntegerToString(x); }
+// NOLINTNEXTLINE
+TString SingleArgStrCat(long x) { return IntegerToString(x); }
+// NOLINTNEXTLINE
+TString SingleArgStrCat(unsigned long x) { return IntegerToString(x); }
+// NOLINTNEXTLINE
+TString SingleArgStrCat(long long x) { return IntegerToString(x); }
+// NOLINTNEXTLINE
+TString SingleArgStrCat(unsigned long long x) { return IntegerToString(x); }
+TString SingleArgStrCat(float x) { return FloatToString(x); }
+TString SingleArgStrCat(double x) { return FloatToString(x); }
+
+template <class Integer>
+std::enable_if_t<std::is_integral<Integer>::value, void> AppendIntegerToString(
+ TString& str, Integer i) {
+ const auto /* either bool or std::false_type */ is_negative =
+ y_absl::numbers_internal::IsNegative(i);
+ const uint32_t digits = y_absl::numbers_internal::Base10Digits(
+ y_absl::numbers_internal::UnsignedAbsoluteValue(i));
+ y_absl::strings_internal::STLStringAppendUninitializedAmortized(
+ &str, digits + static_cast<uint32_t>(is_negative));
+ y_absl::numbers_internal::FastIntToBufferBackward(i, &str[str.size()], digits);
+}
+
+template <>
+void AppendIntegerToString(TString& str, long i) { // NOLINT
+ if (sizeof(i) <= sizeof(int)) {
+ return AppendIntegerToString(str, static_cast<int>(i));
+ } else {
+ return AppendIntegerToString(str, static_cast<long long>(i)); // NOLINT
+ }
+}
+
+template <>
+void AppendIntegerToString(TString& str,
+ unsigned long i) { // NOLINT
+ if (sizeof(i) <= sizeof(unsigned int)) {
+ return AppendIntegerToString(str, static_cast<unsigned int>(i));
+ } else {
+ return AppendIntegerToString(str,
+ static_cast<unsigned long long>(i)); // NOLINT
+ }
+}
+
+// `SingleArgStrAppend` overloads are defined here for the same reasons as with
+// `SingleArgStrCat` above.
+void SingleArgStrAppend(TString& str, int x) {
+ return AppendIntegerToString(str, x);
+}
+
+void SingleArgStrAppend(TString& str, unsigned int x) {
+ return AppendIntegerToString(str, x);
+}
+
+// NOLINTNEXTLINE
+void SingleArgStrAppend(TString& str, long x) {
+ return AppendIntegerToString(str, x);
+}
+
+// NOLINTNEXTLINE
+void SingleArgStrAppend(TString& str, unsigned long x) {
+ return AppendIntegerToString(str, x);
+}
+
+// NOLINTNEXTLINE
+void SingleArgStrAppend(TString& str, long long x) {
+ return AppendIntegerToString(str, x);
+}
+
+// NOLINTNEXTLINE
+void SingleArgStrAppend(TString& str, unsigned long long x) {
+ return AppendIntegerToString(str, x);
+}
+
TString CatPieces(std::initializer_list<y_absl::string_view> pieces) {
TString result;
size_t total_size = 0;
@@ -120,15 +250,15 @@ TString CatPieces(std::initializer_list<y_absl::string_view> pieces) {
assert(((src).size() == 0) || \
(uintptr_t((src).data() - (dest).data()) > uintptr_t((dest).size())))
-void AppendPieces(TString* dest,
+void AppendPieces(y_absl::Nonnull<TString*> dest,
std::initializer_list<y_absl::string_view> pieces) {
size_t old_size = dest->size();
- size_t total_size = old_size;
+ size_t to_append = 0;
for (y_absl::string_view piece : pieces) {
ASSERT_NO_OVERLAP(*dest, piece);
- total_size += piece.size();
+ to_append += piece.size();
}
- strings_internal::STLStringResizeUninitializedAmortized(dest, total_size);
+ strings_internal::STLStringAppendUninitializedAmortized(dest, to_append);
char* const begin = &(*dest)[0];
char* out = begin + old_size;
@@ -144,23 +274,23 @@ void AppendPieces(TString* dest,
} // namespace strings_internal
-void StrAppend(TString* dest, const AlphaNum& a) {
+void StrAppend(y_absl::Nonnull<TString*> dest, const AlphaNum& a) {
ASSERT_NO_OVERLAP(*dest, a);
TString::size_type old_size = dest->size();
- strings_internal::STLStringResizeUninitializedAmortized(dest,
- old_size + a.size());
+ strings_internal::STLStringAppendUninitializedAmortized(dest, a.size());
char* const begin = &(*dest)[0];
char* out = begin + old_size;
out = Append(out, a);
assert(out == begin + dest->size());
}
-void StrAppend(TString* dest, const AlphaNum& a, const AlphaNum& b) {
+void StrAppend(y_absl::Nonnull<TString*> dest, const AlphaNum& a,
+ const AlphaNum& b) {
ASSERT_NO_OVERLAP(*dest, a);
ASSERT_NO_OVERLAP(*dest, b);
TString::size_type old_size = dest->size();
- strings_internal::STLStringResizeUninitializedAmortized(
- dest, old_size + a.size() + b.size());
+ strings_internal::STLStringAppendUninitializedAmortized(dest,
+ a.size() + b.size());
char* const begin = &(*dest)[0];
char* out = begin + old_size;
out = Append(out, a);
@@ -168,14 +298,14 @@ void StrAppend(TString* dest, const AlphaNum& a, const AlphaNum& b) {
assert(out == begin + dest->size());
}
-void StrAppend(TString* dest, const AlphaNum& a, const AlphaNum& b,
- const AlphaNum& c) {
+void StrAppend(y_absl::Nonnull<TString*> dest, const AlphaNum& a,
+ const AlphaNum& b, const AlphaNum& c) {
ASSERT_NO_OVERLAP(*dest, a);
ASSERT_NO_OVERLAP(*dest, b);
ASSERT_NO_OVERLAP(*dest, c);
TString::size_type old_size = dest->size();
- strings_internal::STLStringResizeUninitializedAmortized(
- dest, old_size + a.size() + b.size() + c.size());
+ strings_internal::STLStringAppendUninitializedAmortized(
+ dest, a.size() + b.size() + c.size());
char* const begin = &(*dest)[0];
char* out = begin + old_size;
out = Append(out, a);
@@ -184,15 +314,15 @@ void StrAppend(TString* dest, const AlphaNum& a, const AlphaNum& b,
assert(out == begin + dest->size());
}
-void StrAppend(TString* dest, const AlphaNum& a, const AlphaNum& b,
- const AlphaNum& c, const AlphaNum& d) {
+void StrAppend(y_absl::Nonnull<TString*> dest, const AlphaNum& a,
+ const AlphaNum& b, const AlphaNum& c, const AlphaNum& d) {
ASSERT_NO_OVERLAP(*dest, a);
ASSERT_NO_OVERLAP(*dest, b);
ASSERT_NO_OVERLAP(*dest, c);
ASSERT_NO_OVERLAP(*dest, d);
TString::size_type old_size = dest->size();
- strings_internal::STLStringResizeUninitializedAmortized(
- dest, old_size + a.size() + b.size() + c.size() + d.size());
+ strings_internal::STLStringAppendUninitializedAmortized(
+ dest, a.size() + b.size() + c.size() + d.size());
char* const begin = &(*dest)[0];
char* out = begin + old_size;
out = Append(out, a);
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_cat.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_cat.h
index 37de3bf9cd5..62f7112d8cf 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_cat.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_cat.h
@@ -89,6 +89,8 @@
#include <algorithm>
#include <array>
+#include <cassert>
+#include <cstddef>
#include <cstdint>
#include <cstring>
#include <util/generic/string.h>
@@ -97,8 +99,11 @@
#include <vector>
#include "y_absl/base/attributes.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/base/port.h"
-#include "y_absl/strings/internal/has_absl_stringify.h"
+#include "y_absl/meta/type_traits.h"
+#include "y_absl/strings/has_absl_stringify.h"
+#include "y_absl/strings/internal/resize_uninitialized.h"
#include "y_absl/strings/internal/stringify_sink.h"
#include "y_absl/strings/numbers.h"
#include "y_absl/strings/string_view.h"
@@ -201,7 +206,7 @@ struct Hex {
!std::is_pointer<Int>::value>::type* = nullptr)
: Hex(spec, static_cast<uint64_t>(v)) {}
template <typename Pointee>
- explicit Hex(Pointee* v, PadSpec spec = y_absl::kNoPad)
+ explicit Hex(y_absl::Nullable<Pointee*> v, PadSpec spec = y_absl::kNoPad)
: Hex(spec, reinterpret_cast<uintptr_t>(v)) {}
template <typename S>
@@ -253,10 +258,9 @@ struct Dec {
typename std::enable_if<(sizeof(Int) <= 8)>::type* = nullptr)
: value(v >= 0 ? static_cast<uint64_t>(v)
: uint64_t{0} - static_cast<uint64_t>(v)),
- width(spec == y_absl::kNoPad
- ? 1
- : spec >= y_absl::kSpacePad2 ? spec - y_absl::kSpacePad2 + 2
- : spec - y_absl::kZeroPad2 + 2),
+ width(spec == y_absl::kNoPad ? 1
+ : spec >= y_absl::kSpacePad2 ? spec - y_absl::kSpacePad2 + 2
+ : spec - y_absl::kZeroPad2 + 2),
fill(spec >= y_absl::kSpacePad2 ? ' ' : '0'),
neg(v < 0) {}
@@ -344,7 +348,7 @@ class AlphaNum {
Y_ABSL_ATTRIBUTE_LIFETIME_BOUND)
: piece_(&buf.data[0], buf.size) {}
- AlphaNum(const char* c_str // NOLINT(runtime/explicit)
+ AlphaNum(y_absl::Nullable<const char*> c_str // NOLINT(runtime/explicit)
Y_ABSL_ATTRIBUTE_LIFETIME_BOUND)
: piece_(NullSafeStringView(c_str)) {}
AlphaNum(y_absl::string_view pc // NOLINT(runtime/explicit)
@@ -352,7 +356,7 @@ class AlphaNum {
: piece_(pc) {}
template <typename T, typename = typename std::enable_if<
- strings_internal::HasAbslStringify<T>::value>::type>
+ HasAbslStringify<T>::value>::type>
AlphaNum( // NOLINT(runtime/explicit)
const T& v Y_ABSL_ATTRIBUTE_LIFETIME_BOUND,
strings_internal::StringifySink&& sink Y_ABSL_ATTRIBUTE_LIFETIME_BOUND = {})
@@ -374,7 +378,7 @@ class AlphaNum {
AlphaNum& operator=(const AlphaNum&) = delete;
y_absl::string_view::size_type size() const { return piece_.size(); }
- const char* data() const { return piece_.data(); }
+ y_absl::Nullable<const char*> data() const { return piece_.data(); }
y_absl::string_view Piece() const { return piece_; }
// Match unscoped enums. Use integral promotion so that a `char`-backed
@@ -382,17 +386,17 @@ class AlphaNum {
template <typename T,
typename = typename std::enable_if<
std::is_enum<T>{} && std::is_convertible<T, int>{} &&
- !strings_internal::HasAbslStringify<T>::value>::type>
+ !HasAbslStringify<T>::value>::type>
AlphaNum(T e) // NOLINT(runtime/explicit)
: AlphaNum(+e) {}
// This overload matches scoped enums. We must explicitly cast to the
// underlying type, but use integral promotion for the same reason as above.
template <typename T,
- typename std::enable_if<
- std::is_enum<T>{} && !std::is_convertible<T, int>{} &&
- !strings_internal::HasAbslStringify<T>::value,
- char*>::type = nullptr>
+ typename std::enable_if<std::is_enum<T>{} &&
+ !std::is_convertible<T, int>{} &&
+ !HasAbslStringify<T>::value,
+ char*>::type = nullptr>
AlphaNum(T e) // NOLINT(runtime/explicit)
: AlphaNum(+static_cast<typename std::underlying_type<T>::type>(e)) {}
@@ -444,13 +448,48 @@ namespace strings_internal {
// Do not call directly - this is not part of the public API.
TString CatPieces(std::initializer_list<y_absl::string_view> pieces);
-void AppendPieces(TString* dest,
+void AppendPieces(y_absl::Nonnull<TString*> dest,
std::initializer_list<y_absl::string_view> pieces);
+void STLStringAppendUninitializedAmortized(TString* dest, size_t to_append);
+
+// `SingleArgStrCat` overloads take built-in `int`, `long` and `long long` types
+// (signed / unsigned) to avoid ambiguity on the call side. If we used int32_t
+// and int64_t, then at least one of the three (`int` / `long` / `long long`)
+// would have been ambiguous when passed to `SingleArgStrCat`.
+TString SingleArgStrCat(int x);
+TString SingleArgStrCat(unsigned int x);
+TString SingleArgStrCat(long x); // NOLINT
+TString SingleArgStrCat(unsigned long x); // NOLINT
+TString SingleArgStrCat(long long x); // NOLINT
+TString SingleArgStrCat(unsigned long long x); // NOLINT
+TString SingleArgStrCat(float x);
+TString SingleArgStrCat(double x);
+
+// `SingleArgStrAppend` overloads are defined here for the same reasons as with
+// `SingleArgStrCat` above.
+void SingleArgStrAppend(TString& str, int x);
+void SingleArgStrAppend(TString& str, unsigned int x);
+void SingleArgStrAppend(TString& str, long x); // NOLINT
+void SingleArgStrAppend(TString& str, unsigned long x); // NOLINT
+void SingleArgStrAppend(TString& str, long long x); // NOLINT
+void SingleArgStrAppend(TString& str, unsigned long long x); // NOLINT
+
+template <typename T,
+ typename = std::enable_if_t<std::is_arithmetic<T>::value &&
+ !std::is_same<T, char>::value &&
+ !std::is_same<T, bool>::value>>
+using EnableIfFastCase = T;
+
} // namespace strings_internal
Y_ABSL_MUST_USE_RESULT inline TString StrCat() { return TString(); }
+template <typename T>
+Y_ABSL_MUST_USE_RESULT inline TString StrCat(
+ strings_internal::EnableIfFastCase<T> a) {
+ return strings_internal::SingleArgStrCat(a);
+}
Y_ABSL_MUST_USE_RESULT inline TString StrCat(const AlphaNum& a) {
return TString(a.data(), a.size());
}
@@ -498,24 +537,88 @@ Y_ABSL_MUST_USE_RESULT inline TString StrCat(
// y_absl::string_view p = s;
// StrAppend(&s, p);
-inline void StrAppend(TString*) {}
-void StrAppend(TString* dest, const AlphaNum& a);
-void StrAppend(TString* dest, const AlphaNum& a, const AlphaNum& b);
-void StrAppend(TString* dest, const AlphaNum& a, const AlphaNum& b,
- const AlphaNum& c);
-void StrAppend(TString* dest, const AlphaNum& a, const AlphaNum& b,
- const AlphaNum& c, const AlphaNum& d);
+inline void StrAppend(y_absl::Nonnull<TString*>) {}
+void StrAppend(y_absl::Nonnull<TString*> dest, const AlphaNum& a);
+void StrAppend(y_absl::Nonnull<TString*> dest, const AlphaNum& a,
+ const AlphaNum& b);
+void StrAppend(y_absl::Nonnull<TString*> dest, const AlphaNum& a,
+ const AlphaNum& b, const AlphaNum& c);
+void StrAppend(y_absl::Nonnull<TString*> dest, const AlphaNum& a,
+ const AlphaNum& b, const AlphaNum& c, const AlphaNum& d);
// Support 5 or more arguments
template <typename... AV>
-inline void StrAppend(TString* dest, const AlphaNum& a, const AlphaNum& b,
- const AlphaNum& c, const AlphaNum& d, const AlphaNum& e,
- const AV&... args) {
+inline void StrAppend(y_absl::Nonnull<TString*> dest, const AlphaNum& a,
+ const AlphaNum& b, const AlphaNum& c, const AlphaNum& d,
+ const AlphaNum& e, const AV&... args) {
strings_internal::AppendPieces(
dest, {a.Piece(), b.Piece(), c.Piece(), d.Piece(), e.Piece(),
static_cast<const AlphaNum&>(args).Piece()...});
}
+template <class String, class T>
+std::enable_if_t<
+ std::is_integral<y_absl::strings_internal::EnableIfFastCase<T>>::value, void>
+StrAppend(y_absl::Nonnull<String*> result, T i) {
+ return y_absl::strings_internal::SingleArgStrAppend(*result, i);
+}
+
+// This overload is only selected if all the parameters are numbers that can be
+// handled quickly.
+// Later we can look into how we can extend this to more general argument
+// mixtures without bloating codegen too much, or copying unnecessarily.
+#ifndef __NVCC__
+template <typename String, typename... T>
+std::enable_if_t<
+ (sizeof...(T) > 1),
+ std::common_type_t<std::conditional_t<
+ true, void, y_absl::strings_internal::EnableIfFastCase<T>>...>>
+StrAppend(y_absl::Nonnull<String*> str, T... args) {
+ // Do not add unnecessary variables, logic, or even "free" lambdas here.
+ // They can add overhead for the compiler and/or at run time.
+ // Furthermore, assume this function will be inlined.
+ // This function is carefully tailored to be able to be largely optimized away
+ // so that it becomes near-equivalent to the caller handling each argument
+ // individually while minimizing register pressure, so that the compiler
+ // can inline it with minimal overhead.
+
+ // First, calculate the total length, so we can perform just a single resize.
+ // Save all the lengths for later.
+ size_t total_length = 0;
+ const ptrdiff_t lengths[] = {
+ y_absl::numbers_internal::GetNumDigitsOrNegativeIfNegative(args)...};
+ for (const ptrdiff_t possibly_negative_length : lengths) {
+ // Lengths are negative for negative numbers. Keep them for later use, but
+ // take their absolute values for calculating total lengths;
+ total_length += possibly_negative_length < 0
+ ? static_cast<size_t>(-possibly_negative_length)
+ : static_cast<size_t>(possibly_negative_length);
+ }
+
+ // Now reserve space for all the arguments.
+ const size_t old_size = str->size();
+ y_absl::strings_internal::STLStringAppendUninitializedAmortized(str,
+ total_length);
+
+ // Finally, output each argument one-by-one, from left to right.
+ size_t i = 0; // The current argument we're processing
+ ptrdiff_t n; // The length of the current argument
+ typename String::pointer pos = &(*str)[old_size];
+ using SomeTrivialEmptyType = std::false_type;
+ // Ugly code due to the lack of C++14 fold expression makes us.
+ const SomeTrivialEmptyType dummy1;
+ for (const SomeTrivialEmptyType& dummy2 :
+ {(/* Comma expressions are poor man's C++17 fold expression for C++14 */
+ (void)(n = lengths[i]),
+ (void)(n < 0 ? (void)(*pos++ = '-'), (n = ~n) : 0),
+ (void)y_absl::numbers_internal::FastIntToBufferBackward(
+ y_absl::numbers_internal::UnsignedAbsoluteValue(std::move(args)),
+ pos += n, static_cast<uint32_t>(n)),
+ (void)++i, dummy1)...}) {
+ (void)dummy2; // Remove & migrate to fold expressions in C++17
+ }
+}
+#endif
// Helper function for the future StrCat default floating-point format, %.6g
// This is fast.
inline strings_internal::AlphaNumBuffer<
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_format.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_format.h
index ccf0a48c1c4..63c6b4505f3 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_format.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_format.h
@@ -72,14 +72,21 @@
#ifndef Y_ABSL_STRINGS_STR_FORMAT_H_
#define Y_ABSL_STRINGS_STR_FORMAT_H_
+#include <cstdint>
#include <cstdio>
#include <util/generic/string.h>
+#include <type_traits>
+#include "y_absl/base/attributes.h"
+#include "y_absl/base/config.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/strings/internal/str_format/arg.h" // IWYU pragma: export
#include "y_absl/strings/internal/str_format/bind.h" // IWYU pragma: export
#include "y_absl/strings/internal/str_format/checker.h" // IWYU pragma: export
#include "y_absl/strings/internal/str_format/extension.h" // IWYU pragma: export
#include "y_absl/strings/internal/str_format/parser.h" // IWYU pragma: export
+#include "y_absl/strings/string_view.h"
+#include "y_absl/types/span.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
@@ -104,7 +111,8 @@ class UntypedFormatSpec {
explicit UntypedFormatSpec(string_view s) : spec_(s) {}
protected:
- explicit UntypedFormatSpec(const str_format_internal::ParsedFormatBase* pc)
+ explicit UntypedFormatSpec(
+ y_absl::Nonnull<const str_format_internal::ParsedFormatBase*> pc)
: spec_(pc) {}
private:
@@ -144,7 +152,7 @@ str_format_internal::StreamedWrapper<T> FormatStreamed(const T& v) {
// EXPECT_EQ(8, n);
class FormatCountCapture {
public:
- explicit FormatCountCapture(int* p) : p_(p) {}
+ explicit FormatCountCapture(y_absl::Nonnull<int*> p) : p_(p) {}
private:
// FormatCountCaptureHelper is used to define FormatConvertImpl() for this
@@ -153,8 +161,8 @@ class FormatCountCapture {
// Unused() is here because of the false positive from -Wunused-private-field
// p_ is used in the templated function of the friend FormatCountCaptureHelper
// class.
- int* Unused() { return p_; }
- int* p_;
+ y_absl::Nonnull<int*> Unused() { return p_; }
+ y_absl::Nonnull<int*> p_;
};
// FormatSpec
@@ -250,13 +258,13 @@ class FormatCountCapture {
// `v` uses `d` for signed integer values, `u` for unsigned integer values, `g`
// for floating point values, and formats boolean values as "true"/"false"
// (instead of 1 or 0 for booleans formatted using d). `const char*` is not
-// supported; please use `std:string` and `string_view`. `char` is also not
+// supported; please use `TString` and `string_view`. `char` is also not
// supported due to ambiguity of the type. This specifier does not support
// modifiers.
//
// The `FormatSpec` intrinsically supports all of these fundamental C++ types:
//
-// * Characters: `char`, `signed char`, `unsigned char`
+// * Characters: `char`, `signed char`, `unsigned char`, `wchar_t`
// * Integers: `int`, `short`, `unsigned short`, `unsigned`, `long`,
// `unsigned long`, `long long`, `unsigned long long`
// * Enums: printed as their underlying integral value
@@ -264,9 +272,9 @@ class FormatCountCapture {
//
// However, in the `str_format` library, a format conversion specifies a broader
// C++ conceptual category instead of an exact type. For example, `%s` binds to
-// any string-like argument, so `TString`, `y_absl::string_view`, and
-// `const char*` are all accepted. Likewise, `%d` accepts any integer-like
-// argument, etc.
+// any string-like argument, so `TString`, `std::wstring`,
+// `y_absl::string_view`, `const char*`, and `const wchar_t*` are all accepted.
+// Likewise, `%d` accepts any integer-like argument, etc.
template <typename... Args>
using FormatSpec = str_format_internal::FormatSpecTemplate<
@@ -287,8 +295,8 @@ using FormatSpec = str_format_internal::FormatSpecTemplate<
// Example:
//
// // Verified at compile time.
-// y_absl::ParsedFormat<'s', 'd'> formatString("Welcome to %s, Number %d!");
-// y_absl::StrFormat(formatString, "TheVillage", 6);
+// y_absl::ParsedFormat<'s', 'd'> format_string("Welcome to %s, Number %d!");
+// y_absl::StrFormat(format_string, "TheVillage", 6);
//
// // Verified at runtime.
// auto format_runtime = y_absl::ParsedFormat<'d'>::New(format_string);
@@ -369,7 +377,7 @@ Y_ABSL_MUST_USE_RESULT TString StrFormat(const FormatSpec<Args...>& format,
// TString orig("For example PI is approximately ");
// std::cout << StrAppendFormat(&orig, "%12.6f", 3.14);
template <typename... Args>
-TString& StrAppendFormat(TString* dst,
+TString& StrAppendFormat(y_absl::Nonnull<TString*> dst,
const FormatSpec<Args...>& format,
const Args&... args) {
return str_format_internal::AppendPack(
@@ -381,7 +389,7 @@ TString& StrAppendFormat(TString* dst,
//
// Writes to an output stream given a format string and zero or more arguments,
// generally in a manner that is more efficient than streaming the result of
-// `y_absl:: StrFormat()`. The returned object must be streamed before the full
+// `y_absl::StrFormat()`. The returned object must be streamed before the full
// expression ends.
//
// Example:
@@ -429,7 +437,7 @@ int PrintF(const FormatSpec<Args...>& format, const Args&... args) {
// Outputs: "The capital of Mongolia is Ulaanbaatar"
//
template <typename... Args>
-int FPrintF(std::FILE* output, const FormatSpec<Args...>& format,
+int FPrintF(y_absl::Nonnull<std::FILE*> output, const FormatSpec<Args...>& format,
const Args&... args) {
return str_format_internal::FprintF(
output, str_format_internal::UntypedFormatSpecImpl::Extract(format),
@@ -458,8 +466,8 @@ int FPrintF(std::FILE* output, const FormatSpec<Args...>& format,
// Post-condition: output == "The capital of Mongolia is Ulaanbaatar"
//
template <typename... Args>
-int SNPrintF(char* output, std::size_t size, const FormatSpec<Args...>& format,
- const Args&... args) {
+int SNPrintF(y_absl::Nonnull<char*> output, std::size_t size,
+ const FormatSpec<Args...>& format, const Args&... args) {
return str_format_internal::SnprintF(
output, size, str_format_internal::UntypedFormatSpecImpl::Extract(format),
{str_format_internal::FormatArgImpl(args)...});
@@ -492,7 +500,7 @@ class FormatRawSink {
template <typename T,
typename = typename std::enable_if<std::is_constructible<
str_format_internal::FormatRawSinkImpl, T*>::value>::type>
- FormatRawSink(T* raw) // NOLINT
+ FormatRawSink(y_absl::Nonnull<T*> raw) // NOLINT
: sink_(raw) {}
private:
@@ -849,14 +857,16 @@ class FormatSink {
}
// Support `y_absl::Format(&sink, format, args...)`.
- friend void AbslFormatFlush(FormatSink* sink, y_absl::string_view v) {
+ friend void AbslFormatFlush(y_absl::Nonnull<FormatSink*> sink,
+ y_absl::string_view v) {
sink->Append(v);
}
private:
friend str_format_internal::FormatSinkImpl;
- explicit FormatSink(str_format_internal::FormatSinkImpl* s) : sink_(s) {}
- str_format_internal::FormatSinkImpl* sink_;
+ explicit FormatSink(y_absl::Nonnull<str_format_internal::FormatSinkImpl*> s)
+ : sink_(s) {}
+ y_absl::Nonnull<str_format_internal::FormatSinkImpl*> sink_;
};
// FormatConvertResult
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_join.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_join.h
index f23fe9d102f..9fc0f37af54 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_join.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_join.h
@@ -80,7 +80,7 @@ Y_ABSL_NAMESPACE_BEGIN
// y_absl::StrJoin(v, ", ", [](TString* out, y_absl::Duration dur) {
// y_absl::StrAppend(out, y_absl::FormatDuration(dur));
// });
-// EXPECT_EQ("1s, 10ms", s);
+// EXPECT_EQ(s, "1s, 10ms");
//
// The following standard formatters are provided within this file:
//
@@ -164,21 +164,21 @@ DereferenceFormatter() {
// // of `y_absl::string_view` or even `const char*`.
// std::vector<TString> v = {"foo", "bar", "baz"};
// TString s = y_absl::StrJoin(v, "-");
-// EXPECT_EQ("foo-bar-baz", s);
+// EXPECT_EQ(s, "foo-bar-baz");
//
// Example 2:
// // Joins the values in the given `std::initializer_list<>` specified using
// // brace initialization. This pattern also works with an initializer_list
// // of ints or `y_absl::string_view` -- any `AlphaNum`-compatible type.
// TString s = y_absl::StrJoin({"foo", "bar", "baz"}, "-");
-// EXPECT_EQ("foo-bar-baz", s);
+// EXPECT_EQs, "foo-bar-baz");
//
// Example 3:
// // Joins a collection of ints. This pattern also works with floats,
// // doubles, int64s -- any `StrCat()`-compatible type.
// std::vector<int> v = {1, 2, 3, -4};
// TString s = y_absl::StrJoin(v, "-");
-// EXPECT_EQ("1-2-3--4", s);
+// EXPECT_EQ(s, "1-2-3--4");
//
// Example 4:
// // Joins a collection of pointer-to-int. By default, pointers are
@@ -189,7 +189,7 @@ DereferenceFormatter() {
// int x = 1, y = 2, z = 3;
// std::vector<int*> v = {&x, &y, &z};
// TString s = y_absl::StrJoin(v, "-");
-// EXPECT_EQ("1-2-3", s);
+// EXPECT_EQ(s, "1-2-3");
//
// Example 5:
// // Dereferencing of `std::unique_ptr<>` is also supported:
@@ -198,42 +198,42 @@ DereferenceFormatter() {
// v.emplace_back(new int(2));
// v.emplace_back(new int(3));
// TString s = y_absl::StrJoin(v, "-");
-// EXPECT_EQ("1-2-3", s);
+// EXPECT_EQ(s, "1-2-3");
//
// Example 6:
// // Joins a `std::map`, with each key-value pair separated by an equals
// // sign. This pattern would also work with, say, a
// // `std::vector<std::pair<>>`.
// std::map<TString, int> m = {
-// std::make_pair("a", 1),
-// std::make_pair("b", 2),
-// std::make_pair("c", 3)};
+// {"a", 1},
+// {"b", 2},
+// {"c", 3}};
// TString s = y_absl::StrJoin(m, ",", y_absl::PairFormatter("="));
-// EXPECT_EQ("a=1,b=2,c=3", s);
+// EXPECT_EQ(s, "a=1,b=2,c=3");
//
// Example 7:
// // These examples show how `y_absl::StrJoin()` handles a few common edge
// // cases:
// std::vector<TString> v_empty;
-// EXPECT_EQ("", y_absl::StrJoin(v_empty, "-"));
+// EXPECT_EQ(y_absl::StrJoin(v_empty, "-"), "");
//
// std::vector<TString> v_one_item = {"foo"};
-// EXPECT_EQ("foo", y_absl::StrJoin(v_one_item, "-"));
+// EXPECT_EQ(y_absl::StrJoin(v_one_item, "-"), "foo");
//
// std::vector<TString> v_empty_string = {""};
-// EXPECT_EQ("", y_absl::StrJoin(v_empty_string, "-"));
+// EXPECT_EQ(y_absl::StrJoin(v_empty_string, "-"), "");
//
// std::vector<TString> v_one_item_empty_string = {"a", ""};
-// EXPECT_EQ("a-", y_absl::StrJoin(v_one_item_empty_string, "-"));
+// EXPECT_EQ(y_absl::StrJoin(v_one_item_empty_string, "-"), "a-");
//
// std::vector<TString> v_two_empty_string = {"", ""};
-// EXPECT_EQ("-", y_absl::StrJoin(v_two_empty_string, "-"));
+// EXPECT_EQ(y_absl::StrJoin(v_two_empty_string, "-"), "-");
//
// Example 8:
// // Joins a `std::tuple<T...>` of heterogeneous types, converting each to
// // a TString using the `y_absl::AlphaNum` class.
// TString s = y_absl::StrJoin(std::make_tuple(123, "abc", 0.456), "-");
-// EXPECT_EQ("123-abc-0.456", s);
+// EXPECT_EQ(s, "123-abc-0.456");
template <typename Iterator, typename Formatter>
TString StrJoin(Iterator start, Iterator end, y_absl::string_view sep,
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_replace.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_replace.cc
index 1dc9915ea0f..2c01a16d291 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_replace.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_replace.cc
@@ -14,7 +14,16 @@
#include "y_absl/strings/str_replace.h"
+#include <cstddef>
+#include <initializer_list>
+#include <util/generic/string.h>
+#include <utility>
+#include <vector>
+
+#include "y_absl/base/config.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/string_view.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
@@ -28,8 +37,8 @@ using FixedMapping =
// occurred.
int ApplySubstitutions(
y_absl::string_view s,
- std::vector<strings_internal::ViableSubstitution>* subs_ptr,
- TString* result_ptr) {
+ y_absl::Nonnull<std::vector<strings_internal::ViableSubstitution>*> subs_ptr,
+ y_absl::Nonnull<TString*> result_ptr) {
auto& subs = *subs_ptr;
int substitutions = 0;
size_t pos = 0;
@@ -74,7 +83,7 @@ TString StrReplaceAll(y_absl::string_view s,
}
int StrReplaceAll(strings_internal::FixedMapping replacements,
- TString* target) {
+ y_absl::Nonnull<TString*> target) {
return StrReplaceAll<strings_internal::FixedMapping>(replacements, target);
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_replace.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_replace.h
index af59f42e74a..320e381a4b7 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_replace.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_replace.h
@@ -43,6 +43,7 @@
#include <vector>
#include "y_absl/base/attributes.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/strings/string_view.h"
namespace y_absl {
@@ -113,7 +114,7 @@ TString StrReplaceAll(y_absl::string_view s,
int StrReplaceAll(
std::initializer_list<std::pair<y_absl::string_view, y_absl::string_view>>
replacements,
- TString* target);
+ y_absl::Nonnull<TString*> target);
// Overload of `StrReplaceAll()` to replace patterns within a given output
// string *in place* with replacements provided within a container of key/value
@@ -128,7 +129,8 @@ int StrReplaceAll(
// EXPECT_EQ(count, 2);
// EXPECT_EQ("if (ptr &lt; &amp;foo)", s);
template <typename StrToStrMapping>
-int StrReplaceAll(const StrToStrMapping& replacements, TString* target);
+int StrReplaceAll(const StrToStrMapping& replacements,
+ y_absl::Nonnull<TString*> target);
// Implementation details only, past this point.
namespace strings_internal {
@@ -185,8 +187,8 @@ std::vector<ViableSubstitution> FindSubstitutions(
}
int ApplySubstitutions(y_absl::string_view s,
- std::vector<ViableSubstitution>* subs_ptr,
- TString* result_ptr);
+ y_absl::Nonnull<std::vector<ViableSubstitution>*> subs_ptr,
+ y_absl::Nonnull<TString*> result_ptr);
} // namespace strings_internal
@@ -201,7 +203,8 @@ TString StrReplaceAll(y_absl::string_view s,
}
template <typename StrToStrMapping>
-int StrReplaceAll(const StrToStrMapping& replacements, TString* target) {
+int StrReplaceAll(const StrToStrMapping& replacements,
+ y_absl::Nonnull<TString*> target) {
auto subs = strings_internal::FindSubstitutions(*target, replacements);
if (subs.empty()) return 0;
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_split.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_split.cc
index 02369f47190..744886b48c1 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_split.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_split.cc
@@ -15,16 +15,13 @@
#include "y_absl/strings/str_split.h"
#include <algorithm>
-#include <cassert>
-#include <cstdint>
+#include <cstddef>
#include <cstdlib>
#include <cstring>
-#include <iterator>
-#include <limits>
-#include <memory>
+#include "y_absl/base/config.h"
#include "y_absl/base/internal/raw_logging.h"
-#include "y_absl/strings/ascii.h"
+#include "y_absl/strings/string_view.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
@@ -99,6 +96,11 @@ y_absl::string_view ByString::Find(y_absl::string_view text, size_t pos) const {
return GenericFind(text, delimiter_, pos, LiteralPolicy());
}
+y_absl::string_view ByAsciiWhitespace::Find(y_absl::string_view text,
+ size_t pos) const {
+ return GenericFind(text, " \t\v\f\r\n", pos, AnyOfPolicy());
+}
+
//
// ByChar
//
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_split.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_split.h
index 8cc36e1c6b4..f75a1f18e9e 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_split.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_split.h
@@ -130,6 +130,24 @@ class ByString {
const TString delimiter_;
};
+// ByAsciiWhitespace
+//
+// A sub-string delimiter that splits by ASCII whitespace
+// (space, tab, vertical tab, formfeed, linefeed, or carriage return).
+// Note: you probably want to use y_absl::SkipEmpty() as well!
+//
+// This class is equivalent to ByAnyChar with ASCII whitespace chars.
+//
+// Example:
+//
+// std::vector<TString> v = y_absl::StrSplit(
+// "a b\tc\n d \n", y_absl::ByAsciiWhitespace(), y_absl::SkipEmpty());
+// // v[0] == "a", v[1] == "b", v[2] == "c", v[3] == "d"
+class ByAsciiWhitespace {
+ public:
+ y_absl::string_view Find(y_absl::string_view text, size_t pos) const;
+};
+
// ByChar
//
// A single character delimiter. `ByChar` is functionally equivalent to a
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.cc
index 93c50f0d0ca..7079effe44f 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.cc
@@ -21,6 +21,8 @@
#include <cstring>
#include <ostream>
+#include "y_absl/base/nullability.h"
+
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
@@ -28,8 +30,10 @@ namespace {
// This is significantly faster for case-sensitive matches with very
// few possible matches.
-const char* memmatch(const char* phaystack, size_t haylen, const char* pneedle,
- size_t neelen) {
+y_absl::Nullable<const char*> memmatch(y_absl::Nullable<const char*> phaystack,
+ size_t haylen,
+ y_absl::Nullable<const char*> pneedle,
+ size_t neelen) {
if (0 == neelen) {
return phaystack; // even if haylen is 0
}
@@ -37,8 +41,8 @@ const char* memmatch(const char* phaystack, size_t haylen, const char* pneedle,
const char* match;
const char* hayend = phaystack + haylen - neelen + 1;
- // A static cast is used here to work around the fact that memchr returns
- // a void* on Posix-compliant systems and const void* on Windows.
+ // A static cast is used here as memchr returns a const void *, and pointer
+ // arithmetic is not allowed on pointers to void.
while (
(match = static_cast<const char*>(memchr(
phaystack, pneedle[0], static_cast<size_t>(hayend - phaystack))))) {
@@ -229,7 +233,6 @@ string_view::size_type string_view::find_last_not_of(
return npos;
}
-
#ifdef Y_ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL
constexpr string_view::size_type string_view::npos;
constexpr string_view::size_type string_view::kMaxSize;
@@ -238,4 +241,22 @@ constexpr string_view::size_type string_view::kMaxSize;
Y_ABSL_NAMESPACE_END
} // namespace y_absl
+#else
+
+// https://github.com/abseil/abseil-cpp/issues/1465
+// CMake builds on Apple platforms error when libraries are empty.
+// Our CMake configuration can avoid this error on header-only libraries,
+// but since this library is conditionally empty, including a single
+// variable is an easy workaround.
+#ifdef __APPLE__
+namespace y_absl {
+Y_ABSL_NAMESPACE_BEGIN
+namespace strings_internal {
+extern const char kAvoidEmptyStringViewLibraryWarning;
+const char kAvoidEmptyStringViewLibraryWarning = 0;
+} // namespace strings_internal
+Y_ABSL_NAMESPACE_END
+} // namespace y_absl
+#endif // __APPLE__
+
#endif // Y_ABSL_USES_STD_STRING_VIEW
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.h
index 8b90baebc7c..c3dcbacacf2 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.h
@@ -37,6 +37,7 @@
#include <util/generic/string.h>
#include "y_absl/base/attributes.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/base/config.h"
#include "y_absl/base/internal/throw_delegate.h"
#include "y_absl/base/macros.h"
@@ -162,11 +163,11 @@ class string_view {
public:
using traits_type = std::char_traits<char>;
using value_type = char;
- using pointer = char*;
- using const_pointer = const char*;
+ using pointer = y_absl::Nullable<char*>;
+ using const_pointer = y_absl::Nullable<const char*>;
using reference = char&;
using const_reference = const char&;
- using const_iterator = const char*;
+ using const_iterator = y_absl::Nullable<const char*>;
using iterator = const_iterator;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
using reverse_iterator = const_reverse_iterator;
@@ -194,11 +195,12 @@ class string_view {
// accepting possibly null strings, use `y_absl::NullSafeStringView(str)`
// instead (see below).
// The length check is skipped since it is unnecessary and causes code bloat.
- constexpr string_view(const char* str) // NOLINT(runtime/explicit)
+ constexpr string_view( // NOLINT(runtime/explicit)
+ y_absl::Nonnull<const char*> str)
: ptr_(str), length_(str ? StrlenInternal(str) : 0) {}
// Implicit constructor of a `string_view` from a `const char*` and length.
- constexpr string_view(const char* data, size_type len)
+ constexpr string_view(y_absl::Nullable<const char*> data, size_type len)
: ptr_(data), length_(CheckLengthInternal(len)) {}
// NOTE: Harmlessly omitted to work around gdb bug.
@@ -427,18 +429,21 @@ class string_view {
// Overload of `string_view::compare()` for comparing a `string_view` and a
// a different C-style string `s`.
- constexpr int compare(const char* s) const { return compare(string_view(s)); }
+ constexpr int compare(y_absl::Nonnull<const char*> s) const {
+ return compare(string_view(s));
+ }
// Overload of `string_view::compare()` for comparing a substring of the
// `string_view` and a different string C-style string `s`.
- constexpr int compare(size_type pos1, size_type count1, const char* s) const {
+ constexpr int compare(size_type pos1, size_type count1,
+ y_absl::Nonnull<const char*> s) const {
return substr(pos1, count1).compare(string_view(s));
}
// Overload of `string_view::compare()` for comparing a substring of the
// `string_view` and a substring of a different C-style string `s`.
- constexpr int compare(size_type pos1, size_type count1, const char* s,
- size_type count2) const {
+ constexpr int compare(size_type pos1, size_type count1,
+ y_absl::Nonnull<const char*> s, size_type count2) const {
return substr(pos1, count1).compare(string_view(s, count2));
}
@@ -457,13 +462,14 @@ class string_view {
// Overload of `string_view::find()` for finding a substring of a different
// C-style string `s` within the `string_view`.
- size_type find(const char* s, size_type pos, size_type count) const {
+ size_type find(y_absl::Nonnull<const char*> s, size_type pos,
+ size_type count) const {
return find(string_view(s, count), pos);
}
// Overload of `string_view::find()` for finding a different C-style string
// `s` within the `string_view`.
- size_type find(const char* s, size_type pos = 0) const {
+ size_type find(y_absl::Nonnull<const char *> s, size_type pos = 0) const {
return find(string_view(s), pos);
}
@@ -480,13 +486,14 @@ class string_view {
// Overload of `string_view::rfind()` for finding a substring of a different
// C-style string `s` within the `string_view`.
- size_type rfind(const char* s, size_type pos, size_type count) const {
+ size_type rfind(y_absl::Nonnull<const char*> s, size_type pos,
+ size_type count) const {
return rfind(string_view(s, count), pos);
}
// Overload of `string_view::rfind()` for finding a different C-style string
// `s` within the `string_view`.
- size_type rfind(const char* s, size_type pos = npos) const {
+ size_type rfind(y_absl::Nonnull<const char*> s, size_type pos = npos) const {
return rfind(string_view(s), pos);
}
@@ -505,14 +512,15 @@ class string_view {
// Overload of `string_view::find_first_of()` for finding a substring of a
// different C-style string `s` within the `string_view`.
- size_type find_first_of(const char* s, size_type pos,
- size_type count) const {
+ size_type find_first_of(y_absl::Nonnull<const char*> s, size_type pos,
+ size_type count) const {
return find_first_of(string_view(s, count), pos);
}
// Overload of `string_view::find_first_of()` for finding a different C-style
// string `s` within the `string_view`.
- size_type find_first_of(const char* s, size_type pos = 0) const {
+ size_type find_first_of(y_absl::Nonnull<const char*> s,
+ size_type pos = 0) const {
return find_first_of(string_view(s), pos);
}
@@ -531,13 +539,15 @@ class string_view {
// Overload of `string_view::find_last_of()` for finding a substring of a
// different C-style string `s` within the `string_view`.
- size_type find_last_of(const char* s, size_type pos, size_type count) const {
+ size_type find_last_of(y_absl::Nonnull<const char*> s, size_type pos,
+ size_type count) const {
return find_last_of(string_view(s, count), pos);
}
// Overload of `string_view::find_last_of()` for finding a different C-style
// string `s` within the `string_view`.
- size_type find_last_of(const char* s, size_type pos = npos) const {
+ size_type find_last_of(y_absl::Nonnull<const char*> s,
+ size_type pos = npos) const {
return find_last_of(string_view(s), pos);
}
@@ -554,14 +564,15 @@ class string_view {
// Overload of `string_view::find_first_not_of()` for finding a substring of a
// different C-style string `s` within the `string_view`.
- size_type find_first_not_of(const char* s, size_type pos,
+ size_type find_first_not_of(y_absl::Nonnull<const char*> s, size_type pos,
size_type count) const {
return find_first_not_of(string_view(s, count), pos);
}
// Overload of `string_view::find_first_not_of()` for finding a different
// C-style string `s` within the `string_view`.
- size_type find_first_not_of(const char* s, size_type pos = 0) const {
+ size_type find_first_not_of(y_absl::Nonnull<const char*> s,
+ size_type pos = 0) const {
return find_first_not_of(string_view(s), pos);
}
@@ -579,22 +590,76 @@ class string_view {
// Overload of `string_view::find_last_not_of()` for finding a substring of a
// different C-style string `s` within the `string_view`.
- size_type find_last_not_of(const char* s, size_type pos,
+ size_type find_last_not_of(y_absl::Nonnull<const char*> s, size_type pos,
size_type count) const {
return find_last_not_of(string_view(s, count), pos);
}
// Overload of `string_view::find_last_not_of()` for finding a different
// C-style string `s` within the `string_view`.
- size_type find_last_not_of(const char* s, size_type pos = npos) const {
+ size_type find_last_not_of(y_absl::Nonnull<const char*> s,
+ size_type pos = npos) const {
return find_last_not_of(string_view(s), pos);
}
+#if Y_ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L
+ // string_view::starts_with()
+ //
+ // Returns true if the `string_view` starts with the prefix `s`.
+ //
+ // This method only exists when targeting at least C++20.
+ // If support for C++ prior to C++20 is required, use `y_absl::StartsWith()`
+ // from `//y_absl/strings/match.h` for compatibility.
+ constexpr bool starts_with(string_view s) const noexcept {
+ return s.empty() ||
+ (size() >= s.size() &&
+ Y_ABSL_INTERNAL_STRING_VIEW_MEMCMP(data(), s.data(), s.size()) == 0);
+ }
+
+ // Overload of `string_view::starts_with()` that returns true if `c` is the
+ // first character of the `string_view`.
+ constexpr bool starts_with(char c) const noexcept {
+ return !empty() && front() == c;
+ }
+
+ // Overload of `string_view::starts_with()` that returns true if the
+ // `string_view` starts with the C-style prefix `s`.
+ constexpr bool starts_with(const char* s) const {
+ return starts_with(string_view(s));
+ }
+
+ // string_view::ends_with()
+ //
+ // Returns true if the `string_view` ends with the suffix `s`.
+ //
+ // This method only exists when targeting at least C++20.
+ // If support for C++ prior to C++20 is required, use `y_absl::EndsWith()`
+ // from `//y_absl/strings/match.h` for compatibility.
+ constexpr bool ends_with(string_view s) const noexcept {
+ return s.empty() || (size() >= s.size() && Y_ABSL_INTERNAL_STRING_VIEW_MEMCMP(
+ data() + (size() - s.size()),
+ s.data(), s.size()) == 0);
+ }
+
+ // Overload of `string_view::ends_with()` that returns true if `c` is the
+ // last character of the `string_view`.
+ constexpr bool ends_with(char c) const noexcept {
+ return !empty() && back() == c;
+ }
+
+ // Overload of `string_view::ends_with()` that returns true if the
+ // `string_view` ends with the C-style suffix `s`.
+ constexpr bool ends_with(const char* s) const {
+ return ends_with(string_view(s));
+ }
+#endif // Y_ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L
+
private:
// The constructor from TString delegates to this constructor.
// See the comment on that constructor for the rationale.
struct SkipCheckLengthTag {};
- string_view(const char* data, size_type len, SkipCheckLengthTag) noexcept
+ string_view(y_absl::Nullable<const char*> data, size_type len,
+ SkipCheckLengthTag) noexcept
: ptr_(data), length_(len) {}
static constexpr size_type kMaxSize =
@@ -604,7 +669,7 @@ class string_view {
return Y_ABSL_HARDENING_ASSERT(len <= kMaxSize), len;
}
- static constexpr size_type StrlenInternal(const char* str) {
+ static constexpr size_type StrlenInternal(y_absl::Nonnull<const char*> str) {
#if defined(_MSC_VER) && _MSC_VER >= 1910 && !defined(__clang__)
// MSVC 2017+ can evaluate this at compile-time.
const char* begin = str;
@@ -633,7 +698,7 @@ class string_view {
: (compare_result < 0 ? -1 : 1);
}
- const char* ptr_;
+ y_absl::Nullable<const char*> ptr_;
size_type length_;
};
@@ -694,7 +759,7 @@ inline string_view ClippedSubstr(string_view s, size_t pos,
// Creates an `y_absl::string_view` from a pointer `p` even if it's null-valued.
// This function should be used where an `y_absl::string_view` can be created from
// a possibly-null pointer.
-constexpr string_view NullSafeStringView(const char* p) {
+constexpr string_view NullSafeStringView(y_absl::Nullable<const char*> p) {
return p ? string_view(p) : string_view();
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/strip.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/strip.h
index 1d1d16e698d..4731a0eb984 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/strip.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/strip.h
@@ -25,6 +25,7 @@
#include <util/generic/string.h>
#include "y_absl/base/macros.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/strings/ascii.h"
#include "y_absl/strings/match.h"
#include "y_absl/strings/string_view.h"
@@ -43,7 +44,8 @@ Y_ABSL_NAMESPACE_BEGIN
// y_absl::string_view input("abc");
// EXPECT_TRUE(y_absl::ConsumePrefix(&input, "a"));
// EXPECT_EQ(input, "bc");
-inline bool ConsumePrefix(y_absl::string_view* str, y_absl::string_view expected) {
+inline bool ConsumePrefix(y_absl::Nonnull<y_absl::string_view*> str,
+ y_absl::string_view expected) {
if (!y_absl::StartsWith(*str, expected)) return false;
str->remove_prefix(expected.size());
return true;
@@ -59,7 +61,8 @@ inline bool ConsumePrefix(y_absl::string_view* str, y_absl::string_view expected
// y_absl::string_view input("abcdef");
// EXPECT_TRUE(y_absl::ConsumeSuffix(&input, "def"));
// EXPECT_EQ(input, "abc");
-inline bool ConsumeSuffix(y_absl::string_view* str, y_absl::string_view expected) {
+inline bool ConsumeSuffix(y_absl::Nonnull<y_absl::string_view*> str,
+ y_absl::string_view expected) {
if (!y_absl::EndsWith(*str, expected)) return false;
str->remove_suffix(expected.size());
return true;
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/substitute.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/substitute.cc
index 093ae16562c..72c9c71b2d8 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/substitute.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/substitute.cc
@@ -15,20 +15,28 @@
#include "y_absl/strings/substitute.h"
#include <algorithm>
+#include <cassert>
+#include <cstddef>
+#include <cstdint>
+#include <util/generic/string.h>
+#include "y_absl/base/config.h"
#include "y_absl/base/internal/raw_logging.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/strings/ascii.h"
#include "y_absl/strings/escaping.h"
#include "y_absl/strings/internal/resize_uninitialized.h"
+#include "y_absl/strings/numbers.h"
+#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/string_view.h"
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
namespace substitute_internal {
-void SubstituteAndAppendArray(TString* output, y_absl::string_view format,
- const y_absl::string_view* args_array,
- size_t num_args) {
+void SubstituteAndAppendArray(
+ y_absl::Nonnull<TString*> output, y_absl::string_view format,
+ y_absl::Nullable<const y_absl::string_view*> args_array, size_t num_args) {
// Determine total size needed.
size_t size = 0;
for (size_t i = 0; i < format.size(); i++) {
@@ -97,7 +105,7 @@ void SubstituteAndAppendArray(TString* output, y_absl::string_view format,
assert(target == output->data() + output->size());
}
-Arg::Arg(const void* value) {
+Arg::Arg(y_absl::Nullable<const void*> value) {
static_assert(sizeof(scratch_) >= sizeof(value) * 2 + 2,
"fix sizeof(scratch_)");
if (value == nullptr) {
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/substitute.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/substitute.h
index 45a5e1c01ec..c0b55cd7758 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/substitute.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/substitute.h
@@ -78,6 +78,7 @@
#include <vector>
#include "y_absl/base/macros.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/base/port.h"
#include "y_absl/strings/ascii.h"
#include "y_absl/strings/escaping.h"
@@ -105,7 +106,7 @@ class Arg {
// Overloads for string-y things
//
// Explicitly overload `const char*` so the compiler doesn't cast to `bool`.
- Arg(const char* value) // NOLINT(google-explicit-constructor)
+ Arg(y_absl::Nullable<const char*> value) // NOLINT(google-explicit-constructor)
: piece_(y_absl::NullSafeStringView(value)) {}
template <typename Allocator>
Arg( // NOLINT
@@ -178,7 +179,7 @@ class Arg {
: piece_(value ? "true" : "false") {}
template <typename T, typename = typename std::enable_if<
- strings_internal::HasAbslStringify<T>::value>::type>
+ HasAbslStringify<T>::value>::type>
Arg( // NOLINT(google-explicit-constructor)
const T& v, strings_internal::StringifySink&& sink = {})
: piece_(strings_internal::ExtractStringification(sink, v)) {}
@@ -199,14 +200,15 @@ class Arg {
// `void*` values, with the exception of `char*`, are printed as
// "0x<hex value>". However, in the case of `nullptr`, "NULL" is printed.
- Arg(const void* value); // NOLINT(google-explicit-constructor)
+ Arg( // NOLINT(google-explicit-constructor)
+ y_absl::Nullable<const void*> value);
// Normal enums are already handled by the integer formatters.
// This overload matches only scoped enums.
template <typename T,
typename = typename std::enable_if<
std::is_enum<T>{} && !std::is_convertible<T, int>{} &&
- !strings_internal::HasAbslStringify<T>::value>::type>
+ !HasAbslStringify<T>::value>::type>
Arg(T value) // NOLINT(google-explicit-constructor)
: Arg(static_cast<typename std::underlying_type<T>::type>(value)) {}
@@ -222,12 +224,12 @@ class Arg {
// Internal helper function. Don't call this from outside this implementation.
// This interface may change without notice.
-void SubstituteAndAppendArray(TString* output, y_absl::string_view format,
- const y_absl::string_view* args_array,
- size_t num_args);
+void SubstituteAndAppendArray(
+ y_absl::Nonnull<TString*> output, y_absl::string_view format,
+ y_absl::Nullable<const y_absl::string_view*> args_array, size_t num_args);
#if defined(Y_ABSL_BAD_CALL_IF)
-constexpr int CalculateOneBit(const char* format) {
+constexpr int CalculateOneBit(y_absl::Nonnull<const char*> format) {
// Returns:
// * 2^N for '$N' when N is in [0-9]
// * 0 for correct '$' escaping: '$$'.
@@ -236,11 +238,11 @@ constexpr int CalculateOneBit(const char* format) {
: (1 << (*format - '0'));
}
-constexpr const char* SkipNumber(const char* format) {
+constexpr const char* SkipNumber(y_absl::Nonnull<const char*> format) {
return !*format ? format : (format + 1);
}
-constexpr int PlaceholderBitmask(const char* format) {
+constexpr int PlaceholderBitmask(y_absl::Nonnull<const char*> format) {
return !*format
? 0
: *format != '$' ? PlaceholderBitmask(format + 1)
@@ -273,18 +275,21 @@ constexpr int PlaceholderBitmask(const char* format) {
// y_absl::SubstituteAndAppend(boilerplate, format, args...);
// }
//
-inline void SubstituteAndAppend(TString* output, y_absl::string_view format) {
+inline void SubstituteAndAppend(y_absl::Nonnull<TString*> output,
+ y_absl::string_view format) {
substitute_internal::SubstituteAndAppendArray(output, format, nullptr, 0);
}
-inline void SubstituteAndAppend(TString* output, y_absl::string_view format,
+inline void SubstituteAndAppend(y_absl::Nonnull<TString*> output,
+ y_absl::string_view format,
const substitute_internal::Arg& a0) {
const y_absl::string_view args[] = {a0.piece()};
substitute_internal::SubstituteAndAppendArray(output, format, args,
Y_ABSL_ARRAYSIZE(args));
}
-inline void SubstituteAndAppend(TString* output, y_absl::string_view format,
+inline void SubstituteAndAppend(y_absl::Nonnull<TString*> output,
+ y_absl::string_view format,
const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1) {
const y_absl::string_view args[] = {a0.piece(), a1.piece()};
@@ -292,7 +297,8 @@ inline void SubstituteAndAppend(TString* output, y_absl::string_view format,
Y_ABSL_ARRAYSIZE(args));
}
-inline void SubstituteAndAppend(TString* output, y_absl::string_view format,
+inline void SubstituteAndAppend(y_absl::Nonnull<TString*> output,
+ y_absl::string_view format,
const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2) {
@@ -301,7 +307,8 @@ inline void SubstituteAndAppend(TString* output, y_absl::string_view format,
Y_ABSL_ARRAYSIZE(args));
}
-inline void SubstituteAndAppend(TString* output, y_absl::string_view format,
+inline void SubstituteAndAppend(y_absl::Nonnull<TString*> output,
+ y_absl::string_view format,
const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2,
@@ -312,7 +319,8 @@ inline void SubstituteAndAppend(TString* output, y_absl::string_view format,
Y_ABSL_ARRAYSIZE(args));
}
-inline void SubstituteAndAppend(TString* output, y_absl::string_view format,
+inline void SubstituteAndAppend(y_absl::Nonnull<TString*> output,
+ y_absl::string_view format,
const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2,
@@ -324,27 +332,23 @@ inline void SubstituteAndAppend(TString* output, y_absl::string_view format,
Y_ABSL_ARRAYSIZE(args));
}
-inline void SubstituteAndAppend(TString* output, y_absl::string_view format,
- const substitute_internal::Arg& a0,
- const substitute_internal::Arg& a1,
- const substitute_internal::Arg& a2,
- const substitute_internal::Arg& a3,
- const substitute_internal::Arg& a4,
- const substitute_internal::Arg& a5) {
+inline void SubstituteAndAppend(
+ y_absl::Nonnull<TString*> output, y_absl::string_view format,
+ const substitute_internal::Arg& a0, const substitute_internal::Arg& a1,
+ const substitute_internal::Arg& a2, const substitute_internal::Arg& a3,
+ const substitute_internal::Arg& a4, const substitute_internal::Arg& a5) {
const y_absl::string_view args[] = {a0.piece(), a1.piece(), a2.piece(),
a3.piece(), a4.piece(), a5.piece()};
substitute_internal::SubstituteAndAppendArray(output, format, args,
Y_ABSL_ARRAYSIZE(args));
}
-inline void SubstituteAndAppend(TString* output, y_absl::string_view format,
- const substitute_internal::Arg& a0,
- const substitute_internal::Arg& a1,
- const substitute_internal::Arg& a2,
- const substitute_internal::Arg& a3,
- const substitute_internal::Arg& a4,
- const substitute_internal::Arg& a5,
- const substitute_internal::Arg& a6) {
+inline void SubstituteAndAppend(
+ y_absl::Nonnull<TString*> output, y_absl::string_view format,
+ const substitute_internal::Arg& a0, const substitute_internal::Arg& a1,
+ const substitute_internal::Arg& a2, const substitute_internal::Arg& a3,
+ const substitute_internal::Arg& a4, const substitute_internal::Arg& a5,
+ const substitute_internal::Arg& a6) {
const y_absl::string_view args[] = {a0.piece(), a1.piece(), a2.piece(),
a3.piece(), a4.piece(), a5.piece(),
a6.piece()};
@@ -353,7 +357,7 @@ inline void SubstituteAndAppend(TString* output, y_absl::string_view format,
}
inline void SubstituteAndAppend(
- TString* output, y_absl::string_view format,
+ y_absl::Nonnull<TString*> output, y_absl::string_view format,
const substitute_internal::Arg& a0, const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2, const substitute_internal::Arg& a3,
const substitute_internal::Arg& a4, const substitute_internal::Arg& a5,
@@ -366,7 +370,7 @@ inline void SubstituteAndAppend(
}
inline void SubstituteAndAppend(
- TString* output, y_absl::string_view format,
+ y_absl::Nonnull<TString*> output, y_absl::string_view format,
const substitute_internal::Arg& a0, const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2, const substitute_internal::Arg& a3,
const substitute_internal::Arg& a4, const substitute_internal::Arg& a5,
@@ -380,7 +384,7 @@ inline void SubstituteAndAppend(
}
inline void SubstituteAndAppend(
- TString* output, y_absl::string_view format,
+ y_absl::Nonnull<TString*> output, y_absl::string_view format,
const substitute_internal::Arg& a0, const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2, const substitute_internal::Arg& a3,
const substitute_internal::Arg& a4, const substitute_internal::Arg& a5,
@@ -396,14 +400,16 @@ inline void SubstituteAndAppend(
#if defined(Y_ABSL_BAD_CALL_IF)
// This body of functions catches cases where the number of placeholders
// doesn't match the number of data arguments.
-void SubstituteAndAppend(TString* output, const char* format)
+void SubstituteAndAppend(y_absl::Nonnull<TString*> output,
+ y_absl::Nonnull<const char*> format)
Y_ABSL_BAD_CALL_IF(
substitute_internal::PlaceholderBitmask(format) != 0,
"There were no substitution arguments "
"but this format string either has a $[0-9] in it or contains "
"an unescaped $ character (use $$ instead)");
-void SubstituteAndAppend(TString* output, const char* format,
+void SubstituteAndAppend(y_absl::Nonnull<TString*> output,
+ y_absl::Nonnull<const char*> format,
const substitute_internal::Arg& a0)
Y_ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 1,
"There was 1 substitution argument given, but "
@@ -411,7 +417,8 @@ void SubstituteAndAppend(TString* output, const char* format,
"one of $1-$9, or contains an unescaped $ character (use "
"$$ instead)");
-void SubstituteAndAppend(TString* output, const char* format,
+void SubstituteAndAppend(y_absl::Nonnull<TString*> output,
+ y_absl::Nonnull<const char*> format,
const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1)
Y_ABSL_BAD_CALL_IF(
@@ -420,7 +427,8 @@ void SubstituteAndAppend(TString* output, const char* format,
"missing its $0/$1, contains one of $2-$9, or contains an "
"unescaped $ character (use $$ instead)");
-void SubstituteAndAppend(TString* output, const char* format,
+void SubstituteAndAppend(y_absl::Nonnull<TString*> output,
+ y_absl::Nonnull<const char*> format,
const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2)
@@ -430,7 +438,8 @@ void SubstituteAndAppend(TString* output, const char* format,
"this format string is missing its $0/$1/$2, contains one of "
"$3-$9, or contains an unescaped $ character (use $$ instead)");
-void SubstituteAndAppend(TString* output, const char* format,
+void SubstituteAndAppend(y_absl::Nonnull<TString*> output,
+ y_absl::Nonnull<const char*> format,
const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2,
@@ -441,7 +450,8 @@ void SubstituteAndAppend(TString* output, const char* format,
"this format string is missing its $0-$3, contains one of "
"$4-$9, or contains an unescaped $ character (use $$ instead)");
-void SubstituteAndAppend(TString* output, const char* format,
+void SubstituteAndAppend(y_absl::Nonnull<TString*> output,
+ y_absl::Nonnull<const char*> format,
const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2,
@@ -453,13 +463,11 @@ void SubstituteAndAppend(TString* output, const char* format,
"this format string is missing its $0-$4, contains one of "
"$5-$9, or contains an unescaped $ character (use $$ instead)");
-void SubstituteAndAppend(TString* output, const char* format,
- const substitute_internal::Arg& a0,
- const substitute_internal::Arg& a1,
- const substitute_internal::Arg& a2,
- const substitute_internal::Arg& a3,
- const substitute_internal::Arg& a4,
- const substitute_internal::Arg& a5)
+void SubstituteAndAppend(
+ y_absl::Nonnull<TString*> output, y_absl::Nonnull<const char*> format,
+ const substitute_internal::Arg& a0, const substitute_internal::Arg& a1,
+ const substitute_internal::Arg& a2, const substitute_internal::Arg& a3,
+ const substitute_internal::Arg& a4, const substitute_internal::Arg& a5)
Y_ABSL_BAD_CALL_IF(
substitute_internal::PlaceholderBitmask(format) != 63,
"There were 6 substitution arguments given, but "
@@ -467,10 +475,11 @@ void SubstituteAndAppend(TString* output, const char* format,
"$6-$9, or contains an unescaped $ character (use $$ instead)");
void SubstituteAndAppend(
- TString* output, const char* format, const substitute_internal::Arg& a0,
- const substitute_internal::Arg& a1, const substitute_internal::Arg& a2,
- const substitute_internal::Arg& a3, const substitute_internal::Arg& a4,
- const substitute_internal::Arg& a5, const substitute_internal::Arg& a6)
+ y_absl::Nonnull<TString*> output, y_absl::Nonnull<const char*> format,
+ const substitute_internal::Arg& a0, const substitute_internal::Arg& a1,
+ const substitute_internal::Arg& a2, const substitute_internal::Arg& a3,
+ const substitute_internal::Arg& a4, const substitute_internal::Arg& a5,
+ const substitute_internal::Arg& a6)
Y_ABSL_BAD_CALL_IF(
substitute_internal::PlaceholderBitmask(format) != 127,
"There were 7 substitution arguments given, but "
@@ -478,11 +487,11 @@ void SubstituteAndAppend(
"$7-$9, or contains an unescaped $ character (use $$ instead)");
void SubstituteAndAppend(
- TString* output, const char* format, const substitute_internal::Arg& a0,
- const substitute_internal::Arg& a1, const substitute_internal::Arg& a2,
- const substitute_internal::Arg& a3, const substitute_internal::Arg& a4,
- const substitute_internal::Arg& a5, const substitute_internal::Arg& a6,
- const substitute_internal::Arg& a7)
+ y_absl::Nonnull<TString*> output, y_absl::Nonnull<const char*> format,
+ const substitute_internal::Arg& a0, const substitute_internal::Arg& a1,
+ const substitute_internal::Arg& a2, const substitute_internal::Arg& a3,
+ const substitute_internal::Arg& a4, const substitute_internal::Arg& a5,
+ const substitute_internal::Arg& a6, const substitute_internal::Arg& a7)
Y_ABSL_BAD_CALL_IF(
substitute_internal::PlaceholderBitmask(format) != 255,
"There were 8 substitution arguments given, but "
@@ -490,11 +499,12 @@ void SubstituteAndAppend(
"$8-$9, or contains an unescaped $ character (use $$ instead)");
void SubstituteAndAppend(
- TString* output, const char* format, const substitute_internal::Arg& a0,
- const substitute_internal::Arg& a1, const substitute_internal::Arg& a2,
- const substitute_internal::Arg& a3, const substitute_internal::Arg& a4,
- const substitute_internal::Arg& a5, const substitute_internal::Arg& a6,
- const substitute_internal::Arg& a7, const substitute_internal::Arg& a8)
+ y_absl::Nonnull<TString*> output, y_absl::Nonnull<const char*> format,
+ const substitute_internal::Arg& a0, const substitute_internal::Arg& a1,
+ const substitute_internal::Arg& a2, const substitute_internal::Arg& a3,
+ const substitute_internal::Arg& a4, const substitute_internal::Arg& a5,
+ const substitute_internal::Arg& a6, const substitute_internal::Arg& a7,
+ const substitute_internal::Arg& a8)
Y_ABSL_BAD_CALL_IF(
substitute_internal::PlaceholderBitmask(format) != 511,
"There were 9 substitution arguments given, but "
@@ -502,12 +512,12 @@ void SubstituteAndAppend(
"contains an unescaped $ character (use $$ instead)");
void SubstituteAndAppend(
- TString* output, const char* format, const substitute_internal::Arg& a0,
- const substitute_internal::Arg& a1, const substitute_internal::Arg& a2,
- const substitute_internal::Arg& a3, const substitute_internal::Arg& a4,
- const substitute_internal::Arg& a5, const substitute_internal::Arg& a6,
- const substitute_internal::Arg& a7, const substitute_internal::Arg& a8,
- const substitute_internal::Arg& a9)
+ y_absl::Nonnull<TString*> output, y_absl::Nonnull<const char*> format,
+ const substitute_internal::Arg& a0, const substitute_internal::Arg& a1,
+ const substitute_internal::Arg& a2, const substitute_internal::Arg& a3,
+ const substitute_internal::Arg& a4, const substitute_internal::Arg& a5,
+ const substitute_internal::Arg& a6, const substitute_internal::Arg& a7,
+ const substitute_internal::Arg& a8, const substitute_internal::Arg& a9)
Y_ABSL_BAD_CALL_IF(
substitute_internal::PlaceholderBitmask(format) != 1023,
"There were 10 substitution arguments given, but this "
@@ -635,20 +645,22 @@ Y_ABSL_MUST_USE_RESULT inline TString Substitute(
#if defined(Y_ABSL_BAD_CALL_IF)
// This body of functions catches cases where the number of placeholders
// doesn't match the number of data arguments.
-TString Substitute(const char* format)
+TString Substitute(y_absl::Nonnull<const char*> format)
Y_ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 0,
"There were no substitution arguments "
"but this format string either has a $[0-9] in it or "
"contains an unescaped $ character (use $$ instead)");
-TString Substitute(const char* format, const substitute_internal::Arg& a0)
+TString Substitute(y_absl::Nonnull<const char*> format,
+ const substitute_internal::Arg& a0)
Y_ABSL_BAD_CALL_IF(
substitute_internal::PlaceholderBitmask(format) != 1,
"There was 1 substitution argument given, but "
"this format string is missing its $0, contains one of $1-$9, "
"or contains an unescaped $ character (use $$ instead)");
-TString Substitute(const char* format, const substitute_internal::Arg& a0,
+TString Substitute(y_absl::Nonnull<const char*> format,
+ const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1)
Y_ABSL_BAD_CALL_IF(
substitute_internal::PlaceholderBitmask(format) != 3,
@@ -656,7 +668,8 @@ TString Substitute(const char* format, const substitute_internal::Arg& a0,
"this format string is missing its $0/$1, contains one of "
"$2-$9, or contains an unescaped $ character (use $$ instead)");
-TString Substitute(const char* format, const substitute_internal::Arg& a0,
+TString Substitute(y_absl::Nonnull<const char*> format,
+ const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2)
Y_ABSL_BAD_CALL_IF(
@@ -665,7 +678,8 @@ TString Substitute(const char* format, const substitute_internal::Arg& a0,
"this format string is missing its $0/$1/$2, contains one of "
"$3-$9, or contains an unescaped $ character (use $$ instead)");
-TString Substitute(const char* format, const substitute_internal::Arg& a0,
+TString Substitute(y_absl::Nonnull<const char*> format,
+ const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2,
const substitute_internal::Arg& a3)
@@ -675,7 +689,8 @@ TString Substitute(const char* format, const substitute_internal::Arg& a0,
"this format string is missing its $0-$3, contains one of "
"$4-$9, or contains an unescaped $ character (use $$ instead)");
-TString Substitute(const char* format, const substitute_internal::Arg& a0,
+TString Substitute(y_absl::Nonnull<const char*> format,
+ const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2,
const substitute_internal::Arg& a3,
@@ -686,7 +701,8 @@ TString Substitute(const char* format, const substitute_internal::Arg& a0,
"this format string is missing its $0-$4, contains one of "
"$5-$9, or contains an unescaped $ character (use $$ instead)");
-TString Substitute(const char* format, const substitute_internal::Arg& a0,
+TString Substitute(y_absl::Nonnull<const char*> format,
+ const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2,
const substitute_internal::Arg& a3,
@@ -698,27 +714,23 @@ TString Substitute(const char* format, const substitute_internal::Arg& a0,
"this format string is missing its $0-$5, contains one of "
"$6-$9, or contains an unescaped $ character (use $$ instead)");
-TString Substitute(const char* format, const substitute_internal::Arg& a0,
- const substitute_internal::Arg& a1,
- const substitute_internal::Arg& a2,
- const substitute_internal::Arg& a3,
- const substitute_internal::Arg& a4,
- const substitute_internal::Arg& a5,
- const substitute_internal::Arg& a6)
+TString Substitute(
+ y_absl::Nonnull<const char*> format, const substitute_internal::Arg& a0,
+ const substitute_internal::Arg& a1, const substitute_internal::Arg& a2,
+ const substitute_internal::Arg& a3, const substitute_internal::Arg& a4,
+ const substitute_internal::Arg& a5, const substitute_internal::Arg& a6)
Y_ABSL_BAD_CALL_IF(
substitute_internal::PlaceholderBitmask(format) != 127,
"There were 7 substitution arguments given, but "
"this format string is missing its $0-$6, contains one of "
"$7-$9, or contains an unescaped $ character (use $$ instead)");
-TString Substitute(const char* format, const substitute_internal::Arg& a0,
- const substitute_internal::Arg& a1,
- const substitute_internal::Arg& a2,
- const substitute_internal::Arg& a3,
- const substitute_internal::Arg& a4,
- const substitute_internal::Arg& a5,
- const substitute_internal::Arg& a6,
- const substitute_internal::Arg& a7)
+TString Substitute(
+ y_absl::Nonnull<const char*> format, const substitute_internal::Arg& a0,
+ const substitute_internal::Arg& a1, const substitute_internal::Arg& a2,
+ const substitute_internal::Arg& a3, const substitute_internal::Arg& a4,
+ const substitute_internal::Arg& a5, const substitute_internal::Arg& a6,
+ const substitute_internal::Arg& a7)
Y_ABSL_BAD_CALL_IF(
substitute_internal::PlaceholderBitmask(format) != 255,
"There were 8 substitution arguments given, but "
@@ -726,7 +738,7 @@ TString Substitute(const char* format, const substitute_internal::Arg& a0,
"$8-$9, or contains an unescaped $ character (use $$ instead)");
TString Substitute(
- const char* format, const substitute_internal::Arg& a0,
+ y_absl::Nonnull<const char*> format, const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1, const substitute_internal::Arg& a2,
const substitute_internal::Arg& a3, const substitute_internal::Arg& a4,
const substitute_internal::Arg& a5, const substitute_internal::Arg& a6,
@@ -738,7 +750,7 @@ TString Substitute(
"contains an unescaped $ character (use $$ instead)");
TString Substitute(
- const char* format, const substitute_internal::Arg& a0,
+ y_absl::Nonnull<const char*> format, const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1, const substitute_internal::Arg& a2,
const substitute_internal::Arg& a3, const substitute_internal::Arg& a4,
const substitute_internal::Arg& a5, const substitute_internal::Arg& a6,
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/ya.make
index fde0b02323c..90edc2143b3 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/ya.make
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/ya.make
@@ -25,7 +25,7 @@ SRCS(
crc/internal/crc.cc
crc/internal/crc_cord_state.cc
crc/internal/crc_memcpy_fallback.cc
- crc/internal/crc_memcpy_x86_64.cc
+ crc/internal/crc_memcpy_x86_arm_combined.cc
crc/internal/crc_non_temporal_memcpy.cc
crc/internal/crc_x86_arm_combined.cc
status/statusor.cc
@@ -43,7 +43,6 @@ SRCS(
strings/internal/cord_rep_btree_reader.cc
strings/internal/cord_rep_consume.cc
strings/internal/cord_rep_crc.cc
- strings/internal/cord_rep_ring.cc
strings/internal/cordz_functions.cc
strings/internal/cordz_handle.cc
strings/internal/cordz_info.cc
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/pthread_waiter.h b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/pthread_waiter.h
index 32cb31b01df..69f3bba74d4 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/pthread_waiter.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/pthread_waiter.h
@@ -16,7 +16,7 @@
#ifndef Y_ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_
#define Y_ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__MINGW32__)
#include <pthread.h>
#include "y_absl/base/config.h"
@@ -55,6 +55,6 @@ class PthreadWaiter : public WaiterCrtp<PthreadWaiter> {
Y_ABSL_NAMESPACE_END
} // namespace y_absl
-#endif // ndef _WIN32
+#endif // !defined(_WIN32) && !defined(__MINGW32__)
#endif // Y_ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/win32_waiter.h b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/win32_waiter.h
index 6e4f76af243..c18219d8cf2 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/win32_waiter.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/win32_waiter.h
@@ -20,7 +20,8 @@
#include <sdkddkver.h>
#endif
-#if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+#if defined(_WIN32) && !defined(__MINGW32__) && \
+ _WIN32_WINNT >= _WIN32_WINNT_VISTA
#include "y_absl/base/config.h"
#include "y_absl/synchronization/internal/kernel_timeout.h"
@@ -65,6 +66,7 @@ class Win32Waiter : public WaiterCrtp<Win32Waiter> {
Y_ABSL_NAMESPACE_END
} // namespace y_absl
-#endif // defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+#endif // defined(_WIN32) && !defined(__MINGW32__) &&
+ // _WIN32_WINNT >= _WIN32_WINNT_VISTA
#endif // Y_ABSL_SYNCHRONIZATION_INTERNAL_WIN32_WAITER_H_
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.cc
index 004fd4c06f9..9cccfab498f 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.cc
@@ -129,11 +129,15 @@ enum DelayMode { AGGRESSIVE, GENTLE };
struct Y_ABSL_CACHELINE_ALIGNED MutexGlobals {
y_absl::once_flag once;
- int spinloop_iterations = 0;
+ // Note: this variable is initialized separately in Mutex::LockSlow,
+ // so that Mutex::Lock does not have a stack frame in optimized build.
+ std::atomic<int> spinloop_iterations{0};
int32_t mutex_sleep_spins[2] = {};
y_absl::Duration mutex_sleep_time;
};
+Y_ABSL_CONST_INIT static MutexGlobals globals;
+
y_absl::Duration MeasureTimeToYield() {
y_absl::Time before = y_absl::Now();
Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalMutexYield)();
@@ -141,33 +145,30 @@ y_absl::Duration MeasureTimeToYield() {
}
const MutexGlobals& GetMutexGlobals() {
- Y_ABSL_CONST_INIT static MutexGlobals data;
- y_absl::base_internal::LowLevelCallOnce(&data.once, [&]() {
+ y_absl::base_internal::LowLevelCallOnce(&globals.once, [&]() {
if (y_absl::base_internal::NumCPUs() > 1) {
- // If this is multiprocessor, allow spinning. If the mode is
- // aggressive then spin many times before yielding. If the mode is
- // gentle then spin only a few times before yielding. Aggressive spinning
- // is used to ensure that an Unlock() call, which must get the spin lock
- // for any thread to make progress gets it without undue delay.
- data.spinloop_iterations = 1500;
- data.mutex_sleep_spins[AGGRESSIVE] = 5000;
- data.mutex_sleep_spins[GENTLE] = 250;
- data.mutex_sleep_time = y_absl::Microseconds(10);
+ // If the mode is aggressive then spin many times before yielding.
+ // If the mode is gentle then spin only a few times before yielding.
+ // Aggressive spinning is used to ensure that an Unlock() call,
+ // which must get the spin lock for any thread to make progress gets it
+ // without undue delay.
+ globals.mutex_sleep_spins[AGGRESSIVE] = 5000;
+ globals.mutex_sleep_spins[GENTLE] = 250;
+ globals.mutex_sleep_time = y_absl::Microseconds(10);
} else {
// If this a uniprocessor, only yield/sleep. Real-time threads are often
// unable to yield, so the sleep time needs to be long enough to keep
// the calling thread asleep until scheduling happens.
- data.spinloop_iterations = 0;
- data.mutex_sleep_spins[AGGRESSIVE] = 0;
- data.mutex_sleep_spins[GENTLE] = 0;
- data.mutex_sleep_time = MeasureTimeToYield() * 5;
- data.mutex_sleep_time =
- std::min(data.mutex_sleep_time, y_absl::Milliseconds(1));
- data.mutex_sleep_time =
- std::max(data.mutex_sleep_time, y_absl::Microseconds(10));
+ globals.mutex_sleep_spins[AGGRESSIVE] = 0;
+ globals.mutex_sleep_spins[GENTLE] = 0;
+ globals.mutex_sleep_time = MeasureTimeToYield() * 5;
+ globals.mutex_sleep_time =
+ std::min(globals.mutex_sleep_time, y_absl::Milliseconds(1));
+ globals.mutex_sleep_time =
+ std::max(globals.mutex_sleep_time, y_absl::Microseconds(10));
}
});
- return data;
+ return globals;
}
} // namespace
@@ -202,31 +203,23 @@ int MutexDelay(int32_t c, int mode) {
// Ensure that "(*pv & bits) == bits" by doing an atomic update of "*pv" to
// "*pv | bits" if necessary. Wait until (*pv & wait_until_clear)==0
// before making any change.
+// Returns true if bits were previously unset and set by the call.
// This is used to set flags in mutex and condition variable words.
-static void AtomicSetBits(std::atomic<intptr_t>* pv, intptr_t bits,
+static bool AtomicSetBits(std::atomic<intptr_t>* pv, intptr_t bits,
intptr_t wait_until_clear) {
- intptr_t v;
- do {
- v = pv->load(std::memory_order_relaxed);
- } while ((v & bits) != bits &&
- ((v & wait_until_clear) != 0 ||
- !pv->compare_exchange_weak(v, v | bits, std::memory_order_release,
- std::memory_order_relaxed)));
-}
-
-// Ensure that "(*pv & bits) == 0" by doing an atomic update of "*pv" to
-// "*pv & ~bits" if necessary. Wait until (*pv & wait_until_clear)==0
-// before making any change.
-// This is used to unset flags in mutex and condition variable words.
-static void AtomicClearBits(std::atomic<intptr_t>* pv, intptr_t bits,
- intptr_t wait_until_clear) {
- intptr_t v;
- do {
- v = pv->load(std::memory_order_relaxed);
- } while ((v & bits) != 0 &&
- ((v & wait_until_clear) != 0 ||
- !pv->compare_exchange_weak(v, v & ~bits, std::memory_order_release,
- std::memory_order_relaxed)));
+ for (;;) {
+ intptr_t v = pv->load(std::memory_order_relaxed);
+ if ((v & bits) == bits) {
+ return false;
+ }
+ if ((v & wait_until_clear) != 0) {
+ continue;
+ }
+ if (pv->compare_exchange_weak(v, v | bits, std::memory_order_release,
+ std::memory_order_relaxed)) {
+ return true;
+ }
+ }
}
//------------------------------------------------------------------
@@ -341,12 +334,49 @@ static SynchEvent* EnsureSynchEvent(std::atomic<intptr_t>* addr,
const char* name, intptr_t bits,
intptr_t lockbit) {
uint32_t h = reinterpret_cast<uintptr_t>(addr) % kNSynchEvent;
- SynchEvent* e;
- // first look for existing SynchEvent struct..
synch_event_mu.Lock();
- for (e = synch_event[h];
- e != nullptr && e->masked_addr != base_internal::HidePtr(addr);
- e = e->next) {
+ // When a Mutex/CondVar is destroyed, we don't remove the associated
+ // SynchEvent to keep destructors empty in release builds for performance
+ // reasons. If the current call is the first to set bits (kMuEvent/kCVEvent),
+ // we don't look up the existing even because (if it exists, it must be for
+ // the previous Mutex/CondVar that existed at the same address).
+ // The leaking events must not be a problem for tests, which should create
+ // bounded amount of events. And debug logging is not supposed to be enabled
+ // in production. However, if it's accidentally enabled, or briefly enabled
+ // for some debugging, we don't want to crash the program. Instead we drop
+ // all events, if we accumulated too many of them. Size of a single event
+ // is ~48 bytes, so 100K events is ~5 MB.
+ // Additionally we could delete the old event for the same address,
+ // but it would require a better hashmap (if we accumulate too many events,
+ // linked lists will grow and traversing them will be very slow).
+ constexpr size_t kMaxSynchEventCount = 100 << 10;
+ // Total number of live synch events.
+ static size_t synch_event_count Y_ABSL_GUARDED_BY(synch_event_mu);
+ if (++synch_event_count > kMaxSynchEventCount) {
+ synch_event_count = 0;
+ Y_ABSL_RAW_LOG(ERROR,
+ "Accumulated %zu Mutex debug objects. If you see this"
+ " in production, it may mean that the production code"
+ " accidentally calls "
+ "Mutex/CondVar::EnableDebugLog/EnableInvariantDebugging.",
+ kMaxSynchEventCount);
+ for (auto*& head : synch_event) {
+ for (auto* e = head; e != nullptr;) {
+ SynchEvent* next = e->next;
+ if (--(e->refcount) == 0) {
+ base_internal::LowLevelAlloc::Free(e);
+ }
+ e = next;
+ }
+ head = nullptr;
+ }
+ }
+ SynchEvent* e = nullptr;
+ if (!AtomicSetBits(addr, bits, lockbit)) {
+ for (e = synch_event[h];
+ e != nullptr && e->masked_addr != base_internal::HidePtr(addr);
+ e = e->next) {
+ }
}
if (e == nullptr) { // no SynchEvent struct found; make one.
if (name == nullptr) {
@@ -362,7 +392,6 @@ static SynchEvent* EnsureSynchEvent(std::atomic<intptr_t>* addr,
e->log = false;
strcpy(e->name, name); // NOLINT(runtime/printf)
e->next = synch_event[h];
- AtomicSetBits(addr, bits, lockbit);
synch_event[h] = e;
} else {
e->refcount++; // for return value
@@ -371,11 +400,6 @@ static SynchEvent* EnsureSynchEvent(std::atomic<intptr_t>* addr,
return e;
}
-// Deallocate the SynchEvent *e, whose refcount has fallen to zero.
-static void DeleteSynchEvent(SynchEvent* e) {
- base_internal::LowLevelAlloc::Free(e);
-}
-
// Decrement the reference count of *e, or do nothing if e==null.
static void UnrefSynchEvent(SynchEvent* e) {
if (e != nullptr) {
@@ -383,36 +407,11 @@ static void UnrefSynchEvent(SynchEvent* e) {
bool del = (--(e->refcount) == 0);
synch_event_mu.Unlock();
if (del) {
- DeleteSynchEvent(e);
+ base_internal::LowLevelAlloc::Free(e);
}
}
}
-// Forget the mapping from the object (Mutex or CondVar) at address addr
-// to SynchEvent object, and clear "bits" in its word (waiting until lockbit
-// is clear before doing so).
-static void ForgetSynchEvent(std::atomic<intptr_t>* addr, intptr_t bits,
- intptr_t lockbit) {
- uint32_t h = reinterpret_cast<uintptr_t>(addr) % kNSynchEvent;
- SynchEvent** pe;
- SynchEvent* e;
- synch_event_mu.Lock();
- for (pe = &synch_event[h];
- (e = *pe) != nullptr && e->masked_addr != base_internal::HidePtr(addr);
- pe = &e->next) {
- }
- bool del = false;
- if (e != nullptr) {
- *pe = e->next;
- del = (--(e->refcount) == 0);
- }
- AtomicClearBits(addr, bits, lockbit);
- synch_event_mu.Unlock();
- if (del) {
- DeleteSynchEvent(e);
- }
-}
-
// Return a refcounted reference to the SynchEvent of the object at address
// "addr", if any. The pointer returned is valid until the UnrefSynchEvent() is
// called.
@@ -583,31 +582,25 @@ static SynchLocksHeld* Synch_GetAllLocks() {
// Post on "w"'s associated PerThreadSem.
void Mutex::IncrementSynchSem(Mutex* mu, PerThreadSynch* w) {
- if (mu) {
- Y_ABSL_TSAN_MUTEX_PRE_DIVERT(mu, 0);
- // We miss synchronization around passing PerThreadSynch between threads
- // since it happens inside of the Mutex code, so we need to ignore all
- // accesses to the object.
- Y_ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN();
- PerThreadSem::Post(w->thread_identity());
- Y_ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_END();
- Y_ABSL_TSAN_MUTEX_POST_DIVERT(mu, 0);
- } else {
- PerThreadSem::Post(w->thread_identity());
- }
+ static_cast<void>(mu); // Prevent unused param warning in non-TSAN builds.
+ Y_ABSL_TSAN_MUTEX_PRE_DIVERT(mu, 0);
+ // We miss synchronization around passing PerThreadSynch between threads
+ // since it happens inside of the Mutex code, so we need to ignore all
+ // accesses to the object.
+ Y_ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN();
+ PerThreadSem::Post(w->thread_identity());
+ Y_ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_END();
+ Y_ABSL_TSAN_MUTEX_POST_DIVERT(mu, 0);
}
// Wait on "w"'s associated PerThreadSem; returns false if timeout expired.
bool Mutex::DecrementSynchSem(Mutex* mu, PerThreadSynch* w, KernelTimeout t) {
- if (mu) {
- Y_ABSL_TSAN_MUTEX_PRE_DIVERT(mu, 0);
- }
+ static_cast<void>(mu); // Prevent unused param warning in non-TSAN builds.
+ Y_ABSL_TSAN_MUTEX_PRE_DIVERT(mu, 0);
assert(w == Synch_GetPerThread());
static_cast<void>(w);
bool res = PerThreadSem::Wait(t);
- if (mu) {
- Y_ABSL_TSAN_MUTEX_POST_DIVERT(mu, 0);
- }
+ Y_ABSL_TSAN_MUTEX_POST_DIVERT(mu, 0);
return res;
}
@@ -686,6 +679,7 @@ static const intptr_t kMuOne = 0x0100; // a count of one reader
// flags passed to Enqueue and LockSlow{,WithTimeout,Loop}
static const int kMuHasBlocked = 0x01; // already blocked (MUST == 1)
static const int kMuIsCond = 0x02; // conditional waiter (CV or Condition)
+static const int kMuIsFer = 0x04; // wait morphing from a CondVar
static_assert(PerThreadSynch::kAlignment > kMuLow,
"PerThreadSynch::kAlignment must be greater than kMuLow");
@@ -741,25 +735,43 @@ static unsigned TsanFlags(Mutex::MuHow how) {
}
#endif
-static bool DebugOnlyIsExiting() {
- return false;
-}
+#if defined(__APPLE__) || defined(Y_ABSL_BUILD_DLL)
+// When building a dll symbol export lists may reference the destructor
+// and want it to be an exported symbol rather than an inline function.
+// Some apple builds also do dynamic library build but don't say it explicitly.
+Mutex::~Mutex() { Dtor(); }
+#endif
-Mutex::~Mutex() {
- intptr_t v = mu_.load(std::memory_order_relaxed);
- if ((v & kMuEvent) != 0 && !DebugOnlyIsExiting()) {
- ForgetSynchEvent(&this->mu_, kMuEvent, kMuSpin);
- }
+#if !defined(NDEBUG) || defined(Y_ABSL_HAVE_THREAD_SANITIZER)
+void Mutex::Dtor() {
if (kDebugMode) {
this->ForgetDeadlockInfo();
}
Y_ABSL_TSAN_MUTEX_DESTROY(this, __tsan_mutex_not_static);
}
+#endif
void Mutex::EnableDebugLog(const char* name) {
+ // Need to disable writes here and in EnableInvariantDebugging to prevent
+ // false race reports on SynchEvent objects. TSan ignores synchronization
+ // on synch_event_mu in Lock/Unlock/etc methods due to mutex annotations,
+ // but it sees few accesses to SynchEvent in EvalConditionAnnotated.
+ // If we don't ignore accesses here, it can result in false races
+ // between EvalConditionAnnotated and SynchEvent reuse in EnsureSynchEvent.
+ Y_ABSL_ANNOTATE_IGNORE_WRITES_BEGIN();
SynchEvent* e = EnsureSynchEvent(&this->mu_, name, kMuEvent, kMuSpin);
e->log = true;
UnrefSynchEvent(e);
+ // This prevents "error: undefined symbol: y_absl::Mutex::~Mutex()"
+ // in a release build (NDEBUG defined) when a test does "#undef NDEBUG"
+ // to use assert macro. In such case, the test does not get the dtor
+ // definition because it's supposed to be outline when NDEBUG is not defined,
+ // and this source file does not define one either because NDEBUG is defined.
+ // Since it's not possible to take address of a destructor, we move the
+ // actual destructor code into the separate Dtor function and force the
+ // compiler to emit this function even if it's inline by taking its address.
+ Y_ABSL_ATTRIBUTE_UNUSED volatile auto dtor = &Mutex::Dtor;
+ Y_ABSL_ANNOTATE_IGNORE_WRITES_END();
}
void EnableMutexInvariantDebugging(bool enabled) {
@@ -767,6 +779,7 @@ void EnableMutexInvariantDebugging(bool enabled) {
}
void Mutex::EnableInvariantDebugging(void (*invariant)(void*), void* arg) {
+ Y_ABSL_ANNOTATE_IGNORE_WRITES_BEGIN();
if (synch_check_invariants.load(std::memory_order_acquire) &&
invariant != nullptr) {
SynchEvent* e = EnsureSynchEvent(&this->mu_, nullptr, kMuEvent, kMuSpin);
@@ -774,6 +787,7 @@ void Mutex::EnableInvariantDebugging(void (*invariant)(void*), void* arg) {
e->arg = arg;
UnrefSynchEvent(e);
}
+ Y_ABSL_ANNOTATE_IGNORE_WRITES_END();
}
void SetMutexDeadlockDetectionMode(OnDeadlockCycle mode) {
@@ -924,20 +938,23 @@ static PerThreadSynch* Enqueue(PerThreadSynch* head, SynchWaitParams* waitp,
s->wake = false; // not being woken
s->cond_waiter = ((flags & kMuIsCond) != 0);
#ifdef Y_ABSL_HAVE_PTHREAD_GETSCHEDPARAM
- int64_t now_cycles = CycleClock::Now();
- if (s->next_priority_read_cycles < now_cycles) {
- // Every so often, update our idea of the thread's priority.
- // pthread_getschedparam() is 5% of the block/wakeup time;
- // CycleClock::Now() is 0.5%.
- int policy;
- struct sched_param param;
- const int err = pthread_getschedparam(pthread_self(), &policy, &param);
- if (err != 0) {
- Y_ABSL_RAW_LOG(ERROR, "pthread_getschedparam failed: %d", err);
- } else {
- s->priority = param.sched_priority;
- s->next_priority_read_cycles =
- now_cycles + static_cast<int64_t>(CycleClock::Frequency());
+ if ((flags & kMuIsFer) == 0) {
+ assert(s == Synch_GetPerThread());
+ int64_t now_cycles = CycleClock::Now();
+ if (s->next_priority_read_cycles < now_cycles) {
+ // Every so often, update our idea of the thread's priority.
+ // pthread_getschedparam() is 5% of the block/wakeup time;
+ // CycleClock::Now() is 0.5%.
+ int policy;
+ struct sched_param param;
+ const int err = pthread_getschedparam(pthread_self(), &policy, &param);
+ if (err != 0) {
+ Y_ABSL_RAW_LOG(ERROR, "pthread_getschedparam failed: %d", err);
+ } else {
+ s->priority = param.sched_priority;
+ s->next_priority_read_cycles =
+ now_cycles + static_cast<int64_t>(CycleClock::Frequency());
+ }
}
}
#endif
@@ -966,8 +983,7 @@ static PerThreadSynch* Enqueue(PerThreadSynch* head, SynchWaitParams* waitp,
} while (s->priority <= advance_to->priority);
// termination guaranteed because s->priority > head->priority
// and head is the end of a skip chain
- } else if (waitp->how == kExclusive &&
- Condition::GuaranteedEqual(waitp->cond, nullptr)) {
+ } else if (waitp->how == kExclusive && waitp->cond == nullptr) {
// An unlocker could be scanning the queue, but we know it will recheck
// the queue front for writers that have no condition, which is what s
// is, so an insert at front is safe.
@@ -998,6 +1014,24 @@ static PerThreadSynch* Enqueue(PerThreadSynch* head, SynchWaitParams* waitp,
if (MuEquivalentWaiter(s, s->next)) { // s->may_skip is known to be true
s->skip = s->next; // s may skip to its successor
}
+ } else if ((flags & kMuHasBlocked) &&
+ (s->priority >= head->next->priority) &&
+ (!head->maybe_unlocking ||
+ (waitp->how == kExclusive &&
+ Condition::GuaranteedEqual(waitp->cond, nullptr)))) {
+ // This thread has already waited, then was woken, then failed to acquire
+ // the mutex and now tries to requeue. Try to requeue it at head,
+ // otherwise it can suffer bad latency (wait whole queue several times).
+ // However, we need to be conservative. First, we need to ensure that we
+ // respect priorities. Then, we need to be careful to not break wait
+ // queue invariants: we require either that unlocker is not scanning
+ // the queue or that the current thread is a writer with no condition
+ // (unlocker will recheck the queue for such waiters).
+ s->next = head->next;
+ head->next = s;
+ if (MuEquivalentWaiter(s, s->next)) { // s->may_skip is known to be true
+ s->skip = s->next; // s may skip to its successor
+ }
} else { // enqueue not done any other way, so
// we're inserting s at the back
// s will become new head; copy data from head into it
@@ -1476,7 +1510,7 @@ void Mutex::AssertNotHeld() const {
// Attempt to acquire *mu, and return whether successful. The implementation
// may spin for a short while if the lock cannot be acquired immediately.
static bool TryAcquireWithSpinning(std::atomic<intptr_t>* mu) {
- int c = GetMutexGlobals().spinloop_iterations;
+ int c = globals.spinloop_iterations.load(std::memory_order_relaxed);
do { // do/while somewhat faster on AMD
intptr_t v = mu->load(std::memory_order_relaxed);
if ((v & (kMuReader | kMuEvent)) != 0) {
@@ -1496,11 +1530,12 @@ void Mutex::Lock() {
GraphId id = DebugOnlyDeadlockCheck(this);
intptr_t v = mu_.load(std::memory_order_relaxed);
// try fast acquire, then spin loop
- if ((v & (kMuWriter | kMuReader | kMuEvent)) != 0 ||
- !mu_.compare_exchange_strong(v, kMuWriter | v, std::memory_order_acquire,
- std::memory_order_relaxed)) {
+ if (Y_ABSL_PREDICT_FALSE((v & (kMuWriter | kMuReader | kMuEvent)) != 0) ||
+ Y_ABSL_PREDICT_FALSE(!mu_.compare_exchange_strong(
+ v, kMuWriter | v, std::memory_order_acquire,
+ std::memory_order_relaxed))) {
// try spin acquire, then slow loop
- if (!TryAcquireWithSpinning(&this->mu_)) {
+ if (Y_ABSL_PREDICT_FALSE(!TryAcquireWithSpinning(&this->mu_))) {
this->LockSlow(kExclusive, nullptr, 0);
}
}
@@ -1512,159 +1547,95 @@ void Mutex::ReaderLock() {
Y_ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_read_lock);
GraphId id = DebugOnlyDeadlockCheck(this);
intptr_t v = mu_.load(std::memory_order_relaxed);
- // try fast acquire, then slow loop
- if ((v & (kMuWriter | kMuWait | kMuEvent)) != 0 ||
- !mu_.compare_exchange_strong(v, (kMuReader | v) + kMuOne,
- std::memory_order_acquire,
- std::memory_order_relaxed)) {
- this->LockSlow(kShared, nullptr, 0);
+ for (;;) {
+ // If there are non-readers holding the lock, use the slow loop.
+ if (Y_ABSL_PREDICT_FALSE(v & (kMuWriter | kMuWait | kMuEvent)) != 0) {
+ this->LockSlow(kShared, nullptr, 0);
+ break;
+ }
+ // We can avoid the loop and only use the CAS when the lock is free or
+ // only held by readers.
+ if (Y_ABSL_PREDICT_TRUE(mu_.compare_exchange_weak(
+ v, (kMuReader | v) + kMuOne, std::memory_order_acquire,
+ std::memory_order_relaxed))) {
+ break;
+ }
}
DebugOnlyLockEnter(this, id);
Y_ABSL_TSAN_MUTEX_POST_LOCK(this, __tsan_mutex_read_lock, 0);
}
-void Mutex::LockWhen(const Condition& cond) {
- Y_ABSL_TSAN_MUTEX_PRE_LOCK(this, 0);
- GraphId id = DebugOnlyDeadlockCheck(this);
- this->LockSlow(kExclusive, &cond, 0);
- DebugOnlyLockEnter(this, id);
- Y_ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0);
-}
-
-bool Mutex::LockWhenWithTimeout(const Condition& cond, y_absl::Duration timeout) {
- Y_ABSL_TSAN_MUTEX_PRE_LOCK(this, 0);
- GraphId id = DebugOnlyDeadlockCheck(this);
- bool res = LockSlowWithDeadline(kExclusive, &cond, KernelTimeout(timeout), 0);
- DebugOnlyLockEnter(this, id);
- Y_ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0);
- return res;
-}
-
-bool Mutex::LockWhenWithDeadline(const Condition& cond, y_absl::Time deadline) {
- Y_ABSL_TSAN_MUTEX_PRE_LOCK(this, 0);
- GraphId id = DebugOnlyDeadlockCheck(this);
- bool res =
- LockSlowWithDeadline(kExclusive, &cond, KernelTimeout(deadline), 0);
- DebugOnlyLockEnter(this, id);
- Y_ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0);
- return res;
-}
-
-void Mutex::ReaderLockWhen(const Condition& cond) {
- Y_ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_read_lock);
- GraphId id = DebugOnlyDeadlockCheck(this);
- this->LockSlow(kShared, &cond, 0);
- DebugOnlyLockEnter(this, id);
- Y_ABSL_TSAN_MUTEX_POST_LOCK(this, __tsan_mutex_read_lock, 0);
-}
-
-bool Mutex::ReaderLockWhenWithTimeout(const Condition& cond,
- y_absl::Duration timeout) {
- Y_ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_read_lock);
- GraphId id = DebugOnlyDeadlockCheck(this);
- bool res = LockSlowWithDeadline(kShared, &cond, KernelTimeout(timeout), 0);
- DebugOnlyLockEnter(this, id);
- Y_ABSL_TSAN_MUTEX_POST_LOCK(this, __tsan_mutex_read_lock, 0);
- return res;
-}
-
-bool Mutex::ReaderLockWhenWithDeadline(const Condition& cond,
- y_absl::Time deadline) {
- Y_ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_read_lock);
+bool Mutex::LockWhenCommon(const Condition& cond,
+ synchronization_internal::KernelTimeout t,
+ bool write) {
+ MuHow how = write ? kExclusive : kShared;
+ Y_ABSL_TSAN_MUTEX_PRE_LOCK(this, TsanFlags(how));
GraphId id = DebugOnlyDeadlockCheck(this);
- bool res = LockSlowWithDeadline(kShared, &cond, KernelTimeout(deadline), 0);
+ bool res = LockSlowWithDeadline(how, &cond, t, 0);
DebugOnlyLockEnter(this, id);
- Y_ABSL_TSAN_MUTEX_POST_LOCK(this, __tsan_mutex_read_lock, 0);
+ Y_ABSL_TSAN_MUTEX_POST_LOCK(this, TsanFlags(how), 0);
return res;
}
-void Mutex::Await(const Condition& cond) {
- if (cond.Eval()) { // condition already true; nothing to do
- if (kDebugMode) {
- this->AssertReaderHeld();
- }
- } else { // normal case
- Y_ABSL_RAW_CHECK(this->AwaitCommon(cond, KernelTimeout::Never()),
- "condition untrue on return from Await");
- }
-}
-
-bool Mutex::AwaitWithTimeout(const Condition& cond, y_absl::Duration timeout) {
- if (cond.Eval()) { // condition already true; nothing to do
- if (kDebugMode) {
- this->AssertReaderHeld();
- }
- return true;
+bool Mutex::AwaitCommon(const Condition& cond, KernelTimeout t) {
+ if (kDebugMode) {
+ this->AssertReaderHeld();
}
-
- KernelTimeout t{timeout};
- bool res = this->AwaitCommon(cond, t);
- Y_ABSL_RAW_CHECK(res || t.has_timeout(),
- "condition untrue on return from Await");
- return res;
-}
-
-bool Mutex::AwaitWithDeadline(const Condition& cond, y_absl::Time deadline) {
if (cond.Eval()) { // condition already true; nothing to do
- if (kDebugMode) {
- this->AssertReaderHeld();
- }
return true;
}
-
- KernelTimeout t{deadline};
- bool res = this->AwaitCommon(cond, t);
- Y_ABSL_RAW_CHECK(res || t.has_timeout(),
- "condition untrue on return from Await");
- return res;
-}
-
-bool Mutex::AwaitCommon(const Condition& cond, KernelTimeout t) {
- this->AssertReaderHeld();
MuHow how =
(mu_.load(std::memory_order_relaxed) & kMuWriter) ? kExclusive : kShared;
Y_ABSL_TSAN_MUTEX_PRE_UNLOCK(this, TsanFlags(how));
SynchWaitParams waitp(how, &cond, t, nullptr /*no cvmu*/,
Synch_GetPerThreadAnnotated(this),
nullptr /*no cv_word*/);
- int flags = kMuHasBlocked;
- if (!Condition::GuaranteedEqual(&cond, nullptr)) {
- flags |= kMuIsCond;
- }
this->UnlockSlow(&waitp);
this->Block(waitp.thread);
Y_ABSL_TSAN_MUTEX_POST_UNLOCK(this, TsanFlags(how));
Y_ABSL_TSAN_MUTEX_PRE_LOCK(this, TsanFlags(how));
- this->LockSlowLoop(&waitp, flags);
+ this->LockSlowLoop(&waitp, kMuHasBlocked | kMuIsCond);
bool res = waitp.cond != nullptr || // => cond known true from LockSlowLoop
EvalConditionAnnotated(&cond, this, true, false, how == kShared);
Y_ABSL_TSAN_MUTEX_POST_LOCK(this, TsanFlags(how), 0);
+ Y_ABSL_RAW_CHECK(res || t.has_timeout(),
+ "condition untrue on return from Await");
return res;
}
bool Mutex::TryLock() {
Y_ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_try_lock);
intptr_t v = mu_.load(std::memory_order_relaxed);
- if ((v & (kMuWriter | kMuReader | kMuEvent)) == 0 && // try fast acquire
- mu_.compare_exchange_strong(v, kMuWriter | v, std::memory_order_acquire,
- std::memory_order_relaxed)) {
- DebugOnlyLockEnter(this);
- Y_ABSL_TSAN_MUTEX_POST_LOCK(this, __tsan_mutex_try_lock, 0);
- return true;
- }
- if ((v & kMuEvent) != 0) { // we're recording events
- if ((v & kExclusive->slow_need_zero) == 0 && // try fast acquire
- mu_.compare_exchange_strong(
- v, (kExclusive->fast_or | v) + kExclusive->fast_add,
- std::memory_order_acquire, std::memory_order_relaxed)) {
+ // Try fast acquire.
+ if (Y_ABSL_PREDICT_TRUE((v & (kMuWriter | kMuReader | kMuEvent)) == 0)) {
+ if (Y_ABSL_PREDICT_TRUE(mu_.compare_exchange_strong(
+ v, kMuWriter | v, std::memory_order_acquire,
+ std::memory_order_relaxed))) {
DebugOnlyLockEnter(this);
- PostSynchEvent(this, SYNCH_EV_TRYLOCK_SUCCESS);
Y_ABSL_TSAN_MUTEX_POST_LOCK(this, __tsan_mutex_try_lock, 0);
return true;
- } else {
- PostSynchEvent(this, SYNCH_EV_TRYLOCK_FAILED);
}
+ } else if (Y_ABSL_PREDICT_FALSE((v & kMuEvent) != 0)) {
+ // We're recording events.
+ return TryLockSlow();
+ }
+ Y_ABSL_TSAN_MUTEX_POST_LOCK(
+ this, __tsan_mutex_try_lock | __tsan_mutex_try_lock_failed, 0);
+ return false;
+}
+
+Y_ABSL_ATTRIBUTE_NOINLINE bool Mutex::TryLockSlow() {
+ intptr_t v = mu_.load(std::memory_order_relaxed);
+ if ((v & kExclusive->slow_need_zero) == 0 && // try fast acquire
+ mu_.compare_exchange_strong(
+ v, (kExclusive->fast_or | v) + kExclusive->fast_add,
+ std::memory_order_acquire, std::memory_order_relaxed)) {
+ DebugOnlyLockEnter(this);
+ PostSynchEvent(this, SYNCH_EV_TRYLOCK_SUCCESS);
+ Y_ABSL_TSAN_MUTEX_POST_LOCK(this, __tsan_mutex_try_lock, 0);
+ return true;
}
+ PostSynchEvent(this, SYNCH_EV_TRYLOCK_FAILED);
Y_ABSL_TSAN_MUTEX_POST_LOCK(
this, __tsan_mutex_try_lock | __tsan_mutex_try_lock_failed, 0);
return false;
@@ -1674,41 +1645,57 @@ bool Mutex::ReaderTryLock() {
Y_ABSL_TSAN_MUTEX_PRE_LOCK(this,
__tsan_mutex_read_lock | __tsan_mutex_try_lock);
intptr_t v = mu_.load(std::memory_order_relaxed);
+ // Clang tends to unroll the loop when compiling with optimization.
+ // But in this case it just unnecessary increases code size.
+ // If CAS is failing due to contention, the jump cost is negligible.
+#if defined(__clang__)
+#pragma nounroll
+#endif
// The while-loops (here and below) iterate only if the mutex word keeps
- // changing (typically because the reader count changes) under the CAS. We
- // limit the number of attempts to avoid having to think about livelock.
- int loop_limit = 5;
- while ((v & (kMuWriter | kMuWait | kMuEvent)) == 0 && loop_limit != 0) {
- if (mu_.compare_exchange_strong(v, (kMuReader | v) + kMuOne,
- std::memory_order_acquire,
- std::memory_order_relaxed)) {
+ // changing (typically because the reader count changes) under the CAS.
+ // We limit the number of attempts to avoid having to think about livelock.
+ for (int loop_limit = 5; loop_limit != 0; loop_limit--) {
+ if (Y_ABSL_PREDICT_FALSE((v & (kMuWriter | kMuWait | kMuEvent)) != 0)) {
+ break;
+ }
+ if (Y_ABSL_PREDICT_TRUE(mu_.compare_exchange_strong(
+ v, (kMuReader | v) + kMuOne, std::memory_order_acquire,
+ std::memory_order_relaxed))) {
DebugOnlyLockEnter(this);
Y_ABSL_TSAN_MUTEX_POST_LOCK(
this, __tsan_mutex_read_lock | __tsan_mutex_try_lock, 0);
return true;
}
- loop_limit--;
- v = mu_.load(std::memory_order_relaxed);
}
- if ((v & kMuEvent) != 0) { // we're recording events
- loop_limit = 5;
- while ((v & kShared->slow_need_zero) == 0 && loop_limit != 0) {
- if (mu_.compare_exchange_strong(v, (kMuReader | v) + kMuOne,
- std::memory_order_acquire,
- std::memory_order_relaxed)) {
- DebugOnlyLockEnter(this);
- PostSynchEvent(this, SYNCH_EV_READERTRYLOCK_SUCCESS);
- Y_ABSL_TSAN_MUTEX_POST_LOCK(
- this, __tsan_mutex_read_lock | __tsan_mutex_try_lock, 0);
- return true;
- }
- loop_limit--;
- v = mu_.load(std::memory_order_relaxed);
- }
- if ((v & kMuEvent) != 0) {
- PostSynchEvent(this, SYNCH_EV_READERTRYLOCK_FAILED);
+ if (Y_ABSL_PREDICT_TRUE((v & kMuEvent) == 0)) {
+ Y_ABSL_TSAN_MUTEX_POST_LOCK(this,
+ __tsan_mutex_read_lock | __tsan_mutex_try_lock |
+ __tsan_mutex_try_lock_failed,
+ 0);
+ return false;
+ }
+ // we're recording events
+ return ReaderTryLockSlow();
+}
+
+Y_ABSL_ATTRIBUTE_NOINLINE bool Mutex::ReaderTryLockSlow() {
+ intptr_t v = mu_.load(std::memory_order_relaxed);
+#if defined(__clang__)
+#pragma nounroll
+#endif
+ for (int loop_limit = 5; loop_limit != 0; loop_limit--) {
+ if ((v & kShared->slow_need_zero) == 0 &&
+ mu_.compare_exchange_strong(v, (kMuReader | v) + kMuOne,
+ std::memory_order_acquire,
+ std::memory_order_relaxed)) {
+ DebugOnlyLockEnter(this);
+ PostSynchEvent(this, SYNCH_EV_READERTRYLOCK_SUCCESS);
+ Y_ABSL_TSAN_MUTEX_POST_LOCK(
+ this, __tsan_mutex_read_lock | __tsan_mutex_try_lock, 0);
+ return true;
}
}
+ PostSynchEvent(this, SYNCH_EV_READERTRYLOCK_FAILED);
Y_ABSL_TSAN_MUTEX_POST_LOCK(this,
__tsan_mutex_read_lock | __tsan_mutex_try_lock |
__tsan_mutex_try_lock_failed,
@@ -1772,16 +1759,20 @@ void Mutex::ReaderUnlock() {
DebugOnlyLockLeave(this);
intptr_t v = mu_.load(std::memory_order_relaxed);
assert((v & (kMuWriter | kMuReader)) == kMuReader);
- if ((v & (kMuReader | kMuWait | kMuEvent)) == kMuReader) {
+ for (;;) {
+ if (Y_ABSL_PREDICT_FALSE((v & (kMuReader | kMuWait | kMuEvent)) !=
+ kMuReader)) {
+ this->UnlockSlow(nullptr /*no waitp*/); // take slow path
+ break;
+ }
// fast reader release (reader with no waiters)
intptr_t clear = ExactlyOneReader(v) ? kMuReader | kMuOne : kMuOne;
- if (mu_.compare_exchange_strong(v, v - clear, std::memory_order_release,
- std::memory_order_relaxed)) {
- Y_ABSL_TSAN_MUTEX_POST_UNLOCK(this, __tsan_mutex_read_lock);
- return;
+ if (Y_ABSL_PREDICT_TRUE(
+ mu_.compare_exchange_strong(v, v - clear, std::memory_order_release,
+ std::memory_order_relaxed))) {
+ break;
}
}
- this->UnlockSlow(nullptr /*no waitp*/); // take slow path
Y_ABSL_TSAN_MUTEX_POST_UNLOCK(this, __tsan_mutex_read_lock);
}
@@ -1816,6 +1807,22 @@ static intptr_t IgnoreWaitingWritersMask(int flag) {
// Internal version of LockWhen(). See LockSlowWithDeadline()
Y_ABSL_ATTRIBUTE_NOINLINE void Mutex::LockSlow(MuHow how, const Condition* cond,
int flags) {
+ // Note: we specifically initialize spinloop_iterations after the first use
+ // in TryAcquireWithSpinning so that Lock function does not have any non-tail
+ // calls and consequently a stack frame. It's fine to have spinloop_iterations
+ // uninitialized (meaning no spinning) in all initial uncontended Lock calls
+ // and in the first contended call. After that we will have
+ // spinloop_iterations properly initialized.
+ if (Y_ABSL_PREDICT_FALSE(
+ globals.spinloop_iterations.load(std::memory_order_relaxed) == 0)) {
+ if (y_absl::base_internal::NumCPUs() > 1) {
+ // If this is multiprocessor, allow spinning.
+ globals.spinloop_iterations.store(1500, std::memory_order_relaxed);
+ } else {
+ // If this a uniprocessor, only yield/sleep.
+ globals.spinloop_iterations.store(-1, std::memory_order_relaxed);
+ }
+ }
Y_ABSL_RAW_CHECK(
this->LockSlowWithDeadline(how, cond, KernelTimeout::Never(), flags),
"condition untrue on return from LockSlow");
@@ -1917,7 +1924,7 @@ bool Mutex::LockSlowWithDeadline(MuHow how, const Condition* cond,
SynchWaitParams waitp(how, cond, t, nullptr /*no cvmu*/,
Synch_GetPerThreadAnnotated(this),
nullptr /*no cv_word*/);
- if (!Condition::GuaranteedEqual(cond, nullptr)) {
+ if (cond != nullptr) {
flags |= kMuIsCond;
}
if (unlock) {
@@ -2107,7 +2114,6 @@ Y_ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams* waitp) {
// head of the list searched previously, or zero
PerThreadSynch* old_h = nullptr;
// a condition that's known to be false.
- const Condition* known_false = nullptr;
PerThreadSynch* wake_list = kPerThreadSynchNull; // list of threads to wake
intptr_t wr_wait = 0; // set to kMuWrWait if we wake a reader and a
// later writer could have acquired the lock
@@ -2211,7 +2217,7 @@ Y_ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams* waitp) {
}
}
if (h->next->waitp->how == kExclusive &&
- Condition::GuaranteedEqual(h->next->waitp->cond, nullptr)) {
+ h->next->waitp->cond == nullptr) {
// easy case: writer with no condition; no need to search
pw = h; // wake w, the successor of h (=pw)
w = h->next;
@@ -2294,10 +2300,8 @@ Y_ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams* waitp) {
w_walk->wake = false;
if (w_walk->waitp->cond ==
nullptr || // no condition => vacuously true OR
- (w_walk->waitp->cond != known_false &&
- // this thread's condition is not known false, AND
- // is in fact true
- EvalConditionIgnored(this, w_walk->waitp->cond))) {
+ // this thread's condition is true
+ EvalConditionIgnored(this, w_walk->waitp->cond)) {
if (w == nullptr) {
w_walk->wake = true; // can wake this waiter
w = w_walk;
@@ -2311,8 +2315,6 @@ Y_ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams* waitp) {
} else { // writer with true condition
wr_wait = kMuWrWait;
}
- } else { // can't wake; condition false
- known_false = w_walk->waitp->cond; // remember last false condition
}
if (w_walk->wake) { // we're waking reader w_walk
pw_walk = w_walk; // don't skip similar waiters
@@ -2418,10 +2420,10 @@ void Mutex::Fer(PerThreadSynch* w) {
int c = 0;
Y_ABSL_RAW_CHECK(w->waitp->cond == nullptr,
"Mutex::Fer while waiting on Condition");
- Y_ABSL_RAW_CHECK(!w->waitp->timeout.has_timeout(),
- "Mutex::Fer while in timed wait");
Y_ABSL_RAW_CHECK(w->waitp->cv_word == nullptr,
"Mutex::Fer with pending CondVar queueing");
+ // The CondVar timeout is not relevant for the Mutex wait.
+ w->waitp->timeout = {};
for (;;) {
intptr_t v = mu_.load(std::memory_order_relaxed);
// Note: must not queue if the mutex is unlocked (nobody will wake it).
@@ -2440,7 +2442,8 @@ void Mutex::Fer(PerThreadSynch* w) {
} else {
if ((v & (kMuSpin | kMuWait)) == 0) { // no waiters
// This thread tries to become the one and only waiter.
- PerThreadSynch* new_h = Enqueue(nullptr, w->waitp, v, kMuIsCond);
+ PerThreadSynch* new_h =
+ Enqueue(nullptr, w->waitp, v, kMuIsCond | kMuIsFer);
Y_ABSL_RAW_CHECK(new_h != nullptr,
"Enqueue failed"); // we must queue ourselves
if (mu_.compare_exchange_strong(
@@ -2451,7 +2454,7 @@ void Mutex::Fer(PerThreadSynch* w) {
} else if ((v & kMuSpin) == 0 &&
mu_.compare_exchange_strong(v, v | kMuSpin | kMuWait)) {
PerThreadSynch* h = GetPerThreadSynch(v);
- PerThreadSynch* new_h = Enqueue(h, w->waitp, v, kMuIsCond);
+ PerThreadSynch* new_h = Enqueue(h, w->waitp, v, kMuIsCond | kMuIsFer);
Y_ABSL_RAW_CHECK(new_h != nullptr,
"Enqueue failed"); // we must queue ourselves
do {
@@ -2507,12 +2510,6 @@ void CondVar::EnableDebugLog(const char* name) {
UnrefSynchEvent(e);
}
-CondVar::~CondVar() {
- if ((cv_.load(std::memory_order_relaxed) & kCvEvent) != 0) {
- ForgetSynchEvent(&this->cv_, kCvEvent, kCvSpin);
- }
-}
-
// Remove thread s from the list of waiters on this condition variable.
void CondVar::Remove(PerThreadSynch* s) {
SchedulingGuard::ScopedDisable disable_rescheduling;
@@ -2663,33 +2660,6 @@ bool CondVar::WaitCommon(Mutex* mutex, KernelTimeout t) {
return rc;
}
-bool CondVar::WaitWithTimeout(Mutex* mu, y_absl::Duration timeout) {
- return WaitCommon(mu, KernelTimeout(timeout));
-}
-
-bool CondVar::WaitWithDeadline(Mutex* mu, y_absl::Time deadline) {
- return WaitCommon(mu, KernelTimeout(deadline));
-}
-
-void CondVar::Wait(Mutex* mu) { WaitCommon(mu, KernelTimeout::Never()); }
-
-// Wake thread w
-// If it was a timed wait, w will be waiting on w->cv
-// Otherwise, if it was not a Mutex mutex, w will be waiting on w->sem
-// Otherwise, w is transferred to the Mutex mutex via Mutex::Fer().
-void CondVar::Wakeup(PerThreadSynch* w) {
- if (w->waitp->timeout.has_timeout() || w->waitp->cvmu == nullptr) {
- // The waiting thread only needs to observe "w->state == kAvailable" to be
- // released, we must cache "cvmu" before clearing "next".
- Mutex* mu = w->waitp->cvmu;
- w->next = nullptr;
- w->state.store(PerThreadSynch::kAvailable, std::memory_order_release);
- Mutex::IncrementSynchSem(mu, w);
- } else {
- w->waitp->cvmu->Fer(w);
- }
-}
-
void CondVar::Signal() {
SchedulingGuard::ScopedDisable disable_rescheduling;
Y_ABSL_TSAN_MUTEX_PRE_SIGNAL(nullptr, 0);
@@ -2714,7 +2684,7 @@ void CondVar::Signal() {
cv_.store((v & kCvEvent) | reinterpret_cast<intptr_t>(h),
std::memory_order_release);
if (w != nullptr) {
- CondVar::Wakeup(w); // wake waiter, if there was one
+ w->waitp->cvmu->Fer(w); // wake waiter, if there was one
cond_var_tracer("Signal wakeup", this);
}
if ((v & kCvEvent) != 0) {
@@ -2750,7 +2720,7 @@ void CondVar::SignalAll() {
do { // for every thread, wake it up
w = n;
n = n->next;
- CondVar::Wakeup(w);
+ w->waitp->cvmu->Fer(w);
} while (w != h);
cond_var_tracer("SignalAll wakeup", this);
}
@@ -2814,17 +2784,11 @@ Condition::Condition(const bool* cond)
StoreCallback(dereference);
}
-bool Condition::Eval() const {
- // eval_ == null for kTrue
- return (this->eval_ == nullptr) || (*this->eval_)(this);
-}
+bool Condition::Eval() const { return (*this->eval_)(this); }
bool Condition::GuaranteedEqual(const Condition* a, const Condition* b) {
- // kTrue logic.
- if (a == nullptr || a->eval_ == nullptr) {
- return b == nullptr || b->eval_ == nullptr;
- } else if (b == nullptr || b->eval_ == nullptr) {
- return false;
+ if (a == nullptr || b == nullptr) {
+ return a == b;
}
// Check equality of the representative fields.
return a->eval_ == b->eval_ && a->arg_ == b->arg_ &&
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.h b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.h
index 40aab749a80..6dae8b408db 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.h
@@ -64,6 +64,7 @@
#include <iterator>
#include <util/generic/string.h>
+#include "y_absl/base/attributes.h"
#include "y_absl/base/const_init.h"
#include "y_absl/base/internal/identity.h"
#include "y_absl/base/internal/low_level_alloc.h"
@@ -324,7 +325,9 @@ class Y_ABSL_LOCKABLE Mutex {
// `true`, `Await()` *may* skip the release/re-acquire step.
//
// `Await()` requires that this thread holds this `Mutex` in some mode.
- void Await(const Condition& cond);
+ void Await(const Condition& cond) {
+ AwaitCommon(cond, synchronization_internal::KernelTimeout::Never());
+ }
// Mutex::LockWhen()
// Mutex::ReaderLockWhen()
@@ -334,9 +337,15 @@ class Y_ABSL_LOCKABLE Mutex {
// be acquired, then atomically acquires this `Mutex`. `LockWhen()` is
// logically equivalent to `*Lock(); Await();` though they may have different
// performance characteristics.
- void LockWhen(const Condition& cond) Y_ABSL_EXCLUSIVE_LOCK_FUNCTION();
+ void LockWhen(const Condition& cond) Y_ABSL_EXCLUSIVE_LOCK_FUNCTION() {
+ LockWhenCommon(cond, synchronization_internal::KernelTimeout::Never(),
+ true);
+ }
- void ReaderLockWhen(const Condition& cond) Y_ABSL_SHARED_LOCK_FUNCTION();
+ void ReaderLockWhen(const Condition& cond) Y_ABSL_SHARED_LOCK_FUNCTION() {
+ LockWhenCommon(cond, synchronization_internal::KernelTimeout::Never(),
+ false);
+ }
void WriterLockWhen(const Condition& cond) Y_ABSL_EXCLUSIVE_LOCK_FUNCTION() {
this->LockWhen(cond);
@@ -363,9 +372,13 @@ class Y_ABSL_LOCKABLE Mutex {
// Negative timeouts are equivalent to a zero timeout.
//
// This method requires that this thread holds this `Mutex` in some mode.
- bool AwaitWithTimeout(const Condition& cond, y_absl::Duration timeout);
+ bool AwaitWithTimeout(const Condition& cond, y_absl::Duration timeout) {
+ return AwaitCommon(cond, synchronization_internal::KernelTimeout{timeout});
+ }
- bool AwaitWithDeadline(const Condition& cond, y_absl::Time deadline);
+ bool AwaitWithDeadline(const Condition& cond, y_absl::Time deadline) {
+ return AwaitCommon(cond, synchronization_internal::KernelTimeout{deadline});
+ }
// Mutex::LockWhenWithTimeout()
// Mutex::ReaderLockWhenWithTimeout()
@@ -379,9 +392,15 @@ class Y_ABSL_LOCKABLE Mutex {
//
// Negative timeouts are equivalent to a zero timeout.
bool LockWhenWithTimeout(const Condition& cond, y_absl::Duration timeout)
- Y_ABSL_EXCLUSIVE_LOCK_FUNCTION();
+ Y_ABSL_EXCLUSIVE_LOCK_FUNCTION() {
+ return LockWhenCommon(
+ cond, synchronization_internal::KernelTimeout{timeout}, true);
+ }
bool ReaderLockWhenWithTimeout(const Condition& cond, y_absl::Duration timeout)
- Y_ABSL_SHARED_LOCK_FUNCTION();
+ Y_ABSL_SHARED_LOCK_FUNCTION() {
+ return LockWhenCommon(
+ cond, synchronization_internal::KernelTimeout{timeout}, false);
+ }
bool WriterLockWhenWithTimeout(const Condition& cond, y_absl::Duration timeout)
Y_ABSL_EXCLUSIVE_LOCK_FUNCTION() {
return this->LockWhenWithTimeout(cond, timeout);
@@ -399,9 +418,15 @@ class Y_ABSL_LOCKABLE Mutex {
//
// Deadlines in the past are equivalent to an immediate deadline.
bool LockWhenWithDeadline(const Condition& cond, y_absl::Time deadline)
- Y_ABSL_EXCLUSIVE_LOCK_FUNCTION();
+ Y_ABSL_EXCLUSIVE_LOCK_FUNCTION() {
+ return LockWhenCommon(
+ cond, synchronization_internal::KernelTimeout{deadline}, true);
+ }
bool ReaderLockWhenWithDeadline(const Condition& cond, y_absl::Time deadline)
- Y_ABSL_SHARED_LOCK_FUNCTION();
+ Y_ABSL_SHARED_LOCK_FUNCTION() {
+ return LockWhenCommon(
+ cond, synchronization_internal::KernelTimeout{deadline}, false);
+ }
bool WriterLockWhenWithDeadline(const Condition& cond, y_absl::Time deadline)
Y_ABSL_EXCLUSIVE_LOCK_FUNCTION() {
return this->LockWhenWithDeadline(cond, deadline);
@@ -497,15 +522,22 @@ class Y_ABSL_LOCKABLE Mutex {
int flags) Y_ABSL_ATTRIBUTE_COLD;
// slow path release
void UnlockSlow(SynchWaitParams* waitp) Y_ABSL_ATTRIBUTE_COLD;
+ // TryLock slow path.
+ bool TryLockSlow();
+ // ReaderTryLock slow path.
+ bool ReaderTryLockSlow();
// Common code between Await() and AwaitWithTimeout/Deadline()
bool AwaitCommon(const Condition& cond,
synchronization_internal::KernelTimeout t);
+ bool LockWhenCommon(const Condition& cond,
+ synchronization_internal::KernelTimeout t, bool write);
// Attempt to remove thread s from queue.
void TryRemove(base_internal::PerThreadSynch* s);
// Block a thread on mutex.
void Block(base_internal::PerThreadSynch* s);
// Wake a thread; return successor.
base_internal::PerThreadSynch* Wakeup(base_internal::PerThreadSynch* w);
+ void Dtor();
friend class CondVar; // for access to Trans()/Fer().
void Trans(MuHow how); // used for CondVar->Mutex transfer
@@ -708,23 +740,25 @@ class Condition {
// a function template is passed as `func`. Also, the dummy `typename = void`
// template parameter exists just to work around a MSVC mangling bug.
template <typename T, typename = void>
- Condition(bool (*func)(T*), typename y_absl::internal::identity<T>::type* arg);
+ Condition(bool (*func)(T*),
+ typename y_absl::internal::type_identity<T>::type* arg);
// Templated version for invoking a method that returns a `bool`.
//
// `Condition(object, &Class::Method)` constructs a `Condition` that evaluates
// `object->Method()`.
//
- // Implementation Note: `y_absl::internal::identity` is used to allow methods to
- // come from base classes. A simpler signature like
+ // Implementation Note: `y_absl::internal::type_identity` is used to allow
+ // methods to come from base classes. A simpler signature like
// `Condition(T*, bool (T::*)())` does not suffice.
template <typename T>
- Condition(T* object, bool (y_absl::internal::identity<T>::type::*method)());
+ Condition(T* object,
+ bool (y_absl::internal::type_identity<T>::type::*method)());
// Same as above, for const members
template <typename T>
Condition(const T* object,
- bool (y_absl::internal::identity<T>::type::*method)() const);
+ bool (y_absl::internal::type_identity<T>::type::*method)() const);
// A Condition that returns the value of `*cond`
explicit Condition(const bool* cond);
@@ -816,7 +850,7 @@ class Condition {
static bool CallVoidPtrFunction(const Condition*);
template <typename T>
static bool CastAndCallFunction(const Condition* c);
- template <typename T>
+ template <typename T, typename ConditionMethodPtr>
static bool CastAndCallMethod(const Condition* c);
// Helper methods for storing, validating, and reading callback arguments.
@@ -833,8 +867,10 @@ class Condition {
std::memcpy(callback, callback_, sizeof(*callback));
}
+ static bool AlwaysTrue(const Condition*) { return true; }
+
// Used only to create kTrue.
- constexpr Condition() = default;
+ constexpr Condition() : eval_(AlwaysTrue), arg_(nullptr) {}
};
// -----------------------------------------------------------------------------
@@ -877,7 +913,6 @@ class CondVar {
// A `CondVar` allocated on the heap or on the stack can use the this
// constructor.
CondVar();
- ~CondVar();
// CondVar::Wait()
//
@@ -886,7 +921,9 @@ class CondVar {
// spurious wakeup), then reacquires the `Mutex` and returns.
//
// Requires and ensures that the current thread holds the `Mutex`.
- void Wait(Mutex* mu);
+ void Wait(Mutex* mu) {
+ WaitCommon(mu, synchronization_internal::KernelTimeout::Never());
+ }
// CondVar::WaitWithTimeout()
//
@@ -901,7 +938,9 @@ class CondVar {
// to return `true` or `false`.
//
// Requires and ensures that the current thread holds the `Mutex`.
- bool WaitWithTimeout(Mutex* mu, y_absl::Duration timeout);
+ bool WaitWithTimeout(Mutex* mu, y_absl::Duration timeout) {
+ return WaitCommon(mu, synchronization_internal::KernelTimeout(timeout));
+ }
// CondVar::WaitWithDeadline()
//
@@ -918,7 +957,9 @@ class CondVar {
// to return `true` or `false`.
//
// Requires and ensures that the current thread holds the `Mutex`.
- bool WaitWithDeadline(Mutex* mu, y_absl::Time deadline);
+ bool WaitWithDeadline(Mutex* mu, y_absl::Time deadline) {
+ return WaitCommon(mu, synchronization_internal::KernelTimeout(deadline));
+ }
// CondVar::Signal()
//
@@ -940,7 +981,6 @@ class CondVar {
private:
bool WaitCommon(Mutex* mutex, synchronization_internal::KernelTimeout t);
void Remove(base_internal::PerThreadSynch* s);
- void Wakeup(base_internal::PerThreadSynch* w);
std::atomic<intptr_t> cv_; // Condition variable state.
CondVar(const CondVar&) = delete;
CondVar& operator=(const CondVar&) = delete;
@@ -1024,15 +1064,30 @@ inline Mutex::Mutex() : mu_(0) {
inline constexpr Mutex::Mutex(y_absl::ConstInitType) : mu_(0) {}
+#if !defined(__APPLE__) && !defined(Y_ABSL_BUILD_DLL)
+Y_ABSL_ATTRIBUTE_ALWAYS_INLINE
+inline Mutex::~Mutex() { Dtor(); }
+#endif
+
+#if defined(NDEBUG) && !defined(Y_ABSL_HAVE_THREAD_SANITIZER)
+// Use default (empty) destructor in release build for performance reasons.
+// We need to mark both Dtor and ~Mutex as always inline for inconsistent
+// builds that use both NDEBUG and !NDEBUG with dynamic libraries. In these
+// cases we want the empty functions to dissolve entirely rather than being
+// exported from dynamic libraries and potentially override the non-empty ones.
+Y_ABSL_ATTRIBUTE_ALWAYS_INLINE
+inline void Mutex::Dtor() {}
+#endif
+
inline CondVar::CondVar() : cv_(0) {}
// static
-template <typename T>
+template <typename T, typename ConditionMethodPtr>
bool Condition::CastAndCallMethod(const Condition* c) {
T* object = static_cast<T*>(c->arg_);
- bool (T::*method_pointer)();
- c->ReadCallback(&method_pointer);
- return (object->*method_pointer)();
+ ConditionMethodPtr condition_method_pointer;
+ c->ReadCallback(&condition_method_pointer);
+ return (object->*condition_method_pointer)();
}
// static
@@ -1054,25 +1109,25 @@ inline Condition::Condition(bool (*func)(T*), T* arg)
}
template <typename T, typename>
-inline Condition::Condition(bool (*func)(T*),
- typename y_absl::internal::identity<T>::type* arg)
+inline Condition::Condition(
+ bool (*func)(T*), typename y_absl::internal::type_identity<T>::type* arg)
// Just delegate to the overload above.
: Condition(func, arg) {}
template <typename T>
-inline Condition::Condition(T* object,
- bool (y_absl::internal::identity<T>::type::*method)())
- : eval_(&CastAndCallMethod<T>), arg_(object) {
+inline Condition::Condition(
+ T* object, bool (y_absl::internal::type_identity<T>::type::*method)())
+ : eval_(&CastAndCallMethod<T, decltype(method)>), arg_(object) {
static_assert(sizeof(&method) <= sizeof(callback_),
"An overlarge method pointer was passed to Condition.");
StoreCallback(method);
}
template <typename T>
-inline Condition::Condition(const T* object,
- bool (y_absl::internal::identity<T>::type::*method)()
- const)
- : eval_(&CastAndCallMethod<T>),
+inline Condition::Condition(
+ const T* object,
+ bool (y_absl::internal::type_identity<T>::type::*method)() const)
+ : eval_(&CastAndCallMethod<const T, decltype(method)>),
arg_(reinterpret_cast<void*>(const_cast<T*>(object))) {
StoreCallback(method);
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/time/civil_time.h b/contrib/restricted/abseil-cpp-tstring/y_absl/time/civil_time.h
index 2654bc56fae..fcf4247360b 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/time/civil_time.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/time/civil_time.h
@@ -462,6 +462,32 @@ TString FormatCivilTime(CivilDay c);
TString FormatCivilTime(CivilMonth c);
TString FormatCivilTime(CivilYear c);
+// Support for StrFormat(), StrCat(), etc
+template <typename Sink>
+void AbslStringify(Sink& sink, CivilSecond c) {
+ sink.Append(FormatCivilTime(c));
+}
+template <typename Sink>
+void AbslStringify(Sink& sink, CivilMinute c) {
+ sink.Append(FormatCivilTime(c));
+}
+template <typename Sink>
+void AbslStringify(Sink& sink, CivilHour c) {
+ sink.Append(FormatCivilTime(c));
+}
+template <typename Sink>
+void AbslStringify(Sink& sink, CivilDay c) {
+ sink.Append(FormatCivilTime(c));
+}
+template <typename Sink>
+void AbslStringify(Sink& sink, CivilMonth c) {
+ sink.Append(FormatCivilTime(c));
+}
+template <typename Sink>
+void AbslStringify(Sink& sink, CivilYear c) {
+ sink.Append(FormatCivilTime(c));
+}
+
// y_absl::ParseCivilTime()
//
// Parses a civil-time value from the specified `y_absl::string_view` into the
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/time/clock.h b/contrib/restricted/abseil-cpp-tstring/y_absl/time/clock.h
index 1369748e6ae..5473e886b80 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/time/clock.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/time/clock.h
@@ -22,6 +22,9 @@
#ifndef Y_ABSL_TIME_CLOCK_H_
#define Y_ABSL_TIME_CLOCK_H_
+#include <cstdint>
+
+#include "y_absl/base/config.h"
#include "y_absl/base/macros.h"
#include "y_absl/time/time.h"
@@ -64,7 +67,8 @@ Y_ABSL_NAMESPACE_END
// By changing our extension points to be extern "C", we dodge this
// check.
extern "C" {
-void Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSleepFor)(y_absl::Duration duration);
+Y_ABSL_DLL void Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSleepFor)(
+ y_absl::Duration duration);
} // extern "C"
inline void y_absl::SleepFor(y_absl::Duration duration) {
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/time/duration.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/time/duration.cc
index f6b2f464dc7..62c355ce808 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/time/duration.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/time/duration.cc
@@ -55,8 +55,7 @@
#include <algorithm>
#include <cassert>
-#include <cctype>
-#include <cerrno>
+#include <chrono> // NOLINT(build/c++11)
#include <cmath>
#include <cstdint>
#include <cstdlib>
@@ -66,8 +65,9 @@
#include <limits>
#include <util/generic/string.h>
+#include "y_absl/base/attributes.h"
#include "y_absl/base/casts.h"
-#include "y_absl/base/macros.h"
+#include "y_absl/base/config.h"
#include "y_absl/numeric/int128.h"
#include "y_absl/strings/string_view.h"
#include "y_absl/strings/strip.h"
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/include/cctz/civil_time_detail.h b/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/include/cctz/civil_time_detail.h
index b5cd52c7cf0..b7cf528cfcd 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/include/cctz/civil_time_detail.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/include/cctz/civil_time_detail.h
@@ -401,11 +401,11 @@ class civil_time {
: civil_time(ct.f_) {}
// Factories for the maximum/minimum representable civil_time.
- static CONSTEXPR_F civil_time(max)() {
+ static CONSTEXPR_F auto(max)() -> civil_time {
const auto max_year = (std::numeric_limits<std::int_least64_t>::max)();
return civil_time(max_year, 12, 31, 23, 59, 59);
}
- static CONSTEXPR_F civil_time(min)() {
+ static CONSTEXPR_F auto(min)() -> civil_time {
const auto min_year = (std::numeric_limits<std::int_least64_t>::min)();
return civil_time(min_year, 1, 1, 0, 0, 0);
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_info.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_info.cc
index eced23a3627..626a45c24ef 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_info.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_info.cc
@@ -474,7 +474,8 @@ std::unique_ptr<ZoneInfoSource> AndroidZoneInfoSource::Open(
const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;
// See Android's libc/tzcode/bionic.cpp for additional information.
- for (const char* tzdata : {"/data/misc/zoneinfo/current/tzdata",
+ for (const char* tzdata : {"/apex/com.android.tzdata/etc/tz/tzdata",
+ "/data/misc/zoneinfo/current/tzdata",
"/system/usr/share/zoneinfo/tzdata"}) {
auto fp = FOpen(tzdata, "rb");
if (fp == nullptr) continue;
@@ -539,9 +540,16 @@ std::unique_ptr<ZoneInfoSource> FuchsiaZoneInfoSource::Open(
// Prefixes where a Fuchsia component might find zoneinfo files,
// in descending order of preference.
const auto kTzdataPrefixes = {
+ // The tzdata from `config-data`.
"/config/data/tzdata/",
+ // The tzdata bundled in the component's package.
"/pkg/data/tzdata/",
+ // General data storage.
"/data/tzdata/",
+ // The recommended path for routed-in tzdata files.
+ // See for details:
+ // https://fuchsia.dev/fuchsia-src/concepts/process/namespaces?hl=en#typical_directory_structure
+ "/config/tzdata/",
};
const auto kEmptyPrefix = {""};
const bool name_absolute = (pos != name.size() && name[pos] == '/');
@@ -744,19 +752,6 @@ bool TimeZoneInfo::Load(ZoneInfoSource* zip) {
version_ = zip->Version();
}
- // Trim redundant transitions. zic may have added these to work around
- // differences between the glibc and reference implementations (see
- // zic.c:dontmerge) or to avoid bugs in old readers. For us, they just
- // get in the way when we do future_spec_ extension.
- while (hdr.timecnt > 1) {
- if (!EquivTransitions(transitions_[hdr.timecnt - 1].type_index,
- transitions_[hdr.timecnt - 2].type_index)) {
- break;
- }
- hdr.timecnt -= 1;
- }
- transitions_.resize(hdr.timecnt);
-
// Ensure that there is always a transition in the first half of the
// time line (the second half is handled below) so that the signed
// difference between a civil_second and the civil_second of its
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/tzfile.h b/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/tzfile.h
index 9613055db70..114026d066c 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/tzfile.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/tzfile.h
@@ -21,14 +21,6 @@
** Information about time zone files.
*/
-#ifndef TZDIR
-#define TZDIR "/usr/share/zoneinfo" /* Time zone object file directory */
-#endif /* !defined TZDIR */
-
-#ifndef TZDEFAULT
-#define TZDEFAULT "/etc/localtime"
-#endif /* !defined TZDEFAULT */
-
#ifndef TZDEFRULES
#define TZDEFRULES "posixrules"
#endif /* !defined TZDEFRULES */
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_any_cast.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_any_cast.cc
index 14ed288ece6..a61546e9b2f 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_any_cast.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_any_cast.cc
@@ -43,4 +43,22 @@ void ThrowBadAnyCast() {
Y_ABSL_NAMESPACE_END
} // namespace y_absl
+#else
+
+// https://github.com/abseil/abseil-cpp/issues/1465
+// CMake builds on Apple platforms error when libraries are empty.
+// Our CMake configuration can avoid this error on header-only libraries,
+// but since this library is conditionally empty, including a single
+// variable is an easy workaround.
+#ifdef __APPLE__
+namespace y_absl {
+Y_ABSL_NAMESPACE_BEGIN
+namespace types_internal {
+extern const char kAvoidEmptyBadAnyCastLibraryWarning;
+const char kAvoidEmptyBadAnyCastLibraryWarning = 0;
+} // namespace types_internal
+Y_ABSL_NAMESPACE_END
+} // namespace y_absl
+#endif // __APPLE__
+
#endif // Y_ABSL_USES_STD_ANY
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_optional_access.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_optional_access.cc
index 29740a4838a..6c84468afc1 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_optional_access.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_optional_access.cc
@@ -45,4 +45,22 @@ void throw_bad_optional_access() {
Y_ABSL_NAMESPACE_END
} // namespace y_absl
+#else
+
+// https://github.com/abseil/abseil-cpp/issues/1465
+// CMake builds on Apple platforms error when libraries are empty.
+// Our CMake configuration can avoid this error on header-only libraries,
+// but since this library is conditionally empty, including a single
+// variable is an easy workaround.
+#ifdef __APPLE__
+namespace y_absl {
+Y_ABSL_NAMESPACE_BEGIN
+namespace types_internal {
+extern const char kAvoidEmptyBadOptionalAccessLibraryWarning;
+const char kAvoidEmptyBadOptionalAccessLibraryWarning = 0;
+} // namespace types_internal
+Y_ABSL_NAMESPACE_END
+} // namespace y_absl
+#endif // __APPLE__
+
#endif // Y_ABSL_USES_STD_OPTIONAL
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_variant_access.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_variant_access.cc
index 51345713a8f..e73739552cc 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_variant_access.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_variant_access.cc
@@ -61,4 +61,22 @@ void Rethrow() {
Y_ABSL_NAMESPACE_END
} // namespace y_absl
+#else
+
+// https://github.com/abseil/abseil-cpp/issues/1465
+// CMake builds on Apple platforms error when libraries are empty.
+// Our CMake configuration can avoid this error on header-only libraries,
+// but since this library is conditionally empty, including a single
+// variable is an easy workaround.
+#ifdef __APPLE__
+namespace y_absl {
+Y_ABSL_NAMESPACE_BEGIN
+namespace types_internal {
+extern const char kAvoidEmptyBadVariantAccessLibraryWarning;
+const char kAvoidEmptyBadVariantAccessLibraryWarning = 0;
+} // namespace types_internal
+Y_ABSL_NAMESPACE_END
+} // namespace y_absl
+#endif // __APPLE__
+
#endif // Y_ABSL_USES_STD_VARIANT
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/types/internal/variant.h b/contrib/restricted/abseil-cpp-tstring/y_absl/types/internal/variant.h
index c3e5cad1bc8..da3bd41d861 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/types/internal/variant.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/types/internal/variant.h
@@ -1047,11 +1047,11 @@ class VariantStateBase {
std::size_t index_;
};
-using y_absl::internal::identity;
+using y_absl::internal::type_identity;
// OverloadSet::Overload() is a unary function which is overloaded to
// take any of the element types of the variant, by reference-to-const.
-// The return type of the overload on T is identity<T>, so that you
+// The return type of the overload on T is type_identity<T>, so that you
// can statically determine which overload was called.
//
// Overload() is not defined, so it can only be called in unevaluated
@@ -1062,7 +1062,7 @@ struct OverloadSet;
template <typename T, typename... Ts>
struct OverloadSet<T, Ts...> : OverloadSet<Ts...> {
using Base = OverloadSet<Ts...>;
- static identity<T> Overload(const T&);
+ static type_identity<T> Overload(const T&);
using Base::Overload;
};
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/types/optional.h b/contrib/restricted/abseil-cpp-tstring/y_absl/types/optional.h
index 2d4eefeec00..fe5ff87fc71 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/types/optional.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/types/optional.h
@@ -61,6 +61,7 @@ Y_ABSL_NAMESPACE_END
#include <utility>
#include "y_absl/base/attributes.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/base/internal/inline_variable.h"
#include "y_absl/meta/type_traits.h"
#include "y_absl/types/bad_optional_access.h"
@@ -415,11 +416,11 @@ class optional : private optional_internal::optional_data<T>,
// `optional` is empty, behavior is undefined.
//
// If you need myOpt->foo in constexpr, use (*myOpt).foo instead.
- const T* operator->() const Y_ABSL_ATTRIBUTE_LIFETIME_BOUND {
+ y_absl::Nonnull<const T*> operator->() const Y_ABSL_ATTRIBUTE_LIFETIME_BOUND {
Y_ABSL_HARDENING_ASSERT(this->engaged_);
return std::addressof(this->data_);
}
- T* operator->() Y_ABSL_ATTRIBUTE_LIFETIME_BOUND {
+ y_absl::Nonnull<T*> operator->() Y_ABSL_ATTRIBUTE_LIFETIME_BOUND {
Y_ABSL_HARDENING_ASSERT(this->engaged_);
return std::addressof(this->data_);
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/types/span.h b/contrib/restricted/abseil-cpp-tstring/y_absl/types/span.h
index 8096724218d..83bee533f12 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/types/span.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/types/span.h
@@ -63,6 +63,7 @@
#include "y_absl/base/attributes.h"
#include "y_absl/base/internal/throw_delegate.h"
#include "y_absl/base/macros.h"
+#include "y_absl/base/nullability.h"
#include "y_absl/base/optimization.h"
#include "y_absl/base/port.h" // TODO(strel): remove this include
#include "y_absl/meta/type_traits.h"
@@ -172,6 +173,8 @@ class Span {
public:
using element_type = T;
using value_type = y_absl::remove_cv_t<T>;
+ // TODO(b/316099902) - pointer should be Nullable<T*>, but this makes it hard
+ // to recognize foreach loops as safe.
using pointer = T*;
using const_pointer = const T*;
using reference = T&;
@@ -679,12 +682,12 @@ bool operator>=(Span<T> a, const U& b) {
// }
//
template <int&... ExplicitArgumentBarrier, typename T>
-constexpr Span<T> MakeSpan(T* ptr, size_t size) noexcept {
+constexpr Span<T> MakeSpan(y_absl::Nullable<T*> ptr, size_t size) noexcept {
return Span<T>(ptr, size);
}
template <int&... ExplicitArgumentBarrier, typename T>
-Span<T> MakeSpan(T* begin, T* end) noexcept {
+Span<T> MakeSpan(y_absl::Nullable<T*> begin, y_absl::Nullable<T*> end) noexcept {
return Y_ABSL_HARDENING_ASSERT(begin <= end),
Span<T>(begin, static_cast<size_t>(end - begin));
}
@@ -725,12 +728,14 @@ constexpr Span<T> MakeSpan(T (&array)[N]) noexcept {
// ProcessInts(y_absl::MakeConstSpan(std::vector<int>{ 0, 0, 0 }));
//
template <int&... ExplicitArgumentBarrier, typename T>
-constexpr Span<const T> MakeConstSpan(T* ptr, size_t size) noexcept {
+constexpr Span<const T> MakeConstSpan(y_absl::Nullable<T*> ptr,
+ size_t size) noexcept {
return Span<const T>(ptr, size);
}
template <int&... ExplicitArgumentBarrier, typename T>
-Span<const T> MakeConstSpan(T* begin, T* end) noexcept {
+Span<const T> MakeConstSpan(y_absl::Nullable<T*> begin,
+ y_absl::Nullable<T*> end) noexcept {
return Y_ABSL_HARDENING_ASSERT(begin <= end), Span<const T>(begin, end - begin);
}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/utility/utility.h b/contrib/restricted/abseil-cpp-tstring/y_absl/utility/utility.h
index 7ea0d452a5e..f0c4db7f60d 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/utility/utility.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/utility/utility.h
@@ -12,17 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// This header file contains C++11 versions of standard <utility> header
-// abstractions available within C++14 and C++17, and are designed to be drop-in
+// This header file contains C++14 versions of standard <utility> header
+// abstractions available within C++17, and are designed to be drop-in
// replacement for code compliant with C++14 and C++17.
//
// The following abstractions are defined:
//
-// * integer_sequence<T, Ints...> == std::integer_sequence<T, Ints...>
-// * index_sequence<Ints...> == std::index_sequence<Ints...>
-// * make_integer_sequence<T, N> == std::make_integer_sequence<T, N>
-// * make_index_sequence<N> == std::make_index_sequence<N>
-// * index_sequence_for<Ts...> == std::index_sequence_for<Ts...>
// * apply<Functor, Tuple> == std::apply<Functor, Tuple>
// * exchange<T> == std::exchange<T>
// * make_from_tuple<T> == std::make_from_tuple<T>
@@ -33,7 +28,6 @@
//
// References:
//
-// https://en.cppreference.com/w/cpp/utility/integer_sequence
// https://en.cppreference.com/w/cpp/utility/apply
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3658.html
@@ -53,68 +47,18 @@
namespace y_absl {
Y_ABSL_NAMESPACE_BEGIN
-// integer_sequence
-//
-// Class template representing a compile-time integer sequence. An instantiation
-// of `integer_sequence<T, Ints...>` has a sequence of integers encoded in its
-// type through its template arguments (which is a common need when
-// working with C++11 variadic templates). `y_absl::integer_sequence` is designed
-// to be a drop-in replacement for C++14's `std::integer_sequence`.
-//
-// Example:
-//
-// template< class T, T... Ints >
-// void user_function(integer_sequence<T, Ints...>);
-//
-// int main()
-// {
-// // user_function's `T` will be deduced to `int` and `Ints...`
-// // will be deduced to `0, 1, 2, 3, 4`.
-// user_function(make_integer_sequence<int, 5>());
-// }
-template <typename T, T... Ints>
-struct integer_sequence {
- using value_type = T;
- static constexpr size_t size() noexcept { return sizeof...(Ints); }
-};
-
-// index_sequence
-//
-// A helper template for an `integer_sequence` of `size_t`,
-// `y_absl::index_sequence` is designed to be a drop-in replacement for C++14's
-// `std::index_sequence`.
-template <size_t... Ints>
-using index_sequence = integer_sequence<size_t, Ints...>;
+// Historical note: Abseil once provided implementations of these
+// abstractions for platforms that had not yet provided them. Those
+// platforms are no longer supported. New code should simply use the
+// the ones from std directly.
+using std::index_sequence;
+using std::index_sequence_for;
+using std::integer_sequence;
+using std::make_index_sequence;
+using std::make_integer_sequence;
namespace utility_internal {
-template <typename Seq, size_t SeqSize, size_t Rem>
-struct Extend;
-
-// Note that SeqSize == sizeof...(Ints). It's passed explicitly for efficiency.
-template <typename T, T... Ints, size_t SeqSize>
-struct Extend<integer_sequence<T, Ints...>, SeqSize, 0> {
- using type = integer_sequence<T, Ints..., (Ints + SeqSize)...>;
-};
-
-template <typename T, T... Ints, size_t SeqSize>
-struct Extend<integer_sequence<T, Ints...>, SeqSize, 1> {
- using type = integer_sequence<T, Ints..., (Ints + SeqSize)..., 2 * SeqSize>;
-};
-
-// Recursion helper for 'make_integer_sequence<T, N>'.
-// 'Gen<T, N>::type' is an alias for 'integer_sequence<T, 0, 1, ... N-1>'.
-template <typename T, size_t N>
-struct Gen {
- using type =
- typename Extend<typename Gen<T, N / 2>::type, N / 2, N % 2>::type;
-};
-
-template <typename T>
-struct Gen<T, 0> {
- using type = integer_sequence<T>;
-};
-
template <typename T>
struct InPlaceTypeTag {
explicit InPlaceTypeTag() = delete;
@@ -131,32 +75,6 @@ struct InPlaceIndexTag {
} // namespace utility_internal
-// Compile-time sequences of integers
-
-// make_integer_sequence
-//
-// This template alias is equivalent to
-// `integer_sequence<int, 0, 1, ..., N-1>`, and is designed to be a drop-in
-// replacement for C++14's `std::make_integer_sequence`.
-template <typename T, T N>
-using make_integer_sequence = typename utility_internal::Gen<T, N>::type;
-
-// make_index_sequence
-//
-// This template alias is equivalent to `index_sequence<0, 1, ..., N-1>`,
-// and is designed to be a drop-in replacement for C++14's
-// `std::make_index_sequence`.
-template <size_t N>
-using make_index_sequence = make_integer_sequence<size_t, N>;
-
-// index_sequence_for
-//
-// Converts a typename pack into an index sequence of the same length, and
-// is designed to be a drop-in replacement for C++14's
-// `std::index_sequence_for()`
-template <typename... Ts>
-using index_sequence_for = make_index_sequence<sizeof...(Ts)>;
-
// Tag types
#ifdef Y_ABSL_USES_STD_OPTIONAL
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/utility/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/utility/ya.make
index 3b66e3e4004..939d0737310 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/utility/ya.make
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/utility/ya.make
@@ -6,9 +6,9 @@ LICENSE(Apache-2.0)
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(20230802.1)
+VERSION(20240116.1)
-ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20230802.1.tar.gz)
+ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz)
NO_RUNTIME()
diff --git a/contrib/restricted/aws/s2n/pq-crypto/kyber_r3/KeccakP-brg_endian_avx2.h b/contrib/restricted/aws/s2n/pq-crypto/kyber_r3/KeccakP-brg_endian_avx2.h
index 8e8b73cf2a2..7218ce9f8eb 100644
--- a/contrib/restricted/aws/s2n/pq-crypto/kyber_r3/KeccakP-brg_endian_avx2.h
+++ b/contrib/restricted/aws/s2n/pq-crypto/kyber_r3/KeccakP-brg_endian_avx2.h
@@ -34,7 +34,7 @@
#if 0
/* Include files where endian defines and byteswap functions may reside */
#if defined( __sun )
-# include <sys/isa_defs.h>
+# error #include <sys/isa_defs.h>
#elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ )
# include <sys/endian.h>
#elif defined( BSD ) && ( BSD >= 199103 ) || defined( __APPLE__ ) || \
diff --git a/contrib/restricted/fast_float/include/fast_float/float_common.h b/contrib/restricted/fast_float/include/fast_float/float_common.h
index 90b6ee888b5..102ef957622 100644
--- a/contrib/restricted/fast_float/include/fast_float/float_common.h
+++ b/contrib/restricted/fast_float/include/fast_float/float_common.h
@@ -100,7 +100,7 @@ using parse_options = parse_options_t<char>;
#if defined(__APPLE__) || defined(__FreeBSD__)
#include <machine/endian.h>
#elif defined(sun) || defined(__sun)
-#include <sys/byteorder.h>
+#error #include <sys/byteorder.h>
#elif defined(__MVS__)
#include <sys/endian.h>
#else
diff --git a/contrib/restricted/libffi/src/dlmalloc.c b/contrib/restricted/libffi/src/dlmalloc.c
index ec85fcec2a4..84f502a68f4 100644
--- a/contrib/restricted/libffi/src/dlmalloc.c
+++ b/contrib/restricted/libffi/src/dlmalloc.c
@@ -466,7 +466,7 @@ DEFAULT_MMAP_THRESHOLD default: 256K
#ifdef __OS2__
#define INCL_DOS
-#include <os2.h>
+#error #include <os2.h>
#define HAVE_MMAP 1
#define HAVE_MORECORE 0
#define LACKS_SYS_MMAN_H
diff --git a/contrib/restricted/libffi/src/x86/ffi64.c b/contrib/restricted/libffi/src/x86/ffi64.c
index dec331c958c..14e6f984410 100644
--- a/contrib/restricted/libffi/src/x86/ffi64.c
+++ b/contrib/restricted/libffi/src/x86/ffi64.c
@@ -45,7 +45,7 @@
#define UINT128 __m128
#else
#if defined(__SUNPRO_C)
-#include <sunmedia_types.h>
+#error #include <sunmedia_types.h>
#define UINT128 __m128i
#else
#define UINT128 __int128_t
diff --git a/contrib/restricted/llhttp/include/llhttp.h b/contrib/restricted/llhttp/include/llhttp.h
index 46a7213c123..691969367ae 100644
--- a/contrib/restricted/llhttp/include/llhttp.h
+++ b/contrib/restricted/llhttp/include/llhttp.h
@@ -3,8 +3,8 @@
#define INCLUDE_LLHTTP_H_
#define LLHTTP_VERSION_MAJOR 9
-#define LLHTTP_VERSION_MINOR 1
-#define LLHTTP_VERSION_PATCH 3
+#define LLHTTP_VERSION_MINOR 2
+#define LLHTTP_VERSION_PATCH 0
#ifndef INCLUDE_LLHTTP_ITSELF_H_
#define INCLUDE_LLHTTP_ITSELF_H_
@@ -181,7 +181,8 @@ enum llhttp_method {
HTTP_SET_PARAMETER = 42,
HTTP_REDIRECT = 43,
HTTP_RECORD = 44,
- HTTP_FLUSH = 45
+ HTTP_FLUSH = 45,
+ HTTP_QUERY = 46
};
typedef enum llhttp_method llhttp_method_t;
@@ -362,6 +363,7 @@ typedef enum llhttp_status llhttp_status_t;
XX(31, LINK, LINK) \
XX(32, UNLINK, UNLINK) \
XX(33, SOURCE, SOURCE) \
+ XX(46, QUERY, QUERY) \
#define RTSP_METHOD_MAP(XX) \
@@ -428,6 +430,7 @@ typedef enum llhttp_status llhttp_status_t;
XX(43, REDIRECT, REDIRECT) \
XX(44, RECORD, RECORD) \
XX(45, FLUSH, FLUSH) \
+ XX(46, QUERY, QUERY) \
#define HTTP_STATUS_MAP(XX) \
@@ -547,6 +550,8 @@ extern "C" {
#if defined(__wasm__)
#define LLHTTP_EXPORT __attribute__((visibility("default")))
+#elif defined(_WIN32)
+#define LLHTTP_EXPORT __declspec(dllexport)
#else
#define LLHTTP_EXPORT
#endif
diff --git a/contrib/restricted/llhttp/src/llhttp.c b/contrib/restricted/llhttp/src/llhttp.c
index af84c42425e..c08de6494f7 100644
--- a/contrib/restricted/llhttp/src/llhttp.c
+++ b/contrib/restricted/llhttp/src/llhttp.c
@@ -162,54 +162,57 @@ static const unsigned char llparse_blob42[] = {
'G', 'E'
};
static const unsigned char llparse_blob43[] = {
- 'I', 'N', 'D'
+ 'U', 'E', 'R', 'Y'
};
static const unsigned char llparse_blob44[] = {
- 'O', 'R', 'D'
+ 'I', 'N', 'D'
};
static const unsigned char llparse_blob45[] = {
- 'I', 'R', 'E', 'C', 'T'
+ 'O', 'R', 'D'
};
static const unsigned char llparse_blob46[] = {
- 'O', 'R', 'T'
+ 'I', 'R', 'E', 'C', 'T'
};
static const unsigned char llparse_blob47[] = {
- 'R', 'C', 'H'
+ 'O', 'R', 'T'
};
static const unsigned char llparse_blob48[] = {
- 'P', 'A', 'R', 'A', 'M', 'E', 'T', 'E', 'R'
+ 'R', 'C', 'H'
};
static const unsigned char llparse_blob49[] = {
- 'U', 'R', 'C', 'E'
+ 'P', 'A', 'R', 'A', 'M', 'E', 'T', 'E', 'R'
};
static const unsigned char llparse_blob50[] = {
- 'B', 'S', 'C', 'R', 'I', 'B', 'E'
+ 'U', 'R', 'C', 'E'
};
static const unsigned char llparse_blob51[] = {
- 'A', 'R', 'D', 'O', 'W', 'N'
+ 'B', 'S', 'C', 'R', 'I', 'B', 'E'
};
static const unsigned char llparse_blob52[] = {
- 'A', 'C', 'E'
+ 'A', 'R', 'D', 'O', 'W', 'N'
};
static const unsigned char llparse_blob53[] = {
- 'I', 'N', 'D'
+ 'A', 'C', 'E'
};
static const unsigned char llparse_blob54[] = {
- 'N', 'K'
+ 'I', 'N', 'D'
};
static const unsigned char llparse_blob55[] = {
- 'C', 'K'
+ 'N', 'K'
};
static const unsigned char llparse_blob56[] = {
- 'U', 'B', 'S', 'C', 'R', 'I', 'B', 'E'
+ 'C', 'K'
};
static const unsigned char llparse_blob57[] = {
- 'H', 'T', 'T', 'P', '/'
+ 'U', 'B', 'S', 'C', 'R', 'I', 'B', 'E'
};
static const unsigned char llparse_blob58[] = {
- 'A', 'D'
+ 'H', 'T', 'T', 'P', '/'
};
static const unsigned char llparse_blob59[] = {
+ 'A', 'D'
+};
+static const unsigned char llparse_blob60[] = {
'T', 'P', '/'
};
@@ -376,7 +379,7 @@ enum llparse_state_e {
s_n_llhttp__internal__n_header_value_almost_done,
s_n_llhttp__internal__n_invoke_test_lenient_flags_17,
s_n_llhttp__internal__n_header_value_lenient,
- s_n_llhttp__internal__n_error_52,
+ s_n_llhttp__internal__n_error_53,
s_n_llhttp__internal__n_header_value_otherwise,
s_n_llhttp__internal__n_header_value_connection_token,
s_n_llhttp__internal__n_header_value_connection_ws,
@@ -384,12 +387,12 @@ enum llparse_state_e {
s_n_llhttp__internal__n_header_value_connection_2,
s_n_llhttp__internal__n_header_value_connection_3,
s_n_llhttp__internal__n_header_value_connection,
- s_n_llhttp__internal__n_error_54,
s_n_llhttp__internal__n_error_55,
+ s_n_llhttp__internal__n_error_56,
s_n_llhttp__internal__n_header_value_content_length_ws,
s_n_llhttp__internal__n_header_value_content_length,
+ s_n_llhttp__internal__n_error_58,
s_n_llhttp__internal__n_error_57,
- s_n_llhttp__internal__n_error_56,
s_n_llhttp__internal__n_header_value_te_token_ows,
s_n_llhttp__internal__n_header_value,
s_n_llhttp__internal__n_header_value_te_token,
@@ -422,12 +425,12 @@ enum llparse_state_e {
s_n_llhttp__internal__n_req_http_complete,
s_n_llhttp__internal__n_invoke_load_method_1,
s_n_llhttp__internal__n_invoke_llhttp__on_version_complete,
- s_n_llhttp__internal__n_error_64,
- s_n_llhttp__internal__n_error_71,
- s_n_llhttp__internal__n_req_http_minor,
+ s_n_llhttp__internal__n_error_65,
s_n_llhttp__internal__n_error_72,
- s_n_llhttp__internal__n_req_http_dot,
+ s_n_llhttp__internal__n_req_http_minor,
s_n_llhttp__internal__n_error_73,
+ s_n_llhttp__internal__n_req_http_dot,
+ s_n_llhttp__internal__n_error_74,
s_n_llhttp__internal__n_req_http_major,
s_n_llhttp__internal__n_span_start_llhttp__on_version,
s_n_llhttp__internal__n_req_http_start_1,
@@ -503,30 +506,31 @@ enum llparse_state_e {
s_n_llhttp__internal__n_after_start_req_45,
s_n_llhttp__internal__n_after_start_req_44,
s_n_llhttp__internal__n_after_start_req_33,
- s_n_llhttp__internal__n_after_start_req_48,
+ s_n_llhttp__internal__n_after_start_req_46,
s_n_llhttp__internal__n_after_start_req_49,
s_n_llhttp__internal__n_after_start_req_50,
s_n_llhttp__internal__n_after_start_req_51,
+ s_n_llhttp__internal__n_after_start_req_52,
+ s_n_llhttp__internal__n_after_start_req_48,
s_n_llhttp__internal__n_after_start_req_47,
- s_n_llhttp__internal__n_after_start_req_46,
- s_n_llhttp__internal__n_after_start_req_54,
- s_n_llhttp__internal__n_after_start_req_56,
- s_n_llhttp__internal__n_after_start_req_57,
s_n_llhttp__internal__n_after_start_req_55,
- s_n_llhttp__internal__n_after_start_req_53,
+ s_n_llhttp__internal__n_after_start_req_57,
s_n_llhttp__internal__n_after_start_req_58,
+ s_n_llhttp__internal__n_after_start_req_56,
+ s_n_llhttp__internal__n_after_start_req_54,
s_n_llhttp__internal__n_after_start_req_59,
- s_n_llhttp__internal__n_after_start_req_52,
- s_n_llhttp__internal__n_after_start_req_61,
- s_n_llhttp__internal__n_after_start_req_62,
s_n_llhttp__internal__n_after_start_req_60,
- s_n_llhttp__internal__n_after_start_req_65,
- s_n_llhttp__internal__n_after_start_req_67,
- s_n_llhttp__internal__n_after_start_req_68,
+ s_n_llhttp__internal__n_after_start_req_53,
+ s_n_llhttp__internal__n_after_start_req_62,
+ s_n_llhttp__internal__n_after_start_req_63,
+ s_n_llhttp__internal__n_after_start_req_61,
s_n_llhttp__internal__n_after_start_req_66,
+ s_n_llhttp__internal__n_after_start_req_68,
s_n_llhttp__internal__n_after_start_req_69,
+ s_n_llhttp__internal__n_after_start_req_67,
+ s_n_llhttp__internal__n_after_start_req_70,
+ s_n_llhttp__internal__n_after_start_req_65,
s_n_llhttp__internal__n_after_start_req_64,
- s_n_llhttp__internal__n_after_start_req_63,
s_n_llhttp__internal__n_after_start_req,
s_n_llhttp__internal__n_span_start_llhttp__on_method_1,
s_n_llhttp__internal__n_res_line_almost_done,
@@ -539,12 +543,12 @@ enum llparse_state_e {
s_n_llhttp__internal__n_res_status_code_digit_1,
s_n_llhttp__internal__n_res_after_version,
s_n_llhttp__internal__n_invoke_llhttp__on_version_complete_1,
- s_n_llhttp__internal__n_error_87,
- s_n_llhttp__internal__n_error_101,
- s_n_llhttp__internal__n_res_http_minor,
+ s_n_llhttp__internal__n_error_88,
s_n_llhttp__internal__n_error_102,
- s_n_llhttp__internal__n_res_http_dot,
+ s_n_llhttp__internal__n_res_http_minor,
s_n_llhttp__internal__n_error_103,
+ s_n_llhttp__internal__n_res_http_dot,
+ s_n_llhttp__internal__n_error_104,
s_n_llhttp__internal__n_res_http_major,
s_n_llhttp__internal__n_span_start_llhttp__on_version_1,
s_n_llhttp__internal__n_start_res,
@@ -2133,7 +2137,7 @@ static llparse_state_t llhttp__internal__run(
case 21:
goto s_n_llhttp__internal__n_pause_18;
default:
- goto s_n_llhttp__internal__n_error_47;
+ goto s_n_llhttp__internal__n_error_48;
}
/* UNREACHABLE */;
abort();
@@ -2217,7 +2221,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_header_value_lws;
}
default: {
- goto s_n_llhttp__internal__n_error_51;
+ goto s_n_llhttp__internal__n_error_52;
}
}
/* UNREACHABLE */;
@@ -2229,7 +2233,7 @@ static llparse_state_t llhttp__internal__run(
case 1:
goto s_n_llhttp__internal__n_header_value_almost_done;
default:
- goto s_n_llhttp__internal__n_error_50;
+ goto s_n_llhttp__internal__n_error_51;
}
/* UNREACHABLE */;
abort();
@@ -2254,8 +2258,8 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_error_52:
- s_n_llhttp__internal__n_error_52: {
+ case s_n_llhttp__internal__n_error_53:
+ s_n_llhttp__internal__n_error_53: {
state->error = 0xa;
state->reason = "Invalid header value char";
state->error_pos = (const char*) p;
@@ -2454,8 +2458,8 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_error_54:
- s_n_llhttp__internal__n_error_54: {
+ case s_n_llhttp__internal__n_error_55:
+ s_n_llhttp__internal__n_error_55: {
state->error = 0xb;
state->reason = "Content-Length overflow";
state->error_pos = (const char*) p;
@@ -2464,8 +2468,8 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_error_55:
- s_n_llhttp__internal__n_error_55: {
+ case s_n_llhttp__internal__n_error_56:
+ s_n_llhttp__internal__n_error_56: {
state->error = 0xb;
state->reason = "Invalid character in Content-Length";
state->error_pos = (const char*) p;
@@ -2560,8 +2564,8 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_error_57:
- s_n_llhttp__internal__n_error_57: {
+ case s_n_llhttp__internal__n_error_58:
+ s_n_llhttp__internal__n_error_58: {
state->error = 0xf;
state->reason = "Invalid `Transfer-Encoding` header value";
state->error_pos = (const char*) p;
@@ -2570,8 +2574,8 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_error_56:
- s_n_llhttp__internal__n_error_56: {
+ case s_n_llhttp__internal__n_error_57:
+ s_n_llhttp__internal__n_error_57: {
state->error = 0xf;
state->reason = "Invalid `Transfer-Encoding` header value";
state->error_pos = (const char*) p;
@@ -2810,7 +2814,7 @@ static llparse_state_t llhttp__internal__run(
case 21:
goto s_n_llhttp__internal__n_pause_19;
default:
- goto s_n_llhttp__internal__n_error_44;
+ goto s_n_llhttp__internal__n_error_45;
}
/* UNREACHABLE */;
abort();
@@ -2825,7 +2829,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_span_end_llhttp__on_header_field_2;
}
default: {
- goto s_n_llhttp__internal__n_error_60;
+ goto s_n_llhttp__internal__n_error_61;
}
}
/* UNREACHABLE */;
@@ -3145,6 +3149,9 @@ static llparse_state_t llhttp__internal__run(
p++;
goto s_n_llhttp__internal__n_headers_almost_done;
}
+ case ':': {
+ goto s_n_llhttp__internal__n_error_44;
+ }
default: {
goto s_n_llhttp__internal__n_span_start_llhttp__on_header_field;
}
@@ -3223,7 +3230,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_url_to_http_09;
}
default: {
- goto s_n_llhttp__internal__n_error_61;
+ goto s_n_llhttp__internal__n_error_62;
}
}
/* UNREACHABLE */;
@@ -3248,7 +3255,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_url_skip_lf_to_http09_1;
}
default: {
- goto s_n_llhttp__internal__n_error_61;
+ goto s_n_llhttp__internal__n_error_62;
}
}
/* UNREACHABLE */;
@@ -3266,13 +3273,13 @@ static llparse_state_t llhttp__internal__run(
switch (match_seq.status) {
case kMatchComplete: {
p++;
- goto s_n_llhttp__internal__n_error_69;
+ goto s_n_llhttp__internal__n_error_70;
}
case kMatchPause: {
return s_n_llhttp__internal__n_req_pri_upgrade;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_70;
+ goto s_n_llhttp__internal__n_error_71;
}
}
/* UNREACHABLE */;
@@ -3310,7 +3317,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_req_http_complete_crlf;
}
default: {
- goto s_n_llhttp__internal__n_error_68;
+ goto s_n_llhttp__internal__n_error_69;
}
}
/* UNREACHABLE */;
@@ -3335,13 +3342,13 @@ static llparse_state_t llhttp__internal__run(
case 21:
goto s_n_llhttp__internal__n_pause_21;
default:
- goto s_n_llhttp__internal__n_error_65;
+ goto s_n_llhttp__internal__n_error_66;
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_error_64:
- s_n_llhttp__internal__n_error_64: {
+ case s_n_llhttp__internal__n_error_65:
+ s_n_llhttp__internal__n_error_65: {
state->error = 0x9;
state->reason = "Invalid HTTP version";
state->error_pos = (const char*) p;
@@ -3350,8 +3357,8 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_error_71:
- s_n_llhttp__internal__n_error_71: {
+ case s_n_llhttp__internal__n_error_72:
+ s_n_llhttp__internal__n_error_72: {
state->error = 0x9;
state->reason = "Invalid minor version";
state->error_pos = (const char*) p;
@@ -3423,8 +3430,8 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_error_72:
- s_n_llhttp__internal__n_error_72: {
+ case s_n_llhttp__internal__n_error_73:
+ s_n_llhttp__internal__n_error_73: {
state->error = 0x9;
state->reason = "Expected dot";
state->error_pos = (const char*) p;
@@ -3450,8 +3457,8 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_error_73:
- s_n_llhttp__internal__n_error_73: {
+ case s_n_llhttp__internal__n_error_74:
+ s_n_llhttp__internal__n_error_74: {
state->error = 0x9;
state->reason = "Invalid major version";
state->error_pos = (const char*) p;
@@ -3552,7 +3559,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_req_http_start_1;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_76;
+ goto s_n_llhttp__internal__n_error_77;
}
}
/* UNREACHABLE */;
@@ -3576,7 +3583,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_req_http_start_2;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_76;
+ goto s_n_llhttp__internal__n_error_77;
}
}
/* UNREACHABLE */;
@@ -3600,7 +3607,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_req_http_start_3;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_76;
+ goto s_n_llhttp__internal__n_error_77;
}
}
/* UNREACHABLE */;
@@ -3629,7 +3636,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_req_http_start_3;
}
default: {
- goto s_n_llhttp__internal__n_error_76;
+ goto s_n_llhttp__internal__n_error_77;
}
}
/* UNREACHABLE */;
@@ -3720,7 +3727,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_url_fragment;
}
default: {
- goto s_n_llhttp__internal__n_error_77;
+ goto s_n_llhttp__internal__n_error_78;
}
}
/* UNREACHABLE */;
@@ -3781,7 +3788,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_span_end_stub_query_3;
}
default: {
- goto s_n_llhttp__internal__n_error_78;
+ goto s_n_llhttp__internal__n_error_79;
}
}
/* UNREACHABLE */;
@@ -3819,7 +3826,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_url_query;
}
default: {
- goto s_n_llhttp__internal__n_error_79;
+ goto s_n_llhttp__internal__n_error_80;
}
}
/* UNREACHABLE */;
@@ -3944,10 +3951,10 @@ static llparse_state_t llhttp__internal__run(
}
case 8: {
p++;
- goto s_n_llhttp__internal__n_error_80;
+ goto s_n_llhttp__internal__n_error_81;
}
default: {
- goto s_n_llhttp__internal__n_error_81;
+ goto s_n_llhttp__internal__n_error_82;
}
}
/* UNREACHABLE */;
@@ -4006,7 +4013,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_url_server_with_at;
}
default: {
- goto s_n_llhttp__internal__n_error_82;
+ goto s_n_llhttp__internal__n_error_83;
}
}
/* UNREACHABLE */;
@@ -4023,7 +4030,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_url_server;
}
default: {
- goto s_n_llhttp__internal__n_error_83;
+ goto s_n_llhttp__internal__n_error_84;
}
}
/* UNREACHABLE */;
@@ -4060,7 +4067,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_url_schema_delim_1;
}
default: {
- goto s_n_llhttp__internal__n_error_83;
+ goto s_n_llhttp__internal__n_error_84;
}
}
/* UNREACHABLE */;
@@ -4112,7 +4119,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_url_schema;
}
default: {
- goto s_n_llhttp__internal__n_error_84;
+ goto s_n_llhttp__internal__n_error_85;
}
}
/* UNREACHABLE */;
@@ -4153,7 +4160,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_url_schema;
}
default: {
- goto s_n_llhttp__internal__n_error_85;
+ goto s_n_llhttp__internal__n_error_86;
}
}
/* UNREACHABLE */;
@@ -4251,7 +4258,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_req_spaces_before_url;
}
default: {
- goto s_n_llhttp__internal__n_error_86;
+ goto s_n_llhttp__internal__n_error_87;
}
}
/* UNREACHABLE */;
@@ -4265,7 +4272,7 @@ static llparse_state_t llhttp__internal__run(
case 21:
goto s_n_llhttp__internal__n_pause_26;
default:
- goto s_n_llhttp__internal__n_error_105;
+ goto s_n_llhttp__internal__n_error_106;
}
/* UNREACHABLE */;
abort();
@@ -4282,7 +4289,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4307,7 +4314,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_3;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4328,7 +4335,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_3;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4353,7 +4360,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_4;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4378,7 +4385,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_6;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4403,7 +4410,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_8;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4421,7 +4428,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4442,7 +4449,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_9;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4463,7 +4470,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_7;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4488,7 +4495,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_12;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4513,7 +4520,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_13;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4534,7 +4541,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_13;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4551,7 +4558,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_11;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4576,7 +4583,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_14;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4601,7 +4608,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_17;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4643,7 +4650,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_15;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4668,7 +4675,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_18;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4693,7 +4700,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_20;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4718,7 +4725,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_21;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4739,7 +4746,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_21;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4764,7 +4771,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_23;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4789,7 +4796,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_24;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4814,7 +4821,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_26;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4839,7 +4846,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_28;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4857,7 +4864,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4878,7 +4885,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_29;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4899,7 +4906,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_27;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4924,7 +4931,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_30;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4953,7 +4960,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_30;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -4978,7 +4985,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_31;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5003,7 +5010,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_32;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5028,7 +5035,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_35;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5053,7 +5060,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_36;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5074,7 +5081,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_36;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5099,7 +5106,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_37;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5124,7 +5131,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_38;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5149,7 +5156,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_42;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5174,7 +5181,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_43;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5195,7 +5202,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_43;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5212,7 +5219,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_41;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5234,7 +5241,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_40;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5259,7 +5266,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_after_start_req_45;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5281,7 +5288,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5314,32 +5321,32 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_after_start_req_44;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_48:
- s_n_llhttp__internal__n_after_start_req_48: {
+ case s_n_llhttp__internal__n_after_start_req_46:
+ s_n_llhttp__internal__n_after_start_req_46: {
llparse_match_t match_seq;
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_48;
+ return s_n_llhttp__internal__n_after_start_req_46;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob43, 3);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob43, 4);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
p++;
- match = 17;
+ match = 46;
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
- return s_n_llhttp__internal__n_after_start_req_48;
+ return s_n_llhttp__internal__n_after_start_req_46;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5357,14 +5364,14 @@ static llparse_state_t llhttp__internal__run(
switch (match_seq.status) {
case kMatchComplete: {
p++;
- match = 44;
+ match = 17;
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
return s_n_llhttp__internal__n_after_start_req_49;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5377,19 +5384,19 @@ static llparse_state_t llhttp__internal__run(
if (p == endp) {
return s_n_llhttp__internal__n_after_start_req_50;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob45, 5);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob45, 3);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
p++;
- match = 43;
+ match = 44;
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
return s_n_llhttp__internal__n_after_start_req_50;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5402,78 +5409,103 @@ static llparse_state_t llhttp__internal__run(
if (p == endp) {
return s_n_llhttp__internal__n_after_start_req_51;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob46, 3);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob46, 5);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
p++;
- match = 20;
+ match = 43;
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
return s_n_llhttp__internal__n_after_start_req_51;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_47:
- s_n_llhttp__internal__n_after_start_req_47: {
+ case s_n_llhttp__internal__n_after_start_req_52:
+ s_n_llhttp__internal__n_after_start_req_52: {
+ llparse_match_t match_seq;
+
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_47;
+ return s_n_llhttp__internal__n_after_start_req_52;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob47, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 20;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_52;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_107;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_48:
+ s_n_llhttp__internal__n_after_start_req_48: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_48;
}
switch (*p) {
case 'B': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_48;
+ goto s_n_llhttp__internal__n_after_start_req_49;
}
case 'C': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_49;
+ goto s_n_llhttp__internal__n_after_start_req_50;
}
case 'D': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_50;
+ goto s_n_llhttp__internal__n_after_start_req_51;
}
case 'P': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_51;
+ goto s_n_llhttp__internal__n_after_start_req_52;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_46:
- s_n_llhttp__internal__n_after_start_req_46: {
+ case s_n_llhttp__internal__n_after_start_req_47:
+ s_n_llhttp__internal__n_after_start_req_47: {
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_46;
+ return s_n_llhttp__internal__n_after_start_req_47;
}
switch (*p) {
case 'E': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_47;
+ goto s_n_llhttp__internal__n_after_start_req_48;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_54:
- s_n_llhttp__internal__n_after_start_req_54: {
+ case s_n_llhttp__internal__n_after_start_req_55:
+ s_n_llhttp__internal__n_after_start_req_55: {
llparse_match_t match_seq;
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_54;
+ return s_n_llhttp__internal__n_after_start_req_55;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob47, 3);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob48, 3);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
@@ -5482,19 +5514,19 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
- return s_n_llhttp__internal__n_after_start_req_54;
+ return s_n_llhttp__internal__n_after_start_req_55;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_56:
- s_n_llhttp__internal__n_after_start_req_56: {
+ case s_n_llhttp__internal__n_after_start_req_57:
+ s_n_llhttp__internal__n_after_start_req_57: {
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_56;
+ return s_n_llhttp__internal__n_after_start_req_57;
}
switch (*p) {
case 'P': {
@@ -5503,20 +5535,20 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_57:
- s_n_llhttp__internal__n_after_start_req_57: {
+ case s_n_llhttp__internal__n_after_start_req_58:
+ s_n_llhttp__internal__n_after_start_req_58: {
llparse_match_t match_seq;
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_57;
+ return s_n_llhttp__internal__n_after_start_req_58;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob48, 9);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob49, 9);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
@@ -5525,65 +5557,65 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
- return s_n_llhttp__internal__n_after_start_req_57;
+ return s_n_llhttp__internal__n_after_start_req_58;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_55:
- s_n_llhttp__internal__n_after_start_req_55: {
+ case s_n_llhttp__internal__n_after_start_req_56:
+ s_n_llhttp__internal__n_after_start_req_56: {
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_55;
+ return s_n_llhttp__internal__n_after_start_req_56;
}
switch (*p) {
case 'U': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_56;
+ goto s_n_llhttp__internal__n_after_start_req_57;
}
case '_': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_57;
+ goto s_n_llhttp__internal__n_after_start_req_58;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_53:
- s_n_llhttp__internal__n_after_start_req_53: {
+ case s_n_llhttp__internal__n_after_start_req_54:
+ s_n_llhttp__internal__n_after_start_req_54: {
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_53;
+ return s_n_llhttp__internal__n_after_start_req_54;
}
switch (*p) {
case 'A': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_54;
+ goto s_n_llhttp__internal__n_after_start_req_55;
}
case 'T': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_55;
+ goto s_n_llhttp__internal__n_after_start_req_56;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_58:
- s_n_llhttp__internal__n_after_start_req_58: {
+ case s_n_llhttp__internal__n_after_start_req_59:
+ s_n_llhttp__internal__n_after_start_req_59: {
llparse_match_t match_seq;
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_58;
+ return s_n_llhttp__internal__n_after_start_req_59;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob49, 4);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob50, 4);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
@@ -5592,23 +5624,23 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
- return s_n_llhttp__internal__n_after_start_req_58;
+ return s_n_llhttp__internal__n_after_start_req_59;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_59:
- s_n_llhttp__internal__n_after_start_req_59: {
+ case s_n_llhttp__internal__n_after_start_req_60:
+ s_n_llhttp__internal__n_after_start_req_60: {
llparse_match_t match_seq;
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_59;
+ return s_n_llhttp__internal__n_after_start_req_60;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob50, 7);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob51, 7);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
@@ -5617,48 +5649,48 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
- return s_n_llhttp__internal__n_after_start_req_59;
+ return s_n_llhttp__internal__n_after_start_req_60;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_52:
- s_n_llhttp__internal__n_after_start_req_52: {
+ case s_n_llhttp__internal__n_after_start_req_53:
+ s_n_llhttp__internal__n_after_start_req_53: {
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_52;
+ return s_n_llhttp__internal__n_after_start_req_53;
}
switch (*p) {
case 'E': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_53;
+ goto s_n_llhttp__internal__n_after_start_req_54;
}
case 'O': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_58;
+ goto s_n_llhttp__internal__n_after_start_req_59;
}
case 'U': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_59;
+ goto s_n_llhttp__internal__n_after_start_req_60;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_61:
- s_n_llhttp__internal__n_after_start_req_61: {
+ case s_n_llhttp__internal__n_after_start_req_62:
+ s_n_llhttp__internal__n_after_start_req_62: {
llparse_match_t match_seq;
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_61;
+ return s_n_llhttp__internal__n_after_start_req_62;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob51, 6);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob52, 6);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
@@ -5667,23 +5699,23 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
- return s_n_llhttp__internal__n_after_start_req_61;
+ return s_n_llhttp__internal__n_after_start_req_62;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_62:
- s_n_llhttp__internal__n_after_start_req_62: {
+ case s_n_llhttp__internal__n_after_start_req_63:
+ s_n_llhttp__internal__n_after_start_req_63: {
llparse_match_t match_seq;
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_62;
+ return s_n_llhttp__internal__n_after_start_req_63;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob52, 3);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob53, 3);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
@@ -5692,44 +5724,44 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
- return s_n_llhttp__internal__n_after_start_req_62;
+ return s_n_llhttp__internal__n_after_start_req_63;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_60:
- s_n_llhttp__internal__n_after_start_req_60: {
+ case s_n_llhttp__internal__n_after_start_req_61:
+ s_n_llhttp__internal__n_after_start_req_61: {
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_60;
+ return s_n_llhttp__internal__n_after_start_req_61;
}
switch (*p) {
case 'E': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_61;
+ goto s_n_llhttp__internal__n_after_start_req_62;
}
case 'R': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_62;
+ goto s_n_llhttp__internal__n_after_start_req_63;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_65:
- s_n_llhttp__internal__n_after_start_req_65: {
+ case s_n_llhttp__internal__n_after_start_req_66:
+ s_n_llhttp__internal__n_after_start_req_66: {
llparse_match_t match_seq;
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_65;
+ return s_n_llhttp__internal__n_after_start_req_66;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob53, 3);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob54, 3);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
@@ -5738,23 +5770,23 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
- return s_n_llhttp__internal__n_after_start_req_65;
+ return s_n_llhttp__internal__n_after_start_req_66;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_67:
- s_n_llhttp__internal__n_after_start_req_67: {
+ case s_n_llhttp__internal__n_after_start_req_68:
+ s_n_llhttp__internal__n_after_start_req_68: {
llparse_match_t match_seq;
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_67;
+ return s_n_llhttp__internal__n_after_start_req_68;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob54, 2);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob55, 2);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
@@ -5763,23 +5795,23 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
- return s_n_llhttp__internal__n_after_start_req_67;
+ return s_n_llhttp__internal__n_after_start_req_68;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_68:
- s_n_llhttp__internal__n_after_start_req_68: {
+ case s_n_llhttp__internal__n_after_start_req_69:
+ s_n_llhttp__internal__n_after_start_req_69: {
llparse_match_t match_seq;
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_68;
+ return s_n_llhttp__internal__n_after_start_req_69;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob55, 2);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob56, 2);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
@@ -5788,44 +5820,44 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
- return s_n_llhttp__internal__n_after_start_req_68;
+ return s_n_llhttp__internal__n_after_start_req_69;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_66:
- s_n_llhttp__internal__n_after_start_req_66: {
+ case s_n_llhttp__internal__n_after_start_req_67:
+ s_n_llhttp__internal__n_after_start_req_67: {
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_66;
+ return s_n_llhttp__internal__n_after_start_req_67;
}
switch (*p) {
case 'I': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_67;
+ goto s_n_llhttp__internal__n_after_start_req_68;
}
case 'O': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_68;
+ goto s_n_llhttp__internal__n_after_start_req_69;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_69:
- s_n_llhttp__internal__n_after_start_req_69: {
+ case s_n_llhttp__internal__n_after_start_req_70:
+ s_n_llhttp__internal__n_after_start_req_70: {
llparse_match_t match_seq;
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_69;
+ return s_n_llhttp__internal__n_after_start_req_70;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob56, 8);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob57, 8);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
@@ -5834,52 +5866,52 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_store_method_1;
}
case kMatchPause: {
- return s_n_llhttp__internal__n_after_start_req_69;
+ return s_n_llhttp__internal__n_after_start_req_70;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_64:
- s_n_llhttp__internal__n_after_start_req_64: {
+ case s_n_llhttp__internal__n_after_start_req_65:
+ s_n_llhttp__internal__n_after_start_req_65: {
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_64;
+ return s_n_llhttp__internal__n_after_start_req_65;
}
switch (*p) {
case 'B': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_65;
+ goto s_n_llhttp__internal__n_after_start_req_66;
}
case 'L': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_66;
+ goto s_n_llhttp__internal__n_after_start_req_67;
}
case 'S': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_69;
+ goto s_n_llhttp__internal__n_after_start_req_70;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_after_start_req_63:
- s_n_llhttp__internal__n_after_start_req_63: {
+ case s_n_llhttp__internal__n_after_start_req_64:
+ s_n_llhttp__internal__n_after_start_req_64: {
if (p == endp) {
- return s_n_llhttp__internal__n_after_start_req_63;
+ return s_n_llhttp__internal__n_after_start_req_64;
}
switch (*p) {
case 'N': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_64;
+ goto s_n_llhttp__internal__n_after_start_req_65;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -5939,24 +5971,28 @@ static llparse_state_t llhttp__internal__run(
p++;
goto s_n_llhttp__internal__n_after_start_req_33;
}
- case 'R': {
+ case 'Q': {
p++;
goto s_n_llhttp__internal__n_after_start_req_46;
}
+ case 'R': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_47;
+ }
case 'S': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_52;
+ goto s_n_llhttp__internal__n_after_start_req_53;
}
case 'T': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_60;
+ goto s_n_llhttp__internal__n_after_start_req_61;
}
case 'U': {
p++;
- goto s_n_llhttp__internal__n_after_start_req_63;
+ goto s_n_llhttp__internal__n_after_start_req_64;
}
default: {
- goto s_n_llhttp__internal__n_error_106;
+ goto s_n_llhttp__internal__n_error_107;
}
}
/* UNREACHABLE */;
@@ -6000,7 +6036,7 @@ static llparse_state_t llhttp__internal__run(
case 1:
goto s_n_llhttp__internal__n_invoke_llhttp__on_status_complete;
default:
- goto s_n_llhttp__internal__n_error_92;
+ goto s_n_llhttp__internal__n_error_93;
}
/* UNREACHABLE */;
abort();
@@ -6055,7 +6091,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_span_start_llhttp__on_status;
}
default: {
- goto s_n_llhttp__internal__n_error_93;
+ goto s_n_llhttp__internal__n_error_94;
}
}
/* UNREACHABLE */;
@@ -6118,7 +6154,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
}
default: {
- goto s_n_llhttp__internal__n_error_95;
+ goto s_n_llhttp__internal__n_error_96;
}
}
/* UNREACHABLE */;
@@ -6181,7 +6217,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
}
default: {
- goto s_n_llhttp__internal__n_error_97;
+ goto s_n_llhttp__internal__n_error_98;
}
}
/* UNREACHABLE */;
@@ -6244,7 +6280,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
}
default: {
- goto s_n_llhttp__internal__n_error_99;
+ goto s_n_llhttp__internal__n_error_100;
}
}
/* UNREACHABLE */;
@@ -6261,7 +6297,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_invoke_update_status_code;
}
default: {
- goto s_n_llhttp__internal__n_error_100;
+ goto s_n_llhttp__internal__n_error_101;
}
}
/* UNREACHABLE */;
@@ -6275,13 +6311,13 @@ static llparse_state_t llhttp__internal__run(
case 21:
goto s_n_llhttp__internal__n_pause_25;
default:
- goto s_n_llhttp__internal__n_error_88;
+ goto s_n_llhttp__internal__n_error_89;
}
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_error_87:
- s_n_llhttp__internal__n_error_87: {
+ case s_n_llhttp__internal__n_error_88:
+ s_n_llhttp__internal__n_error_88: {
state->error = 0x9;
state->reason = "Invalid HTTP version";
state->error_pos = (const char*) p;
@@ -6290,8 +6326,8 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_error_101:
- s_n_llhttp__internal__n_error_101: {
+ case s_n_llhttp__internal__n_error_102:
+ s_n_llhttp__internal__n_error_102: {
state->error = 0x9;
state->reason = "Invalid minor version";
state->error_pos = (const char*) p;
@@ -6363,8 +6399,8 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_error_102:
- s_n_llhttp__internal__n_error_102: {
+ case s_n_llhttp__internal__n_error_103:
+ s_n_llhttp__internal__n_error_103: {
state->error = 0x9;
state->reason = "Expected dot";
state->error_pos = (const char*) p;
@@ -6390,8 +6426,8 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- case s_n_llhttp__internal__n_error_103:
- s_n_llhttp__internal__n_error_103: {
+ case s_n_llhttp__internal__n_error_104:
+ s_n_llhttp__internal__n_error_104: {
state->error = 0x9;
state->reason = "Invalid major version";
state->error_pos = (const char*) p;
@@ -6481,7 +6517,7 @@ static llparse_state_t llhttp__internal__run(
if (p == endp) {
return s_n_llhttp__internal__n_start_res;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob57, 5);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob58, 5);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
@@ -6492,7 +6528,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_start_res;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_107;
+ goto s_n_llhttp__internal__n_error_108;
}
}
/* UNREACHABLE */;
@@ -6518,7 +6554,7 @@ static llparse_state_t llhttp__internal__run(
if (p == endp) {
return s_n_llhttp__internal__n_req_or_res_method_2;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob58, 2);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob59, 2);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
@@ -6530,7 +6566,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_req_or_res_method_2;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_104;
+ goto s_n_llhttp__internal__n_error_105;
}
}
/* UNREACHABLE */;
@@ -6552,7 +6588,7 @@ static llparse_state_t llhttp__internal__run(
if (p == endp) {
return s_n_llhttp__internal__n_req_or_res_method_3;
}
- match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob59, 3);
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob60, 3);
p = match_seq.current;
switch (match_seq.status) {
case kMatchComplete: {
@@ -6563,7 +6599,7 @@ static llparse_state_t llhttp__internal__run(
return s_n_llhttp__internal__n_req_or_res_method_3;
}
case kMatchMismatch: {
- goto s_n_llhttp__internal__n_error_104;
+ goto s_n_llhttp__internal__n_error_105;
}
}
/* UNREACHABLE */;
@@ -6584,7 +6620,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_req_or_res_method_3;
}
default: {
- goto s_n_llhttp__internal__n_error_104;
+ goto s_n_llhttp__internal__n_error_105;
}
}
/* UNREACHABLE */;
@@ -6601,7 +6637,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_req_or_res_method_1;
}
default: {
- goto s_n_llhttp__internal__n_error_104;
+ goto s_n_llhttp__internal__n_error_105;
}
}
/* UNREACHABLE */;
@@ -7754,6 +7790,15 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
+ s_n_llhttp__internal__n_error_44: {
+ state->error = 0xa;
+ state->reason = "Invalid header token";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
s_n_llhttp__internal__n_span_end_llhttp__on_header_field: {
const unsigned char* start;
int err;
@@ -7782,7 +7827,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_58: {
+ s_n_llhttp__internal__n_error_59: {
state->error = 0xb;
state->reason = "Content-Length can't be present with Transfer-Encoding";
state->error_pos = (const char*) p;
@@ -7791,7 +7836,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_46: {
+ s_n_llhttp__internal__n_error_47: {
state->error = 0xa;
state->reason = "Invalid header value char";
state->error_pos = (const char*) p;
@@ -7805,12 +7850,12 @@ static llparse_state_t llhttp__internal__run(
case 1:
goto s_n_llhttp__internal__n_header_value_discard_ws;
default:
- goto s_n_llhttp__internal__n_error_46;
+ goto s_n_llhttp__internal__n_error_47;
}
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_48: {
+ s_n_llhttp__internal__n_error_49: {
state->error = 0xb;
state->reason = "Empty Content-Length";
state->error_pos = (const char*) p;
@@ -7828,7 +7873,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_47: {
+ s_n_llhttp__internal__n_error_48: {
state->error = 0x1d;
state->reason = "`on_header_value_complete` callback error";
state->error_pos = (const char*) p;
@@ -7913,14 +7958,14 @@ static llparse_state_t llhttp__internal__run(
s_n_llhttp__internal__n_invoke_load_header_state_1: {
switch (llhttp__internal__c_load_header_state(state, p, endp)) {
case 2:
- goto s_n_llhttp__internal__n_error_48;
+ goto s_n_llhttp__internal__n_error_49;
default:
goto s_n_llhttp__internal__n_invoke_load_header_state_2;
}
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_45: {
+ s_n_llhttp__internal__n_error_46: {
state->error = 0xa;
state->reason = "Invalid header value char";
state->error_pos = (const char*) p;
@@ -7934,12 +7979,12 @@ static llparse_state_t llhttp__internal__run(
case 1:
goto s_n_llhttp__internal__n_header_value_discard_lws;
default:
- goto s_n_llhttp__internal__n_error_45;
+ goto s_n_llhttp__internal__n_error_46;
}
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_49: {
+ s_n_llhttp__internal__n_error_50: {
state->error = 0x2;
state->reason = "Expected LF after CR";
state->error_pos = (const char*) p;
@@ -7953,7 +7998,7 @@ static llparse_state_t llhttp__internal__run(
case 1:
goto s_n_llhttp__internal__n_header_value_discard_lws;
default:
- goto s_n_llhttp__internal__n_error_49;
+ goto s_n_llhttp__internal__n_error_50;
}
/* UNREACHABLE */;
abort();
@@ -8032,7 +8077,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_51: {
+ s_n_llhttp__internal__n_error_52: {
state->error = 0x3;
state->reason = "Missing expected LF after header value";
state->error_pos = (const char*) p;
@@ -8041,7 +8086,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_50: {
+ s_n_llhttp__internal__n_error_51: {
state->error = 0x19;
state->reason = "Missing expected CR after header value";
state->error_pos = (const char*) p;
@@ -8130,10 +8175,10 @@ static llparse_state_t llhttp__internal__run(
if (err != 0) {
state->error = err;
state->error_pos = (const char*) p;
- state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_52;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_53;
return s_error;
}
- goto s_n_llhttp__internal__n_error_52;
+ goto s_n_llhttp__internal__n_error_53;
/* UNREACHABLE */;
abort();
}
@@ -8245,10 +8290,10 @@ static llparse_state_t llhttp__internal__run(
if (err != 0) {
state->error = err;
state->error_pos = (const char*) p;
- state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_54;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_55;
return s_error;
}
- goto s_n_llhttp__internal__n_error_54;
+ goto s_n_llhttp__internal__n_error_55;
/* UNREACHABLE */;
abort();
}
@@ -8280,14 +8325,14 @@ static llparse_state_t llhttp__internal__run(
if (err != 0) {
state->error = err;
state->error_pos = (const char*) p;
- state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_55;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_56;
return s_error;
}
- goto s_n_llhttp__internal__n_error_55;
+ goto s_n_llhttp__internal__n_error_56;
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_53: {
+ s_n_llhttp__internal__n_error_54: {
state->error = 0x4;
state->reason = "Duplicate Content-Length";
state->error_pos = (const char*) p;
@@ -8301,7 +8346,7 @@ static llparse_state_t llhttp__internal__run(
case 0:
goto s_n_llhttp__internal__n_header_value_content_length;
default:
- goto s_n_llhttp__internal__n_error_53;
+ goto s_n_llhttp__internal__n_error_54;
}
/* UNREACHABLE */;
abort();
@@ -8316,11 +8361,11 @@ static llparse_state_t llhttp__internal__run(
if (err != 0) {
state->error = err;
state->error_pos = (const char*) (p + 1);
- state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_57;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_58;
return s_error;
}
p++;
- goto s_n_llhttp__internal__n_error_57;
+ goto s_n_llhttp__internal__n_error_58;
/* UNREACHABLE */;
abort();
}
@@ -8342,11 +8387,11 @@ static llparse_state_t llhttp__internal__run(
if (err != 0) {
state->error = err;
state->error_pos = (const char*) (p + 1);
- state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_56;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_57;
return s_error;
}
p++;
- goto s_n_llhttp__internal__n_error_56;
+ goto s_n_llhttp__internal__n_error_57;
/* UNREACHABLE */;
abort();
}
@@ -8459,7 +8504,7 @@ static llparse_state_t llhttp__internal__run(
s_n_llhttp__internal__n_invoke_test_lenient_flags_21: {
switch (llhttp__internal__c_test_lenient_flags_21(state, p, endp)) {
case 0:
- goto s_n_llhttp__internal__n_error_58;
+ goto s_n_llhttp__internal__n_error_59;
default:
goto s_n_llhttp__internal__n_header_value_discard_ws;
}
@@ -8476,7 +8521,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_59: {
+ s_n_llhttp__internal__n_error_60: {
state->error = 0xf;
state->reason = "Transfer-Encoding can't be present with Content-Length";
state->error_pos = (const char*) p;
@@ -8488,7 +8533,7 @@ static llparse_state_t llhttp__internal__run(
s_n_llhttp__internal__n_invoke_test_lenient_flags_22: {
switch (llhttp__internal__c_test_lenient_flags_21(state, p, endp)) {
case 0:
- goto s_n_llhttp__internal__n_error_59;
+ goto s_n_llhttp__internal__n_error_60;
default:
goto s_n_llhttp__internal__n_header_value_discard_ws;
}
@@ -8514,7 +8559,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_44: {
+ s_n_llhttp__internal__n_error_45: {
state->error = 0x1c;
state->reason = "`on_header_field_complete` callback error";
state->error_pos = (const char*) p;
@@ -8559,7 +8604,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_60: {
+ s_n_llhttp__internal__n_error_61: {
state->error = 0xa;
state->reason = "Invalid header token";
state->error_pos = (const char*) p;
@@ -8674,7 +8719,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_61: {
+ s_n_llhttp__internal__n_error_62: {
state->error = 0x7;
state->reason = "Expected CRLF";
state->error_pos = (const char*) p;
@@ -8700,7 +8745,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_69: {
+ s_n_llhttp__internal__n_error_70: {
state->error = 0x17;
state->reason = "Pause on PRI/Upgrade";
state->error_pos = (const char*) p;
@@ -8709,7 +8754,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_70: {
+ s_n_llhttp__internal__n_error_71: {
state->error = 0x9;
state->reason = "Expected HTTP/2 Connection Preface";
state->error_pos = (const char*) p;
@@ -8718,7 +8763,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_67: {
+ s_n_llhttp__internal__n_error_68: {
state->error = 0x2;
state->reason = "Expected CRLF after version";
state->error_pos = (const char*) p;
@@ -8732,12 +8777,12 @@ static llparse_state_t llhttp__internal__run(
case 1:
goto s_n_llhttp__internal__n_headers_start;
default:
- goto s_n_llhttp__internal__n_error_67;
+ goto s_n_llhttp__internal__n_error_68;
}
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_66: {
+ s_n_llhttp__internal__n_error_67: {
state->error = 0x9;
state->reason = "Expected CRLF after version";
state->error_pos = (const char*) p;
@@ -8751,12 +8796,12 @@ static llparse_state_t llhttp__internal__run(
case 1:
goto s_n_llhttp__internal__n_req_http_complete_crlf;
default:
- goto s_n_llhttp__internal__n_error_66;
+ goto s_n_llhttp__internal__n_error_67;
}
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_68: {
+ s_n_llhttp__internal__n_error_69: {
state->error = 0x9;
state->reason = "Expected CRLF after version";
state->error_pos = (const char*) p;
@@ -8774,7 +8819,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_65: {
+ s_n_llhttp__internal__n_error_66: {
state->error = 0x21;
state->reason = "`on_version_complete` callback error";
state->error_pos = (const char*) p;
@@ -8810,10 +8855,10 @@ static llparse_state_t llhttp__internal__run(
if (err != 0) {
state->error = err;
state->error_pos = (const char*) p;
- state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_64;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_65;
return s_error;
}
- goto s_n_llhttp__internal__n_error_64;
+ goto s_n_llhttp__internal__n_error_65;
/* UNREACHABLE */;
abort();
}
@@ -8891,10 +8936,10 @@ static llparse_state_t llhttp__internal__run(
if (err != 0) {
state->error = err;
state->error_pos = (const char*) p;
- state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_71;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_72;
return s_error;
}
- goto s_n_llhttp__internal__n_error_71;
+ goto s_n_llhttp__internal__n_error_72;
/* UNREACHABLE */;
abort();
}
@@ -8908,10 +8953,10 @@ static llparse_state_t llhttp__internal__run(
if (err != 0) {
state->error = err;
state->error_pos = (const char*) p;
- state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_72;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_73;
return s_error;
}
- goto s_n_llhttp__internal__n_error_72;
+ goto s_n_llhttp__internal__n_error_73;
/* UNREACHABLE */;
abort();
}
@@ -8933,14 +8978,14 @@ static llparse_state_t llhttp__internal__run(
if (err != 0) {
state->error = err;
state->error_pos = (const char*) p;
- state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_73;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_74;
return s_error;
}
- goto s_n_llhttp__internal__n_error_73;
+ goto s_n_llhttp__internal__n_error_74;
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_63: {
+ s_n_llhttp__internal__n_error_64: {
state->error = 0x8;
state->reason = "Invalid method for HTTP/x.x request";
state->error_pos = (const char*) p;
@@ -9021,13 +9066,15 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
case 34:
goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 46:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
default:
- goto s_n_llhttp__internal__n_error_63;
+ goto s_n_llhttp__internal__n_error_64;
}
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_76: {
+ s_n_llhttp__internal__n_error_77: {
state->error = 0x8;
state->reason = "Expected HTTP/";
state->error_pos = (const char*) p;
@@ -9036,7 +9083,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_74: {
+ s_n_llhttp__internal__n_error_75: {
state->error = 0x8;
state->reason = "Expected SOURCE method for ICE/x.x request";
state->error_pos = (const char*) p;
@@ -9050,12 +9097,12 @@ static llparse_state_t llhttp__internal__run(
case 33:
goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
default:
- goto s_n_llhttp__internal__n_error_74;
+ goto s_n_llhttp__internal__n_error_75;
}
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_75: {
+ s_n_llhttp__internal__n_error_76: {
state->error = 0x8;
state->reason = "Invalid method for RTSP/x.x request";
state->error_pos = (const char*) p;
@@ -9095,7 +9142,7 @@ static llparse_state_t llhttp__internal__run(
case 45:
goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
default:
- goto s_n_llhttp__internal__n_error_75;
+ goto s_n_llhttp__internal__n_error_76;
}
/* UNREACHABLE */;
abort();
@@ -9109,7 +9156,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_62: {
+ s_n_llhttp__internal__n_error_63: {
state->error = 0x1a;
state->reason = "`on_url_complete` callback error";
state->error_pos = (const char*) p;
@@ -9125,7 +9172,7 @@ static llparse_state_t llhttp__internal__run(
case 21:
goto s_n_llhttp__internal__n_pause_22;
default:
- goto s_n_llhttp__internal__n_error_62;
+ goto s_n_llhttp__internal__n_error_63;
}
/* UNREACHABLE */;
abort();
@@ -9198,7 +9245,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_77: {
+ s_n_llhttp__internal__n_error_78: {
state->error = 0x7;
state->reason = "Invalid char in url fragment start";
state->error_pos = (const char*) p;
@@ -9258,7 +9305,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_78: {
+ s_n_llhttp__internal__n_error_79: {
state->error = 0x7;
state->reason = "Invalid char in url query";
state->error_pos = (const char*) p;
@@ -9267,7 +9314,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_79: {
+ s_n_llhttp__internal__n_error_80: {
state->error = 0x7;
state->reason = "Invalid char in url path";
state->error_pos = (const char*) p;
@@ -9378,7 +9425,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_80: {
+ s_n_llhttp__internal__n_error_81: {
state->error = 0x7;
state->reason = "Double @ in url";
state->error_pos = (const char*) p;
@@ -9387,7 +9434,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_81: {
+ s_n_llhttp__internal__n_error_82: {
state->error = 0x7;
state->reason = "Unexpected char in url server";
state->error_pos = (const char*) p;
@@ -9396,7 +9443,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_82: {
+ s_n_llhttp__internal__n_error_83: {
state->error = 0x7;
state->reason = "Unexpected char in url server";
state->error_pos = (const char*) p;
@@ -9405,7 +9452,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_83: {
+ s_n_llhttp__internal__n_error_84: {
state->error = 0x7;
state->reason = "Unexpected char in url schema";
state->error_pos = (const char*) p;
@@ -9414,7 +9461,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_84: {
+ s_n_llhttp__internal__n_error_85: {
state->error = 0x7;
state->reason = "Unexpected char in url schema";
state->error_pos = (const char*) p;
@@ -9423,7 +9470,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_85: {
+ s_n_llhttp__internal__n_error_86: {
state->error = 0x7;
state->reason = "Unexpected start char in url";
state->error_pos = (const char*) p;
@@ -9442,7 +9489,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_86: {
+ s_n_llhttp__internal__n_error_87: {
state->error = 0x6;
state->reason = "Expected space after method";
state->error_pos = (const char*) p;
@@ -9460,7 +9507,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_105: {
+ s_n_llhttp__internal__n_error_106: {
state->error = 0x20;
state->reason = "`on_method_complete` callback error";
state->error_pos = (const char*) p;
@@ -9494,7 +9541,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_106: {
+ s_n_llhttp__internal__n_error_107: {
state->error = 0x6;
state->reason = "Invalid method encountered";
state->error_pos = (const char*) p;
@@ -9503,7 +9550,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_98: {
+ s_n_llhttp__internal__n_error_99: {
state->error = 0xd;
state->reason = "Invalid status code";
state->error_pos = (const char*) p;
@@ -9512,7 +9559,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_96: {
+ s_n_llhttp__internal__n_error_97: {
state->error = 0xd;
state->reason = "Invalid status code";
state->error_pos = (const char*) p;
@@ -9521,7 +9568,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_94: {
+ s_n_llhttp__internal__n_error_95: {
state->error = 0xd;
state->reason = "Invalid status code";
state->error_pos = (const char*) p;
@@ -9539,7 +9586,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_90: {
+ s_n_llhttp__internal__n_error_91: {
state->error = 0x1b;
state->reason = "`on_status_complete` callback error";
state->error_pos = (const char*) p;
@@ -9555,12 +9602,12 @@ static llparse_state_t llhttp__internal__run(
case 21:
goto s_n_llhttp__internal__n_pause_24;
default:
- goto s_n_llhttp__internal__n_error_90;
+ goto s_n_llhttp__internal__n_error_91;
}
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_89: {
+ s_n_llhttp__internal__n_error_90: {
state->error = 0xd;
state->reason = "Invalid response status";
state->error_pos = (const char*) p;
@@ -9574,12 +9621,12 @@ static llparse_state_t llhttp__internal__run(
case 1:
goto s_n_llhttp__internal__n_invoke_llhttp__on_status_complete;
default:
- goto s_n_llhttp__internal__n_error_89;
+ goto s_n_llhttp__internal__n_error_90;
}
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_91: {
+ s_n_llhttp__internal__n_error_92: {
state->error = 0x2;
state->reason = "Expected LF after CR";
state->error_pos = (const char*) p;
@@ -9593,12 +9640,12 @@ static llparse_state_t llhttp__internal__run(
case 1:
goto s_n_llhttp__internal__n_invoke_llhttp__on_status_complete;
default:
- goto s_n_llhttp__internal__n_error_91;
+ goto s_n_llhttp__internal__n_error_92;
}
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_92: {
+ s_n_llhttp__internal__n_error_93: {
state->error = 0x19;
state->reason = "Missing expected CR after response line";
state->error_pos = (const char*) p;
@@ -9643,7 +9690,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_93: {
+ s_n_llhttp__internal__n_error_94: {
state->error = 0xd;
state->reason = "Invalid response status";
state->error_pos = (const char*) p;
@@ -9655,14 +9702,14 @@ static llparse_state_t llhttp__internal__run(
s_n_llhttp__internal__n_invoke_mul_add_status_code_2: {
switch (llhttp__internal__c_mul_add_status_code(state, p, endp, match)) {
case 1:
- goto s_n_llhttp__internal__n_error_94;
+ goto s_n_llhttp__internal__n_error_95;
default:
goto s_n_llhttp__internal__n_res_status_code_otherwise;
}
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_95: {
+ s_n_llhttp__internal__n_error_96: {
state->error = 0xd;
state->reason = "Invalid status code";
state->error_pos = (const char*) p;
@@ -9674,14 +9721,14 @@ static llparse_state_t llhttp__internal__run(
s_n_llhttp__internal__n_invoke_mul_add_status_code_1: {
switch (llhttp__internal__c_mul_add_status_code(state, p, endp, match)) {
case 1:
- goto s_n_llhttp__internal__n_error_96;
+ goto s_n_llhttp__internal__n_error_97;
default:
goto s_n_llhttp__internal__n_res_status_code_digit_3;
}
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_97: {
+ s_n_llhttp__internal__n_error_98: {
state->error = 0xd;
state->reason = "Invalid status code";
state->error_pos = (const char*) p;
@@ -9693,14 +9740,14 @@ static llparse_state_t llhttp__internal__run(
s_n_llhttp__internal__n_invoke_mul_add_status_code: {
switch (llhttp__internal__c_mul_add_status_code(state, p, endp, match)) {
case 1:
- goto s_n_llhttp__internal__n_error_98;
+ goto s_n_llhttp__internal__n_error_99;
default:
goto s_n_llhttp__internal__n_res_status_code_digit_2;
}
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_99: {
+ s_n_llhttp__internal__n_error_100: {
state->error = 0xd;
state->reason = "Invalid status code";
state->error_pos = (const char*) p;
@@ -9717,7 +9764,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_100: {
+ s_n_llhttp__internal__n_error_101: {
state->error = 0x9;
state->reason = "Expected space after version";
state->error_pos = (const char*) p;
@@ -9735,7 +9782,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_88: {
+ s_n_llhttp__internal__n_error_89: {
state->error = 0x21;
state->reason = "`on_version_complete` callback error";
state->error_pos = (const char*) p;
@@ -9771,10 +9818,10 @@ static llparse_state_t llhttp__internal__run(
if (err != 0) {
state->error = err;
state->error_pos = (const char*) p;
- state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_87;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_88;
return s_error;
}
- goto s_n_llhttp__internal__n_error_87;
+ goto s_n_llhttp__internal__n_error_88;
/* UNREACHABLE */;
abort();
}
@@ -9852,10 +9899,10 @@ static llparse_state_t llhttp__internal__run(
if (err != 0) {
state->error = err;
state->error_pos = (const char*) p;
- state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_101;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_102;
return s_error;
}
- goto s_n_llhttp__internal__n_error_101;
+ goto s_n_llhttp__internal__n_error_102;
/* UNREACHABLE */;
abort();
}
@@ -9869,10 +9916,10 @@ static llparse_state_t llhttp__internal__run(
if (err != 0) {
state->error = err;
state->error_pos = (const char*) p;
- state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_102;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_103;
return s_error;
}
- goto s_n_llhttp__internal__n_error_102;
+ goto s_n_llhttp__internal__n_error_103;
/* UNREACHABLE */;
abort();
}
@@ -9894,14 +9941,14 @@ static llparse_state_t llhttp__internal__run(
if (err != 0) {
state->error = err;
state->error_pos = (const char*) p;
- state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_103;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_104;
return s_error;
}
- goto s_n_llhttp__internal__n_error_103;
+ goto s_n_llhttp__internal__n_error_104;
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_107: {
+ s_n_llhttp__internal__n_error_108: {
state->error = 0x8;
state->reason = "Expected HTTP/";
state->error_pos = (const char*) p;
@@ -9961,7 +10008,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_104: {
+ s_n_llhttp__internal__n_error_105: {
state->error = 0x8;
state->reason = "Invalid word encountered";
state->error_pos = (const char*) p;
@@ -10034,7 +10081,7 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
- s_n_llhttp__internal__n_error_108: {
+ s_n_llhttp__internal__n_error_109: {
state->error = 0x1f;
state->reason = "`on_reset` callback error";
state->error_pos = (const char*) p;
@@ -10050,7 +10097,7 @@ static llparse_state_t llhttp__internal__run(
case 21:
goto s_n_llhttp__internal__n_pause_28;
default:
- goto s_n_llhttp__internal__n_error_108;
+ goto s_n_llhttp__internal__n_error_109;
}
/* UNREACHABLE */;
abort();
diff --git a/contrib/restricted/llhttp/ya.make b/contrib/restricted/llhttp/ya.make
index fe272c3b7aa..1152518a971 100644
--- a/contrib/restricted/llhttp/ya.make
+++ b/contrib/restricted/llhttp/ya.make
@@ -6,9 +6,9 @@ LICENSE(MIT)
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(9.1.3)
+VERSION(9.2.0)
-ORIGINAL_SOURCE(https://github.com/nodejs/llhttp/archive/release/v9.1.3.tar.gz)
+ORIGINAL_SOURCE(https://github.com/nodejs/llhttp/archive/release/v9.2.0.tar.gz)
ADDINCL(
GLOBAL contrib/restricted/llhttp/include
diff --git a/contrib/tools/bison/gnulib/src/glthread/lock.h b/contrib/tools/bison/gnulib/src/glthread/lock.h
index d20bbdefdde..42228df80f2 100644
--- a/contrib/tools/bison/gnulib/src/glthread/lock.h
+++ b/contrib/tools/bison/gnulib/src/glthread/lock.h
@@ -489,7 +489,7 @@ extern int glthread_once_singlethreaded (pth_once_t *once_control);
/* Use the old Solaris threads library. */
# include <thread.h>
-# include <synch.h>
+# error #include <synch.h>
# ifdef __cplusplus
extern "C" {
diff --git a/contrib/tools/bison/gnulib/src/localcharset.c b/contrib/tools/bison/gnulib/src/localcharset.c
index a225a2ead83..2c31399da56 100644
--- a/contrib/tools/bison/gnulib/src/localcharset.c
+++ b/contrib/tools/bison/gnulib/src/localcharset.c
@@ -62,7 +62,7 @@
#endif
#if defined OS2
# define INCL_DOS
-# include <os2.h>
+# error #include <os2.h>
#endif
/* For MB_CUR_MAX_L */
diff --git a/contrib/tools/python/src/Modules/posixmodule.c b/contrib/tools/python/src/Modules/posixmodule.c
index 25b0ddf668d..bbfa4fcad1f 100644
--- a/contrib/tools/python/src/Modules/posixmodule.c
+++ b/contrib/tools/python/src/Modules/posixmodule.c
@@ -32,7 +32,7 @@
#endif
#if defined(__VMS)
-# include <unixio.h>
+# error #include <unixio.h>
#endif /* defined(__VMS) */
#ifdef __cplusplus
@@ -55,7 +55,7 @@ corresponding Unix manual entries for more information on calls.");
#define INCL_DOSERRORS
#define INCL_DOSPROCESS
#define INCL_NOPMAPI
-#include <os2.h>
+#error #include <os2.h>
#if defined(PYCC_GCC)
#include <ctype.h>
#include <io.h>
diff --git a/contrib/tools/python/src/Modules/socketmodule.c b/contrib/tools/python/src/Modules/socketmodule.c
index 013975455c4..4ab05d97b3b 100644
--- a/contrib/tools/python/src/Modules/socketmodule.c
+++ b/contrib/tools/python/src/Modules/socketmodule.c
@@ -243,7 +243,7 @@ http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/net/getaddrinfo.c.diff?r1=1.82&
# define INCL_DOS
# define INCL_DOSERRORS
# define INCL_NOPMAPI
-# include <os2.h>
+# error #include <os2.h>
#endif
#if defined(__sgi) && _COMPILER_VERSION>700 && !_SGIAPI
diff --git a/contrib/tools/python/src/Modules/timemodule.c b/contrib/tools/python/src/Modules/timemodule.c
index 6118cdd7cf0..2470d6237d3 100644
--- a/contrib/tools/python/src/Modules/timemodule.c
+++ b/contrib/tools/python/src/Modules/timemodule.c
@@ -77,7 +77,7 @@ static long main_thread;
#if defined(PYOS_OS2)
#define INCL_DOS
#define INCL_ERRORS
-#include <os2.h>
+#error #include <os2.h>
#endif
#if defined(PYCC_VACPP)
diff --git a/contrib/tools/python/src/Python/import.c b/contrib/tools/python/src/Python/import.c
index dbf89b763f6..d59c1549bf0 100644
--- a/contrib/tools/python/src/Python/import.c
+++ b/contrib/tools/python/src/Python/import.c
@@ -1701,10 +1701,10 @@ PyAPI_FUNC(int) _PyImport_IsScript(struct filedescr * fd)
#define INCL_DOS
#define INCL_DOSERRORS
#define INCL_NOPMAPI
-#include <os2.h>
+#error #include <os2.h>
#elif defined(RISCOS)
-#include "oslib/osfscontrol.h"
+#error #include "oslib/osfscontrol.h"
#endif
static int
diff --git a/contrib/tools/python/src/Python/importdl.h b/contrib/tools/python/src/Python/importdl.h
index b4d21be6f01..ad577fe4ea0 100644
--- a/contrib/tools/python/src/Python/importdl.h
+++ b/contrib/tools/python/src/Python/importdl.h
@@ -39,7 +39,7 @@ extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname,
typedef FARPROC dl_funcptr;
#else
#if defined(PYOS_OS2) && !defined(PYCC_GCC)
-#include <os2def.h>
+#error #include <os2def.h>
typedef int (* APIENTRY dl_funcptr)();
#else
typedef void (*dl_funcptr)(void);
diff --git a/contrib/tools/python3/src/Include/Python.h b/contrib/tools/python3/Include/Python.h
index 52a7aac6ba6..52a7aac6ba6 100644
--- a/contrib/tools/python3/src/Include/Python.h
+++ b/contrib/tools/python3/Include/Python.h
diff --git a/contrib/tools/python3/src/Include/abstract.h b/contrib/tools/python3/Include/abstract.h
index 064b0300b51..064b0300b51 100644
--- a/contrib/tools/python3/src/Include/abstract.h
+++ b/contrib/tools/python3/Include/abstract.h
diff --git a/contrib/tools/python3/src/Include/bltinmodule.h b/contrib/tools/python3/Include/bltinmodule.h
index 868c9e6443b..868c9e6443b 100644
--- a/contrib/tools/python3/src/Include/bltinmodule.h
+++ b/contrib/tools/python3/Include/bltinmodule.h
diff --git a/contrib/tools/python3/src/Include/boolobject.h b/contrib/tools/python3/Include/boolobject.h
index 19aef5b1b87..19aef5b1b87 100644
--- a/contrib/tools/python3/src/Include/boolobject.h
+++ b/contrib/tools/python3/Include/boolobject.h
diff --git a/contrib/tools/python3/src/Include/bytearrayobject.h b/contrib/tools/python3/Include/bytearrayobject.h
index 3d53fdba643..3d53fdba643 100644
--- a/contrib/tools/python3/src/Include/bytearrayobject.h
+++ b/contrib/tools/python3/Include/bytearrayobject.h
diff --git a/contrib/tools/python3/src/Include/bytesobject.h b/contrib/tools/python3/Include/bytesobject.h
index ee448cd02bd..ee448cd02bd 100644
--- a/contrib/tools/python3/src/Include/bytesobject.h
+++ b/contrib/tools/python3/Include/bytesobject.h
diff --git a/contrib/tools/python3/src/Include/ceval.h b/contrib/tools/python3/Include/ceval.h
index ad4d909d6f2..ad4d909d6f2 100644
--- a/contrib/tools/python3/src/Include/ceval.h
+++ b/contrib/tools/python3/Include/ceval.h
diff --git a/contrib/tools/python3/src/Include/codecs.h b/contrib/tools/python3/Include/codecs.h
index 37ecfb4ab75..37ecfb4ab75 100644
--- a/contrib/tools/python3/src/Include/codecs.h
+++ b/contrib/tools/python3/Include/codecs.h
diff --git a/contrib/tools/python3/src/Include/compile.h b/contrib/tools/python3/Include/compile.h
index 52d0bc76c9f..52d0bc76c9f 100644
--- a/contrib/tools/python3/src/Include/compile.h
+++ b/contrib/tools/python3/Include/compile.h
diff --git a/contrib/tools/python3/src/Include/complexobject.h b/contrib/tools/python3/Include/complexobject.h
index ebe49a832f7..ebe49a832f7 100644
--- a/contrib/tools/python3/src/Include/complexobject.h
+++ b/contrib/tools/python3/Include/complexobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/abstract.h b/contrib/tools/python3/Include/cpython/abstract.h
index 3b27aab2fc4..3b27aab2fc4 100644
--- a/contrib/tools/python3/src/Include/cpython/abstract.h
+++ b/contrib/tools/python3/Include/cpython/abstract.h
diff --git a/contrib/tools/python3/src/Include/cpython/bytearrayobject.h b/contrib/tools/python3/Include/cpython/bytearrayobject.h
index 9ba176eb2d3..9ba176eb2d3 100644
--- a/contrib/tools/python3/src/Include/cpython/bytearrayobject.h
+++ b/contrib/tools/python3/Include/cpython/bytearrayobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/bytesobject.h b/contrib/tools/python3/Include/cpython/bytesobject.h
index e982031c107..e982031c107 100644
--- a/contrib/tools/python3/src/Include/cpython/bytesobject.h
+++ b/contrib/tools/python3/Include/cpython/bytesobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/cellobject.h b/contrib/tools/python3/Include/cpython/cellobject.h
index 47a6a491497..47a6a491497 100644
--- a/contrib/tools/python3/src/Include/cpython/cellobject.h
+++ b/contrib/tools/python3/Include/cpython/cellobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/ceval.h b/contrib/tools/python3/Include/cpython/ceval.h
index a9616bd6a4f..a9616bd6a4f 100644
--- a/contrib/tools/python3/src/Include/cpython/ceval.h
+++ b/contrib/tools/python3/Include/cpython/ceval.h
diff --git a/contrib/tools/python3/src/Include/cpython/classobject.h b/contrib/tools/python3/Include/cpython/classobject.h
index d7c9ddd1336..d7c9ddd1336 100644
--- a/contrib/tools/python3/src/Include/cpython/classobject.h
+++ b/contrib/tools/python3/Include/cpython/classobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/code.h b/contrib/tools/python3/Include/cpython/code.h
index 03834b20c3e..03834b20c3e 100644
--- a/contrib/tools/python3/src/Include/cpython/code.h
+++ b/contrib/tools/python3/Include/cpython/code.h
diff --git a/contrib/tools/python3/src/Include/cpython/compile.h b/contrib/tools/python3/Include/cpython/compile.h
index f5a62a8ec6d..f5a62a8ec6d 100644
--- a/contrib/tools/python3/src/Include/cpython/compile.h
+++ b/contrib/tools/python3/Include/cpython/compile.h
diff --git a/contrib/tools/python3/src/Include/cpython/complexobject.h b/contrib/tools/python3/Include/cpython/complexobject.h
index b7d7283ae88..b7d7283ae88 100644
--- a/contrib/tools/python3/src/Include/cpython/complexobject.h
+++ b/contrib/tools/python3/Include/cpython/complexobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/context.h b/contrib/tools/python3/Include/cpython/context.h
index 9879fc7192e..9879fc7192e 100644
--- a/contrib/tools/python3/src/Include/cpython/context.h
+++ b/contrib/tools/python3/Include/cpython/context.h
diff --git a/contrib/tools/python3/src/Include/cpython/descrobject.h b/contrib/tools/python3/Include/cpython/descrobject.h
index e2ea1b9a2d3..e2ea1b9a2d3 100644
--- a/contrib/tools/python3/src/Include/cpython/descrobject.h
+++ b/contrib/tools/python3/Include/cpython/descrobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/dictobject.h b/contrib/tools/python3/Include/cpython/dictobject.h
index ddada922020..ddada922020 100644
--- a/contrib/tools/python3/src/Include/cpython/dictobject.h
+++ b/contrib/tools/python3/Include/cpython/dictobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/fileobject.h b/contrib/tools/python3/Include/cpython/fileobject.h
index b70ec318986..b70ec318986 100644
--- a/contrib/tools/python3/src/Include/cpython/fileobject.h
+++ b/contrib/tools/python3/Include/cpython/fileobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/fileutils.h b/contrib/tools/python3/Include/cpython/fileutils.h
index b386ad107bd..b386ad107bd 100644
--- a/contrib/tools/python3/src/Include/cpython/fileutils.h
+++ b/contrib/tools/python3/Include/cpython/fileutils.h
diff --git a/contrib/tools/python3/src/Include/cpython/floatobject.h b/contrib/tools/python3/Include/cpython/floatobject.h
index 127093098bf..127093098bf 100644
--- a/contrib/tools/python3/src/Include/cpython/floatobject.h
+++ b/contrib/tools/python3/Include/cpython/floatobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/frameobject.h b/contrib/tools/python3/Include/cpython/frameobject.h
index 4e19535c656..4e19535c656 100644
--- a/contrib/tools/python3/src/Include/cpython/frameobject.h
+++ b/contrib/tools/python3/Include/cpython/frameobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/funcobject.h b/contrib/tools/python3/Include/cpython/funcobject.h
index 6f78f5868d0..6f78f5868d0 100644
--- a/contrib/tools/python3/src/Include/cpython/funcobject.h
+++ b/contrib/tools/python3/Include/cpython/funcobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/genobject.h b/contrib/tools/python3/Include/cpython/genobject.h
index 7856481b5db..7856481b5db 100644
--- a/contrib/tools/python3/src/Include/cpython/genobject.h
+++ b/contrib/tools/python3/Include/cpython/genobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/import.h b/contrib/tools/python3/Include/cpython/import.h
index 2bca4ade4c4..2bca4ade4c4 100644
--- a/contrib/tools/python3/src/Include/cpython/import.h
+++ b/contrib/tools/python3/Include/cpython/import.h
diff --git a/contrib/tools/python3/src/Include/cpython/initconfig.h b/contrib/tools/python3/Include/cpython/initconfig.h
index cbae97f12f5..cbae97f12f5 100644
--- a/contrib/tools/python3/src/Include/cpython/initconfig.h
+++ b/contrib/tools/python3/Include/cpython/initconfig.h
diff --git a/contrib/tools/python3/src/Include/cpython/interpreteridobject.h b/contrib/tools/python3/Include/cpython/interpreteridobject.h
index 5076584209b..5076584209b 100644
--- a/contrib/tools/python3/src/Include/cpython/interpreteridobject.h
+++ b/contrib/tools/python3/Include/cpython/interpreteridobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/listobject.h b/contrib/tools/python3/Include/cpython/listobject.h
index 8fa82122d8d..8fa82122d8d 100644
--- a/contrib/tools/python3/src/Include/cpython/listobject.h
+++ b/contrib/tools/python3/Include/cpython/listobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/longintrepr.h b/contrib/tools/python3/Include/cpython/longintrepr.h
index 692c69ba76d..692c69ba76d 100644
--- a/contrib/tools/python3/src/Include/cpython/longintrepr.h
+++ b/contrib/tools/python3/Include/cpython/longintrepr.h
diff --git a/contrib/tools/python3/src/Include/cpython/longobject.h b/contrib/tools/python3/Include/cpython/longobject.h
index 90cc0f267ae..90cc0f267ae 100644
--- a/contrib/tools/python3/src/Include/cpython/longobject.h
+++ b/contrib/tools/python3/Include/cpython/longobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/memoryobject.h b/contrib/tools/python3/Include/cpython/memoryobject.h
index 3837fa8c6ab..3837fa8c6ab 100644
--- a/contrib/tools/python3/src/Include/cpython/memoryobject.h
+++ b/contrib/tools/python3/Include/cpython/memoryobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/methodobject.h b/contrib/tools/python3/Include/cpython/methodobject.h
index d541e154948..d541e154948 100644
--- a/contrib/tools/python3/src/Include/cpython/methodobject.h
+++ b/contrib/tools/python3/Include/cpython/methodobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/modsupport.h b/contrib/tools/python3/Include/cpython/modsupport.h
index 2259291aff6..2259291aff6 100644
--- a/contrib/tools/python3/src/Include/cpython/modsupport.h
+++ b/contrib/tools/python3/Include/cpython/modsupport.h
diff --git a/contrib/tools/python3/src/Include/cpython/object.h b/contrib/tools/python3/Include/cpython/object.h
index ae7f780a931..ae7f780a931 100644
--- a/contrib/tools/python3/src/Include/cpython/object.h
+++ b/contrib/tools/python3/Include/cpython/object.h
diff --git a/contrib/tools/python3/src/Include/cpython/objimpl.h b/contrib/tools/python3/Include/cpython/objimpl.h
index 5a8cdd57c78..5a8cdd57c78 100644
--- a/contrib/tools/python3/src/Include/cpython/objimpl.h
+++ b/contrib/tools/python3/Include/cpython/objimpl.h
diff --git a/contrib/tools/python3/src/Include/cpython/odictobject.h b/contrib/tools/python3/Include/cpython/odictobject.h
index 3822d554868..3822d554868 100644
--- a/contrib/tools/python3/src/Include/cpython/odictobject.h
+++ b/contrib/tools/python3/Include/cpython/odictobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/picklebufobject.h b/contrib/tools/python3/Include/cpython/picklebufobject.h
index f3cbaeef919..f3cbaeef919 100644
--- a/contrib/tools/python3/src/Include/cpython/picklebufobject.h
+++ b/contrib/tools/python3/Include/cpython/picklebufobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/pthread_stubs.h b/contrib/tools/python3/Include/cpython/pthread_stubs.h
index 83f0b08693e..83f0b08693e 100644
--- a/contrib/tools/python3/src/Include/cpython/pthread_stubs.h
+++ b/contrib/tools/python3/Include/cpython/pthread_stubs.h
diff --git a/contrib/tools/python3/src/Include/cpython/pyctype.h b/contrib/tools/python3/Include/cpython/pyctype.h
index 729d93275e6..729d93275e6 100644
--- a/contrib/tools/python3/src/Include/cpython/pyctype.h
+++ b/contrib/tools/python3/Include/cpython/pyctype.h
diff --git a/contrib/tools/python3/src/Include/cpython/pydebug.h b/contrib/tools/python3/Include/cpython/pydebug.h
index f6ebd99ed7e..f6ebd99ed7e 100644
--- a/contrib/tools/python3/src/Include/cpython/pydebug.h
+++ b/contrib/tools/python3/Include/cpython/pydebug.h
diff --git a/contrib/tools/python3/src/Include/cpython/pyerrors.h b/contrib/tools/python3/Include/cpython/pyerrors.h
index 156665cbdb1..156665cbdb1 100644
--- a/contrib/tools/python3/src/Include/cpython/pyerrors.h
+++ b/contrib/tools/python3/Include/cpython/pyerrors.h
diff --git a/contrib/tools/python3/src/Include/cpython/pyfpe.h b/contrib/tools/python3/Include/cpython/pyfpe.h
index cc2def63aa5..cc2def63aa5 100644
--- a/contrib/tools/python3/src/Include/cpython/pyfpe.h
+++ b/contrib/tools/python3/Include/cpython/pyfpe.h
diff --git a/contrib/tools/python3/src/Include/cpython/pyframe.h b/contrib/tools/python3/Include/cpython/pyframe.h
index 0e2afff925e..0e2afff925e 100644
--- a/contrib/tools/python3/src/Include/cpython/pyframe.h
+++ b/contrib/tools/python3/Include/cpython/pyframe.h
diff --git a/contrib/tools/python3/src/Include/cpython/pylifecycle.h b/contrib/tools/python3/Include/cpython/pylifecycle.h
index 4daea33bf80..4daea33bf80 100644
--- a/contrib/tools/python3/src/Include/cpython/pylifecycle.h
+++ b/contrib/tools/python3/Include/cpython/pylifecycle.h
diff --git a/contrib/tools/python3/src/Include/cpython/pymem.h b/contrib/tools/python3/Include/cpython/pymem.h
index d1054d76520..d1054d76520 100644
--- a/contrib/tools/python3/src/Include/cpython/pymem.h
+++ b/contrib/tools/python3/Include/cpython/pymem.h
diff --git a/contrib/tools/python3/src/Include/cpython/pystate.h b/contrib/tools/python3/Include/cpython/pystate.h
index 628f2e0996e..628f2e0996e 100644
--- a/contrib/tools/python3/src/Include/cpython/pystate.h
+++ b/contrib/tools/python3/Include/cpython/pystate.h
diff --git a/contrib/tools/python3/src/Include/cpython/pythonrun.h b/contrib/tools/python3/Include/cpython/pythonrun.h
index fb617655374..fb617655374 100644
--- a/contrib/tools/python3/src/Include/cpython/pythonrun.h
+++ b/contrib/tools/python3/Include/cpython/pythonrun.h
diff --git a/contrib/tools/python3/src/Include/cpython/pythread.h b/contrib/tools/python3/Include/cpython/pythread.h
index 449b7cc6ddd..449b7cc6ddd 100644
--- a/contrib/tools/python3/src/Include/cpython/pythread.h
+++ b/contrib/tools/python3/Include/cpython/pythread.h
diff --git a/contrib/tools/python3/Include/cpython/pytime.h b/contrib/tools/python3/Include/cpython/pytime.h
new file mode 100644
index 00000000000..16d88d191e9
--- /dev/null
+++ b/contrib/tools/python3/Include/cpython/pytime.h
@@ -0,0 +1,331 @@
+// The _PyTime_t API is written to use timestamp and timeout values stored in
+// various formats and to read clocks.
+//
+// The _PyTime_t type is an integer to support directly common arithmetic
+// operations like t1 + t2.
+//
+// The _PyTime_t API supports a resolution of 1 nanosecond. The _PyTime_t type
+// is signed to support negative timestamps. The supported range is around
+// [-292.3 years; +292.3 years]. Using the Unix epoch (January 1st, 1970), the
+// supported date range is around [1677-09-21; 2262-04-11].
+//
+// Formats:
+//
+// * seconds
+// * seconds as a floating pointer number (C double)
+// * milliseconds (10^-3 seconds)
+// * microseconds (10^-6 seconds)
+// * 100 nanoseconds (10^-7 seconds)
+// * nanoseconds (10^-9 seconds)
+// * timeval structure, 1 microsecond resolution (10^-6 seconds)
+// * timespec structure, 1 nanosecond resolution (10^-9 seconds)
+//
+// Integer overflows are detected and raise OverflowError. Conversion to a
+// resolution worse than 1 nanosecond is rounded correctly with the requested
+// rounding mode. There are 4 rounding modes: floor (towards -inf), ceiling
+// (towards +inf), half even and up (away from zero).
+//
+// Some functions clamp the result in the range [_PyTime_MIN; _PyTime_MAX], so
+// the caller doesn't have to handle errors and doesn't need to hold the GIL.
+// For example, _PyTime_Add(t1, t2) computes t1+t2 and clamp the result on
+// overflow.
+//
+// Clocks:
+//
+// * System clock
+// * Monotonic clock
+// * Performance counter
+//
+// Operations like (t * k / q) with integers are implemented in a way to reduce
+// the risk of integer overflow. Such operation is used to convert a clock
+// value expressed in ticks with a frequency to _PyTime_t, like
+// QueryPerformanceCounter() with QueryPerformanceFrequency().
+
+#ifndef Py_LIMITED_API
+#ifndef Py_PYTIME_H
+#define Py_PYTIME_H
+
+/**************************************************************************
+Symbols and macros to supply platform-independent interfaces to time related
+functions and constants
+**************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __clang__
+struct timeval;
+#endif
+
+/* _PyTime_t: Python timestamp with subsecond precision. It can be used to
+ store a duration, and so indirectly a date (related to another date, like
+ UNIX epoch). */
+typedef int64_t _PyTime_t;
+// _PyTime_MIN nanoseconds is around -292.3 years
+#define _PyTime_MIN INT64_MIN
+// _PyTime_MAX nanoseconds is around +292.3 years
+#define _PyTime_MAX INT64_MAX
+#define _SIZEOF_PYTIME_T 8
+
+typedef enum {
+ /* Round towards minus infinity (-inf).
+ For example, used to read a clock. */
+ _PyTime_ROUND_FLOOR=0,
+ /* Round towards infinity (+inf).
+ For example, used for timeout to wait "at least" N seconds. */
+ _PyTime_ROUND_CEILING=1,
+ /* Round to nearest with ties going to nearest even integer.
+ For example, used to round from a Python float. */
+ _PyTime_ROUND_HALF_EVEN=2,
+ /* Round away from zero
+ For example, used for timeout. _PyTime_ROUND_CEILING rounds
+ -1e-9 to 0 milliseconds which causes bpo-31786 issue.
+ _PyTime_ROUND_UP rounds -1e-9 to -1 millisecond which keeps
+ the timeout sign as expected. select.poll(timeout) must block
+ for negative values." */
+ _PyTime_ROUND_UP=3,
+ /* _PyTime_ROUND_TIMEOUT (an alias for _PyTime_ROUND_UP) should be
+ used for timeouts. */
+ _PyTime_ROUND_TIMEOUT = _PyTime_ROUND_UP
+} _PyTime_round_t;
+
+
+/* Convert a time_t to a PyLong. */
+PyAPI_FUNC(PyObject *) _PyLong_FromTime_t(
+ time_t sec);
+
+/* Convert a PyLong to a time_t. */
+PyAPI_FUNC(time_t) _PyLong_AsTime_t(
+ PyObject *obj);
+
+/* Convert a number of seconds, int or float, to time_t. */
+PyAPI_FUNC(int) _PyTime_ObjectToTime_t(
+ PyObject *obj,
+ time_t *sec,
+ _PyTime_round_t);
+
+/* Convert a number of seconds, int or float, to a timeval structure.
+ usec is in the range [0; 999999] and rounded towards zero.
+ For example, -1.2 is converted to (-2, 800000). */
+PyAPI_FUNC(int) _PyTime_ObjectToTimeval(
+ PyObject *obj,
+ time_t *sec,
+ long *usec,
+ _PyTime_round_t);
+
+/* Convert a number of seconds, int or float, to a timespec structure.
+ nsec is in the range [0; 999999999] and rounded towards zero.
+ For example, -1.2 is converted to (-2, 800000000). */
+PyAPI_FUNC(int) _PyTime_ObjectToTimespec(
+ PyObject *obj,
+ time_t *sec,
+ long *nsec,
+ _PyTime_round_t);
+
+
+/* Create a timestamp from a number of seconds. */
+PyAPI_FUNC(_PyTime_t) _PyTime_FromSeconds(int seconds);
+
+/* Macro to create a timestamp from a number of seconds, no integer overflow.
+ Only use the macro for small values, prefer _PyTime_FromSeconds(). */
+#define _PYTIME_FROMSECONDS(seconds) \
+ ((_PyTime_t)(seconds) * (1000 * 1000 * 1000))
+
+/* Create a timestamp from a number of nanoseconds. */
+PyAPI_FUNC(_PyTime_t) _PyTime_FromNanoseconds(_PyTime_t ns);
+
+/* Create a timestamp from a number of microseconds.
+ * Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow. */
+PyAPI_FUNC(_PyTime_t) _PyTime_FromMicrosecondsClamp(_PyTime_t us);
+
+/* Create a timestamp from nanoseconds (Python int). */
+PyAPI_FUNC(int) _PyTime_FromNanosecondsObject(_PyTime_t *t,
+ PyObject *obj);
+
+/* Convert a number of seconds (Python float or int) to a timestamp.
+ Raise an exception and return -1 on error, return 0 on success. */
+PyAPI_FUNC(int) _PyTime_FromSecondsObject(_PyTime_t *t,
+ PyObject *obj,
+ _PyTime_round_t round);
+
+/* Convert a number of milliseconds (Python float or int, 10^-3) to a timestamp.
+ Raise an exception and return -1 on error, return 0 on success. */
+PyAPI_FUNC(int) _PyTime_FromMillisecondsObject(_PyTime_t *t,
+ PyObject *obj,
+ _PyTime_round_t round);
+
+/* Convert a timestamp to a number of seconds as a C double. */
+PyAPI_FUNC(double) _PyTime_AsSecondsDouble(_PyTime_t t);
+
+/* Convert timestamp to a number of milliseconds (10^-3 seconds). */
+PyAPI_FUNC(_PyTime_t) _PyTime_AsMilliseconds(_PyTime_t t,
+ _PyTime_round_t round);
+
+/* Convert timestamp to a number of microseconds (10^-6 seconds). */
+PyAPI_FUNC(_PyTime_t) _PyTime_AsMicroseconds(_PyTime_t t,
+ _PyTime_round_t round);
+
+/* Convert timestamp to a number of nanoseconds (10^-9 seconds). */
+PyAPI_FUNC(_PyTime_t) _PyTime_AsNanoseconds(_PyTime_t t);
+
+#ifdef MS_WINDOWS
+// Convert timestamp to a number of 100 nanoseconds (10^-7 seconds).
+PyAPI_FUNC(_PyTime_t) _PyTime_As100Nanoseconds(_PyTime_t t,
+ _PyTime_round_t round);
+#endif
+
+/* Convert timestamp to a number of nanoseconds (10^-9 seconds) as a Python int
+ object. */
+PyAPI_FUNC(PyObject *) _PyTime_AsNanosecondsObject(_PyTime_t t);
+
+#ifndef MS_WINDOWS
+/* Create a timestamp from a timeval structure.
+ Raise an exception and return -1 on overflow, return 0 on success. */
+PyAPI_FUNC(int) _PyTime_FromTimeval(_PyTime_t *tp, struct timeval *tv);
+#endif
+
+/* Convert a timestamp to a timeval structure (microsecond resolution).
+ tv_usec is always positive.
+ Raise an exception and return -1 if the conversion overflowed,
+ return 0 on success. */
+PyAPI_FUNC(int) _PyTime_AsTimeval(_PyTime_t t,
+ struct timeval *tv,
+ _PyTime_round_t round);
+
+/* Similar to _PyTime_AsTimeval() but don't raise an exception on overflow.
+ On overflow, clamp tv_sec to _PyTime_t min/max. */
+PyAPI_FUNC(void) _PyTime_AsTimeval_clamp(_PyTime_t t,
+ struct timeval *tv,
+ _PyTime_round_t round);
+
+/* Convert a timestamp to a number of seconds (secs) and microseconds (us).
+ us is always positive. This function is similar to _PyTime_AsTimeval()
+ except that secs is always a time_t type, whereas the timeval structure
+ uses a C long for tv_sec on Windows.
+ Raise an exception and return -1 if the conversion overflowed,
+ return 0 on success. */
+PyAPI_FUNC(int) _PyTime_AsTimevalTime_t(
+ _PyTime_t t,
+ time_t *secs,
+ int *us,
+ _PyTime_round_t round);
+
+#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_KQUEUE)
+/* Create a timestamp from a timespec structure.
+ Raise an exception and return -1 on overflow, return 0 on success. */
+PyAPI_FUNC(int) _PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts);
+
+/* Convert a timestamp to a timespec structure (nanosecond resolution).
+ tv_nsec is always positive.
+ Raise an exception and return -1 on error, return 0 on success. */
+PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts);
+
+/* Similar to _PyTime_AsTimespec() but don't raise an exception on overflow.
+ On overflow, clamp tv_sec to _PyTime_t min/max. */
+PyAPI_FUNC(void) _PyTime_AsTimespec_clamp(_PyTime_t t, struct timespec *ts);
+#endif
+
+
+// Compute t1 + t2. Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow.
+PyAPI_FUNC(_PyTime_t) _PyTime_Add(_PyTime_t t1, _PyTime_t t2);
+
+/* Compute ticks * mul / div.
+ Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow.
+ The caller must ensure that ((div - 1) * mul) cannot overflow. */
+PyAPI_FUNC(_PyTime_t) _PyTime_MulDiv(_PyTime_t ticks,
+ _PyTime_t mul,
+ _PyTime_t div);
+
+/* Structure used by time.get_clock_info() */
+typedef struct {
+ const char *implementation;
+ int monotonic;
+ int adjustable;
+ double resolution;
+} _Py_clock_info_t;
+
+/* Get the current time from the system clock.
+
+ If the internal clock fails, silently ignore the error and return 0.
+ On integer overflow, silently ignore the overflow and clamp the clock to
+ [_PyTime_MIN; _PyTime_MAX].
+
+ Use _PyTime_GetSystemClockWithInfo() to check for failure. */
+PyAPI_FUNC(_PyTime_t) _PyTime_GetSystemClock(void);
+
+/* Get the current time from the system clock.
+ * On success, set *t and *info (if not NULL), and return 0.
+ * On error, raise an exception and return -1.
+ */
+PyAPI_FUNC(int) _PyTime_GetSystemClockWithInfo(
+ _PyTime_t *t,
+ _Py_clock_info_t *info);
+
+/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards.
+ The clock is not affected by system clock updates. The reference point of
+ the returned value is undefined, so that only the difference between the
+ results of consecutive calls is valid.
+
+ If the internal clock fails, silently ignore the error and return 0.
+ On integer overflow, silently ignore the overflow and clamp the clock to
+ [_PyTime_MIN; _PyTime_MAX].
+
+ Use _PyTime_GetMonotonicClockWithInfo() to check for failure. */
+PyAPI_FUNC(_PyTime_t) _PyTime_GetMonotonicClock(void);
+
+/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards.
+ The clock is not affected by system clock updates. The reference point of
+ the returned value is undefined, so that only the difference between the
+ results of consecutive calls is valid.
+
+ Fill info (if set) with information of the function used to get the time.
+
+ Return 0 on success, raise an exception and return -1 on error. */
+PyAPI_FUNC(int) _PyTime_GetMonotonicClockWithInfo(
+ _PyTime_t *t,
+ _Py_clock_info_t *info);
+
+
+/* Converts a timestamp to the Gregorian time, using the local time zone.
+ Return 0 on success, raise an exception and return -1 on error. */
+PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm);
+
+/* Converts a timestamp to the Gregorian time, assuming UTC.
+ Return 0 on success, raise an exception and return -1 on error. */
+PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm);
+
+/* Get the performance counter: clock with the highest available resolution to
+ measure a short duration.
+
+ If the internal clock fails, silently ignore the error and return 0.
+ On integer overflow, silently ignore the overflow and clamp the clock to
+ [_PyTime_MIN; _PyTime_MAX].
+
+ Use _PyTime_GetPerfCounterWithInfo() to check for failure. */
+PyAPI_FUNC(_PyTime_t) _PyTime_GetPerfCounter(void);
+
+/* Get the performance counter: clock with the highest available resolution to
+ measure a short duration.
+
+ Fill info (if set) with information of the function used to get the time.
+
+ Return 0 on success, raise an exception and return -1 on error. */
+PyAPI_FUNC(int) _PyTime_GetPerfCounterWithInfo(
+ _PyTime_t *t,
+ _Py_clock_info_t *info);
+
+
+// Create a deadline.
+// Pseudo code: _PyTime_GetMonotonicClock() + timeout.
+PyAPI_FUNC(_PyTime_t) _PyDeadline_Init(_PyTime_t timeout);
+
+// Get remaining time from a deadline.
+// Pseudo code: deadline - _PyTime_GetMonotonicClock().
+PyAPI_FUNC(_PyTime_t) _PyDeadline_Get(_PyTime_t deadline);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* Py_PYTIME_H */
+#endif /* Py_LIMITED_API */
diff --git a/contrib/tools/python3/src/Include/cpython/setobject.h b/contrib/tools/python3/Include/cpython/setobject.h
index 20fd63eaae5..20fd63eaae5 100644
--- a/contrib/tools/python3/src/Include/cpython/setobject.h
+++ b/contrib/tools/python3/Include/cpython/setobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/sysmodule.h b/contrib/tools/python3/Include/cpython/sysmodule.h
index 19d9dddc344..19d9dddc344 100644
--- a/contrib/tools/python3/src/Include/cpython/sysmodule.h
+++ b/contrib/tools/python3/Include/cpython/sysmodule.h
diff --git a/contrib/tools/python3/src/Include/cpython/traceback.h b/contrib/tools/python3/Include/cpython/traceback.h
index a4e087b2b4e..a4e087b2b4e 100644
--- a/contrib/tools/python3/src/Include/cpython/traceback.h
+++ b/contrib/tools/python3/Include/cpython/traceback.h
diff --git a/contrib/tools/python3/src/Include/cpython/tupleobject.h b/contrib/tools/python3/Include/cpython/tupleobject.h
index f6a1f076e03..f6a1f076e03 100644
--- a/contrib/tools/python3/src/Include/cpython/tupleobject.h
+++ b/contrib/tools/python3/Include/cpython/tupleobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/unicodeobject.h b/contrib/tools/python3/Include/cpython/unicodeobject.h
index f177cd9e2af..f177cd9e2af 100644
--- a/contrib/tools/python3/src/Include/cpython/unicodeobject.h
+++ b/contrib/tools/python3/Include/cpython/unicodeobject.h
diff --git a/contrib/tools/python3/src/Include/cpython/warnings.h b/contrib/tools/python3/Include/cpython/warnings.h
index 4e3eb88e8ff..4e3eb88e8ff 100644
--- a/contrib/tools/python3/src/Include/cpython/warnings.h
+++ b/contrib/tools/python3/Include/cpython/warnings.h
diff --git a/contrib/tools/python3/src/Include/cpython/weakrefobject.h b/contrib/tools/python3/Include/cpython/weakrefobject.h
index fd79fdc2dcc..fd79fdc2dcc 100644
--- a/contrib/tools/python3/src/Include/cpython/weakrefobject.h
+++ b/contrib/tools/python3/Include/cpython/weakrefobject.h
diff --git a/contrib/tools/python3/src/Include/datetime.h b/contrib/tools/python3/Include/datetime.h
index b78cc0e8e2e..b78cc0e8e2e 100644
--- a/contrib/tools/python3/src/Include/datetime.h
+++ b/contrib/tools/python3/Include/datetime.h
diff --git a/contrib/tools/python3/src/Include/descrobject.h b/contrib/tools/python3/Include/descrobject.h
index fd66d17b497..fd66d17b497 100644
--- a/contrib/tools/python3/src/Include/descrobject.h
+++ b/contrib/tools/python3/Include/descrobject.h
diff --git a/contrib/tools/python3/src/Include/dictobject.h b/contrib/tools/python3/Include/dictobject.h
index e7fcb44d0cf..e7fcb44d0cf 100644
--- a/contrib/tools/python3/src/Include/dictobject.h
+++ b/contrib/tools/python3/Include/dictobject.h
diff --git a/contrib/tools/python3/src/Include/dynamic_annotations.h b/contrib/tools/python3/Include/dynamic_annotations.h
index 4d4def9bf89..4d4def9bf89 100644
--- a/contrib/tools/python3/src/Include/dynamic_annotations.h
+++ b/contrib/tools/python3/Include/dynamic_annotations.h
diff --git a/contrib/tools/python3/src/Include/enumobject.h b/contrib/tools/python3/Include/enumobject.h
index c14dbfc8c37..c14dbfc8c37 100644
--- a/contrib/tools/python3/src/Include/enumobject.h
+++ b/contrib/tools/python3/Include/enumobject.h
diff --git a/contrib/tools/python3/src/Include/errcode.h b/contrib/tools/python3/Include/errcode.h
index bd9066bb415..bd9066bb415 100644
--- a/contrib/tools/python3/src/Include/errcode.h
+++ b/contrib/tools/python3/Include/errcode.h
diff --git a/contrib/tools/python3/src/Include/exports.h b/contrib/tools/python3/Include/exports.h
index 59373c39ff7..59373c39ff7 100644
--- a/contrib/tools/python3/src/Include/exports.h
+++ b/contrib/tools/python3/Include/exports.h
diff --git a/contrib/tools/python3/src/Include/fileobject.h b/contrib/tools/python3/Include/fileobject.h
index 2deef544d66..2deef544d66 100644
--- a/contrib/tools/python3/src/Include/fileobject.h
+++ b/contrib/tools/python3/Include/fileobject.h
diff --git a/contrib/tools/python3/src/Include/fileutils.h b/contrib/tools/python3/Include/fileutils.h
index ba5acc84fcb..ba5acc84fcb 100644
--- a/contrib/tools/python3/src/Include/fileutils.h
+++ b/contrib/tools/python3/Include/fileutils.h
diff --git a/contrib/tools/python3/src/Include/floatobject.h b/contrib/tools/python3/Include/floatobject.h
index 999441ac536..999441ac536 100644
--- a/contrib/tools/python3/src/Include/floatobject.h
+++ b/contrib/tools/python3/Include/floatobject.h
diff --git a/contrib/tools/python3/src/Include/frameobject.h b/contrib/tools/python3/Include/frameobject.h
index adb628f6314..adb628f6314 100644
--- a/contrib/tools/python3/src/Include/frameobject.h
+++ b/contrib/tools/python3/Include/frameobject.h
diff --git a/contrib/tools/python3/src/Include/genericaliasobject.h b/contrib/tools/python3/Include/genericaliasobject.h
index cf002976b27..cf002976b27 100644
--- a/contrib/tools/python3/src/Include/genericaliasobject.h
+++ b/contrib/tools/python3/Include/genericaliasobject.h
diff --git a/contrib/tools/python3/src/Include/import.h b/contrib/tools/python3/Include/import.h
index 5d5f3425b8e..5d5f3425b8e 100644
--- a/contrib/tools/python3/src/Include/import.h
+++ b/contrib/tools/python3/Include/import.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_abstract.h b/contrib/tools/python3/Include/internal/pycore_abstract.h
index b1afb2dc7be..b1afb2dc7be 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_abstract.h
+++ b/contrib/tools/python3/Include/internal/pycore_abstract.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_asdl.h b/contrib/tools/python3/Include/internal/pycore_asdl.h
index afeada88d13..afeada88d13 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_asdl.h
+++ b/contrib/tools/python3/Include/internal/pycore_asdl.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_ast.h b/contrib/tools/python3/Include/internal/pycore_ast.h
index b568902bb1e..b568902bb1e 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_ast.h
+++ b/contrib/tools/python3/Include/internal/pycore_ast.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_ast_state.h b/contrib/tools/python3/Include/internal/pycore_ast_state.h
index 863c73b0d6e..863c73b0d6e 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_ast_state.h
+++ b/contrib/tools/python3/Include/internal/pycore_ast_state.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_atexit.h b/contrib/tools/python3/Include/internal/pycore_atexit.h
index 63a2cd5d507..63a2cd5d507 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_atexit.h
+++ b/contrib/tools/python3/Include/internal/pycore_atexit.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_atomic.h b/contrib/tools/python3/Include/internal/pycore_atomic.h
index 425d69f868b..425d69f868b 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_atomic.h
+++ b/contrib/tools/python3/Include/internal/pycore_atomic.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_atomic_funcs.h b/contrib/tools/python3/Include/internal/pycore_atomic_funcs.h
index a708789cea7..a708789cea7 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_atomic_funcs.h
+++ b/contrib/tools/python3/Include/internal/pycore_atomic_funcs.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_bitutils.h b/contrib/tools/python3/Include/internal/pycore_bitutils.h
index e6bf61ef425..e6bf61ef425 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_bitutils.h
+++ b/contrib/tools/python3/Include/internal/pycore_bitutils.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_blocks_output_buffer.h b/contrib/tools/python3/Include/internal/pycore_blocks_output_buffer.h
index 28cf6fba4ee..28cf6fba4ee 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_blocks_output_buffer.h
+++ b/contrib/tools/python3/Include/internal/pycore_blocks_output_buffer.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_bytes_methods.h b/contrib/tools/python3/Include/internal/pycore_bytes_methods.h
index 11e8ab20e91..11e8ab20e91 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_bytes_methods.h
+++ b/contrib/tools/python3/Include/internal/pycore_bytes_methods.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_bytesobject.h b/contrib/tools/python3/Include/internal/pycore_bytesobject.h
index d36fa9569d6..d36fa9569d6 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_bytesobject.h
+++ b/contrib/tools/python3/Include/internal/pycore_bytesobject.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_call.h b/contrib/tools/python3/Include/internal/pycore_call.h
index 5d9342b562b..5d9342b562b 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_call.h
+++ b/contrib/tools/python3/Include/internal/pycore_call.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_ceval.h b/contrib/tools/python3/Include/internal/pycore_ceval.h
index 921b1cfcd3a..921b1cfcd3a 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_ceval.h
+++ b/contrib/tools/python3/Include/internal/pycore_ceval.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_ceval_state.h b/contrib/tools/python3/Include/internal/pycore_ceval_state.h
index e56e43c6e0c..e56e43c6e0c 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_ceval_state.h
+++ b/contrib/tools/python3/Include/internal/pycore_ceval_state.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_code.h b/contrib/tools/python3/Include/internal/pycore_code.h
index 92e0a8bbd39..92e0a8bbd39 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_code.h
+++ b/contrib/tools/python3/Include/internal/pycore_code.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_compile.h b/contrib/tools/python3/Include/internal/pycore_compile.h
index 80a637e5bf9..80a637e5bf9 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_compile.h
+++ b/contrib/tools/python3/Include/internal/pycore_compile.h
diff --git a/contrib/tools/python3/Include/internal/pycore_condvar.h b/contrib/tools/python3/Include/internal/pycore_condvar.h
new file mode 100644
index 00000000000..981c962bf7d
--- /dev/null
+++ b/contrib/tools/python3/Include/internal/pycore_condvar.h
@@ -0,0 +1,97 @@
+#ifndef Py_INTERNAL_CONDVAR_H
+#define Py_INTERNAL_CONDVAR_H
+
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
+
+#ifndef _POSIX_THREADS
+/* This means pthreads are not implemented in libc headers, hence the macro
+ not present in unistd.h. But they still can be implemented as an external
+ library (e.g. gnu pth in pthread emulation) */
+# ifdef HAVE_PTHREAD_H
+# include <pthread.h> /* _POSIX_THREADS */
+# endif
+#endif
+
+#ifdef _POSIX_THREADS
+/*
+ * POSIX support
+ */
+#define Py_HAVE_CONDVAR
+
+#ifdef HAVE_PTHREAD_H
+# include <pthread.h>
+#endif
+
+#define PyMUTEX_T pthread_mutex_t
+#define PyCOND_T pthread_cond_t
+
+#elif defined(NT_THREADS)
+/*
+ * Windows (XP, 2003 server and later, as well as (hopefully) CE) support
+ *
+ * Emulated condition variables ones that work with XP and later, plus
+ * example native support on VISTA and onwards.
+ */
+#define Py_HAVE_CONDVAR
+
+/* include windows if it hasn't been done before */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+/* options */
+/* non-emulated condition variables are provided for those that want
+ * to target Windows Vista. Modify this macro to enable them.
+ */
+#ifndef _PY_EMULATED_WIN_CV
+#define _PY_EMULATED_WIN_CV 1 /* use emulated condition variables */
+#endif
+
+/* fall back to emulation if not targeting Vista */
+#if !defined NTDDI_VISTA || NTDDI_VERSION < NTDDI_VISTA
+#undef _PY_EMULATED_WIN_CV
+#define _PY_EMULATED_WIN_CV 1
+#endif
+
+#if _PY_EMULATED_WIN_CV
+
+typedef CRITICAL_SECTION PyMUTEX_T;
+
+/* The ConditionVariable object. From XP onwards it is easily emulated
+ with a Semaphore.
+ Semaphores are available on Windows XP (2003 server) and later.
+ We use a Semaphore rather than an auto-reset event, because although
+ an auto-reset event might appear to solve the lost-wakeup bug (race
+ condition between releasing the outer lock and waiting) because it
+ maintains state even though a wait hasn't happened, there is still
+ a lost wakeup problem if more than one thread are interrupted in the
+ critical place. A semaphore solves that, because its state is
+ counted, not Boolean.
+ Because it is ok to signal a condition variable with no one
+ waiting, we need to keep track of the number of
+ waiting threads. Otherwise, the semaphore's state could rise
+ without bound. This also helps reduce the number of "spurious wakeups"
+ that would otherwise happen.
+ */
+
+typedef struct _PyCOND_T
+{
+ HANDLE sem;
+ int waiting; /* to allow PyCOND_SIGNAL to be a no-op */
+} PyCOND_T;
+
+#else /* !_PY_EMULATED_WIN_CV */
+
+/* Use native Win7 primitives if build target is Win7 or higher */
+
+/* SRWLOCK is faster and better than CriticalSection */
+typedef SRWLOCK PyMUTEX_T;
+
+typedef CONDITION_VARIABLE PyCOND_T;
+
+#endif /* _PY_EMULATED_WIN_CV */
+
+#endif /* _POSIX_THREADS, NT_THREADS */
+
+#endif /* Py_INTERNAL_CONDVAR_H */
diff --git a/contrib/tools/python3/src/Include/internal/pycore_context.h b/contrib/tools/python3/Include/internal/pycore_context.h
index 52dfe3ef233..52dfe3ef233 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_context.h
+++ b/contrib/tools/python3/Include/internal/pycore_context.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_descrobject.h b/contrib/tools/python3/Include/internal/pycore_descrobject.h
index 76378569df9..76378569df9 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_descrobject.h
+++ b/contrib/tools/python3/Include/internal/pycore_descrobject.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_dict.h b/contrib/tools/python3/Include/internal/pycore_dict.h
index 6253e0841ad..6253e0841ad 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_dict.h
+++ b/contrib/tools/python3/Include/internal/pycore_dict.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_dict_state.h b/contrib/tools/python3/Include/internal/pycore_dict_state.h
index ece0f10ca25..ece0f10ca25 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_dict_state.h
+++ b/contrib/tools/python3/Include/internal/pycore_dict_state.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_dtoa.h b/contrib/tools/python3/Include/internal/pycore_dtoa.h
index 4d9681d59a6..4d9681d59a6 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_dtoa.h
+++ b/contrib/tools/python3/Include/internal/pycore_dtoa.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_emscripten_signal.h b/contrib/tools/python3/Include/internal/pycore_emscripten_signal.h
index 8b3287d85da..8b3287d85da 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_emscripten_signal.h
+++ b/contrib/tools/python3/Include/internal/pycore_emscripten_signal.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_exceptions.h b/contrib/tools/python3/Include/internal/pycore_exceptions.h
index 4a9df709131..4a9df709131 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_exceptions.h
+++ b/contrib/tools/python3/Include/internal/pycore_exceptions.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_faulthandler.h b/contrib/tools/python3/Include/internal/pycore_faulthandler.h
index e6aec7745a6..e6aec7745a6 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_faulthandler.h
+++ b/contrib/tools/python3/Include/internal/pycore_faulthandler.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_fileutils.h b/contrib/tools/python3/Include/internal/pycore_fileutils.h
index 7c2b6ec0bff..7c2b6ec0bff 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_fileutils.h
+++ b/contrib/tools/python3/Include/internal/pycore_fileutils.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_fileutils_windows.h b/contrib/tools/python3/Include/internal/pycore_fileutils_windows.h
index e804d385e76..e804d385e76 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_fileutils_windows.h
+++ b/contrib/tools/python3/Include/internal/pycore_fileutils_windows.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_floatobject.h b/contrib/tools/python3/Include/internal/pycore_floatobject.h
index 27c63bc87f3..27c63bc87f3 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_floatobject.h
+++ b/contrib/tools/python3/Include/internal/pycore_floatobject.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_flowgraph.h b/contrib/tools/python3/Include/internal/pycore_flowgraph.h
index 98d3374a752..98d3374a752 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_flowgraph.h
+++ b/contrib/tools/python3/Include/internal/pycore_flowgraph.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_format.h b/contrib/tools/python3/Include/internal/pycore_format.h
index 1b8d57539ca..1b8d57539ca 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_format.h
+++ b/contrib/tools/python3/Include/internal/pycore_format.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_frame.h b/contrib/tools/python3/Include/internal/pycore_frame.h
index bfe4a759bac..bfe4a759bac 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_frame.h
+++ b/contrib/tools/python3/Include/internal/pycore_frame.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_function.h b/contrib/tools/python3/Include/internal/pycore_function.h
index ecbb7001e7d..ecbb7001e7d 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_function.h
+++ b/contrib/tools/python3/Include/internal/pycore_function.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_gc.h b/contrib/tools/python3/Include/internal/pycore_gc.h
index b3abe2030a0..b3abe2030a0 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_gc.h
+++ b/contrib/tools/python3/Include/internal/pycore_gc.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_genobject.h b/contrib/tools/python3/Include/internal/pycore_genobject.h
index dc60b4ca705..dc60b4ca705 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_genobject.h
+++ b/contrib/tools/python3/Include/internal/pycore_genobject.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_getopt.h b/contrib/tools/python3/Include/internal/pycore_getopt.h
index 7f0dd13ae57..7f0dd13ae57 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_getopt.h
+++ b/contrib/tools/python3/Include/internal/pycore_getopt.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_gil.h b/contrib/tools/python3/Include/internal/pycore_gil.h
index 8ebad37b686..8ebad37b686 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_gil.h
+++ b/contrib/tools/python3/Include/internal/pycore_gil.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_global_objects.h b/contrib/tools/python3/Include/internal/pycore_global_objects.h
index 442f8516278..442f8516278 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_global_objects.h
+++ b/contrib/tools/python3/Include/internal/pycore_global_objects.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_global_objects_fini_generated.h b/contrib/tools/python3/Include/internal/pycore_global_objects_fini_generated.h
index 439f47a263d..439f47a263d 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_global_objects_fini_generated.h
+++ b/contrib/tools/python3/Include/internal/pycore_global_objects_fini_generated.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_global_strings.h b/contrib/tools/python3/Include/internal/pycore_global_strings.h
index 0c84999cbf8..0c84999cbf8 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_global_strings.h
+++ b/contrib/tools/python3/Include/internal/pycore_global_strings.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_hamt.h b/contrib/tools/python3/Include/internal/pycore_hamt.h
index d8742c7cb63..d8742c7cb63 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_hamt.h
+++ b/contrib/tools/python3/Include/internal/pycore_hamt.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_hashtable.h b/contrib/tools/python3/Include/internal/pycore_hashtable.h
index f57978a8d61..f57978a8d61 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_hashtable.h
+++ b/contrib/tools/python3/Include/internal/pycore_hashtable.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_import.h b/contrib/tools/python3/Include/internal/pycore_import.h
index 376957bdc99..376957bdc99 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_import.h
+++ b/contrib/tools/python3/Include/internal/pycore_import.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_initconfig.h b/contrib/tools/python3/Include/internal/pycore_initconfig.h
index 4cbd14a61d4..4cbd14a61d4 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_initconfig.h
+++ b/contrib/tools/python3/Include/internal/pycore_initconfig.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_instruments.h b/contrib/tools/python3/Include/internal/pycore_instruments.h
index 87f70d2dc0d..87f70d2dc0d 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_instruments.h
+++ b/contrib/tools/python3/Include/internal/pycore_instruments.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_interp.h b/contrib/tools/python3/Include/internal/pycore_interp.h
index 37cc88ed081..37cc88ed081 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_interp.h
+++ b/contrib/tools/python3/Include/internal/pycore_interp.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_intrinsics.h b/contrib/tools/python3/Include/internal/pycore_intrinsics.h
index 39f15681b7b..39f15681b7b 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_intrinsics.h
+++ b/contrib/tools/python3/Include/internal/pycore_intrinsics.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_list.h b/contrib/tools/python3/Include/internal/pycore_list.h
index 2fcbe12cd65..2fcbe12cd65 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_list.h
+++ b/contrib/tools/python3/Include/internal/pycore_list.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_long.h b/contrib/tools/python3/Include/internal/pycore_long.h
index 64c00cb1475..64c00cb1475 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_long.h
+++ b/contrib/tools/python3/Include/internal/pycore_long.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_memoryobject.h b/contrib/tools/python3/Include/internal/pycore_memoryobject.h
index fe19e3f9611..fe19e3f9611 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_memoryobject.h
+++ b/contrib/tools/python3/Include/internal/pycore_memoryobject.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_moduleobject.h b/contrib/tools/python3/Include/internal/pycore_moduleobject.h
index 15a1bcb6ae5..15a1bcb6ae5 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_moduleobject.h
+++ b/contrib/tools/python3/Include/internal/pycore_moduleobject.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_namespace.h b/contrib/tools/python3/Include/internal/pycore_namespace.h
index cb76f040693..cb76f040693 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_namespace.h
+++ b/contrib/tools/python3/Include/internal/pycore_namespace.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_object.h b/contrib/tools/python3/Include/internal/pycore_object.h
index 7a2f13a21bd..7a2f13a21bd 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_object.h
+++ b/contrib/tools/python3/Include/internal/pycore_object.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_object_state.h b/contrib/tools/python3/Include/internal/pycore_object_state.h
index 65feb5af969..65feb5af969 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_object_state.h
+++ b/contrib/tools/python3/Include/internal/pycore_object_state.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_obmalloc.h b/contrib/tools/python3/Include/internal/pycore_obmalloc.h
index b1c00654ac1..b1c00654ac1 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_obmalloc.h
+++ b/contrib/tools/python3/Include/internal/pycore_obmalloc.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_obmalloc_init.h b/contrib/tools/python3/Include/internal/pycore_obmalloc_init.h
index 8ee72ff2d41..8ee72ff2d41 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_obmalloc_init.h
+++ b/contrib/tools/python3/Include/internal/pycore_obmalloc_init.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_opcode.h b/contrib/tools/python3/Include/internal/pycore_opcode.h
index 15d96503830..15d96503830 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_opcode.h
+++ b/contrib/tools/python3/Include/internal/pycore_opcode.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_opcode_utils.h b/contrib/tools/python3/Include/internal/pycore_opcode_utils.h
index 1d5ff988290..1d5ff988290 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_opcode_utils.h
+++ b/contrib/tools/python3/Include/internal/pycore_opcode_utils.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_parser.h b/contrib/tools/python3/Include/internal/pycore_parser.h
index dd51b92801a..dd51b92801a 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_parser.h
+++ b/contrib/tools/python3/Include/internal/pycore_parser.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_pathconfig.h b/contrib/tools/python3/Include/internal/pycore_pathconfig.h
index b8deaa0c3eb..b8deaa0c3eb 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_pathconfig.h
+++ b/contrib/tools/python3/Include/internal/pycore_pathconfig.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_pyarena.h b/contrib/tools/python3/Include/internal/pycore_pyarena.h
index d78972a88ca..d78972a88ca 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_pyarena.h
+++ b/contrib/tools/python3/Include/internal/pycore_pyarena.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_pyerrors.h b/contrib/tools/python3/Include/internal/pycore_pyerrors.h
index 4620a269644..4620a269644 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_pyerrors.h
+++ b/contrib/tools/python3/Include/internal/pycore_pyerrors.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_pyhash.h b/contrib/tools/python3/Include/internal/pycore_pyhash.h
index 34dfa537712..34dfa537712 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_pyhash.h
+++ b/contrib/tools/python3/Include/internal/pycore_pyhash.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_pylifecycle.h b/contrib/tools/python3/Include/internal/pycore_pylifecycle.h
index 7cd998a704c..7cd998a704c 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_pylifecycle.h
+++ b/contrib/tools/python3/Include/internal/pycore_pylifecycle.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_pymath.h b/contrib/tools/python3/Include/internal/pycore_pymath.h
index 7a4e1c1eb71..7a4e1c1eb71 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_pymath.h
+++ b/contrib/tools/python3/Include/internal/pycore_pymath.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_pymem.h b/contrib/tools/python3/Include/internal/pycore_pymem.h
index 81a707a0a5d..81a707a0a5d 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_pymem.h
+++ b/contrib/tools/python3/Include/internal/pycore_pymem.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_pymem_init.h b/contrib/tools/python3/Include/internal/pycore_pymem_init.h
index 78232738cb0..78232738cb0 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_pymem_init.h
+++ b/contrib/tools/python3/Include/internal/pycore_pymem_init.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_pystate.h b/contrib/tools/python3/Include/internal/pycore_pystate.h
index fba08ae5523..fba08ae5523 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_pystate.h
+++ b/contrib/tools/python3/Include/internal/pycore_pystate.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_pythread.h b/contrib/tools/python3/Include/internal/pycore_pythread.h
index f53921494c1..f53921494c1 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_pythread.h
+++ b/contrib/tools/python3/Include/internal/pycore_pythread.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_range.h b/contrib/tools/python3/Include/internal/pycore_range.h
index bf045ec4fd8..bf045ec4fd8 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_range.h
+++ b/contrib/tools/python3/Include/internal/pycore_range.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_runtime.h b/contrib/tools/python3/Include/internal/pycore_runtime.h
index 99c4b0760bf..99c4b0760bf 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_runtime.h
+++ b/contrib/tools/python3/Include/internal/pycore_runtime.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_runtime_init.h b/contrib/tools/python3/Include/internal/pycore_runtime_init.h
index e5f9e17efff..e5f9e17efff 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_runtime_init.h
+++ b/contrib/tools/python3/Include/internal/pycore_runtime_init.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_runtime_init_generated.h b/contrib/tools/python3/Include/internal/pycore_runtime_init_generated.h
index 07f237b2905..07f237b2905 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_runtime_init_generated.h
+++ b/contrib/tools/python3/Include/internal/pycore_runtime_init_generated.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_signal.h b/contrib/tools/python3/Include/internal/pycore_signal.h
index ca3f69d09fc..ca3f69d09fc 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_signal.h
+++ b/contrib/tools/python3/Include/internal/pycore_signal.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_sliceobject.h b/contrib/tools/python3/Include/internal/pycore_sliceobject.h
index 98665c3859d..98665c3859d 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_sliceobject.h
+++ b/contrib/tools/python3/Include/internal/pycore_sliceobject.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_strhex.h b/contrib/tools/python3/Include/internal/pycore_strhex.h
index f427b4d695b..f427b4d695b 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_strhex.h
+++ b/contrib/tools/python3/Include/internal/pycore_strhex.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_structseq.h b/contrib/tools/python3/Include/internal/pycore_structseq.h
index 6f5dfc12707..6f5dfc12707 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_structseq.h
+++ b/contrib/tools/python3/Include/internal/pycore_structseq.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_symtable.h b/contrib/tools/python3/Include/internal/pycore_symtable.h
index c8e0578a231..c8e0578a231 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_symtable.h
+++ b/contrib/tools/python3/Include/internal/pycore_symtable.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_sysmodule.h b/contrib/tools/python3/Include/internal/pycore_sysmodule.h
index b4b1febafa4..b4b1febafa4 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_sysmodule.h
+++ b/contrib/tools/python3/Include/internal/pycore_sysmodule.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_time.h b/contrib/tools/python3/Include/internal/pycore_time.h
index 949170c4493..949170c4493 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_time.h
+++ b/contrib/tools/python3/Include/internal/pycore_time.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_token.h b/contrib/tools/python3/Include/internal/pycore_token.h
index c02e637fee1..c02e637fee1 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_token.h
+++ b/contrib/tools/python3/Include/internal/pycore_token.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_traceback.h b/contrib/tools/python3/Include/internal/pycore_traceback.h
index c393b2c136f..c393b2c136f 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_traceback.h
+++ b/contrib/tools/python3/Include/internal/pycore_traceback.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_tracemalloc.h b/contrib/tools/python3/Include/internal/pycore_tracemalloc.h
index d086adc61c3..d086adc61c3 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_tracemalloc.h
+++ b/contrib/tools/python3/Include/internal/pycore_tracemalloc.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_tuple.h b/contrib/tools/python3/Include/internal/pycore_tuple.h
index 335edad8979..335edad8979 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_tuple.h
+++ b/contrib/tools/python3/Include/internal/pycore_tuple.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_typeobject.h b/contrib/tools/python3/Include/internal/pycore_typeobject.h
index 63f76fc55c9..63f76fc55c9 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_typeobject.h
+++ b/contrib/tools/python3/Include/internal/pycore_typeobject.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_typevarobject.h b/contrib/tools/python3/Include/internal/pycore_typevarobject.h
index c9fa97d6820..c9fa97d6820 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_typevarobject.h
+++ b/contrib/tools/python3/Include/internal/pycore_typevarobject.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_ucnhash.h b/contrib/tools/python3/Include/internal/pycore_ucnhash.h
index 187dd68e734..187dd68e734 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_ucnhash.h
+++ b/contrib/tools/python3/Include/internal/pycore_ucnhash.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_unicodeobject.h b/contrib/tools/python3/Include/internal/pycore_unicodeobject.h
index 1bb0f366e78..1bb0f366e78 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_unicodeobject.h
+++ b/contrib/tools/python3/Include/internal/pycore_unicodeobject.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_unicodeobject_generated.h b/contrib/tools/python3/Include/internal/pycore_unicodeobject_generated.h
index 9b470094b7a..9b470094b7a 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_unicodeobject_generated.h
+++ b/contrib/tools/python3/Include/internal/pycore_unicodeobject_generated.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_unionobject.h b/contrib/tools/python3/Include/internal/pycore_unionobject.h
index 87264635b6e..87264635b6e 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_unionobject.h
+++ b/contrib/tools/python3/Include/internal/pycore_unionobject.h
diff --git a/contrib/tools/python3/src/Include/internal/pycore_warnings.h b/contrib/tools/python3/Include/internal/pycore_warnings.h
index efb4f1cd7ea..efb4f1cd7ea 100644
--- a/contrib/tools/python3/src/Include/internal/pycore_warnings.h
+++ b/contrib/tools/python3/Include/internal/pycore_warnings.h
diff --git a/contrib/tools/python3/src/Include/interpreteridobject.h b/contrib/tools/python3/Include/interpreteridobject.h
index 8432632f339..8432632f339 100644
--- a/contrib/tools/python3/src/Include/interpreteridobject.h
+++ b/contrib/tools/python3/Include/interpreteridobject.h
diff --git a/contrib/tools/python3/src/Include/intrcheck.h b/contrib/tools/python3/Include/intrcheck.h
index b8cc6560168..b8cc6560168 100644
--- a/contrib/tools/python3/src/Include/intrcheck.h
+++ b/contrib/tools/python3/Include/intrcheck.h
diff --git a/contrib/tools/python3/src/Include/iterobject.h b/contrib/tools/python3/Include/iterobject.h
index fff30f7176f..fff30f7176f 100644
--- a/contrib/tools/python3/src/Include/iterobject.h
+++ b/contrib/tools/python3/Include/iterobject.h
diff --git a/contrib/tools/python3/src/Include/listobject.h b/contrib/tools/python3/Include/listobject.h
index 6b7041ba0b0..6b7041ba0b0 100644
--- a/contrib/tools/python3/src/Include/listobject.h
+++ b/contrib/tools/python3/Include/listobject.h
diff --git a/contrib/tools/python3/src/Include/longobject.h b/contrib/tools/python3/Include/longobject.h
index e090dd024a0..e090dd024a0 100644
--- a/contrib/tools/python3/src/Include/longobject.h
+++ b/contrib/tools/python3/Include/longobject.h
diff --git a/contrib/tools/python3/src/Include/marshal.h b/contrib/tools/python3/Include/marshal.h
index f8b0de80cfc..f8b0de80cfc 100644
--- a/contrib/tools/python3/src/Include/marshal.h
+++ b/contrib/tools/python3/Include/marshal.h
diff --git a/contrib/tools/python3/src/Include/memoryobject.h b/contrib/tools/python3/Include/memoryobject.h
index 2c9146aa2b5..2c9146aa2b5 100644
--- a/contrib/tools/python3/src/Include/memoryobject.h
+++ b/contrib/tools/python3/Include/memoryobject.h
diff --git a/contrib/tools/python3/src/Include/methodobject.h b/contrib/tools/python3/Include/methodobject.h
index 72af5ad933d..72af5ad933d 100644
--- a/contrib/tools/python3/src/Include/methodobject.h
+++ b/contrib/tools/python3/Include/methodobject.h
diff --git a/contrib/tools/python3/src/Include/modsupport.h b/contrib/tools/python3/Include/modsupport.h
index 1592bd0db4f..1592bd0db4f 100644
--- a/contrib/tools/python3/src/Include/modsupport.h
+++ b/contrib/tools/python3/Include/modsupport.h
diff --git a/contrib/tools/python3/src/Include/moduleobject.h b/contrib/tools/python3/Include/moduleobject.h
index 354d133e45e..354d133e45e 100644
--- a/contrib/tools/python3/src/Include/moduleobject.h
+++ b/contrib/tools/python3/Include/moduleobject.h
diff --git a/contrib/tools/python3/src/Include/object.h b/contrib/tools/python3/Include/object.h
index 5c30c77bc26..5c30c77bc26 100644
--- a/contrib/tools/python3/src/Include/object.h
+++ b/contrib/tools/python3/Include/object.h
diff --git a/contrib/tools/python3/src/Include/objimpl.h b/contrib/tools/python3/Include/objimpl.h
index ef871c5ea93..ef871c5ea93 100644
--- a/contrib/tools/python3/src/Include/objimpl.h
+++ b/contrib/tools/python3/Include/objimpl.h
diff --git a/contrib/tools/python3/src/Include/opcode.h b/contrib/tools/python3/Include/opcode.h
index 9806511ba42..9806511ba42 100644
--- a/contrib/tools/python3/src/Include/opcode.h
+++ b/contrib/tools/python3/Include/opcode.h
diff --git a/contrib/tools/python3/src/Include/osdefs.h b/contrib/tools/python3/Include/osdefs.h
index 3243944a148..3243944a148 100644
--- a/contrib/tools/python3/src/Include/osdefs.h
+++ b/contrib/tools/python3/Include/osdefs.h
diff --git a/contrib/tools/python3/src/Include/osmodule.h b/contrib/tools/python3/Include/osmodule.h
index 9095c2fdd3d..9095c2fdd3d 100644
--- a/contrib/tools/python3/src/Include/osmodule.h
+++ b/contrib/tools/python3/Include/osmodule.h
diff --git a/contrib/tools/python3/src/Include/patchlevel.h b/contrib/tools/python3/Include/patchlevel.h
index e7316df367c..e7316df367c 100644
--- a/contrib/tools/python3/src/Include/patchlevel.h
+++ b/contrib/tools/python3/Include/patchlevel.h
diff --git a/contrib/tools/python3/src/Include/pybuffer.h b/contrib/tools/python3/Include/pybuffer.h
index ca1c6058d90..ca1c6058d90 100644
--- a/contrib/tools/python3/src/Include/pybuffer.h
+++ b/contrib/tools/python3/Include/pybuffer.h
diff --git a/contrib/tools/python3/src/Include/pycapsule.h b/contrib/tools/python3/Include/pycapsule.h
index 929a9a68525..929a9a68525 100644
--- a/contrib/tools/python3/src/Include/pycapsule.h
+++ b/contrib/tools/python3/Include/pycapsule.h
diff --git a/contrib/tools/python3/Include/pyconfig-linux.h b/contrib/tools/python3/Include/pyconfig-linux.h
new file mode 100644
index 00000000000..967ba21e958
--- /dev/null
+++ b/contrib/tools/python3/Include/pyconfig-linux.h
@@ -0,0 +1,1947 @@
+/* pyconfig.h. Generated from pyconfig.h.in by configure. */
+/* pyconfig.h.in. Generated from configure.ac by autoheader. */
+
+
+#ifndef Py_PYCONFIG_H
+#define Py_PYCONFIG_H
+
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* BUILD_GNU_TYPE + AIX_BUILDDATE are used to construct the PEP425 tag of the
+ build system. */
+/* #undef AIX_BUILDDATE */
+
+/* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want
+ support for AIX C++ shared extension modules. */
+/* #undef AIX_GENUINE_CPLUSPLUS */
+
+/* The normal alignment of `long', in bytes. */
+#define ALIGNOF_LONG 8
+
+/* The normal alignment of `max_align_t', in bytes. */
+#define ALIGNOF_MAX_ALIGN_T 16
+
+/* The normal alignment of `size_t', in bytes. */
+#define ALIGNOF_SIZE_T 8
+
+/* Alternative SOABI used in debug build to load C extensions built in release
+ mode */
+/* #undef ALT_SOABI */
+
+/* The Android API level. */
+/* #undef ANDROID_API_LEVEL */
+
+/* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM
+ mixed-endian order (byte order 45670123) */
+/* #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 */
+
+/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the most
+ significant byte first */
+/* #undef DOUBLE_IS_BIG_ENDIAN_IEEE754 */
+
+/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
+ least significant byte first */
+#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1
+
+/* Define if --enable-ipv6 is specified */
+#define ENABLE_IPV6 1
+
+/* Define to 1 if your system stores words within floats with the most
+ significant word first */
+/* #undef FLOAT_WORDS_BIGENDIAN */
+
+/* Define if getpgrp() must be called as getpgrp(0). */
+/* #undef GETPGRP_HAVE_ARG */
+
+/* Define if you have the 'accept' function. */
+#define HAVE_ACCEPT 1
+
+/* Define to 1 if you have the `accept4' function. */
+#define HAVE_ACCEPT4 1
+
+/* Define to 1 if you have the `acosh' function. */
+#define HAVE_ACOSH 1
+
+/* struct addrinfo (netdb.h) */
+#define HAVE_ADDRINFO 1
+
+/* Define to 1 if you have the `alarm' function. */
+#define HAVE_ALARM 1
+
+/* Define if aligned memory access is required */
+/* #undef HAVE_ALIGNED_REQUIRED */
+
+/* Define to 1 if you have the <alloca.h> header file. */
+#define HAVE_ALLOCA_H 1
+
+/* Define this if your time.h defines altzone. */
+/* #undef HAVE_ALTZONE */
+
+/* Define to 1 if you have the `asinh' function. */
+#define HAVE_ASINH 1
+
+/* Define to 1 if you have the <asm/types.h> header file. */
+#define HAVE_ASM_TYPES_H 1
+
+/* Define to 1 if you have the `atanh' function. */
+#define HAVE_ATANH 1
+
+/* Define if you have the 'bind' function. */
+#define HAVE_BIND 1
+
+/* Define to 1 if you have the `bind_textdomain_codeset' function. */
+#define HAVE_BIND_TEXTDOMAIN_CODESET 1
+
+/* Define to 1 if you have the <bluetooth/bluetooth.h> header file. */
+/* #undef HAVE_BLUETOOTH_BLUETOOTH_H */
+
+/* Define to 1 if you have the <bluetooth.h> header file. */
+/* #undef HAVE_BLUETOOTH_H */
+
+/* Define if mbstowcs(NULL, "text", 0) does not return the number of wide
+ chars that would be converted. */
+/* #undef HAVE_BROKEN_MBSTOWCS */
+
+/* Define if nice() returns success/failure instead of the new priority. */
+/* #undef HAVE_BROKEN_NICE */
+
+/* Define if the system reports an invalid PIPE_BUF value. */
+/* #undef HAVE_BROKEN_PIPE_BUF */
+
+/* Define if poll() sets errno on invalid file descriptors. */
+/* #undef HAVE_BROKEN_POLL */
+
+/* Define if the Posix semaphores do not work on your system */
+/* #undef HAVE_BROKEN_POSIX_SEMAPHORES */
+
+/* Define if pthread_sigmask() does not work on your system. */
+/* #undef HAVE_BROKEN_PTHREAD_SIGMASK */
+
+/* define to 1 if your sem_getvalue is broken. */
+/* #undef HAVE_BROKEN_SEM_GETVALUE */
+
+/* Define if 'unsetenv' does not return an int. */
+/* #undef HAVE_BROKEN_UNSETENV */
+
+/* Has builtin __atomic_load_n() and __atomic_store_n() functions */
+#define HAVE_BUILTIN_ATOMIC 1
+
+/* Define to 1 if you have the <bzlib.h> header file. */
+/* #undef HAVE_BZLIB_H */
+
+/* Define to 1 if you have the 'chflags' function. */
+/* #undef HAVE_CHFLAGS */
+
+/* Define to 1 if you have the `chmod' function. */
+#define HAVE_CHMOD 1
+
+/* Define to 1 if you have the `chown' function. */
+#define HAVE_CHOWN 1
+
+/* Define if you have the 'chroot' function. */
+#define HAVE_CHROOT 1
+
+/* Define to 1 if you have the `clock' function. */
+#define HAVE_CLOCK 1
+
+/* Define to 1 if you have the `clock_getres' function. */
+#define HAVE_CLOCK_GETRES 1
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+
+/* Define to 1 if you have the `clock_nanosleep' function. */
+#define HAVE_CLOCK_NANOSLEEP 1
+
+/* Define to 1 if you have the `clock_settime' function. */
+#define HAVE_CLOCK_SETTIME 1
+
+/* Define to 1 if you have the `close_range' function. */
+/* #undef HAVE_CLOSE_RANGE */
+
+/* Define if the C compiler supports computed gotos. */
+#define HAVE_COMPUTED_GOTOS 1
+
+/* Define to 1 if you have the `confstr' function. */
+#define HAVE_CONFSTR 1
+
+/* Define to 1 if you have the <conio.h> header file. */
+/* #undef HAVE_CONIO_H */
+
+/* Define if you have the 'connect' function. */
+#define HAVE_CONNECT 1
+
+/* Define to 1 if you have the `copy_file_range' function. */
+/* #undef HAVE_COPY_FILE_RANGE */
+
+/* Define to 1 if you have the <crypt.h> header file. */
+#define HAVE_CRYPT_H 1
+
+/* Define if you have the crypt_r() function. */
+#define HAVE_CRYPT_R 1
+
+/* Define to 1 if you have the `ctermid' function. */
+#define HAVE_CTERMID 1
+
+/* Define if you have the 'ctermid_r' function. */
+/* #undef HAVE_CTERMID_R */
+
+/* Define if you have the 'filter' function. */
+#define HAVE_CURSES_FILTER 1
+
+/* Define to 1 if you have the <curses.h> header file. */
+#define HAVE_CURSES_H 1
+
+/* Define if you have the 'has_key' function. */
+#define HAVE_CURSES_HAS_KEY 1
+
+/* Define if you have the 'immedok' function. */
+#define HAVE_CURSES_IMMEDOK 1
+
+/* Define if you have the 'is_pad' function. */
+#define HAVE_CURSES_IS_PAD 1
+
+/* Define if you have the 'is_term_resized' function. */
+#define HAVE_CURSES_IS_TERM_RESIZED 1
+
+/* Define if you have the 'resizeterm' function. */
+#define HAVE_CURSES_RESIZETERM 1
+
+/* Define if you have the 'resize_term' function. */
+#define HAVE_CURSES_RESIZE_TERM 1
+
+/* Define if you have the 'syncok' function. */
+#define HAVE_CURSES_SYNCOK 1
+
+/* Define if you have the 'typeahead' function. */
+#define HAVE_CURSES_TYPEAHEAD 1
+
+/* Define if you have the 'use_env' function. */
+#define HAVE_CURSES_USE_ENV 1
+
+/* Define if you have the 'wchgat' function. */
+#define HAVE_CURSES_WCHGAT 1
+
+/* Define to 1 if you have the <db.h> header file. */
+/* #undef HAVE_DB_H */
+
+/* Define to 1 if you have the declaration of `RTLD_DEEPBIND', and to 0 if you
+ don't. */
+#define HAVE_DECL_RTLD_DEEPBIND 1
+
+/* Define to 1 if you have the declaration of `RTLD_GLOBAL', and to 0 if you
+ don't. */
+#define HAVE_DECL_RTLD_GLOBAL 1
+
+/* Define to 1 if you have the declaration of `RTLD_LAZY', and to 0 if you
+ don't. */
+#define HAVE_DECL_RTLD_LAZY 1
+
+/* Define to 1 if you have the declaration of `RTLD_LOCAL', and to 0 if you
+ don't. */
+#define HAVE_DECL_RTLD_LOCAL 1
+
+/* Define to 1 if you have the declaration of `RTLD_MEMBER', and to 0 if you
+ don't. */
+#define HAVE_DECL_RTLD_MEMBER 0
+
+/* Define to 1 if you have the declaration of `RTLD_NODELETE', and to 0 if you
+ don't. */
+#define HAVE_DECL_RTLD_NODELETE 1
+
+/* Define to 1 if you have the declaration of `RTLD_NOLOAD', and to 0 if you
+ don't. */
+#define HAVE_DECL_RTLD_NOLOAD 1
+
+/* Define to 1 if you have the declaration of `RTLD_NOW', and to 0 if you
+ don't. */
+#define HAVE_DECL_RTLD_NOW 1
+
+/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
+ */
+/* #undef HAVE_DECL_TZNAME */
+
+/* Define to 1 if you have the device macros. */
+#define HAVE_DEVICE_MACROS 1
+
+/* Define to 1 if you have the /dev/ptc device file. */
+/* #undef HAVE_DEV_PTC */
+
+/* Define to 1 if you have the /dev/ptmx device file. */
+#define HAVE_DEV_PTMX 1
+
+/* Define to 1 if you have the <direct.h> header file. */
+/* #undef HAVE_DIRECT_H */
+
+/* Define to 1 if the dirent structure has a d_type field */
+#define HAVE_DIRENT_D_TYPE 1
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#define HAVE_DIRENT_H 1
+
+/* Define if you have the 'dirfd' function or macro. */
+#define HAVE_DIRFD 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the `dlopen' function. */
+#define HAVE_DLOPEN 1
+
+/* Define to 1 if you have the `dup' function. */
+#define HAVE_DUP 1
+
+/* Define to 1 if you have the `dup2' function. */
+#define HAVE_DUP2 1
+
+/* Define to 1 if you have the `dup3' function. */
+#define HAVE_DUP3 1
+
+/* Define if you have the '_dyld_shared_cache_contains_path' function. */
+/* #undef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH */
+
+/* Defined when any dynamic module loading is enabled. */
+#define HAVE_DYNAMIC_LOADING 1
+
+/* Define to 1 if you have the <editline/readline.h> header file. */
+/* #undef HAVE_EDITLINE_READLINE_H */
+
+/* Define to 1 if you have the <endian.h> header file. */
+#define HAVE_ENDIAN_H 1
+
+/* Define if you have the 'epoll_create' function. */
+#define HAVE_EPOLL 1
+
+/* Define if you have the 'epoll_create1' function. */
+#define HAVE_EPOLL_CREATE1 1
+
+/* Define to 1 if you have the `erf' function. */
+#define HAVE_ERF 1
+
+/* Define to 1 if you have the `erfc' function. */
+#define HAVE_ERFC 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define if you have the 'eventfd' function. */
+#define HAVE_EVENTFD 1
+
+/* Define to 1 if you have the `execv' function. */
+#define HAVE_EXECV 1
+
+/* Define to 1 if you have the `explicit_bzero' function. */
+#define HAVE_EXPLICIT_BZERO 1
+
+/* Define to 1 if you have the `explicit_memset' function. */
+/* #undef HAVE_EXPLICIT_MEMSET */
+
+/* Define to 1 if you have the `expm1' function. */
+#define HAVE_EXPM1 1
+
+/* Define to 1 if you have the `faccessat' function. */
+#define HAVE_FACCESSAT 1
+
+/* Define if you have the 'fchdir' function. */
+#define HAVE_FCHDIR 1
+
+/* Define to 1 if you have the `fchmod' function. */
+#define HAVE_FCHMOD 1
+
+/* Define to 1 if you have the `fchmodat' function. */
+#define HAVE_FCHMODAT 1
+
+/* Define to 1 if you have the `fchown' function. */
+#define HAVE_FCHOWN 1
+
+/* Define to 1 if you have the `fchownat' function. */
+#define HAVE_FCHOWNAT 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define if you have the 'fdatasync' function. */
+#define HAVE_FDATASYNC 1
+
+/* Define to 1 if you have the `fdopendir' function. */
+#define HAVE_FDOPENDIR 1
+
+/* Define to 1 if you have the `fdwalk' function. */
+/* #undef HAVE_FDWALK */
+
+/* Define to 1 if you have the `fexecve' function. */
+#define HAVE_FEXECVE 1
+
+/* Define if you have the 'ffi_closure_alloc' function. */
+#define HAVE_FFI_CLOSURE_ALLOC 1
+
+/* Define if you have the 'ffi_prep_cif_var' function. */
+#define HAVE_FFI_PREP_CIF_VAR 1
+
+/* Define if you have the 'ffi_prep_closure_loc' function. */
+#define HAVE_FFI_PREP_CLOSURE_LOC 1
+
+/* Define to 1 if you have the `flock' function. */
+#define HAVE_FLOCK 1
+
+/* Define to 1 if you have the `fork' function. */
+#define HAVE_FORK 1
+
+/* Define to 1 if you have the `fork1' function. */
+/* #undef HAVE_FORK1 */
+
+/* Define to 1 if you have the `forkpty' function. */
+/* #undef HAVE_FORKPTY */
+
+/* Define to 1 if you have the `fpathconf' function. */
+#define HAVE_FPATHCONF 1
+
+/* Define to 1 if you have the `fseek64' function. */
+/* #undef HAVE_FSEEK64 */
+
+/* Define to 1 if you have the `fseeko' function. */
+#define HAVE_FSEEKO 1
+
+/* Define to 1 if you have the `fstatat' function. */
+#define HAVE_FSTATAT 1
+
+/* Define to 1 if you have the `fstatvfs' function. */
+#define HAVE_FSTATVFS 1
+
+/* Define if you have the 'fsync' function. */
+#define HAVE_FSYNC 1
+
+/* Define to 1 if you have the `ftell64' function. */
+/* #undef HAVE_FTELL64 */
+
+/* Define to 1 if you have the `ftello' function. */
+#define HAVE_FTELLO 1
+
+/* Define to 1 if you have the `ftime' function. */
+#define HAVE_FTIME 1
+
+/* Define to 1 if you have the `ftruncate' function. */
+#define HAVE_FTRUNCATE 1
+
+/* Define to 1 if you have the `futimens' function. */
+#define HAVE_FUTIMENS 1
+
+/* Define to 1 if you have the `futimes' function. */
+#define HAVE_FUTIMES 1
+
+/* Define to 1 if you have the `futimesat' function. */
+#define HAVE_FUTIMESAT 1
+
+/* Define to 1 if you have the `gai_strerror' function. */
+#define HAVE_GAI_STRERROR 1
+
+/* Define if we can use gcc inline assembler to get and set mc68881 fpcr */
+/* #undef HAVE_GCC_ASM_FOR_MC68881 */
+
+/* Define if we can use x64 gcc inline assembler */
+#define HAVE_GCC_ASM_FOR_X64 1
+
+/* Define if we can use gcc inline assembler to get and set x87 control word
+ */
+#if defined(__x86_64__) || defined(__i386__)
+#define HAVE_GCC_ASM_FOR_X87 1
+#endif
+
+/* Define if your compiler provides __uint128_t */
+#define HAVE_GCC_UINT128_T 1
+
+/* Define to 1 if you have the <gdbm-ndbm.h> header file. */
+/* #undef HAVE_GDBM_DASH_NDBM_H */
+
+/* Define to 1 if you have the <gdbm.h> header file. */
+/* #undef HAVE_GDBM_H */
+
+/* Define to 1 if you have the <gdbm/ndbm.h> header file. */
+/* #undef HAVE_GDBM_NDBM_H */
+
+/* Define if you have the getaddrinfo function. */
+#define HAVE_GETADDRINFO 1
+
+/* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
+#define HAVE_GETC_UNLOCKED 1
+
+/* Define to 1 if you have the `getegid' function. */
+#define HAVE_GETEGID 1
+
+/* Define to 1 if you have the `getentropy' function. */
+#define HAVE_GETENTROPY 1
+
+/* Define to 1 if you have the `geteuid' function. */
+#define HAVE_GETEUID 1
+
+/* Define to 1 if you have the `getgid' function. */
+#define HAVE_GETGID 1
+
+/* Define to 1 if you have the `getgrgid' function. */
+#define HAVE_GETGRGID 1
+
+/* Define to 1 if you have the `getgrgid_r' function. */
+#define HAVE_GETGRGID_R 1
+
+/* Define to 1 if you have the `getgrnam_r' function. */
+#define HAVE_GETGRNAM_R 1
+
+/* Define to 1 if you have the `getgrouplist' function. */
+#define HAVE_GETGROUPLIST 1
+
+/* Define to 1 if you have the `getgroups' function. */
+#define HAVE_GETGROUPS 1
+
+/* Define if you have the 'gethostbyaddr' function. */
+#define HAVE_GETHOSTBYADDR 1
+
+/* Define to 1 if you have the `gethostbyname' function. */
+#define HAVE_GETHOSTBYNAME 1
+
+/* Define this if you have some version of gethostbyname_r() */
+#define HAVE_GETHOSTBYNAME_R 1
+
+/* Define this if you have the 3-arg version of gethostbyname_r(). */
+/* #undef HAVE_GETHOSTBYNAME_R_3_ARG */
+
+/* Define this if you have the 5-arg version of gethostbyname_r(). */
+/* #undef HAVE_GETHOSTBYNAME_R_5_ARG */
+
+/* Define this if you have the 6-arg version of gethostbyname_r(). */
+#define HAVE_GETHOSTBYNAME_R_6_ARG 1
+
+/* Define to 1 if you have the `gethostname' function. */
+#define HAVE_GETHOSTNAME 1
+
+/* Define to 1 if you have the `getitimer' function. */
+#define HAVE_GETITIMER 1
+
+/* Define to 1 if you have the `getloadavg' function. */
+#define HAVE_GETLOADAVG 1
+
+/* Define to 1 if you have the `getlogin' function. */
+#define HAVE_GETLOGIN 1
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#define HAVE_GETNAMEINFO 1
+
+/* Define if you have the 'getpagesize' function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define if you have the 'getpeername' function. */
+#define HAVE_GETPEERNAME 1
+
+/* Define to 1 if you have the `getpgid' function. */
+#define HAVE_GETPGID 1
+
+/* Define to 1 if you have the `getpgrp' function. */
+#define HAVE_GETPGRP 1
+
+/* Define to 1 if you have the `getpid' function. */
+#define HAVE_GETPID 1
+
+/* Define to 1 if you have the `getppid' function. */
+#define HAVE_GETPPID 1
+
+/* Define to 1 if you have the `getpriority' function. */
+#define HAVE_GETPRIORITY 1
+
+/* Define if you have the 'getprotobyname' function. */
+#define HAVE_GETPROTOBYNAME 1
+
+/* Define to 1 if you have the `getpwent' function. */
+#define HAVE_GETPWENT 1
+
+/* Define to 1 if you have the `getpwnam_r' function. */
+#define HAVE_GETPWNAM_R 1
+
+/* Define to 1 if you have the `getpwuid' function. */
+#define HAVE_GETPWUID 1
+
+/* Define to 1 if you have the `getpwuid_r' function. */
+#define HAVE_GETPWUID_R 1
+
+/* Define to 1 if the getrandom() function is available */
+#define HAVE_GETRANDOM 1
+
+/* Define to 1 if the Linux getrandom() syscall is available */
+#define HAVE_GETRANDOM_SYSCALL 1
+
+/* Define to 1 if you have the `getresgid' function. */
+#define HAVE_GETRESGID 1
+
+/* Define to 1 if you have the `getresuid' function. */
+#define HAVE_GETRESUID 1
+
+/* Define to 1 if you have the `getrusage' function. */
+#define HAVE_GETRUSAGE 1
+
+/* Define if you have the 'getservbyname' function. */
+#define HAVE_GETSERVBYNAME 1
+
+/* Define if you have the 'getservbyport' function. */
+#define HAVE_GETSERVBYPORT 1
+
+/* Define to 1 if you have the `getsid' function. */
+#define HAVE_GETSID 1
+
+/* Define if you have the 'getsockname' function. */
+#define HAVE_GETSOCKNAME 1
+
+/* Define to 1 if you have the `getspent' function. */
+#define HAVE_GETSPENT 1
+
+/* Define to 1 if you have the `getspnam' function. */
+#define HAVE_GETSPNAM 1
+
+/* Define to 1 if you have the `getuid' function. */
+#define HAVE_GETUID 1
+
+/* Define to 1 if you have the `getwd' function. */
+#define HAVE_GETWD 1
+
+/* Define if glibc has incorrect _FORTIFY_SOURCE wrappers for memmove and
+ bcopy. */
+/* #undef HAVE_GLIBC_MEMMOVE_BUG */
+
+/* Define to 1 if you have the <grp.h> header file. */
+#define HAVE_GRP_H 1
+
+/* Define if you have the 'hstrerror' function. */
+#define HAVE_HSTRERROR 1
+
+/* Define this if you have le64toh() */
+#define HAVE_HTOLE64 1
+
+/* Define to 1 if you have the <ieeefp.h> header file. */
+/* #undef HAVE_IEEEFP_H */
+
+/* Define to 1 if you have the `if_nameindex' function. */
+#define HAVE_IF_NAMEINDEX 1
+
+/* Define if you have the 'inet_aton' function. */
+#define HAVE_INET_ATON 1
+
+/* Define if you have the 'inet_ntoa' function. */
+#define HAVE_INET_NTOA 1
+
+/* Define if you have the 'inet_pton' function. */
+#define HAVE_INET_PTON 1
+
+/* Define to 1 if you have the `initgroups' function. */
+#define HAVE_INITGROUPS 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <io.h> header file. */
+/* #undef HAVE_IO_H */
+
+/* Define if gcc has the ipa-pure-const bug. */
+/* #undef HAVE_IPA_PURE_CONST_BUG */
+
+/* Define to 1 if you have the `kill' function. */
+#define HAVE_KILL 1
+
+/* Define to 1 if you have the `killpg' function. */
+#define HAVE_KILLPG 1
+
+/* Define if you have the 'kqueue' function. */
+/* #undef HAVE_KQUEUE */
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+#define HAVE_LANGINFO_H 1
+
+/* Defined to enable large file support when an off_t is bigger than a long
+ and long long is at least as big as an off_t. You may need to add some
+ flags for configuration and compilation to enable this mode. (For Solaris
+ and Linux, the necessary defines are already defined.) */
+/* #undef HAVE_LARGEFILE_SUPPORT */
+
+/* Define to 1 if you have the 'lchflags' function. */
+/* #undef HAVE_LCHFLAGS */
+
+/* Define to 1 if you have the `lchmod' function. */
+/* #undef HAVE_LCHMOD */
+
+/* Define to 1 if you have the `lchown' function. */
+#define HAVE_LCHOWN 1
+
+/* Define to 1 if you want to build _blake2 module with libb2 */
+/* #undef HAVE_LIBB2 */
+
+/* Define to 1 if you have the `db' library (-ldb). */
+/* #undef HAVE_LIBDB */
+
+/* Define to 1 if you have the `dl' library (-ldl). */
+#define HAVE_LIBDL 1
+
+/* Define to 1 if you have the `dld' library (-ldld). */
+/* #undef HAVE_LIBDLD */
+
+/* Define to 1 if you have the `ieee' library (-lieee). */
+/* #undef HAVE_LIBIEEE */
+
+/* Define to 1 if you have the <libintl.h> header file. */
+#define HAVE_LIBINTL_H 1
+
+/* Define to 1 if you have the `resolv' library (-lresolv). */
+/* #undef HAVE_LIBRESOLV */
+
+/* Define to 1 if you have the `sendfile' library (-lsendfile). */
+/* #undef HAVE_LIBSENDFILE */
+
+/* Define to 1 if you have the `sqlite3' library (-lsqlite3). */
+#define HAVE_LIBSQLITE3 1
+
+/* Define to 1 if you have the <libutil.h> header file. */
+/* #undef HAVE_LIBUTIL_H */
+
+/* Define if you have the 'link' function. */
+#define HAVE_LINK 1
+
+/* Define to 1 if you have the `linkat' function. */
+#define HAVE_LINKAT 1
+
+/* Define to 1 if you have the <linux/auxvec.h> header file. */
+#define HAVE_LINUX_AUXVEC_H 1
+
+/* Define to 1 if you have the <linux/can/bcm.h> header file. */
+#define HAVE_LINUX_CAN_BCM_H 1
+
+/* Define to 1 if you have the <linux/can.h> header file. */
+#define HAVE_LINUX_CAN_H 1
+
+/* Define to 1 if you have the <linux/can/j1939.h> header file. */
+#define HAVE_LINUX_CAN_J1939_H 1
+
+/* Define if compiling using Linux 3.6 or later. */
+#define HAVE_LINUX_CAN_RAW_FD_FRAMES 1
+
+/* Define to 1 if you have the <linux/can/raw.h> header file. */
+#define HAVE_LINUX_CAN_RAW_H 1
+
+/* Define if compiling using Linux 4.1 or later. */
+#define HAVE_LINUX_CAN_RAW_JOIN_FILTERS 1
+
+/* Define to 1 if you have the <linux/fs.h> header file. */
+#define HAVE_LINUX_FS_H 1
+
+/* Define to 1 if you have the <linux/limits.h> header file. */
+#define HAVE_LINUX_LIMITS_H 1
+
+/* Define to 1 if you have the <linux/memfd.h> header file. */
+#define HAVE_LINUX_MEMFD_H 1
+
+/* Define to 1 if you have the <linux/netlink.h> header file. */
+#define HAVE_LINUX_NETLINK_H 1
+
+/* Define to 1 if you have the <linux/qrtr.h> header file. */
+#define HAVE_LINUX_QRTR_H 1
+
+/* Define to 1 if you have the <linux/random.h> header file. */
+#define HAVE_LINUX_RANDOM_H 1
+
+/* Define to 1 if you have the <linux/soundcard.h> header file. */
+#define HAVE_LINUX_SOUNDCARD_H 1
+
+/* Define to 1 if you have the <linux/tipc.h> header file. */
+#define HAVE_LINUX_TIPC_H 1
+
+/* Define to 1 if you have the <linux/vm_sockets.h> header file. */
+#define HAVE_LINUX_VM_SOCKETS_H 1
+
+/* Define to 1 if you have the <linux/wait.h> header file. */
+#define HAVE_LINUX_WAIT_H 1
+
+/* Define if you have the 'listen' function. */
+#define HAVE_LISTEN 1
+
+/* Define to 1 if you have the `lockf' function. */
+#define HAVE_LOCKF 1
+
+/* Define to 1 if you have the `log1p' function. */
+#define HAVE_LOG1P 1
+
+/* Define to 1 if you have the `log2' function. */
+#define HAVE_LOG2 1
+
+/* Define to 1 if you have the `login_tty' function. */
+/* #undef HAVE_LOGIN_TTY */
+
+/* Define to 1 if the system has the type `long double'. */
+#define HAVE_LONG_DOUBLE 1
+
+/* Define to 1 if you have the `lstat' function. */
+#define HAVE_LSTAT 1
+
+/* Define to 1 if you have the `lutimes' function. */
+#define HAVE_LUTIMES 1
+
+/* Define to 1 if you have the <lzma.h> header file. */
+/* #undef HAVE_LZMA_H */
+
+/* Define to 1 if you have the `madvise' function. */
+#define HAVE_MADVISE 1
+
+/* Define this if you have the makedev macro. */
+#define HAVE_MAKEDEV 1
+
+/* Define to 1 if you have the `mbrtowc' function. */
+#define HAVE_MBRTOWC 1
+
+/* Define if you have the 'memfd_create' function. */
+#define HAVE_MEMFD_CREATE 1
+
+/* Define to 1 if you have the `memrchr' function. */
+#define HAVE_MEMRCHR 1
+
+/* Define to 1 if you have the <minix/config.h> header file. */
+/* #undef HAVE_MINIX_CONFIG_H */
+
+/* Define to 1 if you have the `mkdirat' function. */
+#define HAVE_MKDIRAT 1
+
+/* Define to 1 if you have the `mkfifo' function. */
+#define HAVE_MKFIFO 1
+
+/* Define to 1 if you have the `mkfifoat' function. */
+#define HAVE_MKFIFOAT 1
+
+/* Define to 1 if you have the `mknod' function. */
+#define HAVE_MKNOD 1
+
+/* Define to 1 if you have the `mknodat' function. */
+#define HAVE_MKNODAT 1
+
+/* Define to 1 if you have the `mktime' function. */
+#define HAVE_MKTIME 1
+
+/* Define to 1 if you have the `mmap' function. */
+#define HAVE_MMAP 1
+
+/* Define to 1 if you have the `mremap' function. */
+#define HAVE_MREMAP 1
+
+/* Define to 1 if you have the `nanosleep' function. */
+#define HAVE_NANOSLEEP 1
+
+/* Define to 1 if you have the `ncursesw' library. */
+#define HAVE_NCURSESW 1
+
+/* Define to 1 if you have the <ncurses.h> header file. */
+#define HAVE_NCURSES_H 1
+
+/* Define to 1 if you have the <ndbm.h> header file. */
+/* #undef HAVE_NDBM_H */
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the <netcan/can.h> header file. */
+/* #undef HAVE_NETCAN_CAN_H */
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#define HAVE_NETDB_H 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <netpacket/packet.h> header file. */
+#define HAVE_NETPACKET_PACKET_H 1
+
+/* Define to 1 if you have the <net/ethernet.h> header file. */
+#define HAVE_NET_ETHERNET_H 1
+
+/* Define to 1 if you have the <net/if.h> header file. */
+#define HAVE_NET_IF_H 1
+
+/* Define to 1 if you have the `nice' function. */
+#define HAVE_NICE 1
+
+/* Define if the internal form of wchar_t in non-Unicode locales is not
+ Unicode. */
+/* #undef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION */
+
+/* Define to 1 if you have the `openat' function. */
+#define HAVE_OPENAT 1
+
+/* Define to 1 if you have the `opendir' function. */
+#define HAVE_OPENDIR 1
+
+/* Define to 1 if you have the `openpty' function. */
+/* #undef HAVE_OPENPTY */
+
+/* Define to 1 if you have the <panel.h> header file. */
+#define HAVE_PANEL_H 1
+
+/* Define to 1 if you have the `pathconf' function. */
+#define HAVE_PATHCONF 1
+
+/* Define to 1 if you have the `pause' function. */
+#define HAVE_PAUSE 1
+
+/* Define to 1 if you have the `pipe' function. */
+#define HAVE_PIPE 1
+
+/* Define to 1 if you have the `pipe2' function. */
+#define HAVE_PIPE2 1
+
+/* Define to 1 if you have the `plock' function. */
+/* #undef HAVE_PLOCK */
+
+/* Define to 1 if you have the `poll' function. */
+#define HAVE_POLL 1
+
+/* Define to 1 if you have the <poll.h> header file. */
+#define HAVE_POLL_H 1
+
+/* Define to 1 if you have the `posix_fadvise' function. */
+#define HAVE_POSIX_FADVISE 1
+
+/* Define to 1 if you have the `posix_fallocate' function. */
+#define HAVE_POSIX_FALLOCATE 1
+
+/* Define to 1 if you have the `posix_spawn' function. */
+#define HAVE_POSIX_SPAWN 1
+
+/* Define to 1 if you have the `posix_spawnp' function. */
+#define HAVE_POSIX_SPAWNP 1
+
+/* Define to 1 if you have the `pread' function. */
+#define HAVE_PREAD 1
+
+/* Define to 1 if you have the `preadv' function. */
+#define HAVE_PREADV 1
+
+/* Define to 1 if you have the `preadv2' function. */
+/* #undef HAVE_PREADV2 */
+
+/* Define if you have the 'prlimit' function. */
+#define HAVE_PRLIMIT 1
+
+/* Define to 1 if you have the <process.h> header file. */
+/* #undef HAVE_PROCESS_H */
+
+/* Define if your compiler supports function prototype */
+#define HAVE_PROTOTYPES 1
+
+/* Define to 1 if you have the `pthread_condattr_setclock' function. */
+#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
+
+/* Defined for Solaris 2.6 bug in pthread header. */
+/* #undef HAVE_PTHREAD_DESTRUCTOR */
+
+/* Define to 1 if you have the `pthread_getcpuclockid' function. */
+#define HAVE_PTHREAD_GETCPUCLOCKID 1
+
+/* Define to 1 if you have the <pthread.h> header file. */
+#define HAVE_PTHREAD_H 1
+
+/* Define to 1 if you have the `pthread_init' function. */
+/* #undef HAVE_PTHREAD_INIT */
+
+/* Define to 1 if you have the `pthread_kill' function. */
+#define HAVE_PTHREAD_KILL 1
+
+/* Define to 1 if you have the `pthread_sigmask' function. */
+#define HAVE_PTHREAD_SIGMASK 1
+
+/* Define if platform requires stubbed pthreads support */
+/* #undef HAVE_PTHREAD_STUBS */
+
+/* Define to 1 if you have the <pty.h> header file. */
+#define HAVE_PTY_H 1
+
+/* Define to 1 if you have the `pwrite' function. */
+#define HAVE_PWRITE 1
+
+/* Define to 1 if you have the `pwritev' function. */
+#define HAVE_PWRITEV 1
+
+/* Define to 1 if you have the `pwritev2' function. */
+/* #undef HAVE_PWRITEV2 */
+
+/* Define to 1 if you have the <readline/readline.h> header file. */
+/* #undef HAVE_READLINE_READLINE_H */
+
+/* Define to 1 if you have the `readlink' function. */
+#define HAVE_READLINK 1
+
+/* Define to 1 if you have the `readlinkat' function. */
+#define HAVE_READLINKAT 1
+
+/* Define to 1 if you have the `readv' function. */
+#define HAVE_READV 1
+
+/* Define to 1 if you have the `realpath' function. */
+#define HAVE_REALPATH 1
+
+/* Define if you have the 'recvfrom' function. */
+#define HAVE_RECVFROM 1
+
+/* Define to 1 if you have the `renameat' function. */
+#define HAVE_RENAMEAT 1
+
+/* Define if readline supports append_history */
+/* #undef HAVE_RL_APPEND_HISTORY */
+
+/* Define if you can turn off readline's signal handling. */
+/* #undef HAVE_RL_CATCH_SIGNAL */
+
+/* Define if readline supports rl_compdisp_func_t */
+/* #undef HAVE_RL_COMPDISP_FUNC_T */
+
+/* Define if you have readline 2.2 */
+/* #undef HAVE_RL_COMPLETION_APPEND_CHARACTER */
+
+/* Define if you have readline 4.0 */
+/* #undef HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK */
+
+/* Define if you have readline 4.2 */
+/* #undef HAVE_RL_COMPLETION_MATCHES */
+
+/* Define if you have rl_completion_suppress_append */
+/* #undef HAVE_RL_COMPLETION_SUPPRESS_APPEND */
+
+/* Define if you have readline 4.0 */
+/* #undef HAVE_RL_PRE_INPUT_HOOK */
+
+/* Define if you have readline 4.0 */
+/* #undef HAVE_RL_RESIZE_TERMINAL */
+
+/* Define to 1 if you have the <rpc/rpc.h> header file. */
+#define HAVE_RPC_RPC_H 1
+
+/* Define to 1 if you have the `rtpSpawn' function. */
+/* #undef HAVE_RTPSPAWN */
+
+/* Define to 1 if you have the `sched_get_priority_max' function. */
+#define HAVE_SCHED_GET_PRIORITY_MAX 1
+
+/* Define to 1 if you have the <sched.h> header file. */
+#define HAVE_SCHED_H 1
+
+/* Define to 1 if you have the `sched_rr_get_interval' function. */
+#define HAVE_SCHED_RR_GET_INTERVAL 1
+
+/* Define to 1 if you have the `sched_setaffinity' function. */
+#define HAVE_SCHED_SETAFFINITY 1
+
+/* Define to 1 if you have the `sched_setparam' function. */
+#define HAVE_SCHED_SETPARAM 1
+
+/* Define to 1 if you have the `sched_setscheduler' function. */
+#define HAVE_SCHED_SETSCHEDULER 1
+
+/* Define to 1 if you have the `sem_clockwait' function. */
+/* #undef HAVE_SEM_CLOCKWAIT */
+
+/* Define to 1 if you have the `sem_getvalue' function. */
+#define HAVE_SEM_GETVALUE 1
+
+/* Define to 1 if you have the `sem_open' function. */
+#define HAVE_SEM_OPEN 1
+
+/* Define to 1 if you have the `sem_timedwait' function. */
+#define HAVE_SEM_TIMEDWAIT 1
+
+/* Define to 1 if you have the `sem_unlink' function. */
+#define HAVE_SEM_UNLINK 1
+
+/* Define to 1 if you have the `sendfile' function. */
+#define HAVE_SENDFILE 1
+
+/* Define if you have the 'sendto' function. */
+#define HAVE_SENDTO 1
+
+/* Define to 1 if you have the `setegid' function. */
+#define HAVE_SETEGID 1
+
+/* Define to 1 if you have the `seteuid' function. */
+#define HAVE_SETEUID 1
+
+/* Define to 1 if you have the `setgid' function. */
+#define HAVE_SETGID 1
+
+/* Define if you have the 'setgroups' function. */
+#define HAVE_SETGROUPS 1
+
+/* Define to 1 if you have the `sethostname' function. */
+#define HAVE_SETHOSTNAME 1
+
+/* Define to 1 if you have the `setitimer' function. */
+#define HAVE_SETITIMER 1
+
+/* Define to 1 if you have the <setjmp.h> header file. */
+#define HAVE_SETJMP_H 1
+
+/* Define to 1 if you have the `setlocale' function. */
+#define HAVE_SETLOCALE 1
+
+/* Define to 1 if you have the `setns' function. */
+#define HAVE_SETNS 1
+
+/* Define to 1 if you have the `setpgid' function. */
+#define HAVE_SETPGID 1
+
+/* Define to 1 if you have the `setpgrp' function. */
+#define HAVE_SETPGRP 1
+
+/* Define to 1 if you have the `setpriority' function. */
+#define HAVE_SETPRIORITY 1
+
+/* Define to 1 if you have the `setregid' function. */
+#define HAVE_SETREGID 1
+
+/* Define to 1 if you have the `setresgid' function. */
+#define HAVE_SETRESGID 1
+
+/* Define to 1 if you have the `setresuid' function. */
+#define HAVE_SETRESUID 1
+
+/* Define to 1 if you have the `setreuid' function. */
+#define HAVE_SETREUID 1
+
+/* Define to 1 if you have the `setsid' function. */
+#define HAVE_SETSID 1
+
+/* Define if you have the 'setsockopt' function. */
+#define HAVE_SETSOCKOPT 1
+
+/* Define to 1 if you have the `setuid' function. */
+#define HAVE_SETUID 1
+
+/* Define to 1 if you have the `setvbuf' function. */
+#define HAVE_SETVBUF 1
+
+/* Define to 1 if you have the <shadow.h> header file. */
+#define HAVE_SHADOW_H 1
+
+/* Define to 1 if you have the `shm_open' function. */
+#define HAVE_SHM_OPEN 1
+
+/* Define to 1 if you have the `shm_unlink' function. */
+#define HAVE_SHM_UNLINK 1
+
+/* Define to 1 if you have the `shutdown' function. */
+#define HAVE_SHUTDOWN 1
+
+/* Define to 1 if you have the `sigaction' function. */
+#define HAVE_SIGACTION 1
+
+/* Define to 1 if you have the `sigaltstack' function. */
+#define HAVE_SIGALTSTACK 1
+
+/* Define to 1 if you have the `sigfillset' function. */
+#define HAVE_SIGFILLSET 1
+
+/* Define to 1 if `si_band' is a member of `siginfo_t'. */
+#define HAVE_SIGINFO_T_SI_BAND 1
+
+/* Define to 1 if you have the `siginterrupt' function. */
+#define HAVE_SIGINTERRUPT 1
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the `sigpending' function. */
+#define HAVE_SIGPENDING 1
+
+/* Define to 1 if you have the `sigrelse' function. */
+#define HAVE_SIGRELSE 1
+
+/* Define to 1 if you have the `sigtimedwait' function. */
+#define HAVE_SIGTIMEDWAIT 1
+
+/* Define to 1 if you have the `sigwait' function. */
+#define HAVE_SIGWAIT 1
+
+/* Define to 1 if you have the `sigwaitinfo' function. */
+#define HAVE_SIGWAITINFO 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* struct sockaddr_alg (linux/if_alg.h) */
+#define HAVE_SOCKADDR_ALG 1
+
+/* Define if sockaddr has sa_len member */
+/* #undef HAVE_SOCKADDR_SA_LEN */
+
+/* struct sockaddr_storage (sys/socket.h) */
+#define HAVE_SOCKADDR_STORAGE 1
+
+/* Define if you have the 'socket' function. */
+#define HAVE_SOCKET 1
+
+/* Define if you have the 'socketpair' function. */
+#define HAVE_SOCKETPAIR 1
+
+/* Define to 1 if you have the <spawn.h> header file. */
+#define HAVE_SPAWN_H 1
+
+/* Define to 1 if you have the `splice' function. */
+#define HAVE_SPLICE 1
+
+/* Define if your compiler provides ssize_t */
+#define HAVE_SSIZE_T 1
+
+/* Define to 1 if you have the `statvfs' function. */
+#define HAVE_STATVFS 1
+
+/* Define if you have struct stat.st_mtim.tv_nsec */
+#define HAVE_STAT_TV_NSEC 1
+
+/* Define if you have struct stat.st_mtimensec */
+/* #undef HAVE_STAT_TV_NSEC2 */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#define HAVE_STDIO_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Has stdatomic.h with atomic_int and atomic_uintptr_t */
+#define HAVE_STD_ATOMIC 1
+
+/* Define to 1 if you have the `strftime' function. */
+#define HAVE_STRFTIME 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+/* #undef HAVE_STRLCPY */
+
+/* Define to 1 if you have the <stropts.h> header file. */
+/* #undef HAVE_STROPTS_H */
+
+/* Define to 1 if you have the `strsignal' function. */
+#define HAVE_STRSIGNAL 1
+
+/* Define to 1 if `pw_gecos' is a member of `struct passwd'. */
+#define HAVE_STRUCT_PASSWD_PW_GECOS 1
+
+/* Define to 1 if `pw_passwd' is a member of `struct passwd'. */
+#define HAVE_STRUCT_PASSWD_PW_PASSWD 1
+
+/* Define to 1 if `st_birthtime' is a member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_BIRTHTIME */
+
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+
+/* Define to 1 if `st_blocks' is a member of `struct stat'. */
+#define HAVE_STRUCT_STAT_ST_BLOCKS 1
+
+/* Define to 1 if `st_flags' is a member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_FLAGS */
+
+/* Define to 1 if `st_gen' is a member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_GEN */
+
+/* Define to 1 if `st_rdev' is a member of `struct stat'. */
+#define HAVE_STRUCT_STAT_ST_RDEV 1
+
+/* Define to 1 if `tm_zone' is a member of `struct tm'. */
+#define HAVE_STRUCT_TM_TM_ZONE 1
+
+/* Define if you have the 'symlink' function. */
+#define HAVE_SYMLINK 1
+
+/* Define to 1 if you have the `symlinkat' function. */
+#define HAVE_SYMLINKAT 1
+
+/* Define to 1 if you have the `sync' function. */
+#define HAVE_SYNC 1
+
+/* Define to 1 if you have the `sysconf' function. */
+#define HAVE_SYSCONF 1
+
+/* Define to 1 if you have the <sysexits.h> header file. */
+#define HAVE_SYSEXITS_H 1
+
+/* Define to 1 if you have the <syslog.h> header file. */
+#define HAVE_SYSLOG_H 1
+
+/* Define to 1 if you have the `system' function. */
+#define HAVE_SYSTEM 1
+
+/* Define to 1 if you have the <sys/audioio.h> header file. */
+/* #undef HAVE_SYS_AUDIOIO_H */
+
+/* Define to 1 if you have the <sys/auxv.h> header file. */
+#define HAVE_SYS_AUXV_H 1
+
+/* Define to 1 if you have the <sys/bsdtty.h> header file. */
+/* #undef HAVE_SYS_BSDTTY_H */
+
+/* Define to 1 if you have the <sys/devpoll.h> header file. */
+/* #undef HAVE_SYS_DEVPOLL_H */
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/endian.h> header file. */
+/* #undef HAVE_SYS_ENDIAN_H */
+
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+#define HAVE_SYS_EPOLL_H 1
+
+/* Define to 1 if you have the <sys/eventfd.h> header file. */
+#define HAVE_SYS_EVENTFD_H 1
+
+/* Define to 1 if you have the <sys/event.h> header file. */
+/* #undef HAVE_SYS_EVENT_H */
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+#define HAVE_SYS_FILE_H 1
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/kern_control.h> header file. */
+/* #undef HAVE_SYS_KERN_CONTROL_H */
+
+/* Define to 1 if you have the <sys/loadavg.h> header file. */
+/* #undef HAVE_SYS_LOADAVG_H */
+
+/* Define to 1 if you have the <sys/lock.h> header file. */
+/* #undef HAVE_SYS_LOCK_H */
+
+/* Define to 1 if you have the <sys/memfd.h> header file. */
+/* #undef HAVE_SYS_MEMFD_H */
+
+/* Define to 1 if you have the <sys/mkdev.h> header file. */
+/* #undef HAVE_SYS_MKDEV_H */
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#define HAVE_SYS_MMAN_H 1
+
+/* Define to 1 if you have the <sys/modem.h> header file. */
+/* #undef HAVE_SYS_MODEM_H */
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#define HAVE_SYS_POLL_H 1
+
+/* Define to 1 if you have the <sys/random.h> header file. */
+#define HAVE_SYS_RANDOM_H 1
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#define HAVE_SYS_RESOURCE_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#define HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/sendfile.h> header file. */
+#define HAVE_SYS_SENDFILE_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/soundcard.h> header file. */
+#define HAVE_SYS_SOUNDCARD_H 1
+
+/* Define to 1 if you have the <sys/statvfs.h> header file. */
+#define HAVE_SYS_STATVFS_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/syscall.h> header file. */
+#define HAVE_SYS_SYSCALL_H 1
+
+/* Define to 1 if you have the <sys/sysmacros.h> header file. */
+#define HAVE_SYS_SYSMACROS_H 1
+
+/* Define to 1 if you have the <sys/sys_domain.h> header file. */
+/* #undef HAVE_SYS_SYS_DOMAIN_H */
+
+/* Define to 1 if you have the <sys/termio.h> header file. */
+/* #undef HAVE_SYS_TERMIO_H */
+
+/* Define to 1 if you have the <sys/times.h> header file. */
+#define HAVE_SYS_TIMES_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#define HAVE_SYS_UIO_H 1
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#define HAVE_SYS_UN_H 1
+
+/* Define to 1 if you have the <sys/utsname.h> header file. */
+#define HAVE_SYS_UTSNAME_H 1
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define to 1 if you have the <sys/xattr.h> header file. */
+#define HAVE_SYS_XATTR_H 1
+
+/* Define to 1 if you have the `tcgetpgrp' function. */
+#define HAVE_TCGETPGRP 1
+
+/* Define to 1 if you have the `tcsetpgrp' function. */
+#define HAVE_TCSETPGRP 1
+
+/* Define to 1 if you have the `tempnam' function. */
+#define HAVE_TEMPNAM 1
+
+/* Define to 1 if you have the <termios.h> header file. */
+#define HAVE_TERMIOS_H 1
+
+/* Define to 1 if you have the <term.h> header file. */
+#define HAVE_TERM_H 1
+
+/* Define to 1 if you have the `timegm' function. */
+#define HAVE_TIMEGM 1
+
+/* Define to 1 if you have the `times' function. */
+#define HAVE_TIMES 1
+
+/* Define to 1 if you have the `tmpfile' function. */
+#define HAVE_TMPFILE 1
+
+/* Define to 1 if you have the `tmpnam' function. */
+#define HAVE_TMPNAM 1
+
+/* Define to 1 if you have the `tmpnam_r' function. */
+#define HAVE_TMPNAM_R 1
+
+/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
+ `HAVE_STRUCT_TM_TM_ZONE' instead. */
+#define HAVE_TM_ZONE 1
+
+/* Define to 1 if you have the `truncate' function. */
+#define HAVE_TRUNCATE 1
+
+/* Define to 1 if you have the `ttyname' function. */
+#define HAVE_TTYNAME 1
+
+/* Define to 1 if you don't have `tm_zone' but do have the external array
+ `tzname'. */
+/* #undef HAVE_TZNAME */
+
+/* Define to 1 if you have the `umask' function. */
+#define HAVE_UMASK 1
+
+/* Define to 1 if you have the `uname' function. */
+#define HAVE_UNAME 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `unlinkat' function. */
+#define HAVE_UNLINKAT 1
+
+/* Define to 1 if you have the `unshare' function. */
+#define HAVE_UNSHARE 1
+
+/* Define if you have a useable wchar_t type defined in wchar.h; useable means
+ wchar_t must be an unsigned type with at least 16 bits. (see
+ Include/unicodeobject.h). */
+/* #undef HAVE_USABLE_WCHAR_T */
+
+/* Define to 1 if you have the <util.h> header file. */
+/* #undef HAVE_UTIL_H */
+
+/* Define to 1 if you have the `utimensat' function. */
+#define HAVE_UTIMENSAT 1
+
+/* Define to 1 if you have the `utimes' function. */
+#define HAVE_UTIMES 1
+
+/* Define to 1 if you have the <utime.h> header file. */
+#define HAVE_UTIME_H 1
+
+/* Define to 1 if you have the <utmp.h> header file. */
+#define HAVE_UTMP_H 1
+
+/* Define to 1 if you have the `uuid_create' function. */
+/* #undef HAVE_UUID_CREATE */
+
+/* Define to 1 if you have the `uuid_enc_be' function. */
+/* #undef HAVE_UUID_ENC_BE */
+
+/* Define if uuid_generate_time_safe() exists. */
+#define HAVE_UUID_GENERATE_TIME_SAFE 1
+
+/* Define to 1 if you have the <uuid.h> header file. */
+#define HAVE_UUID_H 1
+
+/* Define to 1 if you have the <uuid/uuid.h> header file. */
+/* #undef HAVE_UUID_UUID_H */
+
+/* Define to 1 if you have the `vfork' function. */
+#define HAVE_VFORK 1
+
+/* Define to 1 if you have the `wait' function. */
+#define HAVE_WAIT 1
+
+/* Define to 1 if you have the `wait3' function. */
+#define HAVE_WAIT3 1
+
+/* Define to 1 if you have the `wait4' function. */
+#define HAVE_WAIT4 1
+
+/* Define to 1 if you have the `waitid' function. */
+#define HAVE_WAITID 1
+
+/* Define to 1 if you have the `waitpid' function. */
+#define HAVE_WAITPID 1
+
+/* Define if the compiler provides a wchar.h header file. */
+#define HAVE_WCHAR_H 1
+
+/* Define to 1 if you have the `wcscoll' function. */
+#define HAVE_WCSCOLL 1
+
+/* Define to 1 if you have the `wcsftime' function. */
+#define HAVE_WCSFTIME 1
+
+/* Define to 1 if you have the `wcsxfrm' function. */
+#define HAVE_WCSXFRM 1
+
+/* Define to 1 if you have the `wmemcmp' function. */
+#define HAVE_WMEMCMP 1
+
+/* Define if tzset() actually switches the local timezone in a meaningful way.
+ */
+#define HAVE_WORKING_TZSET 1
+
+/* Define to 1 if you have the `writev' function. */
+#define HAVE_WRITEV 1
+
+/* Define if the zlib library has inflateCopy */
+#define HAVE_ZLIB_COPY 1
+
+/* Define to 1 if you have the <zlib.h> header file. */
+/* #undef HAVE_ZLIB_H */
+
+/* Define to 1 if you have the `_getpty' function. */
+/* #undef HAVE__GETPTY */
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
+ */
+/* #undef MAJOR_IN_MKDEV */
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in
+ <sysmacros.h>. */
+#define MAJOR_IN_SYSMACROS 1
+
+/* Define if mvwdelch in curses.h is an expression. */
+#define MVWDELCH_IS_EXPRESSION 1
+
+/* Define to the address where bug reports for this package should be sent. */
+/* #undef PACKAGE_BUGREPORT */
+
+/* Define to the full name of this package. */
+/* #undef PACKAGE_NAME */
+
+/* Define to the full name and version of this package. */
+/* #undef PACKAGE_STRING */
+
+/* Define to the one symbol short name of this package. */
+/* #undef PACKAGE_TARNAME */
+
+/* Define to the home page for this package. */
+/* #undef PACKAGE_URL */
+
+/* Define to the version of this package. */
+/* #undef PACKAGE_VERSION */
+
+/* Define if POSIX semaphores aren't enabled on your system */
+/* #undef POSIX_SEMAPHORES_NOT_ENABLED */
+
+/* Define if pthread_key_t is compatible with int. */
+#define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1
+
+/* Defined if PTHREAD_SCOPE_SYSTEM supported. */
+#define PTHREAD_SYSTEM_SCHED_SUPPORTED 1
+
+/* Define as the preferred size in bits of long digits */
+/* #undef PYLONG_BITS_IN_DIGIT */
+
+/* enabled builtin hash modules */
+#define PY_BUILTIN_HASHLIB_HASHES "md5,sha1,sha2,sha3,blake2"
+
+/* Define if you want to coerce the C locale to a UTF-8 based locale */
+#define PY_COERCE_C_LOCALE 1
+
+/* Define to 1 if you have the perf trampoline. */
+#define PY_HAVE_PERF_TRAMPOLINE 1
+
+/* Define to 1 to build the sqlite module with loadable extensions support. */
+#define PY_SQLITE_ENABLE_LOAD_EXTENSION 1
+
+/* Define if SQLite was compiled with the serialize API */
+/* #undef PY_SQLITE_HAVE_SERIALIZE */
+
+/* Default cipher suites list for ssl module. 1: Python's preferred selection,
+ 2: leave OpenSSL defaults untouched, 0: custom string */
+#define PY_SSL_DEFAULT_CIPHERS 1
+
+/* Cipher suite string for PY_SSL_DEFAULT_CIPHERS=0 */
+/* #undef PY_SSL_DEFAULT_CIPHER_STRING */
+
+/* PEP 11 Support tier (1, 2, 3 or 0 for unsupported) */
+#define PY_SUPPORT_TIER 1
+
+/* Define if you want to build an interpreter with many run-time checks. */
+/* #undef Py_DEBUG */
+
+/* Defined if Python is built as a shared library. */
+/* #undef Py_ENABLE_SHARED */
+
+/* Define hash algorithm for str, bytes and memoryview. SipHash24: 1, FNV: 2,
+ SipHash13: 3, externally defined: 0 */
+/* #undef Py_HASH_ALGORITHM */
+
+/* Define if you want to enable internal statistics gathering. */
+/* #undef Py_STATS */
+
+/* The version of SunOS/Solaris as reported by `uname -r' without the dot. */
+/* #undef Py_SUNOS_VERSION */
+
+/* Define if you want to enable tracing references for debugging purpose */
+/* #undef Py_TRACE_REFS */
+
+/* assume C89 semantics that RETSIGTYPE is always void */
+#define RETSIGTYPE void
+
+/* Define if setpgrp() must be called as setpgrp(0, 0). */
+/* #undef SETPGRP_HAVE_ARG */
+
+/* Define if i>>j for signed int i does not extend the sign bit when i < 0 */
+/* #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS */
+
+/* The size of `double', as computed by sizeof. */
+#define SIZEOF_DOUBLE 8
+
+/* The size of `float', as computed by sizeof. */
+#define SIZEOF_FLOAT 4
+
+/* The size of `fpos_t', as computed by sizeof. */
+#define SIZEOF_FPOS_T 16
+
+/* The size of `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 8
+
+/* The size of `long double', as computed by sizeof. */
+#define SIZEOF_LONG_DOUBLE 16
+
+/* The size of `long long', as computed by sizeof. */
+#define SIZEOF_LONG_LONG 8
+
+/* The size of `off_t', as computed by sizeof. */
+#define SIZEOF_OFF_T 8
+
+/* The size of `pid_t', as computed by sizeof. */
+#define SIZEOF_PID_T 4
+
+/* The size of `pthread_key_t', as computed by sizeof. */
+#define SIZEOF_PTHREAD_KEY_T 4
+
+/* The size of `pthread_t', as computed by sizeof. */
+#define SIZEOF_PTHREAD_T 8
+
+/* The size of `short', as computed by sizeof. */
+#define SIZEOF_SHORT 2
+
+/* The size of `size_t', as computed by sizeof. */
+#if !defined(SIZEOF_SIZE_T)
+#define SIZEOF_SIZE_T 8
+#endif
+
+/* The size of `time_t', as computed by sizeof. */
+#define SIZEOF_TIME_T 8
+
+/* The size of `uintptr_t', as computed by sizeof. */
+#define SIZEOF_UINTPTR_T 8
+
+/* The size of `void *', as computed by sizeof. */
+#define SIZEOF_VOID_P 8
+
+/* The size of `wchar_t', as computed by sizeof. */
+#define SIZEOF_WCHAR_T 4
+
+/* The size of `_Bool', as computed by sizeof. */
+#define SIZEOF__BOOL 1
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if you can safely include both <sys/select.h> and <sys/time.h>
+ (which you can't on SCO ODT 3.0). */
+#define SYS_SELECT_WITH_SYS_TIME 1
+
+/* Custom thread stack size depending on chosen sanitizer runtimes. */
+/* #undef THREAD_STACK_SIZE */
+
+/* Library needed by timemodule.c: librt may be needed for clock_gettime() */
+/* #undef TIMEMODULE_LIB */
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+/* #undef TM_IN_SYS_TIME */
+
+/* Define if you want to use computed gotos in ceval.c. */
+/* #undef USE_COMPUTED_GOTOS */
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# define _ALL_SOURCE 1
+#endif
+/* Enable general extensions on macOS. */
+#ifndef _DARWIN_C_SOURCE
+# define _DARWIN_C_SOURCE 1
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+/* Enable X/Open compliant socket functions that do not require linking
+ with -lxnet on HP-UX 11.11. */
+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
+# define _HPUX_ALT_XOPEN_SOCKET_API 1
+#endif
+/* Identify the host operating system as Minix.
+ This macro does not affect the system headers' behavior.
+ A future release of Autoconf may stop defining this macro. */
+#ifndef _MINIX
+/* # undef _MINIX */
+#endif
+/* Enable general extensions on NetBSD.
+ Enable NetBSD compatibility extensions on Minix. */
+#ifndef _NETBSD_SOURCE
+# define _NETBSD_SOURCE 1
+#endif
+/* Enable OpenBSD compatibility extensions on NetBSD.
+ Oddly enough, this does nothing on OpenBSD. */
+#ifndef _OPENBSD_SOURCE
+# define _OPENBSD_SOURCE 1
+#endif
+/* Define to 1 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_SOURCE
+/* # undef _POSIX_SOURCE */
+#endif
+/* Define to 2 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_1_SOURCE
+/* # undef _POSIX_1_SOURCE */
+#endif
+/* Enable POSIX-compatible threading on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
+#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+# define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+# define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
+#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
+# define __STDC_WANT_IEC_60559_DFP_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
+#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
+# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */
+#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
+# define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
+#ifndef __STDC_WANT_LIB_EXT2__
+# define __STDC_WANT_LIB_EXT2__ 1
+#endif
+/* Enable extensions specified by ISO/IEC 24747:2009. */
+#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
+# define __STDC_WANT_MATH_SPEC_FUNCS__ 1
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+/* Enable X/Open extensions. Define to 500 only if necessary
+ to make mbstate_t available. */
+#ifndef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 700
+#endif
+
+
+/* Define if WINDOW in curses.h offers a field _flags. */
+#define WINDOW_HAS_FLAGS 1
+
+/* Define if you want build the _decimal module using a coroutine-local rather
+ than a thread-local context */
+#define WITH_DECIMAL_CONTEXTVAR 1
+
+/* Define if you want documentation strings in extension modules */
+#define WITH_DOC_STRINGS 1
+
+/* Define if you want to compile in DTrace support */
+/* #undef WITH_DTRACE */
+
+/* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic
+ linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).
+ Dyld is necessary to support frameworks. */
+/* #undef WITH_DYLD */
+
+/* Define to build the readline module against libedit. */
+/* #undef WITH_EDITLINE */
+
+/* Define if you want to compile in object freelists optimization */
+#define WITH_FREELISTS 1
+
+/* Define to 1 if libintl is needed for locale functions. */
+/* #undef WITH_LIBINTL */
+
+/* Define if you want to produce an OpenStep/Rhapsody framework (shared
+ library plus accessory files). */
+/* #undef WITH_NEXT_FRAMEWORK */
+
+/* Define if you want to compile in Python-specific mallocs */
+#ifndef address_sanitizer_enabled
+#define WITH_PYMALLOC 1
+#endif
+
+/* Define if you want pymalloc to be disabled when running under valgrind */
+/* #undef WITH_VALGRIND */
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* # undef WORDS_BIGENDIAN */
+# endif
+#endif
+
+/* Define if arithmetic is subject to x87-style double rounding issue */
+/* #undef X87_DOUBLE_ROUNDING */
+
+/* Define on OpenBSD to activate all library features */
+/* #undef _BSD_SOURCE */
+
+/* Define on Darwin to activate all library features */
+#define _DARWIN_C_SOURCE 1
+
+/* This must be set to 64 on some systems to enable large file support. */
+#define _FILE_OFFSET_BITS 64
+
+/* Define to include mbstate_t for mbrtowc */
+/* #undef _INCLUDE__STDC_A1_SOURCE */
+
+/* This must be defined on some systems to enable large file support. */
+#define _LARGEFILE_SOURCE 1
+
+/* This must be defined on AIX systems to enable large file support. */
+/* #undef _LARGE_FILES */
+
+/* Define on NetBSD to activate all library features */
+#define _NETBSD_SOURCE 1
+
+/* Define to activate features from IEEE Stds 1003.1-2008 */
+#define _POSIX_C_SOURCE 200809L
+
+/* Define if you have POSIX threads, and your system does not define that. */
+/* #undef _POSIX_THREADS */
+
+/* framework name */
+#define _PYTHONFRAMEWORK ""
+
+/* Define to force use of thread-safe errno, h_errno, and other functions */
+/* #undef _REENTRANT */
+
+/* Define to 1 if you want to emulate getpid() on WASI */
+/* #undef _WASI_EMULATED_GETPID */
+
+/* Define to 1 if you want to emulate process clocks on WASI */
+/* #undef _WASI_EMULATED_PROCESS_CLOCKS */
+
+/* Define to 1 if you want to emulate signals on WASI */
+/* #undef _WASI_EMULATED_SIGNAL */
+
+/* Define to the level of X/Open that your system supports */
+#define _XOPEN_SOURCE 700
+
+/* Define to activate Unix95-and-earlier features */
+#define _XOPEN_SOURCE_EXTENDED 1
+
+/* Define on FreeBSD to activate all library features */
+#define __BSD_VISIBLE 1
+
+/* Define to 'long' if <time.h> doesn't define. */
+/* #undef clock_t */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef gid_t */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef mode_t */
+
+/* Define to `long int' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define as a signed integer type capable of holding a process identifier. */
+/* #undef pid_t */
+
+/* Define to empty if the keyword does not work. */
+/* #undef signed */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to `int' if <sys/socket.h> does not define. */
+/* #undef socklen_t */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef uid_t */
+
+
+/* Define the macros needed if on a UnixWare 7.x system. */
+#if defined(__USLC__) && defined(__SCO_VERSION__)
+#define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
+#endif
+
+#endif /*Py_PYCONFIG_H*/
+
diff --git a/contrib/tools/python3/src/Include/pyconfig-musl.h b/contrib/tools/python3/Include/pyconfig-musl.h
index 6c95bbab2c5..6c95bbab2c5 100644
--- a/contrib/tools/python3/src/Include/pyconfig-musl.h
+++ b/contrib/tools/python3/Include/pyconfig-musl.h
diff --git a/contrib/tools/python3/src/Include/pyconfig-osx-arm64.h b/contrib/tools/python3/Include/pyconfig-osx-arm64.h
index fb012fa4ddd..fb012fa4ddd 100644
--- a/contrib/tools/python3/src/Include/pyconfig-osx-arm64.h
+++ b/contrib/tools/python3/Include/pyconfig-osx-arm64.h
diff --git a/contrib/tools/python3/src/Include/pyconfig-osx.h b/contrib/tools/python3/Include/pyconfig-osx.h
index 3181d1cec59..3181d1cec59 100644
--- a/contrib/tools/python3/src/Include/pyconfig-osx.h
+++ b/contrib/tools/python3/Include/pyconfig-osx.h
diff --git a/contrib/tools/python3/src/Include/pyconfig.h b/contrib/tools/python3/Include/pyconfig.h
index 0fa2d6916e7..0fa2d6916e7 100644
--- a/contrib/tools/python3/src/Include/pyconfig.h
+++ b/contrib/tools/python3/Include/pyconfig.h
diff --git a/contrib/tools/python3/src/Include/pydtrace.h b/contrib/tools/python3/Include/pydtrace.h
index 6b172d8a25a..6b172d8a25a 100644
--- a/contrib/tools/python3/src/Include/pydtrace.h
+++ b/contrib/tools/python3/Include/pydtrace.h
diff --git a/contrib/tools/python3/src/Include/pyerrors.h b/contrib/tools/python3/Include/pyerrors.h
index d089fa71779..d089fa71779 100644
--- a/contrib/tools/python3/src/Include/pyerrors.h
+++ b/contrib/tools/python3/Include/pyerrors.h
diff --git a/contrib/tools/python3/src/Include/pyexpat.h b/contrib/tools/python3/Include/pyexpat.h
index 07020b5dc96..07020b5dc96 100644
--- a/contrib/tools/python3/src/Include/pyexpat.h
+++ b/contrib/tools/python3/Include/pyexpat.h
diff --git a/contrib/tools/python3/src/Include/pyframe.h b/contrib/tools/python3/Include/pyframe.h
index 13d52312ea9..13d52312ea9 100644
--- a/contrib/tools/python3/src/Include/pyframe.h
+++ b/contrib/tools/python3/Include/pyframe.h
diff --git a/contrib/tools/python3/src/Include/pyhash.h b/contrib/tools/python3/Include/pyhash.h
index 182d223fab1..182d223fab1 100644
--- a/contrib/tools/python3/src/Include/pyhash.h
+++ b/contrib/tools/python3/Include/pyhash.h
diff --git a/contrib/tools/python3/src/Include/pylifecycle.h b/contrib/tools/python3/Include/pylifecycle.h
index e4c3b09c963..e4c3b09c963 100644
--- a/contrib/tools/python3/src/Include/pylifecycle.h
+++ b/contrib/tools/python3/Include/pylifecycle.h
diff --git a/contrib/tools/python3/src/Include/pymacconfig.h b/contrib/tools/python3/Include/pymacconfig.h
index 61f08e368ef..61f08e368ef 100644
--- a/contrib/tools/python3/src/Include/pymacconfig.h
+++ b/contrib/tools/python3/Include/pymacconfig.h
diff --git a/contrib/tools/python3/src/Include/pymacro.h b/contrib/tools/python3/Include/pymacro.h
index 342d2a7b844..342d2a7b844 100644
--- a/contrib/tools/python3/src/Include/pymacro.h
+++ b/contrib/tools/python3/Include/pymacro.h
diff --git a/contrib/tools/python3/src/Include/pymath.h b/contrib/tools/python3/Include/pymath.h
index 4c1e3d99848..4c1e3d99848 100644
--- a/contrib/tools/python3/src/Include/pymath.h
+++ b/contrib/tools/python3/Include/pymath.h
diff --git a/contrib/tools/python3/src/Include/pymem.h b/contrib/tools/python3/Include/pymem.h
index e882645757b..e882645757b 100644
--- a/contrib/tools/python3/src/Include/pymem.h
+++ b/contrib/tools/python3/Include/pymem.h
diff --git a/contrib/tools/python3/src/Include/pyport.h b/contrib/tools/python3/Include/pyport.h
index 35eca7234ca..35eca7234ca 100644
--- a/contrib/tools/python3/src/Include/pyport.h
+++ b/contrib/tools/python3/Include/pyport.h
diff --git a/contrib/tools/python3/src/Include/pystate.h b/contrib/tools/python3/Include/pystate.h
index e6b4de979c8..e6b4de979c8 100644
--- a/contrib/tools/python3/src/Include/pystate.h
+++ b/contrib/tools/python3/Include/pystate.h
diff --git a/contrib/tools/python3/src/Include/pystats.h b/contrib/tools/python3/Include/pystats.h
index 4b961bad2a4..4b961bad2a4 100644
--- a/contrib/tools/python3/src/Include/pystats.h
+++ b/contrib/tools/python3/Include/pystats.h
diff --git a/contrib/tools/python3/src/Include/pystrcmp.h b/contrib/tools/python3/Include/pystrcmp.h
index edb12397e3c..edb12397e3c 100644
--- a/contrib/tools/python3/src/Include/pystrcmp.h
+++ b/contrib/tools/python3/Include/pystrcmp.h
diff --git a/contrib/tools/python3/src/Include/pystrtod.h b/contrib/tools/python3/Include/pystrtod.h
index fa056d17b63..fa056d17b63 100644
--- a/contrib/tools/python3/src/Include/pystrtod.h
+++ b/contrib/tools/python3/Include/pystrtod.h
diff --git a/contrib/tools/python3/src/Include/pythonrun.h b/contrib/tools/python3/Include/pythonrun.h
index 154c7450cb9..154c7450cb9 100644
--- a/contrib/tools/python3/src/Include/pythonrun.h
+++ b/contrib/tools/python3/Include/pythonrun.h
diff --git a/contrib/tools/python3/src/Include/pythread.h b/contrib/tools/python3/Include/pythread.h
index 63714437c49..63714437c49 100644
--- a/contrib/tools/python3/src/Include/pythread.h
+++ b/contrib/tools/python3/Include/pythread.h
diff --git a/contrib/tools/python3/src/Include/pytypedefs.h b/contrib/tools/python3/Include/pytypedefs.h
index e78ed56a3b6..e78ed56a3b6 100644
--- a/contrib/tools/python3/src/Include/pytypedefs.h
+++ b/contrib/tools/python3/Include/pytypedefs.h
diff --git a/contrib/tools/python3/src/Include/rangeobject.h b/contrib/tools/python3/Include/rangeobject.h
index d46ce7cd41b..d46ce7cd41b 100644
--- a/contrib/tools/python3/src/Include/rangeobject.h
+++ b/contrib/tools/python3/Include/rangeobject.h
diff --git a/contrib/tools/python3/src/Include/setobject.h b/contrib/tools/python3/Include/setobject.h
index 62c9e6b13f8..62c9e6b13f8 100644
--- a/contrib/tools/python3/src/Include/setobject.h
+++ b/contrib/tools/python3/Include/setobject.h
diff --git a/contrib/tools/python3/src/Include/sliceobject.h b/contrib/tools/python3/Include/sliceobject.h
index c13863f27c2..c13863f27c2 100644
--- a/contrib/tools/python3/src/Include/sliceobject.h
+++ b/contrib/tools/python3/Include/sliceobject.h
diff --git a/contrib/tools/python3/src/Include/structmember.h b/contrib/tools/python3/Include/structmember.h
index f6e8fd82989..f6e8fd82989 100644
--- a/contrib/tools/python3/src/Include/structmember.h
+++ b/contrib/tools/python3/Include/structmember.h
diff --git a/contrib/tools/python3/src/Include/structseq.h b/contrib/tools/python3/Include/structseq.h
index 96871155611..96871155611 100644
--- a/contrib/tools/python3/src/Include/structseq.h
+++ b/contrib/tools/python3/Include/structseq.h
diff --git a/contrib/tools/python3/src/Include/sysmodule.h b/contrib/tools/python3/Include/sysmodule.h
index 96f883870b3..96f883870b3 100644
--- a/contrib/tools/python3/src/Include/sysmodule.h
+++ b/contrib/tools/python3/Include/sysmodule.h
diff --git a/contrib/tools/python3/src/Include/traceback.h b/contrib/tools/python3/Include/traceback.h
index 2b40cc9fc32..2b40cc9fc32 100644
--- a/contrib/tools/python3/src/Include/traceback.h
+++ b/contrib/tools/python3/Include/traceback.h
diff --git a/contrib/tools/python3/src/Include/tracemalloc.h b/contrib/tools/python3/Include/tracemalloc.h
index 580027a8e36..580027a8e36 100644
--- a/contrib/tools/python3/src/Include/tracemalloc.h
+++ b/contrib/tools/python3/Include/tracemalloc.h
diff --git a/contrib/tools/python3/src/Include/tupleobject.h b/contrib/tools/python3/Include/tupleobject.h
index 1f9ab54be65..1f9ab54be65 100644
--- a/contrib/tools/python3/src/Include/tupleobject.h
+++ b/contrib/tools/python3/Include/tupleobject.h
diff --git a/contrib/tools/python3/src/Include/typeslots.h b/contrib/tools/python3/Include/typeslots.h
index 506b05580de..506b05580de 100644
--- a/contrib/tools/python3/src/Include/typeslots.h
+++ b/contrib/tools/python3/Include/typeslots.h
diff --git a/contrib/tools/python3/src/Include/unicodeobject.h b/contrib/tools/python3/Include/unicodeobject.h
index 5839c747a29..5839c747a29 100644
--- a/contrib/tools/python3/src/Include/unicodeobject.h
+++ b/contrib/tools/python3/Include/unicodeobject.h
diff --git a/contrib/tools/python3/src/Include/warnings.h b/contrib/tools/python3/Include/warnings.h
index 18ac1543a3c..18ac1543a3c 100644
--- a/contrib/tools/python3/src/Include/warnings.h
+++ b/contrib/tools/python3/Include/warnings.h
diff --git a/contrib/tools/python3/src/Include/weakrefobject.h b/contrib/tools/python3/Include/weakrefobject.h
index 8e1fa1b9286..8e1fa1b9286 100644
--- a/contrib/tools/python3/src/Include/weakrefobject.h
+++ b/contrib/tools/python3/Include/weakrefobject.h
diff --git a/contrib/tools/python3/src/LICENSE b/contrib/tools/python3/LICENSE
index f26bcf4d2de..f26bcf4d2de 100644
--- a/contrib/tools/python3/src/LICENSE
+++ b/contrib/tools/python3/LICENSE
diff --git a/contrib/tools/python3/src/Lib/__future__.py b/contrib/tools/python3/Lib/__future__.py
index 39720a5e412..39720a5e412 100644
--- a/contrib/tools/python3/src/Lib/__future__.py
+++ b/contrib/tools/python3/Lib/__future__.py
diff --git a/contrib/tools/python3/src/Lib/__hello__.py b/contrib/tools/python3/Lib/__hello__.py
index c09d6a4f523..c09d6a4f523 100644
--- a/contrib/tools/python3/src/Lib/__hello__.py
+++ b/contrib/tools/python3/Lib/__hello__.py
diff --git a/contrib/tools/python3/src/Lib/_aix_support.py b/contrib/tools/python3/Lib/_aix_support.py
index dadc75c2bf4..dadc75c2bf4 100644
--- a/contrib/tools/python3/src/Lib/_aix_support.py
+++ b/contrib/tools/python3/Lib/_aix_support.py
diff --git a/contrib/tools/python3/src/Lib/_collections_abc.py b/contrib/tools/python3/Lib/_collections_abc.py
index 601107d2d86..601107d2d86 100644
--- a/contrib/tools/python3/src/Lib/_collections_abc.py
+++ b/contrib/tools/python3/Lib/_collections_abc.py
diff --git a/contrib/tools/python3/src/Lib/_compat_pickle.py b/contrib/tools/python3/Lib/_compat_pickle.py
index 65a94b6b1bd..65a94b6b1bd 100644
--- a/contrib/tools/python3/src/Lib/_compat_pickle.py
+++ b/contrib/tools/python3/Lib/_compat_pickle.py
diff --git a/contrib/tools/python3/src/Lib/_compression.py b/contrib/tools/python3/Lib/_compression.py
index e8b70aa0a3e..e8b70aa0a3e 100644
--- a/contrib/tools/python3/src/Lib/_compression.py
+++ b/contrib/tools/python3/Lib/_compression.py
diff --git a/contrib/tools/python3/src/Lib/_markupbase.py b/contrib/tools/python3/Lib/_markupbase.py
index 3ad7e279960..3ad7e279960 100644
--- a/contrib/tools/python3/src/Lib/_markupbase.py
+++ b/contrib/tools/python3/Lib/_markupbase.py
diff --git a/contrib/tools/python3/src/Lib/_osx_support.py b/contrib/tools/python3/Lib/_osx_support.py
index 0cb064fcd79..0cb064fcd79 100644
--- a/contrib/tools/python3/src/Lib/_osx_support.py
+++ b/contrib/tools/python3/Lib/_osx_support.py
diff --git a/contrib/tools/python3/src/Lib/_py_abc.py b/contrib/tools/python3/Lib/_py_abc.py
index c870ae9048b..c870ae9048b 100644
--- a/contrib/tools/python3/src/Lib/_py_abc.py
+++ b/contrib/tools/python3/Lib/_py_abc.py
diff --git a/contrib/tools/python3/src/Lib/_pydatetime.py b/contrib/tools/python3/Lib/_pydatetime.py
index cd0ea900bfb..cd0ea900bfb 100644
--- a/contrib/tools/python3/src/Lib/_pydatetime.py
+++ b/contrib/tools/python3/Lib/_pydatetime.py
diff --git a/contrib/tools/python3/src/Lib/_pydecimal.py b/contrib/tools/python3/Lib/_pydecimal.py
index 2692f2fcba4..2692f2fcba4 100644
--- a/contrib/tools/python3/src/Lib/_pydecimal.py
+++ b/contrib/tools/python3/Lib/_pydecimal.py
diff --git a/contrib/tools/python3/src/Lib/_pyio.py b/contrib/tools/python3/Lib/_pyio.py
index 9641d431018..9641d431018 100644
--- a/contrib/tools/python3/src/Lib/_pyio.py
+++ b/contrib/tools/python3/Lib/_pyio.py
diff --git a/contrib/tools/python3/src/Lib/_pylong.py b/contrib/tools/python3/Lib/_pylong.py
index 936346e187f..936346e187f 100644
--- a/contrib/tools/python3/src/Lib/_pylong.py
+++ b/contrib/tools/python3/Lib/_pylong.py
diff --git a/contrib/tools/python3/src/Lib/_sitebuiltins.py b/contrib/tools/python3/Lib/_sitebuiltins.py
index c66269a5719..c66269a5719 100644
--- a/contrib/tools/python3/src/Lib/_sitebuiltins.py
+++ b/contrib/tools/python3/Lib/_sitebuiltins.py
diff --git a/contrib/tools/python3/src/Lib/_strptime.py b/contrib/tools/python3/Lib/_strptime.py
index 798cf9f9d3f..798cf9f9d3f 100644
--- a/contrib/tools/python3/src/Lib/_strptime.py
+++ b/contrib/tools/python3/Lib/_strptime.py
diff --git a/contrib/tools/python3/src/Lib/_sysconfigdata_arcadia.py b/contrib/tools/python3/Lib/_sysconfigdata_arcadia.py
index 683cc2605df..683cc2605df 100644
--- a/contrib/tools/python3/src/Lib/_sysconfigdata_arcadia.py
+++ b/contrib/tools/python3/Lib/_sysconfigdata_arcadia.py
diff --git a/contrib/tools/python3/src/Lib/_threading_local.py b/contrib/tools/python3/Lib/_threading_local.py
index b006d76c4e2..b006d76c4e2 100644
--- a/contrib/tools/python3/src/Lib/_threading_local.py
+++ b/contrib/tools/python3/Lib/_threading_local.py
diff --git a/contrib/tools/python3/src/Lib/_weakrefset.py b/contrib/tools/python3/Lib/_weakrefset.py
index 489eec714e0..489eec714e0 100644
--- a/contrib/tools/python3/src/Lib/_weakrefset.py
+++ b/contrib/tools/python3/Lib/_weakrefset.py
diff --git a/contrib/tools/python3/src/Lib/abc.py b/contrib/tools/python3/Lib/abc.py
index f8a4e11ce9c..f8a4e11ce9c 100644
--- a/contrib/tools/python3/src/Lib/abc.py
+++ b/contrib/tools/python3/Lib/abc.py
diff --git a/contrib/tools/python3/src/Lib/aifc.py b/contrib/tools/python3/Lib/aifc.py
index 5254987e22b..5254987e22b 100644
--- a/contrib/tools/python3/src/Lib/aifc.py
+++ b/contrib/tools/python3/Lib/aifc.py
diff --git a/contrib/tools/python3/src/Lib/antigravity.py b/contrib/tools/python3/Lib/antigravity.py
index 6dc52073357..6dc52073357 100644
--- a/contrib/tools/python3/src/Lib/antigravity.py
+++ b/contrib/tools/python3/Lib/antigravity.py
diff --git a/contrib/tools/python3/src/Lib/argparse.py b/contrib/tools/python3/Lib/argparse.py
index 484a1efde43..484a1efde43 100644
--- a/contrib/tools/python3/src/Lib/argparse.py
+++ b/contrib/tools/python3/Lib/argparse.py
diff --git a/contrib/tools/python3/src/Lib/ast.py b/contrib/tools/python3/Lib/ast.py
index de940d2e9c6..de940d2e9c6 100644
--- a/contrib/tools/python3/src/Lib/ast.py
+++ b/contrib/tools/python3/Lib/ast.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/__init__.py b/contrib/tools/python3/Lib/asyncio/__init__.py
index 03165a425eb..03165a425eb 100644
--- a/contrib/tools/python3/src/Lib/asyncio/__init__.py
+++ b/contrib/tools/python3/Lib/asyncio/__init__.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/__main__.py b/contrib/tools/python3/Lib/asyncio/__main__.py
index 18bb87a5bc4..18bb87a5bc4 100644
--- a/contrib/tools/python3/src/Lib/asyncio/__main__.py
+++ b/contrib/tools/python3/Lib/asyncio/__main__.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/base_events.py b/contrib/tools/python3/Lib/asyncio/base_events.py
index c16c445bde3..c16c445bde3 100644
--- a/contrib/tools/python3/src/Lib/asyncio/base_events.py
+++ b/contrib/tools/python3/Lib/asyncio/base_events.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/base_futures.py b/contrib/tools/python3/Lib/asyncio/base_futures.py
index 7987963bd99..7987963bd99 100644
--- a/contrib/tools/python3/src/Lib/asyncio/base_futures.py
+++ b/contrib/tools/python3/Lib/asyncio/base_futures.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/base_subprocess.py b/contrib/tools/python3/Lib/asyncio/base_subprocess.py
index 4c9b0dd5653..4c9b0dd5653 100644
--- a/contrib/tools/python3/src/Lib/asyncio/base_subprocess.py
+++ b/contrib/tools/python3/Lib/asyncio/base_subprocess.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/base_tasks.py b/contrib/tools/python3/Lib/asyncio/base_tasks.py
index c907b683413..c907b683413 100644
--- a/contrib/tools/python3/src/Lib/asyncio/base_tasks.py
+++ b/contrib/tools/python3/Lib/asyncio/base_tasks.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/constants.py b/contrib/tools/python3/Lib/asyncio/constants.py
index b60c1e4236a..b60c1e4236a 100644
--- a/contrib/tools/python3/src/Lib/asyncio/constants.py
+++ b/contrib/tools/python3/Lib/asyncio/constants.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/coroutines.py b/contrib/tools/python3/Lib/asyncio/coroutines.py
index ab4f30eb51b..ab4f30eb51b 100644
--- a/contrib/tools/python3/src/Lib/asyncio/coroutines.py
+++ b/contrib/tools/python3/Lib/asyncio/coroutines.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/events.py b/contrib/tools/python3/Lib/asyncio/events.py
index 016852880ca..016852880ca 100644
--- a/contrib/tools/python3/src/Lib/asyncio/events.py
+++ b/contrib/tools/python3/Lib/asyncio/events.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/exceptions.py b/contrib/tools/python3/Lib/asyncio/exceptions.py
index 5ece595aad6..5ece595aad6 100644
--- a/contrib/tools/python3/src/Lib/asyncio/exceptions.py
+++ b/contrib/tools/python3/Lib/asyncio/exceptions.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/format_helpers.py b/contrib/tools/python3/Lib/asyncio/format_helpers.py
index 27d11fd4fa9..27d11fd4fa9 100644
--- a/contrib/tools/python3/src/Lib/asyncio/format_helpers.py
+++ b/contrib/tools/python3/Lib/asyncio/format_helpers.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/futures.py b/contrib/tools/python3/Lib/asyncio/futures.py
index 97fc4e3fcb6..97fc4e3fcb6 100644
--- a/contrib/tools/python3/src/Lib/asyncio/futures.py
+++ b/contrib/tools/python3/Lib/asyncio/futures.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/locks.py b/contrib/tools/python3/Lib/asyncio/locks.py
index ce5d8d5bfb2..ce5d8d5bfb2 100644
--- a/contrib/tools/python3/src/Lib/asyncio/locks.py
+++ b/contrib/tools/python3/Lib/asyncio/locks.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/log.py b/contrib/tools/python3/Lib/asyncio/log.py
index 23a7074afb0..23a7074afb0 100644
--- a/contrib/tools/python3/src/Lib/asyncio/log.py
+++ b/contrib/tools/python3/Lib/asyncio/log.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/mixins.py b/contrib/tools/python3/Lib/asyncio/mixins.py
index c6bf97329e9..c6bf97329e9 100644
--- a/contrib/tools/python3/src/Lib/asyncio/mixins.py
+++ b/contrib/tools/python3/Lib/asyncio/mixins.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/proactor_events.py b/contrib/tools/python3/Lib/asyncio/proactor_events.py
index 1e2a730cf36..1e2a730cf36 100644
--- a/contrib/tools/python3/src/Lib/asyncio/proactor_events.py
+++ b/contrib/tools/python3/Lib/asyncio/proactor_events.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/protocols.py b/contrib/tools/python3/Lib/asyncio/protocols.py
index 09987b164c6..09987b164c6 100644
--- a/contrib/tools/python3/src/Lib/asyncio/protocols.py
+++ b/contrib/tools/python3/Lib/asyncio/protocols.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/queues.py b/contrib/tools/python3/Lib/asyncio/queues.py
index a9656a6df56..a9656a6df56 100644
--- a/contrib/tools/python3/src/Lib/asyncio/queues.py
+++ b/contrib/tools/python3/Lib/asyncio/queues.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/runners.py b/contrib/tools/python3/Lib/asyncio/runners.py
index 1b89236599a..1b89236599a 100644
--- a/contrib/tools/python3/src/Lib/asyncio/runners.py
+++ b/contrib/tools/python3/Lib/asyncio/runners.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/selector_events.py b/contrib/tools/python3/Lib/asyncio/selector_events.py
index 790711f8340..790711f8340 100644
--- a/contrib/tools/python3/src/Lib/asyncio/selector_events.py
+++ b/contrib/tools/python3/Lib/asyncio/selector_events.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/sslproto.py b/contrib/tools/python3/Lib/asyncio/sslproto.py
index e51669a2ab2..e51669a2ab2 100644
--- a/contrib/tools/python3/src/Lib/asyncio/sslproto.py
+++ b/contrib/tools/python3/Lib/asyncio/sslproto.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/staggered.py b/contrib/tools/python3/Lib/asyncio/staggered.py
index 451a53a16f3..451a53a16f3 100644
--- a/contrib/tools/python3/src/Lib/asyncio/staggered.py
+++ b/contrib/tools/python3/Lib/asyncio/staggered.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/streams.py b/contrib/tools/python3/Lib/asyncio/streams.py
index f310aa2f367..f310aa2f367 100644
--- a/contrib/tools/python3/src/Lib/asyncio/streams.py
+++ b/contrib/tools/python3/Lib/asyncio/streams.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/subprocess.py b/contrib/tools/python3/Lib/asyncio/subprocess.py
index 043359bbd03..043359bbd03 100644
--- a/contrib/tools/python3/src/Lib/asyncio/subprocess.py
+++ b/contrib/tools/python3/Lib/asyncio/subprocess.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/taskgroups.py b/contrib/tools/python3/Lib/asyncio/taskgroups.py
index d264e51f1fd..d264e51f1fd 100644
--- a/contrib/tools/python3/src/Lib/asyncio/taskgroups.py
+++ b/contrib/tools/python3/Lib/asyncio/taskgroups.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/tasks.py b/contrib/tools/python3/Lib/asyncio/tasks.py
index 65f2a6ef800..65f2a6ef800 100644
--- a/contrib/tools/python3/src/Lib/asyncio/tasks.py
+++ b/contrib/tools/python3/Lib/asyncio/tasks.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/threads.py b/contrib/tools/python3/Lib/asyncio/threads.py
index db048a8231d..db048a8231d 100644
--- a/contrib/tools/python3/src/Lib/asyncio/threads.py
+++ b/contrib/tools/python3/Lib/asyncio/threads.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/timeouts.py b/contrib/tools/python3/Lib/asyncio/timeouts.py
index 30042abb3ad..30042abb3ad 100644
--- a/contrib/tools/python3/src/Lib/asyncio/timeouts.py
+++ b/contrib/tools/python3/Lib/asyncio/timeouts.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/transports.py b/contrib/tools/python3/Lib/asyncio/transports.py
index 30fd41d49af..30fd41d49af 100644
--- a/contrib/tools/python3/src/Lib/asyncio/transports.py
+++ b/contrib/tools/python3/Lib/asyncio/transports.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/trsock.py b/contrib/tools/python3/Lib/asyncio/trsock.py
index c1f20473b32..c1f20473b32 100644
--- a/contrib/tools/python3/src/Lib/asyncio/trsock.py
+++ b/contrib/tools/python3/Lib/asyncio/trsock.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/unix_events.py b/contrib/tools/python3/Lib/asyncio/unix_events.py
index f2e920ada46..f2e920ada46 100644
--- a/contrib/tools/python3/src/Lib/asyncio/unix_events.py
+++ b/contrib/tools/python3/Lib/asyncio/unix_events.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/windows_events.py b/contrib/tools/python3/Lib/asyncio/windows_events.py
index c9a5fb841cb..c9a5fb841cb 100644
--- a/contrib/tools/python3/src/Lib/asyncio/windows_events.py
+++ b/contrib/tools/python3/Lib/asyncio/windows_events.py
diff --git a/contrib/tools/python3/src/Lib/asyncio/windows_utils.py b/contrib/tools/python3/Lib/asyncio/windows_utils.py
index ef277fac3e2..ef277fac3e2 100644
--- a/contrib/tools/python3/src/Lib/asyncio/windows_utils.py
+++ b/contrib/tools/python3/Lib/asyncio/windows_utils.py
diff --git a/contrib/tools/python3/src/Lib/base64.py b/contrib/tools/python3/Lib/base64.py
index e233647ee76..e233647ee76 100755
--- a/contrib/tools/python3/src/Lib/base64.py
+++ b/contrib/tools/python3/Lib/base64.py
diff --git a/contrib/tools/python3/src/Lib/bdb.py b/contrib/tools/python3/Lib/bdb.py
index 0f3eec653ba..0f3eec653ba 100644
--- a/contrib/tools/python3/src/Lib/bdb.py
+++ b/contrib/tools/python3/Lib/bdb.py
diff --git a/contrib/tools/python3/src/Lib/bisect.py b/contrib/tools/python3/Lib/bisect.py
index ca6ca724084..ca6ca724084 100644
--- a/contrib/tools/python3/src/Lib/bisect.py
+++ b/contrib/tools/python3/Lib/bisect.py
diff --git a/contrib/tools/python3/src/Lib/bz2.py b/contrib/tools/python3/Lib/bz2.py
index fabe4f73c8d..fabe4f73c8d 100644
--- a/contrib/tools/python3/src/Lib/bz2.py
+++ b/contrib/tools/python3/Lib/bz2.py
diff --git a/contrib/tools/python3/src/Lib/cProfile.py b/contrib/tools/python3/Lib/cProfile.py
index 135a12c3965..135a12c3965 100755
--- a/contrib/tools/python3/src/Lib/cProfile.py
+++ b/contrib/tools/python3/Lib/cProfile.py
diff --git a/contrib/tools/python3/src/Lib/calendar.py b/contrib/tools/python3/Lib/calendar.py
index 97d7cab3365..97d7cab3365 100644
--- a/contrib/tools/python3/src/Lib/calendar.py
+++ b/contrib/tools/python3/Lib/calendar.py
diff --git a/contrib/tools/python3/src/Lib/cgi.py b/contrib/tools/python3/Lib/cgi.py
index 8787567be7c..8787567be7c 100755
--- a/contrib/tools/python3/src/Lib/cgi.py
+++ b/contrib/tools/python3/Lib/cgi.py
diff --git a/contrib/tools/python3/src/Lib/cgitb.py b/contrib/tools/python3/Lib/cgitb.py
index f6b97f25c59..f6b97f25c59 100644
--- a/contrib/tools/python3/src/Lib/cgitb.py
+++ b/contrib/tools/python3/Lib/cgitb.py
diff --git a/contrib/tools/python3/src/Lib/chunk.py b/contrib/tools/python3/Lib/chunk.py
index 618781efd11..618781efd11 100644
--- a/contrib/tools/python3/src/Lib/chunk.py
+++ b/contrib/tools/python3/Lib/chunk.py
diff --git a/contrib/tools/python3/src/Lib/cmd.py b/contrib/tools/python3/Lib/cmd.py
index 88ee7d3ddc4..88ee7d3ddc4 100644
--- a/contrib/tools/python3/src/Lib/cmd.py
+++ b/contrib/tools/python3/Lib/cmd.py
diff --git a/contrib/tools/python3/src/Lib/code.py b/contrib/tools/python3/Lib/code.py
index 2bd5fa3e795..2bd5fa3e795 100644
--- a/contrib/tools/python3/src/Lib/code.py
+++ b/contrib/tools/python3/Lib/code.py
diff --git a/contrib/tools/python3/src/Lib/codecs.py b/contrib/tools/python3/Lib/codecs.py
index 82f23983e71..82f23983e71 100644
--- a/contrib/tools/python3/src/Lib/codecs.py
+++ b/contrib/tools/python3/Lib/codecs.py
diff --git a/contrib/tools/python3/src/Lib/codeop.py b/contrib/tools/python3/Lib/codeop.py
index 4dd096574bb..4dd096574bb 100644
--- a/contrib/tools/python3/src/Lib/codeop.py
+++ b/contrib/tools/python3/Lib/codeop.py
diff --git a/contrib/tools/python3/src/Lib/collections/__init__.py b/contrib/tools/python3/Lib/collections/__init__.py
index 8652dc8a4ec..8652dc8a4ec 100644
--- a/contrib/tools/python3/src/Lib/collections/__init__.py
+++ b/contrib/tools/python3/Lib/collections/__init__.py
diff --git a/contrib/tools/python3/src/Lib/collections/abc.py b/contrib/tools/python3/Lib/collections/abc.py
index 86ca8b8a841..86ca8b8a841 100644
--- a/contrib/tools/python3/src/Lib/collections/abc.py
+++ b/contrib/tools/python3/Lib/collections/abc.py
diff --git a/contrib/tools/python3/src/Lib/colorsys.py b/contrib/tools/python3/Lib/colorsys.py
index bc897bd0f99..bc897bd0f99 100644
--- a/contrib/tools/python3/src/Lib/colorsys.py
+++ b/contrib/tools/python3/Lib/colorsys.py
diff --git a/contrib/tools/python3/src/Lib/compileall.py b/contrib/tools/python3/Lib/compileall.py
index d394156cedc..d394156cedc 100644
--- a/contrib/tools/python3/src/Lib/compileall.py
+++ b/contrib/tools/python3/Lib/compileall.py
diff --git a/contrib/tools/python3/src/Lib/concurrent/__init__.py b/contrib/tools/python3/Lib/concurrent/__init__.py
index 196d3788575..196d3788575 100644
--- a/contrib/tools/python3/src/Lib/concurrent/__init__.py
+++ b/contrib/tools/python3/Lib/concurrent/__init__.py
diff --git a/contrib/tools/python3/src/Lib/concurrent/futures/__init__.py b/contrib/tools/python3/Lib/concurrent/futures/__init__.py
index 292e886d5a8..292e886d5a8 100644
--- a/contrib/tools/python3/src/Lib/concurrent/futures/__init__.py
+++ b/contrib/tools/python3/Lib/concurrent/futures/__init__.py
diff --git a/contrib/tools/python3/src/Lib/concurrent/futures/_base.py b/contrib/tools/python3/Lib/concurrent/futures/_base.py
index 6742a07753c..6742a07753c 100644
--- a/contrib/tools/python3/src/Lib/concurrent/futures/_base.py
+++ b/contrib/tools/python3/Lib/concurrent/futures/_base.py
diff --git a/contrib/tools/python3/src/Lib/concurrent/futures/process.py b/contrib/tools/python3/Lib/concurrent/futures/process.py
index 0e452883963..0e452883963 100644
--- a/contrib/tools/python3/src/Lib/concurrent/futures/process.py
+++ b/contrib/tools/python3/Lib/concurrent/futures/process.py
diff --git a/contrib/tools/python3/src/Lib/concurrent/futures/thread.py b/contrib/tools/python3/Lib/concurrent/futures/thread.py
index 3b3a36a5093..3b3a36a5093 100644
--- a/contrib/tools/python3/src/Lib/concurrent/futures/thread.py
+++ b/contrib/tools/python3/Lib/concurrent/futures/thread.py
diff --git a/contrib/tools/python3/src/Lib/configparser.py b/contrib/tools/python3/Lib/configparser.py
index e8aae217949..e8aae217949 100644
--- a/contrib/tools/python3/src/Lib/configparser.py
+++ b/contrib/tools/python3/Lib/configparser.py
diff --git a/contrib/tools/python3/src/Lib/contextlib.py b/contrib/tools/python3/Lib/contextlib.py
index b831d8916ca..b831d8916ca 100644
--- a/contrib/tools/python3/src/Lib/contextlib.py
+++ b/contrib/tools/python3/Lib/contextlib.py
diff --git a/contrib/tools/python3/src/Lib/contextvars.py b/contrib/tools/python3/Lib/contextvars.py
index d78c80dfe6f..d78c80dfe6f 100644
--- a/contrib/tools/python3/src/Lib/contextvars.py
+++ b/contrib/tools/python3/Lib/contextvars.py
diff --git a/contrib/tools/python3/src/Lib/copy.py b/contrib/tools/python3/Lib/copy.py
index da2908ef623..da2908ef623 100644
--- a/contrib/tools/python3/src/Lib/copy.py
+++ b/contrib/tools/python3/Lib/copy.py
diff --git a/contrib/tools/python3/src/Lib/copyreg.py b/contrib/tools/python3/Lib/copyreg.py
index 578392409b4..578392409b4 100644
--- a/contrib/tools/python3/src/Lib/copyreg.py
+++ b/contrib/tools/python3/Lib/copyreg.py
diff --git a/contrib/tools/python3/src/Lib/crypt.py b/contrib/tools/python3/Lib/crypt.py
index de4a14a3884..de4a14a3884 100644
--- a/contrib/tools/python3/src/Lib/crypt.py
+++ b/contrib/tools/python3/Lib/crypt.py
diff --git a/contrib/tools/python3/src/Lib/csv.py b/contrib/tools/python3/Lib/csv.py
index 77f30c8d2b1..77f30c8d2b1 100644
--- a/contrib/tools/python3/src/Lib/csv.py
+++ b/contrib/tools/python3/Lib/csv.py
diff --git a/contrib/tools/python3/src/Lib/ctypes/__init__.py b/contrib/tools/python3/Lib/ctypes/__init__.py
index 45b5d7f8e9d..45b5d7f8e9d 100644
--- a/contrib/tools/python3/src/Lib/ctypes/__init__.py
+++ b/contrib/tools/python3/Lib/ctypes/__init__.py
diff --git a/contrib/tools/python3/src/Lib/ctypes/_aix.py b/contrib/tools/python3/Lib/ctypes/_aix.py
index ee790f713a9..ee790f713a9 100644
--- a/contrib/tools/python3/src/Lib/ctypes/_aix.py
+++ b/contrib/tools/python3/Lib/ctypes/_aix.py
diff --git a/contrib/tools/python3/src/Lib/ctypes/_endian.py b/contrib/tools/python3/Lib/ctypes/_endian.py
index 04389008a8a..04389008a8a 100644
--- a/contrib/tools/python3/src/Lib/ctypes/_endian.py
+++ b/contrib/tools/python3/Lib/ctypes/_endian.py
diff --git a/contrib/tools/python3/src/Lib/ctypes/macholib/__init__.py b/contrib/tools/python3/Lib/ctypes/macholib/__init__.py
index 5621defccd6..5621defccd6 100644
--- a/contrib/tools/python3/src/Lib/ctypes/macholib/__init__.py
+++ b/contrib/tools/python3/Lib/ctypes/macholib/__init__.py
diff --git a/contrib/tools/python3/src/Lib/ctypes/macholib/dyld.py b/contrib/tools/python3/Lib/ctypes/macholib/dyld.py
index 583c47daff3..583c47daff3 100644
--- a/contrib/tools/python3/src/Lib/ctypes/macholib/dyld.py
+++ b/contrib/tools/python3/Lib/ctypes/macholib/dyld.py
diff --git a/contrib/tools/python3/src/Lib/ctypes/macholib/dylib.py b/contrib/tools/python3/Lib/ctypes/macholib/dylib.py
index 0ad4cba8da3..0ad4cba8da3 100644
--- a/contrib/tools/python3/src/Lib/ctypes/macholib/dylib.py
+++ b/contrib/tools/python3/Lib/ctypes/macholib/dylib.py
diff --git a/contrib/tools/python3/src/Lib/ctypes/macholib/framework.py b/contrib/tools/python3/Lib/ctypes/macholib/framework.py
index 495679fff19..495679fff19 100644
--- a/contrib/tools/python3/src/Lib/ctypes/macholib/framework.py
+++ b/contrib/tools/python3/Lib/ctypes/macholib/framework.py
diff --git a/contrib/tools/python3/src/Lib/ctypes/util.py b/contrib/tools/python3/Lib/ctypes/util.py
index e6d14ef6ebe..e6d14ef6ebe 100644
--- a/contrib/tools/python3/src/Lib/ctypes/util.py
+++ b/contrib/tools/python3/Lib/ctypes/util.py
diff --git a/contrib/tools/python3/src/Lib/ctypes/wintypes.py b/contrib/tools/python3/Lib/ctypes/wintypes.py
index 9c4e721438a..9c4e721438a 100644
--- a/contrib/tools/python3/src/Lib/ctypes/wintypes.py
+++ b/contrib/tools/python3/Lib/ctypes/wintypes.py
diff --git a/contrib/tools/python3/src/Lib/curses/__init__.py b/contrib/tools/python3/Lib/curses/__init__.py
index 69270bfcd2b..69270bfcd2b 100644
--- a/contrib/tools/python3/src/Lib/curses/__init__.py
+++ b/contrib/tools/python3/Lib/curses/__init__.py
diff --git a/contrib/tools/python3/src/Lib/curses/ascii.py b/contrib/tools/python3/Lib/curses/ascii.py
index 95acff33925..95acff33925 100644
--- a/contrib/tools/python3/src/Lib/curses/ascii.py
+++ b/contrib/tools/python3/Lib/curses/ascii.py
diff --git a/contrib/tools/python3/src/Lib/curses/has_key.py b/contrib/tools/python3/Lib/curses/has_key.py
index 4e37b480f13..4e37b480f13 100644
--- a/contrib/tools/python3/src/Lib/curses/has_key.py
+++ b/contrib/tools/python3/Lib/curses/has_key.py
diff --git a/contrib/tools/python3/src/Lib/curses/panel.py b/contrib/tools/python3/Lib/curses/panel.py
index 067afef730a..067afef730a 100644
--- a/contrib/tools/python3/src/Lib/curses/panel.py
+++ b/contrib/tools/python3/Lib/curses/panel.py
diff --git a/contrib/tools/python3/src/Lib/curses/textpad.py b/contrib/tools/python3/Lib/curses/textpad.py
index aa87061b8d7..aa87061b8d7 100644
--- a/contrib/tools/python3/src/Lib/curses/textpad.py
+++ b/contrib/tools/python3/Lib/curses/textpad.py
diff --git a/contrib/tools/python3/src/Lib/dataclasses.py b/contrib/tools/python3/Lib/dataclasses.py
index 3eacba840db..3eacba840db 100644
--- a/contrib/tools/python3/src/Lib/dataclasses.py
+++ b/contrib/tools/python3/Lib/dataclasses.py
diff --git a/contrib/tools/python3/src/Lib/datetime.py b/contrib/tools/python3/Lib/datetime.py
index a33d2d724cb..a33d2d724cb 100644
--- a/contrib/tools/python3/src/Lib/datetime.py
+++ b/contrib/tools/python3/Lib/datetime.py
diff --git a/contrib/tools/python3/src/Lib/dbm/__init__.py b/contrib/tools/python3/Lib/dbm/__init__.py
index 8055d3769f9..8055d3769f9 100644
--- a/contrib/tools/python3/src/Lib/dbm/__init__.py
+++ b/contrib/tools/python3/Lib/dbm/__init__.py
diff --git a/contrib/tools/python3/src/Lib/dbm/dumb.py b/contrib/tools/python3/Lib/dbm/dumb.py
index 754624ccc8f..754624ccc8f 100644
--- a/contrib/tools/python3/src/Lib/dbm/dumb.py
+++ b/contrib/tools/python3/Lib/dbm/dumb.py
diff --git a/contrib/tools/python3/src/Lib/dbm/gnu.py b/contrib/tools/python3/Lib/dbm/gnu.py
index b07a1defffd..b07a1defffd 100644
--- a/contrib/tools/python3/src/Lib/dbm/gnu.py
+++ b/contrib/tools/python3/Lib/dbm/gnu.py
diff --git a/contrib/tools/python3/src/Lib/dbm/ndbm.py b/contrib/tools/python3/Lib/dbm/ndbm.py
index 23056a29ef2..23056a29ef2 100644
--- a/contrib/tools/python3/src/Lib/dbm/ndbm.py
+++ b/contrib/tools/python3/Lib/dbm/ndbm.py
diff --git a/contrib/tools/python3/src/Lib/decimal.py b/contrib/tools/python3/Lib/decimal.py
index 7746ea26010..7746ea26010 100644
--- a/contrib/tools/python3/src/Lib/decimal.py
+++ b/contrib/tools/python3/Lib/decimal.py
diff --git a/contrib/tools/python3/src/Lib/difflib.py b/contrib/tools/python3/Lib/difflib.py
index ba0b256969e..ba0b256969e 100644
--- a/contrib/tools/python3/src/Lib/difflib.py
+++ b/contrib/tools/python3/Lib/difflib.py
diff --git a/contrib/tools/python3/src/Lib/dis.py b/contrib/tools/python3/Lib/dis.py
index 320dec03d25..320dec03d25 100644
--- a/contrib/tools/python3/src/Lib/dis.py
+++ b/contrib/tools/python3/Lib/dis.py
diff --git a/contrib/tools/python3/src/Lib/doctest.py b/contrib/tools/python3/Lib/doctest.py
index 087c52327fe..087c52327fe 100644
--- a/contrib/tools/python3/src/Lib/doctest.py
+++ b/contrib/tools/python3/Lib/doctest.py
diff --git a/contrib/tools/python3/src/Lib/email/__init__.py b/contrib/tools/python3/Lib/email/__init__.py
index 9fa47783004..9fa47783004 100644
--- a/contrib/tools/python3/src/Lib/email/__init__.py
+++ b/contrib/tools/python3/Lib/email/__init__.py
diff --git a/contrib/tools/python3/src/Lib/email/_encoded_words.py b/contrib/tools/python3/Lib/email/_encoded_words.py
index 6795a606de0..6795a606de0 100644
--- a/contrib/tools/python3/src/Lib/email/_encoded_words.py
+++ b/contrib/tools/python3/Lib/email/_encoded_words.py
diff --git a/contrib/tools/python3/src/Lib/email/_header_value_parser.py b/contrib/tools/python3/Lib/email/_header_value_parser.py
index 5b653f66c18..5b653f66c18 100644
--- a/contrib/tools/python3/src/Lib/email/_header_value_parser.py
+++ b/contrib/tools/python3/Lib/email/_header_value_parser.py
diff --git a/contrib/tools/python3/src/Lib/email/_parseaddr.py b/contrib/tools/python3/Lib/email/_parseaddr.py
index febe411355d..febe411355d 100644
--- a/contrib/tools/python3/src/Lib/email/_parseaddr.py
+++ b/contrib/tools/python3/Lib/email/_parseaddr.py
diff --git a/contrib/tools/python3/src/Lib/email/_policybase.py b/contrib/tools/python3/Lib/email/_policybase.py
index c9cbadd2a80..c9cbadd2a80 100644
--- a/contrib/tools/python3/src/Lib/email/_policybase.py
+++ b/contrib/tools/python3/Lib/email/_policybase.py
diff --git a/contrib/tools/python3/src/Lib/email/base64mime.py b/contrib/tools/python3/Lib/email/base64mime.py
index 4cdf22666e3..4cdf22666e3 100644
--- a/contrib/tools/python3/src/Lib/email/base64mime.py
+++ b/contrib/tools/python3/Lib/email/base64mime.py
diff --git a/contrib/tools/python3/src/Lib/email/charset.py b/contrib/tools/python3/Lib/email/charset.py
index 043801107b6..043801107b6 100644
--- a/contrib/tools/python3/src/Lib/email/charset.py
+++ b/contrib/tools/python3/Lib/email/charset.py
diff --git a/contrib/tools/python3/src/Lib/email/contentmanager.py b/contrib/tools/python3/Lib/email/contentmanager.py
index b4f5830bead..b4f5830bead 100644
--- a/contrib/tools/python3/src/Lib/email/contentmanager.py
+++ b/contrib/tools/python3/Lib/email/contentmanager.py
diff --git a/contrib/tools/python3/src/Lib/email/encoders.py b/contrib/tools/python3/Lib/email/encoders.py
index 17bd1ab7b19..17bd1ab7b19 100644
--- a/contrib/tools/python3/src/Lib/email/encoders.py
+++ b/contrib/tools/python3/Lib/email/encoders.py
diff --git a/contrib/tools/python3/src/Lib/email/errors.py b/contrib/tools/python3/Lib/email/errors.py
index 3ad00565549..3ad00565549 100644
--- a/contrib/tools/python3/src/Lib/email/errors.py
+++ b/contrib/tools/python3/Lib/email/errors.py
diff --git a/contrib/tools/python3/src/Lib/email/feedparser.py b/contrib/tools/python3/Lib/email/feedparser.py
index c2881d9bc52..c2881d9bc52 100644
--- a/contrib/tools/python3/src/Lib/email/feedparser.py
+++ b/contrib/tools/python3/Lib/email/feedparser.py
diff --git a/contrib/tools/python3/src/Lib/email/generator.py b/contrib/tools/python3/Lib/email/generator.py
index 7ccbe10eb76..7ccbe10eb76 100644
--- a/contrib/tools/python3/src/Lib/email/generator.py
+++ b/contrib/tools/python3/Lib/email/generator.py
diff --git a/contrib/tools/python3/src/Lib/email/header.py b/contrib/tools/python3/Lib/email/header.py
index 984851a7d9a..984851a7d9a 100644
--- a/contrib/tools/python3/src/Lib/email/header.py
+++ b/contrib/tools/python3/Lib/email/header.py
diff --git a/contrib/tools/python3/src/Lib/email/headerregistry.py b/contrib/tools/python3/Lib/email/headerregistry.py
index 543141dc427..543141dc427 100644
--- a/contrib/tools/python3/src/Lib/email/headerregistry.py
+++ b/contrib/tools/python3/Lib/email/headerregistry.py
diff --git a/contrib/tools/python3/src/Lib/email/iterators.py b/contrib/tools/python3/Lib/email/iterators.py
index 3410935e38f..3410935e38f 100644
--- a/contrib/tools/python3/src/Lib/email/iterators.py
+++ b/contrib/tools/python3/Lib/email/iterators.py
diff --git a/contrib/tools/python3/src/Lib/email/message.py b/contrib/tools/python3/Lib/email/message.py
index fe769580fed..fe769580fed 100644
--- a/contrib/tools/python3/src/Lib/email/message.py
+++ b/contrib/tools/python3/Lib/email/message.py
diff --git a/contrib/tools/python3/src/Lib/pydoc_data/__init__.py b/contrib/tools/python3/Lib/email/mime/__init__.py
index e69de29bb2d..e69de29bb2d 100644
--- a/contrib/tools/python3/src/Lib/pydoc_data/__init__.py
+++ b/contrib/tools/python3/Lib/email/mime/__init__.py
diff --git a/contrib/tools/python3/src/Lib/email/mime/application.py b/contrib/tools/python3/Lib/email/mime/application.py
index f67cbad3f03..f67cbad3f03 100644
--- a/contrib/tools/python3/src/Lib/email/mime/application.py
+++ b/contrib/tools/python3/Lib/email/mime/application.py
diff --git a/contrib/tools/python3/src/Lib/email/mime/audio.py b/contrib/tools/python3/Lib/email/mime/audio.py
index 065819b2a21..065819b2a21 100644
--- a/contrib/tools/python3/src/Lib/email/mime/audio.py
+++ b/contrib/tools/python3/Lib/email/mime/audio.py
diff --git a/contrib/tools/python3/src/Lib/email/mime/base.py b/contrib/tools/python3/Lib/email/mime/base.py
index f601f621cec..f601f621cec 100644
--- a/contrib/tools/python3/src/Lib/email/mime/base.py
+++ b/contrib/tools/python3/Lib/email/mime/base.py
diff --git a/contrib/tools/python3/src/Lib/email/mime/image.py b/contrib/tools/python3/Lib/email/mime/image.py
index 4b7f2f9cbad..4b7f2f9cbad 100644
--- a/contrib/tools/python3/src/Lib/email/mime/image.py
+++ b/contrib/tools/python3/Lib/email/mime/image.py
diff --git a/contrib/tools/python3/src/Lib/email/mime/message.py b/contrib/tools/python3/Lib/email/mime/message.py
index 61836b5a786..61836b5a786 100644
--- a/contrib/tools/python3/src/Lib/email/mime/message.py
+++ b/contrib/tools/python3/Lib/email/mime/message.py
diff --git a/contrib/tools/python3/src/Lib/email/mime/multipart.py b/contrib/tools/python3/Lib/email/mime/multipart.py
index 94d81c771a4..94d81c771a4 100644
--- a/contrib/tools/python3/src/Lib/email/mime/multipart.py
+++ b/contrib/tools/python3/Lib/email/mime/multipart.py
diff --git a/contrib/tools/python3/src/Lib/email/mime/nonmultipart.py b/contrib/tools/python3/Lib/email/mime/nonmultipart.py
index a41386eb148..a41386eb148 100644
--- a/contrib/tools/python3/src/Lib/email/mime/nonmultipart.py
+++ b/contrib/tools/python3/Lib/email/mime/nonmultipart.py
diff --git a/contrib/tools/python3/src/Lib/email/mime/text.py b/contrib/tools/python3/Lib/email/mime/text.py
index 7672b789138..7672b789138 100644
--- a/contrib/tools/python3/src/Lib/email/mime/text.py
+++ b/contrib/tools/python3/Lib/email/mime/text.py
diff --git a/contrib/tools/python3/src/Lib/email/parser.py b/contrib/tools/python3/Lib/email/parser.py
index 06d99b17f2f..06d99b17f2f 100644
--- a/contrib/tools/python3/src/Lib/email/parser.py
+++ b/contrib/tools/python3/Lib/email/parser.py
diff --git a/contrib/tools/python3/src/Lib/email/policy.py b/contrib/tools/python3/Lib/email/policy.py
index 8816c84ed17..8816c84ed17 100644
--- a/contrib/tools/python3/src/Lib/email/policy.py
+++ b/contrib/tools/python3/Lib/email/policy.py
diff --git a/contrib/tools/python3/src/Lib/email/quoprimime.py b/contrib/tools/python3/Lib/email/quoprimime.py
index 27fcbb5a26e..27fcbb5a26e 100644
--- a/contrib/tools/python3/src/Lib/email/quoprimime.py
+++ b/contrib/tools/python3/Lib/email/quoprimime.py
diff --git a/contrib/tools/python3/src/Lib/email/utils.py b/contrib/tools/python3/Lib/email/utils.py
index aa949aa933a..aa949aa933a 100644
--- a/contrib/tools/python3/src/Lib/email/utils.py
+++ b/contrib/tools/python3/Lib/email/utils.py
diff --git a/contrib/tools/python3/src/Lib/encodings/__init__.py b/contrib/tools/python3/Lib/encodings/__init__.py
index f9075b8f0d9..f9075b8f0d9 100644
--- a/contrib/tools/python3/src/Lib/encodings/__init__.py
+++ b/contrib/tools/python3/Lib/encodings/__init__.py
diff --git a/contrib/tools/python3/src/Lib/encodings/aliases.py b/contrib/tools/python3/Lib/encodings/aliases.py
index d85afd6d5cf..d85afd6d5cf 100644
--- a/contrib/tools/python3/src/Lib/encodings/aliases.py
+++ b/contrib/tools/python3/Lib/encodings/aliases.py
diff --git a/contrib/tools/python3/src/Lib/encodings/ascii.py b/contrib/tools/python3/Lib/encodings/ascii.py
index 2033cde9748..2033cde9748 100644
--- a/contrib/tools/python3/src/Lib/encodings/ascii.py
+++ b/contrib/tools/python3/Lib/encodings/ascii.py
diff --git a/contrib/tools/python3/src/Lib/encodings/base64_codec.py b/contrib/tools/python3/Lib/encodings/base64_codec.py
index 8e7703b3b60..8e7703b3b60 100644
--- a/contrib/tools/python3/src/Lib/encodings/base64_codec.py
+++ b/contrib/tools/python3/Lib/encodings/base64_codec.py
diff --git a/contrib/tools/python3/src/Lib/encodings/big5.py b/contrib/tools/python3/Lib/encodings/big5.py
index 7adeb0e1605..7adeb0e1605 100644
--- a/contrib/tools/python3/src/Lib/encodings/big5.py
+++ b/contrib/tools/python3/Lib/encodings/big5.py
diff --git a/contrib/tools/python3/src/Lib/encodings/big5hkscs.py b/contrib/tools/python3/Lib/encodings/big5hkscs.py
index 350df37baae..350df37baae 100644
--- a/contrib/tools/python3/src/Lib/encodings/big5hkscs.py
+++ b/contrib/tools/python3/Lib/encodings/big5hkscs.py
diff --git a/contrib/tools/python3/src/Lib/encodings/bz2_codec.py b/contrib/tools/python3/Lib/encodings/bz2_codec.py
index fd9495e341b..fd9495e341b 100644
--- a/contrib/tools/python3/src/Lib/encodings/bz2_codec.py
+++ b/contrib/tools/python3/Lib/encodings/bz2_codec.py
diff --git a/contrib/tools/python3/src/Lib/encodings/charmap.py b/contrib/tools/python3/Lib/encodings/charmap.py
index 81189b161a6..81189b161a6 100644
--- a/contrib/tools/python3/src/Lib/encodings/charmap.py
+++ b/contrib/tools/python3/Lib/encodings/charmap.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp037.py b/contrib/tools/python3/Lib/encodings/cp037.py
index 4edd708f3d7..4edd708f3d7 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp037.py
+++ b/contrib/tools/python3/Lib/encodings/cp037.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp1006.py b/contrib/tools/python3/Lib/encodings/cp1006.py
index a1221c3ef1c..a1221c3ef1c 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp1006.py
+++ b/contrib/tools/python3/Lib/encodings/cp1006.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp1026.py b/contrib/tools/python3/Lib/encodings/cp1026.py
index 46f71f74dae..46f71f74dae 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp1026.py
+++ b/contrib/tools/python3/Lib/encodings/cp1026.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp1125.py b/contrib/tools/python3/Lib/encodings/cp1125.py
index b1fd69deb07..b1fd69deb07 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp1125.py
+++ b/contrib/tools/python3/Lib/encodings/cp1125.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp1140.py b/contrib/tools/python3/Lib/encodings/cp1140.py
index 0a919d837e1..0a919d837e1 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp1140.py
+++ b/contrib/tools/python3/Lib/encodings/cp1140.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp1250.py b/contrib/tools/python3/Lib/encodings/cp1250.py
index c2c83aaf3e8..c2c83aaf3e8 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp1250.py
+++ b/contrib/tools/python3/Lib/encodings/cp1250.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp1251.py b/contrib/tools/python3/Lib/encodings/cp1251.py
index 22bc66002d3..22bc66002d3 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp1251.py
+++ b/contrib/tools/python3/Lib/encodings/cp1251.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp1252.py b/contrib/tools/python3/Lib/encodings/cp1252.py
index c0e8088ea82..c0e8088ea82 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp1252.py
+++ b/contrib/tools/python3/Lib/encodings/cp1252.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp1253.py b/contrib/tools/python3/Lib/encodings/cp1253.py
index ec9c0972d10..ec9c0972d10 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp1253.py
+++ b/contrib/tools/python3/Lib/encodings/cp1253.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp1254.py b/contrib/tools/python3/Lib/encodings/cp1254.py
index 4912327a5bc..4912327a5bc 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp1254.py
+++ b/contrib/tools/python3/Lib/encodings/cp1254.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp1255.py b/contrib/tools/python3/Lib/encodings/cp1255.py
index 91ce26b9bff..91ce26b9bff 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp1255.py
+++ b/contrib/tools/python3/Lib/encodings/cp1255.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp1256.py b/contrib/tools/python3/Lib/encodings/cp1256.py
index fd6afab52c6..fd6afab52c6 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp1256.py
+++ b/contrib/tools/python3/Lib/encodings/cp1256.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp1257.py b/contrib/tools/python3/Lib/encodings/cp1257.py
index 9ebc90d509d..9ebc90d509d 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp1257.py
+++ b/contrib/tools/python3/Lib/encodings/cp1257.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp1258.py b/contrib/tools/python3/Lib/encodings/cp1258.py
index 784378a8369..784378a8369 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp1258.py
+++ b/contrib/tools/python3/Lib/encodings/cp1258.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp273.py b/contrib/tools/python3/Lib/encodings/cp273.py
index 69c6d778c57..69c6d778c57 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp273.py
+++ b/contrib/tools/python3/Lib/encodings/cp273.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp424.py b/contrib/tools/python3/Lib/encodings/cp424.py
index 6753daf122d..6753daf122d 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp424.py
+++ b/contrib/tools/python3/Lib/encodings/cp424.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp437.py b/contrib/tools/python3/Lib/encodings/cp437.py
index b6c75e2ca1c..b6c75e2ca1c 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp437.py
+++ b/contrib/tools/python3/Lib/encodings/cp437.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp500.py b/contrib/tools/python3/Lib/encodings/cp500.py
index 5f61535f82a..5f61535f82a 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp500.py
+++ b/contrib/tools/python3/Lib/encodings/cp500.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp720.py b/contrib/tools/python3/Lib/encodings/cp720.py
index 96d609616c4..96d609616c4 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp720.py
+++ b/contrib/tools/python3/Lib/encodings/cp720.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp737.py b/contrib/tools/python3/Lib/encodings/cp737.py
index 9685bae75b3..9685bae75b3 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp737.py
+++ b/contrib/tools/python3/Lib/encodings/cp737.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp775.py b/contrib/tools/python3/Lib/encodings/cp775.py
index fe06e7bc3b3..fe06e7bc3b3 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp775.py
+++ b/contrib/tools/python3/Lib/encodings/cp775.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp850.py b/contrib/tools/python3/Lib/encodings/cp850.py
index f98aef99fb6..f98aef99fb6 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp850.py
+++ b/contrib/tools/python3/Lib/encodings/cp850.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp852.py b/contrib/tools/python3/Lib/encodings/cp852.py
index 34d8a0ea5ac..34d8a0ea5ac 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp852.py
+++ b/contrib/tools/python3/Lib/encodings/cp852.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp855.py b/contrib/tools/python3/Lib/encodings/cp855.py
index 4fe9210697c..4fe9210697c 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp855.py
+++ b/contrib/tools/python3/Lib/encodings/cp855.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp856.py b/contrib/tools/python3/Lib/encodings/cp856.py
index cacbfb2f804..cacbfb2f804 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp856.py
+++ b/contrib/tools/python3/Lib/encodings/cp856.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp857.py b/contrib/tools/python3/Lib/encodings/cp857.py
index 741b059b9a2..741b059b9a2 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp857.py
+++ b/contrib/tools/python3/Lib/encodings/cp857.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp858.py b/contrib/tools/python3/Lib/encodings/cp858.py
index 7579f525386..7579f525386 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp858.py
+++ b/contrib/tools/python3/Lib/encodings/cp858.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp860.py b/contrib/tools/python3/Lib/encodings/cp860.py
index 65903e74641..65903e74641 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp860.py
+++ b/contrib/tools/python3/Lib/encodings/cp860.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp861.py b/contrib/tools/python3/Lib/encodings/cp861.py
index 860a05fa3f4..860a05fa3f4 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp861.py
+++ b/contrib/tools/python3/Lib/encodings/cp861.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp862.py b/contrib/tools/python3/Lib/encodings/cp862.py
index 3df22f997b7..3df22f997b7 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp862.py
+++ b/contrib/tools/python3/Lib/encodings/cp862.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp863.py b/contrib/tools/python3/Lib/encodings/cp863.py
index 764180b6232..764180b6232 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp863.py
+++ b/contrib/tools/python3/Lib/encodings/cp863.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp864.py b/contrib/tools/python3/Lib/encodings/cp864.py
index 53df482dcd6..53df482dcd6 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp864.py
+++ b/contrib/tools/python3/Lib/encodings/cp864.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp865.py b/contrib/tools/python3/Lib/encodings/cp865.py
index 6726cf3f9ed..6726cf3f9ed 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp865.py
+++ b/contrib/tools/python3/Lib/encodings/cp865.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp866.py b/contrib/tools/python3/Lib/encodings/cp866.py
index bec7ae39fba..bec7ae39fba 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp866.py
+++ b/contrib/tools/python3/Lib/encodings/cp866.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp869.py b/contrib/tools/python3/Lib/encodings/cp869.py
index 8d8a29b175c..8d8a29b175c 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp869.py
+++ b/contrib/tools/python3/Lib/encodings/cp869.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp874.py b/contrib/tools/python3/Lib/encodings/cp874.py
index 59bfcbc98ab..59bfcbc98ab 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp874.py
+++ b/contrib/tools/python3/Lib/encodings/cp874.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp875.py b/contrib/tools/python3/Lib/encodings/cp875.py
index c25a5a43bc4..c25a5a43bc4 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp875.py
+++ b/contrib/tools/python3/Lib/encodings/cp875.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp932.py b/contrib/tools/python3/Lib/encodings/cp932.py
index e01f59b7190..e01f59b7190 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp932.py
+++ b/contrib/tools/python3/Lib/encodings/cp932.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp949.py b/contrib/tools/python3/Lib/encodings/cp949.py
index 627c87125e2..627c87125e2 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp949.py
+++ b/contrib/tools/python3/Lib/encodings/cp949.py
diff --git a/contrib/tools/python3/src/Lib/encodings/cp950.py b/contrib/tools/python3/Lib/encodings/cp950.py
index 39eec5ed0dd..39eec5ed0dd 100644
--- a/contrib/tools/python3/src/Lib/encodings/cp950.py
+++ b/contrib/tools/python3/Lib/encodings/cp950.py
diff --git a/contrib/tools/python3/src/Lib/encodings/euc_jis_2004.py b/contrib/tools/python3/Lib/encodings/euc_jis_2004.py
index 72b87aea688..72b87aea688 100644
--- a/contrib/tools/python3/src/Lib/encodings/euc_jis_2004.py
+++ b/contrib/tools/python3/Lib/encodings/euc_jis_2004.py
diff --git a/contrib/tools/python3/src/Lib/encodings/euc_jisx0213.py b/contrib/tools/python3/Lib/encodings/euc_jisx0213.py
index cc47d04112a..cc47d04112a 100644
--- a/contrib/tools/python3/src/Lib/encodings/euc_jisx0213.py
+++ b/contrib/tools/python3/Lib/encodings/euc_jisx0213.py
diff --git a/contrib/tools/python3/src/Lib/encodings/euc_jp.py b/contrib/tools/python3/Lib/encodings/euc_jp.py
index 7bcbe4147f2..7bcbe4147f2 100644
--- a/contrib/tools/python3/src/Lib/encodings/euc_jp.py
+++ b/contrib/tools/python3/Lib/encodings/euc_jp.py
diff --git a/contrib/tools/python3/src/Lib/encodings/euc_kr.py b/contrib/tools/python3/Lib/encodings/euc_kr.py
index c1fb1260e87..c1fb1260e87 100644
--- a/contrib/tools/python3/src/Lib/encodings/euc_kr.py
+++ b/contrib/tools/python3/Lib/encodings/euc_kr.py
diff --git a/contrib/tools/python3/src/Lib/encodings/gb18030.py b/contrib/tools/python3/Lib/encodings/gb18030.py
index 34fb6c366a7..34fb6c366a7 100644
--- a/contrib/tools/python3/src/Lib/encodings/gb18030.py
+++ b/contrib/tools/python3/Lib/encodings/gb18030.py
diff --git a/contrib/tools/python3/src/Lib/encodings/gb2312.py b/contrib/tools/python3/Lib/encodings/gb2312.py
index 3c3b837d618..3c3b837d618 100644
--- a/contrib/tools/python3/src/Lib/encodings/gb2312.py
+++ b/contrib/tools/python3/Lib/encodings/gb2312.py
diff --git a/contrib/tools/python3/src/Lib/encodings/gbk.py b/contrib/tools/python3/Lib/encodings/gbk.py
index 1b45db89859..1b45db89859 100644
--- a/contrib/tools/python3/src/Lib/encodings/gbk.py
+++ b/contrib/tools/python3/Lib/encodings/gbk.py
diff --git a/contrib/tools/python3/src/Lib/encodings/hex_codec.py b/contrib/tools/python3/Lib/encodings/hex_codec.py
index 9fb10728044..9fb10728044 100644
--- a/contrib/tools/python3/src/Lib/encodings/hex_codec.py
+++ b/contrib/tools/python3/Lib/encodings/hex_codec.py
diff --git a/contrib/tools/python3/src/Lib/encodings/hp_roman8.py b/contrib/tools/python3/Lib/encodings/hp_roman8.py
index 58de1033c13..58de1033c13 100644
--- a/contrib/tools/python3/src/Lib/encodings/hp_roman8.py
+++ b/contrib/tools/python3/Lib/encodings/hp_roman8.py
diff --git a/contrib/tools/python3/src/Lib/encodings/hz.py b/contrib/tools/python3/Lib/encodings/hz.py
index 383442a3c9a..383442a3c9a 100644
--- a/contrib/tools/python3/src/Lib/encodings/hz.py
+++ b/contrib/tools/python3/Lib/encodings/hz.py
diff --git a/contrib/tools/python3/src/Lib/encodings/idna.py b/contrib/tools/python3/Lib/encodings/idna.py
index 5396047a7fb..5396047a7fb 100644
--- a/contrib/tools/python3/src/Lib/encodings/idna.py
+++ b/contrib/tools/python3/Lib/encodings/idna.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso2022_jp.py b/contrib/tools/python3/Lib/encodings/iso2022_jp.py
index ab040606935..ab040606935 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso2022_jp.py
+++ b/contrib/tools/python3/Lib/encodings/iso2022_jp.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso2022_jp_1.py b/contrib/tools/python3/Lib/encodings/iso2022_jp_1.py
index 997044dc378..997044dc378 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso2022_jp_1.py
+++ b/contrib/tools/python3/Lib/encodings/iso2022_jp_1.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso2022_jp_2.py b/contrib/tools/python3/Lib/encodings/iso2022_jp_2.py
index 9106bf76251..9106bf76251 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso2022_jp_2.py
+++ b/contrib/tools/python3/Lib/encodings/iso2022_jp_2.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso2022_jp_2004.py b/contrib/tools/python3/Lib/encodings/iso2022_jp_2004.py
index 40198bf0985..40198bf0985 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso2022_jp_2004.py
+++ b/contrib/tools/python3/Lib/encodings/iso2022_jp_2004.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso2022_jp_3.py b/contrib/tools/python3/Lib/encodings/iso2022_jp_3.py
index 346e08beccb..346e08beccb 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso2022_jp_3.py
+++ b/contrib/tools/python3/Lib/encodings/iso2022_jp_3.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso2022_jp_ext.py b/contrib/tools/python3/Lib/encodings/iso2022_jp_ext.py
index 752bab9813a..752bab9813a 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso2022_jp_ext.py
+++ b/contrib/tools/python3/Lib/encodings/iso2022_jp_ext.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso2022_kr.py b/contrib/tools/python3/Lib/encodings/iso2022_kr.py
index bf7018763ea..bf7018763ea 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso2022_kr.py
+++ b/contrib/tools/python3/Lib/encodings/iso2022_kr.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_1.py b/contrib/tools/python3/Lib/encodings/iso8859_1.py
index 8cfc01fe14e..8cfc01fe14e 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_1.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_1.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_10.py b/contrib/tools/python3/Lib/encodings/iso8859_10.py
index b4fb0419c42..b4fb0419c42 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_10.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_10.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_11.py b/contrib/tools/python3/Lib/encodings/iso8859_11.py
index c7258ecf464..c7258ecf464 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_11.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_11.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_13.py b/contrib/tools/python3/Lib/encodings/iso8859_13.py
index 6f8eab2b821..6f8eab2b821 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_13.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_13.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_14.py b/contrib/tools/python3/Lib/encodings/iso8859_14.py
index 7568d4ee1f0..7568d4ee1f0 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_14.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_14.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_15.py b/contrib/tools/python3/Lib/encodings/iso8859_15.py
index 43bdecd4468..43bdecd4468 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_15.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_15.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_16.py b/contrib/tools/python3/Lib/encodings/iso8859_16.py
index e70c96e3335..e70c96e3335 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_16.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_16.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_2.py b/contrib/tools/python3/Lib/encodings/iso8859_2.py
index 3698747b479..3698747b479 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_2.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_2.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_3.py b/contrib/tools/python3/Lib/encodings/iso8859_3.py
index 96d3063ea68..96d3063ea68 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_3.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_3.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_4.py b/contrib/tools/python3/Lib/encodings/iso8859_4.py
index 65c1e00f306..65c1e00f306 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_4.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_4.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_5.py b/contrib/tools/python3/Lib/encodings/iso8859_5.py
index a3c868a50c5..a3c868a50c5 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_5.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_5.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_6.py b/contrib/tools/python3/Lib/encodings/iso8859_6.py
index b02ade6eaf4..b02ade6eaf4 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_6.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_6.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_7.py b/contrib/tools/python3/Lib/encodings/iso8859_7.py
index d7b39cbc3a7..d7b39cbc3a7 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_7.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_7.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_8.py b/contrib/tools/python3/Lib/encodings/iso8859_8.py
index 81849027388..81849027388 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_8.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_8.py
diff --git a/contrib/tools/python3/src/Lib/encodings/iso8859_9.py b/contrib/tools/python3/Lib/encodings/iso8859_9.py
index e539fddac6c..e539fddac6c 100644
--- a/contrib/tools/python3/src/Lib/encodings/iso8859_9.py
+++ b/contrib/tools/python3/Lib/encodings/iso8859_9.py
diff --git a/contrib/tools/python3/src/Lib/encodings/johab.py b/contrib/tools/python3/Lib/encodings/johab.py
index 512aeeb732b..512aeeb732b 100644
--- a/contrib/tools/python3/src/Lib/encodings/johab.py
+++ b/contrib/tools/python3/Lib/encodings/johab.py
diff --git a/contrib/tools/python3/src/Lib/encodings/koi8_r.py b/contrib/tools/python3/Lib/encodings/koi8_r.py
index 41ddde856e6..41ddde856e6 100644
--- a/contrib/tools/python3/src/Lib/encodings/koi8_r.py
+++ b/contrib/tools/python3/Lib/encodings/koi8_r.py
diff --git a/contrib/tools/python3/src/Lib/encodings/koi8_t.py b/contrib/tools/python3/Lib/encodings/koi8_t.py
index b5415ba3665..b5415ba3665 100644
--- a/contrib/tools/python3/src/Lib/encodings/koi8_t.py
+++ b/contrib/tools/python3/Lib/encodings/koi8_t.py
diff --git a/contrib/tools/python3/src/Lib/encodings/koi8_u.py b/contrib/tools/python3/Lib/encodings/koi8_u.py
index f9e3fae5fa2..f9e3fae5fa2 100644
--- a/contrib/tools/python3/src/Lib/encodings/koi8_u.py
+++ b/contrib/tools/python3/Lib/encodings/koi8_u.py
diff --git a/contrib/tools/python3/src/Lib/encodings/kz1048.py b/contrib/tools/python3/Lib/encodings/kz1048.py
index 712aee6e930..712aee6e930 100644
--- a/contrib/tools/python3/src/Lib/encodings/kz1048.py
+++ b/contrib/tools/python3/Lib/encodings/kz1048.py
diff --git a/contrib/tools/python3/src/Lib/encodings/latin_1.py b/contrib/tools/python3/Lib/encodings/latin_1.py
index 370160c0cb5..370160c0cb5 100644
--- a/contrib/tools/python3/src/Lib/encodings/latin_1.py
+++ b/contrib/tools/python3/Lib/encodings/latin_1.py
diff --git a/contrib/tools/python3/src/Lib/encodings/mac_arabic.py b/contrib/tools/python3/Lib/encodings/mac_arabic.py
index 72847e859c4..72847e859c4 100644
--- a/contrib/tools/python3/src/Lib/encodings/mac_arabic.py
+++ b/contrib/tools/python3/Lib/encodings/mac_arabic.py
diff --git a/contrib/tools/python3/src/Lib/encodings/mac_croatian.py b/contrib/tools/python3/Lib/encodings/mac_croatian.py
index 4a92fe61a4f..4a92fe61a4f 100644
--- a/contrib/tools/python3/src/Lib/encodings/mac_croatian.py
+++ b/contrib/tools/python3/Lib/encodings/mac_croatian.py
diff --git a/contrib/tools/python3/src/Lib/encodings/mac_cyrillic.py b/contrib/tools/python3/Lib/encodings/mac_cyrillic.py
index d20272acfad..d20272acfad 100644
--- a/contrib/tools/python3/src/Lib/encodings/mac_cyrillic.py
+++ b/contrib/tools/python3/Lib/encodings/mac_cyrillic.py
diff --git a/contrib/tools/python3/src/Lib/encodings/mac_farsi.py b/contrib/tools/python3/Lib/encodings/mac_farsi.py
index e357d43510b..e357d43510b 100644
--- a/contrib/tools/python3/src/Lib/encodings/mac_farsi.py
+++ b/contrib/tools/python3/Lib/encodings/mac_farsi.py
diff --git a/contrib/tools/python3/src/Lib/encodings/mac_greek.py b/contrib/tools/python3/Lib/encodings/mac_greek.py
index d3d0c4f0c38..d3d0c4f0c38 100644
--- a/contrib/tools/python3/src/Lib/encodings/mac_greek.py
+++ b/contrib/tools/python3/Lib/encodings/mac_greek.py
diff --git a/contrib/tools/python3/src/Lib/encodings/mac_iceland.py b/contrib/tools/python3/Lib/encodings/mac_iceland.py
index add10f4e555..add10f4e555 100644
--- a/contrib/tools/python3/src/Lib/encodings/mac_iceland.py
+++ b/contrib/tools/python3/Lib/encodings/mac_iceland.py
diff --git a/contrib/tools/python3/src/Lib/encodings/mac_latin2.py b/contrib/tools/python3/Lib/encodings/mac_latin2.py
index da9d4b134ad..da9d4b134ad 100644
--- a/contrib/tools/python3/src/Lib/encodings/mac_latin2.py
+++ b/contrib/tools/python3/Lib/encodings/mac_latin2.py
diff --git a/contrib/tools/python3/src/Lib/encodings/mac_roman.py b/contrib/tools/python3/Lib/encodings/mac_roman.py
index b74b002134f..b74b002134f 100644
--- a/contrib/tools/python3/src/Lib/encodings/mac_roman.py
+++ b/contrib/tools/python3/Lib/encodings/mac_roman.py
diff --git a/contrib/tools/python3/src/Lib/encodings/mac_romanian.py b/contrib/tools/python3/Lib/encodings/mac_romanian.py
index d141b4c5091..d141b4c5091 100644
--- a/contrib/tools/python3/src/Lib/encodings/mac_romanian.py
+++ b/contrib/tools/python3/Lib/encodings/mac_romanian.py
diff --git a/contrib/tools/python3/src/Lib/encodings/mac_turkish.py b/contrib/tools/python3/Lib/encodings/mac_turkish.py
index 044d4cb5ad7..044d4cb5ad7 100644
--- a/contrib/tools/python3/src/Lib/encodings/mac_turkish.py
+++ b/contrib/tools/python3/Lib/encodings/mac_turkish.py
diff --git a/contrib/tools/python3/src/Lib/encodings/mbcs.py b/contrib/tools/python3/Lib/encodings/mbcs.py
index baf46cbd483..baf46cbd483 100644
--- a/contrib/tools/python3/src/Lib/encodings/mbcs.py
+++ b/contrib/tools/python3/Lib/encodings/mbcs.py
diff --git a/contrib/tools/python3/src/Lib/encodings/oem.py b/contrib/tools/python3/Lib/encodings/oem.py
index 2c3426ba48b..2c3426ba48b 100644
--- a/contrib/tools/python3/src/Lib/encodings/oem.py
+++ b/contrib/tools/python3/Lib/encodings/oem.py
diff --git a/contrib/tools/python3/src/Lib/encodings/palmos.py b/contrib/tools/python3/Lib/encodings/palmos.py
index c506d654523..c506d654523 100644
--- a/contrib/tools/python3/src/Lib/encodings/palmos.py
+++ b/contrib/tools/python3/Lib/encodings/palmos.py
diff --git a/contrib/tools/python3/src/Lib/encodings/ptcp154.py b/contrib/tools/python3/Lib/encodings/ptcp154.py
index 656b79d6ac8..656b79d6ac8 100644
--- a/contrib/tools/python3/src/Lib/encodings/ptcp154.py
+++ b/contrib/tools/python3/Lib/encodings/ptcp154.py
diff --git a/contrib/tools/python3/src/Lib/encodings/punycode.py b/contrib/tools/python3/Lib/encodings/punycode.py
index 1c572644707..1c572644707 100644
--- a/contrib/tools/python3/src/Lib/encodings/punycode.py
+++ b/contrib/tools/python3/Lib/encodings/punycode.py
diff --git a/contrib/tools/python3/src/Lib/encodings/quopri_codec.py b/contrib/tools/python3/Lib/encodings/quopri_codec.py
index 496cb7655d0..496cb7655d0 100644
--- a/contrib/tools/python3/src/Lib/encodings/quopri_codec.py
+++ b/contrib/tools/python3/Lib/encodings/quopri_codec.py
diff --git a/contrib/tools/python3/src/Lib/encodings/raw_unicode_escape.py b/contrib/tools/python3/Lib/encodings/raw_unicode_escape.py
index 46c8e070dd1..46c8e070dd1 100644
--- a/contrib/tools/python3/src/Lib/encodings/raw_unicode_escape.py
+++ b/contrib/tools/python3/Lib/encodings/raw_unicode_escape.py
diff --git a/contrib/tools/python3/src/Lib/encodings/rot_13.py b/contrib/tools/python3/Lib/encodings/rot_13.py
index 5627bfbc69c..5627bfbc69c 100755
--- a/contrib/tools/python3/src/Lib/encodings/rot_13.py
+++ b/contrib/tools/python3/Lib/encodings/rot_13.py
diff --git a/contrib/tools/python3/src/Lib/encodings/shift_jis.py b/contrib/tools/python3/Lib/encodings/shift_jis.py
index 83381172764..83381172764 100644
--- a/contrib/tools/python3/src/Lib/encodings/shift_jis.py
+++ b/contrib/tools/python3/Lib/encodings/shift_jis.py
diff --git a/contrib/tools/python3/src/Lib/encodings/shift_jis_2004.py b/contrib/tools/python3/Lib/encodings/shift_jis_2004.py
index 161b1e86f99..161b1e86f99 100644
--- a/contrib/tools/python3/src/Lib/encodings/shift_jis_2004.py
+++ b/contrib/tools/python3/Lib/encodings/shift_jis_2004.py
diff --git a/contrib/tools/python3/src/Lib/encodings/shift_jisx0213.py b/contrib/tools/python3/Lib/encodings/shift_jisx0213.py
index cb653f53055..cb653f53055 100644
--- a/contrib/tools/python3/src/Lib/encodings/shift_jisx0213.py
+++ b/contrib/tools/python3/Lib/encodings/shift_jisx0213.py
diff --git a/contrib/tools/python3/src/Lib/encodings/tis_620.py b/contrib/tools/python3/Lib/encodings/tis_620.py
index e288386343d..e288386343d 100644
--- a/contrib/tools/python3/src/Lib/encodings/tis_620.py
+++ b/contrib/tools/python3/Lib/encodings/tis_620.py
diff --git a/contrib/tools/python3/src/Lib/encodings/undefined.py b/contrib/tools/python3/Lib/encodings/undefined.py
index 4690288355c..4690288355c 100644
--- a/contrib/tools/python3/src/Lib/encodings/undefined.py
+++ b/contrib/tools/python3/Lib/encodings/undefined.py
diff --git a/contrib/tools/python3/src/Lib/encodings/unicode_escape.py b/contrib/tools/python3/Lib/encodings/unicode_escape.py
index 9b1ce99b339..9b1ce99b339 100644
--- a/contrib/tools/python3/src/Lib/encodings/unicode_escape.py
+++ b/contrib/tools/python3/Lib/encodings/unicode_escape.py
diff --git a/contrib/tools/python3/src/Lib/encodings/utf_16.py b/contrib/tools/python3/Lib/encodings/utf_16.py
index c61248242be..c61248242be 100644
--- a/contrib/tools/python3/src/Lib/encodings/utf_16.py
+++ b/contrib/tools/python3/Lib/encodings/utf_16.py
diff --git a/contrib/tools/python3/src/Lib/encodings/utf_16_be.py b/contrib/tools/python3/Lib/encodings/utf_16_be.py
index 86b458eb9bc..86b458eb9bc 100644
--- a/contrib/tools/python3/src/Lib/encodings/utf_16_be.py
+++ b/contrib/tools/python3/Lib/encodings/utf_16_be.py
diff --git a/contrib/tools/python3/src/Lib/encodings/utf_16_le.py b/contrib/tools/python3/Lib/encodings/utf_16_le.py
index ec454142eed..ec454142eed 100644
--- a/contrib/tools/python3/src/Lib/encodings/utf_16_le.py
+++ b/contrib/tools/python3/Lib/encodings/utf_16_le.py
diff --git a/contrib/tools/python3/src/Lib/encodings/utf_32.py b/contrib/tools/python3/Lib/encodings/utf_32.py
index cdf84d14129..cdf84d14129 100644
--- a/contrib/tools/python3/src/Lib/encodings/utf_32.py
+++ b/contrib/tools/python3/Lib/encodings/utf_32.py
diff --git a/contrib/tools/python3/src/Lib/encodings/utf_32_be.py b/contrib/tools/python3/Lib/encodings/utf_32_be.py
index fe272b5fafe..fe272b5fafe 100644
--- a/contrib/tools/python3/src/Lib/encodings/utf_32_be.py
+++ b/contrib/tools/python3/Lib/encodings/utf_32_be.py
diff --git a/contrib/tools/python3/src/Lib/encodings/utf_32_le.py b/contrib/tools/python3/Lib/encodings/utf_32_le.py
index 9e48210928e..9e48210928e 100644
--- a/contrib/tools/python3/src/Lib/encodings/utf_32_le.py
+++ b/contrib/tools/python3/Lib/encodings/utf_32_le.py
diff --git a/contrib/tools/python3/src/Lib/encodings/utf_7.py b/contrib/tools/python3/Lib/encodings/utf_7.py
index 8e0567f2087..8e0567f2087 100644
--- a/contrib/tools/python3/src/Lib/encodings/utf_7.py
+++ b/contrib/tools/python3/Lib/encodings/utf_7.py
diff --git a/contrib/tools/python3/src/Lib/encodings/utf_8.py b/contrib/tools/python3/Lib/encodings/utf_8.py
index 1bf63365715..1bf63365715 100644
--- a/contrib/tools/python3/src/Lib/encodings/utf_8.py
+++ b/contrib/tools/python3/Lib/encodings/utf_8.py
diff --git a/contrib/tools/python3/src/Lib/encodings/utf_8_sig.py b/contrib/tools/python3/Lib/encodings/utf_8_sig.py
index 1bb479203f3..1bb479203f3 100644
--- a/contrib/tools/python3/src/Lib/encodings/utf_8_sig.py
+++ b/contrib/tools/python3/Lib/encodings/utf_8_sig.py
diff --git a/contrib/tools/python3/src/Lib/encodings/uu_codec.py b/contrib/tools/python3/Lib/encodings/uu_codec.py
index 4e58c62fe9e..4e58c62fe9e 100644
--- a/contrib/tools/python3/src/Lib/encodings/uu_codec.py
+++ b/contrib/tools/python3/Lib/encodings/uu_codec.py
diff --git a/contrib/tools/python3/src/Lib/encodings/zlib_codec.py b/contrib/tools/python3/Lib/encodings/zlib_codec.py
index 95908a4b4a1..95908a4b4a1 100644
--- a/contrib/tools/python3/src/Lib/encodings/zlib_codec.py
+++ b/contrib/tools/python3/Lib/encodings/zlib_codec.py
diff --git a/contrib/tools/python3/src/Lib/ensurepip/__init__.py b/contrib/tools/python3/Lib/ensurepip/__init__.py
index 2ac872c25c8..2ac872c25c8 100644
--- a/contrib/tools/python3/src/Lib/ensurepip/__init__.py
+++ b/contrib/tools/python3/Lib/ensurepip/__init__.py
diff --git a/contrib/tools/python3/src/Lib/ensurepip/__main__.py b/contrib/tools/python3/Lib/ensurepip/__main__.py
index 03eef0dd94d..03eef0dd94d 100644
--- a/contrib/tools/python3/src/Lib/ensurepip/__main__.py
+++ b/contrib/tools/python3/Lib/ensurepip/__main__.py
diff --git a/contrib/tools/python3/src/Lib/ensurepip/_uninstall.py b/contrib/tools/python3/Lib/ensurepip/_uninstall.py
index b257904328d..b257904328d 100644
--- a/contrib/tools/python3/src/Lib/ensurepip/_uninstall.py
+++ b/contrib/tools/python3/Lib/ensurepip/_uninstall.py
diff --git a/contrib/tools/python3/src/Lib/enum.py b/contrib/tools/python3/Lib/enum.py
index 1502bfe9158..1502bfe9158 100644
--- a/contrib/tools/python3/src/Lib/enum.py
+++ b/contrib/tools/python3/Lib/enum.py
diff --git a/contrib/tools/python3/src/Lib/filecmp.py b/contrib/tools/python3/Lib/filecmp.py
index 30bd900fa80..30bd900fa80 100644
--- a/contrib/tools/python3/src/Lib/filecmp.py
+++ b/contrib/tools/python3/Lib/filecmp.py
diff --git a/contrib/tools/python3/src/Lib/fileinput.py b/contrib/tools/python3/Lib/fileinput.py
index 1b25f28f3d3..1b25f28f3d3 100644
--- a/contrib/tools/python3/src/Lib/fileinput.py
+++ b/contrib/tools/python3/Lib/fileinput.py
diff --git a/contrib/tools/python3/src/Lib/fnmatch.py b/contrib/tools/python3/Lib/fnmatch.py
index d5e296f7748..d5e296f7748 100644
--- a/contrib/tools/python3/src/Lib/fnmatch.py
+++ b/contrib/tools/python3/Lib/fnmatch.py
diff --git a/contrib/tools/python3/src/Lib/fractions.py b/contrib/tools/python3/Lib/fractions.py
index 88b418fe383..88b418fe383 100644
--- a/contrib/tools/python3/src/Lib/fractions.py
+++ b/contrib/tools/python3/Lib/fractions.py
diff --git a/contrib/tools/python3/src/Lib/ftplib.py b/contrib/tools/python3/Lib/ftplib.py
index 10c5d1ea08a..10c5d1ea08a 100644
--- a/contrib/tools/python3/src/Lib/ftplib.py
+++ b/contrib/tools/python3/Lib/ftplib.py
diff --git a/contrib/tools/python3/src/Lib/functools.py b/contrib/tools/python3/Lib/functools.py
index 2ae4290f983..2ae4290f983 100644
--- a/contrib/tools/python3/src/Lib/functools.py
+++ b/contrib/tools/python3/Lib/functools.py
diff --git a/contrib/tools/python3/src/Lib/genericpath.py b/contrib/tools/python3/Lib/genericpath.py
index 1bd5b3897c3..1bd5b3897c3 100644
--- a/contrib/tools/python3/src/Lib/genericpath.py
+++ b/contrib/tools/python3/Lib/genericpath.py
diff --git a/contrib/tools/python3/src/Lib/getopt.py b/contrib/tools/python3/Lib/getopt.py
index 5419d77f5d7..5419d77f5d7 100644
--- a/contrib/tools/python3/src/Lib/getopt.py
+++ b/contrib/tools/python3/Lib/getopt.py
diff --git a/contrib/tools/python3/src/Lib/getpass.py b/contrib/tools/python3/Lib/getpass.py
index 6970d8adfba..6970d8adfba 100644
--- a/contrib/tools/python3/src/Lib/getpass.py
+++ b/contrib/tools/python3/Lib/getpass.py
diff --git a/contrib/tools/python3/src/Lib/gettext.py b/contrib/tools/python3/Lib/gettext.py
index e665b3ecedc..e665b3ecedc 100644
--- a/contrib/tools/python3/src/Lib/gettext.py
+++ b/contrib/tools/python3/Lib/gettext.py
diff --git a/contrib/tools/python3/src/Lib/glob.py b/contrib/tools/python3/Lib/glob.py
index a7256422d52..a7256422d52 100644
--- a/contrib/tools/python3/src/Lib/glob.py
+++ b/contrib/tools/python3/Lib/glob.py
diff --git a/contrib/tools/python3/src/Lib/graphlib.py b/contrib/tools/python3/Lib/graphlib.py
index 636545648e1..636545648e1 100644
--- a/contrib/tools/python3/src/Lib/graphlib.py
+++ b/contrib/tools/python3/Lib/graphlib.py
diff --git a/contrib/tools/python3/src/Lib/gzip.py b/contrib/tools/python3/Lib/gzip.py
index 177f9080dc5..177f9080dc5 100644
--- a/contrib/tools/python3/src/Lib/gzip.py
+++ b/contrib/tools/python3/Lib/gzip.py
diff --git a/contrib/tools/python3/src/Lib/hashlib.py b/contrib/tools/python3/Lib/hashlib.py
index 1b16441cb60..1b16441cb60 100644
--- a/contrib/tools/python3/src/Lib/hashlib.py
+++ b/contrib/tools/python3/Lib/hashlib.py
diff --git a/contrib/tools/python3/src/Lib/heapq.py b/contrib/tools/python3/Lib/heapq.py
index 2fd9d1ff4bf..2fd9d1ff4bf 100644
--- a/contrib/tools/python3/src/Lib/heapq.py
+++ b/contrib/tools/python3/Lib/heapq.py
diff --git a/contrib/tools/python3/src/Lib/hmac.py b/contrib/tools/python3/Lib/hmac.py
index 8b4eb2fe741..8b4eb2fe741 100644
--- a/contrib/tools/python3/src/Lib/hmac.py
+++ b/contrib/tools/python3/Lib/hmac.py
diff --git a/contrib/tools/python3/src/Lib/html/__init__.py b/contrib/tools/python3/Lib/html/__init__.py
index 1543460ca33..1543460ca33 100644
--- a/contrib/tools/python3/src/Lib/html/__init__.py
+++ b/contrib/tools/python3/Lib/html/__init__.py
diff --git a/contrib/tools/python3/src/Lib/html/entities.py b/contrib/tools/python3/Lib/html/entities.py
index eb6dc121905..eb6dc121905 100644
--- a/contrib/tools/python3/src/Lib/html/entities.py
+++ b/contrib/tools/python3/Lib/html/entities.py
diff --git a/contrib/tools/python3/src/Lib/html/parser.py b/contrib/tools/python3/Lib/html/parser.py
index 13c95c34e50..13c95c34e50 100644
--- a/contrib/tools/python3/src/Lib/html/parser.py
+++ b/contrib/tools/python3/Lib/html/parser.py
diff --git a/contrib/tools/python3/src/Lib/http/__init__.py b/contrib/tools/python3/Lib/http/__init__.py
index e093a1fec4d..e093a1fec4d 100644
--- a/contrib/tools/python3/src/Lib/http/__init__.py
+++ b/contrib/tools/python3/Lib/http/__init__.py
diff --git a/contrib/tools/python3/src/Lib/http/client.py b/contrib/tools/python3/Lib/http/client.py
index 5eebfccafbc..5eebfccafbc 100644
--- a/contrib/tools/python3/src/Lib/http/client.py
+++ b/contrib/tools/python3/Lib/http/client.py
diff --git a/contrib/tools/python3/src/Lib/http/cookiejar.py b/contrib/tools/python3/Lib/http/cookiejar.py
index bd89370e168..bd89370e168 100644
--- a/contrib/tools/python3/src/Lib/http/cookiejar.py
+++ b/contrib/tools/python3/Lib/http/cookiejar.py
diff --git a/contrib/tools/python3/src/Lib/http/cookies.py b/contrib/tools/python3/Lib/http/cookies.py
index 35ac2dc6ae2..35ac2dc6ae2 100644
--- a/contrib/tools/python3/src/Lib/http/cookies.py
+++ b/contrib/tools/python3/Lib/http/cookies.py
diff --git a/contrib/tools/python3/src/Lib/http/server.py b/contrib/tools/python3/Lib/http/server.py
index ca6240d9a92..ca6240d9a92 100644
--- a/contrib/tools/python3/src/Lib/http/server.py
+++ b/contrib/tools/python3/Lib/http/server.py
diff --git a/contrib/tools/python3/src/Lib/imaplib.py b/contrib/tools/python3/Lib/imaplib.py
index 577b4b9b03a..577b4b9b03a 100644
--- a/contrib/tools/python3/src/Lib/imaplib.py
+++ b/contrib/tools/python3/Lib/imaplib.py
diff --git a/contrib/tools/python3/src/Lib/imghdr.py b/contrib/tools/python3/Lib/imghdr.py
index 33868883470..33868883470 100644
--- a/contrib/tools/python3/src/Lib/imghdr.py
+++ b/contrib/tools/python3/Lib/imghdr.py
diff --git a/contrib/tools/python3/src/Lib/importlib/__init__.py b/contrib/tools/python3/Lib/importlib/__init__.py
index 707c081cb2c..707c081cb2c 100644
--- a/contrib/tools/python3/src/Lib/importlib/__init__.py
+++ b/contrib/tools/python3/Lib/importlib/__init__.py
diff --git a/contrib/tools/python3/src/Lib/importlib/_abc.py b/contrib/tools/python3/Lib/importlib/_abc.py
index 693b4661126..693b4661126 100644
--- a/contrib/tools/python3/src/Lib/importlib/_abc.py
+++ b/contrib/tools/python3/Lib/importlib/_abc.py
diff --git a/contrib/tools/python3/src/Lib/importlib/_bootstrap.py b/contrib/tools/python3/Lib/importlib/_bootstrap.py
index d942045f3de..d942045f3de 100644
--- a/contrib/tools/python3/src/Lib/importlib/_bootstrap.py
+++ b/contrib/tools/python3/Lib/importlib/_bootstrap.py
diff --git a/contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py b/contrib/tools/python3/Lib/importlib/_bootstrap_external.py
index e6f75a9f6f6..e6f75a9f6f6 100644
--- a/contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py
+++ b/contrib/tools/python3/Lib/importlib/_bootstrap_external.py
diff --git a/contrib/tools/python3/src/Lib/importlib/abc.py b/contrib/tools/python3/Lib/importlib/abc.py
index b56fa94eb9c..b56fa94eb9c 100644
--- a/contrib/tools/python3/src/Lib/importlib/abc.py
+++ b/contrib/tools/python3/Lib/importlib/abc.py
diff --git a/contrib/tools/python3/src/Lib/importlib/machinery.py b/contrib/tools/python3/Lib/importlib/machinery.py
index d9a19a13f7b..d9a19a13f7b 100644
--- a/contrib/tools/python3/src/Lib/importlib/machinery.py
+++ b/contrib/tools/python3/Lib/importlib/machinery.py
diff --git a/contrib/tools/python3/src/Lib/importlib/metadata/__init__.py b/contrib/tools/python3/Lib/importlib/metadata/__init__.py
index 82e0ce1b281..82e0ce1b281 100644
--- a/contrib/tools/python3/src/Lib/importlib/metadata/__init__.py
+++ b/contrib/tools/python3/Lib/importlib/metadata/__init__.py
diff --git a/contrib/tools/python3/src/Lib/importlib/metadata/_adapters.py b/contrib/tools/python3/Lib/importlib/metadata/_adapters.py
index 6aed69a3085..6aed69a3085 100644
--- a/contrib/tools/python3/src/Lib/importlib/metadata/_adapters.py
+++ b/contrib/tools/python3/Lib/importlib/metadata/_adapters.py
diff --git a/contrib/tools/python3/src/Lib/importlib/metadata/_collections.py b/contrib/tools/python3/Lib/importlib/metadata/_collections.py
index cf0954e1a30..cf0954e1a30 100644
--- a/contrib/tools/python3/src/Lib/importlib/metadata/_collections.py
+++ b/contrib/tools/python3/Lib/importlib/metadata/_collections.py
diff --git a/contrib/tools/python3/src/Lib/importlib/metadata/_functools.py b/contrib/tools/python3/Lib/importlib/metadata/_functools.py
index 71f66bd03cb..71f66bd03cb 100644
--- a/contrib/tools/python3/src/Lib/importlib/metadata/_functools.py
+++ b/contrib/tools/python3/Lib/importlib/metadata/_functools.py
diff --git a/contrib/tools/python3/src/Lib/importlib/metadata/_itertools.py b/contrib/tools/python3/Lib/importlib/metadata/_itertools.py
index d4ca9b9140e..d4ca9b9140e 100644
--- a/contrib/tools/python3/src/Lib/importlib/metadata/_itertools.py
+++ b/contrib/tools/python3/Lib/importlib/metadata/_itertools.py
diff --git a/contrib/tools/python3/src/Lib/importlib/metadata/_meta.py b/contrib/tools/python3/Lib/importlib/metadata/_meta.py
index c9a7ef906a8..c9a7ef906a8 100644
--- a/contrib/tools/python3/src/Lib/importlib/metadata/_meta.py
+++ b/contrib/tools/python3/Lib/importlib/metadata/_meta.py
diff --git a/contrib/tools/python3/src/Lib/importlib/metadata/_text.py b/contrib/tools/python3/Lib/importlib/metadata/_text.py
index c88cfbb2349..c88cfbb2349 100644
--- a/contrib/tools/python3/src/Lib/importlib/metadata/_text.py
+++ b/contrib/tools/python3/Lib/importlib/metadata/_text.py
diff --git a/contrib/tools/python3/src/Lib/importlib/readers.py b/contrib/tools/python3/Lib/importlib/readers.py
index df7fb92e5cd..df7fb92e5cd 100644
--- a/contrib/tools/python3/src/Lib/importlib/readers.py
+++ b/contrib/tools/python3/Lib/importlib/readers.py
diff --git a/contrib/tools/python3/src/Lib/importlib/resources/__init__.py b/contrib/tools/python3/Lib/importlib/resources/__init__.py
index 34e3a9950cc..34e3a9950cc 100644
--- a/contrib/tools/python3/src/Lib/importlib/resources/__init__.py
+++ b/contrib/tools/python3/Lib/importlib/resources/__init__.py
diff --git a/contrib/tools/python3/src/Lib/importlib/resources/_adapters.py b/contrib/tools/python3/Lib/importlib/resources/_adapters.py
index 50688fbb666..50688fbb666 100644
--- a/contrib/tools/python3/src/Lib/importlib/resources/_adapters.py
+++ b/contrib/tools/python3/Lib/importlib/resources/_adapters.py
diff --git a/contrib/tools/python3/src/Lib/importlib/resources/_common.py b/contrib/tools/python3/Lib/importlib/resources/_common.py
index a3902535342..a3902535342 100644
--- a/contrib/tools/python3/src/Lib/importlib/resources/_common.py
+++ b/contrib/tools/python3/Lib/importlib/resources/_common.py
diff --git a/contrib/tools/python3/src/Lib/importlib/resources/_itertools.py b/contrib/tools/python3/Lib/importlib/resources/_itertools.py
index 7b775ef5ae8..7b775ef5ae8 100644
--- a/contrib/tools/python3/src/Lib/importlib/resources/_itertools.py
+++ b/contrib/tools/python3/Lib/importlib/resources/_itertools.py
diff --git a/contrib/tools/python3/src/Lib/importlib/resources/_legacy.py b/contrib/tools/python3/Lib/importlib/resources/_legacy.py
index b1ea8105dad..b1ea8105dad 100644
--- a/contrib/tools/python3/src/Lib/importlib/resources/_legacy.py
+++ b/contrib/tools/python3/Lib/importlib/resources/_legacy.py
diff --git a/contrib/tools/python3/src/Lib/importlib/resources/abc.py b/contrib/tools/python3/Lib/importlib/resources/abc.py
index 6750a7aaf14..6750a7aaf14 100644
--- a/contrib/tools/python3/src/Lib/importlib/resources/abc.py
+++ b/contrib/tools/python3/Lib/importlib/resources/abc.py
diff --git a/contrib/tools/python3/src/Lib/importlib/resources/readers.py b/contrib/tools/python3/Lib/importlib/resources/readers.py
index c3cdf769cbe..c3cdf769cbe 100644
--- a/contrib/tools/python3/src/Lib/importlib/resources/readers.py
+++ b/contrib/tools/python3/Lib/importlib/resources/readers.py
diff --git a/contrib/tools/python3/src/Lib/importlib/resources/simple.py b/contrib/tools/python3/Lib/importlib/resources/simple.py
index 7770c922c84..7770c922c84 100644
--- a/contrib/tools/python3/src/Lib/importlib/resources/simple.py
+++ b/contrib/tools/python3/Lib/importlib/resources/simple.py
diff --git a/contrib/tools/python3/src/Lib/importlib/simple.py b/contrib/tools/python3/Lib/importlib/simple.py
index 845bb903647..845bb903647 100644
--- a/contrib/tools/python3/src/Lib/importlib/simple.py
+++ b/contrib/tools/python3/Lib/importlib/simple.py
diff --git a/contrib/tools/python3/src/Lib/importlib/util.py b/contrib/tools/python3/Lib/importlib/util.py
index f4d6e823315..f4d6e823315 100644
--- a/contrib/tools/python3/src/Lib/importlib/util.py
+++ b/contrib/tools/python3/Lib/importlib/util.py
diff --git a/contrib/tools/python3/src/Lib/inspect.py b/contrib/tools/python3/Lib/inspect.py
index a550202bb0d..a550202bb0d 100644
--- a/contrib/tools/python3/src/Lib/inspect.py
+++ b/contrib/tools/python3/Lib/inspect.py
diff --git a/contrib/tools/python3/src/Lib/io.py b/contrib/tools/python3/Lib/io.py
index f0e2fa15d5a..f0e2fa15d5a 100644
--- a/contrib/tools/python3/src/Lib/io.py
+++ b/contrib/tools/python3/Lib/io.py
diff --git a/contrib/tools/python3/src/Lib/ipaddress.py b/contrib/tools/python3/Lib/ipaddress.py
index 9ca90fd0f75..9ca90fd0f75 100644
--- a/contrib/tools/python3/src/Lib/ipaddress.py
+++ b/contrib/tools/python3/Lib/ipaddress.py
diff --git a/contrib/tools/python3/src/Lib/json/__init__.py b/contrib/tools/python3/Lib/json/__init__.py
index ed2c74771ea..ed2c74771ea 100644
--- a/contrib/tools/python3/src/Lib/json/__init__.py
+++ b/contrib/tools/python3/Lib/json/__init__.py
diff --git a/contrib/tools/python3/src/Lib/json/decoder.py b/contrib/tools/python3/Lib/json/decoder.py
index c5d9ae2d0d5..c5d9ae2d0d5 100644
--- a/contrib/tools/python3/src/Lib/json/decoder.py
+++ b/contrib/tools/python3/Lib/json/decoder.py
diff --git a/contrib/tools/python3/src/Lib/json/encoder.py b/contrib/tools/python3/Lib/json/encoder.py
index 45f54774188..45f54774188 100644
--- a/contrib/tools/python3/src/Lib/json/encoder.py
+++ b/contrib/tools/python3/Lib/json/encoder.py
diff --git a/contrib/tools/python3/src/Lib/json/scanner.py b/contrib/tools/python3/Lib/json/scanner.py
index 7a61cfc2d24..7a61cfc2d24 100644
--- a/contrib/tools/python3/src/Lib/json/scanner.py
+++ b/contrib/tools/python3/Lib/json/scanner.py
diff --git a/contrib/tools/python3/src/Lib/json/tool.py b/contrib/tools/python3/Lib/json/tool.py
index 0490b8c0be1..0490b8c0be1 100644
--- a/contrib/tools/python3/src/Lib/json/tool.py
+++ b/contrib/tools/python3/Lib/json/tool.py
diff --git a/contrib/tools/python3/src/Lib/keyword.py b/contrib/tools/python3/Lib/keyword.py
index e22c837835e..e22c837835e 100644
--- a/contrib/tools/python3/src/Lib/keyword.py
+++ b/contrib/tools/python3/Lib/keyword.py
diff --git a/contrib/tools/python3/src/Lib/linecache.py b/contrib/tools/python3/Lib/linecache.py
index b164e727c6e..b164e727c6e 100644
--- a/contrib/tools/python3/src/Lib/linecache.py
+++ b/contrib/tools/python3/Lib/linecache.py
diff --git a/contrib/tools/python3/src/Lib/locale.py b/contrib/tools/python3/Lib/locale.py
index 4965c973074..4965c973074 100644
--- a/contrib/tools/python3/src/Lib/locale.py
+++ b/contrib/tools/python3/Lib/locale.py
diff --git a/contrib/tools/python3/src/Lib/logging/__init__.py b/contrib/tools/python3/Lib/logging/__init__.py
index 056380fb228..056380fb228 100644
--- a/contrib/tools/python3/src/Lib/logging/__init__.py
+++ b/contrib/tools/python3/Lib/logging/__init__.py
diff --git a/contrib/tools/python3/src/Lib/logging/config.py b/contrib/tools/python3/Lib/logging/config.py
index 33417b75d51..33417b75d51 100644
--- a/contrib/tools/python3/src/Lib/logging/config.py
+++ b/contrib/tools/python3/Lib/logging/config.py
diff --git a/contrib/tools/python3/src/Lib/logging/handlers.py b/contrib/tools/python3/Lib/logging/handlers.py
index 6e88184b512..6e88184b512 100644
--- a/contrib/tools/python3/src/Lib/logging/handlers.py
+++ b/contrib/tools/python3/Lib/logging/handlers.py
diff --git a/contrib/tools/python3/src/Lib/lzma.py b/contrib/tools/python3/Lib/lzma.py
index 800f52198fb..800f52198fb 100644
--- a/contrib/tools/python3/src/Lib/lzma.py
+++ b/contrib/tools/python3/Lib/lzma.py
diff --git a/contrib/tools/python3/src/Lib/mailbox.py b/contrib/tools/python3/Lib/mailbox.py
index c8b3444f646..c8b3444f646 100644
--- a/contrib/tools/python3/src/Lib/mailbox.py
+++ b/contrib/tools/python3/Lib/mailbox.py
diff --git a/contrib/tools/python3/src/Lib/mailcap.py b/contrib/tools/python3/Lib/mailcap.py
index 2f4656e854b..2f4656e854b 100644
--- a/contrib/tools/python3/src/Lib/mailcap.py
+++ b/contrib/tools/python3/Lib/mailcap.py
diff --git a/contrib/tools/python3/src/Lib/mimetypes.py b/contrib/tools/python3/Lib/mimetypes.py
index 37228de4828..37228de4828 100644
--- a/contrib/tools/python3/src/Lib/mimetypes.py
+++ b/contrib/tools/python3/Lib/mimetypes.py
diff --git a/contrib/tools/python3/src/Lib/modulefinder.py b/contrib/tools/python3/Lib/modulefinder.py
index a0a020f9eeb..a0a020f9eeb 100644
--- a/contrib/tools/python3/src/Lib/modulefinder.py
+++ b/contrib/tools/python3/Lib/modulefinder.py
diff --git a/contrib/tools/python3/src/Lib/msilib/__init__.py b/contrib/tools/python3/Lib/msilib/__init__.py
index 565bf631abd..565bf631abd 100644
--- a/contrib/tools/python3/src/Lib/msilib/__init__.py
+++ b/contrib/tools/python3/Lib/msilib/__init__.py
diff --git a/contrib/tools/python3/src/Lib/msilib/schema.py b/contrib/tools/python3/Lib/msilib/schema.py
index 9f5745cfb14..9f5745cfb14 100644
--- a/contrib/tools/python3/src/Lib/msilib/schema.py
+++ b/contrib/tools/python3/Lib/msilib/schema.py
diff --git a/contrib/tools/python3/src/Lib/msilib/sequence.py b/contrib/tools/python3/Lib/msilib/sequence.py
index 7012a21f857..7012a21f857 100644
--- a/contrib/tools/python3/src/Lib/msilib/sequence.py
+++ b/contrib/tools/python3/Lib/msilib/sequence.py
diff --git a/contrib/tools/python3/src/Lib/msilib/text.py b/contrib/tools/python3/Lib/msilib/text.py
index c4b9e8697d7..c4b9e8697d7 100644
--- a/contrib/tools/python3/src/Lib/msilib/text.py
+++ b/contrib/tools/python3/Lib/msilib/text.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/__init__.py b/contrib/tools/python3/Lib/multiprocessing/__init__.py
index 8336f381dec..8336f381dec 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/__init__.py
+++ b/contrib/tools/python3/Lib/multiprocessing/__init__.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/connection.py b/contrib/tools/python3/Lib/multiprocessing/connection.py
index dbbf106f680..dbbf106f680 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/connection.py
+++ b/contrib/tools/python3/Lib/multiprocessing/connection.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/context.py b/contrib/tools/python3/Lib/multiprocessing/context.py
index de8a264829d..de8a264829d 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/context.py
+++ b/contrib/tools/python3/Lib/multiprocessing/context.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/dummy/__init__.py b/contrib/tools/python3/Lib/multiprocessing/dummy/__init__.py
index 6a1468609e3..6a1468609e3 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/dummy/__init__.py
+++ b/contrib/tools/python3/Lib/multiprocessing/dummy/__init__.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/dummy/connection.py b/contrib/tools/python3/Lib/multiprocessing/dummy/connection.py
index f0ce320fcf5..f0ce320fcf5 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/dummy/connection.py
+++ b/contrib/tools/python3/Lib/multiprocessing/dummy/connection.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/forkserver.py b/contrib/tools/python3/Lib/multiprocessing/forkserver.py
index 4642707dae2..4642707dae2 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/forkserver.py
+++ b/contrib/tools/python3/Lib/multiprocessing/forkserver.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/heap.py b/contrib/tools/python3/Lib/multiprocessing/heap.py
index 6217dfe1268..6217dfe1268 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/heap.py
+++ b/contrib/tools/python3/Lib/multiprocessing/heap.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/managers.py b/contrib/tools/python3/Lib/multiprocessing/managers.py
index 75d9c18c201..75d9c18c201 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/managers.py
+++ b/contrib/tools/python3/Lib/multiprocessing/managers.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/pool.py b/contrib/tools/python3/Lib/multiprocessing/pool.py
index 4f5d88cb975..4f5d88cb975 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/pool.py
+++ b/contrib/tools/python3/Lib/multiprocessing/pool.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/popen_fork.py b/contrib/tools/python3/Lib/multiprocessing/popen_fork.py
index 625981cf476..625981cf476 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/popen_fork.py
+++ b/contrib/tools/python3/Lib/multiprocessing/popen_fork.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/popen_forkserver.py b/contrib/tools/python3/Lib/multiprocessing/popen_forkserver.py
index a56eb9bf110..a56eb9bf110 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/popen_forkserver.py
+++ b/contrib/tools/python3/Lib/multiprocessing/popen_forkserver.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/popen_spawn_posix.py b/contrib/tools/python3/Lib/multiprocessing/popen_spawn_posix.py
index 24b8634523e..24b8634523e 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/popen_spawn_posix.py
+++ b/contrib/tools/python3/Lib/multiprocessing/popen_spawn_posix.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/popen_spawn_win32.py b/contrib/tools/python3/Lib/multiprocessing/popen_spawn_win32.py
index 26400861246..26400861246 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/popen_spawn_win32.py
+++ b/contrib/tools/python3/Lib/multiprocessing/popen_spawn_win32.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/process.py b/contrib/tools/python3/Lib/multiprocessing/process.py
index 271ba3fd325..271ba3fd325 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/process.py
+++ b/contrib/tools/python3/Lib/multiprocessing/process.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/queues.py b/contrib/tools/python3/Lib/multiprocessing/queues.py
index 852ae87b276..852ae87b276 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/queues.py
+++ b/contrib/tools/python3/Lib/multiprocessing/queues.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/reduction.py b/contrib/tools/python3/Lib/multiprocessing/reduction.py
index 5593f0682f7..5593f0682f7 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/reduction.py
+++ b/contrib/tools/python3/Lib/multiprocessing/reduction.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/resource_sharer.py b/contrib/tools/python3/Lib/multiprocessing/resource_sharer.py
index b8afb0fbed3..b8afb0fbed3 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/resource_sharer.py
+++ b/contrib/tools/python3/Lib/multiprocessing/resource_sharer.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/resource_tracker.py b/contrib/tools/python3/Lib/multiprocessing/resource_tracker.py
index 79e96ecf324..79e96ecf324 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/resource_tracker.py
+++ b/contrib/tools/python3/Lib/multiprocessing/resource_tracker.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/shared_memory.py b/contrib/tools/python3/Lib/multiprocessing/shared_memory.py
index 9a1e5aa17b8..9a1e5aa17b8 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/shared_memory.py
+++ b/contrib/tools/python3/Lib/multiprocessing/shared_memory.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/sharedctypes.py b/contrib/tools/python3/Lib/multiprocessing/sharedctypes.py
index 6071707027b..6071707027b 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/sharedctypes.py
+++ b/contrib/tools/python3/Lib/multiprocessing/sharedctypes.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/spawn.py b/contrib/tools/python3/Lib/multiprocessing/spawn.py
index a0ab98cfd2c..a0ab98cfd2c 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/spawn.py
+++ b/contrib/tools/python3/Lib/multiprocessing/spawn.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/synchronize.py b/contrib/tools/python3/Lib/multiprocessing/synchronize.py
index 3ccbfe311c7..3ccbfe311c7 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/synchronize.py
+++ b/contrib/tools/python3/Lib/multiprocessing/synchronize.py
diff --git a/contrib/tools/python3/src/Lib/multiprocessing/util.py b/contrib/tools/python3/Lib/multiprocessing/util.py
index eb2cea07e19..eb2cea07e19 100644
--- a/contrib/tools/python3/src/Lib/multiprocessing/util.py
+++ b/contrib/tools/python3/Lib/multiprocessing/util.py
diff --git a/contrib/tools/python3/src/Lib/netrc.py b/contrib/tools/python3/Lib/netrc.py
index b285fd8e357..b285fd8e357 100644
--- a/contrib/tools/python3/src/Lib/netrc.py
+++ b/contrib/tools/python3/Lib/netrc.py
diff --git a/contrib/tools/python3/src/Lib/nntplib.py b/contrib/tools/python3/Lib/nntplib.py
index dddea059982..dddea059982 100644
--- a/contrib/tools/python3/src/Lib/nntplib.py
+++ b/contrib/tools/python3/Lib/nntplib.py
diff --git a/contrib/tools/python3/src/Lib/ntpath.py b/contrib/tools/python3/Lib/ntpath.py
index df3402d46c9..df3402d46c9 100644
--- a/contrib/tools/python3/src/Lib/ntpath.py
+++ b/contrib/tools/python3/Lib/ntpath.py
diff --git a/contrib/tools/python3/src/Lib/nturl2path.py b/contrib/tools/python3/Lib/nturl2path.py
index 61852aff589..61852aff589 100644
--- a/contrib/tools/python3/src/Lib/nturl2path.py
+++ b/contrib/tools/python3/Lib/nturl2path.py
diff --git a/contrib/tools/python3/src/Lib/numbers.py b/contrib/tools/python3/Lib/numbers.py
index a2913e32cfa..a2913e32cfa 100644
--- a/contrib/tools/python3/src/Lib/numbers.py
+++ b/contrib/tools/python3/Lib/numbers.py
diff --git a/contrib/tools/python3/src/Lib/opcode.py b/contrib/tools/python3/Lib/opcode.py
index 6bb2f1c140b..6bb2f1c140b 100644
--- a/contrib/tools/python3/src/Lib/opcode.py
+++ b/contrib/tools/python3/Lib/opcode.py
diff --git a/contrib/tools/python3/src/Lib/operator.py b/contrib/tools/python3/Lib/operator.py
index 30116c1189a..30116c1189a 100644
--- a/contrib/tools/python3/src/Lib/operator.py
+++ b/contrib/tools/python3/Lib/operator.py
diff --git a/contrib/tools/python3/src/Lib/optparse.py b/contrib/tools/python3/Lib/optparse.py
index 1c450c6fcbe..1c450c6fcbe 100644
--- a/contrib/tools/python3/src/Lib/optparse.py
+++ b/contrib/tools/python3/Lib/optparse.py
diff --git a/contrib/tools/python3/src/Lib/os.py b/contrib/tools/python3/Lib/os.py
index 598c9e50230..598c9e50230 100644
--- a/contrib/tools/python3/src/Lib/os.py
+++ b/contrib/tools/python3/Lib/os.py
diff --git a/contrib/tools/python3/src/Lib/pathlib.py b/contrib/tools/python3/Lib/pathlib.py
index bd5a096f9e3..bd5a096f9e3 100644
--- a/contrib/tools/python3/src/Lib/pathlib.py
+++ b/contrib/tools/python3/Lib/pathlib.py
diff --git a/contrib/tools/python3/src/Lib/pdb.py b/contrib/tools/python3/Lib/pdb.py
index a838a26b038..a838a26b038 100755
--- a/contrib/tools/python3/src/Lib/pdb.py
+++ b/contrib/tools/python3/Lib/pdb.py
diff --git a/contrib/tools/python3/src/Lib/pickle.py b/contrib/tools/python3/Lib/pickle.py
index 6e3c61fd0b2..6e3c61fd0b2 100644
--- a/contrib/tools/python3/src/Lib/pickle.py
+++ b/contrib/tools/python3/Lib/pickle.py
diff --git a/contrib/tools/python3/src/Lib/pickletools.py b/contrib/tools/python3/Lib/pickletools.py
index 95a77aeb2af..95a77aeb2af 100644
--- a/contrib/tools/python3/src/Lib/pickletools.py
+++ b/contrib/tools/python3/Lib/pickletools.py
diff --git a/contrib/tools/python3/src/Lib/pipes.py b/contrib/tools/python3/Lib/pipes.py
index 61d63b48d3e..61d63b48d3e 100644
--- a/contrib/tools/python3/src/Lib/pipes.py
+++ b/contrib/tools/python3/Lib/pipes.py
diff --git a/contrib/tools/python3/src/Lib/pkgutil.py b/contrib/tools/python3/Lib/pkgutil.py
index dccbec52aa7..dccbec52aa7 100644
--- a/contrib/tools/python3/src/Lib/pkgutil.py
+++ b/contrib/tools/python3/Lib/pkgutil.py
diff --git a/contrib/tools/python3/src/Lib/platform.py b/contrib/tools/python3/Lib/platform.py
index 7bb222088d5..7bb222088d5 100755
--- a/contrib/tools/python3/src/Lib/platform.py
+++ b/contrib/tools/python3/Lib/platform.py
diff --git a/contrib/tools/python3/src/Lib/plistlib.py b/contrib/tools/python3/Lib/plistlib.py
index 3292c30d5fb..3292c30d5fb 100644
--- a/contrib/tools/python3/src/Lib/plistlib.py
+++ b/contrib/tools/python3/Lib/plistlib.py
diff --git a/contrib/tools/python3/src/Lib/poplib.py b/contrib/tools/python3/Lib/poplib.py
index 9a5ef03c983..9a5ef03c983 100644
--- a/contrib/tools/python3/src/Lib/poplib.py
+++ b/contrib/tools/python3/Lib/poplib.py
diff --git a/contrib/tools/python3/src/Lib/posixpath.py b/contrib/tools/python3/Lib/posixpath.py
index e4f155e41a3..e4f155e41a3 100644
--- a/contrib/tools/python3/src/Lib/posixpath.py
+++ b/contrib/tools/python3/Lib/posixpath.py
diff --git a/contrib/tools/python3/src/Lib/pprint.py b/contrib/tools/python3/Lib/pprint.py
index 9314701db34..9314701db34 100644
--- a/contrib/tools/python3/src/Lib/pprint.py
+++ b/contrib/tools/python3/Lib/pprint.py
diff --git a/contrib/tools/python3/src/Lib/profile.py b/contrib/tools/python3/Lib/profile.py
index 4b82523b03d..4b82523b03d 100755
--- a/contrib/tools/python3/src/Lib/profile.py
+++ b/contrib/tools/python3/Lib/profile.py
diff --git a/contrib/tools/python3/src/Lib/pstats.py b/contrib/tools/python3/Lib/pstats.py
index 51bcca84188..51bcca84188 100644
--- a/contrib/tools/python3/src/Lib/pstats.py
+++ b/contrib/tools/python3/Lib/pstats.py
diff --git a/contrib/tools/python3/src/Lib/pty.py b/contrib/tools/python3/Lib/pty.py
index 1d97994abef..1d97994abef 100644
--- a/contrib/tools/python3/src/Lib/pty.py
+++ b/contrib/tools/python3/Lib/pty.py
diff --git a/contrib/tools/python3/src/Lib/py_compile.py b/contrib/tools/python3/Lib/py_compile.py
index 388614e51b1..388614e51b1 100644
--- a/contrib/tools/python3/src/Lib/py_compile.py
+++ b/contrib/tools/python3/Lib/py_compile.py
diff --git a/contrib/tools/python3/src/Lib/pyclbr.py b/contrib/tools/python3/Lib/pyclbr.py
index 37f86995d6c..37f86995d6c 100644
--- a/contrib/tools/python3/src/Lib/pyclbr.py
+++ b/contrib/tools/python3/Lib/pyclbr.py
diff --git a/contrib/tools/python3/src/Lib/pydoc.py b/contrib/tools/python3/Lib/pydoc.py
index 84bbf588dc9..84bbf588dc9 100755
--- a/contrib/tools/python3/src/Lib/pydoc.py
+++ b/contrib/tools/python3/Lib/pydoc.py
diff --git a/contrib/tools/python3/src/Lib/urllib/__init__.py b/contrib/tools/python3/Lib/pydoc_data/__init__.py
index e69de29bb2d..e69de29bb2d 100644
--- a/contrib/tools/python3/src/Lib/urllib/__init__.py
+++ b/contrib/tools/python3/Lib/pydoc_data/__init__.py
diff --git a/contrib/tools/python3/src/Lib/pydoc_data/topics.py b/contrib/tools/python3/Lib/pydoc_data/topics.py
index e97e543a876..e97e543a876 100644
--- a/contrib/tools/python3/src/Lib/pydoc_data/topics.py
+++ b/contrib/tools/python3/Lib/pydoc_data/topics.py
diff --git a/contrib/tools/python3/src/Lib/queue.py b/contrib/tools/python3/Lib/queue.py
index 55f50088460..55f50088460 100644
--- a/contrib/tools/python3/src/Lib/queue.py
+++ b/contrib/tools/python3/Lib/queue.py
diff --git a/contrib/tools/python3/src/Lib/quopri.py b/contrib/tools/python3/Lib/quopri.py
index f36cf7b3951..f36cf7b3951 100755
--- a/contrib/tools/python3/src/Lib/quopri.py
+++ b/contrib/tools/python3/Lib/quopri.py
diff --git a/contrib/tools/python3/src/Lib/random.py b/contrib/tools/python3/Lib/random.py
index 1cfc2ba2f02..1cfc2ba2f02 100644
--- a/contrib/tools/python3/src/Lib/random.py
+++ b/contrib/tools/python3/Lib/random.py
diff --git a/contrib/tools/python3/src/Lib/re/__init__.py b/contrib/tools/python3/Lib/re/__init__.py
index 4515650a721..4515650a721 100644
--- a/contrib/tools/python3/src/Lib/re/__init__.py
+++ b/contrib/tools/python3/Lib/re/__init__.py
diff --git a/contrib/tools/python3/src/Lib/re/_casefix.py b/contrib/tools/python3/Lib/re/_casefix.py
index 06507d08bee..06507d08bee 100644
--- a/contrib/tools/python3/src/Lib/re/_casefix.py
+++ b/contrib/tools/python3/Lib/re/_casefix.py
diff --git a/contrib/tools/python3/src/Lib/re/_compiler.py b/contrib/tools/python3/Lib/re/_compiler.py
index 285c21936f2..285c21936f2 100644
--- a/contrib/tools/python3/src/Lib/re/_compiler.py
+++ b/contrib/tools/python3/Lib/re/_compiler.py
diff --git a/contrib/tools/python3/src/Lib/re/_constants.py b/contrib/tools/python3/Lib/re/_constants.py
index d8718d36075..d8718d36075 100644
--- a/contrib/tools/python3/src/Lib/re/_constants.py
+++ b/contrib/tools/python3/Lib/re/_constants.py
diff --git a/contrib/tools/python3/src/Lib/re/_parser.py b/contrib/tools/python3/Lib/re/_parser.py
index 4a492b79e84..4a492b79e84 100644
--- a/contrib/tools/python3/src/Lib/re/_parser.py
+++ b/contrib/tools/python3/Lib/re/_parser.py
diff --git a/contrib/tools/python3/src/Lib/reprlib.py b/contrib/tools/python3/Lib/reprlib.py
index a7b37630a4e..a7b37630a4e 100644
--- a/contrib/tools/python3/src/Lib/reprlib.py
+++ b/contrib/tools/python3/Lib/reprlib.py
diff --git a/contrib/tools/python3/src/Lib/rlcompleter.py b/contrib/tools/python3/Lib/rlcompleter.py
index 206d6fb511c..206d6fb511c 100644
--- a/contrib/tools/python3/src/Lib/rlcompleter.py
+++ b/contrib/tools/python3/Lib/rlcompleter.py
diff --git a/contrib/tools/python3/src/Lib/runpy.py b/contrib/tools/python3/Lib/runpy.py
index 42f896c9cd5..42f896c9cd5 100644
--- a/contrib/tools/python3/src/Lib/runpy.py
+++ b/contrib/tools/python3/Lib/runpy.py
diff --git a/contrib/tools/python3/src/Lib/sched.py b/contrib/tools/python3/Lib/sched.py
index 14613cf2987..14613cf2987 100644
--- a/contrib/tools/python3/src/Lib/sched.py
+++ b/contrib/tools/python3/Lib/sched.py
diff --git a/contrib/tools/python3/src/Lib/secrets.py b/contrib/tools/python3/Lib/secrets.py
index 566a09b7311..566a09b7311 100644
--- a/contrib/tools/python3/src/Lib/secrets.py
+++ b/contrib/tools/python3/Lib/secrets.py
diff --git a/contrib/tools/python3/src/Lib/selectors.py b/contrib/tools/python3/Lib/selectors.py
index c3b065b5226..c3b065b5226 100644
--- a/contrib/tools/python3/src/Lib/selectors.py
+++ b/contrib/tools/python3/Lib/selectors.py
diff --git a/contrib/tools/python3/src/Lib/shelve.py b/contrib/tools/python3/Lib/shelve.py
index e053c397345..e053c397345 100644
--- a/contrib/tools/python3/src/Lib/shelve.py
+++ b/contrib/tools/python3/Lib/shelve.py
diff --git a/contrib/tools/python3/src/Lib/shlex.py b/contrib/tools/python3/Lib/shlex.py
index f4821616b62..f4821616b62 100644
--- a/contrib/tools/python3/src/Lib/shlex.py
+++ b/contrib/tools/python3/Lib/shlex.py
diff --git a/contrib/tools/python3/src/Lib/shutil.py b/contrib/tools/python3/Lib/shutil.py
index 96463007d12..96463007d12 100644
--- a/contrib/tools/python3/src/Lib/shutil.py
+++ b/contrib/tools/python3/Lib/shutil.py
diff --git a/contrib/tools/python3/src/Lib/signal.py b/contrib/tools/python3/Lib/signal.py
index c8cd3d4f597..c8cd3d4f597 100644
--- a/contrib/tools/python3/src/Lib/signal.py
+++ b/contrib/tools/python3/Lib/signal.py
diff --git a/contrib/tools/python3/src/Lib/site.py b/contrib/tools/python3/Lib/site.py
index ff959de5a6b..ff959de5a6b 100644
--- a/contrib/tools/python3/src/Lib/site.py
+++ b/contrib/tools/python3/Lib/site.py
diff --git a/contrib/tools/python3/src/Lib/smtplib.py b/contrib/tools/python3/Lib/smtplib.py
index 18c91746fd7..18c91746fd7 100755
--- a/contrib/tools/python3/src/Lib/smtplib.py
+++ b/contrib/tools/python3/Lib/smtplib.py
diff --git a/contrib/tools/python3/src/Lib/sndhdr.py b/contrib/tools/python3/Lib/sndhdr.py
index 45def9ad16d..45def9ad16d 100644
--- a/contrib/tools/python3/src/Lib/sndhdr.py
+++ b/contrib/tools/python3/Lib/sndhdr.py
diff --git a/contrib/tools/python3/src/Lib/socket.py b/contrib/tools/python3/Lib/socket.py
index 42ee1307732..42ee1307732 100644
--- a/contrib/tools/python3/src/Lib/socket.py
+++ b/contrib/tools/python3/Lib/socket.py
diff --git a/contrib/tools/python3/src/Lib/socketserver.py b/contrib/tools/python3/Lib/socketserver.py
index cd028ef1c63..cd028ef1c63 100644
--- a/contrib/tools/python3/src/Lib/socketserver.py
+++ b/contrib/tools/python3/Lib/socketserver.py
diff --git a/contrib/tools/python3/src/Lib/sqlite3/__init__.py b/contrib/tools/python3/Lib/sqlite3/__init__.py
index 927267cf0b9..927267cf0b9 100644
--- a/contrib/tools/python3/src/Lib/sqlite3/__init__.py
+++ b/contrib/tools/python3/Lib/sqlite3/__init__.py
diff --git a/contrib/tools/python3/src/Lib/sqlite3/__main__.py b/contrib/tools/python3/Lib/sqlite3/__main__.py
index 3b59763375c..3b59763375c 100644
--- a/contrib/tools/python3/src/Lib/sqlite3/__main__.py
+++ b/contrib/tools/python3/Lib/sqlite3/__main__.py
diff --git a/contrib/tools/python3/src/Lib/sqlite3/dbapi2.py b/contrib/tools/python3/Lib/sqlite3/dbapi2.py
index 56fc0461e6c..56fc0461e6c 100644
--- a/contrib/tools/python3/src/Lib/sqlite3/dbapi2.py
+++ b/contrib/tools/python3/Lib/sqlite3/dbapi2.py
diff --git a/contrib/tools/python3/src/Lib/sqlite3/dump.py b/contrib/tools/python3/Lib/sqlite3/dump.py
index 1cf8759f897..1cf8759f897 100644
--- a/contrib/tools/python3/src/Lib/sqlite3/dump.py
+++ b/contrib/tools/python3/Lib/sqlite3/dump.py
diff --git a/contrib/tools/python3/src/Lib/sre_compile.py b/contrib/tools/python3/Lib/sre_compile.py
index f9da61e6487..f9da61e6487 100644
--- a/contrib/tools/python3/src/Lib/sre_compile.py
+++ b/contrib/tools/python3/Lib/sre_compile.py
diff --git a/contrib/tools/python3/src/Lib/sre_constants.py b/contrib/tools/python3/Lib/sre_constants.py
index fa09d044292..fa09d044292 100644
--- a/contrib/tools/python3/src/Lib/sre_constants.py
+++ b/contrib/tools/python3/Lib/sre_constants.py
diff --git a/contrib/tools/python3/src/Lib/sre_parse.py b/contrib/tools/python3/Lib/sre_parse.py
index 25a3f557d44..25a3f557d44 100644
--- a/contrib/tools/python3/src/Lib/sre_parse.py
+++ b/contrib/tools/python3/Lib/sre_parse.py
diff --git a/contrib/tools/python3/src/Lib/ssl.py b/contrib/tools/python3/Lib/ssl.py
index 9c1fea6d368..9c1fea6d368 100644
--- a/contrib/tools/python3/src/Lib/ssl.py
+++ b/contrib/tools/python3/Lib/ssl.py
diff --git a/contrib/tools/python3/src/Lib/stat.py b/contrib/tools/python3/Lib/stat.py
index fc024db3f4f..fc024db3f4f 100644
--- a/contrib/tools/python3/src/Lib/stat.py
+++ b/contrib/tools/python3/Lib/stat.py
diff --git a/contrib/tools/python3/src/Lib/statistics.py b/contrib/tools/python3/Lib/statistics.py
index 6bd214bbfe2..6bd214bbfe2 100644
--- a/contrib/tools/python3/src/Lib/statistics.py
+++ b/contrib/tools/python3/Lib/statistics.py
diff --git a/contrib/tools/python3/src/Lib/string.py b/contrib/tools/python3/Lib/string.py
index 2eab6d4f595..2eab6d4f595 100644
--- a/contrib/tools/python3/src/Lib/string.py
+++ b/contrib/tools/python3/Lib/string.py
diff --git a/contrib/tools/python3/src/Lib/stringprep.py b/contrib/tools/python3/Lib/stringprep.py
index 44ecdb266ce..44ecdb266ce 100644
--- a/contrib/tools/python3/src/Lib/stringprep.py
+++ b/contrib/tools/python3/Lib/stringprep.py
diff --git a/contrib/tools/python3/src/Lib/struct.py b/contrib/tools/python3/Lib/struct.py
index d6bba588636..d6bba588636 100644
--- a/contrib/tools/python3/src/Lib/struct.py
+++ b/contrib/tools/python3/Lib/struct.py
diff --git a/contrib/tools/python3/src/Lib/subprocess.py b/contrib/tools/python3/Lib/subprocess.py
index 3264d9afc7e..3264d9afc7e 100644
--- a/contrib/tools/python3/src/Lib/subprocess.py
+++ b/contrib/tools/python3/Lib/subprocess.py
diff --git a/contrib/tools/python3/src/Lib/sunau.py b/contrib/tools/python3/Lib/sunau.py
index c6caab959ab..c6caab959ab 100644
--- a/contrib/tools/python3/src/Lib/sunau.py
+++ b/contrib/tools/python3/Lib/sunau.py
diff --git a/contrib/tools/python3/src/Lib/symtable.py b/contrib/tools/python3/Lib/symtable.py
index 4b0bc6f497a..4b0bc6f497a 100644
--- a/contrib/tools/python3/src/Lib/symtable.py
+++ b/contrib/tools/python3/Lib/symtable.py
diff --git a/contrib/tools/python3/src/Lib/sysconfig.py b/contrib/tools/python3/Lib/sysconfig.py
index 4fd5fbaab59..4fd5fbaab59 100644
--- a/contrib/tools/python3/src/Lib/sysconfig.py
+++ b/contrib/tools/python3/Lib/sysconfig.py
diff --git a/contrib/tools/python3/src/Lib/tabnanny.py b/contrib/tools/python3/Lib/tabnanny.py
index e2ac6837f15..e2ac6837f15 100755
--- a/contrib/tools/python3/src/Lib/tabnanny.py
+++ b/contrib/tools/python3/Lib/tabnanny.py
diff --git a/contrib/tools/python3/src/Lib/tarfile.py b/contrib/tools/python3/Lib/tarfile.py
index 3bbbcaa6211..3bbbcaa6211 100755
--- a/contrib/tools/python3/src/Lib/tarfile.py
+++ b/contrib/tools/python3/Lib/tarfile.py
diff --git a/contrib/tools/python3/src/Lib/telnetlib.py b/contrib/tools/python3/Lib/telnetlib.py
index 62d63612985..62d63612985 100644
--- a/contrib/tools/python3/src/Lib/telnetlib.py
+++ b/contrib/tools/python3/Lib/telnetlib.py
diff --git a/contrib/tools/python3/src/Lib/tempfile.py b/contrib/tools/python3/Lib/tempfile.py
index cbfc172a789..cbfc172a789 100644
--- a/contrib/tools/python3/src/Lib/tempfile.py
+++ b/contrib/tools/python3/Lib/tempfile.py
diff --git a/contrib/tools/python3/src/Lib/textwrap.py b/contrib/tools/python3/Lib/textwrap.py
index 98bedd27ea3..98bedd27ea3 100644
--- a/contrib/tools/python3/src/Lib/textwrap.py
+++ b/contrib/tools/python3/Lib/textwrap.py
diff --git a/contrib/tools/python3/src/Lib/this.py b/contrib/tools/python3/Lib/this.py
index e68dd3ff39b..e68dd3ff39b 100644
--- a/contrib/tools/python3/src/Lib/this.py
+++ b/contrib/tools/python3/Lib/this.py
diff --git a/contrib/tools/python3/Lib/threading.py b/contrib/tools/python3/Lib/threading.py
new file mode 100644
index 00000000000..98cb43c6972
--- /dev/null
+++ b/contrib/tools/python3/Lib/threading.py
@@ -0,0 +1,1706 @@
+"""Thread module emulating a subset of Java's threading model."""
+
+import os as _os
+import sys as _sys
+import _thread
+import functools
+
+from time import monotonic as _time
+from _weakrefset import WeakSet
+from itertools import count as _count
+try:
+ from _collections import deque as _deque
+except ImportError:
+ from collections import deque as _deque
+
+# Note regarding PEP 8 compliant names
+# This threading model was originally inspired by Java, and inherited
+# the convention of camelCase function and method names from that
+# language. Those original names are not in any imminent danger of
+# being deprecated (even for Py3k),so this module provides them as an
+# alias for the PEP 8 compliant names
+# Note that using the new PEP 8 compliant names facilitates substitution
+# with the multiprocessing module, which doesn't provide the old
+# Java inspired names.
+
+__all__ = ['get_ident', 'active_count', 'Condition', 'current_thread',
+ 'enumerate', 'main_thread', 'TIMEOUT_MAX',
+ 'Event', 'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Thread',
+ 'Barrier', 'BrokenBarrierError', 'Timer', 'ThreadError',
+ 'setprofile', 'settrace', 'local', 'stack_size',
+ 'excepthook', 'ExceptHookArgs', 'gettrace', 'getprofile',
+ 'setprofile_all_threads','settrace_all_threads']
+
+# Rename some stuff so "from threading import *" is safe
+_start_new_thread = _thread.start_new_thread
+_daemon_threads_allowed = _thread.daemon_threads_allowed
+_allocate_lock = _thread.allocate_lock
+_set_sentinel = _thread._set_sentinel
+get_ident = _thread.get_ident
+try:
+ _is_main_interpreter = _thread._is_main_interpreter
+except AttributeError:
+ # See https://github.com/python/cpython/issues/112826.
+ # We can pretend a subinterpreter is the main interpreter for the
+ # sake of _shutdown(), since that only means we do not wait for the
+ # subinterpreter's threads to finish. Instead, they will be stopped
+ # later by the mechanism we use for daemon threads. The likelihood
+ # of this case is small because rarely will the _thread module be
+ # replaced by a module without _is_main_interpreter().
+ # Furthermore, this is all irrelevant in applications
+ # that do not use subinterpreters.
+ def _is_main_interpreter():
+ return True
+try:
+ get_native_id = _thread.get_native_id
+ _HAVE_THREAD_NATIVE_ID = True
+ __all__.append('get_native_id')
+except AttributeError:
+ _HAVE_THREAD_NATIVE_ID = False
+ThreadError = _thread.error
+try:
+ _CRLock = _thread.RLock
+except AttributeError:
+ _CRLock = None
+TIMEOUT_MAX = _thread.TIMEOUT_MAX
+del _thread
+
+
+# Support for profile and trace hooks
+
+_profile_hook = None
+_trace_hook = None
+
+def setprofile(func):
+ """Set a profile function for all threads started from the threading module.
+
+ The func will be passed to sys.setprofile() for each thread, before its
+ run() method is called.
+ """
+ global _profile_hook
+ _profile_hook = func
+
+def setprofile_all_threads(func):
+ """Set a profile function for all threads started from the threading module
+ and all Python threads that are currently executing.
+
+ The func will be passed to sys.setprofile() for each thread, before its
+ run() method is called.
+ """
+ setprofile(func)
+ _sys._setprofileallthreads(func)
+
+def getprofile():
+ """Get the profiler function as set by threading.setprofile()."""
+ return _profile_hook
+
+def settrace(func):
+ """Set a trace function for all threads started from the threading module.
+
+ The func will be passed to sys.settrace() for each thread, before its run()
+ method is called.
+ """
+ global _trace_hook
+ _trace_hook = func
+
+def settrace_all_threads(func):
+ """Set a trace function for all threads started from the threading module
+ and all Python threads that are currently executing.
+
+ The func will be passed to sys.settrace() for each thread, before its run()
+ method is called.
+ """
+ settrace(func)
+ _sys._settraceallthreads(func)
+
+def gettrace():
+ """Get the trace function as set by threading.settrace()."""
+ return _trace_hook
+
+# Synchronization classes
+
+Lock = _allocate_lock
+
+def RLock(*args, **kwargs):
+ """Factory function that returns a new reentrant lock.
+
+ A reentrant lock must be released by the thread that acquired it. Once a
+ thread has acquired a reentrant lock, the same thread may acquire it again
+ without blocking; the thread must release it once for each time it has
+ acquired it.
+
+ """
+ if _CRLock is None:
+ return _PyRLock(*args, **kwargs)
+ return _CRLock(*args, **kwargs)
+
+class _RLock:
+ """This class implements reentrant lock objects.
+
+ A reentrant lock must be released by the thread that acquired it. Once a
+ thread has acquired a reentrant lock, the same thread may acquire it
+ again without blocking; the thread must release it once for each time it
+ has acquired it.
+
+ """
+
+ def __init__(self):
+ self._block = _allocate_lock()
+ self._owner = None
+ self._count = 0
+
+ def __repr__(self):
+ owner = self._owner
+ try:
+ owner = _active[owner].name
+ except KeyError:
+ pass
+ return "<%s %s.%s object owner=%r count=%d at %s>" % (
+ "locked" if self._block.locked() else "unlocked",
+ self.__class__.__module__,
+ self.__class__.__qualname__,
+ owner,
+ self._count,
+ hex(id(self))
+ )
+
+ def _at_fork_reinit(self):
+ self._block._at_fork_reinit()
+ self._owner = None
+ self._count = 0
+
+ def acquire(self, blocking=True, timeout=-1):
+ """Acquire a lock, blocking or non-blocking.
+
+ When invoked without arguments: if this thread already owns the lock,
+ increment the recursion level by one, and return immediately. Otherwise,
+ if another thread owns the lock, block until the lock is unlocked. Once
+ the lock is unlocked (not owned by any thread), then grab ownership, set
+ the recursion level to one, and return. If more than one thread is
+ blocked waiting until the lock is unlocked, only one at a time will be
+ able to grab ownership of the lock. There is no return value in this
+ case.
+
+ When invoked with the blocking argument set to true, do the same thing
+ as when called without arguments, and return true.
+
+ When invoked with the blocking argument set to false, do not block. If a
+ call without an argument would block, return false immediately;
+ otherwise, do the same thing as when called without arguments, and
+ return true.
+
+ When invoked with the floating-point timeout argument set to a positive
+ value, block for at most the number of seconds specified by timeout
+ and as long as the lock cannot be acquired. Return true if the lock has
+ been acquired, false if the timeout has elapsed.
+
+ """
+ me = get_ident()
+ if self._owner == me:
+ self._count += 1
+ return 1
+ rc = self._block.acquire(blocking, timeout)
+ if rc:
+ self._owner = me
+ self._count = 1
+ return rc
+
+ __enter__ = acquire
+
+ def release(self):
+ """Release a lock, decrementing the recursion level.
+
+ If after the decrement it is zero, reset the lock to unlocked (not owned
+ by any thread), and if any other threads are blocked waiting for the
+ lock to become unlocked, allow exactly one of them to proceed. If after
+ the decrement the recursion level is still nonzero, the lock remains
+ locked and owned by the calling thread.
+
+ Only call this method when the calling thread owns the lock. A
+ RuntimeError is raised if this method is called when the lock is
+ unlocked.
+
+ There is no return value.
+
+ """
+ if self._owner != get_ident():
+ raise RuntimeError("cannot release un-acquired lock")
+ self._count = count = self._count - 1
+ if not count:
+ self._owner = None
+ self._block.release()
+
+ def __exit__(self, t, v, tb):
+ self.release()
+
+ # Internal methods used by condition variables
+
+ def _acquire_restore(self, state):
+ self._block.acquire()
+ self._count, self._owner = state
+
+ def _release_save(self):
+ if self._count == 0:
+ raise RuntimeError("cannot release un-acquired lock")
+ count = self._count
+ self._count = 0
+ owner = self._owner
+ self._owner = None
+ self._block.release()
+ return (count, owner)
+
+ def _is_owned(self):
+ return self._owner == get_ident()
+
+ # Internal method used for reentrancy checks
+
+ def _recursion_count(self):
+ if self._owner != get_ident():
+ return 0
+ return self._count
+
+_PyRLock = _RLock
+
+
+class Condition:
+ """Class that implements a condition variable.
+
+ A condition variable allows one or more threads to wait until they are
+ notified by another thread.
+
+ If the lock argument is given and not None, it must be a Lock or RLock
+ object, and it is used as the underlying lock. Otherwise, a new RLock object
+ is created and used as the underlying lock.
+
+ """
+
+ def __init__(self, lock=None):
+ if lock is None:
+ lock = RLock()
+ self._lock = lock
+ # Export the lock's acquire() and release() methods
+ self.acquire = lock.acquire
+ self.release = lock.release
+ # If the lock defines _release_save() and/or _acquire_restore(),
+ # these override the default implementations (which just call
+ # release() and acquire() on the lock). Ditto for _is_owned().
+ if hasattr(lock, '_release_save'):
+ self._release_save = lock._release_save
+ if hasattr(lock, '_acquire_restore'):
+ self._acquire_restore = lock._acquire_restore
+ if hasattr(lock, '_is_owned'):
+ self._is_owned = lock._is_owned
+ self._waiters = _deque()
+
+ def _at_fork_reinit(self):
+ self._lock._at_fork_reinit()
+ self._waiters.clear()
+
+ def __enter__(self):
+ return self._lock.__enter__()
+
+ def __exit__(self, *args):
+ return self._lock.__exit__(*args)
+
+ def __repr__(self):
+ return "<Condition(%s, %d)>" % (self._lock, len(self._waiters))
+
+ def _release_save(self):
+ self._lock.release() # No state to save
+
+ def _acquire_restore(self, x):
+ self._lock.acquire() # Ignore saved state
+
+ def _is_owned(self):
+ # Return True if lock is owned by current_thread.
+ # This method is called only if _lock doesn't have _is_owned().
+ if self._lock.acquire(False):
+ self._lock.release()
+ return False
+ else:
+ return True
+
+ def wait(self, timeout=None):
+ """Wait until notified or until a timeout occurs.
+
+ If the calling thread has not acquired the lock when this method is
+ called, a RuntimeError is raised.
+
+ This method releases the underlying lock, and then blocks until it is
+ awakened by a notify() or notify_all() call for the same condition
+ variable in another thread, or until the optional timeout occurs. Once
+ awakened or timed out, it re-acquires the lock and returns.
+
+ When the timeout argument is present and not None, it should be a
+ floating point number specifying a timeout for the operation in seconds
+ (or fractions thereof).
+
+ When the underlying lock is an RLock, it is not released using its
+ release() method, since this may not actually unlock the lock when it
+ was acquired multiple times recursively. Instead, an internal interface
+ of the RLock class is used, which really unlocks it even when it has
+ been recursively acquired several times. Another internal interface is
+ then used to restore the recursion level when the lock is reacquired.
+
+ """
+ if not self._is_owned():
+ raise RuntimeError("cannot wait on un-acquired lock")
+ waiter = _allocate_lock()
+ waiter.acquire()
+ self._waiters.append(waiter)
+ saved_state = self._release_save()
+ gotit = False
+ try: # restore state no matter what (e.g., KeyboardInterrupt)
+ if timeout is None:
+ waiter.acquire()
+ gotit = True
+ else:
+ if timeout > 0:
+ gotit = waiter.acquire(True, timeout)
+ else:
+ gotit = waiter.acquire(False)
+ return gotit
+ finally:
+ self._acquire_restore(saved_state)
+ if not gotit:
+ try:
+ self._waiters.remove(waiter)
+ except ValueError:
+ pass
+
+ def wait_for(self, predicate, timeout=None):
+ """Wait until a condition evaluates to True.
+
+ predicate should be a callable which result will be interpreted as a
+ boolean value. A timeout may be provided giving the maximum time to
+ wait.
+
+ """
+ endtime = None
+ waittime = timeout
+ result = predicate()
+ while not result:
+ if waittime is not None:
+ if endtime is None:
+ endtime = _time() + waittime
+ else:
+ waittime = endtime - _time()
+ if waittime <= 0:
+ break
+ self.wait(waittime)
+ result = predicate()
+ return result
+
+ def notify(self, n=1):
+ """Wake up one or more threads waiting on this condition, if any.
+
+ If the calling thread has not acquired the lock when this method is
+ called, a RuntimeError is raised.
+
+ This method wakes up at most n of the threads waiting for the condition
+ variable; it is a no-op if no threads are waiting.
+
+ """
+ if not self._is_owned():
+ raise RuntimeError("cannot notify on un-acquired lock")
+ waiters = self._waiters
+ while waiters and n > 0:
+ waiter = waiters[0]
+ try:
+ waiter.release()
+ except RuntimeError:
+ # gh-92530: The previous call of notify() released the lock,
+ # but was interrupted before removing it from the queue.
+ # It can happen if a signal handler raises an exception,
+ # like CTRL+C which raises KeyboardInterrupt.
+ pass
+ else:
+ n -= 1
+ try:
+ waiters.remove(waiter)
+ except ValueError:
+ pass
+
+ def notify_all(self):
+ """Wake up all threads waiting on this condition.
+
+ If the calling thread has not acquired the lock when this method
+ is called, a RuntimeError is raised.
+
+ """
+ self.notify(len(self._waiters))
+
+ def notifyAll(self):
+ """Wake up all threads waiting on this condition.
+
+ This method is deprecated, use notify_all() instead.
+
+ """
+ import warnings
+ warnings.warn('notifyAll() is deprecated, use notify_all() instead',
+ DeprecationWarning, stacklevel=2)
+ self.notify_all()
+
+
+class Semaphore:
+ """This class implements semaphore objects.
+
+ Semaphores manage a counter representing the number of release() calls minus
+ the number of acquire() calls, plus an initial value. The acquire() method
+ blocks if necessary until it can return without making the counter
+ negative. If not given, value defaults to 1.
+
+ """
+
+ # After Tim Peters' semaphore class, but not quite the same (no maximum)
+
+ def __init__(self, value=1):
+ if value < 0:
+ raise ValueError("semaphore initial value must be >= 0")
+ self._cond = Condition(Lock())
+ self._value = value
+
+ def __repr__(self):
+ cls = self.__class__
+ return (f"<{cls.__module__}.{cls.__qualname__} at {id(self):#x}:"
+ f" value={self._value}>")
+
+ def acquire(self, blocking=True, timeout=None):
+ """Acquire a semaphore, decrementing the internal counter by one.
+
+ When invoked without arguments: if the internal counter is larger than
+ zero on entry, decrement it by one and return immediately. If it is zero
+ on entry, block, waiting until some other thread has called release() to
+ make it larger than zero. This is done with proper interlocking so that
+ if multiple acquire() calls are blocked, release() will wake exactly one
+ of them up. The implementation may pick one at random, so the order in
+ which blocked threads are awakened should not be relied on. There is no
+ return value in this case.
+
+ When invoked with blocking set to true, do the same thing as when called
+ without arguments, and return true.
+
+ When invoked with blocking set to false, do not block. If a call without
+ an argument would block, return false immediately; otherwise, do the
+ same thing as when called without arguments, and return true.
+
+ When invoked with a timeout other than None, it will block for at
+ most timeout seconds. If acquire does not complete successfully in
+ that interval, return false. Return true otherwise.
+
+ """
+ if not blocking and timeout is not None:
+ raise ValueError("can't specify timeout for non-blocking acquire")
+ rc = False
+ endtime = None
+ with self._cond:
+ while self._value == 0:
+ if not blocking:
+ break
+ if timeout is not None:
+ if endtime is None:
+ endtime = _time() + timeout
+ else:
+ timeout = endtime - _time()
+ if timeout <= 0:
+ break
+ self._cond.wait(timeout)
+ else:
+ self._value -= 1
+ rc = True
+ return rc
+
+ __enter__ = acquire
+
+ def release(self, n=1):
+ """Release a semaphore, incrementing the internal counter by one or more.
+
+ When the counter is zero on entry and another thread is waiting for it
+ to become larger than zero again, wake up that thread.
+
+ """
+ if n < 1:
+ raise ValueError('n must be one or more')
+ with self._cond:
+ self._value += n
+ self._cond.notify(n)
+
+ def __exit__(self, t, v, tb):
+ self.release()
+
+
+class BoundedSemaphore(Semaphore):
+ """Implements a bounded semaphore.
+
+ A bounded semaphore checks to make sure its current value doesn't exceed its
+ initial value. If it does, ValueError is raised. In most situations
+ semaphores are used to guard resources with limited capacity.
+
+ If the semaphore is released too many times it's a sign of a bug. If not
+ given, value defaults to 1.
+
+ Like regular semaphores, bounded semaphores manage a counter representing
+ the number of release() calls minus the number of acquire() calls, plus an
+ initial value. The acquire() method blocks if necessary until it can return
+ without making the counter negative. If not given, value defaults to 1.
+
+ """
+
+ def __init__(self, value=1):
+ super().__init__(value)
+ self._initial_value = value
+
+ def __repr__(self):
+ cls = self.__class__
+ return (f"<{cls.__module__}.{cls.__qualname__} at {id(self):#x}:"
+ f" value={self._value}/{self._initial_value}>")
+
+ def release(self, n=1):
+ """Release a semaphore, incrementing the internal counter by one or more.
+
+ When the counter is zero on entry and another thread is waiting for it
+ to become larger than zero again, wake up that thread.
+
+ If the number of releases exceeds the number of acquires,
+ raise a ValueError.
+
+ """
+ if n < 1:
+ raise ValueError('n must be one or more')
+ with self._cond:
+ if self._value + n > self._initial_value:
+ raise ValueError("Semaphore released too many times")
+ self._value += n
+ self._cond.notify(n)
+
+
+class Event:
+ """Class implementing event objects.
+
+ Events manage a flag that can be set to true with the set() method and reset
+ to false with the clear() method. The wait() method blocks until the flag is
+ true. The flag is initially false.
+
+ """
+
+ # After Tim Peters' event class (without is_posted())
+
+ def __init__(self):
+ self._cond = Condition(Lock())
+ self._flag = False
+
+ def __repr__(self):
+ cls = self.__class__
+ status = 'set' if self._flag else 'unset'
+ return f"<{cls.__module__}.{cls.__qualname__} at {id(self):#x}: {status}>"
+
+ def _at_fork_reinit(self):
+ # Private method called by Thread._reset_internal_locks()
+ self._cond._at_fork_reinit()
+
+ def is_set(self):
+ """Return true if and only if the internal flag is true."""
+ return self._flag
+
+ def isSet(self):
+ """Return true if and only if the internal flag is true.
+
+ This method is deprecated, use is_set() instead.
+
+ """
+ import warnings
+ warnings.warn('isSet() is deprecated, use is_set() instead',
+ DeprecationWarning, stacklevel=2)
+ return self.is_set()
+
+ def set(self):
+ """Set the internal flag to true.
+
+ All threads waiting for it to become true are awakened. Threads
+ that call wait() once the flag is true will not block at all.
+
+ """
+ with self._cond:
+ self._flag = True
+ self._cond.notify_all()
+
+ def clear(self):
+ """Reset the internal flag to false.
+
+ Subsequently, threads calling wait() will block until set() is called to
+ set the internal flag to true again.
+
+ """
+ with self._cond:
+ self._flag = False
+
+ def wait(self, timeout=None):
+ """Block until the internal flag is true.
+
+ If the internal flag is true on entry, return immediately. Otherwise,
+ block until another thread calls set() to set the flag to true, or until
+ the optional timeout occurs.
+
+ When the timeout argument is present and not None, it should be a
+ floating point number specifying a timeout for the operation in seconds
+ (or fractions thereof).
+
+ This method returns the internal flag on exit, so it will always return
+ True except if a timeout is given and the operation times out.
+
+ """
+ with self._cond:
+ signaled = self._flag
+ if not signaled:
+ signaled = self._cond.wait(timeout)
+ return signaled
+
+
+# A barrier class. Inspired in part by the pthread_barrier_* api and
+# the CyclicBarrier class from Java. See
+# http://sourceware.org/pthreads-win32/manual/pthread_barrier_init.html and
+# http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/
+# CyclicBarrier.html
+# for information.
+# We maintain two main states, 'filling' and 'draining' enabling the barrier
+# to be cyclic. Threads are not allowed into it until it has fully drained
+# since the previous cycle. In addition, a 'resetting' state exists which is
+# similar to 'draining' except that threads leave with a BrokenBarrierError,
+# and a 'broken' state in which all threads get the exception.
+class Barrier:
+ """Implements a Barrier.
+
+ Useful for synchronizing a fixed number of threads at known synchronization
+ points. Threads block on 'wait()' and are simultaneously awoken once they
+ have all made that call.
+
+ """
+
+ def __init__(self, parties, action=None, timeout=None):
+ """Create a barrier, initialised to 'parties' threads.
+
+ 'action' is a callable which, when supplied, will be called by one of
+ the threads after they have all entered the barrier and just prior to
+ releasing them all. If a 'timeout' is provided, it is used as the
+ default for all subsequent 'wait()' calls.
+
+ """
+ self._cond = Condition(Lock())
+ self._action = action
+ self._timeout = timeout
+ self._parties = parties
+ self._state = 0 # 0 filling, 1 draining, -1 resetting, -2 broken
+ self._count = 0
+
+ def __repr__(self):
+ cls = self.__class__
+ if self.broken:
+ return f"<{cls.__module__}.{cls.__qualname__} at {id(self):#x}: broken>"
+ return (f"<{cls.__module__}.{cls.__qualname__} at {id(self):#x}:"
+ f" waiters={self.n_waiting}/{self.parties}>")
+
+ def wait(self, timeout=None):
+ """Wait for the barrier.
+
+ When the specified number of threads have started waiting, they are all
+ simultaneously awoken. If an 'action' was provided for the barrier, one
+ of the threads will have executed that callback prior to returning.
+ Returns an individual index number from 0 to 'parties-1'.
+
+ """
+ if timeout is None:
+ timeout = self._timeout
+ with self._cond:
+ self._enter() # Block while the barrier drains.
+ index = self._count
+ self._count += 1
+ try:
+ if index + 1 == self._parties:
+ # We release the barrier
+ self._release()
+ else:
+ # We wait until someone releases us
+ self._wait(timeout)
+ return index
+ finally:
+ self._count -= 1
+ # Wake up any threads waiting for barrier to drain.
+ self._exit()
+
+ # Block until the barrier is ready for us, or raise an exception
+ # if it is broken.
+ def _enter(self):
+ while self._state in (-1, 1):
+ # It is draining or resetting, wait until done
+ self._cond.wait()
+ #see if the barrier is in a broken state
+ if self._state < 0:
+ raise BrokenBarrierError
+ assert self._state == 0
+
+ # Optionally run the 'action' and release the threads waiting
+ # in the barrier.
+ def _release(self):
+ try:
+ if self._action:
+ self._action()
+ # enter draining state
+ self._state = 1
+ self._cond.notify_all()
+ except:
+ #an exception during the _action handler. Break and reraise
+ self._break()
+ raise
+
+ # Wait in the barrier until we are released. Raise an exception
+ # if the barrier is reset or broken.
+ def _wait(self, timeout):
+ if not self._cond.wait_for(lambda : self._state != 0, timeout):
+ #timed out. Break the barrier
+ self._break()
+ raise BrokenBarrierError
+ if self._state < 0:
+ raise BrokenBarrierError
+ assert self._state == 1
+
+ # If we are the last thread to exit the barrier, signal any threads
+ # waiting for the barrier to drain.
+ def _exit(self):
+ if self._count == 0:
+ if self._state in (-1, 1):
+ #resetting or draining
+ self._state = 0
+ self._cond.notify_all()
+
+ def reset(self):
+ """Reset the barrier to the initial state.
+
+ Any threads currently waiting will get the BrokenBarrier exception
+ raised.
+
+ """
+ with self._cond:
+ if self._count > 0:
+ if self._state == 0:
+ #reset the barrier, waking up threads
+ self._state = -1
+ elif self._state == -2:
+ #was broken, set it to reset state
+ #which clears when the last thread exits
+ self._state = -1
+ else:
+ self._state = 0
+ self._cond.notify_all()
+
+ def abort(self):
+ """Place the barrier into a 'broken' state.
+
+ Useful in case of error. Any currently waiting threads and threads
+ attempting to 'wait()' will have BrokenBarrierError raised.
+
+ """
+ with self._cond:
+ self._break()
+
+ def _break(self):
+ # An internal error was detected. The barrier is set to
+ # a broken state all parties awakened.
+ self._state = -2
+ self._cond.notify_all()
+
+ @property
+ def parties(self):
+ """Return the number of threads required to trip the barrier."""
+ return self._parties
+
+ @property
+ def n_waiting(self):
+ """Return the number of threads currently waiting at the barrier."""
+ # We don't need synchronization here since this is an ephemeral result
+ # anyway. It returns the correct value in the steady state.
+ if self._state == 0:
+ return self._count
+ return 0
+
+ @property
+ def broken(self):
+ """Return True if the barrier is in a broken state."""
+ return self._state == -2
+
+# exception raised by the Barrier class
+class BrokenBarrierError(RuntimeError):
+ pass
+
+
+# Helper to generate new thread names
+_counter = _count(1).__next__
+def _newname(name_template):
+ return name_template % _counter()
+
+# Active thread administration.
+#
+# bpo-44422: Use a reentrant lock to allow reentrant calls to functions like
+# threading.enumerate().
+_active_limbo_lock = RLock()
+_active = {} # maps thread id to Thread object
+_limbo = {}
+_dangling = WeakSet()
+
+# Set of Thread._tstate_lock locks of non-daemon threads used by _shutdown()
+# to wait until all Python thread states get deleted:
+# see Thread._set_tstate_lock().
+_shutdown_locks_lock = _allocate_lock()
+_shutdown_locks = set()
+
+def _maintain_shutdown_locks():
+ """
+ Drop any shutdown locks that don't correspond to running threads anymore.
+
+ Calling this from time to time avoids an ever-growing _shutdown_locks
+ set when Thread objects are not joined explicitly. See bpo-37788.
+
+ This must be called with _shutdown_locks_lock acquired.
+ """
+ # If a lock was released, the corresponding thread has exited
+ to_remove = [lock for lock in _shutdown_locks if not lock.locked()]
+ _shutdown_locks.difference_update(to_remove)
+
+
+# Main class for threads
+
+class Thread:
+ """A class that represents a thread of control.
+
+ This class can be safely subclassed in a limited fashion. There are two ways
+ to specify the activity: by passing a callable object to the constructor, or
+ by overriding the run() method in a subclass.
+
+ """
+
+ _initialized = False
+
+ def __init__(self, group=None, target=None, name=None,
+ args=(), kwargs=None, *, daemon=None):
+ """This constructor should always be called with keyword arguments. Arguments are:
+
+ *group* should be None; reserved for future extension when a ThreadGroup
+ class is implemented.
+
+ *target* is the callable object to be invoked by the run()
+ method. Defaults to None, meaning nothing is called.
+
+ *name* is the thread name. By default, a unique name is constructed of
+ the form "Thread-N" where N is a small decimal number.
+
+ *args* is a list or tuple of arguments for the target invocation. Defaults to ().
+
+ *kwargs* is a dictionary of keyword arguments for the target
+ invocation. Defaults to {}.
+
+ If a subclass overrides the constructor, it must make sure to invoke
+ the base class constructor (Thread.__init__()) before doing anything
+ else to the thread.
+
+ """
+ assert group is None, "group argument must be None for now"
+ if kwargs is None:
+ kwargs = {}
+ if name:
+ name = str(name)
+ else:
+ name = _newname("Thread-%d")
+ if target is not None:
+ try:
+ target_name = target.__name__
+ name += f" ({target_name})"
+ except AttributeError:
+ pass
+
+ self._target = target
+ self._name = name
+ self._args = args
+ self._kwargs = kwargs
+ if daemon is not None:
+ if daemon and not _daemon_threads_allowed():
+ raise RuntimeError('daemon threads are disabled in this (sub)interpreter')
+ self._daemonic = daemon
+ else:
+ self._daemonic = current_thread().daemon
+ self._ident = None
+ if _HAVE_THREAD_NATIVE_ID:
+ self._native_id = None
+ self._tstate_lock = None
+ self._started = Event()
+ self._is_stopped = False
+ self._initialized = True
+ # Copy of sys.stderr used by self._invoke_excepthook()
+ self._stderr = _sys.stderr
+ self._invoke_excepthook = _make_invoke_excepthook()
+ # For debugging and _after_fork()
+ _dangling.add(self)
+
+ def _reset_internal_locks(self, is_alive):
+ # private! Called by _after_fork() to reset our internal locks as
+ # they may be in an invalid state leading to a deadlock or crash.
+ self._started._at_fork_reinit()
+ if is_alive:
+ # bpo-42350: If the fork happens when the thread is already stopped
+ # (ex: after threading._shutdown() has been called), _tstate_lock
+ # is None. Do nothing in this case.
+ if self._tstate_lock is not None:
+ self._tstate_lock._at_fork_reinit()
+ self._tstate_lock.acquire()
+ else:
+ # The thread isn't alive after fork: it doesn't have a tstate
+ # anymore.
+ self._is_stopped = True
+ self._tstate_lock = None
+
+ def __repr__(self):
+ assert self._initialized, "Thread.__init__() was not called"
+ status = "initial"
+ if self._started.is_set():
+ status = "started"
+ self.is_alive() # easy way to get ._is_stopped set when appropriate
+ if self._is_stopped:
+ status = "stopped"
+ if self._daemonic:
+ status += " daemon"
+ if self._ident is not None:
+ status += " %s" % self._ident
+ return "<%s(%s, %s)>" % (self.__class__.__name__, self._name, status)
+
+ def start(self):
+ """Start the thread's activity.
+
+ It must be called at most once per thread object. It arranges for the
+ object's run() method to be invoked in a separate thread of control.
+
+ This method will raise a RuntimeError if called more than once on the
+ same thread object.
+
+ """
+ if not self._initialized:
+ raise RuntimeError("thread.__init__() not called")
+
+ if self._started.is_set():
+ raise RuntimeError("threads can only be started once")
+
+ with _active_limbo_lock:
+ _limbo[self] = self
+ try:
+ _start_new_thread(self._bootstrap, ())
+ except Exception:
+ with _active_limbo_lock:
+ del _limbo[self]
+ raise
+ self._started.wait()
+
+ def run(self):
+ """Method representing the thread's activity.
+
+ You may override this method in a subclass. The standard run() method
+ invokes the callable object passed to the object's constructor as the
+ target argument, if any, with sequential and keyword arguments taken
+ from the args and kwargs arguments, respectively.
+
+ """
+ try:
+ if self._target is not None:
+ self._target(*self._args, **self._kwargs)
+ finally:
+ # Avoid a refcycle if the thread is running a function with
+ # an argument that has a member that points to the thread.
+ del self._target, self._args, self._kwargs
+
+ def _bootstrap(self):
+ # Wrapper around the real bootstrap code that ignores
+ # exceptions during interpreter cleanup. Those typically
+ # happen when a daemon thread wakes up at an unfortunate
+ # moment, finds the world around it destroyed, and raises some
+ # random exception *** while trying to report the exception in
+ # _bootstrap_inner() below ***. Those random exceptions
+ # don't help anybody, and they confuse users, so we suppress
+ # them. We suppress them only when it appears that the world
+ # indeed has already been destroyed, so that exceptions in
+ # _bootstrap_inner() during normal business hours are properly
+ # reported. Also, we only suppress them for daemonic threads;
+ # if a non-daemonic encounters this, something else is wrong.
+ try:
+ self._bootstrap_inner()
+ except:
+ if self._daemonic and _sys is None:
+ return
+ raise
+
+ def _set_ident(self):
+ self._ident = get_ident()
+
+ if _HAVE_THREAD_NATIVE_ID:
+ def _set_native_id(self):
+ self._native_id = get_native_id()
+
+ def _set_tstate_lock(self):
+ """
+ Set a lock object which will be released by the interpreter when
+ the underlying thread state (see pystate.h) gets deleted.
+ """
+ self._tstate_lock = _set_sentinel()
+ self._tstate_lock.acquire()
+
+ if not self.daemon:
+ with _shutdown_locks_lock:
+ _maintain_shutdown_locks()
+ _shutdown_locks.add(self._tstate_lock)
+
+ def _bootstrap_inner(self):
+ try:
+ self._set_ident()
+ self._set_tstate_lock()
+ if _HAVE_THREAD_NATIVE_ID:
+ self._set_native_id()
+ self._started.set()
+ with _active_limbo_lock:
+ _active[self._ident] = self
+ del _limbo[self]
+
+ if _trace_hook:
+ _sys.settrace(_trace_hook)
+ if _profile_hook:
+ _sys.setprofile(_profile_hook)
+
+ try:
+ self.run()
+ except:
+ self._invoke_excepthook(self)
+ finally:
+ self._delete()
+
+ def _stop(self):
+ # After calling ._stop(), .is_alive() returns False and .join() returns
+ # immediately. ._tstate_lock must be released before calling ._stop().
+ #
+ # Normal case: C code at the end of the thread's life
+ # (release_sentinel in _threadmodule.c) releases ._tstate_lock, and
+ # that's detected by our ._wait_for_tstate_lock(), called by .join()
+ # and .is_alive(). Any number of threads _may_ call ._stop()
+ # simultaneously (for example, if multiple threads are blocked in
+ # .join() calls), and they're not serialized. That's harmless -
+ # they'll just make redundant rebindings of ._is_stopped and
+ # ._tstate_lock. Obscure: we rebind ._tstate_lock last so that the
+ # "assert self._is_stopped" in ._wait_for_tstate_lock() always works
+ # (the assert is executed only if ._tstate_lock is None).
+ #
+ # Special case: _main_thread releases ._tstate_lock via this
+ # module's _shutdown() function.
+ lock = self._tstate_lock
+ if lock is not None:
+ assert not lock.locked()
+ self._is_stopped = True
+ self._tstate_lock = None
+ if not self.daemon:
+ with _shutdown_locks_lock:
+ # Remove our lock and other released locks from _shutdown_locks
+ _maintain_shutdown_locks()
+
+ def _delete(self):
+ "Remove current thread from the dict of currently running threads."
+ with _active_limbo_lock:
+ del _active[get_ident()]
+ # There must not be any python code between the previous line
+ # and after the lock is released. Otherwise a tracing function
+ # could try to acquire the lock again in the same thread, (in
+ # current_thread()), and would block.
+
+ def join(self, timeout=None):
+ """Wait until the thread terminates.
+
+ This blocks the calling thread until the thread whose join() method is
+ called terminates -- either normally or through an unhandled exception
+ or until the optional timeout occurs.
+
+ When the timeout argument is present and not None, it should be a
+ floating point number specifying a timeout for the operation in seconds
+ (or fractions thereof). As join() always returns None, you must call
+ is_alive() after join() to decide whether a timeout happened -- if the
+ thread is still alive, the join() call timed out.
+
+ When the timeout argument is not present or None, the operation will
+ block until the thread terminates.
+
+ A thread can be join()ed many times.
+
+ join() raises a RuntimeError if an attempt is made to join the current
+ thread as that would cause a deadlock. It is also an error to join() a
+ thread before it has been started and attempts to do so raises the same
+ exception.
+
+ """
+ if not self._initialized:
+ raise RuntimeError("Thread.__init__() not called")
+ if not self._started.is_set():
+ raise RuntimeError("cannot join thread before it is started")
+ if self is current_thread():
+ raise RuntimeError("cannot join current thread")
+
+ if timeout is None:
+ self._wait_for_tstate_lock()
+ else:
+ # the behavior of a negative timeout isn't documented, but
+ # historically .join(timeout=x) for x<0 has acted as if timeout=0
+ self._wait_for_tstate_lock(timeout=max(timeout, 0))
+
+ def _wait_for_tstate_lock(self, block=True, timeout=-1):
+ # Issue #18808: wait for the thread state to be gone.
+ # At the end of the thread's life, after all knowledge of the thread
+ # is removed from C data structures, C code releases our _tstate_lock.
+ # This method passes its arguments to _tstate_lock.acquire().
+ # If the lock is acquired, the C code is done, and self._stop() is
+ # called. That sets ._is_stopped to True, and ._tstate_lock to None.
+ lock = self._tstate_lock
+ if lock is None:
+ # already determined that the C code is done
+ assert self._is_stopped
+ return
+
+ try:
+ if lock.acquire(block, timeout):
+ lock.release()
+ self._stop()
+ except:
+ if lock.locked():
+ # bpo-45274: lock.acquire() acquired the lock, but the function
+ # was interrupted with an exception before reaching the
+ # lock.release(). It can happen if a signal handler raises an
+ # exception, like CTRL+C which raises KeyboardInterrupt.
+ lock.release()
+ self._stop()
+ raise
+
+ @property
+ def name(self):
+ """A string used for identification purposes only.
+
+ It has no semantics. Multiple threads may be given the same name. The
+ initial name is set by the constructor.
+
+ """
+ assert self._initialized, "Thread.__init__() not called"
+ return self._name
+
+ @name.setter
+ def name(self, name):
+ assert self._initialized, "Thread.__init__() not called"
+ self._name = str(name)
+
+ @property
+ def ident(self):
+ """Thread identifier of this thread or None if it has not been started.
+
+ This is a nonzero integer. See the get_ident() function. Thread
+ identifiers may be recycled when a thread exits and another thread is
+ created. The identifier is available even after the thread has exited.
+
+ """
+ assert self._initialized, "Thread.__init__() not called"
+ return self._ident
+
+ if _HAVE_THREAD_NATIVE_ID:
+ @property
+ def native_id(self):
+ """Native integral thread ID of this thread, or None if it has not been started.
+
+ This is a non-negative integer. See the get_native_id() function.
+ This represents the Thread ID as reported by the kernel.
+
+ """
+ assert self._initialized, "Thread.__init__() not called"
+ return self._native_id
+
+ def is_alive(self):
+ """Return whether the thread is alive.
+
+ This method returns True just before the run() method starts until just
+ after the run() method terminates. See also the module function
+ enumerate().
+
+ """
+ assert self._initialized, "Thread.__init__() not called"
+ if self._is_stopped or not self._started.is_set():
+ return False
+ self._wait_for_tstate_lock(False)
+ return not self._is_stopped
+
+ @property
+ def daemon(self):
+ """A boolean value indicating whether this thread is a daemon thread.
+
+ This must be set before start() is called, otherwise RuntimeError is
+ raised. Its initial value is inherited from the creating thread; the
+ main thread is not a daemon thread and therefore all threads created in
+ the main thread default to daemon = False.
+
+ The entire Python program exits when only daemon threads are left.
+
+ """
+ assert self._initialized, "Thread.__init__() not called"
+ return self._daemonic
+
+ @daemon.setter
+ def daemon(self, daemonic):
+ if not self._initialized:
+ raise RuntimeError("Thread.__init__() not called")
+ if daemonic and not _daemon_threads_allowed():
+ raise RuntimeError('daemon threads are disabled in this interpreter')
+ if self._started.is_set():
+ raise RuntimeError("cannot set daemon status of active thread")
+ self._daemonic = daemonic
+
+ def isDaemon(self):
+ """Return whether this thread is a daemon.
+
+ This method is deprecated, use the daemon attribute instead.
+
+ """
+ import warnings
+ warnings.warn('isDaemon() is deprecated, get the daemon attribute instead',
+ DeprecationWarning, stacklevel=2)
+ return self.daemon
+
+ def setDaemon(self, daemonic):
+ """Set whether this thread is a daemon.
+
+ This method is deprecated, use the .daemon property instead.
+
+ """
+ import warnings
+ warnings.warn('setDaemon() is deprecated, set the daemon attribute instead',
+ DeprecationWarning, stacklevel=2)
+ self.daemon = daemonic
+
+ def getName(self):
+ """Return a string used for identification purposes only.
+
+ This method is deprecated, use the name attribute instead.
+
+ """
+ import warnings
+ warnings.warn('getName() is deprecated, get the name attribute instead',
+ DeprecationWarning, stacklevel=2)
+ return self.name
+
+ def setName(self, name):
+ """Set the name string for this thread.
+
+ This method is deprecated, use the name attribute instead.
+
+ """
+ import warnings
+ warnings.warn('setName() is deprecated, set the name attribute instead',
+ DeprecationWarning, stacklevel=2)
+ self.name = name
+
+
+try:
+ from _thread import (_excepthook as excepthook,
+ _ExceptHookArgs as ExceptHookArgs)
+except ImportError:
+ # Simple Python implementation if _thread._excepthook() is not available
+ from traceback import print_exception as _print_exception
+ from collections import namedtuple
+
+ _ExceptHookArgs = namedtuple(
+ 'ExceptHookArgs',
+ 'exc_type exc_value exc_traceback thread')
+
+ def ExceptHookArgs(args):
+ return _ExceptHookArgs(*args)
+
+ def excepthook(args, /):
+ """
+ Handle uncaught Thread.run() exception.
+ """
+ if args.exc_type == SystemExit:
+ # silently ignore SystemExit
+ return
+
+ if _sys is not None and _sys.stderr is not None:
+ stderr = _sys.stderr
+ elif args.thread is not None:
+ stderr = args.thread._stderr
+ if stderr is None:
+ # do nothing if sys.stderr is None and sys.stderr was None
+ # when the thread was created
+ return
+ else:
+ # do nothing if sys.stderr is None and args.thread is None
+ return
+
+ if args.thread is not None:
+ name = args.thread.name
+ else:
+ name = get_ident()
+ print(f"Exception in thread {name}:",
+ file=stderr, flush=True)
+ _print_exception(args.exc_type, args.exc_value, args.exc_traceback,
+ file=stderr)
+ stderr.flush()
+
+
+# Original value of threading.excepthook
+__excepthook__ = excepthook
+
+
+def _make_invoke_excepthook():
+ # Create a local namespace to ensure that variables remain alive
+ # when _invoke_excepthook() is called, even if it is called late during
+ # Python shutdown. It is mostly needed for daemon threads.
+
+ old_excepthook = excepthook
+ old_sys_excepthook = _sys.excepthook
+ if old_excepthook is None:
+ raise RuntimeError("threading.excepthook is None")
+ if old_sys_excepthook is None:
+ raise RuntimeError("sys.excepthook is None")
+
+ sys_exc_info = _sys.exc_info
+ local_print = print
+ local_sys = _sys
+
+ def invoke_excepthook(thread):
+ global excepthook
+ try:
+ hook = excepthook
+ if hook is None:
+ hook = old_excepthook
+
+ args = ExceptHookArgs([*sys_exc_info(), thread])
+
+ hook(args)
+ except Exception as exc:
+ exc.__suppress_context__ = True
+ del exc
+
+ if local_sys is not None and local_sys.stderr is not None:
+ stderr = local_sys.stderr
+ else:
+ stderr = thread._stderr
+
+ local_print("Exception in threading.excepthook:",
+ file=stderr, flush=True)
+
+ if local_sys is not None and local_sys.excepthook is not None:
+ sys_excepthook = local_sys.excepthook
+ else:
+ sys_excepthook = old_sys_excepthook
+
+ sys_excepthook(*sys_exc_info())
+ finally:
+ # Break reference cycle (exception stored in a variable)
+ args = None
+
+ return invoke_excepthook
+
+
+# The timer class was contributed by Itamar Shtull-Trauring
+
+class Timer(Thread):
+ """Call a function after a specified number of seconds:
+
+ t = Timer(30.0, f, args=None, kwargs=None)
+ t.start()
+ t.cancel() # stop the timer's action if it's still waiting
+
+ """
+
+ def __init__(self, interval, function, args=None, kwargs=None):
+ Thread.__init__(self)
+ self.interval = interval
+ self.function = function
+ self.args = args if args is not None else []
+ self.kwargs = kwargs if kwargs is not None else {}
+ self.finished = Event()
+
+ def cancel(self):
+ """Stop the timer if it hasn't finished yet."""
+ self.finished.set()
+
+ def run(self):
+ self.finished.wait(self.interval)
+ if not self.finished.is_set():
+ self.function(*self.args, **self.kwargs)
+ self.finished.set()
+
+
+# Special thread class to represent the main thread
+
+class _MainThread(Thread):
+
+ def __init__(self):
+ Thread.__init__(self, name="MainThread", daemon=False)
+ self._set_tstate_lock()
+ self._started.set()
+ self._set_ident()
+ if _HAVE_THREAD_NATIVE_ID:
+ self._set_native_id()
+ with _active_limbo_lock:
+ _active[self._ident] = self
+
+
+# Dummy thread class to represent threads not started here.
+# These aren't garbage collected when they die, nor can they be waited for.
+# If they invoke anything in threading.py that calls current_thread(), they
+# leave an entry in the _active dict forever after.
+# Their purpose is to return *something* from current_thread().
+# They are marked as daemon threads so we won't wait for them
+# when we exit (conform previous semantics).
+
+class _DummyThread(Thread):
+
+ def __init__(self):
+ Thread.__init__(self, name=_newname("Dummy-%d"),
+ daemon=_daemon_threads_allowed())
+ self._started.set()
+ self._set_ident()
+ if _HAVE_THREAD_NATIVE_ID:
+ self._set_native_id()
+ with _active_limbo_lock:
+ _active[self._ident] = self
+
+ def _stop(self):
+ pass
+
+ def is_alive(self):
+ assert not self._is_stopped and self._started.is_set()
+ return True
+
+ def join(self, timeout=None):
+ assert False, "cannot join a dummy thread"
+
+
+# Global API functions
+
+def current_thread():
+ """Return the current Thread object, corresponding to the caller's thread of control.
+
+ If the caller's thread of control was not created through the threading
+ module, a dummy thread object with limited functionality is returned.
+
+ """
+ try:
+ return _active[get_ident()]
+ except KeyError:
+ return _DummyThread()
+
+def currentThread():
+ """Return the current Thread object, corresponding to the caller's thread of control.
+
+ This function is deprecated, use current_thread() instead.
+
+ """
+ import warnings
+ warnings.warn('currentThread() is deprecated, use current_thread() instead',
+ DeprecationWarning, stacklevel=2)
+ return current_thread()
+
+def active_count():
+ """Return the number of Thread objects currently alive.
+
+ The returned count is equal to the length of the list returned by
+ enumerate().
+
+ """
+ # NOTE: if the logic in here ever changes, update Modules/posixmodule.c
+ # warn_about_fork_with_threads() to match.
+ with _active_limbo_lock:
+ return len(_active) + len(_limbo)
+
+def activeCount():
+ """Return the number of Thread objects currently alive.
+
+ This function is deprecated, use active_count() instead.
+
+ """
+ import warnings
+ warnings.warn('activeCount() is deprecated, use active_count() instead',
+ DeprecationWarning, stacklevel=2)
+ return active_count()
+
+def _enumerate():
+ # Same as enumerate(), but without the lock. Internal use only.
+ return list(_active.values()) + list(_limbo.values())
+
+def enumerate():
+ """Return a list of all Thread objects currently alive.
+
+ The list includes daemonic threads, dummy thread objects created by
+ current_thread(), and the main thread. It excludes terminated threads and
+ threads that have not yet been started.
+
+ """
+ with _active_limbo_lock:
+ return list(_active.values()) + list(_limbo.values())
+
+
+_threading_atexits = []
+_SHUTTING_DOWN = False
+
+def _register_atexit(func, *arg, **kwargs):
+ """CPython internal: register *func* to be called before joining threads.
+
+ The registered *func* is called with its arguments just before all
+ non-daemon threads are joined in `_shutdown()`. It provides a similar
+ purpose to `atexit.register()`, but its functions are called prior to
+ threading shutdown instead of interpreter shutdown.
+
+ For similarity to atexit, the registered functions are called in reverse.
+ """
+ if _SHUTTING_DOWN:
+ raise RuntimeError("can't register atexit after shutdown")
+
+ call = functools.partial(func, *arg, **kwargs)
+ _threading_atexits.append(call)
+
+
+from _thread import stack_size
+
+# Create the main thread object,
+# and make it available for the interpreter
+# (Py_Main) as threading._shutdown.
+
+_main_thread = _MainThread()
+
+def _shutdown():
+ """
+ Wait until the Python thread state of all non-daemon threads get deleted.
+ """
+ # Obscure: other threads may be waiting to join _main_thread. That's
+ # dubious, but some code does it. We can't wait for C code to release
+ # the main thread's tstate_lock - that won't happen until the interpreter
+ # is nearly dead. So we release it here. Note that just calling _stop()
+ # isn't enough: other threads may already be waiting on _tstate_lock.
+ if _main_thread._is_stopped and _is_main_interpreter():
+ # _shutdown() was already called
+ return
+
+ global _SHUTTING_DOWN
+ _SHUTTING_DOWN = True
+
+ # Call registered threading atexit functions before threads are joined.
+ # Order is reversed, similar to atexit.
+ for atexit_call in reversed(_threading_atexits):
+ atexit_call()
+
+ # Main thread
+ if _main_thread.ident == get_ident():
+ tlock = _main_thread._tstate_lock
+ # The main thread isn't finished yet, so its thread state lock can't
+ # have been released.
+ assert tlock is not None
+ assert tlock.locked()
+ tlock.release()
+ _main_thread._stop()
+ else:
+ # bpo-1596321: _shutdown() must be called in the main thread.
+ # If the threading module was not imported by the main thread,
+ # _main_thread is the thread which imported the threading module.
+ # In this case, ignore _main_thread, similar behavior than for threads
+ # spawned by C libraries or using _thread.start_new_thread().
+ pass
+
+ # Join all non-deamon threads
+ while True:
+ with _shutdown_locks_lock:
+ locks = list(_shutdown_locks)
+ _shutdown_locks.clear()
+
+ if not locks:
+ break
+
+ for lock in locks:
+ # mimic Thread.join()
+ lock.acquire()
+ lock.release()
+
+ # new threads can be spawned while we were waiting for the other
+ # threads to complete
+
+
+def main_thread():
+ """Return the main thread object.
+
+ In normal conditions, the main thread is the thread from which the
+ Python interpreter was started.
+ """
+ # XXX Figure this out for subinterpreters. (See gh-75698.)
+ return _main_thread
+
+# get thread-local implementation, either from the thread
+# module, or from the python fallback
+
+try:
+ from _thread import _local as local
+except ImportError:
+ from _threading_local import local
+
+
+def _after_fork():
+ """
+ Cleanup threading module state that should not exist after a fork.
+ """
+ # Reset _active_limbo_lock, in case we forked while the lock was held
+ # by another (non-forked) thread. http://bugs.python.org/issue874900
+ global _active_limbo_lock, _main_thread
+ global _shutdown_locks_lock, _shutdown_locks
+ _active_limbo_lock = RLock()
+
+ # fork() only copied the current thread; clear references to others.
+ new_active = {}
+
+ try:
+ current = _active[get_ident()]
+ except KeyError:
+ # fork() was called in a thread which was not spawned
+ # by threading.Thread. For example, a thread spawned
+ # by thread.start_new_thread().
+ current = _MainThread()
+
+ _main_thread = current
+
+ # reset _shutdown() locks: threads re-register their _tstate_lock below
+ _shutdown_locks_lock = _allocate_lock()
+ _shutdown_locks = set()
+
+ with _active_limbo_lock:
+ # Dangling thread instances must still have their locks reset,
+ # because someone may join() them.
+ threads = set(_enumerate())
+ threads.update(_dangling)
+ for thread in threads:
+ # Any lock/condition variable may be currently locked or in an
+ # invalid state, so we reinitialize them.
+ if thread is current:
+ # There is only one active thread. We reset the ident to
+ # its new value since it can have changed.
+ thread._reset_internal_locks(True)
+ ident = get_ident()
+ if isinstance(thread, _DummyThread):
+ thread.__class__ = _MainThread
+ thread._name = 'MainThread'
+ thread._daemonic = False
+ thread._set_tstate_lock()
+ thread._ident = ident
+ new_active[ident] = thread
+ else:
+ # All the others are already stopped.
+ thread._reset_internal_locks(False)
+ thread._stop()
+
+ _limbo.clear()
+ _active.clear()
+ _active.update(new_active)
+ assert len(_active) == 1
+
+
+if hasattr(_os, "register_at_fork"):
+ _os.register_at_fork(after_in_child=_after_fork)
diff --git a/contrib/tools/python3/src/Lib/timeit.py b/contrib/tools/python3/Lib/timeit.py
index 02cfafaf36e..02cfafaf36e 100755
--- a/contrib/tools/python3/src/Lib/timeit.py
+++ b/contrib/tools/python3/Lib/timeit.py
diff --git a/contrib/tools/python3/src/Lib/token.py b/contrib/tools/python3/Lib/token.py
index 487f6edd3c9..487f6edd3c9 100644
--- a/contrib/tools/python3/src/Lib/token.py
+++ b/contrib/tools/python3/Lib/token.py
diff --git a/contrib/tools/python3/src/Lib/tokenize.py b/contrib/tools/python3/Lib/tokenize.py
index 49e8144eddd..49e8144eddd 100644
--- a/contrib/tools/python3/src/Lib/tokenize.py
+++ b/contrib/tools/python3/Lib/tokenize.py
diff --git a/contrib/tools/python3/src/Lib/tomllib/__init__.py b/contrib/tools/python3/Lib/tomllib/__init__.py
index ef91cb9d25d..ef91cb9d25d 100644
--- a/contrib/tools/python3/src/Lib/tomllib/__init__.py
+++ b/contrib/tools/python3/Lib/tomllib/__init__.py
diff --git a/contrib/tools/python3/src/Lib/tomllib/_parser.py b/contrib/tools/python3/Lib/tomllib/_parser.py
index 45ca7a89630..45ca7a89630 100644
--- a/contrib/tools/python3/src/Lib/tomllib/_parser.py
+++ b/contrib/tools/python3/Lib/tomllib/_parser.py
diff --git a/contrib/tools/python3/src/Lib/tomllib/_re.py b/contrib/tools/python3/Lib/tomllib/_re.py
index 994bb7493fd..994bb7493fd 100644
--- a/contrib/tools/python3/src/Lib/tomllib/_re.py
+++ b/contrib/tools/python3/Lib/tomllib/_re.py
diff --git a/contrib/tools/python3/src/Lib/tomllib/_types.py b/contrib/tools/python3/Lib/tomllib/_types.py
index d949412e03b..d949412e03b 100644
--- a/contrib/tools/python3/src/Lib/tomllib/_types.py
+++ b/contrib/tools/python3/Lib/tomllib/_types.py
diff --git a/contrib/tools/python3/src/Lib/trace.py b/contrib/tools/python3/Lib/trace.py
index 761916b1809..761916b1809 100755
--- a/contrib/tools/python3/src/Lib/trace.py
+++ b/contrib/tools/python3/Lib/trace.py
diff --git a/contrib/tools/python3/src/Lib/traceback.py b/contrib/tools/python3/Lib/traceback.py
index 8247d8ff8cd..8247d8ff8cd 100644
--- a/contrib/tools/python3/src/Lib/traceback.py
+++ b/contrib/tools/python3/Lib/traceback.py
diff --git a/contrib/tools/python3/src/Lib/tracemalloc.py b/contrib/tools/python3/Lib/tracemalloc.py
index cec99c59700..cec99c59700 100644
--- a/contrib/tools/python3/src/Lib/tracemalloc.py
+++ b/contrib/tools/python3/Lib/tracemalloc.py
diff --git a/contrib/tools/python3/src/Lib/tty.py b/contrib/tools/python3/Lib/tty.py
index 5a49e040042..5a49e040042 100644
--- a/contrib/tools/python3/src/Lib/tty.py
+++ b/contrib/tools/python3/Lib/tty.py
diff --git a/contrib/tools/python3/src/Lib/turtle.py b/contrib/tools/python3/Lib/turtle.py
index 811c5dfa492..811c5dfa492 100644
--- a/contrib/tools/python3/src/Lib/turtle.py
+++ b/contrib/tools/python3/Lib/turtle.py
diff --git a/contrib/tools/python3/src/Lib/types.py b/contrib/tools/python3/Lib/types.py
index b4aa19cec40..b4aa19cec40 100644
--- a/contrib/tools/python3/src/Lib/types.py
+++ b/contrib/tools/python3/Lib/types.py
diff --git a/contrib/tools/python3/src/Lib/typing.py b/contrib/tools/python3/Lib/typing.py
index ffe7ce8d8a8..ffe7ce8d8a8 100644
--- a/contrib/tools/python3/src/Lib/typing.py
+++ b/contrib/tools/python3/Lib/typing.py
diff --git a/contrib/tools/python3/src/Lib/unittest/__init__.py b/contrib/tools/python3/Lib/unittest/__init__.py
index 5bcbf834840..5bcbf834840 100644
--- a/contrib/tools/python3/src/Lib/unittest/__init__.py
+++ b/contrib/tools/python3/Lib/unittest/__init__.py
diff --git a/contrib/tools/python3/src/Lib/unittest/__main__.py b/contrib/tools/python3/Lib/unittest/__main__.py
index e5876f569b5..e5876f569b5 100644
--- a/contrib/tools/python3/src/Lib/unittest/__main__.py
+++ b/contrib/tools/python3/Lib/unittest/__main__.py
diff --git a/contrib/tools/python3/src/Lib/unittest/_log.py b/contrib/tools/python3/Lib/unittest/_log.py
index 94868e5bb95..94868e5bb95 100644
--- a/contrib/tools/python3/src/Lib/unittest/_log.py
+++ b/contrib/tools/python3/Lib/unittest/_log.py
diff --git a/contrib/tools/python3/src/Lib/unittest/async_case.py b/contrib/tools/python3/Lib/unittest/async_case.py
index bd2a4711560..bd2a4711560 100644
--- a/contrib/tools/python3/src/Lib/unittest/async_case.py
+++ b/contrib/tools/python3/Lib/unittest/async_case.py
diff --git a/contrib/tools/python3/src/Lib/unittest/case.py b/contrib/tools/python3/Lib/unittest/case.py
index 001b640dc43..001b640dc43 100644
--- a/contrib/tools/python3/src/Lib/unittest/case.py
+++ b/contrib/tools/python3/Lib/unittest/case.py
diff --git a/contrib/tools/python3/src/Lib/unittest/loader.py b/contrib/tools/python3/Lib/unittest/loader.py
index f7c1d61f41b..f7c1d61f41b 100644
--- a/contrib/tools/python3/src/Lib/unittest/loader.py
+++ b/contrib/tools/python3/Lib/unittest/loader.py
diff --git a/contrib/tools/python3/src/Lib/unittest/main.py b/contrib/tools/python3/Lib/unittest/main.py
index dd4dbf7535f..dd4dbf7535f 100644
--- a/contrib/tools/python3/src/Lib/unittest/main.py
+++ b/contrib/tools/python3/Lib/unittest/main.py
diff --git a/contrib/tools/python3/src/Lib/unittest/mock.py b/contrib/tools/python3/Lib/unittest/mock.py
index a2187580af2..a2187580af2 100644
--- a/contrib/tools/python3/src/Lib/unittest/mock.py
+++ b/contrib/tools/python3/Lib/unittest/mock.py
diff --git a/contrib/tools/python3/src/Lib/unittest/result.py b/contrib/tools/python3/Lib/unittest/result.py
index 3ace0a5b7bf..3ace0a5b7bf 100644
--- a/contrib/tools/python3/src/Lib/unittest/result.py
+++ b/contrib/tools/python3/Lib/unittest/result.py
diff --git a/contrib/tools/python3/src/Lib/unittest/runner.py b/contrib/tools/python3/Lib/unittest/runner.py
index 2bcadf0c998..2bcadf0c998 100644
--- a/contrib/tools/python3/src/Lib/unittest/runner.py
+++ b/contrib/tools/python3/Lib/unittest/runner.py
diff --git a/contrib/tools/python3/src/Lib/unittest/signals.py b/contrib/tools/python3/Lib/unittest/signals.py
index e6a5fc52439..e6a5fc52439 100644
--- a/contrib/tools/python3/src/Lib/unittest/signals.py
+++ b/contrib/tools/python3/Lib/unittest/signals.py
diff --git a/contrib/tools/python3/src/Lib/unittest/suite.py b/contrib/tools/python3/Lib/unittest/suite.py
index 6f45b6fe5f6..6f45b6fe5f6 100644
--- a/contrib/tools/python3/src/Lib/unittest/suite.py
+++ b/contrib/tools/python3/Lib/unittest/suite.py
diff --git a/contrib/tools/python3/src/Lib/unittest/util.py b/contrib/tools/python3/Lib/unittest/util.py
index 050eaed0b3f..050eaed0b3f 100644
--- a/contrib/tools/python3/src/Lib/unittest/util.py
+++ b/contrib/tools/python3/Lib/unittest/util.py
diff --git a/contrib/tools/python3/Lib/urllib/__init__.py b/contrib/tools/python3/Lib/urllib/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/contrib/tools/python3/Lib/urllib/__init__.py
diff --git a/contrib/tools/python3/src/Lib/urllib/error.py b/contrib/tools/python3/Lib/urllib/error.py
index a9cd1ecadd6..a9cd1ecadd6 100644
--- a/contrib/tools/python3/src/Lib/urllib/error.py
+++ b/contrib/tools/python3/Lib/urllib/error.py
diff --git a/contrib/tools/python3/src/Lib/urllib/parse.py b/contrib/tools/python3/Lib/urllib/parse.py
index c129b0d7971..c129b0d7971 100644
--- a/contrib/tools/python3/src/Lib/urllib/parse.py
+++ b/contrib/tools/python3/Lib/urllib/parse.py
diff --git a/contrib/tools/python3/src/Lib/urllib/request.py b/contrib/tools/python3/Lib/urllib/request.py
index 5314b3f2602..5314b3f2602 100644
--- a/contrib/tools/python3/src/Lib/urllib/request.py
+++ b/contrib/tools/python3/Lib/urllib/request.py
diff --git a/contrib/tools/python3/src/Lib/urllib/response.py b/contrib/tools/python3/Lib/urllib/response.py
index 5a2c3cc78c3..5a2c3cc78c3 100644
--- a/contrib/tools/python3/src/Lib/urllib/response.py
+++ b/contrib/tools/python3/Lib/urllib/response.py
diff --git a/contrib/tools/python3/src/Lib/urllib/robotparser.py b/contrib/tools/python3/Lib/urllib/robotparser.py
index c58565e3945..c58565e3945 100644
--- a/contrib/tools/python3/src/Lib/urllib/robotparser.py
+++ b/contrib/tools/python3/Lib/urllib/robotparser.py
diff --git a/contrib/tools/python3/src/Lib/uu.py b/contrib/tools/python3/Lib/uu.py
index 26bb59ae073..26bb59ae073 100644
--- a/contrib/tools/python3/src/Lib/uu.py
+++ b/contrib/tools/python3/Lib/uu.py
diff --git a/contrib/tools/python3/src/Lib/uuid.py b/contrib/tools/python3/Lib/uuid.py
index 470bc0d6859..470bc0d6859 100644
--- a/contrib/tools/python3/src/Lib/uuid.py
+++ b/contrib/tools/python3/Lib/uuid.py
diff --git a/contrib/tools/python3/src/Lib/venv/__init__.py b/contrib/tools/python3/Lib/venv/__init__.py
index 2173c9b13e5..2173c9b13e5 100644
--- a/contrib/tools/python3/src/Lib/venv/__init__.py
+++ b/contrib/tools/python3/Lib/venv/__init__.py
diff --git a/contrib/tools/python3/src/Lib/venv/__main__.py b/contrib/tools/python3/Lib/venv/__main__.py
index 912423e4a78..912423e4a78 100644
--- a/contrib/tools/python3/src/Lib/venv/__main__.py
+++ b/contrib/tools/python3/Lib/venv/__main__.py
diff --git a/contrib/tools/python3/src/Lib/warnings.py b/contrib/tools/python3/Lib/warnings.py
index 391a501f728..391a501f728 100644
--- a/contrib/tools/python3/src/Lib/warnings.py
+++ b/contrib/tools/python3/Lib/warnings.py
diff --git a/contrib/tools/python3/src/Lib/wave.py b/contrib/tools/python3/Lib/wave.py
index 4b0c683f6b5..4b0c683f6b5 100644
--- a/contrib/tools/python3/src/Lib/wave.py
+++ b/contrib/tools/python3/Lib/wave.py
diff --git a/contrib/tools/python3/src/Lib/weakref.py b/contrib/tools/python3/Lib/weakref.py
index 25b70927e29..25b70927e29 100644
--- a/contrib/tools/python3/src/Lib/weakref.py
+++ b/contrib/tools/python3/Lib/weakref.py
diff --git a/contrib/tools/python3/src/Lib/webbrowser.py b/contrib/tools/python3/Lib/webbrowser.py
index ba6711e4ef5..ba6711e4ef5 100755
--- a/contrib/tools/python3/src/Lib/webbrowser.py
+++ b/contrib/tools/python3/Lib/webbrowser.py
diff --git a/contrib/tools/python3/src/Lib/wsgiref/__init__.py b/contrib/tools/python3/Lib/wsgiref/__init__.py
index 59ee48fddec..59ee48fddec 100644
--- a/contrib/tools/python3/src/Lib/wsgiref/__init__.py
+++ b/contrib/tools/python3/Lib/wsgiref/__init__.py
diff --git a/contrib/tools/python3/src/Lib/wsgiref/handlers.py b/contrib/tools/python3/Lib/wsgiref/handlers.py
index cafe872c7aa..cafe872c7aa 100644
--- a/contrib/tools/python3/src/Lib/wsgiref/handlers.py
+++ b/contrib/tools/python3/Lib/wsgiref/handlers.py
diff --git a/contrib/tools/python3/src/Lib/wsgiref/headers.py b/contrib/tools/python3/Lib/wsgiref/headers.py
index fab851c5a44..fab851c5a44 100644
--- a/contrib/tools/python3/src/Lib/wsgiref/headers.py
+++ b/contrib/tools/python3/Lib/wsgiref/headers.py
diff --git a/contrib/tools/python3/src/Lib/wsgiref/simple_server.py b/contrib/tools/python3/Lib/wsgiref/simple_server.py
index 93d01a863ad..93d01a863ad 100644
--- a/contrib/tools/python3/src/Lib/wsgiref/simple_server.py
+++ b/contrib/tools/python3/Lib/wsgiref/simple_server.py
diff --git a/contrib/tools/python3/src/Lib/wsgiref/types.py b/contrib/tools/python3/Lib/wsgiref/types.py
index ef0aead5b28..ef0aead5b28 100644
--- a/contrib/tools/python3/src/Lib/wsgiref/types.py
+++ b/contrib/tools/python3/Lib/wsgiref/types.py
diff --git a/contrib/tools/python3/src/Lib/wsgiref/util.py b/contrib/tools/python3/Lib/wsgiref/util.py
index cbbe094cba1..cbbe094cba1 100644
--- a/contrib/tools/python3/src/Lib/wsgiref/util.py
+++ b/contrib/tools/python3/Lib/wsgiref/util.py
diff --git a/contrib/tools/python3/src/Lib/wsgiref/validate.py b/contrib/tools/python3/Lib/wsgiref/validate.py
index 1a1853cd63a..1a1853cd63a 100644
--- a/contrib/tools/python3/src/Lib/wsgiref/validate.py
+++ b/contrib/tools/python3/Lib/wsgiref/validate.py
diff --git a/contrib/tools/python3/src/Lib/xdrlib.py b/contrib/tools/python3/Lib/xdrlib.py
index f8c2c18228d..f8c2c18228d 100644
--- a/contrib/tools/python3/src/Lib/xdrlib.py
+++ b/contrib/tools/python3/Lib/xdrlib.py
diff --git a/contrib/tools/python3/src/Lib/xml/__init__.py b/contrib/tools/python3/Lib/xml/__init__.py
index bf6d8ddfd04..bf6d8ddfd04 100644
--- a/contrib/tools/python3/src/Lib/xml/__init__.py
+++ b/contrib/tools/python3/Lib/xml/__init__.py
diff --git a/contrib/tools/python3/src/Lib/xml/dom/NodeFilter.py b/contrib/tools/python3/Lib/xml/dom/NodeFilter.py
index 640e0bfd246..640e0bfd246 100644
--- a/contrib/tools/python3/src/Lib/xml/dom/NodeFilter.py
+++ b/contrib/tools/python3/Lib/xml/dom/NodeFilter.py
diff --git a/contrib/tools/python3/src/Lib/xml/dom/__init__.py b/contrib/tools/python3/Lib/xml/dom/__init__.py
index 97cf9a64299..97cf9a64299 100644
--- a/contrib/tools/python3/src/Lib/xml/dom/__init__.py
+++ b/contrib/tools/python3/Lib/xml/dom/__init__.py
diff --git a/contrib/tools/python3/src/Lib/xml/dom/domreg.py b/contrib/tools/python3/Lib/xml/dom/domreg.py
index 69c17eebb26..69c17eebb26 100644
--- a/contrib/tools/python3/src/Lib/xml/dom/domreg.py
+++ b/contrib/tools/python3/Lib/xml/dom/domreg.py
diff --git a/contrib/tools/python3/src/Lib/xml/dom/expatbuilder.py b/contrib/tools/python3/Lib/xml/dom/expatbuilder.py
index 7dd667bf3fb..7dd667bf3fb 100644
--- a/contrib/tools/python3/src/Lib/xml/dom/expatbuilder.py
+++ b/contrib/tools/python3/Lib/xml/dom/expatbuilder.py
diff --git a/contrib/tools/python3/src/Lib/xml/dom/minicompat.py b/contrib/tools/python3/Lib/xml/dom/minicompat.py
index 5d6fae9a257..5d6fae9a257 100644
--- a/contrib/tools/python3/src/Lib/xml/dom/minicompat.py
+++ b/contrib/tools/python3/Lib/xml/dom/minicompat.py
diff --git a/contrib/tools/python3/src/Lib/xml/dom/minidom.py b/contrib/tools/python3/Lib/xml/dom/minidom.py
index ef8a159833b..ef8a159833b 100644
--- a/contrib/tools/python3/src/Lib/xml/dom/minidom.py
+++ b/contrib/tools/python3/Lib/xml/dom/minidom.py
diff --git a/contrib/tools/python3/src/Lib/xml/dom/pulldom.py b/contrib/tools/python3/Lib/xml/dom/pulldom.py
index 913141cd7ef..913141cd7ef 100644
--- a/contrib/tools/python3/src/Lib/xml/dom/pulldom.py
+++ b/contrib/tools/python3/Lib/xml/dom/pulldom.py
diff --git a/contrib/tools/python3/src/Lib/xml/dom/xmlbuilder.py b/contrib/tools/python3/Lib/xml/dom/xmlbuilder.py
index 8a200263497..8a200263497 100644
--- a/contrib/tools/python3/src/Lib/xml/dom/xmlbuilder.py
+++ b/contrib/tools/python3/Lib/xml/dom/xmlbuilder.py
diff --git a/contrib/tools/python3/src/Lib/xml/etree/ElementInclude.py b/contrib/tools/python3/Lib/xml/etree/ElementInclude.py
index 40a9b222924..40a9b222924 100644
--- a/contrib/tools/python3/src/Lib/xml/etree/ElementInclude.py
+++ b/contrib/tools/python3/Lib/xml/etree/ElementInclude.py
diff --git a/contrib/tools/python3/src/Lib/xml/etree/ElementPath.py b/contrib/tools/python3/Lib/xml/etree/ElementPath.py
index dc6bd28c031..dc6bd28c031 100644
--- a/contrib/tools/python3/src/Lib/xml/etree/ElementPath.py
+++ b/contrib/tools/python3/Lib/xml/etree/ElementPath.py
diff --git a/contrib/tools/python3/src/Lib/xml/etree/ElementTree.py b/contrib/tools/python3/Lib/xml/etree/ElementTree.py
index bb7362d1634..bb7362d1634 100644
--- a/contrib/tools/python3/src/Lib/xml/etree/ElementTree.py
+++ b/contrib/tools/python3/Lib/xml/etree/ElementTree.py
diff --git a/contrib/tools/python3/src/Lib/xml/etree/__init__.py b/contrib/tools/python3/Lib/xml/etree/__init__.py
index e2ec53421d3..e2ec53421d3 100644
--- a/contrib/tools/python3/src/Lib/xml/etree/__init__.py
+++ b/contrib/tools/python3/Lib/xml/etree/__init__.py
diff --git a/contrib/tools/python3/src/Lib/xml/etree/cElementTree.py b/contrib/tools/python3/Lib/xml/etree/cElementTree.py
index 368e6791895..368e6791895 100644
--- a/contrib/tools/python3/src/Lib/xml/etree/cElementTree.py
+++ b/contrib/tools/python3/Lib/xml/etree/cElementTree.py
diff --git a/contrib/tools/python3/src/Lib/xml/parsers/__init__.py b/contrib/tools/python3/Lib/xml/parsers/__init__.py
index eb314a3b405..eb314a3b405 100644
--- a/contrib/tools/python3/src/Lib/xml/parsers/__init__.py
+++ b/contrib/tools/python3/Lib/xml/parsers/__init__.py
diff --git a/contrib/tools/python3/src/Lib/xml/parsers/expat.py b/contrib/tools/python3/Lib/xml/parsers/expat.py
index bcbe9fb1f8f..bcbe9fb1f8f 100644
--- a/contrib/tools/python3/src/Lib/xml/parsers/expat.py
+++ b/contrib/tools/python3/Lib/xml/parsers/expat.py
diff --git a/contrib/tools/python3/src/Lib/xml/sax/__init__.py b/contrib/tools/python3/Lib/xml/sax/__init__.py
index b657310207c..b657310207c 100644
--- a/contrib/tools/python3/src/Lib/xml/sax/__init__.py
+++ b/contrib/tools/python3/Lib/xml/sax/__init__.py
diff --git a/contrib/tools/python3/src/Lib/xml/sax/_exceptions.py b/contrib/tools/python3/Lib/xml/sax/_exceptions.py
index f292dc3a8e5..f292dc3a8e5 100644
--- a/contrib/tools/python3/src/Lib/xml/sax/_exceptions.py
+++ b/contrib/tools/python3/Lib/xml/sax/_exceptions.py
diff --git a/contrib/tools/python3/src/Lib/xml/sax/expatreader.py b/contrib/tools/python3/Lib/xml/sax/expatreader.py
index b9ad52692db..b9ad52692db 100644
--- a/contrib/tools/python3/src/Lib/xml/sax/expatreader.py
+++ b/contrib/tools/python3/Lib/xml/sax/expatreader.py
diff --git a/contrib/tools/python3/src/Lib/xml/sax/handler.py b/contrib/tools/python3/Lib/xml/sax/handler.py
index e8d417e5194..e8d417e5194 100644
--- a/contrib/tools/python3/src/Lib/xml/sax/handler.py
+++ b/contrib/tools/python3/Lib/xml/sax/handler.py
diff --git a/contrib/tools/python3/src/Lib/xml/sax/saxutils.py b/contrib/tools/python3/Lib/xml/sax/saxutils.py
index c1612ea1ceb..c1612ea1ceb 100644
--- a/contrib/tools/python3/src/Lib/xml/sax/saxutils.py
+++ b/contrib/tools/python3/Lib/xml/sax/saxutils.py
diff --git a/contrib/tools/python3/src/Lib/xml/sax/xmlreader.py b/contrib/tools/python3/Lib/xml/sax/xmlreader.py
index e906121d23b..e906121d23b 100644
--- a/contrib/tools/python3/src/Lib/xml/sax/xmlreader.py
+++ b/contrib/tools/python3/Lib/xml/sax/xmlreader.py
diff --git a/contrib/tools/python3/src/Lib/xmlrpc/__init__.py b/contrib/tools/python3/Lib/xmlrpc/__init__.py
index 196d3788575..196d3788575 100644
--- a/contrib/tools/python3/src/Lib/xmlrpc/__init__.py
+++ b/contrib/tools/python3/Lib/xmlrpc/__init__.py
diff --git a/contrib/tools/python3/src/Lib/xmlrpc/client.py b/contrib/tools/python3/Lib/xmlrpc/client.py
index ea8da766cb5..ea8da766cb5 100644
--- a/contrib/tools/python3/src/Lib/xmlrpc/client.py
+++ b/contrib/tools/python3/Lib/xmlrpc/client.py
diff --git a/contrib/tools/python3/src/Lib/xmlrpc/server.py b/contrib/tools/python3/Lib/xmlrpc/server.py
index 4dddb1d10e0..4dddb1d10e0 100644
--- a/contrib/tools/python3/src/Lib/xmlrpc/server.py
+++ b/contrib/tools/python3/Lib/xmlrpc/server.py
diff --git a/contrib/tools/python3/Lib/ya.make b/contrib/tools/python3/Lib/ya.make
new file mode 100644
index 00000000000..407fd45aaff
--- /dev/null
+++ b/contrib/tools/python3/Lib/ya.make
@@ -0,0 +1,545 @@
+# Generated by devtools/yamaker.
+
+ENABLE(PYBUILD_NO_PY)
+
+PY3_LIBRARY()
+
+VERSION(3.12.2)
+
+ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.12.2.tar.gz)
+
+LICENSE(Python-2.0)
+
+PEERDIR(
+ certs
+ contrib/tools/python3/lib2/py
+)
+
+NO_LINT()
+
+NO_PYTHON_INCLUDES()
+
+PY_SRCS(
+ TOP_LEVEL
+ __future__.py
+ __hello__.py
+ _aix_support.py
+ _collections_abc.py
+ _compat_pickle.py
+ _compression.py
+ _markupbase.py
+ _osx_support.py
+ _py_abc.py
+ _pydatetime.py
+ _pydecimal.py
+ _pyio.py
+ _pylong.py
+ _sitebuiltins.py
+ _strptime.py
+ _sysconfigdata_arcadia.py
+ _threading_local.py
+ _weakrefset.py
+ abc.py
+ aifc.py
+ antigravity.py
+ argparse.py
+ ast.py
+ asyncio/__init__.py
+ asyncio/__main__.py
+ asyncio/base_events.py
+ asyncio/base_futures.py
+ asyncio/base_subprocess.py
+ asyncio/base_tasks.py
+ asyncio/constants.py
+ asyncio/coroutines.py
+ asyncio/events.py
+ asyncio/exceptions.py
+ asyncio/format_helpers.py
+ asyncio/futures.py
+ asyncio/locks.py
+ asyncio/log.py
+ asyncio/mixins.py
+ asyncio/proactor_events.py
+ asyncio/protocols.py
+ asyncio/queues.py
+ asyncio/runners.py
+ asyncio/selector_events.py
+ asyncio/sslproto.py
+ asyncio/staggered.py
+ asyncio/streams.py
+ asyncio/subprocess.py
+ asyncio/taskgroups.py
+ asyncio/tasks.py
+ asyncio/threads.py
+ asyncio/timeouts.py
+ asyncio/transports.py
+ asyncio/trsock.py
+ asyncio/unix_events.py
+ asyncio/windows_events.py
+ asyncio/windows_utils.py
+ base64.py
+ bdb.py
+ bisect.py
+ bz2.py
+ cProfile.py
+ calendar.py
+ cgi.py
+ cgitb.py
+ chunk.py
+ cmd.py
+ code.py
+ codecs.py
+ codeop.py
+ collections/__init__.py
+ collections/abc.py
+ colorsys.py
+ compileall.py
+ concurrent/__init__.py
+ concurrent/futures/__init__.py
+ concurrent/futures/_base.py
+ concurrent/futures/process.py
+ concurrent/futures/thread.py
+ configparser.py
+ contextlib.py
+ contextvars.py
+ copy.py
+ copyreg.py
+ crypt.py
+ csv.py
+ ctypes/__init__.py
+ ctypes/_aix.py
+ ctypes/_endian.py
+ ctypes/macholib/__init__.py
+ ctypes/macholib/dyld.py
+ ctypes/macholib/dylib.py
+ ctypes/macholib/framework.py
+ ctypes/util.py
+ ctypes/wintypes.py
+ curses/__init__.py
+ curses/ascii.py
+ curses/has_key.py
+ curses/panel.py
+ curses/textpad.py
+ dataclasses.py
+ datetime.py
+ dbm/__init__.py
+ dbm/dumb.py
+ dbm/gnu.py
+ dbm/ndbm.py
+ decimal.py
+ difflib.py
+ dis.py
+ doctest.py
+ email/__init__.py
+ email/_encoded_words.py
+ email/_header_value_parser.py
+ email/_parseaddr.py
+ email/_policybase.py
+ email/base64mime.py
+ email/charset.py
+ email/contentmanager.py
+ email/encoders.py
+ email/errors.py
+ email/feedparser.py
+ email/generator.py
+ email/header.py
+ email/headerregistry.py
+ email/iterators.py
+ email/message.py
+ email/mime/__init__.py
+ email/mime/application.py
+ email/mime/audio.py
+ email/mime/base.py
+ email/mime/image.py
+ email/mime/message.py
+ email/mime/multipart.py
+ email/mime/nonmultipart.py
+ email/mime/text.py
+ email/parser.py
+ email/policy.py
+ email/quoprimime.py
+ email/utils.py
+ encodings/__init__.py
+ encodings/aliases.py
+ encodings/ascii.py
+ encodings/base64_codec.py
+ encodings/big5.py
+ encodings/big5hkscs.py
+ encodings/bz2_codec.py
+ encodings/charmap.py
+ encodings/cp037.py
+ encodings/cp1006.py
+ encodings/cp1026.py
+ encodings/cp1125.py
+ encodings/cp1140.py
+ encodings/cp1250.py
+ encodings/cp1251.py
+ encodings/cp1252.py
+ encodings/cp1253.py
+ encodings/cp1254.py
+ encodings/cp1255.py
+ encodings/cp1256.py
+ encodings/cp1257.py
+ encodings/cp1258.py
+ encodings/cp273.py
+ encodings/cp424.py
+ encodings/cp437.py
+ encodings/cp500.py
+ encodings/cp720.py
+ encodings/cp737.py
+ encodings/cp775.py
+ encodings/cp850.py
+ encodings/cp852.py
+ encodings/cp855.py
+ encodings/cp856.py
+ encodings/cp857.py
+ encodings/cp858.py
+ encodings/cp860.py
+ encodings/cp861.py
+ encodings/cp862.py
+ encodings/cp863.py
+ encodings/cp864.py
+ encodings/cp865.py
+ encodings/cp866.py
+ encodings/cp869.py
+ encodings/cp874.py
+ encodings/cp875.py
+ encodings/cp932.py
+ encodings/cp949.py
+ encodings/cp950.py
+ encodings/euc_jis_2004.py
+ encodings/euc_jisx0213.py
+ encodings/euc_jp.py
+ encodings/euc_kr.py
+ encodings/gb18030.py
+ encodings/gb2312.py
+ encodings/gbk.py
+ encodings/hex_codec.py
+ encodings/hp_roman8.py
+ encodings/hz.py
+ encodings/idna.py
+ encodings/iso2022_jp.py
+ encodings/iso2022_jp_1.py
+ encodings/iso2022_jp_2.py
+ encodings/iso2022_jp_2004.py
+ encodings/iso2022_jp_3.py
+ encodings/iso2022_jp_ext.py
+ encodings/iso2022_kr.py
+ encodings/iso8859_1.py
+ encodings/iso8859_10.py
+ encodings/iso8859_11.py
+ encodings/iso8859_13.py
+ encodings/iso8859_14.py
+ encodings/iso8859_15.py
+ encodings/iso8859_16.py
+ encodings/iso8859_2.py
+ encodings/iso8859_3.py
+ encodings/iso8859_4.py
+ encodings/iso8859_5.py
+ encodings/iso8859_6.py
+ encodings/iso8859_7.py
+ encodings/iso8859_8.py
+ encodings/iso8859_9.py
+ encodings/johab.py
+ encodings/koi8_r.py
+ encodings/koi8_t.py
+ encodings/koi8_u.py
+ encodings/kz1048.py
+ encodings/latin_1.py
+ encodings/mac_arabic.py
+ encodings/mac_croatian.py
+ encodings/mac_cyrillic.py
+ encodings/mac_farsi.py
+ encodings/mac_greek.py
+ encodings/mac_iceland.py
+ encodings/mac_latin2.py
+ encodings/mac_roman.py
+ encodings/mac_romanian.py
+ encodings/mac_turkish.py
+ encodings/mbcs.py
+ encodings/oem.py
+ encodings/palmos.py
+ encodings/ptcp154.py
+ encodings/punycode.py
+ encodings/quopri_codec.py
+ encodings/raw_unicode_escape.py
+ encodings/rot_13.py
+ encodings/shift_jis.py
+ encodings/shift_jis_2004.py
+ encodings/shift_jisx0213.py
+ encodings/tis_620.py
+ encodings/undefined.py
+ encodings/unicode_escape.py
+ encodings/utf_16.py
+ encodings/utf_16_be.py
+ encodings/utf_16_le.py
+ encodings/utf_32.py
+ encodings/utf_32_be.py
+ encodings/utf_32_le.py
+ encodings/utf_7.py
+ encodings/utf_8.py
+ encodings/utf_8_sig.py
+ encodings/uu_codec.py
+ encodings/zlib_codec.py
+ ensurepip/__init__.py
+ ensurepip/__main__.py
+ ensurepip/_uninstall.py
+ enum.py
+ filecmp.py
+ fileinput.py
+ fnmatch.py
+ fractions.py
+ ftplib.py
+ functools.py
+ genericpath.py
+ getopt.py
+ getpass.py
+ gettext.py
+ glob.py
+ graphlib.py
+ gzip.py
+ hashlib.py
+ heapq.py
+ hmac.py
+ html/__init__.py
+ html/entities.py
+ html/parser.py
+ http/__init__.py
+ http/client.py
+ http/cookiejar.py
+ http/cookies.py
+ http/server.py
+ imaplib.py
+ imghdr.py
+ importlib/__init__.py
+ importlib/_abc.py
+ importlib/_bootstrap.py
+ importlib/_bootstrap_external.py
+ importlib/abc.py
+ importlib/machinery.py
+ importlib/metadata/__init__.py
+ importlib/metadata/_adapters.py
+ importlib/metadata/_collections.py
+ importlib/metadata/_functools.py
+ importlib/metadata/_itertools.py
+ importlib/metadata/_meta.py
+ importlib/metadata/_text.py
+ importlib/readers.py
+ importlib/resources/__init__.py
+ importlib/resources/_adapters.py
+ importlib/resources/_common.py
+ importlib/resources/_itertools.py
+ importlib/resources/_legacy.py
+ importlib/resources/abc.py
+ importlib/resources/readers.py
+ importlib/resources/simple.py
+ importlib/simple.py
+ importlib/util.py
+ inspect.py
+ io.py
+ ipaddress.py
+ json/__init__.py
+ json/decoder.py
+ json/encoder.py
+ json/scanner.py
+ json/tool.py
+ keyword.py
+ linecache.py
+ locale.py
+ logging/__init__.py
+ logging/config.py
+ logging/handlers.py
+ lzma.py
+ mailbox.py
+ mailcap.py
+ mimetypes.py
+ modulefinder.py
+ msilib/__init__.py
+ msilib/schema.py
+ msilib/sequence.py
+ msilib/text.py
+ multiprocessing/__init__.py
+ multiprocessing/connection.py
+ multiprocessing/context.py
+ multiprocessing/dummy/__init__.py
+ multiprocessing/dummy/connection.py
+ multiprocessing/forkserver.py
+ multiprocessing/heap.py
+ multiprocessing/managers.py
+ multiprocessing/pool.py
+ multiprocessing/popen_fork.py
+ multiprocessing/popen_forkserver.py
+ multiprocessing/popen_spawn_posix.py
+ multiprocessing/popen_spawn_win32.py
+ multiprocessing/process.py
+ multiprocessing/queues.py
+ multiprocessing/reduction.py
+ multiprocessing/resource_sharer.py
+ multiprocessing/resource_tracker.py
+ multiprocessing/shared_memory.py
+ multiprocessing/sharedctypes.py
+ multiprocessing/spawn.py
+ multiprocessing/synchronize.py
+ multiprocessing/util.py
+ netrc.py
+ nntplib.py
+ ntpath.py
+ nturl2path.py
+ numbers.py
+ opcode.py
+ operator.py
+ optparse.py
+ os.py
+ pathlib.py
+ pdb.py
+ pickle.py
+ pickletools.py
+ pipes.py
+ pkgutil.py
+ platform.py
+ plistlib.py
+ poplib.py
+ posixpath.py
+ pprint.py
+ profile.py
+ pstats.py
+ pty.py
+ py_compile.py
+ pyclbr.py
+ pydoc.py
+ pydoc_data/__init__.py
+ pydoc_data/topics.py
+ queue.py
+ quopri.py
+ random.py
+ re/__init__.py
+ re/_casefix.py
+ re/_compiler.py
+ re/_constants.py
+ re/_parser.py
+ reprlib.py
+ rlcompleter.py
+ runpy.py
+ sched.py
+ secrets.py
+ selectors.py
+ shelve.py
+ shlex.py
+ shutil.py
+ signal.py
+ site.py
+ smtplib.py
+ sndhdr.py
+ socket.py
+ socketserver.py
+ sqlite3/__init__.py
+ sqlite3/__main__.py
+ sqlite3/dbapi2.py
+ sqlite3/dump.py
+ sre_compile.py
+ sre_constants.py
+ sre_parse.py
+ ssl.py
+ stat.py
+ statistics.py
+ string.py
+ stringprep.py
+ struct.py
+ subprocess.py
+ sunau.py
+ symtable.py
+ sysconfig.py
+ tabnanny.py
+ tarfile.py
+ telnetlib.py
+ tempfile.py
+ textwrap.py
+ this.py
+ threading.py
+ timeit.py
+ token.py
+ tokenize.py
+ tomllib/__init__.py
+ tomllib/_parser.py
+ tomllib/_re.py
+ tomllib/_types.py
+ trace.py
+ traceback.py
+ tracemalloc.py
+ tty.py
+ turtle.py
+ types.py
+ typing.py
+ unittest/__init__.py
+ unittest/__main__.py
+ unittest/_log.py
+ unittest/async_case.py
+ unittest/case.py
+ unittest/loader.py
+ unittest/main.py
+ unittest/mock.py
+ unittest/result.py
+ unittest/runner.py
+ unittest/signals.py
+ unittest/suite.py
+ unittest/util.py
+ urllib/__init__.py
+ urllib/error.py
+ urllib/parse.py
+ urllib/request.py
+ urllib/response.py
+ urllib/robotparser.py
+ uu.py
+ uuid.py
+ venv/__init__.py
+ venv/__main__.py
+ warnings.py
+ wave.py
+ weakref.py
+ webbrowser.py
+ wsgiref/__init__.py
+ wsgiref/handlers.py
+ wsgiref/headers.py
+ wsgiref/simple_server.py
+ wsgiref/types.py
+ wsgiref/util.py
+ wsgiref/validate.py
+ xdrlib.py
+ xml/__init__.py
+ xml/dom/NodeFilter.py
+ xml/dom/__init__.py
+ xml/dom/domreg.py
+ xml/dom/expatbuilder.py
+ xml/dom/minicompat.py
+ xml/dom/minidom.py
+ xml/dom/pulldom.py
+ xml/dom/xmlbuilder.py
+ xml/etree/ElementInclude.py
+ xml/etree/ElementPath.py
+ xml/etree/ElementTree.py
+ xml/etree/__init__.py
+ xml/etree/cElementTree.py
+ xml/parsers/__init__.py
+ xml/parsers/expat.py
+ xml/sax/__init__.py
+ xml/sax/_exceptions.py
+ xml/sax/expatreader.py
+ xml/sax/handler.py
+ xml/sax/saxutils.py
+ xml/sax/xmlreader.py
+ xmlrpc/__init__.py
+ xmlrpc/client.py
+ xmlrpc/server.py
+ zipapp.py
+ zipfile/__init__.py
+ zipfile/__main__.py
+ zipfile/_path/__init__.py
+ zipfile/_path/glob.py
+ zipimport.py
+ zoneinfo/__init__.py
+ zoneinfo/_common.py
+ zoneinfo/_tzpath.py
+ zoneinfo/_zoneinfo.py
+)
+
+END()
diff --git a/contrib/tools/python3/src/Lib/zipapp.py b/contrib/tools/python3/Lib/zipapp.py
index d8ebfcb6c73..d8ebfcb6c73 100644
--- a/contrib/tools/python3/src/Lib/zipapp.py
+++ b/contrib/tools/python3/Lib/zipapp.py
diff --git a/contrib/tools/python3/src/Lib/zipfile/__init__.py b/contrib/tools/python3/Lib/zipfile/__init__.py
index 8918484207a..8918484207a 100644
--- a/contrib/tools/python3/src/Lib/zipfile/__init__.py
+++ b/contrib/tools/python3/Lib/zipfile/__init__.py
diff --git a/contrib/tools/python3/src/Lib/zipfile/__main__.py b/contrib/tools/python3/Lib/zipfile/__main__.py
index 868d99efc3c..868d99efc3c 100644
--- a/contrib/tools/python3/src/Lib/zipfile/__main__.py
+++ b/contrib/tools/python3/Lib/zipfile/__main__.py
diff --git a/contrib/tools/python3/src/Lib/zipfile/_path/__init__.py b/contrib/tools/python3/Lib/zipfile/_path/__init__.py
index 78c413563bb..78c413563bb 100644
--- a/contrib/tools/python3/src/Lib/zipfile/_path/__init__.py
+++ b/contrib/tools/python3/Lib/zipfile/_path/__init__.py
diff --git a/contrib/tools/python3/src/Lib/zipfile/_path/glob.py b/contrib/tools/python3/Lib/zipfile/_path/glob.py
index 4a2e665e270..4a2e665e270 100644
--- a/contrib/tools/python3/src/Lib/zipfile/_path/glob.py
+++ b/contrib/tools/python3/Lib/zipfile/_path/glob.py
diff --git a/contrib/tools/python3/src/Lib/zipimport.py b/contrib/tools/python3/Lib/zipimport.py
index a7333a4c490..a7333a4c490 100644
--- a/contrib/tools/python3/src/Lib/zipimport.py
+++ b/contrib/tools/python3/Lib/zipimport.py
diff --git a/contrib/tools/python3/src/Lib/zoneinfo/__init__.py b/contrib/tools/python3/Lib/zoneinfo/__init__.py
index f5510ee0497..f5510ee0497 100644
--- a/contrib/tools/python3/src/Lib/zoneinfo/__init__.py
+++ b/contrib/tools/python3/Lib/zoneinfo/__init__.py
diff --git a/contrib/tools/python3/src/Lib/zoneinfo/_common.py b/contrib/tools/python3/Lib/zoneinfo/_common.py
index 98cdfe37ca6..98cdfe37ca6 100644
--- a/contrib/tools/python3/src/Lib/zoneinfo/_common.py
+++ b/contrib/tools/python3/Lib/zoneinfo/_common.py
diff --git a/contrib/tools/python3/src/Lib/zoneinfo/_tzpath.py b/contrib/tools/python3/Lib/zoneinfo/_tzpath.py
index 5db17bea045..5db17bea045 100644
--- a/contrib/tools/python3/src/Lib/zoneinfo/_tzpath.py
+++ b/contrib/tools/python3/Lib/zoneinfo/_tzpath.py
diff --git a/contrib/tools/python3/src/Lib/zoneinfo/_zoneinfo.py b/contrib/tools/python3/Lib/zoneinfo/_zoneinfo.py
index b77dc0ed391..b77dc0ed391 100644
--- a/contrib/tools/python3/src/Lib/zoneinfo/_zoneinfo.py
+++ b/contrib/tools/python3/Lib/zoneinfo/_zoneinfo.py
diff --git a/contrib/tools/python3/Modules/README b/contrib/tools/python3/Modules/README
new file mode 100644
index 00000000000..9b79f538892
--- /dev/null
+++ b/contrib/tools/python3/Modules/README
@@ -0,0 +1,2 @@
+Source files for standard library extension modules,
+and former extension modules that are now builtin modules.
diff --git a/contrib/tools/python3/src/Modules/_abc.c b/contrib/tools/python3/Modules/_abc.c
index d3e405dadb6..d3e405dadb6 100644
--- a/contrib/tools/python3/src/Modules/_abc.c
+++ b/contrib/tools/python3/Modules/_abc.c
diff --git a/contrib/tools/python3/src/Modules/_asynciomodule.c b/contrib/tools/python3/Modules/_asynciomodule.c
index a465090bfaa..a465090bfaa 100644
--- a/contrib/tools/python3/src/Modules/_asynciomodule.c
+++ b/contrib/tools/python3/Modules/_asynciomodule.c
diff --git a/contrib/tools/python3/src/Modules/_bisectmodule.c b/contrib/tools/python3/Modules/_bisectmodule.c
index 0773bbd1919..0773bbd1919 100644
--- a/contrib/tools/python3/src/Modules/_bisectmodule.c
+++ b/contrib/tools/python3/Modules/_bisectmodule.c
diff --git a/contrib/tools/python3/src/Modules/_blake2/blake2b_impl.c b/contrib/tools/python3/Modules/_blake2/blake2b_impl.c
index c2cac98c752..c2cac98c752 100644
--- a/contrib/tools/python3/src/Modules/_blake2/blake2b_impl.c
+++ b/contrib/tools/python3/Modules/_blake2/blake2b_impl.c
diff --git a/contrib/tools/python3/src/Modules/_blake2/blake2module.c b/contrib/tools/python3/Modules/_blake2/blake2module.c
index 5df9fd3df49..5df9fd3df49 100644
--- a/contrib/tools/python3/src/Modules/_blake2/blake2module.c
+++ b/contrib/tools/python3/Modules/_blake2/blake2module.c
diff --git a/contrib/tools/python3/src/Modules/_blake2/blake2module.h b/contrib/tools/python3/Modules/_blake2/blake2module.h
index 3a19478eaf6..3a19478eaf6 100644
--- a/contrib/tools/python3/src/Modules/_blake2/blake2module.h
+++ b/contrib/tools/python3/Modules/_blake2/blake2module.h
diff --git a/contrib/tools/python3/src/Modules/_blake2/blake2s_impl.c b/contrib/tools/python3/Modules/_blake2/blake2s_impl.c
index 1c47328ece1..1c47328ece1 100644
--- a/contrib/tools/python3/src/Modules/_blake2/blake2s_impl.c
+++ b/contrib/tools/python3/Modules/_blake2/blake2s_impl.c
diff --git a/contrib/tools/python3/src/Modules/_blake2/clinic/blake2b_impl.c.h b/contrib/tools/python3/Modules/_blake2/clinic/blake2b_impl.c.h
index 99b0f098cc2..99b0f098cc2 100644
--- a/contrib/tools/python3/src/Modules/_blake2/clinic/blake2b_impl.c.h
+++ b/contrib/tools/python3/Modules/_blake2/clinic/blake2b_impl.c.h
diff --git a/contrib/tools/python3/src/Modules/_blake2/clinic/blake2s_impl.c.h b/contrib/tools/python3/Modules/_blake2/clinic/blake2s_impl.c.h
index 9b821fbcd62..9b821fbcd62 100644
--- a/contrib/tools/python3/src/Modules/_blake2/clinic/blake2s_impl.c.h
+++ b/contrib/tools/python3/Modules/_blake2/clinic/blake2s_impl.c.h
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2-config.h b/contrib/tools/python3/Modules/_blake2/impl/blake2-config.h
index c09cb4bcf06..c09cb4bcf06 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2-config.h
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2-config.h
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2-impl.h b/contrib/tools/python3/Modules/_blake2/impl/blake2-impl.h
index 9d2fbb72fc1..9d2fbb72fc1 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2-impl.h
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2-impl.h
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2.h b/contrib/tools/python3/Modules/_blake2/impl/blake2.h
index a08d82efefe..a08d82efefe 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2.h
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2.h
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2b-load-sse2.h b/contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse2.h
index 1ba153c87d7..1ba153c87d7 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2b-load-sse2.h
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse2.h
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2b-load-sse41.h b/contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse41.h
index f6c1bc8393f..f6c1bc8393f 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2b-load-sse41.h
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse41.h
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2b-ref.c b/contrib/tools/python3/Modules/_blake2/impl/blake2b-ref.c
index e58c43659d9..e58c43659d9 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2b-ref.c
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2b-ref.c
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2b-round.h b/contrib/tools/python3/Modules/_blake2/impl/blake2b-round.h
index 5b452c4d63b..5b452c4d63b 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2b-round.h
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2b-round.h
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2b.c b/contrib/tools/python3/Modules/_blake2/impl/blake2b.c
index cef22838917..cef22838917 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2b.c
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2b.c
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2s-load-sse2.h b/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse2.h
index b24483cf931..b24483cf931 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2s-load-sse2.h
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse2.h
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2s-load-sse41.h b/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse41.h
index 3ac12eb6f5d..3ac12eb6f5d 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2s-load-sse41.h
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse41.h
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2s-load-xop.h b/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-xop.h
index 14d9e7f7640..14d9e7f7640 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2s-load-xop.h
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-xop.h
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2s-ref.c b/contrib/tools/python3/Modules/_blake2/impl/blake2s-ref.c
index ab86cc1b34e..ab86cc1b34e 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2s-ref.c
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2s-ref.c
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2s-round.h b/contrib/tools/python3/Modules/_blake2/impl/blake2s-round.h
index 3af4be35bee..3af4be35bee 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2s-round.h
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2s-round.h
diff --git a/contrib/tools/python3/src/Modules/_blake2/impl/blake2s.c b/contrib/tools/python3/Modules/_blake2/impl/blake2s.c
index e7f63fd274f..e7f63fd274f 100644
--- a/contrib/tools/python3/src/Modules/_blake2/impl/blake2s.c
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2s.c
diff --git a/contrib/tools/python3/src/Modules/_bz2module.c b/contrib/tools/python3/Modules/_bz2module.c
index 97bd44b4ac9..97bd44b4ac9 100644
--- a/contrib/tools/python3/src/Modules/_bz2module.c
+++ b/contrib/tools/python3/Modules/_bz2module.c
diff --git a/contrib/tools/python3/src/Modules/_codecsmodule.c b/contrib/tools/python3/Modules/_codecsmodule.c
index 777c753bd7c..777c753bd7c 100644
--- a/contrib/tools/python3/src/Modules/_codecsmodule.c
+++ b/contrib/tools/python3/Modules/_codecsmodule.c
diff --git a/contrib/tools/python3/src/Modules/_collectionsmodule.c b/contrib/tools/python3/Modules/_collectionsmodule.c
index 9a81531bdff..9a81531bdff 100644
--- a/contrib/tools/python3/src/Modules/_collectionsmodule.c
+++ b/contrib/tools/python3/Modules/_collectionsmodule.c
diff --git a/contrib/tools/python3/src/Modules/_contextvarsmodule.c b/contrib/tools/python3/Modules/_contextvarsmodule.c
index f621c1de6d4..f621c1de6d4 100644
--- a/contrib/tools/python3/src/Modules/_contextvarsmodule.c
+++ b/contrib/tools/python3/Modules/_contextvarsmodule.c
diff --git a/contrib/tools/python3/src/Modules/_cryptmodule.c b/contrib/tools/python3/Modules/_cryptmodule.c
index 75035084c9c..75035084c9c 100644
--- a/contrib/tools/python3/src/Modules/_cryptmodule.c
+++ b/contrib/tools/python3/Modules/_cryptmodule.c
diff --git a/contrib/tools/python3/src/Modules/_csv.c b/contrib/tools/python3/Modules/_csv.c
index 91cb63628a1..91cb63628a1 100644
--- a/contrib/tools/python3/src/Modules/_csv.c
+++ b/contrib/tools/python3/Modules/_csv.c
diff --git a/contrib/tools/python3/Modules/_ctypes/_ctypes.c b/contrib/tools/python3/Modules/_ctypes/_ctypes.c
new file mode 100644
index 00000000000..c5157560f6e
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ctypes/_ctypes.c
@@ -0,0 +1,5835 @@
+/*
+ ToDo:
+
+ Get rid of the checker (and also the converters) field in PyCFuncPtrObject and
+ StgDictObject, and replace them by slot functions in StgDictObject.
+
+ think about a buffer-like object (memory? bytes?)
+
+ Should POINTER(c_char) and POINTER(c_wchar) have a .value property?
+ What about c_char and c_wchar arrays then?
+
+ Add from_mmap, from_file, from_string metaclass methods.
+
+ Maybe we can get away with from_file (calls read) and with a from_buffer
+ method?
+
+ And what about the to_mmap, to_file, to_str(?) methods? They would clobber
+ the namespace, probably. So, functions instead? And we already have memmove...
+*/
+
+/*
+
+Name methods, members, getsets
+==============================================================================
+
+PyCStructType_Type __new__(), from_address(), __mul__(), from_param()
+UnionType_Type __new__(), from_address(), __mul__(), from_param()
+PyCPointerType_Type __new__(), from_address(), __mul__(), from_param(), set_type()
+PyCArrayType_Type __new__(), from_address(), __mul__(), from_param()
+PyCSimpleType_Type __new__(), from_address(), __mul__(), from_param()
+
+PyCData_Type
+ Struct_Type __new__(), __init__()
+ PyCPointer_Type __new__(), __init__(), _as_parameter_, contents
+ PyCArray_Type __new__(), __init__(), _as_parameter_, __get/setitem__(), __len__()
+ Simple_Type __new__(), __init__(), _as_parameter_
+
+PyCField_Type
+PyCStgDict_Type
+
+==============================================================================
+
+class methods
+-------------
+
+It has some similarity to the byref() construct compared to pointer()
+from_address(addr)
+ - construct an instance from a given memory block (sharing this memory block)
+
+from_param(obj)
+ - typecheck and convert a Python object into a C function call parameter
+ The result may be an instance of the type, or an integer or tuple
+ (typecode, value[, obj])
+
+instance methods/properties
+---------------------------
+
+_as_parameter_
+ - convert self into a C function call parameter
+ This is either an integer, or a 3-tuple (typecode, value, obj)
+
+functions
+---------
+
+sizeof(cdata)
+ - return the number of bytes the buffer contains
+
+sizeof(ctype)
+ - return the number of bytes the buffer of an instance would contain
+
+byref(cdata)
+
+addressof(cdata)
+
+pointer(cdata)
+
+POINTER(ctype)
+
+bytes(cdata)
+ - return the buffer contents as a sequence of bytes (which is currently a string)
+
+*/
+
+/*
+ * PyCStgDict_Type
+ * PyCStructType_Type
+ * UnionType_Type
+ * PyCPointerType_Type
+ * PyCArrayType_Type
+ * PyCSimpleType_Type
+ *
+ * PyCData_Type
+ * Struct_Type
+ * Union_Type
+ * PyCArray_Type
+ * Simple_Type
+ * PyCPointer_Type
+ * PyCField_Type
+ *
+ */
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+// windows.h must be included before pycore internal headers
+#ifdef MS_WIN32
+# include <windows.h>
+#endif
+
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
+#include "structmember.h" // PyMemberDef
+
+#include <ffi.h>
+#ifdef MS_WIN32
+#include <malloc.h>
+#ifndef IS_INTRESOURCE
+#define IS_INTRESOURCE(x) (((size_t)(x) >> 16) == 0)
+#endif
+#else
+#include <dlfcn.h>
+#endif
+#include "ctypes.h"
+
+#include "pycore_long.h" // _PyLong_GetZero()
+
+ctypes_state global_state;
+
+PyObject *PyExc_ArgError = NULL;
+
+/* This dict maps ctypes types to POINTER types */
+PyObject *_ctypes_ptrtype_cache = NULL;
+
+static PyTypeObject Simple_Type;
+
+/* a callable object used for unpickling:
+ strong reference to _ctypes._unpickle() function */
+static PyObject *_unpickle;
+
+
+/****************************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *key;
+ PyObject *dict;
+} DictRemoverObject;
+
+static int
+_DictRemover_traverse(DictRemoverObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->key);
+ Py_VISIT(self->dict);
+ return 0;
+}
+
+static int
+_DictRemover_clear(DictRemoverObject *self)
+{
+ Py_CLEAR(self->key);
+ Py_CLEAR(self->dict);
+ return 0;
+}
+
+static void
+_DictRemover_dealloc(PyObject *myself)
+{
+ PyTypeObject *tp = Py_TYPE(myself);
+ DictRemoverObject *self = (DictRemoverObject *)myself;
+ PyObject_GC_UnTrack(myself);
+ (void)_DictRemover_clear(self);
+ tp->tp_free(myself);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+_DictRemover_call(PyObject *myself, PyObject *args, PyObject *kw)
+{
+ DictRemoverObject *self = (DictRemoverObject *)myself;
+ if (self->key && self->dict) {
+ if (-1 == PyDict_DelItem(self->dict, self->key)) {
+ _PyErr_WriteUnraisableMsg("on calling _ctypes.DictRemover", NULL);
+ }
+ Py_CLEAR(self->key);
+ Py_CLEAR(self->dict);
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(dictremover_doc, "deletes a key from a dictionary");
+
+static PyType_Slot dictremover_slots[] = {
+ {Py_tp_dealloc, _DictRemover_dealloc},
+ {Py_tp_traverse, _DictRemover_traverse},
+ {Py_tp_clear, _DictRemover_clear},
+ {Py_tp_call, _DictRemover_call},
+ {Py_tp_doc, (void *)dictremover_doc},
+ {0, NULL},
+};
+
+static PyType_Spec dictremover_spec = {
+ .name = "_ctypes.DictRemover",
+ .basicsize = sizeof(DictRemoverObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = dictremover_slots,
+};
+
+int
+PyDict_SetItemProxy(PyObject *dict, PyObject *key, PyObject *item)
+{
+ PyObject *obj;
+ DictRemoverObject *remover;
+ PyObject *proxy;
+ int result;
+
+ ctypes_state *st = GLOBAL_STATE();
+ obj = _PyObject_CallNoArgs((PyObject *)st->DictRemover_Type);
+ if (obj == NULL)
+ return -1;
+
+ remover = (DictRemoverObject *)obj;
+ assert(remover->key == NULL);
+ assert(remover->dict == NULL);
+ remover->key = Py_NewRef(key);
+ remover->dict = Py_NewRef(dict);
+
+ proxy = PyWeakref_NewProxy(item, obj);
+ Py_DECREF(obj);
+ if (proxy == NULL)
+ return -1;
+
+ result = PyDict_SetItem(dict, key, proxy);
+ Py_DECREF(proxy);
+ return result;
+}
+
+PyObject *
+PyDict_GetItemProxy(PyObject *dict, PyObject *key)
+{
+ PyObject *result;
+ PyObject *item = PyDict_GetItemWithError(dict, key);
+
+ if (item == NULL)
+ return NULL;
+ if (!PyWeakref_CheckProxy(item))
+ return item;
+ result = PyWeakref_GET_OBJECT(item);
+ if (result == Py_None)
+ return NULL;
+ return result;
+}
+
+/******************************************************************/
+
+/*
+ Allocate a memory block for a pep3118 format string, filled with
+ a suitable PEP 3118 type code corresponding to the given ctypes
+ type. Returns NULL on failure, with the error indicator set.
+
+ This produces type codes in the standard size mode (cf. struct module),
+ since the endianness may need to be swapped to a non-native one
+ later on.
+ */
+static char *
+_ctypes_alloc_format_string_for_type(char code, int big_endian)
+{
+ char *result;
+ char pep_code = '\0';
+
+ switch (code) {
+#if SIZEOF_INT == 2
+ case 'i': pep_code = 'h'; break;
+ case 'I': pep_code = 'H'; break;
+#elif SIZEOF_INT == 4
+ case 'i': pep_code = 'i'; break;
+ case 'I': pep_code = 'I'; break;
+#elif SIZEOF_INT == 8
+ case 'i': pep_code = 'q'; break;
+ case 'I': pep_code = 'Q'; break;
+#else
+# error SIZEOF_INT has an unexpected value
+#endif /* SIZEOF_INT */
+#if SIZEOF_LONG == 4
+ case 'l': pep_code = 'l'; break;
+ case 'L': pep_code = 'L'; break;
+#elif SIZEOF_LONG == 8
+ case 'l': pep_code = 'q'; break;
+ case 'L': pep_code = 'Q'; break;
+#else
+# error SIZEOF_LONG has an unexpected value
+#endif /* SIZEOF_LONG */
+#if SIZEOF__BOOL == 1
+ case '?': pep_code = '?'; break;
+#elif SIZEOF__BOOL == 2
+ case '?': pep_code = 'H'; break;
+#elif SIZEOF__BOOL == 4
+ case '?': pep_code = 'L'; break;
+#elif SIZEOF__BOOL == 8
+ case '?': pep_code = 'Q'; break;
+#else
+# error SIZEOF__BOOL has an unexpected value
+#endif /* SIZEOF__BOOL */
+ default:
+ /* The standard-size code is the same as the ctypes one */
+ pep_code = code;
+ break;
+ }
+
+ result = PyMem_Malloc(3);
+ if (result == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ result[0] = big_endian ? '>' : '<';
+ result[1] = pep_code;
+ result[2] = '\0';
+ return result;
+}
+
+/*
+ Allocate a memory block for a pep3118 format string, copy prefix (if
+ non-null) and suffix into it. Returns NULL on failure, with the error
+ indicator set. If called with a suffix of NULL the error indicator must
+ already be set.
+ */
+char *
+_ctypes_alloc_format_string(const char *prefix, const char *suffix)
+{
+ size_t len;
+ char *result;
+
+ if (suffix == NULL) {
+ assert(PyErr_Occurred());
+ return NULL;
+ }
+ len = strlen(suffix);
+ if (prefix)
+ len += strlen(prefix);
+ result = PyMem_Malloc(len + 1);
+ if (result == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ if (prefix)
+ strcpy(result, prefix);
+ else
+ result[0] = '\0';
+ strcat(result, suffix);
+ return result;
+}
+
+/*
+ Allocate a memory block for a pep3118 format string, adding
+ the given prefix (if non-null), an additional shape prefix, and a suffix.
+ Returns NULL on failure, with the error indicator set. If called with
+ a suffix of NULL the error indicator must already be set.
+ */
+char *
+_ctypes_alloc_format_string_with_shape(int ndim, const Py_ssize_t *shape,
+ const char *prefix, const char *suffix)
+{
+ char *new_prefix;
+ char *result;
+ char buf[32];
+ Py_ssize_t prefix_len;
+ int k;
+
+ prefix_len = 32 * ndim + 3;
+ if (prefix)
+ prefix_len += strlen(prefix);
+ new_prefix = PyMem_Malloc(prefix_len);
+ if (new_prefix == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ new_prefix[0] = '\0';
+ if (prefix)
+ strcpy(new_prefix, prefix);
+ if (ndim > 0) {
+ /* Add the prefix "(shape[0],shape[1],...,shape[ndim-1])" */
+ strcat(new_prefix, "(");
+ for (k = 0; k < ndim; ++k) {
+ if (k < ndim-1) {
+ sprintf(buf, "%zd,", shape[k]);
+ } else {
+ sprintf(buf, "%zd)", shape[k]);
+ }
+ strcat(new_prefix, buf);
+ }
+ }
+ result = _ctypes_alloc_format_string(new_prefix, suffix);
+ PyMem_Free(new_prefix);
+ return result;
+}
+
+/* StructParamObject and StructParam_Type are used in _ctypes_callproc()
+ for argument.keep to call PyMem_Free(ptr) on Py_DECREF(argument).
+
+ StructUnionType_paramfunc() creates such object when a ctypes Structure is
+ passed by copy to a C function. */
+typedef struct {
+ PyObject_HEAD
+ void *ptr;
+ PyObject *keep; // If set, a reference to the original CDataObject.
+} StructParamObject;
+
+static int
+StructParam_traverse(StructParamObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static int
+StructParam_clear(StructParamObject *self)
+{
+ Py_CLEAR(self->keep);
+ return 0;
+}
+
+static void
+StructParam_dealloc(PyObject *myself)
+{
+ StructParamObject *self = (StructParamObject *)myself;
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(myself);
+ (void)StructParam_clear(self);
+ PyMem_Free(self->ptr);
+ tp->tp_free(myself);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot structparam_slots[] = {
+ {Py_tp_traverse, StructParam_traverse},
+ {Py_tp_clear, StructParam_clear},
+ {Py_tp_dealloc, StructParam_dealloc},
+ {0, NULL},
+};
+
+static PyType_Spec structparam_spec = {
+ .name = "_ctypes.StructParam_Type",
+ .basicsize = sizeof(StructParamObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = structparam_slots,
+};
+
+
+/*
+ PyCStructType_Type - a meta type/class. Creating a new class using this one as
+ __metaclass__ will call the constructor StructUnionType_new. It replaces the
+ tp_dict member with a new instance of StgDict, and initializes the C
+ accessible fields somehow.
+*/
+
+static PyCArgObject *
+StructUnionType_paramfunc(CDataObject *self)
+{
+ PyCArgObject *parg;
+ PyObject *obj;
+ StgDictObject *stgdict;
+ void *ptr;
+
+ if ((size_t)self->b_size > sizeof(void*)) {
+ ptr = PyMem_Malloc(self->b_size);
+ if (ptr == NULL) {
+ return NULL;
+ }
+ memcpy(ptr, self->b_ptr, self->b_size);
+
+ /* Create a Python object which calls PyMem_Free(ptr) in
+ its deallocator. The object will be destroyed
+ at _ctypes_callproc() cleanup. */
+ ctypes_state *st = GLOBAL_STATE();
+ PyTypeObject *tp = st->StructParam_Type;
+ obj = tp->tp_alloc(tp, 0);
+ if (obj == NULL) {
+ PyMem_Free(ptr);
+ return NULL;
+ }
+
+ StructParamObject *struct_param = (StructParamObject *)obj;
+ struct_param->ptr = ptr;
+ struct_param->keep = Py_NewRef(self);
+ } else {
+ ptr = self->b_ptr;
+ obj = Py_NewRef(self);
+ }
+
+ parg = PyCArgObject_new();
+ if (parg == NULL) {
+ Py_DECREF(obj);
+ return NULL;
+ }
+
+ parg->tag = 'V';
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for structure/union instances */
+ parg->pffi_type = &stgdict->ffi_type_pointer;
+ parg->value.p = ptr;
+ parg->size = self->b_size;
+ parg->obj = obj;
+ return parg;
+}
+
+static PyObject *
+StructUnionType_new(PyTypeObject *type, PyObject *args, PyObject *kwds, int isStruct)
+{
+ PyTypeObject *result;
+ PyObject *fields;
+ StgDictObject *dict;
+
+ /* create the new instance (which is a class,
+ since we are a metatype!) */
+ result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
+ if (!result)
+ return NULL;
+
+ /* keep this for bw compatibility */
+ int r = PyDict_Contains(result->tp_dict, &_Py_ID(_abstract_));
+ if (r > 0)
+ return (PyObject *)result;
+ if (r < 0) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ dict = (StgDictObject *)_PyObject_CallNoArgs((PyObject *)&PyCStgDict_Type);
+ if (!dict) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ if (!isStruct) {
+ dict->flags |= TYPEFLAG_HASUNION;
+ }
+ /* replace the class dict by our updated stgdict, which holds info
+ about storage requirements of the instances */
+ if (-1 == PyDict_Update((PyObject *)dict, result->tp_dict)) {
+ Py_DECREF(result);
+ Py_DECREF((PyObject *)dict);
+ return NULL;
+ }
+ Py_SETREF(result->tp_dict, (PyObject *)dict);
+ dict->format = _ctypes_alloc_format_string(NULL, "B");
+ if (dict->format == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ dict->paramfunc = StructUnionType_paramfunc;
+
+ fields = PyDict_GetItemWithError((PyObject *)dict, &_Py_ID(_fields_));
+ if (fields) {
+ if (PyObject_SetAttr((PyObject *)result, &_Py_ID(_fields_), fields) < 0) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ return (PyObject *)result;
+ }
+ else if (PyErr_Occurred()) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ else {
+ StgDictObject *basedict = PyType_stgdict((PyObject *)result->tp_base);
+
+ if (basedict == NULL)
+ return (PyObject *)result;
+ /* copy base dict */
+ if (-1 == PyCStgDict_clone(dict, basedict)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ dict->flags &= ~DICTFLAG_FINAL; /* clear the 'final' flag in the subclass dict */
+ basedict->flags |= DICTFLAG_FINAL; /* set the 'final' flag in the baseclass dict */
+ return (PyObject *)result;
+ }
+}
+
+static PyObject *
+PyCStructType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ return StructUnionType_new(type, args, kwds, 1);
+}
+
+static PyObject *
+UnionType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ return StructUnionType_new(type, args, kwds, 0);
+}
+
+PyDoc_STRVAR(from_address_doc,
+"C.from_address(integer) -> C instance\naccess a C instance at the specified address");
+
+static PyObject *
+CDataType_from_address(PyObject *type, PyObject *value)
+{
+ void *buf;
+ if (!PyLong_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "integer expected");
+ return NULL;
+ }
+ buf = (void *)PyLong_AsVoidPtr(value);
+ if (PyErr_Occurred())
+ return NULL;
+ return PyCData_AtAddress(type, buf);
+}
+
+PyDoc_STRVAR(from_buffer_doc,
+"C.from_buffer(object, offset=0) -> C instance\ncreate a C instance from a writeable buffer");
+
+static int
+KeepRef(CDataObject *target, Py_ssize_t index, PyObject *keep);
+
+static PyObject *
+CDataType_from_buffer(PyObject *type, PyObject *args)
+{
+ PyObject *obj;
+ PyObject *mv;
+ PyObject *result;
+ Py_buffer *buffer;
+ Py_ssize_t offset = 0;
+
+ StgDictObject *dict = PyType_stgdict(type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError, "abstract class");
+ return NULL;
+ }
+
+ if (!PyArg_ParseTuple(args, "O|n:from_buffer", &obj, &offset))
+ return NULL;
+
+ mv = PyMemoryView_FromObject(obj);
+ if (mv == NULL)
+ return NULL;
+
+ buffer = PyMemoryView_GET_BUFFER(mv);
+
+ if (buffer->readonly) {
+ PyErr_SetString(PyExc_TypeError,
+ "underlying buffer is not writable");
+ Py_DECREF(mv);
+ return NULL;
+ }
+
+ if (!PyBuffer_IsContiguous(buffer, 'C')) {
+ PyErr_SetString(PyExc_TypeError,
+ "underlying buffer is not C contiguous");
+ Py_DECREF(mv);
+ return NULL;
+ }
+
+ if (offset < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "offset cannot be negative");
+ Py_DECREF(mv);
+ return NULL;
+ }
+
+ if (dict->size > buffer->len - offset) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer size too small "
+ "(%zd instead of at least %zd bytes)",
+ buffer->len, dict->size + offset);
+ Py_DECREF(mv);
+ return NULL;
+ }
+
+ if (PySys_Audit("ctypes.cdata/buffer", "nnn",
+ (Py_ssize_t)buffer->buf, buffer->len, offset) < 0) {
+ Py_DECREF(mv);
+ return NULL;
+ }
+
+ result = PyCData_AtAddress(type, (char *)buffer->buf + offset);
+ if (result == NULL) {
+ Py_DECREF(mv);
+ return NULL;
+ }
+
+ if (-1 == KeepRef((CDataObject *)result, -1, mv)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+
+PyDoc_STRVAR(from_buffer_copy_doc,
+"C.from_buffer_copy(object, offset=0) -> C instance\ncreate a C instance from a readable buffer");
+
+static PyObject *
+GenericPyCData_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
+
+static PyObject *
+CDataType_from_buffer_copy(PyObject *type, PyObject *args)
+{
+ Py_buffer buffer;
+ Py_ssize_t offset = 0;
+ PyObject *result;
+ StgDictObject *dict = PyType_stgdict(type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError, "abstract class");
+ return NULL;
+ }
+
+ if (!PyArg_ParseTuple(args, "y*|n:from_buffer_copy", &buffer, &offset))
+ return NULL;
+
+ if (offset < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "offset cannot be negative");
+ PyBuffer_Release(&buffer);
+ return NULL;
+ }
+
+ if (dict->size > buffer.len - offset) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer size too small (%zd instead of at least %zd bytes)",
+ buffer.len, dict->size + offset);
+ PyBuffer_Release(&buffer);
+ return NULL;
+ }
+
+ if (PySys_Audit("ctypes.cdata/buffer", "nnn",
+ (Py_ssize_t)buffer.buf, buffer.len, offset) < 0) {
+ PyBuffer_Release(&buffer);
+ return NULL;
+ }
+
+ result = GenericPyCData_new((PyTypeObject *)type, NULL, NULL);
+ if (result != NULL) {
+ memcpy(((CDataObject *)result)->b_ptr,
+ (char *)buffer.buf + offset, dict->size);
+ }
+ PyBuffer_Release(&buffer);
+ return result;
+}
+
+PyDoc_STRVAR(in_dll_doc,
+"C.in_dll(dll, name) -> C instance\naccess a C instance in a dll");
+
+static PyObject *
+CDataType_in_dll(PyObject *type, PyObject *args)
+{
+ PyObject *dll;
+ char *name;
+ PyObject *obj;
+ void *handle;
+ void *address;
+
+ if (!PyArg_ParseTuple(args, "Os:in_dll", &dll, &name))
+ return NULL;
+ if (PySys_Audit("ctypes.dlsym", "O", args) < 0) {
+ return NULL;
+ }
+
+ obj = PyObject_GetAttrString(dll, "_handle");
+ if (!obj)
+ return NULL;
+ if (!PyLong_Check(obj)) {
+ PyErr_SetString(PyExc_TypeError,
+ "the _handle attribute of the second argument must be an integer");
+ Py_DECREF(obj);
+ return NULL;
+ }
+ handle = (void *)PyLong_AsVoidPtr(obj);
+ Py_DECREF(obj);
+ if (PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ValueError,
+ "could not convert the _handle attribute to a pointer");
+ return NULL;
+ }
+
+#ifdef MS_WIN32
+ Py_BEGIN_ALLOW_THREADS
+ address = (void *)GetProcAddress(handle, name);
+ Py_END_ALLOW_THREADS
+ if (!address) {
+ PyErr_Format(PyExc_ValueError,
+ "symbol '%s' not found",
+ name);
+ return NULL;
+ }
+#else
+ address = (void *)dlsym(handle, name);
+ if (!address) {
+#ifdef __CYGWIN__
+/* dlerror() isn't very helpful on cygwin */
+ PyErr_Format(PyExc_ValueError,
+ "symbol '%s' not found",
+ name);
+#else
+ PyErr_SetString(PyExc_ValueError, dlerror());
+#endif
+ return NULL;
+ }
+#endif
+ return PyCData_AtAddress(type, address);
+}
+
+PyDoc_STRVAR(from_param_doc,
+"Convert a Python object into a function call parameter.");
+
+static PyObject *
+CDataType_from_param(PyObject *type, PyObject *value)
+{
+ PyObject *as_parameter;
+ int res = PyObject_IsInstance(value, type);
+ if (res == -1)
+ return NULL;
+ if (res) {
+ return Py_NewRef(value);
+ }
+ ctypes_state *st = GLOBAL_STATE();
+ if (PyCArg_CheckExact(st, value)) {
+ PyCArgObject *p = (PyCArgObject *)value;
+ PyObject *ob = p->obj;
+ const char *ob_name;
+ StgDictObject *dict;
+ dict = PyType_stgdict(type);
+
+ /* If we got a PyCArgObject, we must check if the object packed in it
+ is an instance of the type's dict->proto */
+ if(dict && ob) {
+ res = PyObject_IsInstance(ob, dict->proto);
+ if (res == -1)
+ return NULL;
+ if (res) {
+ return Py_NewRef(value);
+ }
+ }
+ ob_name = (ob) ? Py_TYPE(ob)->tp_name : "???";
+ PyErr_Format(PyExc_TypeError,
+ "expected %s instance instead of pointer to %s",
+ ((PyTypeObject *)type)->tp_name, ob_name);
+ return NULL;
+ }
+
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
+ return NULL;
+ }
+ if (as_parameter) {
+ value = CDataType_from_param(type, as_parameter);
+ Py_DECREF(as_parameter);
+ return value;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "expected %s instance instead of %s",
+ ((PyTypeObject *)type)->tp_name,
+ Py_TYPE(value)->tp_name);
+ return NULL;
+}
+
+static PyMethodDef CDataType_methods[] = {
+ { "from_param", CDataType_from_param, METH_O, from_param_doc },
+ { "from_address", CDataType_from_address, METH_O, from_address_doc },
+ { "from_buffer", CDataType_from_buffer, METH_VARARGS, from_buffer_doc, },
+ { "from_buffer_copy", CDataType_from_buffer_copy, METH_VARARGS, from_buffer_copy_doc, },
+ { "in_dll", CDataType_in_dll, METH_VARARGS, in_dll_doc },
+ { NULL, NULL },
+};
+
+static PyObject *
+CDataType_repeat(PyObject *self, Py_ssize_t length)
+{
+ if (length < 0)
+ return PyErr_Format(PyExc_ValueError,
+ "Array length must be >= 0, not %zd",
+ length);
+ return PyCArrayType_from_ctype(self, length);
+}
+
+static PySequenceMethods CDataType_as_sequence = {
+ 0, /* inquiry sq_length; */
+ 0, /* binaryfunc sq_concat; */
+ CDataType_repeat, /* intargfunc sq_repeat; */
+ 0, /* intargfunc sq_item; */
+ 0, /* intintargfunc sq_slice; */
+ 0, /* intobjargproc sq_ass_item; */
+ 0, /* intintobjargproc sq_ass_slice; */
+ 0, /* objobjproc sq_contains; */
+
+ 0, /* binaryfunc sq_inplace_concat; */
+ 0, /* intargfunc sq_inplace_repeat; */
+};
+
+static int
+CDataType_clear(PyTypeObject *self)
+{
+ StgDictObject *dict = PyType_stgdict((PyObject *)self);
+ if (dict)
+ Py_CLEAR(dict->proto);
+ return PyType_Type.tp_clear((PyObject *)self);
+}
+
+static int
+CDataType_traverse(PyTypeObject *self, visitproc visit, void *arg)
+{
+ StgDictObject *dict = PyType_stgdict((PyObject *)self);
+ if (dict)
+ Py_VISIT(dict->proto);
+ return PyType_Type.tp_traverse((PyObject *)self, visit, arg);
+}
+
+static int
+PyCStructType_setattro(PyObject *self, PyObject *key, PyObject *value)
+{
+ /* XXX Should we disallow deleting _fields_? */
+ if (-1 == PyType_Type.tp_setattro(self, key, value))
+ return -1;
+
+ if (value && PyUnicode_Check(key) &&
+ _PyUnicode_EqualToASCIIString(key, "_fields_"))
+ return PyCStructUnionType_update_stgdict(self, value, 1);
+ return 0;
+}
+
+
+static int
+UnionType_setattro(PyObject *self, PyObject *key, PyObject *value)
+{
+ /* XXX Should we disallow deleting _fields_? */
+ if (-1 == PyObject_GenericSetAttr(self, key, value))
+ return -1;
+
+ if (PyUnicode_Check(key) &&
+ _PyUnicode_EqualToASCIIString(key, "_fields_"))
+ return PyCStructUnionType_update_stgdict(self, value, 0);
+ return 0;
+}
+
+
+PyTypeObject PyCStructType_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.PyCStructType", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &CDataType_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ PyCStructType_setattro, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
+ PyDoc_STR("metatype for the CData Objects"), /* tp_doc */
+ (traverseproc)CDataType_traverse, /* tp_traverse */
+ (inquiry)CDataType_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ CDataType_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ PyCStructType_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+static PyTypeObject UnionType_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.UnionType", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &CDataType_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ UnionType_setattro, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
+ PyDoc_STR("metatype for the CData Objects"), /* tp_doc */
+ (traverseproc)CDataType_traverse, /* tp_traverse */
+ (inquiry)CDataType_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ CDataType_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ UnionType_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+
+/******************************************************************/
+
+/*
+
+The PyCPointerType_Type metaclass must ensure that the subclass of Pointer can be
+created. It must check for a _type_ attribute in the class. Since are no
+runtime created properties, a CField is probably *not* needed ?
+
+class IntPointer(Pointer):
+ _type_ = "i"
+
+The PyCPointer_Type provides the functionality: a contents method/property, a
+size property/method, and the sequence protocol.
+
+*/
+
+static int
+PyCPointerType_SetProto(StgDictObject *stgdict, PyObject *proto)
+{
+ if (!proto || !PyType_Check(proto)) {
+ PyErr_SetString(PyExc_TypeError,
+ "_type_ must be a type");
+ return -1;
+ }
+ if (!PyType_stgdict(proto)) {
+ PyErr_SetString(PyExc_TypeError,
+ "_type_ must have storage info");
+ return -1;
+ }
+ Py_INCREF(proto);
+ Py_XSETREF(stgdict->proto, proto);
+ return 0;
+}
+
+static PyCArgObject *
+PyCPointerType_paramfunc(CDataObject *self)
+{
+ PyCArgObject *parg;
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+
+ parg->tag = 'P';
+ parg->pffi_type = &ffi_type_pointer;
+ parg->obj = Py_NewRef(self);
+ parg->value.p = *(void **)self->b_ptr;
+ return parg;
+}
+
+static PyObject *
+PyCPointerType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyTypeObject *result;
+ StgDictObject *stgdict;
+ PyObject *proto;
+ PyObject *typedict;
+
+
+ typedict = PyTuple_GetItem(args, 2);
+ if (!typedict)
+ return NULL;
+/*
+ stgdict items size, align, length contain info about pointers itself,
+ stgdict->proto has info about the pointed to type!
+*/
+ stgdict = (StgDictObject *)_PyObject_CallNoArgs(
+ (PyObject *)&PyCStgDict_Type);
+ if (!stgdict)
+ return NULL;
+ stgdict->size = sizeof(void *);
+ stgdict->align = _ctypes_get_fielddesc("P")->pffi_type->alignment;
+ stgdict->length = 1;
+ stgdict->ffi_type_pointer = ffi_type_pointer;
+ stgdict->paramfunc = PyCPointerType_paramfunc;
+ stgdict->flags |= TYPEFLAG_ISPOINTER;
+
+ proto = PyDict_GetItemWithError(typedict, &_Py_ID(_type_)); /* Borrowed ref */
+ if (proto) {
+ StgDictObject *itemdict;
+ const char *current_format;
+ if (-1 == PyCPointerType_SetProto(stgdict, proto)) {
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ itemdict = PyType_stgdict(proto);
+ /* PyCPointerType_SetProto has verified proto has a stgdict. */
+ assert(itemdict);
+ /* If itemdict->format is NULL, then this is a pointer to an
+ incomplete type. We create a generic format string
+ 'pointer to bytes' in this case. XXX Better would be to
+ fix the format string later...
+ */
+ current_format = itemdict->format ? itemdict->format : "B";
+ if (itemdict->shape != NULL) {
+ /* pointer to an array: the shape needs to be prefixed */
+ stgdict->format = _ctypes_alloc_format_string_with_shape(
+ itemdict->ndim, itemdict->shape, "&", current_format);
+ } else {
+ stgdict->format = _ctypes_alloc_format_string("&", current_format);
+ }
+ if (stgdict->format == NULL) {
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ }
+ else if (PyErr_Occurred()) {
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+
+ /* create the new instance (which is a class,
+ since we are a metatype!) */
+ result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
+ if (result == NULL) {
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+
+ /* replace the class dict by our updated spam dict */
+ if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict)) {
+ Py_DECREF(result);
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ Py_SETREF(result->tp_dict, (PyObject *)stgdict);
+
+ return (PyObject *)result;
+}
+
+
+static PyObject *
+PyCPointerType_set_type(PyTypeObject *self, PyObject *type)
+{
+ StgDictObject *dict;
+
+
+ dict = PyType_stgdict((PyObject *)self);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return NULL;
+ }
+
+ if (-1 == PyCPointerType_SetProto(dict, type))
+ return NULL;
+
+ if (-1 == PyDict_SetItem((PyObject *)dict, &_Py_ID(_type_), type))
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *_byref(PyObject *);
+
+static PyObject *
+PyCPointerType_from_param(PyObject *type, PyObject *value)
+{
+ StgDictObject *typedict;
+
+ if (value == Py_None) {
+ /* ConvParam will convert to a NULL pointer later */
+ return Py_NewRef(value);
+ }
+
+ typedict = PyType_stgdict(type);
+ if (!typedict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return NULL;
+ }
+
+ /* If we expect POINTER(<type>), but receive a <type> instance, accept
+ it by calling byref(<type>).
+ */
+ switch (PyObject_IsInstance(value, typedict->proto)) {
+ case 1:
+ Py_INCREF(value); /* _byref steals a refcount */
+ return _byref(value);
+ case -1:
+ return NULL;
+ default:
+ break;
+ }
+
+ if (PointerObject_Check(value) || ArrayObject_Check(value)) {
+ /* Array instances are also pointers when
+ the item types are the same.
+ */
+ StgDictObject *v = PyObject_stgdict(value);
+ assert(v); /* Cannot be NULL for pointer or array objects */
+ int ret = PyObject_IsSubclass(v->proto, typedict->proto);
+ if (ret < 0) {
+ return NULL;
+ }
+ if (ret) {
+ return Py_NewRef(value);
+ }
+ }
+ return CDataType_from_param(type, value);
+}
+
+static PyMethodDef PyCPointerType_methods[] = {
+ { "from_address", CDataType_from_address, METH_O, from_address_doc },
+ { "from_buffer", CDataType_from_buffer, METH_VARARGS, from_buffer_doc, },
+ { "from_buffer_copy", CDataType_from_buffer_copy, METH_VARARGS, from_buffer_copy_doc, },
+ { "in_dll", CDataType_in_dll, METH_VARARGS, in_dll_doc},
+ { "from_param", (PyCFunction)PyCPointerType_from_param, METH_O, from_param_doc},
+ { "set_type", (PyCFunction)PyCPointerType_set_type, METH_O },
+ { NULL, NULL },
+};
+
+PyTypeObject PyCPointerType_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.PyCPointerType", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &CDataType_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
+ PyDoc_STR("metatype for the Pointer Objects"), /* tp_doc */
+ (traverseproc)CDataType_traverse, /* tp_traverse */
+ (inquiry)CDataType_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ PyCPointerType_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ PyCPointerType_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+
+/******************************************************************/
+/*
+ PyCArrayType_Type
+*/
+/*
+ PyCArrayType_new ensures that the new Array subclass created has a _length_
+ attribute, and a _type_ attribute.
+*/
+
+static int
+CharArray_set_raw(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
+{
+ char *ptr;
+ Py_ssize_t size;
+ Py_buffer view;
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
+ return -1;
+ }
+ if (PyObject_GetBuffer(value, &view, PyBUF_SIMPLE) < 0)
+ return -1;
+ size = view.len;
+ ptr = view.buf;
+ if (size > self->b_size) {
+ PyErr_SetString(PyExc_ValueError,
+ "byte string too long");
+ goto fail;
+ }
+
+ memcpy(self->b_ptr, ptr, size);
+
+ PyBuffer_Release(&view);
+ return 0;
+ fail:
+ PyBuffer_Release(&view);
+ return -1;
+}
+
+static PyObject *
+CharArray_get_raw(CDataObject *self, void *Py_UNUSED(ignored))
+{
+ return PyBytes_FromStringAndSize(self->b_ptr, self->b_size);
+}
+
+static PyObject *
+CharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored))
+{
+ Py_ssize_t i;
+ char *ptr = self->b_ptr;
+ for (i = 0; i < self->b_size; ++i)
+ if (*ptr++ == '\0')
+ break;
+ return PyBytes_FromStringAndSize(self->b_ptr, i);
+}
+
+static int
+CharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
+{
+ const char *ptr;
+ Py_ssize_t size;
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "can't delete attribute");
+ return -1;
+ }
+
+ if (!PyBytes_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "bytes expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return -1;
+ } else
+ Py_INCREF(value);
+ size = PyBytes_GET_SIZE(value);
+ if (size > self->b_size) {
+ PyErr_SetString(PyExc_ValueError,
+ "byte string too long");
+ Py_DECREF(value);
+ return -1;
+ }
+
+ ptr = PyBytes_AS_STRING(value);
+ memcpy(self->b_ptr, ptr, size);
+ if (size < self->b_size)
+ self->b_ptr[size] = '\0';
+ Py_DECREF(value);
+
+ return 0;
+}
+
+static PyGetSetDef CharArray_getsets[] = {
+ { "raw", (getter)CharArray_get_raw, (setter)CharArray_set_raw,
+ "value", NULL },
+ { "value", (getter)CharArray_get_value, (setter)CharArray_set_value,
+ "string value"},
+ { NULL, NULL }
+};
+
+static PyObject *
+WCharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored))
+{
+ Py_ssize_t i;
+ wchar_t *ptr = (wchar_t *)self->b_ptr;
+ for (i = 0; i < self->b_size/(Py_ssize_t)sizeof(wchar_t); ++i)
+ if (*ptr++ == (wchar_t)0)
+ break;
+ return PyUnicode_FromWideChar((wchar_t *)self->b_ptr, i);
+}
+
+static int
+WCharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
+{
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "can't delete attribute");
+ return -1;
+ }
+ if (!PyUnicode_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "unicode string expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return -1;
+ }
+
+ Py_ssize_t size = self->b_size / sizeof(wchar_t);
+ Py_ssize_t len = PyUnicode_AsWideChar(value, NULL, 0);
+ if (len < 0) {
+ return -1;
+ }
+ // PyUnicode_AsWideChar() returns number of wchars including trailing null byte,
+ // when it is called with NULL.
+ assert(len > 0);
+ if (len - 1 > size) {
+ PyErr_SetString(PyExc_ValueError, "string too long");
+ return -1;
+ }
+ if (PyUnicode_AsWideChar(value, (wchar_t *)self->b_ptr, size) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyGetSetDef WCharArray_getsets[] = {
+ { "value", (getter)WCharArray_get_value, (setter)WCharArray_set_value,
+ "string value"},
+ { NULL, NULL }
+};
+
+/*
+ The next function is copied from Python's typeobject.c.
+
+ It is used to attach getsets to a type *after* it
+ has been created: Arrays of characters have additional getsets to treat them
+ as strings.
+ */
+
+static int
+add_getset(PyTypeObject *type, PyGetSetDef *gsp)
+{
+ PyObject *dict = type->tp_dict;
+ for (; gsp->name != NULL; gsp++) {
+ PyObject *descr;
+ descr = PyDescr_NewGetSet(type, gsp);
+ if (descr == NULL)
+ return -1;
+ if (PyDict_SetItemString(dict, gsp->name, descr) < 0) {
+ Py_DECREF(descr);
+ return -1;
+ }
+ Py_DECREF(descr);
+ }
+ return 0;
+}
+
+static PyCArgObject *
+PyCArrayType_paramfunc(CDataObject *self)
+{
+ PyCArgObject *p = PyCArgObject_new();
+ if (p == NULL)
+ return NULL;
+ p->tag = 'P';
+ p->pffi_type = &ffi_type_pointer;
+ p->value.p = (char *)self->b_ptr;
+ p->obj = Py_NewRef(self);
+ return p;
+}
+
+static PyObject *
+PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyTypeObject *result;
+ StgDictObject *stgdict;
+ StgDictObject *itemdict;
+ PyObject *length_attr, *type_attr;
+ Py_ssize_t length;
+ Py_ssize_t itemsize, itemalign;
+
+ /* create the new instance (which is a class,
+ since we are a metatype!) */
+ result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
+ if (result == NULL)
+ return NULL;
+
+ /* Initialize these variables to NULL so that we can simplify error
+ handling by using Py_XDECREF. */
+ stgdict = NULL;
+ type_attr = NULL;
+
+ if (_PyObject_LookupAttr((PyObject *)result, &_Py_ID(_length_), &length_attr) < 0) {
+ goto error;
+ }
+ if (!length_attr) {
+ PyErr_SetString(PyExc_AttributeError,
+ "class must define a '_length_' attribute");
+ goto error;
+ }
+
+ if (!PyLong_Check(length_attr)) {
+ Py_DECREF(length_attr);
+ PyErr_SetString(PyExc_TypeError,
+ "The '_length_' attribute must be an integer");
+ goto error;
+ }
+
+ if (_PyLong_Sign(length_attr) == -1) {
+ Py_DECREF(length_attr);
+ PyErr_SetString(PyExc_ValueError,
+ "The '_length_' attribute must not be negative");
+ goto error;
+ }
+
+ length = PyLong_AsSsize_t(length_attr);
+ Py_DECREF(length_attr);
+ if (length == -1 && PyErr_Occurred()) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "The '_length_' attribute is too large");
+ }
+ goto error;
+ }
+
+ if (_PyObject_LookupAttr((PyObject *)result, &_Py_ID(_type_), &type_attr) < 0) {
+ goto error;
+ }
+ if (!type_attr) {
+ PyErr_SetString(PyExc_AttributeError,
+ "class must define a '_type_' attribute");
+ goto error;
+ }
+
+ stgdict = (StgDictObject *)_PyObject_CallNoArgs(
+ (PyObject *)&PyCStgDict_Type);
+ if (!stgdict)
+ goto error;
+
+ itemdict = PyType_stgdict(type_attr);
+ if (!itemdict) {
+ PyErr_SetString(PyExc_TypeError,
+ "_type_ must have storage info");
+ goto error;
+ }
+
+ assert(itemdict->format);
+ stgdict->format = _ctypes_alloc_format_string(NULL, itemdict->format);
+ if (stgdict->format == NULL)
+ goto error;
+ stgdict->ndim = itemdict->ndim + 1;
+ stgdict->shape = PyMem_Malloc(sizeof(Py_ssize_t) * stgdict->ndim);
+ if (stgdict->shape == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+ stgdict->shape[0] = length;
+ if (stgdict->ndim > 1) {
+ memmove(&stgdict->shape[1], itemdict->shape,
+ sizeof(Py_ssize_t) * (stgdict->ndim - 1));
+ }
+
+ itemsize = itemdict->size;
+ if (itemsize != 0 && length > PY_SSIZE_T_MAX / itemsize) {
+ PyErr_SetString(PyExc_OverflowError,
+ "array too large");
+ goto error;
+ }
+
+ itemalign = itemdict->align;
+
+ if (itemdict->flags & (TYPEFLAG_ISPOINTER | TYPEFLAG_HASPOINTER))
+ stgdict->flags |= TYPEFLAG_HASPOINTER;
+
+ stgdict->size = itemsize * length;
+ stgdict->align = itemalign;
+ stgdict->length = length;
+ stgdict->proto = type_attr;
+ type_attr = NULL;
+
+ stgdict->paramfunc = &PyCArrayType_paramfunc;
+
+ /* Arrays are passed as pointers to function calls. */
+ stgdict->ffi_type_pointer = ffi_type_pointer;
+
+ /* replace the class dict by our updated spam dict */
+ if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict))
+ goto error;
+ Py_SETREF(result->tp_dict, (PyObject *)stgdict); /* steal the reference */
+ stgdict = NULL;
+
+ /* Special case for character arrays.
+ A permanent annoyance: char arrays are also strings!
+ */
+ if (itemdict->getfunc == _ctypes_get_fielddesc("c")->getfunc) {
+ if (-1 == add_getset(result, CharArray_getsets))
+ goto error;
+ }
+ else if (itemdict->getfunc == _ctypes_get_fielddesc("u")->getfunc) {
+ if (-1 == add_getset(result, WCharArray_getsets))
+ goto error;
+ }
+
+ return (PyObject *)result;
+error:
+ Py_XDECREF((PyObject*)stgdict);
+ Py_XDECREF(type_attr);
+ Py_DECREF(result);
+ return NULL;
+}
+
+PyTypeObject PyCArrayType_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.PyCArrayType", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &CDataType_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("metatype for the Array Objects"), /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ CDataType_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ PyCArrayType_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+
+/******************************************************************/
+/*
+ PyCSimpleType_Type
+*/
+/*
+
+PyCSimpleType_new ensures that the new Simple_Type subclass created has a valid
+_type_ attribute.
+
+*/
+
+static const char SIMPLE_TYPE_CHARS[] = "cbBhHiIlLdfuzZqQPXOv?g";
+
+static PyObject *
+c_wchar_p_from_param(PyObject *type, PyObject *value)
+{
+ PyObject *as_parameter;
+ int res;
+ if (value == Py_None) {
+ Py_RETURN_NONE;
+ }
+ if (PyUnicode_Check(value)) {
+ PyCArgObject *parg;
+ struct fielddesc *fd = _ctypes_get_fielddesc("Z");
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'Z';
+ parg->obj = fd->setfunc(&parg->value, value, 0);
+ if (parg->obj == NULL) {
+ Py_DECREF(parg);
+ return NULL;
+ }
+ return (PyObject *)parg;
+ }
+ res = PyObject_IsInstance(value, type);
+ if (res == -1)
+ return NULL;
+ if (res) {
+ return Py_NewRef(value);
+ }
+ if (ArrayObject_Check(value) || PointerObject_Check(value)) {
+ /* c_wchar array instance or pointer(c_wchar(...)) */
+ StgDictObject *dt = PyObject_stgdict(value);
+ StgDictObject *dict;
+ assert(dt); /* Cannot be NULL for pointer or array objects */
+ dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL;
+ if (dict && (dict->setfunc == _ctypes_get_fielddesc("u")->setfunc)) {
+ return Py_NewRef(value);
+ }
+ }
+ ctypes_state *st = GLOBAL_STATE();
+ if (PyCArg_CheckExact(st, value)) {
+ /* byref(c_char(...)) */
+ PyCArgObject *a = (PyCArgObject *)value;
+ StgDictObject *dict = PyObject_stgdict(a->obj);
+ if (dict && (dict->setfunc == _ctypes_get_fielddesc("u")->setfunc)) {
+ return Py_NewRef(value);
+ }
+ }
+
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
+ return NULL;
+ }
+ if (as_parameter) {
+ value = c_wchar_p_from_param(type, as_parameter);
+ Py_DECREF(as_parameter);
+ return value;
+ }
+ /* XXX better message */
+ PyErr_SetString(PyExc_TypeError,
+ "wrong type");
+ return NULL;
+}
+
+static PyObject *
+c_char_p_from_param(PyObject *type, PyObject *value)
+{
+ PyObject *as_parameter;
+ int res;
+ if (value == Py_None) {
+ Py_RETURN_NONE;
+ }
+ if (PyBytes_Check(value)) {
+ PyCArgObject *parg;
+ struct fielddesc *fd = _ctypes_get_fielddesc("z");
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'z';
+ parg->obj = fd->setfunc(&parg->value, value, 0);
+ if (parg->obj == NULL) {
+ Py_DECREF(parg);
+ return NULL;
+ }
+ return (PyObject *)parg;
+ }
+ res = PyObject_IsInstance(value, type);
+ if (res == -1)
+ return NULL;
+ if (res) {
+ return Py_NewRef(value);
+ }
+ if (ArrayObject_Check(value) || PointerObject_Check(value)) {
+ /* c_char array instance or pointer(c_char(...)) */
+ StgDictObject *dt = PyObject_stgdict(value);
+ StgDictObject *dict;
+ assert(dt); /* Cannot be NULL for pointer or array objects */
+ dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL;
+ if (dict && (dict->setfunc == _ctypes_get_fielddesc("c")->setfunc)) {
+ return Py_NewRef(value);
+ }
+ }
+ ctypes_state *st = GLOBAL_STATE();
+ if (PyCArg_CheckExact(st, value)) {
+ /* byref(c_char(...)) */
+ PyCArgObject *a = (PyCArgObject *)value;
+ StgDictObject *dict = PyObject_stgdict(a->obj);
+ if (dict && (dict->setfunc == _ctypes_get_fielddesc("c")->setfunc)) {
+ return Py_NewRef(value);
+ }
+ }
+
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
+ return NULL;
+ }
+ if (as_parameter) {
+ value = c_char_p_from_param(type, as_parameter);
+ Py_DECREF(as_parameter);
+ return value;
+ }
+ /* XXX better message */
+ PyErr_SetString(PyExc_TypeError,
+ "wrong type");
+ return NULL;
+}
+
+static PyObject *
+c_void_p_from_param(PyObject *type, PyObject *value)
+{
+ StgDictObject *stgd;
+ PyObject *as_parameter;
+ int res;
+
+/* None */
+ if (value == Py_None) {
+ Py_RETURN_NONE;
+ }
+ /* Should probably allow buffer interface as well */
+/* int, long */
+ if (PyLong_Check(value)) {
+ PyCArgObject *parg;
+ struct fielddesc *fd = _ctypes_get_fielddesc("P");
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'P';
+ parg->obj = fd->setfunc(&parg->value, value, 0);
+ if (parg->obj == NULL) {
+ Py_DECREF(parg);
+ return NULL;
+ }
+ return (PyObject *)parg;
+ }
+ /* XXX struni: remove later */
+/* bytes */
+ if (PyBytes_Check(value)) {
+ PyCArgObject *parg;
+ struct fielddesc *fd = _ctypes_get_fielddesc("z");
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'z';
+ parg->obj = fd->setfunc(&parg->value, value, 0);
+ if (parg->obj == NULL) {
+ Py_DECREF(parg);
+ return NULL;
+ }
+ return (PyObject *)parg;
+ }
+/* unicode */
+ if (PyUnicode_Check(value)) {
+ PyCArgObject *parg;
+ struct fielddesc *fd = _ctypes_get_fielddesc("Z");
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'Z';
+ parg->obj = fd->setfunc(&parg->value, value, 0);
+ if (parg->obj == NULL) {
+ Py_DECREF(parg);
+ return NULL;
+ }
+ return (PyObject *)parg;
+ }
+/* c_void_p instance (or subclass) */
+ res = PyObject_IsInstance(value, type);
+ if (res == -1)
+ return NULL;
+ if (res) {
+ /* c_void_p instances */
+ return Py_NewRef(value);
+ }
+/* ctypes array or pointer instance */
+ if (ArrayObject_Check(value) || PointerObject_Check(value)) {
+ /* Any array or pointer is accepted */
+ return Py_NewRef(value);
+ }
+/* byref(...) */
+ ctypes_state *st = GLOBAL_STATE();
+ if (PyCArg_CheckExact(st, value)) {
+ /* byref(c_xxx()) */
+ PyCArgObject *a = (PyCArgObject *)value;
+ if (a->tag == 'P') {
+ return Py_NewRef(value);
+ }
+ }
+/* function pointer */
+ if (PyCFuncPtrObject_Check(value)) {
+ PyCArgObject *parg;
+ PyCFuncPtrObject *func;
+ func = (PyCFuncPtrObject *)value;
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'P';
+ Py_INCREF(value);
+ parg->value.p = *(void **)func->b_ptr;
+ parg->obj = value;
+ return (PyObject *)parg;
+ }
+/* c_char_p, c_wchar_p */
+ stgd = PyObject_stgdict(value);
+ if (stgd && CDataObject_Check(value) && stgd->proto && PyUnicode_Check(stgd->proto)) {
+ PyCArgObject *parg;
+
+ switch (PyUnicode_AsUTF8(stgd->proto)[0]) {
+ case 'z': /* c_char_p */
+ case 'Z': /* c_wchar_p */
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'Z';
+ parg->obj = Py_NewRef(value);
+ /* Remember: b_ptr points to where the pointer is stored! */
+ parg->value.p = *(void **)(((CDataObject *)value)->b_ptr);
+ return (PyObject *)parg;
+ }
+ }
+
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
+ return NULL;
+ }
+ if (as_parameter) {
+ value = c_void_p_from_param(type, as_parameter);
+ Py_DECREF(as_parameter);
+ return value;
+ }
+ /* XXX better message */
+ PyErr_SetString(PyExc_TypeError,
+ "wrong type");
+ return NULL;
+}
+
+static PyMethodDef c_void_p_method = { "from_param", c_void_p_from_param, METH_O };
+static PyMethodDef c_char_p_method = { "from_param", c_char_p_from_param, METH_O };
+static PyMethodDef c_wchar_p_method = { "from_param", c_wchar_p_from_param, METH_O };
+
+static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject *kwds,
+ PyObject *proto, struct fielddesc *fmt)
+{
+ PyTypeObject *result;
+ StgDictObject *stgdict;
+ PyObject *name = PyTuple_GET_ITEM(args, 0);
+ PyObject *newname;
+ PyObject *swapped_args;
+ static PyObject *suffix;
+ Py_ssize_t i;
+
+ swapped_args = PyTuple_New(PyTuple_GET_SIZE(args));
+ if (!swapped_args)
+ return NULL;
+
+ if (suffix == NULL)
+#ifdef WORDS_BIGENDIAN
+ suffix = PyUnicode_InternFromString("_le");
+#else
+ suffix = PyUnicode_InternFromString("_be");
+#endif
+ if (suffix == NULL) {
+ Py_DECREF(swapped_args);
+ return NULL;
+ }
+
+ newname = PyUnicode_Concat(name, suffix);
+ if (newname == NULL) {
+ Py_DECREF(swapped_args);
+ return NULL;
+ }
+
+ PyTuple_SET_ITEM(swapped_args, 0, newname);
+ for (i=1; i<PyTuple_GET_SIZE(args); ++i) {
+ PyObject *v = PyTuple_GET_ITEM(args, i);
+ Py_INCREF(v);
+ PyTuple_SET_ITEM(swapped_args, i, v);
+ }
+
+ /* create the new instance (which is a class,
+ since we are a metatype!) */
+ result = (PyTypeObject *)PyType_Type.tp_new(type, swapped_args, kwds);
+ Py_DECREF(swapped_args);
+ if (result == NULL)
+ return NULL;
+
+ stgdict = (StgDictObject *)_PyObject_CallNoArgs(
+ (PyObject *)&PyCStgDict_Type);
+ if (!stgdict) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ stgdict->ffi_type_pointer = *fmt->pffi_type;
+ stgdict->align = fmt->pffi_type->alignment;
+ stgdict->length = 0;
+ stgdict->size = fmt->pffi_type->size;
+ stgdict->setfunc = fmt->setfunc_swapped;
+ stgdict->getfunc = fmt->getfunc_swapped;
+
+ stgdict->proto = Py_NewRef(proto);
+
+ /* replace the class dict by our updated spam dict */
+ if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict)) {
+ Py_DECREF(result);
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ Py_SETREF(result->tp_dict, (PyObject *)stgdict);
+
+ return (PyObject *)result;
+}
+
+static PyCArgObject *
+PyCSimpleType_paramfunc(CDataObject *self)
+{
+ StgDictObject *dict;
+ const char *fmt;
+ PyCArgObject *parg;
+ struct fielddesc *fd;
+
+ dict = PyObject_stgdict((PyObject *)self);
+ assert(dict); /* Cannot be NULL for CDataObject instances */
+ fmt = PyUnicode_AsUTF8(dict->proto);
+ assert(fmt);
+
+ fd = _ctypes_get_fielddesc(fmt);
+ assert(fd);
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+
+ parg->tag = fmt[0];
+ parg->pffi_type = fd->pffi_type;
+ parg->obj = Py_NewRef(self);
+ memcpy(&parg->value, self->b_ptr, self->b_size);
+ return parg;
+}
+
+static PyObject *
+PyCSimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyTypeObject *result;
+ StgDictObject *stgdict;
+ PyObject *proto;
+ const char *proto_str;
+ Py_ssize_t proto_len;
+ PyMethodDef *ml;
+ struct fielddesc *fmt;
+
+ /* create the new instance (which is a class,
+ since we are a metatype!) */
+ result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
+ if (result == NULL)
+ return NULL;
+
+ if (_PyObject_LookupAttr((PyObject *)result, &_Py_ID(_type_), &proto) < 0) {
+ return NULL;
+ }
+ if (!proto) {
+ PyErr_SetString(PyExc_AttributeError,
+ "class must define a '_type_' attribute");
+ error:
+ Py_XDECREF(proto);
+ Py_DECREF(result);
+ return NULL;
+ }
+ if (PyUnicode_Check(proto)) {
+ proto_str = PyUnicode_AsUTF8AndSize(proto, &proto_len);
+ if (!proto_str)
+ goto error;
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "class must define a '_type_' string attribute");
+ goto error;
+ }
+ if (proto_len != 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "class must define a '_type_' attribute "
+ "which must be a string of length 1");
+ goto error;
+ }
+ if (!strchr(SIMPLE_TYPE_CHARS, *proto_str)) {
+ PyErr_Format(PyExc_AttributeError,
+ "class must define a '_type_' attribute which must be\n"
+ "a single character string containing one of '%s'.",
+ SIMPLE_TYPE_CHARS);
+ goto error;
+ }
+ fmt = _ctypes_get_fielddesc(proto_str);
+ if (fmt == NULL) {
+ PyErr_Format(PyExc_ValueError,
+ "_type_ '%s' not supported", proto_str);
+ goto error;
+ }
+
+ stgdict = (StgDictObject *)_PyObject_CallNoArgs(
+ (PyObject *)&PyCStgDict_Type);
+ if (!stgdict)
+ goto error;
+
+ stgdict->ffi_type_pointer = *fmt->pffi_type;
+ stgdict->align = fmt->pffi_type->alignment;
+ stgdict->length = 0;
+ stgdict->size = fmt->pffi_type->size;
+ stgdict->setfunc = fmt->setfunc;
+ stgdict->getfunc = fmt->getfunc;
+#ifdef WORDS_BIGENDIAN
+ stgdict->format = _ctypes_alloc_format_string_for_type(proto_str[0], 1);
+#else
+ stgdict->format = _ctypes_alloc_format_string_for_type(proto_str[0], 0);
+#endif
+ if (stgdict->format == NULL) {
+ Py_DECREF(result);
+ Py_DECREF(proto);
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+
+ stgdict->paramfunc = PyCSimpleType_paramfunc;
+/*
+ if (result->tp_base != &Simple_Type) {
+ stgdict->setfunc = NULL;
+ stgdict->getfunc = NULL;
+ }
+*/
+
+ /* This consumes the refcount on proto which we have */
+ stgdict->proto = proto;
+
+ /* replace the class dict by our updated spam dict */
+ if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict)) {
+ Py_DECREF(result);
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ Py_SETREF(result->tp_dict, (PyObject *)stgdict);
+
+ /* Install from_param class methods in ctypes base classes.
+ Overrides the PyCSimpleType_from_param generic method.
+ */
+ if (result->tp_base == &Simple_Type) {
+ switch (*proto_str) {
+ case 'z': /* c_char_p */
+ ml = &c_char_p_method;
+ stgdict->flags |= TYPEFLAG_ISPOINTER;
+ break;
+ case 'Z': /* c_wchar_p */
+ ml = &c_wchar_p_method;
+ stgdict->flags |= TYPEFLAG_ISPOINTER;
+ break;
+ case 'P': /* c_void_p */
+ ml = &c_void_p_method;
+ stgdict->flags |= TYPEFLAG_ISPOINTER;
+ break;
+ case 's':
+ case 'X':
+ case 'O':
+ ml = NULL;
+ stgdict->flags |= TYPEFLAG_ISPOINTER;
+ break;
+ default:
+ ml = NULL;
+ break;
+ }
+
+ if (ml) {
+ PyObject *meth;
+ int x;
+ meth = PyDescr_NewClassMethod(result, ml);
+ if (!meth) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ x = PyDict_SetItemString(result->tp_dict,
+ ml->ml_name,
+ meth);
+ Py_DECREF(meth);
+ if (x == -1) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ }
+ }
+
+ if (type == &PyCSimpleType_Type && fmt->setfunc_swapped && fmt->getfunc_swapped) {
+ PyObject *swapped = CreateSwappedType(type, args, kwds,
+ proto, fmt);
+ StgDictObject *sw_dict;
+ if (swapped == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ sw_dict = PyType_stgdict(swapped);
+#ifdef WORDS_BIGENDIAN
+ PyObject_SetAttrString((PyObject *)result, "__ctype_le__", swapped);
+ PyObject_SetAttrString((PyObject *)result, "__ctype_be__", (PyObject *)result);
+ PyObject_SetAttrString(swapped, "__ctype_be__", (PyObject *)result);
+ PyObject_SetAttrString(swapped, "__ctype_le__", swapped);
+ /* We are creating the type for the OTHER endian */
+ sw_dict->format = _ctypes_alloc_format_string("<", stgdict->format+1);
+#else
+ PyObject_SetAttrString((PyObject *)result, "__ctype_be__", swapped);
+ PyObject_SetAttrString((PyObject *)result, "__ctype_le__", (PyObject *)result);
+ PyObject_SetAttrString(swapped, "__ctype_le__", (PyObject *)result);
+ PyObject_SetAttrString(swapped, "__ctype_be__", swapped);
+ /* We are creating the type for the OTHER endian */
+ sw_dict->format = _ctypes_alloc_format_string(">", stgdict->format+1);
+#endif
+ Py_DECREF(swapped);
+ if (PyErr_Occurred()) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ };
+
+ return (PyObject *)result;
+}
+
+/*
+ * This is a *class method*.
+ * Convert a parameter into something that ConvParam can handle.
+ */
+static PyObject *
+PyCSimpleType_from_param(PyObject *type, PyObject *value)
+{
+ StgDictObject *dict;
+ const char *fmt;
+ PyCArgObject *parg;
+ struct fielddesc *fd;
+ PyObject *as_parameter;
+ int res;
+
+ /* If the value is already an instance of the requested type,
+ we can use it as is */
+ res = PyObject_IsInstance(value, type);
+ if (res == -1)
+ return NULL;
+ if (res) {
+ return Py_NewRef(value);
+ }
+
+ dict = PyType_stgdict(type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return NULL;
+ }
+
+ /* I think we can rely on this being a one-character string */
+ fmt = PyUnicode_AsUTF8(dict->proto);
+ assert(fmt);
+
+ fd = _ctypes_get_fielddesc(fmt);
+ assert(fd);
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+
+ parg->tag = fmt[0];
+ parg->pffi_type = fd->pffi_type;
+ parg->obj = fd->setfunc(&parg->value, value, 0);
+ if (parg->obj)
+ return (PyObject *)parg;
+ PyObject *exc = PyErr_GetRaisedException();
+ Py_DECREF(parg);
+
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
+ Py_XDECREF(exc);
+ return NULL;
+ }
+ if (as_parameter) {
+ if (_Py_EnterRecursiveCall("while processing _as_parameter_")) {
+ Py_DECREF(as_parameter);
+ Py_XDECREF(exc);
+ return NULL;
+ }
+ value = PyCSimpleType_from_param(type, as_parameter);
+ _Py_LeaveRecursiveCall();
+ Py_DECREF(as_parameter);
+ Py_XDECREF(exc);
+ return value;
+ }
+ if (exc) {
+ PyErr_SetRaisedException(exc);
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError, "wrong type");
+ }
+ return NULL;
+}
+
+static PyMethodDef PyCSimpleType_methods[] = {
+ { "from_param", PyCSimpleType_from_param, METH_O, from_param_doc },
+ { "from_address", CDataType_from_address, METH_O, from_address_doc },
+ { "from_buffer", CDataType_from_buffer, METH_VARARGS, from_buffer_doc, },
+ { "from_buffer_copy", CDataType_from_buffer_copy, METH_VARARGS, from_buffer_copy_doc, },
+ { "in_dll", CDataType_in_dll, METH_VARARGS, in_dll_doc},
+ { NULL, NULL },
+};
+
+PyTypeObject PyCSimpleType_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.PyCSimpleType", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &CDataType_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("metatype for the PyCSimpleType Objects"), /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ PyCSimpleType_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ PyCSimpleType_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+/******************************************************************/
+/*
+ PyCFuncPtrType_Type
+ */
+
+static PyObject *
+converters_from_argtypes(PyObject *ob)
+{
+ PyObject *converters;
+ Py_ssize_t i;
+
+ ob = PySequence_Tuple(ob); /* new reference */
+ if (!ob) {
+ PyErr_SetString(PyExc_TypeError,
+ "_argtypes_ must be a sequence of types");
+ return NULL;
+ }
+
+ Py_ssize_t nArgs = PyTuple_GET_SIZE(ob);
+ if (nArgs > CTYPES_MAX_ARGCOUNT) {
+ Py_DECREF(ob);
+ PyErr_Format(PyExc_ArgError,
+ "_argtypes_ has too many arguments (%zi), maximum is %i",
+ nArgs, CTYPES_MAX_ARGCOUNT);
+ return NULL;
+ }
+
+ converters = PyTuple_New(nArgs);
+ if (!converters) {
+ Py_DECREF(ob);
+ return NULL;
+ }
+
+ /* I have to check if this is correct. Using c_char, which has a size
+ of 1, will be assumed to be pushed as only one byte!
+ Aren't these promoted to integers by the C compiler and pushed as 4 bytes?
+ */
+
+ for (i = 0; i < nArgs; ++i) {
+ PyObject *cnv;
+ PyObject *tp = PyTuple_GET_ITEM(ob, i);
+/*
+ * The following checks, relating to bpo-16575 and bpo-16576, have been
+ * disabled. The reason is that, although there is a definite problem with
+ * how libffi handles unions (https://github.com/libffi/libffi/issues/33),
+ * there are numerous libraries which pass structures containing unions
+ * by values - especially on Windows but examples also exist on Linux
+ * (https://bugs.python.org/msg359834).
+ *
+ * It may not be possible to get proper support for unions and bitfields
+ * until support is forthcoming in libffi, but for now, adding the checks
+ * has caused problems in otherwise-working software, which suggests it
+ * is better to disable the checks.
+ *
+ * Although specific examples reported relate specifically to unions and
+ * not bitfields, the bitfields check is also being disabled as a
+ * precaution.
+
+ StgDictObject *stgdict = PyType_stgdict(tp);
+
+ if (stgdict != NULL) {
+ if (stgdict->flags & TYPEFLAG_HASUNION) {
+ Py_DECREF(converters);
+ Py_DECREF(ob);
+ if (!PyErr_Occurred()) {
+ PyErr_Format(PyExc_TypeError,
+ "item %zd in _argtypes_ passes a union by "
+ "value, which is unsupported.",
+ i + 1);
+ }
+ return NULL;
+ }
+ if (stgdict->flags & TYPEFLAG_HASBITFIELD) {
+ Py_DECREF(converters);
+ Py_DECREF(ob);
+ if (!PyErr_Occurred()) {
+ PyErr_Format(PyExc_TypeError,
+ "item %zd in _argtypes_ passes a struct/"
+ "union with a bitfield by value, which is "
+ "unsupported.",
+ i + 1);
+ }
+ return NULL;
+ }
+ }
+ */
+
+ if (_PyObject_LookupAttr(tp, &_Py_ID(from_param), &cnv) <= 0) {
+ Py_DECREF(converters);
+ Py_DECREF(ob);
+ if (!PyErr_Occurred()) {
+ PyErr_Format(PyExc_TypeError,
+ "item %zd in _argtypes_ has no from_param method",
+ i+1);
+ }
+ return NULL;
+ }
+ PyTuple_SET_ITEM(converters, i, cnv);
+ }
+ Py_DECREF(ob);
+ return converters;
+}
+
+static int
+make_funcptrtype_dict(StgDictObject *stgdict)
+{
+ PyObject *ob;
+ PyObject *converters = NULL;
+
+ stgdict->align = _ctypes_get_fielddesc("P")->pffi_type->alignment;
+ stgdict->length = 1;
+ stgdict->size = sizeof(void *);
+ stgdict->setfunc = NULL;
+ stgdict->getfunc = NULL;
+ stgdict->ffi_type_pointer = ffi_type_pointer;
+
+ ob = PyDict_GetItemWithError((PyObject *)stgdict, &_Py_ID(_flags_));
+ if (!ob || !PyLong_Check(ob)) {
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "class must define _flags_ which must be an integer");
+ }
+ return -1;
+ }
+ stgdict->flags = PyLong_AsUnsignedLongMask(ob) | TYPEFLAG_ISPOINTER;
+
+ /* _argtypes_ is optional... */
+ ob = PyDict_GetItemWithError((PyObject *)stgdict, &_Py_ID(_argtypes_));
+ if (ob) {
+ converters = converters_from_argtypes(ob);
+ if (!converters)
+ return -1;
+ stgdict->argtypes = Py_NewRef(ob);
+ stgdict->converters = converters;
+ }
+ else if (PyErr_Occurred()) {
+ return -1;
+ }
+
+ ob = PyDict_GetItemWithError((PyObject *)stgdict, &_Py_ID(_restype_));
+ if (ob) {
+ if (ob != Py_None && !PyType_stgdict(ob) && !PyCallable_Check(ob)) {
+ PyErr_SetString(PyExc_TypeError,
+ "_restype_ must be a type, a callable, or None");
+ return -1;
+ }
+ stgdict->restype = Py_NewRef(ob);
+ if (_PyObject_LookupAttr(ob, &_Py_ID(_check_retval_),
+ &stgdict->checker) < 0)
+ {
+ return -1;
+ }
+ }
+ else if (PyErr_Occurred()) {
+ return -1;
+ }
+/* XXX later, maybe.
+ ob = _PyDict_GetItemIdWithError((PyObject *)stgdict, &PyId__errcheck_);
+ if (ob) {
+ if (!PyCallable_Check(ob)) {
+ PyErr_SetString(PyExc_TypeError,
+ "_errcheck_ must be callable");
+ return -1;
+ }
+ stgdict->errcheck = Py_NewRef(ob);
+ }
+ else if (PyErr_Occurred()) {
+ return -1;
+ }
+*/
+ return 0;
+}
+
+static PyCArgObject *
+PyCFuncPtrType_paramfunc(CDataObject *self)
+{
+ PyCArgObject *parg;
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+
+ parg->tag = 'P';
+ parg->pffi_type = &ffi_type_pointer;
+ parg->obj = Py_NewRef(self);
+ parg->value.p = *(void **)self->b_ptr;
+ return parg;
+}
+
+static PyObject *
+PyCFuncPtrType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyTypeObject *result;
+ StgDictObject *stgdict;
+
+ stgdict = (StgDictObject *)_PyObject_CallNoArgs(
+ (PyObject *)&PyCStgDict_Type);
+ if (!stgdict)
+ return NULL;
+
+ stgdict->paramfunc = PyCFuncPtrType_paramfunc;
+ /* We do NOT expose the function signature in the format string. It
+ is impossible, generally, because the only requirement for the
+ argtypes items is that they have a .from_param method - we do not
+ know the types of the arguments (although, in practice, most
+ argtypes would be a ctypes type).
+ */
+ stgdict->format = _ctypes_alloc_format_string(NULL, "X{}");
+ if (stgdict->format == NULL) {
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ stgdict->flags |= TYPEFLAG_ISPOINTER;
+
+ /* create the new instance (which is a class,
+ since we are a metatype!) */
+ result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
+ if (result == NULL) {
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+
+ /* replace the class dict by our updated storage dict */
+ if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict)) {
+ Py_DECREF(result);
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ Py_SETREF(result->tp_dict, (PyObject *)stgdict);
+
+ if (-1 == make_funcptrtype_dict(stgdict)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return (PyObject *)result;
+}
+
+PyTypeObject PyCFuncPtrType_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.PyCFuncPtrType", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &CDataType_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
+ PyDoc_STR("metatype for C function pointers"), /* tp_doc */
+ (traverseproc)CDataType_traverse, /* tp_traverse */
+ (inquiry)CDataType_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ CDataType_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ PyCFuncPtrType_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+
+/*****************************************************************
+ * Code to keep needed objects alive
+ */
+
+static CDataObject *
+PyCData_GetContainer(CDataObject *self)
+{
+ while (self->b_base)
+ self = self->b_base;
+ if (self->b_objects == NULL) {
+ if (self->b_length) {
+ self->b_objects = PyDict_New();
+ if (self->b_objects == NULL)
+ return NULL;
+ } else {
+ self->b_objects = Py_NewRef(Py_None);
+ }
+ }
+ return self;
+}
+
+static PyObject *
+GetKeepedObjects(CDataObject *target)
+{
+ CDataObject *container;
+ container = PyCData_GetContainer(target);
+ if (container == NULL)
+ return NULL;
+ return container->b_objects;
+}
+
+static PyObject *
+unique_key(CDataObject *target, Py_ssize_t index)
+{
+ char string[256];
+ char *cp = string;
+ size_t bytes_left;
+
+ Py_BUILD_ASSERT(sizeof(string) - 1 > sizeof(Py_ssize_t) * 2);
+ cp += sprintf(cp, "%x", Py_SAFE_DOWNCAST(index, Py_ssize_t, int));
+ while (target->b_base) {
+ bytes_left = sizeof(string) - (cp - string) - 1;
+ /* Hex format needs 2 characters per byte */
+ if (bytes_left < sizeof(Py_ssize_t) * 2) {
+ PyErr_SetString(PyExc_ValueError,
+ "ctypes object structure too deep");
+ return NULL;
+ }
+ cp += sprintf(cp, ":%x", Py_SAFE_DOWNCAST(target->b_index, Py_ssize_t, int));
+ target = target->b_base;
+ }
+ return PyUnicode_FromStringAndSize(string, cp-string);
+}
+
+/*
+ * Keep a reference to 'keep' in the 'target', at index 'index'.
+ *
+ * If 'keep' is None, do nothing.
+ *
+ * Otherwise create a dictionary (if it does not yet exist) id the root
+ * objects 'b_objects' item, which will store the 'keep' object under a unique
+ * key.
+ *
+ * The unique_key helper travels the target's b_base pointer down to the root,
+ * building a string containing hex-formatted indexes found during traversal,
+ * separated by colons.
+ *
+ * The index tuple is used as a key into the root object's b_objects dict.
+ *
+ * Note: This function steals a refcount of the third argument, even if it
+ * fails!
+ */
+static int
+KeepRef(CDataObject *target, Py_ssize_t index, PyObject *keep)
+{
+ int result;
+ CDataObject *ob;
+ PyObject *key;
+
+/* Optimization: no need to store None */
+ if (keep == Py_None) {
+ Py_DECREF(Py_None);
+ return 0;
+ }
+ ob = PyCData_GetContainer(target);
+ if (ob == NULL) {
+ Py_DECREF(keep);
+ return -1;
+ }
+ if (ob->b_objects == NULL || !PyDict_CheckExact(ob->b_objects)) {
+ Py_XSETREF(ob->b_objects, keep); /* refcount consumed */
+ return 0;
+ }
+ key = unique_key(target, index);
+ if (key == NULL) {
+ Py_DECREF(keep);
+ return -1;
+ }
+ result = PyDict_SetItem(ob->b_objects, key, keep);
+ Py_DECREF(key);
+ Py_DECREF(keep);
+ return result;
+}
+
+/******************************************************************/
+/*
+ PyCData_Type
+ */
+static int
+PyCData_traverse(CDataObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->b_objects);
+ Py_VISIT((PyObject *)self->b_base);
+ return 0;
+}
+
+static int
+PyCData_clear(CDataObject *self)
+{
+ Py_CLEAR(self->b_objects);
+ if ((self->b_needsfree)
+ && _CDataObject_HasExternalBuffer(self))
+ PyMem_Free(self->b_ptr);
+ self->b_ptr = NULL;
+ Py_CLEAR(self->b_base);
+ return 0;
+}
+
+static void
+PyCData_dealloc(PyObject *self)
+{
+ PyCData_clear((CDataObject *)self);
+ Py_TYPE(self)->tp_free(self);
+}
+
+static PyMemberDef PyCData_members[] = {
+ { "_b_base_", T_OBJECT,
+ offsetof(CDataObject, b_base), READONLY,
+ "the base object" },
+ { "_b_needsfree_", T_INT,
+ offsetof(CDataObject, b_needsfree), READONLY,
+ "whether the object owns the memory or not" },
+ { "_objects", T_OBJECT,
+ offsetof(CDataObject, b_objects), READONLY,
+ "internal objects tree (NEVER CHANGE THIS OBJECT!)"},
+ { NULL },
+};
+
+/* Find the innermost type of an array type, returning a borrowed reference */
+static PyObject *
+PyCData_item_type(PyObject *type)
+{
+ if (PyCArrayTypeObject_Check(type)) {
+ StgDictObject *stg_dict;
+ PyObject *elem_type;
+
+ /* asserts used here as these are all guaranteed by construction */
+ stg_dict = PyType_stgdict(type);
+ assert(stg_dict);
+ elem_type = stg_dict->proto;
+ assert(elem_type);
+ return PyCData_item_type(elem_type);
+ }
+ else {
+ return type;
+ }
+}
+
+static int
+PyCData_NewGetBuffer(PyObject *myself, Py_buffer *view, int flags)
+{
+ CDataObject *self = (CDataObject *)myself;
+ StgDictObject *dict = PyObject_stgdict(myself);
+ PyObject *item_type = PyCData_item_type((PyObject*)Py_TYPE(myself));
+ StgDictObject *item_dict = PyType_stgdict(item_type);
+
+ if (view == NULL) return 0;
+
+ view->buf = self->b_ptr;
+ view->obj = Py_NewRef(myself);
+ view->len = self->b_size;
+ view->readonly = 0;
+ /* use default format character if not set */
+ view->format = dict->format ? dict->format : "B";
+ view->ndim = dict->ndim;
+ view->shape = dict->shape;
+ view->itemsize = item_dict->size;
+ view->strides = NULL;
+ view->suboffsets = NULL;
+ view->internal = NULL;
+ return 0;
+}
+
+static PyBufferProcs PyCData_as_buffer = {
+ PyCData_NewGetBuffer,
+ NULL,
+};
+
+/*
+ * CData objects are mutable, so they cannot be hashable!
+ */
+static Py_hash_t
+PyCData_nohash(PyObject *self)
+{
+ PyErr_SetString(PyExc_TypeError, "unhashable type");
+ return -1;
+}
+
+static PyObject *
+PyCData_reduce(PyObject *myself, PyObject *args)
+{
+ CDataObject *self = (CDataObject *)myself;
+
+ if (PyObject_stgdict(myself)->flags & (TYPEFLAG_ISPOINTER|TYPEFLAG_HASPOINTER)) {
+ PyErr_SetString(PyExc_ValueError,
+ "ctypes objects containing pointers cannot be pickled");
+ return NULL;
+ }
+ PyObject *dict = PyObject_GetAttrString(myself, "__dict__");
+ if (dict == NULL) {
+ return NULL;
+ }
+ return Py_BuildValue("O(O(NN))", _unpickle, Py_TYPE(myself), dict,
+ PyBytes_FromStringAndSize(self->b_ptr, self->b_size));
+}
+
+static PyObject *
+PyCData_setstate(PyObject *myself, PyObject *args)
+{
+ void *data;
+ Py_ssize_t len;
+ int res;
+ PyObject *dict, *mydict;
+ CDataObject *self = (CDataObject *)myself;
+ if (!PyArg_ParseTuple(args, "O!s#",
+ &PyDict_Type, &dict, &data, &len))
+ {
+ return NULL;
+ }
+ if (len > self->b_size)
+ len = self->b_size;
+ memmove(self->b_ptr, data, len);
+ mydict = PyObject_GetAttrString(myself, "__dict__");
+ if (mydict == NULL) {
+ return NULL;
+ }
+ if (!PyDict_Check(mydict)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.__dict__ must be a dictionary, not %.200s",
+ Py_TYPE(myself)->tp_name, Py_TYPE(mydict)->tp_name);
+ Py_DECREF(mydict);
+ return NULL;
+ }
+ res = PyDict_Update(mydict, dict);
+ Py_DECREF(mydict);
+ if (res == -1)
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+/*
+ * default __ctypes_from_outparam__ method returns self.
+ */
+static PyObject *
+PyCData_from_outparam(PyObject *self, PyObject *args)
+{
+ return Py_NewRef(self);
+}
+
+static PyMethodDef PyCData_methods[] = {
+ { "__ctypes_from_outparam__", PyCData_from_outparam, METH_NOARGS, },
+ { "__reduce__", PyCData_reduce, METH_NOARGS, },
+ { "__setstate__", PyCData_setstate, METH_VARARGS, },
+ { NULL, NULL },
+};
+
+PyTypeObject PyCData_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes._CData",
+ sizeof(CDataObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ PyCData_dealloc, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ PyCData_nohash, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("XXX to be provided"), /* tp_doc */
+ (traverseproc)PyCData_traverse, /* tp_traverse */
+ (inquiry)PyCData_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ PyCData_methods, /* tp_methods */
+ PyCData_members, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+};
+
+static int PyCData_MallocBuffer(CDataObject *obj, StgDictObject *dict)
+{
+ if ((size_t)dict->size <= sizeof(obj->b_value)) {
+ /* No need to call malloc, can use the default buffer */
+ obj->b_ptr = (char *)&obj->b_value;
+ /* The b_needsfree flag does not mean that we actually did
+ call PyMem_Malloc to allocate the memory block; instead it
+ means we are the *owner* of the memory and are responsible
+ for freeing resources associated with the memory. This is
+ also the reason that b_needsfree is exposed to Python.
+ */
+ obj->b_needsfree = 1;
+ } else {
+ /* In python 2.4, and ctypes 0.9.6, the malloc call took about
+ 33% of the creation time for c_int().
+ */
+ obj->b_ptr = (char *)PyMem_Malloc(dict->size);
+ if (obj->b_ptr == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ obj->b_needsfree = 1;
+ memset(obj->b_ptr, 0, dict->size);
+ }
+ obj->b_size = dict->size;
+ return 0;
+}
+
+PyObject *
+PyCData_FromBaseObj(PyObject *type, PyObject *base, Py_ssize_t index, char *adr)
+{
+ CDataObject *cmem;
+ StgDictObject *dict;
+
+ assert(PyType_Check(type));
+ dict = PyType_stgdict(type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return NULL;
+ }
+ dict->flags |= DICTFLAG_FINAL;
+ cmem = (CDataObject *)((PyTypeObject *)type)->tp_alloc((PyTypeObject *)type, 0);
+ if (cmem == NULL)
+ return NULL;
+ assert(CDataObject_Check(cmem));
+
+ cmem->b_length = dict->length;
+ cmem->b_size = dict->size;
+ if (base) { /* use base's buffer */
+ assert(CDataObject_Check(base));
+ cmem->b_ptr = adr;
+ cmem->b_needsfree = 0;
+ cmem->b_base = (CDataObject *)Py_NewRef(base);
+ cmem->b_index = index;
+ } else { /* copy contents of adr */
+ if (-1 == PyCData_MallocBuffer(cmem, dict)) {
+ Py_DECREF(cmem);
+ return NULL;
+ }
+ memcpy(cmem->b_ptr, adr, dict->size);
+ cmem->b_index = index;
+ }
+ return (PyObject *)cmem;
+}
+
+/*
+ Box a memory block into a CData instance.
+*/
+PyObject *
+PyCData_AtAddress(PyObject *type, void *buf)
+{
+ CDataObject *pd;
+ StgDictObject *dict;
+
+ if (PySys_Audit("ctypes.cdata", "n", (Py_ssize_t)buf) < 0) {
+ return NULL;
+ }
+
+ assert(PyType_Check(type));
+ dict = PyType_stgdict(type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return NULL;
+ }
+ dict->flags |= DICTFLAG_FINAL;
+
+ pd = (CDataObject *)((PyTypeObject *)type)->tp_alloc((PyTypeObject *)type, 0);
+ if (!pd)
+ return NULL;
+ assert(CDataObject_Check(pd));
+ pd->b_ptr = (char *)buf;
+ pd->b_length = dict->length;
+ pd->b_size = dict->size;
+ return (PyObject *)pd;
+}
+
+/*
+ This function returns TRUE for c_int, c_void_p, and these kind of
+ classes. FALSE otherwise FALSE also for subclasses of c_int and
+ such.
+*/
+int _ctypes_simple_instance(PyObject *obj)
+{
+ PyTypeObject *type = (PyTypeObject *)obj;
+
+ if (PyCSimpleTypeObject_Check(type))
+ return type->tp_base != &Simple_Type;
+ return 0;
+}
+
+PyObject *
+PyCData_get(PyObject *type, GETFUNC getfunc, PyObject *src,
+ Py_ssize_t index, Py_ssize_t size, char *adr)
+{
+ StgDictObject *dict;
+ if (getfunc)
+ return getfunc(adr, size);
+ assert(type);
+ dict = PyType_stgdict(type);
+ if (dict && dict->getfunc && !_ctypes_simple_instance(type))
+ return dict->getfunc(adr, size);
+ return PyCData_FromBaseObj(type, src, index, adr);
+}
+
+/*
+ Helper function for PyCData_set below.
+*/
+static PyObject *
+_PyCData_set(CDataObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value,
+ Py_ssize_t size, char *ptr)
+{
+ CDataObject *src;
+ int err;
+
+ if (setfunc)
+ return setfunc(ptr, value, size);
+
+ if (!CDataObject_Check(value)) {
+ StgDictObject *dict = PyType_stgdict(type);
+ if (dict && dict->setfunc)
+ return dict->setfunc(ptr, value, size);
+ /*
+ If value is a tuple, we try to call the type with the tuple
+ and use the result!
+ */
+ assert(PyType_Check(type));
+ if (PyTuple_Check(value)) {
+ PyObject *ob;
+ PyObject *result;
+ ob = PyObject_CallObject(type, value);
+ if (ob == NULL) {
+ _ctypes_extend_error(PyExc_RuntimeError, "(%s) ",
+ ((PyTypeObject *)type)->tp_name);
+ return NULL;
+ }
+ result = _PyCData_set(dst, type, setfunc, ob,
+ size, ptr);
+ Py_DECREF(ob);
+ return result;
+ } else if (value == Py_None && PyCPointerTypeObject_Check(type)) {
+ *(void **)ptr = NULL;
+ Py_RETURN_NONE;
+ } else {
+ PyErr_Format(PyExc_TypeError,
+ "expected %s instance, got %s",
+ ((PyTypeObject *)type)->tp_name,
+ Py_TYPE(value)->tp_name);
+ return NULL;
+ }
+ }
+ src = (CDataObject *)value;
+
+ err = PyObject_IsInstance(value, type);
+ if (err == -1)
+ return NULL;
+ if (err) {
+ memcpy(ptr,
+ src->b_ptr,
+ size);
+
+ if (PyCPointerTypeObject_Check(type)) {
+ /* XXX */
+ }
+
+ value = GetKeepedObjects(src);
+ if (value == NULL)
+ return NULL;
+
+ return Py_NewRef(value);
+ }
+
+ if (PyCPointerTypeObject_Check(type)
+ && ArrayObject_Check(value)) {
+ StgDictObject *p1, *p2;
+ PyObject *keep;
+ p1 = PyObject_stgdict(value);
+ assert(p1); /* Cannot be NULL for array instances */
+ p2 = PyType_stgdict(type);
+ assert(p2); /* Cannot be NULL for pointer types */
+
+ if (p1->proto != p2->proto) {
+ PyErr_Format(PyExc_TypeError,
+ "incompatible types, %s instance instead of %s instance",
+ Py_TYPE(value)->tp_name,
+ ((PyTypeObject *)type)->tp_name);
+ return NULL;
+ }
+ *(void **)ptr = src->b_ptr;
+
+ keep = GetKeepedObjects(src);
+ if (keep == NULL)
+ return NULL;
+
+ /*
+ We are assigning an array object to a field which represents
+ a pointer. This has the same effect as converting an array
+ into a pointer. So, again, we have to keep the whole object
+ pointed to (which is the array in this case) alive, and not
+ only it's object list. So we create a tuple, containing
+ b_objects list PLUS the array itself, and return that!
+ */
+ return PyTuple_Pack(2, keep, value);
+ }
+ PyErr_Format(PyExc_TypeError,
+ "incompatible types, %s instance instead of %s instance",
+ Py_TYPE(value)->tp_name,
+ ((PyTypeObject *)type)->tp_name);
+ return NULL;
+}
+
+/*
+ * Set a slice in object 'dst', which has the type 'type',
+ * to the value 'value'.
+ */
+int
+PyCData_set(PyObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value,
+ Py_ssize_t index, Py_ssize_t size, char *ptr)
+{
+ CDataObject *mem = (CDataObject *)dst;
+ PyObject *result;
+
+ if (!CDataObject_Check(dst)) {
+ PyErr_SetString(PyExc_TypeError,
+ "not a ctype instance");
+ return -1;
+ }
+
+ result = _PyCData_set(mem, type, setfunc, value,
+ size, ptr);
+ if (result == NULL)
+ return -1;
+
+ /* KeepRef steals a refcount from it's last argument */
+ /* If KeepRef fails, we are stumped. The dst memory block has already
+ been changed */
+ return KeepRef(mem, index, result);
+}
+
+
+/******************************************************************/
+static PyObject *
+GenericPyCData_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ CDataObject *obj;
+ StgDictObject *dict;
+
+ dict = PyType_stgdict((PyObject *)type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return NULL;
+ }
+ dict->flags |= DICTFLAG_FINAL;
+
+ obj = (CDataObject *)type->tp_alloc(type, 0);
+ if (!obj)
+ return NULL;
+
+ obj->b_base = NULL;
+ obj->b_index = 0;
+ obj->b_objects = NULL;
+ obj->b_length = dict->length;
+
+ if (-1 == PyCData_MallocBuffer(obj, dict)) {
+ Py_DECREF(obj);
+ return NULL;
+ }
+ return (PyObject *)obj;
+}
+/*****************************************************************/
+/*
+ PyCFuncPtr_Type
+*/
+
+static int
+PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
+{
+ if (ob && !PyCallable_Check(ob)) {
+ PyErr_SetString(PyExc_TypeError,
+ "the errcheck attribute must be callable");
+ return -1;
+ }
+ Py_XINCREF(ob);
+ Py_XSETREF(self->errcheck, ob);
+ return 0;
+}
+
+static PyObject *
+PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
+{
+ if (self->errcheck) {
+ return Py_NewRef(self->errcheck);
+ }
+ Py_RETURN_NONE;
+}
+
+static int
+PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
+{
+ PyObject *checker, *oldchecker;
+ if (ob == NULL) {
+ oldchecker = self->checker;
+ self->checker = NULL;
+ Py_CLEAR(self->restype);
+ Py_XDECREF(oldchecker);
+ return 0;
+ }
+ if (ob != Py_None && !PyType_stgdict(ob) && !PyCallable_Check(ob)) {
+ PyErr_SetString(PyExc_TypeError,
+ "restype must be a type, a callable, or None");
+ return -1;
+ }
+ if (_PyObject_LookupAttr(ob, &_Py_ID(_check_retval_), &checker) < 0) {
+ return -1;
+ }
+ oldchecker = self->checker;
+ self->checker = checker;
+ Py_INCREF(ob);
+ Py_XSETREF(self->restype, ob);
+ Py_XDECREF(oldchecker);
+ return 0;
+}
+
+static PyObject *
+PyCFuncPtr_get_restype(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
+{
+ StgDictObject *dict;
+ if (self->restype) {
+ return Py_NewRef(self->restype);
+ }
+ dict = PyObject_stgdict((PyObject *)self);
+ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
+ if (dict->restype) {
+ return Py_NewRef(dict->restype);
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+static int
+PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
+{
+ PyObject *converters;
+
+ if (ob == NULL || ob == Py_None) {
+ Py_CLEAR(self->converters);
+ Py_CLEAR(self->argtypes);
+ } else {
+ converters = converters_from_argtypes(ob);
+ if (!converters)
+ return -1;
+ Py_XSETREF(self->converters, converters);
+ Py_INCREF(ob);
+ Py_XSETREF(self->argtypes, ob);
+ }
+ return 0;
+}
+
+static PyObject *
+PyCFuncPtr_get_argtypes(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
+{
+ StgDictObject *dict;
+ if (self->argtypes) {
+ return Py_NewRef(self->argtypes);
+ }
+ dict = PyObject_stgdict((PyObject *)self);
+ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
+ if (dict->argtypes) {
+ return Py_NewRef(dict->argtypes);
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+static PyGetSetDef PyCFuncPtr_getsets[] = {
+ { "errcheck", (getter)PyCFuncPtr_get_errcheck, (setter)PyCFuncPtr_set_errcheck,
+ "a function to check for errors", NULL },
+ { "restype", (getter)PyCFuncPtr_get_restype, (setter)PyCFuncPtr_set_restype,
+ "specify the result type", NULL },
+ { "argtypes", (getter)PyCFuncPtr_get_argtypes,
+ (setter)PyCFuncPtr_set_argtypes,
+ "specify the argument types", NULL },
+ { NULL, NULL }
+};
+
+#ifdef MS_WIN32
+static PPROC FindAddress(void *handle, const char *name, PyObject *type)
+{
+ PPROC address;
+#ifdef MS_WIN64
+ /* win64 has no stdcall calling conv, so it should
+ also not have the name mangling of it.
+ */
+ Py_BEGIN_ALLOW_THREADS
+ address = (PPROC)GetProcAddress(handle, name);
+ Py_END_ALLOW_THREADS
+ return address;
+#else
+ char *mangled_name;
+ int i;
+ StgDictObject *dict;
+
+ Py_BEGIN_ALLOW_THREADS
+ address = (PPROC)GetProcAddress(handle, name);
+ Py_END_ALLOW_THREADS
+ if (address)
+ return address;
+ if (((size_t)name & ~0xFFFF) == 0) {
+ return NULL;
+ }
+
+ dict = PyType_stgdict((PyObject *)type);
+ /* It should not happen that dict is NULL, but better be safe */
+ if (dict==NULL || dict->flags & FUNCFLAG_CDECL)
+ return address;
+
+ /* for stdcall, try mangled names:
+ funcname -> _funcname@<n>
+ where n is 0, 4, 8, 12, ..., 128
+ */
+ mangled_name = alloca(strlen(name) + 1 + 1 + 1 + 3); /* \0 _ @ %d */
+ if (!mangled_name)
+ return NULL;
+ for (i = 0; i < 32; ++i) {
+ sprintf(mangled_name, "_%s@%d", name, i*4);
+ Py_BEGIN_ALLOW_THREADS
+ address = (PPROC)GetProcAddress(handle, mangled_name);
+ Py_END_ALLOW_THREADS
+ if (address)
+ return address;
+ }
+ return NULL;
+#endif
+}
+#endif
+
+/* Return 1 if usable, 0 else and exception set. */
+static int
+_check_outarg_type(PyObject *arg, Py_ssize_t index)
+{
+ StgDictObject *dict;
+
+ if (PyCPointerTypeObject_Check(arg))
+ return 1;
+
+ if (PyCArrayTypeObject_Check(arg))
+ return 1;
+
+ dict = PyType_stgdict(arg);
+ if (dict
+ /* simple pointer types, c_void_p, c_wchar_p, BSTR, ... */
+ && PyUnicode_Check(dict->proto)
+/* We only allow c_void_p, c_char_p and c_wchar_p as a simple output parameter type */
+ && (strchr("PzZ", PyUnicode_AsUTF8(dict->proto)[0]))) {
+ return 1;
+ }
+
+ PyErr_Format(PyExc_TypeError,
+ "'out' parameter %d must be a pointer type, not %s",
+ Py_SAFE_DOWNCAST(index, Py_ssize_t, int),
+ PyType_Check(arg) ?
+ ((PyTypeObject *)arg)->tp_name :
+ Py_TYPE(arg)->tp_name);
+ return 0;
+}
+
+/* Returns 1 on success, 0 on error */
+static int
+_validate_paramflags(PyTypeObject *type, PyObject *paramflags)
+{
+ Py_ssize_t i, len;
+ StgDictObject *dict;
+ PyObject *argtypes;
+
+ dict = PyType_stgdict((PyObject *)type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return 0;
+ }
+ argtypes = dict->argtypes;
+
+ if (paramflags == NULL || dict->argtypes == NULL)
+ return 1;
+
+ if (!PyTuple_Check(paramflags)) {
+ PyErr_SetString(PyExc_TypeError,
+ "paramflags must be a tuple or None");
+ return 0;
+ }
+
+ len = PyTuple_GET_SIZE(paramflags);
+ if (len != PyTuple_GET_SIZE(dict->argtypes)) {
+ PyErr_SetString(PyExc_ValueError,
+ "paramflags must have the same length as argtypes");
+ return 0;
+ }
+
+ for (i = 0; i < len; ++i) {
+ PyObject *item = PyTuple_GET_ITEM(paramflags, i);
+ int flag;
+ PyObject *name = Py_None;
+ PyObject *defval;
+ PyObject *typ;
+ if (!PyArg_ParseTuple(item, "i|OO", &flag, &name, &defval) ||
+ !(name == Py_None || PyUnicode_Check(name)))
+ {
+ PyErr_SetString(PyExc_TypeError,
+ "paramflags must be a sequence of (int [,string [,value]]) tuples");
+ return 0;
+ }
+ typ = PyTuple_GET_ITEM(argtypes, i);
+ switch (flag & (PARAMFLAG_FIN | PARAMFLAG_FOUT | PARAMFLAG_FLCID)) {
+ case 0:
+ case PARAMFLAG_FIN:
+ case PARAMFLAG_FIN | PARAMFLAG_FLCID:
+ case PARAMFLAG_FIN | PARAMFLAG_FOUT:
+ break;
+ case PARAMFLAG_FOUT:
+ if (!_check_outarg_type(typ, i+1))
+ return 0;
+ break;
+ default:
+ PyErr_Format(PyExc_TypeError,
+ "paramflag value %d not supported",
+ flag);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int
+_get_name(PyObject *obj, const char **pname)
+{
+#ifdef MS_WIN32
+ if (PyLong_Check(obj)) {
+ /* We have to use MAKEINTRESOURCEA for Windows CE.
+ Works on Windows as well, of course.
+ */
+ *pname = MAKEINTRESOURCEA(PyLong_AsUnsignedLongMask(obj) & 0xFFFF);
+ return 1;
+ }
+#endif
+ if (PyBytes_Check(obj)) {
+ *pname = PyBytes_AS_STRING(obj);
+ return *pname ? 1 : 0;
+ }
+ if (PyUnicode_Check(obj)) {
+ *pname = PyUnicode_AsUTF8(obj);
+ return *pname ? 1 : 0;
+ }
+ PyErr_SetString(PyExc_TypeError,
+ "function name must be string, bytes object or integer");
+ return 0;
+}
+
+
+static PyObject *
+PyCFuncPtr_FromDll(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ const char *name;
+ int (* address)(void);
+ PyObject *ftuple;
+ PyObject *dll;
+ PyObject *obj;
+ PyCFuncPtrObject *self;
+ void *handle;
+ PyObject *paramflags = NULL;
+
+ if (!PyArg_ParseTuple(args, "O|O", &ftuple, &paramflags))
+ return NULL;
+ if (paramflags == Py_None)
+ paramflags = NULL;
+
+ ftuple = PySequence_Tuple(ftuple);
+ if (!ftuple)
+ /* Here ftuple is a borrowed reference */
+ return NULL;
+
+ if (!PyArg_ParseTuple(ftuple, "O&O;illegal func_spec argument",
+ _get_name, &name, &dll))
+ {
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+
+#ifdef MS_WIN32
+ if (PySys_Audit("ctypes.dlsym",
+ ((uintptr_t)name & ~0xFFFF) ? "Os" : "On",
+ dll, name) < 0) {
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+#else
+ if (PySys_Audit("ctypes.dlsym", "Os", dll, name) < 0) {
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+#endif
+
+ obj = PyObject_GetAttrString(dll, "_handle");
+ if (!obj) {
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+ if (!PyLong_Check(obj)) {
+ PyErr_SetString(PyExc_TypeError,
+ "the _handle attribute of the second argument must be an integer");
+ Py_DECREF(ftuple);
+ Py_DECREF(obj);
+ return NULL;
+ }
+ handle = (void *)PyLong_AsVoidPtr(obj);
+ Py_DECREF(obj);
+ if (PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ValueError,
+ "could not convert the _handle attribute to a pointer");
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+
+#ifdef MS_WIN32
+ address = FindAddress(handle, name, (PyObject *)type);
+ if (!address) {
+ if (!IS_INTRESOURCE(name))
+ PyErr_Format(PyExc_AttributeError,
+ "function '%s' not found",
+ name);
+ else
+ PyErr_Format(PyExc_AttributeError,
+ "function ordinal %d not found",
+ (WORD)(size_t)name);
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+#else
+ address = (PPROC)dlsym(handle, name);
+ if (!address) {
+#ifdef __CYGWIN__
+/* dlerror() isn't very helpful on cygwin */
+ PyErr_Format(PyExc_AttributeError,
+ "function '%s' not found",
+ name);
+#else
+ PyErr_SetString(PyExc_AttributeError, dlerror());
+#endif
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+#endif
+ if (!_validate_paramflags(type, paramflags)) {
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+
+ self = (PyCFuncPtrObject *)GenericPyCData_new(type, args, kwds);
+ if (!self) {
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+
+ self->paramflags = Py_XNewRef(paramflags);
+
+ *(void **)self->b_ptr = address;
+ Py_INCREF(dll);
+ Py_DECREF(ftuple);
+ if (-1 == KeepRef((CDataObject *)self, 0, dll)) {
+ Py_DECREF((PyObject *)self);
+ return NULL;
+ }
+
+ self->callable = Py_NewRef(self);
+ return (PyObject *)self;
+}
+
+#ifdef MS_WIN32
+static PyObject *
+PyCFuncPtr_FromVtblIndex(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyCFuncPtrObject *self;
+ int index;
+ char *name = NULL;
+ PyObject *paramflags = NULL;
+ GUID *iid = NULL;
+ Py_ssize_t iid_len = 0;
+
+ if (!PyArg_ParseTuple(args, "is|Oz#", &index, &name, &paramflags, &iid, &iid_len))
+ return NULL;
+ if (paramflags == Py_None)
+ paramflags = NULL;
+
+ if (!_validate_paramflags(type, paramflags))
+ return NULL;
+
+ self = (PyCFuncPtrObject *)GenericPyCData_new(type, args, kwds);
+ self->index = index + 0x1000;
+ self->paramflags = Py_XNewRef(paramflags);
+ if (iid_len == sizeof(GUID))
+ self->iid = iid;
+ return (PyObject *)self;
+}
+#endif
+
+/*
+ PyCFuncPtr_new accepts different argument lists in addition to the standard
+ _basespec_ keyword arg:
+
+ one argument form
+ "i" - function address
+ "O" - must be a callable, creates a C callable function
+
+ two or more argument forms (the third argument is a paramflags tuple)
+ "(sO)|..." - (function name, dll object (with an integer handle)), paramflags
+ "(iO)|..." - (function ordinal, dll object (with an integer handle)), paramflags
+ "is|..." - vtable index, method name, creates callable calling COM vtbl
+*/
+static PyObject *
+PyCFuncPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyCFuncPtrObject *self;
+ PyObject *callable;
+ StgDictObject *dict;
+ CThunkObject *thunk;
+
+ if (PyTuple_GET_SIZE(args) == 0)
+ return GenericPyCData_new(type, args, kwds);
+
+ if (1 <= PyTuple_GET_SIZE(args) && PyTuple_Check(PyTuple_GET_ITEM(args, 0)))
+ return PyCFuncPtr_FromDll(type, args, kwds);
+
+#ifdef MS_WIN32
+ if (2 <= PyTuple_GET_SIZE(args) && PyLong_Check(PyTuple_GET_ITEM(args, 0)))
+ return PyCFuncPtr_FromVtblIndex(type, args, kwds);
+#endif
+
+ if (1 == PyTuple_GET_SIZE(args)
+ && (PyLong_Check(PyTuple_GET_ITEM(args, 0)))) {
+ CDataObject *ob;
+ void *ptr = PyLong_AsVoidPtr(PyTuple_GET_ITEM(args, 0));
+ if (ptr == NULL && PyErr_Occurred())
+ return NULL;
+ ob = (CDataObject *)GenericPyCData_new(type, args, kwds);
+ if (ob == NULL)
+ return NULL;
+ *(void **)ob->b_ptr = ptr;
+ return (PyObject *)ob;
+ }
+
+ if (!PyArg_ParseTuple(args, "O", &callable))
+ return NULL;
+ if (!PyCallable_Check(callable)) {
+ PyErr_SetString(PyExc_TypeError,
+ "argument must be callable or integer function address");
+ return NULL;
+ }
+
+ /* XXX XXX This would allow passing additional options. For COM
+ method *implementations*, we would probably want different
+ behaviour than in 'normal' callback functions: return a HRESULT if
+ an exception occurs in the callback, and print the traceback not
+ only on the console, but also to OutputDebugString() or something
+ like that.
+ */
+/*
+ if (kwds && _PyDict_GetItemIdWithError(kwds, &PyId_options)) {
+ ...
+ }
+ else if (PyErr_Occurred()) {
+ return NULL;
+ }
+*/
+
+ dict = PyType_stgdict((PyObject *)type);
+ /* XXXX Fails if we do: 'PyCFuncPtr(lambda x: x)' */
+ if (!dict || !dict->argtypes) {
+ PyErr_SetString(PyExc_TypeError,
+ "cannot construct instance of this class:"
+ " no argtypes");
+ return NULL;
+ }
+
+ thunk = _ctypes_alloc_callback(callable,
+ dict->argtypes,
+ dict->restype,
+ dict->flags);
+ if (!thunk)
+ return NULL;
+
+ self = (PyCFuncPtrObject *)GenericPyCData_new(type, args, kwds);
+ if (self == NULL) {
+ Py_DECREF(thunk);
+ return NULL;
+ }
+
+ self->callable = Py_NewRef(callable);
+
+ self->thunk = thunk;
+ *(void **)self->b_ptr = (void *)thunk->pcl_exec;
+
+ Py_INCREF((PyObject *)thunk); /* for KeepRef */
+ if (-1 == KeepRef((CDataObject *)self, 0, (PyObject *)thunk)) {
+ Py_DECREF((PyObject *)self);
+ return NULL;
+ }
+ return (PyObject *)self;
+}
+
+
+/*
+ _byref consumes a refcount to its argument
+*/
+static PyObject *
+_byref(PyObject *obj)
+{
+ PyCArgObject *parg;
+ if (!CDataObject_Check(obj)) {
+ PyErr_SetString(PyExc_TypeError,
+ "expected CData instance");
+ return NULL;
+ }
+
+ parg = PyCArgObject_new();
+ if (parg == NULL) {
+ Py_DECREF(obj);
+ return NULL;
+ }
+
+ parg->tag = 'P';
+ parg->pffi_type = &ffi_type_pointer;
+ parg->obj = obj;
+ parg->value.p = ((CDataObject *)obj)->b_ptr;
+ return (PyObject *)parg;
+}
+
+static PyObject *
+_get_arg(int *pindex, PyObject *name, PyObject *defval, PyObject *inargs, PyObject *kwds)
+{
+ PyObject *v;
+
+ if (*pindex < PyTuple_GET_SIZE(inargs)) {
+ v = PyTuple_GET_ITEM(inargs, *pindex);
+ ++*pindex;
+ return Py_NewRef(v);
+ }
+ if (kwds && name) {
+ v = PyDict_GetItemWithError(kwds, name);
+ if (v) {
+ ++*pindex;
+ return Py_NewRef(v);
+ }
+ else if (PyErr_Occurred()) {
+ return NULL;
+ }
+ }
+ if (defval) {
+ return Py_NewRef(defval);
+ }
+ /* we can't currently emit a better error message */
+ if (name)
+ PyErr_Format(PyExc_TypeError,
+ "required argument '%S' missing", name);
+ else
+ PyErr_Format(PyExc_TypeError,
+ "not enough arguments");
+ return NULL;
+}
+
+/*
+ This function implements higher level functionality plus the ability to call
+ functions with keyword arguments by looking at parameter flags. parameter
+ flags is a tuple of 1, 2 or 3-tuples. The first entry in each is an integer
+ specifying the direction of the data transfer for this parameter - 'in',
+ 'out' or 'inout' (zero means the same as 'in'). The second entry is the
+ parameter name, and the third is the default value if the parameter is
+ missing in the function call.
+
+ This function builds and returns a new tuple 'callargs' which contains the
+ parameters to use in the call. Items on this tuple are copied from the
+ 'inargs' tuple for 'in' and 'in, out' parameters, and constructed from the
+ 'argtypes' tuple for 'out' parameters. It also calculates numretvals which
+ is the number of return values for the function, outmask/inoutmask are
+ bitmasks containing indexes into the callargs tuple specifying which
+ parameters have to be returned. _build_result builds the return value of the
+ function.
+*/
+static PyObject *
+_build_callargs(PyCFuncPtrObject *self, PyObject *argtypes,
+ PyObject *inargs, PyObject *kwds,
+ int *poutmask, int *pinoutmask, unsigned int *pnumretvals)
+{
+ PyObject *paramflags = self->paramflags;
+ PyObject *callargs;
+ StgDictObject *dict;
+ Py_ssize_t i, len;
+ int inargs_index = 0;
+ /* It's a little bit difficult to determine how many arguments the
+ function call requires/accepts. For simplicity, we count the consumed
+ args and compare this to the number of supplied args. */
+ Py_ssize_t actual_args;
+
+ *poutmask = 0;
+ *pinoutmask = 0;
+ *pnumretvals = 0;
+
+ /* Trivial cases, where we either return inargs itself, or a slice of it. */
+ if (argtypes == NULL || paramflags == NULL || PyTuple_GET_SIZE(argtypes) == 0) {
+#ifdef MS_WIN32
+ if (self->index)
+ return PyTuple_GetSlice(inargs, 1, PyTuple_GET_SIZE(inargs));
+#endif
+ return Py_NewRef(inargs);
+ }
+
+ len = PyTuple_GET_SIZE(argtypes);
+ callargs = PyTuple_New(len); /* the argument tuple we build */
+ if (callargs == NULL)
+ return NULL;
+
+#ifdef MS_WIN32
+ /* For a COM method, skip the first arg */
+ if (self->index) {
+ inargs_index = 1;
+ }
+#endif
+ for (i = 0; i < len; ++i) {
+ PyObject *item = PyTuple_GET_ITEM(paramflags, i);
+ PyObject *ob;
+ unsigned int flag;
+ PyObject *name = NULL;
+ PyObject *defval = NULL;
+
+ /* This way seems to be ~2 us faster than the PyArg_ParseTuple
+ calls below. */
+ /* We HAVE already checked that the tuple can be parsed with "i|ZO", so... */
+ Py_ssize_t tsize = PyTuple_GET_SIZE(item);
+ flag = PyLong_AsUnsignedLongMask(PyTuple_GET_ITEM(item, 0));
+ name = tsize > 1 ? PyTuple_GET_ITEM(item, 1) : NULL;
+ defval = tsize > 2 ? PyTuple_GET_ITEM(item, 2) : NULL;
+
+ switch (flag & (PARAMFLAG_FIN | PARAMFLAG_FOUT | PARAMFLAG_FLCID)) {
+ case PARAMFLAG_FIN | PARAMFLAG_FLCID:
+ /* ['in', 'lcid'] parameter. Always taken from defval,
+ if given, else the integer 0. */
+ if (defval == NULL) {
+ defval = _PyLong_GetZero();
+ }
+ Py_INCREF(defval);
+ PyTuple_SET_ITEM(callargs, i, defval);
+ break;
+ case (PARAMFLAG_FIN | PARAMFLAG_FOUT):
+ *pinoutmask |= (1 << i); /* mark as inout arg */
+ (*pnumretvals)++;
+ /* fall through */
+ case 0:
+ case PARAMFLAG_FIN:
+ /* 'in' parameter. Copy it from inargs. */
+ ob =_get_arg(&inargs_index, name, defval, inargs, kwds);
+ if (ob == NULL)
+ goto error;
+ PyTuple_SET_ITEM(callargs, i, ob);
+ break;
+ case PARAMFLAG_FOUT:
+ /* XXX Refactor this code into a separate function. */
+ /* 'out' parameter.
+ argtypes[i] must be a POINTER to a c type.
+
+ Cannot by supplied in inargs, but a defval will be used
+ if available. XXX Should we support getting it from kwds?
+ */
+ if (defval) {
+ /* XXX Using mutable objects as defval will
+ make the function non-threadsafe, unless we
+ copy the object in each invocation */
+ Py_INCREF(defval);
+ PyTuple_SET_ITEM(callargs, i, defval);
+ *poutmask |= (1 << i); /* mark as out arg */
+ (*pnumretvals)++;
+ break;
+ }
+ ob = PyTuple_GET_ITEM(argtypes, i);
+ dict = PyType_stgdict(ob);
+ if (dict == NULL) {
+ /* Cannot happen: _validate_paramflags()
+ would not accept such an object */
+ PyErr_Format(PyExc_RuntimeError,
+ "NULL stgdict unexpected");
+ goto error;
+ }
+ if (PyUnicode_Check(dict->proto)) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "%s 'out' parameter must be passed as default value",
+ ((PyTypeObject *)ob)->tp_name);
+ goto error;
+ }
+ if (PyCArrayTypeObject_Check(ob))
+ ob = _PyObject_CallNoArgs(ob);
+ else
+ /* Create an instance of the pointed-to type */
+ ob = _PyObject_CallNoArgs(dict->proto);
+ /*
+ XXX Is the following correct any longer?
+ We must not pass a byref() to the array then but
+ the array instance itself. Then, we cannot retrieve
+ the result from the PyCArgObject.
+ */
+ if (ob == NULL)
+ goto error;
+ /* The .from_param call that will occur later will pass this
+ as a byref parameter. */
+ PyTuple_SET_ITEM(callargs, i, ob);
+ *poutmask |= (1 << i); /* mark as out arg */
+ (*pnumretvals)++;
+ break;
+ default:
+ PyErr_Format(PyExc_ValueError,
+ "paramflag %u not yet implemented", flag);
+ goto error;
+ break;
+ }
+ }
+
+ /* We have counted the arguments we have consumed in 'inargs_index'. This
+ must be the same as len(inargs) + len(kwds), otherwise we have
+ either too much or not enough arguments. */
+
+ actual_args = PyTuple_GET_SIZE(inargs) + (kwds ? PyDict_GET_SIZE(kwds) : 0);
+ if (actual_args != inargs_index) {
+ /* When we have default values or named parameters, this error
+ message is misleading. See unittests/test_paramflags.py
+ */
+ PyErr_Format(PyExc_TypeError,
+ "call takes exactly %d arguments (%zd given)",
+ inargs_index, actual_args);
+ goto error;
+ }
+
+ /* outmask is a bitmask containing indexes into callargs. Items at
+ these indexes contain values to return.
+ */
+ return callargs;
+ error:
+ Py_DECREF(callargs);
+ return NULL;
+}
+
+/* See also:
+ http://msdn.microsoft.com/library/en-us/com/html/769127a1-1a14-4ed4-9d38-7cf3e571b661.asp
+*/
+/*
+ Build return value of a function.
+
+ Consumes the refcount on result and callargs.
+*/
+static PyObject *
+_build_result(PyObject *result, PyObject *callargs,
+ int outmask, int inoutmask, unsigned int numretvals)
+{
+ unsigned int i, index;
+ int bit;
+ PyObject *tup = NULL;
+
+ if (callargs == NULL)
+ return result;
+ if (result == NULL || numretvals == 0) {
+ Py_DECREF(callargs);
+ return result;
+ }
+ Py_DECREF(result);
+
+ /* tup will not be allocated if numretvals == 1 */
+ /* allocate tuple to hold the result */
+ if (numretvals > 1) {
+ tup = PyTuple_New(numretvals);
+ if (tup == NULL) {
+ Py_DECREF(callargs);
+ return NULL;
+ }
+ }
+
+ index = 0;
+ for (bit = 1, i = 0; i < 32; ++i, bit <<= 1) {
+ PyObject *v;
+ if (bit & inoutmask) {
+ v = PyTuple_GET_ITEM(callargs, i);
+ Py_INCREF(v);
+ if (numretvals == 1) {
+ Py_DECREF(callargs);
+ return v;
+ }
+ PyTuple_SET_ITEM(tup, index, v);
+ index++;
+ } else if (bit & outmask) {
+
+ v = PyTuple_GET_ITEM(callargs, i);
+ v = PyObject_CallMethodNoArgs(v, &_Py_ID(__ctypes_from_outparam__));
+ if (v == NULL || numretvals == 1) {
+ Py_DECREF(callargs);
+ return v;
+ }
+ PyTuple_SET_ITEM(tup, index, v);
+ index++;
+ }
+ if (index == numretvals)
+ break;
+ }
+
+ Py_DECREF(callargs);
+ return tup;
+}
+
+static PyObject *
+PyCFuncPtr_call(PyCFuncPtrObject *self, PyObject *inargs, PyObject *kwds)
+{
+ PyObject *restype;
+ PyObject *converters;
+ PyObject *checker;
+ PyObject *argtypes;
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
+ PyObject *result;
+ PyObject *callargs;
+ PyObject *errcheck;
+#ifdef MS_WIN32
+ IUnknown *piunk = NULL;
+#endif
+ void *pProc = NULL;
+
+ int inoutmask;
+ int outmask;
+ unsigned int numretvals;
+
+ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
+ restype = self->restype ? self->restype : dict->restype;
+ converters = self->converters ? self->converters : dict->converters;
+ checker = self->checker ? self->checker : dict->checker;
+ argtypes = self->argtypes ? self->argtypes : dict->argtypes;
+/* later, we probably want to have an errcheck field in stgdict */
+ errcheck = self->errcheck /* ? self->errcheck : dict->errcheck */;
+
+
+ pProc = *(void **)self->b_ptr;
+#ifdef MS_WIN32
+ if (self->index) {
+ /* It's a COM method */
+ CDataObject *this;
+ this = (CDataObject *)PyTuple_GetItem(inargs, 0); /* borrowed ref! */
+ if (!this) {
+ PyErr_SetString(PyExc_ValueError,
+ "native com method call without 'this' parameter");
+ return NULL;
+ }
+ if (!CDataObject_Check(this)) {
+ PyErr_SetString(PyExc_TypeError,
+ "Expected a COM this pointer as first argument");
+ return NULL;
+ }
+ /* there should be more checks? No, in Python */
+ /* First arg is a pointer to an interface instance */
+ if (!this->b_ptr || *(void **)this->b_ptr == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "NULL COM pointer access");
+ return NULL;
+ }
+ piunk = *(IUnknown **)this->b_ptr;
+ if (NULL == piunk->lpVtbl) {
+ PyErr_SetString(PyExc_ValueError,
+ "COM method call without VTable");
+ return NULL;
+ }
+ pProc = ((void **)piunk->lpVtbl)[self->index - 0x1000];
+ }
+#endif
+ callargs = _build_callargs(self, argtypes,
+ inargs, kwds,
+ &outmask, &inoutmask, &numretvals);
+ if (callargs == NULL)
+ return NULL;
+
+ if (converters) {
+ int required = Py_SAFE_DOWNCAST(PyTuple_GET_SIZE(converters),
+ Py_ssize_t, int);
+ int actual = Py_SAFE_DOWNCAST(PyTuple_GET_SIZE(callargs),
+ Py_ssize_t, int);
+
+ if ((dict->flags & FUNCFLAG_CDECL) == FUNCFLAG_CDECL) {
+ /* For cdecl functions, we allow more actual arguments
+ than the length of the argtypes tuple.
+ */
+ if (required > actual) {
+ Py_DECREF(callargs);
+ PyErr_Format(PyExc_TypeError,
+ "this function takes at least %d argument%s (%d given)",
+ required,
+ required == 1 ? "" : "s",
+ actual);
+ return NULL;
+ }
+ } else if (required != actual) {
+ Py_DECREF(callargs);
+ PyErr_Format(PyExc_TypeError,
+ "this function takes %d argument%s (%d given)",
+ required,
+ required == 1 ? "" : "s",
+ actual);
+ return NULL;
+ }
+ }
+
+ result = _ctypes_callproc(pProc,
+ callargs,
+#ifdef MS_WIN32
+ piunk,
+ self->iid,
+#endif
+ dict->flags,
+ converters,
+ restype,
+ checker);
+/* The 'errcheck' protocol */
+ if (result != NULL && errcheck) {
+ PyObject *v = PyObject_CallFunctionObjArgs(errcheck,
+ result,
+ self,
+ callargs,
+ NULL);
+ /* If the errcheck function failed, return NULL.
+ If the errcheck function returned callargs unchanged,
+ continue normal processing.
+ If the errcheck function returned something else,
+ use that as result.
+ */
+ if (v == NULL || v != callargs) {
+ Py_DECREF(result);
+ Py_DECREF(callargs);
+ return v;
+ }
+ Py_DECREF(v);
+ }
+
+ return _build_result(result, callargs,
+ outmask, inoutmask, numretvals);
+}
+
+static int
+PyCFuncPtr_traverse(PyCFuncPtrObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->callable);
+ Py_VISIT(self->restype);
+ Py_VISIT(self->checker);
+ Py_VISIT(self->errcheck);
+ Py_VISIT(self->argtypes);
+ Py_VISIT(self->converters);
+ Py_VISIT(self->paramflags);
+ Py_VISIT(self->thunk);
+ return PyCData_traverse((CDataObject *)self, visit, arg);
+}
+
+static int
+PyCFuncPtr_clear(PyCFuncPtrObject *self)
+{
+ Py_CLEAR(self->callable);
+ Py_CLEAR(self->restype);
+ Py_CLEAR(self->checker);
+ Py_CLEAR(self->errcheck);
+ Py_CLEAR(self->argtypes);
+ Py_CLEAR(self->converters);
+ Py_CLEAR(self->paramflags);
+ Py_CLEAR(self->thunk);
+ return PyCData_clear((CDataObject *)self);
+}
+
+static void
+PyCFuncPtr_dealloc(PyCFuncPtrObject *self)
+{
+ PyCFuncPtr_clear(self);
+ Py_TYPE(self)->tp_free((PyObject *)self);
+}
+
+static PyObject *
+PyCFuncPtr_repr(PyCFuncPtrObject *self)
+{
+#ifdef MS_WIN32
+ if (self->index)
+ return PyUnicode_FromFormat("<COM method offset %d: %s at %p>",
+ self->index - 0x1000,
+ Py_TYPE(self)->tp_name,
+ self);
+#endif
+ return PyUnicode_FromFormat("<%s object at %p>",
+ Py_TYPE(self)->tp_name,
+ self);
+}
+
+static int
+PyCFuncPtr_bool(PyCFuncPtrObject *self)
+{
+ return ((*(void **)self->b_ptr != NULL)
+#ifdef MS_WIN32
+ || (self->index != 0)
+#endif
+ );
+}
+
+static PyNumberMethods PyCFuncPtr_as_number = {
+ 0, /* nb_add */
+ 0, /* nb_subtract */
+ 0, /* nb_multiply */
+ 0, /* nb_remainder */
+ 0, /* nb_divmod */
+ 0, /* nb_power */
+ 0, /* nb_negative */
+ 0, /* nb_positive */
+ 0, /* nb_absolute */
+ (inquiry)PyCFuncPtr_bool, /* nb_bool */
+};
+
+PyTypeObject PyCFuncPtr_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.CFuncPtr",
+ sizeof(PyCFuncPtrObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ (destructor)PyCFuncPtr_dealloc, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ (reprfunc)PyCFuncPtr_repr, /* tp_repr */
+ &PyCFuncPtr_as_number, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ (ternaryfunc)PyCFuncPtr_call, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("Function Pointer"), /* tp_doc */
+ (traverseproc)PyCFuncPtr_traverse, /* tp_traverse */
+ (inquiry)PyCFuncPtr_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ PyCFuncPtr_getsets, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ PyCFuncPtr_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+/*****************************************************************/
+/*
+ Struct_Type
+*/
+/*
+ This function is called to initialize a Structure or Union with positional
+ arguments. It calls itself recursively for all Structure or Union base
+ classes, then retrieves the _fields_ member to associate the argument
+ position with the correct field name.
+
+ Returns -1 on error, or the index of next argument on success.
+ */
+static Py_ssize_t
+_init_pos_args(PyObject *self, PyTypeObject *type,
+ PyObject *args, PyObject *kwds,
+ Py_ssize_t index)
+{
+ StgDictObject *dict;
+ PyObject *fields;
+ Py_ssize_t i;
+
+ if (PyType_stgdict((PyObject *)type->tp_base)) {
+ index = _init_pos_args(self, type->tp_base,
+ args, kwds,
+ index);
+ if (index == -1)
+ return -1;
+ }
+
+ dict = PyType_stgdict((PyObject *)type);
+ fields = PyDict_GetItemWithError((PyObject *)dict, &_Py_ID(_fields_));
+ if (fields == NULL) {
+ if (PyErr_Occurred()) {
+ return -1;
+ }
+ return index;
+ }
+
+ for (i = index;
+ i < dict->length && i < PyTuple_GET_SIZE(args);
+ ++i) {
+ PyObject *pair = PySequence_GetItem(fields, i - index);
+ PyObject *name, *val;
+ int res;
+ if (!pair)
+ return -1;
+ name = PySequence_GetItem(pair, 0);
+ if (!name) {
+ Py_DECREF(pair);
+ return -1;
+ }
+ val = PyTuple_GET_ITEM(args, i);
+ if (kwds) {
+ res = PyDict_Contains(kwds, name);
+ if (res != 0) {
+ if (res > 0) {
+ PyErr_Format(PyExc_TypeError,
+ "duplicate values for field %R",
+ name);
+ }
+ Py_DECREF(pair);
+ Py_DECREF(name);
+ return -1;
+ }
+ }
+
+ res = PyObject_SetAttr(self, name, val);
+ Py_DECREF(pair);
+ Py_DECREF(name);
+ if (res == -1)
+ return -1;
+ }
+ return dict->length;
+}
+
+static int
+Struct_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+/* Optimization possible: Store the attribute names _fields_[x][0]
+ * in C accessible fields somewhere ?
+ */
+ if (!PyTuple_Check(args)) {
+ PyErr_SetString(PyExc_TypeError,
+ "args not a tuple?");
+ return -1;
+ }
+ if (PyTuple_GET_SIZE(args)) {
+ Py_ssize_t res = _init_pos_args(self, Py_TYPE(self),
+ args, kwds, 0);
+ if (res == -1)
+ return -1;
+ if (res < PyTuple_GET_SIZE(args)) {
+ PyErr_SetString(PyExc_TypeError,
+ "too many initializers");
+ return -1;
+ }
+ }
+
+ if (kwds) {
+ PyObject *key, *value;
+ Py_ssize_t pos = 0;
+ while(PyDict_Next(kwds, &pos, &key, &value)) {
+ if (-1 == PyObject_SetAttr(self, key, value))
+ return -1;
+ }
+ }
+ return 0;
+}
+
+static PyTypeObject Struct_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.Structure",
+ sizeof(CDataObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("Structure base class"), /* tp_doc */
+ (traverseproc)PyCData_traverse, /* tp_traverse */
+ (inquiry)PyCData_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ Struct_init, /* tp_init */
+ 0, /* tp_alloc */
+ GenericPyCData_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+static PyTypeObject Union_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.Union",
+ sizeof(CDataObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("Union base class"), /* tp_doc */
+ (traverseproc)PyCData_traverse, /* tp_traverse */
+ (inquiry)PyCData_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ Struct_init, /* tp_init */
+ 0, /* tp_alloc */
+ GenericPyCData_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+
+/******************************************************************/
+/*
+ PyCArray_Type
+*/
+static int
+Array_init(CDataObject *self, PyObject *args, PyObject *kw)
+{
+ Py_ssize_t i;
+ Py_ssize_t n;
+
+ if (!PyTuple_Check(args)) {
+ PyErr_SetString(PyExc_TypeError,
+ "args not a tuple?");
+ return -1;
+ }
+ n = PyTuple_GET_SIZE(args);
+ for (i = 0; i < n; ++i) {
+ PyObject *v;
+ v = PyTuple_GET_ITEM(args, i);
+ if (-1 == PySequence_SetItem((PyObject *)self, i, v))
+ return -1;
+ }
+ return 0;
+}
+
+static PyObject *
+Array_item(PyObject *myself, Py_ssize_t index)
+{
+ CDataObject *self = (CDataObject *)myself;
+ Py_ssize_t offset, size;
+ StgDictObject *stgdict;
+
+
+ if (index < 0 || index >= self->b_length) {
+ PyErr_SetString(PyExc_IndexError,
+ "invalid index");
+ return NULL;
+ }
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for array instances */
+ /* Would it be clearer if we got the item size from
+ stgdict->proto's stgdict?
+ */
+ size = stgdict->size / stgdict->length;
+ offset = index * size;
+
+ return PyCData_get(stgdict->proto, stgdict->getfunc, (PyObject *)self,
+ index, size, self->b_ptr + offset);
+}
+
+static PyObject *
+Array_subscript(PyObject *myself, PyObject *item)
+{
+ CDataObject *self = (CDataObject *)myself;
+
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+
+ if (i == -1 && PyErr_Occurred())
+ return NULL;
+ if (i < 0)
+ i += self->b_length;
+ return Array_item(myself, i);
+ }
+ else if (PySlice_Check(item)) {
+ StgDictObject *stgdict, *itemdict;
+ PyObject *proto;
+ PyObject *np;
+ Py_ssize_t start, stop, step, slicelen, i;
+ size_t cur;
+
+ if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
+ return NULL;
+ }
+ slicelen = PySlice_AdjustIndices(self->b_length, &start, &stop, step);
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for array object instances */
+ proto = stgdict->proto;
+ itemdict = PyType_stgdict(proto);
+ assert(itemdict); /* proto is the item type of the array, a
+ ctypes type, so this cannot be NULL */
+
+ if (itemdict->getfunc == _ctypes_get_fielddesc("c")->getfunc) {
+ char *ptr = (char *)self->b_ptr;
+ char *dest;
+
+ if (slicelen <= 0)
+ return PyBytes_FromStringAndSize("", 0);
+ if (step == 1) {
+ return PyBytes_FromStringAndSize(ptr + start,
+ slicelen);
+ }
+ dest = (char *)PyMem_Malloc(slicelen);
+
+ if (dest == NULL)
+ return PyErr_NoMemory();
+
+ for (cur = start, i = 0; i < slicelen;
+ cur += step, i++) {
+ dest[i] = ptr[cur];
+ }
+
+ np = PyBytes_FromStringAndSize(dest, slicelen);
+ PyMem_Free(dest);
+ return np;
+ }
+ if (itemdict->getfunc == _ctypes_get_fielddesc("u")->getfunc) {
+ wchar_t *ptr = (wchar_t *)self->b_ptr;
+ wchar_t *dest;
+
+ if (slicelen <= 0)
+ return PyUnicode_New(0, 0);
+ if (step == 1) {
+ return PyUnicode_FromWideChar(ptr + start,
+ slicelen);
+ }
+
+ dest = PyMem_New(wchar_t, slicelen);
+ if (dest == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ for (cur = start, i = 0; i < slicelen;
+ cur += step, i++) {
+ dest[i] = ptr[cur];
+ }
+
+ np = PyUnicode_FromWideChar(dest, slicelen);
+ PyMem_Free(dest);
+ return np;
+ }
+
+ np = PyList_New(slicelen);
+ if (np == NULL)
+ return NULL;
+
+ for (cur = start, i = 0; i < slicelen;
+ cur += step, i++) {
+ PyObject *v = Array_item(myself, cur);
+ if (v == NULL) {
+ Py_DECREF(np);
+ return NULL;
+ }
+ PyList_SET_ITEM(np, i, v);
+ }
+ return np;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "indices must be integers");
+ return NULL;
+ }
+
+}
+
+static int
+Array_ass_item(PyObject *myself, Py_ssize_t index, PyObject *value)
+{
+ CDataObject *self = (CDataObject *)myself;
+ Py_ssize_t size, offset;
+ StgDictObject *stgdict;
+ char *ptr;
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "Array does not support item deletion");
+ return -1;
+ }
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for array object instances */
+ if (index < 0 || index >= stgdict->length) {
+ PyErr_SetString(PyExc_IndexError,
+ "invalid index");
+ return -1;
+ }
+ size = stgdict->size / stgdict->length;
+ offset = index * size;
+ ptr = self->b_ptr + offset;
+
+ return PyCData_set((PyObject *)self, stgdict->proto, stgdict->setfunc, value,
+ index, size, ptr);
+}
+
+static int
+Array_ass_subscript(PyObject *myself, PyObject *item, PyObject *value)
+{
+ CDataObject *self = (CDataObject *)myself;
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "Array does not support item deletion");
+ return -1;
+ }
+
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+
+ if (i == -1 && PyErr_Occurred())
+ return -1;
+ if (i < 0)
+ i += self->b_length;
+ return Array_ass_item(myself, i, value);
+ }
+ else if (PySlice_Check(item)) {
+ Py_ssize_t start, stop, step, slicelen, otherlen, i;
+ size_t cur;
+
+ if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
+ return -1;
+ }
+ slicelen = PySlice_AdjustIndices(self->b_length, &start, &stop, step);
+ if ((step < 0 && start < stop) ||
+ (step > 0 && start > stop))
+ stop = start;
+
+ otherlen = PySequence_Length(value);
+ if (otherlen != slicelen) {
+ PyErr_SetString(PyExc_ValueError,
+ "Can only assign sequence of same size");
+ return -1;
+ }
+ for (cur = start, i = 0; i < otherlen; cur += step, i++) {
+ PyObject *item = PySequence_GetItem(value, i);
+ int result;
+ if (item == NULL)
+ return -1;
+ result = Array_ass_item(myself, cur, item);
+ Py_DECREF(item);
+ if (result == -1)
+ return -1;
+ }
+ return 0;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "indices must be integer");
+ return -1;
+ }
+}
+
+static Py_ssize_t
+Array_length(PyObject *myself)
+{
+ CDataObject *self = (CDataObject *)myself;
+ return self->b_length;
+}
+
+static PyMethodDef Array_methods[] = {
+ {"__class_getitem__", Py_GenericAlias,
+ METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
+ { NULL, NULL }
+};
+
+static PySequenceMethods Array_as_sequence = {
+ Array_length, /* sq_length; */
+ 0, /* sq_concat; */
+ 0, /* sq_repeat; */
+ Array_item, /* sq_item; */
+ 0, /* sq_slice; */
+ Array_ass_item, /* sq_ass_item; */
+ 0, /* sq_ass_slice; */
+ 0, /* sq_contains; */
+
+ 0, /* sq_inplace_concat; */
+ 0, /* sq_inplace_repeat; */
+};
+
+static PyMappingMethods Array_as_mapping = {
+ Array_length,
+ Array_subscript,
+ Array_ass_subscript,
+};
+
+PyTypeObject PyCArray_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.Array",
+ sizeof(CDataObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &Array_as_sequence, /* tp_as_sequence */
+ &Array_as_mapping, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("XXX to be provided"), /* tp_doc */
+ (traverseproc)PyCData_traverse, /* tp_traverse */
+ (inquiry)PyCData_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ Array_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)Array_init, /* tp_init */
+ 0, /* tp_alloc */
+ GenericPyCData_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+PyObject *
+PyCArrayType_from_ctype(PyObject *itemtype, Py_ssize_t length)
+{
+ static PyObject *cache;
+ PyObject *key;
+ PyObject *result;
+ char name[256];
+ PyObject *len;
+
+ if (cache == NULL) {
+ cache = PyDict_New();
+ if (cache == NULL)
+ return NULL;
+ }
+ len = PyLong_FromSsize_t(length);
+ if (len == NULL)
+ return NULL;
+ key = PyTuple_Pack(2, itemtype, len);
+ Py_DECREF(len);
+ if (!key)
+ return NULL;
+ result = PyDict_GetItemProxy(cache, key);
+ if (result) {
+ Py_INCREF(result);
+ Py_DECREF(key);
+ return result;
+ }
+ else if (PyErr_Occurred()) {
+ Py_DECREF(key);
+ return NULL;
+ }
+
+ if (!PyType_Check(itemtype)) {
+ PyErr_SetString(PyExc_TypeError,
+ "Expected a type object");
+ Py_DECREF(key);
+ return NULL;
+ }
+#ifdef MS_WIN64
+ sprintf(name, "%.200s_Array_%Id",
+ ((PyTypeObject *)itemtype)->tp_name, length);
+#else
+ sprintf(name, "%.200s_Array_%ld",
+ ((PyTypeObject *)itemtype)->tp_name, (long)length);
+#endif
+
+ result = PyObject_CallFunction((PyObject *)&PyCArrayType_Type,
+ "s(O){s:n,s:O}",
+ name,
+ &PyCArray_Type,
+ "_length_",
+ length,
+ "_type_",
+ itemtype
+ );
+ if (result == NULL) {
+ Py_DECREF(key);
+ return NULL;
+ }
+ if (-1 == PyDict_SetItemProxy(cache, key, result)) {
+ Py_DECREF(key);
+ Py_DECREF(result);
+ return NULL;
+ }
+ Py_DECREF(key);
+ return result;
+}
+
+
+/******************************************************************/
+/*
+ Simple_Type
+*/
+
+static int
+Simple_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
+{
+ PyObject *result;
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "can't delete attribute");
+ return -1;
+ }
+ assert(dict); /* Cannot be NULL for CDataObject instances */
+ assert(dict->setfunc);
+ result = dict->setfunc(self->b_ptr, value, dict->size);
+ if (!result)
+ return -1;
+
+ /* consumes the refcount the setfunc returns */
+ return KeepRef(self, 0, result);
+}
+
+static int
+Simple_init(CDataObject *self, PyObject *args, PyObject *kw)
+{
+ PyObject *value = NULL;
+ if (!PyArg_UnpackTuple(args, "__init__", 0, 1, &value))
+ return -1;
+ if (value)
+ return Simple_set_value(self, value, NULL);
+ return 0;
+}
+
+static PyObject *
+Simple_get_value(CDataObject *self, void *Py_UNUSED(ignored))
+{
+ StgDictObject *dict;
+ dict = PyObject_stgdict((PyObject *)self);
+ assert(dict); /* Cannot be NULL for CDataObject instances */
+ assert(dict->getfunc);
+ return dict->getfunc(self->b_ptr, self->b_size);
+}
+
+static PyGetSetDef Simple_getsets[] = {
+ { "value", (getter)Simple_get_value, (setter)Simple_set_value,
+ "current value", NULL },
+ { NULL, NULL }
+};
+
+static PyObject *
+Simple_from_outparm(PyObject *self, PyObject *args)
+{
+ if (_ctypes_simple_instance((PyObject *)Py_TYPE(self))) {
+ return Py_NewRef(self);
+ }
+ /* call stgdict->getfunc */
+ return Simple_get_value((CDataObject *)self, NULL);
+}
+
+static PyMethodDef Simple_methods[] = {
+ { "__ctypes_from_outparam__", Simple_from_outparm, METH_NOARGS, },
+ { NULL, NULL },
+};
+
+static int Simple_bool(CDataObject *self)
+{
+ return memcmp(self->b_ptr, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", self->b_size);
+}
+
+static PyNumberMethods Simple_as_number = {
+ 0, /* nb_add */
+ 0, /* nb_subtract */
+ 0, /* nb_multiply */
+ 0, /* nb_remainder */
+ 0, /* nb_divmod */
+ 0, /* nb_power */
+ 0, /* nb_negative */
+ 0, /* nb_positive */
+ 0, /* nb_absolute */
+ (inquiry)Simple_bool, /* nb_bool */
+};
+
+/* "%s(%s)" % (self.__class__.__name__, self.value) */
+static PyObject *
+Simple_repr(CDataObject *self)
+{
+ PyObject *val, *result;
+
+ if (Py_TYPE(self)->tp_base != &Simple_Type) {
+ return PyUnicode_FromFormat("<%s object at %p>",
+ Py_TYPE(self)->tp_name, self);
+ }
+
+ val = Simple_get_value(self, NULL);
+ if (val == NULL)
+ return NULL;
+
+ result = PyUnicode_FromFormat("%s(%R)",
+ Py_TYPE(self)->tp_name, val);
+ Py_DECREF(val);
+ return result;
+}
+
+static PyTypeObject Simple_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes._SimpleCData",
+ sizeof(CDataObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ (reprfunc)&Simple_repr, /* tp_repr */
+ &Simple_as_number, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("XXX to be provided"), /* tp_doc */
+ (traverseproc)PyCData_traverse, /* tp_traverse */
+ (inquiry)PyCData_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ Simple_methods, /* tp_methods */
+ 0, /* tp_members */
+ Simple_getsets, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)Simple_init, /* tp_init */
+ 0, /* tp_alloc */
+ GenericPyCData_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+/******************************************************************/
+/*
+ PyCPointer_Type
+*/
+static PyObject *
+Pointer_item(PyObject *myself, Py_ssize_t index)
+{
+ CDataObject *self = (CDataObject *)myself;
+ Py_ssize_t size;
+ Py_ssize_t offset;
+ StgDictObject *stgdict, *itemdict;
+ PyObject *proto;
+
+ if (*(void **)self->b_ptr == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "NULL pointer access");
+ return NULL;
+ }
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for pointer object instances */
+
+ proto = stgdict->proto;
+ assert(proto);
+ itemdict = PyType_stgdict(proto);
+ assert(itemdict); /* proto is the item type of the pointer, a ctypes
+ type, so this cannot be NULL */
+
+ size = itemdict->size;
+ offset = index * itemdict->size;
+
+ return PyCData_get(proto, stgdict->getfunc, (PyObject *)self,
+ index, size, (*(char **)self->b_ptr) + offset);
+}
+
+static int
+Pointer_ass_item(PyObject *myself, Py_ssize_t index, PyObject *value)
+{
+ CDataObject *self = (CDataObject *)myself;
+ Py_ssize_t size;
+ Py_ssize_t offset;
+ StgDictObject *stgdict, *itemdict;
+ PyObject *proto;
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "Pointer does not support item deletion");
+ return -1;
+ }
+
+ if (*(void **)self->b_ptr == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "NULL pointer access");
+ return -1;
+ }
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for pointer instances */
+
+ proto = stgdict->proto;
+ assert(proto);
+
+ itemdict = PyType_stgdict(proto);
+ assert(itemdict); /* Cannot be NULL because the itemtype of a pointer
+ is always a ctypes type */
+
+ size = itemdict->size;
+ offset = index * itemdict->size;
+
+ return PyCData_set((PyObject *)self, proto, stgdict->setfunc, value,
+ index, size, (*(char **)self->b_ptr) + offset);
+}
+
+static PyObject *
+Pointer_get_contents(CDataObject *self, void *closure)
+{
+ StgDictObject *stgdict;
+
+ if (*(void **)self->b_ptr == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "NULL pointer access");
+ return NULL;
+ }
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for pointer instances */
+ return PyCData_FromBaseObj(stgdict->proto,
+ (PyObject *)self, 0,
+ *(void **)self->b_ptr);
+}
+
+static int
+Pointer_set_contents(CDataObject *self, PyObject *value, void *closure)
+{
+ StgDictObject *stgdict;
+ CDataObject *dst;
+ PyObject *keep;
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "Pointer does not support item deletion");
+ return -1;
+ }
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for pointer instances */
+ assert(stgdict->proto);
+ if (!CDataObject_Check(value)) {
+ int res = PyObject_IsInstance(value, stgdict->proto);
+ if (res == -1)
+ return -1;
+ if (!res) {
+ PyErr_Format(PyExc_TypeError,
+ "expected %s instead of %s",
+ ((PyTypeObject *)(stgdict->proto))->tp_name,
+ Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ }
+
+ dst = (CDataObject *)value;
+ *(void **)self->b_ptr = dst->b_ptr;
+
+ /*
+ A Pointer instance must keep the value it points to alive. So, a
+ pointer instance has b_length set to 2 instead of 1, and we set
+ 'value' itself as the second item of the b_objects list, additionally.
+ */
+ Py_INCREF(value);
+ if (-1 == KeepRef(self, 1, value))
+ return -1;
+
+ keep = GetKeepedObjects(dst);
+ if (keep == NULL)
+ return -1;
+
+ Py_INCREF(keep);
+ return KeepRef(self, 0, keep);
+}
+
+static PyGetSetDef Pointer_getsets[] = {
+ { "contents", (getter)Pointer_get_contents,
+ (setter)Pointer_set_contents,
+ "the object this pointer points to (read-write)", NULL },
+ { NULL, NULL }
+};
+
+static int
+Pointer_init(CDataObject *self, PyObject *args, PyObject *kw)
+{
+ PyObject *value = NULL;
+
+ if (!PyArg_UnpackTuple(args, "POINTER", 0, 1, &value))
+ return -1;
+ if (value == NULL)
+ return 0;
+ return Pointer_set_contents(self, value, NULL);
+}
+
+static PyObject *
+Pointer_new(PyTypeObject *type, PyObject *args, PyObject *kw)
+{
+ StgDictObject *dict = PyType_stgdict((PyObject *)type);
+ if (!dict || !dict->proto) {
+ PyErr_SetString(PyExc_TypeError,
+ "Cannot create instance: has no _type_");
+ return NULL;
+ }
+ return GenericPyCData_new(type, args, kw);
+}
+
+static PyObject *
+Pointer_subscript(PyObject *myself, PyObject *item)
+{
+ CDataObject *self = (CDataObject *)myself;
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+ if (i == -1 && PyErr_Occurred())
+ return NULL;
+ return Pointer_item(myself, i);
+ }
+ else if (PySlice_Check(item)) {
+ PySliceObject *slice = (PySliceObject *)item;
+ Py_ssize_t start, stop, step;
+ PyObject *np;
+ StgDictObject *stgdict, *itemdict;
+ PyObject *proto;
+ Py_ssize_t i, len;
+ size_t cur;
+
+ /* Since pointers have no length, and we want to apply
+ different semantics to negative indices than normal
+ slicing, we have to dissect the slice object ourselves.*/
+ if (slice->step == Py_None) {
+ step = 1;
+ }
+ else {
+ step = PyNumber_AsSsize_t(slice->step,
+ PyExc_ValueError);
+ if (step == -1 && PyErr_Occurred())
+ return NULL;
+ if (step == 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "slice step cannot be zero");
+ return NULL;
+ }
+ }
+ if (slice->start == Py_None) {
+ if (step < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "slice start is required "
+ "for step < 0");
+ return NULL;
+ }
+ start = 0;
+ }
+ else {
+ start = PyNumber_AsSsize_t(slice->start,
+ PyExc_ValueError);
+ if (start == -1 && PyErr_Occurred())
+ return NULL;
+ }
+ if (slice->stop == Py_None) {
+ PyErr_SetString(PyExc_ValueError,
+ "slice stop is required");
+ return NULL;
+ }
+ stop = PyNumber_AsSsize_t(slice->stop,
+ PyExc_ValueError);
+ if (stop == -1 && PyErr_Occurred())
+ return NULL;
+ if ((step > 0 && start > stop) ||
+ (step < 0 && start < stop))
+ len = 0;
+ else if (step > 0)
+ len = (stop - start - 1) / step + 1;
+ else
+ len = (stop - start + 1) / step + 1;
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for pointer instances */
+ proto = stgdict->proto;
+ assert(proto);
+ itemdict = PyType_stgdict(proto);
+ assert(itemdict);
+ if (itemdict->getfunc == _ctypes_get_fielddesc("c")->getfunc) {
+ char *ptr = *(char **)self->b_ptr;
+ char *dest;
+
+ if (len <= 0)
+ return PyBytes_FromStringAndSize("", 0);
+ if (step == 1) {
+ return PyBytes_FromStringAndSize(ptr + start,
+ len);
+ }
+ dest = (char *)PyMem_Malloc(len);
+ if (dest == NULL)
+ return PyErr_NoMemory();
+ for (cur = start, i = 0; i < len; cur += step, i++) {
+ dest[i] = ptr[cur];
+ }
+ np = PyBytes_FromStringAndSize(dest, len);
+ PyMem_Free(dest);
+ return np;
+ }
+ if (itemdict->getfunc == _ctypes_get_fielddesc("u")->getfunc) {
+ wchar_t *ptr = *(wchar_t **)self->b_ptr;
+ wchar_t *dest;
+
+ if (len <= 0)
+ return PyUnicode_New(0, 0);
+ if (step == 1) {
+ return PyUnicode_FromWideChar(ptr + start,
+ len);
+ }
+ dest = PyMem_New(wchar_t, len);
+ if (dest == NULL)
+ return PyErr_NoMemory();
+ for (cur = start, i = 0; i < len; cur += step, i++) {
+ dest[i] = ptr[cur];
+ }
+ np = PyUnicode_FromWideChar(dest, len);
+ PyMem_Free(dest);
+ return np;
+ }
+
+ np = PyList_New(len);
+ if (np == NULL)
+ return NULL;
+
+ for (cur = start, i = 0; i < len; cur += step, i++) {
+ PyObject *v = Pointer_item(myself, cur);
+ PyList_SET_ITEM(np, i, v);
+ }
+ return np;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "Pointer indices must be integer");
+ return NULL;
+ }
+}
+
+static PySequenceMethods Pointer_as_sequence = {
+ 0, /* inquiry sq_length; */
+ 0, /* binaryfunc sq_concat; */
+ 0, /* intargfunc sq_repeat; */
+ Pointer_item, /* intargfunc sq_item; */
+ 0, /* intintargfunc sq_slice; */
+ Pointer_ass_item, /* intobjargproc sq_ass_item; */
+ 0, /* intintobjargproc sq_ass_slice; */
+ 0, /* objobjproc sq_contains; */
+ /* Added in release 2.0 */
+ 0, /* binaryfunc sq_inplace_concat; */
+ 0, /* intargfunc sq_inplace_repeat; */
+};
+
+static PyMappingMethods Pointer_as_mapping = {
+ 0,
+ Pointer_subscript,
+};
+
+static int
+Pointer_bool(CDataObject *self)
+{
+ return (*(void **)self->b_ptr != NULL);
+}
+
+static PyNumberMethods Pointer_as_number = {
+ 0, /* nb_add */
+ 0, /* nb_subtract */
+ 0, /* nb_multiply */
+ 0, /* nb_remainder */
+ 0, /* nb_divmod */
+ 0, /* nb_power */
+ 0, /* nb_negative */
+ 0, /* nb_positive */
+ 0, /* nb_absolute */
+ (inquiry)Pointer_bool, /* nb_bool */
+};
+
+PyTypeObject PyCPointer_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes._Pointer",
+ sizeof(CDataObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ &Pointer_as_number, /* tp_as_number */
+ &Pointer_as_sequence, /* tp_as_sequence */
+ &Pointer_as_mapping, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("XXX to be provided"), /* tp_doc */
+ (traverseproc)PyCData_traverse, /* tp_traverse */
+ (inquiry)PyCData_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ Pointer_getsets, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)Pointer_init, /* tp_init */
+ 0, /* tp_alloc */
+ Pointer_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+
+/******************************************************************/
+/*
+ * Module initialization.
+ */
+
+PyDoc_STRVAR(_ctypes__doc__,
+"Create and manipulate C compatible data types in Python.");
+
+#ifdef MS_WIN32
+
+PyDoc_STRVAR(comerror_doc, "Raised when a COM method call failed.");
+
+int
+comerror_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ PyObject *hresult, *text, *details;
+ PyObject *a;
+ int status;
+
+ if (!_PyArg_NoKeywords(Py_TYPE(self)->tp_name, kwds))
+ return -1;
+
+ if (!PyArg_ParseTuple(args, "OOO:COMError", &hresult, &text, &details))
+ return -1;
+
+ a = PySequence_GetSlice(args, 1, PyTuple_GET_SIZE(args));
+ if (!a)
+ return -1;
+ status = PyObject_SetAttrString(self, "args", a);
+ Py_DECREF(a);
+ if (status < 0)
+ return -1;
+
+ if (PyObject_SetAttrString(self, "hresult", hresult) < 0)
+ return -1;
+
+ if (PyObject_SetAttrString(self, "text", text) < 0)
+ return -1;
+
+ if (PyObject_SetAttrString(self, "details", details) < 0)
+ return -1;
+
+ Py_INCREF(args);
+ Py_SETREF(((PyBaseExceptionObject *)self)->args, args);
+
+ return 0;
+}
+
+static int
+comerror_clear(PyObject *self)
+{
+ return ((PyTypeObject *)PyExc_BaseException)->tp_clear(self);
+}
+
+static int
+comerror_traverse(PyObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return ((PyTypeObject *)PyExc_BaseException)->tp_traverse(self, visit, arg);
+}
+
+static void
+comerror_dealloc(PyObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ (void)comerror_clear(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot comerror_slots[] = {
+ {Py_tp_doc, (void *)PyDoc_STR(comerror_doc)},
+ {Py_tp_init, comerror_init},
+ {Py_tp_traverse, comerror_traverse},
+ {Py_tp_dealloc, comerror_dealloc},
+ {Py_tp_clear, comerror_clear},
+ {0, NULL},
+};
+
+static PyType_Spec comerror_spec = {
+ .name = "_ctypes.COMError",
+ .basicsize = sizeof(PyBaseExceptionObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = comerror_slots,
+};
+
+#endif // MS_WIN32
+
+static PyObject *
+string_at(const char *ptr, int size)
+{
+ if (PySys_Audit("ctypes.string_at", "ni", (Py_ssize_t)ptr, size) < 0) {
+ return NULL;
+ }
+ if (size == -1)
+ return PyBytes_FromStringAndSize(ptr, strlen(ptr));
+ return PyBytes_FromStringAndSize(ptr, size);
+}
+
+static int
+cast_check_pointertype(PyObject *arg)
+{
+ StgDictObject *dict;
+
+ if (PyCPointerTypeObject_Check(arg))
+ return 1;
+ if (PyCFuncPtrTypeObject_Check(arg))
+ return 1;
+ dict = PyType_stgdict(arg);
+ if (dict != NULL && dict->proto != NULL) {
+ if (PyUnicode_Check(dict->proto)
+ && (strchr("sPzUZXO", PyUnicode_AsUTF8(dict->proto)[0]))) {
+ /* simple pointer types, c_void_p, c_wchar_p, BSTR, ... */
+ return 1;
+ }
+ }
+ PyErr_Format(PyExc_TypeError,
+ "cast() argument 2 must be a pointer type, not %s",
+ PyType_Check(arg)
+ ? ((PyTypeObject *)arg)->tp_name
+ : Py_TYPE(arg)->tp_name);
+ return 0;
+}
+
+static PyObject *
+cast(void *ptr, PyObject *src, PyObject *ctype)
+{
+ CDataObject *result;
+ if (0 == cast_check_pointertype(ctype))
+ return NULL;
+ result = (CDataObject *)_PyObject_CallNoArgs(ctype);
+ if (result == NULL)
+ return NULL;
+
+ /*
+ The casted objects '_objects' member:
+
+ It must certainly contain the source objects one.
+ It must contain the source object itself.
+ */
+ if (CDataObject_Check(src)) {
+ CDataObject *obj = (CDataObject *)src;
+ CDataObject *container;
+
+ /* PyCData_GetContainer will initialize src.b_objects, we need
+ this so it can be shared */
+ container = PyCData_GetContainer(obj);
+ if (container == NULL)
+ goto failed;
+
+ /* But we need a dictionary! */
+ if (obj->b_objects == Py_None) {
+ Py_DECREF(Py_None);
+ obj->b_objects = PyDict_New();
+ if (obj->b_objects == NULL)
+ goto failed;
+ }
+ result->b_objects = Py_XNewRef(obj->b_objects);
+ if (result->b_objects && PyDict_CheckExact(result->b_objects)) {
+ PyObject *index;
+ int rc;
+ index = PyLong_FromVoidPtr((void *)src);
+ if (index == NULL)
+ goto failed;
+ rc = PyDict_SetItem(result->b_objects, index, src);
+ Py_DECREF(index);
+ if (rc == -1)
+ goto failed;
+ }
+ }
+ /* Should we assert that result is a pointer type? */
+ memcpy(result->b_ptr, &ptr, sizeof(void *));
+ return (PyObject *)result;
+
+ failed:
+ Py_DECREF(result);
+ return NULL;
+}
+
+
+static PyObject *
+wstring_at(const wchar_t *ptr, int size)
+{
+ Py_ssize_t ssize = size;
+ if (PySys_Audit("ctypes.wstring_at", "nn", (Py_ssize_t)ptr, ssize) < 0) {
+ return NULL;
+ }
+ if (ssize == -1)
+ ssize = wcslen(ptr);
+ return PyUnicode_FromWideChar(ptr, ssize);
+}
+
+
+static struct PyModuleDef _ctypesmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_ctypes",
+ .m_doc = _ctypes__doc__,
+ .m_size = -1,
+ .m_methods = _ctypes_module_methods,
+};
+
+
+static int
+_ctypes_add_types(PyObject *mod)
+{
+#define TYPE_READY(TYPE) \
+ if (PyType_Ready(TYPE) < 0) { \
+ return -1; \
+ }
+
+#define TYPE_READY_BASE(TYPE_EXPR, TP_BASE) \
+ do { \
+ PyTypeObject *type = (TYPE_EXPR); \
+ type->tp_base = (TP_BASE); \
+ TYPE_READY(type); \
+ } while (0)
+
+#define MOD_ADD_TYPE(TYPE_EXPR, TP_TYPE, TP_BASE) \
+ do { \
+ PyTypeObject *type = (TYPE_EXPR); \
+ Py_SET_TYPE(type, TP_TYPE); \
+ type->tp_base = TP_BASE; \
+ if (PyModule_AddType(mod, type) < 0) { \
+ return -1; \
+ } \
+ } while (0)
+
+#define CREATE_TYPE(MOD, TP, SPEC, BASE) do { \
+ PyObject *type = PyType_FromMetaclass(NULL, MOD, SPEC, \
+ (PyObject *)BASE); \
+ if (type == NULL) { \
+ return -1; \
+ } \
+ TP = (PyTypeObject *)type; \
+} while (0)
+
+ ctypes_state *st = GLOBAL_STATE();
+
+ /* Note:
+ ob_type is the metatype (the 'type'), defaults to PyType_Type,
+ tp_base is the base type, defaults to 'object' aka PyBaseObject_Type.
+ */
+ CREATE_TYPE(mod, st->PyCArg_Type, &carg_spec, NULL);
+ CREATE_TYPE(mod, st->PyCThunk_Type, &cthunk_spec, NULL);
+ TYPE_READY(&PyCData_Type);
+ /* StgDict is derived from PyDict_Type */
+ TYPE_READY_BASE(&PyCStgDict_Type, &PyDict_Type);
+
+ /*************************************************
+ *
+ * Metaclasses
+ */
+ TYPE_READY_BASE(&PyCStructType_Type, &PyType_Type);
+ TYPE_READY_BASE(&UnionType_Type, &PyType_Type);
+ TYPE_READY_BASE(&PyCPointerType_Type, &PyType_Type);
+ TYPE_READY_BASE(&PyCArrayType_Type, &PyType_Type);
+ TYPE_READY_BASE(&PyCSimpleType_Type, &PyType_Type);
+ TYPE_READY_BASE(&PyCFuncPtrType_Type, &PyType_Type);
+
+ /*************************************************
+ *
+ * Classes using a custom metaclass
+ */
+
+ MOD_ADD_TYPE(&Struct_Type, &PyCStructType_Type, &PyCData_Type);
+ MOD_ADD_TYPE(&Union_Type, &UnionType_Type, &PyCData_Type);
+ MOD_ADD_TYPE(&PyCPointer_Type, &PyCPointerType_Type, &PyCData_Type);
+ MOD_ADD_TYPE(&PyCArray_Type, &PyCArrayType_Type, &PyCData_Type);
+ MOD_ADD_TYPE(&Simple_Type, &PyCSimpleType_Type, &PyCData_Type);
+ MOD_ADD_TYPE(&PyCFuncPtr_Type, &PyCFuncPtrType_Type, &PyCData_Type);
+
+ /*************************************************
+ *
+ * Simple classes
+ */
+
+ CREATE_TYPE(mod, st->PyCField_Type, &cfield_spec, NULL);
+
+ /*************************************************
+ *
+ * Other stuff
+ */
+
+ CREATE_TYPE(mod, st->DictRemover_Type, &dictremover_spec, NULL);
+ CREATE_TYPE(mod, st->StructParam_Type, &structparam_spec, NULL);
+
+#ifdef MS_WIN32
+ CREATE_TYPE(mod, st->PyComError_Type, &comerror_spec, PyExc_Exception);
+#endif
+
+#undef TYPE_READY
+#undef TYPE_READY_BASE
+#undef MOD_ADD_TYPE
+#undef CREATE_TYPE
+ return 0;
+}
+
+
+static int
+_ctypes_add_objects(PyObject *mod)
+{
+#define MOD_ADD(name, expr) \
+ do { \
+ PyObject *obj = (expr); \
+ if (obj == NULL) { \
+ return -1; \
+ } \
+ if (PyModule_AddObjectRef(mod, name, obj) < 0) { \
+ Py_DECREF(obj); \
+ return -1; \
+ } \
+ Py_DECREF(obj); \
+ } while (0)
+
+ MOD_ADD("_pointer_type_cache", Py_NewRef(_ctypes_ptrtype_cache));
+
+#ifdef MS_WIN32
+ ctypes_state *st = GLOBAL_STATE();
+ MOD_ADD("COMError", Py_NewRef(st->PyComError_Type));
+ MOD_ADD("FUNCFLAG_HRESULT", PyLong_FromLong(FUNCFLAG_HRESULT));
+ MOD_ADD("FUNCFLAG_STDCALL", PyLong_FromLong(FUNCFLAG_STDCALL));
+#endif
+ MOD_ADD("FUNCFLAG_CDECL", PyLong_FromLong(FUNCFLAG_CDECL));
+ MOD_ADD("FUNCFLAG_USE_ERRNO", PyLong_FromLong(FUNCFLAG_USE_ERRNO));
+ MOD_ADD("FUNCFLAG_USE_LASTERROR", PyLong_FromLong(FUNCFLAG_USE_LASTERROR));
+ MOD_ADD("FUNCFLAG_PYTHONAPI", PyLong_FromLong(FUNCFLAG_PYTHONAPI));
+ MOD_ADD("__version__", PyUnicode_FromString("1.1.0"));
+
+ MOD_ADD("_memmove_addr", PyLong_FromVoidPtr(memmove));
+ MOD_ADD("_memset_addr", PyLong_FromVoidPtr(memset));
+ MOD_ADD("_string_at_addr", PyLong_FromVoidPtr(string_at));
+ MOD_ADD("_cast_addr", PyLong_FromVoidPtr(cast));
+ MOD_ADD("_wstring_at_addr", PyLong_FromVoidPtr(wstring_at));
+
+/* If RTLD_LOCAL is not defined (Windows!), set it to zero. */
+#if !HAVE_DECL_RTLD_LOCAL
+# define RTLD_LOCAL 0
+#endif
+
+/* If RTLD_GLOBAL is not defined (cygwin), set it to the same value as
+ RTLD_LOCAL. */
+#if !HAVE_DECL_RTLD_GLOBAL
+# define RTLD_GLOBAL RTLD_LOCAL
+#endif
+ MOD_ADD("RTLD_LOCAL", PyLong_FromLong(RTLD_LOCAL));
+ MOD_ADD("RTLD_GLOBAL", PyLong_FromLong(RTLD_GLOBAL));
+ MOD_ADD("CTYPES_MAX_ARGCOUNT", PyLong_FromLong(CTYPES_MAX_ARGCOUNT));
+ MOD_ADD("ArgumentError", Py_NewRef(PyExc_ArgError));
+ MOD_ADD("SIZEOF_TIME_T", PyLong_FromSsize_t(SIZEOF_TIME_T));
+ return 0;
+#undef MOD_ADD
+}
+
+
+static int
+_ctypes_mod_exec(PyObject *mod)
+{
+ _unpickle = PyObject_GetAttrString(mod, "_unpickle");
+ if (_unpickle == NULL) {
+ return -1;
+ }
+
+ _ctypes_ptrtype_cache = PyDict_New();
+ if (_ctypes_ptrtype_cache == NULL) {
+ return -1;
+ }
+
+ PyExc_ArgError = PyErr_NewException("ctypes.ArgumentError", NULL, NULL);
+ if (!PyExc_ArgError) {
+ return -1;
+ }
+
+ if (_ctypes_add_types(mod) < 0) {
+ return -1;
+ }
+
+ if (_ctypes_add_objects(mod) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+
+PyMODINIT_FUNC
+PyInit__ctypes(void)
+{
+ PyObject *mod = PyModule_Create(&_ctypesmodule);
+ if (!mod) {
+ return NULL;
+ }
+
+ if (_ctypes_mod_exec(mod) < 0) {
+ Py_DECREF(mod);
+ return NULL;
+ }
+ return mod;
+}
+
+/*
+ Local Variables:
+ compile-command: "cd .. && python setup.py -q build -g && python setup.py -q build install --home ~"
+ End:
+*/
diff --git a/contrib/tools/python3/Modules/_ctypes/callbacks.c b/contrib/tools/python3/Modules/_ctypes/callbacks.c
new file mode 100644
index 00000000000..d71297f9c5c
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ctypes/callbacks.c
@@ -0,0 +1,612 @@
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+// windows.h must be included before pycore internal headers
+#ifdef MS_WIN32
+# include <windows.h>
+#endif
+
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_runtime.h" // _PyRuntime
+#include "pycore_global_objects.h" // _Py_ID()
+
+#include <stdbool.h>
+
+#ifdef MS_WIN32
+# include <malloc.h>
+#endif
+
+#include <ffi.h>
+#include "ctypes.h"
+
+#ifdef HAVE_ALLOCA_H
+/* AIX needs alloca.h for alloca() */
+#include <alloca.h>
+#endif
+
+/**************************************************************/
+
+static int
+CThunkObject_traverse(PyObject *myself, visitproc visit, void *arg)
+{
+ CThunkObject *self = (CThunkObject *)myself;
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->converters);
+ Py_VISIT(self->callable);
+ Py_VISIT(self->restype);
+ return 0;
+}
+
+static int
+CThunkObject_clear(PyObject *myself)
+{
+ CThunkObject *self = (CThunkObject *)myself;
+ Py_CLEAR(self->converters);
+ Py_CLEAR(self->callable);
+ Py_CLEAR(self->restype);
+ return 0;
+}
+
+static void
+CThunkObject_dealloc(PyObject *myself)
+{
+ CThunkObject *self = (CThunkObject *)myself;
+ PyTypeObject *tp = Py_TYPE(myself);
+ PyObject_GC_UnTrack(self);
+ (void)CThunkObject_clear(myself);
+ if (self->pcl_write) {
+ Py_ffi_closure_free(self->pcl_write);
+ }
+ PyObject_GC_Del(self);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot cthunk_slots[] = {
+ {Py_tp_doc, (void *)PyDoc_STR("CThunkObject")},
+ {Py_tp_dealloc, CThunkObject_dealloc},
+ {Py_tp_traverse, CThunkObject_traverse},
+ {Py_tp_clear, CThunkObject_clear},
+ {0, NULL},
+};
+
+PyType_Spec cthunk_spec = {
+ .name = "_ctypes.CThunkObject",
+ .basicsize = sizeof(CThunkObject),
+ .itemsize = sizeof(ffi_type),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = cthunk_slots,
+};
+
+/**************************************************************/
+
+static void
+PrintError(const char *msg, ...)
+{
+ char buf[512];
+ PyObject *f = PySys_GetObject("stderr");
+ va_list marker;
+
+ va_start(marker, msg);
+ PyOS_vsnprintf(buf, sizeof(buf), msg, marker);
+ va_end(marker);
+ if (f != NULL && f != Py_None)
+ PyFile_WriteString(buf, f);
+ PyErr_Print();
+}
+
+
+#ifdef MS_WIN32
+/*
+ * We must call AddRef() on non-NULL COM pointers we receive as arguments
+ * to callback functions - these functions are COM method implementations.
+ * The Python instances we create have a __del__ method which calls Release().
+ *
+ * The presence of a class attribute named '_needs_com_addref_' triggers this
+ * behaviour. It would also be possible to call the AddRef() Python method,
+ * after checking for PyObject_IsTrue(), but this would probably be somewhat
+ * slower.
+ */
+static void
+TryAddRef(StgDictObject *dict, CDataObject *obj)
+{
+ IUnknown *punk;
+ int r = PyDict_Contains((PyObject *)dict, &_Py_ID(_needs_com_addref_));
+ if (r <= 0) {
+ if (r < 0) {
+ PrintError("getting _needs_com_addref_");
+ }
+ return;
+ }
+
+ punk = *(IUnknown **)obj->b_ptr;
+ if (punk)
+ punk->lpVtbl->AddRef(punk);
+ return;
+}
+#endif
+
+/******************************************************************************
+ *
+ * Call the python object with all arguments
+ *
+ */
+static void _CallPythonObject(void *mem,
+ ffi_type *restype,
+ SETFUNC setfunc,
+ PyObject *callable,
+ PyObject *converters,
+ int flags,
+ void **pArgs)
+{
+ PyObject *result = NULL;
+ Py_ssize_t i = 0, j = 0, nargs = 0;
+ PyObject *error_object = NULL;
+ int *space;
+ PyGILState_STATE state = PyGILState_Ensure();
+
+ assert(PyTuple_Check(converters));
+ nargs = PyTuple_GET_SIZE(converters);
+ assert(nargs <= CTYPES_MAX_ARGCOUNT);
+ PyObject **args = alloca(nargs * sizeof(PyObject *));
+ PyObject **cnvs = PySequence_Fast_ITEMS(converters);
+ for (i = 0; i < nargs; i++) {
+ PyObject *cnv = cnvs[i]; // borrowed ref
+ StgDictObject *dict;
+ dict = PyType_stgdict(cnv);
+
+ if (dict && dict->getfunc && !_ctypes_simple_instance(cnv)) {
+ PyObject *v = dict->getfunc(*pArgs, dict->size);
+ if (!v) {
+ PrintError("create argument %zd:\n", i);
+ goto Done;
+ }
+ args[i] = v;
+ /* XXX XXX XX
+ We have the problem that c_byte or c_short have dict->size of
+ 1 resp. 4, but these parameters are pushed as sizeof(int) bytes.
+ BTW, the same problem occurs when they are pushed as parameters
+ */
+ } else if (dict) {
+ /* Hm, shouldn't we use PyCData_AtAddress() or something like that instead? */
+ CDataObject *obj = (CDataObject *)_PyObject_CallNoArgs(cnv);
+ if (!obj) {
+ PrintError("create argument %zd:\n", i);
+ goto Done;
+ }
+ if (!CDataObject_Check(obj)) {
+ Py_DECREF(obj);
+ PrintError("unexpected result of create argument %zd:\n", i);
+ goto Done;
+ }
+ memcpy(obj->b_ptr, *pArgs, dict->size);
+ args[i] = (PyObject *)obj;
+#ifdef MS_WIN32
+ TryAddRef(dict, obj);
+#endif
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "cannot build parameter");
+ PrintError("Parsing argument %zd\n", i);
+ goto Done;
+ }
+ /* XXX error handling! */
+ pArgs++;
+ }
+
+ if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
+ error_object = _ctypes_get_errobj(&space);
+ if (error_object == NULL)
+ goto Done;
+ if (flags & FUNCFLAG_USE_ERRNO) {
+ int temp = space[0];
+ space[0] = errno;
+ errno = temp;
+ }
+#ifdef MS_WIN32
+ if (flags & FUNCFLAG_USE_LASTERROR) {
+ int temp = space[1];
+ space[1] = GetLastError();
+ SetLastError(temp);
+ }
+#endif
+ }
+
+ result = PyObject_Vectorcall(callable, args, nargs, NULL);
+ if (result == NULL) {
+ _PyErr_WriteUnraisableMsg("on calling ctypes callback function",
+ callable);
+ }
+
+#ifdef MS_WIN32
+ if (flags & FUNCFLAG_USE_LASTERROR) {
+ int temp = space[1];
+ space[1] = GetLastError();
+ SetLastError(temp);
+ }
+#endif
+ if (flags & FUNCFLAG_USE_ERRNO) {
+ int temp = space[0];
+ space[0] = errno;
+ errno = temp;
+ }
+ Py_XDECREF(error_object);
+
+ if (restype != &ffi_type_void && result) {
+ assert(setfunc);
+
+#ifdef WORDS_BIGENDIAN
+ /* See the corresponding code in _ctypes_callproc():
+ in callproc.c, around line 1219. */
+ if (restype->type != FFI_TYPE_FLOAT && restype->size < sizeof(ffi_arg)) {
+ mem = (char *)mem + sizeof(ffi_arg) - restype->size;
+ }
+#endif
+
+ /* keep is an object we have to keep alive so that the result
+ stays valid. If there is no such object, the setfunc will
+ have returned Py_None.
+
+ If there is such an object, we have no choice than to keep
+ it alive forever - but a refcount and/or memory leak will
+ be the result. EXCEPT when restype is py_object - Python
+ itself knows how to manage the refcount of these objects.
+ */
+ PyObject *keep = setfunc(mem, result, 0);
+
+ if (keep == NULL) {
+ /* Could not convert callback result. */
+ _PyErr_WriteUnraisableMsg("on converting result "
+ "of ctypes callback function",
+ callable);
+ }
+ else if (setfunc != _ctypes_get_fielddesc("O")->setfunc) {
+ if (keep == Py_None) {
+ /* Nothing to keep */
+ Py_DECREF(keep);
+ }
+ else if (PyErr_WarnEx(PyExc_RuntimeWarning,
+ "memory leak in callback function.",
+ 1) == -1) {
+ _PyErr_WriteUnraisableMsg("on converting result "
+ "of ctypes callback function",
+ callable);
+ }
+ }
+ }
+
+ Py_XDECREF(result);
+
+ Done:
+ for (j = 0; j < i; j++) {
+ Py_DECREF(args[j]);
+ }
+ PyGILState_Release(state);
+}
+
+static void closure_fcn(ffi_cif *cif,
+ void *resp,
+ void **args,
+ void *userdata)
+{
+ CThunkObject *p = (CThunkObject *)userdata;
+
+ _CallPythonObject(resp,
+ p->ffi_restype,
+ p->setfunc,
+ p->callable,
+ p->converters,
+ p->flags,
+ args);
+}
+
+static CThunkObject* CThunkObject_new(Py_ssize_t nargs)
+{
+ CThunkObject *p;
+ Py_ssize_t i;
+
+ ctypes_state *st = GLOBAL_STATE();
+ p = PyObject_GC_NewVar(CThunkObject, st->PyCThunk_Type, nargs);
+ if (p == NULL) {
+ return NULL;
+ }
+
+ p->pcl_write = NULL;
+ p->pcl_exec = NULL;
+ memset(&p->cif, 0, sizeof(p->cif));
+ p->flags = 0;
+ p->converters = NULL;
+ p->callable = NULL;
+ p->restype = NULL;
+ p->setfunc = NULL;
+ p->ffi_restype = NULL;
+
+ for (i = 0; i < nargs + 1; ++i)
+ p->atypes[i] = NULL;
+ PyObject_GC_Track((PyObject *)p);
+ return p;
+}
+
+CThunkObject *_ctypes_alloc_callback(PyObject *callable,
+ PyObject *converters,
+ PyObject *restype,
+ int flags)
+{
+ int result;
+ CThunkObject *p;
+ Py_ssize_t nargs, i;
+ ffi_abi cc;
+
+ assert(PyTuple_Check(converters));
+ nargs = PyTuple_GET_SIZE(converters);
+ p = CThunkObject_new(nargs);
+ if (p == NULL)
+ return NULL;
+
+#ifdef Py_DEBUG
+ ctypes_state *st = GLOBAL_STATE();
+ assert(CThunk_CheckExact(st, (PyObject *)p));
+#endif
+
+ p->pcl_write = Py_ffi_closure_alloc(sizeof(ffi_closure), &p->pcl_exec);
+ if (p->pcl_write == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+
+ p->flags = flags;
+ PyObject **cnvs = PySequence_Fast_ITEMS(converters);
+ for (i = 0; i < nargs; ++i) {
+ PyObject *cnv = cnvs[i]; // borrowed ref
+ p->atypes[i] = _ctypes_get_ffi_type(cnv);
+ }
+ p->atypes[i] = NULL;
+
+ p->restype = Py_NewRef(restype);
+ if (restype == Py_None) {
+ p->setfunc = NULL;
+ p->ffi_restype = &ffi_type_void;
+ } else {
+ StgDictObject *dict = PyType_stgdict(restype);
+ if (dict == NULL || dict->setfunc == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "invalid result type for callback function");
+ goto error;
+ }
+ p->setfunc = dict->setfunc;
+ p->ffi_restype = &dict->ffi_type_pointer;
+ }
+
+ cc = FFI_DEFAULT_ABI;
+#if defined(MS_WIN32) && !defined(_WIN32_WCE) && !defined(MS_WIN64) && !defined(_M_ARM)
+ if ((flags & FUNCFLAG_CDECL) == 0)
+ cc = FFI_STDCALL;
+#endif
+ result = ffi_prep_cif(&p->cif, cc,
+ Py_SAFE_DOWNCAST(nargs, Py_ssize_t, int),
+ p->ffi_restype,
+ &p->atypes[0]);
+ if (result != FFI_OK) {
+ PyErr_Format(PyExc_RuntimeError,
+ "ffi_prep_cif failed with %d", result);
+ goto error;
+ }
+
+
+#if HAVE_FFI_PREP_CLOSURE_LOC
+# ifdef USING_APPLE_OS_LIBFFI
+# ifdef HAVE_BUILTIN_AVAILABLE
+# define HAVE_FFI_PREP_CLOSURE_LOC_RUNTIME __builtin_available(macos 10.15, ios 13, watchos 6, tvos 13, *)
+# else
+# define HAVE_FFI_PREP_CLOSURE_LOC_RUNTIME (ffi_prep_closure_loc != NULL)
+# endif
+# else
+# define HAVE_FFI_PREP_CLOSURE_LOC_RUNTIME 1
+# endif
+ if (HAVE_FFI_PREP_CLOSURE_LOC_RUNTIME) {
+ result = ffi_prep_closure_loc(p->pcl_write, &p->cif, closure_fcn,
+ p,
+ p->pcl_exec);
+ } else
+#endif
+ {
+#if defined(USING_APPLE_OS_LIBFFI) && defined(__arm64__)
+ PyErr_Format(PyExc_NotImplementedError, "ffi_prep_closure_loc() is missing");
+ goto error;
+#else
+#if defined(__clang__)
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p);
+
+#if defined(__clang__)
+ #pragma clang diagnostic pop
+#endif
+#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
+ #pragma GCC diagnostic pop
+#endif
+
+#endif
+ }
+ if (result != FFI_OK) {
+ PyErr_Format(PyExc_RuntimeError,
+ "ffi_prep_closure failed with %d", result);
+ goto error;
+ }
+
+ p->converters = Py_NewRef(converters);
+ p->callable = Py_NewRef(callable);
+ return p;
+
+ error:
+ Py_XDECREF(p);
+ return NULL;
+}
+
+#ifdef MS_WIN32
+
+static void LoadPython(void)
+{
+ if (!Py_IsInitialized()) {
+ Py_Initialize();
+ }
+}
+
+/******************************************************************/
+
+long Call_GetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
+{
+ PyObject *func, *result;
+ long retval;
+ static PyObject *context;
+
+ if (context == NULL)
+ context = PyUnicode_InternFromString("_ctypes.DllGetClassObject");
+
+ func = _PyImport_GetModuleAttrString("ctypes", "DllGetClassObject");
+ if (!func) {
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ /* There has been a warning before about this already */
+ return E_FAIL;
+ }
+
+ {
+ PyObject *py_rclsid = PyLong_FromVoidPtr((void *)rclsid);
+ if (py_rclsid == NULL) {
+ Py_DECREF(func);
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ return E_FAIL;
+ }
+ PyObject *py_riid = PyLong_FromVoidPtr((void *)riid);
+ if (py_riid == NULL) {
+ Py_DECREF(func);
+ Py_DECREF(py_rclsid);
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ return E_FAIL;
+ }
+ PyObject *py_ppv = PyLong_FromVoidPtr(ppv);
+ if (py_ppv == NULL) {
+ Py_DECREF(py_rclsid);
+ Py_DECREF(py_riid);
+ Py_DECREF(func);
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ return E_FAIL;
+ }
+ result = PyObject_CallFunctionObjArgs(func,
+ py_rclsid,
+ py_riid,
+ py_ppv,
+ NULL);
+ Py_DECREF(py_rclsid);
+ Py_DECREF(py_riid);
+ Py_DECREF(py_ppv);
+ }
+ Py_DECREF(func);
+ if (!result) {
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ return E_FAIL;
+ }
+
+ retval = PyLong_AsLong(result);
+ if (PyErr_Occurred()) {
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ retval = E_FAIL;
+ }
+ Py_DECREF(result);
+ return retval;
+}
+
+STDAPI DllGetClassObject(REFCLSID rclsid,
+ REFIID riid,
+ LPVOID *ppv)
+{
+ long result;
+ PyGILState_STATE state;
+
+ LoadPython();
+ state = PyGILState_Ensure();
+ result = Call_GetClassObject(rclsid, riid, ppv);
+ PyGILState_Release(state);
+ return result;
+}
+
+long Call_CanUnloadNow(void)
+{
+ PyObject *mod, *func, *result;
+ long retval;
+ static PyObject *context;
+
+ if (context == NULL)
+ context = PyUnicode_InternFromString("_ctypes.DllCanUnloadNow");
+
+ mod = PyImport_ImportModule("ctypes");
+ if (!mod) {
+/* OutputDebugString("Could not import ctypes"); */
+ /* We assume that this error can only occur when shutting
+ down, so we silently ignore it */
+ PyErr_Clear();
+ return E_FAIL;
+ }
+ /* Other errors cannot be raised, but are printed to stderr */
+ func = PyObject_GetAttrString(mod, "DllCanUnloadNow");
+ Py_DECREF(mod);
+ if (!func) {
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ return E_FAIL;
+ }
+
+ result = _PyObject_CallNoArgs(func);
+ Py_DECREF(func);
+ if (!result) {
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ return E_FAIL;
+ }
+
+ retval = PyLong_AsLong(result);
+ if (PyErr_Occurred()) {
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ retval = E_FAIL;
+ }
+ Py_DECREF(result);
+ return retval;
+}
+
+/*
+ DllRegisterServer and DllUnregisterServer still missing
+*/
+
+STDAPI DllCanUnloadNow(void)
+{
+ long result;
+ PyGILState_STATE state = PyGILState_Ensure();
+ result = Call_CanUnloadNow();
+ PyGILState_Release(state);
+ return result;
+}
+
+#ifndef Py_NO_ENABLE_SHARED
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvRes)
+{
+ switch(fdwReason) {
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(hinstDLL);
+ break;
+ }
+ return TRUE;
+}
+#endif
+
+#endif
+
+/*
+ Local Variables:
+ compile-command: "cd .. && python setup.py -q build_ext"
+ End:
+*/
diff --git a/contrib/tools/python3/Modules/_ctypes/callproc.c b/contrib/tools/python3/Modules/_ctypes/callproc.c
new file mode 100644
index 00000000000..d2fe525dd4d
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ctypes/callproc.c
@@ -0,0 +1,2038 @@
+/*
+ * History: First version dated from 3/97, derived from my SCMLIB version
+ * for win16.
+ */
+/*
+ * Related Work:
+ * - calldll http://www.nightmare.com/software.html
+ * - libffi http://sourceware.cygnus.com/libffi/
+ * - ffcall http://clisp.cons.org/~haible/packages-ffcall.html
+ * and, of course, Don Beaudry's MESS package, but this is more ctypes
+ * related.
+ */
+
+
+/*
+ How are functions called, and how are parameters converted to C ?
+
+ 1. _ctypes.c::PyCFuncPtr_call receives an argument tuple 'inargs' and a
+ keyword dictionary 'kwds'.
+
+ 2. After several checks, _build_callargs() is called which returns another
+ tuple 'callargs'. This may be the same tuple as 'inargs', a slice of
+ 'inargs', or a completely fresh tuple, depending on several things (is it a
+ COM method?, are 'paramflags' available?).
+
+ 3. _build_callargs also calculates bitarrays containing indexes into
+ the callargs tuple, specifying how to build the return value(s) of
+ the function.
+
+ 4. _ctypes_callproc is then called with the 'callargs' tuple. _ctypes_callproc first
+ allocates two arrays. The first is an array of 'struct argument' items, the
+ second array has 'void *' entries.
+
+ 5. If 'converters' are present (converters is a sequence of argtypes'
+ from_param methods), for each item in 'callargs' converter is called and the
+ result passed to ConvParam. If 'converters' are not present, each argument
+ is directly passed to ConvParm.
+
+ 6. For each arg, ConvParam stores the contained C data (or a pointer to it,
+ for structures) into the 'struct argument' array.
+
+ 7. Finally, a loop fills the 'void *' array so that each item points to the
+ data contained in or pointed to by the 'struct argument' array.
+
+ 8. The 'void *' argument array is what _call_function_pointer
+ expects. _call_function_pointer then has very little to do - only some
+ libffi specific stuff, then it calls ffi_call.
+
+ So, there are 4 data structures holding processed arguments:
+ - the inargs tuple (in PyCFuncPtr_call)
+ - the callargs tuple (in PyCFuncPtr_call)
+ - the 'struct arguments' array
+ - the 'void *' array
+
+ */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "structmember.h" // PyMemberDef
+
+#include <stdbool.h>
+
+#ifdef MS_WIN32
+#include <windows.h>
+#include <tchar.h>
+#else
+#include <dlfcn.h>
+#endif
+
+#ifdef __APPLE__
+#include <mach-o/dyld.h>
+#endif
+
+#ifdef MS_WIN32
+#include <malloc.h>
+#endif
+
+#include <ffi.h>
+#include "ctypes.h"
+#ifdef HAVE_ALLOCA_H
+/* AIX needs alloca.h for alloca() */
+#include <alloca.h>
+#endif
+
+#ifdef _Py_MEMORY_SANITIZER
+#include <sanitizer/msan_interface.h>
+#endif
+
+#if defined(_DEBUG) || defined(__MINGW32__)
+/* Don't use structured exception handling on Windows if this is defined.
+ MingW, AFAIK, doesn't support it.
+*/
+#define DONT_USE_SEH
+#endif
+
+#include "pycore_runtime.h" // _PyRuntime
+#include "pycore_global_objects.h" // _Py_ID()
+
+#define CTYPES_CAPSULE_NAME_PYMEM "_ctypes pymem"
+
+
+static void pymem_destructor(PyObject *ptr)
+{
+ void *p = PyCapsule_GetPointer(ptr, CTYPES_CAPSULE_NAME_PYMEM);
+ if (p) {
+ PyMem_Free(p);
+ }
+}
+
+/*
+ ctypes maintains thread-local storage that has space for two error numbers:
+ private copies of the system 'errno' value and, on Windows, the system error code
+ accessed by the GetLastError() and SetLastError() api functions.
+
+ Foreign functions created with CDLL(..., use_errno=True), when called, swap
+ the system 'errno' value with the private copy just before the actual
+ function call, and swapped again immediately afterwards. The 'use_errno'
+ parameter defaults to False, in this case 'ctypes_errno' is not touched.
+
+ On Windows, foreign functions created with CDLL(..., use_last_error=True) or
+ WinDLL(..., use_last_error=True) swap the system LastError value with the
+ ctypes private copy.
+
+ The values are also swapped immediately before and after ctypes callback
+ functions are called, if the callbacks are constructed using the new
+ optional use_errno parameter set to True: CFUNCTYPE(..., use_errno=TRUE) or
+ WINFUNCTYPE(..., use_errno=True).
+
+ New ctypes functions are provided to access the ctypes private copies from
+ Python:
+
+ - ctypes.set_errno(value) and ctypes.set_last_error(value) store 'value' in
+ the private copy and returns the previous value.
+
+ - ctypes.get_errno() and ctypes.get_last_error() returns the current ctypes
+ private copies value.
+*/
+
+/*
+ This function creates and returns a thread-local Python object that has
+ space to store two integer error numbers; once created the Python object is
+ kept alive in the thread state dictionary as long as the thread itself.
+*/
+PyObject *
+_ctypes_get_errobj(int **pspace)
+{
+ PyObject *dict = PyThreadState_GetDict();
+ PyObject *errobj;
+ static PyObject *error_object_name;
+ if (dict == NULL) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "cannot get thread state");
+ return NULL;
+ }
+ if (error_object_name == NULL) {
+ error_object_name = PyUnicode_InternFromString("ctypes.error_object");
+ if (error_object_name == NULL)
+ return NULL;
+ }
+ errobj = PyDict_GetItemWithError(dict, error_object_name);
+ if (errobj) {
+ if (!PyCapsule_IsValid(errobj, CTYPES_CAPSULE_NAME_PYMEM)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ctypes.error_object is an invalid capsule");
+ return NULL;
+ }
+ Py_INCREF(errobj);
+ }
+ else if (!PyErr_Occurred()) {
+ void *space = PyMem_Calloc(2, sizeof(int));
+ if (space == NULL)
+ return NULL;
+ errobj = PyCapsule_New(space, CTYPES_CAPSULE_NAME_PYMEM, pymem_destructor);
+ if (errobj == NULL) {
+ PyMem_Free(space);
+ return NULL;
+ }
+ if (-1 == PyDict_SetItem(dict, error_object_name,
+ errobj)) {
+ Py_DECREF(errobj);
+ return NULL;
+ }
+ }
+ else {
+ return NULL;
+ }
+ *pspace = (int *)PyCapsule_GetPointer(errobj, CTYPES_CAPSULE_NAME_PYMEM);
+ return errobj;
+}
+
+static PyObject *
+get_error_internal(PyObject *self, PyObject *args, int index)
+{
+ int *space;
+ PyObject *errobj = _ctypes_get_errobj(&space);
+ PyObject *result;
+
+ if (errobj == NULL)
+ return NULL;
+ result = PyLong_FromLong(space[index]);
+ Py_DECREF(errobj);
+ return result;
+}
+
+static PyObject *
+set_error_internal(PyObject *self, PyObject *args, int index)
+{
+ int new_errno, old_errno;
+ PyObject *errobj;
+ int *space;
+
+ if (!PyArg_ParseTuple(args, "i", &new_errno)) {
+ return NULL;
+ }
+ errobj = _ctypes_get_errobj(&space);
+ if (errobj == NULL)
+ return NULL;
+ old_errno = space[index];
+ space[index] = new_errno;
+ Py_DECREF(errobj);
+ return PyLong_FromLong(old_errno);
+}
+
+static PyObject *
+get_errno(PyObject *self, PyObject *args)
+{
+ if (PySys_Audit("ctypes.get_errno", NULL) < 0) {
+ return NULL;
+ }
+ return get_error_internal(self, args, 0);
+}
+
+static PyObject *
+set_errno(PyObject *self, PyObject *args)
+{
+ if (PySys_Audit("ctypes.set_errno", "O", args) < 0) {
+ return NULL;
+ }
+ return set_error_internal(self, args, 0);
+}
+
+#ifdef MS_WIN32
+
+static PyObject *
+get_last_error(PyObject *self, PyObject *args)
+{
+ if (PySys_Audit("ctypes.get_last_error", NULL) < 0) {
+ return NULL;
+ }
+ return get_error_internal(self, args, 1);
+}
+
+static PyObject *
+set_last_error(PyObject *self, PyObject *args)
+{
+ if (PySys_Audit("ctypes.set_last_error", "O", args) < 0) {
+ return NULL;
+ }
+ return set_error_internal(self, args, 1);
+}
+
+static WCHAR *FormatError(DWORD code)
+{
+ WCHAR *lpMsgBuf;
+ DWORD n;
+ n = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ code,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
+ (LPWSTR) &lpMsgBuf,
+ 0,
+ NULL);
+ if (n) {
+ while (iswspace(lpMsgBuf[n-1]))
+ --n;
+ lpMsgBuf[n] = L'\0'; /* rstrip() */
+ }
+ return lpMsgBuf;
+}
+
+#ifndef DONT_USE_SEH
+static void SetException(DWORD code, EXCEPTION_RECORD *pr)
+{
+ if (PySys_Audit("ctypes.set_exception", "I", code) < 0) {
+ /* An exception was set by the audit hook */
+ return;
+ }
+
+ /* The 'code' is a normal win32 error code so it could be handled by
+ PyErr_SetFromWindowsErr(). However, for some errors, we have additional
+ information not included in the error code. We handle those here and
+ delegate all others to the generic function. */
+ switch (code) {
+ case EXCEPTION_ACCESS_VIOLATION:
+ /* The thread attempted to read from or write
+ to a virtual address for which it does not
+ have the appropriate access. */
+ if (pr->ExceptionInformation[0] == 0)
+ PyErr_Format(PyExc_OSError,
+ "exception: access violation reading %p",
+ pr->ExceptionInformation[1]);
+ else
+ PyErr_Format(PyExc_OSError,
+ "exception: access violation writing %p",
+ pr->ExceptionInformation[1]);
+ break;
+
+ case EXCEPTION_BREAKPOINT:
+ /* A breakpoint was encountered. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: breakpoint encountered");
+ break;
+
+ case EXCEPTION_DATATYPE_MISALIGNMENT:
+ /* The thread attempted to read or write data that is
+ misaligned on hardware that does not provide
+ alignment. For example, 16-bit values must be
+ aligned on 2-byte boundaries, 32-bit values on
+ 4-byte boundaries, and so on. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: datatype misalignment");
+ break;
+
+ case EXCEPTION_SINGLE_STEP:
+ /* A trace trap or other single-instruction mechanism
+ signaled that one instruction has been executed. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: single step");
+ break;
+
+ case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+ /* The thread attempted to access an array element
+ that is out of bounds, and the underlying hardware
+ supports bounds checking. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: array bounds exceeded");
+ break;
+
+ case EXCEPTION_FLT_DENORMAL_OPERAND:
+ /* One of the operands in a floating-point operation
+ is denormal. A denormal value is one that is too
+ small to represent as a standard floating-point
+ value. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: floating-point operand denormal");
+ break;
+
+ case EXCEPTION_FLT_DIVIDE_BY_ZERO:
+ /* The thread attempted to divide a floating-point
+ value by a floating-point divisor of zero. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: float divide by zero");
+ break;
+
+ case EXCEPTION_FLT_INEXACT_RESULT:
+ /* The result of a floating-point operation cannot be
+ represented exactly as a decimal fraction. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: float inexact");
+ break;
+
+ case EXCEPTION_FLT_INVALID_OPERATION:
+ /* This exception represents any floating-point
+ exception not included in this list. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: float invalid operation");
+ break;
+
+ case EXCEPTION_FLT_OVERFLOW:
+ /* The exponent of a floating-point operation is
+ greater than the magnitude allowed by the
+ corresponding type. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: float overflow");
+ break;
+
+ case EXCEPTION_FLT_STACK_CHECK:
+ /* The stack overflowed or underflowed as the result
+ of a floating-point operation. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: stack over/underflow");
+ break;
+
+ case EXCEPTION_STACK_OVERFLOW:
+ /* The stack overflowed or underflowed as the result
+ of a floating-point operation. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: stack overflow");
+ break;
+
+ case EXCEPTION_FLT_UNDERFLOW:
+ /* The exponent of a floating-point operation is less
+ than the magnitude allowed by the corresponding
+ type. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: float underflow");
+ break;
+
+ case EXCEPTION_INT_DIVIDE_BY_ZERO:
+ /* The thread attempted to divide an integer value by
+ an integer divisor of zero. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: integer divide by zero");
+ break;
+
+ case EXCEPTION_INT_OVERFLOW:
+ /* The result of an integer operation caused a carry
+ out of the most significant bit of the result. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: integer overflow");
+ break;
+
+ case EXCEPTION_PRIV_INSTRUCTION:
+ /* The thread attempted to execute an instruction
+ whose operation is not allowed in the current
+ machine mode. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: privileged instruction");
+ break;
+
+ case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+ /* The thread attempted to continue execution after a
+ noncontinuable exception occurred. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: nocontinuable");
+ break;
+
+ default:
+ PyErr_SetFromWindowsErr(code);
+ break;
+ }
+}
+
+static DWORD HandleException(EXCEPTION_POINTERS *ptrs,
+ DWORD *pdw, EXCEPTION_RECORD *record)
+{
+ *pdw = ptrs->ExceptionRecord->ExceptionCode;
+ *record = *ptrs->ExceptionRecord;
+ /* We don't want to catch breakpoint exceptions, they are used to attach
+ * a debugger to the process.
+ */
+ if (*pdw == EXCEPTION_BREAKPOINT)
+ return EXCEPTION_CONTINUE_SEARCH;
+ return EXCEPTION_EXECUTE_HANDLER;
+}
+#endif
+
+static PyObject *
+check_hresult(PyObject *self, PyObject *args)
+{
+ HRESULT hr;
+ if (!PyArg_ParseTuple(args, "i", &hr))
+ return NULL;
+ if (FAILED(hr))
+ return PyErr_SetFromWindowsErr(hr);
+ return PyLong_FromLong(hr);
+}
+
+#endif
+
+/**************************************************************/
+
+PyCArgObject *
+PyCArgObject_new(void)
+{
+ PyCArgObject *p;
+ ctypes_state *st = GLOBAL_STATE();
+ p = PyObject_GC_New(PyCArgObject, st->PyCArg_Type);
+ if (p == NULL)
+ return NULL;
+ p->pffi_type = NULL;
+ p->tag = '\0';
+ p->obj = NULL;
+ memset(&p->value, 0, sizeof(p->value));
+ PyObject_GC_Track(p);
+ return p;
+}
+
+static int
+PyCArg_traverse(PyCArgObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->obj);
+ return 0;
+}
+
+static int
+PyCArg_clear(PyCArgObject *self)
+{
+ Py_CLEAR(self->obj);
+ return 0;
+}
+
+static void
+PyCArg_dealloc(PyCArgObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ (void)PyCArg_clear(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+is_literal_char(unsigned char c)
+{
+ return c < 128 && _PyUnicode_IsPrintable(c) && c != '\\' && c != '\'';
+}
+
+static PyObject *
+PyCArg_repr(PyCArgObject *self)
+{
+ switch(self->tag) {
+ case 'b':
+ case 'B':
+ return PyUnicode_FromFormat("<cparam '%c' (%d)>",
+ self->tag, self->value.b);
+ case 'h':
+ case 'H':
+ return PyUnicode_FromFormat("<cparam '%c' (%d)>",
+ self->tag, self->value.h);
+ case 'i':
+ case 'I':
+ return PyUnicode_FromFormat("<cparam '%c' (%d)>",
+ self->tag, self->value.i);
+ case 'l':
+ case 'L':
+ return PyUnicode_FromFormat("<cparam '%c' (%ld)>",
+ self->tag, self->value.l);
+
+ case 'q':
+ case 'Q':
+ return PyUnicode_FromFormat("<cparam '%c' (%lld)>",
+ self->tag, self->value.q);
+ case 'd':
+ case 'f': {
+ PyObject *f = PyFloat_FromDouble((self->tag == 'f') ? self->value.f : self->value.d);
+ if (f == NULL) {
+ return NULL;
+ }
+ PyObject *result = PyUnicode_FromFormat("<cparam '%c' (%R)>", self->tag, f);
+ Py_DECREF(f);
+ return result;
+ }
+ case 'c':
+ if (is_literal_char((unsigned char)self->value.c)) {
+ return PyUnicode_FromFormat("<cparam '%c' ('%c')>",
+ self->tag, self->value.c);
+ }
+ else {
+ return PyUnicode_FromFormat("<cparam '%c' ('\\x%02x')>",
+ self->tag, (unsigned char)self->value.c);
+ }
+
+/* Hm, are these 'z' and 'Z' codes useful at all?
+ Shouldn't they be replaced by the functionality of create_string_buffer()
+ and c_wstring() ?
+*/
+ case 'z':
+ case 'Z':
+ case 'P':
+ return PyUnicode_FromFormat("<cparam '%c' (%p)>",
+ self->tag, self->value.p);
+ break;
+
+ default:
+ if (is_literal_char((unsigned char)self->tag)) {
+ return PyUnicode_FromFormat("<cparam '%c' at %p>",
+ (unsigned char)self->tag, (void *)self);
+ }
+ else {
+ return PyUnicode_FromFormat("<cparam 0x%02x at %p>",
+ (unsigned char)self->tag, (void *)self);
+ }
+ }
+}
+
+static PyMemberDef PyCArgType_members[] = {
+ { "_obj", T_OBJECT,
+ offsetof(PyCArgObject, obj), READONLY,
+ "the wrapped object" },
+ { NULL },
+};
+
+static PyType_Slot carg_slots[] = {
+ {Py_tp_dealloc, PyCArg_dealloc},
+ {Py_tp_traverse, PyCArg_traverse},
+ {Py_tp_clear, PyCArg_clear},
+ {Py_tp_repr, PyCArg_repr},
+ {Py_tp_members, PyCArgType_members},
+ {0, NULL},
+};
+
+PyType_Spec carg_spec = {
+ .name = "_ctypes.CArgObject",
+ .basicsize = sizeof(PyCArgObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = carg_slots,
+};
+
+/****************************************************************/
+/*
+ * Convert a PyObject * into a parameter suitable to pass to an
+ * C function call.
+ *
+ * 1. Python integers are converted to C int and passed by value.
+ * Py_None is converted to a C NULL pointer.
+ *
+ * 2. 3-tuples are expected to have a format character in the first
+ * item, which must be 'i', 'f', 'd', 'q', or 'P'.
+ * The second item will have to be an integer, float, double, long long
+ * or integer (denoting an address void *), will be converted to the
+ * corresponding C data type and passed by value.
+ *
+ * 3. Other Python objects are tested for an '_as_parameter_' attribute.
+ * The value of this attribute must be an integer which will be passed
+ * by value, or a 2-tuple or 3-tuple which will be used according
+ * to point 2 above. The third item (if any), is ignored. It is normally
+ * used to keep the object alive where this parameter refers to.
+ * XXX This convention is dangerous - you can construct arbitrary tuples
+ * in Python and pass them. Would it be safer to use a custom container
+ * datatype instead of a tuple?
+ *
+ * 4. Other Python objects cannot be passed as parameters - an exception is raised.
+ *
+ * 5. ConvParam will store the converted result in a struct containing format
+ * and value.
+ */
+
+union result {
+ char c;
+ char b;
+ short h;
+ int i;
+ long l;
+ long long q;
+ long double D;
+ double d;
+ float f;
+ void *p;
+};
+
+struct argument {
+ ffi_type *ffi_type;
+ PyObject *keep;
+ union result value;
+};
+
+/*
+ * Convert a single Python object into a PyCArgObject and return it.
+ */
+static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa)
+{
+ StgDictObject *dict;
+ pa->keep = NULL; /* so we cannot forget it later */
+
+ dict = PyObject_stgdict(obj);
+ if (dict) {
+ PyCArgObject *carg;
+ assert(dict->paramfunc);
+ /* If it has an stgdict, it is a CDataObject */
+ carg = dict->paramfunc((CDataObject *)obj);
+ if (carg == NULL)
+ return -1;
+ pa->ffi_type = carg->pffi_type;
+ memcpy(&pa->value, &carg->value, sizeof(pa->value));
+ pa->keep = (PyObject *)carg;
+ return 0;
+ }
+
+ ctypes_state *st = GLOBAL_STATE();
+ if (PyCArg_CheckExact(st, obj)) {
+ PyCArgObject *carg = (PyCArgObject *)obj;
+ pa->ffi_type = carg->pffi_type;
+ pa->keep = Py_NewRef(obj);
+ memcpy(&pa->value, &carg->value, sizeof(pa->value));
+ return 0;
+ }
+
+ /* check for None, integer, string or unicode and use directly if successful */
+ if (obj == Py_None) {
+ pa->ffi_type = &ffi_type_pointer;
+ pa->value.p = NULL;
+ return 0;
+ }
+
+ if (PyLong_Check(obj)) {
+ pa->ffi_type = &ffi_type_sint;
+ pa->value.i = (long)PyLong_AsUnsignedLong(obj);
+ if (pa->value.i == -1 && PyErr_Occurred()) {
+ PyErr_Clear();
+ pa->value.i = PyLong_AsLong(obj);
+ if (pa->value.i == -1 && PyErr_Occurred()) {
+ PyErr_SetString(PyExc_OverflowError,
+ "int too long to convert");
+ return -1;
+ }
+ }
+ return 0;
+ }
+
+ if (PyBytes_Check(obj)) {
+ pa->ffi_type = &ffi_type_pointer;
+ pa->value.p = PyBytes_AsString(obj);
+ pa->keep = Py_NewRef(obj);
+ return 0;
+ }
+
+ if (PyUnicode_Check(obj)) {
+ pa->ffi_type = &ffi_type_pointer;
+ pa->value.p = PyUnicode_AsWideCharString(obj, NULL);
+ if (pa->value.p == NULL)
+ return -1;
+ pa->keep = PyCapsule_New(pa->value.p, CTYPES_CAPSULE_NAME_PYMEM, pymem_destructor);
+ if (!pa->keep) {
+ PyMem_Free(pa->value.p);
+ return -1;
+ }
+ return 0;
+ }
+
+ {
+ PyObject *arg;
+ if (_PyObject_LookupAttr(obj, &_Py_ID(_as_parameter_), &arg) < 0) {
+ return -1;
+ }
+ /* Which types should we exactly allow here?
+ integers are required for using Python classes
+ as parameters (they have to expose the '_as_parameter_'
+ attribute)
+ */
+ if (arg) {
+ int result;
+ result = ConvParam(arg, index, pa);
+ Py_DECREF(arg);
+ return result;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "Don't know how to convert parameter %d",
+ Py_SAFE_DOWNCAST(index, Py_ssize_t, int));
+ return -1;
+ }
+}
+
+#if defined(MS_WIN32) && !defined(_WIN32_WCE)
+/*
+Per: https://msdn.microsoft.com/en-us/library/7572ztz4.aspx
+To be returned by value in RAX, user-defined types must have a length
+of 1, 2, 4, 8, 16, 32, or 64 bits
+*/
+int can_return_struct_as_int(size_t s)
+{
+ return s == 1 || s == 2 || s == 4;
+}
+
+int can_return_struct_as_sint64(size_t s)
+{
+#ifdef _M_ARM
+ // 8 byte structs cannot be returned in a register on ARM32
+ return 0;
+#else
+ return s == 8;
+#endif
+}
+#endif
+
+
+ffi_type *_ctypes_get_ffi_type(PyObject *obj)
+{
+ StgDictObject *dict;
+ if (obj == NULL)
+ return &ffi_type_sint;
+ dict = PyType_stgdict(obj);
+ if (dict == NULL)
+ return &ffi_type_sint;
+#if defined(MS_WIN32) && !defined(_WIN32_WCE)
+ /* This little trick works correctly with MSVC.
+ It returns small structures in registers
+ */
+ if (dict->ffi_type_pointer.type == FFI_TYPE_STRUCT) {
+ if (can_return_struct_as_int(dict->ffi_type_pointer.size))
+ return &ffi_type_sint32;
+ else if (can_return_struct_as_sint64 (dict->ffi_type_pointer.size))
+ return &ffi_type_sint64;
+ }
+#endif
+ return &dict->ffi_type_pointer;
+}
+
+
+/*
+ * libffi uses:
+ *
+ * ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi,
+ * unsigned int nargs,
+ * ffi_type *rtype,
+ * ffi_type **atypes);
+ *
+ * and then
+ *
+ * void ffi_call(ffi_cif *cif, void *fn, void *rvalue, void **avalues);
+ */
+static int _call_function_pointer(int flags,
+ PPROC pProc,
+ void **avalues,
+ ffi_type **atypes,
+ ffi_type *restype,
+ void *resmem,
+ int argcount,
+ int argtypecount)
+{
+ PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
+ PyObject *error_object = NULL;
+ int *space;
+ ffi_cif cif;
+ int cc;
+#if defined(MS_WIN32) && !defined(DONT_USE_SEH)
+ DWORD dwExceptionCode = 0;
+ EXCEPTION_RECORD record;
+#endif
+ /* XXX check before here */
+ if (restype == NULL) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "No ffi_type for result");
+ return -1;
+ }
+
+ cc = FFI_DEFAULT_ABI;
+#if defined(MS_WIN32) && !defined(MS_WIN64) && !defined(_WIN32_WCE) && !defined(_M_ARM)
+ if ((flags & FUNCFLAG_CDECL) == 0)
+ cc = FFI_STDCALL;
+#endif
+
+# ifdef USING_APPLE_OS_LIBFFI
+# ifdef HAVE_BUILTIN_AVAILABLE
+# define HAVE_FFI_PREP_CIF_VAR_RUNTIME __builtin_available(macos 10.15, ios 13, watchos 6, tvos 13, *)
+# else
+# define HAVE_FFI_PREP_CIF_VAR_RUNTIME (ffi_prep_cif_var != NULL)
+# endif
+# elif HAVE_FFI_PREP_CIF_VAR
+# define HAVE_FFI_PREP_CIF_VAR_RUNTIME true
+# else
+# define HAVE_FFI_PREP_CIF_VAR_RUNTIME false
+# endif
+
+ /* Even on Apple-arm64 the calling convention for variadic functions coincides
+ * with the standard calling convention in the case that the function called
+ * only with its fixed arguments. Thus, we do not need a special flag to be
+ * set on variadic functions. We treat a function as variadic if it is called
+ * with a nonzero number of variadic arguments */
+ bool is_variadic = (argtypecount != 0 && argcount > argtypecount);
+ (void) is_variadic;
+
+#if defined(__APPLE__) && defined(__arm64__)
+ if (is_variadic) {
+ if (HAVE_FFI_PREP_CIF_VAR_RUNTIME) {
+ } else {
+ PyErr_SetString(PyExc_NotImplementedError, "ffi_prep_cif_var() is missing");
+ return -1;
+ }
+ }
+#endif
+
+#if HAVE_FFI_PREP_CIF_VAR
+ if (is_variadic) {
+ if (HAVE_FFI_PREP_CIF_VAR_RUNTIME) {
+ if (FFI_OK != ffi_prep_cif_var(&cif,
+ cc,
+ argtypecount,
+ argcount,
+ restype,
+ atypes)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ffi_prep_cif_var failed");
+ return -1;
+ }
+ } else {
+ if (FFI_OK != ffi_prep_cif(&cif,
+ cc,
+ argcount,
+ restype,
+ atypes)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ffi_prep_cif failed");
+ return -1;
+ }
+ }
+ } else
+#endif
+
+ {
+ if (FFI_OK != ffi_prep_cif(&cif,
+ cc,
+ argcount,
+ restype,
+ atypes)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ffi_prep_cif failed");
+ return -1;
+ }
+ }
+
+ if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
+ error_object = _ctypes_get_errobj(&space);
+ if (error_object == NULL)
+ return -1;
+ }
+ if ((flags & FUNCFLAG_PYTHONAPI) == 0)
+ Py_UNBLOCK_THREADS
+ if (flags & FUNCFLAG_USE_ERRNO) {
+ int temp = space[0];
+ space[0] = errno;
+ errno = temp;
+ }
+#ifdef MS_WIN32
+ if (flags & FUNCFLAG_USE_LASTERROR) {
+ int temp = space[1];
+ space[1] = GetLastError();
+ SetLastError(temp);
+ }
+#ifndef DONT_USE_SEH
+ __try {
+#endif
+#endif
+ ffi_call(&cif, (void *)pProc, resmem, avalues);
+#ifdef MS_WIN32
+#ifndef DONT_USE_SEH
+ }
+ __except (HandleException(GetExceptionInformation(),
+ &dwExceptionCode, &record)) {
+ ;
+ }
+#endif
+ if (flags & FUNCFLAG_USE_LASTERROR) {
+ int temp = space[1];
+ space[1] = GetLastError();
+ SetLastError(temp);
+ }
+#endif
+ if (flags & FUNCFLAG_USE_ERRNO) {
+ int temp = space[0];
+ space[0] = errno;
+ errno = temp;
+ }
+ if ((flags & FUNCFLAG_PYTHONAPI) == 0)
+ Py_BLOCK_THREADS
+ Py_XDECREF(error_object);
+#ifdef MS_WIN32
+#ifndef DONT_USE_SEH
+ if (dwExceptionCode) {
+ SetException(dwExceptionCode, &record);
+ return -1;
+ }
+#endif
+#endif
+ if ((flags & FUNCFLAG_PYTHONAPI) && PyErr_Occurred())
+ return -1;
+ return 0;
+}
+
+/*
+ * Convert the C value in result into a Python object, depending on restype.
+ *
+ * - If restype is NULL, return a Python integer.
+ * - If restype is None, return None.
+ * - If restype is a simple ctypes type (c_int, c_void_p), call the type's getfunc,
+ * pass the result to checker and return the result.
+ * - If restype is another ctypes type, return an instance of that.
+ * - Otherwise, call restype and return the result.
+ */
+static PyObject *GetResult(PyObject *restype, void *result, PyObject *checker)
+{
+ StgDictObject *dict;
+ PyObject *retval, *v;
+
+ if (restype == NULL)
+ return PyLong_FromLong(*(int *)result);
+
+ if (restype == Py_None) {
+ Py_RETURN_NONE;
+ }
+
+ dict = PyType_stgdict(restype);
+ if (dict == NULL)
+ return PyObject_CallFunction(restype, "i", *(int *)result);
+
+ if (dict->getfunc && !_ctypes_simple_instance(restype)) {
+ retval = dict->getfunc(result, dict->size);
+ /* If restype is py_object (detected by comparing getfunc with
+ O_get), we have to call Py_DECREF because O_get has already
+ called Py_INCREF.
+ */
+ if (dict->getfunc == _ctypes_get_fielddesc("O")->getfunc) {
+ Py_DECREF(retval);
+ }
+ } else
+ retval = PyCData_FromBaseObj(restype, NULL, 0, result);
+
+ if (!checker || !retval)
+ return retval;
+
+ v = PyObject_CallOneArg(checker, retval);
+ if (v == NULL)
+ _PyTraceback_Add("GetResult", "_ctypes/callproc.c", __LINE__-2);
+ Py_DECREF(retval);
+ return v;
+}
+
+/*
+ * Raise a new exception 'exc_class', adding additional text to the original
+ * exception string.
+ */
+void _ctypes_extend_error(PyObject *exc_class, const char *fmt, ...)
+{
+ va_list vargs;
+
+ va_start(vargs, fmt);
+ PyObject *s = PyUnicode_FromFormatV(fmt, vargs);
+ va_end(vargs);
+ if (s == NULL) {
+ return;
+ }
+
+ assert(PyErr_Occurred());
+ PyObject *exc = PyErr_GetRaisedException();
+ assert(exc != NULL);
+ PyObject *cls_str = PyType_GetName(Py_TYPE(exc));
+ if (cls_str) {
+ PyUnicode_AppendAndDel(&s, cls_str);
+ PyUnicode_AppendAndDel(&s, PyUnicode_FromString(": "));
+ if (s == NULL) {
+ goto error;
+ }
+ }
+ else {
+ PyErr_Clear();
+ }
+
+ PyObject *msg_str = PyObject_Str(exc);
+ if (msg_str) {
+ PyUnicode_AppendAndDel(&s, msg_str);
+ }
+ else {
+ PyErr_Clear();
+ PyUnicode_AppendAndDel(&s, PyUnicode_FromString("???"));
+ }
+ if (s == NULL) {
+ goto error;
+ }
+ PyErr_SetObject(exc_class, s);
+error:
+ Py_XDECREF(exc);
+ Py_XDECREF(s);
+}
+
+
+#ifdef MS_WIN32
+
+static PyObject *
+GetComError(HRESULT errcode, GUID *riid, IUnknown *pIunk)
+{
+ HRESULT hr;
+ ISupportErrorInfo *psei = NULL;
+ IErrorInfo *pei = NULL;
+ BSTR descr=NULL, helpfile=NULL, source=NULL;
+ GUID guid;
+ DWORD helpcontext=0;
+ LPOLESTR progid;
+ PyObject *obj;
+ LPOLESTR text;
+
+ /* We absolutely have to release the GIL during COM method calls,
+ otherwise we may get a deadlock!
+ */
+ Py_BEGIN_ALLOW_THREADS
+
+ hr = pIunk->lpVtbl->QueryInterface(pIunk, &IID_ISupportErrorInfo, (void **)&psei);
+ if (FAILED(hr))
+ goto failed;
+
+ hr = psei->lpVtbl->InterfaceSupportsErrorInfo(psei, riid);
+ psei->lpVtbl->Release(psei);
+ if (FAILED(hr))
+ goto failed;
+
+ hr = GetErrorInfo(0, &pei);
+ if (hr != S_OK)
+ goto failed;
+
+ pei->lpVtbl->GetDescription(pei, &descr);
+ pei->lpVtbl->GetGUID(pei, &guid);
+ pei->lpVtbl->GetHelpContext(pei, &helpcontext);
+ pei->lpVtbl->GetHelpFile(pei, &helpfile);
+ pei->lpVtbl->GetSource(pei, &source);
+
+ pei->lpVtbl->Release(pei);
+
+ failed:
+ Py_END_ALLOW_THREADS
+
+ progid = NULL;
+ ProgIDFromCLSID(&guid, &progid);
+
+ text = FormatError(errcode);
+ obj = Py_BuildValue(
+ "iu(uuuiu)",
+ errcode,
+ text,
+ descr, source, helpfile, helpcontext,
+ progid);
+ if (obj) {
+ ctypes_state *st = GLOBAL_STATE();
+ PyErr_SetObject((PyObject *)st->PyComError_Type, obj);
+ Py_DECREF(obj);
+ }
+ LocalFree(text);
+
+ if (descr)
+ SysFreeString(descr);
+ if (helpfile)
+ SysFreeString(helpfile);
+ if (source)
+ SysFreeString(source);
+
+ return NULL;
+}
+#endif
+
+#if (defined(__x86_64__) && (defined(__MINGW64__) || defined(__CYGWIN__))) || \
+ defined(__aarch64__) || defined(__riscv)
+#define CTYPES_PASS_BY_REF_HACK
+#define POW2(x) (((x & ~(x - 1)) == x) ? x : 0)
+#define IS_PASS_BY_REF(x) (x > 8 || !POW2(x))
+#endif
+
+/*
+ * Requirements, must be ensured by the caller:
+ * - argtuple is tuple of arguments
+ * - argtypes is either NULL, or a tuple of the same size as argtuple
+ *
+ * - XXX various requirements for restype, not yet collected
+ */
+PyObject *_ctypes_callproc(PPROC pProc,
+ PyObject *argtuple,
+#ifdef MS_WIN32
+ IUnknown *pIunk,
+ GUID *iid,
+#endif
+ int flags,
+ PyObject *argtypes, /* misleading name: This is a tuple of
+ methods, not types: the .from_param
+ class methods of the types */
+ PyObject *restype,
+ PyObject *checker)
+{
+ Py_ssize_t i, n, argcount, argtype_count;
+ void *resbuf;
+ struct argument *args, *pa;
+ ffi_type **atypes;
+ ffi_type *rtype;
+ void **avalues;
+ PyObject *retval = NULL;
+
+ n = argcount = PyTuple_GET_SIZE(argtuple);
+#ifdef MS_WIN32
+ /* an optional COM object this pointer */
+ if (pIunk)
+ ++argcount;
+#endif
+
+ if (argcount > CTYPES_MAX_ARGCOUNT)
+ {
+ PyErr_Format(PyExc_ArgError, "too many arguments (%zi), maximum is %i",
+ argcount, CTYPES_MAX_ARGCOUNT);
+ return NULL;
+ }
+
+ args = alloca(sizeof(struct argument) * argcount);
+ memset(args, 0, sizeof(struct argument) * argcount);
+ argtype_count = argtypes ? PyTuple_GET_SIZE(argtypes) : 0;
+#ifdef MS_WIN32
+ if (pIunk) {
+ args[0].ffi_type = &ffi_type_pointer;
+ args[0].value.p = pIunk;
+ pa = &args[1];
+ } else
+#endif
+ pa = &args[0];
+
+ /* Convert the arguments */
+ for (i = 0; i < n; ++i, ++pa) {
+ PyObject *converter;
+ PyObject *arg;
+ int err;
+
+ arg = PyTuple_GET_ITEM(argtuple, i); /* borrowed ref */
+ /* For cdecl functions, we allow more actual arguments
+ than the length of the argtypes tuple.
+ This is checked in _ctypes::PyCFuncPtr_Call
+ */
+ if (argtypes && argtype_count > i) {
+ PyObject *v;
+ converter = PyTuple_GET_ITEM(argtypes, i);
+ v = PyObject_CallOneArg(converter, arg);
+ if (v == NULL) {
+ _ctypes_extend_error(PyExc_ArgError, "argument %zd: ", i+1);
+ goto cleanup;
+ }
+
+ err = ConvParam(v, i+1, pa);
+ Py_DECREF(v);
+ if (-1 == err) {
+ _ctypes_extend_error(PyExc_ArgError, "argument %zd: ", i+1);
+ goto cleanup;
+ }
+ } else {
+ err = ConvParam(arg, i+1, pa);
+ if (-1 == err) {
+ _ctypes_extend_error(PyExc_ArgError, "argument %zd: ", i+1);
+ goto cleanup; /* leaking ? */
+ }
+ }
+ }
+
+ if (restype == Py_None) {
+ rtype = &ffi_type_void;
+ } else {
+ rtype = _ctypes_get_ffi_type(restype);
+ }
+
+ resbuf = alloca(max(rtype->size, sizeof(ffi_arg)));
+
+#ifdef _Py_MEMORY_SANITIZER
+ /* ffi_call actually initializes resbuf, but from asm, which
+ * MemorySanitizer can't detect. Avoid false positives from MSan. */
+ if (resbuf != NULL) {
+ __msan_unpoison(resbuf, max(rtype->size, sizeof(ffi_arg)));
+ }
+#endif
+ avalues = (void **)alloca(sizeof(void *) * argcount);
+ atypes = (ffi_type **)alloca(sizeof(ffi_type *) * argcount);
+ if (!resbuf || !avalues || !atypes) {
+ PyErr_NoMemory();
+ goto cleanup;
+ }
+ for (i = 0; i < argcount; ++i) {
+ atypes[i] = args[i].ffi_type;
+#ifdef CTYPES_PASS_BY_REF_HACK
+ size_t size = atypes[i]->size;
+ if (IS_PASS_BY_REF(size)) {
+ void *tmp = alloca(size);
+ if (atypes[i]->type == FFI_TYPE_STRUCT)
+ memcpy(tmp, args[i].value.p, size);
+ else
+ memcpy(tmp, (void*)&args[i].value, size);
+
+ avalues[i] = tmp;
+ }
+ else
+#endif
+ if (atypes[i]->type == FFI_TYPE_STRUCT)
+ avalues[i] = (void *)args[i].value.p;
+ else
+ avalues[i] = (void *)&args[i].value;
+ }
+
+ if (-1 == _call_function_pointer(flags, pProc, avalues, atypes,
+ rtype, resbuf,
+ Py_SAFE_DOWNCAST(argcount, Py_ssize_t, int),
+ Py_SAFE_DOWNCAST(argtype_count, Py_ssize_t, int)))
+ goto cleanup;
+
+#ifdef WORDS_BIGENDIAN
+ /* libffi returns the result in a buffer with sizeof(ffi_arg). This
+ causes problems on big endian machines, since the result buffer
+ address cannot simply be used as result pointer, instead we must
+ adjust the pointer value:
+ */
+ /*
+ XXX I should find out and clarify why this is needed at all,
+ especially why adjusting for ffi_type_float must be avoided on
+ 64-bit platforms.
+ */
+ if (rtype->type != FFI_TYPE_FLOAT
+ && rtype->type != FFI_TYPE_STRUCT
+ && rtype->size < sizeof(ffi_arg))
+ {
+ resbuf = (char *)resbuf + sizeof(ffi_arg) - rtype->size;
+ }
+#endif
+
+#ifdef MS_WIN32
+ if (iid && pIunk) {
+ if (*(int *)resbuf & 0x80000000)
+ retval = GetComError(*(HRESULT *)resbuf, iid, pIunk);
+ else
+ retval = PyLong_FromLong(*(int *)resbuf);
+ } else if (flags & FUNCFLAG_HRESULT) {
+ if (*(int *)resbuf & 0x80000000)
+ retval = PyErr_SetFromWindowsErr(*(int *)resbuf);
+ else
+ retval = PyLong_FromLong(*(int *)resbuf);
+ } else
+#endif
+ retval = GetResult(restype, resbuf, checker);
+ cleanup:
+ for (i = 0; i < argcount; ++i)
+ Py_XDECREF(args[i].keep);
+ return retval;
+}
+
+static int
+_parse_voidp(PyObject *obj, void **address)
+{
+ *address = PyLong_AsVoidPtr(obj);
+ if (*address == NULL)
+ return 0;
+ return 1;
+}
+
+#ifdef MS_WIN32
+
+PyDoc_STRVAR(format_error_doc,
+"FormatError([integer]) -> string\n\
+\n\
+Convert a win32 error code into a string. If the error code is not\n\
+given, the return value of a call to GetLastError() is used.\n");
+static PyObject *format_error(PyObject *self, PyObject *args)
+{
+ PyObject *result;
+ wchar_t *lpMsgBuf;
+ DWORD code = 0;
+ if (!PyArg_ParseTuple(args, "|i:FormatError", &code))
+ return NULL;
+ if (code == 0)
+ code = GetLastError();
+ lpMsgBuf = FormatError(code);
+ if (lpMsgBuf) {
+ result = PyUnicode_FromWideChar(lpMsgBuf, wcslen(lpMsgBuf));
+ LocalFree(lpMsgBuf);
+ } else {
+ result = PyUnicode_FromString("<no description>");
+ }
+ return result;
+}
+
+PyDoc_STRVAR(load_library_doc,
+"LoadLibrary(name, load_flags) -> handle\n\
+\n\
+Load an executable (usually a DLL), and return a handle to it.\n\
+The handle may be used to locate exported functions in this\n\
+module. load_flags are as defined for LoadLibraryEx in the\n\
+Windows API.\n");
+static PyObject *load_library(PyObject *self, PyObject *args)
+{
+ PyObject *nameobj;
+ int load_flags = 0;
+ HMODULE hMod;
+ DWORD err;
+
+ if (!PyArg_ParseTuple(args, "U|i:LoadLibrary", &nameobj, &load_flags))
+ return NULL;
+
+ if (PySys_Audit("ctypes.dlopen", "O", nameobj) < 0) {
+ return NULL;
+ }
+
+ WCHAR *name = PyUnicode_AsWideCharString(nameobj, NULL);
+ if (!name)
+ return NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ /* bpo-36085: Limit DLL search directories to avoid pre-loading
+ * attacks and enable use of the AddDllDirectory function.
+ */
+ hMod = LoadLibraryExW(name, NULL, (DWORD)load_flags);
+ err = hMod ? 0 : GetLastError();
+ Py_END_ALLOW_THREADS
+
+ PyMem_Free(name);
+ if (err == ERROR_MOD_NOT_FOUND) {
+ PyErr_Format(PyExc_FileNotFoundError,
+ ("Could not find module '%.500S' (or one of its "
+ "dependencies). Try using the full path with "
+ "constructor syntax."),
+ nameobj);
+ return NULL;
+ } else if (err) {
+ return PyErr_SetFromWindowsErr(err);
+ }
+#ifdef _WIN64
+ return PyLong_FromVoidPtr(hMod);
+#else
+ return Py_BuildValue("i", hMod);
+#endif
+}
+
+PyDoc_STRVAR(free_library_doc,
+"FreeLibrary(handle) -> void\n\
+\n\
+Free the handle of an executable previously loaded by LoadLibrary.\n");
+static PyObject *free_library(PyObject *self, PyObject *args)
+{
+ void *hMod;
+ BOOL result;
+ DWORD err;
+ if (!PyArg_ParseTuple(args, "O&:FreeLibrary", &_parse_voidp, &hMod))
+ return NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ result = FreeLibrary((HMODULE)hMod);
+ err = result ? 0 : GetLastError();
+ Py_END_ALLOW_THREADS
+
+ if (!result) {
+ return PyErr_SetFromWindowsErr(err);
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(copy_com_pointer_doc,
+"CopyComPointer(src, dst) -> HRESULT value\n");
+
+static PyObject *
+copy_com_pointer(PyObject *self, PyObject *args)
+{
+ PyObject *p1, *p2, *r = NULL;
+ struct argument a, b;
+ IUnknown *src, **pdst;
+ if (!PyArg_ParseTuple(args, "OO:CopyComPointer", &p1, &p2))
+ return NULL;
+ a.keep = b.keep = NULL;
+
+ if (-1 == ConvParam(p1, 0, &a) || -1 == ConvParam(p2, 1, &b))
+ goto done;
+ src = (IUnknown *)a.value.p;
+ pdst = (IUnknown **)b.value.p;
+
+ if (pdst == NULL)
+ r = PyLong_FromLong(E_POINTER);
+ else {
+ if (src)
+ src->lpVtbl->AddRef(src);
+ *pdst = src;
+ r = PyLong_FromLong(S_OK);
+ }
+ done:
+ Py_XDECREF(a.keep);
+ Py_XDECREF(b.keep);
+ return r;
+}
+#else
+#ifdef __APPLE__
+#ifdef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH
+# ifdef HAVE_BUILTIN_AVAILABLE
+# define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \
+ __builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *)
+# else
+# define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \
+ (_dyld_shared_cache_contains_path != NULL)
+# endif
+#else
+// Support the deprecated case of compiling on an older macOS version
+static void *libsystem_b_handle;
+static bool (*_dyld_shared_cache_contains_path)(const char *path);
+
+__attribute__((constructor)) void load_dyld_shared_cache_contains_path(void) {
+ libsystem_b_handle = dlopen("/usr/lib/libSystem.B.dylib", RTLD_LAZY);
+ if (libsystem_b_handle != NULL) {
+ _dyld_shared_cache_contains_path = dlsym(libsystem_b_handle, "_dyld_shared_cache_contains_path");
+ }
+}
+
+__attribute__((destructor)) void unload_dyld_shared_cache_contains_path(void) {
+ if (libsystem_b_handle != NULL) {
+ dlclose(libsystem_b_handle);
+ }
+}
+#define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \
+ _dyld_shared_cache_contains_path != NULL
+#endif
+
+static PyObject *py_dyld_shared_cache_contains_path(PyObject *self, PyObject *args)
+{
+ PyObject *name, *name2;
+ char *name_str;
+
+ if (HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME) {
+ int r;
+
+ if (!PyArg_ParseTuple(args, "O", &name))
+ return NULL;
+
+ if (name == Py_None)
+ Py_RETURN_FALSE;
+
+ if (PyUnicode_FSConverter(name, &name2) == 0)
+ return NULL;
+ name_str = PyBytes_AS_STRING(name2);
+
+ r = _dyld_shared_cache_contains_path(name_str);
+ Py_DECREF(name2);
+
+ if (r) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+
+ } else {
+ PyErr_SetString(PyExc_NotImplementedError, "_dyld_shared_cache_contains_path symbol is missing");
+ return NULL;
+ }
+
+ }
+#endif
+
+static PyObject *py_dl_open(PyObject *self, PyObject *args)
+{
+ PyObject *name, *name2;
+ const char *name_str;
+ void * handle;
+#if HAVE_DECL_RTLD_LOCAL
+ int mode = RTLD_NOW | RTLD_LOCAL;
+#else
+ /* cygwin doesn't define RTLD_LOCAL */
+ int mode = RTLD_NOW;
+#endif
+ if (!PyArg_ParseTuple(args, "O|i:dlopen", &name, &mode))
+ return NULL;
+ mode |= RTLD_NOW;
+ if (name != Py_None) {
+ if (PyUnicode_FSConverter(name, &name2) == 0)
+ return NULL;
+ name_str = PyBytes_AS_STRING(name2);
+ } else {
+ name_str = NULL;
+ name2 = NULL;
+ }
+ if (PySys_Audit("ctypes.dlopen", "O", name) < 0) {
+ return NULL;
+ }
+ handle = dlopen(name_str, mode);
+ Py_XDECREF(name2);
+ if (!handle) {
+ const char *errmsg = dlerror();
+ if (!errmsg)
+ errmsg = "dlopen() error";
+ PyErr_SetString(PyExc_OSError,
+ errmsg);
+ return NULL;
+ }
+ return PyLong_FromVoidPtr(handle);
+}
+
+static PyObject *py_dl_close(PyObject *self, PyObject *args)
+{
+ void *handle;
+
+ if (!PyArg_ParseTuple(args, "O&:dlclose", &_parse_voidp, &handle))
+ return NULL;
+ if (dlclose(handle)) {
+ PyErr_SetString(PyExc_OSError,
+ dlerror());
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject *py_dl_sym(PyObject *self, PyObject *args)
+{
+ char *name;
+ void *handle;
+ void *ptr;
+
+ if (!PyArg_ParseTuple(args, "O&s:dlsym",
+ &_parse_voidp, &handle, &name))
+ return NULL;
+ if (PySys_Audit("ctypes.dlsym/handle", "O", args) < 0) {
+ return NULL;
+ }
+ ptr = dlsym((void*)handle, name);
+ if (!ptr) {
+ PyErr_SetString(PyExc_OSError,
+ dlerror());
+ return NULL;
+ }
+ return PyLong_FromVoidPtr(ptr);
+}
+#endif
+
+/*
+ * Only for debugging so far: So that we can call CFunction instances
+ *
+ * XXX Needs to accept more arguments: flags, argtypes, restype
+ */
+static PyObject *
+call_function(PyObject *self, PyObject *args)
+{
+ void *func;
+ PyObject *arguments;
+ PyObject *result;
+
+ if (!PyArg_ParseTuple(args,
+ "O&O!",
+ &_parse_voidp, &func,
+ &PyTuple_Type, &arguments))
+ return NULL;
+ if (PySys_Audit("ctypes.call_function", "nO",
+ (Py_ssize_t)func, arguments) < 0) {
+ return NULL;
+ }
+
+ result = _ctypes_callproc((PPROC)func,
+ arguments,
+#ifdef MS_WIN32
+ NULL,
+ NULL,
+#endif
+ 0, /* flags */
+ NULL, /* self->argtypes */
+ NULL, /* self->restype */
+ NULL); /* checker */
+ return result;
+}
+
+/*
+ * Only for debugging so far: So that we can call CFunction instances
+ *
+ * XXX Needs to accept more arguments: flags, argtypes, restype
+ */
+static PyObject *
+call_cdeclfunction(PyObject *self, PyObject *args)
+{
+ void *func;
+ PyObject *arguments;
+ PyObject *result;
+
+ if (!PyArg_ParseTuple(args,
+ "O&O!",
+ &_parse_voidp, &func,
+ &PyTuple_Type, &arguments))
+ return NULL;
+ if (PySys_Audit("ctypes.call_function", "nO",
+ (Py_ssize_t)func, arguments) < 0) {
+ return NULL;
+ }
+
+ result = _ctypes_callproc((PPROC)func,
+ arguments,
+#ifdef MS_WIN32
+ NULL,
+ NULL,
+#endif
+ FUNCFLAG_CDECL, /* flags */
+ NULL, /* self->argtypes */
+ NULL, /* self->restype */
+ NULL); /* checker */
+ return result;
+}
+
+/*****************************************************************
+ * functions
+ */
+PyDoc_STRVAR(sizeof_doc,
+"sizeof(C type) -> integer\n"
+"sizeof(C instance) -> integer\n"
+"Return the size in bytes of a C instance");
+
+static PyObject *
+sizeof_func(PyObject *self, PyObject *obj)
+{
+ StgDictObject *dict;
+
+ dict = PyType_stgdict(obj);
+ if (dict)
+ return PyLong_FromSsize_t(dict->size);
+
+ if (CDataObject_Check(obj))
+ return PyLong_FromSsize_t(((CDataObject *)obj)->b_size);
+ PyErr_SetString(PyExc_TypeError,
+ "this type has no size");
+ return NULL;
+}
+
+PyDoc_STRVAR(alignment_doc,
+"alignment(C type) -> integer\n"
+"alignment(C instance) -> integer\n"
+"Return the alignment requirements of a C instance");
+
+static PyObject *
+align_func(PyObject *self, PyObject *obj)
+{
+ StgDictObject *dict;
+
+ dict = PyType_stgdict(obj);
+ if (dict)
+ return PyLong_FromSsize_t(dict->align);
+
+ dict = PyObject_stgdict(obj);
+ if (dict)
+ return PyLong_FromSsize_t(dict->align);
+
+ PyErr_SetString(PyExc_TypeError,
+ "no alignment info");
+ return NULL;
+}
+
+PyDoc_STRVAR(byref_doc,
+"byref(C instance[, offset=0]) -> byref-object\n"
+"Return a pointer lookalike to a C instance, only usable\n"
+"as function argument");
+
+/*
+ * We must return something which can be converted to a parameter,
+ * but still has a reference to self.
+ */
+static PyObject *
+byref(PyObject *self, PyObject *args)
+{
+ PyCArgObject *parg;
+ PyObject *obj;
+ PyObject *pyoffset = NULL;
+ Py_ssize_t offset = 0;
+
+ if (!PyArg_UnpackTuple(args, "byref", 1, 2,
+ &obj, &pyoffset))
+ return NULL;
+ if (pyoffset) {
+ offset = PyNumber_AsSsize_t(pyoffset, NULL);
+ if (offset == -1 && PyErr_Occurred())
+ return NULL;
+ }
+ if (!CDataObject_Check(obj)) {
+ PyErr_Format(PyExc_TypeError,
+ "byref() argument must be a ctypes instance, not '%s'",
+ Py_TYPE(obj)->tp_name);
+ return NULL;
+ }
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+
+ parg->tag = 'P';
+ parg->pffi_type = &ffi_type_pointer;
+ parg->obj = Py_NewRef(obj);
+ parg->value.p = (char *)((CDataObject *)obj)->b_ptr + offset;
+ return (PyObject *)parg;
+}
+
+PyDoc_STRVAR(addressof_doc,
+"addressof(C instance) -> integer\n"
+"Return the address of the C instance internal buffer");
+
+static PyObject *
+addressof(PyObject *self, PyObject *obj)
+{
+ if (!CDataObject_Check(obj)) {
+ PyErr_SetString(PyExc_TypeError,
+ "invalid type");
+ return NULL;
+ }
+ if (PySys_Audit("ctypes.addressof", "(O)", obj) < 0) {
+ return NULL;
+ }
+ return PyLong_FromVoidPtr(((CDataObject *)obj)->b_ptr);
+}
+
+static int
+converter(PyObject *obj, void **address)
+{
+ *address = PyLong_AsVoidPtr(obj);
+ return *address != NULL;
+}
+
+static PyObject *
+My_PyObj_FromPtr(PyObject *self, PyObject *args)
+{
+ PyObject *ob;
+ if (!PyArg_ParseTuple(args, "O&:PyObj_FromPtr", converter, &ob)) {
+ return NULL;
+ }
+ if (PySys_Audit("ctypes.PyObj_FromPtr", "(O)", ob) < 0) {
+ return NULL;
+ }
+ return Py_NewRef(ob);
+}
+
+static PyObject *
+My_Py_INCREF(PyObject *self, PyObject *arg)
+{
+ Py_INCREF(arg); /* that's what this function is for */
+ Py_INCREF(arg); /* that for returning it */
+ return arg;
+}
+
+static PyObject *
+My_Py_DECREF(PyObject *self, PyObject *arg)
+{
+ Py_DECREF(arg); /* that's what this function is for */
+ Py_INCREF(arg); /* that's for returning it */
+ return arg;
+}
+
+static PyObject *
+resize(PyObject *self, PyObject *args)
+{
+ CDataObject *obj;
+ StgDictObject *dict;
+ Py_ssize_t size;
+
+ if (!PyArg_ParseTuple(args,
+ "On:resize",
+ &obj, &size))
+ return NULL;
+
+ dict = PyObject_stgdict((PyObject *)obj);
+ if (dict == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "expected ctypes instance");
+ return NULL;
+ }
+ if (size < dict->size) {
+ PyErr_Format(PyExc_ValueError,
+ "minimum size is %zd",
+ dict->size);
+ return NULL;
+ }
+ if (obj->b_needsfree == 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Memory cannot be resized because this object doesn't own it");
+ return NULL;
+ }
+ if ((size_t)size <= sizeof(obj->b_value)) {
+ /* internal default buffer is large enough */
+ obj->b_size = size;
+ goto done;
+ }
+ if (!_CDataObject_HasExternalBuffer(obj)) {
+ /* We are currently using the objects default buffer, but it
+ isn't large enough any more. */
+ void *ptr = PyMem_Calloc(1, size);
+ if (ptr == NULL)
+ return PyErr_NoMemory();
+ memmove(ptr, obj->b_ptr, obj->b_size);
+ obj->b_ptr = ptr;
+ obj->b_size = size;
+ } else {
+ void * ptr = PyMem_Realloc(obj->b_ptr, size);
+ if (ptr == NULL)
+ return PyErr_NoMemory();
+ obj->b_ptr = ptr;
+ obj->b_size = size;
+ }
+ done:
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+unpickle(PyObject *self, PyObject *args)
+{
+ PyObject *typ, *state, *meth, *obj, *result;
+
+ if (!PyArg_ParseTuple(args, "OO!", &typ, &PyTuple_Type, &state))
+ return NULL;
+ obj = PyObject_CallMethodOneArg(typ, &_Py_ID(__new__), typ);
+ if (obj == NULL)
+ return NULL;
+
+ meth = PyObject_GetAttr(obj, &_Py_ID(__setstate__));
+ if (meth == NULL) {
+ goto error;
+ }
+
+ result = PyObject_Call(meth, state, NULL);
+ Py_DECREF(meth);
+ if (result == NULL) {
+ goto error;
+ }
+ Py_DECREF(result);
+
+ return obj;
+
+error:
+ Py_DECREF(obj);
+ return NULL;
+}
+
+static PyObject *
+POINTER(PyObject *self, PyObject *cls)
+{
+ PyObject *result;
+ PyTypeObject *typ;
+ PyObject *key;
+
+ result = PyDict_GetItemWithError(_ctypes_ptrtype_cache, cls);
+ if (result) {
+ return Py_NewRef(result);
+ }
+ else if (PyErr_Occurred()) {
+ return NULL;
+ }
+ if (PyUnicode_CheckExact(cls)) {
+ PyObject *name = PyUnicode_FromFormat("LP_%U", cls);
+ result = PyObject_CallFunction((PyObject *)Py_TYPE(&PyCPointer_Type),
+ "N(O){}",
+ name,
+ &PyCPointer_Type);
+ if (result == NULL)
+ return result;
+ key = PyLong_FromVoidPtr(result);
+ if (key == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ } else if (PyType_Check(cls)) {
+ typ = (PyTypeObject *)cls;
+ PyObject *name = PyUnicode_FromFormat("LP_%s", typ->tp_name);
+ result = PyObject_CallFunction((PyObject *)Py_TYPE(&PyCPointer_Type),
+ "N(O){sO}",
+ name,
+ &PyCPointer_Type,
+ "_type_", cls);
+ if (result == NULL)
+ return result;
+ key = Py_NewRef(cls);
+ } else {
+ PyErr_SetString(PyExc_TypeError, "must be a ctypes type");
+ return NULL;
+ }
+ if (-1 == PyDict_SetItem(_ctypes_ptrtype_cache, key, result)) {
+ Py_DECREF(result);
+ Py_DECREF(key);
+ return NULL;
+ }
+ Py_DECREF(key);
+ return result;
+}
+
+static PyObject *
+pointer(PyObject *self, PyObject *arg)
+{
+ PyObject *result;
+ PyObject *typ;
+
+ typ = PyDict_GetItemWithError(_ctypes_ptrtype_cache, (PyObject *)Py_TYPE(arg));
+ if (typ) {
+ return PyObject_CallOneArg(typ, arg);
+ }
+ else if (PyErr_Occurred()) {
+ return NULL;
+ }
+ typ = POINTER(NULL, (PyObject *)Py_TYPE(arg));
+ if (typ == NULL)
+ return NULL;
+ result = PyObject_CallOneArg(typ, arg);
+ Py_DECREF(typ);
+ return result;
+}
+
+static PyObject *
+buffer_info(PyObject *self, PyObject *arg)
+{
+ StgDictObject *dict = PyType_stgdict(arg);
+ PyObject *shape;
+ Py_ssize_t i;
+
+ if (dict == NULL)
+ dict = PyObject_stgdict(arg);
+ if (dict == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "not a ctypes type or object");
+ return NULL;
+ }
+ shape = PyTuple_New(dict->ndim);
+ if (shape == NULL)
+ return NULL;
+ for (i = 0; i < (int)dict->ndim; ++i)
+ PyTuple_SET_ITEM(shape, i, PyLong_FromSsize_t(dict->shape[i]));
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(shape);
+ return NULL;
+ }
+ return Py_BuildValue("siN", dict->format, dict->ndim, shape);
+}
+
+
+
+PyMethodDef _ctypes_module_methods[] = {
+ {"get_errno", get_errno, METH_NOARGS},
+ {"set_errno", set_errno, METH_VARARGS},
+ {"POINTER", POINTER, METH_O },
+ {"pointer", pointer, METH_O },
+ {"_unpickle", unpickle, METH_VARARGS },
+ {"buffer_info", buffer_info, METH_O, "Return buffer interface information"},
+ {"resize", resize, METH_VARARGS, "Resize the memory buffer of a ctypes instance"},
+#ifdef MS_WIN32
+ {"get_last_error", get_last_error, METH_NOARGS},
+ {"set_last_error", set_last_error, METH_VARARGS},
+ {"CopyComPointer", copy_com_pointer, METH_VARARGS, copy_com_pointer_doc},
+ {"FormatError", format_error, METH_VARARGS, format_error_doc},
+ {"LoadLibrary", load_library, METH_VARARGS, load_library_doc},
+ {"FreeLibrary", free_library, METH_VARARGS, free_library_doc},
+ {"_check_HRESULT", check_hresult, METH_VARARGS},
+#else
+ {"dlopen", py_dl_open, METH_VARARGS,
+ "dlopen(name, flag={RTLD_GLOBAL|RTLD_LOCAL}) open a shared library"},
+ {"dlclose", py_dl_close, METH_VARARGS, "dlclose a library"},
+ {"dlsym", py_dl_sym, METH_VARARGS, "find symbol in shared library"},
+#endif
+#ifdef __APPLE__
+ {"_dyld_shared_cache_contains_path", py_dyld_shared_cache_contains_path, METH_VARARGS, "check if path is in the shared cache"},
+#endif
+ {"alignment", align_func, METH_O, alignment_doc},
+ {"sizeof", sizeof_func, METH_O, sizeof_doc},
+ {"byref", byref, METH_VARARGS, byref_doc},
+ {"addressof", addressof, METH_O, addressof_doc},
+ {"call_function", call_function, METH_VARARGS },
+ {"call_cdeclfunction", call_cdeclfunction, METH_VARARGS },
+ {"PyObj_FromPtr", My_PyObj_FromPtr, METH_VARARGS },
+ {"Py_INCREF", My_Py_INCREF, METH_O },
+ {"Py_DECREF", My_Py_DECREF, METH_O },
+ {NULL, NULL} /* Sentinel */
+};
+
+/*
+ Local Variables:
+ compile-command: "cd .. && python setup.py -q build -g && python setup.py -q build install --home ~"
+ End:
+*/
diff --git a/contrib/tools/python3/Modules/_ctypes/cfield.c b/contrib/tools/python3/Modules/_ctypes/cfield.c
new file mode 100644
index 00000000000..128506a9eed
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ctypes/cfield.c
@@ -0,0 +1,1585 @@
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+// windows.h must be included before pycore internal headers
+#ifdef MS_WIN32
+# include <windows.h>
+#endif
+
+#include "pycore_bitutils.h" // _Py_bswap32()
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+
+#include <ffi.h>
+#include "ctypes.h"
+
+
+#define CTYPES_CFIELD_CAPSULE_NAME_PYMEM "_ctypes/cfield.c pymem"
+
+static void pymem_destructor(PyObject *ptr)
+{
+ void *p = PyCapsule_GetPointer(ptr, CTYPES_CFIELD_CAPSULE_NAME_PYMEM);
+ if (p) {
+ PyMem_Free(p);
+ }
+}
+
+
+/******************************************************************/
+/*
+ PyCField_Type
+*/
+
+/*
+ * Expects the size, index and offset for the current field in *psize and
+ * *poffset, stores the total size so far in *psize, the offset for the next
+ * field in *poffset, the alignment requirements for the current field in
+ * *palign, and returns a field descriptor for this field.
+ */
+/*
+ * bitfields extension:
+ * bitsize != 0: this is a bit field.
+ * pbitofs points to the current bit offset, this will be updated.
+ * prev_desc points to the type of the previous bitfield, if any.
+ */
+PyObject *
+PyCField_FromDesc(PyObject *desc, Py_ssize_t index,
+ Py_ssize_t *pfield_size, int bitsize, int *pbitofs,
+ Py_ssize_t *psize, Py_ssize_t *poffset, Py_ssize_t *palign,
+ int pack, int big_endian)
+{
+ CFieldObject *self;
+ PyObject *proto;
+ Py_ssize_t size, align;
+ SETFUNC setfunc = NULL;
+ GETFUNC getfunc = NULL;
+ StgDictObject *dict;
+ int fieldtype;
+#define NO_BITFIELD 0
+#define NEW_BITFIELD 1
+#define CONT_BITFIELD 2
+#define EXPAND_BITFIELD 3
+
+ ctypes_state *st = GLOBAL_STATE();
+ PyTypeObject *tp = st->PyCField_Type;
+ self = (CFieldObject *)tp->tp_alloc(tp, 0);
+ if (self == NULL)
+ return NULL;
+ dict = PyType_stgdict(desc);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "has no _stginfo_");
+ Py_DECREF(self);
+ return NULL;
+ }
+ if (bitsize /* this is a bitfield request */
+ && *pfield_size /* we have a bitfield open */
+#ifdef MS_WIN32
+ /* MSVC, GCC with -mms-bitfields */
+ && dict->size * 8 == *pfield_size
+#else
+ /* GCC */
+ && dict->size * 8 <= *pfield_size
+#endif
+ && (*pbitofs + bitsize) <= *pfield_size) {
+ /* continue bit field */
+ fieldtype = CONT_BITFIELD;
+#ifndef MS_WIN32
+ } else if (bitsize /* this is a bitfield request */
+ && *pfield_size /* we have a bitfield open */
+ && dict->size * 8 >= *pfield_size
+ && (*pbitofs + bitsize) <= dict->size * 8) {
+ /* expand bit field */
+ fieldtype = EXPAND_BITFIELD;
+#endif
+ } else if (bitsize) {
+ /* start new bitfield */
+ fieldtype = NEW_BITFIELD;
+ *pbitofs = 0;
+ *pfield_size = dict->size * 8;
+ } else {
+ /* not a bit field */
+ fieldtype = NO_BITFIELD;
+ *pbitofs = 0;
+ *pfield_size = 0;
+ }
+
+ size = dict->size;
+ proto = desc;
+
+ /* Field descriptors for 'c_char * n' are be scpecial cased to
+ return a Python string instead of an Array object instance...
+ */
+ if (PyCArrayTypeObject_Check(proto)) {
+ StgDictObject *adict = PyType_stgdict(proto);
+ StgDictObject *idict;
+ if (adict && adict->proto) {
+ idict = PyType_stgdict(adict->proto);
+ if (!idict) {
+ PyErr_SetString(PyExc_TypeError,
+ "has no _stginfo_");
+ Py_DECREF(self);
+ return NULL;
+ }
+ if (idict->getfunc == _ctypes_get_fielddesc("c")->getfunc) {
+ struct fielddesc *fd = _ctypes_get_fielddesc("s");
+ getfunc = fd->getfunc;
+ setfunc = fd->setfunc;
+ }
+ if (idict->getfunc == _ctypes_get_fielddesc("u")->getfunc) {
+ struct fielddesc *fd = _ctypes_get_fielddesc("U");
+ getfunc = fd->getfunc;
+ setfunc = fd->setfunc;
+ }
+ }
+ }
+
+ self->setfunc = setfunc;
+ self->getfunc = getfunc;
+ self->index = index;
+
+ self->proto = Py_NewRef(proto);
+
+ switch (fieldtype) {
+ case NEW_BITFIELD:
+ if (big_endian)
+ self->size = (bitsize << 16) + *pfield_size - *pbitofs - bitsize;
+ else
+ self->size = (bitsize << 16) + *pbitofs;
+ *pbitofs = bitsize;
+ /* fall through */
+ case NO_BITFIELD:
+ if (pack)
+ align = min(pack, dict->align);
+ else
+ align = dict->align;
+ if (align && *poffset % align) {
+ Py_ssize_t delta = align - (*poffset % align);
+ *psize += delta;
+ *poffset += delta;
+ }
+
+ if (bitsize == 0)
+ self->size = size;
+ *psize += size;
+
+ self->offset = *poffset;
+ *poffset += size;
+
+ *palign = align;
+ break;
+
+ case EXPAND_BITFIELD:
+ *poffset += dict->size - *pfield_size/8;
+ *psize += dict->size - *pfield_size/8;
+
+ *pfield_size = dict->size * 8;
+
+ if (big_endian)
+ self->size = (bitsize << 16) + *pfield_size - *pbitofs - bitsize;
+ else
+ self->size = (bitsize << 16) + *pbitofs;
+
+ self->offset = *poffset - size; /* poffset is already updated for the NEXT field */
+ *pbitofs += bitsize;
+ break;
+
+ case CONT_BITFIELD:
+ if (big_endian)
+ self->size = (bitsize << 16) + *pfield_size - *pbitofs - bitsize;
+ else
+ self->size = (bitsize << 16) + *pbitofs;
+
+ self->offset = *poffset - size; /* poffset is already updated for the NEXT field */
+ *pbitofs += bitsize;
+ break;
+ }
+
+ return (PyObject *)self;
+}
+
+static int
+PyCField_set(CFieldObject *self, PyObject *inst, PyObject *value)
+{
+ CDataObject *dst;
+ char *ptr;
+ if (!CDataObject_Check(inst)) {
+ PyErr_SetString(PyExc_TypeError,
+ "not a ctype instance");
+ return -1;
+ }
+ dst = (CDataObject *)inst;
+ ptr = dst->b_ptr + self->offset;
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "can't delete attribute");
+ return -1;
+ }
+ return PyCData_set(inst, self->proto, self->setfunc, value,
+ self->index, self->size, ptr);
+}
+
+static PyObject *
+PyCField_get(CFieldObject *self, PyObject *inst, PyTypeObject *type)
+{
+ CDataObject *src;
+ if (inst == NULL) {
+ return Py_NewRef(self);
+ }
+ if (!CDataObject_Check(inst)) {
+ PyErr_SetString(PyExc_TypeError,
+ "not a ctype instance");
+ return NULL;
+ }
+ src = (CDataObject *)inst;
+ return PyCData_get(self->proto, self->getfunc, inst,
+ self->index, self->size, src->b_ptr + self->offset);
+}
+
+static PyObject *
+PyCField_get_offset(PyObject *self, void *data)
+{
+ return PyLong_FromSsize_t(((CFieldObject *)self)->offset);
+}
+
+static PyObject *
+PyCField_get_size(PyObject *self, void *data)
+{
+ return PyLong_FromSsize_t(((CFieldObject *)self)->size);
+}
+
+static PyGetSetDef PyCField_getset[] = {
+ { "offset", PyCField_get_offset, NULL, "offset in bytes of this field" },
+ { "size", PyCField_get_size, NULL, "size in bytes of this field" },
+ { NULL, NULL, NULL, NULL },
+};
+
+static int
+PyCField_traverse(CFieldObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->proto);
+ return 0;
+}
+
+static int
+PyCField_clear(CFieldObject *self)
+{
+ Py_CLEAR(self->proto);
+ return 0;
+}
+
+static void
+PyCField_dealloc(PyObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ (void)PyCField_clear((CFieldObject *)self);
+ Py_TYPE(self)->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+PyCField_repr(CFieldObject *self)
+{
+ PyObject *result;
+ Py_ssize_t bits = self->size >> 16;
+ Py_ssize_t size = self->size & 0xFFFF;
+ const char *name;
+
+ name = ((PyTypeObject *)self->proto)->tp_name;
+
+ if (bits)
+ result = PyUnicode_FromFormat(
+ "<Field type=%s, ofs=%zd:%zd, bits=%zd>",
+ name, self->offset, size, bits);
+ else
+ result = PyUnicode_FromFormat(
+ "<Field type=%s, ofs=%zd, size=%zd>",
+ name, self->offset, size);
+ return result;
+}
+
+static PyType_Slot cfield_slots[] = {
+ {Py_tp_dealloc, PyCField_dealloc},
+ {Py_tp_repr, PyCField_repr},
+ {Py_tp_doc, (void *)PyDoc_STR("Structure/Union member")},
+ {Py_tp_traverse, PyCField_traverse},
+ {Py_tp_clear, PyCField_clear},
+ {Py_tp_getset, PyCField_getset},
+ {Py_tp_descr_get, PyCField_get},
+ {Py_tp_descr_set, PyCField_set},
+ {0, NULL},
+};
+
+PyType_Spec cfield_spec = {
+ .name = "_ctypes.CField",
+ .basicsize = sizeof(CFieldObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = cfield_slots,
+};
+
+
+/******************************************************************/
+/*
+ Accessor functions
+*/
+
+/* Derived from Modules/structmodule.c:
+ Helper routine to get a Python integer and raise the appropriate error
+ if it isn't one */
+
+static int
+get_long(PyObject *v, long *p)
+{
+ long x = PyLong_AsUnsignedLongMask(v);
+ if (x == -1 && PyErr_Occurred())
+ return -1;
+ *p = x;
+ return 0;
+}
+
+/* Same, but handling unsigned long */
+
+static int
+get_ulong(PyObject *v, unsigned long *p)
+{
+ unsigned long x = PyLong_AsUnsignedLongMask(v);
+ if (x == (unsigned long)-1 && PyErr_Occurred())
+ return -1;
+ *p = x;
+ return 0;
+}
+
+/* Same, but handling native long long. */
+
+static int
+get_longlong(PyObject *v, long long *p)
+{
+ long long x = PyLong_AsUnsignedLongLongMask(v);
+ if (x == -1 && PyErr_Occurred())
+ return -1;
+ *p = x;
+ return 0;
+}
+
+/* Same, but handling native unsigned long long. */
+
+static int
+get_ulonglong(PyObject *v, unsigned long long *p)
+{
+ unsigned long long x = PyLong_AsUnsignedLongLongMask(v);
+ if (x == (unsigned long long)-1 && PyErr_Occurred())
+ return -1;
+ *p = x;
+ return 0;
+}
+
+/*****************************************************************
+ * Integer fields, with bitfield support
+ */
+
+/* how to decode the size field, for integer get/set functions */
+#define LOW_BIT(x) ((x) & 0xFFFF)
+#define NUM_BITS(x) ((x) >> 16)
+
+/* Doesn't work if NUM_BITS(size) == 0, but it never happens in SET() call. */
+#define BIT_MASK(type, size) (((((type)1 << (NUM_BITS(size) - 1)) - 1) << 1) + 1)
+
+/* This macro CHANGES the first parameter IN PLACE. For proper sign handling,
+ we must first shift left, then right.
+*/
+#define GET_BITFIELD(v, size) \
+ if (NUM_BITS(size)) { \
+ v <<= (sizeof(v)*8 - LOW_BIT(size) - NUM_BITS(size)); \
+ v >>= (sizeof(v)*8 - NUM_BITS(size)); \
+ }
+
+/* This macro RETURNS the first parameter with the bit field CHANGED. */
+#define SET(type, x, v, size) \
+ (NUM_BITS(size) ? \
+ ( ( (type)x & ~(BIT_MASK(type, size) << LOW_BIT(size)) ) | ( ((type)v & BIT_MASK(type, size)) << LOW_BIT(size) ) ) \
+ : (type)v)
+
+#if SIZEOF_SHORT == 2
+# define SWAP_SHORT _Py_bswap16
+#else
+# error "unsupported short size"
+#endif
+
+#if SIZEOF_INT == 4
+# define SWAP_INT _Py_bswap32
+#else
+# error "unsupported int size"
+#endif
+
+#if SIZEOF_LONG == 4
+# define SWAP_LONG _Py_bswap32
+#elif SIZEOF_LONG == 8
+# define SWAP_LONG _Py_bswap64
+#else
+# error "unsupported long size"
+#endif
+
+#if SIZEOF_LONG_LONG == 8
+# define SWAP_LONG_LONG _Py_bswap64
+#else
+# error "unsupported long long size"
+#endif
+
+/*****************************************************************
+ * The setter methods return an object which must be kept alive, to keep the
+ * data valid which has been stored in the memory block. The ctypes object
+ * instance inserts this object into its 'b_objects' list.
+ *
+ * For simple Python types like integers or characters, there is nothing that
+ * has to been kept alive, so Py_None is returned in these cases. But this
+ * makes inspecting the 'b_objects' list, which is accessible from Python for
+ * debugging, less useful.
+ *
+ * So, defining the _CTYPES_DEBUG_KEEP symbol returns the original value
+ * instead of Py_None.
+ */
+
+#ifdef _CTYPES_DEBUG_KEEP
+#define _RET(x) Py_INCREF(x); return x
+#else
+#define _RET(X) Py_RETURN_NONE
+#endif
+
+/*****************************************************************
+ * integer accessor methods, supporting bit fields
+ */
+
+static PyObject *
+b_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ if (get_long(value, &val) < 0)
+ return NULL;
+ *(signed char *)ptr = SET(signed char, *(signed char *)ptr, val, size);
+ _RET(value);
+}
+
+
+static PyObject *
+b_get(void *ptr, Py_ssize_t size)
+{
+ signed char val = *(signed char *)ptr;
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+B_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ if (get_ulong(value, &val) < 0)
+ return NULL;
+ *(unsigned char *)ptr = SET(unsigned char, *(unsigned char*)ptr, val, size);
+ _RET(value);
+}
+
+
+static PyObject *
+B_get(void *ptr, Py_ssize_t size)
+{
+ unsigned char val = *(unsigned char *)ptr;
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+h_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ short x;
+ if (get_long(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(short, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+
+static PyObject *
+h_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ short field;
+ if (get_long(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_SHORT(field);
+ field = SET(short, field, val, size);
+ field = SWAP_SHORT(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+static PyObject *
+h_get(void *ptr, Py_ssize_t size)
+{
+ short val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong((long)val);
+}
+
+static PyObject *
+h_get_sw(void *ptr, Py_ssize_t size)
+{
+ short val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_SHORT(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+H_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ unsigned short x;
+ if (get_ulong(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(unsigned short, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+H_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ unsigned short field;
+ if (get_ulong(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_SHORT(field);
+ field = SET(unsigned short, field, val, size);
+ field = SWAP_SHORT(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+
+static PyObject *
+H_get(void *ptr, Py_ssize_t size)
+{
+ unsigned short val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+H_get_sw(void *ptr, Py_ssize_t size)
+{
+ unsigned short val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_SHORT(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+i_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ int x;
+ if (get_long(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(int, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+i_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ int field;
+ if (get_long(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_INT(field);
+ field = SET(int, field, val, size);
+ field = SWAP_INT(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+
+static PyObject *
+i_get(void *ptr, Py_ssize_t size)
+{
+ int val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+i_get_sw(void *ptr, Py_ssize_t size)
+{
+ int val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_INT(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+#ifndef MS_WIN32
+/* http://msdn.microsoft.com/en-us/library/cc237864.aspx */
+#define VARIANT_FALSE 0x0000
+#define VARIANT_TRUE 0xFFFF
+#endif
+/* short BOOL - VARIANT_BOOL */
+static PyObject *
+vBOOL_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ switch (PyObject_IsTrue(value)) {
+ case -1:
+ return NULL;
+ case 0:
+ *(short int *)ptr = VARIANT_FALSE;
+ _RET(value);
+ default:
+ *(short int *)ptr = VARIANT_TRUE;
+ _RET(value);
+ }
+}
+
+static PyObject *
+vBOOL_get(void *ptr, Py_ssize_t size)
+{
+ return PyBool_FromLong((long)*(short int *)ptr);
+}
+
+static PyObject *
+bool_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ switch (PyObject_IsTrue(value)) {
+ case -1:
+ return NULL;
+ case 0:
+ *(_Bool *)ptr = 0;
+ _RET(value);
+ default:
+ *(_Bool *)ptr = 1;
+ _RET(value);
+ }
+}
+
+static PyObject *
+bool_get(void *ptr, Py_ssize_t size)
+{
+ return PyBool_FromLong((long)*(_Bool *)ptr);
+}
+
+static PyObject *
+I_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ unsigned int x;
+ if (get_ulong(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(unsigned int, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+I_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ unsigned int field;
+ if (get_ulong(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_INT(field);
+ field = SET(unsigned int, field, (unsigned int)val, size);
+ field = SWAP_INT(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+
+static PyObject *
+I_get(void *ptr, Py_ssize_t size)
+{
+ unsigned int val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromUnsignedLong(val);
+}
+
+static PyObject *
+I_get_sw(void *ptr, Py_ssize_t size)
+{
+ unsigned int val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_INT(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromUnsignedLong(val);
+}
+
+static PyObject *
+l_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ long x;
+ if (get_long(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(long, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+l_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ long field;
+ if (get_long(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_LONG(field);
+ field = SET(long, field, val, size);
+ field = SWAP_LONG(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+
+static PyObject *
+l_get(void *ptr, Py_ssize_t size)
+{
+ long val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+l_get_sw(void *ptr, Py_ssize_t size)
+{
+ long val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_LONG(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+L_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ unsigned long x;
+ if (get_ulong(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(unsigned long, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+L_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ unsigned long field;
+ if (get_ulong(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_LONG(field);
+ field = SET(unsigned long, field, val, size);
+ field = SWAP_LONG(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+
+static PyObject *
+L_get(void *ptr, Py_ssize_t size)
+{
+ unsigned long val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromUnsignedLong(val);
+}
+
+static PyObject *
+L_get_sw(void *ptr, Py_ssize_t size)
+{
+ unsigned long val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_LONG(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromUnsignedLong(val);
+}
+
+static PyObject *
+q_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long long val;
+ long long x;
+ if (get_longlong(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(long long, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+q_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long long val;
+ long long field;
+ if (get_longlong(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_LONG_LONG(field);
+ field = SET(long long, field, val, size);
+ field = SWAP_LONG_LONG(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+static PyObject *
+q_get(void *ptr, Py_ssize_t size)
+{
+ long long val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromLongLong(val);
+}
+
+static PyObject *
+q_get_sw(void *ptr, Py_ssize_t size)
+{
+ long long val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_LONG_LONG(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromLongLong(val);
+}
+
+static PyObject *
+Q_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long long val;
+ unsigned long long x;
+ if (get_ulonglong(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(long long, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+Q_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long long val;
+ unsigned long long field;
+ if (get_ulonglong(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_LONG_LONG(field);
+ field = SET(unsigned long long, field, val, size);
+ field = SWAP_LONG_LONG(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+static PyObject *
+Q_get(void *ptr, Py_ssize_t size)
+{
+ unsigned long long val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromUnsignedLongLong(val);
+}
+
+static PyObject *
+Q_get_sw(void *ptr, Py_ssize_t size)
+{
+ unsigned long long val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_LONG_LONG(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromUnsignedLongLong(val);
+}
+
+/*****************************************************************
+ * non-integer accessor methods, not supporting bit fields
+ */
+
+
+static PyObject *
+g_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long double x;
+
+ x = PyFloat_AsDouble(value);
+ if (x == -1 && PyErr_Occurred())
+ return NULL;
+ memcpy(ptr, &x, sizeof(long double));
+ _RET(value);
+}
+
+static PyObject *
+g_get(void *ptr, Py_ssize_t size)
+{
+ long double val;
+ memcpy(&val, ptr, sizeof(long double));
+ return PyFloat_FromDouble(val);
+}
+
+static PyObject *
+d_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ double x;
+
+ x = PyFloat_AsDouble(value);
+ if (x == -1 && PyErr_Occurred())
+ return NULL;
+ memcpy(ptr, &x, sizeof(double));
+ _RET(value);
+}
+
+static PyObject *
+d_get(void *ptr, Py_ssize_t size)
+{
+ double val;
+ memcpy(&val, ptr, sizeof(val));
+ return PyFloat_FromDouble(val);
+}
+
+static PyObject *
+d_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ double x;
+
+ x = PyFloat_AsDouble(value);
+ if (x == -1 && PyErr_Occurred())
+ return NULL;
+#ifdef WORDS_BIGENDIAN
+ if (PyFloat_Pack8(x, ptr, 1))
+ return NULL;
+#else
+ if (PyFloat_Pack8(x, ptr, 0))
+ return NULL;
+#endif
+ _RET(value);
+}
+
+static PyObject *
+d_get_sw(void *ptr, Py_ssize_t size)
+{
+#ifdef WORDS_BIGENDIAN
+ return PyFloat_FromDouble(PyFloat_Unpack8(ptr, 1));
+#else
+ return PyFloat_FromDouble(PyFloat_Unpack8(ptr, 0));
+#endif
+}
+
+static PyObject *
+f_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ float x;
+
+ x = (float)PyFloat_AsDouble(value);
+ if (x == -1 && PyErr_Occurred())
+ return NULL;
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+f_get(void *ptr, Py_ssize_t size)
+{
+ float val;
+ memcpy(&val, ptr, sizeof(val));
+ return PyFloat_FromDouble(val);
+}
+
+static PyObject *
+f_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ float x;
+
+ x = (float)PyFloat_AsDouble(value);
+ if (x == -1 && PyErr_Occurred())
+ return NULL;
+#ifdef WORDS_BIGENDIAN
+ if (PyFloat_Pack4(x, ptr, 1))
+ return NULL;
+#else
+ if (PyFloat_Pack4(x, ptr, 0))
+ return NULL;
+#endif
+ _RET(value);
+}
+
+static PyObject *
+f_get_sw(void *ptr, Py_ssize_t size)
+{
+#ifdef WORDS_BIGENDIAN
+ return PyFloat_FromDouble(PyFloat_Unpack4(ptr, 1));
+#else
+ return PyFloat_FromDouble(PyFloat_Unpack4(ptr, 0));
+#endif
+}
+
+/*
+ py_object refcounts:
+
+ 1. If we have a py_object instance, O_get must Py_INCREF the returned
+ object, of course. If O_get is called from a function result, no py_object
+ instance is created - so callproc.c::GetResult has to call Py_DECREF.
+
+ 2. The memory block in py_object owns a refcount. So, py_object must call
+ Py_DECREF on destruction. Maybe only when b_needsfree is non-zero.
+*/
+static PyObject *
+O_get(void *ptr, Py_ssize_t size)
+{
+ PyObject *ob = *(PyObject **)ptr;
+ if (ob == NULL) {
+ if (!PyErr_Occurred())
+ /* Set an error if not yet set */
+ PyErr_SetString(PyExc_ValueError,
+ "PyObject is NULL");
+ return NULL;
+ }
+ return Py_NewRef(ob);
+}
+
+static PyObject *
+O_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ /* Hm, does the memory block need it's own refcount or not? */
+ *(PyObject **)ptr = value;
+ return Py_NewRef(value);
+}
+
+
+static PyObject *
+c_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ if (PyBytes_Check(value) && PyBytes_GET_SIZE(value) == 1) {
+ *(char *)ptr = PyBytes_AS_STRING(value)[0];
+ _RET(value);
+ }
+ if (PyByteArray_Check(value) && PyByteArray_GET_SIZE(value) == 1) {
+ *(char *)ptr = PyByteArray_AS_STRING(value)[0];
+ _RET(value);
+ }
+ if (PyLong_Check(value))
+ {
+ long longval = PyLong_AsLong(value);
+ if (longval < 0 || longval >= 256)
+ goto error;
+ *(char *)ptr = (char)longval;
+ _RET(value);
+ }
+ error:
+ PyErr_Format(PyExc_TypeError,
+ "one character bytes, bytearray or integer expected");
+ return NULL;
+}
+
+
+static PyObject *
+c_get(void *ptr, Py_ssize_t size)
+{
+ return PyBytes_FromStringAndSize((char *)ptr, 1);
+}
+
+/* u - a single wchar_t character */
+static PyObject *
+u_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ Py_ssize_t len;
+ wchar_t chars[2];
+ if (!PyUnicode_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "unicode string expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return NULL;
+ } else
+ Py_INCREF(value);
+
+ len = PyUnicode_AsWideChar(value, chars, 2);
+ if (len != 1) {
+ Py_DECREF(value);
+ PyErr_SetString(PyExc_TypeError,
+ "one character unicode string expected");
+ return NULL;
+ }
+
+ *(wchar_t *)ptr = chars[0];
+ Py_DECREF(value);
+
+ _RET(value);
+}
+
+
+static PyObject *
+u_get(void *ptr, Py_ssize_t size)
+{
+ return PyUnicode_FromWideChar((wchar_t *)ptr, 1);
+}
+
+/* U - a unicode string */
+static PyObject *
+U_get(void *ptr, Py_ssize_t size)
+{
+ Py_ssize_t len;
+ wchar_t *p;
+
+ size /= sizeof(wchar_t); /* we count character units here, not bytes */
+
+ /* We need 'result' to be able to count the characters with wcslen,
+ since ptr may not be NUL terminated. If the length is smaller (if
+ it was actually NUL terminated, we construct a new one and throw
+ away the result.
+ */
+ /* chop off at the first NUL character, if any. */
+ p = (wchar_t*)ptr;
+ for (len = 0; len < size; ++len) {
+ if (!p[len])
+ break;
+ }
+
+ return PyUnicode_FromWideChar((wchar_t *)ptr, len);
+}
+
+static PyObject *
+U_set(void *ptr, PyObject *value, Py_ssize_t length)
+{
+ /* It's easier to calculate in characters than in bytes */
+ length /= sizeof(wchar_t);
+
+ if (!PyUnicode_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "unicode string expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return NULL;
+ }
+
+ Py_ssize_t size = PyUnicode_AsWideChar(value, NULL, 0);
+ if (size < 0) {
+ return NULL;
+ }
+ // PyUnicode_AsWideChar() returns number of wchars including trailing null byte,
+ // when it is called with NULL.
+ size--;
+ assert(size >= 0);
+ if (size > length) {
+ PyErr_Format(PyExc_ValueError,
+ "string too long (%zd, maximum length %zd)",
+ size, length);
+ return NULL;
+ }
+ if (PyUnicode_AsWideChar(value, (wchar_t *)ptr, length) == -1) {
+ return NULL;
+ }
+
+ return Py_NewRef(value);
+}
+
+
+static PyObject *
+s_get(void *ptr, Py_ssize_t size)
+{
+ Py_ssize_t i;
+ char *p;
+
+ p = (char *)ptr;
+ for (i = 0; i < size; ++i) {
+ if (*p++ == '\0')
+ break;
+ }
+
+ return PyBytes_FromStringAndSize((char *)ptr, (Py_ssize_t)i);
+}
+
+static PyObject *
+s_set(void *ptr, PyObject *value, Py_ssize_t length)
+{
+ const char *data;
+ Py_ssize_t size;
+
+ if(!PyBytes_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "expected bytes, %s found",
+ Py_TYPE(value)->tp_name);
+ return NULL;
+ }
+
+ data = PyBytes_AS_STRING(value);
+ // bpo-39593: Use strlen() to truncate the string at the first null character.
+ size = strlen(data);
+
+ if (size < length) {
+ /* This will copy the terminating NUL character
+ * if there is space for it.
+ */
+ ++size;
+ } else if (size > length) {
+ PyErr_Format(PyExc_ValueError,
+ "bytes too long (%zd, maximum length %zd)",
+ size, length);
+ return NULL;
+ }
+ /* Also copy the terminating NUL character if there is space */
+ memcpy((char *)ptr, data, size);
+
+ _RET(value);
+}
+
+static PyObject *
+z_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ if (value == Py_None) {
+ *(char **)ptr = NULL;
+ return Py_NewRef(value);
+ }
+ if (PyBytes_Check(value)) {
+ *(const char **)ptr = PyBytes_AsString(value);
+ return Py_NewRef(value);
+ } else if (PyLong_Check(value)) {
+#if SIZEOF_VOID_P == SIZEOF_LONG_LONG
+ *(char **)ptr = (char *)PyLong_AsUnsignedLongLongMask(value);
+#else
+ *(char **)ptr = (char *)PyLong_AsUnsignedLongMask(value);
+#endif
+ _RET(value);
+ }
+ PyErr_Format(PyExc_TypeError,
+ "bytes or integer address expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return NULL;
+}
+
+static PyObject *
+z_get(void *ptr, Py_ssize_t size)
+{
+ /* XXX What about invalid pointers ??? */
+ if (*(void **)ptr) {
+ return PyBytes_FromStringAndSize(*(char **)ptr,
+ strlen(*(char **)ptr));
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+static PyObject *
+Z_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ PyObject *keep;
+ wchar_t *buffer;
+ Py_ssize_t bsize;
+
+ if (value == Py_None) {
+ *(wchar_t **)ptr = NULL;
+ return Py_NewRef(value);
+ }
+ if (PyLong_Check(value)) {
+#if SIZEOF_VOID_P == SIZEOF_LONG_LONG
+ *(wchar_t **)ptr = (wchar_t *)PyLong_AsUnsignedLongLongMask(value);
+#else
+ *(wchar_t **)ptr = (wchar_t *)PyLong_AsUnsignedLongMask(value);
+#endif
+ Py_RETURN_NONE;
+ }
+ if (!PyUnicode_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "unicode string or integer address expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return NULL;
+ }
+
+ /* We must create a wchar_t* buffer from the unicode object,
+ and keep it alive */
+ buffer = PyUnicode_AsWideCharString(value, &bsize);
+ if (!buffer)
+ return NULL;
+ keep = PyCapsule_New(buffer, CTYPES_CFIELD_CAPSULE_NAME_PYMEM, pymem_destructor);
+ if (!keep) {
+ PyMem_Free(buffer);
+ return NULL;
+ }
+ *(wchar_t **)ptr = buffer;
+ return keep;
+}
+
+static PyObject *
+Z_get(void *ptr, Py_ssize_t size)
+{
+ wchar_t *p;
+ p = *(wchar_t **)ptr;
+ if (p) {
+ return PyUnicode_FromWideChar(p, wcslen(p));
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+
+#ifdef MS_WIN32
+static PyObject *
+BSTR_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ BSTR bstr;
+
+ /* convert value into a PyUnicodeObject or NULL */
+ if (Py_None == value) {
+ value = NULL;
+ } else if (!PyUnicode_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "unicode string expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return NULL;
+ }
+
+ /* create a BSTR from value */
+ if (value) {
+ Py_ssize_t wsize;
+ wchar_t *wvalue = PyUnicode_AsWideCharString(value, &wsize);
+ if (wvalue == NULL) {
+ return NULL;
+ }
+ if ((unsigned) wsize != wsize) {
+ PyErr_SetString(PyExc_ValueError, "String too long for BSTR");
+ PyMem_Free(wvalue);
+ return NULL;
+ }
+ bstr = SysAllocStringLen(wvalue, (unsigned)wsize);
+ PyMem_Free(wvalue);
+ } else
+ bstr = NULL;
+
+ /* free the previous contents, if any */
+ if (*(BSTR *)ptr)
+ SysFreeString(*(BSTR *)ptr);
+
+ /* and store it */
+ *(BSTR *)ptr = bstr;
+
+ /* We don't need to keep any other object */
+ _RET(value);
+}
+
+
+static PyObject *
+BSTR_get(void *ptr, Py_ssize_t size)
+{
+ BSTR p;
+ p = *(BSTR *)ptr;
+ if (p)
+ return PyUnicode_FromWideChar(p, SysStringLen(p));
+ else {
+ /* Hm, it seems NULL pointer and zero length string are the
+ same in BSTR, see Don Box, p 81
+ */
+ Py_RETURN_NONE;
+ }
+}
+#endif
+
+static PyObject *
+P_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ void *v;
+ if (value == Py_None) {
+ *(void **)ptr = NULL;
+ _RET(value);
+ }
+
+ if (!PyLong_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "cannot be converted to pointer");
+ return NULL;
+ }
+
+#if SIZEOF_VOID_P <= SIZEOF_LONG
+ v = (void *)PyLong_AsUnsignedLongMask(value);
+#else
+#if SIZEOF_LONG_LONG < SIZEOF_VOID_P
+# error "PyLong_AsVoidPtr: sizeof(long long) < sizeof(void*)"
+#endif
+ v = (void *)PyLong_AsUnsignedLongLongMask(value);
+#endif
+
+ if (PyErr_Occurred())
+ return NULL;
+
+ *(void **)ptr = v;
+ _RET(value);
+}
+
+static PyObject *
+P_get(void *ptr, Py_ssize_t size)
+{
+ if (*(void **)ptr == NULL) {
+ Py_RETURN_NONE;
+ }
+ return PyLong_FromVoidPtr(*(void **)ptr);
+}
+
+static struct fielddesc formattable[] = {
+ { 's', s_set, s_get, NULL},
+ { 'b', b_set, b_get, NULL},
+ { 'B', B_set, B_get, NULL},
+ { 'c', c_set, c_get, NULL},
+ { 'd', d_set, d_get, NULL, d_set_sw, d_get_sw},
+ { 'g', g_set, g_get, NULL},
+ { 'f', f_set, f_get, NULL, f_set_sw, f_get_sw},
+ { 'h', h_set, h_get, NULL, h_set_sw, h_get_sw},
+ { 'H', H_set, H_get, NULL, H_set_sw, H_get_sw},
+ { 'i', i_set, i_get, NULL, i_set_sw, i_get_sw},
+ { 'I', I_set, I_get, NULL, I_set_sw, I_get_sw},
+ { 'l', l_set, l_get, NULL, l_set_sw, l_get_sw},
+ { 'L', L_set, L_get, NULL, L_set_sw, L_get_sw},
+ { 'q', q_set, q_get, NULL, q_set_sw, q_get_sw},
+ { 'Q', Q_set, Q_get, NULL, Q_set_sw, Q_get_sw},
+ { 'P', P_set, P_get, NULL},
+ { 'z', z_set, z_get, NULL},
+ { 'u', u_set, u_get, NULL},
+ { 'U', U_set, U_get, NULL},
+ { 'Z', Z_set, Z_get, NULL},
+#ifdef MS_WIN32
+ { 'X', BSTR_set, BSTR_get, NULL},
+#endif
+ { 'v', vBOOL_set, vBOOL_get, NULL},
+#if SIZEOF__BOOL == SIZEOF_INT
+ { '?', bool_set, bool_get, NULL, I_set_sw, I_get_sw},
+#elif SIZEOF__BOOL == SIZEOF_LONG
+ { '?', bool_set, bool_get, NULL, L_set_sw, L_get_sw},
+#elif SIZEOF__BOOL == SIZEOF_LONG_LONG
+ { '?', bool_set, bool_get, NULL, Q_set_sw, Q_get_sw},
+#else
+ { '?', bool_set, bool_get, NULL},
+#endif /* SIZEOF__BOOL */
+ { 'O', O_set, O_get, NULL},
+ { 0, NULL, NULL, NULL},
+};
+
+/*
+ Ideas: Implement VARIANT in this table, using 'V' code.
+ Use '?' as code for BOOL.
+*/
+
+/* Delayed initialization. Windows cannot statically reference dynamically
+ loaded addresses from DLLs. */
+void
+_ctypes_init_fielddesc(void)
+{
+ struct fielddesc *fd = formattable;
+ for (; fd->code; ++fd) {
+ switch (fd->code) {
+ case 's': fd->pffi_type = &ffi_type_pointer; break;
+ case 'b': fd->pffi_type = &ffi_type_schar; break;
+ case 'B': fd->pffi_type = &ffi_type_uchar; break;
+ case 'c': fd->pffi_type = &ffi_type_schar; break;
+ case 'd': fd->pffi_type = &ffi_type_double; break;
+ case 'g': fd->pffi_type = &ffi_type_longdouble; break;
+ case 'f': fd->pffi_type = &ffi_type_float; break;
+ case 'h': fd->pffi_type = &ffi_type_sshort; break;
+ case 'H': fd->pffi_type = &ffi_type_ushort; break;
+ case 'i': fd->pffi_type = &ffi_type_sint; break;
+ case 'I': fd->pffi_type = &ffi_type_uint; break;
+ /* XXX Hm, sizeof(int) == sizeof(long) doesn't hold on every platform */
+ /* As soon as we can get rid of the type codes, this is no longer a problem */
+ #if SIZEOF_LONG == 4
+ case 'l': fd->pffi_type = &ffi_type_sint32; break;
+ case 'L': fd->pffi_type = &ffi_type_uint32; break;
+ #elif SIZEOF_LONG == 8
+ case 'l': fd->pffi_type = &ffi_type_sint64; break;
+ case 'L': fd->pffi_type = &ffi_type_uint64; break;
+ #else
+ #error
+ #endif
+ #if SIZEOF_LONG_LONG == 8
+ case 'q': fd->pffi_type = &ffi_type_sint64; break;
+ case 'Q': fd->pffi_type = &ffi_type_uint64; break;
+ #else
+ #error
+ #endif
+ case 'P': fd->pffi_type = &ffi_type_pointer; break;
+ case 'z': fd->pffi_type = &ffi_type_pointer; break;
+ case 'u':
+ if (sizeof(wchar_t) == sizeof(short))
+ fd->pffi_type = &ffi_type_sshort;
+ else if (sizeof(wchar_t) == sizeof(int))
+ fd->pffi_type = &ffi_type_sint;
+ else if (sizeof(wchar_t) == sizeof(long))
+ fd->pffi_type = &ffi_type_slong;
+ else
+ Py_UNREACHABLE();
+ break;
+ case 'U': fd->pffi_type = &ffi_type_pointer; break;
+ case 'Z': fd->pffi_type = &ffi_type_pointer; break;
+ #ifdef MS_WIN32
+ case 'X': fd->pffi_type = &ffi_type_pointer; break;
+ #endif
+ case 'v': fd->pffi_type = &ffi_type_sshort; break;
+ #if SIZEOF__BOOL == 1
+ case '?': fd->pffi_type = &ffi_type_uchar; break; /* Also fallback for no native _Bool support */
+ #elif SIZEOF__BOOL == SIZEOF_SHORT
+ case '?': fd->pffi_type = &ffi_type_ushort; break;
+ #elif SIZEOF__BOOL == SIZEOF_INT
+ case '?': fd->pffi_type = &ffi_type_uint; break;
+ #elif SIZEOF__BOOL == SIZEOF_LONG
+ case '?': fd->pffi_type = &ffi_type_ulong; break;
+ #elif SIZEOF__BOOL == SIZEOF_LONG_LONG
+ case '?': fd->pffi_type = &ffi_type_ulong; break;
+ #endif /* SIZEOF__BOOL */
+ case 'O': fd->pffi_type = &ffi_type_pointer; break;
+ default:
+ Py_UNREACHABLE();
+ }
+ }
+
+}
+
+struct fielddesc *
+_ctypes_get_fielddesc(const char *fmt)
+{
+ static int initialized = 0;
+ struct fielddesc *table = formattable;
+
+ if (!initialized) {
+ initialized = 1;
+ _ctypes_init_fielddesc();
+ }
+
+ for (; table->code; ++table) {
+ if (table->code == fmt[0])
+ return table;
+ }
+ return NULL;
+}
+
+/*---------------- EOF ----------------*/
diff --git a/contrib/tools/python3/Modules/_ctypes/ctypes.h b/contrib/tools/python3/Modules/_ctypes/ctypes.h
new file mode 100644
index 00000000000..aed4dffe074
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ctypes/ctypes.h
@@ -0,0 +1,414 @@
+#if defined (__SVR4) && defined (__sun)
+# include <alloca.h>
+#endif
+
+#ifndef MS_WIN32
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#define min(a, b) ((a) < (b) ? (a) : (b))
+
+#define PARAMFLAG_FIN 0x1
+#define PARAMFLAG_FOUT 0x2
+#define PARAMFLAG_FLCID 0x4
+#endif
+
+/*
+ * bpo-13097: Max number of arguments CFuncPtr._argtypes_ and
+ * _ctypes_callproc() will accept.
+ *
+ * This limit is enforced for the `alloca()` call in `_ctypes_callproc`,
+ * to avoid allocating a massive buffer on the stack.
+ */
+#ifndef CTYPES_MAX_ARGCOUNT
+ #ifdef __EMSCRIPTEN__
+ #define CTYPES_MAX_ARGCOUNT 1000
+ #else
+ #define CTYPES_MAX_ARGCOUNT 1024
+ #endif
+#endif
+
+#if defined(__has_builtin)
+#if __has_builtin(__builtin_available)
+#define HAVE_BUILTIN_AVAILABLE 1
+#endif
+#endif
+
+#ifdef MS_WIN32
+#include <Unknwn.h> // for IUnknown interface
+#endif
+
+typedef struct {
+ PyTypeObject *DictRemover_Type;
+ PyTypeObject *PyCArg_Type;
+ PyTypeObject *PyCField_Type;
+ PyTypeObject *PyCThunk_Type;
+#ifdef MS_WIN32
+ PyTypeObject *PyComError_Type;
+#endif
+ PyTypeObject *StructParam_Type;
+} ctypes_state;
+
+extern ctypes_state global_state;
+
+#define GLOBAL_STATE() (&global_state)
+
+extern PyType_Spec carg_spec;
+extern PyType_Spec cfield_spec;
+extern PyType_Spec cthunk_spec;
+
+typedef struct tagPyCArgObject PyCArgObject;
+typedef struct tagCDataObject CDataObject;
+typedef PyObject *(* GETFUNC)(void *, Py_ssize_t size);
+typedef PyObject *(* SETFUNC)(void *, PyObject *value, Py_ssize_t size);
+typedef PyCArgObject *(* PARAMFUNC)(CDataObject *obj);
+
+/* A default buffer in CDataObject, which can be used for small C types. If
+this buffer is too small, PyMem_Malloc will be called to create a larger one,
+and this one is not used.
+
+Making CDataObject a variable size object would be a better solution, but more
+difficult in the presence of PyCFuncPtrObject. Maybe later.
+*/
+union value {
+ char c[16];
+ short s;
+ int i;
+ long l;
+ float f;
+ double d;
+ long long ll;
+ long double D;
+};
+
+/*
+ Hm. Are there CDataObject's which do not need the b_objects member? In
+ this case we probably should introduce b_flags to mark it as present... If
+ b_objects is not present/unused b_length is unneeded as well.
+*/
+
+struct tagCDataObject {
+ PyObject_HEAD
+ char *b_ptr; /* pointer to memory block */
+ int b_needsfree; /* need _we_ free the memory? */
+ CDataObject *b_base; /* pointer to base object or NULL */
+ Py_ssize_t b_size; /* size of memory block in bytes */
+ Py_ssize_t b_length; /* number of references we need */
+ Py_ssize_t b_index; /* index of this object into base's
+ b_object list */
+ PyObject *b_objects; /* dictionary of references we need to keep, or Py_None */
+ union value b_value;
+};
+
+typedef struct {
+ PyObject_VAR_HEAD
+ ffi_closure *pcl_write; /* the C callable, writeable */
+ void *pcl_exec; /* the C callable, executable */
+ ffi_cif cif;
+ int flags;
+ PyObject *converters;
+ PyObject *callable;
+ PyObject *restype;
+ SETFUNC setfunc;
+ ffi_type *ffi_restype;
+ ffi_type *atypes[1];
+} CThunkObject;
+#define CThunk_CheckExact(st, v) Py_IS_TYPE(v, st->PyCThunk_Type)
+
+typedef struct {
+ /* First part identical to tagCDataObject */
+ PyObject_HEAD
+ char *b_ptr; /* pointer to memory block */
+ int b_needsfree; /* need _we_ free the memory? */
+ CDataObject *b_base; /* pointer to base object or NULL */
+ Py_ssize_t b_size; /* size of memory block in bytes */
+ Py_ssize_t b_length; /* number of references we need */
+ Py_ssize_t b_index; /* index of this object into base's
+ b_object list */
+ PyObject *b_objects; /* list of references we need to keep */
+ union value b_value;
+ /* end of tagCDataObject, additional fields follow */
+
+ CThunkObject *thunk;
+ PyObject *callable;
+
+ /* These two fields will override the ones in the type's stgdict if
+ they are set */
+ PyObject *converters;
+ PyObject *argtypes;
+ PyObject *restype;
+ PyObject *checker;
+ PyObject *errcheck;
+#ifdef MS_WIN32
+ int index;
+ GUID *iid;
+#endif
+ PyObject *paramflags;
+} PyCFuncPtrObject;
+
+extern PyTypeObject PyCStgDict_Type;
+#define PyCStgDict_CheckExact(v) Py_IS_TYPE(v, &PyCStgDict_Type)
+#define PyCStgDict_Check(v) PyObject_TypeCheck(v, &PyCStgDict_Type)
+
+extern int PyCStructUnionType_update_stgdict(PyObject *fields, PyObject *type, int isStruct);
+extern int PyType_stginfo(PyTypeObject *self, Py_ssize_t *psize, Py_ssize_t *palign, Py_ssize_t *plength);
+extern int PyObject_stginfo(PyObject *self, Py_ssize_t *psize, Py_ssize_t *palign, Py_ssize_t *plength);
+
+
+
+extern PyTypeObject PyCData_Type;
+#define CDataObject_CheckExact(v) Py_IS_TYPE(v, &PyCData_Type)
+#define CDataObject_Check(v) PyObject_TypeCheck(v, &PyCData_Type)
+#define _CDataObject_HasExternalBuffer(v) ((v)->b_ptr != (char *)&(v)->b_value)
+
+extern PyTypeObject PyCSimpleType_Type;
+#define PyCSimpleTypeObject_CheckExact(v) Py_IS_TYPE(v, &PyCSimpleType_Type)
+#define PyCSimpleTypeObject_Check(v) PyObject_TypeCheck(v, &PyCSimpleType_Type)
+
+extern struct fielddesc *_ctypes_get_fielddesc(const char *fmt);
+
+
+extern PyObject *
+PyCField_FromDesc(PyObject *desc, Py_ssize_t index,
+ Py_ssize_t *pfield_size, int bitsize, int *pbitofs,
+ Py_ssize_t *psize, Py_ssize_t *poffset, Py_ssize_t *palign,
+ int pack, int is_big_endian);
+
+extern PyObject *PyCData_AtAddress(PyObject *type, void *buf);
+extern PyObject *PyCData_FromBytes(PyObject *type, char *data, Py_ssize_t length);
+
+extern PyTypeObject PyCArrayType_Type;
+extern PyTypeObject PyCArray_Type;
+extern PyTypeObject PyCPointerType_Type;
+extern PyTypeObject PyCPointer_Type;
+extern PyTypeObject PyCFuncPtr_Type;
+extern PyTypeObject PyCFuncPtrType_Type;
+extern PyTypeObject PyCStructType_Type;
+
+#define PyCArrayTypeObject_Check(v) PyObject_TypeCheck(v, &PyCArrayType_Type)
+#define ArrayObject_Check(v) PyObject_TypeCheck(v, &PyCArray_Type)
+#define PointerObject_Check(v) PyObject_TypeCheck(v, &PyCPointer_Type)
+#define PyCPointerTypeObject_Check(v) PyObject_TypeCheck(v, &PyCPointerType_Type)
+#define PyCFuncPtrObject_Check(v) PyObject_TypeCheck(v, &PyCFuncPtr_Type)
+#define PyCFuncPtrTypeObject_Check(v) PyObject_TypeCheck(v, &PyCFuncPtrType_Type)
+#define PyCStructTypeObject_Check(v) PyObject_TypeCheck(v, &PyCStructType_Type)
+
+extern PyObject *
+PyCArrayType_from_ctype(PyObject *itemtype, Py_ssize_t length);
+
+extern PyMethodDef _ctypes_module_methods[];
+
+extern CThunkObject *_ctypes_alloc_callback(PyObject *callable,
+ PyObject *converters,
+ PyObject *restype,
+ int flags);
+/* a table entry describing a predefined ctypes type */
+struct fielddesc {
+ char code;
+ SETFUNC setfunc;
+ GETFUNC getfunc;
+ ffi_type *pffi_type; /* always statically allocated */
+ SETFUNC setfunc_swapped;
+ GETFUNC getfunc_swapped;
+};
+
+typedef struct {
+ PyObject_HEAD
+ Py_ssize_t offset;
+ Py_ssize_t size;
+ Py_ssize_t index; /* Index into CDataObject's
+ object array */
+ PyObject *proto; /* a type or NULL */
+ GETFUNC getfunc; /* getter function if proto is NULL */
+ SETFUNC setfunc; /* setter function if proto is NULL */
+ int anonymous;
+} CFieldObject;
+
+/* A subclass of PyDictObject, used as the instance dictionary of ctypes
+ metatypes */
+typedef struct {
+ PyDictObject dict; /* first part identical to PyDictObject */
+/* The size and align fields are unneeded, they are in ffi_type as well. As
+ an experiment shows, it's trivial to get rid of them, the only thing to
+ remember is that in PyCArrayType_new the ffi_type fields must be filled in -
+ so far it was unneeded because libffi doesn't support arrays at all
+ (because they are passed as pointers to function calls anyway). But it's
+ too much risk to change that now, and there are other fields which doesn't
+ belong into this structure anyway. Maybe in ctypes 2.0... (ctypes 2000?)
+*/
+ Py_ssize_t size; /* number of bytes */
+ Py_ssize_t align; /* alignment requirements */
+ Py_ssize_t length; /* number of fields */
+ ffi_type ffi_type_pointer;
+ PyObject *proto; /* Only for Pointer/ArrayObject */
+ SETFUNC setfunc; /* Only for simple objects */
+ GETFUNC getfunc; /* Only for simple objects */
+ PARAMFUNC paramfunc;
+
+ /* Following fields only used by PyCFuncPtrType_Type instances */
+ PyObject *argtypes; /* tuple of CDataObjects */
+ PyObject *converters; /* tuple([t.from_param for t in argtypes]) */
+ PyObject *restype; /* CDataObject or NULL */
+ PyObject *checker;
+ int flags; /* calling convention and such */
+
+ /* pep3118 fields, pointers need PyMem_Free */
+ char *format;
+ int ndim;
+ Py_ssize_t *shape;
+/* Py_ssize_t *strides; */ /* unused in ctypes */
+/* Py_ssize_t *suboffsets; */ /* unused in ctypes */
+
+} StgDictObject;
+
+/****************************************************************
+ StgDictObject fields
+
+ setfunc and getfunc is only set for simple data types, it is copied from the
+ corresponding fielddesc entry. These are functions to set and get the value
+ in a memory block.
+ They should probably by used by other types as well.
+
+ proto is only used for Pointer and Array types - it points to the item type
+ object.
+
+ Probably all the magic ctypes methods (like from_param) should have C
+ callable wrappers in the StgDictObject. For simple data type, for example,
+ the fielddesc table could have entries for C codec from_param functions or
+ other methods as well, if a subtype overrides this method in Python at
+ construction time, or assigns to it later, tp_setattro should update the
+ StgDictObject function to a generic one.
+
+ Currently, PyCFuncPtr types have 'converters' and 'checker' entries in their
+ type dict. They are only used to cache attributes from other entries, which
+ is wrong.
+
+ One use case is the .value attribute that all simple types have. But some
+ complex structures, like VARIANT, represent a single value also, and should
+ have this attribute.
+
+ Another use case is a _check_retval_ function, which is called when a ctypes
+ type is used as return type of a function to validate and compute the return
+ value.
+
+ Common ctypes protocol:
+
+ - setfunc: store a python value in a memory block
+ - getfunc: convert data from a memory block into a python value
+
+ - checkfunc: validate and convert a return value from a function call
+ - toparamfunc: convert a python value into a function argument
+
+*****************************************************************/
+
+/* May return NULL, but does not set an exception! */
+extern StgDictObject *PyType_stgdict(PyObject *obj);
+
+/* May return NULL, but does not set an exception! */
+extern StgDictObject *PyObject_stgdict(PyObject *self);
+
+extern int PyCStgDict_clone(StgDictObject *src, StgDictObject *dst);
+
+typedef int(* PPROC)(void);
+
+PyObject *_ctypes_callproc(PPROC pProc,
+ PyObject *arguments,
+#ifdef MS_WIN32
+ IUnknown *pIUnk,
+ GUID *iid,
+#endif
+ int flags,
+ PyObject *argtypes,
+ PyObject *restype,
+ PyObject *checker);
+
+
+#define FUNCFLAG_STDCALL 0x0
+#define FUNCFLAG_CDECL 0x1
+#define FUNCFLAG_HRESULT 0x2
+#define FUNCFLAG_PYTHONAPI 0x4
+#define FUNCFLAG_USE_ERRNO 0x8
+#define FUNCFLAG_USE_LASTERROR 0x10
+
+#define TYPEFLAG_ISPOINTER 0x100
+#define TYPEFLAG_HASPOINTER 0x200
+#define TYPEFLAG_HASUNION 0x400
+#define TYPEFLAG_HASBITFIELD 0x800
+
+#define DICTFLAG_FINAL 0x1000
+
+struct tagPyCArgObject {
+ PyObject_HEAD
+ ffi_type *pffi_type;
+ char tag;
+ union {
+ char c;
+ char b;
+ short h;
+ int i;
+ long l;
+ long long q;
+ long double D;
+ double d;
+ float f;
+ void *p;
+ } value;
+ PyObject *obj;
+ Py_ssize_t size; /* for the 'V' tag */
+};
+
+#define PyCArg_CheckExact(st, v) Py_IS_TYPE(v, st->PyCArg_Type)
+extern PyCArgObject *PyCArgObject_new(void);
+
+extern PyObject *
+PyCData_get(PyObject *type, GETFUNC getfunc, PyObject *src,
+ Py_ssize_t index, Py_ssize_t size, char *ptr);
+
+extern int
+PyCData_set(PyObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value,
+ Py_ssize_t index, Py_ssize_t size, char *ptr);
+
+extern void _ctypes_extend_error(PyObject *exc_class, const char *fmt, ...);
+
+struct basespec {
+ CDataObject *base;
+ Py_ssize_t index;
+ char *adr;
+};
+
+extern char basespec_string[];
+
+extern ffi_type *_ctypes_get_ffi_type(PyObject *obj);
+
+/* exception classes */
+extern PyObject *PyExc_ArgError;
+
+extern char *_ctypes_conversion_encoding;
+extern char *_ctypes_conversion_errors;
+
+
+extern void _ctypes_free_closure(void *);
+extern void *_ctypes_alloc_closure(void);
+
+extern PyObject *PyCData_FromBaseObj(PyObject *type, PyObject *base, Py_ssize_t index, char *adr);
+extern char *_ctypes_alloc_format_string(const char *prefix, const char *suffix);
+extern char *_ctypes_alloc_format_string_with_shape(int ndim,
+ const Py_ssize_t *shape,
+ const char *prefix, const char *suffix);
+
+extern int _ctypes_simple_instance(PyObject *obj);
+
+extern PyObject *_ctypes_ptrtype_cache;
+PyObject *_ctypes_get_errobj(int **pspace);
+
+#ifdef USING_MALLOC_CLOSURE_DOT_C
+void Py_ffi_closure_free(void *p);
+void *Py_ffi_closure_alloc(size_t size, void** codeloc);
+#else
+#define Py_ffi_closure_free ffi_closure_free
+#define Py_ffi_closure_alloc ffi_closure_alloc
+#endif
+
+/*
+ Local Variables:
+ compile-command: "python setup.py -q build install --home ~"
+ End:
+*/
diff --git a/contrib/tools/python3/Modules/_ctypes/stgdict.c b/contrib/tools/python3/Modules/_ctypes/stgdict.c
new file mode 100644
index 00000000000..ae3f356c2e0
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ctypes/stgdict.c
@@ -0,0 +1,963 @@
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+// windows.h must be included before pycore internal headers
+#ifdef MS_WIN32
+# include <windows.h>
+#endif
+
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include <ffi.h>
+#ifdef MS_WIN32
+# include <malloc.h>
+#endif
+#include "ctypes.h"
+
+/******************************************************************/
+/*
+ StdDict - a dictionary subclass, containing additional C accessible fields
+
+ XXX blabla more
+*/
+
+/* Seems we need this, otherwise we get problems when calling
+ * PyDict_SetItem() (ma_lookup is NULL)
+ */
+static int
+PyCStgDict_init(StgDictObject *self, PyObject *args, PyObject *kwds)
+{
+ if (PyDict_Type.tp_init((PyObject *)self, args, kwds) < 0)
+ return -1;
+ self->format = NULL;
+ self->ndim = 0;
+ self->shape = NULL;
+ return 0;
+}
+
+static int
+PyCStgDict_clear(StgDictObject *self)
+{
+ Py_CLEAR(self->proto);
+ Py_CLEAR(self->argtypes);
+ Py_CLEAR(self->converters);
+ Py_CLEAR(self->restype);
+ Py_CLEAR(self->checker);
+ return 0;
+}
+
+static void
+PyCStgDict_dealloc(StgDictObject *self)
+{
+ PyCStgDict_clear(self);
+ PyMem_Free(self->format);
+ PyMem_Free(self->shape);
+ PyMem_Free(self->ffi_type_pointer.elements);
+ PyDict_Type.tp_dealloc((PyObject *)self);
+}
+
+static PyObject *
+PyCStgDict_sizeof(StgDictObject *self, void *unused)
+{
+ Py_ssize_t res;
+
+ res = _PyDict_SizeOf((PyDictObject *)self);
+ res += sizeof(StgDictObject) - sizeof(PyDictObject);
+ if (self->format)
+ res += strlen(self->format) + 1;
+ res += self->ndim * sizeof(Py_ssize_t);
+ if (self->ffi_type_pointer.elements)
+ res += (self->length + 1) * sizeof(ffi_type *);
+ return PyLong_FromSsize_t(res);
+}
+
+int
+PyCStgDict_clone(StgDictObject *dst, StgDictObject *src)
+{
+ char *d, *s;
+ Py_ssize_t size;
+
+ PyCStgDict_clear(dst);
+ PyMem_Free(dst->ffi_type_pointer.elements);
+ PyMem_Free(dst->format);
+ dst->format = NULL;
+ PyMem_Free(dst->shape);
+ dst->shape = NULL;
+ dst->ffi_type_pointer.elements = NULL;
+
+ d = (char *)dst;
+ s = (char *)src;
+ memcpy(d + sizeof(PyDictObject),
+ s + sizeof(PyDictObject),
+ sizeof(StgDictObject) - sizeof(PyDictObject));
+
+ Py_XINCREF(dst->proto);
+ Py_XINCREF(dst->argtypes);
+ Py_XINCREF(dst->converters);
+ Py_XINCREF(dst->restype);
+ Py_XINCREF(dst->checker);
+
+ if (src->format) {
+ dst->format = PyMem_Malloc(strlen(src->format) + 1);
+ if (dst->format == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ strcpy(dst->format, src->format);
+ }
+ if (src->shape) {
+ dst->shape = PyMem_Malloc(sizeof(Py_ssize_t) * src->ndim);
+ if (dst->shape == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ memcpy(dst->shape, src->shape,
+ sizeof(Py_ssize_t) * src->ndim);
+ }
+
+ if (src->ffi_type_pointer.elements == NULL)
+ return 0;
+ size = sizeof(ffi_type *) * (src->length + 1);
+ dst->ffi_type_pointer.elements = PyMem_Malloc(size);
+ if (dst->ffi_type_pointer.elements == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ memcpy(dst->ffi_type_pointer.elements,
+ src->ffi_type_pointer.elements,
+ size);
+ return 0;
+}
+
+static struct PyMethodDef PyCStgDict_methods[] = {
+ {"__sizeof__", (PyCFunction)PyCStgDict_sizeof, METH_NOARGS},
+ {NULL, NULL} /* sentinel */
+};
+
+PyTypeObject PyCStgDict_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "StgDict",
+ sizeof(StgDictObject),
+ 0,
+ (destructor)PyCStgDict_dealloc, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ PyCStgDict_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)PyCStgDict_init, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+};
+
+/* May return NULL, but does not set an exception! */
+StgDictObject *
+PyType_stgdict(PyObject *obj)
+{
+ PyTypeObject *type;
+
+ if (!PyType_Check(obj))
+ return NULL;
+ type = (PyTypeObject *)obj;
+ if (!type->tp_dict || !PyCStgDict_CheckExact(type->tp_dict))
+ return NULL;
+ return (StgDictObject *)type->tp_dict;
+}
+
+/* May return NULL, but does not set an exception! */
+/*
+ This function should be as fast as possible, so we don't call PyType_stgdict
+ above but inline the code, and avoid the PyType_Check().
+*/
+StgDictObject *
+PyObject_stgdict(PyObject *self)
+{
+ PyTypeObject *type = Py_TYPE(self);
+ if (!type->tp_dict || !PyCStgDict_CheckExact(type->tp_dict))
+ return NULL;
+ return (StgDictObject *)type->tp_dict;
+}
+
+/* descr is the descriptor for a field marked as anonymous. Get all the
+ _fields_ descriptors from descr->proto, create new descriptors with offset
+ and index adjusted, and stuff them into type.
+ */
+static int
+MakeFields(PyObject *type, CFieldObject *descr,
+ Py_ssize_t index, Py_ssize_t offset)
+{
+ Py_ssize_t i;
+ PyObject *fields;
+ PyObject *fieldlist;
+
+ fields = PyObject_GetAttrString(descr->proto, "_fields_");
+ if (fields == NULL)
+ return -1;
+ fieldlist = PySequence_Fast(fields, "_fields_ must be a sequence");
+ Py_DECREF(fields);
+ if (fieldlist == NULL)
+ return -1;
+
+ ctypes_state *st = GLOBAL_STATE();
+ PyTypeObject *cfield_tp = st->PyCField_Type;
+ for (i = 0; i < PySequence_Fast_GET_SIZE(fieldlist); ++i) {
+ PyObject *pair = PySequence_Fast_GET_ITEM(fieldlist, i); /* borrowed */
+ PyObject *fname, *ftype, *bits;
+ CFieldObject *fdescr;
+ CFieldObject *new_descr;
+ /* Convert to PyArg_UnpackTuple... */
+ if (!PyArg_ParseTuple(pair, "OO|O", &fname, &ftype, &bits)) {
+ Py_DECREF(fieldlist);
+ return -1;
+ }
+ fdescr = (CFieldObject *)PyObject_GetAttr(descr->proto, fname);
+ if (fdescr == NULL) {
+ Py_DECREF(fieldlist);
+ return -1;
+ }
+ if (!Py_IS_TYPE(fdescr, cfield_tp)) {
+ PyErr_SetString(PyExc_TypeError, "unexpected type");
+ Py_DECREF(fdescr);
+ Py_DECREF(fieldlist);
+ return -1;
+ }
+ if (fdescr->anonymous) {
+ int rc = MakeFields(type, fdescr,
+ index + fdescr->index,
+ offset + fdescr->offset);
+ Py_DECREF(fdescr);
+ if (rc == -1) {
+ Py_DECREF(fieldlist);
+ return -1;
+ }
+ continue;
+ }
+ new_descr = (CFieldObject *)cfield_tp->tp_alloc(cfield_tp, 0);
+ if (new_descr == NULL) {
+ Py_DECREF(fdescr);
+ Py_DECREF(fieldlist);
+ return -1;
+ }
+ assert(Py_IS_TYPE(new_descr, cfield_tp));
+ new_descr->size = fdescr->size;
+ new_descr->offset = fdescr->offset + offset;
+ new_descr->index = fdescr->index + index;
+ new_descr->proto = Py_XNewRef(fdescr->proto);
+ new_descr->getfunc = fdescr->getfunc;
+ new_descr->setfunc = fdescr->setfunc;
+
+ Py_DECREF(fdescr);
+
+ if (-1 == PyObject_SetAttr(type, fname, (PyObject *)new_descr)) {
+ Py_DECREF(fieldlist);
+ Py_DECREF(new_descr);
+ return -1;
+ }
+ Py_DECREF(new_descr);
+ }
+ Py_DECREF(fieldlist);
+ return 0;
+}
+
+/* Iterate over the names in the type's _anonymous_ attribute, if present,
+ */
+static int
+MakeAnonFields(PyObject *type)
+{
+ PyObject *anon;
+ PyObject *anon_names;
+ Py_ssize_t i;
+
+ if (_PyObject_LookupAttr(type, &_Py_ID(_anonymous_), &anon) < 0) {
+ return -1;
+ }
+ if (anon == NULL) {
+ return 0;
+ }
+ anon_names = PySequence_Fast(anon, "_anonymous_ must be a sequence");
+ Py_DECREF(anon);
+ if (anon_names == NULL)
+ return -1;
+
+ ctypes_state *st = GLOBAL_STATE();
+ PyTypeObject *cfield_tp = st->PyCField_Type;
+ for (i = 0; i < PySequence_Fast_GET_SIZE(anon_names); ++i) {
+ PyObject *fname = PySequence_Fast_GET_ITEM(anon_names, i); /* borrowed */
+ CFieldObject *descr = (CFieldObject *)PyObject_GetAttr(type, fname);
+ if (descr == NULL) {
+ Py_DECREF(anon_names);
+ return -1;
+ }
+ if (!Py_IS_TYPE(descr, cfield_tp)) {
+ PyErr_Format(PyExc_AttributeError,
+ "'%U' is specified in _anonymous_ but not in "
+ "_fields_",
+ fname);
+ Py_DECREF(anon_names);
+ Py_DECREF(descr);
+ return -1;
+ }
+ descr->anonymous = 1;
+
+ /* descr is in the field descriptor. */
+ if (-1 == MakeFields(type, (CFieldObject *)descr,
+ ((CFieldObject *)descr)->index,
+ ((CFieldObject *)descr)->offset)) {
+ Py_DECREF(descr);
+ Py_DECREF(anon_names);
+ return -1;
+ }
+ Py_DECREF(descr);
+ }
+
+ Py_DECREF(anon_names);
+ return 0;
+}
+
+/*
+ Allocate a memory block for a pep3118 format string, copy prefix (if
+ non-null) into it and append `{padding}x` to the end.
+ Returns NULL on failure, with the error indicator set.
+*/
+char *
+_ctypes_alloc_format_padding(const char *prefix, Py_ssize_t padding)
+{
+ /* int64 decimal characters + x + null */
+ char buf[19 + 1 + 1];
+
+ assert(padding > 0);
+
+ if (padding == 1) {
+ /* Use x instead of 1x, for brevity */
+ return _ctypes_alloc_format_string(prefix, "x");
+ }
+
+ int ret = PyOS_snprintf(buf, sizeof(buf), "%zdx", padding); (void)ret;
+ assert(0 <= ret && ret < (Py_ssize_t)sizeof(buf));
+ return _ctypes_alloc_format_string(prefix, buf);
+}
+
+/*
+ Retrieve the (optional) _pack_ attribute from a type, the _fields_ attribute,
+ and create an StgDictObject. Used for Structure and Union subclasses.
+*/
+int
+PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct)
+{
+ StgDictObject *stgdict, *basedict;
+ Py_ssize_t len, offset, size, align, i;
+ Py_ssize_t union_size, total_align, aligned_size;
+ Py_ssize_t field_size = 0;
+ int bitofs;
+ PyObject *tmp;
+ int pack;
+ Py_ssize_t ffi_ofs;
+ int big_endian;
+ int arrays_seen = 0;
+
+ if (fields == NULL)
+ return 0;
+
+ if (_PyObject_LookupAttr(type, &_Py_ID(_swappedbytes_), &tmp) < 0) {
+ return -1;
+ }
+ if (tmp) {
+ Py_DECREF(tmp);
+ big_endian = !PY_BIG_ENDIAN;
+ }
+ else {
+ big_endian = PY_BIG_ENDIAN;
+ }
+
+ if (_PyObject_LookupAttr(type, &_Py_ID(_pack_), &tmp) < 0) {
+ return -1;
+ }
+ if (tmp) {
+ pack = _PyLong_AsInt(tmp);
+ Py_DECREF(tmp);
+ if (pack < 0) {
+ if (!PyErr_Occurred() ||
+ PyErr_ExceptionMatches(PyExc_TypeError) ||
+ PyErr_ExceptionMatches(PyExc_OverflowError))
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "_pack_ must be a non-negative integer");
+ }
+ return -1;
+ }
+ }
+ else {
+ /* Setting `_pack_ = 0` amounts to using the default alignment */
+ pack = 0;
+ }
+
+ len = PySequence_Size(fields);
+ if (len == -1) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "'_fields_' must be a sequence of pairs");
+ }
+ return -1;
+ }
+
+ stgdict = PyType_stgdict(type);
+ if (!stgdict) {
+ PyErr_SetString(PyExc_TypeError,
+ "ctypes state is not initialized");
+ return -1;
+ }
+ /* If this structure/union is already marked final we cannot assign
+ _fields_ anymore. */
+
+ if (stgdict->flags & DICTFLAG_FINAL) {/* is final ? */
+ PyErr_SetString(PyExc_AttributeError,
+ "_fields_ is final");
+ return -1;
+ }
+
+ if (stgdict->format) {
+ PyMem_Free(stgdict->format);
+ stgdict->format = NULL;
+ }
+
+ if (stgdict->ffi_type_pointer.elements)
+ PyMem_Free(stgdict->ffi_type_pointer.elements);
+
+ basedict = PyType_stgdict((PyObject *)((PyTypeObject *)type)->tp_base);
+ if (basedict) {
+ stgdict->flags |= (basedict->flags &
+ (TYPEFLAG_HASUNION | TYPEFLAG_HASBITFIELD));
+ }
+ if (!isStruct) {
+ stgdict->flags |= TYPEFLAG_HASUNION;
+ }
+ if (basedict) {
+ size = offset = basedict->size;
+ align = basedict->align;
+ union_size = 0;
+ total_align = align ? align : 1;
+ stgdict->ffi_type_pointer.type = FFI_TYPE_STRUCT;
+ stgdict->ffi_type_pointer.elements = PyMem_New(ffi_type *, basedict->length + len + 1);
+ if (stgdict->ffi_type_pointer.elements == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ memset(stgdict->ffi_type_pointer.elements, 0,
+ sizeof(ffi_type *) * (basedict->length + len + 1));
+ if (basedict->length > 0) {
+ memcpy(stgdict->ffi_type_pointer.elements,
+ basedict->ffi_type_pointer.elements,
+ sizeof(ffi_type *) * (basedict->length));
+ }
+ ffi_ofs = basedict->length;
+ } else {
+ offset = 0;
+ size = 0;
+ align = 0;
+ union_size = 0;
+ total_align = 1;
+ stgdict->ffi_type_pointer.type = FFI_TYPE_STRUCT;
+ stgdict->ffi_type_pointer.elements = PyMem_New(ffi_type *, len + 1);
+ if (stgdict->ffi_type_pointer.elements == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ memset(stgdict->ffi_type_pointer.elements, 0,
+ sizeof(ffi_type *) * (len + 1));
+ ffi_ofs = 0;
+ }
+
+ assert(stgdict->format == NULL);
+ if (isStruct) {
+ stgdict->format = _ctypes_alloc_format_string(NULL, "T{");
+ } else {
+ /* PEP3118 doesn't support union. Use 'B' for bytes. */
+ stgdict->format = _ctypes_alloc_format_string(NULL, "B");
+ }
+ if (stgdict->format == NULL)
+ return -1;
+
+ for (i = 0; i < len; ++i) {
+ PyObject *name = NULL, *desc = NULL;
+ PyObject *pair = PySequence_GetItem(fields, i);
+ PyObject *prop;
+ StgDictObject *dict;
+ int bitsize = 0;
+
+ if (!pair || !PyArg_ParseTuple(pair, "UO|i", &name, &desc, &bitsize)) {
+ PyErr_SetString(PyExc_TypeError,
+ "'_fields_' must be a sequence of (name, C type) pairs");
+ Py_XDECREF(pair);
+ return -1;
+ }
+ if (PyCArrayTypeObject_Check(desc))
+ arrays_seen = 1;
+ dict = PyType_stgdict(desc);
+ if (dict == NULL) {
+ Py_DECREF(pair);
+ PyErr_Format(PyExc_TypeError,
+ "second item in _fields_ tuple (index %zd) must be a C type",
+ i);
+ return -1;
+ }
+ stgdict->ffi_type_pointer.elements[ffi_ofs + i] = &dict->ffi_type_pointer;
+ if (dict->flags & (TYPEFLAG_ISPOINTER | TYPEFLAG_HASPOINTER))
+ stgdict->flags |= TYPEFLAG_HASPOINTER;
+ stgdict->flags |= dict->flags & (TYPEFLAG_HASUNION | TYPEFLAG_HASBITFIELD);
+ dict->flags |= DICTFLAG_FINAL; /* mark field type final */
+ if (PyTuple_Size(pair) == 3) { /* bits specified */
+ stgdict->flags |= TYPEFLAG_HASBITFIELD;
+ switch(dict->ffi_type_pointer.type) {
+ case FFI_TYPE_UINT8:
+ case FFI_TYPE_UINT16:
+ case FFI_TYPE_UINT32:
+ case FFI_TYPE_SINT64:
+ case FFI_TYPE_UINT64:
+ break;
+
+ case FFI_TYPE_SINT8:
+ case FFI_TYPE_SINT16:
+ case FFI_TYPE_SINT32:
+ if (dict->getfunc != _ctypes_get_fielddesc("c")->getfunc
+ && dict->getfunc != _ctypes_get_fielddesc("u")->getfunc
+ )
+ break;
+ /* else fall through */
+ default:
+ PyErr_Format(PyExc_TypeError,
+ "bit fields not allowed for type %s",
+ ((PyTypeObject *)desc)->tp_name);
+ Py_DECREF(pair);
+ return -1;
+ }
+ if (bitsize <= 0 || bitsize > dict->size * 8) {
+ PyErr_SetString(PyExc_ValueError,
+ "number of bits invalid for bit field");
+ Py_DECREF(pair);
+ return -1;
+ }
+ } else
+ bitsize = 0;
+
+ if (isStruct) {
+ const char *fieldfmt = dict->format ? dict->format : "B";
+ const char *fieldname = PyUnicode_AsUTF8(name);
+ char *ptr;
+ Py_ssize_t len;
+ char *buf;
+ Py_ssize_t last_size = size;
+ Py_ssize_t padding;
+
+ if (fieldname == NULL)
+ {
+ Py_DECREF(pair);
+ return -1;
+ }
+
+ /* construct the field now, as `prop->offset` is `offset` with
+ corrected alignment */
+ prop = PyCField_FromDesc(desc, i,
+ &field_size, bitsize, &bitofs,
+ &size, &offset, &align,
+ pack, big_endian);
+ if (prop == NULL) {
+ Py_DECREF(pair);
+ return -1;
+ }
+
+ /* number of bytes between the end of the last field and the start
+ of this one */
+ padding = ((CFieldObject *)prop)->offset - last_size;
+
+ if (padding > 0) {
+ ptr = stgdict->format;
+ stgdict->format = _ctypes_alloc_format_padding(ptr, padding);
+ PyMem_Free(ptr);
+ if (stgdict->format == NULL) {
+ Py_DECREF(pair);
+ Py_DECREF(prop);
+ return -1;
+ }
+ }
+
+ len = strlen(fieldname) + strlen(fieldfmt);
+
+ buf = PyMem_Malloc(len + 2 + 1);
+ if (buf == NULL) {
+ Py_DECREF(pair);
+ Py_DECREF(prop);
+ PyErr_NoMemory();
+ return -1;
+ }
+ sprintf(buf, "%s:%s:", fieldfmt, fieldname);
+
+ ptr = stgdict->format;
+ if (dict->shape != NULL) {
+ stgdict->format = _ctypes_alloc_format_string_with_shape(
+ dict->ndim, dict->shape, stgdict->format, buf);
+ } else {
+ stgdict->format = _ctypes_alloc_format_string(stgdict->format, buf);
+ }
+ PyMem_Free(ptr);
+ PyMem_Free(buf);
+
+ if (stgdict->format == NULL) {
+ Py_DECREF(pair);
+ Py_DECREF(prop);
+ return -1;
+ }
+ } else /* union */ {
+ size = 0;
+ offset = 0;
+ align = 0;
+ prop = PyCField_FromDesc(desc, i,
+ &field_size, bitsize, &bitofs,
+ &size, &offset, &align,
+ pack, big_endian);
+ if (prop == NULL) {
+ Py_DECREF(pair);
+ return -1;
+ }
+ union_size = max(size, union_size);
+ }
+ total_align = max(align, total_align);
+
+ if (-1 == PyObject_SetAttr(type, name, prop)) {
+ Py_DECREF(prop);
+ Py_DECREF(pair);
+ return -1;
+ }
+ Py_DECREF(pair);
+ Py_DECREF(prop);
+ }
+
+ if (!isStruct) {
+ size = union_size;
+ }
+
+ /* Adjust the size according to the alignment requirements */
+ aligned_size = ((size + total_align - 1) / total_align) * total_align;
+
+ if (isStruct) {
+ char *ptr;
+ Py_ssize_t padding;
+
+ /* Pad up to the full size of the struct */
+ padding = aligned_size - size;
+ if (padding > 0) {
+ ptr = stgdict->format;
+ stgdict->format = _ctypes_alloc_format_padding(ptr, padding);
+ PyMem_Free(ptr);
+ if (stgdict->format == NULL) {
+ return -1;
+ }
+ }
+
+ ptr = stgdict->format;
+ stgdict->format = _ctypes_alloc_format_string(stgdict->format, "}");
+ PyMem_Free(ptr);
+ if (stgdict->format == NULL)
+ return -1;
+ }
+
+ stgdict->ffi_type_pointer.alignment = Py_SAFE_DOWNCAST(total_align,
+ Py_ssize_t,
+ unsigned short);
+ stgdict->ffi_type_pointer.size = aligned_size;
+
+ stgdict->size = aligned_size;
+ stgdict->align = total_align;
+ stgdict->length = ffi_ofs + len;
+
+/*
+ * The value of MAX_STRUCT_SIZE depends on the platform Python is running on.
+ */
+#if defined(__aarch64__) || defined(__arm__) || defined(_M_ARM64)
+# define MAX_STRUCT_SIZE 32
+#elif defined(__powerpc64__)
+# define MAX_STRUCT_SIZE 64
+#else
+# define MAX_STRUCT_SIZE 16
+#endif
+
+ if (arrays_seen && (size <= MAX_STRUCT_SIZE)) {
+ /*
+ * See bpo-22273 and gh-110190. Arrays are normally treated as
+ * pointers, which is fine when an array name is being passed as
+ * parameter, but not when passing structures by value that contain
+ * arrays.
+ * Small structures passed by value are passed in registers, and in
+ * order to do this, libffi needs to know the true type of the array
+ * members of structs. Treating them as pointers breaks things.
+ *
+ * Small structures have different sizes depending on the platform
+ * where Python is running on:
+ *
+ * * x86-64: 16 bytes or less
+ * * Arm platforms (both 32 and 64 bit): 32 bytes or less
+ * * PowerPC 64 Little Endian: 64 bytes or less
+ *
+ * In that case, there can't be more than 16, 32 or 64 elements after
+ * unrolling arrays, as we (will) disallow bitfields.
+ * So we can collect the true ffi_type values in a fixed-size local
+ * array on the stack and, if any arrays were seen, replace the
+ * ffi_type_pointer.elements with a more accurate set, to allow
+ * libffi to marshal them into registers correctly.
+ * It means one more loop over the fields, but if we got here,
+ * the structure is small, so there aren't too many of those.
+ *
+ * Although the passing in registers is specific to the above
+ * platforms, the array-in-struct vs. pointer problem is general.
+ * But we restrict the type transformation to small structs
+ * nonetheless.
+ *
+ * Note that although a union may be small in terms of memory usage, it
+ * could contain many overlapping declarations of arrays, e.g.
+ *
+ * union {
+ * unsigned int_8 foo [16];
+ * unsigned uint_8 bar [16];
+ * unsigned int_16 baz[8];
+ * unsigned uint_16 bozz[8];
+ * unsigned int_32 fizz[4];
+ * unsigned uint_32 buzz[4];
+ * }
+ *
+ * which is still only 16 bytes in size. We need to convert this into
+ * the following equivalent for libffi:
+ *
+ * union {
+ * struct { int_8 e1; int_8 e2; ... int_8 e_16; } f1;
+ * struct { uint_8 e1; uint_8 e2; ... uint_8 e_16; } f2;
+ * struct { int_16 e1; int_16 e2; ... int_16 e_8; } f3;
+ * struct { uint_16 e1; uint_16 e2; ... uint_16 e_8; } f4;
+ * struct { int_32 e1; int_32 e2; ... int_32 e_4; } f5;
+ * struct { uint_32 e1; uint_32 e2; ... uint_32 e_4; } f6;
+ * }
+ *
+ * The same principle applies for a struct 32 or 64 bytes in size.
+ *
+ * So the struct/union needs setting up as follows: all non-array
+ * elements copied across as is, and all array elements replaced with
+ * an equivalent struct which has as many fields as the array has
+ * elements, plus one NULL pointer.
+ */
+
+ Py_ssize_t num_ffi_type_pointers = 0; /* for the dummy fields */
+ Py_ssize_t num_ffi_types = 0; /* for the dummy structures */
+ size_t alloc_size; /* total bytes to allocate */
+ void *type_block; /* to hold all the type information needed */
+ ffi_type **element_types; /* of this struct/union */
+ ffi_type **dummy_types; /* of the dummy struct elements */
+ ffi_type *structs; /* point to struct aliases of arrays */
+ Py_ssize_t element_index; /* index into element_types for this */
+ Py_ssize_t dummy_index = 0; /* index into dummy field pointers */
+ Py_ssize_t struct_index = 0; /* index into dummy structs */
+
+ /* first pass to see how much memory to allocate */
+ for (i = 0; i < len; ++i) {
+ PyObject *name, *desc;
+ PyObject *pair = PySequence_GetItem(fields, i);
+ StgDictObject *dict;
+ int bitsize = 0;
+
+ if (pair == NULL) {
+ return -1;
+ }
+ if (!PyArg_ParseTuple(pair, "UO|i", &name, &desc, &bitsize)) {
+ PyErr_SetString(PyExc_TypeError,
+ "'_fields_' must be a sequence of (name, C type) pairs");
+ Py_DECREF(pair);
+ return -1;
+ }
+ dict = PyType_stgdict(desc);
+ if (dict == NULL) {
+ Py_DECREF(pair);
+ PyErr_Format(PyExc_TypeError,
+ "second item in _fields_ tuple (index %zd) must be a C type",
+ i);
+ return -1;
+ }
+ if (!PyCArrayTypeObject_Check(desc)) {
+ /* Not an array. Just need an ffi_type pointer. */
+ num_ffi_type_pointers++;
+ }
+ else {
+ /* It's an array. */
+ Py_ssize_t length = dict->length;
+ StgDictObject *edict;
+
+ edict = PyType_stgdict(dict->proto);
+ if (edict == NULL) {
+ Py_DECREF(pair);
+ PyErr_Format(PyExc_TypeError,
+ "second item in _fields_ tuple (index %zd) must be a C type",
+ i);
+ return -1;
+ }
+ /*
+ * We need one extra ffi_type to hold the struct, and one
+ * ffi_type pointer per array element + one for a NULL to
+ * mark the end.
+ */
+ num_ffi_types++;
+ num_ffi_type_pointers += length + 1;
+ }
+ Py_DECREF(pair);
+ }
+
+ /*
+ * At this point, we know we need storage for some ffi_types and some
+ * ffi_type pointers. We'll allocate these in one block.
+ * There are three sub-blocks of information: the ffi_type pointers to
+ * this structure/union's elements, the ffi_type_pointers to the
+ * dummy fields standing in for array elements, and the
+ * ffi_types representing the dummy structures.
+ */
+ alloc_size = (ffi_ofs + 1 + len + num_ffi_type_pointers) * sizeof(ffi_type *) +
+ num_ffi_types * sizeof(ffi_type);
+ type_block = PyMem_Malloc(alloc_size);
+
+ if (type_block == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ /*
+ * the first block takes up ffi_ofs + len + 1 which is the pointers *
+ * for this struct/union. The second block takes up
+ * num_ffi_type_pointers, so the sum of these is ffi_ofs + len + 1 +
+ * num_ffi_type_pointers as allocated above. The last bit is the
+ * num_ffi_types structs.
+ */
+ element_types = (ffi_type **) type_block;
+ dummy_types = &element_types[ffi_ofs + len + 1];
+ structs = (ffi_type *) &dummy_types[num_ffi_type_pointers];
+
+ if (num_ffi_types > 0) {
+ memset(structs, 0, num_ffi_types * sizeof(ffi_type));
+ }
+ if (ffi_ofs && (basedict != NULL)) {
+ memcpy(element_types,
+ basedict->ffi_type_pointer.elements,
+ ffi_ofs * sizeof(ffi_type *));
+ }
+ element_index = ffi_ofs;
+
+ /* second pass to actually set the type pointers */
+ for (i = 0; i < len; ++i) {
+ PyObject *name, *desc;
+ PyObject *pair = PySequence_GetItem(fields, i);
+ StgDictObject *dict;
+ int bitsize = 0;
+
+ if (pair == NULL) {
+ PyMem_Free(type_block);
+ return -1;
+ }
+ /* In theory, we made this call in the first pass, so it *shouldn't*
+ * fail. However, you never know, and the code above might change
+ * later - keeping the check in here is a tad defensive but it
+ * will affect program size only slightly and performance hardly at
+ * all.
+ */
+ if (!PyArg_ParseTuple(pair, "UO|i", &name, &desc, &bitsize)) {
+ PyErr_SetString(PyExc_TypeError,
+ "'_fields_' must be a sequence of (name, C type) pairs");
+ Py_DECREF(pair);
+ PyMem_Free(type_block);
+ return -1;
+ }
+ dict = PyType_stgdict(desc);
+ /* Possibly this check could be avoided, but see above comment. */
+ if (dict == NULL) {
+ Py_DECREF(pair);
+ PyMem_Free(type_block);
+ PyErr_Format(PyExc_TypeError,
+ "second item in _fields_ tuple (index %zd) must be a C type",
+ i);
+ return -1;
+ }
+ assert(element_index < (ffi_ofs + len)); /* will be used below */
+ if (!PyCArrayTypeObject_Check(desc)) {
+ /* Not an array. Just copy over the element ffi_type. */
+ element_types[element_index++] = &dict->ffi_type_pointer;
+ }
+ else {
+ Py_ssize_t length = dict->length;
+ StgDictObject *edict;
+
+ edict = PyType_stgdict(dict->proto);
+ if (edict == NULL) {
+ Py_DECREF(pair);
+ PyMem_Free(type_block);
+ PyErr_Format(PyExc_TypeError,
+ "second item in _fields_ tuple (index %zd) must be a C type",
+ i);
+ return -1;
+ }
+ element_types[element_index++] = &structs[struct_index];
+ structs[struct_index].size = length * edict->ffi_type_pointer.size;
+ structs[struct_index].alignment = edict->ffi_type_pointer.alignment;
+ structs[struct_index].type = FFI_TYPE_STRUCT;
+ structs[struct_index].elements = &dummy_types[dummy_index];
+ ++struct_index;
+ /* Copy over the element's type, length times. */
+ while (length > 0) {
+ assert(dummy_index < (num_ffi_type_pointers));
+ dummy_types[dummy_index++] = &edict->ffi_type_pointer;
+ length--;
+ }
+ assert(dummy_index < (num_ffi_type_pointers));
+ dummy_types[dummy_index++] = NULL;
+ }
+ Py_DECREF(pair);
+ }
+
+ element_types[element_index] = NULL;
+ /*
+ * Replace the old elements with the new, taking into account
+ * base class elements where necessary.
+ */
+ assert(stgdict->ffi_type_pointer.elements);
+ PyMem_Free(stgdict->ffi_type_pointer.elements);
+ stgdict->ffi_type_pointer.elements = element_types;
+ }
+
+ /* We did check that this flag was NOT set above, it must not
+ have been set until now. */
+ if (stgdict->flags & DICTFLAG_FINAL) {
+ PyErr_SetString(PyExc_AttributeError,
+ "Structure or union cannot contain itself");
+ return -1;
+ }
+ stgdict->flags |= DICTFLAG_FINAL;
+
+ return MakeAnonFields(type);
+}
diff --git a/contrib/tools/python3/src/Modules/_datetimemodule.c b/contrib/tools/python3/Modules/_datetimemodule.c
index c8dbc750b0e..c8dbc750b0e 100644
--- a/contrib/tools/python3/src/Modules/_datetimemodule.c
+++ b/contrib/tools/python3/Modules/_datetimemodule.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/_decimal.c b/contrib/tools/python3/Modules/_decimal/_decimal.c
index 70b13982bb0..70b13982bb0 100644
--- a/contrib/tools/python3/src/Modules/_decimal/_decimal.c
+++ b/contrib/tools/python3/Modules/_decimal/_decimal.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/docstrings.h b/contrib/tools/python3/Modules/_decimal/docstrings.h
index a1823cdd32b..a1823cdd32b 100644
--- a/contrib/tools/python3/src/Modules/_decimal/docstrings.h
+++ b/contrib/tools/python3/Modules/_decimal/docstrings.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/basearith.c b/contrib/tools/python3/Modules/_decimal/libmpdec/basearith.c
index 85c608fadf5..85c608fadf5 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/basearith.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/basearith.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/basearith.h b/contrib/tools/python3/Modules/_decimal/libmpdec/basearith.h
index d35925aaddb..d35925aaddb 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/basearith.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/basearith.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/bits.h b/contrib/tools/python3/Modules/_decimal/libmpdec/bits.h
index aa9c3e77980..aa9c3e77980 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/bits.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/bits.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/constants.c b/contrib/tools/python3/Modules/_decimal/libmpdec/constants.c
index ed074fa81c6..ed074fa81c6 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/constants.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/constants.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/constants.h b/contrib/tools/python3/Modules/_decimal/libmpdec/constants.h
index 7c1db839c20..7c1db839c20 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/constants.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/constants.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/context.c b/contrib/tools/python3/Modules/_decimal/libmpdec/context.c
index 172794b67d8..172794b67d8 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/context.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/context.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/convolute.c b/contrib/tools/python3/Modules/_decimal/libmpdec/convolute.c
index 4bc8e8b5fd3..4bc8e8b5fd3 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/convolute.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/convolute.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/convolute.h b/contrib/tools/python3/Modules/_decimal/libmpdec/convolute.h
index 62edb3e4573..62edb3e4573 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/convolute.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/convolute.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/crt.c b/contrib/tools/python3/Modules/_decimal/libmpdec/crt.c
index babcce41bf6..babcce41bf6 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/crt.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/crt.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/crt.h b/contrib/tools/python3/Modules/_decimal/libmpdec/crt.h
index ed66753c251..ed66753c251 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/crt.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/crt.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/difradix2.c b/contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.c
index 049ecff65b6..049ecff65b6 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/difradix2.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/difradix2.h b/contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.h
index cdcbcf9a710..cdcbcf9a710 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/difradix2.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/fnt.c b/contrib/tools/python3/Modules/_decimal/libmpdec/fnt.c
index 0dbe98fc71c..0dbe98fc71c 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/fnt.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/fnt.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/fnt.h b/contrib/tools/python3/Modules/_decimal/libmpdec/fnt.h
index 5222c476a3a..5222c476a3a 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/fnt.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/fnt.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/fourstep.c b/contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.c
index fb173ed5a52..fb173ed5a52 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/fourstep.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/fourstep.h b/contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.h
index 5ffb6fcc8ec..5ffb6fcc8ec 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/fourstep.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/io.c b/contrib/tools/python3/Modules/_decimal/libmpdec/io.c
index ecebe82e1f5..ecebe82e1f5 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/io.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/io.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpalloc.c b/contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.c
index 5871d5c0f53..5871d5c0f53 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpalloc.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpalloc.h b/contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.h
index 22650044218..22650044218 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpalloc.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpd_io.h b/contrib/tools/python3/Modules/_decimal/libmpdec/mpd_io.h
index 79d7c05ce36..79d7c05ce36 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpd_io.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/mpd_io.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpdecimal.c b/contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.c
index 959934bda7a..959934bda7a 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpdecimal.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpdecimal.h b/contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.h
index 8a5aa26b7b6..8a5aa26b7b6 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpdecimal.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpsignal.c b/contrib/tools/python3/Modules/_decimal/libmpdec/mpsignal.c
index fc2af48f4f3..fc2af48f4f3 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpsignal.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/mpsignal.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/numbertheory.c b/contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.c
index 210e0deb371..210e0deb371 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/numbertheory.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/numbertheory.h b/contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.h
index 47b7753b831..47b7753b831 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/numbertheory.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/sixstep.c b/contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.c
index a4d1dbed781..a4d1dbed781 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/sixstep.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/sixstep.h b/contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.h
index 89b4a33afc7..89b4a33afc7 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/sixstep.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/transpose.c b/contrib/tools/python3/Modules/_decimal/libmpdec/transpose.c
index 56321b5f39a..56321b5f39a 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/transpose.c
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/transpose.c
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/transpose.h b/contrib/tools/python3/Modules/_decimal/libmpdec/transpose.h
index e91c18d7435..e91c18d7435 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/transpose.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/transpose.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/typearith.h b/contrib/tools/python3/Modules/_decimal/libmpdec/typearith.h
index dd3776453d0..dd3776453d0 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/typearith.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/typearith.h
diff --git a/contrib/tools/python3/src/Modules/_decimal/libmpdec/umodarith.h b/contrib/tools/python3/Modules/_decimal/libmpdec/umodarith.h
index d7dbbbe6a73..d7dbbbe6a73 100644
--- a/contrib/tools/python3/src/Modules/_decimal/libmpdec/umodarith.h
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/umodarith.h
diff --git a/contrib/tools/python3/src/Modules/_elementtree.c b/contrib/tools/python3/Modules/_elementtree.c
index 620de8bb4c6..620de8bb4c6 100644
--- a/contrib/tools/python3/src/Modules/_elementtree.c
+++ b/contrib/tools/python3/Modules/_elementtree.c
diff --git a/contrib/tools/python3/src/Modules/_functoolsmodule.c b/contrib/tools/python3/Modules/_functoolsmodule.c
index a8001d71223..a8001d71223 100644
--- a/contrib/tools/python3/src/Modules/_functoolsmodule.c
+++ b/contrib/tools/python3/Modules/_functoolsmodule.c
diff --git a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_MD5.c b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.c
index 222ac824f01..222ac824f01 100644
--- a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_MD5.c
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.c
diff --git a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_MD5.h b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.h
index 13c19fd40f4..13c19fd40f4 100644
--- a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_MD5.h
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.h
diff --git a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA1.c b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.c
index 5ecb3c0b3a5..5ecb3c0b3a5 100644
--- a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA1.c
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.c
diff --git a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA1.h b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.h
index dc50aa6f6d3..dc50aa6f6d3 100644
--- a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA1.h
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.h
diff --git a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA2.c b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.c
index 08e3f7edbf4..08e3f7edbf4 100644
--- a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA2.c
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.c
diff --git a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA2.h b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.h
index a0e731094df..a0e731094df 100644
--- a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA2.h
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.h
diff --git a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA3.c b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.c
index b3febdfeb2b..b3febdfeb2b 100644
--- a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA3.c
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.c
diff --git a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA3.h b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.h
index 681b6af4a80..681b6af4a80 100644
--- a/contrib/tools/python3/src/Modules/_hacl/Hacl_Hash_SHA3.h
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.h
diff --git a/contrib/tools/python3/src/Modules/_hacl/Hacl_Streaming_Types.h b/contrib/tools/python3/Modules/_hacl/Hacl_Streaming_Types.h
index 15ef16ba607..15ef16ba607 100644
--- a/contrib/tools/python3/src/Modules/_hacl/Hacl_Streaming_Types.h
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Streaming_Types.h
diff --git a/contrib/tools/python3/src/Modules/_hacl/include/krml/FStar_UInt128_Verified.h b/contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt128_Verified.h
index 3d36d440735..3d36d440735 100644
--- a/contrib/tools/python3/src/Modules/_hacl/include/krml/FStar_UInt128_Verified.h
+++ b/contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt128_Verified.h
diff --git a/contrib/tools/python3/src/Modules/_hacl/include/krml/FStar_UInt_8_16_32_64.h b/contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt_8_16_32_64.h
index a56c7d61349..a56c7d61349 100644
--- a/contrib/tools/python3/src/Modules/_hacl/include/krml/FStar_UInt_8_16_32_64.h
+++ b/contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt_8_16_32_64.h
diff --git a/contrib/tools/python3/src/Modules/_hacl/include/krml/fstar_uint128_struct_endianness.h b/contrib/tools/python3/Modules/_hacl/include/krml/fstar_uint128_struct_endianness.h
index e2b6d62859a..e2b6d62859a 100644
--- a/contrib/tools/python3/src/Modules/_hacl/include/krml/fstar_uint128_struct_endianness.h
+++ b/contrib/tools/python3/Modules/_hacl/include/krml/fstar_uint128_struct_endianness.h
diff --git a/contrib/tools/python3/src/Modules/_hacl/include/krml/internal/target.h b/contrib/tools/python3/Modules/_hacl/include/krml/internal/target.h
index 5a2f94eb2ec..5a2f94eb2ec 100644
--- a/contrib/tools/python3/src/Modules/_hacl/include/krml/internal/target.h
+++ b/contrib/tools/python3/Modules/_hacl/include/krml/internal/target.h
diff --git a/contrib/tools/python3/Modules/_hacl/include/krml/lowstar_endianness.h b/contrib/tools/python3/Modules/_hacl/include/krml/lowstar_endianness.h
new file mode 100644
index 00000000000..b6c648602b9
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/include/krml/lowstar_endianness.h
@@ -0,0 +1,231 @@
+/* Copyright (c) INRIA and Microsoft Corporation. All rights reserved.
+ Licensed under the Apache 2.0 License. */
+
+#ifndef __LOWSTAR_ENDIANNESS_H
+#define __LOWSTAR_ENDIANNESS_H
+
+#include <string.h>
+#include <inttypes.h>
+
+/******************************************************************************/
+/* Implementing C.fst (part 2: endian-ness macros) */
+/******************************************************************************/
+
+/* ... for Linux */
+#if defined(__linux__) || defined(__CYGWIN__) || defined (__USE_SYSTEM_ENDIAN_H__) || defined(__GLIBC__)
+# include <endian.h>
+
+/* ... for OSX */
+#elif defined(__APPLE__)
+# include <libkern/OSByteOrder.h>
+# define htole64(x) OSSwapHostToLittleInt64(x)
+# define le64toh(x) OSSwapLittleToHostInt64(x)
+# define htobe64(x) OSSwapHostToBigInt64(x)
+# define be64toh(x) OSSwapBigToHostInt64(x)
+
+# define htole16(x) OSSwapHostToLittleInt16(x)
+# define le16toh(x) OSSwapLittleToHostInt16(x)
+# define htobe16(x) OSSwapHostToBigInt16(x)
+# define be16toh(x) OSSwapBigToHostInt16(x)
+
+# define htole32(x) OSSwapHostToLittleInt32(x)
+# define le32toh(x) OSSwapLittleToHostInt32(x)
+# define htobe32(x) OSSwapHostToBigInt32(x)
+# define be32toh(x) OSSwapBigToHostInt32(x)
+
+/* ... for Solaris */
+#elif defined(__sun__)
+# error #include <sys/byteorder.h>
+# define htole64(x) LE_64(x)
+# define le64toh(x) LE_64(x)
+# define htobe64(x) BE_64(x)
+# define be64toh(x) BE_64(x)
+
+# define htole16(x) LE_16(x)
+# define le16toh(x) LE_16(x)
+# define htobe16(x) BE_16(x)
+# define be16toh(x) BE_16(x)
+
+# define htole32(x) LE_32(x)
+# define le32toh(x) LE_32(x)
+# define htobe32(x) BE_32(x)
+# define be32toh(x) BE_32(x)
+
+/* ... for the BSDs */
+#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
+# include <sys/endian.h>
+#elif defined(__OpenBSD__)
+# include <endian.h>
+
+/* ... for Windows (MSVC)... not targeting XBOX 360! */
+#elif defined(_MSC_VER)
+
+# include <stdlib.h>
+# define htobe16(x) _byteswap_ushort(x)
+# define htole16(x) (x)
+# define be16toh(x) _byteswap_ushort(x)
+# define le16toh(x) (x)
+
+# define htobe32(x) _byteswap_ulong(x)
+# define htole32(x) (x)
+# define be32toh(x) _byteswap_ulong(x)
+# define le32toh(x) (x)
+
+# define htobe64(x) _byteswap_uint64(x)
+# define htole64(x) (x)
+# define be64toh(x) _byteswap_uint64(x)
+# define le64toh(x) (x)
+
+/* ... for Windows (GCC-like, e.g. mingw or clang) */
+#elif (defined(_WIN32) || defined(_WIN64) || defined(__EMSCRIPTEN__)) && \
+ (defined(__GNUC__) || defined(__clang__))
+
+# define htobe16(x) __builtin_bswap16(x)
+# define htole16(x) (x)
+# define be16toh(x) __builtin_bswap16(x)
+# define le16toh(x) (x)
+
+# define htobe32(x) __builtin_bswap32(x)
+# define htole32(x) (x)
+# define be32toh(x) __builtin_bswap32(x)
+# define le32toh(x) (x)
+
+# define htobe64(x) __builtin_bswap64(x)
+# define htole64(x) (x)
+# define be64toh(x) __builtin_bswap64(x)
+# define le64toh(x) (x)
+
+/* ... generic big-endian fallback code */
+/* ... AIX doesn't have __BYTE_ORDER__ (with XLC compiler) & is always big-endian */
+#elif (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) || defined(_AIX)
+
+/* byte swapping code inspired by:
+ * https://github.com/rweather/arduinolibs/blob/master/libraries/Crypto/utility/EndianUtil.h
+ * */
+
+# define htobe32(x) (x)
+# define be32toh(x) (x)
+# define htole32(x) \
+ (__extension__({ \
+ uint32_t _temp = (x); \
+ ((_temp >> 24) & 0x000000FF) | ((_temp >> 8) & 0x0000FF00) | \
+ ((_temp << 8) & 0x00FF0000) | ((_temp << 24) & 0xFF000000); \
+ }))
+# define le32toh(x) (htole32((x)))
+
+# define htobe64(x) (x)
+# define be64toh(x) (x)
+# define htole64(x) \
+ (__extension__({ \
+ uint64_t __temp = (x); \
+ uint32_t __low = htobe32((uint32_t)__temp); \
+ uint32_t __high = htobe32((uint32_t)(__temp >> 32)); \
+ (((uint64_t)__low) << 32) | __high; \
+ }))
+# define le64toh(x) (htole64((x)))
+
+/* ... generic little-endian fallback code */
+#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+
+# define htole32(x) (x)
+# define le32toh(x) (x)
+# define htobe32(x) \
+ (__extension__({ \
+ uint32_t _temp = (x); \
+ ((_temp >> 24) & 0x000000FF) | ((_temp >> 8) & 0x0000FF00) | \
+ ((_temp << 8) & 0x00FF0000) | ((_temp << 24) & 0xFF000000); \
+ }))
+# define be32toh(x) (htobe32((x)))
+
+# define htole64(x) (x)
+# define le64toh(x) (x)
+# define htobe64(x) \
+ (__extension__({ \
+ uint64_t __temp = (x); \
+ uint32_t __low = htobe32((uint32_t)__temp); \
+ uint32_t __high = htobe32((uint32_t)(__temp >> 32)); \
+ (((uint64_t)__low) << 32) | __high; \
+ }))
+# define be64toh(x) (htobe64((x)))
+
+/* ... couldn't determine endian-ness of the target platform */
+#else
+# error "Please define __BYTE_ORDER__!"
+
+#endif /* defined(__linux__) || ... */
+
+/* Loads and stores. These avoid undefined behavior due to unaligned memory
+ * accesses, via memcpy. */
+
+inline static uint16_t load16(uint8_t *b) {
+ uint16_t x;
+ memcpy(&x, b, 2);
+ return x;
+}
+
+inline static uint32_t load32(uint8_t *b) {
+ uint32_t x;
+ memcpy(&x, b, 4);
+ return x;
+}
+
+inline static uint64_t load64(uint8_t *b) {
+ uint64_t x;
+ memcpy(&x, b, 8);
+ return x;
+}
+
+inline static void store16(uint8_t *b, uint16_t i) {
+ memcpy(b, &i, 2);
+}
+
+inline static void store32(uint8_t *b, uint32_t i) {
+ memcpy(b, &i, 4);
+}
+
+inline static void store64(uint8_t *b, uint64_t i) {
+ memcpy(b, &i, 8);
+}
+
+/* Legacy accessors so that this header can serve as an implementation of
+ * C.Endianness */
+#define load16_le(b) (le16toh(load16(b)))
+#define store16_le(b, i) (store16(b, htole16(i)))
+#define load16_be(b) (be16toh(load16(b)))
+#define store16_be(b, i) (store16(b, htobe16(i)))
+
+#define load32_le(b) (le32toh(load32(b)))
+#define store32_le(b, i) (store32(b, htole32(i)))
+#define load32_be(b) (be32toh(load32(b)))
+#define store32_be(b, i) (store32(b, htobe32(i)))
+
+#define load64_le(b) (le64toh(load64(b)))
+#define store64_le(b, i) (store64(b, htole64(i)))
+#define load64_be(b) (be64toh(load64(b)))
+#define store64_be(b, i) (store64(b, htobe64(i)))
+
+/* Co-existence of LowStar.Endianness and FStar.Endianness generates name
+ * conflicts, because of course both insist on having no prefixes. Until a
+ * prefix is added, or until we truly retire FStar.Endianness, solve this issue
+ * in an elegant way. */
+#define load16_le0 load16_le
+#define store16_le0 store16_le
+#define load16_be0 load16_be
+#define store16_be0 store16_be
+
+#define load32_le0 load32_le
+#define store32_le0 store32_le
+#define load32_be0 load32_be
+#define store32_be0 store32_be
+
+#define load64_le0 load64_le
+#define store64_le0 store64_le
+#define load64_be0 load64_be
+#define store64_be0 store64_be
+
+#define load128_le0 load128_le
+#define store128_le0 store128_le
+#define load128_be0 load128_be
+#define store128_be0 store128_be
+
+#endif
diff --git a/contrib/tools/python3/src/Modules/_hacl/include/krml/types.h b/contrib/tools/python3/Modules/_hacl/include/krml/types.h
index 509f555536e..509f555536e 100644
--- a/contrib/tools/python3/src/Modules/_hacl/include/krml/types.h
+++ b/contrib/tools/python3/Modules/_hacl/include/krml/types.h
diff --git a/contrib/tools/python3/src/Modules/_hacl/internal/Hacl_Hash_MD5.h b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_MD5.h
index 87ad4cf228d..87ad4cf228d 100644
--- a/contrib/tools/python3/src/Modules/_hacl/internal/Hacl_Hash_MD5.h
+++ b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_MD5.h
diff --git a/contrib/tools/python3/src/Modules/_hacl/internal/Hacl_Hash_SHA1.h b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA1.h
index d2d9df44c6c..d2d9df44c6c 100644
--- a/contrib/tools/python3/src/Modules/_hacl/internal/Hacl_Hash_SHA1.h
+++ b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA1.h
diff --git a/contrib/tools/python3/src/Modules/_hacl/internal/Hacl_Hash_SHA2.h b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA2.h
index 851f7dc60c9..851f7dc60c9 100644
--- a/contrib/tools/python3/src/Modules/_hacl/internal/Hacl_Hash_SHA2.h
+++ b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA2.h
diff --git a/contrib/tools/python3/src/Modules/_hacl/internal/Hacl_Hash_SHA3.h b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA3.h
index 1c9808b8dd4..1c9808b8dd4 100644
--- a/contrib/tools/python3/src/Modules/_hacl/internal/Hacl_Hash_SHA3.h
+++ b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA3.h
diff --git a/contrib/tools/python3/src/Modules/_hacl/python_hacl_namespaces.h b/contrib/tools/python3/Modules/_hacl/python_hacl_namespaces.h
index 0df236282ac..0df236282ac 100644
--- a/contrib/tools/python3/src/Modules/_hacl/python_hacl_namespaces.h
+++ b/contrib/tools/python3/Modules/_hacl/python_hacl_namespaces.h
diff --git a/contrib/tools/python3/src/Modules/_hashopenssl.c b/contrib/tools/python3/Modules/_hashopenssl.c
index af6d1b23d3a..af6d1b23d3a 100644
--- a/contrib/tools/python3/src/Modules/_hashopenssl.c
+++ b/contrib/tools/python3/Modules/_hashopenssl.c
diff --git a/contrib/tools/python3/src/Modules/_heapqmodule.c b/contrib/tools/python3/Modules/_heapqmodule.c
index 00285ae01f8..00285ae01f8 100644
--- a/contrib/tools/python3/src/Modules/_heapqmodule.c
+++ b/contrib/tools/python3/Modules/_heapqmodule.c
diff --git a/contrib/tools/python3/src/Modules/_io/_iomodule.c b/contrib/tools/python3/Modules/_io/_iomodule.c
index 7b06c1bee5a..7b06c1bee5a 100644
--- a/contrib/tools/python3/src/Modules/_io/_iomodule.c
+++ b/contrib/tools/python3/Modules/_io/_iomodule.c
diff --git a/contrib/tools/python3/src/Modules/_io/_iomodule.h b/contrib/tools/python3/Modules/_io/_iomodule.h
index afd638a120b..afd638a120b 100644
--- a/contrib/tools/python3/src/Modules/_io/_iomodule.h
+++ b/contrib/tools/python3/Modules/_io/_iomodule.h
diff --git a/contrib/tools/python3/src/Modules/_io/bufferedio.c b/contrib/tools/python3/Modules/_io/bufferedio.c
index f30d54a5e11..f30d54a5e11 100644
--- a/contrib/tools/python3/src/Modules/_io/bufferedio.c
+++ b/contrib/tools/python3/Modules/_io/bufferedio.c
diff --git a/contrib/tools/python3/src/Modules/_io/bytesio.c b/contrib/tools/python3/Modules/_io/bytesio.c
index 9459affa4a8..9459affa4a8 100644
--- a/contrib/tools/python3/src/Modules/_io/bytesio.c
+++ b/contrib/tools/python3/Modules/_io/bytesio.c
diff --git a/contrib/tools/python3/src/Modules/_io/clinic/_iomodule.c.h b/contrib/tools/python3/Modules/_io/clinic/_iomodule.c.h
index 4d76e333b0f..4d76e333b0f 100644
--- a/contrib/tools/python3/src/Modules/_io/clinic/_iomodule.c.h
+++ b/contrib/tools/python3/Modules/_io/clinic/_iomodule.c.h
diff --git a/contrib/tools/python3/src/Modules/_io/clinic/bufferedio.c.h b/contrib/tools/python3/Modules/_io/clinic/bufferedio.c.h
index 3becf4a5e3b..3becf4a5e3b 100644
--- a/contrib/tools/python3/src/Modules/_io/clinic/bufferedio.c.h
+++ b/contrib/tools/python3/Modules/_io/clinic/bufferedio.c.h
diff --git a/contrib/tools/python3/src/Modules/_io/clinic/bytesio.c.h b/contrib/tools/python3/Modules/_io/clinic/bytesio.c.h
index c816ef5d6bb..c816ef5d6bb 100644
--- a/contrib/tools/python3/src/Modules/_io/clinic/bytesio.c.h
+++ b/contrib/tools/python3/Modules/_io/clinic/bytesio.c.h
diff --git a/contrib/tools/python3/src/Modules/_io/clinic/fileio.c.h b/contrib/tools/python3/Modules/_io/clinic/fileio.c.h
index 0d94e6cec69..0d94e6cec69 100644
--- a/contrib/tools/python3/src/Modules/_io/clinic/fileio.c.h
+++ b/contrib/tools/python3/Modules/_io/clinic/fileio.c.h
diff --git a/contrib/tools/python3/src/Modules/_io/clinic/iobase.c.h b/contrib/tools/python3/Modules/_io/clinic/iobase.c.h
index 328ea95e3f8..328ea95e3f8 100644
--- a/contrib/tools/python3/src/Modules/_io/clinic/iobase.c.h
+++ b/contrib/tools/python3/Modules/_io/clinic/iobase.c.h
diff --git a/contrib/tools/python3/src/Modules/_io/clinic/stringio.c.h b/contrib/tools/python3/Modules/_io/clinic/stringio.c.h
index d495dd10c16..d495dd10c16 100644
--- a/contrib/tools/python3/src/Modules/_io/clinic/stringio.c.h
+++ b/contrib/tools/python3/Modules/_io/clinic/stringio.c.h
diff --git a/contrib/tools/python3/src/Modules/_io/clinic/textio.c.h b/contrib/tools/python3/Modules/_io/clinic/textio.c.h
index 1f67434f881..1f67434f881 100644
--- a/contrib/tools/python3/src/Modules/_io/clinic/textio.c.h
+++ b/contrib/tools/python3/Modules/_io/clinic/textio.c.h
diff --git a/contrib/tools/python3/src/Modules/_io/clinic/winconsoleio.c.h b/contrib/tools/python3/Modules/_io/clinic/winconsoleio.c.h
index 064ed3814d9..064ed3814d9 100644
--- a/contrib/tools/python3/src/Modules/_io/clinic/winconsoleio.c.h
+++ b/contrib/tools/python3/Modules/_io/clinic/winconsoleio.c.h
diff --git a/contrib/tools/python3/src/Modules/_io/fileio.c b/contrib/tools/python3/Modules/_io/fileio.c
index bab68077a21..bab68077a21 100644
--- a/contrib/tools/python3/src/Modules/_io/fileio.c
+++ b/contrib/tools/python3/Modules/_io/fileio.c
diff --git a/contrib/tools/python3/src/Modules/_io/iobase.c b/contrib/tools/python3/Modules/_io/iobase.c
index bc2c9afa016..bc2c9afa016 100644
--- a/contrib/tools/python3/src/Modules/_io/iobase.c
+++ b/contrib/tools/python3/Modules/_io/iobase.c
diff --git a/contrib/tools/python3/src/Modules/_io/stringio.c b/contrib/tools/python3/Modules/_io/stringio.c
index 3eb25704b4a..3eb25704b4a 100644
--- a/contrib/tools/python3/src/Modules/_io/stringio.c
+++ b/contrib/tools/python3/Modules/_io/stringio.c
diff --git a/contrib/tools/python3/src/Modules/_io/textio.c b/contrib/tools/python3/Modules/_io/textio.c
index 14dd19d95c2..14dd19d95c2 100644
--- a/contrib/tools/python3/src/Modules/_io/textio.c
+++ b/contrib/tools/python3/Modules/_io/textio.c
diff --git a/contrib/tools/python3/src/Modules/_io/winconsoleio.c b/contrib/tools/python3/Modules/_io/winconsoleio.c
index c2c365e0807..c2c365e0807 100644
--- a/contrib/tools/python3/src/Modules/_io/winconsoleio.c
+++ b/contrib/tools/python3/Modules/_io/winconsoleio.c
diff --git a/contrib/tools/python3/src/Modules/_json.c b/contrib/tools/python3/Modules/_json.c
index c90de05b046..c90de05b046 100644
--- a/contrib/tools/python3/src/Modules/_json.c
+++ b/contrib/tools/python3/Modules/_json.c
diff --git a/contrib/tools/python3/src/Modules/_localemodule.c b/contrib/tools/python3/Modules/_localemodule.c
index cbd036fdf2a..cbd036fdf2a 100644
--- a/contrib/tools/python3/src/Modules/_localemodule.c
+++ b/contrib/tools/python3/Modules/_localemodule.c
diff --git a/contrib/tools/python3/src/Modules/_lsprof.c b/contrib/tools/python3/Modules/_lsprof.c
index 257de4387c0..257de4387c0 100644
--- a/contrib/tools/python3/src/Modules/_lsprof.c
+++ b/contrib/tools/python3/Modules/_lsprof.c
diff --git a/contrib/tools/python3/src/Modules/_lzmamodule.c b/contrib/tools/python3/Modules/_lzmamodule.c
index 7bbd6569aa2..7bbd6569aa2 100644
--- a/contrib/tools/python3/src/Modules/_lzmamodule.c
+++ b/contrib/tools/python3/Modules/_lzmamodule.c
diff --git a/contrib/tools/python3/src/Modules/_math.h b/contrib/tools/python3/Modules/_math.h
index 2285b64747c..2285b64747c 100644
--- a/contrib/tools/python3/src/Modules/_math.h
+++ b/contrib/tools/python3/Modules/_math.h
diff --git a/contrib/tools/python3/src/Modules/_multiprocessing/clinic/multiprocessing.c.h b/contrib/tools/python3/Modules/_multiprocessing/clinic/multiprocessing.c.h
index 885cd5c2fff..885cd5c2fff 100644
--- a/contrib/tools/python3/src/Modules/_multiprocessing/clinic/multiprocessing.c.h
+++ b/contrib/tools/python3/Modules/_multiprocessing/clinic/multiprocessing.c.h
diff --git a/contrib/tools/python3/src/Modules/_multiprocessing/clinic/posixshmem.c.h b/contrib/tools/python3/Modules/_multiprocessing/clinic/posixshmem.c.h
index df2aa29cfe6..df2aa29cfe6 100644
--- a/contrib/tools/python3/src/Modules/_multiprocessing/clinic/posixshmem.c.h
+++ b/contrib/tools/python3/Modules/_multiprocessing/clinic/posixshmem.c.h
diff --git a/contrib/tools/python3/src/Modules/_multiprocessing/clinic/semaphore.c.h b/contrib/tools/python3/Modules/_multiprocessing/clinic/semaphore.c.h
index 35347169bc1..35347169bc1 100644
--- a/contrib/tools/python3/src/Modules/_multiprocessing/clinic/semaphore.c.h
+++ b/contrib/tools/python3/Modules/_multiprocessing/clinic/semaphore.c.h
diff --git a/contrib/tools/python3/src/Modules/_multiprocessing/multiprocessing.c b/contrib/tools/python3/Modules/_multiprocessing/multiprocessing.c
index 8f9daa5c3de..8f9daa5c3de 100644
--- a/contrib/tools/python3/src/Modules/_multiprocessing/multiprocessing.c
+++ b/contrib/tools/python3/Modules/_multiprocessing/multiprocessing.c
diff --git a/contrib/tools/python3/src/Modules/_multiprocessing/multiprocessing.h b/contrib/tools/python3/Modules/_multiprocessing/multiprocessing.h
index dfc2a8e0799..dfc2a8e0799 100644
--- a/contrib/tools/python3/src/Modules/_multiprocessing/multiprocessing.h
+++ b/contrib/tools/python3/Modules/_multiprocessing/multiprocessing.h
diff --git a/contrib/tools/python3/src/Modules/_multiprocessing/posixshmem.c b/contrib/tools/python3/Modules/_multiprocessing/posixshmem.c
index 88c93fe3137..88c93fe3137 100644
--- a/contrib/tools/python3/src/Modules/_multiprocessing/posixshmem.c
+++ b/contrib/tools/python3/Modules/_multiprocessing/posixshmem.c
diff --git a/contrib/tools/python3/src/Modules/_multiprocessing/semaphore.c b/contrib/tools/python3/Modules/_multiprocessing/semaphore.c
index c7df82dfe2d..c7df82dfe2d 100644
--- a/contrib/tools/python3/src/Modules/_multiprocessing/semaphore.c
+++ b/contrib/tools/python3/Modules/_multiprocessing/semaphore.c
diff --git a/contrib/tools/python3/src/Modules/_opcode.c b/contrib/tools/python3/Modules/_opcode.c
index b70d426fa29..b70d426fa29 100644
--- a/contrib/tools/python3/src/Modules/_opcode.c
+++ b/contrib/tools/python3/Modules/_opcode.c
diff --git a/contrib/tools/python3/src/Modules/_operator.c b/contrib/tools/python3/Modules/_operator.c
index 68ccc90562d..68ccc90562d 100644
--- a/contrib/tools/python3/src/Modules/_operator.c
+++ b/contrib/tools/python3/Modules/_operator.c
diff --git a/contrib/tools/python3/Modules/_pickle.c b/contrib/tools/python3/Modules/_pickle.c
new file mode 100644
index 00000000000..2bf9977f0b7
--- /dev/null
+++ b/contrib/tools/python3/Modules/_pickle.c
@@ -0,0 +1,7986 @@
+/* pickle accelerator C extensor: _pickle module.
+ *
+ * It is built as a built-in module (Py_BUILD_CORE_BUILTIN define) on Windows
+ * and as an extension module (Py_BUILD_CORE_MODULE define) on other
+ * platforms. */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_runtime.h" // _Py_ID()
+#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "structmember.h" // PyMemberDef
+
+#include <stdlib.h> // strtol()
+
+PyDoc_STRVAR(pickle_module_doc,
+"Optimized C implementation for the Python pickle module.");
+
+/*[clinic input]
+module _pickle
+class _pickle.Pickler "PicklerObject *" ""
+class _pickle.PicklerMemoProxy "PicklerMemoProxyObject *" ""
+class _pickle.Unpickler "UnpicklerObject *" ""
+class _pickle.UnpicklerMemoProxy "UnpicklerMemoProxyObject *" ""
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=b6d7191ab6466cda]*/
+
+/* Bump HIGHEST_PROTOCOL when new opcodes are added to the pickle protocol.
+ Bump DEFAULT_PROTOCOL only when the oldest still supported version of Python
+ already includes it. */
+enum {
+ HIGHEST_PROTOCOL = 5,
+ DEFAULT_PROTOCOL = 4
+};
+
+#ifdef MS_WINDOWS
+// These are already typedefs from windows.h, pulled in via pycore_runtime.h.
+#define FLOAT FLOAT_
+#define INT INT_
+#define LONG LONG_
+
+/* This can already be defined on Windows to set the character set
+ the Windows header files treat as default */
+#ifdef UNICODE
+#undef UNICODE
+#endif
+#endif
+
+/* Pickle opcodes. These must be kept updated with pickle.py.
+ Extensive docs are in pickletools.py. */
+enum opcode {
+ MARK = '(',
+ STOP = '.',
+ POP = '0',
+ POP_MARK = '1',
+ DUP = '2',
+ FLOAT = 'F',
+ INT = 'I',
+ BININT = 'J',
+ BININT1 = 'K',
+ LONG = 'L',
+ BININT2 = 'M',
+ NONE = 'N',
+ PERSID = 'P',
+ BINPERSID = 'Q',
+ REDUCE = 'R',
+ STRING = 'S',
+ BINSTRING = 'T',
+ SHORT_BINSTRING = 'U',
+ UNICODE = 'V',
+ BINUNICODE = 'X',
+ APPEND = 'a',
+ BUILD = 'b',
+ GLOBAL = 'c',
+ DICT = 'd',
+ EMPTY_DICT = '}',
+ APPENDS = 'e',
+ GET = 'g',
+ BINGET = 'h',
+ INST = 'i',
+ LONG_BINGET = 'j',
+ LIST = 'l',
+ EMPTY_LIST = ']',
+ OBJ = 'o',
+ PUT = 'p',
+ BINPUT = 'q',
+ LONG_BINPUT = 'r',
+ SETITEM = 's',
+ TUPLE = 't',
+ EMPTY_TUPLE = ')',
+ SETITEMS = 'u',
+ BINFLOAT = 'G',
+
+ /* Protocol 2. */
+ PROTO = '\x80',
+ NEWOBJ = '\x81',
+ EXT1 = '\x82',
+ EXT2 = '\x83',
+ EXT4 = '\x84',
+ TUPLE1 = '\x85',
+ TUPLE2 = '\x86',
+ TUPLE3 = '\x87',
+ NEWTRUE = '\x88',
+ NEWFALSE = '\x89',
+ LONG1 = '\x8a',
+ LONG4 = '\x8b',
+
+ /* Protocol 3 (Python 3.x) */
+ BINBYTES = 'B',
+ SHORT_BINBYTES = 'C',
+
+ /* Protocol 4 */
+ SHORT_BINUNICODE = '\x8c',
+ BINUNICODE8 = '\x8d',
+ BINBYTES8 = '\x8e',
+ EMPTY_SET = '\x8f',
+ ADDITEMS = '\x90',
+ FROZENSET = '\x91',
+ NEWOBJ_EX = '\x92',
+ STACK_GLOBAL = '\x93',
+ MEMOIZE = '\x94',
+ FRAME = '\x95',
+
+ /* Protocol 5 */
+ BYTEARRAY8 = '\x96',
+ NEXT_BUFFER = '\x97',
+ READONLY_BUFFER = '\x98'
+};
+
+enum {
+ /* Keep in synch with pickle.Pickler._BATCHSIZE. This is how many elements
+ batch_list/dict() pumps out before doing APPENDS/SETITEMS. Nothing will
+ break if this gets out of synch with pickle.py, but it's unclear that would
+ help anything either. */
+ BATCHSIZE = 1000,
+
+ /* Nesting limit until Pickler, when running in "fast mode", starts
+ checking for self-referential data-structures. */
+ FAST_NESTING_LIMIT = 50,
+
+ /* Initial size of the write buffer of Pickler. */
+ WRITE_BUF_SIZE = 4096,
+
+ /* Prefetch size when unpickling (disabled on unpeekable streams) */
+ PREFETCH = 8192 * 16,
+
+ FRAME_SIZE_MIN = 4,
+ FRAME_SIZE_TARGET = 64 * 1024,
+ FRAME_HEADER_SIZE = 9
+};
+
+/*************************************************************************/
+
+/* State of the pickle module, per PEP 3121. */
+typedef struct {
+ /* Exception classes for pickle. */
+ PyObject *PickleError;
+ PyObject *PicklingError;
+ PyObject *UnpicklingError;
+
+ /* copyreg.dispatch_table, {type_object: pickling_function} */
+ PyObject *dispatch_table;
+
+ /* For the extension opcodes EXT1, EXT2 and EXT4. */
+
+ /* copyreg._extension_registry, {(module_name, function_name): code} */
+ PyObject *extension_registry;
+ /* copyreg._extension_cache, {code: object} */
+ PyObject *extension_cache;
+ /* copyreg._inverted_registry, {code: (module_name, function_name)} */
+ PyObject *inverted_registry;
+
+ /* Import mappings for compatibility with Python 2.x */
+
+ /* _compat_pickle.NAME_MAPPING,
+ {(oldmodule, oldname): (newmodule, newname)} */
+ PyObject *name_mapping_2to3;
+ /* _compat_pickle.IMPORT_MAPPING, {oldmodule: newmodule} */
+ PyObject *import_mapping_2to3;
+ /* Same, but with REVERSE_NAME_MAPPING / REVERSE_IMPORT_MAPPING */
+ PyObject *name_mapping_3to2;
+ PyObject *import_mapping_3to2;
+
+ /* codecs.encode, used for saving bytes in older protocols */
+ PyObject *codecs_encode;
+ /* builtins.getattr, used for saving nested names with protocol < 4 */
+ PyObject *getattr;
+ /* functools.partial, used for implementing __newobj_ex__ with protocols
+ 2 and 3 */
+ PyObject *partial;
+
+ /* Types */
+ PyTypeObject *Pickler_Type;
+ PyTypeObject *Unpickler_Type;
+ PyTypeObject *Pdata_Type;
+ PyTypeObject *PicklerMemoProxyType;
+ PyTypeObject *UnpicklerMemoProxyType;
+} PickleState;
+
+/* Forward declaration of the _pickle module definition. */
+static struct PyModuleDef _picklemodule;
+
+/* Given a module object, get its per-module state. */
+static inline PickleState *
+_Pickle_GetState(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (PickleState *)state;
+}
+
+static inline PickleState *
+_Pickle_GetStateByClass(PyTypeObject *cls)
+{
+ void *state = _PyType_GetModuleState(cls);
+ assert(state != NULL);
+ return (PickleState *)state;
+}
+
+static inline PickleState *
+_Pickle_FindStateByType(PyTypeObject *tp)
+{
+ PyObject *module = PyType_GetModuleByDef(tp, &_picklemodule);
+ assert(module != NULL);
+ return _Pickle_GetState(module);
+}
+
+/* Clear the given pickle module state. */
+static void
+_Pickle_ClearState(PickleState *st)
+{
+ Py_CLEAR(st->PickleError);
+ Py_CLEAR(st->PicklingError);
+ Py_CLEAR(st->UnpicklingError);
+ Py_CLEAR(st->dispatch_table);
+ Py_CLEAR(st->extension_registry);
+ Py_CLEAR(st->extension_cache);
+ Py_CLEAR(st->inverted_registry);
+ Py_CLEAR(st->name_mapping_2to3);
+ Py_CLEAR(st->import_mapping_2to3);
+ Py_CLEAR(st->name_mapping_3to2);
+ Py_CLEAR(st->import_mapping_3to2);
+ Py_CLEAR(st->codecs_encode);
+ Py_CLEAR(st->getattr);
+ Py_CLEAR(st->partial);
+ Py_CLEAR(st->Pickler_Type);
+ Py_CLEAR(st->Unpickler_Type);
+ Py_CLEAR(st->Pdata_Type);
+ Py_CLEAR(st->PicklerMemoProxyType);
+ Py_CLEAR(st->UnpicklerMemoProxyType);
+}
+
+/* Initialize the given pickle module state. */
+static int
+_Pickle_InitState(PickleState *st)
+{
+ PyObject *copyreg = NULL;
+ PyObject *compat_pickle = NULL;
+
+ st->getattr = _PyEval_GetBuiltin(&_Py_ID(getattr));
+ if (st->getattr == NULL)
+ goto error;
+
+ copyreg = PyImport_ImportModule("copyreg");
+ if (!copyreg)
+ goto error;
+ st->dispatch_table = PyObject_GetAttrString(copyreg, "dispatch_table");
+ if (!st->dispatch_table)
+ goto error;
+ if (!PyDict_CheckExact(st->dispatch_table)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "copyreg.dispatch_table should be a dict, not %.200s",
+ Py_TYPE(st->dispatch_table)->tp_name);
+ goto error;
+ }
+ st->extension_registry = \
+ PyObject_GetAttrString(copyreg, "_extension_registry");
+ if (!st->extension_registry)
+ goto error;
+ if (!PyDict_CheckExact(st->extension_registry)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "copyreg._extension_registry should be a dict, "
+ "not %.200s", Py_TYPE(st->extension_registry)->tp_name);
+ goto error;
+ }
+ st->inverted_registry = \
+ PyObject_GetAttrString(copyreg, "_inverted_registry");
+ if (!st->inverted_registry)
+ goto error;
+ if (!PyDict_CheckExact(st->inverted_registry)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "copyreg._inverted_registry should be a dict, "
+ "not %.200s", Py_TYPE(st->inverted_registry)->tp_name);
+ goto error;
+ }
+ st->extension_cache = PyObject_GetAttrString(copyreg, "_extension_cache");
+ if (!st->extension_cache)
+ goto error;
+ if (!PyDict_CheckExact(st->extension_cache)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "copyreg._extension_cache should be a dict, "
+ "not %.200s", Py_TYPE(st->extension_cache)->tp_name);
+ goto error;
+ }
+ Py_CLEAR(copyreg);
+
+ /* Load the 2.x -> 3.x stdlib module mapping tables */
+ compat_pickle = PyImport_ImportModule("_compat_pickle");
+ if (!compat_pickle)
+ goto error;
+ st->name_mapping_2to3 = \
+ PyObject_GetAttrString(compat_pickle, "NAME_MAPPING");
+ if (!st->name_mapping_2to3)
+ goto error;
+ if (!PyDict_CheckExact(st->name_mapping_2to3)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.NAME_MAPPING should be a dict, not %.200s",
+ Py_TYPE(st->name_mapping_2to3)->tp_name);
+ goto error;
+ }
+ st->import_mapping_2to3 = \
+ PyObject_GetAttrString(compat_pickle, "IMPORT_MAPPING");
+ if (!st->import_mapping_2to3)
+ goto error;
+ if (!PyDict_CheckExact(st->import_mapping_2to3)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.IMPORT_MAPPING should be a dict, "
+ "not %.200s", Py_TYPE(st->import_mapping_2to3)->tp_name);
+ goto error;
+ }
+ /* ... and the 3.x -> 2.x mapping tables */
+ st->name_mapping_3to2 = \
+ PyObject_GetAttrString(compat_pickle, "REVERSE_NAME_MAPPING");
+ if (!st->name_mapping_3to2)
+ goto error;
+ if (!PyDict_CheckExact(st->name_mapping_3to2)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.REVERSE_NAME_MAPPING should be a dict, "
+ "not %.200s", Py_TYPE(st->name_mapping_3to2)->tp_name);
+ goto error;
+ }
+ st->import_mapping_3to2 = \
+ PyObject_GetAttrString(compat_pickle, "REVERSE_IMPORT_MAPPING");
+ if (!st->import_mapping_3to2)
+ goto error;
+ if (!PyDict_CheckExact(st->import_mapping_3to2)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.REVERSE_IMPORT_MAPPING should be a dict, "
+ "not %.200s", Py_TYPE(st->import_mapping_3to2)->tp_name);
+ goto error;
+ }
+ Py_CLEAR(compat_pickle);
+
+ st->codecs_encode = _PyImport_GetModuleAttrString("codecs", "encode");
+ if (st->codecs_encode == NULL) {
+ goto error;
+ }
+ if (!PyCallable_Check(st->codecs_encode)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "codecs.encode should be a callable, not %.200s",
+ Py_TYPE(st->codecs_encode)->tp_name);
+ goto error;
+ }
+
+ st->partial = _PyImport_GetModuleAttrString("functools", "partial");
+ if (!st->partial)
+ goto error;
+
+ return 0;
+
+ error:
+ Py_CLEAR(copyreg);
+ Py_CLEAR(compat_pickle);
+ _Pickle_ClearState(st);
+ return -1;
+}
+
+/* Helper for calling a function with a single argument quickly.
+
+ This function steals the reference of the given argument. */
+static PyObject *
+_Pickle_FastCall(PyObject *func, PyObject *obj)
+{
+ PyObject *result;
+
+ result = PyObject_CallOneArg(func, obj);
+ Py_DECREF(obj);
+ return result;
+}
+
+/*************************************************************************/
+
+/* Retrieve and deconstruct a method for avoiding a reference cycle
+ (pickler -> bound method of pickler -> pickler) */
+static int
+init_method_ref(PyObject *self, PyObject *name,
+ PyObject **method_func, PyObject **method_self)
+{
+ PyObject *func, *func2;
+ int ret;
+
+ /* *method_func and *method_self should be consistent. All refcount decrements
+ should be occurred after setting *method_self and *method_func. */
+ ret = _PyObject_LookupAttr(self, name, &func);
+ if (func == NULL) {
+ *method_self = NULL;
+ Py_CLEAR(*method_func);
+ return ret;
+ }
+
+ if (PyMethod_Check(func) && PyMethod_GET_SELF(func) == self) {
+ /* Deconstruct a bound Python method */
+ *method_self = self; /* borrowed */
+ func2 = PyMethod_GET_FUNCTION(func);
+ Py_XSETREF(*method_func, Py_NewRef(func2));
+ Py_DECREF(func);
+ return 0;
+ }
+ else {
+ *method_self = NULL;
+ Py_XSETREF(*method_func, func);
+ return 0;
+ }
+}
+
+/* Bind a method if it was deconstructed */
+static PyObject *
+reconstruct_method(PyObject *func, PyObject *self)
+{
+ if (self) {
+ return PyMethod_New(func, self);
+ }
+ else {
+ return Py_NewRef(func);
+ }
+}
+
+static PyObject *
+call_method(PyObject *func, PyObject *self, PyObject *obj)
+{
+ if (self) {
+ return PyObject_CallFunctionObjArgs(func, self, obj, NULL);
+ }
+ else {
+ return PyObject_CallOneArg(func, obj);
+ }
+}
+
+/*************************************************************************/
+
+/* Internal data type used as the unpickling stack. */
+typedef struct {
+ PyObject_VAR_HEAD
+ PyObject **data;
+ int mark_set; /* is MARK set? */
+ Py_ssize_t fence; /* position of top MARK or 0 */
+ Py_ssize_t allocated; /* number of slots in data allocated */
+} Pdata;
+
+static int
+Pdata_traverse(Pdata *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static void
+Pdata_dealloc(Pdata *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ Py_ssize_t i = Py_SIZE(self);
+ while (--i >= 0) {
+ Py_DECREF(self->data[i]);
+ }
+ PyMem_Free(self->data);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot pdata_slots[] = {
+ {Py_tp_dealloc, Pdata_dealloc},
+ {Py_tp_traverse, Pdata_traverse},
+ {0, NULL},
+};
+
+static PyType_Spec pdata_spec = {
+ .name = "_pickle.Pdata",
+ .basicsize = sizeof(Pdata),
+ .itemsize = sizeof(PyObject *),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = pdata_slots,
+};
+
+static PyObject *
+Pdata_New(PickleState *state)
+{
+ Pdata *self;
+
+ if (!(self = PyObject_GC_New(Pdata, state->Pdata_Type)))
+ return NULL;
+ Py_SET_SIZE(self, 0);
+ self->mark_set = 0;
+ self->fence = 0;
+ self->allocated = 8;
+ self->data = PyMem_Malloc(self->allocated * sizeof(PyObject *));
+ if (self->data) {
+ PyObject_GC_Track(self);
+ return (PyObject *)self;
+ }
+ Py_DECREF(self);
+ return PyErr_NoMemory();
+}
+
+
+/* Retain only the initial clearto items. If clearto >= the current
+ * number of items, this is a (non-erroneous) NOP.
+ */
+static int
+Pdata_clear(Pdata *self, Py_ssize_t clearto)
+{
+ Py_ssize_t i = Py_SIZE(self);
+
+ assert(clearto >= self->fence);
+ if (clearto >= i)
+ return 0;
+
+ while (--i >= clearto) {
+ Py_CLEAR(self->data[i]);
+ }
+ Py_SET_SIZE(self, clearto);
+ return 0;
+}
+
+static int
+Pdata_grow(Pdata *self)
+{
+ PyObject **data = self->data;
+ size_t allocated = (size_t)self->allocated;
+ size_t new_allocated;
+
+ new_allocated = (allocated >> 3) + 6;
+ /* check for integer overflow */
+ if (new_allocated > (size_t)PY_SSIZE_T_MAX - allocated)
+ goto nomemory;
+ new_allocated += allocated;
+ PyMem_RESIZE(data, PyObject *, new_allocated);
+ if (data == NULL)
+ goto nomemory;
+
+ self->data = data;
+ self->allocated = (Py_ssize_t)new_allocated;
+ return 0;
+
+ nomemory:
+ PyErr_NoMemory();
+ return -1;
+}
+
+static int
+Pdata_stack_underflow(PickleState *st, Pdata *self)
+{
+ PyErr_SetString(st->UnpicklingError,
+ self->mark_set ?
+ "unexpected MARK found" :
+ "unpickling stack underflow");
+ return -1;
+}
+
+/* D is a Pdata*. Pop the topmost element and store it into V, which
+ * must be an lvalue holding PyObject*. On stack underflow, UnpicklingError
+ * is raised and V is set to NULL.
+ */
+static PyObject *
+Pdata_pop(PickleState *state, Pdata *self)
+{
+ if (Py_SIZE(self) <= self->fence) {
+ Pdata_stack_underflow(state, self);
+ return NULL;
+ }
+ Py_SET_SIZE(self, Py_SIZE(self) - 1);
+ return self->data[Py_SIZE(self)];
+}
+#define PDATA_POP(S, D, V) do { (V) = Pdata_pop(S, (D)); } while (0)
+
+static int
+Pdata_push(Pdata *self, PyObject *obj)
+{
+ if (Py_SIZE(self) == self->allocated && Pdata_grow(self) < 0) {
+ return -1;
+ }
+ self->data[Py_SIZE(self)] = obj;
+ Py_SET_SIZE(self, Py_SIZE(self) + 1);
+ return 0;
+}
+
+/* Push an object on stack, transferring its ownership to the stack. */
+#define PDATA_PUSH(D, O, ER) do { \
+ if (Pdata_push((D), (O)) < 0) return (ER); } while(0)
+
+/* Push an object on stack, adding a new reference to the object. */
+#define PDATA_APPEND(D, O, ER) do { \
+ Py_INCREF((O)); \
+ if (Pdata_push((D), (O)) < 0) return (ER); } while(0)
+
+static PyObject *
+Pdata_poptuple(PickleState *state, Pdata *self, Py_ssize_t start)
+{
+ PyObject *tuple;
+ Py_ssize_t len, i, j;
+
+ if (start < self->fence) {
+ Pdata_stack_underflow(state, self);
+ return NULL;
+ }
+ len = Py_SIZE(self) - start;
+ tuple = PyTuple_New(len);
+ if (tuple == NULL)
+ return NULL;
+ for (i = start, j = 0; j < len; i++, j++)
+ PyTuple_SET_ITEM(tuple, j, self->data[i]);
+
+ Py_SET_SIZE(self, start);
+ return tuple;
+}
+
+static PyObject *
+Pdata_poplist(Pdata *self, Py_ssize_t start)
+{
+ PyObject *list;
+ Py_ssize_t len, i, j;
+
+ len = Py_SIZE(self) - start;
+ list = PyList_New(len);
+ if (list == NULL)
+ return NULL;
+ for (i = start, j = 0; j < len; i++, j++)
+ PyList_SET_ITEM(list, j, self->data[i]);
+
+ Py_SET_SIZE(self, start);
+ return list;
+}
+
+typedef struct {
+ PyObject *me_key;
+ Py_ssize_t me_value;
+} PyMemoEntry;
+
+typedef struct {
+ size_t mt_mask;
+ size_t mt_used;
+ size_t mt_allocated;
+ PyMemoEntry *mt_table;
+} PyMemoTable;
+
+typedef struct PicklerObject {
+ PyObject_HEAD
+ PyMemoTable *memo; /* Memo table, keep track of the seen
+ objects to support self-referential objects
+ pickling. */
+ PyObject *pers_func; /* persistent_id() method, can be NULL */
+ PyObject *pers_func_self; /* borrowed reference to self if pers_func
+ is an unbound method, NULL otherwise */
+ PyObject *dispatch_table; /* private dispatch_table, can be NULL */
+ PyObject *reducer_override; /* hook for invoking user-defined callbacks
+ instead of save_global when pickling
+ functions and classes*/
+
+ PyObject *write; /* write() method of the output stream. */
+ PyObject *output_buffer; /* Write into a local bytearray buffer before
+ flushing to the stream. */
+ Py_ssize_t output_len; /* Length of output_buffer. */
+ Py_ssize_t max_output_len; /* Allocation size of output_buffer. */
+ int proto; /* Pickle protocol number, >= 0 */
+ int bin; /* Boolean, true if proto > 0 */
+ int framing; /* True when framing is enabled, proto >= 4 */
+ Py_ssize_t frame_start; /* Position in output_buffer where the
+ current frame begins. -1 if there
+ is no frame currently open. */
+
+ Py_ssize_t buf_size; /* Size of the current buffered pickle data */
+ int fast; /* Enable fast mode if set to a true value.
+ The fast mode disable the usage of memo,
+ therefore speeding the pickling process by
+ not generating superfluous PUT opcodes. It
+ should not be used if with self-referential
+ objects. */
+ int fast_nesting;
+ int fix_imports; /* Indicate whether Pickler should fix
+ the name of globals for Python 2.x. */
+ PyObject *fast_memo;
+ PyObject *buffer_callback; /* Callback for out-of-band buffers, or NULL */
+} PicklerObject;
+
+typedef struct UnpicklerObject {
+ PyObject_HEAD
+ Pdata *stack; /* Pickle data stack, store unpickled objects. */
+
+ /* The unpickler memo is just an array of PyObject *s. Using a dict
+ is unnecessary, since the keys are contiguous ints. */
+ PyObject **memo;
+ size_t memo_size; /* Capacity of the memo array */
+ size_t memo_len; /* Number of objects in the memo */
+
+ PyObject *pers_func; /* persistent_load() method, can be NULL. */
+ PyObject *pers_func_self; /* borrowed reference to self if pers_func
+ is an unbound method, NULL otherwise */
+
+ Py_buffer buffer;
+ char *input_buffer;
+ char *input_line;
+ Py_ssize_t input_len;
+ Py_ssize_t next_read_idx;
+ Py_ssize_t prefetched_idx; /* index of first prefetched byte */
+
+ PyObject *read; /* read() method of the input stream. */
+ PyObject *readinto; /* readinto() method of the input stream. */
+ PyObject *readline; /* readline() method of the input stream. */
+ PyObject *peek; /* peek() method of the input stream, or NULL */
+ PyObject *buffers; /* iterable of out-of-band buffers, or NULL */
+
+ char *encoding; /* Name of the encoding to be used for
+ decoding strings pickled using Python
+ 2.x. The default value is "ASCII" */
+ char *errors; /* Name of errors handling scheme to used when
+ decoding strings. The default value is
+ "strict". */
+ Py_ssize_t *marks; /* Mark stack, used for unpickling container
+ objects. */
+ Py_ssize_t num_marks; /* Number of marks in the mark stack. */
+ Py_ssize_t marks_size; /* Current allocated size of the mark stack. */
+ int proto; /* Protocol of the pickle loaded. */
+ int fix_imports; /* Indicate whether Unpickler should fix
+ the name of globals pickled by Python 2.x. */
+} UnpicklerObject;
+
+typedef struct {
+ PyObject_HEAD
+ PicklerObject *pickler; /* Pickler whose memo table we're proxying. */
+} PicklerMemoProxyObject;
+
+typedef struct {
+ PyObject_HEAD
+ UnpicklerObject *unpickler;
+} UnpicklerMemoProxyObject;
+
+/* Forward declarations */
+static int save(PickleState *state, PicklerObject *, PyObject *, int);
+static int save_reduce(PickleState *, PicklerObject *, PyObject *, PyObject *);
+
+#include "clinic/_pickle.c.h"
+
+/*************************************************************************
+ A custom hashtable mapping void* to Python ints. This is used by the pickler
+ for memoization. Using a custom hashtable rather than PyDict allows us to skip
+ a bunch of unnecessary object creation. This makes a huge performance
+ difference. */
+
+#define MT_MINSIZE 8
+#define PERTURB_SHIFT 5
+
+
+static PyMemoTable *
+PyMemoTable_New(void)
+{
+ PyMemoTable *memo = PyMem_Malloc(sizeof(PyMemoTable));
+ if (memo == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ memo->mt_used = 0;
+ memo->mt_allocated = MT_MINSIZE;
+ memo->mt_mask = MT_MINSIZE - 1;
+ memo->mt_table = PyMem_Malloc(MT_MINSIZE * sizeof(PyMemoEntry));
+ if (memo->mt_table == NULL) {
+ PyMem_Free(memo);
+ PyErr_NoMemory();
+ return NULL;
+ }
+ memset(memo->mt_table, 0, MT_MINSIZE * sizeof(PyMemoEntry));
+
+ return memo;
+}
+
+static PyMemoTable *
+PyMemoTable_Copy(PyMemoTable *self)
+{
+ PyMemoTable *new = PyMemoTable_New();
+ if (new == NULL)
+ return NULL;
+
+ new->mt_used = self->mt_used;
+ new->mt_allocated = self->mt_allocated;
+ new->mt_mask = self->mt_mask;
+ /* The table we get from _New() is probably smaller than we wanted.
+ Free it and allocate one that's the right size. */
+ PyMem_Free(new->mt_table);
+ new->mt_table = PyMem_NEW(PyMemoEntry, self->mt_allocated);
+ if (new->mt_table == NULL) {
+ PyMem_Free(new);
+ PyErr_NoMemory();
+ return NULL;
+ }
+ for (size_t i = 0; i < self->mt_allocated; i++) {
+ Py_XINCREF(self->mt_table[i].me_key);
+ }
+ memcpy(new->mt_table, self->mt_table,
+ sizeof(PyMemoEntry) * self->mt_allocated);
+
+ return new;
+}
+
+static Py_ssize_t
+PyMemoTable_Size(PyMemoTable *self)
+{
+ return self->mt_used;
+}
+
+static int
+PyMemoTable_Clear(PyMemoTable *self)
+{
+ Py_ssize_t i = self->mt_allocated;
+
+ while (--i >= 0) {
+ Py_XDECREF(self->mt_table[i].me_key);
+ }
+ self->mt_used = 0;
+ memset(self->mt_table, 0, self->mt_allocated * sizeof(PyMemoEntry));
+ return 0;
+}
+
+static void
+PyMemoTable_Del(PyMemoTable *self)
+{
+ if (self == NULL)
+ return;
+ PyMemoTable_Clear(self);
+
+ PyMem_Free(self->mt_table);
+ PyMem_Free(self);
+}
+
+/* Since entries cannot be deleted from this hashtable, _PyMemoTable_Lookup()
+ can be considerably simpler than dictobject.c's lookdict(). */
+static PyMemoEntry *
+_PyMemoTable_Lookup(PyMemoTable *self, PyObject *key)
+{
+ size_t i;
+ size_t perturb;
+ size_t mask = self->mt_mask;
+ PyMemoEntry *table = self->mt_table;
+ PyMemoEntry *entry;
+ Py_hash_t hash = (Py_hash_t)key >> 3;
+
+ i = hash & mask;
+ entry = &table[i];
+ if (entry->me_key == NULL || entry->me_key == key)
+ return entry;
+
+ for (perturb = hash; ; perturb >>= PERTURB_SHIFT) {
+ i = (i << 2) + i + perturb + 1;
+ entry = &table[i & mask];
+ if (entry->me_key == NULL || entry->me_key == key)
+ return entry;
+ }
+ Py_UNREACHABLE();
+}
+
+/* Returns -1 on failure, 0 on success. */
+static int
+_PyMemoTable_ResizeTable(PyMemoTable *self, size_t min_size)
+{
+ PyMemoEntry *oldtable = NULL;
+ PyMemoEntry *oldentry, *newentry;
+ size_t new_size = MT_MINSIZE;
+ size_t to_process;
+
+ assert(min_size > 0);
+
+ if (min_size > PY_SSIZE_T_MAX) {
+ PyErr_NoMemory();
+ return -1;
+ }
+
+ /* Find the smallest valid table size >= min_size. */
+ while (new_size < min_size) {
+ new_size <<= 1;
+ }
+ /* new_size needs to be a power of two. */
+ assert((new_size & (new_size - 1)) == 0);
+
+ /* Allocate new table. */
+ oldtable = self->mt_table;
+ self->mt_table = PyMem_NEW(PyMemoEntry, new_size);
+ if (self->mt_table == NULL) {
+ self->mt_table = oldtable;
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->mt_allocated = new_size;
+ self->mt_mask = new_size - 1;
+ memset(self->mt_table, 0, sizeof(PyMemoEntry) * new_size);
+
+ /* Copy entries from the old table. */
+ to_process = self->mt_used;
+ for (oldentry = oldtable; to_process > 0; oldentry++) {
+ if (oldentry->me_key != NULL) {
+ to_process--;
+ /* newentry is a pointer to a chunk of the new
+ mt_table, so we're setting the key:value pair
+ in-place. */
+ newentry = _PyMemoTable_Lookup(self, oldentry->me_key);
+ newentry->me_key = oldentry->me_key;
+ newentry->me_value = oldentry->me_value;
+ }
+ }
+
+ /* Deallocate the old table. */
+ PyMem_Free(oldtable);
+ return 0;
+}
+
+/* Returns NULL on failure, a pointer to the value otherwise. */
+static Py_ssize_t *
+PyMemoTable_Get(PyMemoTable *self, PyObject *key)
+{
+ PyMemoEntry *entry = _PyMemoTable_Lookup(self, key);
+ if (entry->me_key == NULL)
+ return NULL;
+ return &entry->me_value;
+}
+
+/* Returns -1 on failure, 0 on success. */
+static int
+PyMemoTable_Set(PyMemoTable *self, PyObject *key, Py_ssize_t value)
+{
+ PyMemoEntry *entry;
+
+ assert(key != NULL);
+
+ entry = _PyMemoTable_Lookup(self, key);
+ if (entry->me_key != NULL) {
+ entry->me_value = value;
+ return 0;
+ }
+ entry->me_key = Py_NewRef(key);
+ entry->me_value = value;
+ self->mt_used++;
+
+ /* If we added a key, we can safely resize. Otherwise just return!
+ * If used >= 2/3 size, adjust size. Normally, this quaduples the size.
+ *
+ * Quadrupling the size improves average table sparseness
+ * (reducing collisions) at the cost of some memory. It also halves
+ * the number of expensive resize operations in a growing memo table.
+ *
+ * Very large memo tables (over 50K items) use doubling instead.
+ * This may help applications with severe memory constraints.
+ */
+ if (SIZE_MAX / 3 >= self->mt_used && self->mt_used * 3 < self->mt_allocated * 2) {
+ return 0;
+ }
+ // self->mt_used is always < PY_SSIZE_T_MAX, so this can't overflow.
+ size_t desired_size = (self->mt_used > 50000 ? 2 : 4) * self->mt_used;
+ return _PyMemoTable_ResizeTable(self, desired_size);
+}
+
+#undef MT_MINSIZE
+#undef PERTURB_SHIFT
+
+/*************************************************************************/
+
+
+static int
+_Pickler_ClearBuffer(PicklerObject *self)
+{
+ Py_XSETREF(self->output_buffer,
+ PyBytes_FromStringAndSize(NULL, self->max_output_len));
+ if (self->output_buffer == NULL)
+ return -1;
+ self->output_len = 0;
+ self->frame_start = -1;
+ return 0;
+}
+
+static void
+_write_size64(char *out, size_t value)
+{
+ size_t i;
+
+ static_assert(sizeof(size_t) <= 8, "size_t is larger than 64-bit");
+
+ for (i = 0; i < sizeof(size_t); i++) {
+ out[i] = (unsigned char)((value >> (8 * i)) & 0xff);
+ }
+ for (i = sizeof(size_t); i < 8; i++) {
+ out[i] = 0;
+ }
+}
+
+static int
+_Pickler_CommitFrame(PicklerObject *self)
+{
+ size_t frame_len;
+ char *qdata;
+
+ if (!self->framing || self->frame_start == -1)
+ return 0;
+ frame_len = self->output_len - self->frame_start - FRAME_HEADER_SIZE;
+ qdata = PyBytes_AS_STRING(self->output_buffer) + self->frame_start;
+ if (frame_len >= FRAME_SIZE_MIN) {
+ qdata[0] = FRAME;
+ _write_size64(qdata + 1, frame_len);
+ }
+ else {
+ memmove(qdata, qdata + FRAME_HEADER_SIZE, frame_len);
+ self->output_len -= FRAME_HEADER_SIZE;
+ }
+ self->frame_start = -1;
+ return 0;
+}
+
+static PyObject *
+_Pickler_GetString(PicklerObject *self)
+{
+ PyObject *output_buffer = self->output_buffer;
+
+ assert(self->output_buffer != NULL);
+
+ if (_Pickler_CommitFrame(self))
+ return NULL;
+
+ self->output_buffer = NULL;
+ /* Resize down to exact size */
+ if (_PyBytes_Resize(&output_buffer, self->output_len) < 0)
+ return NULL;
+ return output_buffer;
+}
+
+static int
+_Pickler_FlushToFile(PicklerObject *self)
+{
+ PyObject *output, *result;
+
+ assert(self->write != NULL);
+
+ /* This will commit the frame first */
+ output = _Pickler_GetString(self);
+ if (output == NULL)
+ return -1;
+
+ result = _Pickle_FastCall(self->write, output);
+ Py_XDECREF(result);
+ return (result == NULL) ? -1 : 0;
+}
+
+static int
+_Pickler_OpcodeBoundary(PicklerObject *self)
+{
+ Py_ssize_t frame_len;
+
+ if (!self->framing || self->frame_start == -1) {
+ return 0;
+ }
+ frame_len = self->output_len - self->frame_start - FRAME_HEADER_SIZE;
+ if (frame_len >= FRAME_SIZE_TARGET) {
+ if(_Pickler_CommitFrame(self)) {
+ return -1;
+ }
+ /* Flush the content of the committed frame to the underlying
+ * file and reuse the pickler buffer for the next frame so as
+ * to limit memory usage when dumping large complex objects to
+ * a file.
+ *
+ * self->write is NULL when called via dumps.
+ */
+ if (self->write != NULL) {
+ if (_Pickler_FlushToFile(self) < 0) {
+ return -1;
+ }
+ if (_Pickler_ClearBuffer(self) < 0) {
+ return -1;
+ }
+ }
+ }
+ return 0;
+}
+
+static Py_ssize_t
+_Pickler_Write(PicklerObject *self, const char *s, Py_ssize_t data_len)
+{
+ Py_ssize_t i, n, required;
+ char *buffer;
+ int need_new_frame;
+
+ assert(s != NULL);
+ need_new_frame = (self->framing && self->frame_start == -1);
+
+ if (need_new_frame)
+ n = data_len + FRAME_HEADER_SIZE;
+ else
+ n = data_len;
+
+ required = self->output_len + n;
+ if (required > self->max_output_len) {
+ /* Make place in buffer for the pickle chunk */
+ if (self->output_len >= PY_SSIZE_T_MAX / 2 - n) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->max_output_len = (self->output_len + n) / 2 * 3;
+ if (_PyBytes_Resize(&self->output_buffer, self->max_output_len) < 0)
+ return -1;
+ }
+ buffer = PyBytes_AS_STRING(self->output_buffer);
+ if (need_new_frame) {
+ /* Setup new frame */
+ Py_ssize_t frame_start = self->output_len;
+ self->frame_start = frame_start;
+ for (i = 0; i < FRAME_HEADER_SIZE; i++) {
+ /* Write an invalid value, for debugging */
+ buffer[frame_start + i] = 0xFE;
+ }
+ self->output_len += FRAME_HEADER_SIZE;
+ }
+ if (data_len < 8) {
+ /* This is faster than memcpy when the string is short. */
+ for (i = 0; i < data_len; i++) {
+ buffer[self->output_len + i] = s[i];
+ }
+ }
+ else {
+ memcpy(buffer + self->output_len, s, data_len);
+ }
+ self->output_len += data_len;
+ return data_len;
+}
+
+static PicklerObject *
+_Pickler_New(PickleState *st)
+{
+ PyMemoTable *memo = PyMemoTable_New();
+ if (memo == NULL) {
+ return NULL;
+ }
+
+ const Py_ssize_t max_output_len = WRITE_BUF_SIZE;
+ PyObject *output_buffer = PyBytes_FromStringAndSize(NULL, max_output_len);
+ if (output_buffer == NULL) {
+ goto error;
+ }
+
+ PicklerObject *self = PyObject_GC_New(PicklerObject, st->Pickler_Type);
+ if (self == NULL) {
+ goto error;
+ }
+
+ self->memo = memo;
+ self->pers_func = NULL;
+ self->pers_func_self = NULL;
+ self->dispatch_table = NULL;
+ self->reducer_override = NULL;
+ self->write = NULL;
+ self->output_buffer = output_buffer;
+ self->output_len = 0;
+ self->max_output_len = max_output_len;
+ self->proto = 0;
+ self->bin = 0;
+ self->framing = 0;
+ self->frame_start = -1;
+ self->buf_size = 0;
+ self->fast = 0;
+ self->fast_nesting = 0;
+ self->fix_imports = 0;
+ self->fast_memo = NULL;
+ self->buffer_callback = NULL;
+
+ PyObject_GC_Track(self);
+ return self;
+
+error:
+ PyMem_Free(memo);
+ Py_XDECREF(output_buffer);
+ return NULL;
+}
+
+static int
+_Pickler_SetProtocol(PicklerObject *self, PyObject *protocol, int fix_imports)
+{
+ long proto;
+
+ if (protocol == Py_None) {
+ proto = DEFAULT_PROTOCOL;
+ }
+ else {
+ proto = PyLong_AsLong(protocol);
+ if (proto < 0) {
+ if (proto == -1 && PyErr_Occurred())
+ return -1;
+ proto = HIGHEST_PROTOCOL;
+ }
+ else if (proto > HIGHEST_PROTOCOL) {
+ PyErr_Format(PyExc_ValueError, "pickle protocol must be <= %d",
+ HIGHEST_PROTOCOL);
+ return -1;
+ }
+ }
+ self->proto = (int)proto;
+ self->bin = proto > 0;
+ self->fix_imports = fix_imports && proto < 3;
+ return 0;
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success. This may
+ be called once on a freshly created Pickler. */
+static int
+_Pickler_SetOutputStream(PicklerObject *self, PyObject *file)
+{
+ assert(file != NULL);
+ if (_PyObject_LookupAttr(file, &_Py_ID(write), &self->write) < 0) {
+ return -1;
+ }
+ if (self->write == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "file must have a 'write' attribute");
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+_Pickler_SetBufferCallback(PicklerObject *self, PyObject *buffer_callback)
+{
+ if (buffer_callback == Py_None) {
+ buffer_callback = NULL;
+ }
+ if (buffer_callback != NULL && self->proto < 5) {
+ PyErr_SetString(PyExc_ValueError,
+ "buffer_callback needs protocol >= 5");
+ return -1;
+ }
+
+ self->buffer_callback = Py_XNewRef(buffer_callback);
+ return 0;
+}
+
+/* Returns the size of the input on success, -1 on failure. This takes its
+ own reference to `input`. */
+static Py_ssize_t
+_Unpickler_SetStringInput(UnpicklerObject *self, PyObject *input)
+{
+ if (self->buffer.buf != NULL)
+ PyBuffer_Release(&self->buffer);
+ if (PyObject_GetBuffer(input, &self->buffer, PyBUF_CONTIG_RO) < 0)
+ return -1;
+ self->input_buffer = self->buffer.buf;
+ self->input_len = self->buffer.len;
+ self->next_read_idx = 0;
+ self->prefetched_idx = self->input_len;
+ return self->input_len;
+}
+
+static int
+bad_readline(PickleState *st)
+{
+ PyErr_SetString(st->UnpicklingError, "pickle data was truncated");
+ return -1;
+}
+
+/* Skip any consumed data that was only prefetched using peek() */
+static int
+_Unpickler_SkipConsumed(UnpicklerObject *self)
+{
+ Py_ssize_t consumed;
+ PyObject *r;
+
+ consumed = self->next_read_idx - self->prefetched_idx;
+ if (consumed <= 0)
+ return 0;
+
+ assert(self->peek); /* otherwise we did something wrong */
+ /* This makes a useless copy... */
+ r = PyObject_CallFunction(self->read, "n", consumed);
+ if (r == NULL)
+ return -1;
+ Py_DECREF(r);
+
+ self->prefetched_idx = self->next_read_idx;
+ return 0;
+}
+
+static const Py_ssize_t READ_WHOLE_LINE = -1;
+
+/* If reading from a file, we need to only pull the bytes we need, since there
+ may be multiple pickle objects arranged contiguously in the same input
+ buffer.
+
+ If `n` is READ_WHOLE_LINE, read a whole line. Otherwise, read up to `n`
+ bytes from the input stream/buffer.
+
+ Update the unpickler's input buffer with the newly-read data. Returns -1 on
+ failure; on success, returns the number of bytes read from the file.
+
+ On success, self->input_len will be 0; this is intentional so that when
+ unpickling from a file, the "we've run out of data" code paths will trigger,
+ causing the Unpickler to go back to the file for more data. Use the returned
+ size to tell you how much data you can process. */
+static Py_ssize_t
+_Unpickler_ReadFromFile(UnpicklerObject *self, Py_ssize_t n)
+{
+ PyObject *data;
+ Py_ssize_t read_size;
+
+ assert(self->read != NULL);
+
+ if (_Unpickler_SkipConsumed(self) < 0)
+ return -1;
+
+ if (n == READ_WHOLE_LINE) {
+ data = PyObject_CallNoArgs(self->readline);
+ }
+ else {
+ PyObject *len;
+ /* Prefetch some data without advancing the file pointer, if possible */
+ if (self->peek && n < PREFETCH) {
+ len = PyLong_FromSsize_t(PREFETCH);
+ if (len == NULL)
+ return -1;
+ data = _Pickle_FastCall(self->peek, len);
+ if (data == NULL) {
+ if (!PyErr_ExceptionMatches(PyExc_NotImplementedError))
+ return -1;
+ /* peek() is probably not supported by the given file object */
+ PyErr_Clear();
+ Py_CLEAR(self->peek);
+ }
+ else {
+ read_size = _Unpickler_SetStringInput(self, data);
+ Py_DECREF(data);
+ self->prefetched_idx = 0;
+ if (n <= read_size)
+ return n;
+ }
+ }
+ len = PyLong_FromSsize_t(n);
+ if (len == NULL)
+ return -1;
+ data = _Pickle_FastCall(self->read, len);
+ }
+ if (data == NULL)
+ return -1;
+
+ read_size = _Unpickler_SetStringInput(self, data);
+ Py_DECREF(data);
+ return read_size;
+}
+
+/* Don't call it directly: use _Unpickler_Read() */
+static Py_ssize_t
+_Unpickler_ReadImpl(UnpicklerObject *self, PickleState *st, char **s, Py_ssize_t n)
+{
+ Py_ssize_t num_read;
+
+ *s = NULL;
+ if (self->next_read_idx > PY_SSIZE_T_MAX - n) {
+ PyErr_SetString(st->UnpicklingError,
+ "read would overflow (invalid bytecode)");
+ return -1;
+ }
+
+ /* This case is handled by the _Unpickler_Read() macro for efficiency */
+ assert(self->next_read_idx + n > self->input_len);
+
+ if (!self->read)
+ return bad_readline(st);
+
+ /* Extend the buffer to satisfy desired size */
+ num_read = _Unpickler_ReadFromFile(self, n);
+ if (num_read < 0)
+ return -1;
+ if (num_read < n)
+ return bad_readline(st);
+ *s = self->input_buffer;
+ self->next_read_idx = n;
+ return n;
+}
+
+/* Read `n` bytes from the unpickler's data source, storing the result in `buf`.
+ *
+ * This should only be used for non-small data reads where potentially
+ * avoiding a copy is beneficial. This method does not try to prefetch
+ * more data into the input buffer.
+ *
+ * _Unpickler_Read() is recommended in most cases.
+ */
+static Py_ssize_t
+_Unpickler_ReadInto(PickleState *state, UnpicklerObject *self, char *buf,
+ Py_ssize_t n)
+{
+ assert(n != READ_WHOLE_LINE);
+
+ /* Read from available buffer data, if any */
+ Py_ssize_t in_buffer = self->input_len - self->next_read_idx;
+ if (in_buffer > 0) {
+ Py_ssize_t to_read = Py_MIN(in_buffer, n);
+ memcpy(buf, self->input_buffer + self->next_read_idx, to_read);
+ self->next_read_idx += to_read;
+ buf += to_read;
+ n -= to_read;
+ if (n == 0) {
+ /* Entire read was satisfied from buffer */
+ return n;
+ }
+ }
+
+ /* Read from file */
+ if (!self->read) {
+ /* We're unpickling memory, this means the input is truncated */
+ return bad_readline(state);
+ }
+ if (_Unpickler_SkipConsumed(self) < 0) {
+ return -1;
+ }
+
+ if (!self->readinto) {
+ /* readinto() not supported on file-like object, fall back to read()
+ * and copy into destination buffer (bpo-39681) */
+ PyObject* len = PyLong_FromSsize_t(n);
+ if (len == NULL) {
+ return -1;
+ }
+ PyObject* data = _Pickle_FastCall(self->read, len);
+ if (data == NULL) {
+ return -1;
+ }
+ if (!PyBytes_Check(data)) {
+ PyErr_Format(PyExc_ValueError,
+ "read() returned non-bytes object (%R)",
+ Py_TYPE(data));
+ Py_DECREF(data);
+ return -1;
+ }
+ Py_ssize_t read_size = PyBytes_GET_SIZE(data);
+ if (read_size < n) {
+ Py_DECREF(data);
+ return bad_readline(state);
+ }
+ memcpy(buf, PyBytes_AS_STRING(data), n);
+ Py_DECREF(data);
+ return n;
+ }
+
+ /* Call readinto() into user buffer */
+ PyObject *buf_obj = PyMemoryView_FromMemory(buf, n, PyBUF_WRITE);
+ if (buf_obj == NULL) {
+ return -1;
+ }
+ PyObject *read_size_obj = _Pickle_FastCall(self->readinto, buf_obj);
+ if (read_size_obj == NULL) {
+ return -1;
+ }
+ Py_ssize_t read_size = PyLong_AsSsize_t(read_size_obj);
+ Py_DECREF(read_size_obj);
+
+ if (read_size < 0) {
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ValueError,
+ "readinto() returned negative size");
+ }
+ return -1;
+ }
+ if (read_size < n) {
+ return bad_readline(state);
+ }
+ return n;
+}
+
+/* Read `n` bytes from the unpickler's data source, storing the result in `*s`.
+
+ This should be used for all data reads, rather than accessing the unpickler's
+ input buffer directly. This method deals correctly with reading from input
+ streams, which the input buffer doesn't deal with.
+
+ Note that when reading from a file-like object, self->next_read_idx won't
+ be updated (it should remain at 0 for the entire unpickling process). You
+ should use this function's return value to know how many bytes you can
+ consume.
+
+ Returns -1 (with an exception set) on failure. On success, return the
+ number of chars read. */
+#define _Unpickler_Read(self, state, s, n) \
+ (((n) <= (self)->input_len - (self)->next_read_idx) \
+ ? (*(s) = (self)->input_buffer + (self)->next_read_idx, \
+ (self)->next_read_idx += (n), \
+ (n)) \
+ : _Unpickler_ReadImpl(self, state, (s), (n)))
+
+static Py_ssize_t
+_Unpickler_CopyLine(UnpicklerObject *self, char *line, Py_ssize_t len,
+ char **result)
+{
+ char *input_line = PyMem_Realloc(self->input_line, len + 1);
+ if (input_line == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+
+ memcpy(input_line, line, len);
+ input_line[len] = '\0';
+ self->input_line = input_line;
+ *result = self->input_line;
+ return len;
+}
+
+/* Read a line from the input stream/buffer. If we run off the end of the input
+ before hitting \n, raise an error.
+
+ Returns the number of chars read, or -1 on failure. */
+static Py_ssize_t
+_Unpickler_Readline(PickleState *state, UnpicklerObject *self, char **result)
+{
+ Py_ssize_t i, num_read;
+
+ for (i = self->next_read_idx; i < self->input_len; i++) {
+ if (self->input_buffer[i] == '\n') {
+ char *line_start = self->input_buffer + self->next_read_idx;
+ num_read = i - self->next_read_idx + 1;
+ self->next_read_idx = i + 1;
+ return _Unpickler_CopyLine(self, line_start, num_read, result);
+ }
+ }
+ if (!self->read)
+ return bad_readline(state);
+
+ num_read = _Unpickler_ReadFromFile(self, READ_WHOLE_LINE);
+ if (num_read < 0)
+ return -1;
+ if (num_read == 0 || self->input_buffer[num_read - 1] != '\n')
+ return bad_readline(state);
+ self->next_read_idx = num_read;
+ return _Unpickler_CopyLine(self, self->input_buffer, num_read, result);
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success. The memo array
+ will be modified in place. */
+static int
+_Unpickler_ResizeMemoList(UnpicklerObject *self, size_t new_size)
+{
+ size_t i;
+
+ assert(new_size > self->memo_size);
+
+ PyObject **memo_new = self->memo;
+ PyMem_RESIZE(memo_new, PyObject *, new_size);
+ if (memo_new == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->memo = memo_new;
+ for (i = self->memo_size; i < new_size; i++)
+ self->memo[i] = NULL;
+ self->memo_size = new_size;
+ return 0;
+}
+
+/* Returns NULL if idx is out of bounds. */
+static PyObject *
+_Unpickler_MemoGet(UnpicklerObject *self, size_t idx)
+{
+ if (idx >= self->memo_size)
+ return NULL;
+
+ return self->memo[idx];
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success.
+ This takes its own reference to `value`. */
+static int
+_Unpickler_MemoPut(UnpicklerObject *self, size_t idx, PyObject *value)
+{
+ PyObject *old_item;
+
+ if (idx >= self->memo_size) {
+ if (_Unpickler_ResizeMemoList(self, idx * 2) < 0)
+ return -1;
+ assert(idx < self->memo_size);
+ }
+ old_item = self->memo[idx];
+ self->memo[idx] = Py_NewRef(value);
+ if (old_item != NULL) {
+ Py_DECREF(old_item);
+ }
+ else {
+ self->memo_len++;
+ }
+ return 0;
+}
+
+static PyObject **
+_Unpickler_NewMemo(Py_ssize_t new_size)
+{
+ PyObject **memo = PyMem_NEW(PyObject *, new_size);
+ if (memo == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ memset(memo, 0, new_size * sizeof(PyObject *));
+ return memo;
+}
+
+/* Free the unpickler's memo, taking care to decref any items left in it. */
+static void
+_Unpickler_MemoCleanup(UnpicklerObject *self)
+{
+ Py_ssize_t i;
+ PyObject **memo = self->memo;
+
+ if (self->memo == NULL)
+ return;
+ self->memo = NULL;
+ i = self->memo_size;
+ while (--i >= 0) {
+ Py_XDECREF(memo[i]);
+ }
+ PyMem_Free(memo);
+}
+
+static UnpicklerObject *
+_Unpickler_New(PyObject *module)
+{
+ const int MEMO_SIZE = 32;
+ PyObject **memo = _Unpickler_NewMemo(MEMO_SIZE);
+ if (memo == NULL) {
+ return NULL;
+ }
+
+ PickleState *st = _Pickle_GetState(module);
+ PyObject *stack = Pdata_New(st);
+ if (stack == NULL) {
+ goto error;
+ }
+
+ UnpicklerObject *self = PyObject_GC_New(UnpicklerObject,
+ st->Unpickler_Type);
+ if (self == NULL) {
+ goto error;
+ }
+
+ self->stack = (Pdata *)stack;
+ self->memo = memo;
+ self->memo_size = MEMO_SIZE;
+ self->memo_len = 0;
+ self->pers_func = NULL;
+ self->pers_func_self = NULL;
+ memset(&self->buffer, 0, sizeof(Py_buffer));
+ self->input_buffer = NULL;
+ self->input_line = NULL;
+ self->input_len = 0;
+ self->next_read_idx = 0;
+ self->prefetched_idx = 0;
+ self->read = NULL;
+ self->readinto = NULL;
+ self->readline = NULL;
+ self->peek = NULL;
+ self->buffers = NULL;
+ self->encoding = NULL;
+ self->errors = NULL;
+ self->marks = NULL;
+ self->num_marks = 0;
+ self->marks_size = 0;
+ self->proto = 0;
+ self->fix_imports = 0;
+
+ PyObject_GC_Track(self);
+ return self;
+
+error:
+ PyMem_Free(memo);
+ Py_XDECREF(stack);
+ return NULL;
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success. This may
+ be called once on a freshly created Unpickler. */
+static int
+_Unpickler_SetInputStream(UnpicklerObject *self, PyObject *file)
+{
+ /* Optional file methods */
+ if (_PyObject_LookupAttr(file, &_Py_ID(peek), &self->peek) < 0) {
+ goto error;
+ }
+ if (_PyObject_LookupAttr(file, &_Py_ID(readinto), &self->readinto) < 0) {
+ goto error;
+ }
+ if (_PyObject_LookupAttr(file, &_Py_ID(read), &self->read) < 0) {
+ goto error;
+ }
+ if (_PyObject_LookupAttr(file, &_Py_ID(readline), &self->readline) < 0) {
+ goto error;
+ }
+ if (!self->readline || !self->read) {
+ PyErr_SetString(PyExc_TypeError,
+ "file must have 'read' and 'readline' attributes");
+ goto error;
+ }
+ return 0;
+
+error:
+ Py_CLEAR(self->read);
+ Py_CLEAR(self->readinto);
+ Py_CLEAR(self->readline);
+ Py_CLEAR(self->peek);
+ return -1;
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success. This may
+ be called once on a freshly created Unpickler. */
+static int
+_Unpickler_SetInputEncoding(UnpicklerObject *self,
+ const char *encoding,
+ const char *errors)
+{
+ if (encoding == NULL)
+ encoding = "ASCII";
+ if (errors == NULL)
+ errors = "strict";
+
+ self->encoding = _PyMem_Strdup(encoding);
+ self->errors = _PyMem_Strdup(errors);
+ if (self->encoding == NULL || self->errors == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ return 0;
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success. This may
+ be called once on a freshly created Unpickler. */
+static int
+_Unpickler_SetBuffers(UnpicklerObject *self, PyObject *buffers)
+{
+ if (buffers == NULL || buffers == Py_None) {
+ self->buffers = NULL;
+ }
+ else {
+ self->buffers = PyObject_GetIter(buffers);
+ if (self->buffers == NULL) {
+ return -1;
+ }
+ }
+ return 0;
+}
+
+/* Generate a GET opcode for an object stored in the memo. */
+static int
+memo_get(PickleState *st, PicklerObject *self, PyObject *key)
+{
+ Py_ssize_t *value;
+ char pdata[30];
+ Py_ssize_t len;
+
+ value = PyMemoTable_Get(self->memo, key);
+ if (value == NULL) {
+ PyErr_SetObject(PyExc_KeyError, key);
+ return -1;
+ }
+
+ if (!self->bin) {
+ pdata[0] = GET;
+ PyOS_snprintf(pdata + 1, sizeof(pdata) - 1,
+ "%zd\n", *value);
+ len = strlen(pdata);
+ }
+ else {
+ if (*value < 256) {
+ pdata[0] = BINGET;
+ pdata[1] = (unsigned char)(*value & 0xff);
+ len = 2;
+ }
+ else if ((size_t)*value <= 0xffffffffUL) {
+ pdata[0] = LONG_BINGET;
+ pdata[1] = (unsigned char)(*value & 0xff);
+ pdata[2] = (unsigned char)((*value >> 8) & 0xff);
+ pdata[3] = (unsigned char)((*value >> 16) & 0xff);
+ pdata[4] = (unsigned char)((*value >> 24) & 0xff);
+ len = 5;
+ }
+ else { /* unlikely */
+ PyErr_SetString(st->PicklingError,
+ "memo id too large for LONG_BINGET");
+ return -1;
+ }
+ }
+
+ if (_Pickler_Write(self, pdata, len) < 0)
+ return -1;
+
+ return 0;
+}
+
+/* Store an object in the memo, assign it a new unique ID based on the number
+ of objects currently stored in the memo and generate a PUT opcode. */
+static int
+memo_put(PickleState *st, PicklerObject *self, PyObject *obj)
+{
+ char pdata[30];
+ Py_ssize_t len;
+ Py_ssize_t idx;
+
+ const char memoize_op = MEMOIZE;
+
+ if (self->fast)
+ return 0;
+
+ idx = PyMemoTable_Size(self->memo);
+ if (PyMemoTable_Set(self->memo, obj, idx) < 0)
+ return -1;
+
+ if (self->proto >= 4) {
+ if (_Pickler_Write(self, &memoize_op, 1) < 0)
+ return -1;
+ return 0;
+ }
+ else if (!self->bin) {
+ pdata[0] = PUT;
+ PyOS_snprintf(pdata + 1, sizeof(pdata) - 1,
+ "%zd\n", idx);
+ len = strlen(pdata);
+ }
+ else {
+ if (idx < 256) {
+ pdata[0] = BINPUT;
+ pdata[1] = (unsigned char)idx;
+ len = 2;
+ }
+ else if ((size_t)idx <= 0xffffffffUL) {
+ pdata[0] = LONG_BINPUT;
+ pdata[1] = (unsigned char)(idx & 0xff);
+ pdata[2] = (unsigned char)((idx >> 8) & 0xff);
+ pdata[3] = (unsigned char)((idx >> 16) & 0xff);
+ pdata[4] = (unsigned char)((idx >> 24) & 0xff);
+ len = 5;
+ }
+ else { /* unlikely */
+ PyErr_SetString(st->PicklingError,
+ "memo id too large for LONG_BINPUT");
+ return -1;
+ }
+ }
+ if (_Pickler_Write(self, pdata, len) < 0)
+ return -1;
+
+ return 0;
+}
+
+static PyObject *
+get_dotted_path(PyObject *obj, PyObject *name)
+{
+ PyObject *dotted_path;
+ Py_ssize_t i, n;
+ _Py_DECLARE_STR(dot, ".");
+ dotted_path = PyUnicode_Split(name, &_Py_STR(dot), -1);
+ if (dotted_path == NULL)
+ return NULL;
+ n = PyList_GET_SIZE(dotted_path);
+ assert(n >= 1);
+ for (i = 0; i < n; i++) {
+ PyObject *subpath = PyList_GET_ITEM(dotted_path, i);
+ if (_PyUnicode_EqualToASCIIString(subpath, "<locals>")) {
+ if (obj == NULL)
+ PyErr_Format(PyExc_AttributeError,
+ "Can't pickle local object %R", name);
+ else
+ PyErr_Format(PyExc_AttributeError,
+ "Can't pickle local attribute %R on %R", name, obj);
+ Py_DECREF(dotted_path);
+ return NULL;
+ }
+ }
+ return dotted_path;
+}
+
+static PyObject *
+get_deep_attribute(PyObject *obj, PyObject *names, PyObject **pparent)
+{
+ Py_ssize_t i, n;
+ PyObject *parent = NULL;
+
+ assert(PyList_CheckExact(names));
+ Py_INCREF(obj);
+ n = PyList_GET_SIZE(names);
+ for (i = 0; i < n; i++) {
+ PyObject *name = PyList_GET_ITEM(names, i);
+ Py_XSETREF(parent, obj);
+ (void)_PyObject_LookupAttr(parent, name, &obj);
+ if (obj == NULL) {
+ Py_DECREF(parent);
+ return NULL;
+ }
+ }
+ if (pparent != NULL)
+ *pparent = parent;
+ else
+ Py_XDECREF(parent);
+ return obj;
+}
+
+
+static PyObject *
+getattribute(PyObject *obj, PyObject *name, int allow_qualname)
+{
+ PyObject *dotted_path, *attr;
+
+ if (allow_qualname) {
+ dotted_path = get_dotted_path(obj, name);
+ if (dotted_path == NULL)
+ return NULL;
+ attr = get_deep_attribute(obj, dotted_path, NULL);
+ Py_DECREF(dotted_path);
+ }
+ else {
+ (void)_PyObject_LookupAttr(obj, name, &attr);
+ }
+ if (attr == NULL && !PyErr_Occurred()) {
+ PyErr_Format(PyExc_AttributeError,
+ "Can't get attribute %R on %R", name, obj);
+ }
+ return attr;
+}
+
+static int
+_checkmodule(PyObject *module_name, PyObject *module,
+ PyObject *global, PyObject *dotted_path)
+{
+ if (module == Py_None) {
+ return -1;
+ }
+ if (PyUnicode_Check(module_name) &&
+ _PyUnicode_EqualToASCIIString(module_name, "__main__")) {
+ return -1;
+ }
+
+ PyObject *candidate = get_deep_attribute(module, dotted_path, NULL);
+ if (candidate == NULL) {
+ return -1;
+ }
+ if (candidate != global) {
+ Py_DECREF(candidate);
+ return -1;
+ }
+ Py_DECREF(candidate);
+ return 0;
+}
+
+static PyObject *
+whichmodule(PyObject *global, PyObject *dotted_path)
+{
+ PyObject *module_name;
+ PyObject *module = NULL;
+ Py_ssize_t i;
+ PyObject *modules;
+
+ if (_PyObject_LookupAttr(global, &_Py_ID(__module__), &module_name) < 0) {
+ return NULL;
+ }
+ if (module_name) {
+ /* In some rare cases (e.g., bound methods of extension types),
+ __module__ can be None. If it is so, then search sys.modules for
+ the module of global. */
+ if (module_name != Py_None)
+ return module_name;
+ Py_CLEAR(module_name);
+ }
+ assert(module_name == NULL);
+
+ /* Fallback on walking sys.modules */
+ PyThreadState *tstate = _PyThreadState_GET();
+ modules = _PySys_GetAttr(tstate, &_Py_ID(modules));
+ if (modules == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "unable to get sys.modules");
+ return NULL;
+ }
+ if (PyDict_CheckExact(modules)) {
+ i = 0;
+ while (PyDict_Next(modules, &i, &module_name, &module)) {
+ if (_checkmodule(module_name, module, global, dotted_path) == 0) {
+ return Py_NewRef(module_name);
+ }
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+ }
+ }
+ else {
+ PyObject *iterator = PyObject_GetIter(modules);
+ if (iterator == NULL) {
+ return NULL;
+ }
+ while ((module_name = PyIter_Next(iterator))) {
+ module = PyObject_GetItem(modules, module_name);
+ if (module == NULL) {
+ Py_DECREF(module_name);
+ Py_DECREF(iterator);
+ return NULL;
+ }
+ if (_checkmodule(module_name, module, global, dotted_path) == 0) {
+ Py_DECREF(module);
+ Py_DECREF(iterator);
+ return module_name;
+ }
+ Py_DECREF(module);
+ Py_DECREF(module_name);
+ if (PyErr_Occurred()) {
+ Py_DECREF(iterator);
+ return NULL;
+ }
+ }
+ Py_DECREF(iterator);
+ }
+
+ /* If no module is found, use __main__. */
+ module_name = &_Py_ID(__main__);
+ return Py_NewRef(module_name);
+}
+
+/* fast_save_enter() and fast_save_leave() are guards against recursive
+ objects when Pickler is used with the "fast mode" (i.e., with object
+ memoization disabled). If the nesting of a list or dict object exceed
+ FAST_NESTING_LIMIT, these guards will start keeping an internal
+ reference to the seen list or dict objects and check whether these objects
+ are recursive. These are not strictly necessary, since save() has a
+ hard-coded recursion limit, but they give a nicer error message than the
+ typical RuntimeError. */
+static int
+fast_save_enter(PicklerObject *self, PyObject *obj)
+{
+ /* if fast_nesting < 0, we're doing an error exit. */
+ if (++self->fast_nesting >= FAST_NESTING_LIMIT) {
+ PyObject *key = NULL;
+ if (self->fast_memo == NULL) {
+ self->fast_memo = PyDict_New();
+ if (self->fast_memo == NULL) {
+ self->fast_nesting = -1;
+ return 0;
+ }
+ }
+ key = PyLong_FromVoidPtr(obj);
+ if (key == NULL) {
+ self->fast_nesting = -1;
+ return 0;
+ }
+ int r = PyDict_Contains(self->fast_memo, key);
+ if (r > 0) {
+ PyErr_Format(PyExc_ValueError,
+ "fast mode: can't pickle cyclic objects "
+ "including object type %.200s at %p",
+ Py_TYPE(obj)->tp_name, obj);
+ }
+ else if (r == 0) {
+ r = PyDict_SetItem(self->fast_memo, key, Py_None);
+ }
+ Py_DECREF(key);
+ if (r != 0) {
+ self->fast_nesting = -1;
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int
+fast_save_leave(PicklerObject *self, PyObject *obj)
+{
+ if (self->fast_nesting-- >= FAST_NESTING_LIMIT) {
+ PyObject *key = PyLong_FromVoidPtr(obj);
+ if (key == NULL)
+ return 0;
+ if (PyDict_DelItem(self->fast_memo, key) < 0) {
+ Py_DECREF(key);
+ return 0;
+ }
+ Py_DECREF(key);
+ }
+ return 1;
+}
+
+static int
+save_none(PicklerObject *self, PyObject *obj)
+{
+ const char none_op = NONE;
+ if (_Pickler_Write(self, &none_op, 1) < 0)
+ return -1;
+
+ return 0;
+}
+
+static int
+save_bool(PicklerObject *self, PyObject *obj)
+{
+ if (self->proto >= 2) {
+ const char bool_op = (obj == Py_True) ? NEWTRUE : NEWFALSE;
+ if (_Pickler_Write(self, &bool_op, 1) < 0)
+ return -1;
+ }
+ else {
+ /* These aren't opcodes -- they're ways to pickle bools before protocol 2
+ * so that unpicklers written before bools were introduced unpickle them
+ * as ints, but unpicklers after can recognize that bools were intended.
+ * Note that protocol 2 added direct ways to pickle bools.
+ */
+ const char *bool_str = (obj == Py_True) ? "I01\n" : "I00\n";
+ if (_Pickler_Write(self, bool_str, strlen(bool_str)) < 0)
+ return -1;
+ }
+ return 0;
+}
+
+static int
+save_long(PicklerObject *self, PyObject *obj)
+{
+ PyObject *repr = NULL;
+ Py_ssize_t size;
+ long val;
+ int overflow;
+ int status = 0;
+
+ val= PyLong_AsLongAndOverflow(obj, &overflow);
+ if (!overflow && (sizeof(long) <= 4 ||
+ (val <= 0x7fffffffL && val >= (-0x7fffffffL - 1))))
+ {
+ /* result fits in a signed 4-byte integer.
+
+ Note: we can't use -0x80000000L in the above condition because some
+ compilers (e.g., MSVC) will promote 0x80000000L to an unsigned type
+ before applying the unary minus when sizeof(long) <= 4. The
+ resulting value stays unsigned which is commonly not what we want,
+ so MSVC happily warns us about it. However, that result would have
+ been fine because we guard for sizeof(long) <= 4 which turns the
+ condition true in that particular case. */
+ char pdata[32];
+ Py_ssize_t len = 0;
+
+ if (self->bin) {
+ pdata[1] = (unsigned char)(val & 0xff);
+ pdata[2] = (unsigned char)((val >> 8) & 0xff);
+ pdata[3] = (unsigned char)((val >> 16) & 0xff);
+ pdata[4] = (unsigned char)((val >> 24) & 0xff);
+
+ if ((pdata[4] != 0) || (pdata[3] != 0)) {
+ pdata[0] = BININT;
+ len = 5;
+ }
+ else if (pdata[2] != 0) {
+ pdata[0] = BININT2;
+ len = 3;
+ }
+ else {
+ pdata[0] = BININT1;
+ len = 2;
+ }
+ }
+ else {
+ sprintf(pdata, "%c%ld\n", INT, val);
+ len = strlen(pdata);
+ }
+ if (_Pickler_Write(self, pdata, len) < 0)
+ return -1;
+
+ return 0;
+ }
+ assert(!PyErr_Occurred());
+
+ if (self->proto >= 2) {
+ /* Linear-time pickling. */
+ size_t nbits;
+ size_t nbytes;
+ unsigned char *pdata;
+ char header[5];
+ int i;
+ int sign = _PyLong_Sign(obj);
+
+ if (sign == 0) {
+ header[0] = LONG1;
+ header[1] = 0; /* It's 0 -- an empty bytestring. */
+ if (_Pickler_Write(self, header, 2) < 0)
+ goto error;
+ return 0;
+ }
+ nbits = _PyLong_NumBits(obj);
+ if (nbits == (size_t)-1 && PyErr_Occurred())
+ goto error;
+ /* How many bytes do we need? There are nbits >> 3 full
+ * bytes of data, and nbits & 7 leftover bits. If there
+ * are any leftover bits, then we clearly need another
+ * byte. What's not so obvious is that we *probably*
+ * need another byte even if there aren't any leftovers:
+ * the most-significant bit of the most-significant byte
+ * acts like a sign bit, and it's usually got a sense
+ * opposite of the one we need. The exception is ints
+ * of the form -(2**(8*j-1)) for j > 0. Such an int is
+ * its own 256's-complement, so has the right sign bit
+ * even without the extra byte. That's a pain to check
+ * for in advance, though, so we always grab an extra
+ * byte at the start, and cut it back later if possible.
+ */
+ nbytes = (nbits >> 3) + 1;
+ if (nbytes > 0x7fffffffL) {
+ PyErr_SetString(PyExc_OverflowError,
+ "int too large to pickle");
+ goto error;
+ }
+ repr = PyBytes_FromStringAndSize(NULL, (Py_ssize_t)nbytes);
+ if (repr == NULL)
+ goto error;
+ pdata = (unsigned char *)PyBytes_AS_STRING(repr);
+ i = _PyLong_AsByteArray((PyLongObject *)obj,
+ pdata, nbytes,
+ 1 /* little endian */ , 1 /* signed */ );
+ if (i < 0)
+ goto error;
+ /* If the int is negative, this may be a byte more than
+ * needed. This is so iff the MSB is all redundant sign
+ * bits.
+ */
+ if (sign < 0 &&
+ nbytes > 1 &&
+ pdata[nbytes - 1] == 0xff &&
+ (pdata[nbytes - 2] & 0x80) != 0) {
+ nbytes--;
+ }
+
+ if (nbytes < 256) {
+ header[0] = LONG1;
+ header[1] = (unsigned char)nbytes;
+ size = 2;
+ }
+ else {
+ header[0] = LONG4;
+ size = (Py_ssize_t) nbytes;
+ for (i = 1; i < 5; i++) {
+ header[i] = (unsigned char)(size & 0xff);
+ size >>= 8;
+ }
+ size = 5;
+ }
+ if (_Pickler_Write(self, header, size) < 0 ||
+ _Pickler_Write(self, (char *)pdata, (int)nbytes) < 0)
+ goto error;
+ }
+ else {
+ const char long_op = LONG;
+ const char *string;
+
+ /* proto < 2: write the repr and newline. This is quadratic-time (in
+ the number of digits), in both directions. We add a trailing 'L'
+ to the repr, for compatibility with Python 2.x. */
+
+ repr = PyObject_Repr(obj);
+ if (repr == NULL)
+ goto error;
+
+ string = PyUnicode_AsUTF8AndSize(repr, &size);
+ if (string == NULL)
+ goto error;
+
+ if (_Pickler_Write(self, &long_op, 1) < 0 ||
+ _Pickler_Write(self, string, size) < 0 ||
+ _Pickler_Write(self, "L\n", 2) < 0)
+ goto error;
+ }
+
+ if (0) {
+ error:
+ status = -1;
+ }
+ Py_XDECREF(repr);
+
+ return status;
+}
+
+static int
+save_float(PicklerObject *self, PyObject *obj)
+{
+ double x = PyFloat_AS_DOUBLE((PyFloatObject *)obj);
+
+ if (self->bin) {
+ char pdata[9];
+ pdata[0] = BINFLOAT;
+ if (PyFloat_Pack8(x, &pdata[1], 0) < 0)
+ return -1;
+ if (_Pickler_Write(self, pdata, 9) < 0)
+ return -1;
+ }
+ else {
+ int result = -1;
+ char *buf = NULL;
+ char op = FLOAT;
+
+ if (_Pickler_Write(self, &op, 1) < 0)
+ goto done;
+
+ buf = PyOS_double_to_string(x, 'r', 0, Py_DTSF_ADD_DOT_0, NULL);
+ if (!buf) {
+ PyErr_NoMemory();
+ goto done;
+ }
+
+ if (_Pickler_Write(self, buf, strlen(buf)) < 0)
+ goto done;
+
+ if (_Pickler_Write(self, "\n", 1) < 0)
+ goto done;
+
+ result = 0;
+done:
+ PyMem_Free(buf);
+ return result;
+ }
+
+ return 0;
+}
+
+/* Perform direct write of the header and payload of the binary object.
+
+ The large contiguous data is written directly into the underlying file
+ object, bypassing the output_buffer of the Pickler. We intentionally
+ do not insert a protocol 4 frame opcode to make it possible to optimize
+ file.read calls in the loader.
+ */
+static int
+_Pickler_write_bytes(PicklerObject *self,
+ const char *header, Py_ssize_t header_size,
+ const char *data, Py_ssize_t data_size,
+ PyObject *payload)
+{
+ int bypass_buffer = (data_size >= FRAME_SIZE_TARGET);
+ int framing = self->framing;
+
+ if (bypass_buffer) {
+ assert(self->output_buffer != NULL);
+ /* Commit the previous frame. */
+ if (_Pickler_CommitFrame(self)) {
+ return -1;
+ }
+ /* Disable framing temporarily */
+ self->framing = 0;
+ }
+
+ if (_Pickler_Write(self, header, header_size) < 0) {
+ return -1;
+ }
+
+ if (bypass_buffer && self->write != NULL) {
+ /* Bypass the in-memory buffer to directly stream large data
+ into the underlying file object. */
+ PyObject *result, *mem = NULL;
+ /* Dump the output buffer to the file. */
+ if (_Pickler_FlushToFile(self) < 0) {
+ return -1;
+ }
+
+ /* Stream write the payload into the file without going through the
+ output buffer. */
+ if (payload == NULL) {
+ /* TODO: It would be better to use a memoryview with a linked
+ original string if this is possible. */
+ payload = mem = PyBytes_FromStringAndSize(data, data_size);
+ if (payload == NULL) {
+ return -1;
+ }
+ }
+ result = PyObject_CallOneArg(self->write, payload);
+ Py_XDECREF(mem);
+ if (result == NULL) {
+ return -1;
+ }
+ Py_DECREF(result);
+
+ /* Reinitialize the buffer for subsequent calls to _Pickler_Write. */
+ if (_Pickler_ClearBuffer(self) < 0) {
+ return -1;
+ }
+ }
+ else {
+ if (_Pickler_Write(self, data, data_size) < 0) {
+ return -1;
+ }
+ }
+
+ /* Re-enable framing for subsequent calls to _Pickler_Write. */
+ self->framing = framing;
+
+ return 0;
+}
+
+static int
+_save_bytes_data(PickleState *st, PicklerObject *self, PyObject *obj,
+ const char *data, Py_ssize_t size)
+{
+ assert(self->proto >= 3);
+
+ char header[9];
+ Py_ssize_t len;
+
+ if (size < 0)
+ return -1;
+
+ if (size <= 0xff) {
+ header[0] = SHORT_BINBYTES;
+ header[1] = (unsigned char)size;
+ len = 2;
+ }
+ else if ((size_t)size <= 0xffffffffUL) {
+ header[0] = BINBYTES;
+ header[1] = (unsigned char)(size & 0xff);
+ header[2] = (unsigned char)((size >> 8) & 0xff);
+ header[3] = (unsigned char)((size >> 16) & 0xff);
+ header[4] = (unsigned char)((size >> 24) & 0xff);
+ len = 5;
+ }
+ else if (self->proto >= 4) {
+ header[0] = BINBYTES8;
+ _write_size64(header + 1, size);
+ len = 9;
+ }
+ else {
+ PyErr_SetString(PyExc_OverflowError,
+ "serializing a bytes object larger than 4 GiB "
+ "requires pickle protocol 4 or higher");
+ return -1;
+ }
+
+ if (_Pickler_write_bytes(self, header, len, data, size, obj) < 0) {
+ return -1;
+ }
+
+ if (memo_put(st, self, obj) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+save_bytes(PickleState *st, PicklerObject *self, PyObject *obj)
+{
+ if (self->proto < 3) {
+ /* Older pickle protocols do not have an opcode for pickling bytes
+ objects. Therefore, we need to fake the copy protocol (i.e.,
+ the __reduce__ method) to permit bytes object unpickling.
+
+ Here we use a hack to be compatible with Python 2. Since in Python
+ 2 'bytes' is just an alias for 'str' (which has different
+ parameters than the actual bytes object), we use codecs.encode
+ to create the appropriate 'str' object when unpickled using
+ Python 2 *and* the appropriate 'bytes' object when unpickled
+ using Python 3. Again this is a hack and we don't need to do this
+ with newer protocols. */
+ PyObject *reduce_value;
+ int status;
+
+ if (PyBytes_GET_SIZE(obj) == 0) {
+ reduce_value = Py_BuildValue("(O())", (PyObject*)&PyBytes_Type);
+ }
+ else {
+ PyObject *unicode_str =
+ PyUnicode_DecodeLatin1(PyBytes_AS_STRING(obj),
+ PyBytes_GET_SIZE(obj),
+ "strict");
+
+ if (unicode_str == NULL)
+ return -1;
+ reduce_value = Py_BuildValue("(O(OO))",
+ st->codecs_encode, unicode_str,
+ &_Py_ID(latin1));
+ Py_DECREF(unicode_str);
+ }
+
+ if (reduce_value == NULL)
+ return -1;
+
+ /* save_reduce() will memoize the object automatically. */
+ status = save_reduce(st, self, reduce_value, obj);
+ Py_DECREF(reduce_value);
+ return status;
+ }
+ else {
+ return _save_bytes_data(st, self, obj, PyBytes_AS_STRING(obj),
+ PyBytes_GET_SIZE(obj));
+ }
+}
+
+static int
+_save_bytearray_data(PickleState *state, PicklerObject *self, PyObject *obj,
+ const char *data, Py_ssize_t size)
+{
+ assert(self->proto >= 5);
+
+ char header[9];
+ Py_ssize_t len;
+
+ if (size < 0)
+ return -1;
+
+ header[0] = BYTEARRAY8;
+ _write_size64(header + 1, size);
+ len = 9;
+
+ if (_Pickler_write_bytes(self, header, len, data, size, obj) < 0) {
+ return -1;
+ }
+
+ if (memo_put(state, self, obj) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+save_bytearray(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ if (self->proto < 5) {
+ /* Older pickle protocols do not have an opcode for pickling
+ * bytearrays. */
+ PyObject *reduce_value = NULL;
+ int status;
+
+ if (PyByteArray_GET_SIZE(obj) == 0) {
+ reduce_value = Py_BuildValue("(O())",
+ (PyObject *) &PyByteArray_Type);
+ }
+ else {
+ PyObject *bytes_obj = PyBytes_FromObject(obj);
+ if (bytes_obj != NULL) {
+ reduce_value = Py_BuildValue("(O(O))",
+ (PyObject *) &PyByteArray_Type,
+ bytes_obj);
+ Py_DECREF(bytes_obj);
+ }
+ }
+ if (reduce_value == NULL)
+ return -1;
+
+ /* save_reduce() will memoize the object automatically. */
+ status = save_reduce(state, self, reduce_value, obj);
+ Py_DECREF(reduce_value);
+ return status;
+ }
+ else {
+ return _save_bytearray_data(state, self, obj,
+ PyByteArray_AS_STRING(obj),
+ PyByteArray_GET_SIZE(obj));
+ }
+}
+
+static int
+save_picklebuffer(PickleState *st, PicklerObject *self, PyObject *obj)
+{
+ if (self->proto < 5) {
+ PyErr_SetString(st->PicklingError,
+ "PickleBuffer can only pickled with protocol >= 5");
+ return -1;
+ }
+ const Py_buffer* view = PyPickleBuffer_GetBuffer(obj);
+ if (view == NULL) {
+ return -1;
+ }
+ if (view->suboffsets != NULL || !PyBuffer_IsContiguous(view, 'A')) {
+ PyErr_SetString(st->PicklingError,
+ "PickleBuffer can not be pickled when "
+ "pointing to a non-contiguous buffer");
+ return -1;
+ }
+ int in_band = 1;
+ if (self->buffer_callback != NULL) {
+ PyObject *ret = PyObject_CallOneArg(self->buffer_callback, obj);
+ if (ret == NULL) {
+ return -1;
+ }
+ in_band = PyObject_IsTrue(ret);
+ Py_DECREF(ret);
+ if (in_band == -1) {
+ return -1;
+ }
+ }
+ if (in_band) {
+ /* Write data in-band */
+ if (view->readonly) {
+ return _save_bytes_data(st, self, obj, (const char *)view->buf,
+ view->len);
+ }
+ else {
+ return _save_bytearray_data(st, self, obj, (const char *)view->buf,
+ view->len);
+ }
+ }
+ else {
+ /* Write data out-of-band */
+ const char next_buffer_op = NEXT_BUFFER;
+ if (_Pickler_Write(self, &next_buffer_op, 1) < 0) {
+ return -1;
+ }
+ if (view->readonly) {
+ const char readonly_buffer_op = READONLY_BUFFER;
+ if (_Pickler_Write(self, &readonly_buffer_op, 1) < 0) {
+ return -1;
+ }
+ }
+ }
+ return 0;
+}
+
+/* A copy of PyUnicode_AsRawUnicodeEscapeString() that also translates
+ backslash and newline characters to \uXXXX escapes. */
+static PyObject *
+raw_unicode_escape(PyObject *obj)
+{
+ char *p;
+ Py_ssize_t i, size;
+ const void *data;
+ int kind;
+ _PyBytesWriter writer;
+
+ if (PyUnicode_READY(obj))
+ return NULL;
+
+ _PyBytesWriter_Init(&writer);
+
+ size = PyUnicode_GET_LENGTH(obj);
+ data = PyUnicode_DATA(obj);
+ kind = PyUnicode_KIND(obj);
+
+ p = _PyBytesWriter_Alloc(&writer, size);
+ if (p == NULL)
+ goto error;
+ writer.overallocate = 1;
+
+ for (i=0; i < size; i++) {
+ Py_UCS4 ch = PyUnicode_READ(kind, data, i);
+ /* Map 32-bit characters to '\Uxxxxxxxx' */
+ if (ch >= 0x10000) {
+ /* -1: subtract 1 preallocated byte */
+ p = _PyBytesWriter_Prepare(&writer, p, 10-1);
+ if (p == NULL)
+ goto error;
+
+ *p++ = '\\';
+ *p++ = 'U';
+ *p++ = Py_hexdigits[(ch >> 28) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 24) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 20) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 16) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 12) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 8) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 4) & 0xf];
+ *p++ = Py_hexdigits[ch & 15];
+ }
+ /* Map 16-bit characters, '\\' and '\n' to '\uxxxx' */
+ else if (ch >= 256 ||
+ ch == '\\' || ch == 0 || ch == '\n' || ch == '\r' ||
+ ch == 0x1a)
+ {
+ /* -1: subtract 1 preallocated byte */
+ p = _PyBytesWriter_Prepare(&writer, p, 6-1);
+ if (p == NULL)
+ goto error;
+
+ *p++ = '\\';
+ *p++ = 'u';
+ *p++ = Py_hexdigits[(ch >> 12) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 8) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 4) & 0xf];
+ *p++ = Py_hexdigits[ch & 15];
+ }
+ /* Copy everything else as-is */
+ else
+ *p++ = (char) ch;
+ }
+
+ return _PyBytesWriter_Finish(&writer, p);
+
+error:
+ _PyBytesWriter_Dealloc(&writer);
+ return NULL;
+}
+
+static int
+write_unicode_binary(PicklerObject *self, PyObject *obj)
+{
+ char header[9];
+ Py_ssize_t len;
+ PyObject *encoded = NULL;
+ Py_ssize_t size;
+ const char *data;
+
+ if (PyUnicode_READY(obj))
+ return -1;
+
+ data = PyUnicode_AsUTF8AndSize(obj, &size);
+ if (data == NULL) {
+ /* Issue #8383: for strings with lone surrogates, fallback on the
+ "surrogatepass" error handler. */
+ PyErr_Clear();
+ encoded = PyUnicode_AsEncodedString(obj, "utf-8", "surrogatepass");
+ if (encoded == NULL)
+ return -1;
+
+ data = PyBytes_AS_STRING(encoded);
+ size = PyBytes_GET_SIZE(encoded);
+ }
+
+ assert(size >= 0);
+ if (size <= 0xff && self->proto >= 4) {
+ header[0] = SHORT_BINUNICODE;
+ header[1] = (unsigned char)(size & 0xff);
+ len = 2;
+ }
+ else if ((size_t)size <= 0xffffffffUL) {
+ header[0] = BINUNICODE;
+ header[1] = (unsigned char)(size & 0xff);
+ header[2] = (unsigned char)((size >> 8) & 0xff);
+ header[3] = (unsigned char)((size >> 16) & 0xff);
+ header[4] = (unsigned char)((size >> 24) & 0xff);
+ len = 5;
+ }
+ else if (self->proto >= 4) {
+ header[0] = BINUNICODE8;
+ _write_size64(header + 1, size);
+ len = 9;
+ }
+ else {
+ PyErr_SetString(PyExc_OverflowError,
+ "serializing a string larger than 4 GiB "
+ "requires pickle protocol 4 or higher");
+ Py_XDECREF(encoded);
+ return -1;
+ }
+
+ if (_Pickler_write_bytes(self, header, len, data, size, encoded) < 0) {
+ Py_XDECREF(encoded);
+ return -1;
+ }
+ Py_XDECREF(encoded);
+ return 0;
+}
+
+static int
+save_unicode(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ if (self->bin) {
+ if (write_unicode_binary(self, obj) < 0)
+ return -1;
+ }
+ else {
+ PyObject *encoded;
+ Py_ssize_t size;
+ const char unicode_op = UNICODE;
+
+ encoded = raw_unicode_escape(obj);
+ if (encoded == NULL)
+ return -1;
+
+ if (_Pickler_Write(self, &unicode_op, 1) < 0) {
+ Py_DECREF(encoded);
+ return -1;
+ }
+
+ size = PyBytes_GET_SIZE(encoded);
+ if (_Pickler_Write(self, PyBytes_AS_STRING(encoded), size) < 0) {
+ Py_DECREF(encoded);
+ return -1;
+ }
+ Py_DECREF(encoded);
+
+ if (_Pickler_Write(self, "\n", 1) < 0)
+ return -1;
+ }
+ if (memo_put(state, self, obj) < 0)
+ return -1;
+
+ return 0;
+}
+
+/* A helper for save_tuple. Push the len elements in tuple t on the stack. */
+static int
+store_tuple_elements(PickleState *state, PicklerObject *self, PyObject *t,
+ Py_ssize_t len)
+{
+ Py_ssize_t i;
+
+ assert(PyTuple_Size(t) == len);
+
+ for (i = 0; i < len; i++) {
+ PyObject *element = PyTuple_GET_ITEM(t, i);
+
+ if (element == NULL)
+ return -1;
+ if (save(state, self, element, 0) < 0)
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Tuples are ubiquitous in the pickle protocols, so many techniques are
+ * used across protocols to minimize the space needed to pickle them.
+ * Tuples are also the only builtin immutable type that can be recursive
+ * (a tuple can be reached from itself), and that requires some subtle
+ * magic so that it works in all cases. IOW, this is a long routine.
+ */
+static int
+save_tuple(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ Py_ssize_t len, i;
+
+ const char mark_op = MARK;
+ const char tuple_op = TUPLE;
+ const char pop_op = POP;
+ const char pop_mark_op = POP_MARK;
+ const char len2opcode[] = {EMPTY_TUPLE, TUPLE1, TUPLE2, TUPLE3};
+
+ if ((len = PyTuple_Size(obj)) < 0)
+ return -1;
+
+ if (len == 0) {
+ char pdata[2];
+
+ if (self->proto) {
+ pdata[0] = EMPTY_TUPLE;
+ len = 1;
+ }
+ else {
+ pdata[0] = MARK;
+ pdata[1] = TUPLE;
+ len = 2;
+ }
+ if (_Pickler_Write(self, pdata, len) < 0)
+ return -1;
+ return 0;
+ }
+
+ /* The tuple isn't in the memo now. If it shows up there after
+ * saving the tuple elements, the tuple must be recursive, in
+ * which case we'll pop everything we put on the stack, and fetch
+ * its value from the memo.
+ */
+ if (len <= 3 && self->proto >= 2) {
+ /* Use TUPLE{1,2,3} opcodes. */
+ if (store_tuple_elements(state, self, obj, len) < 0)
+ return -1;
+
+ if (PyMemoTable_Get(self->memo, obj)) {
+ /* pop the len elements */
+ for (i = 0; i < len; i++)
+ if (_Pickler_Write(self, &pop_op, 1) < 0)
+ return -1;
+ /* fetch from memo */
+ if (memo_get(state, self, obj) < 0)
+ return -1;
+
+ return 0;
+ }
+ else { /* Not recursive. */
+ if (_Pickler_Write(self, len2opcode + len, 1) < 0)
+ return -1;
+ }
+ goto memoize;
+ }
+
+ /* proto < 2 and len > 0, or proto >= 2 and len > 3.
+ * Generate MARK e1 e2 ... TUPLE
+ */
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ return -1;
+
+ if (store_tuple_elements(state, self, obj, len) < 0)
+ return -1;
+
+ if (PyMemoTable_Get(self->memo, obj)) {
+ /* pop the stack stuff we pushed */
+ if (self->bin) {
+ if (_Pickler_Write(self, &pop_mark_op, 1) < 0)
+ return -1;
+ }
+ else {
+ /* Note that we pop one more than len, to remove
+ * the MARK too.
+ */
+ for (i = 0; i <= len; i++)
+ if (_Pickler_Write(self, &pop_op, 1) < 0)
+ return -1;
+ }
+ /* fetch from memo */
+ if (memo_get(state, self, obj) < 0)
+ return -1;
+
+ return 0;
+ }
+ else { /* Not recursive. */
+ if (_Pickler_Write(self, &tuple_op, 1) < 0)
+ return -1;
+ }
+
+ memoize:
+ if (memo_put(state, self, obj) < 0)
+ return -1;
+
+ return 0;
+}
+
+/* iter is an iterator giving items, and we batch up chunks of
+ * MARK item item ... item APPENDS
+ * opcode sequences. Calling code should have arranged to first create an
+ * empty list, or list-like object, for the APPENDS to operate on.
+ * Returns 0 on success, <0 on error.
+ */
+static int
+batch_list(PickleState *state, PicklerObject *self, PyObject *iter)
+{
+ PyObject *obj = NULL;
+ PyObject *firstitem = NULL;
+ int i, n;
+
+ const char mark_op = MARK;
+ const char append_op = APPEND;
+ const char appends_op = APPENDS;
+
+ assert(iter != NULL);
+
+ /* XXX: I think this function could be made faster by avoiding the
+ iterator interface and fetching objects directly from list using
+ PyList_GET_ITEM.
+ */
+
+ if (self->proto == 0) {
+ /* APPENDS isn't available; do one at a time. */
+ for (;;) {
+ obj = PyIter_Next(iter);
+ if (obj == NULL) {
+ if (PyErr_Occurred())
+ return -1;
+ break;
+ }
+ i = save(state, self, obj, 0);
+ Py_DECREF(obj);
+ if (i < 0)
+ return -1;
+ if (_Pickler_Write(self, &append_op, 1) < 0)
+ return -1;
+ }
+ return 0;
+ }
+
+ /* proto > 0: write in batches of BATCHSIZE. */
+ do {
+ /* Get first item */
+ firstitem = PyIter_Next(iter);
+ if (firstitem == NULL) {
+ if (PyErr_Occurred())
+ goto error;
+
+ /* nothing more to add */
+ break;
+ }
+
+ /* Try to get a second item */
+ obj = PyIter_Next(iter);
+ if (obj == NULL) {
+ if (PyErr_Occurred())
+ goto error;
+
+ /* Only one item to write */
+ if (save(state, self, firstitem, 0) < 0)
+ goto error;
+ if (_Pickler_Write(self, &append_op, 1) < 0)
+ goto error;
+ Py_CLEAR(firstitem);
+ break;
+ }
+
+ /* More than one item to write */
+
+ /* Pump out MARK, items, APPENDS. */
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ goto error;
+
+ if (save(state, self, firstitem, 0) < 0)
+ goto error;
+ Py_CLEAR(firstitem);
+ n = 1;
+
+ /* Fetch and save up to BATCHSIZE items */
+ while (obj) {
+ if (save(state, self, obj, 0) < 0)
+ goto error;
+ Py_CLEAR(obj);
+ n += 1;
+
+ if (n == BATCHSIZE)
+ break;
+
+ obj = PyIter_Next(iter);
+ if (obj == NULL) {
+ if (PyErr_Occurred())
+ goto error;
+ break;
+ }
+ }
+
+ if (_Pickler_Write(self, &appends_op, 1) < 0)
+ goto error;
+
+ } while (n == BATCHSIZE);
+ return 0;
+
+ error:
+ Py_XDECREF(firstitem);
+ Py_XDECREF(obj);
+ return -1;
+}
+
+/* This is a variant of batch_list() above, specialized for lists (with no
+ * support for list subclasses). Like batch_list(), we batch up chunks of
+ * MARK item item ... item APPENDS
+ * opcode sequences. Calling code should have arranged to first create an
+ * empty list, or list-like object, for the APPENDS to operate on.
+ * Returns 0 on success, -1 on error.
+ *
+ * This version is considerably faster than batch_list(), if less general.
+ *
+ * Note that this only works for protocols > 0.
+ */
+static int
+batch_list_exact(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ PyObject *item = NULL;
+ Py_ssize_t this_batch, total;
+
+ const char append_op = APPEND;
+ const char appends_op = APPENDS;
+ const char mark_op = MARK;
+
+ assert(obj != NULL);
+ assert(self->proto > 0);
+ assert(PyList_CheckExact(obj));
+
+ if (PyList_GET_SIZE(obj) == 1) {
+ item = PyList_GET_ITEM(obj, 0);
+ Py_INCREF(item);
+ int err = save(state, self, item, 0);
+ Py_DECREF(item);
+ if (err < 0)
+ return -1;
+ if (_Pickler_Write(self, &append_op, 1) < 0)
+ return -1;
+ return 0;
+ }
+
+ /* Write in batches of BATCHSIZE. */
+ total = 0;
+ do {
+ this_batch = 0;
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ return -1;
+ while (total < PyList_GET_SIZE(obj)) {
+ item = PyList_GET_ITEM(obj, total);
+ Py_INCREF(item);
+ int err = save(state, self, item, 0);
+ Py_DECREF(item);
+ if (err < 0)
+ return -1;
+ total++;
+ if (++this_batch == BATCHSIZE)
+ break;
+ }
+ if (_Pickler_Write(self, &appends_op, 1) < 0)
+ return -1;
+
+ } while (total < PyList_GET_SIZE(obj));
+
+ return 0;
+}
+
+static int
+save_list(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ char header[3];
+ Py_ssize_t len;
+ int status = 0;
+
+ if (self->fast && !fast_save_enter(self, obj))
+ goto error;
+
+ /* Create an empty list. */
+ if (self->bin) {
+ header[0] = EMPTY_LIST;
+ len = 1;
+ }
+ else {
+ header[0] = MARK;
+ header[1] = LIST;
+ len = 2;
+ }
+
+ if (_Pickler_Write(self, header, len) < 0)
+ goto error;
+
+ /* Get list length, and bow out early if empty. */
+ if ((len = PyList_Size(obj)) < 0)
+ goto error;
+
+ if (memo_put(state, self, obj) < 0)
+ goto error;
+
+ if (len != 0) {
+ /* Materialize the list elements. */
+ if (PyList_CheckExact(obj) && self->proto > 0) {
+ if (_Py_EnterRecursiveCall(" while pickling an object"))
+ goto error;
+ status = batch_list_exact(state, self, obj);
+ _Py_LeaveRecursiveCall();
+ } else {
+ PyObject *iter = PyObject_GetIter(obj);
+ if (iter == NULL)
+ goto error;
+
+ if (_Py_EnterRecursiveCall(" while pickling an object")) {
+ Py_DECREF(iter);
+ goto error;
+ }
+ status = batch_list(state, self, iter);
+ _Py_LeaveRecursiveCall();
+ Py_DECREF(iter);
+ }
+ }
+ if (0) {
+ error:
+ status = -1;
+ }
+
+ if (self->fast && !fast_save_leave(self, obj))
+ status = -1;
+
+ return status;
+}
+
+/* iter is an iterator giving (key, value) pairs, and we batch up chunks of
+ * MARK key value ... key value SETITEMS
+ * opcode sequences. Calling code should have arranged to first create an
+ * empty dict, or dict-like object, for the SETITEMS to operate on.
+ * Returns 0 on success, <0 on error.
+ *
+ * This is very much like batch_list(). The difference between saving
+ * elements directly, and picking apart two-tuples, is so long-winded at
+ * the C level, though, that attempts to combine these routines were too
+ * ugly to bear.
+ */
+static int
+batch_dict(PickleState *state, PicklerObject *self, PyObject *iter)
+{
+ PyObject *obj = NULL;
+ PyObject *firstitem = NULL;
+ int i, n;
+
+ const char mark_op = MARK;
+ const char setitem_op = SETITEM;
+ const char setitems_op = SETITEMS;
+
+ assert(iter != NULL);
+
+ if (self->proto == 0) {
+ /* SETITEMS isn't available; do one at a time. */
+ for (;;) {
+ obj = PyIter_Next(iter);
+ if (obj == NULL) {
+ if (PyErr_Occurred())
+ return -1;
+ break;
+ }
+ if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 2) {
+ PyErr_SetString(PyExc_TypeError, "dict items "
+ "iterator must return 2-tuples");
+ return -1;
+ }
+ i = save(state, self, PyTuple_GET_ITEM(obj, 0), 0);
+ if (i >= 0)
+ i = save(state, self, PyTuple_GET_ITEM(obj, 1), 0);
+ Py_DECREF(obj);
+ if (i < 0)
+ return -1;
+ if (_Pickler_Write(self, &setitem_op, 1) < 0)
+ return -1;
+ }
+ return 0;
+ }
+
+ /* proto > 0: write in batches of BATCHSIZE. */
+ do {
+ /* Get first item */
+ firstitem = PyIter_Next(iter);
+ if (firstitem == NULL) {
+ if (PyErr_Occurred())
+ goto error;
+
+ /* nothing more to add */
+ break;
+ }
+ if (!PyTuple_Check(firstitem) || PyTuple_Size(firstitem) != 2) {
+ PyErr_SetString(PyExc_TypeError, "dict items "
+ "iterator must return 2-tuples");
+ goto error;
+ }
+
+ /* Try to get a second item */
+ obj = PyIter_Next(iter);
+ if (obj == NULL) {
+ if (PyErr_Occurred())
+ goto error;
+
+ /* Only one item to write */
+ if (save(state, self, PyTuple_GET_ITEM(firstitem, 0), 0) < 0)
+ goto error;
+ if (save(state, self, PyTuple_GET_ITEM(firstitem, 1), 0) < 0)
+ goto error;
+ if (_Pickler_Write(self, &setitem_op, 1) < 0)
+ goto error;
+ Py_CLEAR(firstitem);
+ break;
+ }
+
+ /* More than one item to write */
+
+ /* Pump out MARK, items, SETITEMS. */
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ goto error;
+
+ if (save(state, self, PyTuple_GET_ITEM(firstitem, 0), 0) < 0)
+ goto error;
+ if (save(state, self, PyTuple_GET_ITEM(firstitem, 1), 0) < 0)
+ goto error;
+ Py_CLEAR(firstitem);
+ n = 1;
+
+ /* Fetch and save up to BATCHSIZE items */
+ while (obj) {
+ if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 2) {
+ PyErr_SetString(PyExc_TypeError, "dict items "
+ "iterator must return 2-tuples");
+ goto error;
+ }
+ if (save(state, self, PyTuple_GET_ITEM(obj, 0), 0) < 0 ||
+ save(state, self, PyTuple_GET_ITEM(obj, 1), 0) < 0)
+ goto error;
+ Py_CLEAR(obj);
+ n += 1;
+
+ if (n == BATCHSIZE)
+ break;
+
+ obj = PyIter_Next(iter);
+ if (obj == NULL) {
+ if (PyErr_Occurred())
+ goto error;
+ break;
+ }
+ }
+
+ if (_Pickler_Write(self, &setitems_op, 1) < 0)
+ goto error;
+
+ } while (n == BATCHSIZE);
+ return 0;
+
+ error:
+ Py_XDECREF(firstitem);
+ Py_XDECREF(obj);
+ return -1;
+}
+
+/* This is a variant of batch_dict() above that specializes for dicts, with no
+ * support for dict subclasses. Like batch_dict(), we batch up chunks of
+ * MARK key value ... key value SETITEMS
+ * opcode sequences. Calling code should have arranged to first create an
+ * empty dict, or dict-like object, for the SETITEMS to operate on.
+ * Returns 0 on success, -1 on error.
+ *
+ * Note that this currently doesn't work for protocol 0.
+ */
+static int
+batch_dict_exact(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ PyObject *key = NULL, *value = NULL;
+ int i;
+ Py_ssize_t dict_size, ppos = 0;
+
+ const char mark_op = MARK;
+ const char setitem_op = SETITEM;
+ const char setitems_op = SETITEMS;
+
+ assert(obj != NULL && PyDict_CheckExact(obj));
+ assert(self->proto > 0);
+
+ dict_size = PyDict_GET_SIZE(obj);
+
+ /* Special-case len(d) == 1 to save space. */
+ if (dict_size == 1) {
+ PyDict_Next(obj, &ppos, &key, &value);
+ Py_INCREF(key);
+ Py_INCREF(value);
+ if (save(state, self, key, 0) < 0) {
+ goto error;
+ }
+ if (save(state, self, value, 0) < 0) {
+ goto error;
+ }
+ Py_CLEAR(key);
+ Py_CLEAR(value);
+ if (_Pickler_Write(self, &setitem_op, 1) < 0)
+ return -1;
+ return 0;
+ }
+
+ /* Write in batches of BATCHSIZE. */
+ do {
+ i = 0;
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ return -1;
+ while (PyDict_Next(obj, &ppos, &key, &value)) {
+ Py_INCREF(key);
+ Py_INCREF(value);
+ if (save(state, self, key, 0) < 0) {
+ goto error;
+ }
+ if (save(state, self, value, 0) < 0) {
+ goto error;
+ }
+ Py_CLEAR(key);
+ Py_CLEAR(value);
+ if (++i == BATCHSIZE)
+ break;
+ }
+ if (_Pickler_Write(self, &setitems_op, 1) < 0)
+ return -1;
+ if (PyDict_GET_SIZE(obj) != dict_size) {
+ PyErr_Format(
+ PyExc_RuntimeError,
+ "dictionary changed size during iteration");
+ return -1;
+ }
+
+ } while (i == BATCHSIZE);
+ return 0;
+error:
+ Py_XDECREF(key);
+ Py_XDECREF(value);
+ return -1;
+}
+
+static int
+save_dict(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ PyObject *items, *iter;
+ char header[3];
+ Py_ssize_t len;
+ int status = 0;
+ assert(PyDict_Check(obj));
+
+ if (self->fast && !fast_save_enter(self, obj))
+ goto error;
+
+ /* Create an empty dict. */
+ if (self->bin) {
+ header[0] = EMPTY_DICT;
+ len = 1;
+ }
+ else {
+ header[0] = MARK;
+ header[1] = DICT;
+ len = 2;
+ }
+
+ if (_Pickler_Write(self, header, len) < 0)
+ goto error;
+
+ if (memo_put(state, self, obj) < 0)
+ goto error;
+
+ if (PyDict_GET_SIZE(obj)) {
+ /* Save the dict items. */
+ if (PyDict_CheckExact(obj) && self->proto > 0) {
+ /* We can take certain shortcuts if we know this is a dict and
+ not a dict subclass. */
+ if (_Py_EnterRecursiveCall(" while pickling an object"))
+ goto error;
+ status = batch_dict_exact(state, self, obj);
+ _Py_LeaveRecursiveCall();
+ } else {
+ items = PyObject_CallMethodNoArgs(obj, &_Py_ID(items));
+ if (items == NULL)
+ goto error;
+ iter = PyObject_GetIter(items);
+ Py_DECREF(items);
+ if (iter == NULL)
+ goto error;
+ if (_Py_EnterRecursiveCall(" while pickling an object")) {
+ Py_DECREF(iter);
+ goto error;
+ }
+ status = batch_dict(state, self, iter);
+ _Py_LeaveRecursiveCall();
+ Py_DECREF(iter);
+ }
+ }
+
+ if (0) {
+ error:
+ status = -1;
+ }
+
+ if (self->fast && !fast_save_leave(self, obj))
+ status = -1;
+
+ return status;
+}
+
+static int
+save_set(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ PyObject *item;
+ int i;
+ Py_ssize_t set_size, ppos = 0;
+ Py_hash_t hash;
+
+ const char empty_set_op = EMPTY_SET;
+ const char mark_op = MARK;
+ const char additems_op = ADDITEMS;
+
+ if (self->proto < 4) {
+ PyObject *items;
+ PyObject *reduce_value;
+ int status;
+
+ items = PySequence_List(obj);
+ if (items == NULL) {
+ return -1;
+ }
+ reduce_value = Py_BuildValue("(O(O))", (PyObject*)&PySet_Type, items);
+ Py_DECREF(items);
+ if (reduce_value == NULL) {
+ return -1;
+ }
+ /* save_reduce() will memoize the object automatically. */
+ status = save_reduce(state, self, reduce_value, obj);
+ Py_DECREF(reduce_value);
+ return status;
+ }
+
+ if (_Pickler_Write(self, &empty_set_op, 1) < 0)
+ return -1;
+
+ if (memo_put(state, self, obj) < 0)
+ return -1;
+
+ set_size = PySet_GET_SIZE(obj);
+ if (set_size == 0)
+ return 0; /* nothing to do */
+
+ /* Write in batches of BATCHSIZE. */
+ do {
+ i = 0;
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ return -1;
+ while (_PySet_NextEntry(obj, &ppos, &item, &hash)) {
+ Py_INCREF(item);
+ int err = save(state, self, item, 0);
+ Py_CLEAR(item);
+ if (err < 0)
+ return -1;
+ if (++i == BATCHSIZE)
+ break;
+ }
+ if (_Pickler_Write(self, &additems_op, 1) < 0)
+ return -1;
+ if (PySet_GET_SIZE(obj) != set_size) {
+ PyErr_Format(
+ PyExc_RuntimeError,
+ "set changed size during iteration");
+ return -1;
+ }
+ } while (i == BATCHSIZE);
+
+ return 0;
+}
+
+static int
+save_frozenset(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ PyObject *iter;
+
+ const char mark_op = MARK;
+ const char frozenset_op = FROZENSET;
+
+ if (self->fast && !fast_save_enter(self, obj))
+ return -1;
+
+ if (self->proto < 4) {
+ PyObject *items;
+ PyObject *reduce_value;
+ int status;
+
+ items = PySequence_List(obj);
+ if (items == NULL) {
+ return -1;
+ }
+ reduce_value = Py_BuildValue("(O(O))", (PyObject*)&PyFrozenSet_Type,
+ items);
+ Py_DECREF(items);
+ if (reduce_value == NULL) {
+ return -1;
+ }
+ /* save_reduce() will memoize the object automatically. */
+ status = save_reduce(state, self, reduce_value, obj);
+ Py_DECREF(reduce_value);
+ return status;
+ }
+
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ return -1;
+
+ iter = PyObject_GetIter(obj);
+ if (iter == NULL) {
+ return -1;
+ }
+ for (;;) {
+ PyObject *item;
+
+ item = PyIter_Next(iter);
+ if (item == NULL) {
+ if (PyErr_Occurred()) {
+ Py_DECREF(iter);
+ return -1;
+ }
+ break;
+ }
+ if (save(state, self, item, 0) < 0) {
+ Py_DECREF(item);
+ Py_DECREF(iter);
+ return -1;
+ }
+ Py_DECREF(item);
+ }
+ Py_DECREF(iter);
+
+ /* If the object is already in the memo, this means it is
+ recursive. In this case, throw away everything we put on the
+ stack, and fetch the object back from the memo. */
+ if (PyMemoTable_Get(self->memo, obj)) {
+ const char pop_mark_op = POP_MARK;
+
+ if (_Pickler_Write(self, &pop_mark_op, 1) < 0)
+ return -1;
+ if (memo_get(state, self, obj) < 0)
+ return -1;
+ return 0;
+ }
+
+ if (_Pickler_Write(self, &frozenset_op, 1) < 0)
+ return -1;
+ if (memo_put(state, self, obj) < 0)
+ return -1;
+
+ return 0;
+}
+
+static int
+fix_imports(PickleState *st, PyObject **module_name, PyObject **global_name)
+{
+ PyObject *key;
+ PyObject *item;
+
+ key = PyTuple_Pack(2, *module_name, *global_name);
+ if (key == NULL)
+ return -1;
+ item = PyDict_GetItemWithError(st->name_mapping_3to2, key);
+ Py_DECREF(key);
+ if (item) {
+ PyObject *fixed_module_name;
+ PyObject *fixed_global_name;
+
+ if (!PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.REVERSE_NAME_MAPPING values "
+ "should be 2-tuples, not %.200s",
+ Py_TYPE(item)->tp_name);
+ return -1;
+ }
+ fixed_module_name = PyTuple_GET_ITEM(item, 0);
+ fixed_global_name = PyTuple_GET_ITEM(item, 1);
+ if (!PyUnicode_Check(fixed_module_name) ||
+ !PyUnicode_Check(fixed_global_name)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.REVERSE_NAME_MAPPING values "
+ "should be pairs of str, not (%.200s, %.200s)",
+ Py_TYPE(fixed_module_name)->tp_name,
+ Py_TYPE(fixed_global_name)->tp_name);
+ return -1;
+ }
+
+ Py_CLEAR(*module_name);
+ Py_CLEAR(*global_name);
+ *module_name = Py_NewRef(fixed_module_name);
+ *global_name = Py_NewRef(fixed_global_name);
+ return 0;
+ }
+ else if (PyErr_Occurred()) {
+ return -1;
+ }
+
+ item = PyDict_GetItemWithError(st->import_mapping_3to2, *module_name);
+ if (item) {
+ if (!PyUnicode_Check(item)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.REVERSE_IMPORT_MAPPING values "
+ "should be strings, not %.200s",
+ Py_TYPE(item)->tp_name);
+ return -1;
+ }
+ Py_XSETREF(*module_name, Py_NewRef(item));
+ }
+ else if (PyErr_Occurred()) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+save_global(PickleState *st, PicklerObject *self, PyObject *obj,
+ PyObject *name)
+{
+ PyObject *global_name = NULL;
+ PyObject *module_name = NULL;
+ PyObject *module = NULL;
+ PyObject *parent = NULL;
+ PyObject *dotted_path = NULL;
+ PyObject *lastname = NULL;
+ PyObject *cls;
+ int status = 0;
+
+ const char global_op = GLOBAL;
+
+ if (name) {
+ global_name = Py_NewRef(name);
+ }
+ else {
+ if (_PyObject_LookupAttr(obj, &_Py_ID(__qualname__), &global_name) < 0)
+ goto error;
+ if (global_name == NULL) {
+ global_name = PyObject_GetAttr(obj, &_Py_ID(__name__));
+ if (global_name == NULL)
+ goto error;
+ }
+ }
+
+ dotted_path = get_dotted_path(module, global_name);
+ if (dotted_path == NULL)
+ goto error;
+ module_name = whichmodule(obj, dotted_path);
+ if (module_name == NULL)
+ goto error;
+
+ /* XXX: Change to use the import C API directly with level=0 to disallow
+ relative imports.
+
+ XXX: PyImport_ImportModuleLevel could be used. However, this bypasses
+ builtins.__import__. Therefore, _pickle, unlike pickle.py, will ignore
+ custom import functions (IMHO, this would be a nice security
+ feature). The import C API would need to be extended to support the
+ extra parameters of __import__ to fix that. */
+ module = PyImport_Import(module_name);
+ if (module == NULL) {
+ PyErr_Format(st->PicklingError,
+ "Can't pickle %R: import of module %R failed",
+ obj, module_name);
+ goto error;
+ }
+ lastname = Py_NewRef(PyList_GET_ITEM(dotted_path,
+ PyList_GET_SIZE(dotted_path) - 1));
+ cls = get_deep_attribute(module, dotted_path, &parent);
+ Py_CLEAR(dotted_path);
+ if (cls == NULL) {
+ PyErr_Format(st->PicklingError,
+ "Can't pickle %R: attribute lookup %S on %S failed",
+ obj, global_name, module_name);
+ goto error;
+ }
+ if (cls != obj) {
+ Py_DECREF(cls);
+ PyErr_Format(st->PicklingError,
+ "Can't pickle %R: it's not the same object as %S.%S",
+ obj, module_name, global_name);
+ goto error;
+ }
+ Py_DECREF(cls);
+
+ if (self->proto >= 2) {
+ /* See whether this is in the extension registry, and if
+ * so generate an EXT opcode.
+ */
+ PyObject *extension_key;
+ PyObject *code_obj; /* extension code as Python object */
+ long code; /* extension code as C value */
+ char pdata[5];
+ Py_ssize_t n;
+
+ extension_key = PyTuple_Pack(2, module_name, global_name);
+ if (extension_key == NULL) {
+ goto error;
+ }
+ code_obj = PyDict_GetItemWithError(st->extension_registry,
+ extension_key);
+ Py_DECREF(extension_key);
+ /* The object is not registered in the extension registry.
+ This is the most likely code path. */
+ if (code_obj == NULL) {
+ if (PyErr_Occurred()) {
+ goto error;
+ }
+ goto gen_global;
+ }
+
+ /* XXX: pickle.py doesn't check neither the type, nor the range
+ of the value returned by the extension_registry. It should for
+ consistency. */
+
+ /* Verify code_obj has the right type and value. */
+ if (!PyLong_Check(code_obj)) {
+ PyErr_Format(st->PicklingError,
+ "Can't pickle %R: extension code %R isn't an integer",
+ obj, code_obj);
+ goto error;
+ }
+ code = PyLong_AS_LONG(code_obj);
+ if (code <= 0 || code > 0x7fffffffL) {
+ if (!PyErr_Occurred())
+ PyErr_Format(st->PicklingError, "Can't pickle %R: extension "
+ "code %ld is out of range", obj, code);
+ goto error;
+ }
+
+ /* Generate an EXT opcode. */
+ if (code <= 0xff) {
+ pdata[0] = EXT1;
+ pdata[1] = (unsigned char)code;
+ n = 2;
+ }
+ else if (code <= 0xffff) {
+ pdata[0] = EXT2;
+ pdata[1] = (unsigned char)(code & 0xff);
+ pdata[2] = (unsigned char)((code >> 8) & 0xff);
+ n = 3;
+ }
+ else {
+ pdata[0] = EXT4;
+ pdata[1] = (unsigned char)(code & 0xff);
+ pdata[2] = (unsigned char)((code >> 8) & 0xff);
+ pdata[3] = (unsigned char)((code >> 16) & 0xff);
+ pdata[4] = (unsigned char)((code >> 24) & 0xff);
+ n = 5;
+ }
+
+ if (_Pickler_Write(self, pdata, n) < 0)
+ goto error;
+ }
+ else {
+ gen_global:
+ if (parent == module) {
+ Py_SETREF(global_name, Py_NewRef(lastname));
+ }
+ if (self->proto >= 4) {
+ const char stack_global_op = STACK_GLOBAL;
+
+ if (save(st, self, module_name, 0) < 0)
+ goto error;
+ if (save(st, self, global_name, 0) < 0)
+ goto error;
+
+ if (_Pickler_Write(self, &stack_global_op, 1) < 0)
+ goto error;
+ }
+ else if (parent != module) {
+ PyObject *reduce_value = Py_BuildValue("(O(OO))",
+ st->getattr, parent, lastname);
+ if (reduce_value == NULL)
+ goto error;
+ status = save_reduce(st, self, reduce_value, NULL);
+ Py_DECREF(reduce_value);
+ if (status < 0)
+ goto error;
+ }
+ else {
+ /* Generate a normal global opcode if we are using a pickle
+ protocol < 4, or if the object is not registered in the
+ extension registry. */
+ PyObject *encoded;
+ PyObject *(*unicode_encoder)(PyObject *);
+
+ if (_Pickler_Write(self, &global_op, 1) < 0)
+ goto error;
+
+ /* For protocol < 3 and if the user didn't request against doing
+ so, we convert module names to the old 2.x module names. */
+ if (self->proto < 3 && self->fix_imports) {
+ if (fix_imports(st, &module_name, &global_name) < 0) {
+ goto error;
+ }
+ }
+
+ /* Since Python 3.0 now supports non-ASCII identifiers, we encode
+ both the module name and the global name using UTF-8. We do so
+ only when we are using the pickle protocol newer than version
+ 3. This is to ensure compatibility with older Unpickler running
+ on Python 2.x. */
+ if (self->proto == 3) {
+ unicode_encoder = PyUnicode_AsUTF8String;
+ }
+ else {
+ unicode_encoder = PyUnicode_AsASCIIString;
+ }
+ encoded = unicode_encoder(module_name);
+ if (encoded == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError))
+ PyErr_Format(st->PicklingError,
+ "can't pickle module identifier '%S' using "
+ "pickle protocol %i",
+ module_name, self->proto);
+ goto error;
+ }
+ if (_Pickler_Write(self, PyBytes_AS_STRING(encoded),
+ PyBytes_GET_SIZE(encoded)) < 0) {
+ Py_DECREF(encoded);
+ goto error;
+ }
+ Py_DECREF(encoded);
+ if(_Pickler_Write(self, "\n", 1) < 0)
+ goto error;
+
+ /* Save the name of the module. */
+ encoded = unicode_encoder(global_name);
+ if (encoded == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError))
+ PyErr_Format(st->PicklingError,
+ "can't pickle global identifier '%S' using "
+ "pickle protocol %i",
+ global_name, self->proto);
+ goto error;
+ }
+ if (_Pickler_Write(self, PyBytes_AS_STRING(encoded),
+ PyBytes_GET_SIZE(encoded)) < 0) {
+ Py_DECREF(encoded);
+ goto error;
+ }
+ Py_DECREF(encoded);
+ if (_Pickler_Write(self, "\n", 1) < 0)
+ goto error;
+ }
+ /* Memoize the object. */
+ if (memo_put(st, self, obj) < 0)
+ goto error;
+ }
+
+ if (0) {
+ error:
+ status = -1;
+ }
+ Py_XDECREF(module_name);
+ Py_XDECREF(global_name);
+ Py_XDECREF(module);
+ Py_XDECREF(parent);
+ Py_XDECREF(dotted_path);
+ Py_XDECREF(lastname);
+
+ return status;
+}
+
+static int
+save_singleton_type(PickleState *state, PicklerObject *self, PyObject *obj,
+ PyObject *singleton)
+{
+ PyObject *reduce_value;
+ int status;
+
+ reduce_value = Py_BuildValue("O(O)", &PyType_Type, singleton);
+ if (reduce_value == NULL) {
+ return -1;
+ }
+ status = save_reduce(state, self, reduce_value, obj);
+ Py_DECREF(reduce_value);
+ return status;
+}
+
+static int
+save_type(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ if (obj == (PyObject *)&_PyNone_Type) {
+ return save_singleton_type(state, self, obj, Py_None);
+ }
+ else if (obj == (PyObject *)&PyEllipsis_Type) {
+ return save_singleton_type(state, self, obj, Py_Ellipsis);
+ }
+ else if (obj == (PyObject *)&_PyNotImplemented_Type) {
+ return save_singleton_type(state, self, obj, Py_NotImplemented);
+ }
+ return save_global(state, self, obj, NULL);
+}
+
+static int
+save_pers(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ PyObject *pid = NULL;
+ int status = 0;
+
+ const char persid_op = PERSID;
+ const char binpersid_op = BINPERSID;
+
+ pid = call_method(self->pers_func, self->pers_func_self, obj);
+ if (pid == NULL)
+ return -1;
+
+ if (pid != Py_None) {
+ if (self->bin) {
+ if (save(state, self, pid, 1) < 0 ||
+ _Pickler_Write(self, &binpersid_op, 1) < 0)
+ goto error;
+ }
+ else {
+ PyObject *pid_str;
+
+ pid_str = PyObject_Str(pid);
+ if (pid_str == NULL)
+ goto error;
+
+ /* XXX: Should it check whether the pid contains embedded
+ newlines? */
+ if (!PyUnicode_IS_ASCII(pid_str)) {
+ PyErr_SetString(state->PicklingError,
+ "persistent IDs in protocol 0 must be "
+ "ASCII strings");
+ Py_DECREF(pid_str);
+ goto error;
+ }
+
+ if (_Pickler_Write(self, &persid_op, 1) < 0 ||
+ _Pickler_Write(self, PyUnicode_DATA(pid_str),
+ PyUnicode_GET_LENGTH(pid_str)) < 0 ||
+ _Pickler_Write(self, "\n", 1) < 0) {
+ Py_DECREF(pid_str);
+ goto error;
+ }
+ Py_DECREF(pid_str);
+ }
+ status = 1;
+ }
+
+ if (0) {
+ error:
+ status = -1;
+ }
+ Py_XDECREF(pid);
+
+ return status;
+}
+
+static PyObject *
+get_class(PyObject *obj)
+{
+ PyObject *cls;
+
+ if (_PyObject_LookupAttr(obj, &_Py_ID(__class__), &cls) == 0) {
+ cls = Py_NewRef(Py_TYPE(obj));
+ }
+ return cls;
+}
+
+/* We're saving obj, and args is the 2-thru-5 tuple returned by the
+ * appropriate __reduce__ method for obj.
+ */
+static int
+save_reduce(PickleState *st, PicklerObject *self, PyObject *args,
+ PyObject *obj)
+{
+ PyObject *callable;
+ PyObject *argtup;
+ PyObject *state = NULL;
+ PyObject *listitems = Py_None;
+ PyObject *dictitems = Py_None;
+ PyObject *state_setter = Py_None;
+ Py_ssize_t size;
+ int use_newobj = 0, use_newobj_ex = 0;
+
+ const char reduce_op = REDUCE;
+ const char build_op = BUILD;
+ const char newobj_op = NEWOBJ;
+ const char newobj_ex_op = NEWOBJ_EX;
+
+ size = PyTuple_Size(args);
+ if (size < 2 || size > 6) {
+ PyErr_SetString(st->PicklingError, "tuple returned by "
+ "__reduce__ must contain 2 through 6 elements");
+ return -1;
+ }
+
+ if (!PyArg_UnpackTuple(args, "save_reduce", 2, 6,
+ &callable, &argtup, &state, &listitems, &dictitems,
+ &state_setter))
+ return -1;
+
+ if (!PyCallable_Check(callable)) {
+ PyErr_SetString(st->PicklingError, "first item of the tuple "
+ "returned by __reduce__ must be callable");
+ return -1;
+ }
+ if (!PyTuple_Check(argtup)) {
+ PyErr_SetString(st->PicklingError, "second item of the tuple "
+ "returned by __reduce__ must be a tuple");
+ return -1;
+ }
+
+ if (state == Py_None)
+ state = NULL;
+
+ if (listitems == Py_None)
+ listitems = NULL;
+ else if (!PyIter_Check(listitems)) {
+ PyErr_Format(st->PicklingError, "fourth element of the tuple "
+ "returned by __reduce__ must be an iterator, not %s",
+ Py_TYPE(listitems)->tp_name);
+ return -1;
+ }
+
+ if (dictitems == Py_None)
+ dictitems = NULL;
+ else if (!PyIter_Check(dictitems)) {
+ PyErr_Format(st->PicklingError, "fifth element of the tuple "
+ "returned by __reduce__ must be an iterator, not %s",
+ Py_TYPE(dictitems)->tp_name);
+ return -1;
+ }
+
+ if (state_setter == Py_None)
+ state_setter = NULL;
+ else if (!PyCallable_Check(state_setter)) {
+ PyErr_Format(st->PicklingError, "sixth element of the tuple "
+ "returned by __reduce__ must be a function, not %s",
+ Py_TYPE(state_setter)->tp_name);
+ return -1;
+ }
+
+ if (self->proto >= 2) {
+ PyObject *name;
+
+ if (_PyObject_LookupAttr(callable, &_Py_ID(__name__), &name) < 0) {
+ return -1;
+ }
+ if (name != NULL && PyUnicode_Check(name)) {
+ use_newobj_ex = _PyUnicode_Equal(name, &_Py_ID(__newobj_ex__));
+ if (!use_newobj_ex) {
+ use_newobj = _PyUnicode_Equal(name, &_Py_ID(__newobj__));
+ }
+ }
+ Py_XDECREF(name);
+ }
+
+ if (use_newobj_ex) {
+ PyObject *cls;
+ PyObject *args;
+ PyObject *kwargs;
+
+ if (PyTuple_GET_SIZE(argtup) != 3) {
+ PyErr_Format(st->PicklingError,
+ "length of the NEWOBJ_EX argument tuple must be "
+ "exactly 3, not %zd", PyTuple_GET_SIZE(argtup));
+ return -1;
+ }
+
+ cls = PyTuple_GET_ITEM(argtup, 0);
+ if (!PyType_Check(cls)) {
+ PyErr_Format(st->PicklingError,
+ "first item from NEWOBJ_EX argument tuple must "
+ "be a class, not %.200s", Py_TYPE(cls)->tp_name);
+ return -1;
+ }
+ args = PyTuple_GET_ITEM(argtup, 1);
+ if (!PyTuple_Check(args)) {
+ PyErr_Format(st->PicklingError,
+ "second item from NEWOBJ_EX argument tuple must "
+ "be a tuple, not %.200s", Py_TYPE(args)->tp_name);
+ return -1;
+ }
+ kwargs = PyTuple_GET_ITEM(argtup, 2);
+ if (!PyDict_Check(kwargs)) {
+ PyErr_Format(st->PicklingError,
+ "third item from NEWOBJ_EX argument tuple must "
+ "be a dict, not %.200s", Py_TYPE(kwargs)->tp_name);
+ return -1;
+ }
+
+ if (self->proto >= 4) {
+ if (save(st, self, cls, 0) < 0 ||
+ save(st, self, args, 0) < 0 ||
+ save(st, self, kwargs, 0) < 0 ||
+ _Pickler_Write(self, &newobj_ex_op, 1) < 0) {
+ return -1;
+ }
+ }
+ else {
+ PyObject *newargs;
+ PyObject *cls_new;
+ Py_ssize_t i;
+
+ newargs = PyTuple_New(PyTuple_GET_SIZE(args) + 2);
+ if (newargs == NULL)
+ return -1;
+
+ cls_new = PyObject_GetAttr(cls, &_Py_ID(__new__));
+ if (cls_new == NULL) {
+ Py_DECREF(newargs);
+ return -1;
+ }
+ PyTuple_SET_ITEM(newargs, 0, cls_new);
+ PyTuple_SET_ITEM(newargs, 1, Py_NewRef(cls));
+ for (i = 0; i < PyTuple_GET_SIZE(args); i++) {
+ PyObject *item = PyTuple_GET_ITEM(args, i);
+ PyTuple_SET_ITEM(newargs, i + 2, Py_NewRef(item));
+ }
+
+ callable = PyObject_Call(st->partial, newargs, kwargs);
+ Py_DECREF(newargs);
+ if (callable == NULL)
+ return -1;
+
+ newargs = PyTuple_New(0);
+ if (newargs == NULL) {
+ Py_DECREF(callable);
+ return -1;
+ }
+
+ if (save(st, self, callable, 0) < 0 ||
+ save(st, self, newargs, 0) < 0 ||
+ _Pickler_Write(self, &reduce_op, 1) < 0) {
+ Py_DECREF(newargs);
+ Py_DECREF(callable);
+ return -1;
+ }
+ Py_DECREF(newargs);
+ Py_DECREF(callable);
+ }
+ }
+ else if (use_newobj) {
+ PyObject *cls;
+ PyObject *newargtup;
+ PyObject *obj_class;
+ int p;
+
+ /* Sanity checks. */
+ if (PyTuple_GET_SIZE(argtup) < 1) {
+ PyErr_SetString(st->PicklingError, "__newobj__ arglist is empty");
+ return -1;
+ }
+
+ cls = PyTuple_GET_ITEM(argtup, 0);
+ if (!PyType_Check(cls)) {
+ PyErr_SetString(st->PicklingError, "args[0] from "
+ "__newobj__ args is not a type");
+ return -1;
+ }
+
+ if (obj != NULL) {
+ obj_class = get_class(obj);
+ if (obj_class == NULL) {
+ return -1;
+ }
+ p = obj_class != cls;
+ Py_DECREF(obj_class);
+ if (p) {
+ PyErr_SetString(st->PicklingError, "args[0] from "
+ "__newobj__ args has the wrong class");
+ return -1;
+ }
+ }
+ /* XXX: These calls save() are prone to infinite recursion. Imagine
+ what happen if the value returned by the __reduce__() method of
+ some extension type contains another object of the same type. Ouch!
+
+ Here is a quick example, that I ran into, to illustrate what I
+ mean:
+
+ >>> import pickle, copyreg
+ >>> copyreg.dispatch_table.pop(complex)
+ >>> pickle.dumps(1+2j)
+ Traceback (most recent call last):
+ ...
+ RecursionError: maximum recursion depth exceeded
+
+ Removing the complex class from copyreg.dispatch_table made the
+ __reduce_ex__() method emit another complex object:
+
+ >>> (1+1j).__reduce_ex__(2)
+ (<function __newobj__ at 0xb7b71c3c>,
+ (<class 'complex'>, (1+1j)), None, None, None)
+
+ Thus when save() was called on newargstup (the 2nd item) recursion
+ ensued. Of course, the bug was in the complex class which had a
+ broken __getnewargs__() that emitted another complex object. But,
+ the point, here, is it is quite easy to end up with a broken reduce
+ function. */
+
+ /* Save the class and its __new__ arguments. */
+ if (save(st, self, cls, 0) < 0) {
+ return -1;
+ }
+
+ newargtup = PyTuple_GetSlice(argtup, 1, PyTuple_GET_SIZE(argtup));
+ if (newargtup == NULL)
+ return -1;
+
+ p = save(st, self, newargtup, 0);
+ Py_DECREF(newargtup);
+ if (p < 0)
+ return -1;
+
+ /* Add NEWOBJ opcode. */
+ if (_Pickler_Write(self, &newobj_op, 1) < 0)
+ return -1;
+ }
+ else { /* Not using NEWOBJ. */
+ if (save(st, self, callable, 0) < 0 ||
+ save(st, self, argtup, 0) < 0 ||
+ _Pickler_Write(self, &reduce_op, 1) < 0)
+ return -1;
+ }
+
+ /* obj can be NULL when save_reduce() is used directly. A NULL obj means
+ the caller do not want to memoize the object. Not particularly useful,
+ but that is to mimic the behavior save_reduce() in pickle.py when
+ obj is None. */
+ if (obj != NULL) {
+ /* If the object is already in the memo, this means it is
+ recursive. In this case, throw away everything we put on the
+ stack, and fetch the object back from the memo. */
+ if (PyMemoTable_Get(self->memo, obj)) {
+ const char pop_op = POP;
+
+ if (_Pickler_Write(self, &pop_op, 1) < 0)
+ return -1;
+ if (memo_get(st, self, obj) < 0)
+ return -1;
+
+ return 0;
+ }
+ else if (memo_put(st, self, obj) < 0)
+ return -1;
+ }
+
+ if (listitems && batch_list(st, self, listitems) < 0)
+ return -1;
+
+ if (dictitems && batch_dict(st, self, dictitems) < 0)
+ return -1;
+
+ if (state) {
+ if (state_setter == NULL) {
+ if (save(st, self, state, 0) < 0 ||
+ _Pickler_Write(self, &build_op, 1) < 0)
+ return -1;
+ }
+ else {
+
+ /* If a state_setter is specified, call it instead of load_build to
+ * update obj's with its previous state.
+ * The first 4 save/write instructions push state_setter and its
+ * tuple of expected arguments (obj, state) onto the stack. The
+ * REDUCE opcode triggers the state_setter(obj, state) function
+ * call. Finally, because state-updating routines only do in-place
+ * modification, the whole operation has to be stack-transparent.
+ * Thus, we finally pop the call's output from the stack.*/
+
+ const char tupletwo_op = TUPLE2;
+ const char pop_op = POP;
+ if (save(st, self, state_setter, 0) < 0 ||
+ save(st, self, obj, 0) < 0 || save(st, self, state, 0) < 0 ||
+ _Pickler_Write(self, &tupletwo_op, 1) < 0 ||
+ _Pickler_Write(self, &reduce_op, 1) < 0 ||
+ _Pickler_Write(self, &pop_op, 1) < 0)
+ return -1;
+ }
+ }
+ return 0;
+}
+
+static int
+save(PickleState *st, PicklerObject *self, PyObject *obj, int pers_save)
+{
+ PyTypeObject *type;
+ PyObject *reduce_func = NULL;
+ PyObject *reduce_value = NULL;
+ int status = 0;
+
+ if (_Pickler_OpcodeBoundary(self) < 0)
+ return -1;
+
+ /* The extra pers_save argument is necessary to avoid calling save_pers()
+ on its returned object. */
+ if (!pers_save && self->pers_func) {
+ /* save_pers() returns:
+ -1 to signal an error;
+ 0 if it did nothing successfully;
+ 1 if a persistent id was saved.
+ */
+ if ((status = save_pers(st, self, obj)) != 0)
+ return status;
+ }
+
+ type = Py_TYPE(obj);
+
+ /* The old cPickle had an optimization that used switch-case statement
+ dispatching on the first letter of the type name. This has was removed
+ since benchmarks shown that this optimization was actually slowing
+ things down. */
+
+ /* Atom types; these aren't memoized, so don't check the memo. */
+
+ if (obj == Py_None) {
+ return save_none(self, obj);
+ }
+ else if (obj == Py_False || obj == Py_True) {
+ return save_bool(self, obj);
+ }
+ else if (type == &PyLong_Type) {
+ return save_long(self, obj);
+ }
+ else if (type == &PyFloat_Type) {
+ return save_float(self, obj);
+ }
+
+ /* Check the memo to see if it has the object. If so, generate
+ a GET (or BINGET) opcode, instead of pickling the object
+ once again. */
+ if (PyMemoTable_Get(self->memo, obj)) {
+ return memo_get(st, self, obj);
+ }
+
+ if (type == &PyBytes_Type) {
+ return save_bytes(st, self, obj);
+ }
+ else if (type == &PyUnicode_Type) {
+ return save_unicode(st, self, obj);
+ }
+
+ /* We're only calling _Py_EnterRecursiveCall here so that atomic
+ types above are pickled faster. */
+ if (_Py_EnterRecursiveCall(" while pickling an object")) {
+ return -1;
+ }
+
+ if (type == &PyDict_Type) {
+ status = save_dict(st, self, obj);
+ goto done;
+ }
+ else if (type == &PySet_Type) {
+ status = save_set(st, self, obj);
+ goto done;
+ }
+ else if (type == &PyFrozenSet_Type) {
+ status = save_frozenset(st, self, obj);
+ goto done;
+ }
+ else if (type == &PyList_Type) {
+ status = save_list(st, self, obj);
+ goto done;
+ }
+ else if (type == &PyTuple_Type) {
+ status = save_tuple(st, self, obj);
+ goto done;
+ }
+ else if (type == &PyByteArray_Type) {
+ status = save_bytearray(st, self, obj);
+ goto done;
+ }
+ else if (type == &PyPickleBuffer_Type) {
+ status = save_picklebuffer(st, self, obj);
+ goto done;
+ }
+
+ /* Now, check reducer_override. If it returns NotImplemented,
+ * fallback to save_type or save_global, and then perhaps to the
+ * regular reduction mechanism.
+ */
+ if (self->reducer_override != NULL) {
+ reduce_value = PyObject_CallOneArg(self->reducer_override, obj);
+ if (reduce_value == NULL) {
+ goto error;
+ }
+ if (reduce_value != Py_NotImplemented) {
+ goto reduce;
+ }
+ Py_SETREF(reduce_value, NULL);
+ }
+
+ if (type == &PyType_Type) {
+ status = save_type(st, self, obj);
+ goto done;
+ }
+ else if (type == &PyFunction_Type) {
+ status = save_global(st, self, obj, NULL);
+ goto done;
+ }
+
+ /* XXX: This part needs some unit tests. */
+
+ /* Get a reduction callable, and call it. This may come from
+ * self.dispatch_table, copyreg.dispatch_table, the object's
+ * __reduce_ex__ method, or the object's __reduce__ method.
+ */
+ if (self->dispatch_table == NULL) {
+ reduce_func = PyDict_GetItemWithError(st->dispatch_table,
+ (PyObject *)type);
+ if (reduce_func == NULL) {
+ if (PyErr_Occurred()) {
+ goto error;
+ }
+ } else {
+ /* PyDict_GetItemWithError() returns a borrowed reference.
+ Increase the reference count to be consistent with
+ PyObject_GetItem and _PyObject_GetAttrId used below. */
+ Py_INCREF(reduce_func);
+ }
+ } else {
+ reduce_func = PyObject_GetItem(self->dispatch_table,
+ (PyObject *)type);
+ if (reduce_func == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_KeyError))
+ PyErr_Clear();
+ else
+ goto error;
+ }
+ }
+ if (reduce_func != NULL) {
+ reduce_value = _Pickle_FastCall(reduce_func, Py_NewRef(obj));
+ }
+ else if (PyType_IsSubtype(type, &PyType_Type)) {
+ status = save_global(st, self, obj, NULL);
+ goto done;
+ }
+ else {
+ /* XXX: If the __reduce__ method is defined, __reduce_ex__ is
+ automatically defined as __reduce__. While this is convenient, this
+ make it impossible to know which method was actually called. Of
+ course, this is not a big deal. But still, it would be nice to let
+ the user know which method was called when something go
+ wrong. Incidentally, this means if __reduce_ex__ is not defined, we
+ don't actually have to check for a __reduce__ method. */
+
+ /* Check for a __reduce_ex__ method. */
+ if (_PyObject_LookupAttr(obj, &_Py_ID(__reduce_ex__), &reduce_func) < 0) {
+ goto error;
+ }
+ if (reduce_func != NULL) {
+ PyObject *proto;
+ proto = PyLong_FromLong(self->proto);
+ if (proto != NULL) {
+ reduce_value = _Pickle_FastCall(reduce_func, proto);
+ }
+ }
+ else {
+ /* Check for a __reduce__ method. */
+ if (_PyObject_LookupAttr(obj, &_Py_ID(__reduce__), &reduce_func) < 0) {
+ goto error;
+ }
+ if (reduce_func != NULL) {
+ reduce_value = PyObject_CallNoArgs(reduce_func);
+ }
+ else {
+ PyErr_Format(st->PicklingError,
+ "can't pickle '%.200s' object: %R",
+ type->tp_name, obj);
+ goto error;
+ }
+ }
+ }
+
+ if (reduce_value == NULL)
+ goto error;
+
+ reduce:
+ if (PyUnicode_Check(reduce_value)) {
+ status = save_global(st, self, obj, reduce_value);
+ goto done;
+ }
+
+ if (!PyTuple_Check(reduce_value)) {
+ PyErr_SetString(st->PicklingError,
+ "__reduce__ must return a string or tuple");
+ goto error;
+ }
+
+ status = save_reduce(st, self, reduce_value, obj);
+
+ if (0) {
+ error:
+ status = -1;
+ }
+ done:
+
+ _Py_LeaveRecursiveCall();
+ Py_XDECREF(reduce_func);
+ Py_XDECREF(reduce_value);
+
+ return status;
+}
+
+static int
+dump(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ const char stop_op = STOP;
+ int status = -1;
+ PyObject *tmp;
+
+ if (_PyObject_LookupAttr((PyObject *)self, &_Py_ID(reducer_override),
+ &tmp) < 0) {
+ goto error;
+ }
+ /* Cache the reducer_override method, if it exists. */
+ if (tmp != NULL) {
+ Py_XSETREF(self->reducer_override, tmp);
+ }
+ else {
+ Py_CLEAR(self->reducer_override);
+ }
+
+ if (self->proto >= 2) {
+ char header[2];
+
+ header[0] = PROTO;
+ assert(self->proto >= 0 && self->proto < 256);
+ header[1] = (unsigned char)self->proto;
+ if (_Pickler_Write(self, header, 2) < 0)
+ goto error;
+ if (self->proto >= 4)
+ self->framing = 1;
+ }
+
+ if (save(state, self, obj, 0) < 0 ||
+ _Pickler_Write(self, &stop_op, 1) < 0 ||
+ _Pickler_CommitFrame(self) < 0)
+ goto error;
+
+ // Success
+ status = 0;
+
+ error:
+ self->framing = 0;
+
+ /* Break the reference cycle we generated at the beginning this function
+ * call when setting the reducer_override attribute of the Pickler instance
+ * to a bound method of the same instance. This is important as the Pickler
+ * instance holds a reference to each object it has pickled (through its
+ * memo): thus, these objects won't be garbage-collected as long as the
+ * Pickler itself is not collected. */
+ Py_CLEAR(self->reducer_override);
+ return status;
+}
+
+/*[clinic input]
+
+_pickle.Pickler.clear_memo
+
+Clears the pickler's "memo".
+
+The memo is the data structure that remembers which objects the
+pickler has already seen, so that shared or recursive objects are
+pickled by reference and not by value. This method is useful when
+re-using picklers.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_Pickler_clear_memo_impl(PicklerObject *self)
+/*[clinic end generated code: output=8665c8658aaa094b input=01bdad52f3d93e56]*/
+{
+ if (self->memo)
+ PyMemoTable_Clear(self->memo);
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+
+_pickle.Pickler.dump
+
+ cls: defining_class
+ obj: object
+ /
+
+Write a pickled representation of the given object to the open file.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_Pickler_dump_impl(PicklerObject *self, PyTypeObject *cls,
+ PyObject *obj)
+/*[clinic end generated code: output=952cf7f68b1445bb input=f949d84151983594]*/
+{
+ PickleState *st = _Pickle_GetStateByClass(cls);
+ /* Check whether the Pickler was initialized correctly (issue3664).
+ Developers often forget to call __init__() in their subclasses, which
+ would trigger a segfault without this check. */
+ if (self->write == NULL) {
+ PyErr_Format(st->PicklingError,
+ "Pickler.__init__() was not called by %s.__init__()",
+ Py_TYPE(self)->tp_name);
+ return NULL;
+ }
+
+ if (_Pickler_ClearBuffer(self) < 0)
+ return NULL;
+
+ if (dump(st, self, obj) < 0)
+ return NULL;
+
+ if (_Pickler_FlushToFile(self) < 0)
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+
+_pickle.Pickler.__sizeof__ -> size_t
+
+Returns size in memory, in bytes.
+[clinic start generated code]*/
+
+static size_t
+_pickle_Pickler___sizeof___impl(PicklerObject *self)
+/*[clinic end generated code: output=23ad75658d3b59ff input=d8127c8e7012ebd7]*/
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(self));
+ if (self->memo != NULL) {
+ res += sizeof(PyMemoTable);
+ res += self->memo->mt_allocated * sizeof(PyMemoEntry);
+ }
+ if (self->output_buffer != NULL) {
+ size_t s = _PySys_GetSizeOf(self->output_buffer);
+ if (s == (size_t)-1) {
+ return -1;
+ }
+ res += s;
+ }
+ return res;
+}
+
+static struct PyMethodDef Pickler_methods[] = {
+ _PICKLE_PICKLER_DUMP_METHODDEF
+ _PICKLE_PICKLER_CLEAR_MEMO_METHODDEF
+ _PICKLE_PICKLER___SIZEOF___METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+Pickler_clear(PicklerObject *self)
+{
+ Py_CLEAR(self->output_buffer);
+ Py_CLEAR(self->write);
+ Py_CLEAR(self->pers_func);
+ Py_CLEAR(self->dispatch_table);
+ Py_CLEAR(self->fast_memo);
+ Py_CLEAR(self->reducer_override);
+ Py_CLEAR(self->buffer_callback);
+
+ if (self->memo != NULL) {
+ PyMemoTable *memo = self->memo;
+ self->memo = NULL;
+ PyMemoTable_Del(memo);
+ }
+ return 0;
+}
+
+static void
+Pickler_dealloc(PicklerObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ (void)Pickler_clear(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+Pickler_traverse(PicklerObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->write);
+ Py_VISIT(self->pers_func);
+ Py_VISIT(self->dispatch_table);
+ Py_VISIT(self->fast_memo);
+ Py_VISIT(self->reducer_override);
+ Py_VISIT(self->buffer_callback);
+ PyMemoTable *memo = self->memo;
+ if (memo && memo->mt_table) {
+ Py_ssize_t i = memo->mt_allocated;
+ while (--i >= 0) {
+ Py_VISIT(memo->mt_table[i].me_key);
+ }
+ }
+
+ return 0;
+}
+
+
+/*[clinic input]
+
+_pickle.Pickler.__init__
+
+ file: object
+ protocol: object = None
+ fix_imports: bool = True
+ buffer_callback: object = None
+
+This takes a binary file for writing a pickle data stream.
+
+The optional *protocol* argument tells the pickler to use the given
+protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default
+protocol is 4. It was introduced in Python 3.4, and is incompatible
+with previous versions.
+
+Specifying a negative protocol version selects the highest protocol
+version supported. The higher the protocol used, the more recent the
+version of Python needed to read the pickle produced.
+
+The *file* argument must have a write() method that accepts a single
+bytes argument. It can thus be a file object opened for binary
+writing, an io.BytesIO instance, or any other custom object that meets
+this interface.
+
+If *fix_imports* is True and protocol is less than 3, pickle will try
+to map the new Python 3 names to the old module names used in Python
+2, so that the pickle data stream is readable with Python 2.
+
+If *buffer_callback* is None (the default), buffer views are
+serialized into *file* as part of the pickle stream.
+
+If *buffer_callback* is not None, then it can be called any number
+of times with a buffer view. If the callback returns a false value
+(such as None), the given buffer is out-of-band; otherwise the
+buffer is serialized in-band, i.e. inside the pickle stream.
+
+It is an error if *buffer_callback* is not None and *protocol*
+is None or smaller than 5.
+
+[clinic start generated code]*/
+
+static int
+_pickle_Pickler___init___impl(PicklerObject *self, PyObject *file,
+ PyObject *protocol, int fix_imports,
+ PyObject *buffer_callback)
+/*[clinic end generated code: output=0abedc50590d259b input=a7c969699bf5dad3]*/
+{
+ /* In case of multiple __init__() calls, clear previous content. */
+ if (self->write != NULL)
+ (void)Pickler_clear(self);
+
+ if (_Pickler_SetProtocol(self, protocol, fix_imports) < 0)
+ return -1;
+
+ if (_Pickler_SetOutputStream(self, file) < 0)
+ return -1;
+
+ if (_Pickler_SetBufferCallback(self, buffer_callback) < 0)
+ return -1;
+
+ /* memo and output_buffer may have already been created in _Pickler_New */
+ if (self->memo == NULL) {
+ self->memo = PyMemoTable_New();
+ if (self->memo == NULL)
+ return -1;
+ }
+ self->output_len = 0;
+ if (self->output_buffer == NULL) {
+ self->max_output_len = WRITE_BUF_SIZE;
+ self->output_buffer = PyBytes_FromStringAndSize(NULL,
+ self->max_output_len);
+ if (self->output_buffer == NULL)
+ return -1;
+ }
+
+ self->fast = 0;
+ self->fast_nesting = 0;
+ self->fast_memo = NULL;
+
+ if (init_method_ref((PyObject *)self, &_Py_ID(persistent_id),
+ &self->pers_func, &self->pers_func_self) < 0)
+ {
+ return -1;
+ }
+ if (self->dispatch_table != NULL) {
+ return 0;
+ }
+ if (_PyObject_LookupAttr((PyObject *)self, &_Py_ID(dispatch_table),
+ &self->dispatch_table) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+
+/* Define a proxy object for the Pickler's internal memo object. This is to
+ * avoid breaking code like:
+ * pickler.memo.clear()
+ * and
+ * pickler.memo = saved_memo
+ * Is this a good idea? Not really, but we don't want to break code that uses
+ * it. Note that we don't implement the entire mapping API here. This is
+ * intentional, as these should be treated as black-box implementation details.
+ */
+
+/*[clinic input]
+_pickle.PicklerMemoProxy.clear
+
+Remove all items from memo.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_PicklerMemoProxy_clear_impl(PicklerMemoProxyObject *self)
+/*[clinic end generated code: output=5fb9370d48ae8b05 input=ccc186dacd0f1405]*/
+{
+ if (self->pickler->memo)
+ PyMemoTable_Clear(self->pickler->memo);
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_pickle.PicklerMemoProxy.copy
+
+Copy the memo to a new object.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self)
+/*[clinic end generated code: output=bb83a919d29225ef input=b73043485ac30b36]*/
+{
+ PyMemoTable *memo;
+ PyObject *new_memo = PyDict_New();
+ if (new_memo == NULL)
+ return NULL;
+
+ memo = self->pickler->memo;
+ for (size_t i = 0; i < memo->mt_allocated; ++i) {
+ PyMemoEntry entry = memo->mt_table[i];
+ if (entry.me_key != NULL) {
+ int status;
+ PyObject *key, *value;
+
+ key = PyLong_FromVoidPtr(entry.me_key);
+ if (key == NULL) {
+ goto error;
+ }
+ value = Py_BuildValue("nO", entry.me_value, entry.me_key);
+ if (value == NULL) {
+ Py_DECREF(key);
+ goto error;
+ }
+ status = PyDict_SetItem(new_memo, key, value);
+ Py_DECREF(key);
+ Py_DECREF(value);
+ if (status < 0)
+ goto error;
+ }
+ }
+ return new_memo;
+
+ error:
+ Py_XDECREF(new_memo);
+ return NULL;
+}
+
+/*[clinic input]
+_pickle.PicklerMemoProxy.__reduce__
+
+Implement pickle support.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_PicklerMemoProxy___reduce___impl(PicklerMemoProxyObject *self)
+/*[clinic end generated code: output=bebba1168863ab1d input=2f7c540e24b7aae4]*/
+{
+ PyObject *reduce_value, *dict_args;
+ PyObject *contents = _pickle_PicklerMemoProxy_copy_impl(self);
+ if (contents == NULL)
+ return NULL;
+
+ reduce_value = PyTuple_New(2);
+ if (reduce_value == NULL) {
+ Py_DECREF(contents);
+ return NULL;
+ }
+ dict_args = PyTuple_New(1);
+ if (dict_args == NULL) {
+ Py_DECREF(contents);
+ Py_DECREF(reduce_value);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(dict_args, 0, contents);
+ PyTuple_SET_ITEM(reduce_value, 0, Py_NewRef(&PyDict_Type));
+ PyTuple_SET_ITEM(reduce_value, 1, dict_args);
+ return reduce_value;
+}
+
+static PyMethodDef picklerproxy_methods[] = {
+ _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF
+ _PICKLE_PICKLERMEMOPROXY_COPY_METHODDEF
+ _PICKLE_PICKLERMEMOPROXY___REDUCE___METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static void
+PicklerMemoProxy_dealloc(PicklerMemoProxyObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ Py_CLEAR(self->pickler);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+PicklerMemoProxy_traverse(PicklerMemoProxyObject *self,
+ visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->pickler);
+ return 0;
+}
+
+static int
+PicklerMemoProxy_clear(PicklerMemoProxyObject *self)
+{
+ Py_CLEAR(self->pickler);
+ return 0;
+}
+
+static PyType_Slot memoproxy_slots[] = {
+ {Py_tp_dealloc, PicklerMemoProxy_dealloc},
+ {Py_tp_traverse, PicklerMemoProxy_traverse},
+ {Py_tp_clear, PicklerMemoProxy_clear},
+ {Py_tp_methods, picklerproxy_methods},
+ {Py_tp_hash, PyObject_HashNotImplemented},
+ {0, NULL},
+};
+
+static PyType_Spec memoproxy_spec = {
+ .name = "_pickle.PicklerMemoProxy",
+ .basicsize = sizeof(PicklerMemoProxyObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = memoproxy_slots,
+};
+
+static PyObject *
+PicklerMemoProxy_New(PicklerObject *pickler)
+{
+ PicklerMemoProxyObject *self;
+ PickleState *st = _Pickle_FindStateByType(Py_TYPE(pickler));
+ self = PyObject_GC_New(PicklerMemoProxyObject, st->PicklerMemoProxyType);
+ if (self == NULL)
+ return NULL;
+ self->pickler = (PicklerObject*)Py_NewRef(pickler);
+ PyObject_GC_Track(self);
+ return (PyObject *)self;
+}
+
+/*****************************************************************************/
+
+static PyObject *
+Pickler_get_memo(PicklerObject *self, void *Py_UNUSED(ignored))
+{
+ return PicklerMemoProxy_New(self);
+}
+
+static int
+Pickler_set_memo(PicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored))
+{
+ PyMemoTable *new_memo = NULL;
+
+ if (obj == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "attribute deletion is not supported");
+ return -1;
+ }
+
+ PickleState *st = _Pickle_FindStateByType(Py_TYPE(self));
+ if (Py_IS_TYPE(obj, st->PicklerMemoProxyType)) {
+ PicklerObject *pickler =
+ ((PicklerMemoProxyObject *)obj)->pickler;
+
+ new_memo = PyMemoTable_Copy(pickler->memo);
+ if (new_memo == NULL)
+ return -1;
+ }
+ else if (PyDict_Check(obj)) {
+ Py_ssize_t i = 0;
+ PyObject *key, *value;
+
+ new_memo = PyMemoTable_New();
+ if (new_memo == NULL)
+ return -1;
+
+ while (PyDict_Next(obj, &i, &key, &value)) {
+ Py_ssize_t memo_id;
+ PyObject *memo_obj;
+
+ if (!PyTuple_Check(value) || PyTuple_GET_SIZE(value) != 2) {
+ PyErr_SetString(PyExc_TypeError,
+ "'memo' values must be 2-item tuples");
+ goto error;
+ }
+ memo_id = PyLong_AsSsize_t(PyTuple_GET_ITEM(value, 0));
+ if (memo_id == -1 && PyErr_Occurred())
+ goto error;
+ memo_obj = PyTuple_GET_ITEM(value, 1);
+ if (PyMemoTable_Set(new_memo, memo_obj, memo_id) < 0)
+ goto error;
+ }
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "'memo' attribute must be a PicklerMemoProxy object "
+ "or dict, not %.200s", Py_TYPE(obj)->tp_name);
+ return -1;
+ }
+
+ PyMemoTable_Del(self->memo);
+ self->memo = new_memo;
+
+ return 0;
+
+ error:
+ if (new_memo)
+ PyMemoTable_Del(new_memo);
+ return -1;
+}
+
+static PyObject *
+Pickler_get_persid(PicklerObject *self, void *Py_UNUSED(ignored))
+{
+ if (self->pers_func == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "persistent_id");
+ return NULL;
+ }
+ return reconstruct_method(self->pers_func, self->pers_func_self);
+}
+
+static int
+Pickler_set_persid(PicklerObject *self, PyObject *value, void *Py_UNUSED(ignored))
+{
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "attribute deletion is not supported");
+ return -1;
+ }
+ if (!PyCallable_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "persistent_id must be a callable taking one argument");
+ return -1;
+ }
+
+ self->pers_func_self = NULL;
+ Py_XSETREF(self->pers_func, Py_NewRef(value));
+
+ return 0;
+}
+
+static PyMemberDef Pickler_members[] = {
+ {"bin", T_INT, offsetof(PicklerObject, bin)},
+ {"fast", T_INT, offsetof(PicklerObject, fast)},
+ {"dispatch_table", T_OBJECT_EX, offsetof(PicklerObject, dispatch_table)},
+ {NULL}
+};
+
+static PyGetSetDef Pickler_getsets[] = {
+ {"memo", (getter)Pickler_get_memo,
+ (setter)Pickler_set_memo},
+ {"persistent_id", (getter)Pickler_get_persid,
+ (setter)Pickler_set_persid},
+ {NULL}
+};
+
+static PyType_Slot pickler_type_slots[] = {
+ {Py_tp_dealloc, Pickler_dealloc},
+ {Py_tp_methods, Pickler_methods},
+ {Py_tp_members, Pickler_members},
+ {Py_tp_getset, Pickler_getsets},
+ {Py_tp_clear, Pickler_clear},
+ {Py_tp_doc, (char*)_pickle_Pickler___init____doc__},
+ {Py_tp_traverse, Pickler_traverse},
+ {Py_tp_init, _pickle_Pickler___init__},
+ {Py_tp_new, PyType_GenericNew},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec pickler_type_spec = {
+ .name = "_pickle.Pickler",
+ .basicsize = sizeof(PicklerObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = pickler_type_slots,
+};
+
+/* Temporary helper for calling self.find_class().
+
+ XXX: It would be nice to able to avoid Python function call overhead, by
+ using directly the C version of find_class(), when find_class() is not
+ overridden by a subclass. Although, this could become rather hackish. A
+ simpler optimization would be to call the C function when self is not a
+ subclass instance. */
+static PyObject *
+find_class(UnpicklerObject *self, PyObject *module_name, PyObject *global_name)
+{
+ return PyObject_CallMethodObjArgs((PyObject *)self, &_Py_ID(find_class),
+ module_name, global_name, NULL);
+}
+
+static Py_ssize_t
+marker(PickleState *st, UnpicklerObject *self)
+{
+ if (self->num_marks < 1) {
+ PyErr_SetString(st->UnpicklingError, "could not find MARK");
+ return -1;
+ }
+
+ Py_ssize_t mark = self->marks[--self->num_marks];
+ self->stack->mark_set = self->num_marks != 0;
+ self->stack->fence = self->num_marks ?
+ self->marks[self->num_marks - 1] : 0;
+ return mark;
+}
+
+static int
+load_none(PickleState *state, UnpicklerObject *self)
+{
+ PDATA_APPEND(self->stack, Py_None, -1);
+ return 0;
+}
+
+static int
+load_int(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+ char *endptr, *s;
+ Py_ssize_t len;
+ long x;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(state);
+
+ errno = 0;
+ /* XXX: Should the base argument of strtol() be explicitly set to 10?
+ XXX(avassalotti): Should this uses PyOS_strtol()? */
+ x = strtol(s, &endptr, 0);
+
+ if (errno || (*endptr != '\n' && *endptr != '\0')) {
+ /* Hm, maybe we've got something long. Let's try reading
+ * it as a Python int object. */
+ errno = 0;
+ /* XXX: Same thing about the base here. */
+ value = PyLong_FromString(s, NULL, 0);
+ if (value == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "could not convert string to int");
+ return -1;
+ }
+ }
+ else {
+ if (len == 3 && (x == 0 || x == 1)) {
+ if ((value = PyBool_FromLong(x)) == NULL)
+ return -1;
+ }
+ else {
+ if ((value = PyLong_FromLong(x)) == NULL)
+ return -1;
+ }
+ }
+
+ PDATA_PUSH(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_bool(PickleState *state, UnpicklerObject *self, PyObject *boolean)
+{
+ assert(boolean == Py_True || boolean == Py_False);
+ PDATA_APPEND(self->stack, boolean, -1);
+ return 0;
+}
+
+/* s contains x bytes of an unsigned little-endian integer. Return its value
+ * as a C Py_ssize_t, or -1 if it's higher than PY_SSIZE_T_MAX.
+ */
+static Py_ssize_t
+calc_binsize(char *bytes, int nbytes)
+{
+ unsigned char *s = (unsigned char *)bytes;
+ int i;
+ size_t x = 0;
+
+ if (nbytes > (int)sizeof(size_t)) {
+ /* Check for integer overflow. BINBYTES8 and BINUNICODE8 opcodes
+ * have 64-bit size that can't be represented on 32-bit platform.
+ */
+ for (i = (int)sizeof(size_t); i < nbytes; i++) {
+ if (s[i])
+ return -1;
+ }
+ nbytes = (int)sizeof(size_t);
+ }
+ for (i = 0; i < nbytes; i++) {
+ x |= (size_t) s[i] << (8 * i);
+ }
+
+ if (x > PY_SSIZE_T_MAX)
+ return -1;
+ else
+ return (Py_ssize_t) x;
+}
+
+/* s contains x bytes of a little-endian integer. Return its value as a
+ * C int. Obscure: when x is 1 or 2, this is an unsigned little-endian
+ * int, but when x is 4 it's a signed one. This is a historical source
+ * of x-platform bugs.
+ */
+static long
+calc_binint(char *bytes, int nbytes)
+{
+ unsigned char *s = (unsigned char *)bytes;
+ Py_ssize_t i;
+ long x = 0;
+
+ for (i = 0; i < nbytes; i++) {
+ x |= (long)s[i] << (8 * i);
+ }
+
+ /* Unlike BININT1 and BININT2, BININT (more accurately BININT4)
+ * is signed, so on a box with longs bigger than 4 bytes we need
+ * to extend a BININT's sign bit to the full width.
+ */
+ if (SIZEOF_LONG > 4 && nbytes == 4) {
+ x |= -(x & (1L << 31));
+ }
+
+ return x;
+}
+
+static int
+load_binintx(UnpicklerObject *self, char *s, int size)
+{
+ PyObject *value;
+ long x;
+
+ x = calc_binint(s, size);
+
+ if ((value = PyLong_FromLong(x)) == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_binint(PickleState *state, UnpicklerObject *self)
+{
+ char *s;
+ if (_Unpickler_Read(self, state, &s, 4) < 0)
+ return -1;
+
+ return load_binintx(self, s, 4);
+}
+
+static int
+load_binint1(PickleState *state, UnpicklerObject *self)
+{
+ char *s;
+ if (_Unpickler_Read(self, state, &s, 1) < 0)
+ return -1;
+
+ return load_binintx(self, s, 1);
+}
+
+static int
+load_binint2(PickleState *state, UnpicklerObject *self)
+{
+ char *s;
+ if (_Unpickler_Read(self, state, &s, 2) < 0)
+ return -1;
+
+ return load_binintx(self, s, 2);
+}
+
+static int
+load_long(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+ char *s = NULL;
+ Py_ssize_t len;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(state);
+
+ /* s[len-2] will usually be 'L' (and s[len-1] is '\n'); we need to remove
+ the 'L' before calling PyLong_FromString. In order to maintain
+ compatibility with Python 3.0.0, we don't actually *require*
+ the 'L' to be present. */
+ if (s[len-2] == 'L')
+ s[len-2] = '\0';
+ /* XXX: Should the base argument explicitly set to 10? */
+ value = PyLong_FromString(s, NULL, 0);
+ if (value == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, value, -1);
+ return 0;
+}
+
+/* 'size' bytes contain the # of bytes of little-endian 256's-complement
+ * data following.
+ */
+static int
+load_counted_long(PickleState *st, UnpicklerObject *self, int size)
+{
+ PyObject *value;
+ char *nbytes;
+ char *pdata;
+
+ assert(size == 1 || size == 4);
+ if (_Unpickler_Read(self, st, &nbytes, size) < 0)
+ return -1;
+
+ size = calc_binint(nbytes, size);
+ if (size < 0) {
+ /* Corrupt or hostile pickle -- we never write one like this */
+ PyErr_SetString(st->UnpicklingError,
+ "LONG pickle has negative byte count");
+ return -1;
+ }
+
+ if (size == 0)
+ value = PyLong_FromLong(0L);
+ else {
+ /* Read the raw little-endian bytes and convert. */
+ if (_Unpickler_Read(self, st, &pdata, size) < 0)
+ return -1;
+ value = _PyLong_FromByteArray((unsigned char *)pdata, (size_t)size,
+ 1 /* little endian */ , 1 /* signed */ );
+ }
+ if (value == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_float(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+ char *endptr, *s;
+ Py_ssize_t len;
+ double d;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(state);
+
+ errno = 0;
+ d = PyOS_string_to_double(s, &endptr, PyExc_OverflowError);
+ if (d == -1.0 && PyErr_Occurred())
+ return -1;
+ if ((endptr[0] != '\n') && (endptr[0] != '\0')) {
+ PyErr_SetString(PyExc_ValueError, "could not convert string to float");
+ return -1;
+ }
+ value = PyFloat_FromDouble(d);
+ if (value == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_binfloat(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+ double x;
+ char *s;
+
+ if (_Unpickler_Read(self, state, &s, 8) < 0)
+ return -1;
+
+ x = PyFloat_Unpack8(s, 0);
+ if (x == -1.0 && PyErr_Occurred())
+ return -1;
+
+ if ((value = PyFloat_FromDouble(x)) == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_string(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *bytes;
+ PyObject *obj;
+ Py_ssize_t len;
+ char *s, *p;
+
+ if ((len = _Unpickler_Readline(st, self, &s)) < 0)
+ return -1;
+ /* Strip the newline */
+ len--;
+ /* Strip outermost quotes */
+ if (len >= 2 && s[0] == s[len - 1] && (s[0] == '\'' || s[0] == '"')) {
+ p = s + 1;
+ len -= 2;
+ }
+ else {
+ PyErr_SetString(st->UnpicklingError,
+ "the STRING opcode argument must be quoted");
+ return -1;
+ }
+ assert(len >= 0);
+
+ /* Use the PyBytes API to decode the string, since that is what is used
+ to encode, and then coerce the result to Unicode. */
+ bytes = PyBytes_DecodeEscape(p, len, NULL, 0, NULL);
+ if (bytes == NULL)
+ return -1;
+
+ /* Leave the Python 2.x strings as bytes if the *encoding* given to the
+ Unpickler was 'bytes'. Otherwise, convert them to unicode. */
+ if (strcmp(self->encoding, "bytes") == 0) {
+ obj = bytes;
+ }
+ else {
+ obj = PyUnicode_FromEncodedObject(bytes, self->encoding, self->errors);
+ Py_DECREF(bytes);
+ if (obj == NULL) {
+ return -1;
+ }
+ }
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+}
+
+static int
+load_counted_binstring(PickleState *st, UnpicklerObject *self, int nbytes)
+{
+ PyObject *obj;
+ Py_ssize_t size;
+ char *s;
+
+ if (_Unpickler_Read(self, st, &s, nbytes) < 0)
+ return -1;
+
+ size = calc_binsize(s, nbytes);
+ if (size < 0) {
+ PyErr_Format(st->UnpicklingError,
+ "BINSTRING exceeds system's maximum size of %zd bytes",
+ PY_SSIZE_T_MAX);
+ return -1;
+ }
+
+ if (_Unpickler_Read(self, st, &s, size) < 0)
+ return -1;
+
+ /* Convert Python 2.x strings to bytes if the *encoding* given to the
+ Unpickler was 'bytes'. Otherwise, convert them to unicode. */
+ if (strcmp(self->encoding, "bytes") == 0) {
+ obj = PyBytes_FromStringAndSize(s, size);
+ }
+ else {
+ obj = PyUnicode_Decode(s, size, self->encoding, self->errors);
+ }
+ if (obj == NULL) {
+ return -1;
+ }
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+}
+
+static int
+load_counted_binbytes(PickleState *state, UnpicklerObject *self, int nbytes)
+{
+ PyObject *bytes;
+ Py_ssize_t size;
+ char *s;
+
+ if (_Unpickler_Read(self, state, &s, nbytes) < 0)
+ return -1;
+
+ size = calc_binsize(s, nbytes);
+ if (size < 0) {
+ PyErr_Format(PyExc_OverflowError,
+ "BINBYTES exceeds system's maximum size of %zd bytes",
+ PY_SSIZE_T_MAX);
+ return -1;
+ }
+
+ bytes = PyBytes_FromStringAndSize(NULL, size);
+ if (bytes == NULL)
+ return -1;
+ if (_Unpickler_ReadInto(state, self, PyBytes_AS_STRING(bytes), size) < 0) {
+ Py_DECREF(bytes);
+ return -1;
+ }
+
+ PDATA_PUSH(self->stack, bytes, -1);
+ return 0;
+}
+
+static int
+load_counted_bytearray(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *bytearray;
+ Py_ssize_t size;
+ char *s;
+
+ if (_Unpickler_Read(self, state, &s, 8) < 0) {
+ return -1;
+ }
+
+ size = calc_binsize(s, 8);
+ if (size < 0) {
+ PyErr_Format(PyExc_OverflowError,
+ "BYTEARRAY8 exceeds system's maximum size of %zd bytes",
+ PY_SSIZE_T_MAX);
+ return -1;
+ }
+
+ bytearray = PyByteArray_FromStringAndSize(NULL, size);
+ if (bytearray == NULL) {
+ return -1;
+ }
+ char *str = PyByteArray_AS_STRING(bytearray);
+ if (_Unpickler_ReadInto(state, self, str, size) < 0) {
+ Py_DECREF(bytearray);
+ return -1;
+ }
+
+ PDATA_PUSH(self->stack, bytearray, -1);
+ return 0;
+}
+
+static int
+load_next_buffer(PickleState *st, UnpicklerObject *self)
+{
+ if (self->buffers == NULL) {
+ PyErr_SetString(st->UnpicklingError,
+ "pickle stream refers to out-of-band data "
+ "but no *buffers* argument was given");
+ return -1;
+ }
+ PyObject *buf = PyIter_Next(self->buffers);
+ if (buf == NULL) {
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(st->UnpicklingError,
+ "not enough out-of-band buffers");
+ }
+ return -1;
+ }
+
+ PDATA_PUSH(self->stack, buf, -1);
+ return 0;
+}
+
+static int
+load_readonly_buffer(PickleState *state, UnpicklerObject *self)
+{
+ Py_ssize_t len = Py_SIZE(self->stack);
+ if (len <= self->stack->fence) {
+ return Pdata_stack_underflow(state, self->stack);
+ }
+
+ PyObject *obj = self->stack->data[len - 1];
+ PyObject *view = PyMemoryView_FromObject(obj);
+ if (view == NULL) {
+ return -1;
+ }
+ if (!PyMemoryView_GET_BUFFER(view)->readonly) {
+ /* Original object is writable */
+ PyMemoryView_GET_BUFFER(view)->readonly = 1;
+ self->stack->data[len - 1] = view;
+ Py_DECREF(obj);
+ }
+ else {
+ /* Original object is read-only, no need to replace it */
+ Py_DECREF(view);
+ }
+ return 0;
+}
+
+static int
+load_unicode(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *str;
+ Py_ssize_t len;
+ char *s = NULL;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 1)
+ return bad_readline(state);
+
+ str = PyUnicode_DecodeRawUnicodeEscape(s, len - 1, NULL);
+ if (str == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, str, -1);
+ return 0;
+}
+
+static int
+load_counted_binunicode(PickleState *state, UnpicklerObject *self, int nbytes)
+{
+ PyObject *str;
+ Py_ssize_t size;
+ char *s;
+
+ if (_Unpickler_Read(self, state, &s, nbytes) < 0)
+ return -1;
+
+ size = calc_binsize(s, nbytes);
+ if (size < 0) {
+ PyErr_Format(PyExc_OverflowError,
+ "BINUNICODE exceeds system's maximum size of %zd bytes",
+ PY_SSIZE_T_MAX);
+ return -1;
+ }
+
+ if (_Unpickler_Read(self, state, &s, size) < 0)
+ return -1;
+
+ str = PyUnicode_DecodeUTF8(s, size, "surrogatepass");
+ if (str == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, str, -1);
+ return 0;
+}
+
+static int
+load_counted_tuple(PickleState *state, UnpicklerObject *self, Py_ssize_t len)
+{
+ PyObject *tuple;
+
+ if (Py_SIZE(self->stack) < len)
+ return Pdata_stack_underflow(state, self->stack);
+
+ tuple = Pdata_poptuple(state, self->stack, Py_SIZE(self->stack) - len);
+ if (tuple == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, tuple, -1);
+ return 0;
+}
+
+static int
+load_tuple(PickleState *state, UnpicklerObject *self)
+{
+ Py_ssize_t i;
+
+ if ((i = marker(state, self)) < 0)
+ return -1;
+
+ return load_counted_tuple(state, self, Py_SIZE(self->stack) - i);
+}
+
+static int
+load_empty_list(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *list;
+
+ if ((list = PyList_New(0)) == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, list, -1);
+ return 0;
+}
+
+static int
+load_empty_dict(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *dict;
+
+ if ((dict = PyDict_New()) == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, dict, -1);
+ return 0;
+}
+
+static int
+load_empty_set(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *set;
+
+ if ((set = PySet_New(NULL)) == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, set, -1);
+ return 0;
+}
+
+static int
+load_list(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *list;
+ Py_ssize_t i;
+
+ if ((i = marker(state, self)) < 0)
+ return -1;
+
+ list = Pdata_poplist(self->stack, i);
+ if (list == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, list, -1);
+ return 0;
+}
+
+static int
+load_dict(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *dict, *key, *value;
+ Py_ssize_t i, j, k;
+
+ if ((i = marker(st, self)) < 0)
+ return -1;
+ j = Py_SIZE(self->stack);
+
+ if ((dict = PyDict_New()) == NULL)
+ return -1;
+
+ if ((j - i) % 2 != 0) {
+ PyErr_SetString(st->UnpicklingError, "odd number of items for DICT");
+ Py_DECREF(dict);
+ return -1;
+ }
+
+ for (k = i + 1; k < j; k += 2) {
+ key = self->stack->data[k - 1];
+ value = self->stack->data[k];
+ if (PyDict_SetItem(dict, key, value) < 0) {
+ Py_DECREF(dict);
+ return -1;
+ }
+ }
+ Pdata_clear(self->stack, i);
+ PDATA_PUSH(self->stack, dict, -1);
+ return 0;
+}
+
+static int
+load_frozenset(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *items;
+ PyObject *frozenset;
+ Py_ssize_t i;
+
+ if ((i = marker(state, self)) < 0)
+ return -1;
+
+ items = Pdata_poptuple(state, self->stack, i);
+ if (items == NULL)
+ return -1;
+
+ frozenset = PyFrozenSet_New(items);
+ Py_DECREF(items);
+ if (frozenset == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, frozenset, -1);
+ return 0;
+}
+
+static PyObject *
+instantiate(PyObject *cls, PyObject *args)
+{
+ /* Caller must assure args are a tuple. Normally, args come from
+ Pdata_poptuple which packs objects from the top of the stack
+ into a newly created tuple. */
+ assert(PyTuple_Check(args));
+ if (!PyTuple_GET_SIZE(args) && PyType_Check(cls)) {
+ PyObject *func;
+ if (_PyObject_LookupAttr(cls, &_Py_ID(__getinitargs__), &func) < 0) {
+ return NULL;
+ }
+ if (func == NULL) {
+ return PyObject_CallMethodOneArg(cls, &_Py_ID(__new__), cls);
+ }
+ Py_DECREF(func);
+ }
+ return PyObject_CallObject(cls, args);
+}
+
+static int
+load_obj(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *cls, *args, *obj = NULL;
+ Py_ssize_t i;
+
+ if ((i = marker(state, self)) < 0)
+ return -1;
+
+ if (Py_SIZE(self->stack) - i < 1)
+ return Pdata_stack_underflow(state, self->stack);
+
+ args = Pdata_poptuple(state, self->stack, i + 1);
+ if (args == NULL)
+ return -1;
+
+ PDATA_POP(state, self->stack, cls);
+ if (cls) {
+ obj = instantiate(cls, args);
+ Py_DECREF(cls);
+ }
+ Py_DECREF(args);
+ if (obj == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+}
+
+static int
+load_inst(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *cls = NULL;
+ PyObject *args = NULL;
+ PyObject *obj = NULL;
+ PyObject *module_name;
+ PyObject *class_name;
+ Py_ssize_t len;
+ Py_ssize_t i;
+ char *s;
+
+ if ((i = marker(state, self)) < 0)
+ return -1;
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(state);
+
+ /* Here it is safe to use PyUnicode_DecodeASCII(), even though non-ASCII
+ identifiers are permitted in Python 3.0, since the INST opcode is only
+ supported by older protocols on Python 2.x. */
+ module_name = PyUnicode_DecodeASCII(s, len - 1, "strict");
+ if (module_name == NULL)
+ return -1;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) >= 0) {
+ if (len < 2) {
+ Py_DECREF(module_name);
+ return bad_readline(state);
+ }
+ class_name = PyUnicode_DecodeASCII(s, len - 1, "strict");
+ if (class_name != NULL) {
+ cls = find_class(self, module_name, class_name);
+ Py_DECREF(class_name);
+ }
+ }
+ Py_DECREF(module_name);
+
+ if (cls == NULL)
+ return -1;
+
+ if ((args = Pdata_poptuple(state, self->stack, i)) != NULL) {
+ obj = instantiate(cls, args);
+ Py_DECREF(args);
+ }
+ Py_DECREF(cls);
+
+ if (obj == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+}
+
+static void
+newobj_unpickling_error(PickleState *st, const char *msg, int use_kwargs,
+ PyObject *arg)
+{
+ PyErr_Format(st->UnpicklingError, msg,
+ use_kwargs ? "NEWOBJ_EX" : "NEWOBJ",
+ Py_TYPE(arg)->tp_name);
+}
+
+static int
+load_newobj(PickleState *state, UnpicklerObject *self, int use_kwargs)
+{
+ PyObject *cls, *args, *kwargs = NULL;
+ PyObject *obj;
+
+ /* Stack is ... cls args [kwargs], and we want to call
+ * cls.__new__(cls, *args, **kwargs).
+ */
+ if (use_kwargs) {
+ PDATA_POP(state, self->stack, kwargs);
+ if (kwargs == NULL) {
+ return -1;
+ }
+ }
+ PDATA_POP(state, self->stack, args);
+ if (args == NULL) {
+ Py_XDECREF(kwargs);
+ return -1;
+ }
+ PDATA_POP(state, self->stack, cls);
+ if (cls == NULL) {
+ Py_XDECREF(kwargs);
+ Py_DECREF(args);
+ return -1;
+ }
+
+ if (!PyType_Check(cls)) {
+ newobj_unpickling_error(state,
+ "%s class argument must be a type, not %.200s",
+ use_kwargs, cls);
+ goto error;
+ }
+ if (((PyTypeObject *)cls)->tp_new == NULL) {
+ newobj_unpickling_error(state,
+ "%s class argument '%.200s' doesn't have __new__",
+ use_kwargs, cls);
+ goto error;
+ }
+ if (!PyTuple_Check(args)) {
+ newobj_unpickling_error(state,
+ "%s args argument must be a tuple, not %.200s",
+ use_kwargs, args);
+ goto error;
+ }
+ if (use_kwargs && !PyDict_Check(kwargs)) {
+ newobj_unpickling_error(state,
+ "%s kwargs argument must be a dict, not %.200s",
+ use_kwargs, kwargs);
+ goto error;
+ }
+
+ obj = ((PyTypeObject *)cls)->tp_new((PyTypeObject *)cls, args, kwargs);
+ if (obj == NULL) {
+ goto error;
+ }
+ Py_XDECREF(kwargs);
+ Py_DECREF(args);
+ Py_DECREF(cls);
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+
+error:
+ Py_XDECREF(kwargs);
+ Py_DECREF(args);
+ Py_DECREF(cls);
+ return -1;
+}
+
+static int
+load_global(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *global = NULL;
+ PyObject *module_name;
+ PyObject *global_name;
+ Py_ssize_t len;
+ char *s;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(state);
+ module_name = PyUnicode_DecodeUTF8(s, len - 1, "strict");
+ if (!module_name)
+ return -1;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) >= 0) {
+ if (len < 2) {
+ Py_DECREF(module_name);
+ return bad_readline(state);
+ }
+ global_name = PyUnicode_DecodeUTF8(s, len - 1, "strict");
+ if (global_name) {
+ global = find_class(self, module_name, global_name);
+ Py_DECREF(global_name);
+ }
+ }
+ Py_DECREF(module_name);
+
+ if (global == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, global, -1);
+ return 0;
+}
+
+static int
+load_stack_global(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *global;
+ PyObject *module_name;
+ PyObject *global_name;
+
+ PDATA_POP(st, self->stack, global_name);
+ if (global_name == NULL) {
+ return -1;
+ }
+ PDATA_POP(st, self->stack, module_name);
+ if (module_name == NULL) {
+ Py_DECREF(global_name);
+ return -1;
+ }
+ if (!PyUnicode_CheckExact(module_name) ||
+ !PyUnicode_CheckExact(global_name))
+ {
+ PyErr_SetString(st->UnpicklingError, "STACK_GLOBAL requires str");
+ Py_DECREF(global_name);
+ Py_DECREF(module_name);
+ return -1;
+ }
+ global = find_class(self, module_name, global_name);
+ Py_DECREF(global_name);
+ Py_DECREF(module_name);
+ if (global == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, global, -1);
+ return 0;
+}
+
+static int
+load_persid(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *pid, *obj;
+ Py_ssize_t len;
+ char *s;
+
+ if (self->pers_func) {
+ if ((len = _Unpickler_Readline(st, self, &s)) < 0)
+ return -1;
+ if (len < 1)
+ return bad_readline(st);
+
+ pid = PyUnicode_DecodeASCII(s, len - 1, "strict");
+ if (pid == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) {
+ PyErr_SetString(st->UnpicklingError,
+ "persistent IDs in protocol 0 must be "
+ "ASCII strings");
+ }
+ return -1;
+ }
+
+ obj = call_method(self->pers_func, self->pers_func_self, pid);
+ Py_DECREF(pid);
+ if (obj == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+ }
+ else {
+ PyErr_SetString(st->UnpicklingError,
+ "A load persistent id instruction was encountered, "
+ "but no persistent_load function was specified.");
+ return -1;
+ }
+}
+
+static int
+load_binpersid(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *pid, *obj;
+
+ if (self->pers_func) {
+ PDATA_POP(st, self->stack, pid);
+ if (pid == NULL)
+ return -1;
+
+ obj = call_method(self->pers_func, self->pers_func_self, pid);
+ Py_DECREF(pid);
+ if (obj == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+ }
+ else {
+ PyErr_SetString(st->UnpicklingError,
+ "A load persistent id instruction was encountered, "
+ "but no persistent_load function was specified.");
+ return -1;
+ }
+}
+
+static int
+load_pop(PickleState *state, UnpicklerObject *self)
+{
+ Py_ssize_t len = Py_SIZE(self->stack);
+
+ /* Note that we split the (pickle.py) stack into two stacks,
+ * an object stack and a mark stack. We have to be clever and
+ * pop the right one. We do this by looking at the top of the
+ * mark stack first, and only signalling a stack underflow if
+ * the object stack is empty and the mark stack doesn't match
+ * our expectations.
+ */
+ if (self->num_marks > 0 && self->marks[self->num_marks - 1] == len) {
+ self->num_marks--;
+ self->stack->mark_set = self->num_marks != 0;
+ self->stack->fence = self->num_marks ?
+ self->marks[self->num_marks - 1] : 0;
+ } else if (len <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ else {
+ len--;
+ Py_DECREF(self->stack->data[len]);
+ Py_SET_SIZE(self->stack, len);
+ }
+ return 0;
+}
+
+static int
+load_pop_mark(PickleState *state, UnpicklerObject *self)
+{
+ Py_ssize_t i;
+ if ((i = marker(state, self)) < 0)
+ return -1;
+
+ Pdata_clear(self->stack, i);
+
+ return 0;
+}
+
+static int
+load_dup(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *last;
+ Py_ssize_t len = Py_SIZE(self->stack);
+
+ if (len <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ last = self->stack->data[len - 1];
+ PDATA_APPEND(self->stack, last, -1);
+ return 0;
+}
+
+static int
+load_get(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *key, *value;
+ Py_ssize_t idx;
+ Py_ssize_t len;
+ char *s;
+
+ if ((len = _Unpickler_Readline(st, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(st);
+
+ key = PyLong_FromString(s, NULL, 10);
+ if (key == NULL)
+ return -1;
+ idx = PyLong_AsSsize_t(key);
+ if (idx == -1 && PyErr_Occurred()) {
+ Py_DECREF(key);
+ return -1;
+ }
+
+ value = _Unpickler_MemoGet(self, idx);
+ if (value == NULL) {
+ if (!PyErr_Occurred()) {
+ PyErr_Format(st->UnpicklingError, "Memo value not found at index %ld", idx);
+ }
+ Py_DECREF(key);
+ return -1;
+ }
+ Py_DECREF(key);
+
+ PDATA_APPEND(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_binget(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *value;
+ Py_ssize_t idx;
+ char *s;
+
+ if (_Unpickler_Read(self, st, &s, 1) < 0)
+ return -1;
+
+ idx = Py_CHARMASK(s[0]);
+
+ value = _Unpickler_MemoGet(self, idx);
+ if (value == NULL) {
+ PyObject *key = PyLong_FromSsize_t(idx);
+ if (key != NULL) {
+ PyErr_Format(st->UnpicklingError, "Memo value not found at index %ld", idx);
+ Py_DECREF(key);
+ }
+ return -1;
+ }
+
+ PDATA_APPEND(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_long_binget(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *value;
+ Py_ssize_t idx;
+ char *s;
+
+ if (_Unpickler_Read(self, st, &s, 4) < 0)
+ return -1;
+
+ idx = calc_binsize(s, 4);
+
+ value = _Unpickler_MemoGet(self, idx);
+ if (value == NULL) {
+ PyObject *key = PyLong_FromSsize_t(idx);
+ if (key != NULL) {
+ PyErr_Format(st->UnpicklingError, "Memo value not found at index %ld", idx);
+ Py_DECREF(key);
+ }
+ return -1;
+ }
+
+ PDATA_APPEND(self->stack, value, -1);
+ return 0;
+}
+
+/* Push an object from the extension registry (EXT[124]). nbytes is
+ * the number of bytes following the opcode, holding the index (code) value.
+ */
+static int
+load_extension(PickleState *st, UnpicklerObject *self, int nbytes)
+{
+ char *codebytes; /* the nbytes bytes after the opcode */
+ long code; /* calc_binint returns long */
+ PyObject *py_code; /* code as a Python int */
+ PyObject *obj; /* the object to push */
+ PyObject *pair; /* (module_name, class_name) */
+ PyObject *module_name, *class_name;
+
+ assert(nbytes == 1 || nbytes == 2 || nbytes == 4);
+ if (_Unpickler_Read(self, st, &codebytes, nbytes) < 0)
+ return -1;
+ code = calc_binint(codebytes, nbytes);
+ if (code <= 0) { /* note that 0 is forbidden */
+ /* Corrupt or hostile pickle. */
+ PyErr_SetString(st->UnpicklingError, "EXT specifies code <= 0");
+ return -1;
+ }
+
+ /* Look for the code in the cache. */
+ py_code = PyLong_FromLong(code);
+ if (py_code == NULL)
+ return -1;
+ obj = PyDict_GetItemWithError(st->extension_cache, py_code);
+ if (obj != NULL) {
+ /* Bingo. */
+ Py_DECREF(py_code);
+ PDATA_APPEND(self->stack, obj, -1);
+ return 0;
+ }
+ if (PyErr_Occurred()) {
+ Py_DECREF(py_code);
+ return -1;
+ }
+
+ /* Look up the (module_name, class_name) pair. */
+ pair = PyDict_GetItemWithError(st->inverted_registry, py_code);
+ if (pair == NULL) {
+ Py_DECREF(py_code);
+ if (!PyErr_Occurred()) {
+ PyErr_Format(PyExc_ValueError, "unregistered extension "
+ "code %ld", code);
+ }
+ return -1;
+ }
+ /* Since the extension registry is manipulable via Python code,
+ * confirm that pair is really a 2-tuple of strings.
+ */
+ if (!PyTuple_Check(pair) || PyTuple_Size(pair) != 2) {
+ goto error;
+ }
+
+ module_name = PyTuple_GET_ITEM(pair, 0);
+ if (!PyUnicode_Check(module_name)) {
+ goto error;
+ }
+
+ class_name = PyTuple_GET_ITEM(pair, 1);
+ if (!PyUnicode_Check(class_name)) {
+ goto error;
+ }
+
+ /* Load the object. */
+ obj = find_class(self, module_name, class_name);
+ if (obj == NULL) {
+ Py_DECREF(py_code);
+ return -1;
+ }
+ /* Cache code -> obj. */
+ code = PyDict_SetItem(st->extension_cache, py_code, obj);
+ Py_DECREF(py_code);
+ if (code < 0) {
+ Py_DECREF(obj);
+ return -1;
+ }
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+
+error:
+ Py_DECREF(py_code);
+ PyErr_Format(PyExc_ValueError, "_inverted_registry[%ld] "
+ "isn't a 2-tuple of strings", code);
+ return -1;
+}
+
+static int
+load_put(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *key, *value;
+ Py_ssize_t idx;
+ Py_ssize_t len;
+ char *s = NULL;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(state);
+ if (Py_SIZE(self->stack) <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ value = self->stack->data[Py_SIZE(self->stack) - 1];
+
+ key = PyLong_FromString(s, NULL, 10);
+ if (key == NULL)
+ return -1;
+ idx = PyLong_AsSsize_t(key);
+ Py_DECREF(key);
+ if (idx < 0) {
+ if (!PyErr_Occurred())
+ PyErr_SetString(PyExc_ValueError,
+ "negative PUT argument");
+ return -1;
+ }
+
+ return _Unpickler_MemoPut(self, idx, value);
+}
+
+static int
+load_binput(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+ Py_ssize_t idx;
+ char *s;
+
+ if (_Unpickler_Read(self, state, &s, 1) < 0)
+ return -1;
+
+ if (Py_SIZE(self->stack) <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ value = self->stack->data[Py_SIZE(self->stack) - 1];
+
+ idx = Py_CHARMASK(s[0]);
+
+ return _Unpickler_MemoPut(self, idx, value);
+}
+
+static int
+load_long_binput(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+ Py_ssize_t idx;
+ char *s;
+
+ if (_Unpickler_Read(self, state, &s, 4) < 0)
+ return -1;
+
+ if (Py_SIZE(self->stack) <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ value = self->stack->data[Py_SIZE(self->stack) - 1];
+
+ idx = calc_binsize(s, 4);
+ if (idx < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "negative LONG_BINPUT argument");
+ return -1;
+ }
+
+ return _Unpickler_MemoPut(self, idx, value);
+}
+
+static int
+load_memoize(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+
+ if (Py_SIZE(self->stack) <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ value = self->stack->data[Py_SIZE(self->stack) - 1];
+
+ return _Unpickler_MemoPut(self, self->memo_len, value);
+}
+
+static int
+do_append(PickleState *state, UnpicklerObject *self, Py_ssize_t x)
+{
+ PyObject *value;
+ PyObject *slice;
+ PyObject *list;
+ PyObject *result;
+ Py_ssize_t len, i;
+
+ len = Py_SIZE(self->stack);
+ if (x > len || x <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ if (len == x) /* nothing to do */
+ return 0;
+
+ list = self->stack->data[x - 1];
+
+ if (PyList_CheckExact(list)) {
+ Py_ssize_t list_len;
+ int ret;
+
+ slice = Pdata_poplist(self->stack, x);
+ if (!slice)
+ return -1;
+ list_len = PyList_GET_SIZE(list);
+ ret = PyList_SetSlice(list, list_len, list_len, slice);
+ Py_DECREF(slice);
+ return ret;
+ }
+ else {
+ PyObject *extend_func;
+
+ if (_PyObject_LookupAttr(list, &_Py_ID(extend), &extend_func) < 0) {
+ return -1;
+ }
+ if (extend_func != NULL) {
+ slice = Pdata_poplist(self->stack, x);
+ if (!slice) {
+ Py_DECREF(extend_func);
+ return -1;
+ }
+ result = _Pickle_FastCall(extend_func, slice);
+ Py_DECREF(extend_func);
+ if (result == NULL)
+ return -1;
+ Py_DECREF(result);
+ }
+ else {
+ PyObject *append_func;
+
+ /* Even if the PEP 307 requires extend() and append() methods,
+ fall back on append() if the object has no extend() method
+ for backward compatibility. */
+ append_func = PyObject_GetAttr(list, &_Py_ID(append));
+ if (append_func == NULL)
+ return -1;
+ for (i = x; i < len; i++) {
+ value = self->stack->data[i];
+ result = _Pickle_FastCall(append_func, value);
+ if (result == NULL) {
+ Pdata_clear(self->stack, i + 1);
+ Py_SET_SIZE(self->stack, x);
+ Py_DECREF(append_func);
+ return -1;
+ }
+ Py_DECREF(result);
+ }
+ Py_SET_SIZE(self->stack, x);
+ Py_DECREF(append_func);
+ }
+ }
+
+ return 0;
+}
+
+static int
+load_append(PickleState *state, UnpicklerObject *self)
+{
+ if (Py_SIZE(self->stack) - 1 <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ return do_append(state, self, Py_SIZE(self->stack) - 1);
+}
+
+static int
+load_appends(PickleState *state, UnpicklerObject *self)
+{
+ Py_ssize_t i = marker(state, self);
+ if (i < 0)
+ return -1;
+ return do_append(state, self, i);
+}
+
+static int
+do_setitems(PickleState *st, UnpicklerObject *self, Py_ssize_t x)
+{
+ PyObject *value, *key;
+ PyObject *dict;
+ Py_ssize_t len, i;
+ int status = 0;
+
+ len = Py_SIZE(self->stack);
+ if (x > len || x <= self->stack->fence)
+ return Pdata_stack_underflow(st, self->stack);
+ if (len == x) /* nothing to do */
+ return 0;
+ if ((len - x) % 2 != 0) {
+ /* Corrupt or hostile pickle -- we never write one like this. */
+ PyErr_SetString(st->UnpicklingError,
+ "odd number of items for SETITEMS");
+ return -1;
+ }
+
+ /* Here, dict does not actually need to be a PyDict; it could be anything
+ that supports the __setitem__ attribute. */
+ dict = self->stack->data[x - 1];
+
+ for (i = x + 1; i < len; i += 2) {
+ key = self->stack->data[i - 1];
+ value = self->stack->data[i];
+ if (PyObject_SetItem(dict, key, value) < 0) {
+ status = -1;
+ break;
+ }
+ }
+
+ Pdata_clear(self->stack, x);
+ return status;
+}
+
+static int
+load_setitem(PickleState *state, UnpicklerObject *self)
+{
+ return do_setitems(state, self, Py_SIZE(self->stack) - 2);
+}
+
+static int
+load_setitems(PickleState *state, UnpicklerObject *self)
+{
+ Py_ssize_t i = marker(state, self);
+ if (i < 0)
+ return -1;
+ return do_setitems(state, self, i);
+}
+
+static int
+load_additems(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *set;
+ Py_ssize_t mark, len, i;
+
+ mark = marker(state, self);
+ if (mark < 0)
+ return -1;
+ len = Py_SIZE(self->stack);
+ if (mark > len || mark <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ if (len == mark) /* nothing to do */
+ return 0;
+
+ set = self->stack->data[mark - 1];
+
+ if (PySet_Check(set)) {
+ PyObject *items;
+ int status;
+
+ items = Pdata_poptuple(state, self->stack, mark);
+ if (items == NULL)
+ return -1;
+
+ status = _PySet_Update(set, items);
+ Py_DECREF(items);
+ return status;
+ }
+ else {
+ PyObject *add_func;
+
+ add_func = PyObject_GetAttr(set, &_Py_ID(add));
+ if (add_func == NULL)
+ return -1;
+ for (i = mark; i < len; i++) {
+ PyObject *result;
+ PyObject *item;
+
+ item = self->stack->data[i];
+ result = _Pickle_FastCall(add_func, item);
+ if (result == NULL) {
+ Pdata_clear(self->stack, i + 1);
+ Py_SET_SIZE(self->stack, mark);
+ return -1;
+ }
+ Py_DECREF(result);
+ }
+ Py_SET_SIZE(self->stack, mark);
+ }
+
+ return 0;
+}
+
+static int
+load_build(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *inst, *slotstate;
+ PyObject *setstate;
+ int status = 0;
+
+ /* Stack is ... instance, state. We want to leave instance at
+ * the stack top, possibly mutated via instance.__setstate__(state).
+ */
+ if (Py_SIZE(self->stack) - 2 < self->stack->fence)
+ return Pdata_stack_underflow(st, self->stack);
+
+ PyObject *state;
+ PDATA_POP(st, self->stack, state);
+ if (state == NULL)
+ return -1;
+
+ inst = self->stack->data[Py_SIZE(self->stack) - 1];
+
+ if (_PyObject_LookupAttr(inst, &_Py_ID(__setstate__), &setstate) < 0) {
+ Py_DECREF(state);
+ return -1;
+ }
+ if (setstate != NULL) {
+ PyObject *result;
+
+ /* The explicit __setstate__ is responsible for everything. */
+ result = _Pickle_FastCall(setstate, state);
+ Py_DECREF(setstate);
+ if (result == NULL)
+ return -1;
+ Py_DECREF(result);
+ return 0;
+ }
+
+ /* A default __setstate__. First see whether state embeds a
+ * slot state dict too (a proto 2 addition).
+ */
+ if (PyTuple_Check(state) && PyTuple_GET_SIZE(state) == 2) {
+ PyObject *tmp = state;
+
+ state = PyTuple_GET_ITEM(tmp, 0);
+ slotstate = PyTuple_GET_ITEM(tmp, 1);
+ Py_INCREF(state);
+ Py_INCREF(slotstate);
+ Py_DECREF(tmp);
+ }
+ else
+ slotstate = NULL;
+
+ /* Set inst.__dict__ from the state dict (if any). */
+ if (state != Py_None) {
+ PyObject *dict;
+ PyObject *d_key, *d_value;
+ Py_ssize_t i;
+
+ if (!PyDict_Check(state)) {
+ PyErr_SetString(st->UnpicklingError, "state is not a dictionary");
+ goto error;
+ }
+ dict = PyObject_GetAttr(inst, &_Py_ID(__dict__));
+ if (dict == NULL)
+ goto error;
+
+ i = 0;
+ while (PyDict_Next(state, &i, &d_key, &d_value)) {
+ /* normally the keys for instance attributes are
+ interned. we should try to do that here. */
+ Py_INCREF(d_key);
+ if (PyUnicode_CheckExact(d_key))
+ PyUnicode_InternInPlace(&d_key);
+ if (PyObject_SetItem(dict, d_key, d_value) < 0) {
+ Py_DECREF(d_key);
+ goto error;
+ }
+ Py_DECREF(d_key);
+ }
+ Py_DECREF(dict);
+ }
+
+ /* Also set instance attributes from the slotstate dict (if any). */
+ if (slotstate != NULL) {
+ PyObject *d_key, *d_value;
+ Py_ssize_t i;
+
+ if (!PyDict_Check(slotstate)) {
+ PyErr_SetString(st->UnpicklingError,
+ "slot state is not a dictionary");
+ goto error;
+ }
+ i = 0;
+ while (PyDict_Next(slotstate, &i, &d_key, &d_value)) {
+ if (PyObject_SetAttr(inst, d_key, d_value) < 0)
+ goto error;
+ }
+ }
+
+ if (0) {
+ error:
+ status = -1;
+ }
+
+ Py_DECREF(state);
+ Py_XDECREF(slotstate);
+ return status;
+}
+
+static int
+load_mark(PickleState *state, UnpicklerObject *self)
+{
+
+ /* Note that we split the (pickle.py) stack into two stacks, an
+ * object stack and a mark stack. Here we push a mark onto the
+ * mark stack.
+ */
+
+ if (self->num_marks >= self->marks_size) {
+ size_t alloc = ((size_t)self->num_marks << 1) + 20;
+ Py_ssize_t *marks_new = self->marks;
+ PyMem_RESIZE(marks_new, Py_ssize_t, alloc);
+ if (marks_new == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->marks = marks_new;
+ self->marks_size = (Py_ssize_t)alloc;
+ }
+
+ self->stack->mark_set = 1;
+ self->marks[self->num_marks++] = self->stack->fence = Py_SIZE(self->stack);
+
+ return 0;
+}
+
+static int
+load_reduce(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *callable = NULL;
+ PyObject *argtup = NULL;
+ PyObject *obj = NULL;
+
+ PDATA_POP(state, self->stack, argtup);
+ if (argtup == NULL)
+ return -1;
+ PDATA_POP(state, self->stack, callable);
+ if (callable) {
+ obj = PyObject_CallObject(callable, argtup);
+ Py_DECREF(callable);
+ }
+ Py_DECREF(argtup);
+
+ if (obj == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+}
+
+/* Just raises an error if we don't know the protocol specified. PROTO
+ * is the first opcode for protocols >= 2.
+ */
+static int
+load_proto(PickleState *state, UnpicklerObject *self)
+{
+ char *s;
+ int i;
+
+ if (_Unpickler_Read(self, state, &s, 1) < 0)
+ return -1;
+
+ i = (unsigned char)s[0];
+ if (i <= HIGHEST_PROTOCOL) {
+ self->proto = i;
+ return 0;
+ }
+
+ PyErr_Format(PyExc_ValueError, "unsupported pickle protocol: %d", i);
+ return -1;
+}
+
+static int
+load_frame(PickleState *state, UnpicklerObject *self)
+{
+ char *s;
+ Py_ssize_t frame_len;
+
+ if (_Unpickler_Read(self, state, &s, 8) < 0)
+ return -1;
+
+ frame_len = calc_binsize(s, 8);
+ if (frame_len < 0) {
+ PyErr_Format(PyExc_OverflowError,
+ "FRAME length exceeds system's maximum of %zd bytes",
+ PY_SSIZE_T_MAX);
+ return -1;
+ }
+
+ if (_Unpickler_Read(self, state, &s, frame_len) < 0)
+ return -1;
+
+ /* Rewind to start of frame */
+ self->next_read_idx -= frame_len;
+ return 0;
+}
+
+static PyObject *
+load(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *value = NULL;
+ char *s = NULL;
+
+ self->num_marks = 0;
+ self->stack->mark_set = 0;
+ self->stack->fence = 0;
+ self->proto = 0;
+ if (Py_SIZE(self->stack))
+ Pdata_clear(self->stack, 0);
+
+ /* Convenient macros for the dispatch while-switch loop just below. */
+#define OP(opcode, load_func) \
+ case opcode: if (load_func(st, self) < 0) break; continue;
+
+#define OP_ARG(opcode, load_func, arg) \
+ case opcode: if (load_func(st, self, (arg)) < 0) break; continue;
+
+ while (1) {
+ if (_Unpickler_Read(self, st, &s, 1) < 0) {
+ if (PyErr_ExceptionMatches(st->UnpicklingError)) {
+ PyErr_Format(PyExc_EOFError, "Ran out of input");
+ }
+ return NULL;
+ }
+
+ switch ((enum opcode)s[0]) {
+ OP(NONE, load_none)
+ OP(BININT, load_binint)
+ OP(BININT1, load_binint1)
+ OP(BININT2, load_binint2)
+ OP(INT, load_int)
+ OP(LONG, load_long)
+ OP_ARG(LONG1, load_counted_long, 1)
+ OP_ARG(LONG4, load_counted_long, 4)
+ OP(FLOAT, load_float)
+ OP(BINFLOAT, load_binfloat)
+ OP_ARG(SHORT_BINBYTES, load_counted_binbytes, 1)
+ OP_ARG(BINBYTES, load_counted_binbytes, 4)
+ OP_ARG(BINBYTES8, load_counted_binbytes, 8)
+ OP(BYTEARRAY8, load_counted_bytearray)
+ OP(NEXT_BUFFER, load_next_buffer)
+ OP(READONLY_BUFFER, load_readonly_buffer)
+ OP_ARG(SHORT_BINSTRING, load_counted_binstring, 1)
+ OP_ARG(BINSTRING, load_counted_binstring, 4)
+ OP(STRING, load_string)
+ OP(UNICODE, load_unicode)
+ OP_ARG(SHORT_BINUNICODE, load_counted_binunicode, 1)
+ OP_ARG(BINUNICODE, load_counted_binunicode, 4)
+ OP_ARG(BINUNICODE8, load_counted_binunicode, 8)
+ OP_ARG(EMPTY_TUPLE, load_counted_tuple, 0)
+ OP_ARG(TUPLE1, load_counted_tuple, 1)
+ OP_ARG(TUPLE2, load_counted_tuple, 2)
+ OP_ARG(TUPLE3, load_counted_tuple, 3)
+ OP(TUPLE, load_tuple)
+ OP(EMPTY_LIST, load_empty_list)
+ OP(LIST, load_list)
+ OP(EMPTY_DICT, load_empty_dict)
+ OP(DICT, load_dict)
+ OP(EMPTY_SET, load_empty_set)
+ OP(ADDITEMS, load_additems)
+ OP(FROZENSET, load_frozenset)
+ OP(OBJ, load_obj)
+ OP(INST, load_inst)
+ OP_ARG(NEWOBJ, load_newobj, 0)
+ OP_ARG(NEWOBJ_EX, load_newobj, 1)
+ OP(GLOBAL, load_global)
+ OP(STACK_GLOBAL, load_stack_global)
+ OP(APPEND, load_append)
+ OP(APPENDS, load_appends)
+ OP(BUILD, load_build)
+ OP(DUP, load_dup)
+ OP(BINGET, load_binget)
+ OP(LONG_BINGET, load_long_binget)
+ OP(GET, load_get)
+ OP(MARK, load_mark)
+ OP(BINPUT, load_binput)
+ OP(LONG_BINPUT, load_long_binput)
+ OP(PUT, load_put)
+ OP(MEMOIZE, load_memoize)
+ OP(POP, load_pop)
+ OP(POP_MARK, load_pop_mark)
+ OP(SETITEM, load_setitem)
+ OP(SETITEMS, load_setitems)
+ OP(PERSID, load_persid)
+ OP(BINPERSID, load_binpersid)
+ OP(REDUCE, load_reduce)
+ OP(PROTO, load_proto)
+ OP(FRAME, load_frame)
+ OP_ARG(EXT1, load_extension, 1)
+ OP_ARG(EXT2, load_extension, 2)
+ OP_ARG(EXT4, load_extension, 4)
+ OP_ARG(NEWTRUE, load_bool, Py_True)
+ OP_ARG(NEWFALSE, load_bool, Py_False)
+
+ case STOP:
+ break;
+
+ default:
+ {
+ unsigned char c = (unsigned char) *s;
+ if (0x20 <= c && c <= 0x7e && c != '\'' && c != '\\') {
+ PyErr_Format(st->UnpicklingError,
+ "invalid load key, '%c'.", c);
+ }
+ else {
+ PyErr_Format(st->UnpicklingError,
+ "invalid load key, '\\x%02x'.", c);
+ }
+ return NULL;
+ }
+ }
+
+ break; /* and we are done! */
+ }
+
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+
+ if (_Unpickler_SkipConsumed(self) < 0)
+ return NULL;
+
+ PDATA_POP(st, self->stack, value);
+ return value;
+}
+
+/*[clinic input]
+
+_pickle.Unpickler.load
+
+ cls: defining_class
+
+Load a pickle.
+
+Read a pickled object representation from the open file object given
+in the constructor, and return the reconstituted object hierarchy
+specified therein.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_Unpickler_load_impl(UnpicklerObject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=cc88168f608e3007 input=f5d2f87e61d5f07f]*/
+{
+ UnpicklerObject *unpickler = (UnpicklerObject*)self;
+
+ PickleState *st = _Pickle_GetStateByClass(cls);
+
+ /* Check whether the Unpickler was initialized correctly. This prevents
+ segfaulting if a subclass overridden __init__ with a function that does
+ not call Unpickler.__init__(). Here, we simply ensure that self->read
+ is not NULL. */
+ if (unpickler->read == NULL) {
+ PyErr_Format(st->UnpicklingError,
+ "Unpickler.__init__() was not called by %s.__init__()",
+ Py_TYPE(unpickler)->tp_name);
+ return NULL;
+ }
+
+ return load(st, unpickler);
+}
+
+/* The name of find_class() is misleading. In newer pickle protocols, this
+ function is used for loading any global (i.e., functions), not just
+ classes. The name is kept only for backward compatibility. */
+
+/*[clinic input]
+
+_pickle.Unpickler.find_class
+
+ cls: defining_class
+ module_name: object
+ global_name: object
+ /
+
+Return an object from a specified module.
+
+If necessary, the module will be imported. Subclasses may override
+this method (e.g. to restrict unpickling of arbitrary classes and
+functions).
+
+This method is called whenever a class or a function object is
+needed. Both arguments passed are str objects.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_Unpickler_find_class_impl(UnpicklerObject *self, PyTypeObject *cls,
+ PyObject *module_name,
+ PyObject *global_name)
+/*[clinic end generated code: output=99577948abb0be81 input=9577745719219fc7]*/
+{
+ PyObject *global;
+ PyObject *module;
+
+ if (PySys_Audit("pickle.find_class", "OO",
+ module_name, global_name) < 0) {
+ return NULL;
+ }
+
+ /* Try to map the old names used in Python 2.x to the new ones used in
+ Python 3.x. We do this only with old pickle protocols and when the
+ user has not disabled the feature. */
+ if (self->proto < 3 && self->fix_imports) {
+ PyObject *key;
+ PyObject *item;
+ PickleState *st = _Pickle_GetStateByClass(cls);
+
+ /* Check if the global (i.e., a function or a class) was renamed
+ or moved to another module. */
+ key = PyTuple_Pack(2, module_name, global_name);
+ if (key == NULL)
+ return NULL;
+ item = PyDict_GetItemWithError(st->name_mapping_2to3, key);
+ Py_DECREF(key);
+ if (item) {
+ if (!PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.NAME_MAPPING values should be "
+ "2-tuples, not %.200s", Py_TYPE(item)->tp_name);
+ return NULL;
+ }
+ module_name = PyTuple_GET_ITEM(item, 0);
+ global_name = PyTuple_GET_ITEM(item, 1);
+ if (!PyUnicode_Check(module_name) ||
+ !PyUnicode_Check(global_name)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.NAME_MAPPING values should be "
+ "pairs of str, not (%.200s, %.200s)",
+ Py_TYPE(module_name)->tp_name,
+ Py_TYPE(global_name)->tp_name);
+ return NULL;
+ }
+ }
+ else if (PyErr_Occurred()) {
+ return NULL;
+ }
+ else {
+ /* Check if the module was renamed. */
+ item = PyDict_GetItemWithError(st->import_mapping_2to3, module_name);
+ if (item) {
+ if (!PyUnicode_Check(item)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.IMPORT_MAPPING values should be "
+ "strings, not %.200s", Py_TYPE(item)->tp_name);
+ return NULL;
+ }
+ module_name = item;
+ }
+ else if (PyErr_Occurred()) {
+ return NULL;
+ }
+ }
+ }
+
+ /*
+ * we don't use PyImport_GetModule here, because it can return partially-
+ * initialised modules, which then cause the getattribute to fail.
+ */
+ module = PyImport_Import(module_name);
+ if (module == NULL) {
+ return NULL;
+ }
+ global = getattribute(module, global_name, self->proto >= 4);
+ Py_DECREF(module);
+ return global;
+}
+
+/*[clinic input]
+
+_pickle.Unpickler.__sizeof__ -> size_t
+
+Returns size in memory, in bytes.
+[clinic start generated code]*/
+
+static size_t
+_pickle_Unpickler___sizeof___impl(UnpicklerObject *self)
+/*[clinic end generated code: output=4648d84c228196df input=27180b2b6b524012]*/
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(self));
+ if (self->memo != NULL)
+ res += self->memo_size * sizeof(PyObject *);
+ if (self->marks != NULL)
+ res += (size_t)self->marks_size * sizeof(Py_ssize_t);
+ if (self->input_line != NULL)
+ res += strlen(self->input_line) + 1;
+ if (self->encoding != NULL)
+ res += strlen(self->encoding) + 1;
+ if (self->errors != NULL)
+ res += strlen(self->errors) + 1;
+ return res;
+}
+
+static struct PyMethodDef Unpickler_methods[] = {
+ _PICKLE_UNPICKLER_LOAD_METHODDEF
+ _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF
+ _PICKLE_UNPICKLER___SIZEOF___METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+Unpickler_clear(UnpicklerObject *self)
+{
+ Py_CLEAR(self->readline);
+ Py_CLEAR(self->readinto);
+ Py_CLEAR(self->read);
+ Py_CLEAR(self->peek);
+ Py_CLEAR(self->stack);
+ Py_CLEAR(self->pers_func);
+ Py_CLEAR(self->buffers);
+ if (self->buffer.buf != NULL) {
+ PyBuffer_Release(&self->buffer);
+ self->buffer.buf = NULL;
+ }
+
+ _Unpickler_MemoCleanup(self);
+ PyMem_Free(self->marks);
+ self->marks = NULL;
+ PyMem_Free(self->input_line);
+ self->input_line = NULL;
+ PyMem_Free(self->encoding);
+ self->encoding = NULL;
+ PyMem_Free(self->errors);
+ self->errors = NULL;
+
+ return 0;
+}
+
+static void
+Unpickler_dealloc(UnpicklerObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack((PyObject *)self);
+ (void)Unpickler_clear(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+Unpickler_traverse(UnpicklerObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->readline);
+ Py_VISIT(self->readinto);
+ Py_VISIT(self->read);
+ Py_VISIT(self->peek);
+ Py_VISIT(self->stack);
+ Py_VISIT(self->pers_func);
+ Py_VISIT(self->buffers);
+ PyObject **memo = self->memo;
+ if (memo) {
+ Py_ssize_t i = self->memo_size;
+ while (--i >= 0) {
+ Py_VISIT(memo[i]);
+ }
+ }
+ return 0;
+}
+
+/*[clinic input]
+
+_pickle.Unpickler.__init__
+
+ file: object
+ *
+ fix_imports: bool = True
+ encoding: str = 'ASCII'
+ errors: str = 'strict'
+ buffers: object(c_default="NULL") = ()
+
+This takes a binary file for reading a pickle data stream.
+
+The protocol version of the pickle is detected automatically, so no
+protocol argument is needed. Bytes past the pickled object's
+representation are ignored.
+
+The argument *file* must have two methods, a read() method that takes
+an integer argument, and a readline() method that requires no
+arguments. Both methods should return bytes. Thus *file* can be a
+binary file object opened for reading, an io.BytesIO object, or any
+other custom object that meets this interface.
+
+Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
+which are used to control compatibility support for pickle stream
+generated by Python 2. If *fix_imports* is True, pickle will try to
+map the old Python 2 names to the new names used in Python 3. The
+*encoding* and *errors* tell pickle how to decode 8-bit string
+instances pickled by Python 2; these default to 'ASCII' and 'strict',
+respectively. The *encoding* can be 'bytes' to read these 8-bit
+string instances as bytes objects.
+[clinic start generated code]*/
+
+static int
+_pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file,
+ int fix_imports, const char *encoding,
+ const char *errors, PyObject *buffers)
+/*[clinic end generated code: output=09f0192649ea3f85 input=ca4c1faea9553121]*/
+{
+ /* In case of multiple __init__() calls, clear previous content. */
+ if (self->read != NULL)
+ (void)Unpickler_clear(self);
+
+ if (_Unpickler_SetInputStream(self, file) < 0)
+ return -1;
+
+ if (_Unpickler_SetInputEncoding(self, encoding, errors) < 0)
+ return -1;
+
+ if (_Unpickler_SetBuffers(self, buffers) < 0)
+ return -1;
+
+ self->fix_imports = fix_imports;
+
+ if (init_method_ref((PyObject *)self, &_Py_ID(persistent_load),
+ &self->pers_func, &self->pers_func_self) < 0)
+ {
+ return -1;
+ }
+
+ PyTypeObject *tp = Py_TYPE(self);
+ PickleState *state = _Pickle_FindStateByType(tp);
+ self->stack = (Pdata *)Pdata_New(state);
+ if (self->stack == NULL)
+ return -1;
+
+ self->memo_size = 32;
+ self->memo = _Unpickler_NewMemo(self->memo_size);
+ if (self->memo == NULL)
+ return -1;
+
+ self->proto = 0;
+
+ return 0;
+}
+
+
+/* Define a proxy object for the Unpickler's internal memo object. This is to
+ * avoid breaking code like:
+ * unpickler.memo.clear()
+ * and
+ * unpickler.memo = saved_memo
+ * Is this a good idea? Not really, but we don't want to break code that uses
+ * it. Note that we don't implement the entire mapping API here. This is
+ * intentional, as these should be treated as black-box implementation details.
+ *
+ * We do, however, have to implement pickling/unpickling support because of
+ * real-world code like cvs2svn.
+ */
+
+/*[clinic input]
+_pickle.UnpicklerMemoProxy.clear
+
+Remove all items from memo.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_UnpicklerMemoProxy_clear_impl(UnpicklerMemoProxyObject *self)
+/*[clinic end generated code: output=d20cd43f4ba1fb1f input=b1df7c52e7afd9bd]*/
+{
+ _Unpickler_MemoCleanup(self->unpickler);
+ self->unpickler->memo = _Unpickler_NewMemo(self->unpickler->memo_size);
+ if (self->unpickler->memo == NULL)
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_pickle.UnpicklerMemoProxy.copy
+
+Copy the memo to a new object.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_UnpicklerMemoProxy_copy_impl(UnpicklerMemoProxyObject *self)
+/*[clinic end generated code: output=e12af7e9bc1e4c77 input=97769247ce032c1d]*/
+{
+ size_t i;
+ PyObject *new_memo = PyDict_New();
+ if (new_memo == NULL)
+ return NULL;
+
+ for (i = 0; i < self->unpickler->memo_size; i++) {
+ int status;
+ PyObject *key, *value;
+
+ value = self->unpickler->memo[i];
+ if (value == NULL)
+ continue;
+
+ key = PyLong_FromSsize_t(i);
+ if (key == NULL)
+ goto error;
+ status = PyDict_SetItem(new_memo, key, value);
+ Py_DECREF(key);
+ if (status < 0)
+ goto error;
+ }
+ return new_memo;
+
+error:
+ Py_DECREF(new_memo);
+ return NULL;
+}
+
+/*[clinic input]
+_pickle.UnpicklerMemoProxy.__reduce__
+
+Implement pickling support.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_UnpicklerMemoProxy___reduce___impl(UnpicklerMemoProxyObject *self)
+/*[clinic end generated code: output=6da34ac048d94cca input=6920862413407199]*/
+{
+ PyObject *reduce_value;
+ PyObject *constructor_args;
+ PyObject *contents = _pickle_UnpicklerMemoProxy_copy_impl(self);
+ if (contents == NULL)
+ return NULL;
+
+ reduce_value = PyTuple_New(2);
+ if (reduce_value == NULL) {
+ Py_DECREF(contents);
+ return NULL;
+ }
+ constructor_args = PyTuple_New(1);
+ if (constructor_args == NULL) {
+ Py_DECREF(contents);
+ Py_DECREF(reduce_value);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(constructor_args, 0, contents);
+ PyTuple_SET_ITEM(reduce_value, 0, Py_NewRef(&PyDict_Type));
+ PyTuple_SET_ITEM(reduce_value, 1, constructor_args);
+ return reduce_value;
+}
+
+static PyMethodDef unpicklerproxy_methods[] = {
+ _PICKLE_UNPICKLERMEMOPROXY_CLEAR_METHODDEF
+ _PICKLE_UNPICKLERMEMOPROXY_COPY_METHODDEF
+ _PICKLE_UNPICKLERMEMOPROXY___REDUCE___METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static void
+UnpicklerMemoProxy_dealloc(UnpicklerMemoProxyObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ Py_CLEAR(self->unpickler);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+UnpicklerMemoProxy_traverse(UnpicklerMemoProxyObject *self,
+ visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->unpickler);
+ return 0;
+}
+
+static int
+UnpicklerMemoProxy_clear(UnpicklerMemoProxyObject *self)
+{
+ Py_CLEAR(self->unpickler);
+ return 0;
+}
+
+static PyType_Slot unpickler_memoproxy_slots[] = {
+ {Py_tp_dealloc, UnpicklerMemoProxy_dealloc},
+ {Py_tp_traverse, UnpicklerMemoProxy_traverse},
+ {Py_tp_clear, UnpicklerMemoProxy_clear},
+ {Py_tp_methods, unpicklerproxy_methods},
+ {Py_tp_hash, PyObject_HashNotImplemented},
+ {0, NULL},
+};
+
+static PyType_Spec unpickler_memoproxy_spec = {
+ .name = "_pickle.UnpicklerMemoProxy",
+ .basicsize = sizeof(UnpicklerMemoProxyObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = unpickler_memoproxy_slots,
+};
+
+static PyObject *
+UnpicklerMemoProxy_New(UnpicklerObject *unpickler)
+{
+ PickleState *state = _Pickle_FindStateByType(Py_TYPE(unpickler));
+ UnpicklerMemoProxyObject *self;
+ self = PyObject_GC_New(UnpicklerMemoProxyObject,
+ state->UnpicklerMemoProxyType);
+ if (self == NULL)
+ return NULL;
+ self->unpickler = (UnpicklerObject*)Py_NewRef(unpickler);
+ PyObject_GC_Track(self);
+ return (PyObject *)self;
+}
+
+/*****************************************************************************/
+
+
+static PyObject *
+Unpickler_get_memo(UnpicklerObject *self, void *Py_UNUSED(ignored))
+{
+ return UnpicklerMemoProxy_New(self);
+}
+
+static int
+Unpickler_set_memo(UnpicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored))
+{
+ PyObject **new_memo;
+ size_t new_memo_size = 0;
+
+ if (obj == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "attribute deletion is not supported");
+ return -1;
+ }
+
+ PickleState *state = _Pickle_FindStateByType(Py_TYPE(self));
+ if (Py_IS_TYPE(obj, state->UnpicklerMemoProxyType)) {
+ UnpicklerObject *unpickler =
+ ((UnpicklerMemoProxyObject *)obj)->unpickler;
+
+ new_memo_size = unpickler->memo_size;
+ new_memo = _Unpickler_NewMemo(new_memo_size);
+ if (new_memo == NULL)
+ return -1;
+
+ for (size_t i = 0; i < new_memo_size; i++) {
+ new_memo[i] = Py_XNewRef(unpickler->memo[i]);
+ }
+ }
+ else if (PyDict_Check(obj)) {
+ Py_ssize_t i = 0;
+ PyObject *key, *value;
+
+ new_memo_size = PyDict_GET_SIZE(obj);
+ new_memo = _Unpickler_NewMemo(new_memo_size);
+ if (new_memo == NULL)
+ return -1;
+
+ while (PyDict_Next(obj, &i, &key, &value)) {
+ Py_ssize_t idx;
+ if (!PyLong_Check(key)) {
+ PyErr_SetString(PyExc_TypeError,
+ "memo key must be integers");
+ goto error;
+ }
+ idx = PyLong_AsSsize_t(key);
+ if (idx == -1 && PyErr_Occurred())
+ goto error;
+ if (idx < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "memo key must be positive integers.");
+ goto error;
+ }
+ if (_Unpickler_MemoPut(self, idx, value) < 0)
+ goto error;
+ }
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "'memo' attribute must be an UnpicklerMemoProxy object "
+ "or dict, not %.200s", Py_TYPE(obj)->tp_name);
+ return -1;
+ }
+
+ _Unpickler_MemoCleanup(self);
+ self->memo_size = new_memo_size;
+ self->memo = new_memo;
+
+ return 0;
+
+ error:
+ if (new_memo_size) {
+ for (size_t i = new_memo_size - 1; i != SIZE_MAX; i--) {
+ Py_XDECREF(new_memo[i]);
+ }
+ PyMem_Free(new_memo);
+ }
+ return -1;
+}
+
+static PyObject *
+Unpickler_get_persload(UnpicklerObject *self, void *Py_UNUSED(ignored))
+{
+ if (self->pers_func == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "persistent_load");
+ return NULL;
+ }
+ return reconstruct_method(self->pers_func, self->pers_func_self);
+}
+
+static int
+Unpickler_set_persload(UnpicklerObject *self, PyObject *value, void *Py_UNUSED(ignored))
+{
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "attribute deletion is not supported");
+ return -1;
+ }
+ if (!PyCallable_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "persistent_load must be a callable taking "
+ "one argument");
+ return -1;
+ }
+
+ self->pers_func_self = NULL;
+ Py_XSETREF(self->pers_func, Py_NewRef(value));
+
+ return 0;
+}
+
+static PyGetSetDef Unpickler_getsets[] = {
+ {"memo", (getter)Unpickler_get_memo, (setter)Unpickler_set_memo},
+ {"persistent_load", (getter)Unpickler_get_persload,
+ (setter)Unpickler_set_persload},
+ {NULL}
+};
+
+static PyType_Slot unpickler_type_slots[] = {
+ {Py_tp_dealloc, Unpickler_dealloc},
+ {Py_tp_doc, (char *)_pickle_Unpickler___init____doc__},
+ {Py_tp_traverse, Unpickler_traverse},
+ {Py_tp_clear, Unpickler_clear},
+ {Py_tp_methods, Unpickler_methods},
+ {Py_tp_getset, Unpickler_getsets},
+ {Py_tp_init, _pickle_Unpickler___init__},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_new, PyType_GenericNew},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec unpickler_type_spec = {
+ .name = "_pickle.Unpickler",
+ .basicsize = sizeof(UnpicklerObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = unpickler_type_slots,
+};
+
+/*[clinic input]
+
+_pickle.dump
+
+ obj: object
+ file: object
+ protocol: object = None
+ *
+ fix_imports: bool = True
+ buffer_callback: object = None
+
+Write a pickled representation of obj to the open file object file.
+
+This is equivalent to ``Pickler(file, protocol).dump(obj)``, but may
+be more efficient.
+
+The optional *protocol* argument tells the pickler to use the given
+protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default
+protocol is 4. It was introduced in Python 3.4, and is incompatible
+with previous versions.
+
+Specifying a negative protocol version selects the highest protocol
+version supported. The higher the protocol used, the more recent the
+version of Python needed to read the pickle produced.
+
+The *file* argument must have a write() method that accepts a single
+bytes argument. It can thus be a file object opened for binary
+writing, an io.BytesIO instance, or any other custom object that meets
+this interface.
+
+If *fix_imports* is True and protocol is less than 3, pickle will try
+to map the new Python 3 names to the old module names used in Python
+2, so that the pickle data stream is readable with Python 2.
+
+If *buffer_callback* is None (the default), buffer views are serialized
+into *file* as part of the pickle stream. It is an error if
+*buffer_callback* is not None and *protocol* is None or smaller than 5.
+
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_dump_impl(PyObject *module, PyObject *obj, PyObject *file,
+ PyObject *protocol, int fix_imports,
+ PyObject *buffer_callback)
+/*[clinic end generated code: output=706186dba996490c input=5ed6653da99cd97c]*/
+{
+ PickleState *state = _Pickle_GetState(module);
+ PicklerObject *pickler = _Pickler_New(state);
+
+ if (pickler == NULL)
+ return NULL;
+
+ if (_Pickler_SetProtocol(pickler, protocol, fix_imports) < 0)
+ goto error;
+
+ if (_Pickler_SetOutputStream(pickler, file) < 0)
+ goto error;
+
+ if (_Pickler_SetBufferCallback(pickler, buffer_callback) < 0)
+ goto error;
+
+ if (dump(state, pickler, obj) < 0)
+ goto error;
+
+ if (_Pickler_FlushToFile(pickler) < 0)
+ goto error;
+
+ Py_DECREF(pickler);
+ Py_RETURN_NONE;
+
+ error:
+ Py_XDECREF(pickler);
+ return NULL;
+}
+
+/*[clinic input]
+
+_pickle.dumps
+
+ obj: object
+ protocol: object = None
+ *
+ fix_imports: bool = True
+ buffer_callback: object = None
+
+Return the pickled representation of the object as a bytes object.
+
+The optional *protocol* argument tells the pickler to use the given
+protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default
+protocol is 4. It was introduced in Python 3.4, and is incompatible
+with previous versions.
+
+Specifying a negative protocol version selects the highest protocol
+version supported. The higher the protocol used, the more recent the
+version of Python needed to read the pickle produced.
+
+If *fix_imports* is True and *protocol* is less than 3, pickle will
+try to map the new Python 3 names to the old module names used in
+Python 2, so that the pickle data stream is readable with Python 2.
+
+If *buffer_callback* is None (the default), buffer views are serialized
+into *file* as part of the pickle stream. It is an error if
+*buffer_callback* is not None and *protocol* is None or smaller than 5.
+
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_dumps_impl(PyObject *module, PyObject *obj, PyObject *protocol,
+ int fix_imports, PyObject *buffer_callback)
+/*[clinic end generated code: output=fbab0093a5580fdf input=e543272436c6f987]*/
+{
+ PyObject *result;
+ PickleState *state = _Pickle_GetState(module);
+ PicklerObject *pickler = _Pickler_New(state);
+
+ if (pickler == NULL)
+ return NULL;
+
+ if (_Pickler_SetProtocol(pickler, protocol, fix_imports) < 0)
+ goto error;
+
+ if (_Pickler_SetBufferCallback(pickler, buffer_callback) < 0)
+ goto error;
+
+ if (dump(state, pickler, obj) < 0)
+ goto error;
+
+ result = _Pickler_GetString(pickler);
+ Py_DECREF(pickler);
+ return result;
+
+ error:
+ Py_XDECREF(pickler);
+ return NULL;
+}
+
+/*[clinic input]
+
+_pickle.load
+
+ file: object
+ *
+ fix_imports: bool = True
+ encoding: str = 'ASCII'
+ errors: str = 'strict'
+ buffers: object(c_default="NULL") = ()
+
+Read and return an object from the pickle data stored in a file.
+
+This is equivalent to ``Unpickler(file).load()``, but may be more
+efficient.
+
+The protocol version of the pickle is detected automatically, so no
+protocol argument is needed. Bytes past the pickled object's
+representation are ignored.
+
+The argument *file* must have two methods, a read() method that takes
+an integer argument, and a readline() method that requires no
+arguments. Both methods should return bytes. Thus *file* can be a
+binary file object opened for reading, an io.BytesIO object, or any
+other custom object that meets this interface.
+
+Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
+which are used to control compatibility support for pickle stream
+generated by Python 2. If *fix_imports* is True, pickle will try to
+map the old Python 2 names to the new names used in Python 3. The
+*encoding* and *errors* tell pickle how to decode 8-bit string
+instances pickled by Python 2; these default to 'ASCII' and 'strict',
+respectively. The *encoding* can be 'bytes' to read these 8-bit
+string instances as bytes objects.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_load_impl(PyObject *module, PyObject *file, int fix_imports,
+ const char *encoding, const char *errors,
+ PyObject *buffers)
+/*[clinic end generated code: output=250452d141c23e76 input=46c7c31c92f4f371]*/
+{
+ PyObject *result;
+ UnpicklerObject *unpickler = _Unpickler_New(module);
+
+ if (unpickler == NULL)
+ return NULL;
+
+ if (_Unpickler_SetInputStream(unpickler, file) < 0)
+ goto error;
+
+ if (_Unpickler_SetInputEncoding(unpickler, encoding, errors) < 0)
+ goto error;
+
+ if (_Unpickler_SetBuffers(unpickler, buffers) < 0)
+ goto error;
+
+ unpickler->fix_imports = fix_imports;
+
+ PickleState *state = _Pickle_GetState(module);
+ result = load(state, unpickler);
+ Py_DECREF(unpickler);
+ return result;
+
+ error:
+ Py_XDECREF(unpickler);
+ return NULL;
+}
+
+/*[clinic input]
+
+_pickle.loads
+
+ data: object
+ /
+ *
+ fix_imports: bool = True
+ encoding: str = 'ASCII'
+ errors: str = 'strict'
+ buffers: object(c_default="NULL") = ()
+
+Read and return an object from the given pickle data.
+
+The protocol version of the pickle is detected automatically, so no
+protocol argument is needed. Bytes past the pickled object's
+representation are ignored.
+
+Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
+which are used to control compatibility support for pickle stream
+generated by Python 2. If *fix_imports* is True, pickle will try to
+map the old Python 2 names to the new names used in Python 3. The
+*encoding* and *errors* tell pickle how to decode 8-bit string
+instances pickled by Python 2; these default to 'ASCII' and 'strict',
+respectively. The *encoding* can be 'bytes' to read these 8-bit
+string instances as bytes objects.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_loads_impl(PyObject *module, PyObject *data, int fix_imports,
+ const char *encoding, const char *errors,
+ PyObject *buffers)
+/*[clinic end generated code: output=82ac1e6b588e6d02 input=b3615540d0535087]*/
+{
+ PyObject *result;
+ UnpicklerObject *unpickler = _Unpickler_New(module);
+
+ if (unpickler == NULL)
+ return NULL;
+
+ if (_Unpickler_SetStringInput(unpickler, data) < 0)
+ goto error;
+
+ if (_Unpickler_SetInputEncoding(unpickler, encoding, errors) < 0)
+ goto error;
+
+ if (_Unpickler_SetBuffers(unpickler, buffers) < 0)
+ goto error;
+
+ unpickler->fix_imports = fix_imports;
+
+ PickleState *state = _Pickle_GetState(module);
+ result = load(state, unpickler);
+ Py_DECREF(unpickler);
+ return result;
+
+ error:
+ Py_XDECREF(unpickler);
+ return NULL;
+}
+
+static struct PyMethodDef pickle_methods[] = {
+ _PICKLE_DUMP_METHODDEF
+ _PICKLE_DUMPS_METHODDEF
+ _PICKLE_LOAD_METHODDEF
+ _PICKLE_LOADS_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+pickle_clear(PyObject *m)
+{
+ _Pickle_ClearState(_Pickle_GetState(m));
+ return 0;
+}
+
+static void
+pickle_free(PyObject *m)
+{
+ _Pickle_ClearState(_Pickle_GetState(m));
+}
+
+static int
+pickle_traverse(PyObject *m, visitproc visit, void *arg)
+{
+ PickleState *st = _Pickle_GetState(m);
+ Py_VISIT(st->PickleError);
+ Py_VISIT(st->PicklingError);
+ Py_VISIT(st->UnpicklingError);
+ Py_VISIT(st->dispatch_table);
+ Py_VISIT(st->extension_registry);
+ Py_VISIT(st->extension_cache);
+ Py_VISIT(st->inverted_registry);
+ Py_VISIT(st->name_mapping_2to3);
+ Py_VISIT(st->import_mapping_2to3);
+ Py_VISIT(st->name_mapping_3to2);
+ Py_VISIT(st->import_mapping_3to2);
+ Py_VISIT(st->codecs_encode);
+ Py_VISIT(st->getattr);
+ Py_VISIT(st->partial);
+ Py_VISIT(st->Pickler_Type);
+ Py_VISIT(st->Unpickler_Type);
+ Py_VISIT(st->Pdata_Type);
+ Py_VISIT(st->PicklerMemoProxyType);
+ Py_VISIT(st->UnpicklerMemoProxyType);
+ return 0;
+}
+
+static int
+_pickle_exec(PyObject *m)
+{
+ PickleState *st = _Pickle_GetState(m);
+
+#define CREATE_TYPE(mod, type, spec) \
+ do { \
+ type = (PyTypeObject *)PyType_FromMetaclass(NULL, mod, spec, NULL); \
+ if (type == NULL) { \
+ return -1; \
+ } \
+ } while (0)
+
+ CREATE_TYPE(m, st->Pdata_Type, &pdata_spec);
+ CREATE_TYPE(m, st->PicklerMemoProxyType, &memoproxy_spec);
+ CREATE_TYPE(m, st->UnpicklerMemoProxyType, &unpickler_memoproxy_spec);
+ CREATE_TYPE(m, st->Pickler_Type, &pickler_type_spec);
+ CREATE_TYPE(m, st->Unpickler_Type, &unpickler_type_spec);
+
+#undef CREATE_TYPE
+
+ /* Add types */
+ if (PyModule_AddType(m, &PyPickleBuffer_Type) < 0) {
+ return -1;
+ }
+ if (PyModule_AddType(m, st->Pickler_Type) < 0) {
+ return -1;
+ }
+ if (PyModule_AddType(m, st->Unpickler_Type) < 0) {
+ return -1;
+ }
+
+ /* Initialize the exceptions. */
+ st->PickleError = PyErr_NewException("_pickle.PickleError", NULL, NULL);
+ if (st->PickleError == NULL)
+ return -1;
+ st->PicklingError = \
+ PyErr_NewException("_pickle.PicklingError", st->PickleError, NULL);
+ if (st->PicklingError == NULL)
+ return -1;
+ st->UnpicklingError = \
+ PyErr_NewException("_pickle.UnpicklingError", st->PickleError, NULL);
+ if (st->UnpicklingError == NULL)
+ return -1;
+
+ if (PyModule_AddObjectRef(m, "PickleError", st->PickleError) < 0) {
+ return -1;
+ }
+ if (PyModule_AddObjectRef(m, "PicklingError", st->PicklingError) < 0) {
+ return -1;
+ }
+ if (PyModule_AddObjectRef(m, "UnpicklingError", st->UnpicklingError) < 0) {
+ return -1;
+ }
+
+ if (_Pickle_InitState(st) < 0)
+ return -1;
+
+ return 0;
+}
+
+static PyModuleDef_Slot pickle_slots[] = {
+ {Py_mod_exec, _pickle_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL},
+};
+
+static struct PyModuleDef _picklemodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_pickle",
+ .m_doc = pickle_module_doc,
+ .m_size = sizeof(PickleState),
+ .m_methods = pickle_methods,
+ .m_slots = pickle_slots,
+ .m_traverse = pickle_traverse,
+ .m_clear = pickle_clear,
+ .m_free = (freefunc)pickle_free,
+};
+
+PyMODINIT_FUNC
+PyInit__pickle(void)
+{
+ return PyModuleDef_Init(&_picklemodule);
+}
diff --git a/contrib/tools/python3/src/Modules/_posixsubprocess.c b/contrib/tools/python3/Modules/_posixsubprocess.c
index d75bb92757c..d75bb92757c 100644
--- a/contrib/tools/python3/src/Modules/_posixsubprocess.c
+++ b/contrib/tools/python3/Modules/_posixsubprocess.c
diff --git a/contrib/tools/python3/src/Modules/_queuemodule.c b/contrib/tools/python3/Modules/_queuemodule.c
index db5be842b8a..db5be842b8a 100644
--- a/contrib/tools/python3/src/Modules/_queuemodule.c
+++ b/contrib/tools/python3/Modules/_queuemodule.c
diff --git a/contrib/tools/python3/src/Modules/_randommodule.c b/contrib/tools/python3/Modules/_randommodule.c
index fda5ef267fb..fda5ef267fb 100644
--- a/contrib/tools/python3/src/Modules/_randommodule.c
+++ b/contrib/tools/python3/Modules/_randommodule.c
diff --git a/contrib/tools/python3/src/Modules/_scproxy.c b/contrib/tools/python3/Modules/_scproxy.c
index 0df0324df55..0df0324df55 100644
--- a/contrib/tools/python3/src/Modules/_scproxy.c
+++ b/contrib/tools/python3/Modules/_scproxy.c
diff --git a/contrib/tools/python3/src/Modules/_sqlite/blob.c b/contrib/tools/python3/Modules/_sqlite/blob.c
index 76d261baf00..76d261baf00 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/blob.c
+++ b/contrib/tools/python3/Modules/_sqlite/blob.c
diff --git a/contrib/tools/python3/src/Modules/_sqlite/blob.h b/contrib/tools/python3/Modules/_sqlite/blob.h
index 418ca03bdb5..418ca03bdb5 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/blob.h
+++ b/contrib/tools/python3/Modules/_sqlite/blob.h
diff --git a/contrib/tools/python3/src/Modules/_sqlite/clinic/blob.c.h b/contrib/tools/python3/Modules/_sqlite/clinic/blob.c.h
index f3d8a35be46..f3d8a35be46 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/clinic/blob.c.h
+++ b/contrib/tools/python3/Modules/_sqlite/clinic/blob.c.h
diff --git a/contrib/tools/python3/src/Modules/_sqlite/clinic/connection.c.h b/contrib/tools/python3/Modules/_sqlite/clinic/connection.c.h
index 417abcc4626..417abcc4626 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/clinic/connection.c.h
+++ b/contrib/tools/python3/Modules/_sqlite/clinic/connection.c.h
diff --git a/contrib/tools/python3/src/Modules/_sqlite/clinic/cursor.c.h b/contrib/tools/python3/Modules/_sqlite/clinic/cursor.c.h
index 43e912d1347..43e912d1347 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/clinic/cursor.c.h
+++ b/contrib/tools/python3/Modules/_sqlite/clinic/cursor.c.h
diff --git a/contrib/tools/python3/src/Modules/_sqlite/clinic/module.c.h b/contrib/tools/python3/Modules/_sqlite/clinic/module.c.h
index 12f60835880..12f60835880 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/clinic/module.c.h
+++ b/contrib/tools/python3/Modules/_sqlite/clinic/module.c.h
diff --git a/contrib/tools/python3/src/Modules/_sqlite/clinic/row.c.h b/contrib/tools/python3/Modules/_sqlite/clinic/row.c.h
index 89a48fd52da..89a48fd52da 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/clinic/row.c.h
+++ b/contrib/tools/python3/Modules/_sqlite/clinic/row.c.h
diff --git a/contrib/tools/python3/src/Modules/_sqlite/connection.c b/contrib/tools/python3/Modules/_sqlite/connection.c
index 12e5c135aaf..12e5c135aaf 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/connection.c
+++ b/contrib/tools/python3/Modules/_sqlite/connection.c
diff --git a/contrib/tools/python3/src/Modules/_sqlite/connection.h b/contrib/tools/python3/Modules/_sqlite/connection.h
index 1df92065a58..1df92065a58 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/connection.h
+++ b/contrib/tools/python3/Modules/_sqlite/connection.h
diff --git a/contrib/tools/python3/src/Modules/_sqlite/cursor.c b/contrib/tools/python3/Modules/_sqlite/cursor.c
index caeedbddb8d..caeedbddb8d 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/cursor.c
+++ b/contrib/tools/python3/Modules/_sqlite/cursor.c
diff --git a/contrib/tools/python3/src/Modules/_sqlite/cursor.h b/contrib/tools/python3/Modules/_sqlite/cursor.h
index 0bcdddc3e29..0bcdddc3e29 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/cursor.h
+++ b/contrib/tools/python3/Modules/_sqlite/cursor.h
diff --git a/contrib/tools/python3/src/Modules/_sqlite/microprotocols.c b/contrib/tools/python3/Modules/_sqlite/microprotocols.c
index 148220d0f91..148220d0f91 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/microprotocols.c
+++ b/contrib/tools/python3/Modules/_sqlite/microprotocols.c
diff --git a/contrib/tools/python3/src/Modules/_sqlite/microprotocols.h b/contrib/tools/python3/Modules/_sqlite/microprotocols.h
index 6bde9d01f45..6bde9d01f45 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/microprotocols.h
+++ b/contrib/tools/python3/Modules/_sqlite/microprotocols.h
diff --git a/contrib/tools/python3/src/Modules/_sqlite/module.c b/contrib/tools/python3/Modules/_sqlite/module.c
index 27bd42f4595..27bd42f4595 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/module.c
+++ b/contrib/tools/python3/Modules/_sqlite/module.c
diff --git a/contrib/tools/python3/src/Modules/_sqlite/module.h b/contrib/tools/python3/Modules/_sqlite/module.h
index daa22091d38..daa22091d38 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/module.h
+++ b/contrib/tools/python3/Modules/_sqlite/module.h
diff --git a/contrib/tools/python3/src/Modules/_sqlite/prepare_protocol.c b/contrib/tools/python3/Modules/_sqlite/prepare_protocol.c
index 44533225665..44533225665 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/prepare_protocol.c
+++ b/contrib/tools/python3/Modules/_sqlite/prepare_protocol.c
diff --git a/contrib/tools/python3/src/Modules/_sqlite/prepare_protocol.h b/contrib/tools/python3/Modules/_sqlite/prepare_protocol.h
index afc55a8c1c4..afc55a8c1c4 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/prepare_protocol.h
+++ b/contrib/tools/python3/Modules/_sqlite/prepare_protocol.h
diff --git a/contrib/tools/python3/src/Modules/_sqlite/row.c b/contrib/tools/python3/Modules/_sqlite/row.c
index 1a1943285ce..1a1943285ce 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/row.c
+++ b/contrib/tools/python3/Modules/_sqlite/row.c
diff --git a/contrib/tools/python3/src/Modules/_sqlite/row.h b/contrib/tools/python3/Modules/_sqlite/row.h
index b5190981758..b5190981758 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/row.h
+++ b/contrib/tools/python3/Modules/_sqlite/row.h
diff --git a/contrib/tools/python3/src/Modules/_sqlite/statement.c b/contrib/tools/python3/Modules/_sqlite/statement.c
index 229bfc3b504..229bfc3b504 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/statement.c
+++ b/contrib/tools/python3/Modules/_sqlite/statement.c
diff --git a/contrib/tools/python3/src/Modules/_sqlite/statement.h b/contrib/tools/python3/Modules/_sqlite/statement.h
index 11a6464b1a1..11a6464b1a1 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/statement.h
+++ b/contrib/tools/python3/Modules/_sqlite/statement.h
diff --git a/contrib/tools/python3/src/Modules/_sqlite/util.c b/contrib/tools/python3/Modules/_sqlite/util.c
index 2b3bbfefa3c..2b3bbfefa3c 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/util.c
+++ b/contrib/tools/python3/Modules/_sqlite/util.c
diff --git a/contrib/tools/python3/src/Modules/_sqlite/util.h b/contrib/tools/python3/Modules/_sqlite/util.h
index a22bcd82d2a..a22bcd82d2a 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/util.h
+++ b/contrib/tools/python3/Modules/_sqlite/util.h
diff --git a/contrib/tools/python3/Modules/_sqlite/ya.make b/contrib/tools/python3/Modules/_sqlite/ya.make
new file mode 100644
index 00000000000..c8e770686f0
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/ya.make
@@ -0,0 +1,47 @@
+# Generated by devtools/yamaker.
+
+LIBRARY()
+
+VERSION(3.12.2)
+
+ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.12.2.tar.gz)
+
+LICENSE(Python-2.0)
+
+PEERDIR(
+ contrib/libs/sqlite3
+)
+
+ADDINCL(
+ contrib/libs/sqlite3
+ contrib/tools/python3/Include
+ contrib/tools/python3/Include/internal
+)
+
+PYTHON3_ADDINCL()
+
+NO_COMPILER_WARNINGS()
+
+NO_RUNTIME()
+
+CFLAGS(
+ -DMODULE_NAME=sqlite3
+)
+
+SRCS(
+ blob.c
+ connection.c
+ cursor.c
+ microprotocols.c
+ module.c
+ prepare_protocol.c
+ row.c
+ statement.c
+ util.c
+)
+
+PY_REGISTER(
+ _sqlite3
+)
+
+END()
diff --git a/contrib/tools/python3/src/Modules/_sre/clinic/sre.c.h b/contrib/tools/python3/Modules/_sre/clinic/sre.c.h
index 529c634e76d..529c634e76d 100644
--- a/contrib/tools/python3/src/Modules/_sre/clinic/sre.c.h
+++ b/contrib/tools/python3/Modules/_sre/clinic/sre.c.h
diff --git a/contrib/tools/python3/src/Modules/_sre/sre.c b/contrib/tools/python3/Modules/_sre/sre.c
index 0547390454a..0547390454a 100644
--- a/contrib/tools/python3/src/Modules/_sre/sre.c
+++ b/contrib/tools/python3/Modules/_sre/sre.c
diff --git a/contrib/tools/python3/src/Modules/_sre/sre.h b/contrib/tools/python3/Modules/_sre/sre.h
index a0f235606e2..a0f235606e2 100644
--- a/contrib/tools/python3/src/Modules/_sre/sre.h
+++ b/contrib/tools/python3/Modules/_sre/sre.h
diff --git a/contrib/tools/python3/src/Modules/_sre/sre_constants.h b/contrib/tools/python3/Modules/_sre/sre_constants.h
index b5692292f65..b5692292f65 100644
--- a/contrib/tools/python3/src/Modules/_sre/sre_constants.h
+++ b/contrib/tools/python3/Modules/_sre/sre_constants.h
diff --git a/contrib/tools/python3/src/Modules/_sre/sre_lib.h b/contrib/tools/python3/Modules/_sre/sre_lib.h
index 95c1ada908d..95c1ada908d 100644
--- a/contrib/tools/python3/src/Modules/_sre/sre_lib.h
+++ b/contrib/tools/python3/Modules/_sre/sre_lib.h
diff --git a/contrib/tools/python3/src/Modules/_sre/sre_targets.h b/contrib/tools/python3/Modules/_sre/sre_targets.h
index 62761a0000d..62761a0000d 100644
--- a/contrib/tools/python3/src/Modules/_sre/sre_targets.h
+++ b/contrib/tools/python3/Modules/_sre/sre_targets.h
diff --git a/contrib/tools/python3/src/Modules/_ssl.c b/contrib/tools/python3/Modules/_ssl.c
index 7b4e9b5d696..7b4e9b5d696 100644
--- a/contrib/tools/python3/src/Modules/_ssl.c
+++ b/contrib/tools/python3/Modules/_ssl.c
diff --git a/contrib/tools/python3/src/Modules/_ssl.h b/contrib/tools/python3/Modules/_ssl.h
index 22d93ddcc6d..22d93ddcc6d 100644
--- a/contrib/tools/python3/src/Modules/_ssl.h
+++ b/contrib/tools/python3/Modules/_ssl.h
diff --git a/contrib/tools/python3/src/Modules/_ssl/cert.c b/contrib/tools/python3/Modules/_ssl/cert.c
index bda66dc4d94..bda66dc4d94 100644
--- a/contrib/tools/python3/src/Modules/_ssl/cert.c
+++ b/contrib/tools/python3/Modules/_ssl/cert.c
diff --git a/contrib/tools/python3/src/Modules/_ssl/clinic/cert.c.h b/contrib/tools/python3/Modules/_ssl/clinic/cert.c.h
index a052ab2086f..a052ab2086f 100644
--- a/contrib/tools/python3/src/Modules/_ssl/clinic/cert.c.h
+++ b/contrib/tools/python3/Modules/_ssl/clinic/cert.c.h
diff --git a/contrib/tools/python3/src/Modules/_ssl/debughelpers.c b/contrib/tools/python3/Modules/_ssl/debughelpers.c
index a81f0aad05a..a81f0aad05a 100644
--- a/contrib/tools/python3/src/Modules/_ssl/debughelpers.c
+++ b/contrib/tools/python3/Modules/_ssl/debughelpers.c
diff --git a/contrib/tools/python3/src/Modules/_ssl/misc.c b/contrib/tools/python3/Modules/_ssl/misc.c
index 4de091d57ef..4de091d57ef 100644
--- a/contrib/tools/python3/src/Modules/_ssl/misc.c
+++ b/contrib/tools/python3/Modules/_ssl/misc.c
diff --git a/contrib/tools/python3/src/Modules/_ssl_data.h b/contrib/tools/python3/Modules/_ssl_data.h
index 8f2994f52df..8f2994f52df 100644
--- a/contrib/tools/python3/src/Modules/_ssl_data.h
+++ b/contrib/tools/python3/Modules/_ssl_data.h
diff --git a/contrib/tools/python3/src/Modules/_ssl_data_111.h b/contrib/tools/python3/Modules/_ssl_data_111.h
index 093c786e6a2..093c786e6a2 100644
--- a/contrib/tools/python3/src/Modules/_ssl_data_111.h
+++ b/contrib/tools/python3/Modules/_ssl_data_111.h
diff --git a/contrib/tools/python3/src/Modules/_ssl_data_300.h b/contrib/tools/python3/Modules/_ssl_data_300.h
index dc66731f6b6..dc66731f6b6 100644
--- a/contrib/tools/python3/src/Modules/_ssl_data_300.h
+++ b/contrib/tools/python3/Modules/_ssl_data_300.h
diff --git a/contrib/tools/python3/src/Modules/_ssl_data_31.h b/contrib/tools/python3/Modules/_ssl_data_31.h
index c589c501f4e..c589c501f4e 100644
--- a/contrib/tools/python3/src/Modules/_ssl_data_31.h
+++ b/contrib/tools/python3/Modules/_ssl_data_31.h
diff --git a/contrib/tools/python3/src/Modules/_stat.c b/contrib/tools/python3/Modules/_stat.c
index 4ec2bd25183..4ec2bd25183 100644
--- a/contrib/tools/python3/src/Modules/_stat.c
+++ b/contrib/tools/python3/Modules/_stat.c
diff --git a/contrib/tools/python3/src/Modules/_statisticsmodule.c b/contrib/tools/python3/Modules/_statisticsmodule.c
index 1d5465fbe6d..1d5465fbe6d 100644
--- a/contrib/tools/python3/src/Modules/_statisticsmodule.c
+++ b/contrib/tools/python3/Modules/_statisticsmodule.c
diff --git a/contrib/tools/python3/src/Modules/_struct.c b/contrib/tools/python3/Modules/_struct.c
index 55efc0c6cfe..55efc0c6cfe 100644
--- a/contrib/tools/python3/src/Modules/_struct.c
+++ b/contrib/tools/python3/Modules/_struct.c
diff --git a/contrib/tools/python3/src/Modules/_threadmodule.c b/contrib/tools/python3/Modules/_threadmodule.c
index 568fe8375d1..568fe8375d1 100644
--- a/contrib/tools/python3/src/Modules/_threadmodule.c
+++ b/contrib/tools/python3/Modules/_threadmodule.c
diff --git a/contrib/tools/python3/src/Modules/_tracemalloc.c b/contrib/tools/python3/Modules/_tracemalloc.c
index f3f4af9aba0..f3f4af9aba0 100644
--- a/contrib/tools/python3/src/Modules/_tracemalloc.c
+++ b/contrib/tools/python3/Modules/_tracemalloc.c
diff --git a/contrib/tools/python3/src/Modules/_typingmodule.c b/contrib/tools/python3/Modules/_typingmodule.c
index 39a124a26ad..39a124a26ad 100644
--- a/contrib/tools/python3/src/Modules/_typingmodule.c
+++ b/contrib/tools/python3/Modules/_typingmodule.c
diff --git a/contrib/tools/python3/src/Modules/_weakref.c b/contrib/tools/python3/Modules/_weakref.c
index 387b8fa9d0a..387b8fa9d0a 100644
--- a/contrib/tools/python3/src/Modules/_weakref.c
+++ b/contrib/tools/python3/Modules/_weakref.c
diff --git a/contrib/tools/python3/src/Modules/_winapi.c b/contrib/tools/python3/Modules/_winapi.c
index 2784a815696..2784a815696 100644
--- a/contrib/tools/python3/src/Modules/_winapi.c
+++ b/contrib/tools/python3/Modules/_winapi.c
diff --git a/contrib/tools/python3/src/Modules/_xxinterpchannelsmodule.c b/contrib/tools/python3/Modules/_xxinterpchannelsmodule.c
index 6bee11c1218..6bee11c1218 100644
--- a/contrib/tools/python3/src/Modules/_xxinterpchannelsmodule.c
+++ b/contrib/tools/python3/Modules/_xxinterpchannelsmodule.c
diff --git a/contrib/tools/python3/src/Modules/_xxsubinterpretersmodule.c b/contrib/tools/python3/Modules/_xxsubinterpretersmodule.c
index c0958c65dd0..c0958c65dd0 100644
--- a/contrib/tools/python3/src/Modules/_xxsubinterpretersmodule.c
+++ b/contrib/tools/python3/Modules/_xxsubinterpretersmodule.c
diff --git a/contrib/tools/python3/src/Modules/_xxtestfuzz/_xxtestfuzz.c b/contrib/tools/python3/Modules/_xxtestfuzz/_xxtestfuzz.c
index e0694de6719..e0694de6719 100644
--- a/contrib/tools/python3/src/Modules/_xxtestfuzz/_xxtestfuzz.c
+++ b/contrib/tools/python3/Modules/_xxtestfuzz/_xxtestfuzz.c
diff --git a/contrib/tools/python3/src/Modules/_xxtestfuzz/fuzzer.c b/contrib/tools/python3/Modules/_xxtestfuzz/fuzzer.c
index cd97206d181..cd97206d181 100644
--- a/contrib/tools/python3/src/Modules/_xxtestfuzz/fuzzer.c
+++ b/contrib/tools/python3/Modules/_xxtestfuzz/fuzzer.c
diff --git a/contrib/tools/python3/src/Modules/_zoneinfo.c b/contrib/tools/python3/Modules/_zoneinfo.c
index 8fc86162410..8fc86162410 100644
--- a/contrib/tools/python3/src/Modules/_zoneinfo.c
+++ b/contrib/tools/python3/Modules/_zoneinfo.c
diff --git a/contrib/tools/python3/src/Modules/addrinfo.h b/contrib/tools/python3/Modules/addrinfo.h
index 66e5a795f86..66e5a795f86 100644
--- a/contrib/tools/python3/src/Modules/addrinfo.h
+++ b/contrib/tools/python3/Modules/addrinfo.h
diff --git a/contrib/tools/python3/src/Modules/arraymodule.c b/contrib/tools/python3/Modules/arraymodule.c
index 6680820d8e6..6680820d8e6 100644
--- a/contrib/tools/python3/src/Modules/arraymodule.c
+++ b/contrib/tools/python3/Modules/arraymodule.c
diff --git a/contrib/tools/python3/src/Modules/atexitmodule.c b/contrib/tools/python3/Modules/atexitmodule.c
index 5882d405636..5882d405636 100644
--- a/contrib/tools/python3/src/Modules/atexitmodule.c
+++ b/contrib/tools/python3/Modules/atexitmodule.c
diff --git a/contrib/tools/python3/src/Modules/audioop.c b/contrib/tools/python3/Modules/audioop.c
index 94e82f1c2e6..94e82f1c2e6 100644
--- a/contrib/tools/python3/src/Modules/audioop.c
+++ b/contrib/tools/python3/Modules/audioop.c
diff --git a/contrib/tools/python3/src/Modules/binascii.c b/contrib/tools/python3/Modules/binascii.c
index 0614edf4bc0..0614edf4bc0 100644
--- a/contrib/tools/python3/src/Modules/binascii.c
+++ b/contrib/tools/python3/Modules/binascii.c
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_cn.c b/contrib/tools/python3/Modules/cjkcodecs/_codecs_cn.c
index e2c7908c9bb..e2c7908c9bb 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_cn.c
+++ b/contrib/tools/python3/Modules/cjkcodecs/_codecs_cn.c
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_hk.c b/contrib/tools/python3/Modules/cjkcodecs/_codecs_hk.c
index e7273bf18e3..e7273bf18e3 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_hk.c
+++ b/contrib/tools/python3/Modules/cjkcodecs/_codecs_hk.c
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c b/contrib/tools/python3/Modules/cjkcodecs/_codecs_iso2022.c
index e8835ad0909..e8835ad0909 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c
+++ b/contrib/tools/python3/Modules/cjkcodecs/_codecs_iso2022.c
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_jp.c b/contrib/tools/python3/Modules/cjkcodecs/_codecs_jp.c
index f7127487aa5..f7127487aa5 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_jp.c
+++ b/contrib/tools/python3/Modules/cjkcodecs/_codecs_jp.c
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_kr.c b/contrib/tools/python3/Modules/cjkcodecs/_codecs_kr.c
index fd9a9fd92db..fd9a9fd92db 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_kr.c
+++ b/contrib/tools/python3/Modules/cjkcodecs/_codecs_kr.c
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_tw.c b/contrib/tools/python3/Modules/cjkcodecs/_codecs_tw.c
index 3e440991414..3e440991414 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_tw.c
+++ b/contrib/tools/python3/Modules/cjkcodecs/_codecs_tw.c
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/alg_jisx0201.h b/contrib/tools/python3/Modules/cjkcodecs/alg_jisx0201.h
index 3034b5ab9df..3034b5ab9df 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/alg_jisx0201.h
+++ b/contrib/tools/python3/Modules/cjkcodecs/alg_jisx0201.h
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/cjkcodecs.h b/contrib/tools/python3/Modules/cjkcodecs/cjkcodecs.h
index 36bc7024df9..36bc7024df9 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/cjkcodecs.h
+++ b/contrib/tools/python3/Modules/cjkcodecs/cjkcodecs.h
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/clinic/multibytecodec.c.h b/contrib/tools/python3/Modules/cjkcodecs/clinic/multibytecodec.c.h
index 3f200405f4d..3f200405f4d 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/clinic/multibytecodec.c.h
+++ b/contrib/tools/python3/Modules/cjkcodecs/clinic/multibytecodec.c.h
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/emu_jisx0213_2000.h b/contrib/tools/python3/Modules/cjkcodecs/emu_jisx0213_2000.h
index c30c948a2b1..c30c948a2b1 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/emu_jisx0213_2000.h
+++ b/contrib/tools/python3/Modules/cjkcodecs/emu_jisx0213_2000.h
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/mappings_cn.h b/contrib/tools/python3/Modules/cjkcodecs/mappings_cn.h
index 87ca0de784a..87ca0de784a 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/mappings_cn.h
+++ b/contrib/tools/python3/Modules/cjkcodecs/mappings_cn.h
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/mappings_hk.h b/contrib/tools/python3/Modules/cjkcodecs/mappings_hk.h
index 9012ae350c4..9012ae350c4 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/mappings_hk.h
+++ b/contrib/tools/python3/Modules/cjkcodecs/mappings_hk.h
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/mappings_jisx0213_pair.h b/contrib/tools/python3/Modules/cjkcodecs/mappings_jisx0213_pair.h
index c96f20142b7..c96f20142b7 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/mappings_jisx0213_pair.h
+++ b/contrib/tools/python3/Modules/cjkcodecs/mappings_jisx0213_pair.h
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/mappings_jp.h b/contrib/tools/python3/Modules/cjkcodecs/mappings_jp.h
index 409aeae25c9..409aeae25c9 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/mappings_jp.h
+++ b/contrib/tools/python3/Modules/cjkcodecs/mappings_jp.h
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/mappings_kr.h b/contrib/tools/python3/Modules/cjkcodecs/mappings_kr.h
index bb59acccc1e..bb59acccc1e 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/mappings_kr.h
+++ b/contrib/tools/python3/Modules/cjkcodecs/mappings_kr.h
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/mappings_tw.h b/contrib/tools/python3/Modules/cjkcodecs/mappings_tw.h
index ceb4bc56a21..ceb4bc56a21 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/mappings_tw.h
+++ b/contrib/tools/python3/Modules/cjkcodecs/mappings_tw.h
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/multibytecodec.c b/contrib/tools/python3/Modules/cjkcodecs/multibytecodec.c
index b501e4fb923..b501e4fb923 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/multibytecodec.c
+++ b/contrib/tools/python3/Modules/cjkcodecs/multibytecodec.c
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/multibytecodec.h b/contrib/tools/python3/Modules/cjkcodecs/multibytecodec.h
index f59362205d2..f59362205d2 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/multibytecodec.h
+++ b/contrib/tools/python3/Modules/cjkcodecs/multibytecodec.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_abc.c.h b/contrib/tools/python3/Modules/clinic/_abc.c.h
index 2adec818c91..2adec818c91 100644
--- a/contrib/tools/python3/src/Modules/clinic/_abc.c.h
+++ b/contrib/tools/python3/Modules/clinic/_abc.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_asynciomodule.c.h b/contrib/tools/python3/Modules/clinic/_asynciomodule.c.h
index 860d55cb3bb..860d55cb3bb 100644
--- a/contrib/tools/python3/src/Modules/clinic/_asynciomodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_asynciomodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_bisectmodule.c.h b/contrib/tools/python3/Modules/clinic/_bisectmodule.c.h
index 7944f5219b0..7944f5219b0 100644
--- a/contrib/tools/python3/src/Modules/clinic/_bisectmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_bisectmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_bz2module.c.h b/contrib/tools/python3/Modules/clinic/_bz2module.c.h
index d7797d639ae..d7797d639ae 100644
--- a/contrib/tools/python3/src/Modules/clinic/_bz2module.c.h
+++ b/contrib/tools/python3/Modules/clinic/_bz2module.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_codecsmodule.c.h b/contrib/tools/python3/Modules/clinic/_codecsmodule.c.h
index f11bcc8815b..f11bcc8815b 100644
--- a/contrib/tools/python3/src/Modules/clinic/_codecsmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_codecsmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_collectionsmodule.c.h b/contrib/tools/python3/Modules/clinic/_collectionsmodule.c.h
index 3882d069216..3882d069216 100644
--- a/contrib/tools/python3/src/Modules/clinic/_collectionsmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_collectionsmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_contextvarsmodule.c.h b/contrib/tools/python3/Modules/clinic/_contextvarsmodule.c.h
index 461d4845635..461d4845635 100644
--- a/contrib/tools/python3/src/Modules/clinic/_contextvarsmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_contextvarsmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_cryptmodule.c.h b/contrib/tools/python3/Modules/clinic/_cryptmodule.c.h
index 97b70b3c17e..97b70b3c17e 100644
--- a/contrib/tools/python3/src/Modules/clinic/_cryptmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_cryptmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_csv.c.h b/contrib/tools/python3/Modules/clinic/_csv.c.h
index 8900946350a..8900946350a 100644
--- a/contrib/tools/python3/src/Modules/clinic/_csv.c.h
+++ b/contrib/tools/python3/Modules/clinic/_csv.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_datetimemodule.c.h b/contrib/tools/python3/Modules/clinic/_datetimemodule.c.h
index 51e51e3791c..51e51e3791c 100644
--- a/contrib/tools/python3/src/Modules/clinic/_datetimemodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_datetimemodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_elementtree.c.h b/contrib/tools/python3/Modules/clinic/_elementtree.c.h
index 0b3a86159cc..0b3a86159cc 100644
--- a/contrib/tools/python3/src/Modules/clinic/_elementtree.c.h
+++ b/contrib/tools/python3/Modules/clinic/_elementtree.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_functoolsmodule.c.h b/contrib/tools/python3/Modules/clinic/_functoolsmodule.c.h
index 9c79e643041..9c79e643041 100644
--- a/contrib/tools/python3/src/Modules/clinic/_functoolsmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_functoolsmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_hashopenssl.c.h b/contrib/tools/python3/Modules/clinic/_hashopenssl.c.h
index fb61a444018..fb61a444018 100644
--- a/contrib/tools/python3/src/Modules/clinic/_hashopenssl.c.h
+++ b/contrib/tools/python3/Modules/clinic/_hashopenssl.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_heapqmodule.c.h b/contrib/tools/python3/Modules/clinic/_heapqmodule.c.h
index 3ee3f51702f..3ee3f51702f 100644
--- a/contrib/tools/python3/src/Modules/clinic/_heapqmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_heapqmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_localemodule.c.h b/contrib/tools/python3/Modules/clinic/_localemodule.c.h
index e6b99962d15..e6b99962d15 100644
--- a/contrib/tools/python3/src/Modules/clinic/_localemodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_localemodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_lsprof.c.h b/contrib/tools/python3/Modules/clinic/_lsprof.c.h
index 14af6b48c67..14af6b48c67 100644
--- a/contrib/tools/python3/src/Modules/clinic/_lsprof.c.h
+++ b/contrib/tools/python3/Modules/clinic/_lsprof.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_lzmamodule.c.h b/contrib/tools/python3/Modules/clinic/_lzmamodule.c.h
index 9b396a56683..9b396a56683 100644
--- a/contrib/tools/python3/src/Modules/clinic/_lzmamodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_lzmamodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_opcode.c.h b/contrib/tools/python3/Modules/clinic/_opcode.c.h
index 3bd3ba02387..3bd3ba02387 100644
--- a/contrib/tools/python3/src/Modules/clinic/_opcode.c.h
+++ b/contrib/tools/python3/Modules/clinic/_opcode.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_operator.c.h b/contrib/tools/python3/Modules/clinic/_operator.c.h
index b68e6e0144a..b68e6e0144a 100644
--- a/contrib/tools/python3/src/Modules/clinic/_operator.c.h
+++ b/contrib/tools/python3/Modules/clinic/_operator.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_pickle.c.h b/contrib/tools/python3/Modules/clinic/_pickle.c.h
index b39c04dcaac..b39c04dcaac 100644
--- a/contrib/tools/python3/src/Modules/clinic/_pickle.c.h
+++ b/contrib/tools/python3/Modules/clinic/_pickle.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_posixsubprocess.c.h b/contrib/tools/python3/Modules/clinic/_posixsubprocess.c.h
index f08878cf668..f08878cf668 100644
--- a/contrib/tools/python3/src/Modules/clinic/_posixsubprocess.c.h
+++ b/contrib/tools/python3/Modules/clinic/_posixsubprocess.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_queuemodule.c.h b/contrib/tools/python3/Modules/clinic/_queuemodule.c.h
index 906d0582a99..906d0582a99 100644
--- a/contrib/tools/python3/src/Modules/clinic/_queuemodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_queuemodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_randommodule.c.h b/contrib/tools/python3/Modules/clinic/_randommodule.c.h
index ec8531ce006..ec8531ce006 100644
--- a/contrib/tools/python3/src/Modules/clinic/_randommodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_randommodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_ssl.c.h b/contrib/tools/python3/Modules/clinic/_ssl.c.h
index 9f967ddc8e3..9f967ddc8e3 100644
--- a/contrib/tools/python3/src/Modules/clinic/_ssl.c.h
+++ b/contrib/tools/python3/Modules/clinic/_ssl.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_statisticsmodule.c.h b/contrib/tools/python3/Modules/clinic/_statisticsmodule.c.h
index 4dedadd2939..4dedadd2939 100644
--- a/contrib/tools/python3/src/Modules/clinic/_statisticsmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_statisticsmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_struct.c.h b/contrib/tools/python3/Modules/clinic/_struct.c.h
index b21d9ff2924..b21d9ff2924 100644
--- a/contrib/tools/python3/src/Modules/clinic/_struct.c.h
+++ b/contrib/tools/python3/Modules/clinic/_struct.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_tracemalloc.c.h b/contrib/tools/python3/Modules/clinic/_tracemalloc.c.h
index a89cd9aabca..a89cd9aabca 100644
--- a/contrib/tools/python3/src/Modules/clinic/_tracemalloc.c.h
+++ b/contrib/tools/python3/Modules/clinic/_tracemalloc.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_typingmodule.c.h b/contrib/tools/python3/Modules/clinic/_typingmodule.c.h
index f980aa0d084..f980aa0d084 100644
--- a/contrib/tools/python3/src/Modules/clinic/_typingmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/_typingmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_weakref.c.h b/contrib/tools/python3/Modules/clinic/_weakref.c.h
index 48feb042cac..48feb042cac 100644
--- a/contrib/tools/python3/src/Modules/clinic/_weakref.c.h
+++ b/contrib/tools/python3/Modules/clinic/_weakref.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_winapi.c.h b/contrib/tools/python3/Modules/clinic/_winapi.c.h
index 5b87b24246f..5b87b24246f 100644
--- a/contrib/tools/python3/src/Modules/clinic/_winapi.c.h
+++ b/contrib/tools/python3/Modules/clinic/_winapi.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/_zoneinfo.c.h b/contrib/tools/python3/Modules/clinic/_zoneinfo.c.h
index ae62865e0f6..ae62865e0f6 100644
--- a/contrib/tools/python3/src/Modules/clinic/_zoneinfo.c.h
+++ b/contrib/tools/python3/Modules/clinic/_zoneinfo.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/arraymodule.c.h b/contrib/tools/python3/Modules/clinic/arraymodule.c.h
index 844865f44a5..844865f44a5 100644
--- a/contrib/tools/python3/src/Modules/clinic/arraymodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/arraymodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/audioop.c.h b/contrib/tools/python3/Modules/clinic/audioop.c.h
index 1a7ccf8b828..1a7ccf8b828 100644
--- a/contrib/tools/python3/src/Modules/clinic/audioop.c.h
+++ b/contrib/tools/python3/Modules/clinic/audioop.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/binascii.c.h b/contrib/tools/python3/Modules/clinic/binascii.c.h
index 63566dfb10e..63566dfb10e 100644
--- a/contrib/tools/python3/src/Modules/clinic/binascii.c.h
+++ b/contrib/tools/python3/Modules/clinic/binascii.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/cmathmodule.c.h b/contrib/tools/python3/Modules/clinic/cmathmodule.c.h
index 941448e76e8..941448e76e8 100644
--- a/contrib/tools/python3/src/Modules/clinic/cmathmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/cmathmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/fcntlmodule.c.h b/contrib/tools/python3/Modules/clinic/fcntlmodule.c.h
index 20eb50b0e76..20eb50b0e76 100644
--- a/contrib/tools/python3/src/Modules/clinic/fcntlmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/fcntlmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/gcmodule.c.h b/contrib/tools/python3/Modules/clinic/gcmodule.c.h
index 2d18e2ee097..2d18e2ee097 100644
--- a/contrib/tools/python3/src/Modules/clinic/gcmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/gcmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/grpmodule.c.h b/contrib/tools/python3/Modules/clinic/grpmodule.c.h
index 4914bc9abd6..4914bc9abd6 100644
--- a/contrib/tools/python3/src/Modules/clinic/grpmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/grpmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/itertoolsmodule.c.h b/contrib/tools/python3/Modules/clinic/itertoolsmodule.c.h
index 32278bf715a..32278bf715a 100644
--- a/contrib/tools/python3/src/Modules/clinic/itertoolsmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/itertoolsmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/mathmodule.c.h b/contrib/tools/python3/Modules/clinic/mathmodule.c.h
index c16c1b08398..c16c1b08398 100644
--- a/contrib/tools/python3/src/Modules/clinic/mathmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/mathmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/md5module.c.h b/contrib/tools/python3/Modules/clinic/md5module.c.h
index eb2ed49e9ef..eb2ed49e9ef 100644
--- a/contrib/tools/python3/src/Modules/clinic/md5module.c.h
+++ b/contrib/tools/python3/Modules/clinic/md5module.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/overlapped.c.h b/contrib/tools/python3/Modules/clinic/overlapped.c.h
index 9d9f2cbf6af..9d9f2cbf6af 100644
--- a/contrib/tools/python3/src/Modules/clinic/overlapped.c.h
+++ b/contrib/tools/python3/Modules/clinic/overlapped.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/posixmodule.c.h b/contrib/tools/python3/Modules/clinic/posixmodule.c.h
index 3802182143c..3802182143c 100644
--- a/contrib/tools/python3/src/Modules/clinic/posixmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/posixmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/pwdmodule.c.h b/contrib/tools/python3/Modules/clinic/pwdmodule.c.h
index f2603eaf322..f2603eaf322 100644
--- a/contrib/tools/python3/src/Modules/clinic/pwdmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/pwdmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/pyexpat.c.h b/contrib/tools/python3/Modules/clinic/pyexpat.c.h
index 34937c5d594..34937c5d594 100644
--- a/contrib/tools/python3/src/Modules/clinic/pyexpat.c.h
+++ b/contrib/tools/python3/Modules/clinic/pyexpat.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/resource.c.h b/contrib/tools/python3/Modules/clinic/resource.c.h
index d0ca8e7150f..d0ca8e7150f 100644
--- a/contrib/tools/python3/src/Modules/clinic/resource.c.h
+++ b/contrib/tools/python3/Modules/clinic/resource.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/selectmodule.c.h b/contrib/tools/python3/Modules/clinic/selectmodule.c.h
index f44ca1d70a1..f44ca1d70a1 100644
--- a/contrib/tools/python3/src/Modules/clinic/selectmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/selectmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/sha1module.c.h b/contrib/tools/python3/Modules/clinic/sha1module.c.h
index e0858e77b5e..e0858e77b5e 100644
--- a/contrib/tools/python3/src/Modules/clinic/sha1module.c.h
+++ b/contrib/tools/python3/Modules/clinic/sha1module.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/sha2module.c.h b/contrib/tools/python3/Modules/clinic/sha2module.c.h
index 557a61791bd..557a61791bd 100644
--- a/contrib/tools/python3/src/Modules/clinic/sha2module.c.h
+++ b/contrib/tools/python3/Modules/clinic/sha2module.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/sha3module.c.h b/contrib/tools/python3/Modules/clinic/sha3module.c.h
index 299803a3420..299803a3420 100644
--- a/contrib/tools/python3/src/Modules/clinic/sha3module.c.h
+++ b/contrib/tools/python3/Modules/clinic/sha3module.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/signalmodule.c.h b/contrib/tools/python3/Modules/clinic/signalmodule.c.h
index 3b3c6ba150a..3b3c6ba150a 100644
--- a/contrib/tools/python3/src/Modules/clinic/signalmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/signalmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/socketmodule.c.h b/contrib/tools/python3/Modules/clinic/socketmodule.c.h
index 8ff1044d013..8ff1044d013 100644
--- a/contrib/tools/python3/src/Modules/clinic/socketmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/socketmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/spwdmodule.c.h b/contrib/tools/python3/Modules/clinic/spwdmodule.c.h
index f47aa9a77f3..f47aa9a77f3 100644
--- a/contrib/tools/python3/src/Modules/clinic/spwdmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/spwdmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/symtablemodule.c.h b/contrib/tools/python3/Modules/clinic/symtablemodule.c.h
index 04fdb9f2d9b..04fdb9f2d9b 100644
--- a/contrib/tools/python3/src/Modules/clinic/symtablemodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/symtablemodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/syslogmodule.c.h b/contrib/tools/python3/Modules/clinic/syslogmodule.c.h
index 0ce66ad4e1a..0ce66ad4e1a 100644
--- a/contrib/tools/python3/src/Modules/clinic/syslogmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/syslogmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/termios.c.h b/contrib/tools/python3/Modules/clinic/termios.c.h
index 78863e53c42..78863e53c42 100644
--- a/contrib/tools/python3/src/Modules/clinic/termios.c.h
+++ b/contrib/tools/python3/Modules/clinic/termios.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/unicodedata.c.h b/contrib/tools/python3/Modules/clinic/unicodedata.c.h
index 6102027d07a..6102027d07a 100644
--- a/contrib/tools/python3/src/Modules/clinic/unicodedata.c.h
+++ b/contrib/tools/python3/Modules/clinic/unicodedata.c.h
diff --git a/contrib/tools/python3/src/Modules/clinic/zlibmodule.c.h b/contrib/tools/python3/Modules/clinic/zlibmodule.c.h
index a8d488ec67c..a8d488ec67c 100644
--- a/contrib/tools/python3/src/Modules/clinic/zlibmodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/zlibmodule.c.h
diff --git a/contrib/tools/python3/src/Modules/cmathmodule.c b/contrib/tools/python3/Modules/cmathmodule.c
index 25491e65584..25491e65584 100644
--- a/contrib/tools/python3/src/Modules/cmathmodule.c
+++ b/contrib/tools/python3/Modules/cmathmodule.c
diff --git a/contrib/tools/python3/src/Modules/config.c b/contrib/tools/python3/Modules/config.c
index b2303e511c5..b2303e511c5 100644
--- a/contrib/tools/python3/src/Modules/config.c
+++ b/contrib/tools/python3/Modules/config.c
diff --git a/contrib/tools/python3/src/Modules/errnomodule.c b/contrib/tools/python3/Modules/errnomodule.c
index 301ad8313bc..301ad8313bc 100644
--- a/contrib/tools/python3/src/Modules/errnomodule.c
+++ b/contrib/tools/python3/Modules/errnomodule.c
diff --git a/contrib/tools/python3/src/Modules/faulthandler.c b/contrib/tools/python3/Modules/faulthandler.c
index be77bb01f3f..be77bb01f3f 100644
--- a/contrib/tools/python3/src/Modules/faulthandler.c
+++ b/contrib/tools/python3/Modules/faulthandler.c
diff --git a/contrib/tools/python3/src/Modules/fcntlmodule.c b/contrib/tools/python3/Modules/fcntlmodule.c
index 2bca40213c6..2bca40213c6 100644
--- a/contrib/tools/python3/src/Modules/fcntlmodule.c
+++ b/contrib/tools/python3/Modules/fcntlmodule.c
diff --git a/contrib/tools/python3/src/Modules/gcmodule.c b/contrib/tools/python3/Modules/gcmodule.c
index b7cb30ab7ed..b7cb30ab7ed 100644
--- a/contrib/tools/python3/src/Modules/gcmodule.c
+++ b/contrib/tools/python3/Modules/gcmodule.c
diff --git a/contrib/tools/python3/src/Modules/getaddrinfo.c b/contrib/tools/python3/Modules/getaddrinfo.c
index f1c28d7d931..f1c28d7d931 100644
--- a/contrib/tools/python3/src/Modules/getaddrinfo.c
+++ b/contrib/tools/python3/Modules/getaddrinfo.c
diff --git a/contrib/tools/python3/src/Modules/getbuildinfo.c b/contrib/tools/python3/Modules/getbuildinfo.c
index a24750b76c0..a24750b76c0 100644
--- a/contrib/tools/python3/src/Modules/getbuildinfo.c
+++ b/contrib/tools/python3/Modules/getbuildinfo.c
diff --git a/contrib/tools/python3/src/Modules/getnameinfo.c b/contrib/tools/python3/Modules/getnameinfo.c
index 335021f79ba..335021f79ba 100644
--- a/contrib/tools/python3/src/Modules/getnameinfo.c
+++ b/contrib/tools/python3/Modules/getnameinfo.c
diff --git a/contrib/tools/python3/src/Modules/getpath.c b/contrib/tools/python3/Modules/getpath.c
index bd6920cf068..bd6920cf068 100644
--- a/contrib/tools/python3/src/Modules/getpath.c
+++ b/contrib/tools/python3/Modules/getpath.c
diff --git a/contrib/tools/python3/src/Modules/grpmodule.c b/contrib/tools/python3/Modules/grpmodule.c
index f5709296334..f5709296334 100644
--- a/contrib/tools/python3/src/Modules/grpmodule.c
+++ b/contrib/tools/python3/Modules/grpmodule.c
diff --git a/contrib/tools/python3/src/Modules/hashlib.h b/contrib/tools/python3/Modules/hashlib.h
index a8bad9dd87a..a8bad9dd87a 100644
--- a/contrib/tools/python3/src/Modules/hashlib.h
+++ b/contrib/tools/python3/Modules/hashlib.h
diff --git a/contrib/tools/python3/src/Modules/itertoolsmodule.c b/contrib/tools/python3/Modules/itertoolsmodule.c
index 24e77c485db..24e77c485db 100644
--- a/contrib/tools/python3/src/Modules/itertoolsmodule.c
+++ b/contrib/tools/python3/Modules/itertoolsmodule.c
diff --git a/contrib/tools/python3/src/Modules/main.c b/contrib/tools/python3/Modules/main.c
index 40dafa2c7b7..40dafa2c7b7 100644
--- a/contrib/tools/python3/src/Modules/main.c
+++ b/contrib/tools/python3/Modules/main.c
diff --git a/contrib/tools/python3/src/Modules/mathmodule.c b/contrib/tools/python3/Modules/mathmodule.c
index 23fa2b18164..23fa2b18164 100644
--- a/contrib/tools/python3/src/Modules/mathmodule.c
+++ b/contrib/tools/python3/Modules/mathmodule.c
diff --git a/contrib/tools/python3/src/Modules/md5module.c b/contrib/tools/python3/Modules/md5module.c
index 2122f8b18ba..2122f8b18ba 100644
--- a/contrib/tools/python3/src/Modules/md5module.c
+++ b/contrib/tools/python3/Modules/md5module.c
diff --git a/contrib/tools/python3/src/Modules/mmapmodule.c b/contrib/tools/python3/Modules/mmapmodule.c
index 827f619e6eb..827f619e6eb 100644
--- a/contrib/tools/python3/src/Modules/mmapmodule.c
+++ b/contrib/tools/python3/Modules/mmapmodule.c
diff --git a/contrib/tools/python3/src/Modules/overlapped.c b/contrib/tools/python3/Modules/overlapped.c
index afdd78d1bc9..afdd78d1bc9 100644
--- a/contrib/tools/python3/src/Modules/overlapped.c
+++ b/contrib/tools/python3/Modules/overlapped.c
diff --git a/contrib/tools/python3/src/Modules/posixmodule.c b/contrib/tools/python3/Modules/posixmodule.c
index c99c69d018b..c99c69d018b 100644
--- a/contrib/tools/python3/src/Modules/posixmodule.c
+++ b/contrib/tools/python3/Modules/posixmodule.c
diff --git a/contrib/tools/python3/src/Modules/posixmodule.h b/contrib/tools/python3/Modules/posixmodule.h
index 5452ffbf17a..5452ffbf17a 100644
--- a/contrib/tools/python3/src/Modules/posixmodule.h
+++ b/contrib/tools/python3/Modules/posixmodule.h
diff --git a/contrib/tools/python3/src/Modules/pwdmodule.c b/contrib/tools/python3/Modules/pwdmodule.c
index cc2e2a43893..cc2e2a43893 100644
--- a/contrib/tools/python3/src/Modules/pwdmodule.c
+++ b/contrib/tools/python3/Modules/pwdmodule.c
diff --git a/contrib/tools/python3/src/Modules/pyexpat.c b/contrib/tools/python3/Modules/pyexpat.c
index b21360419d6..b21360419d6 100644
--- a/contrib/tools/python3/src/Modules/pyexpat.c
+++ b/contrib/tools/python3/Modules/pyexpat.c
diff --git a/contrib/tools/python3/src/Modules/resource.c b/contrib/tools/python3/Modules/resource.c
index 3c89468c48c..3c89468c48c 100644
--- a/contrib/tools/python3/src/Modules/resource.c
+++ b/contrib/tools/python3/Modules/resource.c
diff --git a/contrib/tools/python3/src/Modules/rotatingtree.c b/contrib/tools/python3/Modules/rotatingtree.c
index 07e08bc3167..07e08bc3167 100644
--- a/contrib/tools/python3/src/Modules/rotatingtree.c
+++ b/contrib/tools/python3/Modules/rotatingtree.c
diff --git a/contrib/tools/python3/src/Modules/rotatingtree.h b/contrib/tools/python3/Modules/rotatingtree.h
index 7b3e5fde921..7b3e5fde921 100644
--- a/contrib/tools/python3/src/Modules/rotatingtree.h
+++ b/contrib/tools/python3/Modules/rotatingtree.h
diff --git a/contrib/tools/python3/src/Modules/selectmodule.c b/contrib/tools/python3/Modules/selectmodule.c
index b7c6b1b5399..b7c6b1b5399 100644
--- a/contrib/tools/python3/src/Modules/selectmodule.c
+++ b/contrib/tools/python3/Modules/selectmodule.c
diff --git a/contrib/tools/python3/src/Modules/sha1module.c b/contrib/tools/python3/Modules/sha1module.c
index c66269b5f5c..c66269b5f5c 100644
--- a/contrib/tools/python3/src/Modules/sha1module.c
+++ b/contrib/tools/python3/Modules/sha1module.c
diff --git a/contrib/tools/python3/src/Modules/sha2module.c b/contrib/tools/python3/Modules/sha2module.c
index db3774c81e2..db3774c81e2 100644
--- a/contrib/tools/python3/src/Modules/sha2module.c
+++ b/contrib/tools/python3/Modules/sha2module.c
diff --git a/contrib/tools/python3/src/Modules/sha3module.c b/contrib/tools/python3/Modules/sha3module.c
index 558d2005cff..558d2005cff 100644
--- a/contrib/tools/python3/src/Modules/sha3module.c
+++ b/contrib/tools/python3/Modules/sha3module.c
diff --git a/contrib/tools/python3/src/Modules/signalmodule.c b/contrib/tools/python3/Modules/signalmodule.c
index 00ea4343735..00ea4343735 100644
--- a/contrib/tools/python3/src/Modules/signalmodule.c
+++ b/contrib/tools/python3/Modules/signalmodule.c
diff --git a/contrib/tools/python3/src/Modules/socketmodule.c b/contrib/tools/python3/Modules/socketmodule.c
index 97248792c0f..97248792c0f 100644
--- a/contrib/tools/python3/src/Modules/socketmodule.c
+++ b/contrib/tools/python3/Modules/socketmodule.c
diff --git a/contrib/tools/python3/src/Modules/socketmodule.h b/contrib/tools/python3/Modules/socketmodule.h
index d55c02fd156..d55c02fd156 100644
--- a/contrib/tools/python3/src/Modules/socketmodule.h
+++ b/contrib/tools/python3/Modules/socketmodule.h
diff --git a/contrib/tools/python3/src/Modules/spwdmodule.c b/contrib/tools/python3/Modules/spwdmodule.c
index 13f1115feef..13f1115feef 100644
--- a/contrib/tools/python3/src/Modules/spwdmodule.c
+++ b/contrib/tools/python3/Modules/spwdmodule.c
diff --git a/contrib/tools/python3/src/Modules/symtablemodule.c b/contrib/tools/python3/Modules/symtablemodule.c
index 1f09c23bb85..1f09c23bb85 100644
--- a/contrib/tools/python3/src/Modules/symtablemodule.c
+++ b/contrib/tools/python3/Modules/symtablemodule.c
diff --git a/contrib/tools/python3/src/Modules/syslogmodule.c b/contrib/tools/python3/Modules/syslogmodule.c
index 6db8de9c491..6db8de9c491 100644
--- a/contrib/tools/python3/src/Modules/syslogmodule.c
+++ b/contrib/tools/python3/Modules/syslogmodule.c
diff --git a/contrib/tools/python3/src/Modules/termios.c b/contrib/tools/python3/Modules/termios.c
index 402e6ac908a..402e6ac908a 100644
--- a/contrib/tools/python3/src/Modules/termios.c
+++ b/contrib/tools/python3/Modules/termios.c
diff --git a/contrib/tools/python3/src/Modules/timemodule.c b/contrib/tools/python3/Modules/timemodule.c
index 3b46deacdf2..3b46deacdf2 100644
--- a/contrib/tools/python3/src/Modules/timemodule.c
+++ b/contrib/tools/python3/Modules/timemodule.c
diff --git a/contrib/tools/python3/src/Modules/unicodedata.c b/contrib/tools/python3/Modules/unicodedata.c
index 41dcd5f8f88..41dcd5f8f88 100644
--- a/contrib/tools/python3/src/Modules/unicodedata.c
+++ b/contrib/tools/python3/Modules/unicodedata.c
diff --git a/contrib/tools/python3/src/Modules/unicodedata_db.h b/contrib/tools/python3/Modules/unicodedata_db.h
index 4c4b2f589c5..4c4b2f589c5 100644
--- a/contrib/tools/python3/src/Modules/unicodedata_db.h
+++ b/contrib/tools/python3/Modules/unicodedata_db.h
diff --git a/contrib/tools/python3/src/Modules/unicodename_db.h b/contrib/tools/python3/Modules/unicodename_db.h
index f6320c43e53..f6320c43e53 100644
--- a/contrib/tools/python3/src/Modules/unicodename_db.h
+++ b/contrib/tools/python3/Modules/unicodename_db.h
diff --git a/contrib/tools/python3/src/Modules/winreparse.h b/contrib/tools/python3/Modules/winreparse.h
index f06f701f999..f06f701f999 100644
--- a/contrib/tools/python3/src/Modules/winreparse.h
+++ b/contrib/tools/python3/Modules/winreparse.h
diff --git a/contrib/tools/python3/Modules/ya.make b/contrib/tools/python3/Modules/ya.make
new file mode 100644
index 00000000000..2e0a9717076
--- /dev/null
+++ b/contrib/tools/python3/Modules/ya.make
@@ -0,0 +1,188 @@
+# Generated by devtools/yamaker.
+
+LIBRARY()
+
+VERSION(3.12.2)
+
+ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.12.2.tar.gz)
+
+LICENSE(Python-2.0)
+
+PEERDIR(
+ contrib/libs/expat
+ contrib/libs/libbz2
+ contrib/libs/libc_compat
+ contrib/libs/lzma
+ contrib/libs/openssl
+ contrib/libs/zlib
+ contrib/restricted/libffi
+ library/cpp/sanitizer/include
+)
+
+ADDINCL(
+ contrib/libs/expat
+ contrib/libs/libbz2
+ contrib/restricted/libffi/include
+ contrib/tools/python3/Include
+ contrib/tools/python3/Include/internal
+ contrib/tools/python3/Modules
+ contrib/tools/python3/Modules/_decimal/libmpdec
+ contrib/tools/python3/Modules/_hacl/include
+)
+
+NO_COMPILER_WARNINGS()
+
+NO_RUNTIME()
+
+CFLAGS(
+ -DPy_BUILD_CORE
+ -DPy_BUILD_CORE_BUILTIN
+)
+
+SRCS(
+ _abc.c
+ _asynciomodule.c
+ _bisectmodule.c
+ _blake2/blake2b_impl.c
+ _blake2/blake2module.c
+ _blake2/blake2s_impl.c
+ _bz2module.c
+ _codecsmodule.c
+ _collectionsmodule.c
+ _contextvarsmodule.c
+ _csv.c
+ _ctypes/_ctypes.c
+ _ctypes/callbacks.c
+ _ctypes/callproc.c
+ _ctypes/cfield.c
+ _ctypes/stgdict.c
+ _datetimemodule.c
+ _decimal/_decimal.c
+ _decimal/libmpdec/basearith.c
+ _decimal/libmpdec/constants.c
+ _decimal/libmpdec/context.c
+ _decimal/libmpdec/convolute.c
+ _decimal/libmpdec/crt.c
+ _decimal/libmpdec/difradix2.c
+ _decimal/libmpdec/fnt.c
+ _decimal/libmpdec/fourstep.c
+ _decimal/libmpdec/io.c
+ _decimal/libmpdec/mpalloc.c
+ _decimal/libmpdec/mpdecimal.c
+ _decimal/libmpdec/mpsignal.c
+ _decimal/libmpdec/numbertheory.c
+ _decimal/libmpdec/sixstep.c
+ _decimal/libmpdec/transpose.c
+ _elementtree.c
+ _functoolsmodule.c
+ _hacl/Hacl_Hash_MD5.c
+ _hacl/Hacl_Hash_SHA1.c
+ _hacl/Hacl_Hash_SHA2.c
+ _hacl/Hacl_Hash_SHA3.c
+ _hashopenssl.c
+ _heapqmodule.c
+ _io/_iomodule.c
+ _io/bufferedio.c
+ _io/bytesio.c
+ _io/fileio.c
+ _io/iobase.c
+ _io/stringio.c
+ _io/textio.c
+ _io/winconsoleio.c
+ _json.c
+ _localemodule.c
+ _lsprof.c
+ _lzmamodule.c
+ _multiprocessing/multiprocessing.c
+ _multiprocessing/posixshmem.c
+ _multiprocessing/semaphore.c
+ _opcode.c
+ _operator.c
+ _pickle.c
+ _queuemodule.c
+ _randommodule.c
+ _sre/sre.c
+ _ssl.c
+ _stat.c
+ _statisticsmodule.c
+ _struct.c
+ _threadmodule.c
+ _tracemalloc.c
+ _typingmodule.c
+ _weakref.c
+ _xxinterpchannelsmodule.c
+ _xxsubinterpretersmodule.c
+ _xxtestfuzz/_xxtestfuzz.c
+ _xxtestfuzz/fuzzer.c
+ _zoneinfo.c
+ arraymodule.c
+ atexitmodule.c
+ audioop.c
+ binascii.c
+ cjkcodecs/_codecs_cn.c
+ cjkcodecs/_codecs_hk.c
+ cjkcodecs/_codecs_iso2022.c
+ cjkcodecs/_codecs_jp.c
+ cjkcodecs/_codecs_kr.c
+ cjkcodecs/_codecs_tw.c
+ cjkcodecs/multibytecodec.c
+ cmathmodule.c
+ config.c
+ errnomodule.c
+ faulthandler.c
+ gcmodule.c
+ getbuildinfo.c
+ getpath.c
+ itertoolsmodule.c
+ main.c
+ mathmodule.c
+ md5module.c
+ mmapmodule.c
+ posixmodule.c
+ pyexpat.c
+ rotatingtree.c
+ selectmodule.c
+ sha1module.c
+ sha2module.c
+ sha3module.c
+ signalmodule.c
+ socketmodule.c
+ symtablemodule.c
+ timemodule.c
+ unicodedata.c
+ zlibmodule.c
+)
+
+IF (OS_WINDOWS)
+ SRCS(
+ _winapi.c
+ overlapped.c
+ )
+ELSE()
+ SRCS(
+ _cryptmodule.c
+ _posixsubprocess.c
+ fcntlmodule.c
+ grpmodule.c
+ pwdmodule.c
+ resource.c
+ syslogmodule.c
+ termios.c
+ )
+
+ IF (OS_DARWIN)
+ SRCS(
+ _scproxy.c
+ )
+ ELSEIF (OS_LINUX)
+ IF (NOT MUSL)
+ EXTRALIBS(crypt)
+ ENDIF()
+
+ SRCS(
+ spwdmodule.c
+ )
+ ENDIF()
+ENDIF()
+
+END()
diff --git a/contrib/tools/python3/src/Modules/zlibmodule.c b/contrib/tools/python3/Modules/zlibmodule.c
index f94c57e4c89..f94c57e4c89 100644
--- a/contrib/tools/python3/src/Modules/zlibmodule.c
+++ b/contrib/tools/python3/Modules/zlibmodule.c
diff --git a/contrib/tools/python3/Objects/README b/contrib/tools/python3/Objects/README
new file mode 100644
index 00000000000..854b103f7bd
--- /dev/null
+++ b/contrib/tools/python3/Objects/README
@@ -0,0 +1 @@
+Source files for various builtin objects
diff --git a/contrib/tools/python3/src/Objects/abstract.c b/contrib/tools/python3/Objects/abstract.c
index e95785900c9..e95785900c9 100644
--- a/contrib/tools/python3/src/Objects/abstract.c
+++ b/contrib/tools/python3/Objects/abstract.c
diff --git a/contrib/tools/python3/src/Objects/boolobject.c b/contrib/tools/python3/Objects/boolobject.c
index f43e26f3f24..f43e26f3f24 100644
--- a/contrib/tools/python3/src/Objects/boolobject.c
+++ b/contrib/tools/python3/Objects/boolobject.c
diff --git a/contrib/tools/python3/src/Objects/bytearrayobject.c b/contrib/tools/python3/Objects/bytearrayobject.c
index 07c20ac6316..07c20ac6316 100644
--- a/contrib/tools/python3/src/Objects/bytearrayobject.c
+++ b/contrib/tools/python3/Objects/bytearrayobject.c
diff --git a/contrib/tools/python3/src/Objects/bytes_methods.c b/contrib/tools/python3/Objects/bytes_methods.c
index 33aa9c3db6e..33aa9c3db6e 100644
--- a/contrib/tools/python3/src/Objects/bytes_methods.c
+++ b/contrib/tools/python3/Objects/bytes_methods.c
diff --git a/contrib/tools/python3/src/Objects/bytesobject.c b/contrib/tools/python3/Objects/bytesobject.c
index f3a978c86c3..f3a978c86c3 100644
--- a/contrib/tools/python3/src/Objects/bytesobject.c
+++ b/contrib/tools/python3/Objects/bytesobject.c
diff --git a/contrib/tools/python3/src/Objects/call.c b/contrib/tools/python3/Objects/call.c
index 0d548dcd5e1..0d548dcd5e1 100644
--- a/contrib/tools/python3/src/Objects/call.c
+++ b/contrib/tools/python3/Objects/call.c
diff --git a/contrib/tools/python3/src/Objects/capsule.c b/contrib/tools/python3/Objects/capsule.c
index a28e0304e83..a28e0304e83 100644
--- a/contrib/tools/python3/src/Objects/capsule.c
+++ b/contrib/tools/python3/Objects/capsule.c
diff --git a/contrib/tools/python3/src/Objects/cellobject.c b/contrib/tools/python3/Objects/cellobject.c
index f516707f6f8..f516707f6f8 100644
--- a/contrib/tools/python3/src/Objects/cellobject.c
+++ b/contrib/tools/python3/Objects/cellobject.c
diff --git a/contrib/tools/python3/src/Objects/classobject.c b/contrib/tools/python3/Objects/classobject.c
index 12dc276f289..12dc276f289 100644
--- a/contrib/tools/python3/src/Objects/classobject.c
+++ b/contrib/tools/python3/Objects/classobject.c
diff --git a/contrib/tools/python3/src/Objects/clinic/bytearrayobject.c.h b/contrib/tools/python3/Objects/clinic/bytearrayobject.c.h
index e7bf3183af8..e7bf3183af8 100644
--- a/contrib/tools/python3/src/Objects/clinic/bytearrayobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/bytearrayobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/bytesobject.c.h b/contrib/tools/python3/Objects/clinic/bytesobject.c.h
index 060056dafbd..060056dafbd 100644
--- a/contrib/tools/python3/src/Objects/clinic/bytesobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/bytesobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/classobject.c.h b/contrib/tools/python3/Objects/clinic/classobject.c.h
index a7bac63052b..a7bac63052b 100644
--- a/contrib/tools/python3/src/Objects/clinic/classobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/classobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/codeobject.c.h b/contrib/tools/python3/Objects/clinic/codeobject.c.h
index 1034627edd7..1034627edd7 100644
--- a/contrib/tools/python3/src/Objects/clinic/codeobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/codeobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/complexobject.c.h b/contrib/tools/python3/Objects/clinic/complexobject.c.h
index e92c6e98585..e92c6e98585 100644
--- a/contrib/tools/python3/src/Objects/clinic/complexobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/complexobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/descrobject.c.h b/contrib/tools/python3/Objects/clinic/descrobject.c.h
index 75706437df8..75706437df8 100644
--- a/contrib/tools/python3/src/Objects/clinic/descrobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/descrobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/dictobject.c.h b/contrib/tools/python3/Objects/clinic/dictobject.c.h
index bc2452330e4..bc2452330e4 100644
--- a/contrib/tools/python3/src/Objects/clinic/dictobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/dictobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/enumobject.c.h b/contrib/tools/python3/Objects/clinic/enumobject.c.h
index adf78efd0d6..adf78efd0d6 100644
--- a/contrib/tools/python3/src/Objects/clinic/enumobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/enumobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/floatobject.c.h b/contrib/tools/python3/Objects/clinic/floatobject.c.h
index a99fd74e4b6..a99fd74e4b6 100644
--- a/contrib/tools/python3/src/Objects/clinic/floatobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/floatobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/funcobject.c.h b/contrib/tools/python3/Objects/clinic/funcobject.c.h
index c3a3a8edc39..c3a3a8edc39 100644
--- a/contrib/tools/python3/src/Objects/clinic/funcobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/funcobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/listobject.c.h b/contrib/tools/python3/Objects/clinic/listobject.c.h
index e3d6ffa9f76..e3d6ffa9f76 100644
--- a/contrib/tools/python3/src/Objects/clinic/listobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/listobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/longobject.c.h b/contrib/tools/python3/Objects/clinic/longobject.c.h
index c26ceafbc2b..c26ceafbc2b 100644
--- a/contrib/tools/python3/src/Objects/clinic/longobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/longobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/memoryobject.c.h b/contrib/tools/python3/Objects/clinic/memoryobject.c.h
index 25a22341185..25a22341185 100644
--- a/contrib/tools/python3/src/Objects/clinic/memoryobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/memoryobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/moduleobject.c.h b/contrib/tools/python3/Objects/clinic/moduleobject.c.h
index 861bcea6215..861bcea6215 100644
--- a/contrib/tools/python3/src/Objects/clinic/moduleobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/moduleobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/odictobject.c.h b/contrib/tools/python3/Objects/clinic/odictobject.c.h
index 115a134e3f7..115a134e3f7 100644
--- a/contrib/tools/python3/src/Objects/clinic/odictobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/odictobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/structseq.c.h b/contrib/tools/python3/Objects/clinic/structseq.c.h
index 40ba18a544f..40ba18a544f 100644
--- a/contrib/tools/python3/src/Objects/clinic/structseq.c.h
+++ b/contrib/tools/python3/Objects/clinic/structseq.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/tupleobject.c.h b/contrib/tools/python3/Objects/clinic/tupleobject.c.h
index 3de95759a13..3de95759a13 100644
--- a/contrib/tools/python3/src/Objects/clinic/tupleobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/tupleobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/typeobject.c.h b/contrib/tools/python3/Objects/clinic/typeobject.c.h
index dc9746abfbe..dc9746abfbe 100644
--- a/contrib/tools/python3/src/Objects/clinic/typeobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/typeobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/typevarobject.c.h b/contrib/tools/python3/Objects/clinic/typevarobject.c.h
index 54189b98446..54189b98446 100644
--- a/contrib/tools/python3/src/Objects/clinic/typevarobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/typevarobject.c.h
diff --git a/contrib/tools/python3/src/Objects/clinic/unicodeobject.c.h b/contrib/tools/python3/Objects/clinic/unicodeobject.c.h
index 27cbf9d1543..27cbf9d1543 100644
--- a/contrib/tools/python3/src/Objects/clinic/unicodeobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/unicodeobject.c.h
diff --git a/contrib/tools/python3/src/Objects/codeobject.c b/contrib/tools/python3/Objects/codeobject.c
index 5e358825d89..5e358825d89 100644
--- a/contrib/tools/python3/src/Objects/codeobject.c
+++ b/contrib/tools/python3/Objects/codeobject.c
diff --git a/contrib/tools/python3/src/Objects/complexobject.c b/contrib/tools/python3/Objects/complexobject.c
index aee03ddfb07..aee03ddfb07 100644
--- a/contrib/tools/python3/src/Objects/complexobject.c
+++ b/contrib/tools/python3/Objects/complexobject.c
diff --git a/contrib/tools/python3/src/Objects/descrobject.c b/contrib/tools/python3/Objects/descrobject.c
index d5e88dcf1c8..d5e88dcf1c8 100644
--- a/contrib/tools/python3/src/Objects/descrobject.c
+++ b/contrib/tools/python3/Objects/descrobject.c
diff --git a/contrib/tools/python3/src/Objects/dictobject.c b/contrib/tools/python3/Objects/dictobject.c
index 254cd9ad2f9..254cd9ad2f9 100644
--- a/contrib/tools/python3/src/Objects/dictobject.c
+++ b/contrib/tools/python3/Objects/dictobject.c
diff --git a/contrib/tools/python3/src/Objects/enumobject.c b/contrib/tools/python3/Objects/enumobject.c
index c9d90584c26..c9d90584c26 100644
--- a/contrib/tools/python3/src/Objects/enumobject.c
+++ b/contrib/tools/python3/Objects/enumobject.c
diff --git a/contrib/tools/python3/src/Objects/exceptions.c b/contrib/tools/python3/Objects/exceptions.c
index e3217c922ee..e3217c922ee 100644
--- a/contrib/tools/python3/src/Objects/exceptions.c
+++ b/contrib/tools/python3/Objects/exceptions.c
diff --git a/contrib/tools/python3/src/Objects/fileobject.c b/contrib/tools/python3/Objects/fileobject.c
index e99e155f2b8..e99e155f2b8 100644
--- a/contrib/tools/python3/src/Objects/fileobject.c
+++ b/contrib/tools/python3/Objects/fileobject.c
diff --git a/contrib/tools/python3/src/Objects/floatobject.c b/contrib/tools/python3/Objects/floatobject.c
index 83a263c0d9c..83a263c0d9c 100644
--- a/contrib/tools/python3/src/Objects/floatobject.c
+++ b/contrib/tools/python3/Objects/floatobject.c
diff --git a/contrib/tools/python3/src/Objects/frameobject.c b/contrib/tools/python3/Objects/frameobject.c
index d33c3cde526..d33c3cde526 100644
--- a/contrib/tools/python3/src/Objects/frameobject.c
+++ b/contrib/tools/python3/Objects/frameobject.c
diff --git a/contrib/tools/python3/src/Objects/funcobject.c b/contrib/tools/python3/Objects/funcobject.c
index f43e3a2787b..f43e3a2787b 100644
--- a/contrib/tools/python3/src/Objects/funcobject.c
+++ b/contrib/tools/python3/Objects/funcobject.c
diff --git a/contrib/tools/python3/src/Objects/genericaliasobject.c b/contrib/tools/python3/Objects/genericaliasobject.c
index 117b4e8dfb9..117b4e8dfb9 100644
--- a/contrib/tools/python3/src/Objects/genericaliasobject.c
+++ b/contrib/tools/python3/Objects/genericaliasobject.c
diff --git a/contrib/tools/python3/src/Objects/genobject.c b/contrib/tools/python3/Objects/genobject.c
index 3b9e4a60367..3b9e4a60367 100644
--- a/contrib/tools/python3/src/Objects/genobject.c
+++ b/contrib/tools/python3/Objects/genobject.c
diff --git a/contrib/tools/python3/src/Objects/interpreteridobject.c b/contrib/tools/python3/Objects/interpreteridobject.c
index 46239100dcb..46239100dcb 100644
--- a/contrib/tools/python3/src/Objects/interpreteridobject.c
+++ b/contrib/tools/python3/Objects/interpreteridobject.c
diff --git a/contrib/tools/python3/src/Objects/iterobject.c b/contrib/tools/python3/Objects/iterobject.c
index 7cb17a6ca4a..7cb17a6ca4a 100644
--- a/contrib/tools/python3/src/Objects/iterobject.c
+++ b/contrib/tools/python3/Objects/iterobject.c
diff --git a/contrib/tools/python3/src/Objects/listobject.c b/contrib/tools/python3/Objects/listobject.c
index f1edfb3a9a0..f1edfb3a9a0 100644
--- a/contrib/tools/python3/src/Objects/listobject.c
+++ b/contrib/tools/python3/Objects/listobject.c
diff --git a/contrib/tools/python3/src/Objects/longobject.c b/contrib/tools/python3/Objects/longobject.c
index 5d9b4138614..5d9b4138614 100644
--- a/contrib/tools/python3/src/Objects/longobject.c
+++ b/contrib/tools/python3/Objects/longobject.c
diff --git a/contrib/tools/python3/src/Objects/memoryobject.c b/contrib/tools/python3/Objects/memoryobject.c
index b0168044d9f..b0168044d9f 100644
--- a/contrib/tools/python3/src/Objects/memoryobject.c
+++ b/contrib/tools/python3/Objects/memoryobject.c
diff --git a/contrib/tools/python3/src/Objects/methodobject.c b/contrib/tools/python3/Objects/methodobject.c
index 44735045163..44735045163 100644
--- a/contrib/tools/python3/src/Objects/methodobject.c
+++ b/contrib/tools/python3/Objects/methodobject.c
diff --git a/contrib/tools/python3/src/Objects/moduleobject.c b/contrib/tools/python3/Objects/moduleobject.c
index 4daf1a929e0..4daf1a929e0 100644
--- a/contrib/tools/python3/src/Objects/moduleobject.c
+++ b/contrib/tools/python3/Objects/moduleobject.c
diff --git a/contrib/tools/python3/src/Objects/namespaceobject.c b/contrib/tools/python3/Objects/namespaceobject.c
index 2cc4ddd3c91..2cc4ddd3c91 100644
--- a/contrib/tools/python3/src/Objects/namespaceobject.c
+++ b/contrib/tools/python3/Objects/namespaceobject.c
diff --git a/contrib/tools/python3/src/Objects/object.c b/contrib/tools/python3/Objects/object.c
index aac707d6a26..aac707d6a26 100644
--- a/contrib/tools/python3/src/Objects/object.c
+++ b/contrib/tools/python3/Objects/object.c
diff --git a/contrib/tools/python3/src/Objects/obmalloc.c b/contrib/tools/python3/Objects/obmalloc.c
index 9620a8fbb44..9620a8fbb44 100644
--- a/contrib/tools/python3/src/Objects/obmalloc.c
+++ b/contrib/tools/python3/Objects/obmalloc.c
diff --git a/contrib/tools/python3/src/Objects/odictobject.c b/contrib/tools/python3/Objects/odictobject.c
index 39b0f684510..39b0f684510 100644
--- a/contrib/tools/python3/src/Objects/odictobject.c
+++ b/contrib/tools/python3/Objects/odictobject.c
diff --git a/contrib/tools/python3/src/Objects/picklebufobject.c b/contrib/tools/python3/Objects/picklebufobject.c
index aaa852cfbb0..aaa852cfbb0 100644
--- a/contrib/tools/python3/src/Objects/picklebufobject.c
+++ b/contrib/tools/python3/Objects/picklebufobject.c
diff --git a/contrib/tools/python3/src/Objects/rangeobject.c b/contrib/tools/python3/Objects/rangeobject.c
index beb86b9623b..beb86b9623b 100644
--- a/contrib/tools/python3/src/Objects/rangeobject.c
+++ b/contrib/tools/python3/Objects/rangeobject.c
diff --git a/contrib/tools/python3/src/Objects/setobject.c b/contrib/tools/python3/Objects/setobject.c
index 763f9a3d204..763f9a3d204 100644
--- a/contrib/tools/python3/src/Objects/setobject.c
+++ b/contrib/tools/python3/Objects/setobject.c
diff --git a/contrib/tools/python3/src/Objects/sliceobject.c b/contrib/tools/python3/Objects/sliceobject.c
index e6776ac92b6..e6776ac92b6 100644
--- a/contrib/tools/python3/src/Objects/sliceobject.c
+++ b/contrib/tools/python3/Objects/sliceobject.c
diff --git a/contrib/tools/python3/src/Objects/stringlib/asciilib.h b/contrib/tools/python3/Objects/stringlib/asciilib.h
index b3016bfbbb0..b3016bfbbb0 100644
--- a/contrib/tools/python3/src/Objects/stringlib/asciilib.h
+++ b/contrib/tools/python3/Objects/stringlib/asciilib.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/clinic/transmogrify.h.h b/contrib/tools/python3/Objects/stringlib/clinic/transmogrify.h.h
index 49388cf043c..49388cf043c 100644
--- a/contrib/tools/python3/src/Objects/stringlib/clinic/transmogrify.h.h
+++ b/contrib/tools/python3/Objects/stringlib/clinic/transmogrify.h.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/codecs.h b/contrib/tools/python3/Objects/stringlib/codecs.h
index 958cc861478..958cc861478 100644
--- a/contrib/tools/python3/src/Objects/stringlib/codecs.h
+++ b/contrib/tools/python3/Objects/stringlib/codecs.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/count.h b/contrib/tools/python3/Objects/stringlib/count.h
index e20edcd104b..e20edcd104b 100644
--- a/contrib/tools/python3/src/Objects/stringlib/count.h
+++ b/contrib/tools/python3/Objects/stringlib/count.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/ctype.h b/contrib/tools/python3/Objects/stringlib/ctype.h
index 9b319b07d11..9b319b07d11 100644
--- a/contrib/tools/python3/src/Objects/stringlib/ctype.h
+++ b/contrib/tools/python3/Objects/stringlib/ctype.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/eq.h b/contrib/tools/python3/Objects/stringlib/eq.h
index 2eac4baf5ca..2eac4baf5ca 100644
--- a/contrib/tools/python3/src/Objects/stringlib/eq.h
+++ b/contrib/tools/python3/Objects/stringlib/eq.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/fastsearch.h b/contrib/tools/python3/Objects/stringlib/fastsearch.h
index 257b7bd6788..257b7bd6788 100644
--- a/contrib/tools/python3/src/Objects/stringlib/fastsearch.h
+++ b/contrib/tools/python3/Objects/stringlib/fastsearch.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/find.h b/contrib/tools/python3/Objects/stringlib/find.h
index 509b9297396..509b9297396 100644
--- a/contrib/tools/python3/src/Objects/stringlib/find.h
+++ b/contrib/tools/python3/Objects/stringlib/find.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/find_max_char.h b/contrib/tools/python3/Objects/stringlib/find_max_char.h
index b9ffdfc2e35..b9ffdfc2e35 100644
--- a/contrib/tools/python3/src/Objects/stringlib/find_max_char.h
+++ b/contrib/tools/python3/Objects/stringlib/find_max_char.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/join.h b/contrib/tools/python3/Objects/stringlib/join.h
index de6bd83ffe4..de6bd83ffe4 100644
--- a/contrib/tools/python3/src/Objects/stringlib/join.h
+++ b/contrib/tools/python3/Objects/stringlib/join.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/localeutil.h b/contrib/tools/python3/Objects/stringlib/localeutil.h
index d77715ec0de..d77715ec0de 100644
--- a/contrib/tools/python3/src/Objects/stringlib/localeutil.h
+++ b/contrib/tools/python3/Objects/stringlib/localeutil.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/partition.h b/contrib/tools/python3/Objects/stringlib/partition.h
index bcc217697b2..bcc217697b2 100644
--- a/contrib/tools/python3/src/Objects/stringlib/partition.h
+++ b/contrib/tools/python3/Objects/stringlib/partition.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/replace.h b/contrib/tools/python3/Objects/stringlib/replace.h
index 123c9f850f5..123c9f850f5 100644
--- a/contrib/tools/python3/src/Objects/stringlib/replace.h
+++ b/contrib/tools/python3/Objects/stringlib/replace.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/split.h b/contrib/tools/python3/Objects/stringlib/split.h
index 0c11b7214e9..0c11b7214e9 100644
--- a/contrib/tools/python3/src/Objects/stringlib/split.h
+++ b/contrib/tools/python3/Objects/stringlib/split.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/stringdefs.h b/contrib/tools/python3/Objects/stringlib/stringdefs.h
index 484b98b7291..484b98b7291 100644
--- a/contrib/tools/python3/src/Objects/stringlib/stringdefs.h
+++ b/contrib/tools/python3/Objects/stringlib/stringdefs.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/transmogrify.h b/contrib/tools/python3/Objects/stringlib/transmogrify.h
index 71099bb586e..71099bb586e 100644
--- a/contrib/tools/python3/src/Objects/stringlib/transmogrify.h
+++ b/contrib/tools/python3/Objects/stringlib/transmogrify.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/ucs1lib.h b/contrib/tools/python3/Objects/stringlib/ucs1lib.h
index 1b9b65ecbaa..1b9b65ecbaa 100644
--- a/contrib/tools/python3/src/Objects/stringlib/ucs1lib.h
+++ b/contrib/tools/python3/Objects/stringlib/ucs1lib.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/ucs2lib.h b/contrib/tools/python3/Objects/stringlib/ucs2lib.h
index 4b49bbb31d7..4b49bbb31d7 100644
--- a/contrib/tools/python3/src/Objects/stringlib/ucs2lib.h
+++ b/contrib/tools/python3/Objects/stringlib/ucs2lib.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/ucs4lib.h b/contrib/tools/python3/Objects/stringlib/ucs4lib.h
index def4ca5d17d..def4ca5d17d 100644
--- a/contrib/tools/python3/src/Objects/stringlib/ucs4lib.h
+++ b/contrib/tools/python3/Objects/stringlib/ucs4lib.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/undef.h b/contrib/tools/python3/Objects/stringlib/undef.h
index cc873a2ec4e..cc873a2ec4e 100644
--- a/contrib/tools/python3/src/Objects/stringlib/undef.h
+++ b/contrib/tools/python3/Objects/stringlib/undef.h
diff --git a/contrib/tools/python3/src/Objects/stringlib/unicode_format.h b/contrib/tools/python3/Objects/stringlib/unicode_format.h
index ccd7c77c0a0..ccd7c77c0a0 100644
--- a/contrib/tools/python3/src/Objects/stringlib/unicode_format.h
+++ b/contrib/tools/python3/Objects/stringlib/unicode_format.h
diff --git a/contrib/tools/python3/src/Objects/structseq.c b/contrib/tools/python3/Objects/structseq.c
index 8b189595710..8b189595710 100644
--- a/contrib/tools/python3/src/Objects/structseq.c
+++ b/contrib/tools/python3/Objects/structseq.c
diff --git a/contrib/tools/python3/src/Objects/tupleobject.c b/contrib/tools/python3/Objects/tupleobject.c
index 991edcc8667..991edcc8667 100644
--- a/contrib/tools/python3/src/Objects/tupleobject.c
+++ b/contrib/tools/python3/Objects/tupleobject.c
diff --git a/contrib/tools/python3/src/Objects/typeobject.c b/contrib/tools/python3/Objects/typeobject.c
index 8aa07d85281..8aa07d85281 100644
--- a/contrib/tools/python3/src/Objects/typeobject.c
+++ b/contrib/tools/python3/Objects/typeobject.c
diff --git a/contrib/tools/python3/src/Objects/typeslots.inc b/contrib/tools/python3/Objects/typeslots.inc
index 896daa7d806..896daa7d806 100644
--- a/contrib/tools/python3/src/Objects/typeslots.inc
+++ b/contrib/tools/python3/Objects/typeslots.inc
diff --git a/contrib/tools/python3/src/Objects/typevarobject.c b/contrib/tools/python3/Objects/typevarobject.c
index db9c2191d60..db9c2191d60 100644
--- a/contrib/tools/python3/src/Objects/typevarobject.c
+++ b/contrib/tools/python3/Objects/typevarobject.c
diff --git a/contrib/tools/python3/src/Objects/unicodectype.c b/contrib/tools/python3/Objects/unicodectype.c
index aa5c5b2a4ad..aa5c5b2a4ad 100644
--- a/contrib/tools/python3/src/Objects/unicodectype.c
+++ b/contrib/tools/python3/Objects/unicodectype.c
diff --git a/contrib/tools/python3/src/Objects/unicodeobject.c b/contrib/tools/python3/Objects/unicodeobject.c
index f6787c8f8aa..f6787c8f8aa 100644
--- a/contrib/tools/python3/src/Objects/unicodeobject.c
+++ b/contrib/tools/python3/Objects/unicodeobject.c
diff --git a/contrib/tools/python3/src/Objects/unicodetype_db.h b/contrib/tools/python3/Objects/unicodetype_db.h
index 22f8243eaec..22f8243eaec 100644
--- a/contrib/tools/python3/src/Objects/unicodetype_db.h
+++ b/contrib/tools/python3/Objects/unicodetype_db.h
diff --git a/contrib/tools/python3/src/Objects/unionobject.c b/contrib/tools/python3/Objects/unionobject.c
index f509a161bb9..f509a161bb9 100644
--- a/contrib/tools/python3/src/Objects/unionobject.c
+++ b/contrib/tools/python3/Objects/unionobject.c
diff --git a/contrib/tools/python3/src/Objects/weakrefobject.c b/contrib/tools/python3/Objects/weakrefobject.c
index aee79fc1410..aee79fc1410 100644
--- a/contrib/tools/python3/src/Objects/weakrefobject.c
+++ b/contrib/tools/python3/Objects/weakrefobject.c
diff --git a/contrib/tools/python3/src/PC/WinMain.c b/contrib/tools/python3/PC/WinMain.c
index 07e21ce3e9f..07e21ce3e9f 100644
--- a/contrib/tools/python3/src/PC/WinMain.c
+++ b/contrib/tools/python3/PC/WinMain.c
diff --git a/contrib/tools/python3/src/PC/clinic/msvcrtmodule.c.h b/contrib/tools/python3/PC/clinic/msvcrtmodule.c.h
index b708c6cdde7..b708c6cdde7 100644
--- a/contrib/tools/python3/src/PC/clinic/msvcrtmodule.c.h
+++ b/contrib/tools/python3/PC/clinic/msvcrtmodule.c.h
diff --git a/contrib/tools/python3/src/PC/clinic/winreg.c.h b/contrib/tools/python3/PC/clinic/winreg.c.h
index 4109c85276f..4109c85276f 100644
--- a/contrib/tools/python3/src/PC/clinic/winreg.c.h
+++ b/contrib/tools/python3/PC/clinic/winreg.c.h
diff --git a/contrib/tools/python3/src/PC/clinic/winsound.c.h b/contrib/tools/python3/PC/clinic/winsound.c.h
index 241d547c267..241d547c267 100644
--- a/contrib/tools/python3/src/PC/clinic/winsound.c.h
+++ b/contrib/tools/python3/PC/clinic/winsound.c.h
diff --git a/contrib/tools/python3/src/PC/errmap.h b/contrib/tools/python3/PC/errmap.h
index a7489ab75c6..a7489ab75c6 100644
--- a/contrib/tools/python3/src/PC/errmap.h
+++ b/contrib/tools/python3/PC/errmap.h
diff --git a/contrib/tools/python3/src/PC/invalid_parameter_handler.c b/contrib/tools/python3/PC/invalid_parameter_handler.c
index d634710cbec..d634710cbec 100644
--- a/contrib/tools/python3/src/PC/invalid_parameter_handler.c
+++ b/contrib/tools/python3/PC/invalid_parameter_handler.c
diff --git a/contrib/tools/python3/src/PC/msvcrtmodule.c b/contrib/tools/python3/PC/msvcrtmodule.c
index 53ef26b732f..53ef26b732f 100644
--- a/contrib/tools/python3/src/PC/msvcrtmodule.c
+++ b/contrib/tools/python3/PC/msvcrtmodule.c
diff --git a/contrib/tools/python3/src/PC/pyconfig.h b/contrib/tools/python3/PC/pyconfig.h
index db9e8a8855d..db9e8a8855d 100644
--- a/contrib/tools/python3/src/PC/pyconfig.h
+++ b/contrib/tools/python3/PC/pyconfig.h
diff --git a/contrib/tools/python3/src/PC/winreg.c b/contrib/tools/python3/PC/winreg.c
index e2d5322f458..e2d5322f458 100644
--- a/contrib/tools/python3/src/PC/winreg.c
+++ b/contrib/tools/python3/PC/winreg.c
diff --git a/contrib/tools/python3/src/PC/winsound.c b/contrib/tools/python3/PC/winsound.c
index 68a917810f8..68a917810f8 100644
--- a/contrib/tools/python3/src/PC/winsound.c
+++ b/contrib/tools/python3/PC/winsound.c
diff --git a/contrib/tools/python3/src/Parser/action_helpers.c b/contrib/tools/python3/Parser/action_helpers.c
index e68a9cac259..e68a9cac259 100644
--- a/contrib/tools/python3/src/Parser/action_helpers.c
+++ b/contrib/tools/python3/Parser/action_helpers.c
diff --git a/contrib/tools/python3/src/Parser/myreadline.c b/contrib/tools/python3/Parser/myreadline.c
index 7074aba74b7..7074aba74b7 100644
--- a/contrib/tools/python3/src/Parser/myreadline.c
+++ b/contrib/tools/python3/Parser/myreadline.c
diff --git a/contrib/tools/python3/src/Parser/parser.c b/contrib/tools/python3/Parser/parser.c
index 25b4ead7819..25b4ead7819 100644
--- a/contrib/tools/python3/src/Parser/parser.c
+++ b/contrib/tools/python3/Parser/parser.c
diff --git a/contrib/tools/python3/src/Parser/peg_api.c b/contrib/tools/python3/Parser/peg_api.c
index 1487ac4ff85..1487ac4ff85 100644
--- a/contrib/tools/python3/src/Parser/peg_api.c
+++ b/contrib/tools/python3/Parser/peg_api.c
diff --git a/contrib/tools/python3/src/Parser/pegen.c b/contrib/tools/python3/Parser/pegen.c
index cbceaae599d..cbceaae599d 100644
--- a/contrib/tools/python3/src/Parser/pegen.c
+++ b/contrib/tools/python3/Parser/pegen.c
diff --git a/contrib/tools/python3/src/Parser/pegen.h b/contrib/tools/python3/Parser/pegen.h
index c2a3e02b2e0..c2a3e02b2e0 100644
--- a/contrib/tools/python3/src/Parser/pegen.h
+++ b/contrib/tools/python3/Parser/pegen.h
diff --git a/contrib/tools/python3/src/Parser/pegen_errors.c b/contrib/tools/python3/Parser/pegen_errors.c
index cefec5d2757..cefec5d2757 100644
--- a/contrib/tools/python3/src/Parser/pegen_errors.c
+++ b/contrib/tools/python3/Parser/pegen_errors.c
diff --git a/contrib/tools/python3/src/Parser/string_parser.c b/contrib/tools/python3/Parser/string_parser.c
index 65c320c2173..65c320c2173 100644
--- a/contrib/tools/python3/src/Parser/string_parser.c
+++ b/contrib/tools/python3/Parser/string_parser.c
diff --git a/contrib/tools/python3/src/Parser/string_parser.h b/contrib/tools/python3/Parser/string_parser.h
index 0b34de1b4e4..0b34de1b4e4 100644
--- a/contrib/tools/python3/src/Parser/string_parser.h
+++ b/contrib/tools/python3/Parser/string_parser.h
diff --git a/contrib/tools/python3/src/Parser/token.c b/contrib/tools/python3/Parser/token.c
index 2bc963a91c7..2bc963a91c7 100644
--- a/contrib/tools/python3/src/Parser/token.c
+++ b/contrib/tools/python3/Parser/token.c
diff --git a/contrib/tools/python3/src/Parser/tokenizer.c b/contrib/tools/python3/Parser/tokenizer.c
index 27d49c6f89e..27d49c6f89e 100644
--- a/contrib/tools/python3/src/Parser/tokenizer.c
+++ b/contrib/tools/python3/Parser/tokenizer.c
diff --git a/contrib/tools/python3/src/Parser/tokenizer.h b/contrib/tools/python3/Parser/tokenizer.h
index 1e1daa3648f..1e1daa3648f 100644
--- a/contrib/tools/python3/src/Parser/tokenizer.h
+++ b/contrib/tools/python3/Parser/tokenizer.h
diff --git a/contrib/tools/python3/src/Programs/python.c b/contrib/tools/python3/Programs/python.c
index 84148f7767a..84148f7767a 100644
--- a/contrib/tools/python3/src/Programs/python.c
+++ b/contrib/tools/python3/Programs/python.c
diff --git a/contrib/tools/python3/src/Python/Python-ast.c b/contrib/tools/python3/Python/Python-ast.c
index 6c95f07c386..6c95f07c386 100644
--- a/contrib/tools/python3/src/Python/Python-ast.c
+++ b/contrib/tools/python3/Python/Python-ast.c
diff --git a/contrib/tools/python3/src/Python/Python-tokenize.c b/contrib/tools/python3/Python/Python-tokenize.c
index 179f71aa1f5..179f71aa1f5 100644
--- a/contrib/tools/python3/src/Python/Python-tokenize.c
+++ b/contrib/tools/python3/Python/Python-tokenize.c
diff --git a/contrib/tools/python3/src/Python/_warnings.c b/contrib/tools/python3/Python/_warnings.c
index 1f91edbf5cb..1f91edbf5cb 100644
--- a/contrib/tools/python3/src/Python/_warnings.c
+++ b/contrib/tools/python3/Python/_warnings.c
diff --git a/contrib/tools/python3/src/Python/asdl.c b/contrib/tools/python3/Python/asdl.c
index a7f2180c88e..a7f2180c88e 100644
--- a/contrib/tools/python3/src/Python/asdl.c
+++ b/contrib/tools/python3/Python/asdl.c
diff --git a/contrib/tools/python3/Python/asm_trampoline.S b/contrib/tools/python3/Python/asm_trampoline.S
new file mode 100644
index 00000000000..460707717df
--- /dev/null
+++ b/contrib/tools/python3/Python/asm_trampoline.S
@@ -0,0 +1,28 @@
+ .text
+ .globl _Py_trampoline_func_start
+# The following assembly is equivalent to:
+# PyObject *
+# trampoline(PyThreadState *ts, _PyInterpreterFrame *f,
+# int throwflag, py_evaluator evaluator)
+# {
+# return evaluator(ts, f, throwflag);
+# }
+_Py_trampoline_func_start:
+#ifdef __x86_64__
+ sub $8, %rsp
+ call *%rcx
+ add $8, %rsp
+ ret
+#endif // __x86_64__
+#if defined(__aarch64__) && defined(__AARCH64EL__) && !defined(__ILP32__)
+ // ARM64 little endian, 64bit ABI
+ // generate with aarch64-linux-gnu-gcc 12.1
+ stp x29, x30, [sp, -16]!
+ mov x29, sp
+ blr x3
+ ldp x29, x30, [sp], 16
+ ret
+#endif
+ .globl _Py_trampoline_func_end
+_Py_trampoline_func_end:
+ .section .note.GNU-stack,"",@progbits
diff --git a/contrib/tools/python3/src/Python/assemble.c b/contrib/tools/python3/Python/assemble.c
index 8789d8ef978..8789d8ef978 100644
--- a/contrib/tools/python3/src/Python/assemble.c
+++ b/contrib/tools/python3/Python/assemble.c
diff --git a/contrib/tools/python3/src/Python/ast.c b/contrib/tools/python3/Python/ast.c
index 82d7beec0ee..82d7beec0ee 100644
--- a/contrib/tools/python3/src/Python/ast.c
+++ b/contrib/tools/python3/Python/ast.c
diff --git a/contrib/tools/python3/src/Python/ast_opt.c b/contrib/tools/python3/Python/ast_opt.c
index f8c4a951323..f8c4a951323 100644
--- a/contrib/tools/python3/src/Python/ast_opt.c
+++ b/contrib/tools/python3/Python/ast_opt.c
diff --git a/contrib/tools/python3/src/Python/ast_unparse.c b/contrib/tools/python3/Python/ast_unparse.c
index 8aff045101c..8aff045101c 100644
--- a/contrib/tools/python3/src/Python/ast_unparse.c
+++ b/contrib/tools/python3/Python/ast_unparse.c
diff --git a/contrib/tools/python3/src/Python/bltinmodule.c b/contrib/tools/python3/Python/bltinmodule.c
index 84fbc33a48c..84fbc33a48c 100644
--- a/contrib/tools/python3/src/Python/bltinmodule.c
+++ b/contrib/tools/python3/Python/bltinmodule.c
diff --git a/contrib/tools/python3/src/Python/bootstrap_hash.c b/contrib/tools/python3/Python/bootstrap_hash.c
index da85db35c14..da85db35c14 100644
--- a/contrib/tools/python3/src/Python/bootstrap_hash.c
+++ b/contrib/tools/python3/Python/bootstrap_hash.c
diff --git a/contrib/tools/python3/src/Python/ceval.c b/contrib/tools/python3/Python/ceval.c
index 6110883ca0e..6110883ca0e 100644
--- a/contrib/tools/python3/src/Python/ceval.c
+++ b/contrib/tools/python3/Python/ceval.c
diff --git a/contrib/tools/python3/src/Python/ceval_gil.c b/contrib/tools/python3/Python/ceval_gil.c
index c1ab5883568..c1ab5883568 100644
--- a/contrib/tools/python3/src/Python/ceval_gil.c
+++ b/contrib/tools/python3/Python/ceval_gil.c
diff --git a/contrib/tools/python3/src/Python/ceval_macros.h b/contrib/tools/python3/Python/ceval_macros.h
index fccf9088cbd..fccf9088cbd 100644
--- a/contrib/tools/python3/src/Python/ceval_macros.h
+++ b/contrib/tools/python3/Python/ceval_macros.h
diff --git a/contrib/tools/python3/src/Python/clinic/Python-tokenize.c.h b/contrib/tools/python3/Python/clinic/Python-tokenize.c.h
index 28f5075826e..28f5075826e 100644
--- a/contrib/tools/python3/src/Python/clinic/Python-tokenize.c.h
+++ b/contrib/tools/python3/Python/clinic/Python-tokenize.c.h
diff --git a/contrib/tools/python3/src/Python/clinic/_warnings.c.h b/contrib/tools/python3/Python/clinic/_warnings.c.h
index 432e554af85..432e554af85 100644
--- a/contrib/tools/python3/src/Python/clinic/_warnings.c.h
+++ b/contrib/tools/python3/Python/clinic/_warnings.c.h
diff --git a/contrib/tools/python3/src/Python/clinic/bltinmodule.c.h b/contrib/tools/python3/Python/clinic/bltinmodule.c.h
index b77b4a1e4b4..b77b4a1e4b4 100644
--- a/contrib/tools/python3/src/Python/clinic/bltinmodule.c.h
+++ b/contrib/tools/python3/Python/clinic/bltinmodule.c.h
diff --git a/contrib/tools/python3/src/Python/clinic/context.c.h b/contrib/tools/python3/Python/clinic/context.c.h
index 27c375717bf..27c375717bf 100644
--- a/contrib/tools/python3/src/Python/clinic/context.c.h
+++ b/contrib/tools/python3/Python/clinic/context.c.h
diff --git a/contrib/tools/python3/src/Python/clinic/import.c.h b/contrib/tools/python3/Python/clinic/import.c.h
index cb74be6a422..cb74be6a422 100644
--- a/contrib/tools/python3/src/Python/clinic/import.c.h
+++ b/contrib/tools/python3/Python/clinic/import.c.h
diff --git a/contrib/tools/python3/src/Python/clinic/instrumentation.c.h b/contrib/tools/python3/Python/clinic/instrumentation.c.h
index cf3984ca24b..cf3984ca24b 100644
--- a/contrib/tools/python3/src/Python/clinic/instrumentation.c.h
+++ b/contrib/tools/python3/Python/clinic/instrumentation.c.h
diff --git a/contrib/tools/python3/src/Python/clinic/marshal.c.h b/contrib/tools/python3/Python/clinic/marshal.c.h
index a593b980544..a593b980544 100644
--- a/contrib/tools/python3/src/Python/clinic/marshal.c.h
+++ b/contrib/tools/python3/Python/clinic/marshal.c.h
diff --git a/contrib/tools/python3/src/Python/clinic/sysmodule.c.h b/contrib/tools/python3/Python/clinic/sysmodule.c.h
index 7a7c188bccc..7a7c188bccc 100644
--- a/contrib/tools/python3/src/Python/clinic/sysmodule.c.h
+++ b/contrib/tools/python3/Python/clinic/sysmodule.c.h
diff --git a/contrib/tools/python3/src/Python/clinic/traceback.c.h b/contrib/tools/python3/Python/clinic/traceback.c.h
index 3c344934971..3c344934971 100644
--- a/contrib/tools/python3/src/Python/clinic/traceback.c.h
+++ b/contrib/tools/python3/Python/clinic/traceback.c.h
diff --git a/contrib/tools/python3/src/Python/codecs.c b/contrib/tools/python3/Python/codecs.c
index 1983f56ba20..1983f56ba20 100644
--- a/contrib/tools/python3/src/Python/codecs.c
+++ b/contrib/tools/python3/Python/codecs.c
diff --git a/contrib/tools/python3/src/Python/compile.c b/contrib/tools/python3/Python/compile.c
index ddd7b5c795b..ddd7b5c795b 100644
--- a/contrib/tools/python3/src/Python/compile.c
+++ b/contrib/tools/python3/Python/compile.c
diff --git a/contrib/tools/python3/src/Python/condvar.h b/contrib/tools/python3/Python/condvar.h
index 4ddc5311cf8..4ddc5311cf8 100644
--- a/contrib/tools/python3/src/Python/condvar.h
+++ b/contrib/tools/python3/Python/condvar.h
diff --git a/contrib/tools/python3/src/Python/context.c b/contrib/tools/python3/Python/context.c
index 1ffae9871be..1ffae9871be 100644
--- a/contrib/tools/python3/src/Python/context.c
+++ b/contrib/tools/python3/Python/context.c
diff --git a/contrib/tools/python3/src/Python/deepfreeze/README.txt b/contrib/tools/python3/Python/deepfreeze/README.txt
index 276ab51143a..276ab51143a 100644
--- a/contrib/tools/python3/src/Python/deepfreeze/README.txt
+++ b/contrib/tools/python3/Python/deepfreeze/README.txt
diff --git a/contrib/tools/python3/src/Python/deepfreeze/deepfreeze.c b/contrib/tools/python3/Python/deepfreeze/deepfreeze.c
index d6ce3426b45..d6ce3426b45 100644
--- a/contrib/tools/python3/src/Python/deepfreeze/deepfreeze.c
+++ b/contrib/tools/python3/Python/deepfreeze/deepfreeze.c
diff --git a/contrib/tools/python3/src/Python/dtoa.c b/contrib/tools/python3/Python/dtoa.c
index c5e343b82f7..c5e343b82f7 100644
--- a/contrib/tools/python3/src/Python/dtoa.c
+++ b/contrib/tools/python3/Python/dtoa.c
diff --git a/contrib/tools/python3/src/Python/dynamic_annotations.c b/contrib/tools/python3/Python/dynamic_annotations.c
index 7febaa09df1..7febaa09df1 100644
--- a/contrib/tools/python3/src/Python/dynamic_annotations.c
+++ b/contrib/tools/python3/Python/dynamic_annotations.c
diff --git a/contrib/tools/python3/src/Python/dynload_shlib.c b/contrib/tools/python3/Python/dynload_shlib.c
index 6761bba4579..6761bba4579 100644
--- a/contrib/tools/python3/src/Python/dynload_shlib.c
+++ b/contrib/tools/python3/Python/dynload_shlib.c
diff --git a/contrib/tools/python3/src/Python/dynload_win.c b/contrib/tools/python3/Python/dynload_win.c
index acab05e2c6d..acab05e2c6d 100644
--- a/contrib/tools/python3/src/Python/dynload_win.c
+++ b/contrib/tools/python3/Python/dynload_win.c
diff --git a/contrib/tools/python3/src/Python/errors.c b/contrib/tools/python3/Python/errors.c
index 68e740425b6..68e740425b6 100644
--- a/contrib/tools/python3/src/Python/errors.c
+++ b/contrib/tools/python3/Python/errors.c
diff --git a/contrib/tools/python3/src/Python/fileutils.c b/contrib/tools/python3/Python/fileutils.c
index 45de2b891d9..45de2b891d9 100644
--- a/contrib/tools/python3/src/Python/fileutils.c
+++ b/contrib/tools/python3/Python/fileutils.c
diff --git a/contrib/tools/python3/src/Python/flowgraph.c b/contrib/tools/python3/Python/flowgraph.c
index fbbe053ae58..fbbe053ae58 100644
--- a/contrib/tools/python3/src/Python/flowgraph.c
+++ b/contrib/tools/python3/Python/flowgraph.c
diff --git a/contrib/tools/python3/src/Python/formatter_unicode.c b/contrib/tools/python3/Python/formatter_unicode.c
index 38e5f69bfb4..38e5f69bfb4 100644
--- a/contrib/tools/python3/src/Python/formatter_unicode.c
+++ b/contrib/tools/python3/Python/formatter_unicode.c
diff --git a/contrib/tools/python3/src/Python/frame.c b/contrib/tools/python3/Python/frame.c
index b84fd9b6a93..b84fd9b6a93 100644
--- a/contrib/tools/python3/src/Python/frame.c
+++ b/contrib/tools/python3/Python/frame.c
diff --git a/contrib/tools/python3/src/Python/frozen.c b/contrib/tools/python3/Python/frozen.c
index f8e0b8b065a..f8e0b8b065a 100644
--- a/contrib/tools/python3/src/Python/frozen.c
+++ b/contrib/tools/python3/Python/frozen.c
diff --git a/contrib/tools/python3/src/Python/frozen_modules/README.txt b/contrib/tools/python3/Python/frozen_modules/README.txt
index 795bb0efad3..795bb0efad3 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/README.txt
+++ b/contrib/tools/python3/Python/frozen_modules/README.txt
diff --git a/contrib/tools/python3/src/Python/frozen_modules/__hello__.h b/contrib/tools/python3/Python/frozen_modules/__hello__.h
index 3325f05298a..3325f05298a 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/__hello__.h
+++ b/contrib/tools/python3/Python/frozen_modules/__hello__.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/__phello__.h b/contrib/tools/python3/Python/frozen_modules/__phello__.h
index 70394ad9b82..70394ad9b82 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/__phello__.h
+++ b/contrib/tools/python3/Python/frozen_modules/__phello__.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/__phello__.ham.eggs.h b/contrib/tools/python3/Python/frozen_modules/__phello__.ham.eggs.h
index 26151b1ccfe..26151b1ccfe 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/__phello__.ham.eggs.h
+++ b/contrib/tools/python3/Python/frozen_modules/__phello__.ham.eggs.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/__phello__.ham.h b/contrib/tools/python3/Python/frozen_modules/__phello__.ham.h
index 04fbf313adc..04fbf313adc 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/__phello__.ham.h
+++ b/contrib/tools/python3/Python/frozen_modules/__phello__.ham.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/__phello__.spam.h b/contrib/tools/python3/Python/frozen_modules/__phello__.spam.h
index a9903d8224c..a9903d8224c 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/__phello__.spam.h
+++ b/contrib/tools/python3/Python/frozen_modules/__phello__.spam.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/_collections_abc.h b/contrib/tools/python3/Python/frozen_modules/_collections_abc.h
index 07817070698..07817070698 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/_collections_abc.h
+++ b/contrib/tools/python3/Python/frozen_modules/_collections_abc.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/_sitebuiltins.h b/contrib/tools/python3/Python/frozen_modules/_sitebuiltins.h
index 7569a3ac216..7569a3ac216 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/_sitebuiltins.h
+++ b/contrib/tools/python3/Python/frozen_modules/_sitebuiltins.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/abc.h b/contrib/tools/python3/Python/frozen_modules/abc.h
index ba88c8d67da..ba88c8d67da 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/abc.h
+++ b/contrib/tools/python3/Python/frozen_modules/abc.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/codecs.h b/contrib/tools/python3/Python/frozen_modules/codecs.h
index ad126ebe86f..ad126ebe86f 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/codecs.h
+++ b/contrib/tools/python3/Python/frozen_modules/codecs.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/frozen_only.h b/contrib/tools/python3/Python/frozen_modules/frozen_only.h
index 0fca6de55cc..0fca6de55cc 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/frozen_only.h
+++ b/contrib/tools/python3/Python/frozen_modules/frozen_only.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/genericpath.h b/contrib/tools/python3/Python/frozen_modules/genericpath.h
index cdbd57a934a..cdbd57a934a 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/genericpath.h
+++ b/contrib/tools/python3/Python/frozen_modules/genericpath.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/getpath.h b/contrib/tools/python3/Python/frozen_modules/getpath.h
index 1bc2a38dc05..1bc2a38dc05 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/getpath.h
+++ b/contrib/tools/python3/Python/frozen_modules/getpath.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/importlib._bootstrap.h b/contrib/tools/python3/Python/frozen_modules/importlib._bootstrap.h
index 20e6d2d6189..20e6d2d6189 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/importlib._bootstrap.h
+++ b/contrib/tools/python3/Python/frozen_modules/importlib._bootstrap.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/importlib._bootstrap_external.h b/contrib/tools/python3/Python/frozen_modules/importlib._bootstrap_external.h
index 0fa4dc9016e..0fa4dc9016e 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/importlib._bootstrap_external.h
+++ b/contrib/tools/python3/Python/frozen_modules/importlib._bootstrap_external.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/importlib.machinery.h b/contrib/tools/python3/Python/frozen_modules/importlib.machinery.h
index e655b7ae5ec..e655b7ae5ec 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/importlib.machinery.h
+++ b/contrib/tools/python3/Python/frozen_modules/importlib.machinery.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/importlib.util.h b/contrib/tools/python3/Python/frozen_modules/importlib.util.h
index 22663178b90..22663178b90 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/importlib.util.h
+++ b/contrib/tools/python3/Python/frozen_modules/importlib.util.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/io.h b/contrib/tools/python3/Python/frozen_modules/io.h
index a0c9f67c889..a0c9f67c889 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/io.h
+++ b/contrib/tools/python3/Python/frozen_modules/io.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/ntpath.h b/contrib/tools/python3/Python/frozen_modules/ntpath.h
index ce208ace9e1..ce208ace9e1 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/ntpath.h
+++ b/contrib/tools/python3/Python/frozen_modules/ntpath.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/os.h b/contrib/tools/python3/Python/frozen_modules/os.h
index 455e9a35749..455e9a35749 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/os.h
+++ b/contrib/tools/python3/Python/frozen_modules/os.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/posixpath.h b/contrib/tools/python3/Python/frozen_modules/posixpath.h
index 76f4e739ffa..76f4e739ffa 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/posixpath.h
+++ b/contrib/tools/python3/Python/frozen_modules/posixpath.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/runpy.h b/contrib/tools/python3/Python/frozen_modules/runpy.h
index c192f57021d..c192f57021d 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/runpy.h
+++ b/contrib/tools/python3/Python/frozen_modules/runpy.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/site.h b/contrib/tools/python3/Python/frozen_modules/site.h
index df8b6f839f6..df8b6f839f6 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/site.h
+++ b/contrib/tools/python3/Python/frozen_modules/site.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/stat.h b/contrib/tools/python3/Python/frozen_modules/stat.h
index ae8573d7b7b..ae8573d7b7b 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/stat.h
+++ b/contrib/tools/python3/Python/frozen_modules/stat.h
diff --git a/contrib/tools/python3/src/Python/frozen_modules/zipimport.h b/contrib/tools/python3/Python/frozen_modules/zipimport.h
index 5f2f63046dc..5f2f63046dc 100644
--- a/contrib/tools/python3/src/Python/frozen_modules/zipimport.h
+++ b/contrib/tools/python3/Python/frozen_modules/zipimport.h
diff --git a/contrib/tools/python3/src/Python/future.c b/contrib/tools/python3/Python/future.c
index d56f7330964..d56f7330964 100644
--- a/contrib/tools/python3/src/Python/future.c
+++ b/contrib/tools/python3/Python/future.c
diff --git a/contrib/tools/python3/src/Python/generated_cases.c.h b/contrib/tools/python3/Python/generated_cases.c.h
index ea17c0410bc..ea17c0410bc 100644
--- a/contrib/tools/python3/src/Python/generated_cases.c.h
+++ b/contrib/tools/python3/Python/generated_cases.c.h
diff --git a/contrib/tools/python3/src/Python/getargs.c b/contrib/tools/python3/Python/getargs.c
index 066739f21fc..066739f21fc 100644
--- a/contrib/tools/python3/src/Python/getargs.c
+++ b/contrib/tools/python3/Python/getargs.c
diff --git a/contrib/tools/python3/src/Python/getcompiler.c b/contrib/tools/python3/Python/getcompiler.c
index a5d26239e87..a5d26239e87 100644
--- a/contrib/tools/python3/src/Python/getcompiler.c
+++ b/contrib/tools/python3/Python/getcompiler.c
diff --git a/contrib/tools/python3/src/Python/getcopyright.c b/contrib/tools/python3/Python/getcopyright.c
index c1f1aad9b84..c1f1aad9b84 100644
--- a/contrib/tools/python3/src/Python/getcopyright.c
+++ b/contrib/tools/python3/Python/getcopyright.c
diff --git a/contrib/tools/python3/src/Python/getopt.c b/contrib/tools/python3/Python/getopt.c
index 4135bf1446e..4135bf1446e 100644
--- a/contrib/tools/python3/src/Python/getopt.c
+++ b/contrib/tools/python3/Python/getopt.c
diff --git a/contrib/tools/python3/src/Python/getplatform.c b/contrib/tools/python3/Python/getplatform.c
index 81a0f7ac537..81a0f7ac537 100644
--- a/contrib/tools/python3/src/Python/getplatform.c
+++ b/contrib/tools/python3/Python/getplatform.c
diff --git a/contrib/tools/python3/src/Python/getversion.c b/contrib/tools/python3/Python/getversion.c
index 5db836ab4bf..5db836ab4bf 100644
--- a/contrib/tools/python3/src/Python/getversion.c
+++ b/contrib/tools/python3/Python/getversion.c
diff --git a/contrib/tools/python3/src/Python/hamt.c b/contrib/tools/python3/Python/hamt.c
index 8cb94641bef..8cb94641bef 100644
--- a/contrib/tools/python3/src/Python/hamt.c
+++ b/contrib/tools/python3/Python/hamt.c
diff --git a/contrib/tools/python3/src/Python/hashtable.c b/contrib/tools/python3/Python/hashtable.c
index 9f005c7ad96..9f005c7ad96 100644
--- a/contrib/tools/python3/src/Python/hashtable.c
+++ b/contrib/tools/python3/Python/hashtable.c
diff --git a/contrib/tools/python3/src/Python/import.c b/contrib/tools/python3/Python/import.c
index 76b418840e7..76b418840e7 100644
--- a/contrib/tools/python3/src/Python/import.c
+++ b/contrib/tools/python3/Python/import.c
diff --git a/contrib/tools/python3/src/Python/importdl.c b/contrib/tools/python3/Python/importdl.c
index 3a3a30ddbdc..3a3a30ddbdc 100644
--- a/contrib/tools/python3/src/Python/importdl.c
+++ b/contrib/tools/python3/Python/importdl.c
diff --git a/contrib/tools/python3/src/Python/importdl.h b/contrib/tools/python3/Python/importdl.h
index 26d18b626df..26d18b626df 100644
--- a/contrib/tools/python3/src/Python/importdl.h
+++ b/contrib/tools/python3/Python/importdl.h
diff --git a/contrib/tools/python3/src/Python/initconfig.c b/contrib/tools/python3/Python/initconfig.c
index a1256a542a6..a1256a542a6 100644
--- a/contrib/tools/python3/src/Python/initconfig.c
+++ b/contrib/tools/python3/Python/initconfig.c
diff --git a/contrib/tools/python3/src/Python/instrumentation.c b/contrib/tools/python3/Python/instrumentation.c
index a6ff7a8a985..a6ff7a8a985 100644
--- a/contrib/tools/python3/src/Python/instrumentation.c
+++ b/contrib/tools/python3/Python/instrumentation.c
diff --git a/contrib/tools/python3/src/Python/intrinsics.c b/contrib/tools/python3/Python/intrinsics.c
index c6f5ac5402d..c6f5ac5402d 100644
--- a/contrib/tools/python3/src/Python/intrinsics.c
+++ b/contrib/tools/python3/Python/intrinsics.c
diff --git a/contrib/tools/python3/src/Python/legacy_tracing.c b/contrib/tools/python3/Python/legacy_tracing.c
index 43fa5910ef6..43fa5910ef6 100644
--- a/contrib/tools/python3/src/Python/legacy_tracing.c
+++ b/contrib/tools/python3/Python/legacy_tracing.c
diff --git a/contrib/tools/python3/src/Python/marshal.c b/contrib/tools/python3/Python/marshal.c
index 90953cbb728..90953cbb728 100644
--- a/contrib/tools/python3/src/Python/marshal.c
+++ b/contrib/tools/python3/Python/marshal.c
diff --git a/contrib/tools/python3/src/Python/modsupport.c b/contrib/tools/python3/Python/modsupport.c
index df4ae35a525..df4ae35a525 100644
--- a/contrib/tools/python3/src/Python/modsupport.c
+++ b/contrib/tools/python3/Python/modsupport.c
diff --git a/contrib/tools/python3/src/Python/mysnprintf.c b/contrib/tools/python3/Python/mysnprintf.c
index 2a505d14f82..2a505d14f82 100644
--- a/contrib/tools/python3/src/Python/mysnprintf.c
+++ b/contrib/tools/python3/Python/mysnprintf.c
diff --git a/contrib/tools/python3/src/Python/mystrtoul.c b/contrib/tools/python3/Python/mystrtoul.c
index e6fe154eed6..e6fe154eed6 100644
--- a/contrib/tools/python3/src/Python/mystrtoul.c
+++ b/contrib/tools/python3/Python/mystrtoul.c
diff --git a/contrib/tools/python3/src/Python/opcode_metadata.h b/contrib/tools/python3/Python/opcode_metadata.h
index f9b1c928cd4..f9b1c928cd4 100644
--- a/contrib/tools/python3/src/Python/opcode_metadata.h
+++ b/contrib/tools/python3/Python/opcode_metadata.h
diff --git a/contrib/tools/python3/src/Python/opcode_targets.h b/contrib/tools/python3/Python/opcode_targets.h
index 3add0636271..3add0636271 100644
--- a/contrib/tools/python3/src/Python/opcode_targets.h
+++ b/contrib/tools/python3/Python/opcode_targets.h
diff --git a/contrib/tools/python3/src/Python/pathconfig.c b/contrib/tools/python3/Python/pathconfig.c
index be0f97c4b20..be0f97c4b20 100644
--- a/contrib/tools/python3/src/Python/pathconfig.c
+++ b/contrib/tools/python3/Python/pathconfig.c
diff --git a/contrib/tools/python3/src/Python/perf_trampoline.c b/contrib/tools/python3/Python/perf_trampoline.c
index ea9dc83dd0f..ea9dc83dd0f 100644
--- a/contrib/tools/python3/src/Python/perf_trampoline.c
+++ b/contrib/tools/python3/Python/perf_trampoline.c
diff --git a/contrib/tools/python3/src/Python/preconfig.c b/contrib/tools/python3/Python/preconfig.c
index 77a86d651eb..77a86d651eb 100644
--- a/contrib/tools/python3/src/Python/preconfig.c
+++ b/contrib/tools/python3/Python/preconfig.c
diff --git a/contrib/tools/python3/src/Python/pyarena.c b/contrib/tools/python3/Python/pyarena.c
index ead03370d15..ead03370d15 100644
--- a/contrib/tools/python3/src/Python/pyarena.c
+++ b/contrib/tools/python3/Python/pyarena.c
diff --git a/contrib/tools/python3/src/Python/pyctype.c b/contrib/tools/python3/Python/pyctype.c
index da117d58fd0..da117d58fd0 100644
--- a/contrib/tools/python3/src/Python/pyctype.c
+++ b/contrib/tools/python3/Python/pyctype.c
diff --git a/contrib/tools/python3/src/Python/pyfpe.c b/contrib/tools/python3/Python/pyfpe.c
index 9b1260f687a..9b1260f687a 100644
--- a/contrib/tools/python3/src/Python/pyfpe.c
+++ b/contrib/tools/python3/Python/pyfpe.c
diff --git a/contrib/tools/python3/src/Python/pyhash.c b/contrib/tools/python3/Python/pyhash.c
index d5ac9f83be6..d5ac9f83be6 100644
--- a/contrib/tools/python3/src/Python/pyhash.c
+++ b/contrib/tools/python3/Python/pyhash.c
diff --git a/contrib/tools/python3/src/Python/pylifecycle.c b/contrib/tools/python3/Python/pylifecycle.c
index a0130fde15d..a0130fde15d 100644
--- a/contrib/tools/python3/src/Python/pylifecycle.c
+++ b/contrib/tools/python3/Python/pylifecycle.c
diff --git a/contrib/tools/python3/src/Python/pymath.c b/contrib/tools/python3/Python/pymath.c
index e7d0161ff94..e7d0161ff94 100644
--- a/contrib/tools/python3/src/Python/pymath.c
+++ b/contrib/tools/python3/Python/pymath.c
diff --git a/contrib/tools/python3/src/Python/pystate.c b/contrib/tools/python3/Python/pystate.c
index 0ebbdfbfb41..0ebbdfbfb41 100644
--- a/contrib/tools/python3/src/Python/pystate.c
+++ b/contrib/tools/python3/Python/pystate.c
diff --git a/contrib/tools/python3/src/Python/pystrcmp.c b/contrib/tools/python3/Python/pystrcmp.c
index 9224ce4c706..9224ce4c706 100644
--- a/contrib/tools/python3/src/Python/pystrcmp.c
+++ b/contrib/tools/python3/Python/pystrcmp.c
diff --git a/contrib/tools/python3/src/Python/pystrhex.c b/contrib/tools/python3/Python/pystrhex.c
index e4f06d76639..e4f06d76639 100644
--- a/contrib/tools/python3/src/Python/pystrhex.c
+++ b/contrib/tools/python3/Python/pystrhex.c
diff --git a/contrib/tools/python3/src/Python/pystrtod.c b/contrib/tools/python3/Python/pystrtod.c
index 9bb060e3d11..9bb060e3d11 100644
--- a/contrib/tools/python3/src/Python/pystrtod.c
+++ b/contrib/tools/python3/Python/pystrtod.c
diff --git a/contrib/tools/python3/src/Python/pythonrun.c b/contrib/tools/python3/Python/pythonrun.c
index 5f3d249df45..5f3d249df45 100644
--- a/contrib/tools/python3/src/Python/pythonrun.c
+++ b/contrib/tools/python3/Python/pythonrun.c
diff --git a/contrib/tools/python3/src/Python/pytime.c b/contrib/tools/python3/Python/pytime.c
index acd1842056a..acd1842056a 100644
--- a/contrib/tools/python3/src/Python/pytime.c
+++ b/contrib/tools/python3/Python/pytime.c
diff --git a/contrib/tools/python3/src/Python/specialize.c b/contrib/tools/python3/Python/specialize.c
index 2c0d99b04ed..2c0d99b04ed 100644
--- a/contrib/tools/python3/src/Python/specialize.c
+++ b/contrib/tools/python3/Python/specialize.c
diff --git a/contrib/tools/python3/src/Python/stdlib_module_names.h b/contrib/tools/python3/Python/stdlib_module_names.h
index ed4a0ac2dd3..ed4a0ac2dd3 100644
--- a/contrib/tools/python3/src/Python/stdlib_module_names.h
+++ b/contrib/tools/python3/Python/stdlib_module_names.h
diff --git a/contrib/tools/python3/src/Python/structmember.c b/contrib/tools/python3/Python/structmember.c
index ebebaa0a034..ebebaa0a034 100644
--- a/contrib/tools/python3/src/Python/structmember.c
+++ b/contrib/tools/python3/Python/structmember.c
diff --git a/contrib/tools/python3/src/Python/suggestions.c b/contrib/tools/python3/Python/suggestions.c
index ad58393490e..ad58393490e 100644
--- a/contrib/tools/python3/src/Python/suggestions.c
+++ b/contrib/tools/python3/Python/suggestions.c
diff --git a/contrib/tools/python3/src/Python/symtable.c b/contrib/tools/python3/Python/symtable.c
index a5c6b465b71..a5c6b465b71 100644
--- a/contrib/tools/python3/src/Python/symtable.c
+++ b/contrib/tools/python3/Python/symtable.c
diff --git a/contrib/tools/python3/src/Python/sysmodule.c b/contrib/tools/python3/Python/sysmodule.c
index 3146f2a943c..3146f2a943c 100644
--- a/contrib/tools/python3/src/Python/sysmodule.c
+++ b/contrib/tools/python3/Python/sysmodule.c
diff --git a/contrib/tools/python3/src/Python/thread.c b/contrib/tools/python3/Python/thread.c
index 7fc53f9b613..7fc53f9b613 100644
--- a/contrib/tools/python3/src/Python/thread.c
+++ b/contrib/tools/python3/Python/thread.c
diff --git a/contrib/tools/python3/src/Python/thread_nt.h b/contrib/tools/python3/Python/thread_nt.h
index 26f441bd6d3..26f441bd6d3 100644
--- a/contrib/tools/python3/src/Python/thread_nt.h
+++ b/contrib/tools/python3/Python/thread_nt.h
diff --git a/contrib/tools/python3/src/Python/thread_pthread.h b/contrib/tools/python3/Python/thread_pthread.h
index e5535a945e4..e5535a945e4 100644
--- a/contrib/tools/python3/src/Python/thread_pthread.h
+++ b/contrib/tools/python3/Python/thread_pthread.h
diff --git a/contrib/tools/python3/src/Python/thread_pthread_stubs.h b/contrib/tools/python3/Python/thread_pthread_stubs.h
index 56e5b614192..56e5b614192 100644
--- a/contrib/tools/python3/src/Python/thread_pthread_stubs.h
+++ b/contrib/tools/python3/Python/thread_pthread_stubs.h
diff --git a/contrib/tools/python3/src/Python/traceback.c b/contrib/tools/python3/Python/traceback.c
index fdaf19d3707..fdaf19d3707 100644
--- a/contrib/tools/python3/src/Python/traceback.c
+++ b/contrib/tools/python3/Python/traceback.c
diff --git a/contrib/tools/python3/src/Python/tracemalloc.c b/contrib/tools/python3/Python/tracemalloc.c
index bc765623522..bc765623522 100644
--- a/contrib/tools/python3/src/Python/tracemalloc.c
+++ b/contrib/tools/python3/Python/tracemalloc.c
diff --git a/contrib/tools/python3/src/README.rst b/contrib/tools/python3/README.rst
index a5321cf3e20..a5321cf3e20 100644
--- a/contrib/tools/python3/src/README.rst
+++ b/contrib/tools/python3/README.rst
diff --git a/contrib/tools/python3/bin/ya.make b/contrib/tools/python3/bin/ya.make
new file mode 100644
index 00000000000..45f1dde162d
--- /dev/null
+++ b/contrib/tools/python3/bin/ya.make
@@ -0,0 +1,25 @@
+# Generated by devtools/yamaker.
+
+PROGRAM(python3)
+
+VERSION(3.12.2)
+
+ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.12.2.tar.gz)
+
+LICENSE(Python-2.0)
+
+USE_PYTHON3()
+
+PEERDIR(
+ contrib/tools/python3/Modules/_sqlite
+)
+
+CFLAGS(
+ -DPy_BUILD_CORE
+)
+
+SRCS(
+ ../Programs/python.c
+)
+
+END()
diff --git a/contrib/tools/python3/lib/lsan.supp b/contrib/tools/python3/lib/lsan.supp
deleted file mode 100644
index 37121682e78..00000000000
--- a/contrib/tools/python3/lib/lsan.supp
+++ /dev/null
@@ -1,2 +0,0 @@
-leak:PyBytes_FromStringAndSize
-leak:PyUnicode_New
diff --git a/contrib/tools/python3/lib/py/ya.make b/contrib/tools/python3/lib/py/ya.make
deleted file mode 100644
index 1df62e39658..00000000000
--- a/contrib/tools/python3/lib/py/ya.make
+++ /dev/null
@@ -1,563 +0,0 @@
-ENABLE(PYBUILD_NO_PYC)
-
-PY3_LIBRARY()
-
-LICENSE(Python-2.0)
-
-NO_PYTHON_INCLUDES()
-
-SRCDIR(contrib/tools/python3/src/Lib)
-
-NO_CHECK_IMPORTS(
- antigravity
- asyncio.unix_events
- asyncio.windows_events
- asyncio.windows_utils
- crypt
- ctypes.wintypes
- curses.*
- dbm.gnu
- dbm.ndbm
- distutils._msvccompiler
- distutils.command.bdist_msi
- distutils.msvc9compiler
- encodings.cp65001
- encodings.mbcs
- encodings.oem
- lzma
- msilib.*
- multiprocessing.popen_fork
- multiprocessing.popen_forkserver
- multiprocessing.popen_spawn_posix
- multiprocessing.popen_spawn_win32
- sqlite3.*
- turtle
- pty
- tty
-)
-
-NO_LINT()
-
-PY_SRCS(
- TOP_LEVEL
- __future__.py
- __hello__.py
- _aix_support.py
- _collections_abc.py
- _compat_pickle.py
- _compression.py
- _markupbase.py
- _osx_support.py
- _py_abc.py
- _pydecimal.py
- _pyio.py
- _pylong.py
- _sitebuiltins.py
- _strptime.py
- _sysconfigdata_arcadia.py
- _threading_local.py
- _weakrefset.py
- abc.py
- aifc.py
- antigravity.py
- argparse.py
- ast.py
- asyncio/__init__.py
- asyncio/__main__.py
- asyncio/base_events.py
- asyncio/base_futures.py
- asyncio/base_subprocess.py
- asyncio/base_tasks.py
- asyncio/constants.py
- asyncio/coroutines.py
- asyncio/events.py
- asyncio/exceptions.py
- asyncio/format_helpers.py
- asyncio/futures.py
- asyncio/locks.py
- asyncio/log.py
- asyncio/mixins.py
- asyncio/proactor_events.py
- asyncio/protocols.py
- asyncio/queues.py
- asyncio/runners.py
- asyncio/selector_events.py
- asyncio/sslproto.py
- asyncio/staggered.py
- asyncio/streams.py
- asyncio/subprocess.py
- asyncio/taskgroups.py
- asyncio/tasks.py
- asyncio/threads.py
- asyncio/timeouts.py
- asyncio/transports.py
- asyncio/trsock.py
- asyncio/unix_events.py
- asyncio/windows_events.py
- asyncio/windows_utils.py
- base64.py
- bdb.py
- bisect.py
- bz2.py
- cProfile.py
- calendar.py
- cgi.py
- cgitb.py
- chunk.py
- cmd.py
- code.py
- codecs.py
- codeop.py
- collections/__init__.py
- collections/abc.py
- colorsys.py
- compileall.py
- concurrent/__init__.py
- concurrent/futures/__init__.py
- concurrent/futures/_base.py
- concurrent/futures/process.py
- concurrent/futures/thread.py
- configparser.py
- contextlib.py
- contextvars.py
- copy.py
- copyreg.py
- crypt.py
- csv.py
- ctypes/__init__.py
- ctypes/_aix.py
- ctypes/_endian.py
- ctypes/macholib/__init__.py
- ctypes/macholib/dyld.py
- ctypes/macholib/dylib.py
- ctypes/macholib/framework.py
- ctypes/util.py
- ctypes/wintypes.py
- curses/__init__.py
- curses/ascii.py
- curses/has_key.py
- curses/panel.py
- curses/textpad.py
- dataclasses.py
- datetime.py
- dbm/__init__.py
- dbm/dumb.py
- dbm/gnu.py
- dbm/ndbm.py
- decimal.py
- difflib.py
- dis.py
- doctest.py
- email/__init__.py
- email/_encoded_words.py
- email/_header_value_parser.py
- email/_parseaddr.py
- email/_policybase.py
- email/base64mime.py
- email/charset.py
- email/contentmanager.py
- email/encoders.py
- email/errors.py
- email/feedparser.py
- email/generator.py
- email/header.py
- email/headerregistry.py
- email/iterators.py
- email/message.py
- email/mime/__init__.py
- email/mime/application.py
- email/mime/audio.py
- email/mime/base.py
- email/mime/image.py
- email/mime/message.py
- email/mime/multipart.py
- email/mime/nonmultipart.py
- email/mime/text.py
- email/parser.py
- email/policy.py
- email/quoprimime.py
- email/utils.py
- encodings/__init__.py
- encodings/aliases.py
- encodings/ascii.py
- encodings/base64_codec.py
- encodings/big5.py
- encodings/big5hkscs.py
- encodings/bz2_codec.py
- encodings/charmap.py
- encodings/cp037.py
- encodings/cp1006.py
- encodings/cp1026.py
- encodings/cp1125.py
- encodings/cp1140.py
- encodings/cp1250.py
- encodings/cp1251.py
- encodings/cp1252.py
- encodings/cp1253.py
- encodings/cp1254.py
- encodings/cp1255.py
- encodings/cp1256.py
- encodings/cp1257.py
- encodings/cp1258.py
- encodings/cp273.py
- encodings/cp424.py
- encodings/cp437.py
- encodings/cp500.py
- encodings/cp720.py
- encodings/cp737.py
- encodings/cp775.py
- encodings/cp850.py
- encodings/cp852.py
- encodings/cp855.py
- encodings/cp856.py
- encodings/cp857.py
- encodings/cp858.py
- encodings/cp860.py
- encodings/cp861.py
- encodings/cp862.py
- encodings/cp863.py
- encodings/cp864.py
- encodings/cp865.py
- encodings/cp866.py
- encodings/cp869.py
- encodings/cp874.py
- encodings/cp875.py
- encodings/cp932.py
- encodings/cp949.py
- encodings/cp950.py
- encodings/euc_jis_2004.py
- encodings/euc_jisx0213.py
- encodings/euc_jp.py
- encodings/euc_kr.py
- encodings/gb18030.py
- encodings/gb2312.py
- encodings/gbk.py
- encodings/hex_codec.py
- encodings/hp_roman8.py
- encodings/hz.py
- encodings/idna.py
- encodings/iso2022_jp.py
- encodings/iso2022_jp_1.py
- encodings/iso2022_jp_2.py
- encodings/iso2022_jp_2004.py
- encodings/iso2022_jp_3.py
- encodings/iso2022_jp_ext.py
- encodings/iso2022_kr.py
- encodings/iso8859_1.py
- encodings/iso8859_10.py
- encodings/iso8859_11.py
- encodings/iso8859_13.py
- encodings/iso8859_14.py
- encodings/iso8859_15.py
- encodings/iso8859_16.py
- encodings/iso8859_2.py
- encodings/iso8859_3.py
- encodings/iso8859_4.py
- encodings/iso8859_5.py
- encodings/iso8859_6.py
- encodings/iso8859_7.py
- encodings/iso8859_8.py
- encodings/iso8859_9.py
- encodings/johab.py
- encodings/koi8_r.py
- encodings/koi8_t.py
- encodings/koi8_u.py
- encodings/kz1048.py
- encodings/latin_1.py
- encodings/mac_arabic.py
- encodings/mac_croatian.py
- encodings/mac_cyrillic.py
- encodings/mac_farsi.py
- encodings/mac_greek.py
- encodings/mac_iceland.py
- encodings/mac_latin2.py
- encodings/mac_roman.py
- encodings/mac_romanian.py
- encodings/mac_turkish.py
- encodings/mbcs.py
- encodings/oem.py
- encodings/palmos.py
- encodings/ptcp154.py
- encodings/punycode.py
- encodings/quopri_codec.py
- encodings/raw_unicode_escape.py
- encodings/rot_13.py
- encodings/shift_jis.py
- encodings/shift_jis_2004.py
- encodings/shift_jisx0213.py
- encodings/tis_620.py
- encodings/undefined.py
- encodings/unicode_escape.py
- encodings/utf_16.py
- encodings/utf_16_be.py
- encodings/utf_16_le.py
- encodings/utf_32.py
- encodings/utf_32_be.py
- encodings/utf_32_le.py
- encodings/utf_7.py
- encodings/utf_8.py
- encodings/utf_8_sig.py
- encodings/uu_codec.py
- encodings/zlib_codec.py
- ensurepip/__init__.py
- ensurepip/__main__.py
- ensurepip/_uninstall.py
- enum.py
- filecmp.py
- fileinput.py
- fnmatch.py
- fractions.py
- ftplib.py
- functools.py
- genericpath.py
- getopt.py
- getpass.py
- gettext.py
- glob.py
- graphlib.py
- gzip.py
- hashlib.py
- heapq.py
- hmac.py
- html/__init__.py
- html/entities.py
- html/parser.py
- http/__init__.py
- http/client.py
- http/cookiejar.py
- http/cookies.py
- http/server.py
- imaplib.py
- imghdr.py
- importlib/__init__.py
- importlib/_abc.py
- importlib/_bootstrap.py
- importlib/_bootstrap_external.py
- importlib/abc.py
- importlib/machinery.py
- importlib/metadata/__init__.py
- importlib/metadata/_adapters.py
- importlib/metadata/_collections.py
- importlib/metadata/_functools.py
- importlib/metadata/_itertools.py
- importlib/metadata/_meta.py
- importlib/metadata/_text.py
- importlib/readers.py
- importlib/resources/__init__.py
- importlib/resources/_adapters.py
- importlib/resources/_common.py
- importlib/resources/_itertools.py
- importlib/resources/_legacy.py
- importlib/resources/abc.py
- importlib/resources/readers.py
- importlib/resources/simple.py
- importlib/simple.py
- importlib/util.py
- inspect.py
- io.py
- ipaddress.py
- json/__init__.py
- json/decoder.py
- json/encoder.py
- json/scanner.py
- json/tool.py
- keyword.py
- linecache.py
- locale.py
- logging/__init__.py
- logging/config.py
- logging/handlers.py
- lzma.py
- mailbox.py
- mailcap.py
- mimetypes.py
- modulefinder.py
- msilib/__init__.py
- msilib/schema.py
- msilib/sequence.py
- msilib/text.py
- multiprocessing/__init__.py
- multiprocessing/connection.py
- multiprocessing/context.py
- multiprocessing/dummy/__init__.py
- multiprocessing/dummy/connection.py
- multiprocessing/forkserver.py
- multiprocessing/heap.py
- multiprocessing/managers.py
- multiprocessing/pool.py
- multiprocessing/popen_fork.py
- multiprocessing/popen_forkserver.py
- multiprocessing/popen_spawn_posix.py
- multiprocessing/popen_spawn_win32.py
- multiprocessing/process.py
- multiprocessing/queues.py
- multiprocessing/reduction.py
- multiprocessing/resource_sharer.py
- multiprocessing/resource_tracker.py
- multiprocessing/shared_memory.py
- multiprocessing/sharedctypes.py
- multiprocessing/spawn.py
- multiprocessing/synchronize.py
- multiprocessing/util.py
- netrc.py
- nntplib.py
- ntpath.py
- nturl2path.py
- numbers.py
- opcode.py
- operator.py
- optparse.py
- os.py
- pathlib.py
- pdb.py
- pickle.py
- pickletools.py
- pipes.py
- pkgutil.py
- platform.py
- plistlib.py
- poplib.py
- posixpath.py
- pprint.py
- profile.py
- pstats.py
- pty.py
- py_compile.py
- pyclbr.py
- pydoc.py
- pydoc_data/__init__.py
- pydoc_data/topics.py
- queue.py
- quopri.py
- random.py
- re/__init__.py
- re/_casefix.py
- re/_compiler.py
- re/_constants.py
- re/_parser.py
- reprlib.py
- rlcompleter.py
- runpy.py
- sched.py
- secrets.py
- selectors.py
- shelve.py
- shlex.py
- shutil.py
- signal.py
- site.py
- smtplib.py
- sndhdr.py
- socket.py
- socketserver.py
- sqlite3/__init__.py
- sqlite3/__main__.py
- sqlite3/dbapi2.py
- sqlite3/dump.py
- sre_compile.py
- sre_constants.py
- sre_parse.py
- ssl.py
- stat.py
- statistics.py
- string.py
- stringprep.py
- struct.py
- subprocess.py
- sunau.py
- symtable.py
- sysconfig.py
- tabnanny.py
- tarfile.py
- telnetlib.py
- tempfile.py
- textwrap.py
- this.py
- threading.py
- timeit.py
- token.py
- tokenize.py
- tomllib/__init__.py
- tomllib/_parser.py
- tomllib/_re.py
- tomllib/_types.py
- trace.py
- traceback.py
- tracemalloc.py
- tty.py
- turtle.py
- types.py
- typing.py
- unittest/__init__.py
- unittest/__main__.py
- unittest/_log.py
- unittest/async_case.py
- unittest/case.py
- unittest/loader.py
- unittest/main.py
- unittest/mock.py
- unittest/result.py
- unittest/runner.py
- unittest/signals.py
- unittest/suite.py
- unittest/util.py
- urllib/__init__.py
- urllib/error.py
- urllib/parse.py
- urllib/request.py
- urllib/response.py
- urllib/robotparser.py
- uu.py
- uuid.py
- venv/__init__.py
- venv/__main__.py
- warnings.py
- wave.py
- weakref.py
- webbrowser.py
- wsgiref/__init__.py
- wsgiref/handlers.py
- wsgiref/headers.py
- wsgiref/simple_server.py
- wsgiref/types.py
- wsgiref/util.py
- wsgiref/validate.py
- xdrlib.py
- xml/__init__.py
- xml/dom/NodeFilter.py
- xml/dom/__init__.py
- xml/dom/domreg.py
- xml/dom/expatbuilder.py
- xml/dom/minicompat.py
- xml/dom/minidom.py
- xml/dom/pulldom.py
- xml/dom/xmlbuilder.py
- xml/etree/ElementInclude.py
- xml/etree/ElementPath.py
- xml/etree/ElementTree.py
- xml/etree/__init__.py
- xml/etree/cElementTree.py
- xml/parsers/__init__.py
- xml/parsers/expat.py
- xml/sax/__init__.py
- xml/sax/_exceptions.py
- xml/sax/expatreader.py
- xml/sax/handler.py
- xml/sax/saxutils.py
- xml/sax/xmlreader.py
- xmlrpc/__init__.py
- xmlrpc/client.py
- xmlrpc/server.py
- zipapp.py
- zipfile/__init__.py
- zipfile/__main__.py
- zipfile/_path/__init__.py
- zipfile/_path/glob.py
- zipimport.py
- zoneinfo/__init__.py
- zoneinfo/_common.py
- zoneinfo/_tzpath.py
- zoneinfo/_zoneinfo.py
-)
-
-END()
diff --git a/contrib/tools/python3/lib/ya.make b/contrib/tools/python3/lib/ya.make
deleted file mode 100644
index ce0b27a92fd..00000000000
--- a/contrib/tools/python3/lib/ya.make
+++ /dev/null
@@ -1,15 +0,0 @@
-LIBRARY()
-
-PROVIDES(python)
-
-LICENSE(Python-2.0)
-
-PEERDIR(
- contrib/tools/python3/src
- contrib/tools/python3/src/Lib
- contrib/tools/python3/src/Modules
-)
-
-SUPPRESSIONS(lsan.supp)
-
-END()
diff --git a/contrib/tools/python3/lib2/py/ya.make b/contrib/tools/python3/lib2/py/ya.make
new file mode 100644
index 00000000000..49371b8a10f
--- /dev/null
+++ b/contrib/tools/python3/lib2/py/ya.make
@@ -0,0 +1,563 @@
+ENABLE(PYBUILD_NO_PYC)
+
+PY3_LIBRARY()
+
+LICENSE(Python-2.0)
+
+NO_PYTHON_INCLUDES()
+
+SRCDIR(contrib/tools/python3/Lib)
+
+NO_CHECK_IMPORTS(
+ antigravity
+ asyncio.unix_events
+ asyncio.windows_events
+ asyncio.windows_utils
+ crypt
+ ctypes.wintypes
+ curses.*
+ dbm.gnu
+ dbm.ndbm
+ distutils._msvccompiler
+ distutils.command.bdist_msi
+ distutils.msvc9compiler
+ encodings.cp65001
+ encodings.mbcs
+ encodings.oem
+ lzma
+ msilib.*
+ multiprocessing.popen_fork
+ multiprocessing.popen_forkserver
+ multiprocessing.popen_spawn_posix
+ multiprocessing.popen_spawn_win32
+ sqlite3.*
+ turtle
+ pty
+ tty
+)
+
+NO_LINT()
+
+PY_SRCS(
+ TOP_LEVEL
+ __future__.py
+ __hello__.py
+ _aix_support.py
+ _collections_abc.py
+ _compat_pickle.py
+ _compression.py
+ _markupbase.py
+ _osx_support.py
+ _py_abc.py
+ _pydecimal.py
+ _pyio.py
+ _pylong.py
+ _sitebuiltins.py
+ _strptime.py
+ _sysconfigdata_arcadia.py
+ _threading_local.py
+ _weakrefset.py
+ abc.py
+ aifc.py
+ antigravity.py
+ argparse.py
+ ast.py
+ asyncio/__init__.py
+ asyncio/__main__.py
+ asyncio/base_events.py
+ asyncio/base_futures.py
+ asyncio/base_subprocess.py
+ asyncio/base_tasks.py
+ asyncio/constants.py
+ asyncio/coroutines.py
+ asyncio/events.py
+ asyncio/exceptions.py
+ asyncio/format_helpers.py
+ asyncio/futures.py
+ asyncio/locks.py
+ asyncio/log.py
+ asyncio/mixins.py
+ asyncio/proactor_events.py
+ asyncio/protocols.py
+ asyncio/queues.py
+ asyncio/runners.py
+ asyncio/selector_events.py
+ asyncio/sslproto.py
+ asyncio/staggered.py
+ asyncio/streams.py
+ asyncio/subprocess.py
+ asyncio/taskgroups.py
+ asyncio/tasks.py
+ asyncio/threads.py
+ asyncio/timeouts.py
+ asyncio/transports.py
+ asyncio/trsock.py
+ asyncio/unix_events.py
+ asyncio/windows_events.py
+ asyncio/windows_utils.py
+ base64.py
+ bdb.py
+ bisect.py
+ bz2.py
+ cProfile.py
+ calendar.py
+ cgi.py
+ cgitb.py
+ chunk.py
+ cmd.py
+ code.py
+ codecs.py
+ codeop.py
+ collections/__init__.py
+ collections/abc.py
+ colorsys.py
+ compileall.py
+ concurrent/__init__.py
+ concurrent/futures/__init__.py
+ concurrent/futures/_base.py
+ concurrent/futures/process.py
+ concurrent/futures/thread.py
+ configparser.py
+ contextlib.py
+ contextvars.py
+ copy.py
+ copyreg.py
+ crypt.py
+ csv.py
+ ctypes/__init__.py
+ ctypes/_aix.py
+ ctypes/_endian.py
+ ctypes/macholib/__init__.py
+ ctypes/macholib/dyld.py
+ ctypes/macholib/dylib.py
+ ctypes/macholib/framework.py
+ ctypes/util.py
+ ctypes/wintypes.py
+ curses/__init__.py
+ curses/ascii.py
+ curses/has_key.py
+ curses/panel.py
+ curses/textpad.py
+ dataclasses.py
+ datetime.py
+ dbm/__init__.py
+ dbm/dumb.py
+ dbm/gnu.py
+ dbm/ndbm.py
+ decimal.py
+ difflib.py
+ dis.py
+ doctest.py
+ email/__init__.py
+ email/_encoded_words.py
+ email/_header_value_parser.py
+ email/_parseaddr.py
+ email/_policybase.py
+ email/base64mime.py
+ email/charset.py
+ email/contentmanager.py
+ email/encoders.py
+ email/errors.py
+ email/feedparser.py
+ email/generator.py
+ email/header.py
+ email/headerregistry.py
+ email/iterators.py
+ email/message.py
+ email/mime/__init__.py
+ email/mime/application.py
+ email/mime/audio.py
+ email/mime/base.py
+ email/mime/image.py
+ email/mime/message.py
+ email/mime/multipart.py
+ email/mime/nonmultipart.py
+ email/mime/text.py
+ email/parser.py
+ email/policy.py
+ email/quoprimime.py
+ email/utils.py
+ encodings/__init__.py
+ encodings/aliases.py
+ encodings/ascii.py
+ encodings/base64_codec.py
+ encodings/big5.py
+ encodings/big5hkscs.py
+ encodings/bz2_codec.py
+ encodings/charmap.py
+ encodings/cp037.py
+ encodings/cp1006.py
+ encodings/cp1026.py
+ encodings/cp1125.py
+ encodings/cp1140.py
+ encodings/cp1250.py
+ encodings/cp1251.py
+ encodings/cp1252.py
+ encodings/cp1253.py
+ encodings/cp1254.py
+ encodings/cp1255.py
+ encodings/cp1256.py
+ encodings/cp1257.py
+ encodings/cp1258.py
+ encodings/cp273.py
+ encodings/cp424.py
+ encodings/cp437.py
+ encodings/cp500.py
+ encodings/cp720.py
+ encodings/cp737.py
+ encodings/cp775.py
+ encodings/cp850.py
+ encodings/cp852.py
+ encodings/cp855.py
+ encodings/cp856.py
+ encodings/cp857.py
+ encodings/cp858.py
+ encodings/cp860.py
+ encodings/cp861.py
+ encodings/cp862.py
+ encodings/cp863.py
+ encodings/cp864.py
+ encodings/cp865.py
+ encodings/cp866.py
+ encodings/cp869.py
+ encodings/cp874.py
+ encodings/cp875.py
+ encodings/cp932.py
+ encodings/cp949.py
+ encodings/cp950.py
+ encodings/euc_jis_2004.py
+ encodings/euc_jisx0213.py
+ encodings/euc_jp.py
+ encodings/euc_kr.py
+ encodings/gb18030.py
+ encodings/gb2312.py
+ encodings/gbk.py
+ encodings/hex_codec.py
+ encodings/hp_roman8.py
+ encodings/hz.py
+ encodings/idna.py
+ encodings/iso2022_jp.py
+ encodings/iso2022_jp_1.py
+ encodings/iso2022_jp_2.py
+ encodings/iso2022_jp_2004.py
+ encodings/iso2022_jp_3.py
+ encodings/iso2022_jp_ext.py
+ encodings/iso2022_kr.py
+ encodings/iso8859_1.py
+ encodings/iso8859_10.py
+ encodings/iso8859_11.py
+ encodings/iso8859_13.py
+ encodings/iso8859_14.py
+ encodings/iso8859_15.py
+ encodings/iso8859_16.py
+ encodings/iso8859_2.py
+ encodings/iso8859_3.py
+ encodings/iso8859_4.py
+ encodings/iso8859_5.py
+ encodings/iso8859_6.py
+ encodings/iso8859_7.py
+ encodings/iso8859_8.py
+ encodings/iso8859_9.py
+ encodings/johab.py
+ encodings/koi8_r.py
+ encodings/koi8_t.py
+ encodings/koi8_u.py
+ encodings/kz1048.py
+ encodings/latin_1.py
+ encodings/mac_arabic.py
+ encodings/mac_croatian.py
+ encodings/mac_cyrillic.py
+ encodings/mac_farsi.py
+ encodings/mac_greek.py
+ encodings/mac_iceland.py
+ encodings/mac_latin2.py
+ encodings/mac_roman.py
+ encodings/mac_romanian.py
+ encodings/mac_turkish.py
+ encodings/mbcs.py
+ encodings/oem.py
+ encodings/palmos.py
+ encodings/ptcp154.py
+ encodings/punycode.py
+ encodings/quopri_codec.py
+ encodings/raw_unicode_escape.py
+ encodings/rot_13.py
+ encodings/shift_jis.py
+ encodings/shift_jis_2004.py
+ encodings/shift_jisx0213.py
+ encodings/tis_620.py
+ encodings/undefined.py
+ encodings/unicode_escape.py
+ encodings/utf_16.py
+ encodings/utf_16_be.py
+ encodings/utf_16_le.py
+ encodings/utf_32.py
+ encodings/utf_32_be.py
+ encodings/utf_32_le.py
+ encodings/utf_7.py
+ encodings/utf_8.py
+ encodings/utf_8_sig.py
+ encodings/uu_codec.py
+ encodings/zlib_codec.py
+ ensurepip/__init__.py
+ ensurepip/__main__.py
+ ensurepip/_uninstall.py
+ enum.py
+ filecmp.py
+ fileinput.py
+ fnmatch.py
+ fractions.py
+ ftplib.py
+ functools.py
+ genericpath.py
+ getopt.py
+ getpass.py
+ gettext.py
+ glob.py
+ graphlib.py
+ gzip.py
+ hashlib.py
+ heapq.py
+ hmac.py
+ html/__init__.py
+ html/entities.py
+ html/parser.py
+ http/__init__.py
+ http/client.py
+ http/cookiejar.py
+ http/cookies.py
+ http/server.py
+ imaplib.py
+ imghdr.py
+ importlib/__init__.py
+ importlib/_abc.py
+ importlib/_bootstrap.py
+ importlib/_bootstrap_external.py
+ importlib/abc.py
+ importlib/machinery.py
+ importlib/metadata/__init__.py
+ importlib/metadata/_adapters.py
+ importlib/metadata/_collections.py
+ importlib/metadata/_functools.py
+ importlib/metadata/_itertools.py
+ importlib/metadata/_meta.py
+ importlib/metadata/_text.py
+ importlib/readers.py
+ importlib/resources/__init__.py
+ importlib/resources/_adapters.py
+ importlib/resources/_common.py
+ importlib/resources/_itertools.py
+ importlib/resources/_legacy.py
+ importlib/resources/abc.py
+ importlib/resources/readers.py
+ importlib/resources/simple.py
+ importlib/simple.py
+ importlib/util.py
+ inspect.py
+ io.py
+ ipaddress.py
+ json/__init__.py
+ json/decoder.py
+ json/encoder.py
+ json/scanner.py
+ json/tool.py
+ keyword.py
+ linecache.py
+ locale.py
+ logging/__init__.py
+ logging/config.py
+ logging/handlers.py
+ lzma.py
+ mailbox.py
+ mailcap.py
+ mimetypes.py
+ modulefinder.py
+ msilib/__init__.py
+ msilib/schema.py
+ msilib/sequence.py
+ msilib/text.py
+ multiprocessing/__init__.py
+ multiprocessing/connection.py
+ multiprocessing/context.py
+ multiprocessing/dummy/__init__.py
+ multiprocessing/dummy/connection.py
+ multiprocessing/forkserver.py
+ multiprocessing/heap.py
+ multiprocessing/managers.py
+ multiprocessing/pool.py
+ multiprocessing/popen_fork.py
+ multiprocessing/popen_forkserver.py
+ multiprocessing/popen_spawn_posix.py
+ multiprocessing/popen_spawn_win32.py
+ multiprocessing/process.py
+ multiprocessing/queues.py
+ multiprocessing/reduction.py
+ multiprocessing/resource_sharer.py
+ multiprocessing/resource_tracker.py
+ multiprocessing/shared_memory.py
+ multiprocessing/sharedctypes.py
+ multiprocessing/spawn.py
+ multiprocessing/synchronize.py
+ multiprocessing/util.py
+ netrc.py
+ nntplib.py
+ ntpath.py
+ nturl2path.py
+ numbers.py
+ opcode.py
+ operator.py
+ optparse.py
+ os.py
+ pathlib.py
+ pdb.py
+ pickle.py
+ pickletools.py
+ pipes.py
+ pkgutil.py
+ platform.py
+ plistlib.py
+ poplib.py
+ posixpath.py
+ pprint.py
+ profile.py
+ pstats.py
+ pty.py
+ py_compile.py
+ pyclbr.py
+ pydoc.py
+ pydoc_data/__init__.py
+ pydoc_data/topics.py
+ queue.py
+ quopri.py
+ random.py
+ re/__init__.py
+ re/_casefix.py
+ re/_compiler.py
+ re/_constants.py
+ re/_parser.py
+ reprlib.py
+ rlcompleter.py
+ runpy.py
+ sched.py
+ secrets.py
+ selectors.py
+ shelve.py
+ shlex.py
+ shutil.py
+ signal.py
+ site.py
+ smtplib.py
+ sndhdr.py
+ socket.py
+ socketserver.py
+ sqlite3/__init__.py
+ sqlite3/__main__.py
+ sqlite3/dbapi2.py
+ sqlite3/dump.py
+ sre_compile.py
+ sre_constants.py
+ sre_parse.py
+ ssl.py
+ stat.py
+ statistics.py
+ string.py
+ stringprep.py
+ struct.py
+ subprocess.py
+ sunau.py
+ symtable.py
+ sysconfig.py
+ tabnanny.py
+ tarfile.py
+ telnetlib.py
+ tempfile.py
+ textwrap.py
+ this.py
+ threading.py
+ timeit.py
+ token.py
+ tokenize.py
+ tomllib/__init__.py
+ tomllib/_parser.py
+ tomllib/_re.py
+ tomllib/_types.py
+ trace.py
+ traceback.py
+ tracemalloc.py
+ tty.py
+ turtle.py
+ types.py
+ typing.py
+ unittest/__init__.py
+ unittest/__main__.py
+ unittest/_log.py
+ unittest/async_case.py
+ unittest/case.py
+ unittest/loader.py
+ unittest/main.py
+ unittest/mock.py
+ unittest/result.py
+ unittest/runner.py
+ unittest/signals.py
+ unittest/suite.py
+ unittest/util.py
+ urllib/__init__.py
+ urllib/error.py
+ urllib/parse.py
+ urllib/request.py
+ urllib/response.py
+ urllib/robotparser.py
+ uu.py
+ uuid.py
+ venv/__init__.py
+ venv/__main__.py
+ warnings.py
+ wave.py
+ weakref.py
+ webbrowser.py
+ wsgiref/__init__.py
+ wsgiref/handlers.py
+ wsgiref/headers.py
+ wsgiref/simple_server.py
+ wsgiref/types.py
+ wsgiref/util.py
+ wsgiref/validate.py
+ xdrlib.py
+ xml/__init__.py
+ xml/dom/NodeFilter.py
+ xml/dom/__init__.py
+ xml/dom/domreg.py
+ xml/dom/expatbuilder.py
+ xml/dom/minicompat.py
+ xml/dom/minidom.py
+ xml/dom/pulldom.py
+ xml/dom/xmlbuilder.py
+ xml/etree/ElementInclude.py
+ xml/etree/ElementPath.py
+ xml/etree/ElementTree.py
+ xml/etree/__init__.py
+ xml/etree/cElementTree.py
+ xml/parsers/__init__.py
+ xml/parsers/expat.py
+ xml/sax/__init__.py
+ xml/sax/_exceptions.py
+ xml/sax/expatreader.py
+ xml/sax/handler.py
+ xml/sax/saxutils.py
+ xml/sax/xmlreader.py
+ xmlrpc/__init__.py
+ xmlrpc/client.py
+ xmlrpc/server.py
+ zipapp.py
+ zipfile/__init__.py
+ zipfile/__main__.py
+ zipfile/_path/__init__.py
+ zipfile/_path/glob.py
+ zipimport.py
+ zoneinfo/__init__.py
+ zoneinfo/_common.py
+ zoneinfo/_tzpath.py
+ zoneinfo/_zoneinfo.py
+)
+
+END()
diff --git a/contrib/tools/python3/lib2/ya.make b/contrib/tools/python3/lib2/ya.make
new file mode 100644
index 00000000000..3fb8db51644
--- /dev/null
+++ b/contrib/tools/python3/lib2/ya.make
@@ -0,0 +1,15 @@
+LIBRARY()
+
+PROVIDES(python)
+
+LICENSE(Python-2.0)
+
+PEERDIR(
+ contrib/tools/python3
+ contrib/tools/python3/Lib
+ contrib/tools/python3/Modules
+)
+
+SUPPRESSIONS(lsan.supp)
+
+END()
diff --git a/contrib/tools/python3/patches/all-changes.patch b/contrib/tools/python3/patches/all-changes.patch
index a8370126702..9927d22ac6a 100644
--- a/contrib/tools/python3/patches/all-changes.patch
+++ b/contrib/tools/python3/patches/all-changes.patch
@@ -1,5 +1,5 @@
---- contrib/tools/python3/src/Modules/posixmodule.c (index)
-+++ contrib/tools/python3/src/Modules/posixmodule.c (working tree)
+--- contrib/tools/python3/Modules/posixmodule.c (index)
++++ contrib/tools/python3/Modules/posixmodule.c (working tree)
@@ -288,6 +288,7 @@ corresponding Unix manual entries for more information on calls.");
#endif
#ifdef HAVE_GETRANDOM_SYSCALL
@@ -8,8 +8,8 @@
#endif
#if defined(MS_WINDOWS)
---- contrib/tools/python3/src/Lib/ctypes/__init__.py (index)
-+++ contrib/tools/python3/src/Lib/ctypes/__init__.py (working tree)
+--- contrib/tools/python3/Lib/ctypes/__init__.py (index)
++++ contrib/tools/python3/Lib/ctypes/__init__.py (working tree)
@@ -11,6 +11,7 @@ from _ctypes import CFuncPtr as _CFuncPtr
from _ctypes import RTLD_LOCAL, RTLD_GLOBAL
from _ctypes import ArgumentError
@@ -76,8 +76,8 @@
if _os.name == "nt":
---- contrib/tools/python3/src/Lib/ctypes/util.py (index)
-+++ contrib/tools/python3/src/Lib/ctypes/util.py (working tree)
+--- contrib/tools/python3/Lib/ctypes/util.py (index)
++++ contrib/tools/python3/Lib/ctypes/util.py (working tree)
@@ -329,6 +329,16 @@ elif os.name == "posix":
return _findSoname_ldconfig(name) or \
_get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name))
@@ -95,8 +95,8 @@
################################################################
# test code
---- contrib/tools/python3/src/Lib/doctest.py (index)
-+++ contrib/tools/python3/src/Lib/doctest.py (working tree)
+--- contrib/tools/python3/Lib/doctest.py (index)
++++ contrib/tools/python3/Lib/doctest.py (working tree)
@@ -957,7 +957,7 @@ class DocTestFinder:
return module.__dict__ is object.__globals__
elif (inspect.ismethoddescriptor(object) or
@@ -118,8 +118,8 @@
elif hasattr(object, '__module__'):
return module.__name__ == object.__module__
elif isinstance(object, property):
---- contrib/tools/python3/src/Lib/multiprocessing/popen_spawn_win32.py (index)
-+++ contrib/tools/python3/src/Lib/multiprocessing/popen_spawn_win32.py (working tree)
+--- contrib/tools/python3/Lib/multiprocessing/popen_spawn_win32.py (index)
++++ contrib/tools/python3/Lib/multiprocessing/popen_spawn_win32.py (working tree)
@@ -65,5 +65,6 @@ class Popen(object):
env["__PYVENV_LAUNCHER__"] = sys.executable
else:
@@ -128,8 +128,8 @@
+ env['Y_PYTHON_ENTRY_POINT'] = ':main'
cmd = ' '.join('"%s"' % x for x in cmd)
---- contrib/tools/python3/src/Lib/multiprocessing/spawn.py (index)
-+++ contrib/tools/python3/src/Lib/multiprocessing/spawn.py (working tree)
+--- contrib/tools/python3/Lib/multiprocessing/spawn.py (index)
++++ contrib/tools/python3/Lib/multiprocessing/spawn.py (working tree)
@@ -82,7 +82,7 @@ def get_command_line(**kwds):
'''
Returns prefix of command line used for spawning a child process
@@ -139,8 +139,8 @@
return ([sys.executable, '--multiprocessing-fork'] +
['%s=%r' % item for item in kwds.items()])
else:
---- contrib/tools/python3/src/Lib/multiprocessing/util.py (index)
-+++ contrib/tools/python3/src/Lib/multiprocessing/util.py (working tree)
+--- contrib/tools/python3/Lib/multiprocessing/util.py (index)
++++ contrib/tools/python3/Lib/multiprocessing/util.py (working tree)
@@ -383,8 +383,11 @@ class ForkAwareThreadLock(object):
@@ -183,58 +183,8 @@
-1, -1, -1, -1, -1, -1, errpipe_read, errpipe_write,
False, False, -1, None, None, None, -1, None,
subprocess._USE_VFORK)
---- contrib/tools/python3/src/Modules/_ctypes/_ctypes.c (index)
-+++ contrib/tools/python3/src/Modules/_ctypes/_ctypes.c (working tree)
-@@ -109,6 +109,7 @@ bytes(cdata)
- // windows.h must be included before pycore internal headers
- #ifdef MS_WIN32
- # include <windows.h>
-+# include <Unknwn.h>
- #endif
-
- #include "pycore_call.h" // _PyObject_CallNoArgs()
---- contrib/tools/python3/src/Modules/_ctypes/callbacks.c (index)
-+++ contrib/tools/python3/src/Modules/_ctypes/callbacks.c (working tree)
-@@ -7,6 +7,7 @@
- // windows.h must be included before pycore internal headers
- #ifdef MS_WIN32
- # include <windows.h>
-+# include <Unknwn.h>
- #endif
-
- #include "pycore_call.h" // _PyObject_CallNoArgs()
---- contrib/tools/python3/src/Modules/_ctypes/callproc.c (index)
-+++ contrib/tools/python3/src/Modules/_ctypes/callproc.c (working tree)
-@@ -63,6 +63,7 @@
-
- #ifdef MS_WIN32
- #include <windows.h>
-+#include <Unknwn.h>
- #include <tchar.h>
- #else
- #include "ctypes_dlfcn.h"
---- contrib/tools/python3/src/Modules/_ctypes/cfield.c (index)
-+++ contrib/tools/python3/src/Modules/_ctypes/cfield.c (working tree)
-@@ -6,6 +6,7 @@
- // windows.h must be included before pycore internal headers
- #ifdef MS_WIN32
- # include <windows.h>
-+# include <Unknwn.h>
- #endif
-
- #include "pycore_bitutils.h" // _Py_bswap32()
---- contrib/tools/python3/src/Modules/_ctypes/stgdict.c (index)
-+++ contrib/tools/python3/src/Modules/_ctypes/stgdict.c (working tree)
-@@ -7,6 +7,7 @@
- // windows.h must be included before pycore internal headers
- #ifdef MS_WIN32
- # include <windows.h>
-+# include <Unknwn.h>
- #endif
-
- #include "pycore_call.h" // _PyObject_CallNoArgs()
---- contrib/tools/python3/src/Modules/_decimal/libmpdec/io.c (index)
-+++ contrib/tools/python3/src/Modules/_decimal/libmpdec/io.c (working tree)
+--- contrib/tools/python3/Modules/_decimal/libmpdec/io.c (index)
++++ contrib/tools/python3/Modules/_decimal/libmpdec/io.c (working tree)
@@ -37,7 +37,7 @@
#include <stdlib.h>
#include <string.h>
@@ -244,8 +194,8 @@
#include "typearith.h"
---- contrib/tools/python3/src/Modules/_decimal/libmpdec/mpdecimal.h (index)
-+++ contrib/tools/python3/src/Modules/_decimal/libmpdec/mpdecimal.h (working tree)
+--- contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.h (index)
++++ contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.h (working tree)
@@ -96,17 +96,17 @@ const char *mpd_version(void);
/* Configuration */
/******************************************************************************/
@@ -270,15 +220,15 @@
#define CONFIG_32
#define ANSI
#elif defined(__x86_64__)
---- contrib/tools/python3/src/Modules/getpath.c (index)
-+++ contrib/tools/python3/src/Modules/getpath.c (working tree)
+--- contrib/tools/python3/Modules/getpath.c (index)
++++ contrib/tools/python3/Modules/getpath.c (working tree)
@@ -1,3 +1,4 @@
+#define PYTHONPATH ":"
/* Return the initial module search path. */
#include "Python.h"
---- contrib/tools/python3/src/Modules/main.c (index)
-+++ contrib/tools/python3/src/Modules/main.c (working tree)
+--- contrib/tools/python3/Modules/main.c (index)
++++ contrib/tools/python3/Modules/main.c (working tree)
@@ -51,6 +51,7 @@ pymain_init(const _PyArgv *args)
PyConfig config;
@@ -287,8 +237,8 @@
/* pass NULL as the config: config is read from command line arguments,
environment variables, configuration files */
---- contrib/tools/python3/src/PC/pyconfig.h (index)
-+++ contrib/tools/python3/src/PC/pyconfig.h (working tree)
+--- contrib/tools/python3/PC/pyconfig.h (index)
++++ contrib/tools/python3/PC/pyconfig.h (working tree)
@@ -306,10 +306,6 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
# endif
#endif
@@ -310,8 +260,8 @@
/* Define if you want to compile in object freelists optimization */
#define WITH_FREELISTS 1
---- contrib/tools/python3/src/Python/initconfig.c (index)
-+++ contrib/tools/python3/src/Python/initconfig.c (working tree)
+--- contrib/tools/python3/Python/initconfig.c (index)
++++ contrib/tools/python3/Python/initconfig.c (working tree)
@@ -163,7 +163,7 @@ int Py_InspectFlag = 0; /* Needed to determine whether to exit at SystemExit */
int Py_OptimizeFlag = 0; /* Needed by compile.c */
int Py_NoSiteFlag = 0; /* Suppress 'import site' */
@@ -321,8 +271,8 @@
int Py_IgnoreEnvironmentFlag = 0; /* e.g. PYTHONPATH, PYTHONHOME */
int Py_DontWriteBytecodeFlag = 0; /* Suppress writing bytecode files (*.pyc) */
int Py_NoUserSiteDirectory = 0; /* for -s and site.py */
---- contrib/tools/python3/src/Python/import.c (index)
-+++ contrib/tools/python3/src/Python/import.c (working tree)
+--- contrib/tools/python3/Python/import.c (index)
++++ contrib/tools/python3/Python/import.c (working tree)
@@ -2101,6 +2101,13 @@ init_importlib_external(PyInterpreterState *interp)
return -1;
}
diff --git a/contrib/tools/python3/src/Include/cpython/pytime.h b/contrib/tools/python3/src/Include/cpython/pytime.h
deleted file mode 100644
index 6891bd5c03f..00000000000
--- a/contrib/tools/python3/src/Include/cpython/pytime.h
+++ /dev/null
@@ -1,333 +0,0 @@
-// The _PyTime_t API is written to use timestamp and timeout values stored in
-// various formats and to read clocks.
-//
-// The _PyTime_t type is an integer to support directly common arithmetic
-// operations like t1 + t2.
-//
-// The _PyTime_t API supports a resolution of 1 nanosecond. The _PyTime_t type
-// is signed to support negative timestamps. The supported range is around
-// [-292.3 years; +292.3 years]. Using the Unix epoch (January 1st, 1970), the
-// supported date range is around [1677-09-21; 2262-04-11].
-//
-// Formats:
-//
-// * seconds
-// * seconds as a floating pointer number (C double)
-// * milliseconds (10^-3 seconds)
-// * microseconds (10^-6 seconds)
-// * 100 nanoseconds (10^-7 seconds)
-// * nanoseconds (10^-9 seconds)
-// * timeval structure, 1 microsecond resolution (10^-6 seconds)
-// * timespec structure, 1 nanosecond resolution (10^-9 seconds)
-//
-// Integer overflows are detected and raise OverflowError. Conversion to a
-// resolution worse than 1 nanosecond is rounded correctly with the requested
-// rounding mode. There are 4 rounding modes: floor (towards -inf), ceiling
-// (towards +inf), half even and up (away from zero).
-//
-// Some functions clamp the result in the range [_PyTime_MIN; _PyTime_MAX], so
-// the caller doesn't have to handle errors and doesn't need to hold the GIL.
-// For example, _PyTime_Add(t1, t2) computes t1+t2 and clamp the result on
-// overflow.
-//
-// Clocks:
-//
-// * System clock
-// * Monotonic clock
-// * Performance counter
-//
-// Operations like (t * k / q) with integers are implemented in a way to reduce
-// the risk of integer overflow. Such operation is used to convert a clock
-// value expressed in ticks with a frequency to _PyTime_t, like
-// QueryPerformanceCounter() with QueryPerformanceFrequency().
-
-#ifndef Py_LIMITED_API
-#ifndef Py_PYTIME_H
-#define Py_PYTIME_H
-
-struct timeval;
-
-/**************************************************************************
-Symbols and macros to supply platform-independent interfaces to time related
-functions and constants
-**************************************************************************/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __clang__
-struct timeval;
-#endif
-
-/* _PyTime_t: Python timestamp with subsecond precision. It can be used to
- store a duration, and so indirectly a date (related to another date, like
- UNIX epoch). */
-typedef int64_t _PyTime_t;
-// _PyTime_MIN nanoseconds is around -292.3 years
-#define _PyTime_MIN INT64_MIN
-// _PyTime_MAX nanoseconds is around +292.3 years
-#define _PyTime_MAX INT64_MAX
-#define _SIZEOF_PYTIME_T 8
-
-typedef enum {
- /* Round towards minus infinity (-inf).
- For example, used to read a clock. */
- _PyTime_ROUND_FLOOR=0,
- /* Round towards infinity (+inf).
- For example, used for timeout to wait "at least" N seconds. */
- _PyTime_ROUND_CEILING=1,
- /* Round to nearest with ties going to nearest even integer.
- For example, used to round from a Python float. */
- _PyTime_ROUND_HALF_EVEN=2,
- /* Round away from zero
- For example, used for timeout. _PyTime_ROUND_CEILING rounds
- -1e-9 to 0 milliseconds which causes bpo-31786 issue.
- _PyTime_ROUND_UP rounds -1e-9 to -1 millisecond which keeps
- the timeout sign as expected. select.poll(timeout) must block
- for negative values." */
- _PyTime_ROUND_UP=3,
- /* _PyTime_ROUND_TIMEOUT (an alias for _PyTime_ROUND_UP) should be
- used for timeouts. */
- _PyTime_ROUND_TIMEOUT = _PyTime_ROUND_UP
-} _PyTime_round_t;
-
-
-/* Convert a time_t to a PyLong. */
-PyAPI_FUNC(PyObject *) _PyLong_FromTime_t(
- time_t sec);
-
-/* Convert a PyLong to a time_t. */
-PyAPI_FUNC(time_t) _PyLong_AsTime_t(
- PyObject *obj);
-
-/* Convert a number of seconds, int or float, to time_t. */
-PyAPI_FUNC(int) _PyTime_ObjectToTime_t(
- PyObject *obj,
- time_t *sec,
- _PyTime_round_t);
-
-/* Convert a number of seconds, int or float, to a timeval structure.
- usec is in the range [0; 999999] and rounded towards zero.
- For example, -1.2 is converted to (-2, 800000). */
-PyAPI_FUNC(int) _PyTime_ObjectToTimeval(
- PyObject *obj,
- time_t *sec,
- long *usec,
- _PyTime_round_t);
-
-/* Convert a number of seconds, int or float, to a timespec structure.
- nsec is in the range [0; 999999999] and rounded towards zero.
- For example, -1.2 is converted to (-2, 800000000). */
-PyAPI_FUNC(int) _PyTime_ObjectToTimespec(
- PyObject *obj,
- time_t *sec,
- long *nsec,
- _PyTime_round_t);
-
-
-/* Create a timestamp from a number of seconds. */
-PyAPI_FUNC(_PyTime_t) _PyTime_FromSeconds(int seconds);
-
-/* Macro to create a timestamp from a number of seconds, no integer overflow.
- Only use the macro for small values, prefer _PyTime_FromSeconds(). */
-#define _PYTIME_FROMSECONDS(seconds) \
- ((_PyTime_t)(seconds) * (1000 * 1000 * 1000))
-
-/* Create a timestamp from a number of nanoseconds. */
-PyAPI_FUNC(_PyTime_t) _PyTime_FromNanoseconds(_PyTime_t ns);
-
-/* Create a timestamp from a number of microseconds.
- * Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow. */
-PyAPI_FUNC(_PyTime_t) _PyTime_FromMicrosecondsClamp(_PyTime_t us);
-
-/* Create a timestamp from nanoseconds (Python int). */
-PyAPI_FUNC(int) _PyTime_FromNanosecondsObject(_PyTime_t *t,
- PyObject *obj);
-
-/* Convert a number of seconds (Python float or int) to a timestamp.
- Raise an exception and return -1 on error, return 0 on success. */
-PyAPI_FUNC(int) _PyTime_FromSecondsObject(_PyTime_t *t,
- PyObject *obj,
- _PyTime_round_t round);
-
-/* Convert a number of milliseconds (Python float or int, 10^-3) to a timestamp.
- Raise an exception and return -1 on error, return 0 on success. */
-PyAPI_FUNC(int) _PyTime_FromMillisecondsObject(_PyTime_t *t,
- PyObject *obj,
- _PyTime_round_t round);
-
-/* Convert a timestamp to a number of seconds as a C double. */
-PyAPI_FUNC(double) _PyTime_AsSecondsDouble(_PyTime_t t);
-
-/* Convert timestamp to a number of milliseconds (10^-3 seconds). */
-PyAPI_FUNC(_PyTime_t) _PyTime_AsMilliseconds(_PyTime_t t,
- _PyTime_round_t round);
-
-/* Convert timestamp to a number of microseconds (10^-6 seconds). */
-PyAPI_FUNC(_PyTime_t) _PyTime_AsMicroseconds(_PyTime_t t,
- _PyTime_round_t round);
-
-/* Convert timestamp to a number of nanoseconds (10^-9 seconds). */
-PyAPI_FUNC(_PyTime_t) _PyTime_AsNanoseconds(_PyTime_t t);
-
-#ifdef MS_WINDOWS
-// Convert timestamp to a number of 100 nanoseconds (10^-7 seconds).
-PyAPI_FUNC(_PyTime_t) _PyTime_As100Nanoseconds(_PyTime_t t,
- _PyTime_round_t round);
-#endif
-
-/* Convert timestamp to a number of nanoseconds (10^-9 seconds) as a Python int
- object. */
-PyAPI_FUNC(PyObject *) _PyTime_AsNanosecondsObject(_PyTime_t t);
-
-#ifndef MS_WINDOWS
-/* Create a timestamp from a timeval structure.
- Raise an exception and return -1 on overflow, return 0 on success. */
-PyAPI_FUNC(int) _PyTime_FromTimeval(_PyTime_t *tp, struct timeval *tv);
-#endif
-
-/* Convert a timestamp to a timeval structure (microsecond resolution).
- tv_usec is always positive.
- Raise an exception and return -1 if the conversion overflowed,
- return 0 on success. */
-PyAPI_FUNC(int) _PyTime_AsTimeval(_PyTime_t t,
- struct timeval *tv,
- _PyTime_round_t round);
-
-/* Similar to _PyTime_AsTimeval() but don't raise an exception on overflow.
- On overflow, clamp tv_sec to _PyTime_t min/max. */
-PyAPI_FUNC(void) _PyTime_AsTimeval_clamp(_PyTime_t t,
- struct timeval *tv,
- _PyTime_round_t round);
-
-/* Convert a timestamp to a number of seconds (secs) and microseconds (us).
- us is always positive. This function is similar to _PyTime_AsTimeval()
- except that secs is always a time_t type, whereas the timeval structure
- uses a C long for tv_sec on Windows.
- Raise an exception and return -1 if the conversion overflowed,
- return 0 on success. */
-PyAPI_FUNC(int) _PyTime_AsTimevalTime_t(
- _PyTime_t t,
- time_t *secs,
- int *us,
- _PyTime_round_t round);
-
-#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_KQUEUE)
-/* Create a timestamp from a timespec structure.
- Raise an exception and return -1 on overflow, return 0 on success. */
-PyAPI_FUNC(int) _PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts);
-
-/* Convert a timestamp to a timespec structure (nanosecond resolution).
- tv_nsec is always positive.
- Raise an exception and return -1 on error, return 0 on success. */
-PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts);
-
-/* Similar to _PyTime_AsTimespec() but don't raise an exception on overflow.
- On overflow, clamp tv_sec to _PyTime_t min/max. */
-PyAPI_FUNC(void) _PyTime_AsTimespec_clamp(_PyTime_t t, struct timespec *ts);
-#endif
-
-
-// Compute t1 + t2. Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow.
-PyAPI_FUNC(_PyTime_t) _PyTime_Add(_PyTime_t t1, _PyTime_t t2);
-
-/* Compute ticks * mul / div.
- Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow.
- The caller must ensure that ((div - 1) * mul) cannot overflow. */
-PyAPI_FUNC(_PyTime_t) _PyTime_MulDiv(_PyTime_t ticks,
- _PyTime_t mul,
- _PyTime_t div);
-
-/* Structure used by time.get_clock_info() */
-typedef struct {
- const char *implementation;
- int monotonic;
- int adjustable;
- double resolution;
-} _Py_clock_info_t;
-
-/* Get the current time from the system clock.
-
- If the internal clock fails, silently ignore the error and return 0.
- On integer overflow, silently ignore the overflow and clamp the clock to
- [_PyTime_MIN; _PyTime_MAX].
-
- Use _PyTime_GetSystemClockWithInfo() to check for failure. */
-PyAPI_FUNC(_PyTime_t) _PyTime_GetSystemClock(void);
-
-/* Get the current time from the system clock.
- * On success, set *t and *info (if not NULL), and return 0.
- * On error, raise an exception and return -1.
- */
-PyAPI_FUNC(int) _PyTime_GetSystemClockWithInfo(
- _PyTime_t *t,
- _Py_clock_info_t *info);
-
-/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards.
- The clock is not affected by system clock updates. The reference point of
- the returned value is undefined, so that only the difference between the
- results of consecutive calls is valid.
-
- If the internal clock fails, silently ignore the error and return 0.
- On integer overflow, silently ignore the overflow and clamp the clock to
- [_PyTime_MIN; _PyTime_MAX].
-
- Use _PyTime_GetMonotonicClockWithInfo() to check for failure. */
-PyAPI_FUNC(_PyTime_t) _PyTime_GetMonotonicClock(void);
-
-/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards.
- The clock is not affected by system clock updates. The reference point of
- the returned value is undefined, so that only the difference between the
- results of consecutive calls is valid.
-
- Fill info (if set) with information of the function used to get the time.
-
- Return 0 on success, raise an exception and return -1 on error. */
-PyAPI_FUNC(int) _PyTime_GetMonotonicClockWithInfo(
- _PyTime_t *t,
- _Py_clock_info_t *info);
-
-
-/* Converts a timestamp to the Gregorian time, using the local time zone.
- Return 0 on success, raise an exception and return -1 on error. */
-PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm);
-
-/* Converts a timestamp to the Gregorian time, assuming UTC.
- Return 0 on success, raise an exception and return -1 on error. */
-PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm);
-
-/* Get the performance counter: clock with the highest available resolution to
- measure a short duration.
-
- If the internal clock fails, silently ignore the error and return 0.
- On integer overflow, silently ignore the overflow and clamp the clock to
- [_PyTime_MIN; _PyTime_MAX].
-
- Use _PyTime_GetPerfCounterWithInfo() to check for failure. */
-PyAPI_FUNC(_PyTime_t) _PyTime_GetPerfCounter(void);
-
-/* Get the performance counter: clock with the highest available resolution to
- measure a short duration.
-
- Fill info (if set) with information of the function used to get the time.
-
- Return 0 on success, raise an exception and return -1 on error. */
-PyAPI_FUNC(int) _PyTime_GetPerfCounterWithInfo(
- _PyTime_t *t,
- _Py_clock_info_t *info);
-
-
-// Create a deadline.
-// Pseudo code: _PyTime_GetMonotonicClock() + timeout.
-PyAPI_FUNC(_PyTime_t) _PyDeadline_Init(_PyTime_t timeout);
-
-// Get remaining time from a deadline.
-// Pseudo code: deadline - _PyTime_GetMonotonicClock().
-PyAPI_FUNC(_PyTime_t) _PyDeadline_Get(_PyTime_t deadline);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* Py_PYTIME_H */
-#endif /* Py_LIMITED_API */
diff --git a/contrib/tools/python3/src/Include/internal/pycore_condvar.h b/contrib/tools/python3/src/Include/internal/pycore_condvar.h
deleted file mode 100644
index acdc9db12c5..00000000000
--- a/contrib/tools/python3/src/Include/internal/pycore_condvar.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef Py_INTERNAL_CONDVAR_H
-#define Py_INTERNAL_CONDVAR_H
-
-#ifndef Py_BUILD_CORE
-# error "this header requires Py_BUILD_CORE define"
-#endif
-
-#ifndef _POSIX_THREADS
-/* This means pthreads are not implemented in libc headers, hence the macro
- not present in unistd.h. But they still can be implemented as an external
- library (e.g. gnu pth in pthread emulation) */
-# ifdef HAVE_PTHREAD_H
-# include <pthread.h> /* _POSIX_THREADS */
-# endif
-#endif
-
-#ifdef _POSIX_THREADS
-/*
- * POSIX support
- */
-#define Py_HAVE_CONDVAR
-
-#ifdef HAVE_PTHREAD_H
-# include <pthread.h>
-#endif
-
-#define PyMUTEX_T pthread_mutex_t
-#define PyCOND_T pthread_cond_t
-
-#elif defined(NT_THREADS)
-/*
- * Windows (XP, 2003 server and later, as well as (hopefully) CE) support
- *
- * Emulated condition variables ones that work with XP and later, plus
- * example native support on VISTA and onwards.
- */
-#define Py_HAVE_CONDVAR
-
-/* include windows if it hasn't been done before */
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-
-/* options */
-/* non-emulated condition variables are provided for those that want
- * to target Windows Vista. Modify this macro to enable them.
- */
-#ifndef _PY_EMULATED_WIN_CV
-#define _PY_EMULATED_WIN_CV 1 /* use emulated condition variables */
-#endif
-
-/* fall back to emulation if not targeting Vista */
-#if !defined NTDDI_VISTA || NTDDI_VERSION < NTDDI_VISTA
-#undef _PY_EMULATED_WIN_CV
-#define _PY_EMULATED_WIN_CV 1
-#endif
-
-#if _PY_EMULATED_WIN_CV
-
-typedef CRITICAL_SECTION PyMUTEX_T;
-
-/* The ConditionVariable object. From XP onwards it is easily emulated
- with a Semaphore.
- Semaphores are available on Windows XP (2003 server) and later.
- We use a Semaphore rather than an auto-reset event, because although
- an auto-reset event might appear to solve the lost-wakeup bug (race
- condition between releasing the outer lock and waiting) because it
- maintains state even though a wait hasn't happened, there is still
- a lost wakeup problem if more than one thread are interrupted in the
- critical place. A semaphore solves that, because its state is
- counted, not Boolean.
- Because it is ok to signal a condition variable with no one
- waiting, we need to keep track of the number of
- waiting threads. Otherwise, the semaphore's state could rise
- without bound. This also helps reduce the number of "spurious wakeups"
- that would otherwise happen.
- */
-
-typedef struct _PyCOND_T
-{
- HANDLE sem;
- int waiting; /* to allow PyCOND_SIGNAL to be a no-op */
-} PyCOND_T;
-
-#else /* !_PY_EMULATED_WIN_CV */
-
-/* Use native Win7 primitives if build target is Win7 or higher */
-
-/* SRWLOCK is faster and better than CriticalSection */
-typedef SRWLOCK PyMUTEX_T;
-
-typedef CONDITION_VARIABLE PyCOND_T;
-
-#endif /* _PY_EMULATED_WIN_CV */
-
-#endif /* _POSIX_THREADS, NT_THREADS */
-
-#endif /* Py_INTERNAL_CONDVAR_H */
diff --git a/contrib/tools/python3/src/Include/pyconfig-linux.h b/contrib/tools/python3/src/Include/pyconfig-linux.h
deleted file mode 100644
index 0cf6e48f50f..00000000000
--- a/contrib/tools/python3/src/Include/pyconfig-linux.h
+++ /dev/null
@@ -1,1947 +0,0 @@
-/* pyconfig.h. Generated from pyconfig.h.in by configure. */
-/* pyconfig.h.in. Generated from configure.ac by autoheader. */
-
-
-#ifndef Py_PYCONFIG_H
-#define Py_PYCONFIG_H
-
-
-/* Define if building universal (internal helper macro) */
-/* #undef AC_APPLE_UNIVERSAL_BUILD */
-
-/* BUILD_GNU_TYPE + AIX_BUILDDATE are used to construct the PEP425 tag of the
- build system. */
-/* #undef AIX_BUILDDATE */
-
-/* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want
- support for AIX C++ shared extension modules. */
-/* #undef AIX_GENUINE_CPLUSPLUS */
-
-/* The normal alignment of `long', in bytes. */
-#define ALIGNOF_LONG 8
-
-/* The normal alignment of `max_align_t', in bytes. */
-#define ALIGNOF_MAX_ALIGN_T 16
-
-/* The normal alignment of `size_t', in bytes. */
-#define ALIGNOF_SIZE_T 8
-
-/* Alternative SOABI used in debug build to load C extensions built in release
- mode */
-/* #undef ALT_SOABI */
-
-/* The Android API level. */
-/* #undef ANDROID_API_LEVEL */
-
-/* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM
- mixed-endian order (byte order 45670123) */
-/* #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 */
-
-/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the most
- significant byte first */
-/* #undef DOUBLE_IS_BIG_ENDIAN_IEEE754 */
-
-/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
- least significant byte first */
-#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1
-
-/* Define if --enable-ipv6 is specified */
-#define ENABLE_IPV6 1
-
-/* Define to 1 if your system stores words within floats with the most
- significant word first */
-/* #undef FLOAT_WORDS_BIGENDIAN */
-
-/* Define if getpgrp() must be called as getpgrp(0). */
-/* #undef GETPGRP_HAVE_ARG */
-
-/* Define if you have the 'accept' function. */
-#define HAVE_ACCEPT 1
-
-/* Define to 1 if you have the `accept4' function. */
-#define HAVE_ACCEPT4 1
-
-/* Define to 1 if you have the `acosh' function. */
-#define HAVE_ACOSH 1
-
-/* struct addrinfo (netdb.h) */
-#define HAVE_ADDRINFO 1
-
-/* Define to 1 if you have the `alarm' function. */
-#define HAVE_ALARM 1
-
-/* Define if aligned memory access is required */
-/* #undef HAVE_ALIGNED_REQUIRED */
-
-/* Define to 1 if you have the <alloca.h> header file. */
-#define HAVE_ALLOCA_H 1
-
-/* Define this if your time.h defines altzone. */
-/* #undef HAVE_ALTZONE */
-
-/* Define to 1 if you have the `asinh' function. */
-#define HAVE_ASINH 1
-
-/* Define to 1 if you have the <asm/types.h> header file. */
-#define HAVE_ASM_TYPES_H 1
-
-/* Define to 1 if you have the `atanh' function. */
-#define HAVE_ATANH 1
-
-/* Define if you have the 'bind' function. */
-#define HAVE_BIND 1
-
-/* Define to 1 if you have the `bind_textdomain_codeset' function. */
-#define HAVE_BIND_TEXTDOMAIN_CODESET 1
-
-/* Define to 1 if you have the <bluetooth/bluetooth.h> header file. */
-/* #undef HAVE_BLUETOOTH_BLUETOOTH_H */
-
-/* Define to 1 if you have the <bluetooth.h> header file. */
-/* #undef HAVE_BLUETOOTH_H */
-
-/* Define if mbstowcs(NULL, "text", 0) does not return the number of wide
- chars that would be converted. */
-/* #undef HAVE_BROKEN_MBSTOWCS */
-
-/* Define if nice() returns success/failure instead of the new priority. */
-/* #undef HAVE_BROKEN_NICE */
-
-/* Define if the system reports an invalid PIPE_BUF value. */
-/* #undef HAVE_BROKEN_PIPE_BUF */
-
-/* Define if poll() sets errno on invalid file descriptors. */
-/* #undef HAVE_BROKEN_POLL */
-
-/* Define if the Posix semaphores do not work on your system */
-/* #undef HAVE_BROKEN_POSIX_SEMAPHORES */
-
-/* Define if pthread_sigmask() does not work on your system. */
-/* #undef HAVE_BROKEN_PTHREAD_SIGMASK */
-
-/* define to 1 if your sem_getvalue is broken. */
-/* #undef HAVE_BROKEN_SEM_GETVALUE */
-
-/* Define if 'unsetenv' does not return an int. */
-/* #undef HAVE_BROKEN_UNSETENV */
-
-/* Has builtin __atomic_load_n() and __atomic_store_n() functions */
-#define HAVE_BUILTIN_ATOMIC 1
-
-/* Define to 1 if you have the <bzlib.h> header file. */
-/* #undef HAVE_BZLIB_H */
-
-/* Define to 1 if you have the 'chflags' function. */
-/* #undef HAVE_CHFLAGS */
-
-/* Define to 1 if you have the `chmod' function. */
-#define HAVE_CHMOD 1
-
-/* Define to 1 if you have the `chown' function. */
-#define HAVE_CHOWN 1
-
-/* Define if you have the 'chroot' function. */
-#define HAVE_CHROOT 1
-
-/* Define to 1 if you have the `clock' function. */
-#define HAVE_CLOCK 1
-
-/* Define to 1 if you have the `clock_getres' function. */
-#define HAVE_CLOCK_GETRES 1
-
-/* Define to 1 if you have the `clock_gettime' function. */
-#define HAVE_CLOCK_GETTIME 1
-
-/* Define to 1 if you have the `clock_nanosleep' function. */
-#define HAVE_CLOCK_NANOSLEEP 1
-
-/* Define to 1 if you have the `clock_settime' function. */
-#define HAVE_CLOCK_SETTIME 1
-
-/* Define to 1 if you have the `close_range' function. */
-/* #undef HAVE_CLOSE_RANGE */
-
-/* Define if the C compiler supports computed gotos. */
-#define HAVE_COMPUTED_GOTOS 1
-
-/* Define to 1 if you have the `confstr' function. */
-#define HAVE_CONFSTR 1
-
-/* Define to 1 if you have the <conio.h> header file. */
-/* #undef HAVE_CONIO_H */
-
-/* Define if you have the 'connect' function. */
-#define HAVE_CONNECT 1
-
-/* Define to 1 if you have the `copy_file_range' function. */
-/* #undef HAVE_COPY_FILE_RANGE */
-
-/* Define to 1 if you have the <crypt.h> header file. */
-#define HAVE_CRYPT_H 1
-
-/* Define if you have the crypt_r() function. */
-#define HAVE_CRYPT_R 1
-
-/* Define to 1 if you have the `ctermid' function. */
-#define HAVE_CTERMID 1
-
-/* Define if you have the 'ctermid_r' function. */
-/* #undef HAVE_CTERMID_R */
-
-/* Define if you have the 'filter' function. */
-#define HAVE_CURSES_FILTER 1
-
-/* Define to 1 if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the 'has_key' function. */
-#define HAVE_CURSES_HAS_KEY 1
-
-/* Define if you have the 'immedok' function. */
-#define HAVE_CURSES_IMMEDOK 1
-
-/* Define if you have the 'is_pad' function. */
-#define HAVE_CURSES_IS_PAD 1
-
-/* Define if you have the 'is_term_resized' function. */
-#define HAVE_CURSES_IS_TERM_RESIZED 1
-
-/* Define if you have the 'resizeterm' function. */
-#define HAVE_CURSES_RESIZETERM 1
-
-/* Define if you have the 'resize_term' function. */
-#define HAVE_CURSES_RESIZE_TERM 1
-
-/* Define if you have the 'syncok' function. */
-#define HAVE_CURSES_SYNCOK 1
-
-/* Define if you have the 'typeahead' function. */
-#define HAVE_CURSES_TYPEAHEAD 1
-
-/* Define if you have the 'use_env' function. */
-#define HAVE_CURSES_USE_ENV 1
-
-/* Define if you have the 'wchgat' function. */
-#define HAVE_CURSES_WCHGAT 1
-
-/* Define to 1 if you have the <db.h> header file. */
-/* #undef HAVE_DB_H */
-
-/* Define to 1 if you have the declaration of `RTLD_DEEPBIND', and to 0 if you
- don't. */
-#define HAVE_DECL_RTLD_DEEPBIND 1
-
-/* Define to 1 if you have the declaration of `RTLD_GLOBAL', and to 0 if you
- don't. */
-#define HAVE_DECL_RTLD_GLOBAL 1
-
-/* Define to 1 if you have the declaration of `RTLD_LAZY', and to 0 if you
- don't. */
-#define HAVE_DECL_RTLD_LAZY 1
-
-/* Define to 1 if you have the declaration of `RTLD_LOCAL', and to 0 if you
- don't. */
-#define HAVE_DECL_RTLD_LOCAL 1
-
-/* Define to 1 if you have the declaration of `RTLD_MEMBER', and to 0 if you
- don't. */
-#define HAVE_DECL_RTLD_MEMBER 0
-
-/* Define to 1 if you have the declaration of `RTLD_NODELETE', and to 0 if you
- don't. */
-#define HAVE_DECL_RTLD_NODELETE 1
-
-/* Define to 1 if you have the declaration of `RTLD_NOLOAD', and to 0 if you
- don't. */
-#define HAVE_DECL_RTLD_NOLOAD 1
-
-/* Define to 1 if you have the declaration of `RTLD_NOW', and to 0 if you
- don't. */
-#define HAVE_DECL_RTLD_NOW 1
-
-/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
- */
-/* #undef HAVE_DECL_TZNAME */
-
-/* Define to 1 if you have the device macros. */
-#define HAVE_DEVICE_MACROS 1
-
-/* Define to 1 if you have the /dev/ptc device file. */
-/* #undef HAVE_DEV_PTC */
-
-/* Define to 1 if you have the /dev/ptmx device file. */
-#define HAVE_DEV_PTMX 1
-
-/* Define to 1 if you have the <direct.h> header file. */
-/* #undef HAVE_DIRECT_H */
-
-/* Define to 1 if the dirent structure has a d_type field */
-#define HAVE_DIRENT_D_TYPE 1
-
-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
- */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the 'dirfd' function or macro. */
-#define HAVE_DIRFD 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the `dlopen' function. */
-#define HAVE_DLOPEN 1
-
-/* Define to 1 if you have the `dup' function. */
-#define HAVE_DUP 1
-
-/* Define to 1 if you have the `dup2' function. */
-#define HAVE_DUP2 1
-
-/* Define to 1 if you have the `dup3' function. */
-#define HAVE_DUP3 1
-
-/* Define if you have the '_dyld_shared_cache_contains_path' function. */
-/* #undef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH */
-
-/* Defined when any dynamic module loading is enabled. */
-#define HAVE_DYNAMIC_LOADING 1
-
-/* Define to 1 if you have the <editline/readline.h> header file. */
-/* #undef HAVE_EDITLINE_READLINE_H */
-
-/* Define to 1 if you have the <endian.h> header file. */
-#define HAVE_ENDIAN_H 1
-
-/* Define if you have the 'epoll_create' function. */
-#define HAVE_EPOLL 1
-
-/* Define if you have the 'epoll_create1' function. */
-#define HAVE_EPOLL_CREATE1 1
-
-/* Define to 1 if you have the `erf' function. */
-#define HAVE_ERF 1
-
-/* Define to 1 if you have the `erfc' function. */
-#define HAVE_ERFC 1
-
-/* Define to 1 if you have the <errno.h> header file. */
-#define HAVE_ERRNO_H 1
-
-/* Define if you have the 'eventfd' function. */
-#define HAVE_EVENTFD 1
-
-/* Define to 1 if you have the `execv' function. */
-#define HAVE_EXECV 1
-
-/* Define to 1 if you have the `explicit_bzero' function. */
-#define HAVE_EXPLICIT_BZERO 1
-
-/* Define to 1 if you have the `explicit_memset' function. */
-/* #undef HAVE_EXPLICIT_MEMSET */
-
-/* Define to 1 if you have the `expm1' function. */
-#define HAVE_EXPM1 1
-
-/* Define to 1 if you have the `faccessat' function. */
-#define HAVE_FACCESSAT 1
-
-/* Define if you have the 'fchdir' function. */
-#define HAVE_FCHDIR 1
-
-/* Define to 1 if you have the `fchmod' function. */
-#define HAVE_FCHMOD 1
-
-/* Define to 1 if you have the `fchmodat' function. */
-#define HAVE_FCHMODAT 1
-
-/* Define to 1 if you have the `fchown' function. */
-#define HAVE_FCHOWN 1
-
-/* Define to 1 if you have the `fchownat' function. */
-#define HAVE_FCHOWNAT 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define if you have the 'fdatasync' function. */
-#define HAVE_FDATASYNC 1
-
-/* Define to 1 if you have the `fdopendir' function. */
-#define HAVE_FDOPENDIR 1
-
-/* Define to 1 if you have the `fdwalk' function. */
-/* #undef HAVE_FDWALK */
-
-/* Define to 1 if you have the `fexecve' function. */
-#define HAVE_FEXECVE 1
-
-/* Define if you have the 'ffi_closure_alloc' function. */
-#define HAVE_FFI_CLOSURE_ALLOC 1
-
-/* Define if you have the 'ffi_prep_cif_var' function. */
-#define HAVE_FFI_PREP_CIF_VAR 1
-
-/* Define if you have the 'ffi_prep_closure_loc' function. */
-#define HAVE_FFI_PREP_CLOSURE_LOC 1
-
-/* Define to 1 if you have the `flock' function. */
-#define HAVE_FLOCK 1
-
-/* Define to 1 if you have the `fork' function. */
-#define HAVE_FORK 1
-
-/* Define to 1 if you have the `fork1' function. */
-/* #undef HAVE_FORK1 */
-
-/* Define to 1 if you have the `forkpty' function. */
-/* #undef HAVE_FORKPTY */
-
-/* Define to 1 if you have the `fpathconf' function. */
-#define HAVE_FPATHCONF 1
-
-/* Define to 1 if you have the `fseek64' function. */
-/* #undef HAVE_FSEEK64 */
-
-/* Define to 1 if you have the `fseeko' function. */
-#define HAVE_FSEEKO 1
-
-/* Define to 1 if you have the `fstatat' function. */
-#define HAVE_FSTATAT 1
-
-/* Define to 1 if you have the `fstatvfs' function. */
-#define HAVE_FSTATVFS 1
-
-/* Define if you have the 'fsync' function. */
-#define HAVE_FSYNC 1
-
-/* Define to 1 if you have the `ftell64' function. */
-/* #undef HAVE_FTELL64 */
-
-/* Define to 1 if you have the `ftello' function. */
-#define HAVE_FTELLO 1
-
-/* Define to 1 if you have the `ftime' function. */
-#define HAVE_FTIME 1
-
-/* Define to 1 if you have the `ftruncate' function. */
-#define HAVE_FTRUNCATE 1
-
-/* Define to 1 if you have the `futimens' function. */
-#define HAVE_FUTIMENS 1
-
-/* Define to 1 if you have the `futimes' function. */
-#define HAVE_FUTIMES 1
-
-/* Define to 1 if you have the `futimesat' function. */
-#define HAVE_FUTIMESAT 1
-
-/* Define to 1 if you have the `gai_strerror' function. */
-#define HAVE_GAI_STRERROR 1
-
-/* Define if we can use gcc inline assembler to get and set mc68881 fpcr */
-/* #undef HAVE_GCC_ASM_FOR_MC68881 */
-
-/* Define if we can use x64 gcc inline assembler */
-#define HAVE_GCC_ASM_FOR_X64 1
-
-/* Define if we can use gcc inline assembler to get and set x87 control word
- */
-#if defined(__x86_64__) || defined(__i386__)
-#define HAVE_GCC_ASM_FOR_X87 1
-#endif
-
-/* Define if your compiler provides __uint128_t */
-#define HAVE_GCC_UINT128_T 1
-
-/* Define to 1 if you have the <gdbm-ndbm.h> header file. */
-/* #undef HAVE_GDBM_DASH_NDBM_H */
-
-/* Define to 1 if you have the <gdbm.h> header file. */
-/* #undef HAVE_GDBM_H */
-
-/* Define to 1 if you have the <gdbm/ndbm.h> header file. */
-/* #undef HAVE_GDBM_NDBM_H */
-
-/* Define if you have the getaddrinfo function. */
-#define HAVE_GETADDRINFO 1
-
-/* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
-#define HAVE_GETC_UNLOCKED 1
-
-/* Define to 1 if you have the `getegid' function. */
-#define HAVE_GETEGID 1
-
-/* Define to 1 if you have the `getentropy' function. */
-#define HAVE_GETENTROPY 1
-
-/* Define to 1 if you have the `geteuid' function. */
-#define HAVE_GETEUID 1
-
-/* Define to 1 if you have the `getgid' function. */
-#define HAVE_GETGID 1
-
-/* Define to 1 if you have the `getgrgid' function. */
-#define HAVE_GETGRGID 1
-
-/* Define to 1 if you have the `getgrgid_r' function. */
-#define HAVE_GETGRGID_R 1
-
-/* Define to 1 if you have the `getgrnam_r' function. */
-#define HAVE_GETGRNAM_R 1
-
-/* Define to 1 if you have the `getgrouplist' function. */
-#define HAVE_GETGROUPLIST 1
-
-/* Define to 1 if you have the `getgroups' function. */
-#define HAVE_GETGROUPS 1
-
-/* Define if you have the 'gethostbyaddr' function. */
-#define HAVE_GETHOSTBYADDR 1
-
-/* Define to 1 if you have the `gethostbyname' function. */
-#define HAVE_GETHOSTBYNAME 1
-
-/* Define this if you have some version of gethostbyname_r() */
-#define HAVE_GETHOSTBYNAME_R 1
-
-/* Define this if you have the 3-arg version of gethostbyname_r(). */
-/* #undef HAVE_GETHOSTBYNAME_R_3_ARG */
-
-/* Define this if you have the 5-arg version of gethostbyname_r(). */
-/* #undef HAVE_GETHOSTBYNAME_R_5_ARG */
-
-/* Define this if you have the 6-arg version of gethostbyname_r(). */
-#define HAVE_GETHOSTBYNAME_R_6_ARG 1
-
-/* Define to 1 if you have the `gethostname' function. */
-#define HAVE_GETHOSTNAME 1
-
-/* Define to 1 if you have the `getitimer' function. */
-#define HAVE_GETITIMER 1
-
-/* Define to 1 if you have the `getloadavg' function. */
-#define HAVE_GETLOADAVG 1
-
-/* Define to 1 if you have the `getlogin' function. */
-#define HAVE_GETLOGIN 1
-
-/* Define to 1 if you have the `getnameinfo' function. */
-#define HAVE_GETNAMEINFO 1
-
-/* Define if you have the 'getpagesize' function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the 'getpeername' function. */
-#define HAVE_GETPEERNAME 1
-
-/* Define to 1 if you have the `getpgid' function. */
-#define HAVE_GETPGID 1
-
-/* Define to 1 if you have the `getpgrp' function. */
-#define HAVE_GETPGRP 1
-
-/* Define to 1 if you have the `getpid' function. */
-#define HAVE_GETPID 1
-
-/* Define to 1 if you have the `getppid' function. */
-#define HAVE_GETPPID 1
-
-/* Define to 1 if you have the `getpriority' function. */
-#define HAVE_GETPRIORITY 1
-
-/* Define if you have the 'getprotobyname' function. */
-#define HAVE_GETPROTOBYNAME 1
-
-/* Define to 1 if you have the `getpwent' function. */
-#define HAVE_GETPWENT 1
-
-/* Define to 1 if you have the `getpwnam_r' function. */
-#define HAVE_GETPWNAM_R 1
-
-/* Define to 1 if you have the `getpwuid' function. */
-#define HAVE_GETPWUID 1
-
-/* Define to 1 if you have the `getpwuid_r' function. */
-#define HAVE_GETPWUID_R 1
-
-/* Define to 1 if the getrandom() function is available */
-#define HAVE_GETRANDOM 1
-
-/* Define to 1 if the Linux getrandom() syscall is available */
-#define HAVE_GETRANDOM_SYSCALL 1
-
-/* Define to 1 if you have the `getresgid' function. */
-#define HAVE_GETRESGID 1
-
-/* Define to 1 if you have the `getresuid' function. */
-#define HAVE_GETRESUID 1
-
-/* Define to 1 if you have the `getrusage' function. */
-#define HAVE_GETRUSAGE 1
-
-/* Define if you have the 'getservbyname' function. */
-#define HAVE_GETSERVBYNAME 1
-
-/* Define if you have the 'getservbyport' function. */
-#define HAVE_GETSERVBYPORT 1
-
-/* Define to 1 if you have the `getsid' function. */
-#define HAVE_GETSID 1
-
-/* Define if you have the 'getsockname' function. */
-#define HAVE_GETSOCKNAME 1
-
-/* Define to 1 if you have the `getspent' function. */
-#define HAVE_GETSPENT 1
-
-/* Define to 1 if you have the `getspnam' function. */
-#define HAVE_GETSPNAM 1
-
-/* Define to 1 if you have the `getuid' function. */
-#define HAVE_GETUID 1
-
-/* Define to 1 if you have the `getwd' function. */
-#define HAVE_GETWD 1
-
-/* Define if glibc has incorrect _FORTIFY_SOURCE wrappers for memmove and
- bcopy. */
-/* #undef HAVE_GLIBC_MEMMOVE_BUG */
-
-/* Define to 1 if you have the <grp.h> header file. */
-#define HAVE_GRP_H 1
-
-/* Define if you have the 'hstrerror' function. */
-#define HAVE_HSTRERROR 1
-
-/* Define this if you have le64toh() */
-#define HAVE_HTOLE64 1
-
-/* Define to 1 if you have the <ieeefp.h> header file. */
-/* #undef HAVE_IEEEFP_H */
-
-/* Define to 1 if you have the `if_nameindex' function. */
-#define HAVE_IF_NAMEINDEX 1
-
-/* Define if you have the 'inet_aton' function. */
-#define HAVE_INET_ATON 1
-
-/* Define if you have the 'inet_ntoa' function. */
-#define HAVE_INET_NTOA 1
-
-/* Define if you have the 'inet_pton' function. */
-#define HAVE_INET_PTON 1
-
-/* Define to 1 if you have the `initgroups' function. */
-#define HAVE_INITGROUPS 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the <io.h> header file. */
-/* #undef HAVE_IO_H */
-
-/* Define if gcc has the ipa-pure-const bug. */
-/* #undef HAVE_IPA_PURE_CONST_BUG */
-
-/* Define to 1 if you have the `kill' function. */
-#define HAVE_KILL 1
-
-/* Define to 1 if you have the `killpg' function. */
-#define HAVE_KILLPG 1
-
-/* Define if you have the 'kqueue' function. */
-/* #undef HAVE_KQUEUE */
-
-/* Define to 1 if you have the <langinfo.h> header file. */
-#define HAVE_LANGINFO_H 1
-
-/* Defined to enable large file support when an off_t is bigger than a long
- and long long is at least as big as an off_t. You may need to add some
- flags for configuration and compilation to enable this mode. (For Solaris
- and Linux, the necessary defines are already defined.) */
-/* #undef HAVE_LARGEFILE_SUPPORT */
-
-/* Define to 1 if you have the 'lchflags' function. */
-/* #undef HAVE_LCHFLAGS */
-
-/* Define to 1 if you have the `lchmod' function. */
-/* #undef HAVE_LCHMOD */
-
-/* Define to 1 if you have the `lchown' function. */
-#define HAVE_LCHOWN 1
-
-/* Define to 1 if you want to build _blake2 module with libb2 */
-/* #undef HAVE_LIBB2 */
-
-/* Define to 1 if you have the `db' library (-ldb). */
-/* #undef HAVE_LIBDB */
-
-/* Define to 1 if you have the `dl' library (-ldl). */
-#define HAVE_LIBDL 1
-
-/* Define to 1 if you have the `dld' library (-ldld). */
-/* #undef HAVE_LIBDLD */
-
-/* Define to 1 if you have the `ieee' library (-lieee). */
-/* #undef HAVE_LIBIEEE */
-
-/* Define to 1 if you have the <libintl.h> header file. */
-#define HAVE_LIBINTL_H 1
-
-/* Define to 1 if you have the `resolv' library (-lresolv). */
-/* #undef HAVE_LIBRESOLV */
-
-/* Define to 1 if you have the `sendfile' library (-lsendfile). */
-/* #undef HAVE_LIBSENDFILE */
-
-/* Define to 1 if you have the `sqlite3' library (-lsqlite3). */
-#define HAVE_LIBSQLITE3 1
-
-/* Define to 1 if you have the <libutil.h> header file. */
-/* #undef HAVE_LIBUTIL_H */
-
-/* Define if you have the 'link' function. */
-#define HAVE_LINK 1
-
-/* Define to 1 if you have the `linkat' function. */
-#define HAVE_LINKAT 1
-
-/* Define to 1 if you have the <linux/auxvec.h> header file. */
-#define HAVE_LINUX_AUXVEC_H 1
-
-/* Define to 1 if you have the <linux/can/bcm.h> header file. */
-#define HAVE_LINUX_CAN_BCM_H 1
-
-/* Define to 1 if you have the <linux/can.h> header file. */
-#define HAVE_LINUX_CAN_H 1
-
-/* Define to 1 if you have the <linux/can/j1939.h> header file. */
-#define HAVE_LINUX_CAN_J1939_H 1
-
-/* Define if compiling using Linux 3.6 or later. */
-#define HAVE_LINUX_CAN_RAW_FD_FRAMES 1
-
-/* Define to 1 if you have the <linux/can/raw.h> header file. */
-#define HAVE_LINUX_CAN_RAW_H 1
-
-/* Define if compiling using Linux 4.1 or later. */
-#define HAVE_LINUX_CAN_RAW_JOIN_FILTERS 1
-
-/* Define to 1 if you have the <linux/fs.h> header file. */
-#define HAVE_LINUX_FS_H 1
-
-/* Define to 1 if you have the <linux/limits.h> header file. */
-#define HAVE_LINUX_LIMITS_H 1
-
-/* Define to 1 if you have the <linux/memfd.h> header file. */
-#define HAVE_LINUX_MEMFD_H 1
-
-/* Define to 1 if you have the <linux/netlink.h> header file. */
-#define HAVE_LINUX_NETLINK_H 1
-
-/* Define to 1 if you have the <linux/qrtr.h> header file. */
-#define HAVE_LINUX_QRTR_H 1
-
-/* Define to 1 if you have the <linux/random.h> header file. */
-#define HAVE_LINUX_RANDOM_H 1
-
-/* Define to 1 if you have the <linux/soundcard.h> header file. */
-#define HAVE_LINUX_SOUNDCARD_H 1
-
-/* Define to 1 if you have the <linux/tipc.h> header file. */
-#define HAVE_LINUX_TIPC_H 1
-
-/* Define to 1 if you have the <linux/vm_sockets.h> header file. */
-#define HAVE_LINUX_VM_SOCKETS_H 1
-
-/* Define to 1 if you have the <linux/wait.h> header file. */
-#define HAVE_LINUX_WAIT_H 1
-
-/* Define if you have the 'listen' function. */
-#define HAVE_LISTEN 1
-
-/* Define to 1 if you have the `lockf' function. */
-#define HAVE_LOCKF 1
-
-/* Define to 1 if you have the `log1p' function. */
-#define HAVE_LOG1P 1
-
-/* Define to 1 if you have the `log2' function. */
-#define HAVE_LOG2 1
-
-/* Define to 1 if you have the `login_tty' function. */
-/* #undef HAVE_LOGIN_TTY */
-
-/* Define to 1 if the system has the type `long double'. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define to 1 if you have the `lstat' function. */
-#define HAVE_LSTAT 1
-
-/* Define to 1 if you have the `lutimes' function. */
-#define HAVE_LUTIMES 1
-
-/* Define to 1 if you have the <lzma.h> header file. */
-/* #undef HAVE_LZMA_H */
-
-/* Define to 1 if you have the `madvise' function. */
-#define HAVE_MADVISE 1
-
-/* Define this if you have the makedev macro. */
-#define HAVE_MAKEDEV 1
-
-/* Define to 1 if you have the `mbrtowc' function. */
-#define HAVE_MBRTOWC 1
-
-/* Define if you have the 'memfd_create' function. */
-#define HAVE_MEMFD_CREATE 1
-
-/* Define to 1 if you have the `memrchr' function. */
-#define HAVE_MEMRCHR 1
-
-/* Define to 1 if you have the <minix/config.h> header file. */
-/* #undef HAVE_MINIX_CONFIG_H */
-
-/* Define to 1 if you have the `mkdirat' function. */
-#define HAVE_MKDIRAT 1
-
-/* Define to 1 if you have the `mkfifo' function. */
-#define HAVE_MKFIFO 1
-
-/* Define to 1 if you have the `mkfifoat' function. */
-#define HAVE_MKFIFOAT 1
-
-/* Define to 1 if you have the `mknod' function. */
-#define HAVE_MKNOD 1
-
-/* Define to 1 if you have the `mknodat' function. */
-#define HAVE_MKNODAT 1
-
-/* Define to 1 if you have the `mktime' function. */
-#define HAVE_MKTIME 1
-
-/* Define to 1 if you have the `mmap' function. */
-#define HAVE_MMAP 1
-
-/* Define to 1 if you have the `mremap' function. */
-#define HAVE_MREMAP 1
-
-/* Define to 1 if you have the `nanosleep' function. */
-#define HAVE_NANOSLEEP 1
-
-/* Define to 1 if you have the `ncursesw' library. */
-#define HAVE_NCURSESW 1
-
-/* Define to 1 if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define to 1 if you have the <ndbm.h> header file. */
-/* #undef HAVE_NDBM_H */
-
-/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
-/* #undef HAVE_NDIR_H */
-
-/* Define to 1 if you have the <netcan/can.h> header file. */
-/* #undef HAVE_NETCAN_CAN_H */
-
-/* Define to 1 if you have the <netdb.h> header file. */
-#define HAVE_NETDB_H 1
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#define HAVE_NETINET_IN_H 1
-
-/* Define to 1 if you have the <netpacket/packet.h> header file. */
-#define HAVE_NETPACKET_PACKET_H 1
-
-/* Define to 1 if you have the <net/ethernet.h> header file. */
-#define HAVE_NET_ETHERNET_H 1
-
-/* Define to 1 if you have the <net/if.h> header file. */
-#define HAVE_NET_IF_H 1
-
-/* Define to 1 if you have the `nice' function. */
-#define HAVE_NICE 1
-
-/* Define if the internal form of wchar_t in non-Unicode locales is not
- Unicode. */
-/* #undef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION */
-
-/* Define to 1 if you have the `openat' function. */
-#define HAVE_OPENAT 1
-
-/* Define to 1 if you have the `opendir' function. */
-#define HAVE_OPENDIR 1
-
-/* Define to 1 if you have the `openpty' function. */
-/* #undef HAVE_OPENPTY */
-
-/* Define to 1 if you have the <panel.h> header file. */
-#define HAVE_PANEL_H 1
-
-/* Define to 1 if you have the `pathconf' function. */
-#define HAVE_PATHCONF 1
-
-/* Define to 1 if you have the `pause' function. */
-#define HAVE_PAUSE 1
-
-/* Define to 1 if you have the `pipe' function. */
-#define HAVE_PIPE 1
-
-/* Define to 1 if you have the `pipe2' function. */
-#define HAVE_PIPE2 1
-
-/* Define to 1 if you have the `plock' function. */
-/* #undef HAVE_PLOCK */
-
-/* Define to 1 if you have the `poll' function. */
-#define HAVE_POLL 1
-
-/* Define to 1 if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define to 1 if you have the `posix_fadvise' function. */
-#define HAVE_POSIX_FADVISE 1
-
-/* Define to 1 if you have the `posix_fallocate' function. */
-#define HAVE_POSIX_FALLOCATE 1
-
-/* Define to 1 if you have the `posix_spawn' function. */
-#define HAVE_POSIX_SPAWN 1
-
-/* Define to 1 if you have the `posix_spawnp' function. */
-#define HAVE_POSIX_SPAWNP 1
-
-/* Define to 1 if you have the `pread' function. */
-#define HAVE_PREAD 1
-
-/* Define to 1 if you have the `preadv' function. */
-#define HAVE_PREADV 1
-
-/* Define to 1 if you have the `preadv2' function. */
-/* #undef HAVE_PREADV2 */
-
-/* Define if you have the 'prlimit' function. */
-#define HAVE_PRLIMIT 1
-
-/* Define to 1 if you have the <process.h> header file. */
-/* #undef HAVE_PROCESS_H */
-
-/* Define if your compiler supports function prototype */
-#define HAVE_PROTOTYPES 1
-
-/* Define to 1 if you have the `pthread_condattr_setclock' function. */
-#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
-
-/* Defined for Solaris 2.6 bug in pthread header. */
-/* #undef HAVE_PTHREAD_DESTRUCTOR */
-
-/* Define to 1 if you have the `pthread_getcpuclockid' function. */
-#define HAVE_PTHREAD_GETCPUCLOCKID 1
-
-/* Define to 1 if you have the <pthread.h> header file. */
-#define HAVE_PTHREAD_H 1
-
-/* Define to 1 if you have the `pthread_init' function. */
-/* #undef HAVE_PTHREAD_INIT */
-
-/* Define to 1 if you have the `pthread_kill' function. */
-#define HAVE_PTHREAD_KILL 1
-
-/* Define to 1 if you have the `pthread_sigmask' function. */
-#define HAVE_PTHREAD_SIGMASK 1
-
-/* Define if platform requires stubbed pthreads support */
-/* #undef HAVE_PTHREAD_STUBS */
-
-/* Define to 1 if you have the <pty.h> header file. */
-#define HAVE_PTY_H 1
-
-/* Define to 1 if you have the `pwrite' function. */
-#define HAVE_PWRITE 1
-
-/* Define to 1 if you have the `pwritev' function. */
-#define HAVE_PWRITEV 1
-
-/* Define to 1 if you have the `pwritev2' function. */
-/* #undef HAVE_PWRITEV2 */
-
-/* Define to 1 if you have the <readline/readline.h> header file. */
-/* #undef HAVE_READLINE_READLINE_H */
-
-/* Define to 1 if you have the `readlink' function. */
-#define HAVE_READLINK 1
-
-/* Define to 1 if you have the `readlinkat' function. */
-#define HAVE_READLINKAT 1
-
-/* Define to 1 if you have the `readv' function. */
-#define HAVE_READV 1
-
-/* Define to 1 if you have the `realpath' function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the 'recvfrom' function. */
-#define HAVE_RECVFROM 1
-
-/* Define to 1 if you have the `renameat' function. */
-#define HAVE_RENAMEAT 1
-
-/* Define if readline supports append_history */
-/* #undef HAVE_RL_APPEND_HISTORY */
-
-/* Define if you can turn off readline's signal handling. */
-/* #undef HAVE_RL_CATCH_SIGNAL */
-
-/* Define if readline supports rl_compdisp_func_t */
-/* #undef HAVE_RL_COMPDISP_FUNC_T */
-
-/* Define if you have readline 2.2 */
-/* #undef HAVE_RL_COMPLETION_APPEND_CHARACTER */
-
-/* Define if you have readline 4.0 */
-/* #undef HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK */
-
-/* Define if you have readline 4.2 */
-/* #undef HAVE_RL_COMPLETION_MATCHES */
-
-/* Define if you have rl_completion_suppress_append */
-/* #undef HAVE_RL_COMPLETION_SUPPRESS_APPEND */
-
-/* Define if you have readline 4.0 */
-/* #undef HAVE_RL_PRE_INPUT_HOOK */
-
-/* Define if you have readline 4.0 */
-/* #undef HAVE_RL_RESIZE_TERMINAL */
-
-/* Define to 1 if you have the <rpc/rpc.h> header file. */
-#define HAVE_RPC_RPC_H 1
-
-/* Define to 1 if you have the `rtpSpawn' function. */
-/* #undef HAVE_RTPSPAWN */
-
-/* Define to 1 if you have the `sched_get_priority_max' function. */
-#define HAVE_SCHED_GET_PRIORITY_MAX 1
-
-/* Define to 1 if you have the <sched.h> header file. */
-#define HAVE_SCHED_H 1
-
-/* Define to 1 if you have the `sched_rr_get_interval' function. */
-#define HAVE_SCHED_RR_GET_INTERVAL 1
-
-/* Define to 1 if you have the `sched_setaffinity' function. */
-#define HAVE_SCHED_SETAFFINITY 1
-
-/* Define to 1 if you have the `sched_setparam' function. */
-#define HAVE_SCHED_SETPARAM 1
-
-/* Define to 1 if you have the `sched_setscheduler' function. */
-#define HAVE_SCHED_SETSCHEDULER 1
-
-/* Define to 1 if you have the `sem_clockwait' function. */
-/* #undef HAVE_SEM_CLOCKWAIT */
-
-/* Define to 1 if you have the `sem_getvalue' function. */
-#define HAVE_SEM_GETVALUE 1
-
-/* Define to 1 if you have the `sem_open' function. */
-#define HAVE_SEM_OPEN 1
-
-/* Define to 1 if you have the `sem_timedwait' function. */
-#define HAVE_SEM_TIMEDWAIT 1
-
-/* Define to 1 if you have the `sem_unlink' function. */
-#define HAVE_SEM_UNLINK 1
-
-/* Define to 1 if you have the `sendfile' function. */
-#define HAVE_SENDFILE 1
-
-/* Define if you have the 'sendto' function. */
-#define HAVE_SENDTO 1
-
-/* Define to 1 if you have the `setegid' function. */
-#define HAVE_SETEGID 1
-
-/* Define to 1 if you have the `seteuid' function. */
-#define HAVE_SETEUID 1
-
-/* Define to 1 if you have the `setgid' function. */
-#define HAVE_SETGID 1
-
-/* Define if you have the 'setgroups' function. */
-#define HAVE_SETGROUPS 1
-
-/* Define to 1 if you have the `sethostname' function. */
-#define HAVE_SETHOSTNAME 1
-
-/* Define to 1 if you have the `setitimer' function. */
-#define HAVE_SETITIMER 1
-
-/* Define to 1 if you have the <setjmp.h> header file. */
-#define HAVE_SETJMP_H 1
-
-/* Define to 1 if you have the `setlocale' function. */
-#define HAVE_SETLOCALE 1
-
-/* Define to 1 if you have the `setns' function. */
-#define HAVE_SETNS 1
-
-/* Define to 1 if you have the `setpgid' function. */
-#define HAVE_SETPGID 1
-
-/* Define to 1 if you have the `setpgrp' function. */
-#define HAVE_SETPGRP 1
-
-/* Define to 1 if you have the `setpriority' function. */
-#define HAVE_SETPRIORITY 1
-
-/* Define to 1 if you have the `setregid' function. */
-#define HAVE_SETREGID 1
-
-/* Define to 1 if you have the `setresgid' function. */
-#define HAVE_SETRESGID 1
-
-/* Define to 1 if you have the `setresuid' function. */
-#define HAVE_SETRESUID 1
-
-/* Define to 1 if you have the `setreuid' function. */
-#define HAVE_SETREUID 1
-
-/* Define to 1 if you have the `setsid' function. */
-#define HAVE_SETSID 1
-
-/* Define if you have the 'setsockopt' function. */
-#define HAVE_SETSOCKOPT 1
-
-/* Define to 1 if you have the `setuid' function. */
-#define HAVE_SETUID 1
-
-/* Define to 1 if you have the `setvbuf' function. */
-#define HAVE_SETVBUF 1
-
-/* Define to 1 if you have the <shadow.h> header file. */
-#define HAVE_SHADOW_H 1
-
-/* Define to 1 if you have the `shm_open' function. */
-#define HAVE_SHM_OPEN 1
-
-/* Define to 1 if you have the `shm_unlink' function. */
-#define HAVE_SHM_UNLINK 1
-
-/* Define to 1 if you have the `shutdown' function. */
-#define HAVE_SHUTDOWN 1
-
-/* Define to 1 if you have the `sigaction' function. */
-#define HAVE_SIGACTION 1
-
-/* Define to 1 if you have the `sigaltstack' function. */
-#define HAVE_SIGALTSTACK 1
-
-/* Define to 1 if you have the `sigfillset' function. */
-#define HAVE_SIGFILLSET 1
-
-/* Define to 1 if `si_band' is a member of `siginfo_t'. */
-#define HAVE_SIGINFO_T_SI_BAND 1
-
-/* Define to 1 if you have the `siginterrupt' function. */
-#define HAVE_SIGINTERRUPT 1
-
-/* Define to 1 if you have the <signal.h> header file. */
-#define HAVE_SIGNAL_H 1
-
-/* Define to 1 if you have the `sigpending' function. */
-#define HAVE_SIGPENDING 1
-
-/* Define to 1 if you have the `sigrelse' function. */
-#define HAVE_SIGRELSE 1
-
-/* Define to 1 if you have the `sigtimedwait' function. */
-#define HAVE_SIGTIMEDWAIT 1
-
-/* Define to 1 if you have the `sigwait' function. */
-#define HAVE_SIGWAIT 1
-
-/* Define to 1 if you have the `sigwaitinfo' function. */
-#define HAVE_SIGWAITINFO 1
-
-/* Define to 1 if you have the `snprintf' function. */
-#define HAVE_SNPRINTF 1
-
-/* struct sockaddr_alg (linux/if_alg.h) */
-#define HAVE_SOCKADDR_ALG 1
-
-/* Define if sockaddr has sa_len member */
-/* #undef HAVE_SOCKADDR_SA_LEN */
-
-/* struct sockaddr_storage (sys/socket.h) */
-#define HAVE_SOCKADDR_STORAGE 1
-
-/* Define if you have the 'socket' function. */
-#define HAVE_SOCKET 1
-
-/* Define if you have the 'socketpair' function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define to 1 if you have the <spawn.h> header file. */
-#define HAVE_SPAWN_H 1
-
-/* Define to 1 if you have the `splice' function. */
-#define HAVE_SPLICE 1
-
-/* Define if your compiler provides ssize_t */
-#define HAVE_SSIZE_T 1
-
-/* Define to 1 if you have the `statvfs' function. */
-#define HAVE_STATVFS 1
-
-/* Define if you have struct stat.st_mtim.tv_nsec */
-#define HAVE_STAT_TV_NSEC 1
-
-/* Define if you have struct stat.st_mtimensec */
-/* #undef HAVE_STAT_TV_NSEC2 */
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdio.h> header file. */
-#define HAVE_STDIO_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Has stdatomic.h with atomic_int and atomic_uintptr_t */
-#define HAVE_STD_ATOMIC 1
-
-/* Define to 1 if you have the `strftime' function. */
-#define HAVE_STRFTIME 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the `strlcpy' function. */
-/* #undef HAVE_STRLCPY */
-
-/* Define to 1 if you have the <stropts.h> header file. */
-/* #undef HAVE_STROPTS_H */
-
-/* Define to 1 if you have the `strsignal' function. */
-#define HAVE_STRSIGNAL 1
-
-/* Define to 1 if `pw_gecos' is a member of `struct passwd'. */
-#define HAVE_STRUCT_PASSWD_PW_GECOS 1
-
-/* Define to 1 if `pw_passwd' is a member of `struct passwd'. */
-#define HAVE_STRUCT_PASSWD_PW_PASSWD 1
-
-/* Define to 1 if `st_birthtime' is a member of `struct stat'. */
-/* #undef HAVE_STRUCT_STAT_ST_BIRTHTIME */
-
-/* Define to 1 if `st_blksize' is a member of `struct stat'. */
-#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
-
-/* Define to 1 if `st_blocks' is a member of `struct stat'. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define to 1 if `st_flags' is a member of `struct stat'. */
-/* #undef HAVE_STRUCT_STAT_ST_FLAGS */
-
-/* Define to 1 if `st_gen' is a member of `struct stat'. */
-/* #undef HAVE_STRUCT_STAT_ST_GEN */
-
-/* Define to 1 if `st_rdev' is a member of `struct stat'. */
-#define HAVE_STRUCT_STAT_ST_RDEV 1
-
-/* Define to 1 if `tm_zone' is a member of `struct tm'. */
-#define HAVE_STRUCT_TM_TM_ZONE 1
-
-/* Define if you have the 'symlink' function. */
-#define HAVE_SYMLINK 1
-
-/* Define to 1 if you have the `symlinkat' function. */
-#define HAVE_SYMLINKAT 1
-
-/* Define to 1 if you have the `sync' function. */
-#define HAVE_SYNC 1
-
-/* Define to 1 if you have the `sysconf' function. */
-#define HAVE_SYSCONF 1
-
-/* Define to 1 if you have the <sysexits.h> header file. */
-#define HAVE_SYSEXITS_H 1
-
-/* Define to 1 if you have the <syslog.h> header file. */
-#define HAVE_SYSLOG_H 1
-
-/* Define to 1 if you have the `system' function. */
-#define HAVE_SYSTEM 1
-
-/* Define to 1 if you have the <sys/audioio.h> header file. */
-/* #undef HAVE_SYS_AUDIOIO_H */
-
-/* Define to 1 if you have the <sys/auxv.h> header file. */
-#define HAVE_SYS_AUXV_H 1
-
-/* Define to 1 if you have the <sys/bsdtty.h> header file. */
-/* #undef HAVE_SYS_BSDTTY_H */
-
-/* Define to 1 if you have the <sys/devpoll.h> header file. */
-/* #undef HAVE_SYS_DEVPOLL_H */
-
-/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
- */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define to 1 if you have the <sys/endian.h> header file. */
-/* #undef HAVE_SYS_ENDIAN_H */
-
-/* Define to 1 if you have the <sys/epoll.h> header file. */
-#define HAVE_SYS_EPOLL_H 1
-
-/* Define to 1 if you have the <sys/eventfd.h> header file. */
-#define HAVE_SYS_EVENTFD_H 1
-
-/* Define to 1 if you have the <sys/event.h> header file. */
-/* #undef HAVE_SYS_EVENT_H */
-
-/* Define to 1 if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define to 1 if you have the <sys/kern_control.h> header file. */
-/* #undef HAVE_SYS_KERN_CONTROL_H */
-
-/* Define to 1 if you have the <sys/loadavg.h> header file. */
-/* #undef HAVE_SYS_LOADAVG_H */
-
-/* Define to 1 if you have the <sys/lock.h> header file. */
-/* #undef HAVE_SYS_LOCK_H */
-
-/* Define to 1 if you have the <sys/memfd.h> header file. */
-/* #undef HAVE_SYS_MEMFD_H */
-
-/* Define to 1 if you have the <sys/mkdev.h> header file. */
-/* #undef HAVE_SYS_MKDEV_H */
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#define HAVE_SYS_MMAN_H 1
-
-/* Define to 1 if you have the <sys/modem.h> header file. */
-/* #undef HAVE_SYS_MODEM_H */
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
- */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define to 1 if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define to 1 if you have the <sys/random.h> header file. */
-#define HAVE_SYS_RANDOM_H 1
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#define HAVE_SYS_RESOURCE_H 1
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define to 1 if you have the <sys/sendfile.h> header file. */
-#define HAVE_SYS_SENDFILE_H 1
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#define HAVE_SYS_SOCKET_H 1
-
-/* Define to 1 if you have the <sys/soundcard.h> header file. */
-#define HAVE_SYS_SOUNDCARD_H 1
-
-/* Define to 1 if you have the <sys/statvfs.h> header file. */
-#define HAVE_SYS_STATVFS_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define to 1 if you have the <sys/sysmacros.h> header file. */
-#define HAVE_SYS_SYSMACROS_H 1
-
-/* Define to 1 if you have the <sys/sys_domain.h> header file. */
-/* #undef HAVE_SYS_SYS_DOMAIN_H */
-
-/* Define to 1 if you have the <sys/termio.h> header file. */
-/* #undef HAVE_SYS_TERMIO_H */
-
-/* Define to 1 if you have the <sys/times.h> header file. */
-#define HAVE_SYS_TIMES_H 1
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <sys/uio.h> header file. */
-#define HAVE_SYS_UIO_H 1
-
-/* Define to 1 if you have the <sys/un.h> header file. */
-#define HAVE_SYS_UN_H 1
-
-/* Define to 1 if you have the <sys/utsname.h> header file. */
-#define HAVE_SYS_UTSNAME_H 1
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define to 1 if you have the <sys/xattr.h> header file. */
-#define HAVE_SYS_XATTR_H 1
-
-/* Define to 1 if you have the `tcgetpgrp' function. */
-#define HAVE_TCGETPGRP 1
-
-/* Define to 1 if you have the `tcsetpgrp' function. */
-#define HAVE_TCSETPGRP 1
-
-/* Define to 1 if you have the `tempnam' function. */
-#define HAVE_TEMPNAM 1
-
-/* Define to 1 if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define to 1 if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define to 1 if you have the `timegm' function. */
-#define HAVE_TIMEGM 1
-
-/* Define to 1 if you have the `times' function. */
-#define HAVE_TIMES 1
-
-/* Define to 1 if you have the `tmpfile' function. */
-#define HAVE_TMPFILE 1
-
-/* Define to 1 if you have the `tmpnam' function. */
-#define HAVE_TMPNAM 1
-
-/* Define to 1 if you have the `tmpnam_r' function. */
-#define HAVE_TMPNAM_R 1
-
-/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
- `HAVE_STRUCT_TM_TM_ZONE' instead. */
-#define HAVE_TM_ZONE 1
-
-/* Define to 1 if you have the `truncate' function. */
-#define HAVE_TRUNCATE 1
-
-/* Define to 1 if you have the `ttyname' function. */
-#define HAVE_TTYNAME 1
-
-/* Define to 1 if you don't have `tm_zone' but do have the external array
- `tzname'. */
-/* #undef HAVE_TZNAME */
-
-/* Define to 1 if you have the `umask' function. */
-#define HAVE_UMASK 1
-
-/* Define to 1 if you have the `uname' function. */
-#define HAVE_UNAME 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to 1 if you have the `unlinkat' function. */
-#define HAVE_UNLINKAT 1
-
-/* Define to 1 if you have the `unshare' function. */
-#define HAVE_UNSHARE 1
-
-/* Define if you have a useable wchar_t type defined in wchar.h; useable means
- wchar_t must be an unsigned type with at least 16 bits. (see
- Include/unicodeobject.h). */
-/* #undef HAVE_USABLE_WCHAR_T */
-
-/* Define to 1 if you have the <util.h> header file. */
-/* #undef HAVE_UTIL_H */
-
-/* Define to 1 if you have the `utimensat' function. */
-#define HAVE_UTIMENSAT 1
-
-/* Define to 1 if you have the `utimes' function. */
-#define HAVE_UTIMES 1
-
-/* Define to 1 if you have the <utime.h> header file. */
-#define HAVE_UTIME_H 1
-
-/* Define to 1 if you have the <utmp.h> header file. */
-#define HAVE_UTMP_H 1
-
-/* Define to 1 if you have the `uuid_create' function. */
-/* #undef HAVE_UUID_CREATE */
-
-/* Define to 1 if you have the `uuid_enc_be' function. */
-/* #undef HAVE_UUID_ENC_BE */
-
-/* Define if uuid_generate_time_safe() exists. */
-#define HAVE_UUID_GENERATE_TIME_SAFE 1
-
-/* Define to 1 if you have the <uuid.h> header file. */
-#define HAVE_UUID_H 1
-
-/* Define to 1 if you have the <uuid/uuid.h> header file. */
-/* #undef HAVE_UUID_UUID_H */
-
-/* Define to 1 if you have the `vfork' function. */
-#define HAVE_VFORK 1
-
-/* Define to 1 if you have the `wait' function. */
-#define HAVE_WAIT 1
-
-/* Define to 1 if you have the `wait3' function. */
-#define HAVE_WAIT3 1
-
-/* Define to 1 if you have the `wait4' function. */
-#define HAVE_WAIT4 1
-
-/* Define to 1 if you have the `waitid' function. */
-#define HAVE_WAITID 1
-
-/* Define to 1 if you have the `waitpid' function. */
-#define HAVE_WAITPID 1
-
-/* Define if the compiler provides a wchar.h header file. */
-#define HAVE_WCHAR_H 1
-
-/* Define to 1 if you have the `wcscoll' function. */
-#define HAVE_WCSCOLL 1
-
-/* Define to 1 if you have the `wcsftime' function. */
-#define HAVE_WCSFTIME 1
-
-/* Define to 1 if you have the `wcsxfrm' function. */
-#define HAVE_WCSXFRM 1
-
-/* Define to 1 if you have the `wmemcmp' function. */
-#define HAVE_WMEMCMP 1
-
-/* Define if tzset() actually switches the local timezone in a meaningful way.
- */
-#define HAVE_WORKING_TZSET 1
-
-/* Define to 1 if you have the `writev' function. */
-#define HAVE_WRITEV 1
-
-/* Define if the zlib library has inflateCopy */
-#define HAVE_ZLIB_COPY 1
-
-/* Define to 1 if you have the <zlib.h> header file. */
-/* #undef HAVE_ZLIB_H */
-
-/* Define to 1 if you have the `_getpty' function. */
-/* #undef HAVE__GETPTY */
-
-/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
- */
-/* #undef MAJOR_IN_MKDEV */
-
-/* Define to 1 if `major', `minor', and `makedev' are declared in
- <sysmacros.h>. */
-#define MAJOR_IN_SYSMACROS 1
-
-/* Define if mvwdelch in curses.h is an expression. */
-#define MVWDELCH_IS_EXPRESSION 1
-
-/* Define to the address where bug reports for this package should be sent. */
-/* #undef PACKAGE_BUGREPORT */
-
-/* Define to the full name of this package. */
-/* #undef PACKAGE_NAME */
-
-/* Define to the full name and version of this package. */
-/* #undef PACKAGE_STRING */
-
-/* Define to the one symbol short name of this package. */
-/* #undef PACKAGE_TARNAME */
-
-/* Define to the home page for this package. */
-/* #undef PACKAGE_URL */
-
-/* Define to the version of this package. */
-/* #undef PACKAGE_VERSION */
-
-/* Define if POSIX semaphores aren't enabled on your system */
-/* #undef POSIX_SEMAPHORES_NOT_ENABLED */
-
-/* Define if pthread_key_t is compatible with int. */
-#define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1
-
-/* Defined if PTHREAD_SCOPE_SYSTEM supported. */
-#define PTHREAD_SYSTEM_SCHED_SUPPORTED 1
-
-/* Define as the preferred size in bits of long digits */
-/* #undef PYLONG_BITS_IN_DIGIT */
-
-/* enabled builtin hash modules */
-#define PY_BUILTIN_HASHLIB_HASHES "md5,sha1,sha2,sha3,blake2"
-
-/* Define if you want to coerce the C locale to a UTF-8 based locale */
-#define PY_COERCE_C_LOCALE 1
-
-/* Define to 1 if you have the perf trampoline. */
-/* #undef PY_HAVE_PERF_TRAMPOLINE */
-
-/* Define to 1 to build the sqlite module with loadable extensions support. */
-#define PY_SQLITE_ENABLE_LOAD_EXTENSION 1
-
-/* Define if SQLite was compiled with the serialize API */
-/* #undef PY_SQLITE_HAVE_SERIALIZE */
-
-/* Default cipher suites list for ssl module. 1: Python's preferred selection,
- 2: leave OpenSSL defaults untouched, 0: custom string */
-#define PY_SSL_DEFAULT_CIPHERS 1
-
-/* Cipher suite string for PY_SSL_DEFAULT_CIPHERS=0 */
-/* #undef PY_SSL_DEFAULT_CIPHER_STRING */
-
-/* PEP 11 Support tier (1, 2, 3 or 0 for unsupported) */
-#define PY_SUPPORT_TIER 1
-
-/* Define if you want to build an interpreter with many run-time checks. */
-/* #undef Py_DEBUG */
-
-/* Defined if Python is built as a shared library. */
-/* #undef Py_ENABLE_SHARED */
-
-/* Define hash algorithm for str, bytes and memoryview. SipHash24: 1, FNV: 2,
- SipHash13: 3, externally defined: 0 */
-/* #undef Py_HASH_ALGORITHM */
-
-/* Define if you want to enable internal statistics gathering. */
-/* #undef Py_STATS */
-
-/* The version of SunOS/Solaris as reported by `uname -r' without the dot. */
-/* #undef Py_SUNOS_VERSION */
-
-/* Define if you want to enable tracing references for debugging purpose */
-/* #undef Py_TRACE_REFS */
-
-/* assume C89 semantics that RETSIGTYPE is always void */
-#define RETSIGTYPE void
-
-/* Define if setpgrp() must be called as setpgrp(0, 0). */
-/* #undef SETPGRP_HAVE_ARG */
-
-/* Define if i>>j for signed int i does not extend the sign bit when i < 0 */
-/* #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS */
-
-/* The size of `double', as computed by sizeof. */
-#define SIZEOF_DOUBLE 8
-
-/* The size of `float', as computed by sizeof. */
-#define SIZEOF_FLOAT 4
-
-/* The size of `fpos_t', as computed by sizeof. */
-#define SIZEOF_FPOS_T 16
-
-/* The size of `int', as computed by sizeof. */
-#define SIZEOF_INT 4
-
-/* The size of `long', as computed by sizeof. */
-#define SIZEOF_LONG 8
-
-/* The size of `long double', as computed by sizeof. */
-#define SIZEOF_LONG_DOUBLE 16
-
-/* The size of `long long', as computed by sizeof. */
-#define SIZEOF_LONG_LONG 8
-
-/* The size of `off_t', as computed by sizeof. */
-#define SIZEOF_OFF_T 8
-
-/* The size of `pid_t', as computed by sizeof. */
-#define SIZEOF_PID_T 4
-
-/* The size of `pthread_key_t', as computed by sizeof. */
-#define SIZEOF_PTHREAD_KEY_T 4
-
-/* The size of `pthread_t', as computed by sizeof. */
-#define SIZEOF_PTHREAD_T 8
-
-/* The size of `short', as computed by sizeof. */
-#define SIZEOF_SHORT 2
-
-/* The size of `size_t', as computed by sizeof. */
-#if !defined(SIZEOF_SIZE_T)
-#define SIZEOF_SIZE_T 8
-#endif
-
-/* The size of `time_t', as computed by sizeof. */
-#define SIZEOF_TIME_T 8
-
-/* The size of `uintptr_t', as computed by sizeof. */
-#define SIZEOF_UINTPTR_T 8
-
-/* The size of `void *', as computed by sizeof. */
-#define SIZEOF_VOID_P 8
-
-/* The size of `wchar_t', as computed by sizeof. */
-#define SIZEOF_WCHAR_T 4
-
-/* The size of `_Bool', as computed by sizeof. */
-#define SIZEOF__BOOL 1
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define if you can safely include both <sys/select.h> and <sys/time.h>
- (which you can't on SCO ODT 3.0). */
-#define SYS_SELECT_WITH_SYS_TIME 1
-
-/* Custom thread stack size depending on chosen sanitizer runtimes. */
-/* #undef THREAD_STACK_SIZE */
-
-/* Library needed by timemodule.c: librt may be needed for clock_gettime() */
-/* #undef TIMEMODULE_LIB */
-
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-/* #undef TM_IN_SYS_TIME */
-
-/* Define if you want to use computed gotos in ceval.c. */
-/* #undef USE_COMPUTED_GOTOS */
-
-/* Enable extensions on AIX 3, Interix. */
-#ifndef _ALL_SOURCE
-# define _ALL_SOURCE 1
-#endif
-/* Enable general extensions on macOS. */
-#ifndef _DARWIN_C_SOURCE
-# define _DARWIN_C_SOURCE 1
-#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# define __EXTENSIONS__ 1
-#endif
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-/* Enable X/Open compliant socket functions that do not require linking
- with -lxnet on HP-UX 11.11. */
-#ifndef _HPUX_ALT_XOPEN_SOCKET_API
-# define _HPUX_ALT_XOPEN_SOCKET_API 1
-#endif
-/* Identify the host operating system as Minix.
- This macro does not affect the system headers' behavior.
- A future release of Autoconf may stop defining this macro. */
-#ifndef _MINIX
-/* # undef _MINIX */
-#endif
-/* Enable general extensions on NetBSD.
- Enable NetBSD compatibility extensions on Minix. */
-#ifndef _NETBSD_SOURCE
-# define _NETBSD_SOURCE 1
-#endif
-/* Enable OpenBSD compatibility extensions on NetBSD.
- Oddly enough, this does nothing on OpenBSD. */
-#ifndef _OPENBSD_SOURCE
-# define _OPENBSD_SOURCE 1
-#endif
-/* Define to 1 if needed for POSIX-compatible behavior. */
-#ifndef _POSIX_SOURCE
-/* # undef _POSIX_SOURCE */
-#endif
-/* Define to 2 if needed for POSIX-compatible behavior. */
-#ifndef _POSIX_1_SOURCE
-/* # undef _POSIX_1_SOURCE */
-#endif
-/* Enable POSIX-compatible threading on Solaris. */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# define _POSIX_PTHREAD_SEMANTICS 1
-#endif
-/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
-#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
-# define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
-#endif
-/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
-#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
-# define __STDC_WANT_IEC_60559_BFP_EXT__ 1
-#endif
-/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
-#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
-# define __STDC_WANT_IEC_60559_DFP_EXT__ 1
-#endif
-/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
-#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
-# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
-#endif
-/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */
-#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
-# define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
-#endif
-/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
-#ifndef __STDC_WANT_LIB_EXT2__
-# define __STDC_WANT_LIB_EXT2__ 1
-#endif
-/* Enable extensions specified by ISO/IEC 24747:2009. */
-#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
-# define __STDC_WANT_MATH_SPEC_FUNCS__ 1
-#endif
-/* Enable extensions on HP NonStop. */
-#ifndef _TANDEM_SOURCE
-# define _TANDEM_SOURCE 1
-#endif
-/* Enable X/Open extensions. Define to 500 only if necessary
- to make mbstate_t available. */
-#ifndef _XOPEN_SOURCE
-# define _XOPEN_SOURCE 700
-#endif
-
-
-/* Define if WINDOW in curses.h offers a field _flags. */
-#define WINDOW_HAS_FLAGS 1
-
-/* Define if you want build the _decimal module using a coroutine-local rather
- than a thread-local context */
-#define WITH_DECIMAL_CONTEXTVAR 1
-
-/* Define if you want documentation strings in extension modules */
-#define WITH_DOC_STRINGS 1
-
-/* Define if you want to compile in DTrace support */
-/* #undef WITH_DTRACE */
-
-/* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic
- linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).
- Dyld is necessary to support frameworks. */
-/* #undef WITH_DYLD */
-
-/* Define to build the readline module against libedit. */
-/* #undef WITH_EDITLINE */
-
-/* Define if you want to compile in object freelists optimization */
-#define WITH_FREELISTS 1
-
-/* Define to 1 if libintl is needed for locale functions. */
-/* #undef WITH_LIBINTL */
-
-/* Define if you want to produce an OpenStep/Rhapsody framework (shared
- library plus accessory files). */
-/* #undef WITH_NEXT_FRAMEWORK */
-
-/* Define if you want to compile in Python-specific mallocs */
-#ifndef address_sanitizer_enabled
-#define WITH_PYMALLOC 1
-#endif
-
-/* Define if you want pymalloc to be disabled when running under valgrind */
-/* #undef WITH_VALGRIND */
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
- significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-# define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-/* # undef WORDS_BIGENDIAN */
-# endif
-#endif
-
-/* Define if arithmetic is subject to x87-style double rounding issue */
-/* #undef X87_DOUBLE_ROUNDING */
-
-/* Define on OpenBSD to activate all library features */
-/* #undef _BSD_SOURCE */
-
-/* Define on Darwin to activate all library features */
-#define _DARWIN_C_SOURCE 1
-
-/* This must be set to 64 on some systems to enable large file support. */
-#define _FILE_OFFSET_BITS 64
-
-/* Define to include mbstate_t for mbrtowc */
-/* #undef _INCLUDE__STDC_A1_SOURCE */
-
-/* This must be defined on some systems to enable large file support. */
-#define _LARGEFILE_SOURCE 1
-
-/* This must be defined on AIX systems to enable large file support. */
-/* #undef _LARGE_FILES */
-
-/* Define on NetBSD to activate all library features */
-#define _NETBSD_SOURCE 1
-
-/* Define to activate features from IEEE Stds 1003.1-2008 */
-#define _POSIX_C_SOURCE 200809L
-
-/* Define if you have POSIX threads, and your system does not define that. */
-/* #undef _POSIX_THREADS */
-
-/* framework name */
-#define _PYTHONFRAMEWORK ""
-
-/* Define to force use of thread-safe errno, h_errno, and other functions */
-/* #undef _REENTRANT */
-
-/* Define to 1 if you want to emulate getpid() on WASI */
-/* #undef _WASI_EMULATED_GETPID */
-
-/* Define to 1 if you want to emulate process clocks on WASI */
-/* #undef _WASI_EMULATED_PROCESS_CLOCKS */
-
-/* Define to 1 if you want to emulate signals on WASI */
-/* #undef _WASI_EMULATED_SIGNAL */
-
-/* Define to the level of X/Open that your system supports */
-#define _XOPEN_SOURCE 700
-
-/* Define to activate Unix95-and-earlier features */
-#define _XOPEN_SOURCE_EXTENDED 1
-
-/* Define on FreeBSD to activate all library features */
-#define __BSD_VISIBLE 1
-
-/* Define to 'long' if <time.h> doesn't define. */
-/* #undef clock_t */
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef gid_t */
-
-/* Define to `int' if <sys/types.h> does not define. */
-/* #undef mode_t */
-
-/* Define to `long int' if <sys/types.h> does not define. */
-/* #undef off_t */
-
-/* Define as a signed integer type capable of holding a process identifier. */
-/* #undef pid_t */
-
-/* Define to empty if the keyword does not work. */
-/* #undef signed */
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-/* #undef size_t */
-
-/* Define to `int' if <sys/socket.h> does not define. */
-/* #undef socklen_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef uid_t */
-
-
-/* Define the macros needed if on a UnixWare 7.x system. */
-#if defined(__USLC__) && defined(__SCO_VERSION__)
-#define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
-#endif
-
-#endif /*Py_PYCONFIG_H*/
-
diff --git a/contrib/tools/python3/src/Lib/threading.py b/contrib/tools/python3/src/Lib/threading.py
deleted file mode 100644
index 3936074d725..00000000000
--- a/contrib/tools/python3/src/Lib/threading.py
+++ /dev/null
@@ -1,1711 +0,0 @@
-"""Thread module emulating a subset of Java's threading model."""
-
-import os as _os
-import sys as _sys
-import _thread
-import functools
-
-from time import monotonic as _time
-from _weakrefset import WeakSet
-from itertools import count as _count
-try:
- from _collections import deque as _deque
-except ImportError:
- from collections import deque as _deque
-
-# Note regarding PEP 8 compliant names
-# This threading model was originally inspired by Java, and inherited
-# the convention of camelCase function and method names from that
-# language. Those original names are not in any imminent danger of
-# being deprecated (even for Py3k),so this module provides them as an
-# alias for the PEP 8 compliant names
-# Note that using the new PEP 8 compliant names facilitates substitution
-# with the multiprocessing module, which doesn't provide the old
-# Java inspired names.
-
-__all__ = ['get_ident', 'active_count', 'Condition', 'current_thread',
- 'enumerate', 'main_thread', 'TIMEOUT_MAX',
- 'Event', 'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Thread',
- 'Barrier', 'BrokenBarrierError', 'Timer', 'ThreadError',
- 'setprofile', 'settrace', 'local', 'stack_size',
- 'excepthook', 'ExceptHookArgs', 'gettrace', 'getprofile',
- 'setprofile_all_threads','settrace_all_threads']
-
-# Rename some stuff so "from threading import *" is safe
-_start_new_thread = _thread.start_new_thread
-_daemon_threads_allowed = _thread.daemon_threads_allowed
-_allocate_lock = _thread.allocate_lock
-_set_sentinel = _thread._set_sentinel
-get_ident = _thread.get_ident
-try:
- _is_main_interpreter = _thread._is_main_interpreter
-except AttributeError:
- # See https://github.com/python/cpython/issues/112826.
- # We can pretend a subinterpreter is the main interpreter for the
- # sake of _shutdown(), since that only means we do not wait for the
- # subinterpreter's threads to finish. Instead, they will be stopped
- # later by the mechanism we use for daemon threads. The likelihood
- # of this case is small because rarely will the _thread module be
- # replaced by a module without _is_main_interpreter().
- # Furthermore, this is all irrelevant in applications
- # that do not use subinterpreters.
- def _is_main_interpreter():
- return True
-try:
- get_native_id = _thread.get_native_id
- _HAVE_THREAD_NATIVE_ID = True
- __all__.append('get_native_id')
-except AttributeError:
- _HAVE_THREAD_NATIVE_ID = False
-ThreadError = _thread.error
-try:
- _CRLock = _thread.RLock
-except AttributeError:
- _CRLock = None
-TIMEOUT_MAX = _thread.TIMEOUT_MAX
-del _thread
-
-
-# Support for profile and trace hooks
-
-_profile_hook = None
-_trace_hook = None
-
-def setprofile(func):
- """Set a profile function for all threads started from the threading module.
-
- The func will be passed to sys.setprofile() for each thread, before its
- run() method is called.
- """
- global _profile_hook
- _profile_hook = func
-
-def setprofile_all_threads(func):
- """Set a profile function for all threads started from the threading module
- and all Python threads that are currently executing.
-
- The func will be passed to sys.setprofile() for each thread, before its
- run() method is called.
- """
- setprofile(func)
- _sys._setprofileallthreads(func)
-
-def getprofile():
- """Get the profiler function as set by threading.setprofile()."""
- return _profile_hook
-
-def settrace(func):
- """Set a trace function for all threads started from the threading module.
-
- The func will be passed to sys.settrace() for each thread, before its run()
- method is called.
- """
- global _trace_hook
- _trace_hook = func
-
-def settrace_all_threads(func):
- """Set a trace function for all threads started from the threading module
- and all Python threads that are currently executing.
-
- The func will be passed to sys.settrace() for each thread, before its run()
- method is called.
- """
- settrace(func)
- _sys._settraceallthreads(func)
-
-def gettrace():
- """Get the trace function as set by threading.settrace()."""
- return _trace_hook
-
-# Synchronization classes
-
-Lock = _allocate_lock
-
-def RLock(*args, **kwargs):
- """Factory function that returns a new reentrant lock.
-
- A reentrant lock must be released by the thread that acquired it. Once a
- thread has acquired a reentrant lock, the same thread may acquire it again
- without blocking; the thread must release it once for each time it has
- acquired it.
-
- """
- if _CRLock is None:
- return _PyRLock(*args, **kwargs)
- return _CRLock(*args, **kwargs)
-
-class _RLock:
- """This class implements reentrant lock objects.
-
- A reentrant lock must be released by the thread that acquired it. Once a
- thread has acquired a reentrant lock, the same thread may acquire it
- again without blocking; the thread must release it once for each time it
- has acquired it.
-
- """
-
- def __init__(self):
- self._block = _allocate_lock()
- self._owner = None
- self._count = 0
-
- def __repr__(self):
- owner = self._owner
- try:
- owner = _active[owner].name
- except KeyError:
- pass
- return "<%s %s.%s object owner=%r count=%d at %s>" % (
- "locked" if self._block.locked() else "unlocked",
- self.__class__.__module__,
- self.__class__.__qualname__,
- owner,
- self._count,
- hex(id(self))
- )
-
- def _at_fork_reinit(self):
- self._block._at_fork_reinit()
- self._owner = None
- self._count = 0
-
- def acquire(self, blocking=True, timeout=-1):
- """Acquire a lock, blocking or non-blocking.
-
- When invoked without arguments: if this thread already owns the lock,
- increment the recursion level by one, and return immediately. Otherwise,
- if another thread owns the lock, block until the lock is unlocked. Once
- the lock is unlocked (not owned by any thread), then grab ownership, set
- the recursion level to one, and return. If more than one thread is
- blocked waiting until the lock is unlocked, only one at a time will be
- able to grab ownership of the lock. There is no return value in this
- case.
-
- When invoked with the blocking argument set to true, do the same thing
- as when called without arguments, and return true.
-
- When invoked with the blocking argument set to false, do not block. If a
- call without an argument would block, return false immediately;
- otherwise, do the same thing as when called without arguments, and
- return true.
-
- When invoked with the floating-point timeout argument set to a positive
- value, block for at most the number of seconds specified by timeout
- and as long as the lock cannot be acquired. Return true if the lock has
- been acquired, false if the timeout has elapsed.
-
- """
- me = get_ident()
- if self._owner == me:
- self._count += 1
- return 1
- rc = self._block.acquire(blocking, timeout)
- if rc:
- self._owner = me
- self._count = 1
- return rc
-
- __enter__ = acquire
-
- def release(self):
- """Release a lock, decrementing the recursion level.
-
- If after the decrement it is zero, reset the lock to unlocked (not owned
- by any thread), and if any other threads are blocked waiting for the
- lock to become unlocked, allow exactly one of them to proceed. If after
- the decrement the recursion level is still nonzero, the lock remains
- locked and owned by the calling thread.
-
- Only call this method when the calling thread owns the lock. A
- RuntimeError is raised if this method is called when the lock is
- unlocked.
-
- There is no return value.
-
- """
- if self._owner != get_ident():
- raise RuntimeError("cannot release un-acquired lock")
- self._count = count = self._count - 1
- if not count:
- self._owner = None
- self._block.release()
-
- def __exit__(self, t, v, tb):
- self.release()
-
- # Internal methods used by condition variables
-
- def _acquire_restore(self, state):
- self._block.acquire()
- self._count, self._owner = state
-
- def _release_save(self):
- if self._count == 0:
- raise RuntimeError("cannot release un-acquired lock")
- count = self._count
- self._count = 0
- owner = self._owner
- self._owner = None
- self._block.release()
- return (count, owner)
-
- def _is_owned(self):
- return self._owner == get_ident()
-
- # Internal method used for reentrancy checks
-
- def _recursion_count(self):
- if self._owner != get_ident():
- return 0
- return self._count
-
-_PyRLock = _RLock
-
-
-class Condition:
- """Class that implements a condition variable.
-
- A condition variable allows one or more threads to wait until they are
- notified by another thread.
-
- If the lock argument is given and not None, it must be a Lock or RLock
- object, and it is used as the underlying lock. Otherwise, a new RLock object
- is created and used as the underlying lock.
-
- """
-
- def __init__(self, lock=None):
- if lock is None:
- lock = RLock()
- self._lock = lock
- # Export the lock's acquire() and release() methods
- self.acquire = lock.acquire
- self.release = lock.release
- # If the lock defines _release_save() and/or _acquire_restore(),
- # these override the default implementations (which just call
- # release() and acquire() on the lock). Ditto for _is_owned().
- if hasattr(lock, '_release_save'):
- self._release_save = lock._release_save
- if hasattr(lock, '_acquire_restore'):
- self._acquire_restore = lock._acquire_restore
- if hasattr(lock, '_is_owned'):
- self._is_owned = lock._is_owned
- self._waiters = _deque()
-
- def _at_fork_reinit(self):
- self._lock._at_fork_reinit()
- self._waiters.clear()
-
- def __enter__(self):
- return self._lock.__enter__()
-
- def __exit__(self, *args):
- return self._lock.__exit__(*args)
-
- def __repr__(self):
- return "<Condition(%s, %d)>" % (self._lock, len(self._waiters))
-
- def _release_save(self):
- self._lock.release() # No state to save
-
- def _acquire_restore(self, x):
- self._lock.acquire() # Ignore saved state
-
- def _is_owned(self):
- # Return True if lock is owned by current_thread.
- # This method is called only if _lock doesn't have _is_owned().
- if self._lock.acquire(False):
- self._lock.release()
- return False
- else:
- return True
-
- def wait(self, timeout=None):
- """Wait until notified or until a timeout occurs.
-
- If the calling thread has not acquired the lock when this method is
- called, a RuntimeError is raised.
-
- This method releases the underlying lock, and then blocks until it is
- awakened by a notify() or notify_all() call for the same condition
- variable in another thread, or until the optional timeout occurs. Once
- awakened or timed out, it re-acquires the lock and returns.
-
- When the timeout argument is present and not None, it should be a
- floating point number specifying a timeout for the operation in seconds
- (or fractions thereof).
-
- When the underlying lock is an RLock, it is not released using its
- release() method, since this may not actually unlock the lock when it
- was acquired multiple times recursively. Instead, an internal interface
- of the RLock class is used, which really unlocks it even when it has
- been recursively acquired several times. Another internal interface is
- then used to restore the recursion level when the lock is reacquired.
-
- """
- if not self._is_owned():
- raise RuntimeError("cannot wait on un-acquired lock")
- waiter = _allocate_lock()
- waiter.acquire()
- self._waiters.append(waiter)
- saved_state = self._release_save()
- gotit = False
- try: # restore state no matter what (e.g., KeyboardInterrupt)
- if timeout is None:
- waiter.acquire()
- gotit = True
- else:
- if timeout > 0:
- gotit = waiter.acquire(True, timeout)
- else:
- gotit = waiter.acquire(False)
- return gotit
- finally:
- self._acquire_restore(saved_state)
- if not gotit:
- try:
- self._waiters.remove(waiter)
- except ValueError:
- pass
-
- def wait_for(self, predicate, timeout=None):
- """Wait until a condition evaluates to True.
-
- predicate should be a callable which result will be interpreted as a
- boolean value. A timeout may be provided giving the maximum time to
- wait.
-
- """
- endtime = None
- waittime = timeout
- result = predicate()
- while not result:
- if waittime is not None:
- if endtime is None:
- endtime = _time() + waittime
- else:
- waittime = endtime - _time()
- if waittime <= 0:
- break
- self.wait(waittime)
- result = predicate()
- return result
-
- def notify(self, n=1):
- """Wake up one or more threads waiting on this condition, if any.
-
- If the calling thread has not acquired the lock when this method is
- called, a RuntimeError is raised.
-
- This method wakes up at most n of the threads waiting for the condition
- variable; it is a no-op if no threads are waiting.
-
- """
- if not self._is_owned():
- raise RuntimeError("cannot notify on un-acquired lock")
- waiters = self._waiters
- while waiters and n > 0:
- waiter = waiters[0]
- try:
- waiter.release()
- except RuntimeError:
- # gh-92530: The previous call of notify() released the lock,
- # but was interrupted before removing it from the queue.
- # It can happen if a signal handler raises an exception,
- # like CTRL+C which raises KeyboardInterrupt.
- pass
- else:
- n -= 1
- try:
- waiters.remove(waiter)
- except ValueError:
- pass
-
- def notify_all(self):
- """Wake up all threads waiting on this condition.
-
- If the calling thread has not acquired the lock when this method
- is called, a RuntimeError is raised.
-
- """
- self.notify(len(self._waiters))
-
- def notifyAll(self):
- """Wake up all threads waiting on this condition.
-
- This method is deprecated, use notify_all() instead.
-
- """
- import warnings
- warnings.warn('notifyAll() is deprecated, use notify_all() instead',
- DeprecationWarning, stacklevel=2)
- self.notify_all()
-
-
-class Semaphore:
- """This class implements semaphore objects.
-
- Semaphores manage a counter representing the number of release() calls minus
- the number of acquire() calls, plus an initial value. The acquire() method
- blocks if necessary until it can return without making the counter
- negative. If not given, value defaults to 1.
-
- """
-
- # After Tim Peters' semaphore class, but not quite the same (no maximum)
-
- def __init__(self, value=1):
- if value < 0:
- raise ValueError("semaphore initial value must be >= 0")
- self._cond = Condition(Lock())
- self._value = value
-
- def __repr__(self):
- cls = self.__class__
- return (f"<{cls.__module__}.{cls.__qualname__} at {id(self):#x}:"
- f" value={self._value}>")
-
- def acquire(self, blocking=True, timeout=None):
- """Acquire a semaphore, decrementing the internal counter by one.
-
- When invoked without arguments: if the internal counter is larger than
- zero on entry, decrement it by one and return immediately. If it is zero
- on entry, block, waiting until some other thread has called release() to
- make it larger than zero. This is done with proper interlocking so that
- if multiple acquire() calls are blocked, release() will wake exactly one
- of them up. The implementation may pick one at random, so the order in
- which blocked threads are awakened should not be relied on. There is no
- return value in this case.
-
- When invoked with blocking set to true, do the same thing as when called
- without arguments, and return true.
-
- When invoked with blocking set to false, do not block. If a call without
- an argument would block, return false immediately; otherwise, do the
- same thing as when called without arguments, and return true.
-
- When invoked with a timeout other than None, it will block for at
- most timeout seconds. If acquire does not complete successfully in
- that interval, return false. Return true otherwise.
-
- """
- if not blocking and timeout is not None:
- raise ValueError("can't specify timeout for non-blocking acquire")
- rc = False
- endtime = None
- with self._cond:
- while self._value == 0:
- if not blocking:
- break
- if timeout is not None:
- if endtime is None:
- endtime = _time() + timeout
- else:
- timeout = endtime - _time()
- if timeout <= 0:
- break
- self._cond.wait(timeout)
- else:
- self._value -= 1
- rc = True
- return rc
-
- __enter__ = acquire
-
- def release(self, n=1):
- """Release a semaphore, incrementing the internal counter by one or more.
-
- When the counter is zero on entry and another thread is waiting for it
- to become larger than zero again, wake up that thread.
-
- """
- if n < 1:
- raise ValueError('n must be one or more')
- with self._cond:
- self._value += n
- self._cond.notify(n)
-
- def __exit__(self, t, v, tb):
- self.release()
-
-
-class BoundedSemaphore(Semaphore):
- """Implements a bounded semaphore.
-
- A bounded semaphore checks to make sure its current value doesn't exceed its
- initial value. If it does, ValueError is raised. In most situations
- semaphores are used to guard resources with limited capacity.
-
- If the semaphore is released too many times it's a sign of a bug. If not
- given, value defaults to 1.
-
- Like regular semaphores, bounded semaphores manage a counter representing
- the number of release() calls minus the number of acquire() calls, plus an
- initial value. The acquire() method blocks if necessary until it can return
- without making the counter negative. If not given, value defaults to 1.
-
- """
-
- def __init__(self, value=1):
- super().__init__(value)
- self._initial_value = value
-
- def __repr__(self):
- cls = self.__class__
- return (f"<{cls.__module__}.{cls.__qualname__} at {id(self):#x}:"
- f" value={self._value}/{self._initial_value}>")
-
- def release(self, n=1):
- """Release a semaphore, incrementing the internal counter by one or more.
-
- When the counter is zero on entry and another thread is waiting for it
- to become larger than zero again, wake up that thread.
-
- If the number of releases exceeds the number of acquires,
- raise a ValueError.
-
- """
- if n < 1:
- raise ValueError('n must be one or more')
- with self._cond:
- if self._value + n > self._initial_value:
- raise ValueError("Semaphore released too many times")
- self._value += n
- self._cond.notify(n)
-
-
-class Event:
- """Class implementing event objects.
-
- Events manage a flag that can be set to true with the set() method and reset
- to false with the clear() method. The wait() method blocks until the flag is
- true. The flag is initially false.
-
- """
-
- # After Tim Peters' event class (without is_posted())
-
- def __init__(self):
- self._cond = Condition(Lock())
- self._flag = False
-
- def __repr__(self):
- cls = self.__class__
- status = 'set' if self._flag else 'unset'
- return f"<{cls.__module__}.{cls.__qualname__} at {id(self):#x}: {status}>"
-
- def _at_fork_reinit(self):
- # Private method called by Thread._reset_internal_locks()
- self._cond._at_fork_reinit()
-
- def is_set(self):
- """Return true if and only if the internal flag is true."""
- return self._flag
-
- def isSet(self):
- """Return true if and only if the internal flag is true.
-
- This method is deprecated, use is_set() instead.
-
- """
- import warnings
- warnings.warn('isSet() is deprecated, use is_set() instead',
- DeprecationWarning, stacklevel=2)
- return self.is_set()
-
- def set(self):
- """Set the internal flag to true.
-
- All threads waiting for it to become true are awakened. Threads
- that call wait() once the flag is true will not block at all.
-
- """
- with self._cond:
- self._flag = True
- self._cond.notify_all()
-
- def clear(self):
- """Reset the internal flag to false.
-
- Subsequently, threads calling wait() will block until set() is called to
- set the internal flag to true again.
-
- """
- with self._cond:
- self._flag = False
-
- def wait(self, timeout=None):
- """Block until the internal flag is true.
-
- If the internal flag is true on entry, return immediately. Otherwise,
- block until another thread calls set() to set the flag to true, or until
- the optional timeout occurs.
-
- When the timeout argument is present and not None, it should be a
- floating point number specifying a timeout for the operation in seconds
- (or fractions thereof).
-
- This method returns the internal flag on exit, so it will always return
- True except if a timeout is given and the operation times out.
-
- """
- with self._cond:
- signaled = self._flag
- if not signaled:
- signaled = self._cond.wait(timeout)
- return signaled
-
-
-# A barrier class. Inspired in part by the pthread_barrier_* api and
-# the CyclicBarrier class from Java. See
-# http://sourceware.org/pthreads-win32/manual/pthread_barrier_init.html and
-# http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/
-# CyclicBarrier.html
-# for information.
-# We maintain two main states, 'filling' and 'draining' enabling the barrier
-# to be cyclic. Threads are not allowed into it until it has fully drained
-# since the previous cycle. In addition, a 'resetting' state exists which is
-# similar to 'draining' except that threads leave with a BrokenBarrierError,
-# and a 'broken' state in which all threads get the exception.
-class Barrier:
- """Implements a Barrier.
-
- Useful for synchronizing a fixed number of threads at known synchronization
- points. Threads block on 'wait()' and are simultaneously awoken once they
- have all made that call.
-
- """
-
- def __init__(self, parties, action=None, timeout=None):
- """Create a barrier, initialised to 'parties' threads.
-
- 'action' is a callable which, when supplied, will be called by one of
- the threads after they have all entered the barrier and just prior to
- releasing them all. If a 'timeout' is provided, it is used as the
- default for all subsequent 'wait()' calls.
-
- """
- self._cond = Condition(Lock())
- self._action = action
- self._timeout = timeout
- self._parties = parties
- self._state = 0 # 0 filling, 1 draining, -1 resetting, -2 broken
- self._count = 0
-
- def __repr__(self):
- cls = self.__class__
- if self.broken:
- return f"<{cls.__module__}.{cls.__qualname__} at {id(self):#x}: broken>"
- return (f"<{cls.__module__}.{cls.__qualname__} at {id(self):#x}:"
- f" waiters={self.n_waiting}/{self.parties}>")
-
- def wait(self, timeout=None):
- """Wait for the barrier.
-
- When the specified number of threads have started waiting, they are all
- simultaneously awoken. If an 'action' was provided for the barrier, one
- of the threads will have executed that callback prior to returning.
- Returns an individual index number from 0 to 'parties-1'.
-
- """
- if timeout is None:
- timeout = self._timeout
- with self._cond:
- self._enter() # Block while the barrier drains.
- index = self._count
- self._count += 1
- try:
- if index + 1 == self._parties:
- # We release the barrier
- self._release()
- else:
- # We wait until someone releases us
- self._wait(timeout)
- return index
- finally:
- self._count -= 1
- # Wake up any threads waiting for barrier to drain.
- self._exit()
-
- # Block until the barrier is ready for us, or raise an exception
- # if it is broken.
- def _enter(self):
- while self._state in (-1, 1):
- # It is draining or resetting, wait until done
- self._cond.wait()
- #see if the barrier is in a broken state
- if self._state < 0:
- raise BrokenBarrierError
- assert self._state == 0
-
- # Optionally run the 'action' and release the threads waiting
- # in the barrier.
- def _release(self):
- try:
- if self._action:
- self._action()
- # enter draining state
- self._state = 1
- self._cond.notify_all()
- except:
- #an exception during the _action handler. Break and reraise
- self._break()
- raise
-
- # Wait in the barrier until we are released. Raise an exception
- # if the barrier is reset or broken.
- def _wait(self, timeout):
- if not self._cond.wait_for(lambda : self._state != 0, timeout):
- #timed out. Break the barrier
- self._break()
- raise BrokenBarrierError
- if self._state < 0:
- raise BrokenBarrierError
- assert self._state == 1
-
- # If we are the last thread to exit the barrier, signal any threads
- # waiting for the barrier to drain.
- def _exit(self):
- if self._count == 0:
- if self._state in (-1, 1):
- #resetting or draining
- self._state = 0
- self._cond.notify_all()
-
- def reset(self):
- """Reset the barrier to the initial state.
-
- Any threads currently waiting will get the BrokenBarrier exception
- raised.
-
- """
- with self._cond:
- if self._count > 0:
- if self._state == 0:
- #reset the barrier, waking up threads
- self._state = -1
- elif self._state == -2:
- #was broken, set it to reset state
- #which clears when the last thread exits
- self._state = -1
- else:
- self._state = 0
- self._cond.notify_all()
-
- def abort(self):
- """Place the barrier into a 'broken' state.
-
- Useful in case of error. Any currently waiting threads and threads
- attempting to 'wait()' will have BrokenBarrierError raised.
-
- """
- with self._cond:
- self._break()
-
- def _break(self):
- # An internal error was detected. The barrier is set to
- # a broken state all parties awakened.
- self._state = -2
- self._cond.notify_all()
-
- @property
- def parties(self):
- """Return the number of threads required to trip the barrier."""
- return self._parties
-
- @property
- def n_waiting(self):
- """Return the number of threads currently waiting at the barrier."""
- # We don't need synchronization here since this is an ephemeral result
- # anyway. It returns the correct value in the steady state.
- if self._state == 0:
- return self._count
- return 0
-
- @property
- def broken(self):
- """Return True if the barrier is in a broken state."""
- return self._state == -2
-
-# exception raised by the Barrier class
-class BrokenBarrierError(RuntimeError):
- pass
-
-
-# Helper to generate new thread names
-_counter = _count(1).__next__
-def _newname(name_template):
- return name_template % _counter()
-
-# Active thread administration.
-#
-# bpo-44422: Use a reentrant lock to allow reentrant calls to functions like
-# threading.enumerate().
-_active_limbo_lock = RLock()
-_active = {} # maps thread id to Thread object
-_limbo = {}
-_dangling = WeakSet()
-
-# Set of Thread._tstate_lock locks of non-daemon threads used by _shutdown()
-# to wait until all Python thread states get deleted:
-# see Thread._set_tstate_lock().
-_shutdown_locks_lock = _allocate_lock()
-_shutdown_locks = set()
-
-def _maintain_shutdown_locks():
- """
- Drop any shutdown locks that don't correspond to running threads anymore.
-
- Calling this from time to time avoids an ever-growing _shutdown_locks
- set when Thread objects are not joined explicitly. See bpo-37788.
-
- This must be called with _shutdown_locks_lock acquired.
- """
- # If a lock was released, the corresponding thread has exited
- to_remove = [lock for lock in _shutdown_locks if not lock.locked()]
- _shutdown_locks.difference_update(to_remove)
-
-
-# Main class for threads
-
-class Thread:
- """A class that represents a thread of control.
-
- This class can be safely subclassed in a limited fashion. There are two ways
- to specify the activity: by passing a callable object to the constructor, or
- by overriding the run() method in a subclass.
-
- """
-
- _initialized = False
-
- def __init__(self, group=None, target=None, name=None,
- args=(), kwargs=None, *, daemon=None):
- """This constructor should always be called with keyword arguments. Arguments are:
-
- *group* should be None; reserved for future extension when a ThreadGroup
- class is implemented.
-
- *target* is the callable object to be invoked by the run()
- method. Defaults to None, meaning nothing is called.
-
- *name* is the thread name. By default, a unique name is constructed of
- the form "Thread-N" where N is a small decimal number.
-
- *args* is a list or tuple of arguments for the target invocation. Defaults to ().
-
- *kwargs* is a dictionary of keyword arguments for the target
- invocation. Defaults to {}.
-
- If a subclass overrides the constructor, it must make sure to invoke
- the base class constructor (Thread.__init__()) before doing anything
- else to the thread.
-
- """
- assert group is None, "group argument must be None for now"
- if kwargs is None:
- kwargs = {}
- if name:
- name = str(name)
- else:
- name = _newname("Thread-%d")
- if target is not None:
- try:
- target_name = target.__name__
- name += f" ({target_name})"
- except AttributeError:
- pass
-
- self._target = target
- self._name = name
- self._args = args
- self._kwargs = kwargs
- if daemon is not None:
- if daemon and not _daemon_threads_allowed():
- raise RuntimeError('daemon threads are disabled in this (sub)interpreter')
- self._daemonic = daemon
- else:
- self._daemonic = current_thread().daemon
- self._ident = None
- if _HAVE_THREAD_NATIVE_ID:
- self._native_id = None
- self._tstate_lock = None
- self._started = Event()
- self._is_stopped = False
- self._initialized = True
- # Copy of sys.stderr used by self._invoke_excepthook()
- self._stderr = _sys.stderr
- self._invoke_excepthook = _make_invoke_excepthook()
- # For debugging and _after_fork()
- _dangling.add(self)
-
- def _reset_internal_locks(self, is_alive):
- # private! Called by _after_fork() to reset our internal locks as
- # they may be in an invalid state leading to a deadlock or crash.
- self._started._at_fork_reinit()
- if is_alive:
- # bpo-42350: If the fork happens when the thread is already stopped
- # (ex: after threading._shutdown() has been called), _tstate_lock
- # is None. Do nothing in this case.
- if self._tstate_lock is not None:
- self._tstate_lock._at_fork_reinit()
- self._tstate_lock.acquire()
- else:
- # The thread isn't alive after fork: it doesn't have a tstate
- # anymore.
- self._is_stopped = True
- self._tstate_lock = None
-
- def __repr__(self):
- assert self._initialized, "Thread.__init__() was not called"
- status = "initial"
- if self._started.is_set():
- status = "started"
- self.is_alive() # easy way to get ._is_stopped set when appropriate
- if self._is_stopped:
- status = "stopped"
- if self._daemonic:
- status += " daemon"
- if self._ident is not None:
- status += " %s" % self._ident
- return "<%s(%s, %s)>" % (self.__class__.__name__, self._name, status)
-
- def start(self):
- """Start the thread's activity.
-
- It must be called at most once per thread object. It arranges for the
- object's run() method to be invoked in a separate thread of control.
-
- This method will raise a RuntimeError if called more than once on the
- same thread object.
-
- """
- if not self._initialized:
- raise RuntimeError("thread.__init__() not called")
-
- if self._started.is_set():
- raise RuntimeError("threads can only be started once")
-
- with _active_limbo_lock:
- _limbo[self] = self
- try:
- _start_new_thread(self._bootstrap, ())
- except Exception:
- with _active_limbo_lock:
- del _limbo[self]
- raise
- self._started.wait()
-
- def run(self):
- """Method representing the thread's activity.
-
- You may override this method in a subclass. The standard run() method
- invokes the callable object passed to the object's constructor as the
- target argument, if any, with sequential and keyword arguments taken
- from the args and kwargs arguments, respectively.
-
- """
- try:
- if self._target is not None:
- self._target(*self._args, **self._kwargs)
- finally:
- # Avoid a refcycle if the thread is running a function with
- # an argument that has a member that points to the thread.
- del self._target, self._args, self._kwargs
-
- def _bootstrap(self):
- # Wrapper around the real bootstrap code that ignores
- # exceptions during interpreter cleanup. Those typically
- # happen when a daemon thread wakes up at an unfortunate
- # moment, finds the world around it destroyed, and raises some
- # random exception *** while trying to report the exception in
- # _bootstrap_inner() below ***. Those random exceptions
- # don't help anybody, and they confuse users, so we suppress
- # them. We suppress them only when it appears that the world
- # indeed has already been destroyed, so that exceptions in
- # _bootstrap_inner() during normal business hours are properly
- # reported. Also, we only suppress them for daemonic threads;
- # if a non-daemonic encounters this, something else is wrong.
- try:
- self._bootstrap_inner()
- except:
- if self._daemonic and _sys is None:
- return
- raise
-
- def _set_ident(self):
- self._ident = get_ident()
-
- if _HAVE_THREAD_NATIVE_ID:
- def _set_native_id(self):
- self._native_id = get_native_id()
-
- def _set_tstate_lock(self):
- """
- Set a lock object which will be released by the interpreter when
- the underlying thread state (see pystate.h) gets deleted.
- """
- self._tstate_lock = _set_sentinel()
- self._tstate_lock.acquire()
-
- if not self.daemon:
- with _shutdown_locks_lock:
- _maintain_shutdown_locks()
- _shutdown_locks.add(self._tstate_lock)
-
- def _bootstrap_inner(self):
- try:
- self._set_ident()
- self._set_tstate_lock()
- if _HAVE_THREAD_NATIVE_ID:
- self._set_native_id()
- self._started.set()
- with _active_limbo_lock:
- _active[self._ident] = self
- del _limbo[self]
-
- if _trace_hook:
- _sys.settrace(_trace_hook)
- if _profile_hook:
- _sys.setprofile(_profile_hook)
-
- try:
- self.run()
- except:
- self._invoke_excepthook(self)
- finally:
- self._delete()
-
- def _stop(self):
- # After calling ._stop(), .is_alive() returns False and .join() returns
- # immediately. ._tstate_lock must be released before calling ._stop().
- #
- # Normal case: C code at the end of the thread's life
- # (release_sentinel in _threadmodule.c) releases ._tstate_lock, and
- # that's detected by our ._wait_for_tstate_lock(), called by .join()
- # and .is_alive(). Any number of threads _may_ call ._stop()
- # simultaneously (for example, if multiple threads are blocked in
- # .join() calls), and they're not serialized. That's harmless -
- # they'll just make redundant rebindings of ._is_stopped and
- # ._tstate_lock. Obscure: we rebind ._tstate_lock last so that the
- # "assert self._is_stopped" in ._wait_for_tstate_lock() always works
- # (the assert is executed only if ._tstate_lock is None).
- #
- # Special case: _main_thread releases ._tstate_lock via this
- # module's _shutdown() function.
- lock = self._tstate_lock
- if lock is not None:
- assert not lock.locked()
- self._is_stopped = True
- self._tstate_lock = None
- if not self.daemon:
- with _shutdown_locks_lock:
- # Remove our lock and other released locks from _shutdown_locks
- _maintain_shutdown_locks()
-
- def _delete(self):
- "Remove current thread from the dict of currently running threads."
- with _active_limbo_lock:
- del _active[get_ident()]
- # There must not be any python code between the previous line
- # and after the lock is released. Otherwise a tracing function
- # could try to acquire the lock again in the same thread, (in
- # current_thread()), and would block.
-
- def join(self, timeout=None):
- """Wait until the thread terminates.
-
- This blocks the calling thread until the thread whose join() method is
- called terminates -- either normally or through an unhandled exception
- or until the optional timeout occurs.
-
- When the timeout argument is present and not None, it should be a
- floating point number specifying a timeout for the operation in seconds
- (or fractions thereof). As join() always returns None, you must call
- is_alive() after join() to decide whether a timeout happened -- if the
- thread is still alive, the join() call timed out.
-
- When the timeout argument is not present or None, the operation will
- block until the thread terminates.
-
- A thread can be join()ed many times.
-
- join() raises a RuntimeError if an attempt is made to join the current
- thread as that would cause a deadlock. It is also an error to join() a
- thread before it has been started and attempts to do so raises the same
- exception.
-
- """
- if not self._initialized:
- raise RuntimeError("Thread.__init__() not called")
- if not self._started.is_set():
- raise RuntimeError("cannot join thread before it is started")
- if self is current_thread():
- raise RuntimeError("cannot join current thread")
-
- if timeout is None:
- self._wait_for_tstate_lock()
- else:
- # the behavior of a negative timeout isn't documented, but
- # historically .join(timeout=x) for x<0 has acted as if timeout=0
- self._wait_for_tstate_lock(timeout=max(timeout, 0))
-
- def _wait_for_tstate_lock(self, block=True, timeout=-1):
- # Issue #18808: wait for the thread state to be gone.
- # At the end of the thread's life, after all knowledge of the thread
- # is removed from C data structures, C code releases our _tstate_lock.
- # This method passes its arguments to _tstate_lock.acquire().
- # If the lock is acquired, the C code is done, and self._stop() is
- # called. That sets ._is_stopped to True, and ._tstate_lock to None.
- lock = self._tstate_lock
- if lock is None:
- # already determined that the C code is done
- assert self._is_stopped
- return
-
- try:
- if lock.acquire(block, timeout):
- lock.release()
- self._stop()
- except:
- if lock.locked():
- # bpo-45274: lock.acquire() acquired the lock, but the function
- # was interrupted with an exception before reaching the
- # lock.release(). It can happen if a signal handler raises an
- # exception, like CTRL+C which raises KeyboardInterrupt.
- lock.release()
- self._stop()
- raise
-
- @property
- def name(self):
- """A string used for identification purposes only.
-
- It has no semantics. Multiple threads may be given the same name. The
- initial name is set by the constructor.
-
- """
- assert self._initialized, "Thread.__init__() not called"
- return self._name
-
- @name.setter
- def name(self, name):
- assert self._initialized, "Thread.__init__() not called"
- self._name = str(name)
-
- @property
- def ident(self):
- """Thread identifier of this thread or None if it has not been started.
-
- This is a nonzero integer. See the get_ident() function. Thread
- identifiers may be recycled when a thread exits and another thread is
- created. The identifier is available even after the thread has exited.
-
- """
- assert self._initialized, "Thread.__init__() not called"
- return self._ident
-
- if _HAVE_THREAD_NATIVE_ID:
- @property
- def native_id(self):
- """Native integral thread ID of this thread, or None if it has not been started.
-
- This is a non-negative integer. See the get_native_id() function.
- This represents the Thread ID as reported by the kernel.
-
- """
- assert self._initialized, "Thread.__init__() not called"
- return self._native_id
-
- def is_alive(self):
- """Return whether the thread is alive.
-
- This method returns True just before the run() method starts until just
- after the run() method terminates. See also the module function
- enumerate().
-
- """
- assert self._initialized, "Thread.__init__() not called"
- if self._is_stopped or not self._started.is_set():
- return False
- self._wait_for_tstate_lock(False)
- return not self._is_stopped
-
- @property
- def daemon(self):
- """A boolean value indicating whether this thread is a daemon thread.
-
- This must be set before start() is called, otherwise RuntimeError is
- raised. Its initial value is inherited from the creating thread; the
- main thread is not a daemon thread and therefore all threads created in
- the main thread default to daemon = False.
-
- The entire Python program exits when only daemon threads are left.
-
- """
- assert self._initialized, "Thread.__init__() not called"
- return self._daemonic
-
- @daemon.setter
- def daemon(self, daemonic):
- if not self._initialized:
- raise RuntimeError("Thread.__init__() not called")
- if daemonic and not _daemon_threads_allowed():
- raise RuntimeError('daemon threads are disabled in this interpreter')
- if self._started.is_set():
- raise RuntimeError("cannot set daemon status of active thread")
- self._daemonic = daemonic
-
- def isDaemon(self):
- """Return whether this thread is a daemon.
-
- This method is deprecated, use the daemon attribute instead.
-
- """
- import warnings
- warnings.warn('isDaemon() is deprecated, get the daemon attribute instead',
- DeprecationWarning, stacklevel=2)
- return self.daemon
-
- def setDaemon(self, daemonic):
- """Set whether this thread is a daemon.
-
- This method is deprecated, use the .daemon property instead.
-
- """
- import warnings
- warnings.warn('setDaemon() is deprecated, set the daemon attribute instead',
- DeprecationWarning, stacklevel=2)
- self.daemon = daemonic
-
- def getName(self):
- """Return a string used for identification purposes only.
-
- This method is deprecated, use the name attribute instead.
-
- """
- import warnings
- warnings.warn('getName() is deprecated, get the name attribute instead',
- DeprecationWarning, stacklevel=2)
- return self.name
-
- def setName(self, name):
- """Set the name string for this thread.
-
- This method is deprecated, use the name attribute instead.
-
- """
- import warnings
- warnings.warn('setName() is deprecated, set the name attribute instead',
- DeprecationWarning, stacklevel=2)
- self.name = name
-
-
-try:
- from _thread import (_excepthook as excepthook,
- _ExceptHookArgs as ExceptHookArgs)
-except ImportError:
- # Simple Python implementation if _thread._excepthook() is not available
- from traceback import print_exception as _print_exception
- from collections import namedtuple
-
- _ExceptHookArgs = namedtuple(
- 'ExceptHookArgs',
- 'exc_type exc_value exc_traceback thread')
-
- def ExceptHookArgs(args):
- return _ExceptHookArgs(*args)
-
- def excepthook(args, /):
- """
- Handle uncaught Thread.run() exception.
- """
- if args.exc_type == SystemExit:
- # silently ignore SystemExit
- return
-
- if _sys is not None and _sys.stderr is not None:
- stderr = _sys.stderr
- elif args.thread is not None:
- stderr = args.thread._stderr
- if stderr is None:
- # do nothing if sys.stderr is None and sys.stderr was None
- # when the thread was created
- return
- else:
- # do nothing if sys.stderr is None and args.thread is None
- return
-
- if args.thread is not None:
- name = args.thread.name
- else:
- name = get_ident()
- print(f"Exception in thread {name}:",
- file=stderr, flush=True)
- _print_exception(args.exc_type, args.exc_value, args.exc_traceback,
- file=stderr)
- stderr.flush()
-
-
-# Original value of threading.excepthook
-__excepthook__ = excepthook
-
-
-def _make_invoke_excepthook():
- # Create a local namespace to ensure that variables remain alive
- # when _invoke_excepthook() is called, even if it is called late during
- # Python shutdown. It is mostly needed for daemon threads.
-
- old_excepthook = excepthook
- old_sys_excepthook = _sys.excepthook
- if old_excepthook is None:
- raise RuntimeError("threading.excepthook is None")
- if old_sys_excepthook is None:
- raise RuntimeError("sys.excepthook is None")
-
- sys_exc_info = _sys.exc_info
- local_print = print
- local_sys = _sys
-
- def invoke_excepthook(thread):
- global excepthook
- try:
- hook = excepthook
- if hook is None:
- hook = old_excepthook
-
- args = ExceptHookArgs([*sys_exc_info(), thread])
-
- hook(args)
- except Exception as exc:
- exc.__suppress_context__ = True
- del exc
-
- if local_sys is not None and local_sys.stderr is not None:
- stderr = local_sys.stderr
- else:
- stderr = thread._stderr
-
- local_print("Exception in threading.excepthook:",
- file=stderr, flush=True)
-
- if local_sys is not None and local_sys.excepthook is not None:
- sys_excepthook = local_sys.excepthook
- else:
- sys_excepthook = old_sys_excepthook
-
- sys_excepthook(*sys_exc_info())
- finally:
- # Break reference cycle (exception stored in a variable)
- args = None
-
- return invoke_excepthook
-
-
-# The timer class was contributed by Itamar Shtull-Trauring
-
-class Timer(Thread):
- """Call a function after a specified number of seconds:
-
- t = Timer(30.0, f, args=None, kwargs=None)
- t.start()
- t.cancel() # stop the timer's action if it's still waiting
-
- """
-
- def __init__(self, interval, function, args=None, kwargs=None):
- Thread.__init__(self)
- self.interval = interval
- self.function = function
- self.args = args if args is not None else []
- self.kwargs = kwargs if kwargs is not None else {}
- self.finished = Event()
-
- def cancel(self):
- """Stop the timer if it hasn't finished yet."""
- self.finished.set()
-
- def run(self):
- self.finished.wait(self.interval)
- if not self.finished.is_set():
- self.function(*self.args, **self.kwargs)
- self.finished.set()
-
-
-# Special thread class to represent the main thread
-
-class _MainThread(Thread):
-
- def __init__(self):
- Thread.__init__(self, name="MainThread", daemon=False)
- self._set_tstate_lock()
- self._started.set()
- self._set_ident()
- if _HAVE_THREAD_NATIVE_ID:
- self._set_native_id()
- with _active_limbo_lock:
- _active[self._ident] = self
-
-
-# Dummy thread class to represent threads not started here.
-# These aren't garbage collected when they die, nor can they be waited for.
-# If they invoke anything in threading.py that calls current_thread(), they
-# leave an entry in the _active dict forever after.
-# Their purpose is to return *something* from current_thread().
-# They are marked as daemon threads so we won't wait for them
-# when we exit (conform previous semantics).
-
-class _DummyThread(Thread):
-
- def __init__(self):
- Thread.__init__(self, name=_newname("Dummy-%d"),
- daemon=_daemon_threads_allowed())
- self._started.set()
- self._set_ident()
- if _HAVE_THREAD_NATIVE_ID:
- self._set_native_id()
- with _active_limbo_lock:
- _active[self._ident] = self
-
- def _stop(self):
- pass
-
- def is_alive(self):
- assert not self._is_stopped and self._started.is_set()
- return True
-
- def join(self, timeout=None):
- assert False, "cannot join a dummy thread"
-
-
-# Global API functions
-
-def current_thread():
- """Return the current Thread object, corresponding to the caller's thread of control.
-
- If the caller's thread of control was not created through the threading
- module, a dummy thread object with limited functionality is returned.
-
- """
- try:
- return _active[get_ident()]
- except KeyError:
- return _DummyThread()
-
-def currentThread():
- """Return the current Thread object, corresponding to the caller's thread of control.
-
- This function is deprecated, use current_thread() instead.
-
- """
- import warnings
- warnings.warn('currentThread() is deprecated, use current_thread() instead',
- DeprecationWarning, stacklevel=2)
- return current_thread()
-
-def active_count():
- """Return the number of Thread objects currently alive.
-
- The returned count is equal to the length of the list returned by
- enumerate().
-
- """
- # NOTE: if the logic in here ever changes, update Modules/posixmodule.c
- # warn_about_fork_with_threads() to match.
- with _active_limbo_lock:
- return len(_active) + len(_limbo)
-
-def activeCount():
- """Return the number of Thread objects currently alive.
-
- This function is deprecated, use active_count() instead.
-
- """
- import warnings
- warnings.warn('activeCount() is deprecated, use active_count() instead',
- DeprecationWarning, stacklevel=2)
- return active_count()
-
-def _enumerate():
- # Same as enumerate(), but without the lock. Internal use only.
- return list(_active.values()) + list(_limbo.values())
-
-def enumerate():
- """Return a list of all Thread objects currently alive.
-
- The list includes daemonic threads, dummy thread objects created by
- current_thread(), and the main thread. It excludes terminated threads and
- threads that have not yet been started.
-
- """
- with _active_limbo_lock:
- return list(_active.values()) + list(_limbo.values())
-
-
-_threading_atexits = []
-_SHUTTING_DOWN = False
-
-def _register_atexit(func, *arg, **kwargs):
- """CPython internal: register *func* to be called before joining threads.
-
- The registered *func* is called with its arguments just before all
- non-daemon threads are joined in `_shutdown()`. It provides a similar
- purpose to `atexit.register()`, but its functions are called prior to
- threading shutdown instead of interpreter shutdown.
-
- For similarity to atexit, the registered functions are called in reverse.
- """
- if _SHUTTING_DOWN:
- raise RuntimeError("can't register atexit after shutdown")
-
- call = functools.partial(func, *arg, **kwargs)
- _threading_atexits.append(call)
-
-
-from _thread import stack_size
-
-# Create the main thread object,
-# and make it available for the interpreter
-# (Py_Main) as threading._shutdown.
-
-_main_thread = _MainThread()
-
-def _shutdown():
- """
- Wait until the Python thread state of all non-daemon threads get deleted.
- """
- # Obscure: other threads may be waiting to join _main_thread. That's
- # dubious, but some code does it. We can't wait for C code to release
- # the main thread's tstate_lock - that won't happen until the interpreter
- # is nearly dead. So we release it here. Note that just calling _stop()
- # isn't enough: other threads may already be waiting on _tstate_lock.
- if _main_thread._is_stopped and _is_main_interpreter():
- # _shutdown() was already called
- return
-
- global _SHUTTING_DOWN
- _SHUTTING_DOWN = True
-
- # Call registered threading atexit functions before threads are joined.
- # Order is reversed, similar to atexit.
- for atexit_call in reversed(_threading_atexits):
- atexit_call()
-
- # Main thread
- if _main_thread.ident == get_ident():
- tlock = _main_thread._tstate_lock
- # The main thread isn't finished yet, so its thread state lock can't
- # have been released.
- assert tlock is not None
- assert tlock.locked()
- tlock.release()
- _main_thread._stop()
- else:
- # bpo-1596321: _shutdown() must be called in the main thread.
- # If the threading module was not imported by the main thread,
- # _main_thread is the thread which imported the threading module.
- # In this case, ignore _main_thread, similar behavior than for threads
- # spawned by C libraries or using _thread.start_new_thread().
- pass
-
- # Join all non-deamon threads
- while True:
- with _shutdown_locks_lock:
- locks = list(_shutdown_locks)
- _shutdown_locks.clear()
-
- if not locks:
- break
-
- for lock in locks:
- # mimic Thread.join()
- lock.acquire()
- lock.release()
-
- # new threads can be spawned while we were waiting for the other
- # threads to complete
-
-
-def main_thread():
- """Return the main thread object.
-
- In normal conditions, the main thread is the thread from which the
- Python interpreter was started.
- """
- # XXX Figure this out for subinterpreters. (See gh-75698.)
- return _main_thread
-
-# get thread-local implementation, either from the thread
-# module, or from the python fallback
-
-try:
- from _thread import _local as local
-except ImportError:
- from _threading_local import local
-
-
-def _after_fork():
- """
- Cleanup threading module state that should not exist after a fork.
- """
- # Reset _active_limbo_lock, in case we forked while the lock was held
- # by another (non-forked) thread. http://bugs.python.org/issue874900
- global _active_limbo_lock, _main_thread
- global _shutdown_locks_lock, _shutdown_locks
- _active_limbo_lock = RLock()
-
- # fork() only copied the current thread; clear references to others.
- new_active = {}
-
- try:
- current = _active[get_ident()]
- except KeyError:
- # fork() was called in a thread which was not spawned
- # by threading.Thread. For example, a thread spawned
- # by thread.start_new_thread().
- current = _MainThread()
-
- _main_thread = current
-
- # reset _shutdown() locks: threads re-register their _tstate_lock below
- _shutdown_locks_lock = _allocate_lock()
- _shutdown_locks = set()
-
- with _active_limbo_lock:
- # Dangling thread instances must still have their locks reset,
- # because someone may join() them.
- threads = set(_enumerate())
- threads.update(_dangling)
- for thread in threads:
- # Any lock/condition variable may be currently locked or in an
- # invalid state, so we reinitialize them.
- if thread is current:
- # There is only one active thread. We reset the ident to
- # its new value since it can have changed.
- thread._reset_internal_locks(True)
- ident = get_ident()
- if (
- isinstance(thread, _DummyThread)
- # Ensure _DummyThread is not monkey-patched to avoid
- # <https://github.com/gevent/gevent/issues/2020>
- and _DummyThread.__bases__[0] == Thread
- ):
- thread.__class__ = _MainThread
- thread._name = 'MainThread'
- thread._daemonic = False
- thread._set_tstate_lock()
- thread._ident = ident
- new_active[ident] = thread
- else:
- # All the others are already stopped.
- thread._reset_internal_locks(False)
- thread._stop()
-
- _limbo.clear()
- _active.clear()
- _active.update(new_active)
- assert len(_active) == 1
-
-
-if hasattr(_os, "register_at_fork"):
- _os.register_at_fork(after_in_child=_after_fork)
diff --git a/contrib/tools/python3/src/Lib/ya.make b/contrib/tools/python3/src/Lib/ya.make
deleted file mode 100644
index 2bd807f0001..00000000000
--- a/contrib/tools/python3/src/Lib/ya.make
+++ /dev/null
@@ -1,545 +0,0 @@
-# Generated by devtools/yamaker.
-
-ENABLE(PYBUILD_NO_PY)
-
-PY3_LIBRARY()
-
-VERSION(3.12.2)
-
-ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.12.2.tar.gz)
-
-LICENSE(Python-2.0)
-
-PEERDIR(
- certs
- contrib/tools/python3/lib/py
-)
-
-NO_LINT()
-
-NO_PYTHON_INCLUDES()
-
-PY_SRCS(
- TOP_LEVEL
- __future__.py
- __hello__.py
- _aix_support.py
- _collections_abc.py
- _compat_pickle.py
- _compression.py
- _markupbase.py
- _osx_support.py
- _py_abc.py
- _pydatetime.py
- _pydecimal.py
- _pyio.py
- _pylong.py
- _sitebuiltins.py
- _strptime.py
- _sysconfigdata_arcadia.py
- _threading_local.py
- _weakrefset.py
- abc.py
- aifc.py
- antigravity.py
- argparse.py
- ast.py
- asyncio/__init__.py
- asyncio/__main__.py
- asyncio/base_events.py
- asyncio/base_futures.py
- asyncio/base_subprocess.py
- asyncio/base_tasks.py
- asyncio/constants.py
- asyncio/coroutines.py
- asyncio/events.py
- asyncio/exceptions.py
- asyncio/format_helpers.py
- asyncio/futures.py
- asyncio/locks.py
- asyncio/log.py
- asyncio/mixins.py
- asyncio/proactor_events.py
- asyncio/protocols.py
- asyncio/queues.py
- asyncio/runners.py
- asyncio/selector_events.py
- asyncio/sslproto.py
- asyncio/staggered.py
- asyncio/streams.py
- asyncio/subprocess.py
- asyncio/taskgroups.py
- asyncio/tasks.py
- asyncio/threads.py
- asyncio/timeouts.py
- asyncio/transports.py
- asyncio/trsock.py
- asyncio/unix_events.py
- asyncio/windows_events.py
- asyncio/windows_utils.py
- base64.py
- bdb.py
- bisect.py
- bz2.py
- cProfile.py
- calendar.py
- cgi.py
- cgitb.py
- chunk.py
- cmd.py
- code.py
- codecs.py
- codeop.py
- collections/__init__.py
- collections/abc.py
- colorsys.py
- compileall.py
- concurrent/__init__.py
- concurrent/futures/__init__.py
- concurrent/futures/_base.py
- concurrent/futures/process.py
- concurrent/futures/thread.py
- configparser.py
- contextlib.py
- contextvars.py
- copy.py
- copyreg.py
- crypt.py
- csv.py
- ctypes/__init__.py
- ctypes/_aix.py
- ctypes/_endian.py
- ctypes/macholib/__init__.py
- ctypes/macholib/dyld.py
- ctypes/macholib/dylib.py
- ctypes/macholib/framework.py
- ctypes/util.py
- ctypes/wintypes.py
- curses/__init__.py
- curses/ascii.py
- curses/has_key.py
- curses/panel.py
- curses/textpad.py
- dataclasses.py
- datetime.py
- dbm/__init__.py
- dbm/dumb.py
- dbm/gnu.py
- dbm/ndbm.py
- decimal.py
- difflib.py
- dis.py
- doctest.py
- email/__init__.py
- email/_encoded_words.py
- email/_header_value_parser.py
- email/_parseaddr.py
- email/_policybase.py
- email/base64mime.py
- email/charset.py
- email/contentmanager.py
- email/encoders.py
- email/errors.py
- email/feedparser.py
- email/generator.py
- email/header.py
- email/headerregistry.py
- email/iterators.py
- email/message.py
- email/mime/__init__.py
- email/mime/application.py
- email/mime/audio.py
- email/mime/base.py
- email/mime/image.py
- email/mime/message.py
- email/mime/multipart.py
- email/mime/nonmultipart.py
- email/mime/text.py
- email/parser.py
- email/policy.py
- email/quoprimime.py
- email/utils.py
- encodings/__init__.py
- encodings/aliases.py
- encodings/ascii.py
- encodings/base64_codec.py
- encodings/big5.py
- encodings/big5hkscs.py
- encodings/bz2_codec.py
- encodings/charmap.py
- encodings/cp037.py
- encodings/cp1006.py
- encodings/cp1026.py
- encodings/cp1125.py
- encodings/cp1140.py
- encodings/cp1250.py
- encodings/cp1251.py
- encodings/cp1252.py
- encodings/cp1253.py
- encodings/cp1254.py
- encodings/cp1255.py
- encodings/cp1256.py
- encodings/cp1257.py
- encodings/cp1258.py
- encodings/cp273.py
- encodings/cp424.py
- encodings/cp437.py
- encodings/cp500.py
- encodings/cp720.py
- encodings/cp737.py
- encodings/cp775.py
- encodings/cp850.py
- encodings/cp852.py
- encodings/cp855.py
- encodings/cp856.py
- encodings/cp857.py
- encodings/cp858.py
- encodings/cp860.py
- encodings/cp861.py
- encodings/cp862.py
- encodings/cp863.py
- encodings/cp864.py
- encodings/cp865.py
- encodings/cp866.py
- encodings/cp869.py
- encodings/cp874.py
- encodings/cp875.py
- encodings/cp932.py
- encodings/cp949.py
- encodings/cp950.py
- encodings/euc_jis_2004.py
- encodings/euc_jisx0213.py
- encodings/euc_jp.py
- encodings/euc_kr.py
- encodings/gb18030.py
- encodings/gb2312.py
- encodings/gbk.py
- encodings/hex_codec.py
- encodings/hp_roman8.py
- encodings/hz.py
- encodings/idna.py
- encodings/iso2022_jp.py
- encodings/iso2022_jp_1.py
- encodings/iso2022_jp_2.py
- encodings/iso2022_jp_2004.py
- encodings/iso2022_jp_3.py
- encodings/iso2022_jp_ext.py
- encodings/iso2022_kr.py
- encodings/iso8859_1.py
- encodings/iso8859_10.py
- encodings/iso8859_11.py
- encodings/iso8859_13.py
- encodings/iso8859_14.py
- encodings/iso8859_15.py
- encodings/iso8859_16.py
- encodings/iso8859_2.py
- encodings/iso8859_3.py
- encodings/iso8859_4.py
- encodings/iso8859_5.py
- encodings/iso8859_6.py
- encodings/iso8859_7.py
- encodings/iso8859_8.py
- encodings/iso8859_9.py
- encodings/johab.py
- encodings/koi8_r.py
- encodings/koi8_t.py
- encodings/koi8_u.py
- encodings/kz1048.py
- encodings/latin_1.py
- encodings/mac_arabic.py
- encodings/mac_croatian.py
- encodings/mac_cyrillic.py
- encodings/mac_farsi.py
- encodings/mac_greek.py
- encodings/mac_iceland.py
- encodings/mac_latin2.py
- encodings/mac_roman.py
- encodings/mac_romanian.py
- encodings/mac_turkish.py
- encodings/mbcs.py
- encodings/oem.py
- encodings/palmos.py
- encodings/ptcp154.py
- encodings/punycode.py
- encodings/quopri_codec.py
- encodings/raw_unicode_escape.py
- encodings/rot_13.py
- encodings/shift_jis.py
- encodings/shift_jis_2004.py
- encodings/shift_jisx0213.py
- encodings/tis_620.py
- encodings/undefined.py
- encodings/unicode_escape.py
- encodings/utf_16.py
- encodings/utf_16_be.py
- encodings/utf_16_le.py
- encodings/utf_32.py
- encodings/utf_32_be.py
- encodings/utf_32_le.py
- encodings/utf_7.py
- encodings/utf_8.py
- encodings/utf_8_sig.py
- encodings/uu_codec.py
- encodings/zlib_codec.py
- ensurepip/__init__.py
- ensurepip/__main__.py
- ensurepip/_uninstall.py
- enum.py
- filecmp.py
- fileinput.py
- fnmatch.py
- fractions.py
- ftplib.py
- functools.py
- genericpath.py
- getopt.py
- getpass.py
- gettext.py
- glob.py
- graphlib.py
- gzip.py
- hashlib.py
- heapq.py
- hmac.py
- html/__init__.py
- html/entities.py
- html/parser.py
- http/__init__.py
- http/client.py
- http/cookiejar.py
- http/cookies.py
- http/server.py
- imaplib.py
- imghdr.py
- importlib/__init__.py
- importlib/_abc.py
- importlib/_bootstrap.py
- importlib/_bootstrap_external.py
- importlib/abc.py
- importlib/machinery.py
- importlib/metadata/__init__.py
- importlib/metadata/_adapters.py
- importlib/metadata/_collections.py
- importlib/metadata/_functools.py
- importlib/metadata/_itertools.py
- importlib/metadata/_meta.py
- importlib/metadata/_text.py
- importlib/readers.py
- importlib/resources/__init__.py
- importlib/resources/_adapters.py
- importlib/resources/_common.py
- importlib/resources/_itertools.py
- importlib/resources/_legacy.py
- importlib/resources/abc.py
- importlib/resources/readers.py
- importlib/resources/simple.py
- importlib/simple.py
- importlib/util.py
- inspect.py
- io.py
- ipaddress.py
- json/__init__.py
- json/decoder.py
- json/encoder.py
- json/scanner.py
- json/tool.py
- keyword.py
- linecache.py
- locale.py
- logging/__init__.py
- logging/config.py
- logging/handlers.py
- lzma.py
- mailbox.py
- mailcap.py
- mimetypes.py
- modulefinder.py
- msilib/__init__.py
- msilib/schema.py
- msilib/sequence.py
- msilib/text.py
- multiprocessing/__init__.py
- multiprocessing/connection.py
- multiprocessing/context.py
- multiprocessing/dummy/__init__.py
- multiprocessing/dummy/connection.py
- multiprocessing/forkserver.py
- multiprocessing/heap.py
- multiprocessing/managers.py
- multiprocessing/pool.py
- multiprocessing/popen_fork.py
- multiprocessing/popen_forkserver.py
- multiprocessing/popen_spawn_posix.py
- multiprocessing/popen_spawn_win32.py
- multiprocessing/process.py
- multiprocessing/queues.py
- multiprocessing/reduction.py
- multiprocessing/resource_sharer.py
- multiprocessing/resource_tracker.py
- multiprocessing/shared_memory.py
- multiprocessing/sharedctypes.py
- multiprocessing/spawn.py
- multiprocessing/synchronize.py
- multiprocessing/util.py
- netrc.py
- nntplib.py
- ntpath.py
- nturl2path.py
- numbers.py
- opcode.py
- operator.py
- optparse.py
- os.py
- pathlib.py
- pdb.py
- pickle.py
- pickletools.py
- pipes.py
- pkgutil.py
- platform.py
- plistlib.py
- poplib.py
- posixpath.py
- pprint.py
- profile.py
- pstats.py
- pty.py
- py_compile.py
- pyclbr.py
- pydoc.py
- pydoc_data/__init__.py
- pydoc_data/topics.py
- queue.py
- quopri.py
- random.py
- re/__init__.py
- re/_casefix.py
- re/_compiler.py
- re/_constants.py
- re/_parser.py
- reprlib.py
- rlcompleter.py
- runpy.py
- sched.py
- secrets.py
- selectors.py
- shelve.py
- shlex.py
- shutil.py
- signal.py
- site.py
- smtplib.py
- sndhdr.py
- socket.py
- socketserver.py
- sqlite3/__init__.py
- sqlite3/__main__.py
- sqlite3/dbapi2.py
- sqlite3/dump.py
- sre_compile.py
- sre_constants.py
- sre_parse.py
- ssl.py
- stat.py
- statistics.py
- string.py
- stringprep.py
- struct.py
- subprocess.py
- sunau.py
- symtable.py
- sysconfig.py
- tabnanny.py
- tarfile.py
- telnetlib.py
- tempfile.py
- textwrap.py
- this.py
- threading.py
- timeit.py
- token.py
- tokenize.py
- tomllib/__init__.py
- tomllib/_parser.py
- tomllib/_re.py
- tomllib/_types.py
- trace.py
- traceback.py
- tracemalloc.py
- tty.py
- turtle.py
- types.py
- typing.py
- unittest/__init__.py
- unittest/__main__.py
- unittest/_log.py
- unittest/async_case.py
- unittest/case.py
- unittest/loader.py
- unittest/main.py
- unittest/mock.py
- unittest/result.py
- unittest/runner.py
- unittest/signals.py
- unittest/suite.py
- unittest/util.py
- urllib/__init__.py
- urllib/error.py
- urllib/parse.py
- urllib/request.py
- urllib/response.py
- urllib/robotparser.py
- uu.py
- uuid.py
- venv/__init__.py
- venv/__main__.py
- warnings.py
- wave.py
- weakref.py
- webbrowser.py
- wsgiref/__init__.py
- wsgiref/handlers.py
- wsgiref/headers.py
- wsgiref/simple_server.py
- wsgiref/types.py
- wsgiref/util.py
- wsgiref/validate.py
- xdrlib.py
- xml/__init__.py
- xml/dom/NodeFilter.py
- xml/dom/__init__.py
- xml/dom/domreg.py
- xml/dom/expatbuilder.py
- xml/dom/minicompat.py
- xml/dom/minidom.py
- xml/dom/pulldom.py
- xml/dom/xmlbuilder.py
- xml/etree/ElementInclude.py
- xml/etree/ElementPath.py
- xml/etree/ElementTree.py
- xml/etree/__init__.py
- xml/etree/cElementTree.py
- xml/parsers/__init__.py
- xml/parsers/expat.py
- xml/sax/__init__.py
- xml/sax/_exceptions.py
- xml/sax/expatreader.py
- xml/sax/handler.py
- xml/sax/saxutils.py
- xml/sax/xmlreader.py
- xmlrpc/__init__.py
- xmlrpc/client.py
- xmlrpc/server.py
- zipapp.py
- zipfile/__init__.py
- zipfile/__main__.py
- zipfile/_path/__init__.py
- zipfile/_path/glob.py
- zipimport.py
- zoneinfo/__init__.py
- zoneinfo/_common.py
- zoneinfo/_tzpath.py
- zoneinfo/_zoneinfo.py
-)
-
-END()
diff --git a/contrib/tools/python3/src/Modules/_ctypes/_ctypes.c b/contrib/tools/python3/src/Modules/_ctypes/_ctypes.c
deleted file mode 100644
index 05de939b7a0..00000000000
--- a/contrib/tools/python3/src/Modules/_ctypes/_ctypes.c
+++ /dev/null
@@ -1,5836 +0,0 @@
-/*
- ToDo:
-
- Get rid of the checker (and also the converters) field in PyCFuncPtrObject and
- StgDictObject, and replace them by slot functions in StgDictObject.
-
- think about a buffer-like object (memory? bytes?)
-
- Should POINTER(c_char) and POINTER(c_wchar) have a .value property?
- What about c_char and c_wchar arrays then?
-
- Add from_mmap, from_file, from_string metaclass methods.
-
- Maybe we can get away with from_file (calls read) and with a from_buffer
- method?
-
- And what about the to_mmap, to_file, to_str(?) methods? They would clobber
- the namespace, probably. So, functions instead? And we already have memmove...
-*/
-
-/*
-
-Name methods, members, getsets
-==============================================================================
-
-PyCStructType_Type __new__(), from_address(), __mul__(), from_param()
-UnionType_Type __new__(), from_address(), __mul__(), from_param()
-PyCPointerType_Type __new__(), from_address(), __mul__(), from_param(), set_type()
-PyCArrayType_Type __new__(), from_address(), __mul__(), from_param()
-PyCSimpleType_Type __new__(), from_address(), __mul__(), from_param()
-
-PyCData_Type
- Struct_Type __new__(), __init__()
- PyCPointer_Type __new__(), __init__(), _as_parameter_, contents
- PyCArray_Type __new__(), __init__(), _as_parameter_, __get/setitem__(), __len__()
- Simple_Type __new__(), __init__(), _as_parameter_
-
-PyCField_Type
-PyCStgDict_Type
-
-==============================================================================
-
-class methods
--------------
-
-It has some similarity to the byref() construct compared to pointer()
-from_address(addr)
- - construct an instance from a given memory block (sharing this memory block)
-
-from_param(obj)
- - typecheck and convert a Python object into a C function call parameter
- The result may be an instance of the type, or an integer or tuple
- (typecode, value[, obj])
-
-instance methods/properties
----------------------------
-
-_as_parameter_
- - convert self into a C function call parameter
- This is either an integer, or a 3-tuple (typecode, value, obj)
-
-functions
----------
-
-sizeof(cdata)
- - return the number of bytes the buffer contains
-
-sizeof(ctype)
- - return the number of bytes the buffer of an instance would contain
-
-byref(cdata)
-
-addressof(cdata)
-
-pointer(cdata)
-
-POINTER(ctype)
-
-bytes(cdata)
- - return the buffer contents as a sequence of bytes (which is currently a string)
-
-*/
-
-/*
- * PyCStgDict_Type
- * PyCStructType_Type
- * UnionType_Type
- * PyCPointerType_Type
- * PyCArrayType_Type
- * PyCSimpleType_Type
- *
- * PyCData_Type
- * Struct_Type
- * Union_Type
- * PyCArray_Type
- * Simple_Type
- * PyCPointer_Type
- * PyCField_Type
- *
- */
-#ifndef Py_BUILD_CORE_BUILTIN
-# define Py_BUILD_CORE_MODULE 1
-#endif
-#define PY_SSIZE_T_CLEAN
-
-#include "Python.h"
-// windows.h must be included before pycore internal headers
-#ifdef MS_WIN32
-# include <windows.h>
-# include <Unknwn.h>
-#endif
-
-#include "pycore_call.h" // _PyObject_CallNoArgs()
-#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
-#include "structmember.h" // PyMemberDef
-
-#include <ffi.h>
-#ifdef MS_WIN32
-#include <malloc.h>
-#ifndef IS_INTRESOURCE
-#define IS_INTRESOURCE(x) (((size_t)(x) >> 16) == 0)
-#endif
-#else
-#include <dlfcn.h>
-#endif
-#include "ctypes.h"
-
-#include "pycore_long.h" // _PyLong_GetZero()
-
-ctypes_state global_state;
-
-PyObject *PyExc_ArgError = NULL;
-
-/* This dict maps ctypes types to POINTER types */
-PyObject *_ctypes_ptrtype_cache = NULL;
-
-static PyTypeObject Simple_Type;
-
-/* a callable object used for unpickling:
- strong reference to _ctypes._unpickle() function */
-static PyObject *_unpickle;
-
-
-/****************************************************************/
-
-typedef struct {
- PyObject_HEAD
- PyObject *key;
- PyObject *dict;
-} DictRemoverObject;
-
-static int
-_DictRemover_traverse(DictRemoverObject *self, visitproc visit, void *arg)
-{
- Py_VISIT(Py_TYPE(self));
- Py_VISIT(self->key);
- Py_VISIT(self->dict);
- return 0;
-}
-
-static int
-_DictRemover_clear(DictRemoverObject *self)
-{
- Py_CLEAR(self->key);
- Py_CLEAR(self->dict);
- return 0;
-}
-
-static void
-_DictRemover_dealloc(PyObject *myself)
-{
- PyTypeObject *tp = Py_TYPE(myself);
- DictRemoverObject *self = (DictRemoverObject *)myself;
- PyObject_GC_UnTrack(myself);
- (void)_DictRemover_clear(self);
- tp->tp_free(myself);
- Py_DECREF(tp);
-}
-
-static PyObject *
-_DictRemover_call(PyObject *myself, PyObject *args, PyObject *kw)
-{
- DictRemoverObject *self = (DictRemoverObject *)myself;
- if (self->key && self->dict) {
- if (-1 == PyDict_DelItem(self->dict, self->key)) {
- _PyErr_WriteUnraisableMsg("on calling _ctypes.DictRemover", NULL);
- }
- Py_CLEAR(self->key);
- Py_CLEAR(self->dict);
- }
- Py_RETURN_NONE;
-}
-
-PyDoc_STRVAR(dictremover_doc, "deletes a key from a dictionary");
-
-static PyType_Slot dictremover_slots[] = {
- {Py_tp_dealloc, _DictRemover_dealloc},
- {Py_tp_traverse, _DictRemover_traverse},
- {Py_tp_clear, _DictRemover_clear},
- {Py_tp_call, _DictRemover_call},
- {Py_tp_doc, (void *)dictremover_doc},
- {0, NULL},
-};
-
-static PyType_Spec dictremover_spec = {
- .name = "_ctypes.DictRemover",
- .basicsize = sizeof(DictRemoverObject),
- .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
- Py_TPFLAGS_IMMUTABLETYPE),
- .slots = dictremover_slots,
-};
-
-int
-PyDict_SetItemProxy(PyObject *dict, PyObject *key, PyObject *item)
-{
- PyObject *obj;
- DictRemoverObject *remover;
- PyObject *proxy;
- int result;
-
- ctypes_state *st = GLOBAL_STATE();
- obj = _PyObject_CallNoArgs((PyObject *)st->DictRemover_Type);
- if (obj == NULL)
- return -1;
-
- remover = (DictRemoverObject *)obj;
- assert(remover->key == NULL);
- assert(remover->dict == NULL);
- remover->key = Py_NewRef(key);
- remover->dict = Py_NewRef(dict);
-
- proxy = PyWeakref_NewProxy(item, obj);
- Py_DECREF(obj);
- if (proxy == NULL)
- return -1;
-
- result = PyDict_SetItem(dict, key, proxy);
- Py_DECREF(proxy);
- return result;
-}
-
-PyObject *
-PyDict_GetItemProxy(PyObject *dict, PyObject *key)
-{
- PyObject *result;
- PyObject *item = PyDict_GetItemWithError(dict, key);
-
- if (item == NULL)
- return NULL;
- if (!PyWeakref_CheckProxy(item))
- return item;
- result = PyWeakref_GET_OBJECT(item);
- if (result == Py_None)
- return NULL;
- return result;
-}
-
-/******************************************************************/
-
-/*
- Allocate a memory block for a pep3118 format string, filled with
- a suitable PEP 3118 type code corresponding to the given ctypes
- type. Returns NULL on failure, with the error indicator set.
-
- This produces type codes in the standard size mode (cf. struct module),
- since the endianness may need to be swapped to a non-native one
- later on.
- */
-static char *
-_ctypes_alloc_format_string_for_type(char code, int big_endian)
-{
- char *result;
- char pep_code = '\0';
-
- switch (code) {
-#if SIZEOF_INT == 2
- case 'i': pep_code = 'h'; break;
- case 'I': pep_code = 'H'; break;
-#elif SIZEOF_INT == 4
- case 'i': pep_code = 'i'; break;
- case 'I': pep_code = 'I'; break;
-#elif SIZEOF_INT == 8
- case 'i': pep_code = 'q'; break;
- case 'I': pep_code = 'Q'; break;
-#else
-# error SIZEOF_INT has an unexpected value
-#endif /* SIZEOF_INT */
-#if SIZEOF_LONG == 4
- case 'l': pep_code = 'l'; break;
- case 'L': pep_code = 'L'; break;
-#elif SIZEOF_LONG == 8
- case 'l': pep_code = 'q'; break;
- case 'L': pep_code = 'Q'; break;
-#else
-# error SIZEOF_LONG has an unexpected value
-#endif /* SIZEOF_LONG */
-#if SIZEOF__BOOL == 1
- case '?': pep_code = '?'; break;
-#elif SIZEOF__BOOL == 2
- case '?': pep_code = 'H'; break;
-#elif SIZEOF__BOOL == 4
- case '?': pep_code = 'L'; break;
-#elif SIZEOF__BOOL == 8
- case '?': pep_code = 'Q'; break;
-#else
-# error SIZEOF__BOOL has an unexpected value
-#endif /* SIZEOF__BOOL */
- default:
- /* The standard-size code is the same as the ctypes one */
- pep_code = code;
- break;
- }
-
- result = PyMem_Malloc(3);
- if (result == NULL) {
- PyErr_NoMemory();
- return NULL;
- }
-
- result[0] = big_endian ? '>' : '<';
- result[1] = pep_code;
- result[2] = '\0';
- return result;
-}
-
-/*
- Allocate a memory block for a pep3118 format string, copy prefix (if
- non-null) and suffix into it. Returns NULL on failure, with the error
- indicator set. If called with a suffix of NULL the error indicator must
- already be set.
- */
-char *
-_ctypes_alloc_format_string(const char *prefix, const char *suffix)
-{
- size_t len;
- char *result;
-
- if (suffix == NULL) {
- assert(PyErr_Occurred());
- return NULL;
- }
- len = strlen(suffix);
- if (prefix)
- len += strlen(prefix);
- result = PyMem_Malloc(len + 1);
- if (result == NULL) {
- PyErr_NoMemory();
- return NULL;
- }
- if (prefix)
- strcpy(result, prefix);
- else
- result[0] = '\0';
- strcat(result, suffix);
- return result;
-}
-
-/*
- Allocate a memory block for a pep3118 format string, adding
- the given prefix (if non-null), an additional shape prefix, and a suffix.
- Returns NULL on failure, with the error indicator set. If called with
- a suffix of NULL the error indicator must already be set.
- */
-char *
-_ctypes_alloc_format_string_with_shape(int ndim, const Py_ssize_t *shape,
- const char *prefix, const char *suffix)
-{
- char *new_prefix;
- char *result;
- char buf[32];
- Py_ssize_t prefix_len;
- int k;
-
- prefix_len = 32 * ndim + 3;
- if (prefix)
- prefix_len += strlen(prefix);
- new_prefix = PyMem_Malloc(prefix_len);
- if (new_prefix == NULL) {
- PyErr_NoMemory();
- return NULL;
- }
- new_prefix[0] = '\0';
- if (prefix)
- strcpy(new_prefix, prefix);
- if (ndim > 0) {
- /* Add the prefix "(shape[0],shape[1],...,shape[ndim-1])" */
- strcat(new_prefix, "(");
- for (k = 0; k < ndim; ++k) {
- if (k < ndim-1) {
- sprintf(buf, "%zd,", shape[k]);
- } else {
- sprintf(buf, "%zd)", shape[k]);
- }
- strcat(new_prefix, buf);
- }
- }
- result = _ctypes_alloc_format_string(new_prefix, suffix);
- PyMem_Free(new_prefix);
- return result;
-}
-
-/* StructParamObject and StructParam_Type are used in _ctypes_callproc()
- for argument.keep to call PyMem_Free(ptr) on Py_DECREF(argument).
-
- StructUnionType_paramfunc() creates such object when a ctypes Structure is
- passed by copy to a C function. */
-typedef struct {
- PyObject_HEAD
- void *ptr;
- PyObject *keep; // If set, a reference to the original CDataObject.
-} StructParamObject;
-
-static int
-StructParam_traverse(StructParamObject *self, visitproc visit, void *arg)
-{
- Py_VISIT(Py_TYPE(self));
- return 0;
-}
-
-static int
-StructParam_clear(StructParamObject *self)
-{
- Py_CLEAR(self->keep);
- return 0;
-}
-
-static void
-StructParam_dealloc(PyObject *myself)
-{
- StructParamObject *self = (StructParamObject *)myself;
- PyTypeObject *tp = Py_TYPE(self);
- PyObject_GC_UnTrack(myself);
- (void)StructParam_clear(self);
- PyMem_Free(self->ptr);
- tp->tp_free(myself);
- Py_DECREF(tp);
-}
-
-static PyType_Slot structparam_slots[] = {
- {Py_tp_traverse, StructParam_traverse},
- {Py_tp_clear, StructParam_clear},
- {Py_tp_dealloc, StructParam_dealloc},
- {0, NULL},
-};
-
-static PyType_Spec structparam_spec = {
- .name = "_ctypes.StructParam_Type",
- .basicsize = sizeof(StructParamObject),
- .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE |
- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_DISALLOW_INSTANTIATION),
- .slots = structparam_slots,
-};
-
-
-/*
- PyCStructType_Type - a meta type/class. Creating a new class using this one as
- __metaclass__ will call the constructor StructUnionType_new. It replaces the
- tp_dict member with a new instance of StgDict, and initializes the C
- accessible fields somehow.
-*/
-
-static PyCArgObject *
-StructUnionType_paramfunc(CDataObject *self)
-{
- PyCArgObject *parg;
- PyObject *obj;
- StgDictObject *stgdict;
- void *ptr;
-
- if ((size_t)self->b_size > sizeof(void*)) {
- ptr = PyMem_Malloc(self->b_size);
- if (ptr == NULL) {
- return NULL;
- }
- memcpy(ptr, self->b_ptr, self->b_size);
-
- /* Create a Python object which calls PyMem_Free(ptr) in
- its deallocator. The object will be destroyed
- at _ctypes_callproc() cleanup. */
- ctypes_state *st = GLOBAL_STATE();
- PyTypeObject *tp = st->StructParam_Type;
- obj = tp->tp_alloc(tp, 0);
- if (obj == NULL) {
- PyMem_Free(ptr);
- return NULL;
- }
-
- StructParamObject *struct_param = (StructParamObject *)obj;
- struct_param->ptr = ptr;
- struct_param->keep = Py_NewRef(self);
- } else {
- ptr = self->b_ptr;
- obj = Py_NewRef(self);
- }
-
- parg = PyCArgObject_new();
- if (parg == NULL) {
- Py_DECREF(obj);
- return NULL;
- }
-
- parg->tag = 'V';
- stgdict = PyObject_stgdict((PyObject *)self);
- assert(stgdict); /* Cannot be NULL for structure/union instances */
- parg->pffi_type = &stgdict->ffi_type_pointer;
- parg->value.p = ptr;
- parg->size = self->b_size;
- parg->obj = obj;
- return parg;
-}
-
-static PyObject *
-StructUnionType_new(PyTypeObject *type, PyObject *args, PyObject *kwds, int isStruct)
-{
- PyTypeObject *result;
- PyObject *fields;
- StgDictObject *dict;
-
- /* create the new instance (which is a class,
- since we are a metatype!) */
- result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
- if (!result)
- return NULL;
-
- /* keep this for bw compatibility */
- int r = PyDict_Contains(result->tp_dict, &_Py_ID(_abstract_));
- if (r > 0)
- return (PyObject *)result;
- if (r < 0) {
- Py_DECREF(result);
- return NULL;
- }
-
- dict = (StgDictObject *)_PyObject_CallNoArgs((PyObject *)&PyCStgDict_Type);
- if (!dict) {
- Py_DECREF(result);
- return NULL;
- }
- if (!isStruct) {
- dict->flags |= TYPEFLAG_HASUNION;
- }
- /* replace the class dict by our updated stgdict, which holds info
- about storage requirements of the instances */
- if (-1 == PyDict_Update((PyObject *)dict, result->tp_dict)) {
- Py_DECREF(result);
- Py_DECREF((PyObject *)dict);
- return NULL;
- }
- Py_SETREF(result->tp_dict, (PyObject *)dict);
- dict->format = _ctypes_alloc_format_string(NULL, "B");
- if (dict->format == NULL) {
- Py_DECREF(result);
- return NULL;
- }
-
- dict->paramfunc = StructUnionType_paramfunc;
-
- fields = PyDict_GetItemWithError((PyObject *)dict, &_Py_ID(_fields_));
- if (fields) {
- if (PyObject_SetAttr((PyObject *)result, &_Py_ID(_fields_), fields) < 0) {
- Py_DECREF(result);
- return NULL;
- }
- return (PyObject *)result;
- }
- else if (PyErr_Occurred()) {
- Py_DECREF(result);
- return NULL;
- }
- else {
- StgDictObject *basedict = PyType_stgdict((PyObject *)result->tp_base);
-
- if (basedict == NULL)
- return (PyObject *)result;
- /* copy base dict */
- if (-1 == PyCStgDict_clone(dict, basedict)) {
- Py_DECREF(result);
- return NULL;
- }
- dict->flags &= ~DICTFLAG_FINAL; /* clear the 'final' flag in the subclass dict */
- basedict->flags |= DICTFLAG_FINAL; /* set the 'final' flag in the baseclass dict */
- return (PyObject *)result;
- }
-}
-
-static PyObject *
-PyCStructType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- return StructUnionType_new(type, args, kwds, 1);
-}
-
-static PyObject *
-UnionType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- return StructUnionType_new(type, args, kwds, 0);
-}
-
-PyDoc_STRVAR(from_address_doc,
-"C.from_address(integer) -> C instance\naccess a C instance at the specified address");
-
-static PyObject *
-CDataType_from_address(PyObject *type, PyObject *value)
-{
- void *buf;
- if (!PyLong_Check(value)) {
- PyErr_SetString(PyExc_TypeError,
- "integer expected");
- return NULL;
- }
- buf = (void *)PyLong_AsVoidPtr(value);
- if (PyErr_Occurred())
- return NULL;
- return PyCData_AtAddress(type, buf);
-}
-
-PyDoc_STRVAR(from_buffer_doc,
-"C.from_buffer(object, offset=0) -> C instance\ncreate a C instance from a writeable buffer");
-
-static int
-KeepRef(CDataObject *target, Py_ssize_t index, PyObject *keep);
-
-static PyObject *
-CDataType_from_buffer(PyObject *type, PyObject *args)
-{
- PyObject *obj;
- PyObject *mv;
- PyObject *result;
- Py_buffer *buffer;
- Py_ssize_t offset = 0;
-
- StgDictObject *dict = PyType_stgdict(type);
- if (!dict) {
- PyErr_SetString(PyExc_TypeError, "abstract class");
- return NULL;
- }
-
- if (!PyArg_ParseTuple(args, "O|n:from_buffer", &obj, &offset))
- return NULL;
-
- mv = PyMemoryView_FromObject(obj);
- if (mv == NULL)
- return NULL;
-
- buffer = PyMemoryView_GET_BUFFER(mv);
-
- if (buffer->readonly) {
- PyErr_SetString(PyExc_TypeError,
- "underlying buffer is not writable");
- Py_DECREF(mv);
- return NULL;
- }
-
- if (!PyBuffer_IsContiguous(buffer, 'C')) {
- PyErr_SetString(PyExc_TypeError,
- "underlying buffer is not C contiguous");
- Py_DECREF(mv);
- return NULL;
- }
-
- if (offset < 0) {
- PyErr_SetString(PyExc_ValueError,
- "offset cannot be negative");
- Py_DECREF(mv);
- return NULL;
- }
-
- if (dict->size > buffer->len - offset) {
- PyErr_Format(PyExc_ValueError,
- "Buffer size too small "
- "(%zd instead of at least %zd bytes)",
- buffer->len, dict->size + offset);
- Py_DECREF(mv);
- return NULL;
- }
-
- if (PySys_Audit("ctypes.cdata/buffer", "nnn",
- (Py_ssize_t)buffer->buf, buffer->len, offset) < 0) {
- Py_DECREF(mv);
- return NULL;
- }
-
- result = PyCData_AtAddress(type, (char *)buffer->buf + offset);
- if (result == NULL) {
- Py_DECREF(mv);
- return NULL;
- }
-
- if (-1 == KeepRef((CDataObject *)result, -1, mv)) {
- Py_DECREF(result);
- return NULL;
- }
-
- return result;
-}
-
-PyDoc_STRVAR(from_buffer_copy_doc,
-"C.from_buffer_copy(object, offset=0) -> C instance\ncreate a C instance from a readable buffer");
-
-static PyObject *
-GenericPyCData_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
-
-static PyObject *
-CDataType_from_buffer_copy(PyObject *type, PyObject *args)
-{
- Py_buffer buffer;
- Py_ssize_t offset = 0;
- PyObject *result;
- StgDictObject *dict = PyType_stgdict(type);
- if (!dict) {
- PyErr_SetString(PyExc_TypeError, "abstract class");
- return NULL;
- }
-
- if (!PyArg_ParseTuple(args, "y*|n:from_buffer_copy", &buffer, &offset))
- return NULL;
-
- if (offset < 0) {
- PyErr_SetString(PyExc_ValueError,
- "offset cannot be negative");
- PyBuffer_Release(&buffer);
- return NULL;
- }
-
- if (dict->size > buffer.len - offset) {
- PyErr_Format(PyExc_ValueError,
- "Buffer size too small (%zd instead of at least %zd bytes)",
- buffer.len, dict->size + offset);
- PyBuffer_Release(&buffer);
- return NULL;
- }
-
- if (PySys_Audit("ctypes.cdata/buffer", "nnn",
- (Py_ssize_t)buffer.buf, buffer.len, offset) < 0) {
- PyBuffer_Release(&buffer);
- return NULL;
- }
-
- result = GenericPyCData_new((PyTypeObject *)type, NULL, NULL);
- if (result != NULL) {
- memcpy(((CDataObject *)result)->b_ptr,
- (char *)buffer.buf + offset, dict->size);
- }
- PyBuffer_Release(&buffer);
- return result;
-}
-
-PyDoc_STRVAR(in_dll_doc,
-"C.in_dll(dll, name) -> C instance\naccess a C instance in a dll");
-
-static PyObject *
-CDataType_in_dll(PyObject *type, PyObject *args)
-{
- PyObject *dll;
- char *name;
- PyObject *obj;
- void *handle;
- void *address;
-
- if (!PyArg_ParseTuple(args, "Os:in_dll", &dll, &name))
- return NULL;
- if (PySys_Audit("ctypes.dlsym", "O", args) < 0) {
- return NULL;
- }
-
- obj = PyObject_GetAttrString(dll, "_handle");
- if (!obj)
- return NULL;
- if (!PyLong_Check(obj)) {
- PyErr_SetString(PyExc_TypeError,
- "the _handle attribute of the second argument must be an integer");
- Py_DECREF(obj);
- return NULL;
- }
- handle = (void *)PyLong_AsVoidPtr(obj);
- Py_DECREF(obj);
- if (PyErr_Occurred()) {
- PyErr_SetString(PyExc_ValueError,
- "could not convert the _handle attribute to a pointer");
- return NULL;
- }
-
-#ifdef MS_WIN32
- Py_BEGIN_ALLOW_THREADS
- address = (void *)GetProcAddress(handle, name);
- Py_END_ALLOW_THREADS
- if (!address) {
- PyErr_Format(PyExc_ValueError,
- "symbol '%s' not found",
- name);
- return NULL;
- }
-#else
- address = (void *)dlsym(handle, name);
- if (!address) {
-#ifdef __CYGWIN__
-/* dlerror() isn't very helpful on cygwin */
- PyErr_Format(PyExc_ValueError,
- "symbol '%s' not found",
- name);
-#else
- PyErr_SetString(PyExc_ValueError, dlerror());
-#endif
- return NULL;
- }
-#endif
- return PyCData_AtAddress(type, address);
-}
-
-PyDoc_STRVAR(from_param_doc,
-"Convert a Python object into a function call parameter.");
-
-static PyObject *
-CDataType_from_param(PyObject *type, PyObject *value)
-{
- PyObject *as_parameter;
- int res = PyObject_IsInstance(value, type);
- if (res == -1)
- return NULL;
- if (res) {
- return Py_NewRef(value);
- }
- ctypes_state *st = GLOBAL_STATE();
- if (PyCArg_CheckExact(st, value)) {
- PyCArgObject *p = (PyCArgObject *)value;
- PyObject *ob = p->obj;
- const char *ob_name;
- StgDictObject *dict;
- dict = PyType_stgdict(type);
-
- /* If we got a PyCArgObject, we must check if the object packed in it
- is an instance of the type's dict->proto */
- if(dict && ob) {
- res = PyObject_IsInstance(ob, dict->proto);
- if (res == -1)
- return NULL;
- if (res) {
- return Py_NewRef(value);
- }
- }
- ob_name = (ob) ? Py_TYPE(ob)->tp_name : "???";
- PyErr_Format(PyExc_TypeError,
- "expected %s instance instead of pointer to %s",
- ((PyTypeObject *)type)->tp_name, ob_name);
- return NULL;
- }
-
- if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
- return NULL;
- }
- if (as_parameter) {
- value = CDataType_from_param(type, as_parameter);
- Py_DECREF(as_parameter);
- return value;
- }
- PyErr_Format(PyExc_TypeError,
- "expected %s instance instead of %s",
- ((PyTypeObject *)type)->tp_name,
- Py_TYPE(value)->tp_name);
- return NULL;
-}
-
-static PyMethodDef CDataType_methods[] = {
- { "from_param", CDataType_from_param, METH_O, from_param_doc },
- { "from_address", CDataType_from_address, METH_O, from_address_doc },
- { "from_buffer", CDataType_from_buffer, METH_VARARGS, from_buffer_doc, },
- { "from_buffer_copy", CDataType_from_buffer_copy, METH_VARARGS, from_buffer_copy_doc, },
- { "in_dll", CDataType_in_dll, METH_VARARGS, in_dll_doc },
- { NULL, NULL },
-};
-
-static PyObject *
-CDataType_repeat(PyObject *self, Py_ssize_t length)
-{
- if (length < 0)
- return PyErr_Format(PyExc_ValueError,
- "Array length must be >= 0, not %zd",
- length);
- return PyCArrayType_from_ctype(self, length);
-}
-
-static PySequenceMethods CDataType_as_sequence = {
- 0, /* inquiry sq_length; */
- 0, /* binaryfunc sq_concat; */
- CDataType_repeat, /* intargfunc sq_repeat; */
- 0, /* intargfunc sq_item; */
- 0, /* intintargfunc sq_slice; */
- 0, /* intobjargproc sq_ass_item; */
- 0, /* intintobjargproc sq_ass_slice; */
- 0, /* objobjproc sq_contains; */
-
- 0, /* binaryfunc sq_inplace_concat; */
- 0, /* intargfunc sq_inplace_repeat; */
-};
-
-static int
-CDataType_clear(PyTypeObject *self)
-{
- StgDictObject *dict = PyType_stgdict((PyObject *)self);
- if (dict)
- Py_CLEAR(dict->proto);
- return PyType_Type.tp_clear((PyObject *)self);
-}
-
-static int
-CDataType_traverse(PyTypeObject *self, visitproc visit, void *arg)
-{
- StgDictObject *dict = PyType_stgdict((PyObject *)self);
- if (dict)
- Py_VISIT(dict->proto);
- return PyType_Type.tp_traverse((PyObject *)self, visit, arg);
-}
-
-static int
-PyCStructType_setattro(PyObject *self, PyObject *key, PyObject *value)
-{
- /* XXX Should we disallow deleting _fields_? */
- if (-1 == PyType_Type.tp_setattro(self, key, value))
- return -1;
-
- if (value && PyUnicode_Check(key) &&
- _PyUnicode_EqualToASCIIString(key, "_fields_"))
- return PyCStructUnionType_update_stgdict(self, value, 1);
- return 0;
-}
-
-
-static int
-UnionType_setattro(PyObject *self, PyObject *key, PyObject *value)
-{
- /* XXX Should we disallow deleting _fields_? */
- if (-1 == PyObject_GenericSetAttr(self, key, value))
- return -1;
-
- if (PyUnicode_Check(key) &&
- _PyUnicode_EqualToASCIIString(key, "_fields_"))
- return PyCStructUnionType_update_stgdict(self, value, 0);
- return 0;
-}
-
-
-PyTypeObject PyCStructType_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_ctypes.PyCStructType", /* tp_name */
- 0, /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- &CDataType_as_sequence, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- PyCStructType_setattro, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
- PyDoc_STR("metatype for the CData Objects"), /* tp_doc */
- (traverseproc)CDataType_traverse, /* tp_traverse */
- (inquiry)CDataType_clear, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- CDataType_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- PyCStructType_new, /* tp_new */
- 0, /* tp_free */
-};
-
-static PyTypeObject UnionType_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_ctypes.UnionType", /* tp_name */
- 0, /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- &CDataType_as_sequence, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- UnionType_setattro, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
- PyDoc_STR("metatype for the CData Objects"), /* tp_doc */
- (traverseproc)CDataType_traverse, /* tp_traverse */
- (inquiry)CDataType_clear, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- CDataType_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- UnionType_new, /* tp_new */
- 0, /* tp_free */
-};
-
-
-/******************************************************************/
-
-/*
-
-The PyCPointerType_Type metaclass must ensure that the subclass of Pointer can be
-created. It must check for a _type_ attribute in the class. Since are no
-runtime created properties, a CField is probably *not* needed ?
-
-class IntPointer(Pointer):
- _type_ = "i"
-
-The PyCPointer_Type provides the functionality: a contents method/property, a
-size property/method, and the sequence protocol.
-
-*/
-
-static int
-PyCPointerType_SetProto(StgDictObject *stgdict, PyObject *proto)
-{
- if (!proto || !PyType_Check(proto)) {
- PyErr_SetString(PyExc_TypeError,
- "_type_ must be a type");
- return -1;
- }
- if (!PyType_stgdict(proto)) {
- PyErr_SetString(PyExc_TypeError,
- "_type_ must have storage info");
- return -1;
- }
- Py_INCREF(proto);
- Py_XSETREF(stgdict->proto, proto);
- return 0;
-}
-
-static PyCArgObject *
-PyCPointerType_paramfunc(CDataObject *self)
-{
- PyCArgObject *parg;
-
- parg = PyCArgObject_new();
- if (parg == NULL)
- return NULL;
-
- parg->tag = 'P';
- parg->pffi_type = &ffi_type_pointer;
- parg->obj = Py_NewRef(self);
- parg->value.p = *(void **)self->b_ptr;
- return parg;
-}
-
-static PyObject *
-PyCPointerType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- PyTypeObject *result;
- StgDictObject *stgdict;
- PyObject *proto;
- PyObject *typedict;
-
-
- typedict = PyTuple_GetItem(args, 2);
- if (!typedict)
- return NULL;
-/*
- stgdict items size, align, length contain info about pointers itself,
- stgdict->proto has info about the pointed to type!
-*/
- stgdict = (StgDictObject *)_PyObject_CallNoArgs(
- (PyObject *)&PyCStgDict_Type);
- if (!stgdict)
- return NULL;
- stgdict->size = sizeof(void *);
- stgdict->align = _ctypes_get_fielddesc("P")->pffi_type->alignment;
- stgdict->length = 1;
- stgdict->ffi_type_pointer = ffi_type_pointer;
- stgdict->paramfunc = PyCPointerType_paramfunc;
- stgdict->flags |= TYPEFLAG_ISPOINTER;
-
- proto = PyDict_GetItemWithError(typedict, &_Py_ID(_type_)); /* Borrowed ref */
- if (proto) {
- StgDictObject *itemdict;
- const char *current_format;
- if (-1 == PyCPointerType_SetProto(stgdict, proto)) {
- Py_DECREF((PyObject *)stgdict);
- return NULL;
- }
- itemdict = PyType_stgdict(proto);
- /* PyCPointerType_SetProto has verified proto has a stgdict. */
- assert(itemdict);
- /* If itemdict->format is NULL, then this is a pointer to an
- incomplete type. We create a generic format string
- 'pointer to bytes' in this case. XXX Better would be to
- fix the format string later...
- */
- current_format = itemdict->format ? itemdict->format : "B";
- if (itemdict->shape != NULL) {
- /* pointer to an array: the shape needs to be prefixed */
- stgdict->format = _ctypes_alloc_format_string_with_shape(
- itemdict->ndim, itemdict->shape, "&", current_format);
- } else {
- stgdict->format = _ctypes_alloc_format_string("&", current_format);
- }
- if (stgdict->format == NULL) {
- Py_DECREF((PyObject *)stgdict);
- return NULL;
- }
- }
- else if (PyErr_Occurred()) {
- Py_DECREF((PyObject *)stgdict);
- return NULL;
- }
-
- /* create the new instance (which is a class,
- since we are a metatype!) */
- result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
- if (result == NULL) {
- Py_DECREF((PyObject *)stgdict);
- return NULL;
- }
-
- /* replace the class dict by our updated spam dict */
- if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict)) {
- Py_DECREF(result);
- Py_DECREF((PyObject *)stgdict);
- return NULL;
- }
- Py_SETREF(result->tp_dict, (PyObject *)stgdict);
-
- return (PyObject *)result;
-}
-
-
-static PyObject *
-PyCPointerType_set_type(PyTypeObject *self, PyObject *type)
-{
- StgDictObject *dict;
-
-
- dict = PyType_stgdict((PyObject *)self);
- if (!dict) {
- PyErr_SetString(PyExc_TypeError,
- "abstract class");
- return NULL;
- }
-
- if (-1 == PyCPointerType_SetProto(dict, type))
- return NULL;
-
- if (-1 == PyDict_SetItem((PyObject *)dict, &_Py_ID(_type_), type))
- return NULL;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *_byref(PyObject *);
-
-static PyObject *
-PyCPointerType_from_param(PyObject *type, PyObject *value)
-{
- StgDictObject *typedict;
-
- if (value == Py_None) {
- /* ConvParam will convert to a NULL pointer later */
- return Py_NewRef(value);
- }
-
- typedict = PyType_stgdict(type);
- if (!typedict) {
- PyErr_SetString(PyExc_TypeError,
- "abstract class");
- return NULL;
- }
-
- /* If we expect POINTER(<type>), but receive a <type> instance, accept
- it by calling byref(<type>).
- */
- switch (PyObject_IsInstance(value, typedict->proto)) {
- case 1:
- Py_INCREF(value); /* _byref steals a refcount */
- return _byref(value);
- case -1:
- return NULL;
- default:
- break;
- }
-
- if (PointerObject_Check(value) || ArrayObject_Check(value)) {
- /* Array instances are also pointers when
- the item types are the same.
- */
- StgDictObject *v = PyObject_stgdict(value);
- assert(v); /* Cannot be NULL for pointer or array objects */
- int ret = PyObject_IsSubclass(v->proto, typedict->proto);
- if (ret < 0) {
- return NULL;
- }
- if (ret) {
- return Py_NewRef(value);
- }
- }
- return CDataType_from_param(type, value);
-}
-
-static PyMethodDef PyCPointerType_methods[] = {
- { "from_address", CDataType_from_address, METH_O, from_address_doc },
- { "from_buffer", CDataType_from_buffer, METH_VARARGS, from_buffer_doc, },
- { "from_buffer_copy", CDataType_from_buffer_copy, METH_VARARGS, from_buffer_copy_doc, },
- { "in_dll", CDataType_in_dll, METH_VARARGS, in_dll_doc},
- { "from_param", (PyCFunction)PyCPointerType_from_param, METH_O, from_param_doc},
- { "set_type", (PyCFunction)PyCPointerType_set_type, METH_O },
- { NULL, NULL },
-};
-
-PyTypeObject PyCPointerType_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_ctypes.PyCPointerType", /* tp_name */
- 0, /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- &CDataType_as_sequence, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
- PyDoc_STR("metatype for the Pointer Objects"), /* tp_doc */
- (traverseproc)CDataType_traverse, /* tp_traverse */
- (inquiry)CDataType_clear, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- PyCPointerType_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- PyCPointerType_new, /* tp_new */
- 0, /* tp_free */
-};
-
-
-/******************************************************************/
-/*
- PyCArrayType_Type
-*/
-/*
- PyCArrayType_new ensures that the new Array subclass created has a _length_
- attribute, and a _type_ attribute.
-*/
-
-static int
-CharArray_set_raw(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
-{
- char *ptr;
- Py_ssize_t size;
- Py_buffer view;
-
- if (value == NULL) {
- PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
- return -1;
- }
- if (PyObject_GetBuffer(value, &view, PyBUF_SIMPLE) < 0)
- return -1;
- size = view.len;
- ptr = view.buf;
- if (size > self->b_size) {
- PyErr_SetString(PyExc_ValueError,
- "byte string too long");
- goto fail;
- }
-
- memcpy(self->b_ptr, ptr, size);
-
- PyBuffer_Release(&view);
- return 0;
- fail:
- PyBuffer_Release(&view);
- return -1;
-}
-
-static PyObject *
-CharArray_get_raw(CDataObject *self, void *Py_UNUSED(ignored))
-{
- return PyBytes_FromStringAndSize(self->b_ptr, self->b_size);
-}
-
-static PyObject *
-CharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored))
-{
- Py_ssize_t i;
- char *ptr = self->b_ptr;
- for (i = 0; i < self->b_size; ++i)
- if (*ptr++ == '\0')
- break;
- return PyBytes_FromStringAndSize(self->b_ptr, i);
-}
-
-static int
-CharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
-{
- const char *ptr;
- Py_ssize_t size;
-
- if (value == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "can't delete attribute");
- return -1;
- }
-
- if (!PyBytes_Check(value)) {
- PyErr_Format(PyExc_TypeError,
- "bytes expected instead of %s instance",
- Py_TYPE(value)->tp_name);
- return -1;
- } else
- Py_INCREF(value);
- size = PyBytes_GET_SIZE(value);
- if (size > self->b_size) {
- PyErr_SetString(PyExc_ValueError,
- "byte string too long");
- Py_DECREF(value);
- return -1;
- }
-
- ptr = PyBytes_AS_STRING(value);
- memcpy(self->b_ptr, ptr, size);
- if (size < self->b_size)
- self->b_ptr[size] = '\0';
- Py_DECREF(value);
-
- return 0;
-}
-
-static PyGetSetDef CharArray_getsets[] = {
- { "raw", (getter)CharArray_get_raw, (setter)CharArray_set_raw,
- "value", NULL },
- { "value", (getter)CharArray_get_value, (setter)CharArray_set_value,
- "string value"},
- { NULL, NULL }
-};
-
-static PyObject *
-WCharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored))
-{
- Py_ssize_t i;
- wchar_t *ptr = (wchar_t *)self->b_ptr;
- for (i = 0; i < self->b_size/(Py_ssize_t)sizeof(wchar_t); ++i)
- if (*ptr++ == (wchar_t)0)
- break;
- return PyUnicode_FromWideChar((wchar_t *)self->b_ptr, i);
-}
-
-static int
-WCharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
-{
- if (value == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "can't delete attribute");
- return -1;
- }
- if (!PyUnicode_Check(value)) {
- PyErr_Format(PyExc_TypeError,
- "unicode string expected instead of %s instance",
- Py_TYPE(value)->tp_name);
- return -1;
- }
-
- Py_ssize_t size = self->b_size / sizeof(wchar_t);
- Py_ssize_t len = PyUnicode_AsWideChar(value, NULL, 0);
- if (len < 0) {
- return -1;
- }
- // PyUnicode_AsWideChar() returns number of wchars including trailing null byte,
- // when it is called with NULL.
- assert(len > 0);
- if (len - 1 > size) {
- PyErr_SetString(PyExc_ValueError, "string too long");
- return -1;
- }
- if (PyUnicode_AsWideChar(value, (wchar_t *)self->b_ptr, size) < 0) {
- return -1;
- }
- return 0;
-}
-
-static PyGetSetDef WCharArray_getsets[] = {
- { "value", (getter)WCharArray_get_value, (setter)WCharArray_set_value,
- "string value"},
- { NULL, NULL }
-};
-
-/*
- The next function is copied from Python's typeobject.c.
-
- It is used to attach getsets to a type *after* it
- has been created: Arrays of characters have additional getsets to treat them
- as strings.
- */
-
-static int
-add_getset(PyTypeObject *type, PyGetSetDef *gsp)
-{
- PyObject *dict = type->tp_dict;
- for (; gsp->name != NULL; gsp++) {
- PyObject *descr;
- descr = PyDescr_NewGetSet(type, gsp);
- if (descr == NULL)
- return -1;
- if (PyDict_SetItemString(dict, gsp->name, descr) < 0) {
- Py_DECREF(descr);
- return -1;
- }
- Py_DECREF(descr);
- }
- return 0;
-}
-
-static PyCArgObject *
-PyCArrayType_paramfunc(CDataObject *self)
-{
- PyCArgObject *p = PyCArgObject_new();
- if (p == NULL)
- return NULL;
- p->tag = 'P';
- p->pffi_type = &ffi_type_pointer;
- p->value.p = (char *)self->b_ptr;
- p->obj = Py_NewRef(self);
- return p;
-}
-
-static PyObject *
-PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- PyTypeObject *result;
- StgDictObject *stgdict;
- StgDictObject *itemdict;
- PyObject *length_attr, *type_attr;
- Py_ssize_t length;
- Py_ssize_t itemsize, itemalign;
-
- /* create the new instance (which is a class,
- since we are a metatype!) */
- result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
- if (result == NULL)
- return NULL;
-
- /* Initialize these variables to NULL so that we can simplify error
- handling by using Py_XDECREF. */
- stgdict = NULL;
- type_attr = NULL;
-
- if (_PyObject_LookupAttr((PyObject *)result, &_Py_ID(_length_), &length_attr) < 0) {
- goto error;
- }
- if (!length_attr) {
- PyErr_SetString(PyExc_AttributeError,
- "class must define a '_length_' attribute");
- goto error;
- }
-
- if (!PyLong_Check(length_attr)) {
- Py_DECREF(length_attr);
- PyErr_SetString(PyExc_TypeError,
- "The '_length_' attribute must be an integer");
- goto error;
- }
-
- if (_PyLong_Sign(length_attr) == -1) {
- Py_DECREF(length_attr);
- PyErr_SetString(PyExc_ValueError,
- "The '_length_' attribute must not be negative");
- goto error;
- }
-
- length = PyLong_AsSsize_t(length_attr);
- Py_DECREF(length_attr);
- if (length == -1 && PyErr_Occurred()) {
- if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
- PyErr_SetString(PyExc_OverflowError,
- "The '_length_' attribute is too large");
- }
- goto error;
- }
-
- if (_PyObject_LookupAttr((PyObject *)result, &_Py_ID(_type_), &type_attr) < 0) {
- goto error;
- }
- if (!type_attr) {
- PyErr_SetString(PyExc_AttributeError,
- "class must define a '_type_' attribute");
- goto error;
- }
-
- stgdict = (StgDictObject *)_PyObject_CallNoArgs(
- (PyObject *)&PyCStgDict_Type);
- if (!stgdict)
- goto error;
-
- itemdict = PyType_stgdict(type_attr);
- if (!itemdict) {
- PyErr_SetString(PyExc_TypeError,
- "_type_ must have storage info");
- goto error;
- }
-
- assert(itemdict->format);
- stgdict->format = _ctypes_alloc_format_string(NULL, itemdict->format);
- if (stgdict->format == NULL)
- goto error;
- stgdict->ndim = itemdict->ndim + 1;
- stgdict->shape = PyMem_Malloc(sizeof(Py_ssize_t) * stgdict->ndim);
- if (stgdict->shape == NULL) {
- PyErr_NoMemory();
- goto error;
- }
- stgdict->shape[0] = length;
- if (stgdict->ndim > 1) {
- memmove(&stgdict->shape[1], itemdict->shape,
- sizeof(Py_ssize_t) * (stgdict->ndim - 1));
- }
-
- itemsize = itemdict->size;
- if (itemsize != 0 && length > PY_SSIZE_T_MAX / itemsize) {
- PyErr_SetString(PyExc_OverflowError,
- "array too large");
- goto error;
- }
-
- itemalign = itemdict->align;
-
- if (itemdict->flags & (TYPEFLAG_ISPOINTER | TYPEFLAG_HASPOINTER))
- stgdict->flags |= TYPEFLAG_HASPOINTER;
-
- stgdict->size = itemsize * length;
- stgdict->align = itemalign;
- stgdict->length = length;
- stgdict->proto = type_attr;
- type_attr = NULL;
-
- stgdict->paramfunc = &PyCArrayType_paramfunc;
-
- /* Arrays are passed as pointers to function calls. */
- stgdict->ffi_type_pointer = ffi_type_pointer;
-
- /* replace the class dict by our updated spam dict */
- if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict))
- goto error;
- Py_SETREF(result->tp_dict, (PyObject *)stgdict); /* steal the reference */
- stgdict = NULL;
-
- /* Special case for character arrays.
- A permanent annoyance: char arrays are also strings!
- */
- if (itemdict->getfunc == _ctypes_get_fielddesc("c")->getfunc) {
- if (-1 == add_getset(result, CharArray_getsets))
- goto error;
- }
- else if (itemdict->getfunc == _ctypes_get_fielddesc("u")->getfunc) {
- if (-1 == add_getset(result, WCharArray_getsets))
- goto error;
- }
-
- return (PyObject *)result;
-error:
- Py_XDECREF((PyObject*)stgdict);
- Py_XDECREF(type_attr);
- Py_DECREF(result);
- return NULL;
-}
-
-PyTypeObject PyCArrayType_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_ctypes.PyCArrayType", /* tp_name */
- 0, /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- &CDataType_as_sequence, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- PyDoc_STR("metatype for the Array Objects"), /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- CDataType_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- PyCArrayType_new, /* tp_new */
- 0, /* tp_free */
-};
-
-
-/******************************************************************/
-/*
- PyCSimpleType_Type
-*/
-/*
-
-PyCSimpleType_new ensures that the new Simple_Type subclass created has a valid
-_type_ attribute.
-
-*/
-
-static const char SIMPLE_TYPE_CHARS[] = "cbBhHiIlLdfuzZqQPXOv?g";
-
-static PyObject *
-c_wchar_p_from_param(PyObject *type, PyObject *value)
-{
- PyObject *as_parameter;
- int res;
- if (value == Py_None) {
- Py_RETURN_NONE;
- }
- if (PyUnicode_Check(value)) {
- PyCArgObject *parg;
- struct fielddesc *fd = _ctypes_get_fielddesc("Z");
-
- parg = PyCArgObject_new();
- if (parg == NULL)
- return NULL;
- parg->pffi_type = &ffi_type_pointer;
- parg->tag = 'Z';
- parg->obj = fd->setfunc(&parg->value, value, 0);
- if (parg->obj == NULL) {
- Py_DECREF(parg);
- return NULL;
- }
- return (PyObject *)parg;
- }
- res = PyObject_IsInstance(value, type);
- if (res == -1)
- return NULL;
- if (res) {
- return Py_NewRef(value);
- }
- if (ArrayObject_Check(value) || PointerObject_Check(value)) {
- /* c_wchar array instance or pointer(c_wchar(...)) */
- StgDictObject *dt = PyObject_stgdict(value);
- StgDictObject *dict;
- assert(dt); /* Cannot be NULL for pointer or array objects */
- dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL;
- if (dict && (dict->setfunc == _ctypes_get_fielddesc("u")->setfunc)) {
- return Py_NewRef(value);
- }
- }
- ctypes_state *st = GLOBAL_STATE();
- if (PyCArg_CheckExact(st, value)) {
- /* byref(c_char(...)) */
- PyCArgObject *a = (PyCArgObject *)value;
- StgDictObject *dict = PyObject_stgdict(a->obj);
- if (dict && (dict->setfunc == _ctypes_get_fielddesc("u")->setfunc)) {
- return Py_NewRef(value);
- }
- }
-
- if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
- return NULL;
- }
- if (as_parameter) {
- value = c_wchar_p_from_param(type, as_parameter);
- Py_DECREF(as_parameter);
- return value;
- }
- /* XXX better message */
- PyErr_SetString(PyExc_TypeError,
- "wrong type");
- return NULL;
-}
-
-static PyObject *
-c_char_p_from_param(PyObject *type, PyObject *value)
-{
- PyObject *as_parameter;
- int res;
- if (value == Py_None) {
- Py_RETURN_NONE;
- }
- if (PyBytes_Check(value)) {
- PyCArgObject *parg;
- struct fielddesc *fd = _ctypes_get_fielddesc("z");
-
- parg = PyCArgObject_new();
- if (parg == NULL)
- return NULL;
- parg->pffi_type = &ffi_type_pointer;
- parg->tag = 'z';
- parg->obj = fd->setfunc(&parg->value, value, 0);
- if (parg->obj == NULL) {
- Py_DECREF(parg);
- return NULL;
- }
- return (PyObject *)parg;
- }
- res = PyObject_IsInstance(value, type);
- if (res == -1)
- return NULL;
- if (res) {
- return Py_NewRef(value);
- }
- if (ArrayObject_Check(value) || PointerObject_Check(value)) {
- /* c_char array instance or pointer(c_char(...)) */
- StgDictObject *dt = PyObject_stgdict(value);
- StgDictObject *dict;
- assert(dt); /* Cannot be NULL for pointer or array objects */
- dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL;
- if (dict && (dict->setfunc == _ctypes_get_fielddesc("c")->setfunc)) {
- return Py_NewRef(value);
- }
- }
- ctypes_state *st = GLOBAL_STATE();
- if (PyCArg_CheckExact(st, value)) {
- /* byref(c_char(...)) */
- PyCArgObject *a = (PyCArgObject *)value;
- StgDictObject *dict = PyObject_stgdict(a->obj);
- if (dict && (dict->setfunc == _ctypes_get_fielddesc("c")->setfunc)) {
- return Py_NewRef(value);
- }
- }
-
- if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
- return NULL;
- }
- if (as_parameter) {
- value = c_char_p_from_param(type, as_parameter);
- Py_DECREF(as_parameter);
- return value;
- }
- /* XXX better message */
- PyErr_SetString(PyExc_TypeError,
- "wrong type");
- return NULL;
-}
-
-static PyObject *
-c_void_p_from_param(PyObject *type, PyObject *value)
-{
- StgDictObject *stgd;
- PyObject *as_parameter;
- int res;
-
-/* None */
- if (value == Py_None) {
- Py_RETURN_NONE;
- }
- /* Should probably allow buffer interface as well */
-/* int, long */
- if (PyLong_Check(value)) {
- PyCArgObject *parg;
- struct fielddesc *fd = _ctypes_get_fielddesc("P");
-
- parg = PyCArgObject_new();
- if (parg == NULL)
- return NULL;
- parg->pffi_type = &ffi_type_pointer;
- parg->tag = 'P';
- parg->obj = fd->setfunc(&parg->value, value, 0);
- if (parg->obj == NULL) {
- Py_DECREF(parg);
- return NULL;
- }
- return (PyObject *)parg;
- }
- /* XXX struni: remove later */
-/* bytes */
- if (PyBytes_Check(value)) {
- PyCArgObject *parg;
- struct fielddesc *fd = _ctypes_get_fielddesc("z");
-
- parg = PyCArgObject_new();
- if (parg == NULL)
- return NULL;
- parg->pffi_type = &ffi_type_pointer;
- parg->tag = 'z';
- parg->obj = fd->setfunc(&parg->value, value, 0);
- if (parg->obj == NULL) {
- Py_DECREF(parg);
- return NULL;
- }
- return (PyObject *)parg;
- }
-/* unicode */
- if (PyUnicode_Check(value)) {
- PyCArgObject *parg;
- struct fielddesc *fd = _ctypes_get_fielddesc("Z");
-
- parg = PyCArgObject_new();
- if (parg == NULL)
- return NULL;
- parg->pffi_type = &ffi_type_pointer;
- parg->tag = 'Z';
- parg->obj = fd->setfunc(&parg->value, value, 0);
- if (parg->obj == NULL) {
- Py_DECREF(parg);
- return NULL;
- }
- return (PyObject *)parg;
- }
-/* c_void_p instance (or subclass) */
- res = PyObject_IsInstance(value, type);
- if (res == -1)
- return NULL;
- if (res) {
- /* c_void_p instances */
- return Py_NewRef(value);
- }
-/* ctypes array or pointer instance */
- if (ArrayObject_Check(value) || PointerObject_Check(value)) {
- /* Any array or pointer is accepted */
- return Py_NewRef(value);
- }
-/* byref(...) */
- ctypes_state *st = GLOBAL_STATE();
- if (PyCArg_CheckExact(st, value)) {
- /* byref(c_xxx()) */
- PyCArgObject *a = (PyCArgObject *)value;
- if (a->tag == 'P') {
- return Py_NewRef(value);
- }
- }
-/* function pointer */
- if (PyCFuncPtrObject_Check(value)) {
- PyCArgObject *parg;
- PyCFuncPtrObject *func;
- func = (PyCFuncPtrObject *)value;
- parg = PyCArgObject_new();
- if (parg == NULL)
- return NULL;
- parg->pffi_type = &ffi_type_pointer;
- parg->tag = 'P';
- Py_INCREF(value);
- parg->value.p = *(void **)func->b_ptr;
- parg->obj = value;
- return (PyObject *)parg;
- }
-/* c_char_p, c_wchar_p */
- stgd = PyObject_stgdict(value);
- if (stgd && CDataObject_Check(value) && stgd->proto && PyUnicode_Check(stgd->proto)) {
- PyCArgObject *parg;
-
- switch (PyUnicode_AsUTF8(stgd->proto)[0]) {
- case 'z': /* c_char_p */
- case 'Z': /* c_wchar_p */
- parg = PyCArgObject_new();
- if (parg == NULL)
- return NULL;
- parg->pffi_type = &ffi_type_pointer;
- parg->tag = 'Z';
- parg->obj = Py_NewRef(value);
- /* Remember: b_ptr points to where the pointer is stored! */
- parg->value.p = *(void **)(((CDataObject *)value)->b_ptr);
- return (PyObject *)parg;
- }
- }
-
- if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
- return NULL;
- }
- if (as_parameter) {
- value = c_void_p_from_param(type, as_parameter);
- Py_DECREF(as_parameter);
- return value;
- }
- /* XXX better message */
- PyErr_SetString(PyExc_TypeError,
- "wrong type");
- return NULL;
-}
-
-static PyMethodDef c_void_p_method = { "from_param", c_void_p_from_param, METH_O };
-static PyMethodDef c_char_p_method = { "from_param", c_char_p_from_param, METH_O };
-static PyMethodDef c_wchar_p_method = { "from_param", c_wchar_p_from_param, METH_O };
-
-static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject *kwds,
- PyObject *proto, struct fielddesc *fmt)
-{
- PyTypeObject *result;
- StgDictObject *stgdict;
- PyObject *name = PyTuple_GET_ITEM(args, 0);
- PyObject *newname;
- PyObject *swapped_args;
- static PyObject *suffix;
- Py_ssize_t i;
-
- swapped_args = PyTuple_New(PyTuple_GET_SIZE(args));
- if (!swapped_args)
- return NULL;
-
- if (suffix == NULL)
-#ifdef WORDS_BIGENDIAN
- suffix = PyUnicode_InternFromString("_le");
-#else
- suffix = PyUnicode_InternFromString("_be");
-#endif
- if (suffix == NULL) {
- Py_DECREF(swapped_args);
- return NULL;
- }
-
- newname = PyUnicode_Concat(name, suffix);
- if (newname == NULL) {
- Py_DECREF(swapped_args);
- return NULL;
- }
-
- PyTuple_SET_ITEM(swapped_args, 0, newname);
- for (i=1; i<PyTuple_GET_SIZE(args); ++i) {
- PyObject *v = PyTuple_GET_ITEM(args, i);
- Py_INCREF(v);
- PyTuple_SET_ITEM(swapped_args, i, v);
- }
-
- /* create the new instance (which is a class,
- since we are a metatype!) */
- result = (PyTypeObject *)PyType_Type.tp_new(type, swapped_args, kwds);
- Py_DECREF(swapped_args);
- if (result == NULL)
- return NULL;
-
- stgdict = (StgDictObject *)_PyObject_CallNoArgs(
- (PyObject *)&PyCStgDict_Type);
- if (!stgdict) {
- Py_DECREF(result);
- return NULL;
- }
-
- stgdict->ffi_type_pointer = *fmt->pffi_type;
- stgdict->align = fmt->pffi_type->alignment;
- stgdict->length = 0;
- stgdict->size = fmt->pffi_type->size;
- stgdict->setfunc = fmt->setfunc_swapped;
- stgdict->getfunc = fmt->getfunc_swapped;
-
- stgdict->proto = Py_NewRef(proto);
-
- /* replace the class dict by our updated spam dict */
- if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict)) {
- Py_DECREF(result);
- Py_DECREF((PyObject *)stgdict);
- return NULL;
- }
- Py_SETREF(result->tp_dict, (PyObject *)stgdict);
-
- return (PyObject *)result;
-}
-
-static PyCArgObject *
-PyCSimpleType_paramfunc(CDataObject *self)
-{
- StgDictObject *dict;
- const char *fmt;
- PyCArgObject *parg;
- struct fielddesc *fd;
-
- dict = PyObject_stgdict((PyObject *)self);
- assert(dict); /* Cannot be NULL for CDataObject instances */
- fmt = PyUnicode_AsUTF8(dict->proto);
- assert(fmt);
-
- fd = _ctypes_get_fielddesc(fmt);
- assert(fd);
-
- parg = PyCArgObject_new();
- if (parg == NULL)
- return NULL;
-
- parg->tag = fmt[0];
- parg->pffi_type = fd->pffi_type;
- parg->obj = Py_NewRef(self);
- memcpy(&parg->value, self->b_ptr, self->b_size);
- return parg;
-}
-
-static PyObject *
-PyCSimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- PyTypeObject *result;
- StgDictObject *stgdict;
- PyObject *proto;
- const char *proto_str;
- Py_ssize_t proto_len;
- PyMethodDef *ml;
- struct fielddesc *fmt;
-
- /* create the new instance (which is a class,
- since we are a metatype!) */
- result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
- if (result == NULL)
- return NULL;
-
- if (_PyObject_LookupAttr((PyObject *)result, &_Py_ID(_type_), &proto) < 0) {
- return NULL;
- }
- if (!proto) {
- PyErr_SetString(PyExc_AttributeError,
- "class must define a '_type_' attribute");
- error:
- Py_XDECREF(proto);
- Py_DECREF(result);
- return NULL;
- }
- if (PyUnicode_Check(proto)) {
- proto_str = PyUnicode_AsUTF8AndSize(proto, &proto_len);
- if (!proto_str)
- goto error;
- } else {
- PyErr_SetString(PyExc_TypeError,
- "class must define a '_type_' string attribute");
- goto error;
- }
- if (proto_len != 1) {
- PyErr_SetString(PyExc_ValueError,
- "class must define a '_type_' attribute "
- "which must be a string of length 1");
- goto error;
- }
- if (!strchr(SIMPLE_TYPE_CHARS, *proto_str)) {
- PyErr_Format(PyExc_AttributeError,
- "class must define a '_type_' attribute which must be\n"
- "a single character string containing one of '%s'.",
- SIMPLE_TYPE_CHARS);
- goto error;
- }
- fmt = _ctypes_get_fielddesc(proto_str);
- if (fmt == NULL) {
- PyErr_Format(PyExc_ValueError,
- "_type_ '%s' not supported", proto_str);
- goto error;
- }
-
- stgdict = (StgDictObject *)_PyObject_CallNoArgs(
- (PyObject *)&PyCStgDict_Type);
- if (!stgdict)
- goto error;
-
- stgdict->ffi_type_pointer = *fmt->pffi_type;
- stgdict->align = fmt->pffi_type->alignment;
- stgdict->length = 0;
- stgdict->size = fmt->pffi_type->size;
- stgdict->setfunc = fmt->setfunc;
- stgdict->getfunc = fmt->getfunc;
-#ifdef WORDS_BIGENDIAN
- stgdict->format = _ctypes_alloc_format_string_for_type(proto_str[0], 1);
-#else
- stgdict->format = _ctypes_alloc_format_string_for_type(proto_str[0], 0);
-#endif
- if (stgdict->format == NULL) {
- Py_DECREF(result);
- Py_DECREF(proto);
- Py_DECREF((PyObject *)stgdict);
- return NULL;
- }
-
- stgdict->paramfunc = PyCSimpleType_paramfunc;
-/*
- if (result->tp_base != &Simple_Type) {
- stgdict->setfunc = NULL;
- stgdict->getfunc = NULL;
- }
-*/
-
- /* This consumes the refcount on proto which we have */
- stgdict->proto = proto;
-
- /* replace the class dict by our updated spam dict */
- if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict)) {
- Py_DECREF(result);
- Py_DECREF((PyObject *)stgdict);
- return NULL;
- }
- Py_SETREF(result->tp_dict, (PyObject *)stgdict);
-
- /* Install from_param class methods in ctypes base classes.
- Overrides the PyCSimpleType_from_param generic method.
- */
- if (result->tp_base == &Simple_Type) {
- switch (*proto_str) {
- case 'z': /* c_char_p */
- ml = &c_char_p_method;
- stgdict->flags |= TYPEFLAG_ISPOINTER;
- break;
- case 'Z': /* c_wchar_p */
- ml = &c_wchar_p_method;
- stgdict->flags |= TYPEFLAG_ISPOINTER;
- break;
- case 'P': /* c_void_p */
- ml = &c_void_p_method;
- stgdict->flags |= TYPEFLAG_ISPOINTER;
- break;
- case 's':
- case 'X':
- case 'O':
- ml = NULL;
- stgdict->flags |= TYPEFLAG_ISPOINTER;
- break;
- default:
- ml = NULL;
- break;
- }
-
- if (ml) {
- PyObject *meth;
- int x;
- meth = PyDescr_NewClassMethod(result, ml);
- if (!meth) {
- Py_DECREF(result);
- return NULL;
- }
- x = PyDict_SetItemString(result->tp_dict,
- ml->ml_name,
- meth);
- Py_DECREF(meth);
- if (x == -1) {
- Py_DECREF(result);
- return NULL;
- }
- }
- }
-
- if (type == &PyCSimpleType_Type && fmt->setfunc_swapped && fmt->getfunc_swapped) {
- PyObject *swapped = CreateSwappedType(type, args, kwds,
- proto, fmt);
- StgDictObject *sw_dict;
- if (swapped == NULL) {
- Py_DECREF(result);
- return NULL;
- }
- sw_dict = PyType_stgdict(swapped);
-#ifdef WORDS_BIGENDIAN
- PyObject_SetAttrString((PyObject *)result, "__ctype_le__", swapped);
- PyObject_SetAttrString((PyObject *)result, "__ctype_be__", (PyObject *)result);
- PyObject_SetAttrString(swapped, "__ctype_be__", (PyObject *)result);
- PyObject_SetAttrString(swapped, "__ctype_le__", swapped);
- /* We are creating the type for the OTHER endian */
- sw_dict->format = _ctypes_alloc_format_string("<", stgdict->format+1);
-#else
- PyObject_SetAttrString((PyObject *)result, "__ctype_be__", swapped);
- PyObject_SetAttrString((PyObject *)result, "__ctype_le__", (PyObject *)result);
- PyObject_SetAttrString(swapped, "__ctype_le__", (PyObject *)result);
- PyObject_SetAttrString(swapped, "__ctype_be__", swapped);
- /* We are creating the type for the OTHER endian */
- sw_dict->format = _ctypes_alloc_format_string(">", stgdict->format+1);
-#endif
- Py_DECREF(swapped);
- if (PyErr_Occurred()) {
- Py_DECREF(result);
- return NULL;
- }
- };
-
- return (PyObject *)result;
-}
-
-/*
- * This is a *class method*.
- * Convert a parameter into something that ConvParam can handle.
- */
-static PyObject *
-PyCSimpleType_from_param(PyObject *type, PyObject *value)
-{
- StgDictObject *dict;
- const char *fmt;
- PyCArgObject *parg;
- struct fielddesc *fd;
- PyObject *as_parameter;
- int res;
-
- /* If the value is already an instance of the requested type,
- we can use it as is */
- res = PyObject_IsInstance(value, type);
- if (res == -1)
- return NULL;
- if (res) {
- return Py_NewRef(value);
- }
-
- dict = PyType_stgdict(type);
- if (!dict) {
- PyErr_SetString(PyExc_TypeError,
- "abstract class");
- return NULL;
- }
-
- /* I think we can rely on this being a one-character string */
- fmt = PyUnicode_AsUTF8(dict->proto);
- assert(fmt);
-
- fd = _ctypes_get_fielddesc(fmt);
- assert(fd);
-
- parg = PyCArgObject_new();
- if (parg == NULL)
- return NULL;
-
- parg->tag = fmt[0];
- parg->pffi_type = fd->pffi_type;
- parg->obj = fd->setfunc(&parg->value, value, 0);
- if (parg->obj)
- return (PyObject *)parg;
- PyObject *exc = PyErr_GetRaisedException();
- Py_DECREF(parg);
-
- if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
- Py_XDECREF(exc);
- return NULL;
- }
- if (as_parameter) {
- if (_Py_EnterRecursiveCall("while processing _as_parameter_")) {
- Py_DECREF(as_parameter);
- Py_XDECREF(exc);
- return NULL;
- }
- value = PyCSimpleType_from_param(type, as_parameter);
- _Py_LeaveRecursiveCall();
- Py_DECREF(as_parameter);
- Py_XDECREF(exc);
- return value;
- }
- if (exc) {
- PyErr_SetRaisedException(exc);
- }
- else {
- PyErr_SetString(PyExc_TypeError, "wrong type");
- }
- return NULL;
-}
-
-static PyMethodDef PyCSimpleType_methods[] = {
- { "from_param", PyCSimpleType_from_param, METH_O, from_param_doc },
- { "from_address", CDataType_from_address, METH_O, from_address_doc },
- { "from_buffer", CDataType_from_buffer, METH_VARARGS, from_buffer_doc, },
- { "from_buffer_copy", CDataType_from_buffer_copy, METH_VARARGS, from_buffer_copy_doc, },
- { "in_dll", CDataType_in_dll, METH_VARARGS, in_dll_doc},
- { NULL, NULL },
-};
-
-PyTypeObject PyCSimpleType_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_ctypes.PyCSimpleType", /* tp_name */
- 0, /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- &CDataType_as_sequence, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- PyDoc_STR("metatype for the PyCSimpleType Objects"), /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- PyCSimpleType_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- PyCSimpleType_new, /* tp_new */
- 0, /* tp_free */
-};
-
-/******************************************************************/
-/*
- PyCFuncPtrType_Type
- */
-
-static PyObject *
-converters_from_argtypes(PyObject *ob)
-{
- PyObject *converters;
- Py_ssize_t i;
-
- ob = PySequence_Tuple(ob); /* new reference */
- if (!ob) {
- PyErr_SetString(PyExc_TypeError,
- "_argtypes_ must be a sequence of types");
- return NULL;
- }
-
- Py_ssize_t nArgs = PyTuple_GET_SIZE(ob);
- if (nArgs > CTYPES_MAX_ARGCOUNT) {
- Py_DECREF(ob);
- PyErr_Format(PyExc_ArgError,
- "_argtypes_ has too many arguments (%zi), maximum is %i",
- nArgs, CTYPES_MAX_ARGCOUNT);
- return NULL;
- }
-
- converters = PyTuple_New(nArgs);
- if (!converters) {
- Py_DECREF(ob);
- return NULL;
- }
-
- /* I have to check if this is correct. Using c_char, which has a size
- of 1, will be assumed to be pushed as only one byte!
- Aren't these promoted to integers by the C compiler and pushed as 4 bytes?
- */
-
- for (i = 0; i < nArgs; ++i) {
- PyObject *cnv;
- PyObject *tp = PyTuple_GET_ITEM(ob, i);
-/*
- * The following checks, relating to bpo-16575 and bpo-16576, have been
- * disabled. The reason is that, although there is a definite problem with
- * how libffi handles unions (https://github.com/libffi/libffi/issues/33),
- * there are numerous libraries which pass structures containing unions
- * by values - especially on Windows but examples also exist on Linux
- * (https://bugs.python.org/msg359834).
- *
- * It may not be possible to get proper support for unions and bitfields
- * until support is forthcoming in libffi, but for now, adding the checks
- * has caused problems in otherwise-working software, which suggests it
- * is better to disable the checks.
- *
- * Although specific examples reported relate specifically to unions and
- * not bitfields, the bitfields check is also being disabled as a
- * precaution.
-
- StgDictObject *stgdict = PyType_stgdict(tp);
-
- if (stgdict != NULL) {
- if (stgdict->flags & TYPEFLAG_HASUNION) {
- Py_DECREF(converters);
- Py_DECREF(ob);
- if (!PyErr_Occurred()) {
- PyErr_Format(PyExc_TypeError,
- "item %zd in _argtypes_ passes a union by "
- "value, which is unsupported.",
- i + 1);
- }
- return NULL;
- }
- if (stgdict->flags & TYPEFLAG_HASBITFIELD) {
- Py_DECREF(converters);
- Py_DECREF(ob);
- if (!PyErr_Occurred()) {
- PyErr_Format(PyExc_TypeError,
- "item %zd in _argtypes_ passes a struct/"
- "union with a bitfield by value, which is "
- "unsupported.",
- i + 1);
- }
- return NULL;
- }
- }
- */
-
- if (_PyObject_LookupAttr(tp, &_Py_ID(from_param), &cnv) <= 0) {
- Py_DECREF(converters);
- Py_DECREF(ob);
- if (!PyErr_Occurred()) {
- PyErr_Format(PyExc_TypeError,
- "item %zd in _argtypes_ has no from_param method",
- i+1);
- }
- return NULL;
- }
- PyTuple_SET_ITEM(converters, i, cnv);
- }
- Py_DECREF(ob);
- return converters;
-}
-
-static int
-make_funcptrtype_dict(StgDictObject *stgdict)
-{
- PyObject *ob;
- PyObject *converters = NULL;
-
- stgdict->align = _ctypes_get_fielddesc("P")->pffi_type->alignment;
- stgdict->length = 1;
- stgdict->size = sizeof(void *);
- stgdict->setfunc = NULL;
- stgdict->getfunc = NULL;
- stgdict->ffi_type_pointer = ffi_type_pointer;
-
- ob = PyDict_GetItemWithError((PyObject *)stgdict, &_Py_ID(_flags_));
- if (!ob || !PyLong_Check(ob)) {
- if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_TypeError,
- "class must define _flags_ which must be an integer");
- }
- return -1;
- }
- stgdict->flags = PyLong_AsUnsignedLongMask(ob) | TYPEFLAG_ISPOINTER;
-
- /* _argtypes_ is optional... */
- ob = PyDict_GetItemWithError((PyObject *)stgdict, &_Py_ID(_argtypes_));
- if (ob) {
- converters = converters_from_argtypes(ob);
- if (!converters)
- return -1;
- stgdict->argtypes = Py_NewRef(ob);
- stgdict->converters = converters;
- }
- else if (PyErr_Occurred()) {
- return -1;
- }
-
- ob = PyDict_GetItemWithError((PyObject *)stgdict, &_Py_ID(_restype_));
- if (ob) {
- if (ob != Py_None && !PyType_stgdict(ob) && !PyCallable_Check(ob)) {
- PyErr_SetString(PyExc_TypeError,
- "_restype_ must be a type, a callable, or None");
- return -1;
- }
- stgdict->restype = Py_NewRef(ob);
- if (_PyObject_LookupAttr(ob, &_Py_ID(_check_retval_),
- &stgdict->checker) < 0)
- {
- return -1;
- }
- }
- else if (PyErr_Occurred()) {
- return -1;
- }
-/* XXX later, maybe.
- ob = _PyDict_GetItemIdWithError((PyObject *)stgdict, &PyId__errcheck_);
- if (ob) {
- if (!PyCallable_Check(ob)) {
- PyErr_SetString(PyExc_TypeError,
- "_errcheck_ must be callable");
- return -1;
- }
- stgdict->errcheck = Py_NewRef(ob);
- }
- else if (PyErr_Occurred()) {
- return -1;
- }
-*/
- return 0;
-}
-
-static PyCArgObject *
-PyCFuncPtrType_paramfunc(CDataObject *self)
-{
- PyCArgObject *parg;
-
- parg = PyCArgObject_new();
- if (parg == NULL)
- return NULL;
-
- parg->tag = 'P';
- parg->pffi_type = &ffi_type_pointer;
- parg->obj = Py_NewRef(self);
- parg->value.p = *(void **)self->b_ptr;
- return parg;
-}
-
-static PyObject *
-PyCFuncPtrType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- PyTypeObject *result;
- StgDictObject *stgdict;
-
- stgdict = (StgDictObject *)_PyObject_CallNoArgs(
- (PyObject *)&PyCStgDict_Type);
- if (!stgdict)
- return NULL;
-
- stgdict->paramfunc = PyCFuncPtrType_paramfunc;
- /* We do NOT expose the function signature in the format string. It
- is impossible, generally, because the only requirement for the
- argtypes items is that they have a .from_param method - we do not
- know the types of the arguments (although, in practice, most
- argtypes would be a ctypes type).
- */
- stgdict->format = _ctypes_alloc_format_string(NULL, "X{}");
- if (stgdict->format == NULL) {
- Py_DECREF((PyObject *)stgdict);
- return NULL;
- }
- stgdict->flags |= TYPEFLAG_ISPOINTER;
-
- /* create the new instance (which is a class,
- since we are a metatype!) */
- result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
- if (result == NULL) {
- Py_DECREF((PyObject *)stgdict);
- return NULL;
- }
-
- /* replace the class dict by our updated storage dict */
- if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict)) {
- Py_DECREF(result);
- Py_DECREF((PyObject *)stgdict);
- return NULL;
- }
- Py_SETREF(result->tp_dict, (PyObject *)stgdict);
-
- if (-1 == make_funcptrtype_dict(stgdict)) {
- Py_DECREF(result);
- return NULL;
- }
-
- return (PyObject *)result;
-}
-
-PyTypeObject PyCFuncPtrType_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_ctypes.PyCFuncPtrType", /* tp_name */
- 0, /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- &CDataType_as_sequence, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
- PyDoc_STR("metatype for C function pointers"), /* tp_doc */
- (traverseproc)CDataType_traverse, /* tp_traverse */
- (inquiry)CDataType_clear, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- CDataType_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- PyCFuncPtrType_new, /* tp_new */
- 0, /* tp_free */
-};
-
-
-/*****************************************************************
- * Code to keep needed objects alive
- */
-
-static CDataObject *
-PyCData_GetContainer(CDataObject *self)
-{
- while (self->b_base)
- self = self->b_base;
- if (self->b_objects == NULL) {
- if (self->b_length) {
- self->b_objects = PyDict_New();
- if (self->b_objects == NULL)
- return NULL;
- } else {
- self->b_objects = Py_NewRef(Py_None);
- }
- }
- return self;
-}
-
-static PyObject *
-GetKeepedObjects(CDataObject *target)
-{
- CDataObject *container;
- container = PyCData_GetContainer(target);
- if (container == NULL)
- return NULL;
- return container->b_objects;
-}
-
-static PyObject *
-unique_key(CDataObject *target, Py_ssize_t index)
-{
- char string[256];
- char *cp = string;
- size_t bytes_left;
-
- Py_BUILD_ASSERT(sizeof(string) - 1 > sizeof(Py_ssize_t) * 2);
- cp += sprintf(cp, "%x", Py_SAFE_DOWNCAST(index, Py_ssize_t, int));
- while (target->b_base) {
- bytes_left = sizeof(string) - (cp - string) - 1;
- /* Hex format needs 2 characters per byte */
- if (bytes_left < sizeof(Py_ssize_t) * 2) {
- PyErr_SetString(PyExc_ValueError,
- "ctypes object structure too deep");
- return NULL;
- }
- cp += sprintf(cp, ":%x", Py_SAFE_DOWNCAST(target->b_index, Py_ssize_t, int));
- target = target->b_base;
- }
- return PyUnicode_FromStringAndSize(string, cp-string);
-}
-
-/*
- * Keep a reference to 'keep' in the 'target', at index 'index'.
- *
- * If 'keep' is None, do nothing.
- *
- * Otherwise create a dictionary (if it does not yet exist) id the root
- * objects 'b_objects' item, which will store the 'keep' object under a unique
- * key.
- *
- * The unique_key helper travels the target's b_base pointer down to the root,
- * building a string containing hex-formatted indexes found during traversal,
- * separated by colons.
- *
- * The index tuple is used as a key into the root object's b_objects dict.
- *
- * Note: This function steals a refcount of the third argument, even if it
- * fails!
- */
-static int
-KeepRef(CDataObject *target, Py_ssize_t index, PyObject *keep)
-{
- int result;
- CDataObject *ob;
- PyObject *key;
-
-/* Optimization: no need to store None */
- if (keep == Py_None) {
- Py_DECREF(Py_None);
- return 0;
- }
- ob = PyCData_GetContainer(target);
- if (ob == NULL) {
- Py_DECREF(keep);
- return -1;
- }
- if (ob->b_objects == NULL || !PyDict_CheckExact(ob->b_objects)) {
- Py_XSETREF(ob->b_objects, keep); /* refcount consumed */
- return 0;
- }
- key = unique_key(target, index);
- if (key == NULL) {
- Py_DECREF(keep);
- return -1;
- }
- result = PyDict_SetItem(ob->b_objects, key, keep);
- Py_DECREF(key);
- Py_DECREF(keep);
- return result;
-}
-
-/******************************************************************/
-/*
- PyCData_Type
- */
-static int
-PyCData_traverse(CDataObject *self, visitproc visit, void *arg)
-{
- Py_VISIT(self->b_objects);
- Py_VISIT((PyObject *)self->b_base);
- return 0;
-}
-
-static int
-PyCData_clear(CDataObject *self)
-{
- Py_CLEAR(self->b_objects);
- if ((self->b_needsfree)
- && _CDataObject_HasExternalBuffer(self))
- PyMem_Free(self->b_ptr);
- self->b_ptr = NULL;
- Py_CLEAR(self->b_base);
- return 0;
-}
-
-static void
-PyCData_dealloc(PyObject *self)
-{
- PyCData_clear((CDataObject *)self);
- Py_TYPE(self)->tp_free(self);
-}
-
-static PyMemberDef PyCData_members[] = {
- { "_b_base_", T_OBJECT,
- offsetof(CDataObject, b_base), READONLY,
- "the base object" },
- { "_b_needsfree_", T_INT,
- offsetof(CDataObject, b_needsfree), READONLY,
- "whether the object owns the memory or not" },
- { "_objects", T_OBJECT,
- offsetof(CDataObject, b_objects), READONLY,
- "internal objects tree (NEVER CHANGE THIS OBJECT!)"},
- { NULL },
-};
-
-/* Find the innermost type of an array type, returning a borrowed reference */
-static PyObject *
-PyCData_item_type(PyObject *type)
-{
- if (PyCArrayTypeObject_Check(type)) {
- StgDictObject *stg_dict;
- PyObject *elem_type;
-
- /* asserts used here as these are all guaranteed by construction */
- stg_dict = PyType_stgdict(type);
- assert(stg_dict);
- elem_type = stg_dict->proto;
- assert(elem_type);
- return PyCData_item_type(elem_type);
- }
- else {
- return type;
- }
-}
-
-static int
-PyCData_NewGetBuffer(PyObject *myself, Py_buffer *view, int flags)
-{
- CDataObject *self = (CDataObject *)myself;
- StgDictObject *dict = PyObject_stgdict(myself);
- PyObject *item_type = PyCData_item_type((PyObject*)Py_TYPE(myself));
- StgDictObject *item_dict = PyType_stgdict(item_type);
-
- if (view == NULL) return 0;
-
- view->buf = self->b_ptr;
- view->obj = Py_NewRef(myself);
- view->len = self->b_size;
- view->readonly = 0;
- /* use default format character if not set */
- view->format = dict->format ? dict->format : "B";
- view->ndim = dict->ndim;
- view->shape = dict->shape;
- view->itemsize = item_dict->size;
- view->strides = NULL;
- view->suboffsets = NULL;
- view->internal = NULL;
- return 0;
-}
-
-static PyBufferProcs PyCData_as_buffer = {
- PyCData_NewGetBuffer,
- NULL,
-};
-
-/*
- * CData objects are mutable, so they cannot be hashable!
- */
-static Py_hash_t
-PyCData_nohash(PyObject *self)
-{
- PyErr_SetString(PyExc_TypeError, "unhashable type");
- return -1;
-}
-
-static PyObject *
-PyCData_reduce(PyObject *myself, PyObject *args)
-{
- CDataObject *self = (CDataObject *)myself;
-
- if (PyObject_stgdict(myself)->flags & (TYPEFLAG_ISPOINTER|TYPEFLAG_HASPOINTER)) {
- PyErr_SetString(PyExc_ValueError,
- "ctypes objects containing pointers cannot be pickled");
- return NULL;
- }
- PyObject *dict = PyObject_GetAttrString(myself, "__dict__");
- if (dict == NULL) {
- return NULL;
- }
- return Py_BuildValue("O(O(NN))", _unpickle, Py_TYPE(myself), dict,
- PyBytes_FromStringAndSize(self->b_ptr, self->b_size));
-}
-
-static PyObject *
-PyCData_setstate(PyObject *myself, PyObject *args)
-{
- void *data;
- Py_ssize_t len;
- int res;
- PyObject *dict, *mydict;
- CDataObject *self = (CDataObject *)myself;
- if (!PyArg_ParseTuple(args, "O!s#",
- &PyDict_Type, &dict, &data, &len))
- {
- return NULL;
- }
- if (len > self->b_size)
- len = self->b_size;
- memmove(self->b_ptr, data, len);
- mydict = PyObject_GetAttrString(myself, "__dict__");
- if (mydict == NULL) {
- return NULL;
- }
- if (!PyDict_Check(mydict)) {
- PyErr_Format(PyExc_TypeError,
- "%.200s.__dict__ must be a dictionary, not %.200s",
- Py_TYPE(myself)->tp_name, Py_TYPE(mydict)->tp_name);
- Py_DECREF(mydict);
- return NULL;
- }
- res = PyDict_Update(mydict, dict);
- Py_DECREF(mydict);
- if (res == -1)
- return NULL;
- Py_RETURN_NONE;
-}
-
-/*
- * default __ctypes_from_outparam__ method returns self.
- */
-static PyObject *
-PyCData_from_outparam(PyObject *self, PyObject *args)
-{
- return Py_NewRef(self);
-}
-
-static PyMethodDef PyCData_methods[] = {
- { "__ctypes_from_outparam__", PyCData_from_outparam, METH_NOARGS, },
- { "__reduce__", PyCData_reduce, METH_NOARGS, },
- { "__setstate__", PyCData_setstate, METH_VARARGS, },
- { NULL, NULL },
-};
-
-PyTypeObject PyCData_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_ctypes._CData",
- sizeof(CDataObject), /* tp_basicsize */
- 0, /* tp_itemsize */
- PyCData_dealloc, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- PyCData_nohash, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- &PyCData_as_buffer, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- PyDoc_STR("XXX to be provided"), /* tp_doc */
- (traverseproc)PyCData_traverse, /* tp_traverse */
- (inquiry)PyCData_clear, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- PyCData_methods, /* tp_methods */
- PyCData_members, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
- 0, /* tp_free */
-};
-
-static int PyCData_MallocBuffer(CDataObject *obj, StgDictObject *dict)
-{
- if ((size_t)dict->size <= sizeof(obj->b_value)) {
- /* No need to call malloc, can use the default buffer */
- obj->b_ptr = (char *)&obj->b_value;
- /* The b_needsfree flag does not mean that we actually did
- call PyMem_Malloc to allocate the memory block; instead it
- means we are the *owner* of the memory and are responsible
- for freeing resources associated with the memory. This is
- also the reason that b_needsfree is exposed to Python.
- */
- obj->b_needsfree = 1;
- } else {
- /* In python 2.4, and ctypes 0.9.6, the malloc call took about
- 33% of the creation time for c_int().
- */
- obj->b_ptr = (char *)PyMem_Malloc(dict->size);
- if (obj->b_ptr == NULL) {
- PyErr_NoMemory();
- return -1;
- }
- obj->b_needsfree = 1;
- memset(obj->b_ptr, 0, dict->size);
- }
- obj->b_size = dict->size;
- return 0;
-}
-
-PyObject *
-PyCData_FromBaseObj(PyObject *type, PyObject *base, Py_ssize_t index, char *adr)
-{
- CDataObject *cmem;
- StgDictObject *dict;
-
- assert(PyType_Check(type));
- dict = PyType_stgdict(type);
- if (!dict) {
- PyErr_SetString(PyExc_TypeError,
- "abstract class");
- return NULL;
- }
- dict->flags |= DICTFLAG_FINAL;
- cmem = (CDataObject *)((PyTypeObject *)type)->tp_alloc((PyTypeObject *)type, 0);
- if (cmem == NULL)
- return NULL;
- assert(CDataObject_Check(cmem));
-
- cmem->b_length = dict->length;
- cmem->b_size = dict->size;
- if (base) { /* use base's buffer */
- assert(CDataObject_Check(base));
- cmem->b_ptr = adr;
- cmem->b_needsfree = 0;
- cmem->b_base = (CDataObject *)Py_NewRef(base);
- cmem->b_index = index;
- } else { /* copy contents of adr */
- if (-1 == PyCData_MallocBuffer(cmem, dict)) {
- Py_DECREF(cmem);
- return NULL;
- }
- memcpy(cmem->b_ptr, adr, dict->size);
- cmem->b_index = index;
- }
- return (PyObject *)cmem;
-}
-
-/*
- Box a memory block into a CData instance.
-*/
-PyObject *
-PyCData_AtAddress(PyObject *type, void *buf)
-{
- CDataObject *pd;
- StgDictObject *dict;
-
- if (PySys_Audit("ctypes.cdata", "n", (Py_ssize_t)buf) < 0) {
- return NULL;
- }
-
- assert(PyType_Check(type));
- dict = PyType_stgdict(type);
- if (!dict) {
- PyErr_SetString(PyExc_TypeError,
- "abstract class");
- return NULL;
- }
- dict->flags |= DICTFLAG_FINAL;
-
- pd = (CDataObject *)((PyTypeObject *)type)->tp_alloc((PyTypeObject *)type, 0);
- if (!pd)
- return NULL;
- assert(CDataObject_Check(pd));
- pd->b_ptr = (char *)buf;
- pd->b_length = dict->length;
- pd->b_size = dict->size;
- return (PyObject *)pd;
-}
-
-/*
- This function returns TRUE for c_int, c_void_p, and these kind of
- classes. FALSE otherwise FALSE also for subclasses of c_int and
- such.
-*/
-int _ctypes_simple_instance(PyObject *obj)
-{
- PyTypeObject *type = (PyTypeObject *)obj;
-
- if (PyCSimpleTypeObject_Check(type))
- return type->tp_base != &Simple_Type;
- return 0;
-}
-
-PyObject *
-PyCData_get(PyObject *type, GETFUNC getfunc, PyObject *src,
- Py_ssize_t index, Py_ssize_t size, char *adr)
-{
- StgDictObject *dict;
- if (getfunc)
- return getfunc(adr, size);
- assert(type);
- dict = PyType_stgdict(type);
- if (dict && dict->getfunc && !_ctypes_simple_instance(type))
- return dict->getfunc(adr, size);
- return PyCData_FromBaseObj(type, src, index, adr);
-}
-
-/*
- Helper function for PyCData_set below.
-*/
-static PyObject *
-_PyCData_set(CDataObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value,
- Py_ssize_t size, char *ptr)
-{
- CDataObject *src;
- int err;
-
- if (setfunc)
- return setfunc(ptr, value, size);
-
- if (!CDataObject_Check(value)) {
- StgDictObject *dict = PyType_stgdict(type);
- if (dict && dict->setfunc)
- return dict->setfunc(ptr, value, size);
- /*
- If value is a tuple, we try to call the type with the tuple
- and use the result!
- */
- assert(PyType_Check(type));
- if (PyTuple_Check(value)) {
- PyObject *ob;
- PyObject *result;
- ob = PyObject_CallObject(type, value);
- if (ob == NULL) {
- _ctypes_extend_error(PyExc_RuntimeError, "(%s) ",
- ((PyTypeObject *)type)->tp_name);
- return NULL;
- }
- result = _PyCData_set(dst, type, setfunc, ob,
- size, ptr);
- Py_DECREF(ob);
- return result;
- } else if (value == Py_None && PyCPointerTypeObject_Check(type)) {
- *(void **)ptr = NULL;
- Py_RETURN_NONE;
- } else {
- PyErr_Format(PyExc_TypeError,
- "expected %s instance, got %s",
- ((PyTypeObject *)type)->tp_name,
- Py_TYPE(value)->tp_name);
- return NULL;
- }
- }
- src = (CDataObject *)value;
-
- err = PyObject_IsInstance(value, type);
- if (err == -1)
- return NULL;
- if (err) {
- memcpy(ptr,
- src->b_ptr,
- size);
-
- if (PyCPointerTypeObject_Check(type)) {
- /* XXX */
- }
-
- value = GetKeepedObjects(src);
- if (value == NULL)
- return NULL;
-
- return Py_NewRef(value);
- }
-
- if (PyCPointerTypeObject_Check(type)
- && ArrayObject_Check(value)) {
- StgDictObject *p1, *p2;
- PyObject *keep;
- p1 = PyObject_stgdict(value);
- assert(p1); /* Cannot be NULL for array instances */
- p2 = PyType_stgdict(type);
- assert(p2); /* Cannot be NULL for pointer types */
-
- if (p1->proto != p2->proto) {
- PyErr_Format(PyExc_TypeError,
- "incompatible types, %s instance instead of %s instance",
- Py_TYPE(value)->tp_name,
- ((PyTypeObject *)type)->tp_name);
- return NULL;
- }
- *(void **)ptr = src->b_ptr;
-
- keep = GetKeepedObjects(src);
- if (keep == NULL)
- return NULL;
-
- /*
- We are assigning an array object to a field which represents
- a pointer. This has the same effect as converting an array
- into a pointer. So, again, we have to keep the whole object
- pointed to (which is the array in this case) alive, and not
- only it's object list. So we create a tuple, containing
- b_objects list PLUS the array itself, and return that!
- */
- return PyTuple_Pack(2, keep, value);
- }
- PyErr_Format(PyExc_TypeError,
- "incompatible types, %s instance instead of %s instance",
- Py_TYPE(value)->tp_name,
- ((PyTypeObject *)type)->tp_name);
- return NULL;
-}
-
-/*
- * Set a slice in object 'dst', which has the type 'type',
- * to the value 'value'.
- */
-int
-PyCData_set(PyObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value,
- Py_ssize_t index, Py_ssize_t size, char *ptr)
-{
- CDataObject *mem = (CDataObject *)dst;
- PyObject *result;
-
- if (!CDataObject_Check(dst)) {
- PyErr_SetString(PyExc_TypeError,
- "not a ctype instance");
- return -1;
- }
-
- result = _PyCData_set(mem, type, setfunc, value,
- size, ptr);
- if (result == NULL)
- return -1;
-
- /* KeepRef steals a refcount from it's last argument */
- /* If KeepRef fails, we are stumped. The dst memory block has already
- been changed */
- return KeepRef(mem, index, result);
-}
-
-
-/******************************************************************/
-static PyObject *
-GenericPyCData_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- CDataObject *obj;
- StgDictObject *dict;
-
- dict = PyType_stgdict((PyObject *)type);
- if (!dict) {
- PyErr_SetString(PyExc_TypeError,
- "abstract class");
- return NULL;
- }
- dict->flags |= DICTFLAG_FINAL;
-
- obj = (CDataObject *)type->tp_alloc(type, 0);
- if (!obj)
- return NULL;
-
- obj->b_base = NULL;
- obj->b_index = 0;
- obj->b_objects = NULL;
- obj->b_length = dict->length;
-
- if (-1 == PyCData_MallocBuffer(obj, dict)) {
- Py_DECREF(obj);
- return NULL;
- }
- return (PyObject *)obj;
-}
-/*****************************************************************/
-/*
- PyCFuncPtr_Type
-*/
-
-static int
-PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
-{
- if (ob && !PyCallable_Check(ob)) {
- PyErr_SetString(PyExc_TypeError,
- "the errcheck attribute must be callable");
- return -1;
- }
- Py_XINCREF(ob);
- Py_XSETREF(self->errcheck, ob);
- return 0;
-}
-
-static PyObject *
-PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
-{
- if (self->errcheck) {
- return Py_NewRef(self->errcheck);
- }
- Py_RETURN_NONE;
-}
-
-static int
-PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
-{
- PyObject *checker, *oldchecker;
- if (ob == NULL) {
- oldchecker = self->checker;
- self->checker = NULL;
- Py_CLEAR(self->restype);
- Py_XDECREF(oldchecker);
- return 0;
- }
- if (ob != Py_None && !PyType_stgdict(ob) && !PyCallable_Check(ob)) {
- PyErr_SetString(PyExc_TypeError,
- "restype must be a type, a callable, or None");
- return -1;
- }
- if (_PyObject_LookupAttr(ob, &_Py_ID(_check_retval_), &checker) < 0) {
- return -1;
- }
- oldchecker = self->checker;
- self->checker = checker;
- Py_INCREF(ob);
- Py_XSETREF(self->restype, ob);
- Py_XDECREF(oldchecker);
- return 0;
-}
-
-static PyObject *
-PyCFuncPtr_get_restype(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
-{
- StgDictObject *dict;
- if (self->restype) {
- return Py_NewRef(self->restype);
- }
- dict = PyObject_stgdict((PyObject *)self);
- assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
- if (dict->restype) {
- return Py_NewRef(dict->restype);
- } else {
- Py_RETURN_NONE;
- }
-}
-
-static int
-PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
-{
- PyObject *converters;
-
- if (ob == NULL || ob == Py_None) {
- Py_CLEAR(self->converters);
- Py_CLEAR(self->argtypes);
- } else {
- converters = converters_from_argtypes(ob);
- if (!converters)
- return -1;
- Py_XSETREF(self->converters, converters);
- Py_INCREF(ob);
- Py_XSETREF(self->argtypes, ob);
- }
- return 0;
-}
-
-static PyObject *
-PyCFuncPtr_get_argtypes(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
-{
- StgDictObject *dict;
- if (self->argtypes) {
- return Py_NewRef(self->argtypes);
- }
- dict = PyObject_stgdict((PyObject *)self);
- assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
- if (dict->argtypes) {
- return Py_NewRef(dict->argtypes);
- } else {
- Py_RETURN_NONE;
- }
-}
-
-static PyGetSetDef PyCFuncPtr_getsets[] = {
- { "errcheck", (getter)PyCFuncPtr_get_errcheck, (setter)PyCFuncPtr_set_errcheck,
- "a function to check for errors", NULL },
- { "restype", (getter)PyCFuncPtr_get_restype, (setter)PyCFuncPtr_set_restype,
- "specify the result type", NULL },
- { "argtypes", (getter)PyCFuncPtr_get_argtypes,
- (setter)PyCFuncPtr_set_argtypes,
- "specify the argument types", NULL },
- { NULL, NULL }
-};
-
-#ifdef MS_WIN32
-static PPROC FindAddress(void *handle, const char *name, PyObject *type)
-{
- PPROC address;
-#ifdef MS_WIN64
- /* win64 has no stdcall calling conv, so it should
- also not have the name mangling of it.
- */
- Py_BEGIN_ALLOW_THREADS
- address = (PPROC)GetProcAddress(handle, name);
- Py_END_ALLOW_THREADS
- return address;
-#else
- char *mangled_name;
- int i;
- StgDictObject *dict;
-
- Py_BEGIN_ALLOW_THREADS
- address = (PPROC)GetProcAddress(handle, name);
- Py_END_ALLOW_THREADS
- if (address)
- return address;
- if (((size_t)name & ~0xFFFF) == 0) {
- return NULL;
- }
-
- dict = PyType_stgdict((PyObject *)type);
- /* It should not happen that dict is NULL, but better be safe */
- if (dict==NULL || dict->flags & FUNCFLAG_CDECL)
- return address;
-
- /* for stdcall, try mangled names:
- funcname -> _funcname@<n>
- where n is 0, 4, 8, 12, ..., 128
- */
- mangled_name = alloca(strlen(name) + 1 + 1 + 1 + 3); /* \0 _ @ %d */
- if (!mangled_name)
- return NULL;
- for (i = 0; i < 32; ++i) {
- sprintf(mangled_name, "_%s@%d", name, i*4);
- Py_BEGIN_ALLOW_THREADS
- address = (PPROC)GetProcAddress(handle, mangled_name);
- Py_END_ALLOW_THREADS
- if (address)
- return address;
- }
- return NULL;
-#endif
-}
-#endif
-
-/* Return 1 if usable, 0 else and exception set. */
-static int
-_check_outarg_type(PyObject *arg, Py_ssize_t index)
-{
- StgDictObject *dict;
-
- if (PyCPointerTypeObject_Check(arg))
- return 1;
-
- if (PyCArrayTypeObject_Check(arg))
- return 1;
-
- dict = PyType_stgdict(arg);
- if (dict
- /* simple pointer types, c_void_p, c_wchar_p, BSTR, ... */
- && PyUnicode_Check(dict->proto)
-/* We only allow c_void_p, c_char_p and c_wchar_p as a simple output parameter type */
- && (strchr("PzZ", PyUnicode_AsUTF8(dict->proto)[0]))) {
- return 1;
- }
-
- PyErr_Format(PyExc_TypeError,
- "'out' parameter %d must be a pointer type, not %s",
- Py_SAFE_DOWNCAST(index, Py_ssize_t, int),
- PyType_Check(arg) ?
- ((PyTypeObject *)arg)->tp_name :
- Py_TYPE(arg)->tp_name);
- return 0;
-}
-
-/* Returns 1 on success, 0 on error */
-static int
-_validate_paramflags(PyTypeObject *type, PyObject *paramflags)
-{
- Py_ssize_t i, len;
- StgDictObject *dict;
- PyObject *argtypes;
-
- dict = PyType_stgdict((PyObject *)type);
- if (!dict) {
- PyErr_SetString(PyExc_TypeError,
- "abstract class");
- return 0;
- }
- argtypes = dict->argtypes;
-
- if (paramflags == NULL || dict->argtypes == NULL)
- return 1;
-
- if (!PyTuple_Check(paramflags)) {
- PyErr_SetString(PyExc_TypeError,
- "paramflags must be a tuple or None");
- return 0;
- }
-
- len = PyTuple_GET_SIZE(paramflags);
- if (len != PyTuple_GET_SIZE(dict->argtypes)) {
- PyErr_SetString(PyExc_ValueError,
- "paramflags must have the same length as argtypes");
- return 0;
- }
-
- for (i = 0; i < len; ++i) {
- PyObject *item = PyTuple_GET_ITEM(paramflags, i);
- int flag;
- PyObject *name = Py_None;
- PyObject *defval;
- PyObject *typ;
- if (!PyArg_ParseTuple(item, "i|OO", &flag, &name, &defval) ||
- !(name == Py_None || PyUnicode_Check(name)))
- {
- PyErr_SetString(PyExc_TypeError,
- "paramflags must be a sequence of (int [,string [,value]]) tuples");
- return 0;
- }
- typ = PyTuple_GET_ITEM(argtypes, i);
- switch (flag & (PARAMFLAG_FIN | PARAMFLAG_FOUT | PARAMFLAG_FLCID)) {
- case 0:
- case PARAMFLAG_FIN:
- case PARAMFLAG_FIN | PARAMFLAG_FLCID:
- case PARAMFLAG_FIN | PARAMFLAG_FOUT:
- break;
- case PARAMFLAG_FOUT:
- if (!_check_outarg_type(typ, i+1))
- return 0;
- break;
- default:
- PyErr_Format(PyExc_TypeError,
- "paramflag value %d not supported",
- flag);
- return 0;
- }
- }
- return 1;
-}
-
-static int
-_get_name(PyObject *obj, const char **pname)
-{
-#ifdef MS_WIN32
- if (PyLong_Check(obj)) {
- /* We have to use MAKEINTRESOURCEA for Windows CE.
- Works on Windows as well, of course.
- */
- *pname = MAKEINTRESOURCEA(PyLong_AsUnsignedLongMask(obj) & 0xFFFF);
- return 1;
- }
-#endif
- if (PyBytes_Check(obj)) {
- *pname = PyBytes_AS_STRING(obj);
- return *pname ? 1 : 0;
- }
- if (PyUnicode_Check(obj)) {
- *pname = PyUnicode_AsUTF8(obj);
- return *pname ? 1 : 0;
- }
- PyErr_SetString(PyExc_TypeError,
- "function name must be string, bytes object or integer");
- return 0;
-}
-
-
-static PyObject *
-PyCFuncPtr_FromDll(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- const char *name;
- int (* address)(void);
- PyObject *ftuple;
- PyObject *dll;
- PyObject *obj;
- PyCFuncPtrObject *self;
- void *handle;
- PyObject *paramflags = NULL;
-
- if (!PyArg_ParseTuple(args, "O|O", &ftuple, &paramflags))
- return NULL;
- if (paramflags == Py_None)
- paramflags = NULL;
-
- ftuple = PySequence_Tuple(ftuple);
- if (!ftuple)
- /* Here ftuple is a borrowed reference */
- return NULL;
-
- if (!PyArg_ParseTuple(ftuple, "O&O;illegal func_spec argument",
- _get_name, &name, &dll))
- {
- Py_DECREF(ftuple);
- return NULL;
- }
-
-#ifdef MS_WIN32
- if (PySys_Audit("ctypes.dlsym",
- ((uintptr_t)name & ~0xFFFF) ? "Os" : "On",
- dll, name) < 0) {
- Py_DECREF(ftuple);
- return NULL;
- }
-#else
- if (PySys_Audit("ctypes.dlsym", "Os", dll, name) < 0) {
- Py_DECREF(ftuple);
- return NULL;
- }
-#endif
-
- obj = PyObject_GetAttrString(dll, "_handle");
- if (!obj) {
- Py_DECREF(ftuple);
- return NULL;
- }
- if (!PyLong_Check(obj)) {
- PyErr_SetString(PyExc_TypeError,
- "the _handle attribute of the second argument must be an integer");
- Py_DECREF(ftuple);
- Py_DECREF(obj);
- return NULL;
- }
- handle = (void *)PyLong_AsVoidPtr(obj);
- Py_DECREF(obj);
- if (PyErr_Occurred()) {
- PyErr_SetString(PyExc_ValueError,
- "could not convert the _handle attribute to a pointer");
- Py_DECREF(ftuple);
- return NULL;
- }
-
-#ifdef MS_WIN32
- address = FindAddress(handle, name, (PyObject *)type);
- if (!address) {
- if (!IS_INTRESOURCE(name))
- PyErr_Format(PyExc_AttributeError,
- "function '%s' not found",
- name);
- else
- PyErr_Format(PyExc_AttributeError,
- "function ordinal %d not found",
- (WORD)(size_t)name);
- Py_DECREF(ftuple);
- return NULL;
- }
-#else
- address = (PPROC)dlsym(handle, name);
- if (!address) {
-#ifdef __CYGWIN__
-/* dlerror() isn't very helpful on cygwin */
- PyErr_Format(PyExc_AttributeError,
- "function '%s' not found",
- name);
-#else
- PyErr_SetString(PyExc_AttributeError, dlerror());
-#endif
- Py_DECREF(ftuple);
- return NULL;
- }
-#endif
- if (!_validate_paramflags(type, paramflags)) {
- Py_DECREF(ftuple);
- return NULL;
- }
-
- self = (PyCFuncPtrObject *)GenericPyCData_new(type, args, kwds);
- if (!self) {
- Py_DECREF(ftuple);
- return NULL;
- }
-
- self->paramflags = Py_XNewRef(paramflags);
-
- *(void **)self->b_ptr = address;
- Py_INCREF(dll);
- Py_DECREF(ftuple);
- if (-1 == KeepRef((CDataObject *)self, 0, dll)) {
- Py_DECREF((PyObject *)self);
- return NULL;
- }
-
- self->callable = Py_NewRef(self);
- return (PyObject *)self;
-}
-
-#ifdef MS_WIN32
-static PyObject *
-PyCFuncPtr_FromVtblIndex(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- PyCFuncPtrObject *self;
- int index;
- char *name = NULL;
- PyObject *paramflags = NULL;
- GUID *iid = NULL;
- Py_ssize_t iid_len = 0;
-
- if (!PyArg_ParseTuple(args, "is|Oz#", &index, &name, &paramflags, &iid, &iid_len))
- return NULL;
- if (paramflags == Py_None)
- paramflags = NULL;
-
- if (!_validate_paramflags(type, paramflags))
- return NULL;
-
- self = (PyCFuncPtrObject *)GenericPyCData_new(type, args, kwds);
- self->index = index + 0x1000;
- self->paramflags = Py_XNewRef(paramflags);
- if (iid_len == sizeof(GUID))
- self->iid = iid;
- return (PyObject *)self;
-}
-#endif
-
-/*
- PyCFuncPtr_new accepts different argument lists in addition to the standard
- _basespec_ keyword arg:
-
- one argument form
- "i" - function address
- "O" - must be a callable, creates a C callable function
-
- two or more argument forms (the third argument is a paramflags tuple)
- "(sO)|..." - (function name, dll object (with an integer handle)), paramflags
- "(iO)|..." - (function ordinal, dll object (with an integer handle)), paramflags
- "is|..." - vtable index, method name, creates callable calling COM vtbl
-*/
-static PyObject *
-PyCFuncPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- PyCFuncPtrObject *self;
- PyObject *callable;
- StgDictObject *dict;
- CThunkObject *thunk;
-
- if (PyTuple_GET_SIZE(args) == 0)
- return GenericPyCData_new(type, args, kwds);
-
- if (1 <= PyTuple_GET_SIZE(args) && PyTuple_Check(PyTuple_GET_ITEM(args, 0)))
- return PyCFuncPtr_FromDll(type, args, kwds);
-
-#ifdef MS_WIN32
- if (2 <= PyTuple_GET_SIZE(args) && PyLong_Check(PyTuple_GET_ITEM(args, 0)))
- return PyCFuncPtr_FromVtblIndex(type, args, kwds);
-#endif
-
- if (1 == PyTuple_GET_SIZE(args)
- && (PyLong_Check(PyTuple_GET_ITEM(args, 0)))) {
- CDataObject *ob;
- void *ptr = PyLong_AsVoidPtr(PyTuple_GET_ITEM(args, 0));
- if (ptr == NULL && PyErr_Occurred())
- return NULL;
- ob = (CDataObject *)GenericPyCData_new(type, args, kwds);
- if (ob == NULL)
- return NULL;
- *(void **)ob->b_ptr = ptr;
- return (PyObject *)ob;
- }
-
- if (!PyArg_ParseTuple(args, "O", &callable))
- return NULL;
- if (!PyCallable_Check(callable)) {
- PyErr_SetString(PyExc_TypeError,
- "argument must be callable or integer function address");
- return NULL;
- }
-
- /* XXX XXX This would allow passing additional options. For COM
- method *implementations*, we would probably want different
- behaviour than in 'normal' callback functions: return a HRESULT if
- an exception occurs in the callback, and print the traceback not
- only on the console, but also to OutputDebugString() or something
- like that.
- */
-/*
- if (kwds && _PyDict_GetItemIdWithError(kwds, &PyId_options)) {
- ...
- }
- else if (PyErr_Occurred()) {
- return NULL;
- }
-*/
-
- dict = PyType_stgdict((PyObject *)type);
- /* XXXX Fails if we do: 'PyCFuncPtr(lambda x: x)' */
- if (!dict || !dict->argtypes) {
- PyErr_SetString(PyExc_TypeError,
- "cannot construct instance of this class:"
- " no argtypes");
- return NULL;
- }
-
- thunk = _ctypes_alloc_callback(callable,
- dict->argtypes,
- dict->restype,
- dict->flags);
- if (!thunk)
- return NULL;
-
- self = (PyCFuncPtrObject *)GenericPyCData_new(type, args, kwds);
- if (self == NULL) {
- Py_DECREF(thunk);
- return NULL;
- }
-
- self->callable = Py_NewRef(callable);
-
- self->thunk = thunk;
- *(void **)self->b_ptr = (void *)thunk->pcl_exec;
-
- Py_INCREF((PyObject *)thunk); /* for KeepRef */
- if (-1 == KeepRef((CDataObject *)self, 0, (PyObject *)thunk)) {
- Py_DECREF((PyObject *)self);
- return NULL;
- }
- return (PyObject *)self;
-}
-
-
-/*
- _byref consumes a refcount to its argument
-*/
-static PyObject *
-_byref(PyObject *obj)
-{
- PyCArgObject *parg;
- if (!CDataObject_Check(obj)) {
- PyErr_SetString(PyExc_TypeError,
- "expected CData instance");
- return NULL;
- }
-
- parg = PyCArgObject_new();
- if (parg == NULL) {
- Py_DECREF(obj);
- return NULL;
- }
-
- parg->tag = 'P';
- parg->pffi_type = &ffi_type_pointer;
- parg->obj = obj;
- parg->value.p = ((CDataObject *)obj)->b_ptr;
- return (PyObject *)parg;
-}
-
-static PyObject *
-_get_arg(int *pindex, PyObject *name, PyObject *defval, PyObject *inargs, PyObject *kwds)
-{
- PyObject *v;
-
- if (*pindex < PyTuple_GET_SIZE(inargs)) {
- v = PyTuple_GET_ITEM(inargs, *pindex);
- ++*pindex;
- return Py_NewRef(v);
- }
- if (kwds && name) {
- v = PyDict_GetItemWithError(kwds, name);
- if (v) {
- ++*pindex;
- return Py_NewRef(v);
- }
- else if (PyErr_Occurred()) {
- return NULL;
- }
- }
- if (defval) {
- return Py_NewRef(defval);
- }
- /* we can't currently emit a better error message */
- if (name)
- PyErr_Format(PyExc_TypeError,
- "required argument '%S' missing", name);
- else
- PyErr_Format(PyExc_TypeError,
- "not enough arguments");
- return NULL;
-}
-
-/*
- This function implements higher level functionality plus the ability to call
- functions with keyword arguments by looking at parameter flags. parameter
- flags is a tuple of 1, 2 or 3-tuples. The first entry in each is an integer
- specifying the direction of the data transfer for this parameter - 'in',
- 'out' or 'inout' (zero means the same as 'in'). The second entry is the
- parameter name, and the third is the default value if the parameter is
- missing in the function call.
-
- This function builds and returns a new tuple 'callargs' which contains the
- parameters to use in the call. Items on this tuple are copied from the
- 'inargs' tuple for 'in' and 'in, out' parameters, and constructed from the
- 'argtypes' tuple for 'out' parameters. It also calculates numretvals which
- is the number of return values for the function, outmask/inoutmask are
- bitmasks containing indexes into the callargs tuple specifying which
- parameters have to be returned. _build_result builds the return value of the
- function.
-*/
-static PyObject *
-_build_callargs(PyCFuncPtrObject *self, PyObject *argtypes,
- PyObject *inargs, PyObject *kwds,
- int *poutmask, int *pinoutmask, unsigned int *pnumretvals)
-{
- PyObject *paramflags = self->paramflags;
- PyObject *callargs;
- StgDictObject *dict;
- Py_ssize_t i, len;
- int inargs_index = 0;
- /* It's a little bit difficult to determine how many arguments the
- function call requires/accepts. For simplicity, we count the consumed
- args and compare this to the number of supplied args. */
- Py_ssize_t actual_args;
-
- *poutmask = 0;
- *pinoutmask = 0;
- *pnumretvals = 0;
-
- /* Trivial cases, where we either return inargs itself, or a slice of it. */
- if (argtypes == NULL || paramflags == NULL || PyTuple_GET_SIZE(argtypes) == 0) {
-#ifdef MS_WIN32
- if (self->index)
- return PyTuple_GetSlice(inargs, 1, PyTuple_GET_SIZE(inargs));
-#endif
- return Py_NewRef(inargs);
- }
-
- len = PyTuple_GET_SIZE(argtypes);
- callargs = PyTuple_New(len); /* the argument tuple we build */
- if (callargs == NULL)
- return NULL;
-
-#ifdef MS_WIN32
- /* For a COM method, skip the first arg */
- if (self->index) {
- inargs_index = 1;
- }
-#endif
- for (i = 0; i < len; ++i) {
- PyObject *item = PyTuple_GET_ITEM(paramflags, i);
- PyObject *ob;
- unsigned int flag;
- PyObject *name = NULL;
- PyObject *defval = NULL;
-
- /* This way seems to be ~2 us faster than the PyArg_ParseTuple
- calls below. */
- /* We HAVE already checked that the tuple can be parsed with "i|ZO", so... */
- Py_ssize_t tsize = PyTuple_GET_SIZE(item);
- flag = PyLong_AsUnsignedLongMask(PyTuple_GET_ITEM(item, 0));
- name = tsize > 1 ? PyTuple_GET_ITEM(item, 1) : NULL;
- defval = tsize > 2 ? PyTuple_GET_ITEM(item, 2) : NULL;
-
- switch (flag & (PARAMFLAG_FIN | PARAMFLAG_FOUT | PARAMFLAG_FLCID)) {
- case PARAMFLAG_FIN | PARAMFLAG_FLCID:
- /* ['in', 'lcid'] parameter. Always taken from defval,
- if given, else the integer 0. */
- if (defval == NULL) {
- defval = _PyLong_GetZero();
- }
- Py_INCREF(defval);
- PyTuple_SET_ITEM(callargs, i, defval);
- break;
- case (PARAMFLAG_FIN | PARAMFLAG_FOUT):
- *pinoutmask |= (1 << i); /* mark as inout arg */
- (*pnumretvals)++;
- /* fall through */
- case 0:
- case PARAMFLAG_FIN:
- /* 'in' parameter. Copy it from inargs. */
- ob =_get_arg(&inargs_index, name, defval, inargs, kwds);
- if (ob == NULL)
- goto error;
- PyTuple_SET_ITEM(callargs, i, ob);
- break;
- case PARAMFLAG_FOUT:
- /* XXX Refactor this code into a separate function. */
- /* 'out' parameter.
- argtypes[i] must be a POINTER to a c type.
-
- Cannot by supplied in inargs, but a defval will be used
- if available. XXX Should we support getting it from kwds?
- */
- if (defval) {
- /* XXX Using mutable objects as defval will
- make the function non-threadsafe, unless we
- copy the object in each invocation */
- Py_INCREF(defval);
- PyTuple_SET_ITEM(callargs, i, defval);
- *poutmask |= (1 << i); /* mark as out arg */
- (*pnumretvals)++;
- break;
- }
- ob = PyTuple_GET_ITEM(argtypes, i);
- dict = PyType_stgdict(ob);
- if (dict == NULL) {
- /* Cannot happen: _validate_paramflags()
- would not accept such an object */
- PyErr_Format(PyExc_RuntimeError,
- "NULL stgdict unexpected");
- goto error;
- }
- if (PyUnicode_Check(dict->proto)) {
- PyErr_Format(
- PyExc_TypeError,
- "%s 'out' parameter must be passed as default value",
- ((PyTypeObject *)ob)->tp_name);
- goto error;
- }
- if (PyCArrayTypeObject_Check(ob))
- ob = _PyObject_CallNoArgs(ob);
- else
- /* Create an instance of the pointed-to type */
- ob = _PyObject_CallNoArgs(dict->proto);
- /*
- XXX Is the following correct any longer?
- We must not pass a byref() to the array then but
- the array instance itself. Then, we cannot retrieve
- the result from the PyCArgObject.
- */
- if (ob == NULL)
- goto error;
- /* The .from_param call that will occur later will pass this
- as a byref parameter. */
- PyTuple_SET_ITEM(callargs, i, ob);
- *poutmask |= (1 << i); /* mark as out arg */
- (*pnumretvals)++;
- break;
- default:
- PyErr_Format(PyExc_ValueError,
- "paramflag %u not yet implemented", flag);
- goto error;
- break;
- }
- }
-
- /* We have counted the arguments we have consumed in 'inargs_index'. This
- must be the same as len(inargs) + len(kwds), otherwise we have
- either too much or not enough arguments. */
-
- actual_args = PyTuple_GET_SIZE(inargs) + (kwds ? PyDict_GET_SIZE(kwds) : 0);
- if (actual_args != inargs_index) {
- /* When we have default values or named parameters, this error
- message is misleading. See unittests/test_paramflags.py
- */
- PyErr_Format(PyExc_TypeError,
- "call takes exactly %d arguments (%zd given)",
- inargs_index, actual_args);
- goto error;
- }
-
- /* outmask is a bitmask containing indexes into callargs. Items at
- these indexes contain values to return.
- */
- return callargs;
- error:
- Py_DECREF(callargs);
- return NULL;
-}
-
-/* See also:
- http://msdn.microsoft.com/library/en-us/com/html/769127a1-1a14-4ed4-9d38-7cf3e571b661.asp
-*/
-/*
- Build return value of a function.
-
- Consumes the refcount on result and callargs.
-*/
-static PyObject *
-_build_result(PyObject *result, PyObject *callargs,
- int outmask, int inoutmask, unsigned int numretvals)
-{
- unsigned int i, index;
- int bit;
- PyObject *tup = NULL;
-
- if (callargs == NULL)
- return result;
- if (result == NULL || numretvals == 0) {
- Py_DECREF(callargs);
- return result;
- }
- Py_DECREF(result);
-
- /* tup will not be allocated if numretvals == 1 */
- /* allocate tuple to hold the result */
- if (numretvals > 1) {
- tup = PyTuple_New(numretvals);
- if (tup == NULL) {
- Py_DECREF(callargs);
- return NULL;
- }
- }
-
- index = 0;
- for (bit = 1, i = 0; i < 32; ++i, bit <<= 1) {
- PyObject *v;
- if (bit & inoutmask) {
- v = PyTuple_GET_ITEM(callargs, i);
- Py_INCREF(v);
- if (numretvals == 1) {
- Py_DECREF(callargs);
- return v;
- }
- PyTuple_SET_ITEM(tup, index, v);
- index++;
- } else if (bit & outmask) {
-
- v = PyTuple_GET_ITEM(callargs, i);
- v = PyObject_CallMethodNoArgs(v, &_Py_ID(__ctypes_from_outparam__));
- if (v == NULL || numretvals == 1) {
- Py_DECREF(callargs);
- return v;
- }
- PyTuple_SET_ITEM(tup, index, v);
- index++;
- }
- if (index == numretvals)
- break;
- }
-
- Py_DECREF(callargs);
- return tup;
-}
-
-static PyObject *
-PyCFuncPtr_call(PyCFuncPtrObject *self, PyObject *inargs, PyObject *kwds)
-{
- PyObject *restype;
- PyObject *converters;
- PyObject *checker;
- PyObject *argtypes;
- StgDictObject *dict = PyObject_stgdict((PyObject *)self);
- PyObject *result;
- PyObject *callargs;
- PyObject *errcheck;
-#ifdef MS_WIN32
- IUnknown *piunk = NULL;
-#endif
- void *pProc = NULL;
-
- int inoutmask;
- int outmask;
- unsigned int numretvals;
-
- assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
- restype = self->restype ? self->restype : dict->restype;
- converters = self->converters ? self->converters : dict->converters;
- checker = self->checker ? self->checker : dict->checker;
- argtypes = self->argtypes ? self->argtypes : dict->argtypes;
-/* later, we probably want to have an errcheck field in stgdict */
- errcheck = self->errcheck /* ? self->errcheck : dict->errcheck */;
-
-
- pProc = *(void **)self->b_ptr;
-#ifdef MS_WIN32
- if (self->index) {
- /* It's a COM method */
- CDataObject *this;
- this = (CDataObject *)PyTuple_GetItem(inargs, 0); /* borrowed ref! */
- if (!this) {
- PyErr_SetString(PyExc_ValueError,
- "native com method call without 'this' parameter");
- return NULL;
- }
- if (!CDataObject_Check(this)) {
- PyErr_SetString(PyExc_TypeError,
- "Expected a COM this pointer as first argument");
- return NULL;
- }
- /* there should be more checks? No, in Python */
- /* First arg is a pointer to an interface instance */
- if (!this->b_ptr || *(void **)this->b_ptr == NULL) {
- PyErr_SetString(PyExc_ValueError,
- "NULL COM pointer access");
- return NULL;
- }
- piunk = *(IUnknown **)this->b_ptr;
- if (NULL == piunk->lpVtbl) {
- PyErr_SetString(PyExc_ValueError,
- "COM method call without VTable");
- return NULL;
- }
- pProc = ((void **)piunk->lpVtbl)[self->index - 0x1000];
- }
-#endif
- callargs = _build_callargs(self, argtypes,
- inargs, kwds,
- &outmask, &inoutmask, &numretvals);
- if (callargs == NULL)
- return NULL;
-
- if (converters) {
- int required = Py_SAFE_DOWNCAST(PyTuple_GET_SIZE(converters),
- Py_ssize_t, int);
- int actual = Py_SAFE_DOWNCAST(PyTuple_GET_SIZE(callargs),
- Py_ssize_t, int);
-
- if ((dict->flags & FUNCFLAG_CDECL) == FUNCFLAG_CDECL) {
- /* For cdecl functions, we allow more actual arguments
- than the length of the argtypes tuple.
- */
- if (required > actual) {
- Py_DECREF(callargs);
- PyErr_Format(PyExc_TypeError,
- "this function takes at least %d argument%s (%d given)",
- required,
- required == 1 ? "" : "s",
- actual);
- return NULL;
- }
- } else if (required != actual) {
- Py_DECREF(callargs);
- PyErr_Format(PyExc_TypeError,
- "this function takes %d argument%s (%d given)",
- required,
- required == 1 ? "" : "s",
- actual);
- return NULL;
- }
- }
-
- result = _ctypes_callproc(pProc,
- callargs,
-#ifdef MS_WIN32
- piunk,
- self->iid,
-#endif
- dict->flags,
- converters,
- restype,
- checker);
-/* The 'errcheck' protocol */
- if (result != NULL && errcheck) {
- PyObject *v = PyObject_CallFunctionObjArgs(errcheck,
- result,
- self,
- callargs,
- NULL);
- /* If the errcheck function failed, return NULL.
- If the errcheck function returned callargs unchanged,
- continue normal processing.
- If the errcheck function returned something else,
- use that as result.
- */
- if (v == NULL || v != callargs) {
- Py_DECREF(result);
- Py_DECREF(callargs);
- return v;
- }
- Py_DECREF(v);
- }
-
- return _build_result(result, callargs,
- outmask, inoutmask, numretvals);
-}
-
-static int
-PyCFuncPtr_traverse(PyCFuncPtrObject *self, visitproc visit, void *arg)
-{
- Py_VISIT(self->callable);
- Py_VISIT(self->restype);
- Py_VISIT(self->checker);
- Py_VISIT(self->errcheck);
- Py_VISIT(self->argtypes);
- Py_VISIT(self->converters);
- Py_VISIT(self->paramflags);
- Py_VISIT(self->thunk);
- return PyCData_traverse((CDataObject *)self, visit, arg);
-}
-
-static int
-PyCFuncPtr_clear(PyCFuncPtrObject *self)
-{
- Py_CLEAR(self->callable);
- Py_CLEAR(self->restype);
- Py_CLEAR(self->checker);
- Py_CLEAR(self->errcheck);
- Py_CLEAR(self->argtypes);
- Py_CLEAR(self->converters);
- Py_CLEAR(self->paramflags);
- Py_CLEAR(self->thunk);
- return PyCData_clear((CDataObject *)self);
-}
-
-static void
-PyCFuncPtr_dealloc(PyCFuncPtrObject *self)
-{
- PyCFuncPtr_clear(self);
- Py_TYPE(self)->tp_free((PyObject *)self);
-}
-
-static PyObject *
-PyCFuncPtr_repr(PyCFuncPtrObject *self)
-{
-#ifdef MS_WIN32
- if (self->index)
- return PyUnicode_FromFormat("<COM method offset %d: %s at %p>",
- self->index - 0x1000,
- Py_TYPE(self)->tp_name,
- self);
-#endif
- return PyUnicode_FromFormat("<%s object at %p>",
- Py_TYPE(self)->tp_name,
- self);
-}
-
-static int
-PyCFuncPtr_bool(PyCFuncPtrObject *self)
-{
- return ((*(void **)self->b_ptr != NULL)
-#ifdef MS_WIN32
- || (self->index != 0)
-#endif
- );
-}
-
-static PyNumberMethods PyCFuncPtr_as_number = {
- 0, /* nb_add */
- 0, /* nb_subtract */
- 0, /* nb_multiply */
- 0, /* nb_remainder */
- 0, /* nb_divmod */
- 0, /* nb_power */
- 0, /* nb_negative */
- 0, /* nb_positive */
- 0, /* nb_absolute */
- (inquiry)PyCFuncPtr_bool, /* nb_bool */
-};
-
-PyTypeObject PyCFuncPtr_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_ctypes.CFuncPtr",
- sizeof(PyCFuncPtrObject), /* tp_basicsize */
- 0, /* tp_itemsize */
- (destructor)PyCFuncPtr_dealloc, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- (reprfunc)PyCFuncPtr_repr, /* tp_repr */
- &PyCFuncPtr_as_number, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- (ternaryfunc)PyCFuncPtr_call, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- &PyCData_as_buffer, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- PyDoc_STR("Function Pointer"), /* tp_doc */
- (traverseproc)PyCFuncPtr_traverse, /* tp_traverse */
- (inquiry)PyCFuncPtr_clear, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- 0, /* tp_methods */
- 0, /* tp_members */
- PyCFuncPtr_getsets, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- PyCFuncPtr_new, /* tp_new */
- 0, /* tp_free */
-};
-
-/*****************************************************************/
-/*
- Struct_Type
-*/
-/*
- This function is called to initialize a Structure or Union with positional
- arguments. It calls itself recursively for all Structure or Union base
- classes, then retrieves the _fields_ member to associate the argument
- position with the correct field name.
-
- Returns -1 on error, or the index of next argument on success.
- */
-static Py_ssize_t
-_init_pos_args(PyObject *self, PyTypeObject *type,
- PyObject *args, PyObject *kwds,
- Py_ssize_t index)
-{
- StgDictObject *dict;
- PyObject *fields;
- Py_ssize_t i;
-
- if (PyType_stgdict((PyObject *)type->tp_base)) {
- index = _init_pos_args(self, type->tp_base,
- args, kwds,
- index);
- if (index == -1)
- return -1;
- }
-
- dict = PyType_stgdict((PyObject *)type);
- fields = PyDict_GetItemWithError((PyObject *)dict, &_Py_ID(_fields_));
- if (fields == NULL) {
- if (PyErr_Occurred()) {
- return -1;
- }
- return index;
- }
-
- for (i = index;
- i < dict->length && i < PyTuple_GET_SIZE(args);
- ++i) {
- PyObject *pair = PySequence_GetItem(fields, i - index);
- PyObject *name, *val;
- int res;
- if (!pair)
- return -1;
- name = PySequence_GetItem(pair, 0);
- if (!name) {
- Py_DECREF(pair);
- return -1;
- }
- val = PyTuple_GET_ITEM(args, i);
- if (kwds) {
- res = PyDict_Contains(kwds, name);
- if (res != 0) {
- if (res > 0) {
- PyErr_Format(PyExc_TypeError,
- "duplicate values for field %R",
- name);
- }
- Py_DECREF(pair);
- Py_DECREF(name);
- return -1;
- }
- }
-
- res = PyObject_SetAttr(self, name, val);
- Py_DECREF(pair);
- Py_DECREF(name);
- if (res == -1)
- return -1;
- }
- return dict->length;
-}
-
-static int
-Struct_init(PyObject *self, PyObject *args, PyObject *kwds)
-{
-/* Optimization possible: Store the attribute names _fields_[x][0]
- * in C accessible fields somewhere ?
- */
- if (!PyTuple_Check(args)) {
- PyErr_SetString(PyExc_TypeError,
- "args not a tuple?");
- return -1;
- }
- if (PyTuple_GET_SIZE(args)) {
- Py_ssize_t res = _init_pos_args(self, Py_TYPE(self),
- args, kwds, 0);
- if (res == -1)
- return -1;
- if (res < PyTuple_GET_SIZE(args)) {
- PyErr_SetString(PyExc_TypeError,
- "too many initializers");
- return -1;
- }
- }
-
- if (kwds) {
- PyObject *key, *value;
- Py_ssize_t pos = 0;
- while(PyDict_Next(kwds, &pos, &key, &value)) {
- if (-1 == PyObject_SetAttr(self, key, value))
- return -1;
- }
- }
- return 0;
-}
-
-static PyTypeObject Struct_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_ctypes.Structure",
- sizeof(CDataObject), /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- &PyCData_as_buffer, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- PyDoc_STR("Structure base class"), /* tp_doc */
- (traverseproc)PyCData_traverse, /* tp_traverse */
- (inquiry)PyCData_clear, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- 0, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- Struct_init, /* tp_init */
- 0, /* tp_alloc */
- GenericPyCData_new, /* tp_new */
- 0, /* tp_free */
-};
-
-static PyTypeObject Union_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_ctypes.Union",
- sizeof(CDataObject), /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- &PyCData_as_buffer, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- PyDoc_STR("Union base class"), /* tp_doc */
- (traverseproc)PyCData_traverse, /* tp_traverse */
- (inquiry)PyCData_clear, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- 0, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- Struct_init, /* tp_init */
- 0, /* tp_alloc */
- GenericPyCData_new, /* tp_new */
- 0, /* tp_free */
-};
-
-
-/******************************************************************/
-/*
- PyCArray_Type
-*/
-static int
-Array_init(CDataObject *self, PyObject *args, PyObject *kw)
-{
- Py_ssize_t i;
- Py_ssize_t n;
-
- if (!PyTuple_Check(args)) {
- PyErr_SetString(PyExc_TypeError,
- "args not a tuple?");
- return -1;
- }
- n = PyTuple_GET_SIZE(args);
- for (i = 0; i < n; ++i) {
- PyObject *v;
- v = PyTuple_GET_ITEM(args, i);
- if (-1 == PySequence_SetItem((PyObject *)self, i, v))
- return -1;
- }
- return 0;
-}
-
-static PyObject *
-Array_item(PyObject *myself, Py_ssize_t index)
-{
- CDataObject *self = (CDataObject *)myself;
- Py_ssize_t offset, size;
- StgDictObject *stgdict;
-
-
- if (index < 0 || index >= self->b_length) {
- PyErr_SetString(PyExc_IndexError,
- "invalid index");
- return NULL;
- }
-
- stgdict = PyObject_stgdict((PyObject *)self);
- assert(stgdict); /* Cannot be NULL for array instances */
- /* Would it be clearer if we got the item size from
- stgdict->proto's stgdict?
- */
- size = stgdict->size / stgdict->length;
- offset = index * size;
-
- return PyCData_get(stgdict->proto, stgdict->getfunc, (PyObject *)self,
- index, size, self->b_ptr + offset);
-}
-
-static PyObject *
-Array_subscript(PyObject *myself, PyObject *item)
-{
- CDataObject *self = (CDataObject *)myself;
-
- if (PyIndex_Check(item)) {
- Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
-
- if (i == -1 && PyErr_Occurred())
- return NULL;
- if (i < 0)
- i += self->b_length;
- return Array_item(myself, i);
- }
- else if (PySlice_Check(item)) {
- StgDictObject *stgdict, *itemdict;
- PyObject *proto;
- PyObject *np;
- Py_ssize_t start, stop, step, slicelen, i;
- size_t cur;
-
- if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
- return NULL;
- }
- slicelen = PySlice_AdjustIndices(self->b_length, &start, &stop, step);
-
- stgdict = PyObject_stgdict((PyObject *)self);
- assert(stgdict); /* Cannot be NULL for array object instances */
- proto = stgdict->proto;
- itemdict = PyType_stgdict(proto);
- assert(itemdict); /* proto is the item type of the array, a
- ctypes type, so this cannot be NULL */
-
- if (itemdict->getfunc == _ctypes_get_fielddesc("c")->getfunc) {
- char *ptr = (char *)self->b_ptr;
- char *dest;
-
- if (slicelen <= 0)
- return PyBytes_FromStringAndSize("", 0);
- if (step == 1) {
- return PyBytes_FromStringAndSize(ptr + start,
- slicelen);
- }
- dest = (char *)PyMem_Malloc(slicelen);
-
- if (dest == NULL)
- return PyErr_NoMemory();
-
- for (cur = start, i = 0; i < slicelen;
- cur += step, i++) {
- dest[i] = ptr[cur];
- }
-
- np = PyBytes_FromStringAndSize(dest, slicelen);
- PyMem_Free(dest);
- return np;
- }
- if (itemdict->getfunc == _ctypes_get_fielddesc("u")->getfunc) {
- wchar_t *ptr = (wchar_t *)self->b_ptr;
- wchar_t *dest;
-
- if (slicelen <= 0)
- return PyUnicode_New(0, 0);
- if (step == 1) {
- return PyUnicode_FromWideChar(ptr + start,
- slicelen);
- }
-
- dest = PyMem_New(wchar_t, slicelen);
- if (dest == NULL) {
- PyErr_NoMemory();
- return NULL;
- }
-
- for (cur = start, i = 0; i < slicelen;
- cur += step, i++) {
- dest[i] = ptr[cur];
- }
-
- np = PyUnicode_FromWideChar(dest, slicelen);
- PyMem_Free(dest);
- return np;
- }
-
- np = PyList_New(slicelen);
- if (np == NULL)
- return NULL;
-
- for (cur = start, i = 0; i < slicelen;
- cur += step, i++) {
- PyObject *v = Array_item(myself, cur);
- if (v == NULL) {
- Py_DECREF(np);
- return NULL;
- }
- PyList_SET_ITEM(np, i, v);
- }
- return np;
- }
- else {
- PyErr_SetString(PyExc_TypeError,
- "indices must be integers");
- return NULL;
- }
-
-}
-
-static int
-Array_ass_item(PyObject *myself, Py_ssize_t index, PyObject *value)
-{
- CDataObject *self = (CDataObject *)myself;
- Py_ssize_t size, offset;
- StgDictObject *stgdict;
- char *ptr;
-
- if (value == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "Array does not support item deletion");
- return -1;
- }
-
- stgdict = PyObject_stgdict((PyObject *)self);
- assert(stgdict); /* Cannot be NULL for array object instances */
- if (index < 0 || index >= stgdict->length) {
- PyErr_SetString(PyExc_IndexError,
- "invalid index");
- return -1;
- }
- size = stgdict->size / stgdict->length;
- offset = index * size;
- ptr = self->b_ptr + offset;
-
- return PyCData_set((PyObject *)self, stgdict->proto, stgdict->setfunc, value,
- index, size, ptr);
-}
-
-static int
-Array_ass_subscript(PyObject *myself, PyObject *item, PyObject *value)
-{
- CDataObject *self = (CDataObject *)myself;
-
- if (value == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "Array does not support item deletion");
- return -1;
- }
-
- if (PyIndex_Check(item)) {
- Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
-
- if (i == -1 && PyErr_Occurred())
- return -1;
- if (i < 0)
- i += self->b_length;
- return Array_ass_item(myself, i, value);
- }
- else if (PySlice_Check(item)) {
- Py_ssize_t start, stop, step, slicelen, otherlen, i;
- size_t cur;
-
- if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
- return -1;
- }
- slicelen = PySlice_AdjustIndices(self->b_length, &start, &stop, step);
- if ((step < 0 && start < stop) ||
- (step > 0 && start > stop))
- stop = start;
-
- otherlen = PySequence_Length(value);
- if (otherlen != slicelen) {
- PyErr_SetString(PyExc_ValueError,
- "Can only assign sequence of same size");
- return -1;
- }
- for (cur = start, i = 0; i < otherlen; cur += step, i++) {
- PyObject *item = PySequence_GetItem(value, i);
- int result;
- if (item == NULL)
- return -1;
- result = Array_ass_item(myself, cur, item);
- Py_DECREF(item);
- if (result == -1)
- return -1;
- }
- return 0;
- }
- else {
- PyErr_SetString(PyExc_TypeError,
- "indices must be integer");
- return -1;
- }
-}
-
-static Py_ssize_t
-Array_length(PyObject *myself)
-{
- CDataObject *self = (CDataObject *)myself;
- return self->b_length;
-}
-
-static PyMethodDef Array_methods[] = {
- {"__class_getitem__", Py_GenericAlias,
- METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
- { NULL, NULL }
-};
-
-static PySequenceMethods Array_as_sequence = {
- Array_length, /* sq_length; */
- 0, /* sq_concat; */
- 0, /* sq_repeat; */
- Array_item, /* sq_item; */
- 0, /* sq_slice; */
- Array_ass_item, /* sq_ass_item; */
- 0, /* sq_ass_slice; */
- 0, /* sq_contains; */
-
- 0, /* sq_inplace_concat; */
- 0, /* sq_inplace_repeat; */
-};
-
-static PyMappingMethods Array_as_mapping = {
- Array_length,
- Array_subscript,
- Array_ass_subscript,
-};
-
-PyTypeObject PyCArray_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_ctypes.Array",
- sizeof(CDataObject), /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- &Array_as_sequence, /* tp_as_sequence */
- &Array_as_mapping, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- &PyCData_as_buffer, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- PyDoc_STR("XXX to be provided"), /* tp_doc */
- (traverseproc)PyCData_traverse, /* tp_traverse */
- (inquiry)PyCData_clear, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- Array_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)Array_init, /* tp_init */
- 0, /* tp_alloc */
- GenericPyCData_new, /* tp_new */
- 0, /* tp_free */
-};
-
-PyObject *
-PyCArrayType_from_ctype(PyObject *itemtype, Py_ssize_t length)
-{
- static PyObject *cache;
- PyObject *key;
- PyObject *result;
- char name[256];
- PyObject *len;
-
- if (cache == NULL) {
- cache = PyDict_New();
- if (cache == NULL)
- return NULL;
- }
- len = PyLong_FromSsize_t(length);
- if (len == NULL)
- return NULL;
- key = PyTuple_Pack(2, itemtype, len);
- Py_DECREF(len);
- if (!key)
- return NULL;
- result = PyDict_GetItemProxy(cache, key);
- if (result) {
- Py_INCREF(result);
- Py_DECREF(key);
- return result;
- }
- else if (PyErr_Occurred()) {
- Py_DECREF(key);
- return NULL;
- }
-
- if (!PyType_Check(itemtype)) {
- PyErr_SetString(PyExc_TypeError,
- "Expected a type object");
- Py_DECREF(key);
- return NULL;
- }
-#ifdef MS_WIN64
- sprintf(name, "%.200s_Array_%Id",
- ((PyTypeObject *)itemtype)->tp_name, length);
-#else
- sprintf(name, "%.200s_Array_%ld",
- ((PyTypeObject *)itemtype)->tp_name, (long)length);
-#endif
-
- result = PyObject_CallFunction((PyObject *)&PyCArrayType_Type,
- "s(O){s:n,s:O}",
- name,
- &PyCArray_Type,
- "_length_",
- length,
- "_type_",
- itemtype
- );
- if (result == NULL) {
- Py_DECREF(key);
- return NULL;
- }
- if (-1 == PyDict_SetItemProxy(cache, key, result)) {
- Py_DECREF(key);
- Py_DECREF(result);
- return NULL;
- }
- Py_DECREF(key);
- return result;
-}
-
-
-/******************************************************************/
-/*
- Simple_Type
-*/
-
-static int
-Simple_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
-{
- PyObject *result;
- StgDictObject *dict = PyObject_stgdict((PyObject *)self);
-
- if (value == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "can't delete attribute");
- return -1;
- }
- assert(dict); /* Cannot be NULL for CDataObject instances */
- assert(dict->setfunc);
- result = dict->setfunc(self->b_ptr, value, dict->size);
- if (!result)
- return -1;
-
- /* consumes the refcount the setfunc returns */
- return KeepRef(self, 0, result);
-}
-
-static int
-Simple_init(CDataObject *self, PyObject *args, PyObject *kw)
-{
- PyObject *value = NULL;
- if (!PyArg_UnpackTuple(args, "__init__", 0, 1, &value))
- return -1;
- if (value)
- return Simple_set_value(self, value, NULL);
- return 0;
-}
-
-static PyObject *
-Simple_get_value(CDataObject *self, void *Py_UNUSED(ignored))
-{
- StgDictObject *dict;
- dict = PyObject_stgdict((PyObject *)self);
- assert(dict); /* Cannot be NULL for CDataObject instances */
- assert(dict->getfunc);
- return dict->getfunc(self->b_ptr, self->b_size);
-}
-
-static PyGetSetDef Simple_getsets[] = {
- { "value", (getter)Simple_get_value, (setter)Simple_set_value,
- "current value", NULL },
- { NULL, NULL }
-};
-
-static PyObject *
-Simple_from_outparm(PyObject *self, PyObject *args)
-{
- if (_ctypes_simple_instance((PyObject *)Py_TYPE(self))) {
- return Py_NewRef(self);
- }
- /* call stgdict->getfunc */
- return Simple_get_value((CDataObject *)self, NULL);
-}
-
-static PyMethodDef Simple_methods[] = {
- { "__ctypes_from_outparam__", Simple_from_outparm, METH_NOARGS, },
- { NULL, NULL },
-};
-
-static int Simple_bool(CDataObject *self)
-{
- return memcmp(self->b_ptr, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", self->b_size);
-}
-
-static PyNumberMethods Simple_as_number = {
- 0, /* nb_add */
- 0, /* nb_subtract */
- 0, /* nb_multiply */
- 0, /* nb_remainder */
- 0, /* nb_divmod */
- 0, /* nb_power */
- 0, /* nb_negative */
- 0, /* nb_positive */
- 0, /* nb_absolute */
- (inquiry)Simple_bool, /* nb_bool */
-};
-
-/* "%s(%s)" % (self.__class__.__name__, self.value) */
-static PyObject *
-Simple_repr(CDataObject *self)
-{
- PyObject *val, *result;
-
- if (Py_TYPE(self)->tp_base != &Simple_Type) {
- return PyUnicode_FromFormat("<%s object at %p>",
- Py_TYPE(self)->tp_name, self);
- }
-
- val = Simple_get_value(self, NULL);
- if (val == NULL)
- return NULL;
-
- result = PyUnicode_FromFormat("%s(%R)",
- Py_TYPE(self)->tp_name, val);
- Py_DECREF(val);
- return result;
-}
-
-static PyTypeObject Simple_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_ctypes._SimpleCData",
- sizeof(CDataObject), /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- (reprfunc)&Simple_repr, /* tp_repr */
- &Simple_as_number, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- &PyCData_as_buffer, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- PyDoc_STR("XXX to be provided"), /* tp_doc */
- (traverseproc)PyCData_traverse, /* tp_traverse */
- (inquiry)PyCData_clear, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- Simple_methods, /* tp_methods */
- 0, /* tp_members */
- Simple_getsets, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)Simple_init, /* tp_init */
- 0, /* tp_alloc */
- GenericPyCData_new, /* tp_new */
- 0, /* tp_free */
-};
-
-/******************************************************************/
-/*
- PyCPointer_Type
-*/
-static PyObject *
-Pointer_item(PyObject *myself, Py_ssize_t index)
-{
- CDataObject *self = (CDataObject *)myself;
- Py_ssize_t size;
- Py_ssize_t offset;
- StgDictObject *stgdict, *itemdict;
- PyObject *proto;
-
- if (*(void **)self->b_ptr == NULL) {
- PyErr_SetString(PyExc_ValueError,
- "NULL pointer access");
- return NULL;
- }
-
- stgdict = PyObject_stgdict((PyObject *)self);
- assert(stgdict); /* Cannot be NULL for pointer object instances */
-
- proto = stgdict->proto;
- assert(proto);
- itemdict = PyType_stgdict(proto);
- assert(itemdict); /* proto is the item type of the pointer, a ctypes
- type, so this cannot be NULL */
-
- size = itemdict->size;
- offset = index * itemdict->size;
-
- return PyCData_get(proto, stgdict->getfunc, (PyObject *)self,
- index, size, (*(char **)self->b_ptr) + offset);
-}
-
-static int
-Pointer_ass_item(PyObject *myself, Py_ssize_t index, PyObject *value)
-{
- CDataObject *self = (CDataObject *)myself;
- Py_ssize_t size;
- Py_ssize_t offset;
- StgDictObject *stgdict, *itemdict;
- PyObject *proto;
-
- if (value == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "Pointer does not support item deletion");
- return -1;
- }
-
- if (*(void **)self->b_ptr == NULL) {
- PyErr_SetString(PyExc_ValueError,
- "NULL pointer access");
- return -1;
- }
-
- stgdict = PyObject_stgdict((PyObject *)self);
- assert(stgdict); /* Cannot be NULL for pointer instances */
-
- proto = stgdict->proto;
- assert(proto);
-
- itemdict = PyType_stgdict(proto);
- assert(itemdict); /* Cannot be NULL because the itemtype of a pointer
- is always a ctypes type */
-
- size = itemdict->size;
- offset = index * itemdict->size;
-
- return PyCData_set((PyObject *)self, proto, stgdict->setfunc, value,
- index, size, (*(char **)self->b_ptr) + offset);
-}
-
-static PyObject *
-Pointer_get_contents(CDataObject *self, void *closure)
-{
- StgDictObject *stgdict;
-
- if (*(void **)self->b_ptr == NULL) {
- PyErr_SetString(PyExc_ValueError,
- "NULL pointer access");
- return NULL;
- }
-
- stgdict = PyObject_stgdict((PyObject *)self);
- assert(stgdict); /* Cannot be NULL for pointer instances */
- return PyCData_FromBaseObj(stgdict->proto,
- (PyObject *)self, 0,
- *(void **)self->b_ptr);
-}
-
-static int
-Pointer_set_contents(CDataObject *self, PyObject *value, void *closure)
-{
- StgDictObject *stgdict;
- CDataObject *dst;
- PyObject *keep;
-
- if (value == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "Pointer does not support item deletion");
- return -1;
- }
- stgdict = PyObject_stgdict((PyObject *)self);
- assert(stgdict); /* Cannot be NULL for pointer instances */
- assert(stgdict->proto);
- if (!CDataObject_Check(value)) {
- int res = PyObject_IsInstance(value, stgdict->proto);
- if (res == -1)
- return -1;
- if (!res) {
- PyErr_Format(PyExc_TypeError,
- "expected %s instead of %s",
- ((PyTypeObject *)(stgdict->proto))->tp_name,
- Py_TYPE(value)->tp_name);
- return -1;
- }
- }
-
- dst = (CDataObject *)value;
- *(void **)self->b_ptr = dst->b_ptr;
-
- /*
- A Pointer instance must keep the value it points to alive. So, a
- pointer instance has b_length set to 2 instead of 1, and we set
- 'value' itself as the second item of the b_objects list, additionally.
- */
- Py_INCREF(value);
- if (-1 == KeepRef(self, 1, value))
- return -1;
-
- keep = GetKeepedObjects(dst);
- if (keep == NULL)
- return -1;
-
- Py_INCREF(keep);
- return KeepRef(self, 0, keep);
-}
-
-static PyGetSetDef Pointer_getsets[] = {
- { "contents", (getter)Pointer_get_contents,
- (setter)Pointer_set_contents,
- "the object this pointer points to (read-write)", NULL },
- { NULL, NULL }
-};
-
-static int
-Pointer_init(CDataObject *self, PyObject *args, PyObject *kw)
-{
- PyObject *value = NULL;
-
- if (!PyArg_UnpackTuple(args, "POINTER", 0, 1, &value))
- return -1;
- if (value == NULL)
- return 0;
- return Pointer_set_contents(self, value, NULL);
-}
-
-static PyObject *
-Pointer_new(PyTypeObject *type, PyObject *args, PyObject *kw)
-{
- StgDictObject *dict = PyType_stgdict((PyObject *)type);
- if (!dict || !dict->proto) {
- PyErr_SetString(PyExc_TypeError,
- "Cannot create instance: has no _type_");
- return NULL;
- }
- return GenericPyCData_new(type, args, kw);
-}
-
-static PyObject *
-Pointer_subscript(PyObject *myself, PyObject *item)
-{
- CDataObject *self = (CDataObject *)myself;
- if (PyIndex_Check(item)) {
- Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
- if (i == -1 && PyErr_Occurred())
- return NULL;
- return Pointer_item(myself, i);
- }
- else if (PySlice_Check(item)) {
- PySliceObject *slice = (PySliceObject *)item;
- Py_ssize_t start, stop, step;
- PyObject *np;
- StgDictObject *stgdict, *itemdict;
- PyObject *proto;
- Py_ssize_t i, len;
- size_t cur;
-
- /* Since pointers have no length, and we want to apply
- different semantics to negative indices than normal
- slicing, we have to dissect the slice object ourselves.*/
- if (slice->step == Py_None) {
- step = 1;
- }
- else {
- step = PyNumber_AsSsize_t(slice->step,
- PyExc_ValueError);
- if (step == -1 && PyErr_Occurred())
- return NULL;
- if (step == 0) {
- PyErr_SetString(PyExc_ValueError,
- "slice step cannot be zero");
- return NULL;
- }
- }
- if (slice->start == Py_None) {
- if (step < 0) {
- PyErr_SetString(PyExc_ValueError,
- "slice start is required "
- "for step < 0");
- return NULL;
- }
- start = 0;
- }
- else {
- start = PyNumber_AsSsize_t(slice->start,
- PyExc_ValueError);
- if (start == -1 && PyErr_Occurred())
- return NULL;
- }
- if (slice->stop == Py_None) {
- PyErr_SetString(PyExc_ValueError,
- "slice stop is required");
- return NULL;
- }
- stop = PyNumber_AsSsize_t(slice->stop,
- PyExc_ValueError);
- if (stop == -1 && PyErr_Occurred())
- return NULL;
- if ((step > 0 && start > stop) ||
- (step < 0 && start < stop))
- len = 0;
- else if (step > 0)
- len = (stop - start - 1) / step + 1;
- else
- len = (stop - start + 1) / step + 1;
-
- stgdict = PyObject_stgdict((PyObject *)self);
- assert(stgdict); /* Cannot be NULL for pointer instances */
- proto = stgdict->proto;
- assert(proto);
- itemdict = PyType_stgdict(proto);
- assert(itemdict);
- if (itemdict->getfunc == _ctypes_get_fielddesc("c")->getfunc) {
- char *ptr = *(char **)self->b_ptr;
- char *dest;
-
- if (len <= 0)
- return PyBytes_FromStringAndSize("", 0);
- if (step == 1) {
- return PyBytes_FromStringAndSize(ptr + start,
- len);
- }
- dest = (char *)PyMem_Malloc(len);
- if (dest == NULL)
- return PyErr_NoMemory();
- for (cur = start, i = 0; i < len; cur += step, i++) {
- dest[i] = ptr[cur];
- }
- np = PyBytes_FromStringAndSize(dest, len);
- PyMem_Free(dest);
- return np;
- }
- if (itemdict->getfunc == _ctypes_get_fielddesc("u")->getfunc) {
- wchar_t *ptr = *(wchar_t **)self->b_ptr;
- wchar_t *dest;
-
- if (len <= 0)
- return PyUnicode_New(0, 0);
- if (step == 1) {
- return PyUnicode_FromWideChar(ptr + start,
- len);
- }
- dest = PyMem_New(wchar_t, len);
- if (dest == NULL)
- return PyErr_NoMemory();
- for (cur = start, i = 0; i < len; cur += step, i++) {
- dest[i] = ptr[cur];
- }
- np = PyUnicode_FromWideChar(dest, len);
- PyMem_Free(dest);
- return np;
- }
-
- np = PyList_New(len);
- if (np == NULL)
- return NULL;
-
- for (cur = start, i = 0; i < len; cur += step, i++) {
- PyObject *v = Pointer_item(myself, cur);
- PyList_SET_ITEM(np, i, v);
- }
- return np;
- }
- else {
- PyErr_SetString(PyExc_TypeError,
- "Pointer indices must be integer");
- return NULL;
- }
-}
-
-static PySequenceMethods Pointer_as_sequence = {
- 0, /* inquiry sq_length; */
- 0, /* binaryfunc sq_concat; */
- 0, /* intargfunc sq_repeat; */
- Pointer_item, /* intargfunc sq_item; */
- 0, /* intintargfunc sq_slice; */
- Pointer_ass_item, /* intobjargproc sq_ass_item; */
- 0, /* intintobjargproc sq_ass_slice; */
- 0, /* objobjproc sq_contains; */
- /* Added in release 2.0 */
- 0, /* binaryfunc sq_inplace_concat; */
- 0, /* intargfunc sq_inplace_repeat; */
-};
-
-static PyMappingMethods Pointer_as_mapping = {
- 0,
- Pointer_subscript,
-};
-
-static int
-Pointer_bool(CDataObject *self)
-{
- return (*(void **)self->b_ptr != NULL);
-}
-
-static PyNumberMethods Pointer_as_number = {
- 0, /* nb_add */
- 0, /* nb_subtract */
- 0, /* nb_multiply */
- 0, /* nb_remainder */
- 0, /* nb_divmod */
- 0, /* nb_power */
- 0, /* nb_negative */
- 0, /* nb_positive */
- 0, /* nb_absolute */
- (inquiry)Pointer_bool, /* nb_bool */
-};
-
-PyTypeObject PyCPointer_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_ctypes._Pointer",
- sizeof(CDataObject), /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- &Pointer_as_number, /* tp_as_number */
- &Pointer_as_sequence, /* tp_as_sequence */
- &Pointer_as_mapping, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- &PyCData_as_buffer, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- PyDoc_STR("XXX to be provided"), /* tp_doc */
- (traverseproc)PyCData_traverse, /* tp_traverse */
- (inquiry)PyCData_clear, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- 0, /* tp_methods */
- 0, /* tp_members */
- Pointer_getsets, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)Pointer_init, /* tp_init */
- 0, /* tp_alloc */
- Pointer_new, /* tp_new */
- 0, /* tp_free */
-};
-
-
-/******************************************************************/
-/*
- * Module initialization.
- */
-
-PyDoc_STRVAR(_ctypes__doc__,
-"Create and manipulate C compatible data types in Python.");
-
-#ifdef MS_WIN32
-
-PyDoc_STRVAR(comerror_doc, "Raised when a COM method call failed.");
-
-int
-comerror_init(PyObject *self, PyObject *args, PyObject *kwds)
-{
- PyObject *hresult, *text, *details;
- PyObject *a;
- int status;
-
- if (!_PyArg_NoKeywords(Py_TYPE(self)->tp_name, kwds))
- return -1;
-
- if (!PyArg_ParseTuple(args, "OOO:COMError", &hresult, &text, &details))
- return -1;
-
- a = PySequence_GetSlice(args, 1, PyTuple_GET_SIZE(args));
- if (!a)
- return -1;
- status = PyObject_SetAttrString(self, "args", a);
- Py_DECREF(a);
- if (status < 0)
- return -1;
-
- if (PyObject_SetAttrString(self, "hresult", hresult) < 0)
- return -1;
-
- if (PyObject_SetAttrString(self, "text", text) < 0)
- return -1;
-
- if (PyObject_SetAttrString(self, "details", details) < 0)
- return -1;
-
- Py_INCREF(args);
- Py_SETREF(((PyBaseExceptionObject *)self)->args, args);
-
- return 0;
-}
-
-static int
-comerror_clear(PyObject *self)
-{
- return ((PyTypeObject *)PyExc_BaseException)->tp_clear(self);
-}
-
-static int
-comerror_traverse(PyObject *self, visitproc visit, void *arg)
-{
- Py_VISIT(Py_TYPE(self));
- return ((PyTypeObject *)PyExc_BaseException)->tp_traverse(self, visit, arg);
-}
-
-static void
-comerror_dealloc(PyObject *self)
-{
- PyTypeObject *tp = Py_TYPE(self);
- PyObject_GC_UnTrack(self);
- (void)comerror_clear(self);
- tp->tp_free(self);
- Py_DECREF(tp);
-}
-
-static PyType_Slot comerror_slots[] = {
- {Py_tp_doc, (void *)PyDoc_STR(comerror_doc)},
- {Py_tp_init, comerror_init},
- {Py_tp_traverse, comerror_traverse},
- {Py_tp_dealloc, comerror_dealloc},
- {Py_tp_clear, comerror_clear},
- {0, NULL},
-};
-
-static PyType_Spec comerror_spec = {
- .name = "_ctypes.COMError",
- .basicsize = sizeof(PyBaseExceptionObject),
- .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
- .slots = comerror_slots,
-};
-
-#endif // MS_WIN32
-
-static PyObject *
-string_at(const char *ptr, int size)
-{
- if (PySys_Audit("ctypes.string_at", "ni", (Py_ssize_t)ptr, size) < 0) {
- return NULL;
- }
- if (size == -1)
- return PyBytes_FromStringAndSize(ptr, strlen(ptr));
- return PyBytes_FromStringAndSize(ptr, size);
-}
-
-static int
-cast_check_pointertype(PyObject *arg)
-{
- StgDictObject *dict;
-
- if (PyCPointerTypeObject_Check(arg))
- return 1;
- if (PyCFuncPtrTypeObject_Check(arg))
- return 1;
- dict = PyType_stgdict(arg);
- if (dict != NULL && dict->proto != NULL) {
- if (PyUnicode_Check(dict->proto)
- && (strchr("sPzUZXO", PyUnicode_AsUTF8(dict->proto)[0]))) {
- /* simple pointer types, c_void_p, c_wchar_p, BSTR, ... */
- return 1;
- }
- }
- PyErr_Format(PyExc_TypeError,
- "cast() argument 2 must be a pointer type, not %s",
- PyType_Check(arg)
- ? ((PyTypeObject *)arg)->tp_name
- : Py_TYPE(arg)->tp_name);
- return 0;
-}
-
-static PyObject *
-cast(void *ptr, PyObject *src, PyObject *ctype)
-{
- CDataObject *result;
- if (0 == cast_check_pointertype(ctype))
- return NULL;
- result = (CDataObject *)_PyObject_CallNoArgs(ctype);
- if (result == NULL)
- return NULL;
-
- /*
- The casted objects '_objects' member:
-
- It must certainly contain the source objects one.
- It must contain the source object itself.
- */
- if (CDataObject_Check(src)) {
- CDataObject *obj = (CDataObject *)src;
- CDataObject *container;
-
- /* PyCData_GetContainer will initialize src.b_objects, we need
- this so it can be shared */
- container = PyCData_GetContainer(obj);
- if (container == NULL)
- goto failed;
-
- /* But we need a dictionary! */
- if (obj->b_objects == Py_None) {
- Py_DECREF(Py_None);
- obj->b_objects = PyDict_New();
- if (obj->b_objects == NULL)
- goto failed;
- }
- result->b_objects = Py_XNewRef(obj->b_objects);
- if (result->b_objects && PyDict_CheckExact(result->b_objects)) {
- PyObject *index;
- int rc;
- index = PyLong_FromVoidPtr((void *)src);
- if (index == NULL)
- goto failed;
- rc = PyDict_SetItem(result->b_objects, index, src);
- Py_DECREF(index);
- if (rc == -1)
- goto failed;
- }
- }
- /* Should we assert that result is a pointer type? */
- memcpy(result->b_ptr, &ptr, sizeof(void *));
- return (PyObject *)result;
-
- failed:
- Py_DECREF(result);
- return NULL;
-}
-
-
-static PyObject *
-wstring_at(const wchar_t *ptr, int size)
-{
- Py_ssize_t ssize = size;
- if (PySys_Audit("ctypes.wstring_at", "nn", (Py_ssize_t)ptr, ssize) < 0) {
- return NULL;
- }
- if (ssize == -1)
- ssize = wcslen(ptr);
- return PyUnicode_FromWideChar(ptr, ssize);
-}
-
-
-static struct PyModuleDef _ctypesmodule = {
- PyModuleDef_HEAD_INIT,
- .m_name = "_ctypes",
- .m_doc = _ctypes__doc__,
- .m_size = -1,
- .m_methods = _ctypes_module_methods,
-};
-
-
-static int
-_ctypes_add_types(PyObject *mod)
-{
-#define TYPE_READY(TYPE) \
- if (PyType_Ready(TYPE) < 0) { \
- return -1; \
- }
-
-#define TYPE_READY_BASE(TYPE_EXPR, TP_BASE) \
- do { \
- PyTypeObject *type = (TYPE_EXPR); \
- type->tp_base = (TP_BASE); \
- TYPE_READY(type); \
- } while (0)
-
-#define MOD_ADD_TYPE(TYPE_EXPR, TP_TYPE, TP_BASE) \
- do { \
- PyTypeObject *type = (TYPE_EXPR); \
- Py_SET_TYPE(type, TP_TYPE); \
- type->tp_base = TP_BASE; \
- if (PyModule_AddType(mod, type) < 0) { \
- return -1; \
- } \
- } while (0)
-
-#define CREATE_TYPE(MOD, TP, SPEC, BASE) do { \
- PyObject *type = PyType_FromMetaclass(NULL, MOD, SPEC, \
- (PyObject *)BASE); \
- if (type == NULL) { \
- return -1; \
- } \
- TP = (PyTypeObject *)type; \
-} while (0)
-
- ctypes_state *st = GLOBAL_STATE();
-
- /* Note:
- ob_type is the metatype (the 'type'), defaults to PyType_Type,
- tp_base is the base type, defaults to 'object' aka PyBaseObject_Type.
- */
- CREATE_TYPE(mod, st->PyCArg_Type, &carg_spec, NULL);
- CREATE_TYPE(mod, st->PyCThunk_Type, &cthunk_spec, NULL);
- TYPE_READY(&PyCData_Type);
- /* StgDict is derived from PyDict_Type */
- TYPE_READY_BASE(&PyCStgDict_Type, &PyDict_Type);
-
- /*************************************************
- *
- * Metaclasses
- */
- TYPE_READY_BASE(&PyCStructType_Type, &PyType_Type);
- TYPE_READY_BASE(&UnionType_Type, &PyType_Type);
- TYPE_READY_BASE(&PyCPointerType_Type, &PyType_Type);
- TYPE_READY_BASE(&PyCArrayType_Type, &PyType_Type);
- TYPE_READY_BASE(&PyCSimpleType_Type, &PyType_Type);
- TYPE_READY_BASE(&PyCFuncPtrType_Type, &PyType_Type);
-
- /*************************************************
- *
- * Classes using a custom metaclass
- */
-
- MOD_ADD_TYPE(&Struct_Type, &PyCStructType_Type, &PyCData_Type);
- MOD_ADD_TYPE(&Union_Type, &UnionType_Type, &PyCData_Type);
- MOD_ADD_TYPE(&PyCPointer_Type, &PyCPointerType_Type, &PyCData_Type);
- MOD_ADD_TYPE(&PyCArray_Type, &PyCArrayType_Type, &PyCData_Type);
- MOD_ADD_TYPE(&Simple_Type, &PyCSimpleType_Type, &PyCData_Type);
- MOD_ADD_TYPE(&PyCFuncPtr_Type, &PyCFuncPtrType_Type, &PyCData_Type);
-
- /*************************************************
- *
- * Simple classes
- */
-
- CREATE_TYPE(mod, st->PyCField_Type, &cfield_spec, NULL);
-
- /*************************************************
- *
- * Other stuff
- */
-
- CREATE_TYPE(mod, st->DictRemover_Type, &dictremover_spec, NULL);
- CREATE_TYPE(mod, st->StructParam_Type, &structparam_spec, NULL);
-
-#ifdef MS_WIN32
- CREATE_TYPE(mod, st->PyComError_Type, &comerror_spec, PyExc_Exception);
-#endif
-
-#undef TYPE_READY
-#undef TYPE_READY_BASE
-#undef MOD_ADD_TYPE
-#undef CREATE_TYPE
- return 0;
-}
-
-
-static int
-_ctypes_add_objects(PyObject *mod)
-{
-#define MOD_ADD(name, expr) \
- do { \
- PyObject *obj = (expr); \
- if (obj == NULL) { \
- return -1; \
- } \
- if (PyModule_AddObjectRef(mod, name, obj) < 0) { \
- Py_DECREF(obj); \
- return -1; \
- } \
- Py_DECREF(obj); \
- } while (0)
-
- MOD_ADD("_pointer_type_cache", Py_NewRef(_ctypes_ptrtype_cache));
-
-#ifdef MS_WIN32
- ctypes_state *st = GLOBAL_STATE();
- MOD_ADD("COMError", Py_NewRef(st->PyComError_Type));
- MOD_ADD("FUNCFLAG_HRESULT", PyLong_FromLong(FUNCFLAG_HRESULT));
- MOD_ADD("FUNCFLAG_STDCALL", PyLong_FromLong(FUNCFLAG_STDCALL));
-#endif
- MOD_ADD("FUNCFLAG_CDECL", PyLong_FromLong(FUNCFLAG_CDECL));
- MOD_ADD("FUNCFLAG_USE_ERRNO", PyLong_FromLong(FUNCFLAG_USE_ERRNO));
- MOD_ADD("FUNCFLAG_USE_LASTERROR", PyLong_FromLong(FUNCFLAG_USE_LASTERROR));
- MOD_ADD("FUNCFLAG_PYTHONAPI", PyLong_FromLong(FUNCFLAG_PYTHONAPI));
- MOD_ADD("__version__", PyUnicode_FromString("1.1.0"));
-
- MOD_ADD("_memmove_addr", PyLong_FromVoidPtr(memmove));
- MOD_ADD("_memset_addr", PyLong_FromVoidPtr(memset));
- MOD_ADD("_string_at_addr", PyLong_FromVoidPtr(string_at));
- MOD_ADD("_cast_addr", PyLong_FromVoidPtr(cast));
- MOD_ADD("_wstring_at_addr", PyLong_FromVoidPtr(wstring_at));
-
-/* If RTLD_LOCAL is not defined (Windows!), set it to zero. */
-#if !HAVE_DECL_RTLD_LOCAL
-# define RTLD_LOCAL 0
-#endif
-
-/* If RTLD_GLOBAL is not defined (cygwin), set it to the same value as
- RTLD_LOCAL. */
-#if !HAVE_DECL_RTLD_GLOBAL
-# define RTLD_GLOBAL RTLD_LOCAL
-#endif
- MOD_ADD("RTLD_LOCAL", PyLong_FromLong(RTLD_LOCAL));
- MOD_ADD("RTLD_GLOBAL", PyLong_FromLong(RTLD_GLOBAL));
- MOD_ADD("CTYPES_MAX_ARGCOUNT", PyLong_FromLong(CTYPES_MAX_ARGCOUNT));
- MOD_ADD("ArgumentError", Py_NewRef(PyExc_ArgError));
- MOD_ADD("SIZEOF_TIME_T", PyLong_FromSsize_t(SIZEOF_TIME_T));
- return 0;
-#undef MOD_ADD
-}
-
-
-static int
-_ctypes_mod_exec(PyObject *mod)
-{
- _unpickle = PyObject_GetAttrString(mod, "_unpickle");
- if (_unpickle == NULL) {
- return -1;
- }
-
- _ctypes_ptrtype_cache = PyDict_New();
- if (_ctypes_ptrtype_cache == NULL) {
- return -1;
- }
-
- PyExc_ArgError = PyErr_NewException("ctypes.ArgumentError", NULL, NULL);
- if (!PyExc_ArgError) {
- return -1;
- }
-
- if (_ctypes_add_types(mod) < 0) {
- return -1;
- }
-
- if (_ctypes_add_objects(mod) < 0) {
- return -1;
- }
- return 0;
-}
-
-
-PyMODINIT_FUNC
-PyInit__ctypes(void)
-{
- PyObject *mod = PyModule_Create(&_ctypesmodule);
- if (!mod) {
- return NULL;
- }
-
- if (_ctypes_mod_exec(mod) < 0) {
- Py_DECREF(mod);
- return NULL;
- }
- return mod;
-}
-
-/*
- Local Variables:
- compile-command: "cd .. && python setup.py -q build -g && python setup.py -q build install --home ~"
- End:
-*/
diff --git a/contrib/tools/python3/src/Modules/_ctypes/callbacks.c b/contrib/tools/python3/src/Modules/_ctypes/callbacks.c
deleted file mode 100644
index 58f6249f8df..00000000000
--- a/contrib/tools/python3/src/Modules/_ctypes/callbacks.c
+++ /dev/null
@@ -1,613 +0,0 @@
-#ifndef Py_BUILD_CORE_BUILTIN
-# define Py_BUILD_CORE_MODULE 1
-#endif
-
-#include "Python.h"
-// windows.h must be included before pycore internal headers
-#ifdef MS_WIN32
-# include <windows.h>
-# include <Unknwn.h>
-#endif
-
-#include "pycore_call.h" // _PyObject_CallNoArgs()
-#include "pycore_runtime.h" // _PyRuntime
-#include "pycore_global_objects.h" // _Py_ID()
-
-#include <stdbool.h>
-
-#ifdef MS_WIN32
-# include <malloc.h>
-#endif
-
-#include <ffi.h>
-#include "ctypes.h"
-
-#ifdef HAVE_ALLOCA_H
-/* AIX needs alloca.h for alloca() */
-#include <alloca.h>
-#endif
-
-/**************************************************************/
-
-static int
-CThunkObject_traverse(PyObject *myself, visitproc visit, void *arg)
-{
- CThunkObject *self = (CThunkObject *)myself;
- Py_VISIT(Py_TYPE(self));
- Py_VISIT(self->converters);
- Py_VISIT(self->callable);
- Py_VISIT(self->restype);
- return 0;
-}
-
-static int
-CThunkObject_clear(PyObject *myself)
-{
- CThunkObject *self = (CThunkObject *)myself;
- Py_CLEAR(self->converters);
- Py_CLEAR(self->callable);
- Py_CLEAR(self->restype);
- return 0;
-}
-
-static void
-CThunkObject_dealloc(PyObject *myself)
-{
- CThunkObject *self = (CThunkObject *)myself;
- PyTypeObject *tp = Py_TYPE(myself);
- PyObject_GC_UnTrack(self);
- (void)CThunkObject_clear(myself);
- if (self->pcl_write) {
- Py_ffi_closure_free(self->pcl_write);
- }
- PyObject_GC_Del(self);
- Py_DECREF(tp);
-}
-
-static PyType_Slot cthunk_slots[] = {
- {Py_tp_doc, (void *)PyDoc_STR("CThunkObject")},
- {Py_tp_dealloc, CThunkObject_dealloc},
- {Py_tp_traverse, CThunkObject_traverse},
- {Py_tp_clear, CThunkObject_clear},
- {0, NULL},
-};
-
-PyType_Spec cthunk_spec = {
- .name = "_ctypes.CThunkObject",
- .basicsize = sizeof(CThunkObject),
- .itemsize = sizeof(ffi_type),
- .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
- Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
- .slots = cthunk_slots,
-};
-
-/**************************************************************/
-
-static void
-PrintError(const char *msg, ...)
-{
- char buf[512];
- PyObject *f = PySys_GetObject("stderr");
- va_list marker;
-
- va_start(marker, msg);
- PyOS_vsnprintf(buf, sizeof(buf), msg, marker);
- va_end(marker);
- if (f != NULL && f != Py_None)
- PyFile_WriteString(buf, f);
- PyErr_Print();
-}
-
-
-#ifdef MS_WIN32
-/*
- * We must call AddRef() on non-NULL COM pointers we receive as arguments
- * to callback functions - these functions are COM method implementations.
- * The Python instances we create have a __del__ method which calls Release().
- *
- * The presence of a class attribute named '_needs_com_addref_' triggers this
- * behaviour. It would also be possible to call the AddRef() Python method,
- * after checking for PyObject_IsTrue(), but this would probably be somewhat
- * slower.
- */
-static void
-TryAddRef(StgDictObject *dict, CDataObject *obj)
-{
- IUnknown *punk;
- int r = PyDict_Contains((PyObject *)dict, &_Py_ID(_needs_com_addref_));
- if (r <= 0) {
- if (r < 0) {
- PrintError("getting _needs_com_addref_");
- }
- return;
- }
-
- punk = *(IUnknown **)obj->b_ptr;
- if (punk)
- punk->lpVtbl->AddRef(punk);
- return;
-}
-#endif
-
-/******************************************************************************
- *
- * Call the python object with all arguments
- *
- */
-static void _CallPythonObject(void *mem,
- ffi_type *restype,
- SETFUNC setfunc,
- PyObject *callable,
- PyObject *converters,
- int flags,
- void **pArgs)
-{
- PyObject *result = NULL;
- Py_ssize_t i = 0, j = 0, nargs = 0;
- PyObject *error_object = NULL;
- int *space;
- PyGILState_STATE state = PyGILState_Ensure();
-
- assert(PyTuple_Check(converters));
- nargs = PyTuple_GET_SIZE(converters);
- assert(nargs <= CTYPES_MAX_ARGCOUNT);
- PyObject **args = alloca(nargs * sizeof(PyObject *));
- PyObject **cnvs = PySequence_Fast_ITEMS(converters);
- for (i = 0; i < nargs; i++) {
- PyObject *cnv = cnvs[i]; // borrowed ref
- StgDictObject *dict;
- dict = PyType_stgdict(cnv);
-
- if (dict && dict->getfunc && !_ctypes_simple_instance(cnv)) {
- PyObject *v = dict->getfunc(*pArgs, dict->size);
- if (!v) {
- PrintError("create argument %zd:\n", i);
- goto Done;
- }
- args[i] = v;
- /* XXX XXX XX
- We have the problem that c_byte or c_short have dict->size of
- 1 resp. 4, but these parameters are pushed as sizeof(int) bytes.
- BTW, the same problem occurs when they are pushed as parameters
- */
- } else if (dict) {
- /* Hm, shouldn't we use PyCData_AtAddress() or something like that instead? */
- CDataObject *obj = (CDataObject *)_PyObject_CallNoArgs(cnv);
- if (!obj) {
- PrintError("create argument %zd:\n", i);
- goto Done;
- }
- if (!CDataObject_Check(obj)) {
- Py_DECREF(obj);
- PrintError("unexpected result of create argument %zd:\n", i);
- goto Done;
- }
- memcpy(obj->b_ptr, *pArgs, dict->size);
- args[i] = (PyObject *)obj;
-#ifdef MS_WIN32
- TryAddRef(dict, obj);
-#endif
- } else {
- PyErr_SetString(PyExc_TypeError,
- "cannot build parameter");
- PrintError("Parsing argument %zd\n", i);
- goto Done;
- }
- /* XXX error handling! */
- pArgs++;
- }
-
- if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
- error_object = _ctypes_get_errobj(&space);
- if (error_object == NULL)
- goto Done;
- if (flags & FUNCFLAG_USE_ERRNO) {
- int temp = space[0];
- space[0] = errno;
- errno = temp;
- }
-#ifdef MS_WIN32
- if (flags & FUNCFLAG_USE_LASTERROR) {
- int temp = space[1];
- space[1] = GetLastError();
- SetLastError(temp);
- }
-#endif
- }
-
- result = PyObject_Vectorcall(callable, args, nargs, NULL);
- if (result == NULL) {
- _PyErr_WriteUnraisableMsg("on calling ctypes callback function",
- callable);
- }
-
-#ifdef MS_WIN32
- if (flags & FUNCFLAG_USE_LASTERROR) {
- int temp = space[1];
- space[1] = GetLastError();
- SetLastError(temp);
- }
-#endif
- if (flags & FUNCFLAG_USE_ERRNO) {
- int temp = space[0];
- space[0] = errno;
- errno = temp;
- }
- Py_XDECREF(error_object);
-
- if (restype != &ffi_type_void && result) {
- assert(setfunc);
-
-#ifdef WORDS_BIGENDIAN
- /* See the corresponding code in _ctypes_callproc():
- in callproc.c, around line 1219. */
- if (restype->type != FFI_TYPE_FLOAT && restype->size < sizeof(ffi_arg)) {
- mem = (char *)mem + sizeof(ffi_arg) - restype->size;
- }
-#endif
-
- /* keep is an object we have to keep alive so that the result
- stays valid. If there is no such object, the setfunc will
- have returned Py_None.
-
- If there is such an object, we have no choice than to keep
- it alive forever - but a refcount and/or memory leak will
- be the result. EXCEPT when restype is py_object - Python
- itself knows how to manage the refcount of these objects.
- */
- PyObject *keep = setfunc(mem, result, 0);
-
- if (keep == NULL) {
- /* Could not convert callback result. */
- _PyErr_WriteUnraisableMsg("on converting result "
- "of ctypes callback function",
- callable);
- }
- else if (setfunc != _ctypes_get_fielddesc("O")->setfunc) {
- if (keep == Py_None) {
- /* Nothing to keep */
- Py_DECREF(keep);
- }
- else if (PyErr_WarnEx(PyExc_RuntimeWarning,
- "memory leak in callback function.",
- 1) == -1) {
- _PyErr_WriteUnraisableMsg("on converting result "
- "of ctypes callback function",
- callable);
- }
- }
- }
-
- Py_XDECREF(result);
-
- Done:
- for (j = 0; j < i; j++) {
- Py_DECREF(args[j]);
- }
- PyGILState_Release(state);
-}
-
-static void closure_fcn(ffi_cif *cif,
- void *resp,
- void **args,
- void *userdata)
-{
- CThunkObject *p = (CThunkObject *)userdata;
-
- _CallPythonObject(resp,
- p->ffi_restype,
- p->setfunc,
- p->callable,
- p->converters,
- p->flags,
- args);
-}
-
-static CThunkObject* CThunkObject_new(Py_ssize_t nargs)
-{
- CThunkObject *p;
- Py_ssize_t i;
-
- ctypes_state *st = GLOBAL_STATE();
- p = PyObject_GC_NewVar(CThunkObject, st->PyCThunk_Type, nargs);
- if (p == NULL) {
- return NULL;
- }
-
- p->pcl_write = NULL;
- p->pcl_exec = NULL;
- memset(&p->cif, 0, sizeof(p->cif));
- p->flags = 0;
- p->converters = NULL;
- p->callable = NULL;
- p->restype = NULL;
- p->setfunc = NULL;
- p->ffi_restype = NULL;
-
- for (i = 0; i < nargs + 1; ++i)
- p->atypes[i] = NULL;
- PyObject_GC_Track((PyObject *)p);
- return p;
-}
-
-CThunkObject *_ctypes_alloc_callback(PyObject *callable,
- PyObject *converters,
- PyObject *restype,
- int flags)
-{
- int result;
- CThunkObject *p;
- Py_ssize_t nargs, i;
- ffi_abi cc;
-
- assert(PyTuple_Check(converters));
- nargs = PyTuple_GET_SIZE(converters);
- p = CThunkObject_new(nargs);
- if (p == NULL)
- return NULL;
-
-#ifdef Py_DEBUG
- ctypes_state *st = GLOBAL_STATE();
- assert(CThunk_CheckExact(st, (PyObject *)p));
-#endif
-
- p->pcl_write = Py_ffi_closure_alloc(sizeof(ffi_closure), &p->pcl_exec);
- if (p->pcl_write == NULL) {
- PyErr_NoMemory();
- goto error;
- }
-
- p->flags = flags;
- PyObject **cnvs = PySequence_Fast_ITEMS(converters);
- for (i = 0; i < nargs; ++i) {
- PyObject *cnv = cnvs[i]; // borrowed ref
- p->atypes[i] = _ctypes_get_ffi_type(cnv);
- }
- p->atypes[i] = NULL;
-
- p->restype = Py_NewRef(restype);
- if (restype == Py_None) {
- p->setfunc = NULL;
- p->ffi_restype = &ffi_type_void;
- } else {
- StgDictObject *dict = PyType_stgdict(restype);
- if (dict == NULL || dict->setfunc == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "invalid result type for callback function");
- goto error;
- }
- p->setfunc = dict->setfunc;
- p->ffi_restype = &dict->ffi_type_pointer;
- }
-
- cc = FFI_DEFAULT_ABI;
-#if defined(MS_WIN32) && !defined(_WIN32_WCE) && !defined(MS_WIN64) && !defined(_M_ARM)
- if ((flags & FUNCFLAG_CDECL) == 0)
- cc = FFI_STDCALL;
-#endif
- result = ffi_prep_cif(&p->cif, cc,
- Py_SAFE_DOWNCAST(nargs, Py_ssize_t, int),
- p->ffi_restype,
- &p->atypes[0]);
- if (result != FFI_OK) {
- PyErr_Format(PyExc_RuntimeError,
- "ffi_prep_cif failed with %d", result);
- goto error;
- }
-
-
-#if HAVE_FFI_PREP_CLOSURE_LOC
-# ifdef USING_APPLE_OS_LIBFFI
-# ifdef HAVE_BUILTIN_AVAILABLE
-# define HAVE_FFI_PREP_CLOSURE_LOC_RUNTIME __builtin_available(macos 10.15, ios 13, watchos 6, tvos 13, *)
-# else
-# define HAVE_FFI_PREP_CLOSURE_LOC_RUNTIME (ffi_prep_closure_loc != NULL)
-# endif
-# else
-# define HAVE_FFI_PREP_CLOSURE_LOC_RUNTIME 1
-# endif
- if (HAVE_FFI_PREP_CLOSURE_LOC_RUNTIME) {
- result = ffi_prep_closure_loc(p->pcl_write, &p->cif, closure_fcn,
- p,
- p->pcl_exec);
- } else
-#endif
- {
-#if defined(USING_APPLE_OS_LIBFFI) && defined(__arm64__)
- PyErr_Format(PyExc_NotImplementedError, "ffi_prep_closure_loc() is missing");
- goto error;
-#else
-#if defined(__clang__)
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#endif
-#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
- #pragma GCC diagnostic push
- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
- result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p);
-
-#if defined(__clang__)
- #pragma clang diagnostic pop
-#endif
-#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
- #pragma GCC diagnostic pop
-#endif
-
-#endif
- }
- if (result != FFI_OK) {
- PyErr_Format(PyExc_RuntimeError,
- "ffi_prep_closure failed with %d", result);
- goto error;
- }
-
- p->converters = Py_NewRef(converters);
- p->callable = Py_NewRef(callable);
- return p;
-
- error:
- Py_XDECREF(p);
- return NULL;
-}
-
-#ifdef MS_WIN32
-
-static void LoadPython(void)
-{
- if (!Py_IsInitialized()) {
- Py_Initialize();
- }
-}
-
-/******************************************************************/
-
-long Call_GetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
-{
- PyObject *func, *result;
- long retval;
- static PyObject *context;
-
- if (context == NULL)
- context = PyUnicode_InternFromString("_ctypes.DllGetClassObject");
-
- func = _PyImport_GetModuleAttrString("ctypes", "DllGetClassObject");
- if (!func) {
- PyErr_WriteUnraisable(context ? context : Py_None);
- /* There has been a warning before about this already */
- return E_FAIL;
- }
-
- {
- PyObject *py_rclsid = PyLong_FromVoidPtr((void *)rclsid);
- if (py_rclsid == NULL) {
- Py_DECREF(func);
- PyErr_WriteUnraisable(context ? context : Py_None);
- return E_FAIL;
- }
- PyObject *py_riid = PyLong_FromVoidPtr((void *)riid);
- if (py_riid == NULL) {
- Py_DECREF(func);
- Py_DECREF(py_rclsid);
- PyErr_WriteUnraisable(context ? context : Py_None);
- return E_FAIL;
- }
- PyObject *py_ppv = PyLong_FromVoidPtr(ppv);
- if (py_ppv == NULL) {
- Py_DECREF(py_rclsid);
- Py_DECREF(py_riid);
- Py_DECREF(func);
- PyErr_WriteUnraisable(context ? context : Py_None);
- return E_FAIL;
- }
- result = PyObject_CallFunctionObjArgs(func,
- py_rclsid,
- py_riid,
- py_ppv,
- NULL);
- Py_DECREF(py_rclsid);
- Py_DECREF(py_riid);
- Py_DECREF(py_ppv);
- }
- Py_DECREF(func);
- if (!result) {
- PyErr_WriteUnraisable(context ? context : Py_None);
- return E_FAIL;
- }
-
- retval = PyLong_AsLong(result);
- if (PyErr_Occurred()) {
- PyErr_WriteUnraisable(context ? context : Py_None);
- retval = E_FAIL;
- }
- Py_DECREF(result);
- return retval;
-}
-
-STDAPI DllGetClassObject(REFCLSID rclsid,
- REFIID riid,
- LPVOID *ppv)
-{
- long result;
- PyGILState_STATE state;
-
- LoadPython();
- state = PyGILState_Ensure();
- result = Call_GetClassObject(rclsid, riid, ppv);
- PyGILState_Release(state);
- return result;
-}
-
-long Call_CanUnloadNow(void)
-{
- PyObject *mod, *func, *result;
- long retval;
- static PyObject *context;
-
- if (context == NULL)
- context = PyUnicode_InternFromString("_ctypes.DllCanUnloadNow");
-
- mod = PyImport_ImportModule("ctypes");
- if (!mod) {
-/* OutputDebugString("Could not import ctypes"); */
- /* We assume that this error can only occur when shutting
- down, so we silently ignore it */
- PyErr_Clear();
- return E_FAIL;
- }
- /* Other errors cannot be raised, but are printed to stderr */
- func = PyObject_GetAttrString(mod, "DllCanUnloadNow");
- Py_DECREF(mod);
- if (!func) {
- PyErr_WriteUnraisable(context ? context : Py_None);
- return E_FAIL;
- }
-
- result = _PyObject_CallNoArgs(func);
- Py_DECREF(func);
- if (!result) {
- PyErr_WriteUnraisable(context ? context : Py_None);
- return E_FAIL;
- }
-
- retval = PyLong_AsLong(result);
- if (PyErr_Occurred()) {
- PyErr_WriteUnraisable(context ? context : Py_None);
- retval = E_FAIL;
- }
- Py_DECREF(result);
- return retval;
-}
-
-/*
- DllRegisterServer and DllUnregisterServer still missing
-*/
-
-STDAPI DllCanUnloadNow(void)
-{
- long result;
- PyGILState_STATE state = PyGILState_Ensure();
- result = Call_CanUnloadNow();
- PyGILState_Release(state);
- return result;
-}
-
-#ifndef Py_NO_ENABLE_SHARED
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvRes)
-{
- switch(fdwReason) {
- case DLL_PROCESS_ATTACH:
- DisableThreadLibraryCalls(hinstDLL);
- break;
- }
- return TRUE;
-}
-#endif
-
-#endif
-
-/*
- Local Variables:
- compile-command: "cd .. && python setup.py -q build_ext"
- End:
-*/
diff --git a/contrib/tools/python3/src/Modules/_ctypes/callproc.c b/contrib/tools/python3/src/Modules/_ctypes/callproc.c
deleted file mode 100644
index b46ccc2d86a..00000000000
--- a/contrib/tools/python3/src/Modules/_ctypes/callproc.c
+++ /dev/null
@@ -1,2039 +0,0 @@
-/*
- * History: First version dated from 3/97, derived from my SCMLIB version
- * for win16.
- */
-/*
- * Related Work:
- * - calldll http://www.nightmare.com/software.html
- * - libffi http://sourceware.cygnus.com/libffi/
- * - ffcall http://clisp.cons.org/~haible/packages-ffcall.html
- * and, of course, Don Beaudry's MESS package, but this is more ctypes
- * related.
- */
-
-
-/*
- How are functions called, and how are parameters converted to C ?
-
- 1. _ctypes.c::PyCFuncPtr_call receives an argument tuple 'inargs' and a
- keyword dictionary 'kwds'.
-
- 2. After several checks, _build_callargs() is called which returns another
- tuple 'callargs'. This may be the same tuple as 'inargs', a slice of
- 'inargs', or a completely fresh tuple, depending on several things (is it a
- COM method?, are 'paramflags' available?).
-
- 3. _build_callargs also calculates bitarrays containing indexes into
- the callargs tuple, specifying how to build the return value(s) of
- the function.
-
- 4. _ctypes_callproc is then called with the 'callargs' tuple. _ctypes_callproc first
- allocates two arrays. The first is an array of 'struct argument' items, the
- second array has 'void *' entries.
-
- 5. If 'converters' are present (converters is a sequence of argtypes'
- from_param methods), for each item in 'callargs' converter is called and the
- result passed to ConvParam. If 'converters' are not present, each argument
- is directly passed to ConvParm.
-
- 6. For each arg, ConvParam stores the contained C data (or a pointer to it,
- for structures) into the 'struct argument' array.
-
- 7. Finally, a loop fills the 'void *' array so that each item points to the
- data contained in or pointed to by the 'struct argument' array.
-
- 8. The 'void *' argument array is what _call_function_pointer
- expects. _call_function_pointer then has very little to do - only some
- libffi specific stuff, then it calls ffi_call.
-
- So, there are 4 data structures holding processed arguments:
- - the inargs tuple (in PyCFuncPtr_call)
- - the callargs tuple (in PyCFuncPtr_call)
- - the 'struct arguments' array
- - the 'void *' array
-
- */
-
-#ifndef Py_BUILD_CORE_BUILTIN
-# define Py_BUILD_CORE_MODULE 1
-#endif
-
-#include "Python.h"
-#include "structmember.h" // PyMemberDef
-
-#include <stdbool.h>
-
-#ifdef MS_WIN32
-#include <windows.h>
-#include <Unknwn.h>
-#include <tchar.h>
-#else
-#include <dlfcn.h>
-#endif
-
-#ifdef __APPLE__
-#include <mach-o/dyld.h>
-#endif
-
-#ifdef MS_WIN32
-#include <malloc.h>
-#endif
-
-#include <ffi.h>
-#include "ctypes.h"
-#ifdef HAVE_ALLOCA_H
-/* AIX needs alloca.h for alloca() */
-#include <alloca.h>
-#endif
-
-#ifdef _Py_MEMORY_SANITIZER
-#include <sanitizer/msan_interface.h>
-#endif
-
-#if defined(_DEBUG) || defined(__MINGW32__)
-/* Don't use structured exception handling on Windows if this is defined.
- MingW, AFAIK, doesn't support it.
-*/
-#define DONT_USE_SEH
-#endif
-
-#include "pycore_runtime.h" // _PyRuntime
-#include "pycore_global_objects.h" // _Py_ID()
-
-#define CTYPES_CAPSULE_NAME_PYMEM "_ctypes pymem"
-
-
-static void pymem_destructor(PyObject *ptr)
-{
- void *p = PyCapsule_GetPointer(ptr, CTYPES_CAPSULE_NAME_PYMEM);
- if (p) {
- PyMem_Free(p);
- }
-}
-
-/*
- ctypes maintains thread-local storage that has space for two error numbers:
- private copies of the system 'errno' value and, on Windows, the system error code
- accessed by the GetLastError() and SetLastError() api functions.
-
- Foreign functions created with CDLL(..., use_errno=True), when called, swap
- the system 'errno' value with the private copy just before the actual
- function call, and swapped again immediately afterwards. The 'use_errno'
- parameter defaults to False, in this case 'ctypes_errno' is not touched.
-
- On Windows, foreign functions created with CDLL(..., use_last_error=True) or
- WinDLL(..., use_last_error=True) swap the system LastError value with the
- ctypes private copy.
-
- The values are also swapped immediately before and after ctypes callback
- functions are called, if the callbacks are constructed using the new
- optional use_errno parameter set to True: CFUNCTYPE(..., use_errno=TRUE) or
- WINFUNCTYPE(..., use_errno=True).
-
- New ctypes functions are provided to access the ctypes private copies from
- Python:
-
- - ctypes.set_errno(value) and ctypes.set_last_error(value) store 'value' in
- the private copy and returns the previous value.
-
- - ctypes.get_errno() and ctypes.get_last_error() returns the current ctypes
- private copies value.
-*/
-
-/*
- This function creates and returns a thread-local Python object that has
- space to store two integer error numbers; once created the Python object is
- kept alive in the thread state dictionary as long as the thread itself.
-*/
-PyObject *
-_ctypes_get_errobj(int **pspace)
-{
- PyObject *dict = PyThreadState_GetDict();
- PyObject *errobj;
- static PyObject *error_object_name;
- if (dict == NULL) {
- PyErr_SetString(PyExc_RuntimeError,
- "cannot get thread state");
- return NULL;
- }
- if (error_object_name == NULL) {
- error_object_name = PyUnicode_InternFromString("ctypes.error_object");
- if (error_object_name == NULL)
- return NULL;
- }
- errobj = PyDict_GetItemWithError(dict, error_object_name);
- if (errobj) {
- if (!PyCapsule_IsValid(errobj, CTYPES_CAPSULE_NAME_PYMEM)) {
- PyErr_SetString(PyExc_RuntimeError,
- "ctypes.error_object is an invalid capsule");
- return NULL;
- }
- Py_INCREF(errobj);
- }
- else if (!PyErr_Occurred()) {
- void *space = PyMem_Calloc(2, sizeof(int));
- if (space == NULL)
- return NULL;
- errobj = PyCapsule_New(space, CTYPES_CAPSULE_NAME_PYMEM, pymem_destructor);
- if (errobj == NULL) {
- PyMem_Free(space);
- return NULL;
- }
- if (-1 == PyDict_SetItem(dict, error_object_name,
- errobj)) {
- Py_DECREF(errobj);
- return NULL;
- }
- }
- else {
- return NULL;
- }
- *pspace = (int *)PyCapsule_GetPointer(errobj, CTYPES_CAPSULE_NAME_PYMEM);
- return errobj;
-}
-
-static PyObject *
-get_error_internal(PyObject *self, PyObject *args, int index)
-{
- int *space;
- PyObject *errobj = _ctypes_get_errobj(&space);
- PyObject *result;
-
- if (errobj == NULL)
- return NULL;
- result = PyLong_FromLong(space[index]);
- Py_DECREF(errobj);
- return result;
-}
-
-static PyObject *
-set_error_internal(PyObject *self, PyObject *args, int index)
-{
- int new_errno, old_errno;
- PyObject *errobj;
- int *space;
-
- if (!PyArg_ParseTuple(args, "i", &new_errno)) {
- return NULL;
- }
- errobj = _ctypes_get_errobj(&space);
- if (errobj == NULL)
- return NULL;
- old_errno = space[index];
- space[index] = new_errno;
- Py_DECREF(errobj);
- return PyLong_FromLong(old_errno);
-}
-
-static PyObject *
-get_errno(PyObject *self, PyObject *args)
-{
- if (PySys_Audit("ctypes.get_errno", NULL) < 0) {
- return NULL;
- }
- return get_error_internal(self, args, 0);
-}
-
-static PyObject *
-set_errno(PyObject *self, PyObject *args)
-{
- if (PySys_Audit("ctypes.set_errno", "O", args) < 0) {
- return NULL;
- }
- return set_error_internal(self, args, 0);
-}
-
-#ifdef MS_WIN32
-
-static PyObject *
-get_last_error(PyObject *self, PyObject *args)
-{
- if (PySys_Audit("ctypes.get_last_error", NULL) < 0) {
- return NULL;
- }
- return get_error_internal(self, args, 1);
-}
-
-static PyObject *
-set_last_error(PyObject *self, PyObject *args)
-{
- if (PySys_Audit("ctypes.set_last_error", "O", args) < 0) {
- return NULL;
- }
- return set_error_internal(self, args, 1);
-}
-
-static WCHAR *FormatError(DWORD code)
-{
- WCHAR *lpMsgBuf;
- DWORD n;
- n = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- code,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
- (LPWSTR) &lpMsgBuf,
- 0,
- NULL);
- if (n) {
- while (iswspace(lpMsgBuf[n-1]))
- --n;
- lpMsgBuf[n] = L'\0'; /* rstrip() */
- }
- return lpMsgBuf;
-}
-
-#ifndef DONT_USE_SEH
-static void SetException(DWORD code, EXCEPTION_RECORD *pr)
-{
- if (PySys_Audit("ctypes.set_exception", "I", code) < 0) {
- /* An exception was set by the audit hook */
- return;
- }
-
- /* The 'code' is a normal win32 error code so it could be handled by
- PyErr_SetFromWindowsErr(). However, for some errors, we have additional
- information not included in the error code. We handle those here and
- delegate all others to the generic function. */
- switch (code) {
- case EXCEPTION_ACCESS_VIOLATION:
- /* The thread attempted to read from or write
- to a virtual address for which it does not
- have the appropriate access. */
- if (pr->ExceptionInformation[0] == 0)
- PyErr_Format(PyExc_OSError,
- "exception: access violation reading %p",
- pr->ExceptionInformation[1]);
- else
- PyErr_Format(PyExc_OSError,
- "exception: access violation writing %p",
- pr->ExceptionInformation[1]);
- break;
-
- case EXCEPTION_BREAKPOINT:
- /* A breakpoint was encountered. */
- PyErr_SetString(PyExc_OSError,
- "exception: breakpoint encountered");
- break;
-
- case EXCEPTION_DATATYPE_MISALIGNMENT:
- /* The thread attempted to read or write data that is
- misaligned on hardware that does not provide
- alignment. For example, 16-bit values must be
- aligned on 2-byte boundaries, 32-bit values on
- 4-byte boundaries, and so on. */
- PyErr_SetString(PyExc_OSError,
- "exception: datatype misalignment");
- break;
-
- case EXCEPTION_SINGLE_STEP:
- /* A trace trap or other single-instruction mechanism
- signaled that one instruction has been executed. */
- PyErr_SetString(PyExc_OSError,
- "exception: single step");
- break;
-
- case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
- /* The thread attempted to access an array element
- that is out of bounds, and the underlying hardware
- supports bounds checking. */
- PyErr_SetString(PyExc_OSError,
- "exception: array bounds exceeded");
- break;
-
- case EXCEPTION_FLT_DENORMAL_OPERAND:
- /* One of the operands in a floating-point operation
- is denormal. A denormal value is one that is too
- small to represent as a standard floating-point
- value. */
- PyErr_SetString(PyExc_OSError,
- "exception: floating-point operand denormal");
- break;
-
- case EXCEPTION_FLT_DIVIDE_BY_ZERO:
- /* The thread attempted to divide a floating-point
- value by a floating-point divisor of zero. */
- PyErr_SetString(PyExc_OSError,
- "exception: float divide by zero");
- break;
-
- case EXCEPTION_FLT_INEXACT_RESULT:
- /* The result of a floating-point operation cannot be
- represented exactly as a decimal fraction. */
- PyErr_SetString(PyExc_OSError,
- "exception: float inexact");
- break;
-
- case EXCEPTION_FLT_INVALID_OPERATION:
- /* This exception represents any floating-point
- exception not included in this list. */
- PyErr_SetString(PyExc_OSError,
- "exception: float invalid operation");
- break;
-
- case EXCEPTION_FLT_OVERFLOW:
- /* The exponent of a floating-point operation is
- greater than the magnitude allowed by the
- corresponding type. */
- PyErr_SetString(PyExc_OSError,
- "exception: float overflow");
- break;
-
- case EXCEPTION_FLT_STACK_CHECK:
- /* The stack overflowed or underflowed as the result
- of a floating-point operation. */
- PyErr_SetString(PyExc_OSError,
- "exception: stack over/underflow");
- break;
-
- case EXCEPTION_STACK_OVERFLOW:
- /* The stack overflowed or underflowed as the result
- of a floating-point operation. */
- PyErr_SetString(PyExc_OSError,
- "exception: stack overflow");
- break;
-
- case EXCEPTION_FLT_UNDERFLOW:
- /* The exponent of a floating-point operation is less
- than the magnitude allowed by the corresponding
- type. */
- PyErr_SetString(PyExc_OSError,
- "exception: float underflow");
- break;
-
- case EXCEPTION_INT_DIVIDE_BY_ZERO:
- /* The thread attempted to divide an integer value by
- an integer divisor of zero. */
- PyErr_SetString(PyExc_OSError,
- "exception: integer divide by zero");
- break;
-
- case EXCEPTION_INT_OVERFLOW:
- /* The result of an integer operation caused a carry
- out of the most significant bit of the result. */
- PyErr_SetString(PyExc_OSError,
- "exception: integer overflow");
- break;
-
- case EXCEPTION_PRIV_INSTRUCTION:
- /* The thread attempted to execute an instruction
- whose operation is not allowed in the current
- machine mode. */
- PyErr_SetString(PyExc_OSError,
- "exception: privileged instruction");
- break;
-
- case EXCEPTION_NONCONTINUABLE_EXCEPTION:
- /* The thread attempted to continue execution after a
- noncontinuable exception occurred. */
- PyErr_SetString(PyExc_OSError,
- "exception: nocontinuable");
- break;
-
- default:
- PyErr_SetFromWindowsErr(code);
- break;
- }
-}
-
-static DWORD HandleException(EXCEPTION_POINTERS *ptrs,
- DWORD *pdw, EXCEPTION_RECORD *record)
-{
- *pdw = ptrs->ExceptionRecord->ExceptionCode;
- *record = *ptrs->ExceptionRecord;
- /* We don't want to catch breakpoint exceptions, they are used to attach
- * a debugger to the process.
- */
- if (*pdw == EXCEPTION_BREAKPOINT)
- return EXCEPTION_CONTINUE_SEARCH;
- return EXCEPTION_EXECUTE_HANDLER;
-}
-#endif
-
-static PyObject *
-check_hresult(PyObject *self, PyObject *args)
-{
- HRESULT hr;
- if (!PyArg_ParseTuple(args, "i", &hr))
- return NULL;
- if (FAILED(hr))
- return PyErr_SetFromWindowsErr(hr);
- return PyLong_FromLong(hr);
-}
-
-#endif
-
-/**************************************************************/
-
-PyCArgObject *
-PyCArgObject_new(void)
-{
- PyCArgObject *p;
- ctypes_state *st = GLOBAL_STATE();
- p = PyObject_GC_New(PyCArgObject, st->PyCArg_Type);
- if (p == NULL)
- return NULL;
- p->pffi_type = NULL;
- p->tag = '\0';
- p->obj = NULL;
- memset(&p->value, 0, sizeof(p->value));
- PyObject_GC_Track(p);
- return p;
-}
-
-static int
-PyCArg_traverse(PyCArgObject *self, visitproc visit, void *arg)
-{
- Py_VISIT(Py_TYPE(self));
- Py_VISIT(self->obj);
- return 0;
-}
-
-static int
-PyCArg_clear(PyCArgObject *self)
-{
- Py_CLEAR(self->obj);
- return 0;
-}
-
-static void
-PyCArg_dealloc(PyCArgObject *self)
-{
- PyTypeObject *tp = Py_TYPE(self);
- PyObject_GC_UnTrack(self);
- (void)PyCArg_clear(self);
- tp->tp_free((PyObject *)self);
- Py_DECREF(tp);
-}
-
-static int
-is_literal_char(unsigned char c)
-{
- return c < 128 && _PyUnicode_IsPrintable(c) && c != '\\' && c != '\'';
-}
-
-static PyObject *
-PyCArg_repr(PyCArgObject *self)
-{
- switch(self->tag) {
- case 'b':
- case 'B':
- return PyUnicode_FromFormat("<cparam '%c' (%d)>",
- self->tag, self->value.b);
- case 'h':
- case 'H':
- return PyUnicode_FromFormat("<cparam '%c' (%d)>",
- self->tag, self->value.h);
- case 'i':
- case 'I':
- return PyUnicode_FromFormat("<cparam '%c' (%d)>",
- self->tag, self->value.i);
- case 'l':
- case 'L':
- return PyUnicode_FromFormat("<cparam '%c' (%ld)>",
- self->tag, self->value.l);
-
- case 'q':
- case 'Q':
- return PyUnicode_FromFormat("<cparam '%c' (%lld)>",
- self->tag, self->value.q);
- case 'd':
- case 'f': {
- PyObject *f = PyFloat_FromDouble((self->tag == 'f') ? self->value.f : self->value.d);
- if (f == NULL) {
- return NULL;
- }
- PyObject *result = PyUnicode_FromFormat("<cparam '%c' (%R)>", self->tag, f);
- Py_DECREF(f);
- return result;
- }
- case 'c':
- if (is_literal_char((unsigned char)self->value.c)) {
- return PyUnicode_FromFormat("<cparam '%c' ('%c')>",
- self->tag, self->value.c);
- }
- else {
- return PyUnicode_FromFormat("<cparam '%c' ('\\x%02x')>",
- self->tag, (unsigned char)self->value.c);
- }
-
-/* Hm, are these 'z' and 'Z' codes useful at all?
- Shouldn't they be replaced by the functionality of create_string_buffer()
- and c_wstring() ?
-*/
- case 'z':
- case 'Z':
- case 'P':
- return PyUnicode_FromFormat("<cparam '%c' (%p)>",
- self->tag, self->value.p);
- break;
-
- default:
- if (is_literal_char((unsigned char)self->tag)) {
- return PyUnicode_FromFormat("<cparam '%c' at %p>",
- (unsigned char)self->tag, (void *)self);
- }
- else {
- return PyUnicode_FromFormat("<cparam 0x%02x at %p>",
- (unsigned char)self->tag, (void *)self);
- }
- }
-}
-
-static PyMemberDef PyCArgType_members[] = {
- { "_obj", T_OBJECT,
- offsetof(PyCArgObject, obj), READONLY,
- "the wrapped object" },
- { NULL },
-};
-
-static PyType_Slot carg_slots[] = {
- {Py_tp_dealloc, PyCArg_dealloc},
- {Py_tp_traverse, PyCArg_traverse},
- {Py_tp_clear, PyCArg_clear},
- {Py_tp_repr, PyCArg_repr},
- {Py_tp_members, PyCArgType_members},
- {0, NULL},
-};
-
-PyType_Spec carg_spec = {
- .name = "_ctypes.CArgObject",
- .basicsize = sizeof(PyCArgObject),
- .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
- Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
- .slots = carg_slots,
-};
-
-/****************************************************************/
-/*
- * Convert a PyObject * into a parameter suitable to pass to an
- * C function call.
- *
- * 1. Python integers are converted to C int and passed by value.
- * Py_None is converted to a C NULL pointer.
- *
- * 2. 3-tuples are expected to have a format character in the first
- * item, which must be 'i', 'f', 'd', 'q', or 'P'.
- * The second item will have to be an integer, float, double, long long
- * or integer (denoting an address void *), will be converted to the
- * corresponding C data type and passed by value.
- *
- * 3. Other Python objects are tested for an '_as_parameter_' attribute.
- * The value of this attribute must be an integer which will be passed
- * by value, or a 2-tuple or 3-tuple which will be used according
- * to point 2 above. The third item (if any), is ignored. It is normally
- * used to keep the object alive where this parameter refers to.
- * XXX This convention is dangerous - you can construct arbitrary tuples
- * in Python and pass them. Would it be safer to use a custom container
- * datatype instead of a tuple?
- *
- * 4. Other Python objects cannot be passed as parameters - an exception is raised.
- *
- * 5. ConvParam will store the converted result in a struct containing format
- * and value.
- */
-
-union result {
- char c;
- char b;
- short h;
- int i;
- long l;
- long long q;
- long double D;
- double d;
- float f;
- void *p;
-};
-
-struct argument {
- ffi_type *ffi_type;
- PyObject *keep;
- union result value;
-};
-
-/*
- * Convert a single Python object into a PyCArgObject and return it.
- */
-static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa)
-{
- StgDictObject *dict;
- pa->keep = NULL; /* so we cannot forget it later */
-
- dict = PyObject_stgdict(obj);
- if (dict) {
- PyCArgObject *carg;
- assert(dict->paramfunc);
- /* If it has an stgdict, it is a CDataObject */
- carg = dict->paramfunc((CDataObject *)obj);
- if (carg == NULL)
- return -1;
- pa->ffi_type = carg->pffi_type;
- memcpy(&pa->value, &carg->value, sizeof(pa->value));
- pa->keep = (PyObject *)carg;
- return 0;
- }
-
- ctypes_state *st = GLOBAL_STATE();
- if (PyCArg_CheckExact(st, obj)) {
- PyCArgObject *carg = (PyCArgObject *)obj;
- pa->ffi_type = carg->pffi_type;
- pa->keep = Py_NewRef(obj);
- memcpy(&pa->value, &carg->value, sizeof(pa->value));
- return 0;
- }
-
- /* check for None, integer, string or unicode and use directly if successful */
- if (obj == Py_None) {
- pa->ffi_type = &ffi_type_pointer;
- pa->value.p = NULL;
- return 0;
- }
-
- if (PyLong_Check(obj)) {
- pa->ffi_type = &ffi_type_sint;
- pa->value.i = (long)PyLong_AsUnsignedLong(obj);
- if (pa->value.i == -1 && PyErr_Occurred()) {
- PyErr_Clear();
- pa->value.i = PyLong_AsLong(obj);
- if (pa->value.i == -1 && PyErr_Occurred()) {
- PyErr_SetString(PyExc_OverflowError,
- "int too long to convert");
- return -1;
- }
- }
- return 0;
- }
-
- if (PyBytes_Check(obj)) {
- pa->ffi_type = &ffi_type_pointer;
- pa->value.p = PyBytes_AsString(obj);
- pa->keep = Py_NewRef(obj);
- return 0;
- }
-
- if (PyUnicode_Check(obj)) {
- pa->ffi_type = &ffi_type_pointer;
- pa->value.p = PyUnicode_AsWideCharString(obj, NULL);
- if (pa->value.p == NULL)
- return -1;
- pa->keep = PyCapsule_New(pa->value.p, CTYPES_CAPSULE_NAME_PYMEM, pymem_destructor);
- if (!pa->keep) {
- PyMem_Free(pa->value.p);
- return -1;
- }
- return 0;
- }
-
- {
- PyObject *arg;
- if (_PyObject_LookupAttr(obj, &_Py_ID(_as_parameter_), &arg) < 0) {
- return -1;
- }
- /* Which types should we exactly allow here?
- integers are required for using Python classes
- as parameters (they have to expose the '_as_parameter_'
- attribute)
- */
- if (arg) {
- int result;
- result = ConvParam(arg, index, pa);
- Py_DECREF(arg);
- return result;
- }
- PyErr_Format(PyExc_TypeError,
- "Don't know how to convert parameter %d",
- Py_SAFE_DOWNCAST(index, Py_ssize_t, int));
- return -1;
- }
-}
-
-#if defined(MS_WIN32) && !defined(_WIN32_WCE)
-/*
-Per: https://msdn.microsoft.com/en-us/library/7572ztz4.aspx
-To be returned by value in RAX, user-defined types must have a length
-of 1, 2, 4, 8, 16, 32, or 64 bits
-*/
-int can_return_struct_as_int(size_t s)
-{
- return s == 1 || s == 2 || s == 4;
-}
-
-int can_return_struct_as_sint64(size_t s)
-{
-#ifdef _M_ARM
- // 8 byte structs cannot be returned in a register on ARM32
- return 0;
-#else
- return s == 8;
-#endif
-}
-#endif
-
-
-ffi_type *_ctypes_get_ffi_type(PyObject *obj)
-{
- StgDictObject *dict;
- if (obj == NULL)
- return &ffi_type_sint;
- dict = PyType_stgdict(obj);
- if (dict == NULL)
- return &ffi_type_sint;
-#if defined(MS_WIN32) && !defined(_WIN32_WCE)
- /* This little trick works correctly with MSVC.
- It returns small structures in registers
- */
- if (dict->ffi_type_pointer.type == FFI_TYPE_STRUCT) {
- if (can_return_struct_as_int(dict->ffi_type_pointer.size))
- return &ffi_type_sint32;
- else if (can_return_struct_as_sint64 (dict->ffi_type_pointer.size))
- return &ffi_type_sint64;
- }
-#endif
- return &dict->ffi_type_pointer;
-}
-
-
-/*
- * libffi uses:
- *
- * ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi,
- * unsigned int nargs,
- * ffi_type *rtype,
- * ffi_type **atypes);
- *
- * and then
- *
- * void ffi_call(ffi_cif *cif, void *fn, void *rvalue, void **avalues);
- */
-static int _call_function_pointer(int flags,
- PPROC pProc,
- void **avalues,
- ffi_type **atypes,
- ffi_type *restype,
- void *resmem,
- int argcount,
- int argtypecount)
-{
- PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
- PyObject *error_object = NULL;
- int *space;
- ffi_cif cif;
- int cc;
-#if defined(MS_WIN32) && !defined(DONT_USE_SEH)
- DWORD dwExceptionCode = 0;
- EXCEPTION_RECORD record;
-#endif
- /* XXX check before here */
- if (restype == NULL) {
- PyErr_SetString(PyExc_RuntimeError,
- "No ffi_type for result");
- return -1;
- }
-
- cc = FFI_DEFAULT_ABI;
-#if defined(MS_WIN32) && !defined(MS_WIN64) && !defined(_WIN32_WCE) && !defined(_M_ARM)
- if ((flags & FUNCFLAG_CDECL) == 0)
- cc = FFI_STDCALL;
-#endif
-
-# ifdef USING_APPLE_OS_LIBFFI
-# ifdef HAVE_BUILTIN_AVAILABLE
-# define HAVE_FFI_PREP_CIF_VAR_RUNTIME __builtin_available(macos 10.15, ios 13, watchos 6, tvos 13, *)
-# else
-# define HAVE_FFI_PREP_CIF_VAR_RUNTIME (ffi_prep_cif_var != NULL)
-# endif
-# elif HAVE_FFI_PREP_CIF_VAR
-# define HAVE_FFI_PREP_CIF_VAR_RUNTIME true
-# else
-# define HAVE_FFI_PREP_CIF_VAR_RUNTIME false
-# endif
-
- /* Even on Apple-arm64 the calling convention for variadic functions coincides
- * with the standard calling convention in the case that the function called
- * only with its fixed arguments. Thus, we do not need a special flag to be
- * set on variadic functions. We treat a function as variadic if it is called
- * with a nonzero number of variadic arguments */
- bool is_variadic = (argtypecount != 0 && argcount > argtypecount);
- (void) is_variadic;
-
-#if defined(__APPLE__) && defined(__arm64__)
- if (is_variadic) {
- if (HAVE_FFI_PREP_CIF_VAR_RUNTIME) {
- } else {
- PyErr_SetString(PyExc_NotImplementedError, "ffi_prep_cif_var() is missing");
- return -1;
- }
- }
-#endif
-
-#if HAVE_FFI_PREP_CIF_VAR
- if (is_variadic) {
- if (HAVE_FFI_PREP_CIF_VAR_RUNTIME) {
- if (FFI_OK != ffi_prep_cif_var(&cif,
- cc,
- argtypecount,
- argcount,
- restype,
- atypes)) {
- PyErr_SetString(PyExc_RuntimeError,
- "ffi_prep_cif_var failed");
- return -1;
- }
- } else {
- if (FFI_OK != ffi_prep_cif(&cif,
- cc,
- argcount,
- restype,
- atypes)) {
- PyErr_SetString(PyExc_RuntimeError,
- "ffi_prep_cif failed");
- return -1;
- }
- }
- } else
-#endif
-
- {
- if (FFI_OK != ffi_prep_cif(&cif,
- cc,
- argcount,
- restype,
- atypes)) {
- PyErr_SetString(PyExc_RuntimeError,
- "ffi_prep_cif failed");
- return -1;
- }
- }
-
- if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
- error_object = _ctypes_get_errobj(&space);
- if (error_object == NULL)
- return -1;
- }
- if ((flags & FUNCFLAG_PYTHONAPI) == 0)
- Py_UNBLOCK_THREADS
- if (flags & FUNCFLAG_USE_ERRNO) {
- int temp = space[0];
- space[0] = errno;
- errno = temp;
- }
-#ifdef MS_WIN32
- if (flags & FUNCFLAG_USE_LASTERROR) {
- int temp = space[1];
- space[1] = GetLastError();
- SetLastError(temp);
- }
-#ifndef DONT_USE_SEH
- __try {
-#endif
-#endif
- ffi_call(&cif, (void *)pProc, resmem, avalues);
-#ifdef MS_WIN32
-#ifndef DONT_USE_SEH
- }
- __except (HandleException(GetExceptionInformation(),
- &dwExceptionCode, &record)) {
- ;
- }
-#endif
- if (flags & FUNCFLAG_USE_LASTERROR) {
- int temp = space[1];
- space[1] = GetLastError();
- SetLastError(temp);
- }
-#endif
- if (flags & FUNCFLAG_USE_ERRNO) {
- int temp = space[0];
- space[0] = errno;
- errno = temp;
- }
- if ((flags & FUNCFLAG_PYTHONAPI) == 0)
- Py_BLOCK_THREADS
- Py_XDECREF(error_object);
-#ifdef MS_WIN32
-#ifndef DONT_USE_SEH
- if (dwExceptionCode) {
- SetException(dwExceptionCode, &record);
- return -1;
- }
-#endif
-#endif
- if ((flags & FUNCFLAG_PYTHONAPI) && PyErr_Occurred())
- return -1;
- return 0;
-}
-
-/*
- * Convert the C value in result into a Python object, depending on restype.
- *
- * - If restype is NULL, return a Python integer.
- * - If restype is None, return None.
- * - If restype is a simple ctypes type (c_int, c_void_p), call the type's getfunc,
- * pass the result to checker and return the result.
- * - If restype is another ctypes type, return an instance of that.
- * - Otherwise, call restype and return the result.
- */
-static PyObject *GetResult(PyObject *restype, void *result, PyObject *checker)
-{
- StgDictObject *dict;
- PyObject *retval, *v;
-
- if (restype == NULL)
- return PyLong_FromLong(*(int *)result);
-
- if (restype == Py_None) {
- Py_RETURN_NONE;
- }
-
- dict = PyType_stgdict(restype);
- if (dict == NULL)
- return PyObject_CallFunction(restype, "i", *(int *)result);
-
- if (dict->getfunc && !_ctypes_simple_instance(restype)) {
- retval = dict->getfunc(result, dict->size);
- /* If restype is py_object (detected by comparing getfunc with
- O_get), we have to call Py_DECREF because O_get has already
- called Py_INCREF.
- */
- if (dict->getfunc == _ctypes_get_fielddesc("O")->getfunc) {
- Py_DECREF(retval);
- }
- } else
- retval = PyCData_FromBaseObj(restype, NULL, 0, result);
-
- if (!checker || !retval)
- return retval;
-
- v = PyObject_CallOneArg(checker, retval);
- if (v == NULL)
- _PyTraceback_Add("GetResult", "_ctypes/callproc.c", __LINE__-2);
- Py_DECREF(retval);
- return v;
-}
-
-/*
- * Raise a new exception 'exc_class', adding additional text to the original
- * exception string.
- */
-void _ctypes_extend_error(PyObject *exc_class, const char *fmt, ...)
-{
- va_list vargs;
-
- va_start(vargs, fmt);
- PyObject *s = PyUnicode_FromFormatV(fmt, vargs);
- va_end(vargs);
- if (s == NULL) {
- return;
- }
-
- assert(PyErr_Occurred());
- PyObject *exc = PyErr_GetRaisedException();
- assert(exc != NULL);
- PyObject *cls_str = PyType_GetName(Py_TYPE(exc));
- if (cls_str) {
- PyUnicode_AppendAndDel(&s, cls_str);
- PyUnicode_AppendAndDel(&s, PyUnicode_FromString(": "));
- if (s == NULL) {
- goto error;
- }
- }
- else {
- PyErr_Clear();
- }
-
- PyObject *msg_str = PyObject_Str(exc);
- if (msg_str) {
- PyUnicode_AppendAndDel(&s, msg_str);
- }
- else {
- PyErr_Clear();
- PyUnicode_AppendAndDel(&s, PyUnicode_FromString("???"));
- }
- if (s == NULL) {
- goto error;
- }
- PyErr_SetObject(exc_class, s);
-error:
- Py_XDECREF(exc);
- Py_XDECREF(s);
-}
-
-
-#ifdef MS_WIN32
-
-static PyObject *
-GetComError(HRESULT errcode, GUID *riid, IUnknown *pIunk)
-{
- HRESULT hr;
- ISupportErrorInfo *psei = NULL;
- IErrorInfo *pei = NULL;
- BSTR descr=NULL, helpfile=NULL, source=NULL;
- GUID guid;
- DWORD helpcontext=0;
- LPOLESTR progid;
- PyObject *obj;
- LPOLESTR text;
-
- /* We absolutely have to release the GIL during COM method calls,
- otherwise we may get a deadlock!
- */
- Py_BEGIN_ALLOW_THREADS
-
- hr = pIunk->lpVtbl->QueryInterface(pIunk, &IID_ISupportErrorInfo, (void **)&psei);
- if (FAILED(hr))
- goto failed;
-
- hr = psei->lpVtbl->InterfaceSupportsErrorInfo(psei, riid);
- psei->lpVtbl->Release(psei);
- if (FAILED(hr))
- goto failed;
-
- hr = GetErrorInfo(0, &pei);
- if (hr != S_OK)
- goto failed;
-
- pei->lpVtbl->GetDescription(pei, &descr);
- pei->lpVtbl->GetGUID(pei, &guid);
- pei->lpVtbl->GetHelpContext(pei, &helpcontext);
- pei->lpVtbl->GetHelpFile(pei, &helpfile);
- pei->lpVtbl->GetSource(pei, &source);
-
- pei->lpVtbl->Release(pei);
-
- failed:
- Py_END_ALLOW_THREADS
-
- progid = NULL;
- ProgIDFromCLSID(&guid, &progid);
-
- text = FormatError(errcode);
- obj = Py_BuildValue(
- "iu(uuuiu)",
- errcode,
- text,
- descr, source, helpfile, helpcontext,
- progid);
- if (obj) {
- ctypes_state *st = GLOBAL_STATE();
- PyErr_SetObject((PyObject *)st->PyComError_Type, obj);
- Py_DECREF(obj);
- }
- LocalFree(text);
-
- if (descr)
- SysFreeString(descr);
- if (helpfile)
- SysFreeString(helpfile);
- if (source)
- SysFreeString(source);
-
- return NULL;
-}
-#endif
-
-#if (defined(__x86_64__) && (defined(__MINGW64__) || defined(__CYGWIN__))) || \
- defined(__aarch64__) || defined(__riscv)
-#define CTYPES_PASS_BY_REF_HACK
-#define POW2(x) (((x & ~(x - 1)) == x) ? x : 0)
-#define IS_PASS_BY_REF(x) (x > 8 || !POW2(x))
-#endif
-
-/*
- * Requirements, must be ensured by the caller:
- * - argtuple is tuple of arguments
- * - argtypes is either NULL, or a tuple of the same size as argtuple
- *
- * - XXX various requirements for restype, not yet collected
- */
-PyObject *_ctypes_callproc(PPROC pProc,
- PyObject *argtuple,
-#ifdef MS_WIN32
- IUnknown *pIunk,
- GUID *iid,
-#endif
- int flags,
- PyObject *argtypes, /* misleading name: This is a tuple of
- methods, not types: the .from_param
- class methods of the types */
- PyObject *restype,
- PyObject *checker)
-{
- Py_ssize_t i, n, argcount, argtype_count;
- void *resbuf;
- struct argument *args, *pa;
- ffi_type **atypes;
- ffi_type *rtype;
- void **avalues;
- PyObject *retval = NULL;
-
- n = argcount = PyTuple_GET_SIZE(argtuple);
-#ifdef MS_WIN32
- /* an optional COM object this pointer */
- if (pIunk)
- ++argcount;
-#endif
-
- if (argcount > CTYPES_MAX_ARGCOUNT)
- {
- PyErr_Format(PyExc_ArgError, "too many arguments (%zi), maximum is %i",
- argcount, CTYPES_MAX_ARGCOUNT);
- return NULL;
- }
-
- args = alloca(sizeof(struct argument) * argcount);
- memset(args, 0, sizeof(struct argument) * argcount);
- argtype_count = argtypes ? PyTuple_GET_SIZE(argtypes) : 0;
-#ifdef MS_WIN32
- if (pIunk) {
- args[0].ffi_type = &ffi_type_pointer;
- args[0].value.p = pIunk;
- pa = &args[1];
- } else
-#endif
- pa = &args[0];
-
- /* Convert the arguments */
- for (i = 0; i < n; ++i, ++pa) {
- PyObject *converter;
- PyObject *arg;
- int err;
-
- arg = PyTuple_GET_ITEM(argtuple, i); /* borrowed ref */
- /* For cdecl functions, we allow more actual arguments
- than the length of the argtypes tuple.
- This is checked in _ctypes::PyCFuncPtr_Call
- */
- if (argtypes && argtype_count > i) {
- PyObject *v;
- converter = PyTuple_GET_ITEM(argtypes, i);
- v = PyObject_CallOneArg(converter, arg);
- if (v == NULL) {
- _ctypes_extend_error(PyExc_ArgError, "argument %zd: ", i+1);
- goto cleanup;
- }
-
- err = ConvParam(v, i+1, pa);
- Py_DECREF(v);
- if (-1 == err) {
- _ctypes_extend_error(PyExc_ArgError, "argument %zd: ", i+1);
- goto cleanup;
- }
- } else {
- err = ConvParam(arg, i+1, pa);
- if (-1 == err) {
- _ctypes_extend_error(PyExc_ArgError, "argument %zd: ", i+1);
- goto cleanup; /* leaking ? */
- }
- }
- }
-
- if (restype == Py_None) {
- rtype = &ffi_type_void;
- } else {
- rtype = _ctypes_get_ffi_type(restype);
- }
-
- resbuf = alloca(max(rtype->size, sizeof(ffi_arg)));
-
-#ifdef _Py_MEMORY_SANITIZER
- /* ffi_call actually initializes resbuf, but from asm, which
- * MemorySanitizer can't detect. Avoid false positives from MSan. */
- if (resbuf != NULL) {
- __msan_unpoison(resbuf, max(rtype->size, sizeof(ffi_arg)));
- }
-#endif
- avalues = (void **)alloca(sizeof(void *) * argcount);
- atypes = (ffi_type **)alloca(sizeof(ffi_type *) * argcount);
- if (!resbuf || !avalues || !atypes) {
- PyErr_NoMemory();
- goto cleanup;
- }
- for (i = 0; i < argcount; ++i) {
- atypes[i] = args[i].ffi_type;
-#ifdef CTYPES_PASS_BY_REF_HACK
- size_t size = atypes[i]->size;
- if (IS_PASS_BY_REF(size)) {
- void *tmp = alloca(size);
- if (atypes[i]->type == FFI_TYPE_STRUCT)
- memcpy(tmp, args[i].value.p, size);
- else
- memcpy(tmp, (void*)&args[i].value, size);
-
- avalues[i] = tmp;
- }
- else
-#endif
- if (atypes[i]->type == FFI_TYPE_STRUCT)
- avalues[i] = (void *)args[i].value.p;
- else
- avalues[i] = (void *)&args[i].value;
- }
-
- if (-1 == _call_function_pointer(flags, pProc, avalues, atypes,
- rtype, resbuf,
- Py_SAFE_DOWNCAST(argcount, Py_ssize_t, int),
- Py_SAFE_DOWNCAST(argtype_count, Py_ssize_t, int)))
- goto cleanup;
-
-#ifdef WORDS_BIGENDIAN
- /* libffi returns the result in a buffer with sizeof(ffi_arg). This
- causes problems on big endian machines, since the result buffer
- address cannot simply be used as result pointer, instead we must
- adjust the pointer value:
- */
- /*
- XXX I should find out and clarify why this is needed at all,
- especially why adjusting for ffi_type_float must be avoided on
- 64-bit platforms.
- */
- if (rtype->type != FFI_TYPE_FLOAT
- && rtype->type != FFI_TYPE_STRUCT
- && rtype->size < sizeof(ffi_arg))
- {
- resbuf = (char *)resbuf + sizeof(ffi_arg) - rtype->size;
- }
-#endif
-
-#ifdef MS_WIN32
- if (iid && pIunk) {
- if (*(int *)resbuf & 0x80000000)
- retval = GetComError(*(HRESULT *)resbuf, iid, pIunk);
- else
- retval = PyLong_FromLong(*(int *)resbuf);
- } else if (flags & FUNCFLAG_HRESULT) {
- if (*(int *)resbuf & 0x80000000)
- retval = PyErr_SetFromWindowsErr(*(int *)resbuf);
- else
- retval = PyLong_FromLong(*(int *)resbuf);
- } else
-#endif
- retval = GetResult(restype, resbuf, checker);
- cleanup:
- for (i = 0; i < argcount; ++i)
- Py_XDECREF(args[i].keep);
- return retval;
-}
-
-static int
-_parse_voidp(PyObject *obj, void **address)
-{
- *address = PyLong_AsVoidPtr(obj);
- if (*address == NULL)
- return 0;
- return 1;
-}
-
-#ifdef MS_WIN32
-
-PyDoc_STRVAR(format_error_doc,
-"FormatError([integer]) -> string\n\
-\n\
-Convert a win32 error code into a string. If the error code is not\n\
-given, the return value of a call to GetLastError() is used.\n");
-static PyObject *format_error(PyObject *self, PyObject *args)
-{
- PyObject *result;
- wchar_t *lpMsgBuf;
- DWORD code = 0;
- if (!PyArg_ParseTuple(args, "|i:FormatError", &code))
- return NULL;
- if (code == 0)
- code = GetLastError();
- lpMsgBuf = FormatError(code);
- if (lpMsgBuf) {
- result = PyUnicode_FromWideChar(lpMsgBuf, wcslen(lpMsgBuf));
- LocalFree(lpMsgBuf);
- } else {
- result = PyUnicode_FromString("<no description>");
- }
- return result;
-}
-
-PyDoc_STRVAR(load_library_doc,
-"LoadLibrary(name, load_flags) -> handle\n\
-\n\
-Load an executable (usually a DLL), and return a handle to it.\n\
-The handle may be used to locate exported functions in this\n\
-module. load_flags are as defined for LoadLibraryEx in the\n\
-Windows API.\n");
-static PyObject *load_library(PyObject *self, PyObject *args)
-{
- PyObject *nameobj;
- int load_flags = 0;
- HMODULE hMod;
- DWORD err;
-
- if (!PyArg_ParseTuple(args, "U|i:LoadLibrary", &nameobj, &load_flags))
- return NULL;
-
- if (PySys_Audit("ctypes.dlopen", "O", nameobj) < 0) {
- return NULL;
- }
-
- WCHAR *name = PyUnicode_AsWideCharString(nameobj, NULL);
- if (!name)
- return NULL;
-
- Py_BEGIN_ALLOW_THREADS
- /* bpo-36085: Limit DLL search directories to avoid pre-loading
- * attacks and enable use of the AddDllDirectory function.
- */
- hMod = LoadLibraryExW(name, NULL, (DWORD)load_flags);
- err = hMod ? 0 : GetLastError();
- Py_END_ALLOW_THREADS
-
- PyMem_Free(name);
- if (err == ERROR_MOD_NOT_FOUND) {
- PyErr_Format(PyExc_FileNotFoundError,
- ("Could not find module '%.500S' (or one of its "
- "dependencies). Try using the full path with "
- "constructor syntax."),
- nameobj);
- return NULL;
- } else if (err) {
- return PyErr_SetFromWindowsErr(err);
- }
-#ifdef _WIN64
- return PyLong_FromVoidPtr(hMod);
-#else
- return Py_BuildValue("i", hMod);
-#endif
-}
-
-PyDoc_STRVAR(free_library_doc,
-"FreeLibrary(handle) -> void\n\
-\n\
-Free the handle of an executable previously loaded by LoadLibrary.\n");
-static PyObject *free_library(PyObject *self, PyObject *args)
-{
- void *hMod;
- BOOL result;
- DWORD err;
- if (!PyArg_ParseTuple(args, "O&:FreeLibrary", &_parse_voidp, &hMod))
- return NULL;
-
- Py_BEGIN_ALLOW_THREADS
- result = FreeLibrary((HMODULE)hMod);
- err = result ? 0 : GetLastError();
- Py_END_ALLOW_THREADS
-
- if (!result) {
- return PyErr_SetFromWindowsErr(err);
- }
- Py_RETURN_NONE;
-}
-
-PyDoc_STRVAR(copy_com_pointer_doc,
-"CopyComPointer(src, dst) -> HRESULT value\n");
-
-static PyObject *
-copy_com_pointer(PyObject *self, PyObject *args)
-{
- PyObject *p1, *p2, *r = NULL;
- struct argument a, b;
- IUnknown *src, **pdst;
- if (!PyArg_ParseTuple(args, "OO:CopyComPointer", &p1, &p2))
- return NULL;
- a.keep = b.keep = NULL;
-
- if (-1 == ConvParam(p1, 0, &a) || -1 == ConvParam(p2, 1, &b))
- goto done;
- src = (IUnknown *)a.value.p;
- pdst = (IUnknown **)b.value.p;
-
- if (pdst == NULL)
- r = PyLong_FromLong(E_POINTER);
- else {
- if (src)
- src->lpVtbl->AddRef(src);
- *pdst = src;
- r = PyLong_FromLong(S_OK);
- }
- done:
- Py_XDECREF(a.keep);
- Py_XDECREF(b.keep);
- return r;
-}
-#else
-#ifdef __APPLE__
-#ifdef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH
-# ifdef HAVE_BUILTIN_AVAILABLE
-# define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \
- __builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *)
-# else
-# define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \
- (_dyld_shared_cache_contains_path != NULL)
-# endif
-#else
-// Support the deprecated case of compiling on an older macOS version
-static void *libsystem_b_handle;
-static bool (*_dyld_shared_cache_contains_path)(const char *path);
-
-__attribute__((constructor)) void load_dyld_shared_cache_contains_path(void) {
- libsystem_b_handle = dlopen("/usr/lib/libSystem.B.dylib", RTLD_LAZY);
- if (libsystem_b_handle != NULL) {
- _dyld_shared_cache_contains_path = dlsym(libsystem_b_handle, "_dyld_shared_cache_contains_path");
- }
-}
-
-__attribute__((destructor)) void unload_dyld_shared_cache_contains_path(void) {
- if (libsystem_b_handle != NULL) {
- dlclose(libsystem_b_handle);
- }
-}
-#define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \
- _dyld_shared_cache_contains_path != NULL
-#endif
-
-static PyObject *py_dyld_shared_cache_contains_path(PyObject *self, PyObject *args)
-{
- PyObject *name, *name2;
- char *name_str;
-
- if (HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME) {
- int r;
-
- if (!PyArg_ParseTuple(args, "O", &name))
- return NULL;
-
- if (name == Py_None)
- Py_RETURN_FALSE;
-
- if (PyUnicode_FSConverter(name, &name2) == 0)
- return NULL;
- name_str = PyBytes_AS_STRING(name2);
-
- r = _dyld_shared_cache_contains_path(name_str);
- Py_DECREF(name2);
-
- if (r) {
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
-
- } else {
- PyErr_SetString(PyExc_NotImplementedError, "_dyld_shared_cache_contains_path symbol is missing");
- return NULL;
- }
-
- }
-#endif
-
-static PyObject *py_dl_open(PyObject *self, PyObject *args)
-{
- PyObject *name, *name2;
- const char *name_str;
- void * handle;
-#if HAVE_DECL_RTLD_LOCAL
- int mode = RTLD_NOW | RTLD_LOCAL;
-#else
- /* cygwin doesn't define RTLD_LOCAL */
- int mode = RTLD_NOW;
-#endif
- if (!PyArg_ParseTuple(args, "O|i:dlopen", &name, &mode))
- return NULL;
- mode |= RTLD_NOW;
- if (name != Py_None) {
- if (PyUnicode_FSConverter(name, &name2) == 0)
- return NULL;
- name_str = PyBytes_AS_STRING(name2);
- } else {
- name_str = NULL;
- name2 = NULL;
- }
- if (PySys_Audit("ctypes.dlopen", "O", name) < 0) {
- return NULL;
- }
- handle = dlopen(name_str, mode);
- Py_XDECREF(name2);
- if (!handle) {
- const char *errmsg = dlerror();
- if (!errmsg)
- errmsg = "dlopen() error";
- PyErr_SetString(PyExc_OSError,
- errmsg);
- return NULL;
- }
- return PyLong_FromVoidPtr(handle);
-}
-
-static PyObject *py_dl_close(PyObject *self, PyObject *args)
-{
- void *handle;
-
- if (!PyArg_ParseTuple(args, "O&:dlclose", &_parse_voidp, &handle))
- return NULL;
- if (dlclose(handle)) {
- PyErr_SetString(PyExc_OSError,
- dlerror());
- return NULL;
- }
- Py_RETURN_NONE;
-}
-
-static PyObject *py_dl_sym(PyObject *self, PyObject *args)
-{
- char *name;
- void *handle;
- void *ptr;
-
- if (!PyArg_ParseTuple(args, "O&s:dlsym",
- &_parse_voidp, &handle, &name))
- return NULL;
- if (PySys_Audit("ctypes.dlsym/handle", "O", args) < 0) {
- return NULL;
- }
- ptr = dlsym((void*)handle, name);
- if (!ptr) {
- PyErr_SetString(PyExc_OSError,
- dlerror());
- return NULL;
- }
- return PyLong_FromVoidPtr(ptr);
-}
-#endif
-
-/*
- * Only for debugging so far: So that we can call CFunction instances
- *
- * XXX Needs to accept more arguments: flags, argtypes, restype
- */
-static PyObject *
-call_function(PyObject *self, PyObject *args)
-{
- void *func;
- PyObject *arguments;
- PyObject *result;
-
- if (!PyArg_ParseTuple(args,
- "O&O!",
- &_parse_voidp, &func,
- &PyTuple_Type, &arguments))
- return NULL;
- if (PySys_Audit("ctypes.call_function", "nO",
- (Py_ssize_t)func, arguments) < 0) {
- return NULL;
- }
-
- result = _ctypes_callproc((PPROC)func,
- arguments,
-#ifdef MS_WIN32
- NULL,
- NULL,
-#endif
- 0, /* flags */
- NULL, /* self->argtypes */
- NULL, /* self->restype */
- NULL); /* checker */
- return result;
-}
-
-/*
- * Only for debugging so far: So that we can call CFunction instances
- *
- * XXX Needs to accept more arguments: flags, argtypes, restype
- */
-static PyObject *
-call_cdeclfunction(PyObject *self, PyObject *args)
-{
- void *func;
- PyObject *arguments;
- PyObject *result;
-
- if (!PyArg_ParseTuple(args,
- "O&O!",
- &_parse_voidp, &func,
- &PyTuple_Type, &arguments))
- return NULL;
- if (PySys_Audit("ctypes.call_function", "nO",
- (Py_ssize_t)func, arguments) < 0) {
- return NULL;
- }
-
- result = _ctypes_callproc((PPROC)func,
- arguments,
-#ifdef MS_WIN32
- NULL,
- NULL,
-#endif
- FUNCFLAG_CDECL, /* flags */
- NULL, /* self->argtypes */
- NULL, /* self->restype */
- NULL); /* checker */
- return result;
-}
-
-/*****************************************************************
- * functions
- */
-PyDoc_STRVAR(sizeof_doc,
-"sizeof(C type) -> integer\n"
-"sizeof(C instance) -> integer\n"
-"Return the size in bytes of a C instance");
-
-static PyObject *
-sizeof_func(PyObject *self, PyObject *obj)
-{
- StgDictObject *dict;
-
- dict = PyType_stgdict(obj);
- if (dict)
- return PyLong_FromSsize_t(dict->size);
-
- if (CDataObject_Check(obj))
- return PyLong_FromSsize_t(((CDataObject *)obj)->b_size);
- PyErr_SetString(PyExc_TypeError,
- "this type has no size");
- return NULL;
-}
-
-PyDoc_STRVAR(alignment_doc,
-"alignment(C type) -> integer\n"
-"alignment(C instance) -> integer\n"
-"Return the alignment requirements of a C instance");
-
-static PyObject *
-align_func(PyObject *self, PyObject *obj)
-{
- StgDictObject *dict;
-
- dict = PyType_stgdict(obj);
- if (dict)
- return PyLong_FromSsize_t(dict->align);
-
- dict = PyObject_stgdict(obj);
- if (dict)
- return PyLong_FromSsize_t(dict->align);
-
- PyErr_SetString(PyExc_TypeError,
- "no alignment info");
- return NULL;
-}
-
-PyDoc_STRVAR(byref_doc,
-"byref(C instance[, offset=0]) -> byref-object\n"
-"Return a pointer lookalike to a C instance, only usable\n"
-"as function argument");
-
-/*
- * We must return something which can be converted to a parameter,
- * but still has a reference to self.
- */
-static PyObject *
-byref(PyObject *self, PyObject *args)
-{
- PyCArgObject *parg;
- PyObject *obj;
- PyObject *pyoffset = NULL;
- Py_ssize_t offset = 0;
-
- if (!PyArg_UnpackTuple(args, "byref", 1, 2,
- &obj, &pyoffset))
- return NULL;
- if (pyoffset) {
- offset = PyNumber_AsSsize_t(pyoffset, NULL);
- if (offset == -1 && PyErr_Occurred())
- return NULL;
- }
- if (!CDataObject_Check(obj)) {
- PyErr_Format(PyExc_TypeError,
- "byref() argument must be a ctypes instance, not '%s'",
- Py_TYPE(obj)->tp_name);
- return NULL;
- }
-
- parg = PyCArgObject_new();
- if (parg == NULL)
- return NULL;
-
- parg->tag = 'P';
- parg->pffi_type = &ffi_type_pointer;
- parg->obj = Py_NewRef(obj);
- parg->value.p = (char *)((CDataObject *)obj)->b_ptr + offset;
- return (PyObject *)parg;
-}
-
-PyDoc_STRVAR(addressof_doc,
-"addressof(C instance) -> integer\n"
-"Return the address of the C instance internal buffer");
-
-static PyObject *
-addressof(PyObject *self, PyObject *obj)
-{
- if (!CDataObject_Check(obj)) {
- PyErr_SetString(PyExc_TypeError,
- "invalid type");
- return NULL;
- }
- if (PySys_Audit("ctypes.addressof", "(O)", obj) < 0) {
- return NULL;
- }
- return PyLong_FromVoidPtr(((CDataObject *)obj)->b_ptr);
-}
-
-static int
-converter(PyObject *obj, void **address)
-{
- *address = PyLong_AsVoidPtr(obj);
- return *address != NULL;
-}
-
-static PyObject *
-My_PyObj_FromPtr(PyObject *self, PyObject *args)
-{
- PyObject *ob;
- if (!PyArg_ParseTuple(args, "O&:PyObj_FromPtr", converter, &ob)) {
- return NULL;
- }
- if (PySys_Audit("ctypes.PyObj_FromPtr", "(O)", ob) < 0) {
- return NULL;
- }
- return Py_NewRef(ob);
-}
-
-static PyObject *
-My_Py_INCREF(PyObject *self, PyObject *arg)
-{
- Py_INCREF(arg); /* that's what this function is for */
- Py_INCREF(arg); /* that for returning it */
- return arg;
-}
-
-static PyObject *
-My_Py_DECREF(PyObject *self, PyObject *arg)
-{
- Py_DECREF(arg); /* that's what this function is for */
- Py_INCREF(arg); /* that's for returning it */
- return arg;
-}
-
-static PyObject *
-resize(PyObject *self, PyObject *args)
-{
- CDataObject *obj;
- StgDictObject *dict;
- Py_ssize_t size;
-
- if (!PyArg_ParseTuple(args,
- "On:resize",
- &obj, &size))
- return NULL;
-
- dict = PyObject_stgdict((PyObject *)obj);
- if (dict == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "expected ctypes instance");
- return NULL;
- }
- if (size < dict->size) {
- PyErr_Format(PyExc_ValueError,
- "minimum size is %zd",
- dict->size);
- return NULL;
- }
- if (obj->b_needsfree == 0) {
- PyErr_Format(PyExc_ValueError,
- "Memory cannot be resized because this object doesn't own it");
- return NULL;
- }
- if ((size_t)size <= sizeof(obj->b_value)) {
- /* internal default buffer is large enough */
- obj->b_size = size;
- goto done;
- }
- if (!_CDataObject_HasExternalBuffer(obj)) {
- /* We are currently using the objects default buffer, but it
- isn't large enough any more. */
- void *ptr = PyMem_Calloc(1, size);
- if (ptr == NULL)
- return PyErr_NoMemory();
- memmove(ptr, obj->b_ptr, obj->b_size);
- obj->b_ptr = ptr;
- obj->b_size = size;
- } else {
- void * ptr = PyMem_Realloc(obj->b_ptr, size);
- if (ptr == NULL)
- return PyErr_NoMemory();
- obj->b_ptr = ptr;
- obj->b_size = size;
- }
- done:
- Py_RETURN_NONE;
-}
-
-static PyObject *
-unpickle(PyObject *self, PyObject *args)
-{
- PyObject *typ, *state, *meth, *obj, *result;
-
- if (!PyArg_ParseTuple(args, "OO!", &typ, &PyTuple_Type, &state))
- return NULL;
- obj = PyObject_CallMethodOneArg(typ, &_Py_ID(__new__), typ);
- if (obj == NULL)
- return NULL;
-
- meth = PyObject_GetAttr(obj, &_Py_ID(__setstate__));
- if (meth == NULL) {
- goto error;
- }
-
- result = PyObject_Call(meth, state, NULL);
- Py_DECREF(meth);
- if (result == NULL) {
- goto error;
- }
- Py_DECREF(result);
-
- return obj;
-
-error:
- Py_DECREF(obj);
- return NULL;
-}
-
-static PyObject *
-POINTER(PyObject *self, PyObject *cls)
-{
- PyObject *result;
- PyTypeObject *typ;
- PyObject *key;
-
- result = PyDict_GetItemWithError(_ctypes_ptrtype_cache, cls);
- if (result) {
- return Py_NewRef(result);
- }
- else if (PyErr_Occurred()) {
- return NULL;
- }
- if (PyUnicode_CheckExact(cls)) {
- PyObject *name = PyUnicode_FromFormat("LP_%U", cls);
- result = PyObject_CallFunction((PyObject *)Py_TYPE(&PyCPointer_Type),
- "N(O){}",
- name,
- &PyCPointer_Type);
- if (result == NULL)
- return result;
- key = PyLong_FromVoidPtr(result);
- if (key == NULL) {
- Py_DECREF(result);
- return NULL;
- }
- } else if (PyType_Check(cls)) {
- typ = (PyTypeObject *)cls;
- PyObject *name = PyUnicode_FromFormat("LP_%s", typ->tp_name);
- result = PyObject_CallFunction((PyObject *)Py_TYPE(&PyCPointer_Type),
- "N(O){sO}",
- name,
- &PyCPointer_Type,
- "_type_", cls);
- if (result == NULL)
- return result;
- key = Py_NewRef(cls);
- } else {
- PyErr_SetString(PyExc_TypeError, "must be a ctypes type");
- return NULL;
- }
- if (-1 == PyDict_SetItem(_ctypes_ptrtype_cache, key, result)) {
- Py_DECREF(result);
- Py_DECREF(key);
- return NULL;
- }
- Py_DECREF(key);
- return result;
-}
-
-static PyObject *
-pointer(PyObject *self, PyObject *arg)
-{
- PyObject *result;
- PyObject *typ;
-
- typ = PyDict_GetItemWithError(_ctypes_ptrtype_cache, (PyObject *)Py_TYPE(arg));
- if (typ) {
- return PyObject_CallOneArg(typ, arg);
- }
- else if (PyErr_Occurred()) {
- return NULL;
- }
- typ = POINTER(NULL, (PyObject *)Py_TYPE(arg));
- if (typ == NULL)
- return NULL;
- result = PyObject_CallOneArg(typ, arg);
- Py_DECREF(typ);
- return result;
-}
-
-static PyObject *
-buffer_info(PyObject *self, PyObject *arg)
-{
- StgDictObject *dict = PyType_stgdict(arg);
- PyObject *shape;
- Py_ssize_t i;
-
- if (dict == NULL)
- dict = PyObject_stgdict(arg);
- if (dict == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "not a ctypes type or object");
- return NULL;
- }
- shape = PyTuple_New(dict->ndim);
- if (shape == NULL)
- return NULL;
- for (i = 0; i < (int)dict->ndim; ++i)
- PyTuple_SET_ITEM(shape, i, PyLong_FromSsize_t(dict->shape[i]));
-
- if (PyErr_Occurred()) {
- Py_DECREF(shape);
- return NULL;
- }
- return Py_BuildValue("siN", dict->format, dict->ndim, shape);
-}
-
-
-
-PyMethodDef _ctypes_module_methods[] = {
- {"get_errno", get_errno, METH_NOARGS},
- {"set_errno", set_errno, METH_VARARGS},
- {"POINTER", POINTER, METH_O },
- {"pointer", pointer, METH_O },
- {"_unpickle", unpickle, METH_VARARGS },
- {"buffer_info", buffer_info, METH_O, "Return buffer interface information"},
- {"resize", resize, METH_VARARGS, "Resize the memory buffer of a ctypes instance"},
-#ifdef MS_WIN32
- {"get_last_error", get_last_error, METH_NOARGS},
- {"set_last_error", set_last_error, METH_VARARGS},
- {"CopyComPointer", copy_com_pointer, METH_VARARGS, copy_com_pointer_doc},
- {"FormatError", format_error, METH_VARARGS, format_error_doc},
- {"LoadLibrary", load_library, METH_VARARGS, load_library_doc},
- {"FreeLibrary", free_library, METH_VARARGS, free_library_doc},
- {"_check_HRESULT", check_hresult, METH_VARARGS},
-#else
- {"dlopen", py_dl_open, METH_VARARGS,
- "dlopen(name, flag={RTLD_GLOBAL|RTLD_LOCAL}) open a shared library"},
- {"dlclose", py_dl_close, METH_VARARGS, "dlclose a library"},
- {"dlsym", py_dl_sym, METH_VARARGS, "find symbol in shared library"},
-#endif
-#ifdef __APPLE__
- {"_dyld_shared_cache_contains_path", py_dyld_shared_cache_contains_path, METH_VARARGS, "check if path is in the shared cache"},
-#endif
- {"alignment", align_func, METH_O, alignment_doc},
- {"sizeof", sizeof_func, METH_O, sizeof_doc},
- {"byref", byref, METH_VARARGS, byref_doc},
- {"addressof", addressof, METH_O, addressof_doc},
- {"call_function", call_function, METH_VARARGS },
- {"call_cdeclfunction", call_cdeclfunction, METH_VARARGS },
- {"PyObj_FromPtr", My_PyObj_FromPtr, METH_VARARGS },
- {"Py_INCREF", My_Py_INCREF, METH_O },
- {"Py_DECREF", My_Py_DECREF, METH_O },
- {NULL, NULL} /* Sentinel */
-};
-
-/*
- Local Variables:
- compile-command: "cd .. && python setup.py -q build -g && python setup.py -q build install --home ~"
- End:
-*/
diff --git a/contrib/tools/python3/src/Modules/_ctypes/cfield.c b/contrib/tools/python3/src/Modules/_ctypes/cfield.c
deleted file mode 100644
index ebca11e5968..00000000000
--- a/contrib/tools/python3/src/Modules/_ctypes/cfield.c
+++ /dev/null
@@ -1,1586 +0,0 @@
-#ifndef Py_BUILD_CORE_BUILTIN
-# define Py_BUILD_CORE_MODULE 1
-#endif
-
-#include "Python.h"
-// windows.h must be included before pycore internal headers
-#ifdef MS_WIN32
-# include <windows.h>
-# include <Unknwn.h>
-#endif
-
-#include "pycore_bitutils.h" // _Py_bswap32()
-#include "pycore_call.h" // _PyObject_CallNoArgs()
-
-#include <ffi.h>
-#include "ctypes.h"
-
-
-#define CTYPES_CFIELD_CAPSULE_NAME_PYMEM "_ctypes/cfield.c pymem"
-
-static void pymem_destructor(PyObject *ptr)
-{
- void *p = PyCapsule_GetPointer(ptr, CTYPES_CFIELD_CAPSULE_NAME_PYMEM);
- if (p) {
- PyMem_Free(p);
- }
-}
-
-
-/******************************************************************/
-/*
- PyCField_Type
-*/
-
-/*
- * Expects the size, index and offset for the current field in *psize and
- * *poffset, stores the total size so far in *psize, the offset for the next
- * field in *poffset, the alignment requirements for the current field in
- * *palign, and returns a field descriptor for this field.
- */
-/*
- * bitfields extension:
- * bitsize != 0: this is a bit field.
- * pbitofs points to the current bit offset, this will be updated.
- * prev_desc points to the type of the previous bitfield, if any.
- */
-PyObject *
-PyCField_FromDesc(PyObject *desc, Py_ssize_t index,
- Py_ssize_t *pfield_size, int bitsize, int *pbitofs,
- Py_ssize_t *psize, Py_ssize_t *poffset, Py_ssize_t *palign,
- int pack, int big_endian)
-{
- CFieldObject *self;
- PyObject *proto;
- Py_ssize_t size, align;
- SETFUNC setfunc = NULL;
- GETFUNC getfunc = NULL;
- StgDictObject *dict;
- int fieldtype;
-#define NO_BITFIELD 0
-#define NEW_BITFIELD 1
-#define CONT_BITFIELD 2
-#define EXPAND_BITFIELD 3
-
- ctypes_state *st = GLOBAL_STATE();
- PyTypeObject *tp = st->PyCField_Type;
- self = (CFieldObject *)tp->tp_alloc(tp, 0);
- if (self == NULL)
- return NULL;
- dict = PyType_stgdict(desc);
- if (!dict) {
- PyErr_SetString(PyExc_TypeError,
- "has no _stginfo_");
- Py_DECREF(self);
- return NULL;
- }
- if (bitsize /* this is a bitfield request */
- && *pfield_size /* we have a bitfield open */
-#ifdef MS_WIN32
- /* MSVC, GCC with -mms-bitfields */
- && dict->size * 8 == *pfield_size
-#else
- /* GCC */
- && dict->size * 8 <= *pfield_size
-#endif
- && (*pbitofs + bitsize) <= *pfield_size) {
- /* continue bit field */
- fieldtype = CONT_BITFIELD;
-#ifndef MS_WIN32
- } else if (bitsize /* this is a bitfield request */
- && *pfield_size /* we have a bitfield open */
- && dict->size * 8 >= *pfield_size
- && (*pbitofs + bitsize) <= dict->size * 8) {
- /* expand bit field */
- fieldtype = EXPAND_BITFIELD;
-#endif
- } else if (bitsize) {
- /* start new bitfield */
- fieldtype = NEW_BITFIELD;
- *pbitofs = 0;
- *pfield_size = dict->size * 8;
- } else {
- /* not a bit field */
- fieldtype = NO_BITFIELD;
- *pbitofs = 0;
- *pfield_size = 0;
- }
-
- size = dict->size;
- proto = desc;
-
- /* Field descriptors for 'c_char * n' are be scpecial cased to
- return a Python string instead of an Array object instance...
- */
- if (PyCArrayTypeObject_Check(proto)) {
- StgDictObject *adict = PyType_stgdict(proto);
- StgDictObject *idict;
- if (adict && adict->proto) {
- idict = PyType_stgdict(adict->proto);
- if (!idict) {
- PyErr_SetString(PyExc_TypeError,
- "has no _stginfo_");
- Py_DECREF(self);
- return NULL;
- }
- if (idict->getfunc == _ctypes_get_fielddesc("c")->getfunc) {
- struct fielddesc *fd = _ctypes_get_fielddesc("s");
- getfunc = fd->getfunc;
- setfunc = fd->setfunc;
- }
- if (idict->getfunc == _ctypes_get_fielddesc("u")->getfunc) {
- struct fielddesc *fd = _ctypes_get_fielddesc("U");
- getfunc = fd->getfunc;
- setfunc = fd->setfunc;
- }
- }
- }
-
- self->setfunc = setfunc;
- self->getfunc = getfunc;
- self->index = index;
-
- self->proto = Py_NewRef(proto);
-
- switch (fieldtype) {
- case NEW_BITFIELD:
- if (big_endian)
- self->size = (bitsize << 16) + *pfield_size - *pbitofs - bitsize;
- else
- self->size = (bitsize << 16) + *pbitofs;
- *pbitofs = bitsize;
- /* fall through */
- case NO_BITFIELD:
- if (pack)
- align = min(pack, dict->align);
- else
- align = dict->align;
- if (align && *poffset % align) {
- Py_ssize_t delta = align - (*poffset % align);
- *psize += delta;
- *poffset += delta;
- }
-
- if (bitsize == 0)
- self->size = size;
- *psize += size;
-
- self->offset = *poffset;
- *poffset += size;
-
- *palign = align;
- break;
-
- case EXPAND_BITFIELD:
- *poffset += dict->size - *pfield_size/8;
- *psize += dict->size - *pfield_size/8;
-
- *pfield_size = dict->size * 8;
-
- if (big_endian)
- self->size = (bitsize << 16) + *pfield_size - *pbitofs - bitsize;
- else
- self->size = (bitsize << 16) + *pbitofs;
-
- self->offset = *poffset - size; /* poffset is already updated for the NEXT field */
- *pbitofs += bitsize;
- break;
-
- case CONT_BITFIELD:
- if (big_endian)
- self->size = (bitsize << 16) + *pfield_size - *pbitofs - bitsize;
- else
- self->size = (bitsize << 16) + *pbitofs;
-
- self->offset = *poffset - size; /* poffset is already updated for the NEXT field */
- *pbitofs += bitsize;
- break;
- }
-
- return (PyObject *)self;
-}
-
-static int
-PyCField_set(CFieldObject *self, PyObject *inst, PyObject *value)
-{
- CDataObject *dst;
- char *ptr;
- if (!CDataObject_Check(inst)) {
- PyErr_SetString(PyExc_TypeError,
- "not a ctype instance");
- return -1;
- }
- dst = (CDataObject *)inst;
- ptr = dst->b_ptr + self->offset;
- if (value == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "can't delete attribute");
- return -1;
- }
- return PyCData_set(inst, self->proto, self->setfunc, value,
- self->index, self->size, ptr);
-}
-
-static PyObject *
-PyCField_get(CFieldObject *self, PyObject *inst, PyTypeObject *type)
-{
- CDataObject *src;
- if (inst == NULL) {
- return Py_NewRef(self);
- }
- if (!CDataObject_Check(inst)) {
- PyErr_SetString(PyExc_TypeError,
- "not a ctype instance");
- return NULL;
- }
- src = (CDataObject *)inst;
- return PyCData_get(self->proto, self->getfunc, inst,
- self->index, self->size, src->b_ptr + self->offset);
-}
-
-static PyObject *
-PyCField_get_offset(PyObject *self, void *data)
-{
- return PyLong_FromSsize_t(((CFieldObject *)self)->offset);
-}
-
-static PyObject *
-PyCField_get_size(PyObject *self, void *data)
-{
- return PyLong_FromSsize_t(((CFieldObject *)self)->size);
-}
-
-static PyGetSetDef PyCField_getset[] = {
- { "offset", PyCField_get_offset, NULL, "offset in bytes of this field" },
- { "size", PyCField_get_size, NULL, "size in bytes of this field" },
- { NULL, NULL, NULL, NULL },
-};
-
-static int
-PyCField_traverse(CFieldObject *self, visitproc visit, void *arg)
-{
- Py_VISIT(Py_TYPE(self));
- Py_VISIT(self->proto);
- return 0;
-}
-
-static int
-PyCField_clear(CFieldObject *self)
-{
- Py_CLEAR(self->proto);
- return 0;
-}
-
-static void
-PyCField_dealloc(PyObject *self)
-{
- PyTypeObject *tp = Py_TYPE(self);
- PyObject_GC_UnTrack(self);
- (void)PyCField_clear((CFieldObject *)self);
- Py_TYPE(self)->tp_free((PyObject *)self);
- Py_DECREF(tp);
-}
-
-static PyObject *
-PyCField_repr(CFieldObject *self)
-{
- PyObject *result;
- Py_ssize_t bits = self->size >> 16;
- Py_ssize_t size = self->size & 0xFFFF;
- const char *name;
-
- name = ((PyTypeObject *)self->proto)->tp_name;
-
- if (bits)
- result = PyUnicode_FromFormat(
- "<Field type=%s, ofs=%zd:%zd, bits=%zd>",
- name, self->offset, size, bits);
- else
- result = PyUnicode_FromFormat(
- "<Field type=%s, ofs=%zd, size=%zd>",
- name, self->offset, size);
- return result;
-}
-
-static PyType_Slot cfield_slots[] = {
- {Py_tp_dealloc, PyCField_dealloc},
- {Py_tp_repr, PyCField_repr},
- {Py_tp_doc, (void *)PyDoc_STR("Structure/Union member")},
- {Py_tp_traverse, PyCField_traverse},
- {Py_tp_clear, PyCField_clear},
- {Py_tp_getset, PyCField_getset},
- {Py_tp_descr_get, PyCField_get},
- {Py_tp_descr_set, PyCField_set},
- {0, NULL},
-};
-
-PyType_Spec cfield_spec = {
- .name = "_ctypes.CField",
- .basicsize = sizeof(CFieldObject),
- .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
- Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
- .slots = cfield_slots,
-};
-
-
-/******************************************************************/
-/*
- Accessor functions
-*/
-
-/* Derived from Modules/structmodule.c:
- Helper routine to get a Python integer and raise the appropriate error
- if it isn't one */
-
-static int
-get_long(PyObject *v, long *p)
-{
- long x = PyLong_AsUnsignedLongMask(v);
- if (x == -1 && PyErr_Occurred())
- return -1;
- *p = x;
- return 0;
-}
-
-/* Same, but handling unsigned long */
-
-static int
-get_ulong(PyObject *v, unsigned long *p)
-{
- unsigned long x = PyLong_AsUnsignedLongMask(v);
- if (x == (unsigned long)-1 && PyErr_Occurred())
- return -1;
- *p = x;
- return 0;
-}
-
-/* Same, but handling native long long. */
-
-static int
-get_longlong(PyObject *v, long long *p)
-{
- long long x = PyLong_AsUnsignedLongLongMask(v);
- if (x == -1 && PyErr_Occurred())
- return -1;
- *p = x;
- return 0;
-}
-
-/* Same, but handling native unsigned long long. */
-
-static int
-get_ulonglong(PyObject *v, unsigned long long *p)
-{
- unsigned long long x = PyLong_AsUnsignedLongLongMask(v);
- if (x == (unsigned long long)-1 && PyErr_Occurred())
- return -1;
- *p = x;
- return 0;
-}
-
-/*****************************************************************
- * Integer fields, with bitfield support
- */
-
-/* how to decode the size field, for integer get/set functions */
-#define LOW_BIT(x) ((x) & 0xFFFF)
-#define NUM_BITS(x) ((x) >> 16)
-
-/* Doesn't work if NUM_BITS(size) == 0, but it never happens in SET() call. */
-#define BIT_MASK(type, size) (((((type)1 << (NUM_BITS(size) - 1)) - 1) << 1) + 1)
-
-/* This macro CHANGES the first parameter IN PLACE. For proper sign handling,
- we must first shift left, then right.
-*/
-#define GET_BITFIELD(v, size) \
- if (NUM_BITS(size)) { \
- v <<= (sizeof(v)*8 - LOW_BIT(size) - NUM_BITS(size)); \
- v >>= (sizeof(v)*8 - NUM_BITS(size)); \
- }
-
-/* This macro RETURNS the first parameter with the bit field CHANGED. */
-#define SET(type, x, v, size) \
- (NUM_BITS(size) ? \
- ( ( (type)x & ~(BIT_MASK(type, size) << LOW_BIT(size)) ) | ( ((type)v & BIT_MASK(type, size)) << LOW_BIT(size) ) ) \
- : (type)v)
-
-#if SIZEOF_SHORT == 2
-# define SWAP_SHORT _Py_bswap16
-#else
-# error "unsupported short size"
-#endif
-
-#if SIZEOF_INT == 4
-# define SWAP_INT _Py_bswap32
-#else
-# error "unsupported int size"
-#endif
-
-#if SIZEOF_LONG == 4
-# define SWAP_LONG _Py_bswap32
-#elif SIZEOF_LONG == 8
-# define SWAP_LONG _Py_bswap64
-#else
-# error "unsupported long size"
-#endif
-
-#if SIZEOF_LONG_LONG == 8
-# define SWAP_LONG_LONG _Py_bswap64
-#else
-# error "unsupported long long size"
-#endif
-
-/*****************************************************************
- * The setter methods return an object which must be kept alive, to keep the
- * data valid which has been stored in the memory block. The ctypes object
- * instance inserts this object into its 'b_objects' list.
- *
- * For simple Python types like integers or characters, there is nothing that
- * has to been kept alive, so Py_None is returned in these cases. But this
- * makes inspecting the 'b_objects' list, which is accessible from Python for
- * debugging, less useful.
- *
- * So, defining the _CTYPES_DEBUG_KEEP symbol returns the original value
- * instead of Py_None.
- */
-
-#ifdef _CTYPES_DEBUG_KEEP
-#define _RET(x) Py_INCREF(x); return x
-#else
-#define _RET(X) Py_RETURN_NONE
-#endif
-
-/*****************************************************************
- * integer accessor methods, supporting bit fields
- */
-
-static PyObject *
-b_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- long val;
- if (get_long(value, &val) < 0)
- return NULL;
- *(signed char *)ptr = SET(signed char, *(signed char *)ptr, val, size);
- _RET(value);
-}
-
-
-static PyObject *
-b_get(void *ptr, Py_ssize_t size)
-{
- signed char val = *(signed char *)ptr;
- GET_BITFIELD(val, size);
- return PyLong_FromLong(val);
-}
-
-static PyObject *
-B_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- unsigned long val;
- if (get_ulong(value, &val) < 0)
- return NULL;
- *(unsigned char *)ptr = SET(unsigned char, *(unsigned char*)ptr, val, size);
- _RET(value);
-}
-
-
-static PyObject *
-B_get(void *ptr, Py_ssize_t size)
-{
- unsigned char val = *(unsigned char *)ptr;
- GET_BITFIELD(val, size);
- return PyLong_FromLong(val);
-}
-
-static PyObject *
-h_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- long val;
- short x;
- if (get_long(value, &val) < 0)
- return NULL;
- memcpy(&x, ptr, sizeof(x));
- x = SET(short, x, val, size);
- memcpy(ptr, &x, sizeof(x));
- _RET(value);
-}
-
-
-static PyObject *
-h_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
-{
- long val;
- short field;
- if (get_long(value, &val) < 0) {
- return NULL;
- }
- memcpy(&field, ptr, sizeof(field));
- field = SWAP_SHORT(field);
- field = SET(short, field, val, size);
- field = SWAP_SHORT(field);
- memcpy(ptr, &field, sizeof(field));
- _RET(value);
-}
-
-static PyObject *
-h_get(void *ptr, Py_ssize_t size)
-{
- short val;
- memcpy(&val, ptr, sizeof(val));
- GET_BITFIELD(val, size);
- return PyLong_FromLong((long)val);
-}
-
-static PyObject *
-h_get_sw(void *ptr, Py_ssize_t size)
-{
- short val;
- memcpy(&val, ptr, sizeof(val));
- val = SWAP_SHORT(val);
- GET_BITFIELD(val, size);
- return PyLong_FromLong(val);
-}
-
-static PyObject *
-H_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- unsigned long val;
- unsigned short x;
- if (get_ulong(value, &val) < 0)
- return NULL;
- memcpy(&x, ptr, sizeof(x));
- x = SET(unsigned short, x, val, size);
- memcpy(ptr, &x, sizeof(x));
- _RET(value);
-}
-
-static PyObject *
-H_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
-{
- unsigned long val;
- unsigned short field;
- if (get_ulong(value, &val) < 0) {
- return NULL;
- }
- memcpy(&field, ptr, sizeof(field));
- field = SWAP_SHORT(field);
- field = SET(unsigned short, field, val, size);
- field = SWAP_SHORT(field);
- memcpy(ptr, &field, sizeof(field));
- _RET(value);
-}
-
-
-static PyObject *
-H_get(void *ptr, Py_ssize_t size)
-{
- unsigned short val;
- memcpy(&val, ptr, sizeof(val));
- GET_BITFIELD(val, size);
- return PyLong_FromLong(val);
-}
-
-static PyObject *
-H_get_sw(void *ptr, Py_ssize_t size)
-{
- unsigned short val;
- memcpy(&val, ptr, sizeof(val));
- val = SWAP_SHORT(val);
- GET_BITFIELD(val, size);
- return PyLong_FromLong(val);
-}
-
-static PyObject *
-i_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- long val;
- int x;
- if (get_long(value, &val) < 0)
- return NULL;
- memcpy(&x, ptr, sizeof(x));
- x = SET(int, x, val, size);
- memcpy(ptr, &x, sizeof(x));
- _RET(value);
-}
-
-static PyObject *
-i_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
-{
- long val;
- int field;
- if (get_long(value, &val) < 0) {
- return NULL;
- }
- memcpy(&field, ptr, sizeof(field));
- field = SWAP_INT(field);
- field = SET(int, field, val, size);
- field = SWAP_INT(field);
- memcpy(ptr, &field, sizeof(field));
- _RET(value);
-}
-
-
-static PyObject *
-i_get(void *ptr, Py_ssize_t size)
-{
- int val;
- memcpy(&val, ptr, sizeof(val));
- GET_BITFIELD(val, size);
- return PyLong_FromLong(val);
-}
-
-static PyObject *
-i_get_sw(void *ptr, Py_ssize_t size)
-{
- int val;
- memcpy(&val, ptr, sizeof(val));
- val = SWAP_INT(val);
- GET_BITFIELD(val, size);
- return PyLong_FromLong(val);
-}
-
-#ifndef MS_WIN32
-/* http://msdn.microsoft.com/en-us/library/cc237864.aspx */
-#define VARIANT_FALSE 0x0000
-#define VARIANT_TRUE 0xFFFF
-#endif
-/* short BOOL - VARIANT_BOOL */
-static PyObject *
-vBOOL_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- switch (PyObject_IsTrue(value)) {
- case -1:
- return NULL;
- case 0:
- *(short int *)ptr = VARIANT_FALSE;
- _RET(value);
- default:
- *(short int *)ptr = VARIANT_TRUE;
- _RET(value);
- }
-}
-
-static PyObject *
-vBOOL_get(void *ptr, Py_ssize_t size)
-{
- return PyBool_FromLong((long)*(short int *)ptr);
-}
-
-static PyObject *
-bool_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- switch (PyObject_IsTrue(value)) {
- case -1:
- return NULL;
- case 0:
- *(_Bool *)ptr = 0;
- _RET(value);
- default:
- *(_Bool *)ptr = 1;
- _RET(value);
- }
-}
-
-static PyObject *
-bool_get(void *ptr, Py_ssize_t size)
-{
- return PyBool_FromLong((long)*(_Bool *)ptr);
-}
-
-static PyObject *
-I_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- unsigned long val;
- unsigned int x;
- if (get_ulong(value, &val) < 0)
- return NULL;
- memcpy(&x, ptr, sizeof(x));
- x = SET(unsigned int, x, val, size);
- memcpy(ptr, &x, sizeof(x));
- _RET(value);
-}
-
-static PyObject *
-I_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
-{
- unsigned long val;
- unsigned int field;
- if (get_ulong(value, &val) < 0) {
- return NULL;
- }
- memcpy(&field, ptr, sizeof(field));
- field = SWAP_INT(field);
- field = SET(unsigned int, field, (unsigned int)val, size);
- field = SWAP_INT(field);
- memcpy(ptr, &field, sizeof(field));
- _RET(value);
-}
-
-
-static PyObject *
-I_get(void *ptr, Py_ssize_t size)
-{
- unsigned int val;
- memcpy(&val, ptr, sizeof(val));
- GET_BITFIELD(val, size);
- return PyLong_FromUnsignedLong(val);
-}
-
-static PyObject *
-I_get_sw(void *ptr, Py_ssize_t size)
-{
- unsigned int val;
- memcpy(&val, ptr, sizeof(val));
- val = SWAP_INT(val);
- GET_BITFIELD(val, size);
- return PyLong_FromUnsignedLong(val);
-}
-
-static PyObject *
-l_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- long val;
- long x;
- if (get_long(value, &val) < 0)
- return NULL;
- memcpy(&x, ptr, sizeof(x));
- x = SET(long, x, val, size);
- memcpy(ptr, &x, sizeof(x));
- _RET(value);
-}
-
-static PyObject *
-l_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
-{
- long val;
- long field;
- if (get_long(value, &val) < 0) {
- return NULL;
- }
- memcpy(&field, ptr, sizeof(field));
- field = SWAP_LONG(field);
- field = SET(long, field, val, size);
- field = SWAP_LONG(field);
- memcpy(ptr, &field, sizeof(field));
- _RET(value);
-}
-
-
-static PyObject *
-l_get(void *ptr, Py_ssize_t size)
-{
- long val;
- memcpy(&val, ptr, sizeof(val));
- GET_BITFIELD(val, size);
- return PyLong_FromLong(val);
-}
-
-static PyObject *
-l_get_sw(void *ptr, Py_ssize_t size)
-{
- long val;
- memcpy(&val, ptr, sizeof(val));
- val = SWAP_LONG(val);
- GET_BITFIELD(val, size);
- return PyLong_FromLong(val);
-}
-
-static PyObject *
-L_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- unsigned long val;
- unsigned long x;
- if (get_ulong(value, &val) < 0)
- return NULL;
- memcpy(&x, ptr, sizeof(x));
- x = SET(unsigned long, x, val, size);
- memcpy(ptr, &x, sizeof(x));
- _RET(value);
-}
-
-static PyObject *
-L_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
-{
- unsigned long val;
- unsigned long field;
- if (get_ulong(value, &val) < 0) {
- return NULL;
- }
- memcpy(&field, ptr, sizeof(field));
- field = SWAP_LONG(field);
- field = SET(unsigned long, field, val, size);
- field = SWAP_LONG(field);
- memcpy(ptr, &field, sizeof(field));
- _RET(value);
-}
-
-
-static PyObject *
-L_get(void *ptr, Py_ssize_t size)
-{
- unsigned long val;
- memcpy(&val, ptr, sizeof(val));
- GET_BITFIELD(val, size);
- return PyLong_FromUnsignedLong(val);
-}
-
-static PyObject *
-L_get_sw(void *ptr, Py_ssize_t size)
-{
- unsigned long val;
- memcpy(&val, ptr, sizeof(val));
- val = SWAP_LONG(val);
- GET_BITFIELD(val, size);
- return PyLong_FromUnsignedLong(val);
-}
-
-static PyObject *
-q_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- long long val;
- long long x;
- if (get_longlong(value, &val) < 0)
- return NULL;
- memcpy(&x, ptr, sizeof(x));
- x = SET(long long, x, val, size);
- memcpy(ptr, &x, sizeof(x));
- _RET(value);
-}
-
-static PyObject *
-q_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
-{
- long long val;
- long long field;
- if (get_longlong(value, &val) < 0) {
- return NULL;
- }
- memcpy(&field, ptr, sizeof(field));
- field = SWAP_LONG_LONG(field);
- field = SET(long long, field, val, size);
- field = SWAP_LONG_LONG(field);
- memcpy(ptr, &field, sizeof(field));
- _RET(value);
-}
-
-static PyObject *
-q_get(void *ptr, Py_ssize_t size)
-{
- long long val;
- memcpy(&val, ptr, sizeof(val));
- GET_BITFIELD(val, size);
- return PyLong_FromLongLong(val);
-}
-
-static PyObject *
-q_get_sw(void *ptr, Py_ssize_t size)
-{
- long long val;
- memcpy(&val, ptr, sizeof(val));
- val = SWAP_LONG_LONG(val);
- GET_BITFIELD(val, size);
- return PyLong_FromLongLong(val);
-}
-
-static PyObject *
-Q_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- unsigned long long val;
- unsigned long long x;
- if (get_ulonglong(value, &val) < 0)
- return NULL;
- memcpy(&x, ptr, sizeof(x));
- x = SET(long long, x, val, size);
- memcpy(ptr, &x, sizeof(x));
- _RET(value);
-}
-
-static PyObject *
-Q_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
-{
- unsigned long long val;
- unsigned long long field;
- if (get_ulonglong(value, &val) < 0) {
- return NULL;
- }
- memcpy(&field, ptr, sizeof(field));
- field = SWAP_LONG_LONG(field);
- field = SET(unsigned long long, field, val, size);
- field = SWAP_LONG_LONG(field);
- memcpy(ptr, &field, sizeof(field));
- _RET(value);
-}
-
-static PyObject *
-Q_get(void *ptr, Py_ssize_t size)
-{
- unsigned long long val;
- memcpy(&val, ptr, sizeof(val));
- GET_BITFIELD(val, size);
- return PyLong_FromUnsignedLongLong(val);
-}
-
-static PyObject *
-Q_get_sw(void *ptr, Py_ssize_t size)
-{
- unsigned long long val;
- memcpy(&val, ptr, sizeof(val));
- val = SWAP_LONG_LONG(val);
- GET_BITFIELD(val, size);
- return PyLong_FromUnsignedLongLong(val);
-}
-
-/*****************************************************************
- * non-integer accessor methods, not supporting bit fields
- */
-
-
-static PyObject *
-g_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- long double x;
-
- x = PyFloat_AsDouble(value);
- if (x == -1 && PyErr_Occurred())
- return NULL;
- memcpy(ptr, &x, sizeof(long double));
- _RET(value);
-}
-
-static PyObject *
-g_get(void *ptr, Py_ssize_t size)
-{
- long double val;
- memcpy(&val, ptr, sizeof(long double));
- return PyFloat_FromDouble(val);
-}
-
-static PyObject *
-d_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- double x;
-
- x = PyFloat_AsDouble(value);
- if (x == -1 && PyErr_Occurred())
- return NULL;
- memcpy(ptr, &x, sizeof(double));
- _RET(value);
-}
-
-static PyObject *
-d_get(void *ptr, Py_ssize_t size)
-{
- double val;
- memcpy(&val, ptr, sizeof(val));
- return PyFloat_FromDouble(val);
-}
-
-static PyObject *
-d_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
-{
- double x;
-
- x = PyFloat_AsDouble(value);
- if (x == -1 && PyErr_Occurred())
- return NULL;
-#ifdef WORDS_BIGENDIAN
- if (PyFloat_Pack8(x, ptr, 1))
- return NULL;
-#else
- if (PyFloat_Pack8(x, ptr, 0))
- return NULL;
-#endif
- _RET(value);
-}
-
-static PyObject *
-d_get_sw(void *ptr, Py_ssize_t size)
-{
-#ifdef WORDS_BIGENDIAN
- return PyFloat_FromDouble(PyFloat_Unpack8(ptr, 1));
-#else
- return PyFloat_FromDouble(PyFloat_Unpack8(ptr, 0));
-#endif
-}
-
-static PyObject *
-f_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- float x;
-
- x = (float)PyFloat_AsDouble(value);
- if (x == -1 && PyErr_Occurred())
- return NULL;
- memcpy(ptr, &x, sizeof(x));
- _RET(value);
-}
-
-static PyObject *
-f_get(void *ptr, Py_ssize_t size)
-{
- float val;
- memcpy(&val, ptr, sizeof(val));
- return PyFloat_FromDouble(val);
-}
-
-static PyObject *
-f_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
-{
- float x;
-
- x = (float)PyFloat_AsDouble(value);
- if (x == -1 && PyErr_Occurred())
- return NULL;
-#ifdef WORDS_BIGENDIAN
- if (PyFloat_Pack4(x, ptr, 1))
- return NULL;
-#else
- if (PyFloat_Pack4(x, ptr, 0))
- return NULL;
-#endif
- _RET(value);
-}
-
-static PyObject *
-f_get_sw(void *ptr, Py_ssize_t size)
-{
-#ifdef WORDS_BIGENDIAN
- return PyFloat_FromDouble(PyFloat_Unpack4(ptr, 1));
-#else
- return PyFloat_FromDouble(PyFloat_Unpack4(ptr, 0));
-#endif
-}
-
-/*
- py_object refcounts:
-
- 1. If we have a py_object instance, O_get must Py_INCREF the returned
- object, of course. If O_get is called from a function result, no py_object
- instance is created - so callproc.c::GetResult has to call Py_DECREF.
-
- 2. The memory block in py_object owns a refcount. So, py_object must call
- Py_DECREF on destruction. Maybe only when b_needsfree is non-zero.
-*/
-static PyObject *
-O_get(void *ptr, Py_ssize_t size)
-{
- PyObject *ob = *(PyObject **)ptr;
- if (ob == NULL) {
- if (!PyErr_Occurred())
- /* Set an error if not yet set */
- PyErr_SetString(PyExc_ValueError,
- "PyObject is NULL");
- return NULL;
- }
- return Py_NewRef(ob);
-}
-
-static PyObject *
-O_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- /* Hm, does the memory block need it's own refcount or not? */
- *(PyObject **)ptr = value;
- return Py_NewRef(value);
-}
-
-
-static PyObject *
-c_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- if (PyBytes_Check(value) && PyBytes_GET_SIZE(value) == 1) {
- *(char *)ptr = PyBytes_AS_STRING(value)[0];
- _RET(value);
- }
- if (PyByteArray_Check(value) && PyByteArray_GET_SIZE(value) == 1) {
- *(char *)ptr = PyByteArray_AS_STRING(value)[0];
- _RET(value);
- }
- if (PyLong_Check(value))
- {
- long longval = PyLong_AsLong(value);
- if (longval < 0 || longval >= 256)
- goto error;
- *(char *)ptr = (char)longval;
- _RET(value);
- }
- error:
- PyErr_Format(PyExc_TypeError,
- "one character bytes, bytearray or integer expected");
- return NULL;
-}
-
-
-static PyObject *
-c_get(void *ptr, Py_ssize_t size)
-{
- return PyBytes_FromStringAndSize((char *)ptr, 1);
-}
-
-/* u - a single wchar_t character */
-static PyObject *
-u_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- Py_ssize_t len;
- wchar_t chars[2];
- if (!PyUnicode_Check(value)) {
- PyErr_Format(PyExc_TypeError,
- "unicode string expected instead of %s instance",
- Py_TYPE(value)->tp_name);
- return NULL;
- } else
- Py_INCREF(value);
-
- len = PyUnicode_AsWideChar(value, chars, 2);
- if (len != 1) {
- Py_DECREF(value);
- PyErr_SetString(PyExc_TypeError,
- "one character unicode string expected");
- return NULL;
- }
-
- *(wchar_t *)ptr = chars[0];
- Py_DECREF(value);
-
- _RET(value);
-}
-
-
-static PyObject *
-u_get(void *ptr, Py_ssize_t size)
-{
- return PyUnicode_FromWideChar((wchar_t *)ptr, 1);
-}
-
-/* U - a unicode string */
-static PyObject *
-U_get(void *ptr, Py_ssize_t size)
-{
- Py_ssize_t len;
- wchar_t *p;
-
- size /= sizeof(wchar_t); /* we count character units here, not bytes */
-
- /* We need 'result' to be able to count the characters with wcslen,
- since ptr may not be NUL terminated. If the length is smaller (if
- it was actually NUL terminated, we construct a new one and throw
- away the result.
- */
- /* chop off at the first NUL character, if any. */
- p = (wchar_t*)ptr;
- for (len = 0; len < size; ++len) {
- if (!p[len])
- break;
- }
-
- return PyUnicode_FromWideChar((wchar_t *)ptr, len);
-}
-
-static PyObject *
-U_set(void *ptr, PyObject *value, Py_ssize_t length)
-{
- /* It's easier to calculate in characters than in bytes */
- length /= sizeof(wchar_t);
-
- if (!PyUnicode_Check(value)) {
- PyErr_Format(PyExc_TypeError,
- "unicode string expected instead of %s instance",
- Py_TYPE(value)->tp_name);
- return NULL;
- }
-
- Py_ssize_t size = PyUnicode_AsWideChar(value, NULL, 0);
- if (size < 0) {
- return NULL;
- }
- // PyUnicode_AsWideChar() returns number of wchars including trailing null byte,
- // when it is called with NULL.
- size--;
- assert(size >= 0);
- if (size > length) {
- PyErr_Format(PyExc_ValueError,
- "string too long (%zd, maximum length %zd)",
- size, length);
- return NULL;
- }
- if (PyUnicode_AsWideChar(value, (wchar_t *)ptr, length) == -1) {
- return NULL;
- }
-
- return Py_NewRef(value);
-}
-
-
-static PyObject *
-s_get(void *ptr, Py_ssize_t size)
-{
- Py_ssize_t i;
- char *p;
-
- p = (char *)ptr;
- for (i = 0; i < size; ++i) {
- if (*p++ == '\0')
- break;
- }
-
- return PyBytes_FromStringAndSize((char *)ptr, (Py_ssize_t)i);
-}
-
-static PyObject *
-s_set(void *ptr, PyObject *value, Py_ssize_t length)
-{
- const char *data;
- Py_ssize_t size;
-
- if(!PyBytes_Check(value)) {
- PyErr_Format(PyExc_TypeError,
- "expected bytes, %s found",
- Py_TYPE(value)->tp_name);
- return NULL;
- }
-
- data = PyBytes_AS_STRING(value);
- // bpo-39593: Use strlen() to truncate the string at the first null character.
- size = strlen(data);
-
- if (size < length) {
- /* This will copy the terminating NUL character
- * if there is space for it.
- */
- ++size;
- } else if (size > length) {
- PyErr_Format(PyExc_ValueError,
- "bytes too long (%zd, maximum length %zd)",
- size, length);
- return NULL;
- }
- /* Also copy the terminating NUL character if there is space */
- memcpy((char *)ptr, data, size);
-
- _RET(value);
-}
-
-static PyObject *
-z_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- if (value == Py_None) {
- *(char **)ptr = NULL;
- return Py_NewRef(value);
- }
- if (PyBytes_Check(value)) {
- *(const char **)ptr = PyBytes_AsString(value);
- return Py_NewRef(value);
- } else if (PyLong_Check(value)) {
-#if SIZEOF_VOID_P == SIZEOF_LONG_LONG
- *(char **)ptr = (char *)PyLong_AsUnsignedLongLongMask(value);
-#else
- *(char **)ptr = (char *)PyLong_AsUnsignedLongMask(value);
-#endif
- _RET(value);
- }
- PyErr_Format(PyExc_TypeError,
- "bytes or integer address expected instead of %s instance",
- Py_TYPE(value)->tp_name);
- return NULL;
-}
-
-static PyObject *
-z_get(void *ptr, Py_ssize_t size)
-{
- /* XXX What about invalid pointers ??? */
- if (*(void **)ptr) {
- return PyBytes_FromStringAndSize(*(char **)ptr,
- strlen(*(char **)ptr));
- } else {
- Py_RETURN_NONE;
- }
-}
-
-static PyObject *
-Z_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- PyObject *keep;
- wchar_t *buffer;
- Py_ssize_t bsize;
-
- if (value == Py_None) {
- *(wchar_t **)ptr = NULL;
- return Py_NewRef(value);
- }
- if (PyLong_Check(value)) {
-#if SIZEOF_VOID_P == SIZEOF_LONG_LONG
- *(wchar_t **)ptr = (wchar_t *)PyLong_AsUnsignedLongLongMask(value);
-#else
- *(wchar_t **)ptr = (wchar_t *)PyLong_AsUnsignedLongMask(value);
-#endif
- Py_RETURN_NONE;
- }
- if (!PyUnicode_Check(value)) {
- PyErr_Format(PyExc_TypeError,
- "unicode string or integer address expected instead of %s instance",
- Py_TYPE(value)->tp_name);
- return NULL;
- }
-
- /* We must create a wchar_t* buffer from the unicode object,
- and keep it alive */
- buffer = PyUnicode_AsWideCharString(value, &bsize);
- if (!buffer)
- return NULL;
- keep = PyCapsule_New(buffer, CTYPES_CFIELD_CAPSULE_NAME_PYMEM, pymem_destructor);
- if (!keep) {
- PyMem_Free(buffer);
- return NULL;
- }
- *(wchar_t **)ptr = buffer;
- return keep;
-}
-
-static PyObject *
-Z_get(void *ptr, Py_ssize_t size)
-{
- wchar_t *p;
- p = *(wchar_t **)ptr;
- if (p) {
- return PyUnicode_FromWideChar(p, wcslen(p));
- } else {
- Py_RETURN_NONE;
- }
-}
-
-
-#ifdef MS_WIN32
-static PyObject *
-BSTR_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- BSTR bstr;
-
- /* convert value into a PyUnicodeObject or NULL */
- if (Py_None == value) {
- value = NULL;
- } else if (!PyUnicode_Check(value)) {
- PyErr_Format(PyExc_TypeError,
- "unicode string expected instead of %s instance",
- Py_TYPE(value)->tp_name);
- return NULL;
- }
-
- /* create a BSTR from value */
- if (value) {
- Py_ssize_t wsize;
- wchar_t *wvalue = PyUnicode_AsWideCharString(value, &wsize);
- if (wvalue == NULL) {
- return NULL;
- }
- if ((unsigned) wsize != wsize) {
- PyErr_SetString(PyExc_ValueError, "String too long for BSTR");
- PyMem_Free(wvalue);
- return NULL;
- }
- bstr = SysAllocStringLen(wvalue, (unsigned)wsize);
- PyMem_Free(wvalue);
- } else
- bstr = NULL;
-
- /* free the previous contents, if any */
- if (*(BSTR *)ptr)
- SysFreeString(*(BSTR *)ptr);
-
- /* and store it */
- *(BSTR *)ptr = bstr;
-
- /* We don't need to keep any other object */
- _RET(value);
-}
-
-
-static PyObject *
-BSTR_get(void *ptr, Py_ssize_t size)
-{
- BSTR p;
- p = *(BSTR *)ptr;
- if (p)
- return PyUnicode_FromWideChar(p, SysStringLen(p));
- else {
- /* Hm, it seems NULL pointer and zero length string are the
- same in BSTR, see Don Box, p 81
- */
- Py_RETURN_NONE;
- }
-}
-#endif
-
-static PyObject *
-P_set(void *ptr, PyObject *value, Py_ssize_t size)
-{
- void *v;
- if (value == Py_None) {
- *(void **)ptr = NULL;
- _RET(value);
- }
-
- if (!PyLong_Check(value)) {
- PyErr_SetString(PyExc_TypeError,
- "cannot be converted to pointer");
- return NULL;
- }
-
-#if SIZEOF_VOID_P <= SIZEOF_LONG
- v = (void *)PyLong_AsUnsignedLongMask(value);
-#else
-#if SIZEOF_LONG_LONG < SIZEOF_VOID_P
-# error "PyLong_AsVoidPtr: sizeof(long long) < sizeof(void*)"
-#endif
- v = (void *)PyLong_AsUnsignedLongLongMask(value);
-#endif
-
- if (PyErr_Occurred())
- return NULL;
-
- *(void **)ptr = v;
- _RET(value);
-}
-
-static PyObject *
-P_get(void *ptr, Py_ssize_t size)
-{
- if (*(void **)ptr == NULL) {
- Py_RETURN_NONE;
- }
- return PyLong_FromVoidPtr(*(void **)ptr);
-}
-
-static struct fielddesc formattable[] = {
- { 's', s_set, s_get, NULL},
- { 'b', b_set, b_get, NULL},
- { 'B', B_set, B_get, NULL},
- { 'c', c_set, c_get, NULL},
- { 'd', d_set, d_get, NULL, d_set_sw, d_get_sw},
- { 'g', g_set, g_get, NULL},
- { 'f', f_set, f_get, NULL, f_set_sw, f_get_sw},
- { 'h', h_set, h_get, NULL, h_set_sw, h_get_sw},
- { 'H', H_set, H_get, NULL, H_set_sw, H_get_sw},
- { 'i', i_set, i_get, NULL, i_set_sw, i_get_sw},
- { 'I', I_set, I_get, NULL, I_set_sw, I_get_sw},
- { 'l', l_set, l_get, NULL, l_set_sw, l_get_sw},
- { 'L', L_set, L_get, NULL, L_set_sw, L_get_sw},
- { 'q', q_set, q_get, NULL, q_set_sw, q_get_sw},
- { 'Q', Q_set, Q_get, NULL, Q_set_sw, Q_get_sw},
- { 'P', P_set, P_get, NULL},
- { 'z', z_set, z_get, NULL},
- { 'u', u_set, u_get, NULL},
- { 'U', U_set, U_get, NULL},
- { 'Z', Z_set, Z_get, NULL},
-#ifdef MS_WIN32
- { 'X', BSTR_set, BSTR_get, NULL},
-#endif
- { 'v', vBOOL_set, vBOOL_get, NULL},
-#if SIZEOF__BOOL == SIZEOF_INT
- { '?', bool_set, bool_get, NULL, I_set_sw, I_get_sw},
-#elif SIZEOF__BOOL == SIZEOF_LONG
- { '?', bool_set, bool_get, NULL, L_set_sw, L_get_sw},
-#elif SIZEOF__BOOL == SIZEOF_LONG_LONG
- { '?', bool_set, bool_get, NULL, Q_set_sw, Q_get_sw},
-#else
- { '?', bool_set, bool_get, NULL},
-#endif /* SIZEOF__BOOL */
- { 'O', O_set, O_get, NULL},
- { 0, NULL, NULL, NULL},
-};
-
-/*
- Ideas: Implement VARIANT in this table, using 'V' code.
- Use '?' as code for BOOL.
-*/
-
-/* Delayed initialization. Windows cannot statically reference dynamically
- loaded addresses from DLLs. */
-void
-_ctypes_init_fielddesc(void)
-{
- struct fielddesc *fd = formattable;
- for (; fd->code; ++fd) {
- switch (fd->code) {
- case 's': fd->pffi_type = &ffi_type_pointer; break;
- case 'b': fd->pffi_type = &ffi_type_schar; break;
- case 'B': fd->pffi_type = &ffi_type_uchar; break;
- case 'c': fd->pffi_type = &ffi_type_schar; break;
- case 'd': fd->pffi_type = &ffi_type_double; break;
- case 'g': fd->pffi_type = &ffi_type_longdouble; break;
- case 'f': fd->pffi_type = &ffi_type_float; break;
- case 'h': fd->pffi_type = &ffi_type_sshort; break;
- case 'H': fd->pffi_type = &ffi_type_ushort; break;
- case 'i': fd->pffi_type = &ffi_type_sint; break;
- case 'I': fd->pffi_type = &ffi_type_uint; break;
- /* XXX Hm, sizeof(int) == sizeof(long) doesn't hold on every platform */
- /* As soon as we can get rid of the type codes, this is no longer a problem */
- #if SIZEOF_LONG == 4
- case 'l': fd->pffi_type = &ffi_type_sint32; break;
- case 'L': fd->pffi_type = &ffi_type_uint32; break;
- #elif SIZEOF_LONG == 8
- case 'l': fd->pffi_type = &ffi_type_sint64; break;
- case 'L': fd->pffi_type = &ffi_type_uint64; break;
- #else
- #error
- #endif
- #if SIZEOF_LONG_LONG == 8
- case 'q': fd->pffi_type = &ffi_type_sint64; break;
- case 'Q': fd->pffi_type = &ffi_type_uint64; break;
- #else
- #error
- #endif
- case 'P': fd->pffi_type = &ffi_type_pointer; break;
- case 'z': fd->pffi_type = &ffi_type_pointer; break;
- case 'u':
- if (sizeof(wchar_t) == sizeof(short))
- fd->pffi_type = &ffi_type_sshort;
- else if (sizeof(wchar_t) == sizeof(int))
- fd->pffi_type = &ffi_type_sint;
- else if (sizeof(wchar_t) == sizeof(long))
- fd->pffi_type = &ffi_type_slong;
- else
- Py_UNREACHABLE();
- break;
- case 'U': fd->pffi_type = &ffi_type_pointer; break;
- case 'Z': fd->pffi_type = &ffi_type_pointer; break;
- #ifdef MS_WIN32
- case 'X': fd->pffi_type = &ffi_type_pointer; break;
- #endif
- case 'v': fd->pffi_type = &ffi_type_sshort; break;
- #if SIZEOF__BOOL == 1
- case '?': fd->pffi_type = &ffi_type_uchar; break; /* Also fallback for no native _Bool support */
- #elif SIZEOF__BOOL == SIZEOF_SHORT
- case '?': fd->pffi_type = &ffi_type_ushort; break;
- #elif SIZEOF__BOOL == SIZEOF_INT
- case '?': fd->pffi_type = &ffi_type_uint; break;
- #elif SIZEOF__BOOL == SIZEOF_LONG
- case '?': fd->pffi_type = &ffi_type_ulong; break;
- #elif SIZEOF__BOOL == SIZEOF_LONG_LONG
- case '?': fd->pffi_type = &ffi_type_ulong; break;
- #endif /* SIZEOF__BOOL */
- case 'O': fd->pffi_type = &ffi_type_pointer; break;
- default:
- Py_UNREACHABLE();
- }
- }
-
-}
-
-struct fielddesc *
-_ctypes_get_fielddesc(const char *fmt)
-{
- static int initialized = 0;
- struct fielddesc *table = formattable;
-
- if (!initialized) {
- initialized = 1;
- _ctypes_init_fielddesc();
- }
-
- for (; table->code; ++table) {
- if (table->code == fmt[0])
- return table;
- }
- return NULL;
-}
-
-/*---------------- EOF ----------------*/
diff --git a/contrib/tools/python3/src/Modules/_ctypes/ctypes.h b/contrib/tools/python3/src/Modules/_ctypes/ctypes.h
deleted file mode 100644
index 8891a0a741d..00000000000
--- a/contrib/tools/python3/src/Modules/_ctypes/ctypes.h
+++ /dev/null
@@ -1,410 +0,0 @@
-#if defined (__SVR4) && defined (__sun)
-# include <alloca.h>
-#endif
-
-#ifndef MS_WIN32
-#define max(a, b) ((a) > (b) ? (a) : (b))
-#define min(a, b) ((a) < (b) ? (a) : (b))
-
-#define PARAMFLAG_FIN 0x1
-#define PARAMFLAG_FOUT 0x2
-#define PARAMFLAG_FLCID 0x4
-#endif
-
-/*
- * bpo-13097: Max number of arguments CFuncPtr._argtypes_ and
- * _ctypes_callproc() will accept.
- *
- * This limit is enforced for the `alloca()` call in `_ctypes_callproc`,
- * to avoid allocating a massive buffer on the stack.
- */
-#ifndef CTYPES_MAX_ARGCOUNT
- #ifdef __EMSCRIPTEN__
- #define CTYPES_MAX_ARGCOUNT 1000
- #else
- #define CTYPES_MAX_ARGCOUNT 1024
- #endif
-#endif
-
-#if defined(__has_builtin)
-#if __has_builtin(__builtin_available)
-#define HAVE_BUILTIN_AVAILABLE 1
-#endif
-#endif
-
-typedef struct {
- PyTypeObject *DictRemover_Type;
- PyTypeObject *PyCArg_Type;
- PyTypeObject *PyCField_Type;
- PyTypeObject *PyCThunk_Type;
-#ifdef MS_WIN32
- PyTypeObject *PyComError_Type;
-#endif
- PyTypeObject *StructParam_Type;
-} ctypes_state;
-
-extern ctypes_state global_state;
-
-#define GLOBAL_STATE() (&global_state)
-
-extern PyType_Spec carg_spec;
-extern PyType_Spec cfield_spec;
-extern PyType_Spec cthunk_spec;
-
-typedef struct tagPyCArgObject PyCArgObject;
-typedef struct tagCDataObject CDataObject;
-typedef PyObject *(* GETFUNC)(void *, Py_ssize_t size);
-typedef PyObject *(* SETFUNC)(void *, PyObject *value, Py_ssize_t size);
-typedef PyCArgObject *(* PARAMFUNC)(CDataObject *obj);
-
-/* A default buffer in CDataObject, which can be used for small C types. If
-this buffer is too small, PyMem_Malloc will be called to create a larger one,
-and this one is not used.
-
-Making CDataObject a variable size object would be a better solution, but more
-difficult in the presence of PyCFuncPtrObject. Maybe later.
-*/
-union value {
- char c[16];
- short s;
- int i;
- long l;
- float f;
- double d;
- long long ll;
- long double D;
-};
-
-/*
- Hm. Are there CDataObject's which do not need the b_objects member? In
- this case we probably should introduce b_flags to mark it as present... If
- b_objects is not present/unused b_length is unneeded as well.
-*/
-
-struct tagCDataObject {
- PyObject_HEAD
- char *b_ptr; /* pointer to memory block */
- int b_needsfree; /* need _we_ free the memory? */
- CDataObject *b_base; /* pointer to base object or NULL */
- Py_ssize_t b_size; /* size of memory block in bytes */
- Py_ssize_t b_length; /* number of references we need */
- Py_ssize_t b_index; /* index of this object into base's
- b_object list */
- PyObject *b_objects; /* dictionary of references we need to keep, or Py_None */
- union value b_value;
-};
-
-typedef struct {
- PyObject_VAR_HEAD
- ffi_closure *pcl_write; /* the C callable, writeable */
- void *pcl_exec; /* the C callable, executable */
- ffi_cif cif;
- int flags;
- PyObject *converters;
- PyObject *callable;
- PyObject *restype;
- SETFUNC setfunc;
- ffi_type *ffi_restype;
- ffi_type *atypes[1];
-} CThunkObject;
-#define CThunk_CheckExact(st, v) Py_IS_TYPE(v, st->PyCThunk_Type)
-
-typedef struct {
- /* First part identical to tagCDataObject */
- PyObject_HEAD
- char *b_ptr; /* pointer to memory block */
- int b_needsfree; /* need _we_ free the memory? */
- CDataObject *b_base; /* pointer to base object or NULL */
- Py_ssize_t b_size; /* size of memory block in bytes */
- Py_ssize_t b_length; /* number of references we need */
- Py_ssize_t b_index; /* index of this object into base's
- b_object list */
- PyObject *b_objects; /* list of references we need to keep */
- union value b_value;
- /* end of tagCDataObject, additional fields follow */
-
- CThunkObject *thunk;
- PyObject *callable;
-
- /* These two fields will override the ones in the type's stgdict if
- they are set */
- PyObject *converters;
- PyObject *argtypes;
- PyObject *restype;
- PyObject *checker;
- PyObject *errcheck;
-#ifdef MS_WIN32
- int index;
- GUID *iid;
-#endif
- PyObject *paramflags;
-} PyCFuncPtrObject;
-
-extern PyTypeObject PyCStgDict_Type;
-#define PyCStgDict_CheckExact(v) Py_IS_TYPE(v, &PyCStgDict_Type)
-#define PyCStgDict_Check(v) PyObject_TypeCheck(v, &PyCStgDict_Type)
-
-extern int PyCStructUnionType_update_stgdict(PyObject *fields, PyObject *type, int isStruct);
-extern int PyType_stginfo(PyTypeObject *self, Py_ssize_t *psize, Py_ssize_t *palign, Py_ssize_t *plength);
-extern int PyObject_stginfo(PyObject *self, Py_ssize_t *psize, Py_ssize_t *palign, Py_ssize_t *plength);
-
-
-
-extern PyTypeObject PyCData_Type;
-#define CDataObject_CheckExact(v) Py_IS_TYPE(v, &PyCData_Type)
-#define CDataObject_Check(v) PyObject_TypeCheck(v, &PyCData_Type)
-#define _CDataObject_HasExternalBuffer(v) ((v)->b_ptr != (char *)&(v)->b_value)
-
-extern PyTypeObject PyCSimpleType_Type;
-#define PyCSimpleTypeObject_CheckExact(v) Py_IS_TYPE(v, &PyCSimpleType_Type)
-#define PyCSimpleTypeObject_Check(v) PyObject_TypeCheck(v, &PyCSimpleType_Type)
-
-extern struct fielddesc *_ctypes_get_fielddesc(const char *fmt);
-
-
-extern PyObject *
-PyCField_FromDesc(PyObject *desc, Py_ssize_t index,
- Py_ssize_t *pfield_size, int bitsize, int *pbitofs,
- Py_ssize_t *psize, Py_ssize_t *poffset, Py_ssize_t *palign,
- int pack, int is_big_endian);
-
-extern PyObject *PyCData_AtAddress(PyObject *type, void *buf);
-extern PyObject *PyCData_FromBytes(PyObject *type, char *data, Py_ssize_t length);
-
-extern PyTypeObject PyCArrayType_Type;
-extern PyTypeObject PyCArray_Type;
-extern PyTypeObject PyCPointerType_Type;
-extern PyTypeObject PyCPointer_Type;
-extern PyTypeObject PyCFuncPtr_Type;
-extern PyTypeObject PyCFuncPtrType_Type;
-extern PyTypeObject PyCStructType_Type;
-
-#define PyCArrayTypeObject_Check(v) PyObject_TypeCheck(v, &PyCArrayType_Type)
-#define ArrayObject_Check(v) PyObject_TypeCheck(v, &PyCArray_Type)
-#define PointerObject_Check(v) PyObject_TypeCheck(v, &PyCPointer_Type)
-#define PyCPointerTypeObject_Check(v) PyObject_TypeCheck(v, &PyCPointerType_Type)
-#define PyCFuncPtrObject_Check(v) PyObject_TypeCheck(v, &PyCFuncPtr_Type)
-#define PyCFuncPtrTypeObject_Check(v) PyObject_TypeCheck(v, &PyCFuncPtrType_Type)
-#define PyCStructTypeObject_Check(v) PyObject_TypeCheck(v, &PyCStructType_Type)
-
-extern PyObject *
-PyCArrayType_from_ctype(PyObject *itemtype, Py_ssize_t length);
-
-extern PyMethodDef _ctypes_module_methods[];
-
-extern CThunkObject *_ctypes_alloc_callback(PyObject *callable,
- PyObject *converters,
- PyObject *restype,
- int flags);
-/* a table entry describing a predefined ctypes type */
-struct fielddesc {
- char code;
- SETFUNC setfunc;
- GETFUNC getfunc;
- ffi_type *pffi_type; /* always statically allocated */
- SETFUNC setfunc_swapped;
- GETFUNC getfunc_swapped;
-};
-
-typedef struct {
- PyObject_HEAD
- Py_ssize_t offset;
- Py_ssize_t size;
- Py_ssize_t index; /* Index into CDataObject's
- object array */
- PyObject *proto; /* a type or NULL */
- GETFUNC getfunc; /* getter function if proto is NULL */
- SETFUNC setfunc; /* setter function if proto is NULL */
- int anonymous;
-} CFieldObject;
-
-/* A subclass of PyDictObject, used as the instance dictionary of ctypes
- metatypes */
-typedef struct {
- PyDictObject dict; /* first part identical to PyDictObject */
-/* The size and align fields are unneeded, they are in ffi_type as well. As
- an experiment shows, it's trivial to get rid of them, the only thing to
- remember is that in PyCArrayType_new the ffi_type fields must be filled in -
- so far it was unneeded because libffi doesn't support arrays at all
- (because they are passed as pointers to function calls anyway). But it's
- too much risk to change that now, and there are other fields which doesn't
- belong into this structure anyway. Maybe in ctypes 2.0... (ctypes 2000?)
-*/
- Py_ssize_t size; /* number of bytes */
- Py_ssize_t align; /* alignment requirements */
- Py_ssize_t length; /* number of fields */
- ffi_type ffi_type_pointer;
- PyObject *proto; /* Only for Pointer/ArrayObject */
- SETFUNC setfunc; /* Only for simple objects */
- GETFUNC getfunc; /* Only for simple objects */
- PARAMFUNC paramfunc;
-
- /* Following fields only used by PyCFuncPtrType_Type instances */
- PyObject *argtypes; /* tuple of CDataObjects */
- PyObject *converters; /* tuple([t.from_param for t in argtypes]) */
- PyObject *restype; /* CDataObject or NULL */
- PyObject *checker;
- int flags; /* calling convention and such */
-
- /* pep3118 fields, pointers need PyMem_Free */
- char *format;
- int ndim;
- Py_ssize_t *shape;
-/* Py_ssize_t *strides; */ /* unused in ctypes */
-/* Py_ssize_t *suboffsets; */ /* unused in ctypes */
-
-} StgDictObject;
-
-/****************************************************************
- StgDictObject fields
-
- setfunc and getfunc is only set for simple data types, it is copied from the
- corresponding fielddesc entry. These are functions to set and get the value
- in a memory block.
- They should probably by used by other types as well.
-
- proto is only used for Pointer and Array types - it points to the item type
- object.
-
- Probably all the magic ctypes methods (like from_param) should have C
- callable wrappers in the StgDictObject. For simple data type, for example,
- the fielddesc table could have entries for C codec from_param functions or
- other methods as well, if a subtype overrides this method in Python at
- construction time, or assigns to it later, tp_setattro should update the
- StgDictObject function to a generic one.
-
- Currently, PyCFuncPtr types have 'converters' and 'checker' entries in their
- type dict. They are only used to cache attributes from other entries, which
- is wrong.
-
- One use case is the .value attribute that all simple types have. But some
- complex structures, like VARIANT, represent a single value also, and should
- have this attribute.
-
- Another use case is a _check_retval_ function, which is called when a ctypes
- type is used as return type of a function to validate and compute the return
- value.
-
- Common ctypes protocol:
-
- - setfunc: store a python value in a memory block
- - getfunc: convert data from a memory block into a python value
-
- - checkfunc: validate and convert a return value from a function call
- - toparamfunc: convert a python value into a function argument
-
-*****************************************************************/
-
-/* May return NULL, but does not set an exception! */
-extern StgDictObject *PyType_stgdict(PyObject *obj);
-
-/* May return NULL, but does not set an exception! */
-extern StgDictObject *PyObject_stgdict(PyObject *self);
-
-extern int PyCStgDict_clone(StgDictObject *src, StgDictObject *dst);
-
-typedef int(* PPROC)(void);
-
-PyObject *_ctypes_callproc(PPROC pProc,
- PyObject *arguments,
-#ifdef MS_WIN32
- IUnknown *pIUnk,
- GUID *iid,
-#endif
- int flags,
- PyObject *argtypes,
- PyObject *restype,
- PyObject *checker);
-
-
-#define FUNCFLAG_STDCALL 0x0
-#define FUNCFLAG_CDECL 0x1
-#define FUNCFLAG_HRESULT 0x2
-#define FUNCFLAG_PYTHONAPI 0x4
-#define FUNCFLAG_USE_ERRNO 0x8
-#define FUNCFLAG_USE_LASTERROR 0x10
-
-#define TYPEFLAG_ISPOINTER 0x100
-#define TYPEFLAG_HASPOINTER 0x200
-#define TYPEFLAG_HASUNION 0x400
-#define TYPEFLAG_HASBITFIELD 0x800
-
-#define DICTFLAG_FINAL 0x1000
-
-struct tagPyCArgObject {
- PyObject_HEAD
- ffi_type *pffi_type;
- char tag;
- union {
- char c;
- char b;
- short h;
- int i;
- long l;
- long long q;
- long double D;
- double d;
- float f;
- void *p;
- } value;
- PyObject *obj;
- Py_ssize_t size; /* for the 'V' tag */
-};
-
-#define PyCArg_CheckExact(st, v) Py_IS_TYPE(v, st->PyCArg_Type)
-extern PyCArgObject *PyCArgObject_new(void);
-
-extern PyObject *
-PyCData_get(PyObject *type, GETFUNC getfunc, PyObject *src,
- Py_ssize_t index, Py_ssize_t size, char *ptr);
-
-extern int
-PyCData_set(PyObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value,
- Py_ssize_t index, Py_ssize_t size, char *ptr);
-
-extern void _ctypes_extend_error(PyObject *exc_class, const char *fmt, ...);
-
-struct basespec {
- CDataObject *base;
- Py_ssize_t index;
- char *adr;
-};
-
-extern char basespec_string[];
-
-extern ffi_type *_ctypes_get_ffi_type(PyObject *obj);
-
-/* exception classes */
-extern PyObject *PyExc_ArgError;
-
-extern char *_ctypes_conversion_encoding;
-extern char *_ctypes_conversion_errors;
-
-
-extern void _ctypes_free_closure(void *);
-extern void *_ctypes_alloc_closure(void);
-
-extern PyObject *PyCData_FromBaseObj(PyObject *type, PyObject *base, Py_ssize_t index, char *adr);
-extern char *_ctypes_alloc_format_string(const char *prefix, const char *suffix);
-extern char *_ctypes_alloc_format_string_with_shape(int ndim,
- const Py_ssize_t *shape,
- const char *prefix, const char *suffix);
-
-extern int _ctypes_simple_instance(PyObject *obj);
-
-extern PyObject *_ctypes_ptrtype_cache;
-PyObject *_ctypes_get_errobj(int **pspace);
-
-#ifdef USING_MALLOC_CLOSURE_DOT_C
-void Py_ffi_closure_free(void *p);
-void *Py_ffi_closure_alloc(size_t size, void** codeloc);
-#else
-#define Py_ffi_closure_free ffi_closure_free
-#define Py_ffi_closure_alloc ffi_closure_alloc
-#endif
-
-/*
- Local Variables:
- compile-command: "python setup.py -q build install --home ~"
- End:
-*/
diff --git a/contrib/tools/python3/src/Modules/_ctypes/stgdict.c b/contrib/tools/python3/src/Modules/_ctypes/stgdict.c
deleted file mode 100644
index 57f4b0040c7..00000000000
--- a/contrib/tools/python3/src/Modules/_ctypes/stgdict.c
+++ /dev/null
@@ -1,964 +0,0 @@
-#ifndef Py_BUILD_CORE_BUILTIN
-# define Py_BUILD_CORE_MODULE 1
-#endif
-
-#include "Python.h"
-// windows.h must be included before pycore internal headers
-#ifdef MS_WIN32
-# include <windows.h>
-# include <Unknwn.h>
-#endif
-
-#include "pycore_call.h" // _PyObject_CallNoArgs()
-#include <ffi.h>
-#ifdef MS_WIN32
-# include <malloc.h>
-#endif
-#include "ctypes.h"
-
-/******************************************************************/
-/*
- StdDict - a dictionary subclass, containing additional C accessible fields
-
- XXX blabla more
-*/
-
-/* Seems we need this, otherwise we get problems when calling
- * PyDict_SetItem() (ma_lookup is NULL)
- */
-static int
-PyCStgDict_init(StgDictObject *self, PyObject *args, PyObject *kwds)
-{
- if (PyDict_Type.tp_init((PyObject *)self, args, kwds) < 0)
- return -1;
- self->format = NULL;
- self->ndim = 0;
- self->shape = NULL;
- return 0;
-}
-
-static int
-PyCStgDict_clear(StgDictObject *self)
-{
- Py_CLEAR(self->proto);
- Py_CLEAR(self->argtypes);
- Py_CLEAR(self->converters);
- Py_CLEAR(self->restype);
- Py_CLEAR(self->checker);
- return 0;
-}
-
-static void
-PyCStgDict_dealloc(StgDictObject *self)
-{
- PyCStgDict_clear(self);
- PyMem_Free(self->format);
- PyMem_Free(self->shape);
- PyMem_Free(self->ffi_type_pointer.elements);
- PyDict_Type.tp_dealloc((PyObject *)self);
-}
-
-static PyObject *
-PyCStgDict_sizeof(StgDictObject *self, void *unused)
-{
- Py_ssize_t res;
-
- res = _PyDict_SizeOf((PyDictObject *)self);
- res += sizeof(StgDictObject) - sizeof(PyDictObject);
- if (self->format)
- res += strlen(self->format) + 1;
- res += self->ndim * sizeof(Py_ssize_t);
- if (self->ffi_type_pointer.elements)
- res += (self->length + 1) * sizeof(ffi_type *);
- return PyLong_FromSsize_t(res);
-}
-
-int
-PyCStgDict_clone(StgDictObject *dst, StgDictObject *src)
-{
- char *d, *s;
- Py_ssize_t size;
-
- PyCStgDict_clear(dst);
- PyMem_Free(dst->ffi_type_pointer.elements);
- PyMem_Free(dst->format);
- dst->format = NULL;
- PyMem_Free(dst->shape);
- dst->shape = NULL;
- dst->ffi_type_pointer.elements = NULL;
-
- d = (char *)dst;
- s = (char *)src;
- memcpy(d + sizeof(PyDictObject),
- s + sizeof(PyDictObject),
- sizeof(StgDictObject) - sizeof(PyDictObject));
-
- Py_XINCREF(dst->proto);
- Py_XINCREF(dst->argtypes);
- Py_XINCREF(dst->converters);
- Py_XINCREF(dst->restype);
- Py_XINCREF(dst->checker);
-
- if (src->format) {
- dst->format = PyMem_Malloc(strlen(src->format) + 1);
- if (dst->format == NULL) {
- PyErr_NoMemory();
- return -1;
- }
- strcpy(dst->format, src->format);
- }
- if (src->shape) {
- dst->shape = PyMem_Malloc(sizeof(Py_ssize_t) * src->ndim);
- if (dst->shape == NULL) {
- PyErr_NoMemory();
- return -1;
- }
- memcpy(dst->shape, src->shape,
- sizeof(Py_ssize_t) * src->ndim);
- }
-
- if (src->ffi_type_pointer.elements == NULL)
- return 0;
- size = sizeof(ffi_type *) * (src->length + 1);
- dst->ffi_type_pointer.elements = PyMem_Malloc(size);
- if (dst->ffi_type_pointer.elements == NULL) {
- PyErr_NoMemory();
- return -1;
- }
- memcpy(dst->ffi_type_pointer.elements,
- src->ffi_type_pointer.elements,
- size);
- return 0;
-}
-
-static struct PyMethodDef PyCStgDict_methods[] = {
- {"__sizeof__", (PyCFunction)PyCStgDict_sizeof, METH_NOARGS},
- {NULL, NULL} /* sentinel */
-};
-
-PyTypeObject PyCStgDict_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "StgDict",
- sizeof(StgDictObject),
- 0,
- (destructor)PyCStgDict_dealloc, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- 0, /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- PyCStgDict_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)PyCStgDict_init, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
- 0, /* tp_free */
-};
-
-/* May return NULL, but does not set an exception! */
-StgDictObject *
-PyType_stgdict(PyObject *obj)
-{
- PyTypeObject *type;
-
- if (!PyType_Check(obj))
- return NULL;
- type = (PyTypeObject *)obj;
- if (!type->tp_dict || !PyCStgDict_CheckExact(type->tp_dict))
- return NULL;
- return (StgDictObject *)type->tp_dict;
-}
-
-/* May return NULL, but does not set an exception! */
-/*
- This function should be as fast as possible, so we don't call PyType_stgdict
- above but inline the code, and avoid the PyType_Check().
-*/
-StgDictObject *
-PyObject_stgdict(PyObject *self)
-{
- PyTypeObject *type = Py_TYPE(self);
- if (!type->tp_dict || !PyCStgDict_CheckExact(type->tp_dict))
- return NULL;
- return (StgDictObject *)type->tp_dict;
-}
-
-/* descr is the descriptor for a field marked as anonymous. Get all the
- _fields_ descriptors from descr->proto, create new descriptors with offset
- and index adjusted, and stuff them into type.
- */
-static int
-MakeFields(PyObject *type, CFieldObject *descr,
- Py_ssize_t index, Py_ssize_t offset)
-{
- Py_ssize_t i;
- PyObject *fields;
- PyObject *fieldlist;
-
- fields = PyObject_GetAttrString(descr->proto, "_fields_");
- if (fields == NULL)
- return -1;
- fieldlist = PySequence_Fast(fields, "_fields_ must be a sequence");
- Py_DECREF(fields);
- if (fieldlist == NULL)
- return -1;
-
- ctypes_state *st = GLOBAL_STATE();
- PyTypeObject *cfield_tp = st->PyCField_Type;
- for (i = 0; i < PySequence_Fast_GET_SIZE(fieldlist); ++i) {
- PyObject *pair = PySequence_Fast_GET_ITEM(fieldlist, i); /* borrowed */
- PyObject *fname, *ftype, *bits;
- CFieldObject *fdescr;
- CFieldObject *new_descr;
- /* Convert to PyArg_UnpackTuple... */
- if (!PyArg_ParseTuple(pair, "OO|O", &fname, &ftype, &bits)) {
- Py_DECREF(fieldlist);
- return -1;
- }
- fdescr = (CFieldObject *)PyObject_GetAttr(descr->proto, fname);
- if (fdescr == NULL) {
- Py_DECREF(fieldlist);
- return -1;
- }
- if (!Py_IS_TYPE(fdescr, cfield_tp)) {
- PyErr_SetString(PyExc_TypeError, "unexpected type");
- Py_DECREF(fdescr);
- Py_DECREF(fieldlist);
- return -1;
- }
- if (fdescr->anonymous) {
- int rc = MakeFields(type, fdescr,
- index + fdescr->index,
- offset + fdescr->offset);
- Py_DECREF(fdescr);
- if (rc == -1) {
- Py_DECREF(fieldlist);
- return -1;
- }
- continue;
- }
- new_descr = (CFieldObject *)cfield_tp->tp_alloc(cfield_tp, 0);
- if (new_descr == NULL) {
- Py_DECREF(fdescr);
- Py_DECREF(fieldlist);
- return -1;
- }
- assert(Py_IS_TYPE(new_descr, cfield_tp));
- new_descr->size = fdescr->size;
- new_descr->offset = fdescr->offset + offset;
- new_descr->index = fdescr->index + index;
- new_descr->proto = Py_XNewRef(fdescr->proto);
- new_descr->getfunc = fdescr->getfunc;
- new_descr->setfunc = fdescr->setfunc;
-
- Py_DECREF(fdescr);
-
- if (-1 == PyObject_SetAttr(type, fname, (PyObject *)new_descr)) {
- Py_DECREF(fieldlist);
- Py_DECREF(new_descr);
- return -1;
- }
- Py_DECREF(new_descr);
- }
- Py_DECREF(fieldlist);
- return 0;
-}
-
-/* Iterate over the names in the type's _anonymous_ attribute, if present,
- */
-static int
-MakeAnonFields(PyObject *type)
-{
- PyObject *anon;
- PyObject *anon_names;
- Py_ssize_t i;
-
- if (_PyObject_LookupAttr(type, &_Py_ID(_anonymous_), &anon) < 0) {
- return -1;
- }
- if (anon == NULL) {
- return 0;
- }
- anon_names = PySequence_Fast(anon, "_anonymous_ must be a sequence");
- Py_DECREF(anon);
- if (anon_names == NULL)
- return -1;
-
- ctypes_state *st = GLOBAL_STATE();
- PyTypeObject *cfield_tp = st->PyCField_Type;
- for (i = 0; i < PySequence_Fast_GET_SIZE(anon_names); ++i) {
- PyObject *fname = PySequence_Fast_GET_ITEM(anon_names, i); /* borrowed */
- CFieldObject *descr = (CFieldObject *)PyObject_GetAttr(type, fname);
- if (descr == NULL) {
- Py_DECREF(anon_names);
- return -1;
- }
- if (!Py_IS_TYPE(descr, cfield_tp)) {
- PyErr_Format(PyExc_AttributeError,
- "'%U' is specified in _anonymous_ but not in "
- "_fields_",
- fname);
- Py_DECREF(anon_names);
- Py_DECREF(descr);
- return -1;
- }
- descr->anonymous = 1;
-
- /* descr is in the field descriptor. */
- if (-1 == MakeFields(type, (CFieldObject *)descr,
- ((CFieldObject *)descr)->index,
- ((CFieldObject *)descr)->offset)) {
- Py_DECREF(descr);
- Py_DECREF(anon_names);
- return -1;
- }
- Py_DECREF(descr);
- }
-
- Py_DECREF(anon_names);
- return 0;
-}
-
-/*
- Allocate a memory block for a pep3118 format string, copy prefix (if
- non-null) into it and append `{padding}x` to the end.
- Returns NULL on failure, with the error indicator set.
-*/
-char *
-_ctypes_alloc_format_padding(const char *prefix, Py_ssize_t padding)
-{
- /* int64 decimal characters + x + null */
- char buf[19 + 1 + 1];
-
- assert(padding > 0);
-
- if (padding == 1) {
- /* Use x instead of 1x, for brevity */
- return _ctypes_alloc_format_string(prefix, "x");
- }
-
- int ret = PyOS_snprintf(buf, sizeof(buf), "%zdx", padding); (void)ret;
- assert(0 <= ret && ret < (Py_ssize_t)sizeof(buf));
- return _ctypes_alloc_format_string(prefix, buf);
-}
-
-/*
- Retrieve the (optional) _pack_ attribute from a type, the _fields_ attribute,
- and create an StgDictObject. Used for Structure and Union subclasses.
-*/
-int
-PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct)
-{
- StgDictObject *stgdict, *basedict;
- Py_ssize_t len, offset, size, align, i;
- Py_ssize_t union_size, total_align, aligned_size;
- Py_ssize_t field_size = 0;
- int bitofs;
- PyObject *tmp;
- int pack;
- Py_ssize_t ffi_ofs;
- int big_endian;
- int arrays_seen = 0;
-
- if (fields == NULL)
- return 0;
-
- if (_PyObject_LookupAttr(type, &_Py_ID(_swappedbytes_), &tmp) < 0) {
- return -1;
- }
- if (tmp) {
- Py_DECREF(tmp);
- big_endian = !PY_BIG_ENDIAN;
- }
- else {
- big_endian = PY_BIG_ENDIAN;
- }
-
- if (_PyObject_LookupAttr(type, &_Py_ID(_pack_), &tmp) < 0) {
- return -1;
- }
- if (tmp) {
- pack = _PyLong_AsInt(tmp);
- Py_DECREF(tmp);
- if (pack < 0) {
- if (!PyErr_Occurred() ||
- PyErr_ExceptionMatches(PyExc_TypeError) ||
- PyErr_ExceptionMatches(PyExc_OverflowError))
- {
- PyErr_SetString(PyExc_ValueError,
- "_pack_ must be a non-negative integer");
- }
- return -1;
- }
- }
- else {
- /* Setting `_pack_ = 0` amounts to using the default alignment */
- pack = 0;
- }
-
- len = PySequence_Size(fields);
- if (len == -1) {
- if (PyErr_ExceptionMatches(PyExc_TypeError)) {
- PyErr_SetString(PyExc_TypeError,
- "'_fields_' must be a sequence of pairs");
- }
- return -1;
- }
-
- stgdict = PyType_stgdict(type);
- if (!stgdict) {
- PyErr_SetString(PyExc_TypeError,
- "ctypes state is not initialized");
- return -1;
- }
- /* If this structure/union is already marked final we cannot assign
- _fields_ anymore. */
-
- if (stgdict->flags & DICTFLAG_FINAL) {/* is final ? */
- PyErr_SetString(PyExc_AttributeError,
- "_fields_ is final");
- return -1;
- }
-
- if (stgdict->format) {
- PyMem_Free(stgdict->format);
- stgdict->format = NULL;
- }
-
- if (stgdict->ffi_type_pointer.elements)
- PyMem_Free(stgdict->ffi_type_pointer.elements);
-
- basedict = PyType_stgdict((PyObject *)((PyTypeObject *)type)->tp_base);
- if (basedict) {
- stgdict->flags |= (basedict->flags &
- (TYPEFLAG_HASUNION | TYPEFLAG_HASBITFIELD));
- }
- if (!isStruct) {
- stgdict->flags |= TYPEFLAG_HASUNION;
- }
- if (basedict) {
- size = offset = basedict->size;
- align = basedict->align;
- union_size = 0;
- total_align = align ? align : 1;
- stgdict->ffi_type_pointer.type = FFI_TYPE_STRUCT;
- stgdict->ffi_type_pointer.elements = PyMem_New(ffi_type *, basedict->length + len + 1);
- if (stgdict->ffi_type_pointer.elements == NULL) {
- PyErr_NoMemory();
- return -1;
- }
- memset(stgdict->ffi_type_pointer.elements, 0,
- sizeof(ffi_type *) * (basedict->length + len + 1));
- if (basedict->length > 0) {
- memcpy(stgdict->ffi_type_pointer.elements,
- basedict->ffi_type_pointer.elements,
- sizeof(ffi_type *) * (basedict->length));
- }
- ffi_ofs = basedict->length;
- } else {
- offset = 0;
- size = 0;
- align = 0;
- union_size = 0;
- total_align = 1;
- stgdict->ffi_type_pointer.type = FFI_TYPE_STRUCT;
- stgdict->ffi_type_pointer.elements = PyMem_New(ffi_type *, len + 1);
- if (stgdict->ffi_type_pointer.elements == NULL) {
- PyErr_NoMemory();
- return -1;
- }
- memset(stgdict->ffi_type_pointer.elements, 0,
- sizeof(ffi_type *) * (len + 1));
- ffi_ofs = 0;
- }
-
- assert(stgdict->format == NULL);
- if (isStruct) {
- stgdict->format = _ctypes_alloc_format_string(NULL, "T{");
- } else {
- /* PEP3118 doesn't support union. Use 'B' for bytes. */
- stgdict->format = _ctypes_alloc_format_string(NULL, "B");
- }
- if (stgdict->format == NULL)
- return -1;
-
- for (i = 0; i < len; ++i) {
- PyObject *name = NULL, *desc = NULL;
- PyObject *pair = PySequence_GetItem(fields, i);
- PyObject *prop;
- StgDictObject *dict;
- int bitsize = 0;
-
- if (!pair || !PyArg_ParseTuple(pair, "UO|i", &name, &desc, &bitsize)) {
- PyErr_SetString(PyExc_TypeError,
- "'_fields_' must be a sequence of (name, C type) pairs");
- Py_XDECREF(pair);
- return -1;
- }
- if (PyCArrayTypeObject_Check(desc))
- arrays_seen = 1;
- dict = PyType_stgdict(desc);
- if (dict == NULL) {
- Py_DECREF(pair);
- PyErr_Format(PyExc_TypeError,
- "second item in _fields_ tuple (index %zd) must be a C type",
- i);
- return -1;
- }
- stgdict->ffi_type_pointer.elements[ffi_ofs + i] = &dict->ffi_type_pointer;
- if (dict->flags & (TYPEFLAG_ISPOINTER | TYPEFLAG_HASPOINTER))
- stgdict->flags |= TYPEFLAG_HASPOINTER;
- stgdict->flags |= dict->flags & (TYPEFLAG_HASUNION | TYPEFLAG_HASBITFIELD);
- dict->flags |= DICTFLAG_FINAL; /* mark field type final */
- if (PyTuple_Size(pair) == 3) { /* bits specified */
- stgdict->flags |= TYPEFLAG_HASBITFIELD;
- switch(dict->ffi_type_pointer.type) {
- case FFI_TYPE_UINT8:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- break;
-
- case FFI_TYPE_SINT8:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_SINT32:
- if (dict->getfunc != _ctypes_get_fielddesc("c")->getfunc
- && dict->getfunc != _ctypes_get_fielddesc("u")->getfunc
- )
- break;
- /* else fall through */
- default:
- PyErr_Format(PyExc_TypeError,
- "bit fields not allowed for type %s",
- ((PyTypeObject *)desc)->tp_name);
- Py_DECREF(pair);
- return -1;
- }
- if (bitsize <= 0 || bitsize > dict->size * 8) {
- PyErr_SetString(PyExc_ValueError,
- "number of bits invalid for bit field");
- Py_DECREF(pair);
- return -1;
- }
- } else
- bitsize = 0;
-
- if (isStruct) {
- const char *fieldfmt = dict->format ? dict->format : "B";
- const char *fieldname = PyUnicode_AsUTF8(name);
- char *ptr;
- Py_ssize_t len;
- char *buf;
- Py_ssize_t last_size = size;
- Py_ssize_t padding;
-
- if (fieldname == NULL)
- {
- Py_DECREF(pair);
- return -1;
- }
-
- /* construct the field now, as `prop->offset` is `offset` with
- corrected alignment */
- prop = PyCField_FromDesc(desc, i,
- &field_size, bitsize, &bitofs,
- &size, &offset, &align,
- pack, big_endian);
- if (prop == NULL) {
- Py_DECREF(pair);
- return -1;
- }
-
- /* number of bytes between the end of the last field and the start
- of this one */
- padding = ((CFieldObject *)prop)->offset - last_size;
-
- if (padding > 0) {
- ptr = stgdict->format;
- stgdict->format = _ctypes_alloc_format_padding(ptr, padding);
- PyMem_Free(ptr);
- if (stgdict->format == NULL) {
- Py_DECREF(pair);
- Py_DECREF(prop);
- return -1;
- }
- }
-
- len = strlen(fieldname) + strlen(fieldfmt);
-
- buf = PyMem_Malloc(len + 2 + 1);
- if (buf == NULL) {
- Py_DECREF(pair);
- Py_DECREF(prop);
- PyErr_NoMemory();
- return -1;
- }
- sprintf(buf, "%s:%s:", fieldfmt, fieldname);
-
- ptr = stgdict->format;
- if (dict->shape != NULL) {
- stgdict->format = _ctypes_alloc_format_string_with_shape(
- dict->ndim, dict->shape, stgdict->format, buf);
- } else {
- stgdict->format = _ctypes_alloc_format_string(stgdict->format, buf);
- }
- PyMem_Free(ptr);
- PyMem_Free(buf);
-
- if (stgdict->format == NULL) {
- Py_DECREF(pair);
- Py_DECREF(prop);
- return -1;
- }
- } else /* union */ {
- size = 0;
- offset = 0;
- align = 0;
- prop = PyCField_FromDesc(desc, i,
- &field_size, bitsize, &bitofs,
- &size, &offset, &align,
- pack, big_endian);
- if (prop == NULL) {
- Py_DECREF(pair);
- return -1;
- }
- union_size = max(size, union_size);
- }
- total_align = max(align, total_align);
-
- if (-1 == PyObject_SetAttr(type, name, prop)) {
- Py_DECREF(prop);
- Py_DECREF(pair);
- return -1;
- }
- Py_DECREF(pair);
- Py_DECREF(prop);
- }
-
- if (!isStruct) {
- size = union_size;
- }
-
- /* Adjust the size according to the alignment requirements */
- aligned_size = ((size + total_align - 1) / total_align) * total_align;
-
- if (isStruct) {
- char *ptr;
- Py_ssize_t padding;
-
- /* Pad up to the full size of the struct */
- padding = aligned_size - size;
- if (padding > 0) {
- ptr = stgdict->format;
- stgdict->format = _ctypes_alloc_format_padding(ptr, padding);
- PyMem_Free(ptr);
- if (stgdict->format == NULL) {
- return -1;
- }
- }
-
- ptr = stgdict->format;
- stgdict->format = _ctypes_alloc_format_string(stgdict->format, "}");
- PyMem_Free(ptr);
- if (stgdict->format == NULL)
- return -1;
- }
-
- stgdict->ffi_type_pointer.alignment = Py_SAFE_DOWNCAST(total_align,
- Py_ssize_t,
- unsigned short);
- stgdict->ffi_type_pointer.size = aligned_size;
-
- stgdict->size = aligned_size;
- stgdict->align = total_align;
- stgdict->length = ffi_ofs + len;
-
-/*
- * The value of MAX_STRUCT_SIZE depends on the platform Python is running on.
- */
-#if defined(__aarch64__) || defined(__arm__) || defined(_M_ARM64)
-# define MAX_STRUCT_SIZE 32
-#elif defined(__powerpc64__)
-# define MAX_STRUCT_SIZE 64
-#else
-# define MAX_STRUCT_SIZE 16
-#endif
-
- if (arrays_seen && (size <= MAX_STRUCT_SIZE)) {
- /*
- * See bpo-22273 and gh-110190. Arrays are normally treated as
- * pointers, which is fine when an array name is being passed as
- * parameter, but not when passing structures by value that contain
- * arrays.
- * Small structures passed by value are passed in registers, and in
- * order to do this, libffi needs to know the true type of the array
- * members of structs. Treating them as pointers breaks things.
- *
- * Small structures have different sizes depending on the platform
- * where Python is running on:
- *
- * * x86-64: 16 bytes or less
- * * Arm platforms (both 32 and 64 bit): 32 bytes or less
- * * PowerPC 64 Little Endian: 64 bytes or less
- *
- * In that case, there can't be more than 16, 32 or 64 elements after
- * unrolling arrays, as we (will) disallow bitfields.
- * So we can collect the true ffi_type values in a fixed-size local
- * array on the stack and, if any arrays were seen, replace the
- * ffi_type_pointer.elements with a more accurate set, to allow
- * libffi to marshal them into registers correctly.
- * It means one more loop over the fields, but if we got here,
- * the structure is small, so there aren't too many of those.
- *
- * Although the passing in registers is specific to the above
- * platforms, the array-in-struct vs. pointer problem is general.
- * But we restrict the type transformation to small structs
- * nonetheless.
- *
- * Note that although a union may be small in terms of memory usage, it
- * could contain many overlapping declarations of arrays, e.g.
- *
- * union {
- * unsigned int_8 foo [16];
- * unsigned uint_8 bar [16];
- * unsigned int_16 baz[8];
- * unsigned uint_16 bozz[8];
- * unsigned int_32 fizz[4];
- * unsigned uint_32 buzz[4];
- * }
- *
- * which is still only 16 bytes in size. We need to convert this into
- * the following equivalent for libffi:
- *
- * union {
- * struct { int_8 e1; int_8 e2; ... int_8 e_16; } f1;
- * struct { uint_8 e1; uint_8 e2; ... uint_8 e_16; } f2;
- * struct { int_16 e1; int_16 e2; ... int_16 e_8; } f3;
- * struct { uint_16 e1; uint_16 e2; ... uint_16 e_8; } f4;
- * struct { int_32 e1; int_32 e2; ... int_32 e_4; } f5;
- * struct { uint_32 e1; uint_32 e2; ... uint_32 e_4; } f6;
- * }
- *
- * The same principle applies for a struct 32 or 64 bytes in size.
- *
- * So the struct/union needs setting up as follows: all non-array
- * elements copied across as is, and all array elements replaced with
- * an equivalent struct which has as many fields as the array has
- * elements, plus one NULL pointer.
- */
-
- Py_ssize_t num_ffi_type_pointers = 0; /* for the dummy fields */
- Py_ssize_t num_ffi_types = 0; /* for the dummy structures */
- size_t alloc_size; /* total bytes to allocate */
- void *type_block; /* to hold all the type information needed */
- ffi_type **element_types; /* of this struct/union */
- ffi_type **dummy_types; /* of the dummy struct elements */
- ffi_type *structs; /* point to struct aliases of arrays */
- Py_ssize_t element_index; /* index into element_types for this */
- Py_ssize_t dummy_index = 0; /* index into dummy field pointers */
- Py_ssize_t struct_index = 0; /* index into dummy structs */
-
- /* first pass to see how much memory to allocate */
- for (i = 0; i < len; ++i) {
- PyObject *name, *desc;
- PyObject *pair = PySequence_GetItem(fields, i);
- StgDictObject *dict;
- int bitsize = 0;
-
- if (pair == NULL) {
- return -1;
- }
- if (!PyArg_ParseTuple(pair, "UO|i", &name, &desc, &bitsize)) {
- PyErr_SetString(PyExc_TypeError,
- "'_fields_' must be a sequence of (name, C type) pairs");
- Py_DECREF(pair);
- return -1;
- }
- dict = PyType_stgdict(desc);
- if (dict == NULL) {
- Py_DECREF(pair);
- PyErr_Format(PyExc_TypeError,
- "second item in _fields_ tuple (index %zd) must be a C type",
- i);
- return -1;
- }
- if (!PyCArrayTypeObject_Check(desc)) {
- /* Not an array. Just need an ffi_type pointer. */
- num_ffi_type_pointers++;
- }
- else {
- /* It's an array. */
- Py_ssize_t length = dict->length;
- StgDictObject *edict;
-
- edict = PyType_stgdict(dict->proto);
- if (edict == NULL) {
- Py_DECREF(pair);
- PyErr_Format(PyExc_TypeError,
- "second item in _fields_ tuple (index %zd) must be a C type",
- i);
- return -1;
- }
- /*
- * We need one extra ffi_type to hold the struct, and one
- * ffi_type pointer per array element + one for a NULL to
- * mark the end.
- */
- num_ffi_types++;
- num_ffi_type_pointers += length + 1;
- }
- Py_DECREF(pair);
- }
-
- /*
- * At this point, we know we need storage for some ffi_types and some
- * ffi_type pointers. We'll allocate these in one block.
- * There are three sub-blocks of information: the ffi_type pointers to
- * this structure/union's elements, the ffi_type_pointers to the
- * dummy fields standing in for array elements, and the
- * ffi_types representing the dummy structures.
- */
- alloc_size = (ffi_ofs + 1 + len + num_ffi_type_pointers) * sizeof(ffi_type *) +
- num_ffi_types * sizeof(ffi_type);
- type_block = PyMem_Malloc(alloc_size);
-
- if (type_block == NULL) {
- PyErr_NoMemory();
- return -1;
- }
- /*
- * the first block takes up ffi_ofs + len + 1 which is the pointers *
- * for this struct/union. The second block takes up
- * num_ffi_type_pointers, so the sum of these is ffi_ofs + len + 1 +
- * num_ffi_type_pointers as allocated above. The last bit is the
- * num_ffi_types structs.
- */
- element_types = (ffi_type **) type_block;
- dummy_types = &element_types[ffi_ofs + len + 1];
- structs = (ffi_type *) &dummy_types[num_ffi_type_pointers];
-
- if (num_ffi_types > 0) {
- memset(structs, 0, num_ffi_types * sizeof(ffi_type));
- }
- if (ffi_ofs && (basedict != NULL)) {
- memcpy(element_types,
- basedict->ffi_type_pointer.elements,
- ffi_ofs * sizeof(ffi_type *));
- }
- element_index = ffi_ofs;
-
- /* second pass to actually set the type pointers */
- for (i = 0; i < len; ++i) {
- PyObject *name, *desc;
- PyObject *pair = PySequence_GetItem(fields, i);
- StgDictObject *dict;
- int bitsize = 0;
-
- if (pair == NULL) {
- PyMem_Free(type_block);
- return -1;
- }
- /* In theory, we made this call in the first pass, so it *shouldn't*
- * fail. However, you never know, and the code above might change
- * later - keeping the check in here is a tad defensive but it
- * will affect program size only slightly and performance hardly at
- * all.
- */
- if (!PyArg_ParseTuple(pair, "UO|i", &name, &desc, &bitsize)) {
- PyErr_SetString(PyExc_TypeError,
- "'_fields_' must be a sequence of (name, C type) pairs");
- Py_DECREF(pair);
- PyMem_Free(type_block);
- return -1;
- }
- dict = PyType_stgdict(desc);
- /* Possibly this check could be avoided, but see above comment. */
- if (dict == NULL) {
- Py_DECREF(pair);
- PyMem_Free(type_block);
- PyErr_Format(PyExc_TypeError,
- "second item in _fields_ tuple (index %zd) must be a C type",
- i);
- return -1;
- }
- assert(element_index < (ffi_ofs + len)); /* will be used below */
- if (!PyCArrayTypeObject_Check(desc)) {
- /* Not an array. Just copy over the element ffi_type. */
- element_types[element_index++] = &dict->ffi_type_pointer;
- }
- else {
- Py_ssize_t length = dict->length;
- StgDictObject *edict;
-
- edict = PyType_stgdict(dict->proto);
- if (edict == NULL) {
- Py_DECREF(pair);
- PyMem_Free(type_block);
- PyErr_Format(PyExc_TypeError,
- "second item in _fields_ tuple (index %zd) must be a C type",
- i);
- return -1;
- }
- element_types[element_index++] = &structs[struct_index];
- structs[struct_index].size = length * edict->ffi_type_pointer.size;
- structs[struct_index].alignment = edict->ffi_type_pointer.alignment;
- structs[struct_index].type = FFI_TYPE_STRUCT;
- structs[struct_index].elements = &dummy_types[dummy_index];
- ++struct_index;
- /* Copy over the element's type, length times. */
- while (length > 0) {
- assert(dummy_index < (num_ffi_type_pointers));
- dummy_types[dummy_index++] = &edict->ffi_type_pointer;
- length--;
- }
- assert(dummy_index < (num_ffi_type_pointers));
- dummy_types[dummy_index++] = NULL;
- }
- Py_DECREF(pair);
- }
-
- element_types[element_index] = NULL;
- /*
- * Replace the old elements with the new, taking into account
- * base class elements where necessary.
- */
- assert(stgdict->ffi_type_pointer.elements);
- PyMem_Free(stgdict->ffi_type_pointer.elements);
- stgdict->ffi_type_pointer.elements = element_types;
- }
-
- /* We did check that this flag was NOT set above, it must not
- have been set until now. */
- if (stgdict->flags & DICTFLAG_FINAL) {
- PyErr_SetString(PyExc_AttributeError,
- "Structure or union cannot contain itself");
- return -1;
- }
- stgdict->flags |= DICTFLAG_FINAL;
-
- return MakeAnonFields(type);
-}
diff --git a/contrib/tools/python3/src/Modules/_hacl/include/krml/lowstar_endianness.h b/contrib/tools/python3/src/Modules/_hacl/include/krml/lowstar_endianness.h
deleted file mode 100644
index 1aa2ccd644c..00000000000
--- a/contrib/tools/python3/src/Modules/_hacl/include/krml/lowstar_endianness.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/* Copyright (c) INRIA and Microsoft Corporation. All rights reserved.
- Licensed under the Apache 2.0 License. */
-
-#ifndef __LOWSTAR_ENDIANNESS_H
-#define __LOWSTAR_ENDIANNESS_H
-
-#include <string.h>
-#include <inttypes.h>
-
-/******************************************************************************/
-/* Implementing C.fst (part 2: endian-ness macros) */
-/******************************************************************************/
-
-/* ... for Linux */
-#if defined(__linux__) || defined(__CYGWIN__) || defined (__USE_SYSTEM_ENDIAN_H__) || defined(__GLIBC__)
-# include <endian.h>
-
-/* ... for OSX */
-#elif defined(__APPLE__)
-# include <libkern/OSByteOrder.h>
-# define htole64(x) OSSwapHostToLittleInt64(x)
-# define le64toh(x) OSSwapLittleToHostInt64(x)
-# define htobe64(x) OSSwapHostToBigInt64(x)
-# define be64toh(x) OSSwapBigToHostInt64(x)
-
-# define htole16(x) OSSwapHostToLittleInt16(x)
-# define le16toh(x) OSSwapLittleToHostInt16(x)
-# define htobe16(x) OSSwapHostToBigInt16(x)
-# define be16toh(x) OSSwapBigToHostInt16(x)
-
-# define htole32(x) OSSwapHostToLittleInt32(x)
-# define le32toh(x) OSSwapLittleToHostInt32(x)
-# define htobe32(x) OSSwapHostToBigInt32(x)
-# define be32toh(x) OSSwapBigToHostInt32(x)
-
-/* ... for Solaris */
-#elif defined(__sun__)
-# include <sys/byteorder.h>
-# define htole64(x) LE_64(x)
-# define le64toh(x) LE_64(x)
-# define htobe64(x) BE_64(x)
-# define be64toh(x) BE_64(x)
-
-# define htole16(x) LE_16(x)
-# define le16toh(x) LE_16(x)
-# define htobe16(x) BE_16(x)
-# define be16toh(x) BE_16(x)
-
-# define htole32(x) LE_32(x)
-# define le32toh(x) LE_32(x)
-# define htobe32(x) BE_32(x)
-# define be32toh(x) BE_32(x)
-
-/* ... for the BSDs */
-#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
-# include <sys/endian.h>
-#elif defined(__OpenBSD__)
-# include <endian.h>
-
-/* ... for Windows (MSVC)... not targeting XBOX 360! */
-#elif defined(_MSC_VER)
-
-# include <stdlib.h>
-# define htobe16(x) _byteswap_ushort(x)
-# define htole16(x) (x)
-# define be16toh(x) _byteswap_ushort(x)
-# define le16toh(x) (x)
-
-# define htobe32(x) _byteswap_ulong(x)
-# define htole32(x) (x)
-# define be32toh(x) _byteswap_ulong(x)
-# define le32toh(x) (x)
-
-# define htobe64(x) _byteswap_uint64(x)
-# define htole64(x) (x)
-# define be64toh(x) _byteswap_uint64(x)
-# define le64toh(x) (x)
-
-/* ... for Windows (GCC-like, e.g. mingw or clang) */
-#elif (defined(_WIN32) || defined(_WIN64) || defined(__EMSCRIPTEN__)) && \
- (defined(__GNUC__) || defined(__clang__))
-
-# define htobe16(x) __builtin_bswap16(x)
-# define htole16(x) (x)
-# define be16toh(x) __builtin_bswap16(x)
-# define le16toh(x) (x)
-
-# define htobe32(x) __builtin_bswap32(x)
-# define htole32(x) (x)
-# define be32toh(x) __builtin_bswap32(x)
-# define le32toh(x) (x)
-
-# define htobe64(x) __builtin_bswap64(x)
-# define htole64(x) (x)
-# define be64toh(x) __builtin_bswap64(x)
-# define le64toh(x) (x)
-
-/* ... generic big-endian fallback code */
-/* ... AIX doesn't have __BYTE_ORDER__ (with XLC compiler) & is always big-endian */
-#elif (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) || defined(_AIX)
-
-/* byte swapping code inspired by:
- * https://github.com/rweather/arduinolibs/blob/master/libraries/Crypto/utility/EndianUtil.h
- * */
-
-# define htobe32(x) (x)
-# define be32toh(x) (x)
-# define htole32(x) \
- (__extension__({ \
- uint32_t _temp = (x); \
- ((_temp >> 24) & 0x000000FF) | ((_temp >> 8) & 0x0000FF00) | \
- ((_temp << 8) & 0x00FF0000) | ((_temp << 24) & 0xFF000000); \
- }))
-# define le32toh(x) (htole32((x)))
-
-# define htobe64(x) (x)
-# define be64toh(x) (x)
-# define htole64(x) \
- (__extension__({ \
- uint64_t __temp = (x); \
- uint32_t __low = htobe32((uint32_t)__temp); \
- uint32_t __high = htobe32((uint32_t)(__temp >> 32)); \
- (((uint64_t)__low) << 32) | __high; \
- }))
-# define le64toh(x) (htole64((x)))
-
-/* ... generic little-endian fallback code */
-#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-
-# define htole32(x) (x)
-# define le32toh(x) (x)
-# define htobe32(x) \
- (__extension__({ \
- uint32_t _temp = (x); \
- ((_temp >> 24) & 0x000000FF) | ((_temp >> 8) & 0x0000FF00) | \
- ((_temp << 8) & 0x00FF0000) | ((_temp << 24) & 0xFF000000); \
- }))
-# define be32toh(x) (htobe32((x)))
-
-# define htole64(x) (x)
-# define le64toh(x) (x)
-# define htobe64(x) \
- (__extension__({ \
- uint64_t __temp = (x); \
- uint32_t __low = htobe32((uint32_t)__temp); \
- uint32_t __high = htobe32((uint32_t)(__temp >> 32)); \
- (((uint64_t)__low) << 32) | __high; \
- }))
-# define be64toh(x) (htobe64((x)))
-
-/* ... couldn't determine endian-ness of the target platform */
-#else
-# error "Please define __BYTE_ORDER__!"
-
-#endif /* defined(__linux__) || ... */
-
-/* Loads and stores. These avoid undefined behavior due to unaligned memory
- * accesses, via memcpy. */
-
-inline static uint16_t load16(uint8_t *b) {
- uint16_t x;
- memcpy(&x, b, 2);
- return x;
-}
-
-inline static uint32_t load32(uint8_t *b) {
- uint32_t x;
- memcpy(&x, b, 4);
- return x;
-}
-
-inline static uint64_t load64(uint8_t *b) {
- uint64_t x;
- memcpy(&x, b, 8);
- return x;
-}
-
-inline static void store16(uint8_t *b, uint16_t i) {
- memcpy(b, &i, 2);
-}
-
-inline static void store32(uint8_t *b, uint32_t i) {
- memcpy(b, &i, 4);
-}
-
-inline static void store64(uint8_t *b, uint64_t i) {
- memcpy(b, &i, 8);
-}
-
-/* Legacy accessors so that this header can serve as an implementation of
- * C.Endianness */
-#define load16_le(b) (le16toh(load16(b)))
-#define store16_le(b, i) (store16(b, htole16(i)))
-#define load16_be(b) (be16toh(load16(b)))
-#define store16_be(b, i) (store16(b, htobe16(i)))
-
-#define load32_le(b) (le32toh(load32(b)))
-#define store32_le(b, i) (store32(b, htole32(i)))
-#define load32_be(b) (be32toh(load32(b)))
-#define store32_be(b, i) (store32(b, htobe32(i)))
-
-#define load64_le(b) (le64toh(load64(b)))
-#define store64_le(b, i) (store64(b, htole64(i)))
-#define load64_be(b) (be64toh(load64(b)))
-#define store64_be(b, i) (store64(b, htobe64(i)))
-
-/* Co-existence of LowStar.Endianness and FStar.Endianness generates name
- * conflicts, because of course both insist on having no prefixes. Until a
- * prefix is added, or until we truly retire FStar.Endianness, solve this issue
- * in an elegant way. */
-#define load16_le0 load16_le
-#define store16_le0 store16_le
-#define load16_be0 load16_be
-#define store16_be0 store16_be
-
-#define load32_le0 load32_le
-#define store32_le0 store32_le
-#define load32_be0 load32_be
-#define store32_be0 store32_be
-
-#define load64_le0 load64_le
-#define store64_le0 store64_le
-#define load64_be0 load64_be
-#define store64_be0 store64_be
-
-#define load128_le0 load128_le
-#define store128_le0 store128_le
-#define load128_be0 load128_be
-#define store128_be0 store128_be
-
-#endif
diff --git a/contrib/tools/python3/src/Modules/_pickle.c b/contrib/tools/python3/src/Modules/_pickle.c
deleted file mode 100644
index 43d968f5248..00000000000
--- a/contrib/tools/python3/src/Modules/_pickle.c
+++ /dev/null
@@ -1,7986 +0,0 @@
-/* pickle accelerator C extensor: _pickle module.
- *
- * It is built as a built-in module (Py_BUILD_CORE_BUILTIN define) on Windows
- * and as an extension module (Py_BUILD_CORE_MODULE define) on other
- * platforms. */
-
-#ifndef Py_BUILD_CORE_BUILTIN
-# define Py_BUILD_CORE_MODULE 1
-#endif
-
-#include "Python.h"
-#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
-#include "pycore_moduleobject.h" // _PyModule_GetState()
-#include "pycore_runtime.h" // _Py_ID()
-#include "pycore_pystate.h" // _PyThreadState_GET()
-#include "structmember.h" // PyMemberDef
-
-#include <stdlib.h> // strtol()
-
-PyDoc_STRVAR(pickle_module_doc,
-"Optimized C implementation for the Python pickle module.");
-
-/*[clinic input]
-module _pickle
-class _pickle.Pickler "PicklerObject *" ""
-class _pickle.PicklerMemoProxy "PicklerMemoProxyObject *" ""
-class _pickle.Unpickler "UnpicklerObject *" ""
-class _pickle.UnpicklerMemoProxy "UnpicklerMemoProxyObject *" ""
-[clinic start generated code]*/
-/*[clinic end generated code: output=da39a3ee5e6b4b0d input=b6d7191ab6466cda]*/
-
-/* Bump HIGHEST_PROTOCOL when new opcodes are added to the pickle protocol.
- Bump DEFAULT_PROTOCOL only when the oldest still supported version of Python
- already includes it. */
-enum {
- HIGHEST_PROTOCOL = 5,
- DEFAULT_PROTOCOL = 4
-};
-
-#ifdef MS_WINDOWS
-// These are already typedefs from windows.h, pulled in via pycore_runtime.h.
-#define FLOAT FLOAT_
-#define INT INT_
-#define LONG LONG_
-
-/* This can already be defined on Windows to set the character set
- the Windows header files treat as default */
-#ifdef UNICODE
-#undef UNICODE
-#endif
-#endif
-
-/* Pickle opcodes. These must be kept updated with pickle.py.
- Extensive docs are in pickletools.py. */
-enum opcode {
- MARK = '(',
- STOP = '.',
- POP = '0',
- POP_MARK = '1',
- DUP = '2',
- FLOAT_ = 'F',
- INT_ = 'I',
- BININT = 'J',
- BININT1 = 'K',
- LONG_ = 'L',
- BININT2 = 'M',
- NONE = 'N',
- PERSID = 'P',
- BINPERSID = 'Q',
- REDUCE = 'R',
- STRING = 'S',
- BINSTRING = 'T',
- SHORT_BINSTRING = 'U',
- UNICODE = 'V',
- BINUNICODE = 'X',
- APPEND = 'a',
- BUILD = 'b',
- GLOBAL = 'c',
- DICT = 'd',
- EMPTY_DICT = '}',
- APPENDS = 'e',
- GET = 'g',
- BINGET = 'h',
- INST = 'i',
- LONG_BINGET = 'j',
- LIST = 'l',
- EMPTY_LIST = ']',
- OBJ = 'o',
- PUT = 'p',
- BINPUT = 'q',
- LONG_BINPUT = 'r',
- SETITEM = 's',
- TUPLE = 't',
- EMPTY_TUPLE = ')',
- SETITEMS = 'u',
- BINFLOAT = 'G',
-
- /* Protocol 2. */
- PROTO = '\x80',
- NEWOBJ = '\x81',
- EXT1 = '\x82',
- EXT2 = '\x83',
- EXT4 = '\x84',
- TUPLE1 = '\x85',
- TUPLE2 = '\x86',
- TUPLE3 = '\x87',
- NEWTRUE = '\x88',
- NEWFALSE = '\x89',
- LONG1 = '\x8a',
- LONG4 = '\x8b',
-
- /* Protocol 3 (Python 3.x) */
- BINBYTES = 'B',
- SHORT_BINBYTES = 'C',
-
- /* Protocol 4 */
- SHORT_BINUNICODE = '\x8c',
- BINUNICODE8 = '\x8d',
- BINBYTES8 = '\x8e',
- EMPTY_SET = '\x8f',
- ADDITEMS = '\x90',
- FROZENSET = '\x91',
- NEWOBJ_EX = '\x92',
- STACK_GLOBAL = '\x93',
- MEMOIZE = '\x94',
- FRAME = '\x95',
-
- /* Protocol 5 */
- BYTEARRAY8 = '\x96',
- NEXT_BUFFER = '\x97',
- READONLY_BUFFER = '\x98'
-};
-
-enum {
- /* Keep in synch with pickle.Pickler._BATCHSIZE. This is how many elements
- batch_list/dict() pumps out before doing APPENDS/SETITEMS. Nothing will
- break if this gets out of synch with pickle.py, but it's unclear that would
- help anything either. */
- BATCHSIZE = 1000,
-
- /* Nesting limit until Pickler, when running in "fast mode", starts
- checking for self-referential data-structures. */
- FAST_NESTING_LIMIT = 50,
-
- /* Initial size of the write buffer of Pickler. */
- WRITE_BUF_SIZE = 4096,
-
- /* Prefetch size when unpickling (disabled on unpeekable streams) */
- PREFETCH = 8192 * 16,
-
- FRAME_SIZE_MIN = 4,
- FRAME_SIZE_TARGET = 64 * 1024,
- FRAME_HEADER_SIZE = 9
-};
-
-/*************************************************************************/
-
-/* State of the pickle module, per PEP 3121. */
-typedef struct {
- /* Exception classes for pickle. */
- PyObject *PickleError;
- PyObject *PicklingError;
- PyObject *UnpicklingError;
-
- /* copyreg.dispatch_table, {type_object: pickling_function} */
- PyObject *dispatch_table;
-
- /* For the extension opcodes EXT1, EXT2 and EXT4. */
-
- /* copyreg._extension_registry, {(module_name, function_name): code} */
- PyObject *extension_registry;
- /* copyreg._extension_cache, {code: object} */
- PyObject *extension_cache;
- /* copyreg._inverted_registry, {code: (module_name, function_name)} */
- PyObject *inverted_registry;
-
- /* Import mappings for compatibility with Python 2.x */
-
- /* _compat_pickle.NAME_MAPPING,
- {(oldmodule, oldname): (newmodule, newname)} */
- PyObject *name_mapping_2to3;
- /* _compat_pickle.IMPORT_MAPPING, {oldmodule: newmodule} */
- PyObject *import_mapping_2to3;
- /* Same, but with REVERSE_NAME_MAPPING / REVERSE_IMPORT_MAPPING */
- PyObject *name_mapping_3to2;
- PyObject *import_mapping_3to2;
-
- /* codecs.encode, used for saving bytes in older protocols */
- PyObject *codecs_encode;
- /* builtins.getattr, used for saving nested names with protocol < 4 */
- PyObject *getattr;
- /* functools.partial, used for implementing __newobj_ex__ with protocols
- 2 and 3 */
- PyObject *partial;
-
- /* Types */
- PyTypeObject *Pickler_Type;
- PyTypeObject *Unpickler_Type;
- PyTypeObject *Pdata_Type;
- PyTypeObject *PicklerMemoProxyType;
- PyTypeObject *UnpicklerMemoProxyType;
-} PickleState;
-
-/* Forward declaration of the _pickle module definition. */
-static struct PyModuleDef _picklemodule;
-
-/* Given a module object, get its per-module state. */
-static inline PickleState *
-_Pickle_GetState(PyObject *module)
-{
- void *state = _PyModule_GetState(module);
- assert(state != NULL);
- return (PickleState *)state;
-}
-
-static inline PickleState *
-_Pickle_GetStateByClass(PyTypeObject *cls)
-{
- void *state = _PyType_GetModuleState(cls);
- assert(state != NULL);
- return (PickleState *)state;
-}
-
-static inline PickleState *
-_Pickle_FindStateByType(PyTypeObject *tp)
-{
- PyObject *module = PyType_GetModuleByDef(tp, &_picklemodule);
- assert(module != NULL);
- return _Pickle_GetState(module);
-}
-
-/* Clear the given pickle module state. */
-static void
-_Pickle_ClearState(PickleState *st)
-{
- Py_CLEAR(st->PickleError);
- Py_CLEAR(st->PicklingError);
- Py_CLEAR(st->UnpicklingError);
- Py_CLEAR(st->dispatch_table);
- Py_CLEAR(st->extension_registry);
- Py_CLEAR(st->extension_cache);
- Py_CLEAR(st->inverted_registry);
- Py_CLEAR(st->name_mapping_2to3);
- Py_CLEAR(st->import_mapping_2to3);
- Py_CLEAR(st->name_mapping_3to2);
- Py_CLEAR(st->import_mapping_3to2);
- Py_CLEAR(st->codecs_encode);
- Py_CLEAR(st->getattr);
- Py_CLEAR(st->partial);
- Py_CLEAR(st->Pickler_Type);
- Py_CLEAR(st->Unpickler_Type);
- Py_CLEAR(st->Pdata_Type);
- Py_CLEAR(st->PicklerMemoProxyType);
- Py_CLEAR(st->UnpicklerMemoProxyType);
-}
-
-/* Initialize the given pickle module state. */
-static int
-_Pickle_InitState(PickleState *st)
-{
- PyObject *copyreg = NULL;
- PyObject *compat_pickle = NULL;
-
- st->getattr = _PyEval_GetBuiltin(&_Py_ID(getattr));
- if (st->getattr == NULL)
- goto error;
-
- copyreg = PyImport_ImportModule("copyreg");
- if (!copyreg)
- goto error;
- st->dispatch_table = PyObject_GetAttrString(copyreg, "dispatch_table");
- if (!st->dispatch_table)
- goto error;
- if (!PyDict_CheckExact(st->dispatch_table)) {
- PyErr_Format(PyExc_RuntimeError,
- "copyreg.dispatch_table should be a dict, not %.200s",
- Py_TYPE(st->dispatch_table)->tp_name);
- goto error;
- }
- st->extension_registry = \
- PyObject_GetAttrString(copyreg, "_extension_registry");
- if (!st->extension_registry)
- goto error;
- if (!PyDict_CheckExact(st->extension_registry)) {
- PyErr_Format(PyExc_RuntimeError,
- "copyreg._extension_registry should be a dict, "
- "not %.200s", Py_TYPE(st->extension_registry)->tp_name);
- goto error;
- }
- st->inverted_registry = \
- PyObject_GetAttrString(copyreg, "_inverted_registry");
- if (!st->inverted_registry)
- goto error;
- if (!PyDict_CheckExact(st->inverted_registry)) {
- PyErr_Format(PyExc_RuntimeError,
- "copyreg._inverted_registry should be a dict, "
- "not %.200s", Py_TYPE(st->inverted_registry)->tp_name);
- goto error;
- }
- st->extension_cache = PyObject_GetAttrString(copyreg, "_extension_cache");
- if (!st->extension_cache)
- goto error;
- if (!PyDict_CheckExact(st->extension_cache)) {
- PyErr_Format(PyExc_RuntimeError,
- "copyreg._extension_cache should be a dict, "
- "not %.200s", Py_TYPE(st->extension_cache)->tp_name);
- goto error;
- }
- Py_CLEAR(copyreg);
-
- /* Load the 2.x -> 3.x stdlib module mapping tables */
- compat_pickle = PyImport_ImportModule("_compat_pickle");
- if (!compat_pickle)
- goto error;
- st->name_mapping_2to3 = \
- PyObject_GetAttrString(compat_pickle, "NAME_MAPPING");
- if (!st->name_mapping_2to3)
- goto error;
- if (!PyDict_CheckExact(st->name_mapping_2to3)) {
- PyErr_Format(PyExc_RuntimeError,
- "_compat_pickle.NAME_MAPPING should be a dict, not %.200s",
- Py_TYPE(st->name_mapping_2to3)->tp_name);
- goto error;
- }
- st->import_mapping_2to3 = \
- PyObject_GetAttrString(compat_pickle, "IMPORT_MAPPING");
- if (!st->import_mapping_2to3)
- goto error;
- if (!PyDict_CheckExact(st->import_mapping_2to3)) {
- PyErr_Format(PyExc_RuntimeError,
- "_compat_pickle.IMPORT_MAPPING should be a dict, "
- "not %.200s", Py_TYPE(st->import_mapping_2to3)->tp_name);
- goto error;
- }
- /* ... and the 3.x -> 2.x mapping tables */
- st->name_mapping_3to2 = \
- PyObject_GetAttrString(compat_pickle, "REVERSE_NAME_MAPPING");
- if (!st->name_mapping_3to2)
- goto error;
- if (!PyDict_CheckExact(st->name_mapping_3to2)) {
- PyErr_Format(PyExc_RuntimeError,
- "_compat_pickle.REVERSE_NAME_MAPPING should be a dict, "
- "not %.200s", Py_TYPE(st->name_mapping_3to2)->tp_name);
- goto error;
- }
- st->import_mapping_3to2 = \
- PyObject_GetAttrString(compat_pickle, "REVERSE_IMPORT_MAPPING");
- if (!st->import_mapping_3to2)
- goto error;
- if (!PyDict_CheckExact(st->import_mapping_3to2)) {
- PyErr_Format(PyExc_RuntimeError,
- "_compat_pickle.REVERSE_IMPORT_MAPPING should be a dict, "
- "not %.200s", Py_TYPE(st->import_mapping_3to2)->tp_name);
- goto error;
- }
- Py_CLEAR(compat_pickle);
-
- st->codecs_encode = _PyImport_GetModuleAttrString("codecs", "encode");
- if (st->codecs_encode == NULL) {
- goto error;
- }
- if (!PyCallable_Check(st->codecs_encode)) {
- PyErr_Format(PyExc_RuntimeError,
- "codecs.encode should be a callable, not %.200s",
- Py_TYPE(st->codecs_encode)->tp_name);
- goto error;
- }
-
- st->partial = _PyImport_GetModuleAttrString("functools", "partial");
- if (!st->partial)
- goto error;
-
- return 0;
-
- error:
- Py_CLEAR(copyreg);
- Py_CLEAR(compat_pickle);
- _Pickle_ClearState(st);
- return -1;
-}
-
-/* Helper for calling a function with a single argument quickly.
-
- This function steals the reference of the given argument. */
-static PyObject *
-_Pickle_FastCall(PyObject *func, PyObject *obj)
-{
- PyObject *result;
-
- result = PyObject_CallOneArg(func, obj);
- Py_DECREF(obj);
- return result;
-}
-
-/*************************************************************************/
-
-/* Retrieve and deconstruct a method for avoiding a reference cycle
- (pickler -> bound method of pickler -> pickler) */
-static int
-init_method_ref(PyObject *self, PyObject *name,
- PyObject **method_func, PyObject **method_self)
-{
- PyObject *func, *func2;
- int ret;
-
- /* *method_func and *method_self should be consistent. All refcount decrements
- should be occurred after setting *method_self and *method_func. */
- ret = _PyObject_LookupAttr(self, name, &func);
- if (func == NULL) {
- *method_self = NULL;
- Py_CLEAR(*method_func);
- return ret;
- }
-
- if (PyMethod_Check(func) && PyMethod_GET_SELF(func) == self) {
- /* Deconstruct a bound Python method */
- *method_self = self; /* borrowed */
- func2 = PyMethod_GET_FUNCTION(func);
- Py_XSETREF(*method_func, Py_NewRef(func2));
- Py_DECREF(func);
- return 0;
- }
- else {
- *method_self = NULL;
- Py_XSETREF(*method_func, func);
- return 0;
- }
-}
-
-/* Bind a method if it was deconstructed */
-static PyObject *
-reconstruct_method(PyObject *func, PyObject *self)
-{
- if (self) {
- return PyMethod_New(func, self);
- }
- else {
- return Py_NewRef(func);
- }
-}
-
-static PyObject *
-call_method(PyObject *func, PyObject *self, PyObject *obj)
-{
- if (self) {
- return PyObject_CallFunctionObjArgs(func, self, obj, NULL);
- }
- else {
- return PyObject_CallOneArg(func, obj);
- }
-}
-
-/*************************************************************************/
-
-/* Internal data type used as the unpickling stack. */
-typedef struct {
- PyObject_VAR_HEAD
- PyObject **data;
- int mark_set; /* is MARK set? */
- Py_ssize_t fence; /* position of top MARK or 0 */
- Py_ssize_t allocated; /* number of slots in data allocated */
-} Pdata;
-
-static int
-Pdata_traverse(Pdata *self, visitproc visit, void *arg)
-{
- Py_VISIT(Py_TYPE(self));
- return 0;
-}
-
-static void
-Pdata_dealloc(Pdata *self)
-{
- PyTypeObject *tp = Py_TYPE(self);
- PyObject_GC_UnTrack(self);
- Py_ssize_t i = Py_SIZE(self);
- while (--i >= 0) {
- Py_DECREF(self->data[i]);
- }
- PyMem_Free(self->data);
- tp->tp_free((PyObject *)self);
- Py_DECREF(tp);
-}
-
-static PyType_Slot pdata_slots[] = {
- {Py_tp_dealloc, Pdata_dealloc},
- {Py_tp_traverse, Pdata_traverse},
- {0, NULL},
-};
-
-static PyType_Spec pdata_spec = {
- .name = "_pickle.Pdata",
- .basicsize = sizeof(Pdata),
- .itemsize = sizeof(PyObject *),
- .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
- Py_TPFLAGS_IMMUTABLETYPE),
- .slots = pdata_slots,
-};
-
-static PyObject *
-Pdata_New(PickleState *state)
-{
- Pdata *self;
-
- if (!(self = PyObject_GC_New(Pdata, state->Pdata_Type)))
- return NULL;
- Py_SET_SIZE(self, 0);
- self->mark_set = 0;
- self->fence = 0;
- self->allocated = 8;
- self->data = PyMem_Malloc(self->allocated * sizeof(PyObject *));
- if (self->data) {
- PyObject_GC_Track(self);
- return (PyObject *)self;
- }
- Py_DECREF(self);
- return PyErr_NoMemory();
-}
-
-
-/* Retain only the initial clearto items. If clearto >= the current
- * number of items, this is a (non-erroneous) NOP.
- */
-static int
-Pdata_clear(Pdata *self, Py_ssize_t clearto)
-{
- Py_ssize_t i = Py_SIZE(self);
-
- assert(clearto >= self->fence);
- if (clearto >= i)
- return 0;
-
- while (--i >= clearto) {
- Py_CLEAR(self->data[i]);
- }
- Py_SET_SIZE(self, clearto);
- return 0;
-}
-
-static int
-Pdata_grow(Pdata *self)
-{
- PyObject **data = self->data;
- size_t allocated = (size_t)self->allocated;
- size_t new_allocated;
-
- new_allocated = (allocated >> 3) + 6;
- /* check for integer overflow */
- if (new_allocated > (size_t)PY_SSIZE_T_MAX - allocated)
- goto nomemory;
- new_allocated += allocated;
- PyMem_RESIZE(data, PyObject *, new_allocated);
- if (data == NULL)
- goto nomemory;
-
- self->data = data;
- self->allocated = (Py_ssize_t)new_allocated;
- return 0;
-
- nomemory:
- PyErr_NoMemory();
- return -1;
-}
-
-static int
-Pdata_stack_underflow(PickleState *st, Pdata *self)
-{
- PyErr_SetString(st->UnpicklingError,
- self->mark_set ?
- "unexpected MARK found" :
- "unpickling stack underflow");
- return -1;
-}
-
-/* D is a Pdata*. Pop the topmost element and store it into V, which
- * must be an lvalue holding PyObject*. On stack underflow, UnpicklingError
- * is raised and V is set to NULL.
- */
-static PyObject *
-Pdata_pop(PickleState *state, Pdata *self)
-{
- if (Py_SIZE(self) <= self->fence) {
- Pdata_stack_underflow(state, self);
- return NULL;
- }
- Py_SET_SIZE(self, Py_SIZE(self) - 1);
- return self->data[Py_SIZE(self)];
-}
-#define PDATA_POP(S, D, V) do { (V) = Pdata_pop(S, (D)); } while (0)
-
-static int
-Pdata_push(Pdata *self, PyObject *obj)
-{
- if (Py_SIZE(self) == self->allocated && Pdata_grow(self) < 0) {
- return -1;
- }
- self->data[Py_SIZE(self)] = obj;
- Py_SET_SIZE(self, Py_SIZE(self) + 1);
- return 0;
-}
-
-/* Push an object on stack, transferring its ownership to the stack. */
-#define PDATA_PUSH(D, O, ER) do { \
- if (Pdata_push((D), (O)) < 0) return (ER); } while(0)
-
-/* Push an object on stack, adding a new reference to the object. */
-#define PDATA_APPEND(D, O, ER) do { \
- Py_INCREF((O)); \
- if (Pdata_push((D), (O)) < 0) return (ER); } while(0)
-
-static PyObject *
-Pdata_poptuple(PickleState *state, Pdata *self, Py_ssize_t start)
-{
- PyObject *tuple;
- Py_ssize_t len, i, j;
-
- if (start < self->fence) {
- Pdata_stack_underflow(state, self);
- return NULL;
- }
- len = Py_SIZE(self) - start;
- tuple = PyTuple_New(len);
- if (tuple == NULL)
- return NULL;
- for (i = start, j = 0; j < len; i++, j++)
- PyTuple_SET_ITEM(tuple, j, self->data[i]);
-
- Py_SET_SIZE(self, start);
- return tuple;
-}
-
-static PyObject *
-Pdata_poplist(Pdata *self, Py_ssize_t start)
-{
- PyObject *list;
- Py_ssize_t len, i, j;
-
- len = Py_SIZE(self) - start;
- list = PyList_New(len);
- if (list == NULL)
- return NULL;
- for (i = start, j = 0; j < len; i++, j++)
- PyList_SET_ITEM(list, j, self->data[i]);
-
- Py_SET_SIZE(self, start);
- return list;
-}
-
-typedef struct {
- PyObject *me_key;
- Py_ssize_t me_value;
-} PyMemoEntry;
-
-typedef struct {
- size_t mt_mask;
- size_t mt_used;
- size_t mt_allocated;
- PyMemoEntry *mt_table;
-} PyMemoTable;
-
-typedef struct PicklerObject {
- PyObject_HEAD
- PyMemoTable *memo; /* Memo table, keep track of the seen
- objects to support self-referential objects
- pickling. */
- PyObject *pers_func; /* persistent_id() method, can be NULL */
- PyObject *pers_func_self; /* borrowed reference to self if pers_func
- is an unbound method, NULL otherwise */
- PyObject *dispatch_table; /* private dispatch_table, can be NULL */
- PyObject *reducer_override; /* hook for invoking user-defined callbacks
- instead of save_global when pickling
- functions and classes*/
-
- PyObject *write; /* write() method of the output stream. */
- PyObject *output_buffer; /* Write into a local bytearray buffer before
- flushing to the stream. */
- Py_ssize_t output_len; /* Length of output_buffer. */
- Py_ssize_t max_output_len; /* Allocation size of output_buffer. */
- int proto; /* Pickle protocol number, >= 0 */
- int bin; /* Boolean, true if proto > 0 */
- int framing; /* True when framing is enabled, proto >= 4 */
- Py_ssize_t frame_start; /* Position in output_buffer where the
- current frame begins. -1 if there
- is no frame currently open. */
-
- Py_ssize_t buf_size; /* Size of the current buffered pickle data */
- int fast; /* Enable fast mode if set to a true value.
- The fast mode disable the usage of memo,
- therefore speeding the pickling process by
- not generating superfluous PUT opcodes. It
- should not be used if with self-referential
- objects. */
- int fast_nesting;
- int fix_imports; /* Indicate whether Pickler should fix
- the name of globals for Python 2.x. */
- PyObject *fast_memo;
- PyObject *buffer_callback; /* Callback for out-of-band buffers, or NULL */
-} PicklerObject;
-
-typedef struct UnpicklerObject {
- PyObject_HEAD
- Pdata *stack; /* Pickle data stack, store unpickled objects. */
-
- /* The unpickler memo is just an array of PyObject *s. Using a dict
- is unnecessary, since the keys are contiguous ints. */
- PyObject **memo;
- size_t memo_size; /* Capacity of the memo array */
- size_t memo_len; /* Number of objects in the memo */
-
- PyObject *pers_func; /* persistent_load() method, can be NULL. */
- PyObject *pers_func_self; /* borrowed reference to self if pers_func
- is an unbound method, NULL otherwise */
-
- Py_buffer buffer;
- char *input_buffer;
- char *input_line;
- Py_ssize_t input_len;
- Py_ssize_t next_read_idx;
- Py_ssize_t prefetched_idx; /* index of first prefetched byte */
-
- PyObject *read; /* read() method of the input stream. */
- PyObject *readinto; /* readinto() method of the input stream. */
- PyObject *readline; /* readline() method of the input stream. */
- PyObject *peek; /* peek() method of the input stream, or NULL */
- PyObject *buffers; /* iterable of out-of-band buffers, or NULL */
-
- char *encoding; /* Name of the encoding to be used for
- decoding strings pickled using Python
- 2.x. The default value is "ASCII" */
- char *errors; /* Name of errors handling scheme to used when
- decoding strings. The default value is
- "strict". */
- Py_ssize_t *marks; /* Mark stack, used for unpickling container
- objects. */
- Py_ssize_t num_marks; /* Number of marks in the mark stack. */
- Py_ssize_t marks_size; /* Current allocated size of the mark stack. */
- int proto; /* Protocol of the pickle loaded. */
- int fix_imports; /* Indicate whether Unpickler should fix
- the name of globals pickled by Python 2.x. */
-} UnpicklerObject;
-
-typedef struct {
- PyObject_HEAD
- PicklerObject *pickler; /* Pickler whose memo table we're proxying. */
-} PicklerMemoProxyObject;
-
-typedef struct {
- PyObject_HEAD
- UnpicklerObject *unpickler;
-} UnpicklerMemoProxyObject;
-
-/* Forward declarations */
-static int save(PickleState *state, PicklerObject *, PyObject *, int);
-static int save_reduce(PickleState *, PicklerObject *, PyObject *, PyObject *);
-
-#include "clinic/_pickle.c.h"
-
-/*************************************************************************
- A custom hashtable mapping void* to Python ints. This is used by the pickler
- for memoization. Using a custom hashtable rather than PyDict allows us to skip
- a bunch of unnecessary object creation. This makes a huge performance
- difference. */
-
-#define MT_MINSIZE 8
-#define PERTURB_SHIFT 5
-
-
-static PyMemoTable *
-PyMemoTable_New(void)
-{
- PyMemoTable *memo = PyMem_Malloc(sizeof(PyMemoTable));
- if (memo == NULL) {
- PyErr_NoMemory();
- return NULL;
- }
-
- memo->mt_used = 0;
- memo->mt_allocated = MT_MINSIZE;
- memo->mt_mask = MT_MINSIZE - 1;
- memo->mt_table = PyMem_Malloc(MT_MINSIZE * sizeof(PyMemoEntry));
- if (memo->mt_table == NULL) {
- PyMem_Free(memo);
- PyErr_NoMemory();
- return NULL;
- }
- memset(memo->mt_table, 0, MT_MINSIZE * sizeof(PyMemoEntry));
-
- return memo;
-}
-
-static PyMemoTable *
-PyMemoTable_Copy(PyMemoTable *self)
-{
- PyMemoTable *new = PyMemoTable_New();
- if (new == NULL)
- return NULL;
-
- new->mt_used = self->mt_used;
- new->mt_allocated = self->mt_allocated;
- new->mt_mask = self->mt_mask;
- /* The table we get from _New() is probably smaller than we wanted.
- Free it and allocate one that's the right size. */
- PyMem_Free(new->mt_table);
- new->mt_table = PyMem_NEW(PyMemoEntry, self->mt_allocated);
- if (new->mt_table == NULL) {
- PyMem_Free(new);
- PyErr_NoMemory();
- return NULL;
- }
- for (size_t i = 0; i < self->mt_allocated; i++) {
- Py_XINCREF(self->mt_table[i].me_key);
- }
- memcpy(new->mt_table, self->mt_table,
- sizeof(PyMemoEntry) * self->mt_allocated);
-
- return new;
-}
-
-static Py_ssize_t
-PyMemoTable_Size(PyMemoTable *self)
-{
- return self->mt_used;
-}
-
-static int
-PyMemoTable_Clear(PyMemoTable *self)
-{
- Py_ssize_t i = self->mt_allocated;
-
- while (--i >= 0) {
- Py_XDECREF(self->mt_table[i].me_key);
- }
- self->mt_used = 0;
- memset(self->mt_table, 0, self->mt_allocated * sizeof(PyMemoEntry));
- return 0;
-}
-
-static void
-PyMemoTable_Del(PyMemoTable *self)
-{
- if (self == NULL)
- return;
- PyMemoTable_Clear(self);
-
- PyMem_Free(self->mt_table);
- PyMem_Free(self);
-}
-
-/* Since entries cannot be deleted from this hashtable, _PyMemoTable_Lookup()
- can be considerably simpler than dictobject.c's lookdict(). */
-static PyMemoEntry *
-_PyMemoTable_Lookup(PyMemoTable *self, PyObject *key)
-{
- size_t i;
- size_t perturb;
- size_t mask = self->mt_mask;
- PyMemoEntry *table = self->mt_table;
- PyMemoEntry *entry;
- Py_hash_t hash = (Py_hash_t)key >> 3;
-
- i = hash & mask;
- entry = &table[i];
- if (entry->me_key == NULL || entry->me_key == key)
- return entry;
-
- for (perturb = hash; ; perturb >>= PERTURB_SHIFT) {
- i = (i << 2) + i + perturb + 1;
- entry = &table[i & mask];
- if (entry->me_key == NULL || entry->me_key == key)
- return entry;
- }
- Py_UNREACHABLE();
-}
-
-/* Returns -1 on failure, 0 on success. */
-static int
-_PyMemoTable_ResizeTable(PyMemoTable *self, size_t min_size)
-{
- PyMemoEntry *oldtable = NULL;
- PyMemoEntry *oldentry, *newentry;
- size_t new_size = MT_MINSIZE;
- size_t to_process;
-
- assert(min_size > 0);
-
- if (min_size > PY_SSIZE_T_MAX) {
- PyErr_NoMemory();
- return -1;
- }
-
- /* Find the smallest valid table size >= min_size. */
- while (new_size < min_size) {
- new_size <<= 1;
- }
- /* new_size needs to be a power of two. */
- assert((new_size & (new_size - 1)) == 0);
-
- /* Allocate new table. */
- oldtable = self->mt_table;
- self->mt_table = PyMem_NEW(PyMemoEntry, new_size);
- if (self->mt_table == NULL) {
- self->mt_table = oldtable;
- PyErr_NoMemory();
- return -1;
- }
- self->mt_allocated = new_size;
- self->mt_mask = new_size - 1;
- memset(self->mt_table, 0, sizeof(PyMemoEntry) * new_size);
-
- /* Copy entries from the old table. */
- to_process = self->mt_used;
- for (oldentry = oldtable; to_process > 0; oldentry++) {
- if (oldentry->me_key != NULL) {
- to_process--;
- /* newentry is a pointer to a chunk of the new
- mt_table, so we're setting the key:value pair
- in-place. */
- newentry = _PyMemoTable_Lookup(self, oldentry->me_key);
- newentry->me_key = oldentry->me_key;
- newentry->me_value = oldentry->me_value;
- }
- }
-
- /* Deallocate the old table. */
- PyMem_Free(oldtable);
- return 0;
-}
-
-/* Returns NULL on failure, a pointer to the value otherwise. */
-static Py_ssize_t *
-PyMemoTable_Get(PyMemoTable *self, PyObject *key)
-{
- PyMemoEntry *entry = _PyMemoTable_Lookup(self, key);
- if (entry->me_key == NULL)
- return NULL;
- return &entry->me_value;
-}
-
-/* Returns -1 on failure, 0 on success. */
-static int
-PyMemoTable_Set(PyMemoTable *self, PyObject *key, Py_ssize_t value)
-{
- PyMemoEntry *entry;
-
- assert(key != NULL);
-
- entry = _PyMemoTable_Lookup(self, key);
- if (entry->me_key != NULL) {
- entry->me_value = value;
- return 0;
- }
- entry->me_key = Py_NewRef(key);
- entry->me_value = value;
- self->mt_used++;
-
- /* If we added a key, we can safely resize. Otherwise just return!
- * If used >= 2/3 size, adjust size. Normally, this quaduples the size.
- *
- * Quadrupling the size improves average table sparseness
- * (reducing collisions) at the cost of some memory. It also halves
- * the number of expensive resize operations in a growing memo table.
- *
- * Very large memo tables (over 50K items) use doubling instead.
- * This may help applications with severe memory constraints.
- */
- if (SIZE_MAX / 3 >= self->mt_used && self->mt_used * 3 < self->mt_allocated * 2) {
- return 0;
- }
- // self->mt_used is always < PY_SSIZE_T_MAX, so this can't overflow.
- size_t desired_size = (self->mt_used > 50000 ? 2 : 4) * self->mt_used;
- return _PyMemoTable_ResizeTable(self, desired_size);
-}
-
-#undef MT_MINSIZE
-#undef PERTURB_SHIFT
-
-/*************************************************************************/
-
-
-static int
-_Pickler_ClearBuffer(PicklerObject *self)
-{
- Py_XSETREF(self->output_buffer,
- PyBytes_FromStringAndSize(NULL, self->max_output_len));
- if (self->output_buffer == NULL)
- return -1;
- self->output_len = 0;
- self->frame_start = -1;
- return 0;
-}
-
-static void
-_write_size64(char *out, size_t value)
-{
- size_t i;
-
- static_assert(sizeof(size_t) <= 8, "size_t is larger than 64-bit");
-
- for (i = 0; i < sizeof(size_t); i++) {
- out[i] = (unsigned char)((value >> (8 * i)) & 0xff);
- }
- for (i = sizeof(size_t); i < 8; i++) {
- out[i] = 0;
- }
-}
-
-static int
-_Pickler_CommitFrame(PicklerObject *self)
-{
- size_t frame_len;
- char *qdata;
-
- if (!self->framing || self->frame_start == -1)
- return 0;
- frame_len = self->output_len - self->frame_start - FRAME_HEADER_SIZE;
- qdata = PyBytes_AS_STRING(self->output_buffer) + self->frame_start;
- if (frame_len >= FRAME_SIZE_MIN) {
- qdata[0] = FRAME;
- _write_size64(qdata + 1, frame_len);
- }
- else {
- memmove(qdata, qdata + FRAME_HEADER_SIZE, frame_len);
- self->output_len -= FRAME_HEADER_SIZE;
- }
- self->frame_start = -1;
- return 0;
-}
-
-static PyObject *
-_Pickler_GetString(PicklerObject *self)
-{
- PyObject *output_buffer = self->output_buffer;
-
- assert(self->output_buffer != NULL);
-
- if (_Pickler_CommitFrame(self))
- return NULL;
-
- self->output_buffer = NULL;
- /* Resize down to exact size */
- if (_PyBytes_Resize(&output_buffer, self->output_len) < 0)
- return NULL;
- return output_buffer;
-}
-
-static int
-_Pickler_FlushToFile(PicklerObject *self)
-{
- PyObject *output, *result;
-
- assert(self->write != NULL);
-
- /* This will commit the frame first */
- output = _Pickler_GetString(self);
- if (output == NULL)
- return -1;
-
- result = _Pickle_FastCall(self->write, output);
- Py_XDECREF(result);
- return (result == NULL) ? -1 : 0;
-}
-
-static int
-_Pickler_OpcodeBoundary(PicklerObject *self)
-{
- Py_ssize_t frame_len;
-
- if (!self->framing || self->frame_start == -1) {
- return 0;
- }
- frame_len = self->output_len - self->frame_start - FRAME_HEADER_SIZE;
- if (frame_len >= FRAME_SIZE_TARGET) {
- if(_Pickler_CommitFrame(self)) {
- return -1;
- }
- /* Flush the content of the committed frame to the underlying
- * file and reuse the pickler buffer for the next frame so as
- * to limit memory usage when dumping large complex objects to
- * a file.
- *
- * self->write is NULL when called via dumps.
- */
- if (self->write != NULL) {
- if (_Pickler_FlushToFile(self) < 0) {
- return -1;
- }
- if (_Pickler_ClearBuffer(self) < 0) {
- return -1;
- }
- }
- }
- return 0;
-}
-
-static Py_ssize_t
-_Pickler_Write(PicklerObject *self, const char *s, Py_ssize_t data_len)
-{
- Py_ssize_t i, n, required;
- char *buffer;
- int need_new_frame;
-
- assert(s != NULL);
- need_new_frame = (self->framing && self->frame_start == -1);
-
- if (need_new_frame)
- n = data_len + FRAME_HEADER_SIZE;
- else
- n = data_len;
-
- required = self->output_len + n;
- if (required > self->max_output_len) {
- /* Make place in buffer for the pickle chunk */
- if (self->output_len >= PY_SSIZE_T_MAX / 2 - n) {
- PyErr_NoMemory();
- return -1;
- }
- self->max_output_len = (self->output_len + n) / 2 * 3;
- if (_PyBytes_Resize(&self->output_buffer, self->max_output_len) < 0)
- return -1;
- }
- buffer = PyBytes_AS_STRING(self->output_buffer);
- if (need_new_frame) {
- /* Setup new frame */
- Py_ssize_t frame_start = self->output_len;
- self->frame_start = frame_start;
- for (i = 0; i < FRAME_HEADER_SIZE; i++) {
- /* Write an invalid value, for debugging */
- buffer[frame_start + i] = 0xFE;
- }
- self->output_len += FRAME_HEADER_SIZE;
- }
- if (data_len < 8) {
- /* This is faster than memcpy when the string is short. */
- for (i = 0; i < data_len; i++) {
- buffer[self->output_len + i] = s[i];
- }
- }
- else {
- memcpy(buffer + self->output_len, s, data_len);
- }
- self->output_len += data_len;
- return data_len;
-}
-
-static PicklerObject *
-_Pickler_New(PickleState *st)
-{
- PyMemoTable *memo = PyMemoTable_New();
- if (memo == NULL) {
- return NULL;
- }
-
- const Py_ssize_t max_output_len = WRITE_BUF_SIZE;
- PyObject *output_buffer = PyBytes_FromStringAndSize(NULL, max_output_len);
- if (output_buffer == NULL) {
- goto error;
- }
-
- PicklerObject *self = PyObject_GC_New(PicklerObject, st->Pickler_Type);
- if (self == NULL) {
- goto error;
- }
-
- self->memo = memo;
- self->pers_func = NULL;
- self->pers_func_self = NULL;
- self->dispatch_table = NULL;
- self->reducer_override = NULL;
- self->write = NULL;
- self->output_buffer = output_buffer;
- self->output_len = 0;
- self->max_output_len = max_output_len;
- self->proto = 0;
- self->bin = 0;
- self->framing = 0;
- self->frame_start = -1;
- self->buf_size = 0;
- self->fast = 0;
- self->fast_nesting = 0;
- self->fix_imports = 0;
- self->fast_memo = NULL;
- self->buffer_callback = NULL;
-
- PyObject_GC_Track(self);
- return self;
-
-error:
- PyMem_Free(memo);
- Py_XDECREF(output_buffer);
- return NULL;
-}
-
-static int
-_Pickler_SetProtocol(PicklerObject *self, PyObject *protocol, int fix_imports)
-{
- long proto;
-
- if (protocol == Py_None) {
- proto = DEFAULT_PROTOCOL;
- }
- else {
- proto = PyLong_AsLong(protocol);
- if (proto < 0) {
- if (proto == -1 && PyErr_Occurred())
- return -1;
- proto = HIGHEST_PROTOCOL;
- }
- else if (proto > HIGHEST_PROTOCOL) {
- PyErr_Format(PyExc_ValueError, "pickle protocol must be <= %d",
- HIGHEST_PROTOCOL);
- return -1;
- }
- }
- self->proto = (int)proto;
- self->bin = proto > 0;
- self->fix_imports = fix_imports && proto < 3;
- return 0;
-}
-
-/* Returns -1 (with an exception set) on failure, 0 on success. This may
- be called once on a freshly created Pickler. */
-static int
-_Pickler_SetOutputStream(PicklerObject *self, PyObject *file)
-{
- assert(file != NULL);
- if (_PyObject_LookupAttr(file, &_Py_ID(write), &self->write) < 0) {
- return -1;
- }
- if (self->write == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "file must have a 'write' attribute");
- return -1;
- }
-
- return 0;
-}
-
-static int
-_Pickler_SetBufferCallback(PicklerObject *self, PyObject *buffer_callback)
-{
- if (buffer_callback == Py_None) {
- buffer_callback = NULL;
- }
- if (buffer_callback != NULL && self->proto < 5) {
- PyErr_SetString(PyExc_ValueError,
- "buffer_callback needs protocol >= 5");
- return -1;
- }
-
- self->buffer_callback = Py_XNewRef(buffer_callback);
- return 0;
-}
-
-/* Returns the size of the input on success, -1 on failure. This takes its
- own reference to `input`. */
-static Py_ssize_t
-_Unpickler_SetStringInput(UnpicklerObject *self, PyObject *input)
-{
- if (self->buffer.buf != NULL)
- PyBuffer_Release(&self->buffer);
- if (PyObject_GetBuffer(input, &self->buffer, PyBUF_CONTIG_RO) < 0)
- return -1;
- self->input_buffer = self->buffer.buf;
- self->input_len = self->buffer.len;
- self->next_read_idx = 0;
- self->prefetched_idx = self->input_len;
- return self->input_len;
-}
-
-static int
-bad_readline(PickleState *st)
-{
- PyErr_SetString(st->UnpicklingError, "pickle data was truncated");
- return -1;
-}
-
-/* Skip any consumed data that was only prefetched using peek() */
-static int
-_Unpickler_SkipConsumed(UnpicklerObject *self)
-{
- Py_ssize_t consumed;
- PyObject *r;
-
- consumed = self->next_read_idx - self->prefetched_idx;
- if (consumed <= 0)
- return 0;
-
- assert(self->peek); /* otherwise we did something wrong */
- /* This makes a useless copy... */
- r = PyObject_CallFunction(self->read, "n", consumed);
- if (r == NULL)
- return -1;
- Py_DECREF(r);
-
- self->prefetched_idx = self->next_read_idx;
- return 0;
-}
-
-static const Py_ssize_t READ_WHOLE_LINE = -1;
-
-/* If reading from a file, we need to only pull the bytes we need, since there
- may be multiple pickle objects arranged contiguously in the same input
- buffer.
-
- If `n` is READ_WHOLE_LINE, read a whole line. Otherwise, read up to `n`
- bytes from the input stream/buffer.
-
- Update the unpickler's input buffer with the newly-read data. Returns -1 on
- failure; on success, returns the number of bytes read from the file.
-
- On success, self->input_len will be 0; this is intentional so that when
- unpickling from a file, the "we've run out of data" code paths will trigger,
- causing the Unpickler to go back to the file for more data. Use the returned
- size to tell you how much data you can process. */
-static Py_ssize_t
-_Unpickler_ReadFromFile(UnpicklerObject *self, Py_ssize_t n)
-{
- PyObject *data;
- Py_ssize_t read_size;
-
- assert(self->read != NULL);
-
- if (_Unpickler_SkipConsumed(self) < 0)
- return -1;
-
- if (n == READ_WHOLE_LINE) {
- data = PyObject_CallNoArgs(self->readline);
- }
- else {
- PyObject *len;
- /* Prefetch some data without advancing the file pointer, if possible */
- if (self->peek && n < PREFETCH) {
- len = PyLong_FromSsize_t(PREFETCH);
- if (len == NULL)
- return -1;
- data = _Pickle_FastCall(self->peek, len);
- if (data == NULL) {
- if (!PyErr_ExceptionMatches(PyExc_NotImplementedError))
- return -1;
- /* peek() is probably not supported by the given file object */
- PyErr_Clear();
- Py_CLEAR(self->peek);
- }
- else {
- read_size = _Unpickler_SetStringInput(self, data);
- Py_DECREF(data);
- self->prefetched_idx = 0;
- if (n <= read_size)
- return n;
- }
- }
- len = PyLong_FromSsize_t(n);
- if (len == NULL)
- return -1;
- data = _Pickle_FastCall(self->read, len);
- }
- if (data == NULL)
- return -1;
-
- read_size = _Unpickler_SetStringInput(self, data);
- Py_DECREF(data);
- return read_size;
-}
-
-/* Don't call it directly: use _Unpickler_Read() */
-static Py_ssize_t
-_Unpickler_ReadImpl(UnpicklerObject *self, PickleState *st, char **s, Py_ssize_t n)
-{
- Py_ssize_t num_read;
-
- *s = NULL;
- if (self->next_read_idx > PY_SSIZE_T_MAX - n) {
- PyErr_SetString(st->UnpicklingError,
- "read would overflow (invalid bytecode)");
- return -1;
- }
-
- /* This case is handled by the _Unpickler_Read() macro for efficiency */
- assert(self->next_read_idx + n > self->input_len);
-
- if (!self->read)
- return bad_readline(st);
-
- /* Extend the buffer to satisfy desired size */
- num_read = _Unpickler_ReadFromFile(self, n);
- if (num_read < 0)
- return -1;
- if (num_read < n)
- return bad_readline(st);
- *s = self->input_buffer;
- self->next_read_idx = n;
- return n;
-}
-
-/* Read `n` bytes from the unpickler's data source, storing the result in `buf`.
- *
- * This should only be used for non-small data reads where potentially
- * avoiding a copy is beneficial. This method does not try to prefetch
- * more data into the input buffer.
- *
- * _Unpickler_Read() is recommended in most cases.
- */
-static Py_ssize_t
-_Unpickler_ReadInto(PickleState *state, UnpicklerObject *self, char *buf,
- Py_ssize_t n)
-{
- assert(n != READ_WHOLE_LINE);
-
- /* Read from available buffer data, if any */
- Py_ssize_t in_buffer = self->input_len - self->next_read_idx;
- if (in_buffer > 0) {
- Py_ssize_t to_read = Py_MIN(in_buffer, n);
- memcpy(buf, self->input_buffer + self->next_read_idx, to_read);
- self->next_read_idx += to_read;
- buf += to_read;
- n -= to_read;
- if (n == 0) {
- /* Entire read was satisfied from buffer */
- return n;
- }
- }
-
- /* Read from file */
- if (!self->read) {
- /* We're unpickling memory, this means the input is truncated */
- return bad_readline(state);
- }
- if (_Unpickler_SkipConsumed(self) < 0) {
- return -1;
- }
-
- if (!self->readinto) {
- /* readinto() not supported on file-like object, fall back to read()
- * and copy into destination buffer (bpo-39681) */
- PyObject* len = PyLong_FromSsize_t(n);
- if (len == NULL) {
- return -1;
- }
- PyObject* data = _Pickle_FastCall(self->read, len);
- if (data == NULL) {
- return -1;
- }
- if (!PyBytes_Check(data)) {
- PyErr_Format(PyExc_ValueError,
- "read() returned non-bytes object (%R)",
- Py_TYPE(data));
- Py_DECREF(data);
- return -1;
- }
- Py_ssize_t read_size = PyBytes_GET_SIZE(data);
- if (read_size < n) {
- Py_DECREF(data);
- return bad_readline(state);
- }
- memcpy(buf, PyBytes_AS_STRING(data), n);
- Py_DECREF(data);
- return n;
- }
-
- /* Call readinto() into user buffer */
- PyObject *buf_obj = PyMemoryView_FromMemory(buf, n, PyBUF_WRITE);
- if (buf_obj == NULL) {
- return -1;
- }
- PyObject *read_size_obj = _Pickle_FastCall(self->readinto, buf_obj);
- if (read_size_obj == NULL) {
- return -1;
- }
- Py_ssize_t read_size = PyLong_AsSsize_t(read_size_obj);
- Py_DECREF(read_size_obj);
-
- if (read_size < 0) {
- if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ValueError,
- "readinto() returned negative size");
- }
- return -1;
- }
- if (read_size < n) {
- return bad_readline(state);
- }
- return n;
-}
-
-/* Read `n` bytes from the unpickler's data source, storing the result in `*s`.
-
- This should be used for all data reads, rather than accessing the unpickler's
- input buffer directly. This method deals correctly with reading from input
- streams, which the input buffer doesn't deal with.
-
- Note that when reading from a file-like object, self->next_read_idx won't
- be updated (it should remain at 0 for the entire unpickling process). You
- should use this function's return value to know how many bytes you can
- consume.
-
- Returns -1 (with an exception set) on failure. On success, return the
- number of chars read. */
-#define _Unpickler_Read(self, state, s, n) \
- (((n) <= (self)->input_len - (self)->next_read_idx) \
- ? (*(s) = (self)->input_buffer + (self)->next_read_idx, \
- (self)->next_read_idx += (n), \
- (n)) \
- : _Unpickler_ReadImpl(self, state, (s), (n)))
-
-static Py_ssize_t
-_Unpickler_CopyLine(UnpicklerObject *self, char *line, Py_ssize_t len,
- char **result)
-{
- char *input_line = PyMem_Realloc(self->input_line, len + 1);
- if (input_line == NULL) {
- PyErr_NoMemory();
- return -1;
- }
-
- memcpy(input_line, line, len);
- input_line[len] = '\0';
- self->input_line = input_line;
- *result = self->input_line;
- return len;
-}
-
-/* Read a line from the input stream/buffer. If we run off the end of the input
- before hitting \n, raise an error.
-
- Returns the number of chars read, or -1 on failure. */
-static Py_ssize_t
-_Unpickler_Readline(PickleState *state, UnpicklerObject *self, char **result)
-{
- Py_ssize_t i, num_read;
-
- for (i = self->next_read_idx; i < self->input_len; i++) {
- if (self->input_buffer[i] == '\n') {
- char *line_start = self->input_buffer + self->next_read_idx;
- num_read = i - self->next_read_idx + 1;
- self->next_read_idx = i + 1;
- return _Unpickler_CopyLine(self, line_start, num_read, result);
- }
- }
- if (!self->read)
- return bad_readline(state);
-
- num_read = _Unpickler_ReadFromFile(self, READ_WHOLE_LINE);
- if (num_read < 0)
- return -1;
- if (num_read == 0 || self->input_buffer[num_read - 1] != '\n')
- return bad_readline(state);
- self->next_read_idx = num_read;
- return _Unpickler_CopyLine(self, self->input_buffer, num_read, result);
-}
-
-/* Returns -1 (with an exception set) on failure, 0 on success. The memo array
- will be modified in place. */
-static int
-_Unpickler_ResizeMemoList(UnpicklerObject *self, size_t new_size)
-{
- size_t i;
-
- assert(new_size > self->memo_size);
-
- PyObject **memo_new = self->memo;
- PyMem_RESIZE(memo_new, PyObject *, new_size);
- if (memo_new == NULL) {
- PyErr_NoMemory();
- return -1;
- }
- self->memo = memo_new;
- for (i = self->memo_size; i < new_size; i++)
- self->memo[i] = NULL;
- self->memo_size = new_size;
- return 0;
-}
-
-/* Returns NULL if idx is out of bounds. */
-static PyObject *
-_Unpickler_MemoGet(UnpicklerObject *self, size_t idx)
-{
- if (idx >= self->memo_size)
- return NULL;
-
- return self->memo[idx];
-}
-
-/* Returns -1 (with an exception set) on failure, 0 on success.
- This takes its own reference to `value`. */
-static int
-_Unpickler_MemoPut(UnpicklerObject *self, size_t idx, PyObject *value)
-{
- PyObject *old_item;
-
- if (idx >= self->memo_size) {
- if (_Unpickler_ResizeMemoList(self, idx * 2) < 0)
- return -1;
- assert(idx < self->memo_size);
- }
- old_item = self->memo[idx];
- self->memo[idx] = Py_NewRef(value);
- if (old_item != NULL) {
- Py_DECREF(old_item);
- }
- else {
- self->memo_len++;
- }
- return 0;
-}
-
-static PyObject **
-_Unpickler_NewMemo(Py_ssize_t new_size)
-{
- PyObject **memo = PyMem_NEW(PyObject *, new_size);
- if (memo == NULL) {
- PyErr_NoMemory();
- return NULL;
- }
- memset(memo, 0, new_size * sizeof(PyObject *));
- return memo;
-}
-
-/* Free the unpickler's memo, taking care to decref any items left in it. */
-static void
-_Unpickler_MemoCleanup(UnpicklerObject *self)
-{
- Py_ssize_t i;
- PyObject **memo = self->memo;
-
- if (self->memo == NULL)
- return;
- self->memo = NULL;
- i = self->memo_size;
- while (--i >= 0) {
- Py_XDECREF(memo[i]);
- }
- PyMem_Free(memo);
-}
-
-static UnpicklerObject *
-_Unpickler_New(PyObject *module)
-{
- const int MEMO_SIZE = 32;
- PyObject **memo = _Unpickler_NewMemo(MEMO_SIZE);
- if (memo == NULL) {
- return NULL;
- }
-
- PickleState *st = _Pickle_GetState(module);
- PyObject *stack = Pdata_New(st);
- if (stack == NULL) {
- goto error;
- }
-
- UnpicklerObject *self = PyObject_GC_New(UnpicklerObject,
- st->Unpickler_Type);
- if (self == NULL) {
- goto error;
- }
-
- self->stack = (Pdata *)stack;
- self->memo = memo;
- self->memo_size = MEMO_SIZE;
- self->memo_len = 0;
- self->pers_func = NULL;
- self->pers_func_self = NULL;
- memset(&self->buffer, 0, sizeof(Py_buffer));
- self->input_buffer = NULL;
- self->input_line = NULL;
- self->input_len = 0;
- self->next_read_idx = 0;
- self->prefetched_idx = 0;
- self->read = NULL;
- self->readinto = NULL;
- self->readline = NULL;
- self->peek = NULL;
- self->buffers = NULL;
- self->encoding = NULL;
- self->errors = NULL;
- self->marks = NULL;
- self->num_marks = 0;
- self->marks_size = 0;
- self->proto = 0;
- self->fix_imports = 0;
-
- PyObject_GC_Track(self);
- return self;
-
-error:
- PyMem_Free(memo);
- Py_XDECREF(stack);
- return NULL;
-}
-
-/* Returns -1 (with an exception set) on failure, 0 on success. This may
- be called once on a freshly created Unpickler. */
-static int
-_Unpickler_SetInputStream(UnpicklerObject *self, PyObject *file)
-{
- /* Optional file methods */
- if (_PyObject_LookupAttr(file, &_Py_ID(peek), &self->peek) < 0) {
- goto error;
- }
- if (_PyObject_LookupAttr(file, &_Py_ID(readinto), &self->readinto) < 0) {
- goto error;
- }
- if (_PyObject_LookupAttr(file, &_Py_ID(read), &self->read) < 0) {
- goto error;
- }
- if (_PyObject_LookupAttr(file, &_Py_ID(readline), &self->readline) < 0) {
- goto error;
- }
- if (!self->readline || !self->read) {
- PyErr_SetString(PyExc_TypeError,
- "file must have 'read' and 'readline' attributes");
- goto error;
- }
- return 0;
-
-error:
- Py_CLEAR(self->read);
- Py_CLEAR(self->readinto);
- Py_CLEAR(self->readline);
- Py_CLEAR(self->peek);
- return -1;
-}
-
-/* Returns -1 (with an exception set) on failure, 0 on success. This may
- be called once on a freshly created Unpickler. */
-static int
-_Unpickler_SetInputEncoding(UnpicklerObject *self,
- const char *encoding,
- const char *errors)
-{
- if (encoding == NULL)
- encoding = "ASCII";
- if (errors == NULL)
- errors = "strict";
-
- self->encoding = _PyMem_Strdup(encoding);
- self->errors = _PyMem_Strdup(errors);
- if (self->encoding == NULL || self->errors == NULL) {
- PyErr_NoMemory();
- return -1;
- }
- return 0;
-}
-
-/* Returns -1 (with an exception set) on failure, 0 on success. This may
- be called once on a freshly created Unpickler. */
-static int
-_Unpickler_SetBuffers(UnpicklerObject *self, PyObject *buffers)
-{
- if (buffers == NULL || buffers == Py_None) {
- self->buffers = NULL;
- }
- else {
- self->buffers = PyObject_GetIter(buffers);
- if (self->buffers == NULL) {
- return -1;
- }
- }
- return 0;
-}
-
-/* Generate a GET opcode for an object stored in the memo. */
-static int
-memo_get(PickleState *st, PicklerObject *self, PyObject *key)
-{
- Py_ssize_t *value;
- char pdata[30];
- Py_ssize_t len;
-
- value = PyMemoTable_Get(self->memo, key);
- if (value == NULL) {
- PyErr_SetObject(PyExc_KeyError, key);
- return -1;
- }
-
- if (!self->bin) {
- pdata[0] = GET;
- PyOS_snprintf(pdata + 1, sizeof(pdata) - 1,
- "%zd\n", *value);
- len = strlen(pdata);
- }
- else {
- if (*value < 256) {
- pdata[0] = BINGET;
- pdata[1] = (unsigned char)(*value & 0xff);
- len = 2;
- }
- else if ((size_t)*value <= 0xffffffffUL) {
- pdata[0] = LONG_BINGET;
- pdata[1] = (unsigned char)(*value & 0xff);
- pdata[2] = (unsigned char)((*value >> 8) & 0xff);
- pdata[3] = (unsigned char)((*value >> 16) & 0xff);
- pdata[4] = (unsigned char)((*value >> 24) & 0xff);
- len = 5;
- }
- else { /* unlikely */
- PyErr_SetString(st->PicklingError,
- "memo id too large for LONG_BINGET");
- return -1;
- }
- }
-
- if (_Pickler_Write(self, pdata, len) < 0)
- return -1;
-
- return 0;
-}
-
-/* Store an object in the memo, assign it a new unique ID based on the number
- of objects currently stored in the memo and generate a PUT opcode. */
-static int
-memo_put(PickleState *st, PicklerObject *self, PyObject *obj)
-{
- char pdata[30];
- Py_ssize_t len;
- Py_ssize_t idx;
-
- const char memoize_op = MEMOIZE;
-
- if (self->fast)
- return 0;
-
- idx = PyMemoTable_Size(self->memo);
- if (PyMemoTable_Set(self->memo, obj, idx) < 0)
- return -1;
-
- if (self->proto >= 4) {
- if (_Pickler_Write(self, &memoize_op, 1) < 0)
- return -1;
- return 0;
- }
- else if (!self->bin) {
- pdata[0] = PUT;
- PyOS_snprintf(pdata + 1, sizeof(pdata) - 1,
- "%zd\n", idx);
- len = strlen(pdata);
- }
- else {
- if (idx < 256) {
- pdata[0] = BINPUT;
- pdata[1] = (unsigned char)idx;
- len = 2;
- }
- else if ((size_t)idx <= 0xffffffffUL) {
- pdata[0] = LONG_BINPUT;
- pdata[1] = (unsigned char)(idx & 0xff);
- pdata[2] = (unsigned char)((idx >> 8) & 0xff);
- pdata[3] = (unsigned char)((idx >> 16) & 0xff);
- pdata[4] = (unsigned char)((idx >> 24) & 0xff);
- len = 5;
- }
- else { /* unlikely */
- PyErr_SetString(st->PicklingError,
- "memo id too large for LONG_BINPUT");
- return -1;
- }
- }
- if (_Pickler_Write(self, pdata, len) < 0)
- return -1;
-
- return 0;
-}
-
-static PyObject *
-get_dotted_path(PyObject *obj, PyObject *name)
-{
- PyObject *dotted_path;
- Py_ssize_t i, n;
- _Py_DECLARE_STR(dot, ".");
- dotted_path = PyUnicode_Split(name, &_Py_STR(dot), -1);
- if (dotted_path == NULL)
- return NULL;
- n = PyList_GET_SIZE(dotted_path);
- assert(n >= 1);
- for (i = 0; i < n; i++) {
- PyObject *subpath = PyList_GET_ITEM(dotted_path, i);
- if (_PyUnicode_EqualToASCIIString(subpath, "<locals>")) {
- if (obj == NULL)
- PyErr_Format(PyExc_AttributeError,
- "Can't pickle local object %R", name);
- else
- PyErr_Format(PyExc_AttributeError,
- "Can't pickle local attribute %R on %R", name, obj);
- Py_DECREF(dotted_path);
- return NULL;
- }
- }
- return dotted_path;
-}
-
-static PyObject *
-get_deep_attribute(PyObject *obj, PyObject *names, PyObject **pparent)
-{
- Py_ssize_t i, n;
- PyObject *parent = NULL;
-
- assert(PyList_CheckExact(names));
- Py_INCREF(obj);
- n = PyList_GET_SIZE(names);
- for (i = 0; i < n; i++) {
- PyObject *name = PyList_GET_ITEM(names, i);
- Py_XSETREF(parent, obj);
- (void)_PyObject_LookupAttr(parent, name, &obj);
- if (obj == NULL) {
- Py_DECREF(parent);
- return NULL;
- }
- }
- if (pparent != NULL)
- *pparent = parent;
- else
- Py_XDECREF(parent);
- return obj;
-}
-
-
-static PyObject *
-getattribute(PyObject *obj, PyObject *name, int allow_qualname)
-{
- PyObject *dotted_path, *attr;
-
- if (allow_qualname) {
- dotted_path = get_dotted_path(obj, name);
- if (dotted_path == NULL)
- return NULL;
- attr = get_deep_attribute(obj, dotted_path, NULL);
- Py_DECREF(dotted_path);
- }
- else {
- (void)_PyObject_LookupAttr(obj, name, &attr);
- }
- if (attr == NULL && !PyErr_Occurred()) {
- PyErr_Format(PyExc_AttributeError,
- "Can't get attribute %R on %R", name, obj);
- }
- return attr;
-}
-
-static int
-_checkmodule(PyObject *module_name, PyObject *module,
- PyObject *global, PyObject *dotted_path)
-{
- if (module == Py_None) {
- return -1;
- }
- if (PyUnicode_Check(module_name) &&
- _PyUnicode_EqualToASCIIString(module_name, "__main__")) {
- return -1;
- }
-
- PyObject *candidate = get_deep_attribute(module, dotted_path, NULL);
- if (candidate == NULL) {
- return -1;
- }
- if (candidate != global) {
- Py_DECREF(candidate);
- return -1;
- }
- Py_DECREF(candidate);
- return 0;
-}
-
-static PyObject *
-whichmodule(PyObject *global, PyObject *dotted_path)
-{
- PyObject *module_name;
- PyObject *module = NULL;
- Py_ssize_t i;
- PyObject *modules;
-
- if (_PyObject_LookupAttr(global, &_Py_ID(__module__), &module_name) < 0) {
- return NULL;
- }
- if (module_name) {
- /* In some rare cases (e.g., bound methods of extension types),
- __module__ can be None. If it is so, then search sys.modules for
- the module of global. */
- if (module_name != Py_None)
- return module_name;
- Py_CLEAR(module_name);
- }
- assert(module_name == NULL);
-
- /* Fallback on walking sys.modules */
- PyThreadState *tstate = _PyThreadState_GET();
- modules = _PySys_GetAttr(tstate, &_Py_ID(modules));
- if (modules == NULL) {
- PyErr_SetString(PyExc_RuntimeError, "unable to get sys.modules");
- return NULL;
- }
- if (PyDict_CheckExact(modules)) {
- i = 0;
- while (PyDict_Next(modules, &i, &module_name, &module)) {
- if (_checkmodule(module_name, module, global, dotted_path) == 0) {
- return Py_NewRef(module_name);
- }
- if (PyErr_Occurred()) {
- return NULL;
- }
- }
- }
- else {
- PyObject *iterator = PyObject_GetIter(modules);
- if (iterator == NULL) {
- return NULL;
- }
- while ((module_name = PyIter_Next(iterator))) {
- module = PyObject_GetItem(modules, module_name);
- if (module == NULL) {
- Py_DECREF(module_name);
- Py_DECREF(iterator);
- return NULL;
- }
- if (_checkmodule(module_name, module, global, dotted_path) == 0) {
- Py_DECREF(module);
- Py_DECREF(iterator);
- return module_name;
- }
- Py_DECREF(module);
- Py_DECREF(module_name);
- if (PyErr_Occurred()) {
- Py_DECREF(iterator);
- return NULL;
- }
- }
- Py_DECREF(iterator);
- }
-
- /* If no module is found, use __main__. */
- module_name = &_Py_ID(__main__);
- return Py_NewRef(module_name);
-}
-
-/* fast_save_enter() and fast_save_leave() are guards against recursive
- objects when Pickler is used with the "fast mode" (i.e., with object
- memoization disabled). If the nesting of a list or dict object exceed
- FAST_NESTING_LIMIT, these guards will start keeping an internal
- reference to the seen list or dict objects and check whether these objects
- are recursive. These are not strictly necessary, since save() has a
- hard-coded recursion limit, but they give a nicer error message than the
- typical RuntimeError. */
-static int
-fast_save_enter(PicklerObject *self, PyObject *obj)
-{
- /* if fast_nesting < 0, we're doing an error exit. */
- if (++self->fast_nesting >= FAST_NESTING_LIMIT) {
- PyObject *key = NULL;
- if (self->fast_memo == NULL) {
- self->fast_memo = PyDict_New();
- if (self->fast_memo == NULL) {
- self->fast_nesting = -1;
- return 0;
- }
- }
- key = PyLong_FromVoidPtr(obj);
- if (key == NULL) {
- self->fast_nesting = -1;
- return 0;
- }
- int r = PyDict_Contains(self->fast_memo, key);
- if (r > 0) {
- PyErr_Format(PyExc_ValueError,
- "fast mode: can't pickle cyclic objects "
- "including object type %.200s at %p",
- Py_TYPE(obj)->tp_name, obj);
- }
- else if (r == 0) {
- r = PyDict_SetItem(self->fast_memo, key, Py_None);
- }
- Py_DECREF(key);
- if (r != 0) {
- self->fast_nesting = -1;
- return 0;
- }
- }
- return 1;
-}
-
-static int
-fast_save_leave(PicklerObject *self, PyObject *obj)
-{
- if (self->fast_nesting-- >= FAST_NESTING_LIMIT) {
- PyObject *key = PyLong_FromVoidPtr(obj);
- if (key == NULL)
- return 0;
- if (PyDict_DelItem(self->fast_memo, key) < 0) {
- Py_DECREF(key);
- return 0;
- }
- Py_DECREF(key);
- }
- return 1;
-}
-
-static int
-save_none(PicklerObject *self, PyObject *obj)
-{
- const char none_op = NONE;
- if (_Pickler_Write(self, &none_op, 1) < 0)
- return -1;
-
- return 0;
-}
-
-static int
-save_bool(PicklerObject *self, PyObject *obj)
-{
- if (self->proto >= 2) {
- const char bool_op = (obj == Py_True) ? NEWTRUE : NEWFALSE;
- if (_Pickler_Write(self, &bool_op, 1) < 0)
- return -1;
- }
- else {
- /* These aren't opcodes -- they're ways to pickle bools before protocol 2
- * so that unpicklers written before bools were introduced unpickle them
- * as ints, but unpicklers after can recognize that bools were intended.
- * Note that protocol 2 added direct ways to pickle bools.
- */
- const char *bool_str = (obj == Py_True) ? "I01\n" : "I00\n";
- if (_Pickler_Write(self, bool_str, strlen(bool_str)) < 0)
- return -1;
- }
- return 0;
-}
-
-static int
-save_long(PicklerObject *self, PyObject *obj)
-{
- PyObject *repr = NULL;
- Py_ssize_t size;
- long val;
- int overflow;
- int status = 0;
-
- val= PyLong_AsLongAndOverflow(obj, &overflow);
- if (!overflow && (sizeof(long) <= 4 ||
- (val <= 0x7fffffffL && val >= (-0x7fffffffL - 1))))
- {
- /* result fits in a signed 4-byte integer.
-
- Note: we can't use -0x80000000L in the above condition because some
- compilers (e.g., MSVC) will promote 0x80000000L to an unsigned type
- before applying the unary minus when sizeof(long) <= 4. The
- resulting value stays unsigned which is commonly not what we want,
- so MSVC happily warns us about it. However, that result would have
- been fine because we guard for sizeof(long) <= 4 which turns the
- condition true in that particular case. */
- char pdata[32];
- Py_ssize_t len = 0;
-
- if (self->bin) {
- pdata[1] = (unsigned char)(val & 0xff);
- pdata[2] = (unsigned char)((val >> 8) & 0xff);
- pdata[3] = (unsigned char)((val >> 16) & 0xff);
- pdata[4] = (unsigned char)((val >> 24) & 0xff);
-
- if ((pdata[4] != 0) || (pdata[3] != 0)) {
- pdata[0] = BININT;
- len = 5;
- }
- else if (pdata[2] != 0) {
- pdata[0] = BININT2;
- len = 3;
- }
- else {
- pdata[0] = BININT1;
- len = 2;
- }
- }
- else {
- sprintf(pdata, "%c%ld\n", INT_, val);
- len = strlen(pdata);
- }
- if (_Pickler_Write(self, pdata, len) < 0)
- return -1;
-
- return 0;
- }
- assert(!PyErr_Occurred());
-
- if (self->proto >= 2) {
- /* Linear-time pickling. */
- size_t nbits;
- size_t nbytes;
- unsigned char *pdata;
- char header[5];
- int i;
- int sign = _PyLong_Sign(obj);
-
- if (sign == 0) {
- header[0] = LONG1;
- header[1] = 0; /* It's 0 -- an empty bytestring. */
- if (_Pickler_Write(self, header, 2) < 0)
- goto error;
- return 0;
- }
- nbits = _PyLong_NumBits(obj);
- if (nbits == (size_t)-1 && PyErr_Occurred())
- goto error;
- /* How many bytes do we need? There are nbits >> 3 full
- * bytes of data, and nbits & 7 leftover bits. If there
- * are any leftover bits, then we clearly need another
- * byte. What's not so obvious is that we *probably*
- * need another byte even if there aren't any leftovers:
- * the most-significant bit of the most-significant byte
- * acts like a sign bit, and it's usually got a sense
- * opposite of the one we need. The exception is ints
- * of the form -(2**(8*j-1)) for j > 0. Such an int is
- * its own 256's-complement, so has the right sign bit
- * even without the extra byte. That's a pain to check
- * for in advance, though, so we always grab an extra
- * byte at the start, and cut it back later if possible.
- */
- nbytes = (nbits >> 3) + 1;
- if (nbytes > 0x7fffffffL) {
- PyErr_SetString(PyExc_OverflowError,
- "int too large to pickle");
- goto error;
- }
- repr = PyBytes_FromStringAndSize(NULL, (Py_ssize_t)nbytes);
- if (repr == NULL)
- goto error;
- pdata = (unsigned char *)PyBytes_AS_STRING(repr);
- i = _PyLong_AsByteArray((PyLongObject *)obj,
- pdata, nbytes,
- 1 /* little endian */ , 1 /* signed */ );
- if (i < 0)
- goto error;
- /* If the int is negative, this may be a byte more than
- * needed. This is so iff the MSB is all redundant sign
- * bits.
- */
- if (sign < 0 &&
- nbytes > 1 &&
- pdata[nbytes - 1] == 0xff &&
- (pdata[nbytes - 2] & 0x80) != 0) {
- nbytes--;
- }
-
- if (nbytes < 256) {
- header[0] = LONG1;
- header[1] = (unsigned char)nbytes;
- size = 2;
- }
- else {
- header[0] = LONG4;
- size = (Py_ssize_t) nbytes;
- for (i = 1; i < 5; i++) {
- header[i] = (unsigned char)(size & 0xff);
- size >>= 8;
- }
- size = 5;
- }
- if (_Pickler_Write(self, header, size) < 0 ||
- _Pickler_Write(self, (char *)pdata, (int)nbytes) < 0)
- goto error;
- }
- else {
- const char long_op = LONG_;
- const char *string;
-
- /* proto < 2: write the repr and newline. This is quadratic-time (in
- the number of digits), in both directions. We add a trailing 'L'
- to the repr, for compatibility with Python 2.x. */
-
- repr = PyObject_Repr(obj);
- if (repr == NULL)
- goto error;
-
- string = PyUnicode_AsUTF8AndSize(repr, &size);
- if (string == NULL)
- goto error;
-
- if (_Pickler_Write(self, &long_op, 1) < 0 ||
- _Pickler_Write(self, string, size) < 0 ||
- _Pickler_Write(self, "L\n", 2) < 0)
- goto error;
- }
-
- if (0) {
- error:
- status = -1;
- }
- Py_XDECREF(repr);
-
- return status;
-}
-
-static int
-save_float(PicklerObject *self, PyObject *obj)
-{
- double x = PyFloat_AS_DOUBLE((PyFloatObject *)obj);
-
- if (self->bin) {
- char pdata[9];
- pdata[0] = BINFLOAT;
- if (PyFloat_Pack8(x, &pdata[1], 0) < 0)
- return -1;
- if (_Pickler_Write(self, pdata, 9) < 0)
- return -1;
- }
- else {
- int result = -1;
- char *buf = NULL;
- char op = FLOAT_;
-
- if (_Pickler_Write(self, &op, 1) < 0)
- goto done;
-
- buf = PyOS_double_to_string(x, 'r', 0, Py_DTSF_ADD_DOT_0, NULL);
- if (!buf) {
- PyErr_NoMemory();
- goto done;
- }
-
- if (_Pickler_Write(self, buf, strlen(buf)) < 0)
- goto done;
-
- if (_Pickler_Write(self, "\n", 1) < 0)
- goto done;
-
- result = 0;
-done:
- PyMem_Free(buf);
- return result;
- }
-
- return 0;
-}
-
-/* Perform direct write of the header and payload of the binary object.
-
- The large contiguous data is written directly into the underlying file
- object, bypassing the output_buffer of the Pickler. We intentionally
- do not insert a protocol 4 frame opcode to make it possible to optimize
- file.read calls in the loader.
- */
-static int
-_Pickler_write_bytes(PicklerObject *self,
- const char *header, Py_ssize_t header_size,
- const char *data, Py_ssize_t data_size,
- PyObject *payload)
-{
- int bypass_buffer = (data_size >= FRAME_SIZE_TARGET);
- int framing = self->framing;
-
- if (bypass_buffer) {
- assert(self->output_buffer != NULL);
- /* Commit the previous frame. */
- if (_Pickler_CommitFrame(self)) {
- return -1;
- }
- /* Disable framing temporarily */
- self->framing = 0;
- }
-
- if (_Pickler_Write(self, header, header_size) < 0) {
- return -1;
- }
-
- if (bypass_buffer && self->write != NULL) {
- /* Bypass the in-memory buffer to directly stream large data
- into the underlying file object. */
- PyObject *result, *mem = NULL;
- /* Dump the output buffer to the file. */
- if (_Pickler_FlushToFile(self) < 0) {
- return -1;
- }
-
- /* Stream write the payload into the file without going through the
- output buffer. */
- if (payload == NULL) {
- /* TODO: It would be better to use a memoryview with a linked
- original string if this is possible. */
- payload = mem = PyBytes_FromStringAndSize(data, data_size);
- if (payload == NULL) {
- return -1;
- }
- }
- result = PyObject_CallOneArg(self->write, payload);
- Py_XDECREF(mem);
- if (result == NULL) {
- return -1;
- }
- Py_DECREF(result);
-
- /* Reinitialize the buffer for subsequent calls to _Pickler_Write. */
- if (_Pickler_ClearBuffer(self) < 0) {
- return -1;
- }
- }
- else {
- if (_Pickler_Write(self, data, data_size) < 0) {
- return -1;
- }
- }
-
- /* Re-enable framing for subsequent calls to _Pickler_Write. */
- self->framing = framing;
-
- return 0;
-}
-
-static int
-_save_bytes_data(PickleState *st, PicklerObject *self, PyObject *obj,
- const char *data, Py_ssize_t size)
-{
- assert(self->proto >= 3);
-
- char header[9];
- Py_ssize_t len;
-
- if (size < 0)
- return -1;
-
- if (size <= 0xff) {
- header[0] = SHORT_BINBYTES;
- header[1] = (unsigned char)size;
- len = 2;
- }
- else if ((size_t)size <= 0xffffffffUL) {
- header[0] = BINBYTES;
- header[1] = (unsigned char)(size & 0xff);
- header[2] = (unsigned char)((size >> 8) & 0xff);
- header[3] = (unsigned char)((size >> 16) & 0xff);
- header[4] = (unsigned char)((size >> 24) & 0xff);
- len = 5;
- }
- else if (self->proto >= 4) {
- header[0] = BINBYTES8;
- _write_size64(header + 1, size);
- len = 9;
- }
- else {
- PyErr_SetString(PyExc_OverflowError,
- "serializing a bytes object larger than 4 GiB "
- "requires pickle protocol 4 or higher");
- return -1;
- }
-
- if (_Pickler_write_bytes(self, header, len, data, size, obj) < 0) {
- return -1;
- }
-
- if (memo_put(st, self, obj) < 0) {
- return -1;
- }
-
- return 0;
-}
-
-static int
-save_bytes(PickleState *st, PicklerObject *self, PyObject *obj)
-{
- if (self->proto < 3) {
- /* Older pickle protocols do not have an opcode for pickling bytes
- objects. Therefore, we need to fake the copy protocol (i.e.,
- the __reduce__ method) to permit bytes object unpickling.
-
- Here we use a hack to be compatible with Python 2. Since in Python
- 2 'bytes' is just an alias for 'str' (which has different
- parameters than the actual bytes object), we use codecs.encode
- to create the appropriate 'str' object when unpickled using
- Python 2 *and* the appropriate 'bytes' object when unpickled
- using Python 3. Again this is a hack and we don't need to do this
- with newer protocols. */
- PyObject *reduce_value;
- int status;
-
- if (PyBytes_GET_SIZE(obj) == 0) {
- reduce_value = Py_BuildValue("(O())", (PyObject*)&PyBytes_Type);
- }
- else {
- PyObject *unicode_str =
- PyUnicode_DecodeLatin1(PyBytes_AS_STRING(obj),
- PyBytes_GET_SIZE(obj),
- "strict");
-
- if (unicode_str == NULL)
- return -1;
- reduce_value = Py_BuildValue("(O(OO))",
- st->codecs_encode, unicode_str,
- &_Py_ID(latin1));
- Py_DECREF(unicode_str);
- }
-
- if (reduce_value == NULL)
- return -1;
-
- /* save_reduce() will memoize the object automatically. */
- status = save_reduce(st, self, reduce_value, obj);
- Py_DECREF(reduce_value);
- return status;
- }
- else {
- return _save_bytes_data(st, self, obj, PyBytes_AS_STRING(obj),
- PyBytes_GET_SIZE(obj));
- }
-}
-
-static int
-_save_bytearray_data(PickleState *state, PicklerObject *self, PyObject *obj,
- const char *data, Py_ssize_t size)
-{
- assert(self->proto >= 5);
-
- char header[9];
- Py_ssize_t len;
-
- if (size < 0)
- return -1;
-
- header[0] = BYTEARRAY8;
- _write_size64(header + 1, size);
- len = 9;
-
- if (_Pickler_write_bytes(self, header, len, data, size, obj) < 0) {
- return -1;
- }
-
- if (memo_put(state, self, obj) < 0) {
- return -1;
- }
-
- return 0;
-}
-
-static int
-save_bytearray(PickleState *state, PicklerObject *self, PyObject *obj)
-{
- if (self->proto < 5) {
- /* Older pickle protocols do not have an opcode for pickling
- * bytearrays. */
- PyObject *reduce_value = NULL;
- int status;
-
- if (PyByteArray_GET_SIZE(obj) == 0) {
- reduce_value = Py_BuildValue("(O())",
- (PyObject *) &PyByteArray_Type);
- }
- else {
- PyObject *bytes_obj = PyBytes_FromObject(obj);
- if (bytes_obj != NULL) {
- reduce_value = Py_BuildValue("(O(O))",
- (PyObject *) &PyByteArray_Type,
- bytes_obj);
- Py_DECREF(bytes_obj);
- }
- }
- if (reduce_value == NULL)
- return -1;
-
- /* save_reduce() will memoize the object automatically. */
- status = save_reduce(state, self, reduce_value, obj);
- Py_DECREF(reduce_value);
- return status;
- }
- else {
- return _save_bytearray_data(state, self, obj,
- PyByteArray_AS_STRING(obj),
- PyByteArray_GET_SIZE(obj));
- }
-}
-
-static int
-save_picklebuffer(PickleState *st, PicklerObject *self, PyObject *obj)
-{
- if (self->proto < 5) {
- PyErr_SetString(st->PicklingError,
- "PickleBuffer can only pickled with protocol >= 5");
- return -1;
- }
- const Py_buffer* view = PyPickleBuffer_GetBuffer(obj);
- if (view == NULL) {
- return -1;
- }
- if (view->suboffsets != NULL || !PyBuffer_IsContiguous(view, 'A')) {
- PyErr_SetString(st->PicklingError,
- "PickleBuffer can not be pickled when "
- "pointing to a non-contiguous buffer");
- return -1;
- }
- int in_band = 1;
- if (self->buffer_callback != NULL) {
- PyObject *ret = PyObject_CallOneArg(self->buffer_callback, obj);
- if (ret == NULL) {
- return -1;
- }
- in_band = PyObject_IsTrue(ret);
- Py_DECREF(ret);
- if (in_band == -1) {
- return -1;
- }
- }
- if (in_band) {
- /* Write data in-band */
- if (view->readonly) {
- return _save_bytes_data(st, self, obj, (const char *)view->buf,
- view->len);
- }
- else {
- return _save_bytearray_data(st, self, obj, (const char *)view->buf,
- view->len);
- }
- }
- else {
- /* Write data out-of-band */
- const char next_buffer_op = NEXT_BUFFER;
- if (_Pickler_Write(self, &next_buffer_op, 1) < 0) {
- return -1;
- }
- if (view->readonly) {
- const char readonly_buffer_op = READONLY_BUFFER;
- if (_Pickler_Write(self, &readonly_buffer_op, 1) < 0) {
- return -1;
- }
- }
- }
- return 0;
-}
-
-/* A copy of PyUnicode_AsRawUnicodeEscapeString() that also translates
- backslash and newline characters to \uXXXX escapes. */
-static PyObject *
-raw_unicode_escape(PyObject *obj)
-{
- char *p;
- Py_ssize_t i, size;
- const void *data;
- int kind;
- _PyBytesWriter writer;
-
- if (PyUnicode_READY(obj))
- return NULL;
-
- _PyBytesWriter_Init(&writer);
-
- size = PyUnicode_GET_LENGTH(obj);
- data = PyUnicode_DATA(obj);
- kind = PyUnicode_KIND(obj);
-
- p = _PyBytesWriter_Alloc(&writer, size);
- if (p == NULL)
- goto error;
- writer.overallocate = 1;
-
- for (i=0; i < size; i++) {
- Py_UCS4 ch = PyUnicode_READ(kind, data, i);
- /* Map 32-bit characters to '\Uxxxxxxxx' */
- if (ch >= 0x10000) {
- /* -1: subtract 1 preallocated byte */
- p = _PyBytesWriter_Prepare(&writer, p, 10-1);
- if (p == NULL)
- goto error;
-
- *p++ = '\\';
- *p++ = 'U';
- *p++ = Py_hexdigits[(ch >> 28) & 0xf];
- *p++ = Py_hexdigits[(ch >> 24) & 0xf];
- *p++ = Py_hexdigits[(ch >> 20) & 0xf];
- *p++ = Py_hexdigits[(ch >> 16) & 0xf];
- *p++ = Py_hexdigits[(ch >> 12) & 0xf];
- *p++ = Py_hexdigits[(ch >> 8) & 0xf];
- *p++ = Py_hexdigits[(ch >> 4) & 0xf];
- *p++ = Py_hexdigits[ch & 15];
- }
- /* Map 16-bit characters, '\\' and '\n' to '\uxxxx' */
- else if (ch >= 256 ||
- ch == '\\' || ch == 0 || ch == '\n' || ch == '\r' ||
- ch == 0x1a)
- {
- /* -1: subtract 1 preallocated byte */
- p = _PyBytesWriter_Prepare(&writer, p, 6-1);
- if (p == NULL)
- goto error;
-
- *p++ = '\\';
- *p++ = 'u';
- *p++ = Py_hexdigits[(ch >> 12) & 0xf];
- *p++ = Py_hexdigits[(ch >> 8) & 0xf];
- *p++ = Py_hexdigits[(ch >> 4) & 0xf];
- *p++ = Py_hexdigits[ch & 15];
- }
- /* Copy everything else as-is */
- else
- *p++ = (char) ch;
- }
-
- return _PyBytesWriter_Finish(&writer, p);
-
-error:
- _PyBytesWriter_Dealloc(&writer);
- return NULL;
-}
-
-static int
-write_unicode_binary(PicklerObject *self, PyObject *obj)
-{
- char header[9];
- Py_ssize_t len;
- PyObject *encoded = NULL;
- Py_ssize_t size;
- const char *data;
-
- if (PyUnicode_READY(obj))
- return -1;
-
- data = PyUnicode_AsUTF8AndSize(obj, &size);
- if (data == NULL) {
- /* Issue #8383: for strings with lone surrogates, fallback on the
- "surrogatepass" error handler. */
- PyErr_Clear();
- encoded = PyUnicode_AsEncodedString(obj, "utf-8", "surrogatepass");
- if (encoded == NULL)
- return -1;
-
- data = PyBytes_AS_STRING(encoded);
- size = PyBytes_GET_SIZE(encoded);
- }
-
- assert(size >= 0);
- if (size <= 0xff && self->proto >= 4) {
- header[0] = SHORT_BINUNICODE;
- header[1] = (unsigned char)(size & 0xff);
- len = 2;
- }
- else if ((size_t)size <= 0xffffffffUL) {
- header[0] = BINUNICODE;
- header[1] = (unsigned char)(size & 0xff);
- header[2] = (unsigned char)((size >> 8) & 0xff);
- header[3] = (unsigned char)((size >> 16) & 0xff);
- header[4] = (unsigned char)((size >> 24) & 0xff);
- len = 5;
- }
- else if (self->proto >= 4) {
- header[0] = BINUNICODE8;
- _write_size64(header + 1, size);
- len = 9;
- }
- else {
- PyErr_SetString(PyExc_OverflowError,
- "serializing a string larger than 4 GiB "
- "requires pickle protocol 4 or higher");
- Py_XDECREF(encoded);
- return -1;
- }
-
- if (_Pickler_write_bytes(self, header, len, data, size, encoded) < 0) {
- Py_XDECREF(encoded);
- return -1;
- }
- Py_XDECREF(encoded);
- return 0;
-}
-
-static int
-save_unicode(PickleState *state, PicklerObject *self, PyObject *obj)
-{
- if (self->bin) {
- if (write_unicode_binary(self, obj) < 0)
- return -1;
- }
- else {
- PyObject *encoded;
- Py_ssize_t size;
- const char unicode_op = UNICODE;
-
- encoded = raw_unicode_escape(obj);
- if (encoded == NULL)
- return -1;
-
- if (_Pickler_Write(self, &unicode_op, 1) < 0) {
- Py_DECREF(encoded);
- return -1;
- }
-
- size = PyBytes_GET_SIZE(encoded);
- if (_Pickler_Write(self, PyBytes_AS_STRING(encoded), size) < 0) {
- Py_DECREF(encoded);
- return -1;
- }
- Py_DECREF(encoded);
-
- if (_Pickler_Write(self, "\n", 1) < 0)
- return -1;
- }
- if (memo_put(state, self, obj) < 0)
- return -1;
-
- return 0;
-}
-
-/* A helper for save_tuple. Push the len elements in tuple t on the stack. */
-static int
-store_tuple_elements(PickleState *state, PicklerObject *self, PyObject *t,
- Py_ssize_t len)
-{
- Py_ssize_t i;
-
- assert(PyTuple_Size(t) == len);
-
- for (i = 0; i < len; i++) {
- PyObject *element = PyTuple_GET_ITEM(t, i);
-
- if (element == NULL)
- return -1;
- if (save(state, self, element, 0) < 0)
- return -1;
- }
-
- return 0;
-}
-
-/* Tuples are ubiquitous in the pickle protocols, so many techniques are
- * used across protocols to minimize the space needed to pickle them.
- * Tuples are also the only builtin immutable type that can be recursive
- * (a tuple can be reached from itself), and that requires some subtle
- * magic so that it works in all cases. IOW, this is a long routine.
- */
-static int
-save_tuple(PickleState *state, PicklerObject *self, PyObject *obj)
-{
- Py_ssize_t len, i;
-
- const char mark_op = MARK;
- const char tuple_op = TUPLE;
- const char pop_op = POP;
- const char pop_mark_op = POP_MARK;
- const char len2opcode[] = {EMPTY_TUPLE, TUPLE1, TUPLE2, TUPLE3};
-
- if ((len = PyTuple_Size(obj)) < 0)
- return -1;
-
- if (len == 0) {
- char pdata[2];
-
- if (self->proto) {
- pdata[0] = EMPTY_TUPLE;
- len = 1;
- }
- else {
- pdata[0] = MARK;
- pdata[1] = TUPLE;
- len = 2;
- }
- if (_Pickler_Write(self, pdata, len) < 0)
- return -1;
- return 0;
- }
-
- /* The tuple isn't in the memo now. If it shows up there after
- * saving the tuple elements, the tuple must be recursive, in
- * which case we'll pop everything we put on the stack, and fetch
- * its value from the memo.
- */
- if (len <= 3 && self->proto >= 2) {
- /* Use TUPLE{1,2,3} opcodes. */
- if (store_tuple_elements(state, self, obj, len) < 0)
- return -1;
-
- if (PyMemoTable_Get(self->memo, obj)) {
- /* pop the len elements */
- for (i = 0; i < len; i++)
- if (_Pickler_Write(self, &pop_op, 1) < 0)
- return -1;
- /* fetch from memo */
- if (memo_get(state, self, obj) < 0)
- return -1;
-
- return 0;
- }
- else { /* Not recursive. */
- if (_Pickler_Write(self, len2opcode + len, 1) < 0)
- return -1;
- }
- goto memoize;
- }
-
- /* proto < 2 and len > 0, or proto >= 2 and len > 3.
- * Generate MARK e1 e2 ... TUPLE
- */
- if (_Pickler_Write(self, &mark_op, 1) < 0)
- return -1;
-
- if (store_tuple_elements(state, self, obj, len) < 0)
- return -1;
-
- if (PyMemoTable_Get(self->memo, obj)) {
- /* pop the stack stuff we pushed */
- if (self->bin) {
- if (_Pickler_Write(self, &pop_mark_op, 1) < 0)
- return -1;
- }
- else {
- /* Note that we pop one more than len, to remove
- * the MARK too.
- */
- for (i = 0; i <= len; i++)
- if (_Pickler_Write(self, &pop_op, 1) < 0)
- return -1;
- }
- /* fetch from memo */
- if (memo_get(state, self, obj) < 0)
- return -1;
-
- return 0;
- }
- else { /* Not recursive. */
- if (_Pickler_Write(self, &tuple_op, 1) < 0)
- return -1;
- }
-
- memoize:
- if (memo_put(state, self, obj) < 0)
- return -1;
-
- return 0;
-}
-
-/* iter is an iterator giving items, and we batch up chunks of
- * MARK item item ... item APPENDS
- * opcode sequences. Calling code should have arranged to first create an
- * empty list, or list-like object, for the APPENDS to operate on.
- * Returns 0 on success, <0 on error.
- */
-static int
-batch_list(PickleState *state, PicklerObject *self, PyObject *iter)
-{
- PyObject *obj = NULL;
- PyObject *firstitem = NULL;
- int i, n;
-
- const char mark_op = MARK;
- const char append_op = APPEND;
- const char appends_op = APPENDS;
-
- assert(iter != NULL);
-
- /* XXX: I think this function could be made faster by avoiding the
- iterator interface and fetching objects directly from list using
- PyList_GET_ITEM.
- */
-
- if (self->proto == 0) {
- /* APPENDS isn't available; do one at a time. */
- for (;;) {
- obj = PyIter_Next(iter);
- if (obj == NULL) {
- if (PyErr_Occurred())
- return -1;
- break;
- }
- i = save(state, self, obj, 0);
- Py_DECREF(obj);
- if (i < 0)
- return -1;
- if (_Pickler_Write(self, &append_op, 1) < 0)
- return -1;
- }
- return 0;
- }
-
- /* proto > 0: write in batches of BATCHSIZE. */
- do {
- /* Get first item */
- firstitem = PyIter_Next(iter);
- if (firstitem == NULL) {
- if (PyErr_Occurred())
- goto error;
-
- /* nothing more to add */
- break;
- }
-
- /* Try to get a second item */
- obj = PyIter_Next(iter);
- if (obj == NULL) {
- if (PyErr_Occurred())
- goto error;
-
- /* Only one item to write */
- if (save(state, self, firstitem, 0) < 0)
- goto error;
- if (_Pickler_Write(self, &append_op, 1) < 0)
- goto error;
- Py_CLEAR(firstitem);
- break;
- }
-
- /* More than one item to write */
-
- /* Pump out MARK, items, APPENDS. */
- if (_Pickler_Write(self, &mark_op, 1) < 0)
- goto error;
-
- if (save(state, self, firstitem, 0) < 0)
- goto error;
- Py_CLEAR(firstitem);
- n = 1;
-
- /* Fetch and save up to BATCHSIZE items */
- while (obj) {
- if (save(state, self, obj, 0) < 0)
- goto error;
- Py_CLEAR(obj);
- n += 1;
-
- if (n == BATCHSIZE)
- break;
-
- obj = PyIter_Next(iter);
- if (obj == NULL) {
- if (PyErr_Occurred())
- goto error;
- break;
- }
- }
-
- if (_Pickler_Write(self, &appends_op, 1) < 0)
- goto error;
-
- } while (n == BATCHSIZE);
- return 0;
-
- error:
- Py_XDECREF(firstitem);
- Py_XDECREF(obj);
- return -1;
-}
-
-/* This is a variant of batch_list() above, specialized for lists (with no
- * support for list subclasses). Like batch_list(), we batch up chunks of
- * MARK item item ... item APPENDS
- * opcode sequences. Calling code should have arranged to first create an
- * empty list, or list-like object, for the APPENDS to operate on.
- * Returns 0 on success, -1 on error.
- *
- * This version is considerably faster than batch_list(), if less general.
- *
- * Note that this only works for protocols > 0.
- */
-static int
-batch_list_exact(PickleState *state, PicklerObject *self, PyObject *obj)
-{
- PyObject *item = NULL;
- Py_ssize_t this_batch, total;
-
- const char append_op = APPEND;
- const char appends_op = APPENDS;
- const char mark_op = MARK;
-
- assert(obj != NULL);
- assert(self->proto > 0);
- assert(PyList_CheckExact(obj));
-
- if (PyList_GET_SIZE(obj) == 1) {
- item = PyList_GET_ITEM(obj, 0);
- Py_INCREF(item);
- int err = save(state, self, item, 0);
- Py_DECREF(item);
- if (err < 0)
- return -1;
- if (_Pickler_Write(self, &append_op, 1) < 0)
- return -1;
- return 0;
- }
-
- /* Write in batches of BATCHSIZE. */
- total = 0;
- do {
- this_batch = 0;
- if (_Pickler_Write(self, &mark_op, 1) < 0)
- return -1;
- while (total < PyList_GET_SIZE(obj)) {
- item = PyList_GET_ITEM(obj, total);
- Py_INCREF(item);
- int err = save(state, self, item, 0);
- Py_DECREF(item);
- if (err < 0)
- return -1;
- total++;
- if (++this_batch == BATCHSIZE)
- break;
- }
- if (_Pickler_Write(self, &appends_op, 1) < 0)
- return -1;
-
- } while (total < PyList_GET_SIZE(obj));
-
- return 0;
-}
-
-static int
-save_list(PickleState *state, PicklerObject *self, PyObject *obj)
-{
- char header[3];
- Py_ssize_t len;
- int status = 0;
-
- if (self->fast && !fast_save_enter(self, obj))
- goto error;
-
- /* Create an empty list. */
- if (self->bin) {
- header[0] = EMPTY_LIST;
- len = 1;
- }
- else {
- header[0] = MARK;
- header[1] = LIST;
- len = 2;
- }
-
- if (_Pickler_Write(self, header, len) < 0)
- goto error;
-
- /* Get list length, and bow out early if empty. */
- if ((len = PyList_Size(obj)) < 0)
- goto error;
-
- if (memo_put(state, self, obj) < 0)
- goto error;
-
- if (len != 0) {
- /* Materialize the list elements. */
- if (PyList_CheckExact(obj) && self->proto > 0) {
- if (_Py_EnterRecursiveCall(" while pickling an object"))
- goto error;
- status = batch_list_exact(state, self, obj);
- _Py_LeaveRecursiveCall();
- } else {
- PyObject *iter = PyObject_GetIter(obj);
- if (iter == NULL)
- goto error;
-
- if (_Py_EnterRecursiveCall(" while pickling an object")) {
- Py_DECREF(iter);
- goto error;
- }
- status = batch_list(state, self, iter);
- _Py_LeaveRecursiveCall();
- Py_DECREF(iter);
- }
- }
- if (0) {
- error:
- status = -1;
- }
-
- if (self->fast && !fast_save_leave(self, obj))
- status = -1;
-
- return status;
-}
-
-/* iter is an iterator giving (key, value) pairs, and we batch up chunks of
- * MARK key value ... key value SETITEMS
- * opcode sequences. Calling code should have arranged to first create an
- * empty dict, or dict-like object, for the SETITEMS to operate on.
- * Returns 0 on success, <0 on error.
- *
- * This is very much like batch_list(). The difference between saving
- * elements directly, and picking apart two-tuples, is so long-winded at
- * the C level, though, that attempts to combine these routines were too
- * ugly to bear.
- */
-static int
-batch_dict(PickleState *state, PicklerObject *self, PyObject *iter)
-{
- PyObject *obj = NULL;
- PyObject *firstitem = NULL;
- int i, n;
-
- const char mark_op = MARK;
- const char setitem_op = SETITEM;
- const char setitems_op = SETITEMS;
-
- assert(iter != NULL);
-
- if (self->proto == 0) {
- /* SETITEMS isn't available; do one at a time. */
- for (;;) {
- obj = PyIter_Next(iter);
- if (obj == NULL) {
- if (PyErr_Occurred())
- return -1;
- break;
- }
- if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 2) {
- PyErr_SetString(PyExc_TypeError, "dict items "
- "iterator must return 2-tuples");
- return -1;
- }
- i = save(state, self, PyTuple_GET_ITEM(obj, 0), 0);
- if (i >= 0)
- i = save(state, self, PyTuple_GET_ITEM(obj, 1), 0);
- Py_DECREF(obj);
- if (i < 0)
- return -1;
- if (_Pickler_Write(self, &setitem_op, 1) < 0)
- return -1;
- }
- return 0;
- }
-
- /* proto > 0: write in batches of BATCHSIZE. */
- do {
- /* Get first item */
- firstitem = PyIter_Next(iter);
- if (firstitem == NULL) {
- if (PyErr_Occurred())
- goto error;
-
- /* nothing more to add */
- break;
- }
- if (!PyTuple_Check(firstitem) || PyTuple_Size(firstitem) != 2) {
- PyErr_SetString(PyExc_TypeError, "dict items "
- "iterator must return 2-tuples");
- goto error;
- }
-
- /* Try to get a second item */
- obj = PyIter_Next(iter);
- if (obj == NULL) {
- if (PyErr_Occurred())
- goto error;
-
- /* Only one item to write */
- if (save(state, self, PyTuple_GET_ITEM(firstitem, 0), 0) < 0)
- goto error;
- if (save(state, self, PyTuple_GET_ITEM(firstitem, 1), 0) < 0)
- goto error;
- if (_Pickler_Write(self, &setitem_op, 1) < 0)
- goto error;
- Py_CLEAR(firstitem);
- break;
- }
-
- /* More than one item to write */
-
- /* Pump out MARK, items, SETITEMS. */
- if (_Pickler_Write(self, &mark_op, 1) < 0)
- goto error;
-
- if (save(state, self, PyTuple_GET_ITEM(firstitem, 0), 0) < 0)
- goto error;
- if (save(state, self, PyTuple_GET_ITEM(firstitem, 1), 0) < 0)
- goto error;
- Py_CLEAR(firstitem);
- n = 1;
-
- /* Fetch and save up to BATCHSIZE items */
- while (obj) {
- if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 2) {
- PyErr_SetString(PyExc_TypeError, "dict items "
- "iterator must return 2-tuples");
- goto error;
- }
- if (save(state, self, PyTuple_GET_ITEM(obj, 0), 0) < 0 ||
- save(state, self, PyTuple_GET_ITEM(obj, 1), 0) < 0)
- goto error;
- Py_CLEAR(obj);
- n += 1;
-
- if (n == BATCHSIZE)
- break;
-
- obj = PyIter_Next(iter);
- if (obj == NULL) {
- if (PyErr_Occurred())
- goto error;
- break;
- }
- }
-
- if (_Pickler_Write(self, &setitems_op, 1) < 0)
- goto error;
-
- } while (n == BATCHSIZE);
- return 0;
-
- error:
- Py_XDECREF(firstitem);
- Py_XDECREF(obj);
- return -1;
-}
-
-/* This is a variant of batch_dict() above that specializes for dicts, with no
- * support for dict subclasses. Like batch_dict(), we batch up chunks of
- * MARK key value ... key value SETITEMS
- * opcode sequences. Calling code should have arranged to first create an
- * empty dict, or dict-like object, for the SETITEMS to operate on.
- * Returns 0 on success, -1 on error.
- *
- * Note that this currently doesn't work for protocol 0.
- */
-static int
-batch_dict_exact(PickleState *state, PicklerObject *self, PyObject *obj)
-{
- PyObject *key = NULL, *value = NULL;
- int i;
- Py_ssize_t dict_size, ppos = 0;
-
- const char mark_op = MARK;
- const char setitem_op = SETITEM;
- const char setitems_op = SETITEMS;
-
- assert(obj != NULL && PyDict_CheckExact(obj));
- assert(self->proto > 0);
-
- dict_size = PyDict_GET_SIZE(obj);
-
- /* Special-case len(d) == 1 to save space. */
- if (dict_size == 1) {
- PyDict_Next(obj, &ppos, &key, &value);
- Py_INCREF(key);
- Py_INCREF(value);
- if (save(state, self, key, 0) < 0) {
- goto error;
- }
- if (save(state, self, value, 0) < 0) {
- goto error;
- }
- Py_CLEAR(key);
- Py_CLEAR(value);
- if (_Pickler_Write(self, &setitem_op, 1) < 0)
- return -1;
- return 0;
- }
-
- /* Write in batches of BATCHSIZE. */
- do {
- i = 0;
- if (_Pickler_Write(self, &mark_op, 1) < 0)
- return -1;
- while (PyDict_Next(obj, &ppos, &key, &value)) {
- Py_INCREF(key);
- Py_INCREF(value);
- if (save(state, self, key, 0) < 0) {
- goto error;
- }
- if (save(state, self, value, 0) < 0) {
- goto error;
- }
- Py_CLEAR(key);
- Py_CLEAR(value);
- if (++i == BATCHSIZE)
- break;
- }
- if (_Pickler_Write(self, &setitems_op, 1) < 0)
- return -1;
- if (PyDict_GET_SIZE(obj) != dict_size) {
- PyErr_Format(
- PyExc_RuntimeError,
- "dictionary changed size during iteration");
- return -1;
- }
-
- } while (i == BATCHSIZE);
- return 0;
-error:
- Py_XDECREF(key);
- Py_XDECREF(value);
- return -1;
-}
-
-static int
-save_dict(PickleState *state, PicklerObject *self, PyObject *obj)
-{
- PyObject *items, *iter;
- char header[3];
- Py_ssize_t len;
- int status = 0;
- assert(PyDict_Check(obj));
-
- if (self->fast && !fast_save_enter(self, obj))
- goto error;
-
- /* Create an empty dict. */
- if (self->bin) {
- header[0] = EMPTY_DICT;
- len = 1;
- }
- else {
- header[0] = MARK;
- header[1] = DICT;
- len = 2;
- }
-
- if (_Pickler_Write(self, header, len) < 0)
- goto error;
-
- if (memo_put(state, self, obj) < 0)
- goto error;
-
- if (PyDict_GET_SIZE(obj)) {
- /* Save the dict items. */
- if (PyDict_CheckExact(obj) && self->proto > 0) {
- /* We can take certain shortcuts if we know this is a dict and
- not a dict subclass. */
- if (_Py_EnterRecursiveCall(" while pickling an object"))
- goto error;
- status = batch_dict_exact(state, self, obj);
- _Py_LeaveRecursiveCall();
- } else {
- items = PyObject_CallMethodNoArgs(obj, &_Py_ID(items));
- if (items == NULL)
- goto error;
- iter = PyObject_GetIter(items);
- Py_DECREF(items);
- if (iter == NULL)
- goto error;
- if (_Py_EnterRecursiveCall(" while pickling an object")) {
- Py_DECREF(iter);
- goto error;
- }
- status = batch_dict(state, self, iter);
- _Py_LeaveRecursiveCall();
- Py_DECREF(iter);
- }
- }
-
- if (0) {
- error:
- status = -1;
- }
-
- if (self->fast && !fast_save_leave(self, obj))
- status = -1;
-
- return status;
-}
-
-static int
-save_set(PickleState *state, PicklerObject *self, PyObject *obj)
-{
- PyObject *item;
- int i;
- Py_ssize_t set_size, ppos = 0;
- Py_hash_t hash;
-
- const char empty_set_op = EMPTY_SET;
- const char mark_op = MARK;
- const char additems_op = ADDITEMS;
-
- if (self->proto < 4) {
- PyObject *items;
- PyObject *reduce_value;
- int status;
-
- items = PySequence_List(obj);
- if (items == NULL) {
- return -1;
- }
- reduce_value = Py_BuildValue("(O(O))", (PyObject*)&PySet_Type, items);
- Py_DECREF(items);
- if (reduce_value == NULL) {
- return -1;
- }
- /* save_reduce() will memoize the object automatically. */
- status = save_reduce(state, self, reduce_value, obj);
- Py_DECREF(reduce_value);
- return status;
- }
-
- if (_Pickler_Write(self, &empty_set_op, 1) < 0)
- return -1;
-
- if (memo_put(state, self, obj) < 0)
- return -1;
-
- set_size = PySet_GET_SIZE(obj);
- if (set_size == 0)
- return 0; /* nothing to do */
-
- /* Write in batches of BATCHSIZE. */
- do {
- i = 0;
- if (_Pickler_Write(self, &mark_op, 1) < 0)
- return -1;
- while (_PySet_NextEntry(obj, &ppos, &item, &hash)) {
- Py_INCREF(item);
- int err = save(state, self, item, 0);
- Py_CLEAR(item);
- if (err < 0)
- return -1;
- if (++i == BATCHSIZE)
- break;
- }
- if (_Pickler_Write(self, &additems_op, 1) < 0)
- return -1;
- if (PySet_GET_SIZE(obj) != set_size) {
- PyErr_Format(
- PyExc_RuntimeError,
- "set changed size during iteration");
- return -1;
- }
- } while (i == BATCHSIZE);
-
- return 0;
-}
-
-static int
-save_frozenset(PickleState *state, PicklerObject *self, PyObject *obj)
-{
- PyObject *iter;
-
- const char mark_op = MARK;
- const char frozenset_op = FROZENSET;
-
- if (self->fast && !fast_save_enter(self, obj))
- return -1;
-
- if (self->proto < 4) {
- PyObject *items;
- PyObject *reduce_value;
- int status;
-
- items = PySequence_List(obj);
- if (items == NULL) {
- return -1;
- }
- reduce_value = Py_BuildValue("(O(O))", (PyObject*)&PyFrozenSet_Type,
- items);
- Py_DECREF(items);
- if (reduce_value == NULL) {
- return -1;
- }
- /* save_reduce() will memoize the object automatically. */
- status = save_reduce(state, self, reduce_value, obj);
- Py_DECREF(reduce_value);
- return status;
- }
-
- if (_Pickler_Write(self, &mark_op, 1) < 0)
- return -1;
-
- iter = PyObject_GetIter(obj);
- if (iter == NULL) {
- return -1;
- }
- for (;;) {
- PyObject *item;
-
- item = PyIter_Next(iter);
- if (item == NULL) {
- if (PyErr_Occurred()) {
- Py_DECREF(iter);
- return -1;
- }
- break;
- }
- if (save(state, self, item, 0) < 0) {
- Py_DECREF(item);
- Py_DECREF(iter);
- return -1;
- }
- Py_DECREF(item);
- }
- Py_DECREF(iter);
-
- /* If the object is already in the memo, this means it is
- recursive. In this case, throw away everything we put on the
- stack, and fetch the object back from the memo. */
- if (PyMemoTable_Get(self->memo, obj)) {
- const char pop_mark_op = POP_MARK;
-
- if (_Pickler_Write(self, &pop_mark_op, 1) < 0)
- return -1;
- if (memo_get(state, self, obj) < 0)
- return -1;
- return 0;
- }
-
- if (_Pickler_Write(self, &frozenset_op, 1) < 0)
- return -1;
- if (memo_put(state, self, obj) < 0)
- return -1;
-
- return 0;
-}
-
-static int
-fix_imports(PickleState *st, PyObject **module_name, PyObject **global_name)
-{
- PyObject *key;
- PyObject *item;
-
- key = PyTuple_Pack(2, *module_name, *global_name);
- if (key == NULL)
- return -1;
- item = PyDict_GetItemWithError(st->name_mapping_3to2, key);
- Py_DECREF(key);
- if (item) {
- PyObject *fixed_module_name;
- PyObject *fixed_global_name;
-
- if (!PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) {
- PyErr_Format(PyExc_RuntimeError,
- "_compat_pickle.REVERSE_NAME_MAPPING values "
- "should be 2-tuples, not %.200s",
- Py_TYPE(item)->tp_name);
- return -1;
- }
- fixed_module_name = PyTuple_GET_ITEM(item, 0);
- fixed_global_name = PyTuple_GET_ITEM(item, 1);
- if (!PyUnicode_Check(fixed_module_name) ||
- !PyUnicode_Check(fixed_global_name)) {
- PyErr_Format(PyExc_RuntimeError,
- "_compat_pickle.REVERSE_NAME_MAPPING values "
- "should be pairs of str, not (%.200s, %.200s)",
- Py_TYPE(fixed_module_name)->tp_name,
- Py_TYPE(fixed_global_name)->tp_name);
- return -1;
- }
-
- Py_CLEAR(*module_name);
- Py_CLEAR(*global_name);
- *module_name = Py_NewRef(fixed_module_name);
- *global_name = Py_NewRef(fixed_global_name);
- return 0;
- }
- else if (PyErr_Occurred()) {
- return -1;
- }
-
- item = PyDict_GetItemWithError(st->import_mapping_3to2, *module_name);
- if (item) {
- if (!PyUnicode_Check(item)) {
- PyErr_Format(PyExc_RuntimeError,
- "_compat_pickle.REVERSE_IMPORT_MAPPING values "
- "should be strings, not %.200s",
- Py_TYPE(item)->tp_name);
- return -1;
- }
- Py_XSETREF(*module_name, Py_NewRef(item));
- }
- else if (PyErr_Occurred()) {
- return -1;
- }
-
- return 0;
-}
-
-static int
-save_global(PickleState *st, PicklerObject *self, PyObject *obj,
- PyObject *name)
-{
- PyObject *global_name = NULL;
- PyObject *module_name = NULL;
- PyObject *module = NULL;
- PyObject *parent = NULL;
- PyObject *dotted_path = NULL;
- PyObject *lastname = NULL;
- PyObject *cls;
- int status = 0;
-
- const char global_op = GLOBAL;
-
- if (name) {
- global_name = Py_NewRef(name);
- }
- else {
- if (_PyObject_LookupAttr(obj, &_Py_ID(__qualname__), &global_name) < 0)
- goto error;
- if (global_name == NULL) {
- global_name = PyObject_GetAttr(obj, &_Py_ID(__name__));
- if (global_name == NULL)
- goto error;
- }
- }
-
- dotted_path = get_dotted_path(module, global_name);
- if (dotted_path == NULL)
- goto error;
- module_name = whichmodule(obj, dotted_path);
- if (module_name == NULL)
- goto error;
-
- /* XXX: Change to use the import C API directly with level=0 to disallow
- relative imports.
-
- XXX: PyImport_ImportModuleLevel could be used. However, this bypasses
- builtins.__import__. Therefore, _pickle, unlike pickle.py, will ignore
- custom import functions (IMHO, this would be a nice security
- feature). The import C API would need to be extended to support the
- extra parameters of __import__ to fix that. */
- module = PyImport_Import(module_name);
- if (module == NULL) {
- PyErr_Format(st->PicklingError,
- "Can't pickle %R: import of module %R failed",
- obj, module_name);
- goto error;
- }
- lastname = Py_NewRef(PyList_GET_ITEM(dotted_path,
- PyList_GET_SIZE(dotted_path) - 1));
- cls = get_deep_attribute(module, dotted_path, &parent);
- Py_CLEAR(dotted_path);
- if (cls == NULL) {
- PyErr_Format(st->PicklingError,
- "Can't pickle %R: attribute lookup %S on %S failed",
- obj, global_name, module_name);
- goto error;
- }
- if (cls != obj) {
- Py_DECREF(cls);
- PyErr_Format(st->PicklingError,
- "Can't pickle %R: it's not the same object as %S.%S",
- obj, module_name, global_name);
- goto error;
- }
- Py_DECREF(cls);
-
- if (self->proto >= 2) {
- /* See whether this is in the extension registry, and if
- * so generate an EXT opcode.
- */
- PyObject *extension_key;
- PyObject *code_obj; /* extension code as Python object */
- long code; /* extension code as C value */
- char pdata[5];
- Py_ssize_t n;
-
- extension_key = PyTuple_Pack(2, module_name, global_name);
- if (extension_key == NULL) {
- goto error;
- }
- code_obj = PyDict_GetItemWithError(st->extension_registry,
- extension_key);
- Py_DECREF(extension_key);
- /* The object is not registered in the extension registry.
- This is the most likely code path. */
- if (code_obj == NULL) {
- if (PyErr_Occurred()) {
- goto error;
- }
- goto gen_global;
- }
-
- /* XXX: pickle.py doesn't check neither the type, nor the range
- of the value returned by the extension_registry. It should for
- consistency. */
-
- /* Verify code_obj has the right type and value. */
- if (!PyLong_Check(code_obj)) {
- PyErr_Format(st->PicklingError,
- "Can't pickle %R: extension code %R isn't an integer",
- obj, code_obj);
- goto error;
- }
- code = PyLong_AS_LONG(code_obj);
- if (code <= 0 || code > 0x7fffffffL) {
- if (!PyErr_Occurred())
- PyErr_Format(st->PicklingError, "Can't pickle %R: extension "
- "code %ld is out of range", obj, code);
- goto error;
- }
-
- /* Generate an EXT opcode. */
- if (code <= 0xff) {
- pdata[0] = EXT1;
- pdata[1] = (unsigned char)code;
- n = 2;
- }
- else if (code <= 0xffff) {
- pdata[0] = EXT2;
- pdata[1] = (unsigned char)(code & 0xff);
- pdata[2] = (unsigned char)((code >> 8) & 0xff);
- n = 3;
- }
- else {
- pdata[0] = EXT4;
- pdata[1] = (unsigned char)(code & 0xff);
- pdata[2] = (unsigned char)((code >> 8) & 0xff);
- pdata[3] = (unsigned char)((code >> 16) & 0xff);
- pdata[4] = (unsigned char)((code >> 24) & 0xff);
- n = 5;
- }
-
- if (_Pickler_Write(self, pdata, n) < 0)
- goto error;
- }
- else {
- gen_global:
- if (parent == module) {
- Py_SETREF(global_name, Py_NewRef(lastname));
- }
- if (self->proto >= 4) {
- const char stack_global_op = STACK_GLOBAL;
-
- if (save(st, self, module_name, 0) < 0)
- goto error;
- if (save(st, self, global_name, 0) < 0)
- goto error;
-
- if (_Pickler_Write(self, &stack_global_op, 1) < 0)
- goto error;
- }
- else if (parent != module) {
- PyObject *reduce_value = Py_BuildValue("(O(OO))",
- st->getattr, parent, lastname);
- if (reduce_value == NULL)
- goto error;
- status = save_reduce(st, self, reduce_value, NULL);
- Py_DECREF(reduce_value);
- if (status < 0)
- goto error;
- }
- else {
- /* Generate a normal global opcode if we are using a pickle
- protocol < 4, or if the object is not registered in the
- extension registry. */
- PyObject *encoded;
- PyObject *(*unicode_encoder)(PyObject *);
-
- if (_Pickler_Write(self, &global_op, 1) < 0)
- goto error;
-
- /* For protocol < 3 and if the user didn't request against doing
- so, we convert module names to the old 2.x module names. */
- if (self->proto < 3 && self->fix_imports) {
- if (fix_imports(st, &module_name, &global_name) < 0) {
- goto error;
- }
- }
-
- /* Since Python 3.0 now supports non-ASCII identifiers, we encode
- both the module name and the global name using UTF-8. We do so
- only when we are using the pickle protocol newer than version
- 3. This is to ensure compatibility with older Unpickler running
- on Python 2.x. */
- if (self->proto == 3) {
- unicode_encoder = PyUnicode_AsUTF8String;
- }
- else {
- unicode_encoder = PyUnicode_AsASCIIString;
- }
- encoded = unicode_encoder(module_name);
- if (encoded == NULL) {
- if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError))
- PyErr_Format(st->PicklingError,
- "can't pickle module identifier '%S' using "
- "pickle protocol %i",
- module_name, self->proto);
- goto error;
- }
- if (_Pickler_Write(self, PyBytes_AS_STRING(encoded),
- PyBytes_GET_SIZE(encoded)) < 0) {
- Py_DECREF(encoded);
- goto error;
- }
- Py_DECREF(encoded);
- if(_Pickler_Write(self, "\n", 1) < 0)
- goto error;
-
- /* Save the name of the module. */
- encoded = unicode_encoder(global_name);
- if (encoded == NULL) {
- if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError))
- PyErr_Format(st->PicklingError,
- "can't pickle global identifier '%S' using "
- "pickle protocol %i",
- global_name, self->proto);
- goto error;
- }
- if (_Pickler_Write(self, PyBytes_AS_STRING(encoded),
- PyBytes_GET_SIZE(encoded)) < 0) {
- Py_DECREF(encoded);
- goto error;
- }
- Py_DECREF(encoded);
- if (_Pickler_Write(self, "\n", 1) < 0)
- goto error;
- }
- /* Memoize the object. */
- if (memo_put(st, self, obj) < 0)
- goto error;
- }
-
- if (0) {
- error:
- status = -1;
- }
- Py_XDECREF(module_name);
- Py_XDECREF(global_name);
- Py_XDECREF(module);
- Py_XDECREF(parent);
- Py_XDECREF(dotted_path);
- Py_XDECREF(lastname);
-
- return status;
-}
-
-static int
-save_singleton_type(PickleState *state, PicklerObject *self, PyObject *obj,
- PyObject *singleton)
-{
- PyObject *reduce_value;
- int status;
-
- reduce_value = Py_BuildValue("O(O)", &PyType_Type, singleton);
- if (reduce_value == NULL) {
- return -1;
- }
- status = save_reduce(state, self, reduce_value, obj);
- Py_DECREF(reduce_value);
- return status;
-}
-
-static int
-save_type(PickleState *state, PicklerObject *self, PyObject *obj)
-{
- if (obj == (PyObject *)&_PyNone_Type) {
- return save_singleton_type(state, self, obj, Py_None);
- }
- else if (obj == (PyObject *)&PyEllipsis_Type) {
- return save_singleton_type(state, self, obj, Py_Ellipsis);
- }
- else if (obj == (PyObject *)&_PyNotImplemented_Type) {
- return save_singleton_type(state, self, obj, Py_NotImplemented);
- }
- return save_global(state, self, obj, NULL);
-}
-
-static int
-save_pers(PickleState *state, PicklerObject *self, PyObject *obj)
-{
- PyObject *pid = NULL;
- int status = 0;
-
- const char persid_op = PERSID;
- const char binpersid_op = BINPERSID;
-
- pid = call_method(self->pers_func, self->pers_func_self, obj);
- if (pid == NULL)
- return -1;
-
- if (pid != Py_None) {
- if (self->bin) {
- if (save(state, self, pid, 1) < 0 ||
- _Pickler_Write(self, &binpersid_op, 1) < 0)
- goto error;
- }
- else {
- PyObject *pid_str;
-
- pid_str = PyObject_Str(pid);
- if (pid_str == NULL)
- goto error;
-
- /* XXX: Should it check whether the pid contains embedded
- newlines? */
- if (!PyUnicode_IS_ASCII(pid_str)) {
- PyErr_SetString(state->PicklingError,
- "persistent IDs in protocol 0 must be "
- "ASCII strings");
- Py_DECREF(pid_str);
- goto error;
- }
-
- if (_Pickler_Write(self, &persid_op, 1) < 0 ||
- _Pickler_Write(self, PyUnicode_DATA(pid_str),
- PyUnicode_GET_LENGTH(pid_str)) < 0 ||
- _Pickler_Write(self, "\n", 1) < 0) {
- Py_DECREF(pid_str);
- goto error;
- }
- Py_DECREF(pid_str);
- }
- status = 1;
- }
-
- if (0) {
- error:
- status = -1;
- }
- Py_XDECREF(pid);
-
- return status;
-}
-
-static PyObject *
-get_class(PyObject *obj)
-{
- PyObject *cls;
-
- if (_PyObject_LookupAttr(obj, &_Py_ID(__class__), &cls) == 0) {
- cls = Py_NewRef(Py_TYPE(obj));
- }
- return cls;
-}
-
-/* We're saving obj, and args is the 2-thru-5 tuple returned by the
- * appropriate __reduce__ method for obj.
- */
-static int
-save_reduce(PickleState *st, PicklerObject *self, PyObject *args,
- PyObject *obj)
-{
- PyObject *callable;
- PyObject *argtup;
- PyObject *state = NULL;
- PyObject *listitems = Py_None;
- PyObject *dictitems = Py_None;
- PyObject *state_setter = Py_None;
- Py_ssize_t size;
- int use_newobj = 0, use_newobj_ex = 0;
-
- const char reduce_op = REDUCE;
- const char build_op = BUILD;
- const char newobj_op = NEWOBJ;
- const char newobj_ex_op = NEWOBJ_EX;
-
- size = PyTuple_Size(args);
- if (size < 2 || size > 6) {
- PyErr_SetString(st->PicklingError, "tuple returned by "
- "__reduce__ must contain 2 through 6 elements");
- return -1;
- }
-
- if (!PyArg_UnpackTuple(args, "save_reduce", 2, 6,
- &callable, &argtup, &state, &listitems, &dictitems,
- &state_setter))
- return -1;
-
- if (!PyCallable_Check(callable)) {
- PyErr_SetString(st->PicklingError, "first item of the tuple "
- "returned by __reduce__ must be callable");
- return -1;
- }
- if (!PyTuple_Check(argtup)) {
- PyErr_SetString(st->PicklingError, "second item of the tuple "
- "returned by __reduce__ must be a tuple");
- return -1;
- }
-
- if (state == Py_None)
- state = NULL;
-
- if (listitems == Py_None)
- listitems = NULL;
- else if (!PyIter_Check(listitems)) {
- PyErr_Format(st->PicklingError, "fourth element of the tuple "
- "returned by __reduce__ must be an iterator, not %s",
- Py_TYPE(listitems)->tp_name);
- return -1;
- }
-
- if (dictitems == Py_None)
- dictitems = NULL;
- else if (!PyIter_Check(dictitems)) {
- PyErr_Format(st->PicklingError, "fifth element of the tuple "
- "returned by __reduce__ must be an iterator, not %s",
- Py_TYPE(dictitems)->tp_name);
- return -1;
- }
-
- if (state_setter == Py_None)
- state_setter = NULL;
- else if (!PyCallable_Check(state_setter)) {
- PyErr_Format(st->PicklingError, "sixth element of the tuple "
- "returned by __reduce__ must be a function, not %s",
- Py_TYPE(state_setter)->tp_name);
- return -1;
- }
-
- if (self->proto >= 2) {
- PyObject *name;
-
- if (_PyObject_LookupAttr(callable, &_Py_ID(__name__), &name) < 0) {
- return -1;
- }
- if (name != NULL && PyUnicode_Check(name)) {
- use_newobj_ex = _PyUnicode_Equal(name, &_Py_ID(__newobj_ex__));
- if (!use_newobj_ex) {
- use_newobj = _PyUnicode_Equal(name, &_Py_ID(__newobj__));
- }
- }
- Py_XDECREF(name);
- }
-
- if (use_newobj_ex) {
- PyObject *cls;
- PyObject *args;
- PyObject *kwargs;
-
- if (PyTuple_GET_SIZE(argtup) != 3) {
- PyErr_Format(st->PicklingError,
- "length of the NEWOBJ_EX argument tuple must be "
- "exactly 3, not %zd", PyTuple_GET_SIZE(argtup));
- return -1;
- }
-
- cls = PyTuple_GET_ITEM(argtup, 0);
- if (!PyType_Check(cls)) {
- PyErr_Format(st->PicklingError,
- "first item from NEWOBJ_EX argument tuple must "
- "be a class, not %.200s", Py_TYPE(cls)->tp_name);
- return -1;
- }
- args = PyTuple_GET_ITEM(argtup, 1);
- if (!PyTuple_Check(args)) {
- PyErr_Format(st->PicklingError,
- "second item from NEWOBJ_EX argument tuple must "
- "be a tuple, not %.200s", Py_TYPE(args)->tp_name);
- return -1;
- }
- kwargs = PyTuple_GET_ITEM(argtup, 2);
- if (!PyDict_Check(kwargs)) {
- PyErr_Format(st->PicklingError,
- "third item from NEWOBJ_EX argument tuple must "
- "be a dict, not %.200s", Py_TYPE(kwargs)->tp_name);
- return -1;
- }
-
- if (self->proto >= 4) {
- if (save(st, self, cls, 0) < 0 ||
- save(st, self, args, 0) < 0 ||
- save(st, self, kwargs, 0) < 0 ||
- _Pickler_Write(self, &newobj_ex_op, 1) < 0) {
- return -1;
- }
- }
- else {
- PyObject *newargs;
- PyObject *cls_new;
- Py_ssize_t i;
-
- newargs = PyTuple_New(PyTuple_GET_SIZE(args) + 2);
- if (newargs == NULL)
- return -1;
-
- cls_new = PyObject_GetAttr(cls, &_Py_ID(__new__));
- if (cls_new == NULL) {
- Py_DECREF(newargs);
- return -1;
- }
- PyTuple_SET_ITEM(newargs, 0, cls_new);
- PyTuple_SET_ITEM(newargs, 1, Py_NewRef(cls));
- for (i = 0; i < PyTuple_GET_SIZE(args); i++) {
- PyObject *item = PyTuple_GET_ITEM(args, i);
- PyTuple_SET_ITEM(newargs, i + 2, Py_NewRef(item));
- }
-
- callable = PyObject_Call(st->partial, newargs, kwargs);
- Py_DECREF(newargs);
- if (callable == NULL)
- return -1;
-
- newargs = PyTuple_New(0);
- if (newargs == NULL) {
- Py_DECREF(callable);
- return -1;
- }
-
- if (save(st, self, callable, 0) < 0 ||
- save(st, self, newargs, 0) < 0 ||
- _Pickler_Write(self, &reduce_op, 1) < 0) {
- Py_DECREF(newargs);
- Py_DECREF(callable);
- return -1;
- }
- Py_DECREF(newargs);
- Py_DECREF(callable);
- }
- }
- else if (use_newobj) {
- PyObject *cls;
- PyObject *newargtup;
- PyObject *obj_class;
- int p;
-
- /* Sanity checks. */
- if (PyTuple_GET_SIZE(argtup) < 1) {
- PyErr_SetString(st->PicklingError, "__newobj__ arglist is empty");
- return -1;
- }
-
- cls = PyTuple_GET_ITEM(argtup, 0);
- if (!PyType_Check(cls)) {
- PyErr_SetString(st->PicklingError, "args[0] from "
- "__newobj__ args is not a type");
- return -1;
- }
-
- if (obj != NULL) {
- obj_class = get_class(obj);
- if (obj_class == NULL) {
- return -1;
- }
- p = obj_class != cls;
- Py_DECREF(obj_class);
- if (p) {
- PyErr_SetString(st->PicklingError, "args[0] from "
- "__newobj__ args has the wrong class");
- return -1;
- }
- }
- /* XXX: These calls save() are prone to infinite recursion. Imagine
- what happen if the value returned by the __reduce__() method of
- some extension type contains another object of the same type. Ouch!
-
- Here is a quick example, that I ran into, to illustrate what I
- mean:
-
- >>> import pickle, copyreg
- >>> copyreg.dispatch_table.pop(complex)
- >>> pickle.dumps(1+2j)
- Traceback (most recent call last):
- ...
- RecursionError: maximum recursion depth exceeded
-
- Removing the complex class from copyreg.dispatch_table made the
- __reduce_ex__() method emit another complex object:
-
- >>> (1+1j).__reduce_ex__(2)
- (<function __newobj__ at 0xb7b71c3c>,
- (<class 'complex'>, (1+1j)), None, None, None)
-
- Thus when save() was called on newargstup (the 2nd item) recursion
- ensued. Of course, the bug was in the complex class which had a
- broken __getnewargs__() that emitted another complex object. But,
- the point, here, is it is quite easy to end up with a broken reduce
- function. */
-
- /* Save the class and its __new__ arguments. */
- if (save(st, self, cls, 0) < 0) {
- return -1;
- }
-
- newargtup = PyTuple_GetSlice(argtup, 1, PyTuple_GET_SIZE(argtup));
- if (newargtup == NULL)
- return -1;
-
- p = save(st, self, newargtup, 0);
- Py_DECREF(newargtup);
- if (p < 0)
- return -1;
-
- /* Add NEWOBJ opcode. */
- if (_Pickler_Write(self, &newobj_op, 1) < 0)
- return -1;
- }
- else { /* Not using NEWOBJ. */
- if (save(st, self, callable, 0) < 0 ||
- save(st, self, argtup, 0) < 0 ||
- _Pickler_Write(self, &reduce_op, 1) < 0)
- return -1;
- }
-
- /* obj can be NULL when save_reduce() is used directly. A NULL obj means
- the caller do not want to memoize the object. Not particularly useful,
- but that is to mimic the behavior save_reduce() in pickle.py when
- obj is None. */
- if (obj != NULL) {
- /* If the object is already in the memo, this means it is
- recursive. In this case, throw away everything we put on the
- stack, and fetch the object back from the memo. */
- if (PyMemoTable_Get(self->memo, obj)) {
- const char pop_op = POP;
-
- if (_Pickler_Write(self, &pop_op, 1) < 0)
- return -1;
- if (memo_get(st, self, obj) < 0)
- return -1;
-
- return 0;
- }
- else if (memo_put(st, self, obj) < 0)
- return -1;
- }
-
- if (listitems && batch_list(st, self, listitems) < 0)
- return -1;
-
- if (dictitems && batch_dict(st, self, dictitems) < 0)
- return -1;
-
- if (state) {
- if (state_setter == NULL) {
- if (save(st, self, state, 0) < 0 ||
- _Pickler_Write(self, &build_op, 1) < 0)
- return -1;
- }
- else {
-
- /* If a state_setter is specified, call it instead of load_build to
- * update obj's with its previous state.
- * The first 4 save/write instructions push state_setter and its
- * tuple of expected arguments (obj, state) onto the stack. The
- * REDUCE opcode triggers the state_setter(obj, state) function
- * call. Finally, because state-updating routines only do in-place
- * modification, the whole operation has to be stack-transparent.
- * Thus, we finally pop the call's output from the stack.*/
-
- const char tupletwo_op = TUPLE2;
- const char pop_op = POP;
- if (save(st, self, state_setter, 0) < 0 ||
- save(st, self, obj, 0) < 0 || save(st, self, state, 0) < 0 ||
- _Pickler_Write(self, &tupletwo_op, 1) < 0 ||
- _Pickler_Write(self, &reduce_op, 1) < 0 ||
- _Pickler_Write(self, &pop_op, 1) < 0)
- return -1;
- }
- }
- return 0;
-}
-
-static int
-save(PickleState *st, PicklerObject *self, PyObject *obj, int pers_save)
-{
- PyTypeObject *type;
- PyObject *reduce_func = NULL;
- PyObject *reduce_value = NULL;
- int status = 0;
-
- if (_Pickler_OpcodeBoundary(self) < 0)
- return -1;
-
- /* The extra pers_save argument is necessary to avoid calling save_pers()
- on its returned object. */
- if (!pers_save && self->pers_func) {
- /* save_pers() returns:
- -1 to signal an error;
- 0 if it did nothing successfully;
- 1 if a persistent id was saved.
- */
- if ((status = save_pers(st, self, obj)) != 0)
- return status;
- }
-
- type = Py_TYPE(obj);
-
- /* The old cPickle had an optimization that used switch-case statement
- dispatching on the first letter of the type name. This has was removed
- since benchmarks shown that this optimization was actually slowing
- things down. */
-
- /* Atom types; these aren't memoized, so don't check the memo. */
-
- if (obj == Py_None) {
- return save_none(self, obj);
- }
- else if (obj == Py_False || obj == Py_True) {
- return save_bool(self, obj);
- }
- else if (type == &PyLong_Type) {
- return save_long(self, obj);
- }
- else if (type == &PyFloat_Type) {
- return save_float(self, obj);
- }
-
- /* Check the memo to see if it has the object. If so, generate
- a GET (or BINGET) opcode, instead of pickling the object
- once again. */
- if (PyMemoTable_Get(self->memo, obj)) {
- return memo_get(st, self, obj);
- }
-
- if (type == &PyBytes_Type) {
- return save_bytes(st, self, obj);
- }
- else if (type == &PyUnicode_Type) {
- return save_unicode(st, self, obj);
- }
-
- /* We're only calling _Py_EnterRecursiveCall here so that atomic
- types above are pickled faster. */
- if (_Py_EnterRecursiveCall(" while pickling an object")) {
- return -1;
- }
-
- if (type == &PyDict_Type) {
- status = save_dict(st, self, obj);
- goto done;
- }
- else if (type == &PySet_Type) {
- status = save_set(st, self, obj);
- goto done;
- }
- else if (type == &PyFrozenSet_Type) {
- status = save_frozenset(st, self, obj);
- goto done;
- }
- else if (type == &PyList_Type) {
- status = save_list(st, self, obj);
- goto done;
- }
- else if (type == &PyTuple_Type) {
- status = save_tuple(st, self, obj);
- goto done;
- }
- else if (type == &PyByteArray_Type) {
- status = save_bytearray(st, self, obj);
- goto done;
- }
- else if (type == &PyPickleBuffer_Type) {
- status = save_picklebuffer(st, self, obj);
- goto done;
- }
-
- /* Now, check reducer_override. If it returns NotImplemented,
- * fallback to save_type or save_global, and then perhaps to the
- * regular reduction mechanism.
- */
- if (self->reducer_override != NULL) {
- reduce_value = PyObject_CallOneArg(self->reducer_override, obj);
- if (reduce_value == NULL) {
- goto error;
- }
- if (reduce_value != Py_NotImplemented) {
- goto reduce;
- }
- Py_SETREF(reduce_value, NULL);
- }
-
- if (type == &PyType_Type) {
- status = save_type(st, self, obj);
- goto done;
- }
- else if (type == &PyFunction_Type) {
- status = save_global(st, self, obj, NULL);
- goto done;
- }
-
- /* XXX: This part needs some unit tests. */
-
- /* Get a reduction callable, and call it. This may come from
- * self.dispatch_table, copyreg.dispatch_table, the object's
- * __reduce_ex__ method, or the object's __reduce__ method.
- */
- if (self->dispatch_table == NULL) {
- reduce_func = PyDict_GetItemWithError(st->dispatch_table,
- (PyObject *)type);
- if (reduce_func == NULL) {
- if (PyErr_Occurred()) {
- goto error;
- }
- } else {
- /* PyDict_GetItemWithError() returns a borrowed reference.
- Increase the reference count to be consistent with
- PyObject_GetItem and _PyObject_GetAttrId used below. */
- Py_INCREF(reduce_func);
- }
- } else {
- reduce_func = PyObject_GetItem(self->dispatch_table,
- (PyObject *)type);
- if (reduce_func == NULL) {
- if (PyErr_ExceptionMatches(PyExc_KeyError))
- PyErr_Clear();
- else
- goto error;
- }
- }
- if (reduce_func != NULL) {
- reduce_value = _Pickle_FastCall(reduce_func, Py_NewRef(obj));
- }
- else if (PyType_IsSubtype(type, &PyType_Type)) {
- status = save_global(st, self, obj, NULL);
- goto done;
- }
- else {
- /* XXX: If the __reduce__ method is defined, __reduce_ex__ is
- automatically defined as __reduce__. While this is convenient, this
- make it impossible to know which method was actually called. Of
- course, this is not a big deal. But still, it would be nice to let
- the user know which method was called when something go
- wrong. Incidentally, this means if __reduce_ex__ is not defined, we
- don't actually have to check for a __reduce__ method. */
-
- /* Check for a __reduce_ex__ method. */
- if (_PyObject_LookupAttr(obj, &_Py_ID(__reduce_ex__), &reduce_func) < 0) {
- goto error;
- }
- if (reduce_func != NULL) {
- PyObject *proto;
- proto = PyLong_FromLong(self->proto);
- if (proto != NULL) {
- reduce_value = _Pickle_FastCall(reduce_func, proto);
- }
- }
- else {
- /* Check for a __reduce__ method. */
- if (_PyObject_LookupAttr(obj, &_Py_ID(__reduce__), &reduce_func) < 0) {
- goto error;
- }
- if (reduce_func != NULL) {
- reduce_value = PyObject_CallNoArgs(reduce_func);
- }
- else {
- PyErr_Format(st->PicklingError,
- "can't pickle '%.200s' object: %R",
- type->tp_name, obj);
- goto error;
- }
- }
- }
-
- if (reduce_value == NULL)
- goto error;
-
- reduce:
- if (PyUnicode_Check(reduce_value)) {
- status = save_global(st, self, obj, reduce_value);
- goto done;
- }
-
- if (!PyTuple_Check(reduce_value)) {
- PyErr_SetString(st->PicklingError,
- "__reduce__ must return a string or tuple");
- goto error;
- }
-
- status = save_reduce(st, self, reduce_value, obj);
-
- if (0) {
- error:
- status = -1;
- }
- done:
-
- _Py_LeaveRecursiveCall();
- Py_XDECREF(reduce_func);
- Py_XDECREF(reduce_value);
-
- return status;
-}
-
-static int
-dump(PickleState *state, PicklerObject *self, PyObject *obj)
-{
- const char stop_op = STOP;
- int status = -1;
- PyObject *tmp;
-
- if (_PyObject_LookupAttr((PyObject *)self, &_Py_ID(reducer_override),
- &tmp) < 0) {
- goto error;
- }
- /* Cache the reducer_override method, if it exists. */
- if (tmp != NULL) {
- Py_XSETREF(self->reducer_override, tmp);
- }
- else {
- Py_CLEAR(self->reducer_override);
- }
-
- if (self->proto >= 2) {
- char header[2];
-
- header[0] = PROTO;
- assert(self->proto >= 0 && self->proto < 256);
- header[1] = (unsigned char)self->proto;
- if (_Pickler_Write(self, header, 2) < 0)
- goto error;
- if (self->proto >= 4)
- self->framing = 1;
- }
-
- if (save(state, self, obj, 0) < 0 ||
- _Pickler_Write(self, &stop_op, 1) < 0 ||
- _Pickler_CommitFrame(self) < 0)
- goto error;
-
- // Success
- status = 0;
-
- error:
- self->framing = 0;
-
- /* Break the reference cycle we generated at the beginning this function
- * call when setting the reducer_override attribute of the Pickler instance
- * to a bound method of the same instance. This is important as the Pickler
- * instance holds a reference to each object it has pickled (through its
- * memo): thus, these objects won't be garbage-collected as long as the
- * Pickler itself is not collected. */
- Py_CLEAR(self->reducer_override);
- return status;
-}
-
-/*[clinic input]
-
-_pickle.Pickler.clear_memo
-
-Clears the pickler's "memo".
-
-The memo is the data structure that remembers which objects the
-pickler has already seen, so that shared or recursive objects are
-pickled by reference and not by value. This method is useful when
-re-using picklers.
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_Pickler_clear_memo_impl(PicklerObject *self)
-/*[clinic end generated code: output=8665c8658aaa094b input=01bdad52f3d93e56]*/
-{
- if (self->memo)
- PyMemoTable_Clear(self->memo);
-
- Py_RETURN_NONE;
-}
-
-/*[clinic input]
-
-_pickle.Pickler.dump
-
- cls: defining_class
- obj: object
- /
-
-Write a pickled representation of the given object to the open file.
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_Pickler_dump_impl(PicklerObject *self, PyTypeObject *cls,
- PyObject *obj)
-/*[clinic end generated code: output=952cf7f68b1445bb input=f949d84151983594]*/
-{
- PickleState *st = _Pickle_GetStateByClass(cls);
- /* Check whether the Pickler was initialized correctly (issue3664).
- Developers often forget to call __init__() in their subclasses, which
- would trigger a segfault without this check. */
- if (self->write == NULL) {
- PyErr_Format(st->PicklingError,
- "Pickler.__init__() was not called by %s.__init__()",
- Py_TYPE(self)->tp_name);
- return NULL;
- }
-
- if (_Pickler_ClearBuffer(self) < 0)
- return NULL;
-
- if (dump(st, self, obj) < 0)
- return NULL;
-
- if (_Pickler_FlushToFile(self) < 0)
- return NULL;
-
- Py_RETURN_NONE;
-}
-
-/*[clinic input]
-
-_pickle.Pickler.__sizeof__ -> size_t
-
-Returns size in memory, in bytes.
-[clinic start generated code]*/
-
-static size_t
-_pickle_Pickler___sizeof___impl(PicklerObject *self)
-/*[clinic end generated code: output=23ad75658d3b59ff input=d8127c8e7012ebd7]*/
-{
- size_t res = _PyObject_SIZE(Py_TYPE(self));
- if (self->memo != NULL) {
- res += sizeof(PyMemoTable);
- res += self->memo->mt_allocated * sizeof(PyMemoEntry);
- }
- if (self->output_buffer != NULL) {
- size_t s = _PySys_GetSizeOf(self->output_buffer);
- if (s == (size_t)-1) {
- return -1;
- }
- res += s;
- }
- return res;
-}
-
-static struct PyMethodDef Pickler_methods[] = {
- _PICKLE_PICKLER_DUMP_METHODDEF
- _PICKLE_PICKLER_CLEAR_MEMO_METHODDEF
- _PICKLE_PICKLER___SIZEOF___METHODDEF
- {NULL, NULL} /* sentinel */
-};
-
-static int
-Pickler_clear(PicklerObject *self)
-{
- Py_CLEAR(self->output_buffer);
- Py_CLEAR(self->write);
- Py_CLEAR(self->pers_func);
- Py_CLEAR(self->dispatch_table);
- Py_CLEAR(self->fast_memo);
- Py_CLEAR(self->reducer_override);
- Py_CLEAR(self->buffer_callback);
-
- if (self->memo != NULL) {
- PyMemoTable *memo = self->memo;
- self->memo = NULL;
- PyMemoTable_Del(memo);
- }
- return 0;
-}
-
-static void
-Pickler_dealloc(PicklerObject *self)
-{
- PyTypeObject *tp = Py_TYPE(self);
- PyObject_GC_UnTrack(self);
- (void)Pickler_clear(self);
- tp->tp_free((PyObject *)self);
- Py_DECREF(tp);
-}
-
-static int
-Pickler_traverse(PicklerObject *self, visitproc visit, void *arg)
-{
- Py_VISIT(Py_TYPE(self));
- Py_VISIT(self->write);
- Py_VISIT(self->pers_func);
- Py_VISIT(self->dispatch_table);
- Py_VISIT(self->fast_memo);
- Py_VISIT(self->reducer_override);
- Py_VISIT(self->buffer_callback);
- PyMemoTable *memo = self->memo;
- if (memo && memo->mt_table) {
- Py_ssize_t i = memo->mt_allocated;
- while (--i >= 0) {
- Py_VISIT(memo->mt_table[i].me_key);
- }
- }
-
- return 0;
-}
-
-
-/*[clinic input]
-
-_pickle.Pickler.__init__
-
- file: object
- protocol: object = None
- fix_imports: bool = True
- buffer_callback: object = None
-
-This takes a binary file for writing a pickle data stream.
-
-The optional *protocol* argument tells the pickler to use the given
-protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default
-protocol is 4. It was introduced in Python 3.4, and is incompatible
-with previous versions.
-
-Specifying a negative protocol version selects the highest protocol
-version supported. The higher the protocol used, the more recent the
-version of Python needed to read the pickle produced.
-
-The *file* argument must have a write() method that accepts a single
-bytes argument. It can thus be a file object opened for binary
-writing, an io.BytesIO instance, or any other custom object that meets
-this interface.
-
-If *fix_imports* is True and protocol is less than 3, pickle will try
-to map the new Python 3 names to the old module names used in Python
-2, so that the pickle data stream is readable with Python 2.
-
-If *buffer_callback* is None (the default), buffer views are
-serialized into *file* as part of the pickle stream.
-
-If *buffer_callback* is not None, then it can be called any number
-of times with a buffer view. If the callback returns a false value
-(such as None), the given buffer is out-of-band; otherwise the
-buffer is serialized in-band, i.e. inside the pickle stream.
-
-It is an error if *buffer_callback* is not None and *protocol*
-is None or smaller than 5.
-
-[clinic start generated code]*/
-
-static int
-_pickle_Pickler___init___impl(PicklerObject *self, PyObject *file,
- PyObject *protocol, int fix_imports,
- PyObject *buffer_callback)
-/*[clinic end generated code: output=0abedc50590d259b input=a7c969699bf5dad3]*/
-{
- /* In case of multiple __init__() calls, clear previous content. */
- if (self->write != NULL)
- (void)Pickler_clear(self);
-
- if (_Pickler_SetProtocol(self, protocol, fix_imports) < 0)
- return -1;
-
- if (_Pickler_SetOutputStream(self, file) < 0)
- return -1;
-
- if (_Pickler_SetBufferCallback(self, buffer_callback) < 0)
- return -1;
-
- /* memo and output_buffer may have already been created in _Pickler_New */
- if (self->memo == NULL) {
- self->memo = PyMemoTable_New();
- if (self->memo == NULL)
- return -1;
- }
- self->output_len = 0;
- if (self->output_buffer == NULL) {
- self->max_output_len = WRITE_BUF_SIZE;
- self->output_buffer = PyBytes_FromStringAndSize(NULL,
- self->max_output_len);
- if (self->output_buffer == NULL)
- return -1;
- }
-
- self->fast = 0;
- self->fast_nesting = 0;
- self->fast_memo = NULL;
-
- if (init_method_ref((PyObject *)self, &_Py_ID(persistent_id),
- &self->pers_func, &self->pers_func_self) < 0)
- {
- return -1;
- }
- if (self->dispatch_table != NULL) {
- return 0;
- }
- if (_PyObject_LookupAttr((PyObject *)self, &_Py_ID(dispatch_table),
- &self->dispatch_table) < 0) {
- return -1;
- }
-
- return 0;
-}
-
-
-/* Define a proxy object for the Pickler's internal memo object. This is to
- * avoid breaking code like:
- * pickler.memo.clear()
- * and
- * pickler.memo = saved_memo
- * Is this a good idea? Not really, but we don't want to break code that uses
- * it. Note that we don't implement the entire mapping API here. This is
- * intentional, as these should be treated as black-box implementation details.
- */
-
-/*[clinic input]
-_pickle.PicklerMemoProxy.clear
-
-Remove all items from memo.
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_PicklerMemoProxy_clear_impl(PicklerMemoProxyObject *self)
-/*[clinic end generated code: output=5fb9370d48ae8b05 input=ccc186dacd0f1405]*/
-{
- if (self->pickler->memo)
- PyMemoTable_Clear(self->pickler->memo);
- Py_RETURN_NONE;
-}
-
-/*[clinic input]
-_pickle.PicklerMemoProxy.copy
-
-Copy the memo to a new object.
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self)
-/*[clinic end generated code: output=bb83a919d29225ef input=b73043485ac30b36]*/
-{
- PyMemoTable *memo;
- PyObject *new_memo = PyDict_New();
- if (new_memo == NULL)
- return NULL;
-
- memo = self->pickler->memo;
- for (size_t i = 0; i < memo->mt_allocated; ++i) {
- PyMemoEntry entry = memo->mt_table[i];
- if (entry.me_key != NULL) {
- int status;
- PyObject *key, *value;
-
- key = PyLong_FromVoidPtr(entry.me_key);
- if (key == NULL) {
- goto error;
- }
- value = Py_BuildValue("nO", entry.me_value, entry.me_key);
- if (value == NULL) {
- Py_DECREF(key);
- goto error;
- }
- status = PyDict_SetItem(new_memo, key, value);
- Py_DECREF(key);
- Py_DECREF(value);
- if (status < 0)
- goto error;
- }
- }
- return new_memo;
-
- error:
- Py_XDECREF(new_memo);
- return NULL;
-}
-
-/*[clinic input]
-_pickle.PicklerMemoProxy.__reduce__
-
-Implement pickle support.
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_PicklerMemoProxy___reduce___impl(PicklerMemoProxyObject *self)
-/*[clinic end generated code: output=bebba1168863ab1d input=2f7c540e24b7aae4]*/
-{
- PyObject *reduce_value, *dict_args;
- PyObject *contents = _pickle_PicklerMemoProxy_copy_impl(self);
- if (contents == NULL)
- return NULL;
-
- reduce_value = PyTuple_New(2);
- if (reduce_value == NULL) {
- Py_DECREF(contents);
- return NULL;
- }
- dict_args = PyTuple_New(1);
- if (dict_args == NULL) {
- Py_DECREF(contents);
- Py_DECREF(reduce_value);
- return NULL;
- }
- PyTuple_SET_ITEM(dict_args, 0, contents);
- PyTuple_SET_ITEM(reduce_value, 0, Py_NewRef(&PyDict_Type));
- PyTuple_SET_ITEM(reduce_value, 1, dict_args);
- return reduce_value;
-}
-
-static PyMethodDef picklerproxy_methods[] = {
- _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF
- _PICKLE_PICKLERMEMOPROXY_COPY_METHODDEF
- _PICKLE_PICKLERMEMOPROXY___REDUCE___METHODDEF
- {NULL, NULL} /* sentinel */
-};
-
-static void
-PicklerMemoProxy_dealloc(PicklerMemoProxyObject *self)
-{
- PyTypeObject *tp = Py_TYPE(self);
- PyObject_GC_UnTrack(self);
- Py_CLEAR(self->pickler);
- tp->tp_free((PyObject *)self);
- Py_DECREF(tp);
-}
-
-static int
-PicklerMemoProxy_traverse(PicklerMemoProxyObject *self,
- visitproc visit, void *arg)
-{
- Py_VISIT(Py_TYPE(self));
- Py_VISIT(self->pickler);
- return 0;
-}
-
-static int
-PicklerMemoProxy_clear(PicklerMemoProxyObject *self)
-{
- Py_CLEAR(self->pickler);
- return 0;
-}
-
-static PyType_Slot memoproxy_slots[] = {
- {Py_tp_dealloc, PicklerMemoProxy_dealloc},
- {Py_tp_traverse, PicklerMemoProxy_traverse},
- {Py_tp_clear, PicklerMemoProxy_clear},
- {Py_tp_methods, picklerproxy_methods},
- {Py_tp_hash, PyObject_HashNotImplemented},
- {0, NULL},
-};
-
-static PyType_Spec memoproxy_spec = {
- .name = "_pickle.PicklerMemoProxy",
- .basicsize = sizeof(PicklerMemoProxyObject),
- .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
- Py_TPFLAGS_IMMUTABLETYPE),
- .slots = memoproxy_slots,
-};
-
-static PyObject *
-PicklerMemoProxy_New(PicklerObject *pickler)
-{
- PicklerMemoProxyObject *self;
- PickleState *st = _Pickle_FindStateByType(Py_TYPE(pickler));
- self = PyObject_GC_New(PicklerMemoProxyObject, st->PicklerMemoProxyType);
- if (self == NULL)
- return NULL;
- self->pickler = (PicklerObject*)Py_NewRef(pickler);
- PyObject_GC_Track(self);
- return (PyObject *)self;
-}
-
-/*****************************************************************************/
-
-static PyObject *
-Pickler_get_memo(PicklerObject *self, void *Py_UNUSED(ignored))
-{
- return PicklerMemoProxy_New(self);
-}
-
-static int
-Pickler_set_memo(PicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored))
-{
- PyMemoTable *new_memo = NULL;
-
- if (obj == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "attribute deletion is not supported");
- return -1;
- }
-
- PickleState *st = _Pickle_FindStateByType(Py_TYPE(self));
- if (Py_IS_TYPE(obj, st->PicklerMemoProxyType)) {
- PicklerObject *pickler =
- ((PicklerMemoProxyObject *)obj)->pickler;
-
- new_memo = PyMemoTable_Copy(pickler->memo);
- if (new_memo == NULL)
- return -1;
- }
- else if (PyDict_Check(obj)) {
- Py_ssize_t i = 0;
- PyObject *key, *value;
-
- new_memo = PyMemoTable_New();
- if (new_memo == NULL)
- return -1;
-
- while (PyDict_Next(obj, &i, &key, &value)) {
- Py_ssize_t memo_id;
- PyObject *memo_obj;
-
- if (!PyTuple_Check(value) || PyTuple_GET_SIZE(value) != 2) {
- PyErr_SetString(PyExc_TypeError,
- "'memo' values must be 2-item tuples");
- goto error;
- }
- memo_id = PyLong_AsSsize_t(PyTuple_GET_ITEM(value, 0));
- if (memo_id == -1 && PyErr_Occurred())
- goto error;
- memo_obj = PyTuple_GET_ITEM(value, 1);
- if (PyMemoTable_Set(new_memo, memo_obj, memo_id) < 0)
- goto error;
- }
- }
- else {
- PyErr_Format(PyExc_TypeError,
- "'memo' attribute must be a PicklerMemoProxy object "
- "or dict, not %.200s", Py_TYPE(obj)->tp_name);
- return -1;
- }
-
- PyMemoTable_Del(self->memo);
- self->memo = new_memo;
-
- return 0;
-
- error:
- if (new_memo)
- PyMemoTable_Del(new_memo);
- return -1;
-}
-
-static PyObject *
-Pickler_get_persid(PicklerObject *self, void *Py_UNUSED(ignored))
-{
- if (self->pers_func == NULL) {
- PyErr_SetString(PyExc_AttributeError, "persistent_id");
- return NULL;
- }
- return reconstruct_method(self->pers_func, self->pers_func_self);
-}
-
-static int
-Pickler_set_persid(PicklerObject *self, PyObject *value, void *Py_UNUSED(ignored))
-{
- if (value == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "attribute deletion is not supported");
- return -1;
- }
- if (!PyCallable_Check(value)) {
- PyErr_SetString(PyExc_TypeError,
- "persistent_id must be a callable taking one argument");
- return -1;
- }
-
- self->pers_func_self = NULL;
- Py_XSETREF(self->pers_func, Py_NewRef(value));
-
- return 0;
-}
-
-static PyMemberDef Pickler_members[] = {
- {"bin", T_INT, offsetof(PicklerObject, bin)},
- {"fast", T_INT, offsetof(PicklerObject, fast)},
- {"dispatch_table", T_OBJECT_EX, offsetof(PicklerObject, dispatch_table)},
- {NULL}
-};
-
-static PyGetSetDef Pickler_getsets[] = {
- {"memo", (getter)Pickler_get_memo,
- (setter)Pickler_set_memo},
- {"persistent_id", (getter)Pickler_get_persid,
- (setter)Pickler_set_persid},
- {NULL}
-};
-
-static PyType_Slot pickler_type_slots[] = {
- {Py_tp_dealloc, Pickler_dealloc},
- {Py_tp_methods, Pickler_methods},
- {Py_tp_members, Pickler_members},
- {Py_tp_getset, Pickler_getsets},
- {Py_tp_clear, Pickler_clear},
- {Py_tp_doc, (char*)_pickle_Pickler___init____doc__},
- {Py_tp_traverse, Pickler_traverse},
- {Py_tp_init, _pickle_Pickler___init__},
- {Py_tp_new, PyType_GenericNew},
- {Py_tp_alloc, PyType_GenericAlloc},
- {Py_tp_free, PyObject_GC_Del},
- {0, NULL},
-};
-
-static PyType_Spec pickler_type_spec = {
- .name = "_pickle.Pickler",
- .basicsize = sizeof(PicklerObject),
- .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
- Py_TPFLAGS_IMMUTABLETYPE),
- .slots = pickler_type_slots,
-};
-
-/* Temporary helper for calling self.find_class().
-
- XXX: It would be nice to able to avoid Python function call overhead, by
- using directly the C version of find_class(), when find_class() is not
- overridden by a subclass. Although, this could become rather hackish. A
- simpler optimization would be to call the C function when self is not a
- subclass instance. */
-static PyObject *
-find_class(UnpicklerObject *self, PyObject *module_name, PyObject *global_name)
-{
- return PyObject_CallMethodObjArgs((PyObject *)self, &_Py_ID(find_class),
- module_name, global_name, NULL);
-}
-
-static Py_ssize_t
-marker(PickleState *st, UnpicklerObject *self)
-{
- if (self->num_marks < 1) {
- PyErr_SetString(st->UnpicklingError, "could not find MARK");
- return -1;
- }
-
- Py_ssize_t mark = self->marks[--self->num_marks];
- self->stack->mark_set = self->num_marks != 0;
- self->stack->fence = self->num_marks ?
- self->marks[self->num_marks - 1] : 0;
- return mark;
-}
-
-static int
-load_none(PickleState *state, UnpicklerObject *self)
-{
- PDATA_APPEND(self->stack, Py_None, -1);
- return 0;
-}
-
-static int
-load_int(PickleState *state, UnpicklerObject *self)
-{
- PyObject *value;
- char *endptr, *s;
- Py_ssize_t len;
- long x;
-
- if ((len = _Unpickler_Readline(state, self, &s)) < 0)
- return -1;
- if (len < 2)
- return bad_readline(state);
-
- errno = 0;
- /* XXX: Should the base argument of strtol() be explicitly set to 10?
- XXX(avassalotti): Should this uses PyOS_strtol()? */
- x = strtol(s, &endptr, 0);
-
- if (errno || (*endptr != '\n' && *endptr != '\0')) {
- /* Hm, maybe we've got something long. Let's try reading
- * it as a Python int object. */
- errno = 0;
- /* XXX: Same thing about the base here. */
- value = PyLong_FromString(s, NULL, 0);
- if (value == NULL) {
- PyErr_SetString(PyExc_ValueError,
- "could not convert string to int");
- return -1;
- }
- }
- else {
- if (len == 3 && (x == 0 || x == 1)) {
- if ((value = PyBool_FromLong(x)) == NULL)
- return -1;
- }
- else {
- if ((value = PyLong_FromLong(x)) == NULL)
- return -1;
- }
- }
-
- PDATA_PUSH(self->stack, value, -1);
- return 0;
-}
-
-static int
-load_bool(PickleState *state, UnpicklerObject *self, PyObject *boolean)
-{
- assert(boolean == Py_True || boolean == Py_False);
- PDATA_APPEND(self->stack, boolean, -1);
- return 0;
-}
-
-/* s contains x bytes of an unsigned little-endian integer. Return its value
- * as a C Py_ssize_t, or -1 if it's higher than PY_SSIZE_T_MAX.
- */
-static Py_ssize_t
-calc_binsize(char *bytes, int nbytes)
-{
- unsigned char *s = (unsigned char *)bytes;
- int i;
- size_t x = 0;
-
- if (nbytes > (int)sizeof(size_t)) {
- /* Check for integer overflow. BINBYTES8 and BINUNICODE8 opcodes
- * have 64-bit size that can't be represented on 32-bit platform.
- */
- for (i = (int)sizeof(size_t); i < nbytes; i++) {
- if (s[i])
- return -1;
- }
- nbytes = (int)sizeof(size_t);
- }
- for (i = 0; i < nbytes; i++) {
- x |= (size_t) s[i] << (8 * i);
- }
-
- if (x > PY_SSIZE_T_MAX)
- return -1;
- else
- return (Py_ssize_t) x;
-}
-
-/* s contains x bytes of a little-endian integer. Return its value as a
- * C int. Obscure: when x is 1 or 2, this is an unsigned little-endian
- * int, but when x is 4 it's a signed one. This is a historical source
- * of x-platform bugs.
- */
-static long
-calc_binint(char *bytes, int nbytes)
-{
- unsigned char *s = (unsigned char *)bytes;
- Py_ssize_t i;
- long x = 0;
-
- for (i = 0; i < nbytes; i++) {
- x |= (long)s[i] << (8 * i);
- }
-
- /* Unlike BININT1 and BININT2, BININT (more accurately BININT4)
- * is signed, so on a box with longs bigger than 4 bytes we need
- * to extend a BININT's sign bit to the full width.
- */
- if (SIZEOF_LONG > 4 && nbytes == 4) {
- x |= -(x & (1L << 31));
- }
-
- return x;
-}
-
-static int
-load_binintx(UnpicklerObject *self, char *s, int size)
-{
- PyObject *value;
- long x;
-
- x = calc_binint(s, size);
-
- if ((value = PyLong_FromLong(x)) == NULL)
- return -1;
-
- PDATA_PUSH(self->stack, value, -1);
- return 0;
-}
-
-static int
-load_binint(PickleState *state, UnpicklerObject *self)
-{
- char *s;
- if (_Unpickler_Read(self, state, &s, 4) < 0)
- return -1;
-
- return load_binintx(self, s, 4);
-}
-
-static int
-load_binint1(PickleState *state, UnpicklerObject *self)
-{
- char *s;
- if (_Unpickler_Read(self, state, &s, 1) < 0)
- return -1;
-
- return load_binintx(self, s, 1);
-}
-
-static int
-load_binint2(PickleState *state, UnpicklerObject *self)
-{
- char *s;
- if (_Unpickler_Read(self, state, &s, 2) < 0)
- return -1;
-
- return load_binintx(self, s, 2);
-}
-
-static int
-load_long(PickleState *state, UnpicklerObject *self)
-{
- PyObject *value;
- char *s = NULL;
- Py_ssize_t len;
-
- if ((len = _Unpickler_Readline(state, self, &s)) < 0)
- return -1;
- if (len < 2)
- return bad_readline(state);
-
- /* s[len-2] will usually be 'L' (and s[len-1] is '\n'); we need to remove
- the 'L' before calling PyLong_FromString. In order to maintain
- compatibility with Python 3.0.0, we don't actually *require*
- the 'L' to be present. */
- if (s[len-2] == 'L')
- s[len-2] = '\0';
- /* XXX: Should the base argument explicitly set to 10? */
- value = PyLong_FromString(s, NULL, 0);
- if (value == NULL)
- return -1;
-
- PDATA_PUSH(self->stack, value, -1);
- return 0;
-}
-
-/* 'size' bytes contain the # of bytes of little-endian 256's-complement
- * data following.
- */
-static int
-load_counted_long(PickleState *st, UnpicklerObject *self, int size)
-{
- PyObject *value;
- char *nbytes;
- char *pdata;
-
- assert(size == 1 || size == 4);
- if (_Unpickler_Read(self, st, &nbytes, size) < 0)
- return -1;
-
- size = calc_binint(nbytes, size);
- if (size < 0) {
- /* Corrupt or hostile pickle -- we never write one like this */
- PyErr_SetString(st->UnpicklingError,
- "LONG pickle has negative byte count");
- return -1;
- }
-
- if (size == 0)
- value = PyLong_FromLong(0L);
- else {
- /* Read the raw little-endian bytes and convert. */
- if (_Unpickler_Read(self, st, &pdata, size) < 0)
- return -1;
- value = _PyLong_FromByteArray((unsigned char *)pdata, (size_t)size,
- 1 /* little endian */ , 1 /* signed */ );
- }
- if (value == NULL)
- return -1;
- PDATA_PUSH(self->stack, value, -1);
- return 0;
-}
-
-static int
-load_float(PickleState *state, UnpicklerObject *self)
-{
- PyObject *value;
- char *endptr, *s;
- Py_ssize_t len;
- double d;
-
- if ((len = _Unpickler_Readline(state, self, &s)) < 0)
- return -1;
- if (len < 2)
- return bad_readline(state);
-
- errno = 0;
- d = PyOS_string_to_double(s, &endptr, PyExc_OverflowError);
- if (d == -1.0 && PyErr_Occurred())
- return -1;
- if ((endptr[0] != '\n') && (endptr[0] != '\0')) {
- PyErr_SetString(PyExc_ValueError, "could not convert string to float");
- return -1;
- }
- value = PyFloat_FromDouble(d);
- if (value == NULL)
- return -1;
-
- PDATA_PUSH(self->stack, value, -1);
- return 0;
-}
-
-static int
-load_binfloat(PickleState *state, UnpicklerObject *self)
-{
- PyObject *value;
- double x;
- char *s;
-
- if (_Unpickler_Read(self, state, &s, 8) < 0)
- return -1;
-
- x = PyFloat_Unpack8(s, 0);
- if (x == -1.0 && PyErr_Occurred())
- return -1;
-
- if ((value = PyFloat_FromDouble(x)) == NULL)
- return -1;
-
- PDATA_PUSH(self->stack, value, -1);
- return 0;
-}
-
-static int
-load_string(PickleState *st, UnpicklerObject *self)
-{
- PyObject *bytes;
- PyObject *obj;
- Py_ssize_t len;
- char *s, *p;
-
- if ((len = _Unpickler_Readline(st, self, &s)) < 0)
- return -1;
- /* Strip the newline */
- len--;
- /* Strip outermost quotes */
- if (len >= 2 && s[0] == s[len - 1] && (s[0] == '\'' || s[0] == '"')) {
- p = s + 1;
- len -= 2;
- }
- else {
- PyErr_SetString(st->UnpicklingError,
- "the STRING opcode argument must be quoted");
- return -1;
- }
- assert(len >= 0);
-
- /* Use the PyBytes API to decode the string, since that is what is used
- to encode, and then coerce the result to Unicode. */
- bytes = PyBytes_DecodeEscape(p, len, NULL, 0, NULL);
- if (bytes == NULL)
- return -1;
-
- /* Leave the Python 2.x strings as bytes if the *encoding* given to the
- Unpickler was 'bytes'. Otherwise, convert them to unicode. */
- if (strcmp(self->encoding, "bytes") == 0) {
- obj = bytes;
- }
- else {
- obj = PyUnicode_FromEncodedObject(bytes, self->encoding, self->errors);
- Py_DECREF(bytes);
- if (obj == NULL) {
- return -1;
- }
- }
-
- PDATA_PUSH(self->stack, obj, -1);
- return 0;
-}
-
-static int
-load_counted_binstring(PickleState *st, UnpicklerObject *self, int nbytes)
-{
- PyObject *obj;
- Py_ssize_t size;
- char *s;
-
- if (_Unpickler_Read(self, st, &s, nbytes) < 0)
- return -1;
-
- size = calc_binsize(s, nbytes);
- if (size < 0) {
- PyErr_Format(st->UnpicklingError,
- "BINSTRING exceeds system's maximum size of %zd bytes",
- PY_SSIZE_T_MAX);
- return -1;
- }
-
- if (_Unpickler_Read(self, st, &s, size) < 0)
- return -1;
-
- /* Convert Python 2.x strings to bytes if the *encoding* given to the
- Unpickler was 'bytes'. Otherwise, convert them to unicode. */
- if (strcmp(self->encoding, "bytes") == 0) {
- obj = PyBytes_FromStringAndSize(s, size);
- }
- else {
- obj = PyUnicode_Decode(s, size, self->encoding, self->errors);
- }
- if (obj == NULL) {
- return -1;
- }
-
- PDATA_PUSH(self->stack, obj, -1);
- return 0;
-}
-
-static int
-load_counted_binbytes(PickleState *state, UnpicklerObject *self, int nbytes)
-{
- PyObject *bytes;
- Py_ssize_t size;
- char *s;
-
- if (_Unpickler_Read(self, state, &s, nbytes) < 0)
- return -1;
-
- size = calc_binsize(s, nbytes);
- if (size < 0) {
- PyErr_Format(PyExc_OverflowError,
- "BINBYTES exceeds system's maximum size of %zd bytes",
- PY_SSIZE_T_MAX);
- return -1;
- }
-
- bytes = PyBytes_FromStringAndSize(NULL, size);
- if (bytes == NULL)
- return -1;
- if (_Unpickler_ReadInto(state, self, PyBytes_AS_STRING(bytes), size) < 0) {
- Py_DECREF(bytes);
- return -1;
- }
-
- PDATA_PUSH(self->stack, bytes, -1);
- return 0;
-}
-
-static int
-load_counted_bytearray(PickleState *state, UnpicklerObject *self)
-{
- PyObject *bytearray;
- Py_ssize_t size;
- char *s;
-
- if (_Unpickler_Read(self, state, &s, 8) < 0) {
- return -1;
- }
-
- size = calc_binsize(s, 8);
- if (size < 0) {
- PyErr_Format(PyExc_OverflowError,
- "BYTEARRAY8 exceeds system's maximum size of %zd bytes",
- PY_SSIZE_T_MAX);
- return -1;
- }
-
- bytearray = PyByteArray_FromStringAndSize(NULL, size);
- if (bytearray == NULL) {
- return -1;
- }
- char *str = PyByteArray_AS_STRING(bytearray);
- if (_Unpickler_ReadInto(state, self, str, size) < 0) {
- Py_DECREF(bytearray);
- return -1;
- }
-
- PDATA_PUSH(self->stack, bytearray, -1);
- return 0;
-}
-
-static int
-load_next_buffer(PickleState *st, UnpicklerObject *self)
-{
- if (self->buffers == NULL) {
- PyErr_SetString(st->UnpicklingError,
- "pickle stream refers to out-of-band data "
- "but no *buffers* argument was given");
- return -1;
- }
- PyObject *buf = PyIter_Next(self->buffers);
- if (buf == NULL) {
- if (!PyErr_Occurred()) {
- PyErr_SetString(st->UnpicklingError,
- "not enough out-of-band buffers");
- }
- return -1;
- }
-
- PDATA_PUSH(self->stack, buf, -1);
- return 0;
-}
-
-static int
-load_readonly_buffer(PickleState *state, UnpicklerObject *self)
-{
- Py_ssize_t len = Py_SIZE(self->stack);
- if (len <= self->stack->fence) {
- return Pdata_stack_underflow(state, self->stack);
- }
-
- PyObject *obj = self->stack->data[len - 1];
- PyObject *view = PyMemoryView_FromObject(obj);
- if (view == NULL) {
- return -1;
- }
- if (!PyMemoryView_GET_BUFFER(view)->readonly) {
- /* Original object is writable */
- PyMemoryView_GET_BUFFER(view)->readonly = 1;
- self->stack->data[len - 1] = view;
- Py_DECREF(obj);
- }
- else {
- /* Original object is read-only, no need to replace it */
- Py_DECREF(view);
- }
- return 0;
-}
-
-static int
-load_unicode(PickleState *state, UnpicklerObject *self)
-{
- PyObject *str;
- Py_ssize_t len;
- char *s = NULL;
-
- if ((len = _Unpickler_Readline(state, self, &s)) < 0)
- return -1;
- if (len < 1)
- return bad_readline(state);
-
- str = PyUnicode_DecodeRawUnicodeEscape(s, len - 1, NULL);
- if (str == NULL)
- return -1;
-
- PDATA_PUSH(self->stack, str, -1);
- return 0;
-}
-
-static int
-load_counted_binunicode(PickleState *state, UnpicklerObject *self, int nbytes)
-{
- PyObject *str;
- Py_ssize_t size;
- char *s;
-
- if (_Unpickler_Read(self, state, &s, nbytes) < 0)
- return -1;
-
- size = calc_binsize(s, nbytes);
- if (size < 0) {
- PyErr_Format(PyExc_OverflowError,
- "BINUNICODE exceeds system's maximum size of %zd bytes",
- PY_SSIZE_T_MAX);
- return -1;
- }
-
- if (_Unpickler_Read(self, state, &s, size) < 0)
- return -1;
-
- str = PyUnicode_DecodeUTF8(s, size, "surrogatepass");
- if (str == NULL)
- return -1;
-
- PDATA_PUSH(self->stack, str, -1);
- return 0;
-}
-
-static int
-load_counted_tuple(PickleState *state, UnpicklerObject *self, Py_ssize_t len)
-{
- PyObject *tuple;
-
- if (Py_SIZE(self->stack) < len)
- return Pdata_stack_underflow(state, self->stack);
-
- tuple = Pdata_poptuple(state, self->stack, Py_SIZE(self->stack) - len);
- if (tuple == NULL)
- return -1;
- PDATA_PUSH(self->stack, tuple, -1);
- return 0;
-}
-
-static int
-load_tuple(PickleState *state, UnpicklerObject *self)
-{
- Py_ssize_t i;
-
- if ((i = marker(state, self)) < 0)
- return -1;
-
- return load_counted_tuple(state, self, Py_SIZE(self->stack) - i);
-}
-
-static int
-load_empty_list(PickleState *state, UnpicklerObject *self)
-{
- PyObject *list;
-
- if ((list = PyList_New(0)) == NULL)
- return -1;
- PDATA_PUSH(self->stack, list, -1);
- return 0;
-}
-
-static int
-load_empty_dict(PickleState *state, UnpicklerObject *self)
-{
- PyObject *dict;
-
- if ((dict = PyDict_New()) == NULL)
- return -1;
- PDATA_PUSH(self->stack, dict, -1);
- return 0;
-}
-
-static int
-load_empty_set(PickleState *state, UnpicklerObject *self)
-{
- PyObject *set;
-
- if ((set = PySet_New(NULL)) == NULL)
- return -1;
- PDATA_PUSH(self->stack, set, -1);
- return 0;
-}
-
-static int
-load_list(PickleState *state, UnpicklerObject *self)
-{
- PyObject *list;
- Py_ssize_t i;
-
- if ((i = marker(state, self)) < 0)
- return -1;
-
- list = Pdata_poplist(self->stack, i);
- if (list == NULL)
- return -1;
- PDATA_PUSH(self->stack, list, -1);
- return 0;
-}
-
-static int
-load_dict(PickleState *st, UnpicklerObject *self)
-{
- PyObject *dict, *key, *value;
- Py_ssize_t i, j, k;
-
- if ((i = marker(st, self)) < 0)
- return -1;
- j = Py_SIZE(self->stack);
-
- if ((dict = PyDict_New()) == NULL)
- return -1;
-
- if ((j - i) % 2 != 0) {
- PyErr_SetString(st->UnpicklingError, "odd number of items for DICT");
- Py_DECREF(dict);
- return -1;
- }
-
- for (k = i + 1; k < j; k += 2) {
- key = self->stack->data[k - 1];
- value = self->stack->data[k];
- if (PyDict_SetItem(dict, key, value) < 0) {
- Py_DECREF(dict);
- return -1;
- }
- }
- Pdata_clear(self->stack, i);
- PDATA_PUSH(self->stack, dict, -1);
- return 0;
-}
-
-static int
-load_frozenset(PickleState *state, UnpicklerObject *self)
-{
- PyObject *items;
- PyObject *frozenset;
- Py_ssize_t i;
-
- if ((i = marker(state, self)) < 0)
- return -1;
-
- items = Pdata_poptuple(state, self->stack, i);
- if (items == NULL)
- return -1;
-
- frozenset = PyFrozenSet_New(items);
- Py_DECREF(items);
- if (frozenset == NULL)
- return -1;
-
- PDATA_PUSH(self->stack, frozenset, -1);
- return 0;
-}
-
-static PyObject *
-instantiate(PyObject *cls, PyObject *args)
-{
- /* Caller must assure args are a tuple. Normally, args come from
- Pdata_poptuple which packs objects from the top of the stack
- into a newly created tuple. */
- assert(PyTuple_Check(args));
- if (!PyTuple_GET_SIZE(args) && PyType_Check(cls)) {
- PyObject *func;
- if (_PyObject_LookupAttr(cls, &_Py_ID(__getinitargs__), &func) < 0) {
- return NULL;
- }
- if (func == NULL) {
- return PyObject_CallMethodOneArg(cls, &_Py_ID(__new__), cls);
- }
- Py_DECREF(func);
- }
- return PyObject_CallObject(cls, args);
-}
-
-static int
-load_obj(PickleState *state, UnpicklerObject *self)
-{
- PyObject *cls, *args, *obj = NULL;
- Py_ssize_t i;
-
- if ((i = marker(state, self)) < 0)
- return -1;
-
- if (Py_SIZE(self->stack) - i < 1)
- return Pdata_stack_underflow(state, self->stack);
-
- args = Pdata_poptuple(state, self->stack, i + 1);
- if (args == NULL)
- return -1;
-
- PDATA_POP(state, self->stack, cls);
- if (cls) {
- obj = instantiate(cls, args);
- Py_DECREF(cls);
- }
- Py_DECREF(args);
- if (obj == NULL)
- return -1;
-
- PDATA_PUSH(self->stack, obj, -1);
- return 0;
-}
-
-static int
-load_inst(PickleState *state, UnpicklerObject *self)
-{
- PyObject *cls = NULL;
- PyObject *args = NULL;
- PyObject *obj = NULL;
- PyObject *module_name;
- PyObject *class_name;
- Py_ssize_t len;
- Py_ssize_t i;
- char *s;
-
- if ((i = marker(state, self)) < 0)
- return -1;
- if ((len = _Unpickler_Readline(state, self, &s)) < 0)
- return -1;
- if (len < 2)
- return bad_readline(state);
-
- /* Here it is safe to use PyUnicode_DecodeASCII(), even though non-ASCII
- identifiers are permitted in Python 3.0, since the INST opcode is only
- supported by older protocols on Python 2.x. */
- module_name = PyUnicode_DecodeASCII(s, len - 1, "strict");
- if (module_name == NULL)
- return -1;
-
- if ((len = _Unpickler_Readline(state, self, &s)) >= 0) {
- if (len < 2) {
- Py_DECREF(module_name);
- return bad_readline(state);
- }
- class_name = PyUnicode_DecodeASCII(s, len - 1, "strict");
- if (class_name != NULL) {
- cls = find_class(self, module_name, class_name);
- Py_DECREF(class_name);
- }
- }
- Py_DECREF(module_name);
-
- if (cls == NULL)
- return -1;
-
- if ((args = Pdata_poptuple(state, self->stack, i)) != NULL) {
- obj = instantiate(cls, args);
- Py_DECREF(args);
- }
- Py_DECREF(cls);
-
- if (obj == NULL)
- return -1;
-
- PDATA_PUSH(self->stack, obj, -1);
- return 0;
-}
-
-static void
-newobj_unpickling_error(PickleState *st, const char *msg, int use_kwargs,
- PyObject *arg)
-{
- PyErr_Format(st->UnpicklingError, msg,
- use_kwargs ? "NEWOBJ_EX" : "NEWOBJ",
- Py_TYPE(arg)->tp_name);
-}
-
-static int
-load_newobj(PickleState *state, UnpicklerObject *self, int use_kwargs)
-{
- PyObject *cls, *args, *kwargs = NULL;
- PyObject *obj;
-
- /* Stack is ... cls args [kwargs], and we want to call
- * cls.__new__(cls, *args, **kwargs).
- */
- if (use_kwargs) {
- PDATA_POP(state, self->stack, kwargs);
- if (kwargs == NULL) {
- return -1;
- }
- }
- PDATA_POP(state, self->stack, args);
- if (args == NULL) {
- Py_XDECREF(kwargs);
- return -1;
- }
- PDATA_POP(state, self->stack, cls);
- if (cls == NULL) {
- Py_XDECREF(kwargs);
- Py_DECREF(args);
- return -1;
- }
-
- if (!PyType_Check(cls)) {
- newobj_unpickling_error(state,
- "%s class argument must be a type, not %.200s",
- use_kwargs, cls);
- goto error;
- }
- if (((PyTypeObject *)cls)->tp_new == NULL) {
- newobj_unpickling_error(state,
- "%s class argument '%.200s' doesn't have __new__",
- use_kwargs, cls);
- goto error;
- }
- if (!PyTuple_Check(args)) {
- newobj_unpickling_error(state,
- "%s args argument must be a tuple, not %.200s",
- use_kwargs, args);
- goto error;
- }
- if (use_kwargs && !PyDict_Check(kwargs)) {
- newobj_unpickling_error(state,
- "%s kwargs argument must be a dict, not %.200s",
- use_kwargs, kwargs);
- goto error;
- }
-
- obj = ((PyTypeObject *)cls)->tp_new((PyTypeObject *)cls, args, kwargs);
- if (obj == NULL) {
- goto error;
- }
- Py_XDECREF(kwargs);
- Py_DECREF(args);
- Py_DECREF(cls);
- PDATA_PUSH(self->stack, obj, -1);
- return 0;
-
-error:
- Py_XDECREF(kwargs);
- Py_DECREF(args);
- Py_DECREF(cls);
- return -1;
-}
-
-static int
-load_global(PickleState *state, UnpicklerObject *self)
-{
- PyObject *global = NULL;
- PyObject *module_name;
- PyObject *global_name;
- Py_ssize_t len;
- char *s;
-
- if ((len = _Unpickler_Readline(state, self, &s)) < 0)
- return -1;
- if (len < 2)
- return bad_readline(state);
- module_name = PyUnicode_DecodeUTF8(s, len - 1, "strict");
- if (!module_name)
- return -1;
-
- if ((len = _Unpickler_Readline(state, self, &s)) >= 0) {
- if (len < 2) {
- Py_DECREF(module_name);
- return bad_readline(state);
- }
- global_name = PyUnicode_DecodeUTF8(s, len - 1, "strict");
- if (global_name) {
- global = find_class(self, module_name, global_name);
- Py_DECREF(global_name);
- }
- }
- Py_DECREF(module_name);
-
- if (global == NULL)
- return -1;
- PDATA_PUSH(self->stack, global, -1);
- return 0;
-}
-
-static int
-load_stack_global(PickleState *st, UnpicklerObject *self)
-{
- PyObject *global;
- PyObject *module_name;
- PyObject *global_name;
-
- PDATA_POP(st, self->stack, global_name);
- if (global_name == NULL) {
- return -1;
- }
- PDATA_POP(st, self->stack, module_name);
- if (module_name == NULL) {
- Py_DECREF(global_name);
- return -1;
- }
- if (!PyUnicode_CheckExact(module_name) ||
- !PyUnicode_CheckExact(global_name))
- {
- PyErr_SetString(st->UnpicklingError, "STACK_GLOBAL requires str");
- Py_DECREF(global_name);
- Py_DECREF(module_name);
- return -1;
- }
- global = find_class(self, module_name, global_name);
- Py_DECREF(global_name);
- Py_DECREF(module_name);
- if (global == NULL)
- return -1;
- PDATA_PUSH(self->stack, global, -1);
- return 0;
-}
-
-static int
-load_persid(PickleState *st, UnpicklerObject *self)
-{
- PyObject *pid, *obj;
- Py_ssize_t len;
- char *s;
-
- if (self->pers_func) {
- if ((len = _Unpickler_Readline(st, self, &s)) < 0)
- return -1;
- if (len < 1)
- return bad_readline(st);
-
- pid = PyUnicode_DecodeASCII(s, len - 1, "strict");
- if (pid == NULL) {
- if (PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) {
- PyErr_SetString(st->UnpicklingError,
- "persistent IDs in protocol 0 must be "
- "ASCII strings");
- }
- return -1;
- }
-
- obj = call_method(self->pers_func, self->pers_func_self, pid);
- Py_DECREF(pid);
- if (obj == NULL)
- return -1;
-
- PDATA_PUSH(self->stack, obj, -1);
- return 0;
- }
- else {
- PyErr_SetString(st->UnpicklingError,
- "A load persistent id instruction was encountered, "
- "but no persistent_load function was specified.");
- return -1;
- }
-}
-
-static int
-load_binpersid(PickleState *st, UnpicklerObject *self)
-{
- PyObject *pid, *obj;
-
- if (self->pers_func) {
- PDATA_POP(st, self->stack, pid);
- if (pid == NULL)
- return -1;
-
- obj = call_method(self->pers_func, self->pers_func_self, pid);
- Py_DECREF(pid);
- if (obj == NULL)
- return -1;
-
- PDATA_PUSH(self->stack, obj, -1);
- return 0;
- }
- else {
- PyErr_SetString(st->UnpicklingError,
- "A load persistent id instruction was encountered, "
- "but no persistent_load function was specified.");
- return -1;
- }
-}
-
-static int
-load_pop(PickleState *state, UnpicklerObject *self)
-{
- Py_ssize_t len = Py_SIZE(self->stack);
-
- /* Note that we split the (pickle.py) stack into two stacks,
- * an object stack and a mark stack. We have to be clever and
- * pop the right one. We do this by looking at the top of the
- * mark stack first, and only signalling a stack underflow if
- * the object stack is empty and the mark stack doesn't match
- * our expectations.
- */
- if (self->num_marks > 0 && self->marks[self->num_marks - 1] == len) {
- self->num_marks--;
- self->stack->mark_set = self->num_marks != 0;
- self->stack->fence = self->num_marks ?
- self->marks[self->num_marks - 1] : 0;
- } else if (len <= self->stack->fence)
- return Pdata_stack_underflow(state, self->stack);
- else {
- len--;
- Py_DECREF(self->stack->data[len]);
- Py_SET_SIZE(self->stack, len);
- }
- return 0;
-}
-
-static int
-load_pop_mark(PickleState *state, UnpicklerObject *self)
-{
- Py_ssize_t i;
- if ((i = marker(state, self)) < 0)
- return -1;
-
- Pdata_clear(self->stack, i);
-
- return 0;
-}
-
-static int
-load_dup(PickleState *state, UnpicklerObject *self)
-{
- PyObject *last;
- Py_ssize_t len = Py_SIZE(self->stack);
-
- if (len <= self->stack->fence)
- return Pdata_stack_underflow(state, self->stack);
- last = self->stack->data[len - 1];
- PDATA_APPEND(self->stack, last, -1);
- return 0;
-}
-
-static int
-load_get(PickleState *st, UnpicklerObject *self)
-{
- PyObject *key, *value;
- Py_ssize_t idx;
- Py_ssize_t len;
- char *s;
-
- if ((len = _Unpickler_Readline(st, self, &s)) < 0)
- return -1;
- if (len < 2)
- return bad_readline(st);
-
- key = PyLong_FromString(s, NULL, 10);
- if (key == NULL)
- return -1;
- idx = PyLong_AsSsize_t(key);
- if (idx == -1 && PyErr_Occurred()) {
- Py_DECREF(key);
- return -1;
- }
-
- value = _Unpickler_MemoGet(self, idx);
- if (value == NULL) {
- if (!PyErr_Occurred()) {
- PyErr_Format(st->UnpicklingError, "Memo value not found at index %ld", idx);
- }
- Py_DECREF(key);
- return -1;
- }
- Py_DECREF(key);
-
- PDATA_APPEND(self->stack, value, -1);
- return 0;
-}
-
-static int
-load_binget(PickleState *st, UnpicklerObject *self)
-{
- PyObject *value;
- Py_ssize_t idx;
- char *s;
-
- if (_Unpickler_Read(self, st, &s, 1) < 0)
- return -1;
-
- idx = Py_CHARMASK(s[0]);
-
- value = _Unpickler_MemoGet(self, idx);
- if (value == NULL) {
- PyObject *key = PyLong_FromSsize_t(idx);
- if (key != NULL) {
- PyErr_Format(st->UnpicklingError, "Memo value not found at index %ld", idx);
- Py_DECREF(key);
- }
- return -1;
- }
-
- PDATA_APPEND(self->stack, value, -1);
- return 0;
-}
-
-static int
-load_long_binget(PickleState *st, UnpicklerObject *self)
-{
- PyObject *value;
- Py_ssize_t idx;
- char *s;
-
- if (_Unpickler_Read(self, st, &s, 4) < 0)
- return -1;
-
- idx = calc_binsize(s, 4);
-
- value = _Unpickler_MemoGet(self, idx);
- if (value == NULL) {
- PyObject *key = PyLong_FromSsize_t(idx);
- if (key != NULL) {
- PyErr_Format(st->UnpicklingError, "Memo value not found at index %ld", idx);
- Py_DECREF(key);
- }
- return -1;
- }
-
- PDATA_APPEND(self->stack, value, -1);
- return 0;
-}
-
-/* Push an object from the extension registry (EXT[124]). nbytes is
- * the number of bytes following the opcode, holding the index (code) value.
- */
-static int
-load_extension(PickleState *st, UnpicklerObject *self, int nbytes)
-{
- char *codebytes; /* the nbytes bytes after the opcode */
- long code; /* calc_binint returns long */
- PyObject *py_code; /* code as a Python int */
- PyObject *obj; /* the object to push */
- PyObject *pair; /* (module_name, class_name) */
- PyObject *module_name, *class_name;
-
- assert(nbytes == 1 || nbytes == 2 || nbytes == 4);
- if (_Unpickler_Read(self, st, &codebytes, nbytes) < 0)
- return -1;
- code = calc_binint(codebytes, nbytes);
- if (code <= 0) { /* note that 0 is forbidden */
- /* Corrupt or hostile pickle. */
- PyErr_SetString(st->UnpicklingError, "EXT specifies code <= 0");
- return -1;
- }
-
- /* Look for the code in the cache. */
- py_code = PyLong_FromLong(code);
- if (py_code == NULL)
- return -1;
- obj = PyDict_GetItemWithError(st->extension_cache, py_code);
- if (obj != NULL) {
- /* Bingo. */
- Py_DECREF(py_code);
- PDATA_APPEND(self->stack, obj, -1);
- return 0;
- }
- if (PyErr_Occurred()) {
- Py_DECREF(py_code);
- return -1;
- }
-
- /* Look up the (module_name, class_name) pair. */
- pair = PyDict_GetItemWithError(st->inverted_registry, py_code);
- if (pair == NULL) {
- Py_DECREF(py_code);
- if (!PyErr_Occurred()) {
- PyErr_Format(PyExc_ValueError, "unregistered extension "
- "code %ld", code);
- }
- return -1;
- }
- /* Since the extension registry is manipulable via Python code,
- * confirm that pair is really a 2-tuple of strings.
- */
- if (!PyTuple_Check(pair) || PyTuple_Size(pair) != 2) {
- goto error;
- }
-
- module_name = PyTuple_GET_ITEM(pair, 0);
- if (!PyUnicode_Check(module_name)) {
- goto error;
- }
-
- class_name = PyTuple_GET_ITEM(pair, 1);
- if (!PyUnicode_Check(class_name)) {
- goto error;
- }
-
- /* Load the object. */
- obj = find_class(self, module_name, class_name);
- if (obj == NULL) {
- Py_DECREF(py_code);
- return -1;
- }
- /* Cache code -> obj. */
- code = PyDict_SetItem(st->extension_cache, py_code, obj);
- Py_DECREF(py_code);
- if (code < 0) {
- Py_DECREF(obj);
- return -1;
- }
- PDATA_PUSH(self->stack, obj, -1);
- return 0;
-
-error:
- Py_DECREF(py_code);
- PyErr_Format(PyExc_ValueError, "_inverted_registry[%ld] "
- "isn't a 2-tuple of strings", code);
- return -1;
-}
-
-static int
-load_put(PickleState *state, UnpicklerObject *self)
-{
- PyObject *key, *value;
- Py_ssize_t idx;
- Py_ssize_t len;
- char *s = NULL;
-
- if ((len = _Unpickler_Readline(state, self, &s)) < 0)
- return -1;
- if (len < 2)
- return bad_readline(state);
- if (Py_SIZE(self->stack) <= self->stack->fence)
- return Pdata_stack_underflow(state, self->stack);
- value = self->stack->data[Py_SIZE(self->stack) - 1];
-
- key = PyLong_FromString(s, NULL, 10);
- if (key == NULL)
- return -1;
- idx = PyLong_AsSsize_t(key);
- Py_DECREF(key);
- if (idx < 0) {
- if (!PyErr_Occurred())
- PyErr_SetString(PyExc_ValueError,
- "negative PUT argument");
- return -1;
- }
-
- return _Unpickler_MemoPut(self, idx, value);
-}
-
-static int
-load_binput(PickleState *state, UnpicklerObject *self)
-{
- PyObject *value;
- Py_ssize_t idx;
- char *s;
-
- if (_Unpickler_Read(self, state, &s, 1) < 0)
- return -1;
-
- if (Py_SIZE(self->stack) <= self->stack->fence)
- return Pdata_stack_underflow(state, self->stack);
- value = self->stack->data[Py_SIZE(self->stack) - 1];
-
- idx = Py_CHARMASK(s[0]);
-
- return _Unpickler_MemoPut(self, idx, value);
-}
-
-static int
-load_long_binput(PickleState *state, UnpicklerObject *self)
-{
- PyObject *value;
- Py_ssize_t idx;
- char *s;
-
- if (_Unpickler_Read(self, state, &s, 4) < 0)
- return -1;
-
- if (Py_SIZE(self->stack) <= self->stack->fence)
- return Pdata_stack_underflow(state, self->stack);
- value = self->stack->data[Py_SIZE(self->stack) - 1];
-
- idx = calc_binsize(s, 4);
- if (idx < 0) {
- PyErr_SetString(PyExc_ValueError,
- "negative LONG_BINPUT argument");
- return -1;
- }
-
- return _Unpickler_MemoPut(self, idx, value);
-}
-
-static int
-load_memoize(PickleState *state, UnpicklerObject *self)
-{
- PyObject *value;
-
- if (Py_SIZE(self->stack) <= self->stack->fence)
- return Pdata_stack_underflow(state, self->stack);
- value = self->stack->data[Py_SIZE(self->stack) - 1];
-
- return _Unpickler_MemoPut(self, self->memo_len, value);
-}
-
-static int
-do_append(PickleState *state, UnpicklerObject *self, Py_ssize_t x)
-{
- PyObject *value;
- PyObject *slice;
- PyObject *list;
- PyObject *result;
- Py_ssize_t len, i;
-
- len = Py_SIZE(self->stack);
- if (x > len || x <= self->stack->fence)
- return Pdata_stack_underflow(state, self->stack);
- if (len == x) /* nothing to do */
- return 0;
-
- list = self->stack->data[x - 1];
-
- if (PyList_CheckExact(list)) {
- Py_ssize_t list_len;
- int ret;
-
- slice = Pdata_poplist(self->stack, x);
- if (!slice)
- return -1;
- list_len = PyList_GET_SIZE(list);
- ret = PyList_SetSlice(list, list_len, list_len, slice);
- Py_DECREF(slice);
- return ret;
- }
- else {
- PyObject *extend_func;
-
- if (_PyObject_LookupAttr(list, &_Py_ID(extend), &extend_func) < 0) {
- return -1;
- }
- if (extend_func != NULL) {
- slice = Pdata_poplist(self->stack, x);
- if (!slice) {
- Py_DECREF(extend_func);
- return -1;
- }
- result = _Pickle_FastCall(extend_func, slice);
- Py_DECREF(extend_func);
- if (result == NULL)
- return -1;
- Py_DECREF(result);
- }
- else {
- PyObject *append_func;
-
- /* Even if the PEP 307 requires extend() and append() methods,
- fall back on append() if the object has no extend() method
- for backward compatibility. */
- append_func = PyObject_GetAttr(list, &_Py_ID(append));
- if (append_func == NULL)
- return -1;
- for (i = x; i < len; i++) {
- value = self->stack->data[i];
- result = _Pickle_FastCall(append_func, value);
- if (result == NULL) {
- Pdata_clear(self->stack, i + 1);
- Py_SET_SIZE(self->stack, x);
- Py_DECREF(append_func);
- return -1;
- }
- Py_DECREF(result);
- }
- Py_SET_SIZE(self->stack, x);
- Py_DECREF(append_func);
- }
- }
-
- return 0;
-}
-
-static int
-load_append(PickleState *state, UnpicklerObject *self)
-{
- if (Py_SIZE(self->stack) - 1 <= self->stack->fence)
- return Pdata_stack_underflow(state, self->stack);
- return do_append(state, self, Py_SIZE(self->stack) - 1);
-}
-
-static int
-load_appends(PickleState *state, UnpicklerObject *self)
-{
- Py_ssize_t i = marker(state, self);
- if (i < 0)
- return -1;
- return do_append(state, self, i);
-}
-
-static int
-do_setitems(PickleState *st, UnpicklerObject *self, Py_ssize_t x)
-{
- PyObject *value, *key;
- PyObject *dict;
- Py_ssize_t len, i;
- int status = 0;
-
- len = Py_SIZE(self->stack);
- if (x > len || x <= self->stack->fence)
- return Pdata_stack_underflow(st, self->stack);
- if (len == x) /* nothing to do */
- return 0;
- if ((len - x) % 2 != 0) {
- /* Corrupt or hostile pickle -- we never write one like this. */
- PyErr_SetString(st->UnpicklingError,
- "odd number of items for SETITEMS");
- return -1;
- }
-
- /* Here, dict does not actually need to be a PyDict; it could be anything
- that supports the __setitem__ attribute. */
- dict = self->stack->data[x - 1];
-
- for (i = x + 1; i < len; i += 2) {
- key = self->stack->data[i - 1];
- value = self->stack->data[i];
- if (PyObject_SetItem(dict, key, value) < 0) {
- status = -1;
- break;
- }
- }
-
- Pdata_clear(self->stack, x);
- return status;
-}
-
-static int
-load_setitem(PickleState *state, UnpicklerObject *self)
-{
- return do_setitems(state, self, Py_SIZE(self->stack) - 2);
-}
-
-static int
-load_setitems(PickleState *state, UnpicklerObject *self)
-{
- Py_ssize_t i = marker(state, self);
- if (i < 0)
- return -1;
- return do_setitems(state, self, i);
-}
-
-static int
-load_additems(PickleState *state, UnpicklerObject *self)
-{
- PyObject *set;
- Py_ssize_t mark, len, i;
-
- mark = marker(state, self);
- if (mark < 0)
- return -1;
- len = Py_SIZE(self->stack);
- if (mark > len || mark <= self->stack->fence)
- return Pdata_stack_underflow(state, self->stack);
- if (len == mark) /* nothing to do */
- return 0;
-
- set = self->stack->data[mark - 1];
-
- if (PySet_Check(set)) {
- PyObject *items;
- int status;
-
- items = Pdata_poptuple(state, self->stack, mark);
- if (items == NULL)
- return -1;
-
- status = _PySet_Update(set, items);
- Py_DECREF(items);
- return status;
- }
- else {
- PyObject *add_func;
-
- add_func = PyObject_GetAttr(set, &_Py_ID(add));
- if (add_func == NULL)
- return -1;
- for (i = mark; i < len; i++) {
- PyObject *result;
- PyObject *item;
-
- item = self->stack->data[i];
- result = _Pickle_FastCall(add_func, item);
- if (result == NULL) {
- Pdata_clear(self->stack, i + 1);
- Py_SET_SIZE(self->stack, mark);
- return -1;
- }
- Py_DECREF(result);
- }
- Py_SET_SIZE(self->stack, mark);
- }
-
- return 0;
-}
-
-static int
-load_build(PickleState *st, UnpicklerObject *self)
-{
- PyObject *inst, *slotstate;
- PyObject *setstate;
- int status = 0;
-
- /* Stack is ... instance, state. We want to leave instance at
- * the stack top, possibly mutated via instance.__setstate__(state).
- */
- if (Py_SIZE(self->stack) - 2 < self->stack->fence)
- return Pdata_stack_underflow(st, self->stack);
-
- PyObject *state;
- PDATA_POP(st, self->stack, state);
- if (state == NULL)
- return -1;
-
- inst = self->stack->data[Py_SIZE(self->stack) - 1];
-
- if (_PyObject_LookupAttr(inst, &_Py_ID(__setstate__), &setstate) < 0) {
- Py_DECREF(state);
- return -1;
- }
- if (setstate != NULL) {
- PyObject *result;
-
- /* The explicit __setstate__ is responsible for everything. */
- result = _Pickle_FastCall(setstate, state);
- Py_DECREF(setstate);
- if (result == NULL)
- return -1;
- Py_DECREF(result);
- return 0;
- }
-
- /* A default __setstate__. First see whether state embeds a
- * slot state dict too (a proto 2 addition).
- */
- if (PyTuple_Check(state) && PyTuple_GET_SIZE(state) == 2) {
- PyObject *tmp = state;
-
- state = PyTuple_GET_ITEM(tmp, 0);
- slotstate = PyTuple_GET_ITEM(tmp, 1);
- Py_INCREF(state);
- Py_INCREF(slotstate);
- Py_DECREF(tmp);
- }
- else
- slotstate = NULL;
-
- /* Set inst.__dict__ from the state dict (if any). */
- if (state != Py_None) {
- PyObject *dict;
- PyObject *d_key, *d_value;
- Py_ssize_t i;
-
- if (!PyDict_Check(state)) {
- PyErr_SetString(st->UnpicklingError, "state is not a dictionary");
- goto error;
- }
- dict = PyObject_GetAttr(inst, &_Py_ID(__dict__));
- if (dict == NULL)
- goto error;
-
- i = 0;
- while (PyDict_Next(state, &i, &d_key, &d_value)) {
- /* normally the keys for instance attributes are
- interned. we should try to do that here. */
- Py_INCREF(d_key);
- if (PyUnicode_CheckExact(d_key))
- PyUnicode_InternInPlace(&d_key);
- if (PyObject_SetItem(dict, d_key, d_value) < 0) {
- Py_DECREF(d_key);
- goto error;
- }
- Py_DECREF(d_key);
- }
- Py_DECREF(dict);
- }
-
- /* Also set instance attributes from the slotstate dict (if any). */
- if (slotstate != NULL) {
- PyObject *d_key, *d_value;
- Py_ssize_t i;
-
- if (!PyDict_Check(slotstate)) {
- PyErr_SetString(st->UnpicklingError,
- "slot state is not a dictionary");
- goto error;
- }
- i = 0;
- while (PyDict_Next(slotstate, &i, &d_key, &d_value)) {
- if (PyObject_SetAttr(inst, d_key, d_value) < 0)
- goto error;
- }
- }
-
- if (0) {
- error:
- status = -1;
- }
-
- Py_DECREF(state);
- Py_XDECREF(slotstate);
- return status;
-}
-
-static int
-load_mark(PickleState *state, UnpicklerObject *self)
-{
-
- /* Note that we split the (pickle.py) stack into two stacks, an
- * object stack and a mark stack. Here we push a mark onto the
- * mark stack.
- */
-
- if (self->num_marks >= self->marks_size) {
- size_t alloc = ((size_t)self->num_marks << 1) + 20;
- Py_ssize_t *marks_new = self->marks;
- PyMem_RESIZE(marks_new, Py_ssize_t, alloc);
- if (marks_new == NULL) {
- PyErr_NoMemory();
- return -1;
- }
- self->marks = marks_new;
- self->marks_size = (Py_ssize_t)alloc;
- }
-
- self->stack->mark_set = 1;
- self->marks[self->num_marks++] = self->stack->fence = Py_SIZE(self->stack);
-
- return 0;
-}
-
-static int
-load_reduce(PickleState *state, UnpicklerObject *self)
-{
- PyObject *callable = NULL;
- PyObject *argtup = NULL;
- PyObject *obj = NULL;
-
- PDATA_POP(state, self->stack, argtup);
- if (argtup == NULL)
- return -1;
- PDATA_POP(state, self->stack, callable);
- if (callable) {
- obj = PyObject_CallObject(callable, argtup);
- Py_DECREF(callable);
- }
- Py_DECREF(argtup);
-
- if (obj == NULL)
- return -1;
-
- PDATA_PUSH(self->stack, obj, -1);
- return 0;
-}
-
-/* Just raises an error if we don't know the protocol specified. PROTO
- * is the first opcode for protocols >= 2.
- */
-static int
-load_proto(PickleState *state, UnpicklerObject *self)
-{
- char *s;
- int i;
-
- if (_Unpickler_Read(self, state, &s, 1) < 0)
- return -1;
-
- i = (unsigned char)s[0];
- if (i <= HIGHEST_PROTOCOL) {
- self->proto = i;
- return 0;
- }
-
- PyErr_Format(PyExc_ValueError, "unsupported pickle protocol: %d", i);
- return -1;
-}
-
-static int
-load_frame(PickleState *state, UnpicklerObject *self)
-{
- char *s;
- Py_ssize_t frame_len;
-
- if (_Unpickler_Read(self, state, &s, 8) < 0)
- return -1;
-
- frame_len = calc_binsize(s, 8);
- if (frame_len < 0) {
- PyErr_Format(PyExc_OverflowError,
- "FRAME length exceeds system's maximum of %zd bytes",
- PY_SSIZE_T_MAX);
- return -1;
- }
-
- if (_Unpickler_Read(self, state, &s, frame_len) < 0)
- return -1;
-
- /* Rewind to start of frame */
- self->next_read_idx -= frame_len;
- return 0;
-}
-
-static PyObject *
-load(PickleState *st, UnpicklerObject *self)
-{
- PyObject *value = NULL;
- char *s = NULL;
-
- self->num_marks = 0;
- self->stack->mark_set = 0;
- self->stack->fence = 0;
- self->proto = 0;
- if (Py_SIZE(self->stack))
- Pdata_clear(self->stack, 0);
-
- /* Convenient macros for the dispatch while-switch loop just below. */
-#define OP(opcode, load_func) \
- case opcode: if (load_func(st, self) < 0) break; continue;
-
-#define OP_ARG(opcode, load_func, arg) \
- case opcode: if (load_func(st, self, (arg)) < 0) break; continue;
-
- while (1) {
- if (_Unpickler_Read(self, st, &s, 1) < 0) {
- if (PyErr_ExceptionMatches(st->UnpicklingError)) {
- PyErr_Format(PyExc_EOFError, "Ran out of input");
- }
- return NULL;
- }
-
- switch ((enum opcode)s[0]) {
- OP(NONE, load_none)
- OP(BININT, load_binint)
- OP(BININT1, load_binint1)
- OP(BININT2, load_binint2)
- OP(INT_, load_int)
- OP(LONG_, load_long)
- OP_ARG(LONG1, load_counted_long, 1)
- OP_ARG(LONG4, load_counted_long, 4)
- OP(FLOAT_, load_float)
- OP(BINFLOAT, load_binfloat)
- OP_ARG(SHORT_BINBYTES, load_counted_binbytes, 1)
- OP_ARG(BINBYTES, load_counted_binbytes, 4)
- OP_ARG(BINBYTES8, load_counted_binbytes, 8)
- OP(BYTEARRAY8, load_counted_bytearray)
- OP(NEXT_BUFFER, load_next_buffer)
- OP(READONLY_BUFFER, load_readonly_buffer)
- OP_ARG(SHORT_BINSTRING, load_counted_binstring, 1)
- OP_ARG(BINSTRING, load_counted_binstring, 4)
- OP(STRING, load_string)
- OP(UNICODE, load_unicode)
- OP_ARG(SHORT_BINUNICODE, load_counted_binunicode, 1)
- OP_ARG(BINUNICODE, load_counted_binunicode, 4)
- OP_ARG(BINUNICODE8, load_counted_binunicode, 8)
- OP_ARG(EMPTY_TUPLE, load_counted_tuple, 0)
- OP_ARG(TUPLE1, load_counted_tuple, 1)
- OP_ARG(TUPLE2, load_counted_tuple, 2)
- OP_ARG(TUPLE3, load_counted_tuple, 3)
- OP(TUPLE, load_tuple)
- OP(EMPTY_LIST, load_empty_list)
- OP(LIST, load_list)
- OP(EMPTY_DICT, load_empty_dict)
- OP(DICT, load_dict)
- OP(EMPTY_SET, load_empty_set)
- OP(ADDITEMS, load_additems)
- OP(FROZENSET, load_frozenset)
- OP(OBJ, load_obj)
- OP(INST, load_inst)
- OP_ARG(NEWOBJ, load_newobj, 0)
- OP_ARG(NEWOBJ_EX, load_newobj, 1)
- OP(GLOBAL, load_global)
- OP(STACK_GLOBAL, load_stack_global)
- OP(APPEND, load_append)
- OP(APPENDS, load_appends)
- OP(BUILD, load_build)
- OP(DUP, load_dup)
- OP(BINGET, load_binget)
- OP(LONG_BINGET, load_long_binget)
- OP(GET, load_get)
- OP(MARK, load_mark)
- OP(BINPUT, load_binput)
- OP(LONG_BINPUT, load_long_binput)
- OP(PUT, load_put)
- OP(MEMOIZE, load_memoize)
- OP(POP, load_pop)
- OP(POP_MARK, load_pop_mark)
- OP(SETITEM, load_setitem)
- OP(SETITEMS, load_setitems)
- OP(PERSID, load_persid)
- OP(BINPERSID, load_binpersid)
- OP(REDUCE, load_reduce)
- OP(PROTO, load_proto)
- OP(FRAME, load_frame)
- OP_ARG(EXT1, load_extension, 1)
- OP_ARG(EXT2, load_extension, 2)
- OP_ARG(EXT4, load_extension, 4)
- OP_ARG(NEWTRUE, load_bool, Py_True)
- OP_ARG(NEWFALSE, load_bool, Py_False)
-
- case STOP:
- break;
-
- default:
- {
- unsigned char c = (unsigned char) *s;
- if (0x20 <= c && c <= 0x7e && c != '\'' && c != '\\') {
- PyErr_Format(st->UnpicklingError,
- "invalid load key, '%c'.", c);
- }
- else {
- PyErr_Format(st->UnpicklingError,
- "invalid load key, '\\x%02x'.", c);
- }
- return NULL;
- }
- }
-
- break; /* and we are done! */
- }
-
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- if (_Unpickler_SkipConsumed(self) < 0)
- return NULL;
-
- PDATA_POP(st, self->stack, value);
- return value;
-}
-
-/*[clinic input]
-
-_pickle.Unpickler.load
-
- cls: defining_class
-
-Load a pickle.
-
-Read a pickled object representation from the open file object given
-in the constructor, and return the reconstituted object hierarchy
-specified therein.
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_Unpickler_load_impl(UnpicklerObject *self, PyTypeObject *cls)
-/*[clinic end generated code: output=cc88168f608e3007 input=f5d2f87e61d5f07f]*/
-{
- UnpicklerObject *unpickler = (UnpicklerObject*)self;
-
- PickleState *st = _Pickle_GetStateByClass(cls);
-
- /* Check whether the Unpickler was initialized correctly. This prevents
- segfaulting if a subclass overridden __init__ with a function that does
- not call Unpickler.__init__(). Here, we simply ensure that self->read
- is not NULL. */
- if (unpickler->read == NULL) {
- PyErr_Format(st->UnpicklingError,
- "Unpickler.__init__() was not called by %s.__init__()",
- Py_TYPE(unpickler)->tp_name);
- return NULL;
- }
-
- return load(st, unpickler);
-}
-
-/* The name of find_class() is misleading. In newer pickle protocols, this
- function is used for loading any global (i.e., functions), not just
- classes. The name is kept only for backward compatibility. */
-
-/*[clinic input]
-
-_pickle.Unpickler.find_class
-
- cls: defining_class
- module_name: object
- global_name: object
- /
-
-Return an object from a specified module.
-
-If necessary, the module will be imported. Subclasses may override
-this method (e.g. to restrict unpickling of arbitrary classes and
-functions).
-
-This method is called whenever a class or a function object is
-needed. Both arguments passed are str objects.
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_Unpickler_find_class_impl(UnpicklerObject *self, PyTypeObject *cls,
- PyObject *module_name,
- PyObject *global_name)
-/*[clinic end generated code: output=99577948abb0be81 input=9577745719219fc7]*/
-{
- PyObject *global;
- PyObject *module;
-
- if (PySys_Audit("pickle.find_class", "OO",
- module_name, global_name) < 0) {
- return NULL;
- }
-
- /* Try to map the old names used in Python 2.x to the new ones used in
- Python 3.x. We do this only with old pickle protocols and when the
- user has not disabled the feature. */
- if (self->proto < 3 && self->fix_imports) {
- PyObject *key;
- PyObject *item;
- PickleState *st = _Pickle_GetStateByClass(cls);
-
- /* Check if the global (i.e., a function or a class) was renamed
- or moved to another module. */
- key = PyTuple_Pack(2, module_name, global_name);
- if (key == NULL)
- return NULL;
- item = PyDict_GetItemWithError(st->name_mapping_2to3, key);
- Py_DECREF(key);
- if (item) {
- if (!PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) {
- PyErr_Format(PyExc_RuntimeError,
- "_compat_pickle.NAME_MAPPING values should be "
- "2-tuples, not %.200s", Py_TYPE(item)->tp_name);
- return NULL;
- }
- module_name = PyTuple_GET_ITEM(item, 0);
- global_name = PyTuple_GET_ITEM(item, 1);
- if (!PyUnicode_Check(module_name) ||
- !PyUnicode_Check(global_name)) {
- PyErr_Format(PyExc_RuntimeError,
- "_compat_pickle.NAME_MAPPING values should be "
- "pairs of str, not (%.200s, %.200s)",
- Py_TYPE(module_name)->tp_name,
- Py_TYPE(global_name)->tp_name);
- return NULL;
- }
- }
- else if (PyErr_Occurred()) {
- return NULL;
- }
- else {
- /* Check if the module was renamed. */
- item = PyDict_GetItemWithError(st->import_mapping_2to3, module_name);
- if (item) {
- if (!PyUnicode_Check(item)) {
- PyErr_Format(PyExc_RuntimeError,
- "_compat_pickle.IMPORT_MAPPING values should be "
- "strings, not %.200s", Py_TYPE(item)->tp_name);
- return NULL;
- }
- module_name = item;
- }
- else if (PyErr_Occurred()) {
- return NULL;
- }
- }
- }
-
- /*
- * we don't use PyImport_GetModule here, because it can return partially-
- * initialised modules, which then cause the getattribute to fail.
- */
- module = PyImport_Import(module_name);
- if (module == NULL) {
- return NULL;
- }
- global = getattribute(module, global_name, self->proto >= 4);
- Py_DECREF(module);
- return global;
-}
-
-/*[clinic input]
-
-_pickle.Unpickler.__sizeof__ -> size_t
-
-Returns size in memory, in bytes.
-[clinic start generated code]*/
-
-static size_t
-_pickle_Unpickler___sizeof___impl(UnpicklerObject *self)
-/*[clinic end generated code: output=4648d84c228196df input=27180b2b6b524012]*/
-{
- size_t res = _PyObject_SIZE(Py_TYPE(self));
- if (self->memo != NULL)
- res += self->memo_size * sizeof(PyObject *);
- if (self->marks != NULL)
- res += (size_t)self->marks_size * sizeof(Py_ssize_t);
- if (self->input_line != NULL)
- res += strlen(self->input_line) + 1;
- if (self->encoding != NULL)
- res += strlen(self->encoding) + 1;
- if (self->errors != NULL)
- res += strlen(self->errors) + 1;
- return res;
-}
-
-static struct PyMethodDef Unpickler_methods[] = {
- _PICKLE_UNPICKLER_LOAD_METHODDEF
- _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF
- _PICKLE_UNPICKLER___SIZEOF___METHODDEF
- {NULL, NULL} /* sentinel */
-};
-
-static int
-Unpickler_clear(UnpicklerObject *self)
-{
- Py_CLEAR(self->readline);
- Py_CLEAR(self->readinto);
- Py_CLEAR(self->read);
- Py_CLEAR(self->peek);
- Py_CLEAR(self->stack);
- Py_CLEAR(self->pers_func);
- Py_CLEAR(self->buffers);
- if (self->buffer.buf != NULL) {
- PyBuffer_Release(&self->buffer);
- self->buffer.buf = NULL;
- }
-
- _Unpickler_MemoCleanup(self);
- PyMem_Free(self->marks);
- self->marks = NULL;
- PyMem_Free(self->input_line);
- self->input_line = NULL;
- PyMem_Free(self->encoding);
- self->encoding = NULL;
- PyMem_Free(self->errors);
- self->errors = NULL;
-
- return 0;
-}
-
-static void
-Unpickler_dealloc(UnpicklerObject *self)
-{
- PyTypeObject *tp = Py_TYPE(self);
- PyObject_GC_UnTrack((PyObject *)self);
- (void)Unpickler_clear(self);
- tp->tp_free((PyObject *)self);
- Py_DECREF(tp);
-}
-
-static int
-Unpickler_traverse(UnpicklerObject *self, visitproc visit, void *arg)
-{
- Py_VISIT(Py_TYPE(self));
- Py_VISIT(self->readline);
- Py_VISIT(self->readinto);
- Py_VISIT(self->read);
- Py_VISIT(self->peek);
- Py_VISIT(self->stack);
- Py_VISIT(self->pers_func);
- Py_VISIT(self->buffers);
- PyObject **memo = self->memo;
- if (memo) {
- Py_ssize_t i = self->memo_size;
- while (--i >= 0) {
- Py_VISIT(memo[i]);
- }
- }
- return 0;
-}
-
-/*[clinic input]
-
-_pickle.Unpickler.__init__
-
- file: object
- *
- fix_imports: bool = True
- encoding: str = 'ASCII'
- errors: str = 'strict'
- buffers: object(c_default="NULL") = ()
-
-This takes a binary file for reading a pickle data stream.
-
-The protocol version of the pickle is detected automatically, so no
-protocol argument is needed. Bytes past the pickled object's
-representation are ignored.
-
-The argument *file* must have two methods, a read() method that takes
-an integer argument, and a readline() method that requires no
-arguments. Both methods should return bytes. Thus *file* can be a
-binary file object opened for reading, an io.BytesIO object, or any
-other custom object that meets this interface.
-
-Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
-which are used to control compatibility support for pickle stream
-generated by Python 2. If *fix_imports* is True, pickle will try to
-map the old Python 2 names to the new names used in Python 3. The
-*encoding* and *errors* tell pickle how to decode 8-bit string
-instances pickled by Python 2; these default to 'ASCII' and 'strict',
-respectively. The *encoding* can be 'bytes' to read these 8-bit
-string instances as bytes objects.
-[clinic start generated code]*/
-
-static int
-_pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file,
- int fix_imports, const char *encoding,
- const char *errors, PyObject *buffers)
-/*[clinic end generated code: output=09f0192649ea3f85 input=ca4c1faea9553121]*/
-{
- /* In case of multiple __init__() calls, clear previous content. */
- if (self->read != NULL)
- (void)Unpickler_clear(self);
-
- if (_Unpickler_SetInputStream(self, file) < 0)
- return -1;
-
- if (_Unpickler_SetInputEncoding(self, encoding, errors) < 0)
- return -1;
-
- if (_Unpickler_SetBuffers(self, buffers) < 0)
- return -1;
-
- self->fix_imports = fix_imports;
-
- if (init_method_ref((PyObject *)self, &_Py_ID(persistent_load),
- &self->pers_func, &self->pers_func_self) < 0)
- {
- return -1;
- }
-
- PyTypeObject *tp = Py_TYPE(self);
- PickleState *state = _Pickle_FindStateByType(tp);
- self->stack = (Pdata *)Pdata_New(state);
- if (self->stack == NULL)
- return -1;
-
- self->memo_size = 32;
- self->memo = _Unpickler_NewMemo(self->memo_size);
- if (self->memo == NULL)
- return -1;
-
- self->proto = 0;
-
- return 0;
-}
-
-
-/* Define a proxy object for the Unpickler's internal memo object. This is to
- * avoid breaking code like:
- * unpickler.memo.clear()
- * and
- * unpickler.memo = saved_memo
- * Is this a good idea? Not really, but we don't want to break code that uses
- * it. Note that we don't implement the entire mapping API here. This is
- * intentional, as these should be treated as black-box implementation details.
- *
- * We do, however, have to implement pickling/unpickling support because of
- * real-world code like cvs2svn.
- */
-
-/*[clinic input]
-_pickle.UnpicklerMemoProxy.clear
-
-Remove all items from memo.
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_UnpicklerMemoProxy_clear_impl(UnpicklerMemoProxyObject *self)
-/*[clinic end generated code: output=d20cd43f4ba1fb1f input=b1df7c52e7afd9bd]*/
-{
- _Unpickler_MemoCleanup(self->unpickler);
- self->unpickler->memo = _Unpickler_NewMemo(self->unpickler->memo_size);
- if (self->unpickler->memo == NULL)
- return NULL;
- Py_RETURN_NONE;
-}
-
-/*[clinic input]
-_pickle.UnpicklerMemoProxy.copy
-
-Copy the memo to a new object.
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_UnpicklerMemoProxy_copy_impl(UnpicklerMemoProxyObject *self)
-/*[clinic end generated code: output=e12af7e9bc1e4c77 input=97769247ce032c1d]*/
-{
- size_t i;
- PyObject *new_memo = PyDict_New();
- if (new_memo == NULL)
- return NULL;
-
- for (i = 0; i < self->unpickler->memo_size; i++) {
- int status;
- PyObject *key, *value;
-
- value = self->unpickler->memo[i];
- if (value == NULL)
- continue;
-
- key = PyLong_FromSsize_t(i);
- if (key == NULL)
- goto error;
- status = PyDict_SetItem(new_memo, key, value);
- Py_DECREF(key);
- if (status < 0)
- goto error;
- }
- return new_memo;
-
-error:
- Py_DECREF(new_memo);
- return NULL;
-}
-
-/*[clinic input]
-_pickle.UnpicklerMemoProxy.__reduce__
-
-Implement pickling support.
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_UnpicklerMemoProxy___reduce___impl(UnpicklerMemoProxyObject *self)
-/*[clinic end generated code: output=6da34ac048d94cca input=6920862413407199]*/
-{
- PyObject *reduce_value;
- PyObject *constructor_args;
- PyObject *contents = _pickle_UnpicklerMemoProxy_copy_impl(self);
- if (contents == NULL)
- return NULL;
-
- reduce_value = PyTuple_New(2);
- if (reduce_value == NULL) {
- Py_DECREF(contents);
- return NULL;
- }
- constructor_args = PyTuple_New(1);
- if (constructor_args == NULL) {
- Py_DECREF(contents);
- Py_DECREF(reduce_value);
- return NULL;
- }
- PyTuple_SET_ITEM(constructor_args, 0, contents);
- PyTuple_SET_ITEM(reduce_value, 0, Py_NewRef(&PyDict_Type));
- PyTuple_SET_ITEM(reduce_value, 1, constructor_args);
- return reduce_value;
-}
-
-static PyMethodDef unpicklerproxy_methods[] = {
- _PICKLE_UNPICKLERMEMOPROXY_CLEAR_METHODDEF
- _PICKLE_UNPICKLERMEMOPROXY_COPY_METHODDEF
- _PICKLE_UNPICKLERMEMOPROXY___REDUCE___METHODDEF
- {NULL, NULL} /* sentinel */
-};
-
-static void
-UnpicklerMemoProxy_dealloc(UnpicklerMemoProxyObject *self)
-{
- PyTypeObject *tp = Py_TYPE(self);
- PyObject_GC_UnTrack(self);
- Py_CLEAR(self->unpickler);
- tp->tp_free((PyObject *)self);
- Py_DECREF(tp);
-}
-
-static int
-UnpicklerMemoProxy_traverse(UnpicklerMemoProxyObject *self,
- visitproc visit, void *arg)
-{
- Py_VISIT(Py_TYPE(self));
- Py_VISIT(self->unpickler);
- return 0;
-}
-
-static int
-UnpicklerMemoProxy_clear(UnpicklerMemoProxyObject *self)
-{
- Py_CLEAR(self->unpickler);
- return 0;
-}
-
-static PyType_Slot unpickler_memoproxy_slots[] = {
- {Py_tp_dealloc, UnpicklerMemoProxy_dealloc},
- {Py_tp_traverse, UnpicklerMemoProxy_traverse},
- {Py_tp_clear, UnpicklerMemoProxy_clear},
- {Py_tp_methods, unpicklerproxy_methods},
- {Py_tp_hash, PyObject_HashNotImplemented},
- {0, NULL},
-};
-
-static PyType_Spec unpickler_memoproxy_spec = {
- .name = "_pickle.UnpicklerMemoProxy",
- .basicsize = sizeof(UnpicklerMemoProxyObject),
- .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
- Py_TPFLAGS_IMMUTABLETYPE),
- .slots = unpickler_memoproxy_slots,
-};
-
-static PyObject *
-UnpicklerMemoProxy_New(UnpicklerObject *unpickler)
-{
- PickleState *state = _Pickle_FindStateByType(Py_TYPE(unpickler));
- UnpicklerMemoProxyObject *self;
- self = PyObject_GC_New(UnpicklerMemoProxyObject,
- state->UnpicklerMemoProxyType);
- if (self == NULL)
- return NULL;
- self->unpickler = (UnpicklerObject*)Py_NewRef(unpickler);
- PyObject_GC_Track(self);
- return (PyObject *)self;
-}
-
-/*****************************************************************************/
-
-
-static PyObject *
-Unpickler_get_memo(UnpicklerObject *self, void *Py_UNUSED(ignored))
-{
- return UnpicklerMemoProxy_New(self);
-}
-
-static int
-Unpickler_set_memo(UnpicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored))
-{
- PyObject **new_memo;
- size_t new_memo_size = 0;
-
- if (obj == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "attribute deletion is not supported");
- return -1;
- }
-
- PickleState *state = _Pickle_FindStateByType(Py_TYPE(self));
- if (Py_IS_TYPE(obj, state->UnpicklerMemoProxyType)) {
- UnpicklerObject *unpickler =
- ((UnpicklerMemoProxyObject *)obj)->unpickler;
-
- new_memo_size = unpickler->memo_size;
- new_memo = _Unpickler_NewMemo(new_memo_size);
- if (new_memo == NULL)
- return -1;
-
- for (size_t i = 0; i < new_memo_size; i++) {
- new_memo[i] = Py_XNewRef(unpickler->memo[i]);
- }
- }
- else if (PyDict_Check(obj)) {
- Py_ssize_t i = 0;
- PyObject *key, *value;
-
- new_memo_size = PyDict_GET_SIZE(obj);
- new_memo = _Unpickler_NewMemo(new_memo_size);
- if (new_memo == NULL)
- return -1;
-
- while (PyDict_Next(obj, &i, &key, &value)) {
- Py_ssize_t idx;
- if (!PyLong_Check(key)) {
- PyErr_SetString(PyExc_TypeError,
- "memo key must be integers");
- goto error;
- }
- idx = PyLong_AsSsize_t(key);
- if (idx == -1 && PyErr_Occurred())
- goto error;
- if (idx < 0) {
- PyErr_SetString(PyExc_ValueError,
- "memo key must be positive integers.");
- goto error;
- }
- if (_Unpickler_MemoPut(self, idx, value) < 0)
- goto error;
- }
- }
- else {
- PyErr_Format(PyExc_TypeError,
- "'memo' attribute must be an UnpicklerMemoProxy object "
- "or dict, not %.200s", Py_TYPE(obj)->tp_name);
- return -1;
- }
-
- _Unpickler_MemoCleanup(self);
- self->memo_size = new_memo_size;
- self->memo = new_memo;
-
- return 0;
-
- error:
- if (new_memo_size) {
- for (size_t i = new_memo_size - 1; i != SIZE_MAX; i--) {
- Py_XDECREF(new_memo[i]);
- }
- PyMem_Free(new_memo);
- }
- return -1;
-}
-
-static PyObject *
-Unpickler_get_persload(UnpicklerObject *self, void *Py_UNUSED(ignored))
-{
- if (self->pers_func == NULL) {
- PyErr_SetString(PyExc_AttributeError, "persistent_load");
- return NULL;
- }
- return reconstruct_method(self->pers_func, self->pers_func_self);
-}
-
-static int
-Unpickler_set_persload(UnpicklerObject *self, PyObject *value, void *Py_UNUSED(ignored))
-{
- if (value == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "attribute deletion is not supported");
- return -1;
- }
- if (!PyCallable_Check(value)) {
- PyErr_SetString(PyExc_TypeError,
- "persistent_load must be a callable taking "
- "one argument");
- return -1;
- }
-
- self->pers_func_self = NULL;
- Py_XSETREF(self->pers_func, Py_NewRef(value));
-
- return 0;
-}
-
-static PyGetSetDef Unpickler_getsets[] = {
- {"memo", (getter)Unpickler_get_memo, (setter)Unpickler_set_memo},
- {"persistent_load", (getter)Unpickler_get_persload,
- (setter)Unpickler_set_persload},
- {NULL}
-};
-
-static PyType_Slot unpickler_type_slots[] = {
- {Py_tp_dealloc, Unpickler_dealloc},
- {Py_tp_doc, (char *)_pickle_Unpickler___init____doc__},
- {Py_tp_traverse, Unpickler_traverse},
- {Py_tp_clear, Unpickler_clear},
- {Py_tp_methods, Unpickler_methods},
- {Py_tp_getset, Unpickler_getsets},
- {Py_tp_init, _pickle_Unpickler___init__},
- {Py_tp_alloc, PyType_GenericAlloc},
- {Py_tp_new, PyType_GenericNew},
- {Py_tp_free, PyObject_GC_Del},
- {0, NULL},
-};
-
-static PyType_Spec unpickler_type_spec = {
- .name = "_pickle.Unpickler",
- .basicsize = sizeof(UnpicklerObject),
- .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
- Py_TPFLAGS_IMMUTABLETYPE),
- .slots = unpickler_type_slots,
-};
-
-/*[clinic input]
-
-_pickle.dump
-
- obj: object
- file: object
- protocol: object = None
- *
- fix_imports: bool = True
- buffer_callback: object = None
-
-Write a pickled representation of obj to the open file object file.
-
-This is equivalent to ``Pickler(file, protocol).dump(obj)``, but may
-be more efficient.
-
-The optional *protocol* argument tells the pickler to use the given
-protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default
-protocol is 4. It was introduced in Python 3.4, and is incompatible
-with previous versions.
-
-Specifying a negative protocol version selects the highest protocol
-version supported. The higher the protocol used, the more recent the
-version of Python needed to read the pickle produced.
-
-The *file* argument must have a write() method that accepts a single
-bytes argument. It can thus be a file object opened for binary
-writing, an io.BytesIO instance, or any other custom object that meets
-this interface.
-
-If *fix_imports* is True and protocol is less than 3, pickle will try
-to map the new Python 3 names to the old module names used in Python
-2, so that the pickle data stream is readable with Python 2.
-
-If *buffer_callback* is None (the default), buffer views are serialized
-into *file* as part of the pickle stream. It is an error if
-*buffer_callback* is not None and *protocol* is None or smaller than 5.
-
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_dump_impl(PyObject *module, PyObject *obj, PyObject *file,
- PyObject *protocol, int fix_imports,
- PyObject *buffer_callback)
-/*[clinic end generated code: output=706186dba996490c input=5ed6653da99cd97c]*/
-{
- PickleState *state = _Pickle_GetState(module);
- PicklerObject *pickler = _Pickler_New(state);
-
- if (pickler == NULL)
- return NULL;
-
- if (_Pickler_SetProtocol(pickler, protocol, fix_imports) < 0)
- goto error;
-
- if (_Pickler_SetOutputStream(pickler, file) < 0)
- goto error;
-
- if (_Pickler_SetBufferCallback(pickler, buffer_callback) < 0)
- goto error;
-
- if (dump(state, pickler, obj) < 0)
- goto error;
-
- if (_Pickler_FlushToFile(pickler) < 0)
- goto error;
-
- Py_DECREF(pickler);
- Py_RETURN_NONE;
-
- error:
- Py_XDECREF(pickler);
- return NULL;
-}
-
-/*[clinic input]
-
-_pickle.dumps
-
- obj: object
- protocol: object = None
- *
- fix_imports: bool = True
- buffer_callback: object = None
-
-Return the pickled representation of the object as a bytes object.
-
-The optional *protocol* argument tells the pickler to use the given
-protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default
-protocol is 4. It was introduced in Python 3.4, and is incompatible
-with previous versions.
-
-Specifying a negative protocol version selects the highest protocol
-version supported. The higher the protocol used, the more recent the
-version of Python needed to read the pickle produced.
-
-If *fix_imports* is True and *protocol* is less than 3, pickle will
-try to map the new Python 3 names to the old module names used in
-Python 2, so that the pickle data stream is readable with Python 2.
-
-If *buffer_callback* is None (the default), buffer views are serialized
-into *file* as part of the pickle stream. It is an error if
-*buffer_callback* is not None and *protocol* is None or smaller than 5.
-
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_dumps_impl(PyObject *module, PyObject *obj, PyObject *protocol,
- int fix_imports, PyObject *buffer_callback)
-/*[clinic end generated code: output=fbab0093a5580fdf input=e543272436c6f987]*/
-{
- PyObject *result;
- PickleState *state = _Pickle_GetState(module);
- PicklerObject *pickler = _Pickler_New(state);
-
- if (pickler == NULL)
- return NULL;
-
- if (_Pickler_SetProtocol(pickler, protocol, fix_imports) < 0)
- goto error;
-
- if (_Pickler_SetBufferCallback(pickler, buffer_callback) < 0)
- goto error;
-
- if (dump(state, pickler, obj) < 0)
- goto error;
-
- result = _Pickler_GetString(pickler);
- Py_DECREF(pickler);
- return result;
-
- error:
- Py_XDECREF(pickler);
- return NULL;
-}
-
-/*[clinic input]
-
-_pickle.load
-
- file: object
- *
- fix_imports: bool = True
- encoding: str = 'ASCII'
- errors: str = 'strict'
- buffers: object(c_default="NULL") = ()
-
-Read and return an object from the pickle data stored in a file.
-
-This is equivalent to ``Unpickler(file).load()``, but may be more
-efficient.
-
-The protocol version of the pickle is detected automatically, so no
-protocol argument is needed. Bytes past the pickled object's
-representation are ignored.
-
-The argument *file* must have two methods, a read() method that takes
-an integer argument, and a readline() method that requires no
-arguments. Both methods should return bytes. Thus *file* can be a
-binary file object opened for reading, an io.BytesIO object, or any
-other custom object that meets this interface.
-
-Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
-which are used to control compatibility support for pickle stream
-generated by Python 2. If *fix_imports* is True, pickle will try to
-map the old Python 2 names to the new names used in Python 3. The
-*encoding* and *errors* tell pickle how to decode 8-bit string
-instances pickled by Python 2; these default to 'ASCII' and 'strict',
-respectively. The *encoding* can be 'bytes' to read these 8-bit
-string instances as bytes objects.
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_load_impl(PyObject *module, PyObject *file, int fix_imports,
- const char *encoding, const char *errors,
- PyObject *buffers)
-/*[clinic end generated code: output=250452d141c23e76 input=46c7c31c92f4f371]*/
-{
- PyObject *result;
- UnpicklerObject *unpickler = _Unpickler_New(module);
-
- if (unpickler == NULL)
- return NULL;
-
- if (_Unpickler_SetInputStream(unpickler, file) < 0)
- goto error;
-
- if (_Unpickler_SetInputEncoding(unpickler, encoding, errors) < 0)
- goto error;
-
- if (_Unpickler_SetBuffers(unpickler, buffers) < 0)
- goto error;
-
- unpickler->fix_imports = fix_imports;
-
- PickleState *state = _Pickle_GetState(module);
- result = load(state, unpickler);
- Py_DECREF(unpickler);
- return result;
-
- error:
- Py_XDECREF(unpickler);
- return NULL;
-}
-
-/*[clinic input]
-
-_pickle.loads
-
- data: object
- /
- *
- fix_imports: bool = True
- encoding: str = 'ASCII'
- errors: str = 'strict'
- buffers: object(c_default="NULL") = ()
-
-Read and return an object from the given pickle data.
-
-The protocol version of the pickle is detected automatically, so no
-protocol argument is needed. Bytes past the pickled object's
-representation are ignored.
-
-Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
-which are used to control compatibility support for pickle stream
-generated by Python 2. If *fix_imports* is True, pickle will try to
-map the old Python 2 names to the new names used in Python 3. The
-*encoding* and *errors* tell pickle how to decode 8-bit string
-instances pickled by Python 2; these default to 'ASCII' and 'strict',
-respectively. The *encoding* can be 'bytes' to read these 8-bit
-string instances as bytes objects.
-[clinic start generated code]*/
-
-static PyObject *
-_pickle_loads_impl(PyObject *module, PyObject *data, int fix_imports,
- const char *encoding, const char *errors,
- PyObject *buffers)
-/*[clinic end generated code: output=82ac1e6b588e6d02 input=b3615540d0535087]*/
-{
- PyObject *result;
- UnpicklerObject *unpickler = _Unpickler_New(module);
-
- if (unpickler == NULL)
- return NULL;
-
- if (_Unpickler_SetStringInput(unpickler, data) < 0)
- goto error;
-
- if (_Unpickler_SetInputEncoding(unpickler, encoding, errors) < 0)
- goto error;
-
- if (_Unpickler_SetBuffers(unpickler, buffers) < 0)
- goto error;
-
- unpickler->fix_imports = fix_imports;
-
- PickleState *state = _Pickle_GetState(module);
- result = load(state, unpickler);
- Py_DECREF(unpickler);
- return result;
-
- error:
- Py_XDECREF(unpickler);
- return NULL;
-}
-
-static struct PyMethodDef pickle_methods[] = {
- _PICKLE_DUMP_METHODDEF
- _PICKLE_DUMPS_METHODDEF
- _PICKLE_LOAD_METHODDEF
- _PICKLE_LOADS_METHODDEF
- {NULL, NULL} /* sentinel */
-};
-
-static int
-pickle_clear(PyObject *m)
-{
- _Pickle_ClearState(_Pickle_GetState(m));
- return 0;
-}
-
-static void
-pickle_free(PyObject *m)
-{
- _Pickle_ClearState(_Pickle_GetState(m));
-}
-
-static int
-pickle_traverse(PyObject *m, visitproc visit, void *arg)
-{
- PickleState *st = _Pickle_GetState(m);
- Py_VISIT(st->PickleError);
- Py_VISIT(st->PicklingError);
- Py_VISIT(st->UnpicklingError);
- Py_VISIT(st->dispatch_table);
- Py_VISIT(st->extension_registry);
- Py_VISIT(st->extension_cache);
- Py_VISIT(st->inverted_registry);
- Py_VISIT(st->name_mapping_2to3);
- Py_VISIT(st->import_mapping_2to3);
- Py_VISIT(st->name_mapping_3to2);
- Py_VISIT(st->import_mapping_3to2);
- Py_VISIT(st->codecs_encode);
- Py_VISIT(st->getattr);
- Py_VISIT(st->partial);
- Py_VISIT(st->Pickler_Type);
- Py_VISIT(st->Unpickler_Type);
- Py_VISIT(st->Pdata_Type);
- Py_VISIT(st->PicklerMemoProxyType);
- Py_VISIT(st->UnpicklerMemoProxyType);
- return 0;
-}
-
-static int
-_pickle_exec(PyObject *m)
-{
- PickleState *st = _Pickle_GetState(m);
-
-#define CREATE_TYPE(mod, type, spec) \
- do { \
- type = (PyTypeObject *)PyType_FromMetaclass(NULL, mod, spec, NULL); \
- if (type == NULL) { \
- return -1; \
- } \
- } while (0)
-
- CREATE_TYPE(m, st->Pdata_Type, &pdata_spec);
- CREATE_TYPE(m, st->PicklerMemoProxyType, &memoproxy_spec);
- CREATE_TYPE(m, st->UnpicklerMemoProxyType, &unpickler_memoproxy_spec);
- CREATE_TYPE(m, st->Pickler_Type, &pickler_type_spec);
- CREATE_TYPE(m, st->Unpickler_Type, &unpickler_type_spec);
-
-#undef CREATE_TYPE
-
- /* Add types */
- if (PyModule_AddType(m, &PyPickleBuffer_Type) < 0) {
- return -1;
- }
- if (PyModule_AddType(m, st->Pickler_Type) < 0) {
- return -1;
- }
- if (PyModule_AddType(m, st->Unpickler_Type) < 0) {
- return -1;
- }
-
- /* Initialize the exceptions. */
- st->PickleError = PyErr_NewException("_pickle.PickleError", NULL, NULL);
- if (st->PickleError == NULL)
- return -1;
- st->PicklingError = \
- PyErr_NewException("_pickle.PicklingError", st->PickleError, NULL);
- if (st->PicklingError == NULL)
- return -1;
- st->UnpicklingError = \
- PyErr_NewException("_pickle.UnpicklingError", st->PickleError, NULL);
- if (st->UnpicklingError == NULL)
- return -1;
-
- if (PyModule_AddObjectRef(m, "PickleError", st->PickleError) < 0) {
- return -1;
- }
- if (PyModule_AddObjectRef(m, "PicklingError", st->PicklingError) < 0) {
- return -1;
- }
- if (PyModule_AddObjectRef(m, "UnpicklingError", st->UnpicklingError) < 0) {
- return -1;
- }
-
- if (_Pickle_InitState(st) < 0)
- return -1;
-
- return 0;
-}
-
-static PyModuleDef_Slot pickle_slots[] = {
- {Py_mod_exec, _pickle_exec},
- {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
- {0, NULL},
-};
-
-static struct PyModuleDef _picklemodule = {
- PyModuleDef_HEAD_INIT,
- .m_name = "_pickle",
- .m_doc = pickle_module_doc,
- .m_size = sizeof(PickleState),
- .m_methods = pickle_methods,
- .m_slots = pickle_slots,
- .m_traverse = pickle_traverse,
- .m_clear = pickle_clear,
- .m_free = (freefunc)pickle_free,
-};
-
-PyMODINIT_FUNC
-PyInit__pickle(void)
-{
- return PyModuleDef_Init(&_picklemodule);
-}
diff --git a/contrib/tools/python3/src/Modules/_sqlite/ya.make b/contrib/tools/python3/src/Modules/_sqlite/ya.make
deleted file mode 100644
index f262ffabffc..00000000000
--- a/contrib/tools/python3/src/Modules/_sqlite/ya.make
+++ /dev/null
@@ -1,47 +0,0 @@
-# Generated by devtools/yamaker.
-
-LIBRARY()
-
-VERSION(3.12.2)
-
-ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.12.2.tar.gz)
-
-LICENSE(Python-2.0)
-
-PEERDIR(
- contrib/libs/sqlite3
-)
-
-ADDINCL(
- contrib/libs/sqlite3
- contrib/tools/python3/src/Include
- contrib/tools/python3/src/Include/internal
-)
-
-PYTHON3_ADDINCL()
-
-NO_COMPILER_WARNINGS()
-
-NO_RUNTIME()
-
-CFLAGS(
- -DMODULE_NAME=sqlite3
-)
-
-SRCS(
- blob.c
- connection.c
- cursor.c
- microprotocols.c
- module.c
- prepare_protocol.c
- row.c
- statement.c
- util.c
-)
-
-PY_REGISTER(
- _sqlite3
-)
-
-END()
diff --git a/contrib/tools/python3/src/Modules/ya.make b/contrib/tools/python3/src/Modules/ya.make
deleted file mode 100644
index 3f05b27353b..00000000000
--- a/contrib/tools/python3/src/Modules/ya.make
+++ /dev/null
@@ -1,188 +0,0 @@
-# Generated by devtools/yamaker.
-
-LIBRARY()
-
-VERSION(3.12.2)
-
-ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.12.2.tar.gz)
-
-LICENSE(Python-2.0)
-
-PEERDIR(
- contrib/libs/expat
- contrib/libs/libbz2
- contrib/libs/libc_compat
- contrib/libs/lzma
- contrib/libs/openssl
- contrib/libs/zlib
- contrib/restricted/libffi
- library/cpp/sanitizer/include
-)
-
-ADDINCL(
- contrib/libs/expat
- contrib/libs/libbz2
- contrib/restricted/libffi/include
- contrib/tools/python3/src/Include
- contrib/tools/python3/src/Include/internal
- contrib/tools/python3/src/Modules
- contrib/tools/python3/src/Modules/_decimal/libmpdec
- contrib/tools/python3/src/Modules/_hacl/include
-)
-
-NO_COMPILER_WARNINGS()
-
-NO_RUNTIME()
-
-CFLAGS(
- -DPy_BUILD_CORE
- -DPy_BUILD_CORE_BUILTIN
-)
-
-SRCS(
- _abc.c
- _asynciomodule.c
- _bisectmodule.c
- _blake2/blake2b_impl.c
- _blake2/blake2module.c
- _blake2/blake2s_impl.c
- _bz2module.c
- _codecsmodule.c
- _collectionsmodule.c
- _contextvarsmodule.c
- _csv.c
- _ctypes/_ctypes.c
- _ctypes/callbacks.c
- _ctypes/callproc.c
- _ctypes/cfield.c
- _ctypes/stgdict.c
- _datetimemodule.c
- _decimal/_decimal.c
- _decimal/libmpdec/basearith.c
- _decimal/libmpdec/constants.c
- _decimal/libmpdec/context.c
- _decimal/libmpdec/convolute.c
- _decimal/libmpdec/crt.c
- _decimal/libmpdec/difradix2.c
- _decimal/libmpdec/fnt.c
- _decimal/libmpdec/fourstep.c
- _decimal/libmpdec/io.c
- _decimal/libmpdec/mpalloc.c
- _decimal/libmpdec/mpdecimal.c
- _decimal/libmpdec/mpsignal.c
- _decimal/libmpdec/numbertheory.c
- _decimal/libmpdec/sixstep.c
- _decimal/libmpdec/transpose.c
- _elementtree.c
- _functoolsmodule.c
- _hacl/Hacl_Hash_MD5.c
- _hacl/Hacl_Hash_SHA1.c
- _hacl/Hacl_Hash_SHA2.c
- _hacl/Hacl_Hash_SHA3.c
- _hashopenssl.c
- _heapqmodule.c
- _io/_iomodule.c
- _io/bufferedio.c
- _io/bytesio.c
- _io/fileio.c
- _io/iobase.c
- _io/stringio.c
- _io/textio.c
- _io/winconsoleio.c
- _json.c
- _localemodule.c
- _lsprof.c
- _lzmamodule.c
- _multiprocessing/multiprocessing.c
- _multiprocessing/posixshmem.c
- _multiprocessing/semaphore.c
- _opcode.c
- _operator.c
- _pickle.c
- _queuemodule.c
- _randommodule.c
- _sre/sre.c
- _ssl.c
- _stat.c
- _statisticsmodule.c
- _struct.c
- _threadmodule.c
- _tracemalloc.c
- _typingmodule.c
- _weakref.c
- _xxinterpchannelsmodule.c
- _xxsubinterpretersmodule.c
- _xxtestfuzz/_xxtestfuzz.c
- _xxtestfuzz/fuzzer.c
- _zoneinfo.c
- arraymodule.c
- atexitmodule.c
- audioop.c
- binascii.c
- cjkcodecs/_codecs_cn.c
- cjkcodecs/_codecs_hk.c
- cjkcodecs/_codecs_iso2022.c
- cjkcodecs/_codecs_jp.c
- cjkcodecs/_codecs_kr.c
- cjkcodecs/_codecs_tw.c
- cjkcodecs/multibytecodec.c
- cmathmodule.c
- config.c
- errnomodule.c
- faulthandler.c
- gcmodule.c
- getbuildinfo.c
- getpath.c
- itertoolsmodule.c
- main.c
- mathmodule.c
- md5module.c
- mmapmodule.c
- posixmodule.c
- pyexpat.c
- rotatingtree.c
- selectmodule.c
- sha1module.c
- sha2module.c
- sha3module.c
- signalmodule.c
- socketmodule.c
- symtablemodule.c
- timemodule.c
- unicodedata.c
- zlibmodule.c
-)
-
-IF (OS_WINDOWS)
- SRCS(
- _winapi.c
- overlapped.c
- )
-ELSE()
- SRCS(
- _cryptmodule.c
- _posixsubprocess.c
- fcntlmodule.c
- grpmodule.c
- pwdmodule.c
- resource.c
- syslogmodule.c
- termios.c
- )
-
- IF (OS_DARWIN)
- SRCS(
- _scproxy.c
- )
- ELSEIF (OS_LINUX)
- IF (NOT MUSL)
- EXTRALIBS(crypt)
- ENDIF()
-
- SRCS(
- spwdmodule.c
- )
- ENDIF()
-ENDIF()
-
-END()
diff --git a/contrib/tools/python3/src/ya.make b/contrib/tools/python3/src/ya.make
deleted file mode 100644
index 1b6a693192f..00000000000
--- a/contrib/tools/python3/src/ya.make
+++ /dev/null
@@ -1,197 +0,0 @@
-# Generated by devtools/yamaker.
-
-LIBRARY()
-
-VERSION(3.12.2)
-
-ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.12.2.tar.gz)
-
-LICENSE(Python-2.0)
-
-PEERDIR(
- contrib/libs/libc_compat
- contrib/tools/python3/src/Modules
- library/cpp/sanitizer/include
-)
-
-ADDINCL(
- contrib/tools/python3/src/Include
- contrib/tools/python3/src/Include/internal
- contrib/tools/python3/src/PC
-)
-
-NO_COMPILER_WARNINGS()
-
-NO_UTIL()
-
-CFLAGS(
- -DPy_BUILD_CORE
-)
-
-IF (CLANG_CL)
- CFLAGS(
- -Wno-invalid-token-paste
- )
-ENDIF()
-
-IF (OS_DARWIN)
- LDFLAGS(
- -framework CoreFoundation
- -framework SystemConfiguration
- )
-ELSEIF (OS_WINDOWS)
- CFLAGS(
- -DPY3_DLLNAME=L\"python3\"
- )
-
- LDFLAGS(
- Mincore.lib
- Shlwapi.lib
- Winmm.lib
- )
-
- # DISABLE(MSVC_INLINE_OPTIMIZED)
-ENDIF()
-
-SRCS(
- Objects/abstract.c
- Objects/boolobject.c
- Objects/bytearrayobject.c
- Objects/bytes_methods.c
- Objects/bytesobject.c
- Objects/call.c
- Objects/capsule.c
- Objects/cellobject.c
- Objects/classobject.c
- Objects/codeobject.c
- Objects/complexobject.c
- Objects/descrobject.c
- Objects/dictobject.c
- Objects/enumobject.c
- Objects/exceptions.c
- Objects/fileobject.c
- Objects/floatobject.c
- Objects/frameobject.c
- Objects/funcobject.c
- Objects/genericaliasobject.c
- Objects/genobject.c
- Objects/interpreteridobject.c
- Objects/iterobject.c
- Objects/listobject.c
- Objects/longobject.c
- Objects/memoryobject.c
- Objects/methodobject.c
- Objects/moduleobject.c
- Objects/namespaceobject.c
- Objects/object.c
- Objects/obmalloc.c
- Objects/odictobject.c
- Objects/picklebufobject.c
- Objects/rangeobject.c
- Objects/setobject.c
- Objects/sliceobject.c
- Objects/structseq.c
- Objects/tupleobject.c
- Objects/typeobject.c
- Objects/typevarobject.c
- Objects/unicodectype.c
- Objects/unicodeobject.c
- Objects/unionobject.c
- Objects/weakrefobject.c
- Parser/action_helpers.c
- Parser/myreadline.c
- Parser/parser.c
- Parser/peg_api.c
- Parser/pegen.c
- Parser/pegen_errors.c
- Parser/string_parser.c
- Parser/token.c
- Parser/tokenizer.c
- Python/Python-ast.c
- Python/Python-tokenize.c
- Python/_warnings.c
- Python/asdl.c
- Python/assemble.c
- Python/ast.c
- Python/ast_opt.c
- Python/ast_unparse.c
- Python/bltinmodule.c
- Python/bootstrap_hash.c
- Python/ceval.c
- Python/ceval_gil.c
- Python/codecs.c
- Python/compile.c
- Python/context.c
- Python/deepfreeze/deepfreeze.c
- Python/dtoa.c
- Python/dynamic_annotations.c
- Python/errors.c
- Python/fileutils.c
- Python/flowgraph.c
- Python/formatter_unicode.c
- Python/frame.c
- Python/frozen.c
- Python/future.c
- Python/getargs.c
- Python/getcompiler.c
- Python/getcopyright.c
- Python/getopt.c
- Python/getplatform.c
- Python/getversion.c
- Python/hamt.c
- Python/hashtable.c
- Python/import.c
- Python/importdl.c
- Python/initconfig.c
- Python/instrumentation.c
- Python/intrinsics.c
- Python/legacy_tracing.c
- Python/marshal.c
- Python/modsupport.c
- Python/mysnprintf.c
- Python/mystrtoul.c
- Python/pathconfig.c
- Python/perf_trampoline.c
- Python/preconfig.c
- Python/pyarena.c
- Python/pyctype.c
- Python/pyfpe.c
- Python/pyhash.c
- Python/pylifecycle.c
- Python/pymath.c
- Python/pystate.c
- Python/pystrcmp.c
- Python/pystrhex.c
- Python/pystrtod.c
- Python/pythonrun.c
- Python/pytime.c
- Python/specialize.c
- Python/structmember.c
- Python/suggestions.c
- Python/symtable.c
- Python/sysmodule.c
- Python/thread.c
- Python/traceback.c
- Python/tracemalloc.c
-)
-
-IF (OS_WINDOWS)
- SRCS(
- PC/WinMain.c
- PC/invalid_parameter_handler.c
- PC/msvcrtmodule.c
- PC/winreg.c
- PC/winsound.c
- Python/dynload_win.c
- )
-ELSE()
- SRCS(
- Python/dynload_shlib.c
- )
-ENDIF()
-
-SUPPRESSIONS(
- tsan.supp
-)
-
-END()
diff --git a/contrib/tools/python3/src/tsan.supp b/contrib/tools/python3/tsan.supp
index 65dce089ffc..65dce089ffc 100644
--- a/contrib/tools/python3/src/tsan.supp
+++ b/contrib/tools/python3/tsan.supp
diff --git a/contrib/tools/python3/ya.make b/contrib/tools/python3/ya.make
index 36d93b491f9..6bc4b6d1bff 100644
--- a/contrib/tools/python3/ya.make
+++ b/contrib/tools/python3/ya.make
@@ -1,6 +1,6 @@
# Generated by devtools/yamaker from nixpkgs 22.11.
-PROGRAM()
+LIBRARY()
VERSION(3.12.2)
@@ -8,25 +8,203 @@ ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.12.2.tar.gz)
LICENSE(Python-2.0)
-USE_PYTHON3()
-
PEERDIR(
- contrib/tools/python3/src/Modules/_sqlite
+ contrib/libs/libc_compat
+ contrib/tools/python3/Modules
+ library/cpp/sanitizer/include
+)
+
+ADDINCL(
+ contrib/tools/python3/Include
+ contrib/tools/python3/Include/internal
+ contrib/tools/python3/PC
)
+NO_COMPILER_WARNINGS()
+
+NO_UTIL()
+
CFLAGS(
-DPy_BUILD_CORE
)
+IF (CLANG_CL)
+ CFLAGS(
+ -Wno-invalid-token-paste
+ )
+ENDIF()
+
+IF (OS_DARWIN)
+ LDFLAGS(
+ -framework CoreFoundation
+ -framework SystemConfiguration
+ )
+ELSEIF (OS_WINDOWS)
+ CFLAGS(
+ -DPY3_DLLNAME=L\"python3\"
+ )
+
+ LDFLAGS(
+ Mincore.lib
+ Shlwapi.lib
+ Winmm.lib
+ )
+
+ # DISABLE(MSVC_INLINE_OPTIMIZED)
+ENDIF()
+
SRCS(
- src/Programs/python.c
+ Objects/abstract.c
+ Objects/boolobject.c
+ Objects/bytearrayobject.c
+ Objects/bytes_methods.c
+ Objects/bytesobject.c
+ Objects/call.c
+ Objects/capsule.c
+ Objects/cellobject.c
+ Objects/classobject.c
+ Objects/codeobject.c
+ Objects/complexobject.c
+ Objects/descrobject.c
+ Objects/dictobject.c
+ Objects/enumobject.c
+ Objects/exceptions.c
+ Objects/fileobject.c
+ Objects/floatobject.c
+ Objects/frameobject.c
+ Objects/funcobject.c
+ Objects/genericaliasobject.c
+ Objects/genobject.c
+ Objects/interpreteridobject.c
+ Objects/iterobject.c
+ Objects/listobject.c
+ Objects/longobject.c
+ Objects/memoryobject.c
+ Objects/methodobject.c
+ Objects/moduleobject.c
+ Objects/namespaceobject.c
+ Objects/object.c
+ Objects/obmalloc.c
+ Objects/odictobject.c
+ Objects/picklebufobject.c
+ Objects/rangeobject.c
+ Objects/setobject.c
+ Objects/sliceobject.c
+ Objects/structseq.c
+ Objects/tupleobject.c
+ Objects/typeobject.c
+ Objects/typevarobject.c
+ Objects/unicodectype.c
+ Objects/unicodeobject.c
+ Objects/unionobject.c
+ Objects/weakrefobject.c
+ Parser/action_helpers.c
+ Parser/myreadline.c
+ Parser/parser.c
+ Parser/peg_api.c
+ Parser/pegen.c
+ Parser/pegen_errors.c
+ Parser/string_parser.c
+ Parser/token.c
+ Parser/tokenizer.c
+ Python/Python-ast.c
+ Python/Python-tokenize.c
+ Python/_warnings.c
+ Python/asdl.c
+ Python/assemble.c
+ Python/ast.c
+ Python/ast_opt.c
+ Python/ast_unparse.c
+ Python/bltinmodule.c
+ Python/bootstrap_hash.c
+ Python/ceval.c
+ Python/ceval_gil.c
+ Python/codecs.c
+ Python/compile.c
+ Python/context.c
+ Python/deepfreeze/deepfreeze.c
+ Python/dtoa.c
+ Python/dynamic_annotations.c
+ Python/errors.c
+ Python/fileutils.c
+ Python/flowgraph.c
+ Python/formatter_unicode.c
+ Python/frame.c
+ Python/frozen.c
+ Python/future.c
+ Python/getargs.c
+ Python/getcompiler.c
+ Python/getcopyright.c
+ Python/getopt.c
+ Python/getplatform.c
+ Python/getversion.c
+ Python/hamt.c
+ Python/hashtable.c
+ Python/import.c
+ Python/importdl.c
+ Python/initconfig.c
+ Python/instrumentation.c
+ Python/intrinsics.c
+ Python/legacy_tracing.c
+ Python/marshal.c
+ Python/modsupport.c
+ Python/mysnprintf.c
+ Python/mystrtoul.c
+ Python/pathconfig.c
+ Python/perf_trampoline.c
+ Python/preconfig.c
+ Python/pyarena.c
+ Python/pyctype.c
+ Python/pyfpe.c
+ Python/pyhash.c
+ Python/pylifecycle.c
+ Python/pymath.c
+ Python/pystate.c
+ Python/pystrcmp.c
+ Python/pystrhex.c
+ Python/pystrtod.c
+ Python/pythonrun.c
+ Python/pytime.c
+ Python/specialize.c
+ Python/structmember.c
+ Python/suggestions.c
+ Python/symtable.c
+ Python/sysmodule.c
+ Python/thread.c
+ Python/traceback.c
+ Python/tracemalloc.c
+)
+
+IF (OS_WINDOWS)
+ SRCS(
+ PC/WinMain.c
+ PC/invalid_parameter_handler.c
+ PC/msvcrtmodule.c
+ PC/winreg.c
+ PC/winsound.c
+ Python/dynload_win.c
+ )
+ELSE()
+ SRCS(
+ Python/dynload_shlib.c
+ )
+ENDIF()
+
+IF (OS_LINUX)
+ SRCS(
+ Python/asm_trampoline.S
+ )
+ENDIF()
+
+SUPPRESSIONS(
+ tsan.supp
)
END()
RECURSE(
- src
- src/Lib
- src/Modules
- src/Modules/_sqlite
+ Lib
+ Modules
+ Modules/_sqlite
+ bin
)
diff --git a/library/cpp/containers/disjoint_interval_tree/disjoint_interval_tree.h b/library/cpp/containers/disjoint_interval_tree/disjoint_interval_tree.h
index 3f51c61277c..f0c6644d4be 100644
--- a/library/cpp/containers/disjoint_interval_tree/disjoint_interval_tree.h
+++ b/library/cpp/containers/disjoint_interval_tree/disjoint_interval_tree.h
@@ -132,7 +132,7 @@ public:
}
TIterator completelyRemoveEnd = completelyRemoveBegin != Tree.end() ? Tree.lower_bound(end) : Tree.end();
- if (completelyRemoveEnd != Tree.end() && completelyRemoveEnd != Tree.begin() && completelyRemoveEnd->first != end) {
+ if (completelyRemoveEnd != Tree.begin() && (completelyRemoveEnd == Tree.end() || completelyRemoveEnd->first != end)) {
TIterator containingEnd = completelyRemoveEnd;
--containingEnd;
if (containingEnd->second > end) {
diff --git a/library/cpp/containers/disjoint_interval_tree/ut/disjoint_interval_tree_ut.cpp b/library/cpp/containers/disjoint_interval_tree/ut/disjoint_interval_tree_ut.cpp
index 8474ae89b04..508a82459af 100644
--- a/library/cpp/containers/disjoint_interval_tree/ut/disjoint_interval_tree_ut.cpp
+++ b/library/cpp/containers/disjoint_interval_tree/ut/disjoint_interval_tree_ut.cpp
@@ -232,6 +232,18 @@ Y_UNIT_TEST_SUITE(DisjointIntervalTreeTest) {
UNIT_ASSERT_VALUES_EQUAL(tree.GetNumIntervals(), 2);
UNIT_ASSERT_VALUES_EQUAL(tree.GetNumElements(), 8);
}
+
+ // 12. The only one interval
+ {
+ TDisjointIntervalTree<ui64> tree;
+ tree.InsertInterval(1, 10);
+ UNIT_ASSERT_VALUES_EQUAL(tree.GetNumIntervals(), 1);
+ UNIT_ASSERT_VALUES_EQUAL(tree.GetNumElements(), 9);
+ UNIT_ASSERT_VALUES_EQUAL(tree.EraseInterval(0, 6), 5);
+ UNIT_ASSERT_VALUES_EQUAL(tree.GetNumIntervals(), 1);
+ UNIT_ASSERT_VALUES_EQUAL(tree.GetNumElements(), 4);
+ UNIT_ASSERT(tree.Intersects(5, 10));
+ }
}
Y_UNIT_TEST(IntersectsTest) {
diff --git a/library/cpp/http/fetch/http_socket.cpp b/library/cpp/http/fetch/http_socket.cpp
index 1524ef04a80..fb8ab4373f3 100644
--- a/library/cpp/http/fetch/http_socket.cpp
+++ b/library/cpp/http/fetch/http_socket.cpp
@@ -1,203 +1,10 @@
#include "httpload.h"
#include "http_digest.h"
-/************************************************************/
-
-#ifdef USE_GNUTLS
-
-#include <gcrypt.h>
-#include <gnutls/gnutls.h>
-#include <util/network/init.h>
-#include <util/network/socket.h>
-#include <util/system/mutex.h>
-
-/********************************************************/
-// HTTPS handler is used as implementation of
-// socketAbstractHandler for work through HTTPS protocol
-
-class socketSecureHandler: public socketRegularHandler {
-protected:
- bool IsValid_;
- gnutls_session Session_;
- gnutls_certificate_credentials Credits_;
-
-public:
- socketSecureHandler();
- virtual ~socketSecureHandler();
-
- virtual bool Good();
- virtual int Connect(const TAddrList& addrs, TDuration Timeout);
- virtual void Disconnect();
- virtual void shutdown();
- virtual bool send(const char* message, ssize_t messlen);
- virtual bool peek();
- virtual ssize_t read(void* buffer, ssize_t buflen);
-};
-
-/********************************************************/
-/********************************************************/
-static int gcry_pthread_mutex_init(void** priv) {
- int err = 0;
-
- try {
- TMutex* lock = new TMutex;
- *priv = lock;
- } catch (...) {
- err = -1;
- }
-
- return err;
-}
-
-static int gcry_pthread_mutex_destroy(void** lock) {
- delete static_cast<TMutex*>(*lock);
-
- return 0;
-}
-
-static int gcry_pthread_mutex_lock(void** lock) {
- static_cast<TMutex*>(*lock)->Acquire();
-
- return 0;
-}
-
-static int gcry_pthread_mutex_unlock(void** lock) {
- static_cast<TMutex*>(*lock)->Release();
-
- return 0;
-}
-
-static struct gcry_thread_cbs gcry_threads_pthread =
- {
- GCRY_THREAD_OPTION_PTHREAD, NULL,
- gcry_pthread_mutex_init, gcry_pthread_mutex_destroy,
- gcry_pthread_mutex_lock, gcry_pthread_mutex_unlock,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL};
-
-/********************************************************/
-struct https_initor {
- https_initor() {
- gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
- gnutls_global_init();
- InitNetworkSubSystem();
- }
-
- ~https_initor() {
- gnutls_global_deinit();
- }
-};
-
-static https_initor _initor;
-
-/********************************************************/
-socketSecureHandler::socketSecureHandler()
- : socketRegularHandler()
- , IsValid_(false)
- , Session_()
- , Credits_()
-{
-}
-
-/********************************************************/
-socketSecureHandler::~socketSecureHandler() {
- if (IsValid_)
- Disconnect();
-}
-
-/********************************************************/
-bool socketSecureHandler::Good() {
- return Socket_.Good() && IsValid_;
-}
-
-/********************************************************/
-int socketSecureHandler::Connect(const TAddrList& addrs, TDuration Timeout) {
- IsValid_ = false;
-
- int ret = socketRegularHandler::Connect(addrs, Timeout);
- if (ret)
- return ret;
-
- gnutls_certificate_allocate_credentials(&Credits_);
- gnutls_init(&Session_, GNUTLS_CLIENT);
- gnutls_set_default_priority(Session_);
- gnutls_credentials_set(Session_, GNUTLS_CRD_CERTIFICATE, Credits_);
-
- SOCKET fd = Socket_;
- gnutls_transport_set_ptr(Session_, (gnutls_transport_ptr)fd);
-
- ret = gnutls_handshake(Session_);
-
- if (ret < 0) {
- fprintf(stderr, "*** Handshake failed\n");
- gnutls_perror(ret);
-
- gnutls_deinit(Session_);
- if (Credits_) {
- gnutls_certificate_free_credentials(Credits_);
- Credits_ = 0;
- }
- return 1;
- }
-
- IsValid_ = true;
- return !IsValid_;
-}
-
-/********************************************************/
-void socketSecureHandler::Disconnect() {
- if (IsValid_) {
- gnutls_bye(Session_, GNUTLS_SHUT_RDWR);
- IsValid_ = false;
- gnutls_deinit(Session_);
- }
-
- if (Credits_) {
- gnutls_certificate_free_credentials(Credits_);
- Credits_ = 0;
- }
-
- socketRegularHandler::Disconnect();
-}
-
-/********************************************************/
-void socketSecureHandler::shutdown() {
-}
-
-/********************************************************/
-bool socketSecureHandler::send(const char* message, ssize_t messlen) {
- if (!IsValid_)
- return false;
- ssize_t rv = gnutls_record_send(Session_, message, messlen);
- return rv >= 0;
-}
-
-/********************************************************/
-bool socketSecureHandler::peek() {
- //ssize_t rv = gnutls_record_check_pending(mSession);
- //return rv>0;
- return true;
-}
-
-/********************************************************/
-ssize_t socketSecureHandler::read(void* buffer, ssize_t buflen) {
- if (!IsValid_)
- return false;
- return gnutls_record_recv(Session_, (char*)buffer, buflen);
-}
-
-#endif
-
-/************************************************************/
socketAbstractHandler* socketHandlerFactory::chooseHandler(const THttpURL& url) {
if (url.IsValidGlobal() && url.GetScheme() == THttpURL::SchemeHTTP)
return new socketRegularHandler;
-#ifdef USE_GNUTLS
- if (url.IsValidGlobal() && url.GetScheme() == THttpURL::SchemeHTTPS)
- return new socketSecureHandler;
-#endif
-
return nullptr;
}
diff --git a/library/cpp/lfalloc/yt/ya.make b/library/cpp/lfalloc/yt/ya.make
deleted file mode 100644
index 36068c090d8..00000000000
--- a/library/cpp/lfalloc/yt/ya.make
+++ /dev/null
@@ -1,28 +0,0 @@
-LIBRARY()
-
-NO_UTIL()
-ALLOCATOR_IMPL()
-
-NO_COMPILER_WARNINGS()
-
-IF (ARCH_AARCH64)
- PEERDIR(
- contrib/libs/jemalloc
- )
-ELSE()
- IF ("${YMAKE}" MATCHES "devtools")
- CFLAGS(-DYMAKE=1)
- ENDIF()
- CXXFLAGS(-DLFALLOC_YT)
- SRCS(
- ../lf_allocX64.cpp
- )
-ENDIF()
-
-PEERDIR(
- library/cpp/malloc/api
-)
-
-SET(IDE_FOLDER "util")
-
-END()
diff --git a/library/cpp/timezone_conversion/civil.h b/library/cpp/timezone_conversion/civil.h
index 5f331b33584..a50e0e7cb24 100644
--- a/library/cpp/timezone_conversion/civil.h
+++ b/library/cpp/timezone_conversion/civil.h
@@ -233,6 +233,14 @@ namespace NDatetime {
return cctz::get_weekday(day);
}
+ /** Returns the weekday by day.
+ * @param[in] second is a given seconds
+ * @return a weekday (enum)
+ */
+ CONSTEXPR_M TWeekday GetWeekday(const TCivilSecond& second) noexcept {
+ return cctz::get_weekday(second);
+ }
+
/** Returns the TCivilDay that strictly follows or precedes the given
* civil_day, and that falls on the given weekday.
* @code
diff --git a/library/cpp/timezone_conversion/ut/civil_ut.cpp b/library/cpp/timezone_conversion/ut/civil_ut.cpp
index f91935ac499..2c3db3c3b31 100644
--- a/library/cpp/timezone_conversion/ut/civil_ut.cpp
+++ b/library/cpp/timezone_conversion/ut/civil_ut.cpp
@@ -103,6 +103,11 @@ Y_UNIT_TEST_SUITE(DateTime) {
UNIT_ASSERT_VALUES_EQUAL(NDatetime::WeekdayOnTheWeek(d, NDatetime::TWeekday::wednesday), NDatetime::TCivilDay(2013, 1, 2));
UNIT_ASSERT_VALUES_EQUAL(NDatetime::WeekdayOnTheWeek(d, NDatetime::TWeekday::friday), NDatetime::TCivilDay(2013, 1, 4));
}
+ Y_UNIT_TEST(WeekdayFromCivilSecond) {
+ NDatetime::TCivilSecond s(2013, 1, 2, 10, 12, 9);
+ NDatetime::TWeekday wd = NDatetime::GetWeekday(s);
+ UNIT_ASSERT_VALUES_EQUAL(wd, NDatetime::TWeekday::wednesday);
+ }
Y_UNIT_TEST(CivilUnit) {
using namespace NDatetime;
diff --git a/library/cpp/tld/tlds-alpha-by-domain.txt b/library/cpp/tld/tlds-alpha-by-domain.txt
index b0b874be792..751a75c74da 100644
--- a/library/cpp/tld/tlds-alpha-by-domain.txt
+++ b/library/cpp/tld/tlds-alpha-by-domain.txt
@@ -1,4 +1,4 @@
-# Version 2024021500, Last Updated Thu Feb 15 07:07:02 2024 UTC
+# Version 2024030100, Last Updated Fri Mar 1 07:07:01 2024 UTC
AAA
AARP
ABB
diff --git a/library/python/import_test/__init__.py b/library/python/import_test/__init__.py
deleted file mode 100644
index f759b281d77..00000000000
--- a/library/python/import_test/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from library.python.testing.import_test.import_test import check_imports
-
-test_imports = check_imports
diff --git a/library/python/import_test/ya.make b/library/python/import_test/ya.make
deleted file mode 100644
index 11e098cfe6f..00000000000
--- a/library/python/import_test/ya.make
+++ /dev/null
@@ -1,9 +0,0 @@
-PY23_LIBRARY()
-
-PY_SRCS(__init__.py)
-
-PEERDIR(
- library/python/testing/import_test
-)
-
-END()
diff --git a/library/python/runtime_py3/importer.pxi b/library/python/runtime_py3/importer.pxi
index 0a194308c3a..493c17204d0 100644
--- a/library/python/runtime_py3/importer.pxi
+++ b/library/python/runtime_py3/importer.pxi
@@ -9,7 +9,6 @@ import __res as __resource
_b = lambda x: x if isinstance(x, bytes) else utf_8_encode(x)[0]
_s = lambda x: x if isinstance(x, str) else utf_8_decode(x)[0]
-env_entry_point = b'Y_PYTHON_ENTRY_POINT'
env_source_root = b'Y_PYTHON_SOURCE_ROOT'
cfg_source_root = b'arcadia-source-root'
env_extended_source_search = b'Y_PYTHON_EXTENDED_SOURCE_SEARCH'
@@ -17,12 +16,28 @@ res_ya_ide_venv = b'YA_IDE_VENV'
executable = sys.executable or 'Y_PYTHON'
sys.modules['run_import_hook'] = __resource
-# This is the prefix in contrib/tools/python3/src/Lib/ya.make.
+def _probe(environ_dict, key, default_value=None):
+ """ Probe bytes and str variants for environ.
+ This is because in python3:
+ * _os (nt) on windows returns str,
+ * _os (posix) on linux return bytes
+ For more information check:
+ * https://github.com/python/cpython/blob/main/Lib/importlib/_bootstrap_external.py#L34
+ * YA-1700
+ """
+ keys = [_b(key), _s(key)]
+ for key in keys:
+ if key in environ_dict:
+ return _b(environ_dict[key])
+
+ return _b(default_value) if isinstance(default_value, str) else default_value
+
+# This is the prefix in contrib/tools/python3/Lib/ya.make.
py_prefix = b'py/'
py_prefix_len = len(py_prefix)
YA_IDE_VENV = __resource.find(res_ya_ide_venv)
-Y_PYTHON_EXTENDED_SOURCE_SEARCH = _os.environ.get(env_extended_source_search) or YA_IDE_VENV
+Y_PYTHON_EXTENDED_SOURCE_SEARCH = _probe(_os.environ, env_extended_source_search) or YA_IDE_VENV
def _init_venv():
@@ -64,7 +79,7 @@ def _init_venv():
def _get_source_root():
- env_value = _os.environ.get(env_source_root)
+ env_value = _probe(_os.environ, env_source_root)
if env_value or not YA_IDE_VENV:
return env_value
diff --git a/library/python/runtime_py3/main/main.c b/library/python/runtime_py3/main/main.c
index bf80678d260..896ab0b21d0 100644
--- a/library/python/runtime_py3/main/main.c
+++ b/library/python/runtime_py3/main/main.c
@@ -1,5 +1,5 @@
#include <Python.h>
-#include <contrib/tools/python3/src/Include/internal/pycore_runtime.h> // _PyRuntime_Initialize()
+#include <contrib/tools/python3/Include/internal/pycore_runtime.h> // _PyRuntime_Initialize()
#include <stdlib.h>
#include <string.h>
diff --git a/library/python/runtime_py3/main/ya.make b/library/python/runtime_py3/main/ya.make
index bfd0955b0f1..13449602a9d 100644
--- a/library/python/runtime_py3/main/ya.make
+++ b/library/python/runtime_py3/main/ya.make
@@ -1,12 +1,12 @@
LIBRARY()
PEERDIR(
- contrib/tools/python3/src
+ contrib/tools/python3
library/cpp/resource
)
ADDINCL(
- contrib/tools/python3/src/Include
+ contrib/tools/python3/Include
)
CFLAGS(
diff --git a/library/python/runtime_py3/ya.make b/library/python/runtime_py3/ya.make
index 58e05a72951..05687fdd8fc 100644
--- a/library/python/runtime_py3/ya.make
+++ b/library/python/runtime_py3/ya.make
@@ -3,8 +3,8 @@ PY3_LIBRARY()
STYLE_PYTHON()
PEERDIR(
- contrib/tools/python3/src
- contrib/tools/python3/lib/py
+ contrib/tools/python3
+ contrib/tools/python3/lib2/py
library/cpp/resource
)
diff --git a/util/generic/flags.h b/util/generic/flags.h
index 80e2f17b7fb..e11163a2f45 100644
--- a/util/generic/flags.h
+++ b/util/generic/flags.h
@@ -217,16 +217,16 @@ private:
};
template <class T>
-struct TPodTraits<TFlags<T>> {
+struct TPodTraits<::TFlags<T>> {
enum {
IsPod = TTypeTraits<T>::IsPod
};
};
template <class Enum>
-struct THash<TFlags<Enum>> {
+struct THash<::TFlags<Enum>> {
size_t operator()(const TFlags<Enum>& flags) const noexcept {
- return THash<typename TFlags<Enum>::TInt>()(flags);
+ return THash<typename ::TFlags<Enum>::TInt>()(flags);
}
};
@@ -237,7 +237,7 @@ struct THash<TFlags<Enum>> {
* @param ENUM Name of the base enum type to use.
*/
#define Y_DECLARE_FLAGS(FLAGS, ENUM) \
- using FLAGS = TFlags<ENUM>
+ using FLAGS = ::TFlags<ENUM>
/**
* This macro declares global operator functions for enum base of `FLAGS` type.
diff --git a/util/generic/vector.h b/util/generic/vector.h
index 8cb0aeaea1c..1723961e532 100644
--- a/util/generic/vector.h
+++ b/util/generic/vector.h
@@ -114,9 +114,9 @@ public:
return (yssize_t)TBase::size();
}
-#ifdef _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED
+#if defined(_YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED) && !defined(__CUDACC__)
void yresize(size_type newSize) {
- if (std::is_pod<T>::value) {
+ if (std::is_standard_layout_v<T> && std::is_trivial_v<T>) {
TBase::resize_uninitialized(newSize);
} else {
TBase::resize(newSize);
diff --git a/util/system/context.cpp b/util/system/context.cpp
index ad993090884..3a67593813e 100644
--- a/util/system/context.cpp
+++ b/util/system/context.cpp
@@ -134,6 +134,8 @@ namespace {
#endif
}
+ #if defined(USE_SANITIZER_CONTEXT)
+
TContMachineContext::TSan::TSan() noexcept
: TL(nullptr)
{
@@ -148,11 +150,12 @@ TContMachineContext::TSan::TSan(const TContClosure& c) noexcept
void TContMachineContext::TSan::DoRunNaked() {
AfterSwitch();
TL->DoRunNaked();
- BeforeFinish();
}
+ #endif
+
TContMachineContext::TContMachineContext(const TContClosure& c)
- #if defined(_asan_enabled_) || defined(_tsan_enabled_)
+ #if defined(USE_SANITIZER_CONTEXT)
: San_(c)
#endif
{
@@ -162,7 +165,7 @@ TContMachineContext::TContMachineContext(const TContClosure& c)
* arg, and align data
*/
- #if defined(_asan_enabled_)
+ #if defined(USE_SANITIZER_CONTEXT)
auto trampoline = &San_;
#else
auto trampoline = c.TrampoLine;
@@ -196,12 +199,12 @@ TContMachineContext::TContMachineContext(const TContClosure& c)
void TContMachineContext::SwitchTo(TContMachineContext* next) noexcept {
if (Y_LIKELY(__mysetjmp(Buf_) == 0)) {
- #if defined(_asan_enabled_) || defined(_tsan_enabled_)
+ #if defined(USE_SANITIZER_CONTEXT)
next->San_.BeforeSwitch(&San_);
#endif
__mylongjmp(next->Buf_, 1);
} else {
- #if defined(_asan_enabled_)
+ #if defined(USE_SANITIZER_CONTEXT)
San_.AfterSwitch();
#endif
}
diff --git a/util/system/context.h b/util/system/context.h
index c04a462365a..1b690bd57c7 100644
--- a/util/system/context.h
+++ b/util/system/context.h
@@ -3,7 +3,6 @@
#include "align.h"
#include "defaults.h"
#include "compiler.h"
-#include "sanitizers.h"
#include <util/generic/array_ref.h>
#include <util/generic/utility.h>
@@ -17,17 +16,21 @@
#error todo
#endif
+#if defined(__clang_major__) && (__clang_major__ >= 9) && (defined(_asan_enabled_) || defined(_tsan_enabled_))
+ #include "sanitizers.h"
+ #define USE_SANITIZER_CONTEXT
+#endif
+
/*
* switch method
*/
-#if defined(thread_sanitizer_enabled)
- #define USE_UCONTEXT_CONT
- #if defined(_darwin_)
- #define _XOPEN_SOURCE 700
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
- #endif
-#elif defined(_bionic_) || defined(__IOS__)
+#if defined(thread_sanitizer_enabled) && defined(_darwin_)
+ #define _XOPEN_SOURCE 700
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+#if defined(_bionic_) || defined(__IOS__)
#define USE_GENERIC_CONT
#elif defined(_cygwin_)
#define USE_UCONTEXT_CONT
@@ -145,6 +148,8 @@ public:
private:
__myjmp_buf Buf_;
+ #if defined(USE_SANITIZER_CONTEXT)
+
struct TSan: public ITrampoLine, public ::NSan::TFiberContext {
TSan() noexcept;
TSan(const TContClosure& c) noexcept;
@@ -154,7 +159,6 @@ private:
ITrampoLine* TL;
};
- #if defined(_asan_enabled_) || defined(_tsan_enabled_)
TSan San_;
#endif
};
@@ -168,6 +172,7 @@ static inline size_t MachineContextSize() noexcept {
* be polite
*/
#if !defined(FROM_CONTEXT_IMPL)
+ #undef USE_SANITIZER_CONTEXT
#undef USE_JUMP_CONT
#undef USE_FIBER_CONT
#undef USE_GENERIC_CONT
diff --git a/util/system/fs.cpp b/util/system/fs.cpp
index b848abac8a1..808bc0b7b6a 100644
--- a/util/system/fs.cpp
+++ b/util/system/fs.cpp
@@ -8,12 +8,13 @@
#include <errno.h>
#endif
+#include <util/folder/iterator.h>
+#include <util/folder/path.h>
#include <util/generic/yexception.h>
#include <util/memory/tempbuf.h>
#include <util/stream/file.h>
-#include <util/folder/iterator.h>
#include <util/system/fstat.h>
-#include <util/folder/path.h>
+#include <util/system/sysstat.h>
bool NFs::Remove(const TString& path) {
#if defined(_win_)
@@ -23,6 +24,24 @@ bool NFs::Remove(const TString& path) {
#endif
}
+bool NFs::SetExecutable(const TString& path, bool exec) {
+#ifdef _unix_
+ TFileStat stat(path);
+ ui32 mode = stat.Mode;
+ if (exec) {
+ mode |= S_IXUSR | S_IXGRP | S_IXOTH;
+ } else {
+ mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH);
+ }
+ if (stat.Mode != 0 && mode != stat.Mode) {
+ return !Chmod(path.c_str(), mode);
+ }
+#endif
+ Y_UNUSED(exec);
+ Y_UNUSED(path);
+ return true;
+}
+
void NFs::RemoveRecursive(const TString& path) {
static const TStringBuf errStr = "error while removing ";
diff --git a/util/system/fs.h b/util/system/fs.h
index a28a6d84fb9..f4ab746aa36 100644
--- a/util/system/fs.h
+++ b/util/system/fs.h
@@ -23,6 +23,13 @@ namespace NFs {
Y_DECLARE_FLAGS(EFilePermissions, EFilePermission);
+ /// Add executable bit
+ ///
+ /// @param[in] path Path to mark as executable
+ /// @param[in] exec New value of execution bit
+ /// @returns true if bit has changed or false otherwise
+ bool SetExecutable(const TString& path, bool exec);
+
/// Remove a file or empty directory
///
/// @param[in] path Path to file or directory
diff --git a/util/system/sanitizers.cpp b/util/system/sanitizers.cpp
index bb799a9e2e7..3e710b39c7b 100644
--- a/util/system/sanitizers.cpp
+++ b/util/system/sanitizers.cpp
@@ -1,42 +1,29 @@
#include "sanitizers.h"
#include "thread.h"
-#if defined(_asan_enabled_)
-extern "C" {
- void __sanitizer_start_switch_fiber(void** fake_stack_save, const void* bottom, size_t size);
- void __sanitizer_finish_switch_fiber(void* fake_stack_save, const void** old_bottom, size_t* old_size);
-}
-#endif
+using namespace NSan;
#if defined(_tsan_enabled_)
#if defined(__clang_major__) && (__clang_major__ >= 9)
-extern "C" {
- void* __tsan_get_current_fiber(void);
+extern "C" { // sanitizers API
+
+ #if defined(_tsan_enabled_)
void* __tsan_create_fiber(unsigned flags);
- void __tsan_destroy_fiber(void* fiber);
- void __tsan_switch_to_fiber(void* fiber, unsigned flags);
void __tsan_set_fiber_name(void* fiber, const char* name);
-}
+ #endif
+
+} // sanitizers API
#else
namespace {
- void* __tsan_get_current_fiber(void) {
- return nullptr;
- }
void* __tsan_create_fiber(unsigned) {
return nullptr;
}
- void __tsan_destroy_fiber(void*) {
- }
- void __tsan_switch_to_fiber(void*, unsigned) {
- }
void __tsan_set_fiber_name(void*, const char*) {
}
}
#endif
#endif
-using namespace NSan;
-
TFiberContext::TFiberContext() noexcept
: Token_(nullptr)
, IsMainFiber_(true)
@@ -45,7 +32,7 @@ TFiberContext::TFiberContext() noexcept
#endif
{
TCurrentThreadLimits sl;
-
+ (void)Token_;
Stack_ = sl.StackBegin;
Len_ = sl.StackLength;
@@ -70,60 +57,6 @@ TFiberContext::TFiberContext(const void* stack, size_t len, const char* contName
#endif
}
-TFiberContext::~TFiberContext() noexcept {
- if (!IsMainFiber_) {
-#if defined(_asan_enabled_)
- if (Token_) {
- // destroy saved FakeStack
- void* activeFakeStack = nullptr;
- const void* activeStack = nullptr;
- size_t activeStackSize = 0;
- __sanitizer_start_switch_fiber(&activeFakeStack, (char*)Stack_, Len_);
- __sanitizer_finish_switch_fiber(Token_, &activeStack, &activeStackSize);
- __sanitizer_start_switch_fiber(nullptr, activeStack, activeStackSize);
- __sanitizer_finish_switch_fiber(activeFakeStack, nullptr, nullptr);
- }
-#endif
-#if defined(_tsan_enabled_)
- __tsan_destroy_fiber(CurrentTSanFiberContext_);
-#endif
- }
-}
-
-void TFiberContext::BeforeFinish() noexcept {
-#if defined(_asan_enabled_)
- __sanitizer_start_switch_fiber(nullptr, nullptr, 0);
-#else
- (void)Token_;
- (void)Stack_;
- (void)Len_;
-#endif
-}
-
-void TFiberContext::BeforeSwitch(TFiberContext* old) noexcept {
-#if defined(_asan_enabled_)
- __sanitizer_start_switch_fiber(old ? &old->Token_ : nullptr, (char*)Stack_, Len_);
-#else
- (void)old;
-#endif
-
-#if defined(_tsan_enabled_)
- __tsan_switch_to_fiber(CurrentTSanFiberContext_, /*flags =*/0);
-#endif
-}
-
-void TFiberContext::AfterSwitch() noexcept {
-#if defined(_asan_enabled_)
- __sanitizer_finish_switch_fiber(Token_, nullptr, nullptr);
-#endif
-}
-
-void TFiberContext::AfterStart() noexcept {
-#if defined(_asan_enabled_)
- __sanitizer_finish_switch_fiber(nullptr, nullptr, nullptr);
-#endif
-}
-
#if defined(_tsan_enabled_)
extern "C" {
// This function should not be directly exposed in headers
diff --git a/util/system/sanitizers.h b/util/system/sanitizers.h
index f0d31244966..516256ea1d6 100644
--- a/util/system/sanitizers.h
+++ b/util/system/sanitizers.h
@@ -6,6 +6,8 @@ extern "C" { // sanitizers API
#if defined(_asan_enabled_)
void __lsan_ignore_object(const void* p);
+ void __sanitizer_start_switch_fiber(void** fake_stack_save, const void* bottom, size_t size);
+ void __sanitizer_finish_switch_fiber(void* fake_stack_save, const void** old_bottom, size_t* old_size);
#endif
#if defined(_msan_enabled_)
@@ -17,6 +19,9 @@ extern "C" { // sanitizers API
#if defined(_tsan_enabled_)
void __tsan_acquire(void* a);
void __tsan_release(void* a);
+ void* __tsan_get_current_fiber(void);
+ void __tsan_destroy_fiber(void* fiber);
+ void __tsan_switch_to_fiber(void* fiber, unsigned flags);
#endif
} // sanitizers API
@@ -27,13 +32,42 @@ namespace NSan {
TFiberContext() noexcept;
TFiberContext(const void* stack, size_t len, const char* contName) noexcept;
- ~TFiberContext() noexcept;
+ ~TFiberContext() noexcept {
+ if (!IsMainFiber_) {
+#if defined(_asan_enabled_)
+ if (Token_) {
+ // destroy saved FakeStack
+ void* activeFakeStack = nullptr;
+ const void* activeStack = nullptr;
+ size_t activeStackSize = 0;
+ __sanitizer_start_switch_fiber(&activeFakeStack, (char*)Stack_, Len_);
+ __sanitizer_finish_switch_fiber(Token_, &activeStack, &activeStackSize);
+ __sanitizer_start_switch_fiber(nullptr, activeStack, activeStackSize);
+ __sanitizer_finish_switch_fiber(activeFakeStack, nullptr, nullptr);
+ }
+#endif
+#if defined(_tsan_enabled_)
+ __tsan_destroy_fiber(CurrentTSanFiberContext_);
+#endif
+ }
+ }
- void BeforeFinish() noexcept;
- void BeforeSwitch(TFiberContext* old) noexcept;
- void AfterSwitch() noexcept;
+ Y_FORCE_INLINE void BeforeSwitch(TFiberContext* old) noexcept {
+#if defined(_asan_enabled_)
+ __sanitizer_start_switch_fiber(old ? &old->Token_ : nullptr, (char*)Stack_, Len_);
+#else
+ (void)old;
+#endif
- static void AfterStart() noexcept;
+#if defined(_tsan_enabled_)
+ __tsan_switch_to_fiber(CurrentTSanFiberContext_, /*flags =*/0);
+#endif
+ }
+ void AfterSwitch() noexcept {
+#if defined(_asan_enabled_)
+ __sanitizer_finish_switch_fiber(Token_, nullptr, nullptr);
+#endif
+ }
private:
void* Token_;
diff --git a/vendor/github.com/google/uuid/hash.go b/vendor/github.com/google/uuid/hash.go
index b404f4bec27..dc60082d3b3 100644
--- a/vendor/github.com/google/uuid/hash.go
+++ b/vendor/github.com/google/uuid/hash.go
@@ -17,6 +17,12 @@ var (
NameSpaceOID = Must(Parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8"))
NameSpaceX500 = Must(Parse("6ba7b814-9dad-11d1-80b4-00c04fd430c8"))
Nil UUID // empty UUID, all zeros
+
+ // The Max UUID is special form of UUID that is specified to have all 128 bits set to 1.
+ Max = UUID{
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ }
)
// NewHash returns a new UUID derived from the hash of space concatenated with
diff --git a/vendor/github.com/google/uuid/time.go b/vendor/github.com/google/uuid/time.go
index e6ef06cdc87..c351129279f 100644
--- a/vendor/github.com/google/uuid/time.go
+++ b/vendor/github.com/google/uuid/time.go
@@ -108,12 +108,23 @@ func setClockSequence(seq int) {
}
// Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in
-// uuid. The time is only defined for version 1 and 2 UUIDs.
+// uuid. The time is only defined for version 1, 2, 6 and 7 UUIDs.
func (uuid UUID) Time() Time {
- time := int64(binary.BigEndian.Uint32(uuid[0:4]))
- time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32
- time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48
- return Time(time)
+ var t Time
+ switch uuid.Version() {
+ case 6:
+ time := binary.BigEndian.Uint64(uuid[:8]) // Ignore uuid[6] version b0110
+ t = Time(time)
+ case 7:
+ time := binary.BigEndian.Uint64(uuid[:8])
+ t = Time((time>>16)*10000 + g1582ns100)
+ default: // forward compatible
+ time := int64(binary.BigEndian.Uint32(uuid[0:4]))
+ time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32
+ time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48
+ t = Time(time)
+ }
+ return t
}
// ClockSequence returns the clock sequence encoded in uuid.
diff --git a/vendor/github.com/google/uuid/uuid.go b/vendor/github.com/google/uuid/uuid.go
index dc75f7d9909..5232b486780 100644
--- a/vendor/github.com/google/uuid/uuid.go
+++ b/vendor/github.com/google/uuid/uuid.go
@@ -186,6 +186,59 @@ func Must(uuid UUID, err error) UUID {
return uuid
}
+// Validate returns an error if s is not a properly formatted UUID in one of the following formats:
+// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
+// It returns an error if the format is invalid, otherwise nil.
+func Validate(s string) error {
+ switch len(s) {
+ // Standard UUID format
+ case 36:
+
+ // UUID with "urn:uuid:" prefix
+ case 36 + 9:
+ if !strings.EqualFold(s[:9], "urn:uuid:") {
+ return fmt.Errorf("invalid urn prefix: %q", s[:9])
+ }
+ s = s[9:]
+
+ // UUID enclosed in braces
+ case 36 + 2:
+ if s[0] != '{' || s[len(s)-1] != '}' {
+ return fmt.Errorf("invalid bracketed UUID format")
+ }
+ s = s[1 : len(s)-1]
+
+ // UUID without hyphens
+ case 32:
+ for i := 0; i < len(s); i += 2 {
+ _, ok := xtob(s[i], s[i+1])
+ if !ok {
+ return errors.New("invalid UUID format")
+ }
+ }
+
+ default:
+ return invalidLengthError{len(s)}
+ }
+
+ // Check for standard UUID format
+ if len(s) == 36 {
+ if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
+ return errors.New("invalid UUID format")
+ }
+ for _, x := range []int{0, 2, 4, 6, 9, 11, 14, 16, 19, 21, 24, 26, 28, 30, 32, 34} {
+ if _, ok := xtob(s[x], s[x+1]); !ok {
+ return errors.New("invalid UUID format")
+ }
+ }
+ }
+
+ return nil
+}
+
// String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
// , or "" if uuid is invalid.
func (uuid UUID) String() string {
diff --git a/vendor/github.com/google/uuid/version6.go b/vendor/github.com/google/uuid/version6.go
new file mode 100644
index 00000000000..339a959a7a2
--- /dev/null
+++ b/vendor/github.com/google/uuid/version6.go
@@ -0,0 +1,56 @@
+// Copyright 2023 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import "encoding/binary"
+
+// UUID version 6 is a field-compatible version of UUIDv1, reordered for improved DB locality.
+// It is expected that UUIDv6 will primarily be used in contexts where there are existing v1 UUIDs.
+// Systems that do not involve legacy UUIDv1 SHOULD consider using UUIDv7 instead.
+//
+// see https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03#uuidv6
+//
+// NewV6 returns a Version 6 UUID based on the current NodeID and clock
+// sequence, and the current time. If the NodeID has not been set by SetNodeID
+// or SetNodeInterface then it will be set automatically. If the NodeID cannot
+// be set NewV6 set NodeID is random bits automatically . If clock sequence has not been set by
+// SetClockSequence then it will be set automatically. If GetTime fails to
+// return the current NewV6 returns Nil and an error.
+func NewV6() (UUID, error) {
+ var uuid UUID
+ now, seq, err := GetTime()
+ if err != nil {
+ return uuid, err
+ }
+
+ /*
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | time_high |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | time_mid | time_low_and_version |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |clk_seq_hi_res | clk_seq_low | node (0-1) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | node (2-5) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+
+ binary.BigEndian.PutUint64(uuid[0:], uint64(now))
+ binary.BigEndian.PutUint16(uuid[8:], seq)
+
+ uuid[6] = 0x60 | (uuid[6] & 0x0F)
+ uuid[8] = 0x80 | (uuid[8] & 0x3F)
+
+ nodeMu.Lock()
+ if nodeID == zeroID {
+ setNodeInterface("")
+ }
+ copy(uuid[10:], nodeID[:])
+ nodeMu.Unlock()
+
+ return uuid, nil
+}
diff --git a/vendor/github.com/google/uuid/version7.go b/vendor/github.com/google/uuid/version7.go
new file mode 100644
index 00000000000..3167b643d45
--- /dev/null
+++ b/vendor/github.com/google/uuid/version7.go
@@ -0,0 +1,104 @@
+// Copyright 2023 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "io"
+)
+
+// UUID version 7 features a time-ordered value field derived from the widely
+// implemented and well known Unix Epoch timestamp source,
+// the number of milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded.
+// As well as improved entropy characteristics over versions 1 or 6.
+//
+// see https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03#name-uuid-version-7
+//
+// Implementations SHOULD utilize UUID version 7 over UUID version 1 and 6 if possible.
+//
+// NewV7 returns a Version 7 UUID based on the current time(Unix Epoch).
+// Uses the randomness pool if it was enabled with EnableRandPool.
+// On error, NewV7 returns Nil and an error
+func NewV7() (UUID, error) {
+ uuid, err := NewRandom()
+ if err != nil {
+ return uuid, err
+ }
+ makeV7(uuid[:])
+ return uuid, nil
+}
+
+// NewV7FromReader returns a Version 7 UUID based on the current time(Unix Epoch).
+// it use NewRandomFromReader fill random bits.
+// On error, NewV7FromReader returns Nil and an error.
+func NewV7FromReader(r io.Reader) (UUID, error) {
+ uuid, err := NewRandomFromReader(r)
+ if err != nil {
+ return uuid, err
+ }
+
+ makeV7(uuid[:])
+ return uuid, nil
+}
+
+// makeV7 fill 48 bits time (uuid[0] - uuid[5]), set version b0111 (uuid[6])
+// uuid[8] already has the right version number (Variant is 10)
+// see function NewV7 and NewV7FromReader
+func makeV7(uuid []byte) {
+ /*
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | unix_ts_ms |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | unix_ts_ms | ver | rand_a (12 bit seq) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |var| rand_b |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | rand_b |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ _ = uuid[15] // bounds check
+
+ t, s := getV7Time()
+
+ uuid[0] = byte(t >> 40)
+ uuid[1] = byte(t >> 32)
+ uuid[2] = byte(t >> 24)
+ uuid[3] = byte(t >> 16)
+ uuid[4] = byte(t >> 8)
+ uuid[5] = byte(t)
+
+ uuid[6] = 0x70 | (0x0F & byte(s>>8))
+ uuid[7] = byte(s)
+}
+
+// lastV7time is the last time we returned stored as:
+//
+// 52 bits of time in milliseconds since epoch
+// 12 bits of (fractional nanoseconds) >> 8
+var lastV7time int64
+
+const nanoPerMilli = 1000000
+
+// getV7Time returns the time in milliseconds and nanoseconds / 256.
+// The returned (milli << 12 + seq) is guarenteed to be greater than
+// (milli << 12 + seq) returned by any previous call to getV7Time.
+func getV7Time() (milli, seq int64) {
+ timeMu.Lock()
+ defer timeMu.Unlock()
+
+ nano := timeNow().UnixNano()
+ milli = nano / nanoPerMilli
+ // Sequence number is between 0 and 3906 (nanoPerMilli>>8)
+ seq = (nano - milli*nanoPerMilli) >> 8
+ now := milli<<12 + seq
+ if now <= lastV7time {
+ now = lastV7time + 1
+ milli = now >> 12
+ seq = now & 0xfff
+ }
+ lastV7time = now
+ return milli, seq
+}
diff --git a/vendor/github.com/google/uuid/ya.make b/vendor/github.com/google/uuid/ya.make
index c00c7821da1..f94426932ec 100644
--- a/vendor/github.com/google/uuid/ya.make
+++ b/vendor/github.com/google/uuid/ya.make
@@ -16,6 +16,8 @@ SRCS(
uuid.go
version1.go
version4.go
+ version6.go
+ version7.go
)
GO_TEST_SRCS(
diff --git a/ya b/ya
index 1356863a8e1..96c1fc23541 100755
--- a/ya
+++ b/ya
@@ -34,33 +34,33 @@ REGISTRY_ENDPOINT = os.environ.get("YA_REGISTRY_ENDPOINT", "https://devtools-reg
PLATFORM_MAP = {
"data": {
"darwin": {
- "md5": "353ff2807c4ead0f91f60b593c2a884b",
+ "md5": "f8eb20c1a507736a81834a17d047652b",
"urls": [
- f"{REGISTRY_ENDPOINT}/5829322660"
+ f"{REGISTRY_ENDPOINT}/5923491707"
]
},
"darwin-arm64": {
- "md5": "ca71911440df907634bb5ed009878f16",
+ "md5": "6a990034f3f6e23e5fbdbdb91302b523",
"urls": [
- f"{REGISTRY_ENDPOINT}/5829321216"
+ f"{REGISTRY_ENDPOINT}/5923490842"
]
},
"linux-aarch64": {
- "md5": "747ef3883910f23a4ed2164bcc71910b",
+ "md5": "96beea81023bb48e268519a50c07419a",
"urls": [
- f"{REGISTRY_ENDPOINT}/5829319955"
+ f"{REGISTRY_ENDPOINT}/5923490453"
]
},
"win32-clang-cl": {
- "md5": "46dd5771c0b23c93dfec4eed04e2e62b",
+ "md5": "87eb5f132bcb294f0127a505d00f0735",
"urls": [
- f"{REGISTRY_ENDPOINT}/5829324146"
+ f"{REGISTRY_ENDPOINT}/5923492435"
]
},
"linux": {
- "md5": "d72dbb047d6abc30d7260042cba105f6",
+ "md5": "6062cf519b6899fcd49422749e8f35ae",
"urls": [
- f"{REGISTRY_ENDPOINT}/5829325531"
+ f"{REGISTRY_ENDPOINT}/5923493257"
]
}
}
diff --git a/yt/cpp/mapreduce/client/client.cpp b/yt/cpp/mapreduce/client/client.cpp
index 22f1253e2ef..4548577834e 100644
--- a/yt/cpp/mapreduce/client/client.cpp
+++ b/yt/cpp/mapreduce/client/client.cpp
@@ -44,6 +44,8 @@
#include <yt/cpp/mapreduce/raw_client/raw_requests.h>
#include <yt/cpp/mapreduce/raw_client/rpc_parameters_serialization.h>
+#include <yt/yt/core/ytree/fluent.h>
+
#include <library/cpp/json/json_reader.h>
#include <util/generic/algorithm.h>
@@ -62,6 +64,32 @@ namespace NDetail {
////////////////////////////////////////////////////////////////////////////////
+namespace {
+
+////////////////////////////////////////////////////////////////////////////////
+
+THashMap<TString, TString> ParseProxyUrlAliasingRules(TString envConfig)
+{
+ if (envConfig.empty()) {
+ return {};
+ }
+ return NYTree::ConvertTo<THashMap<TString, TString>>(NYson::TYsonString(envConfig));
+}
+
+void ApplyProxyUrlAliasingRules(TString& url)
+{
+ static auto rules = ParseProxyUrlAliasingRules(GetEnv("YT_PROXY_URL_ALIASING_CONFIG"));
+ if (auto ruleIt = rules.find(url); ruleIt != rules.end()) {
+ url = ruleIt->second;
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace
+
+////////////////////////////////////////////////////////////////////////////////
+
TClientBase::TClientBase(
const TClientContext& context,
const TTransactionId& transactionId,
@@ -1333,8 +1361,10 @@ TClientPtr CreateClientImpl(
context.ProxyAddress = options.ProxyAddress_;
context.ServerName = serverName;
+
if (context.ServerName.find('.') == TString::npos &&
- context.ServerName.find(':') == TString::npos)
+ context.ServerName.find(':') == TString::npos &&
+ context.ServerName.find("localhost") == TString::npos)
{
context.ServerName += ".yt.yandex.net";
}
@@ -1419,6 +1449,8 @@ IClientPtr CreateClientFromEnv(const TCreateClientOptions& options)
ythrow yexception() << "YT_PROXY is not set";
}
+ NDetail::ApplyProxyUrlAliasingRules(serverName);
+
return NDetail::CreateClientImpl(serverName, options);
}
diff --git a/yt/python/yt/common.py b/yt/python/yt/common.py
index 7943d0e86dd..fb90e09651e 100644
--- a/yt/python/yt/common.py
+++ b/yt/python/yt/common.py
@@ -347,6 +347,10 @@ class YtError(Exception):
"""Chunk data is not preloaded yet"""
return self.contains_code(1735)
+ def is_no_in_sync_replicas(self):
+ """No in-sync replicas found"""
+ return self.contains_code(1736)
+
def is_already_present_in_group(self):
"""Member is already present in group"""
return self.contains_code(908)
diff --git a/yt/python/yt/logger.py b/yt/python/yt/logger.py
index c885fa9f524..7b876312b91 100644
--- a/yt/python/yt/logger.py
+++ b/yt/python/yt/logger.py
@@ -5,7 +5,10 @@ try:
except ImportError:
yatest_common = None
+import functools
import logging
+import os
+import re
def set_log_level_from_config(logger):
@@ -20,6 +23,58 @@ def set_log_level_from_config(logger):
logger.setLevel(level=logging.__dict__[logger_config.LOG_LEVEL.upper()])
+class SimpleColorizedStreamHandler(logging.StreamHandler):
+ C_LCYAN = "\033[96m"
+ C_LBLUE = "\033[94m"
+ C_LGREEN = "\033[92m"
+ C_LYELLOW = "\033[93m"
+ C_LGRAY = "\033[37m"
+ C_BOLD = "\033[1m"
+ C_END = "\033[0m"
+
+ KW = C_LBLUE
+ URL = C_LCYAN + C_BOLD
+ PARAM = C_LGRAY
+ YSON_PARAM = C_LYELLOW
+
+ RE_KW = functools.partial(lambda p, r, m: p.sub(r, m), re.compile(r"(Perform HTTP \S+ request|Response received)"), r"{}\1{}".format(KW, C_END))
+ RE_HTTP = functools.partial(lambda p, r, m: p.sub(r, m), re.compile(r"(https?://\S+)"), r"{}\1{}".format(URL, C_END))
+ RE_JSON = functools.partial(lambda p, r, m: p.sub(r, m), re.compile(r"([\w'-]+): "), r"{}\1{}: ".format(PARAM, C_END))
+ RE_YSON = functools.partial(lambda p, r, m: p.sub(r, m), re.compile(r"\"([^\";]+?)\"="), "\"{}\\1{}\"=".format(YSON_PARAM, C_END))
+
+ ENABLED = os.environ.get("YT_LOG_LEVEL") == "Debug"
+
+ terminator = '\n' # py2 compat
+
+ def _colorize(self, msg):
+ msg = self.RE_KW(msg)
+ msg = self.RE_HTTP(msg)
+ msg = self.RE_JSON(msg)
+ msg = self.RE_YSON(msg)
+ return msg
+
+ def emit(self, record):
+ try:
+ msg = self.format(record)
+ stream = self.stream
+ if stream.isatty() and record.levelno == logging.DEBUG and self.ENABLED:
+ msg = self._colorize(msg)
+ stream.write(msg + self.terminator)
+ self.flush()
+ except Exception:
+ self.handleError(record)
+
+
+formatter = None
+
+
+def set_formatter(new_formatter):
+ global formatter
+ formatter = new_formatter
+ for handler in LOGGER.handlers:
+ handler.setFormatter(new_formatter)
+
+
logging.getLogger("yt.packages.requests.packages.urllib3").setLevel(logging.WARNING)
LOGGER = logging.getLogger("Yt")
@@ -29,22 +84,12 @@ LOGGER.propagate = False
set_log_level_from_config(LOGGER)
if logger_config.LOG_PATH is None:
- LOGGER.addHandler(logging.StreamHandler())
+ LOGGER.addHandler(SimpleColorizedStreamHandler())
else:
LOGGER.addHandler(logging.FileHandler(logger_config.LOG_PATH))
BASIC_FORMATTER = logging.Formatter(logger_config.LOG_PATTERN)
-formatter = None
-
-
-def set_formatter(new_formatter):
- global formatter
- formatter = new_formatter
- for handler in LOGGER.handlers:
- handler.setFormatter(new_formatter)
-
-
set_formatter(BASIC_FORMATTER)
diff --git a/yt/yt/client/api/client_common.h b/yt/yt/client/api/client_common.h
index 4133955e906..31395f015a0 100644
--- a/yt/yt/client/api/client_common.h
+++ b/yt/yt/client/api/client_common.h
@@ -151,14 +151,15 @@ struct TSelectRowsOptionsBase
// COMPAT(lukyan)
//! Use fixed and rewritten range inference.
bool NewRangeInference = true;
- //! Enables canonical SQL behaviour for relational operators, i.e. null </=/> value -> null.
- bool UseCanonicalNullRelations = false;
- //! Merge versioned rows from different stores when reading.
- bool MergeVersionedRows = true;
//! Query language syntax version.
int SyntaxVersion = 1;
};
+DEFINE_ENUM(EExecutionBackend,
+ (Native)
+ (WebAssembly)
+);
+
struct TSelectRowsOptions
: public TSelectRowsOptionsBase
{
@@ -184,8 +185,12 @@ struct TSelectRowsOptions
TDetailedProfilingInfoPtr DetailedProfilingInfo;
//! YSON map with placeholder values for parameterized queries.
NYson::TYsonString PlaceholderValues;
- //! If |true| then WebAssembly execution backend is used.
- std::optional<bool> UseWebAssembly;
+ //! Native or WebAssembly execution backend.
+ std::optional<EExecutionBackend> ExecutionBackend;
+ //! Enables canonical SQL behaviour for relational operators, i.e. null </=/> value -> null.
+ bool UseCanonicalNullRelations = false;
+ //! Merge versioned rows from different stores when reading.
+ bool MergeVersionedRows = true;
//! Expected schemas for tables in a query (used for replica fallback in replicated tables).
using TExpectedTableSchemas = THashMap<NYPath::TYPath, NTableClient::TTableSchemaPtr>;
TExpectedTableSchemas ExpectedTableSchemas;
diff --git a/yt/yt/client/api/internal_client.cpp b/yt/yt/client/api/internal_client.cpp
index 2fb7da75060..8c0e2f4ee5e 100644
--- a/yt/yt/client/api/internal_client.cpp
+++ b/yt/yt/client/api/internal_client.cpp
@@ -8,18 +8,26 @@ void TSerializableHunkDescriptor::Register(TRegistrar registrar)
{
registrar.BaseClassParameter("chunk_id", &TThis::ChunkId);
registrar.BaseClassParameter("erasure_codec", &TThis::ErasureCodec)
- .Optional();
+ .Default(NErasure::ECodec::None);
registrar.BaseClassParameter("block_index", &TThis::BlockIndex);
registrar.BaseClassParameter("block_offset", &TThis::BlockOffset);
registrar.BaseClassParameter("block_size", &TThis::BlockSize)
- .Optional();
+ .Default(std::nullopt);
registrar.BaseClassParameter("length", &TThis::Length);
}
-TSerializableHunkDescriptor::TSerializableHunkDescriptor(const THunkDescriptor& descriptor)
- : THunkDescriptor(descriptor)
+TSerializableHunkDescriptorPtr CreateSerializableHunkDescriptor(const THunkDescriptor& descriptor)
{
- ::NYT::NYTree::TYsonStructRegistry::Get()->InitializeStruct(this);
+ auto serializableDescriptor = New<TSerializableHunkDescriptor>();
+ serializableDescriptor->ChunkId = descriptor.ChunkId;
+ serializableDescriptor->ErasureCodec = descriptor.ErasureCodec;
+ serializableDescriptor->BlockIndex = descriptor.BlockIndex;
+ serializableDescriptor->BlockOffset = descriptor.BlockOffset;
+ serializableDescriptor->BlockSize = descriptor.BlockSize;
+ serializableDescriptor->Length = descriptor.Length;
+ serializableDescriptor->Postprocess();
+
+ return serializableDescriptor;
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/client/api/internal_client.h b/yt/yt/client/api/internal_client.h
index 01fa29340b0..61a2f300ab1 100644
--- a/yt/yt/client/api/internal_client.h
+++ b/yt/yt/client/api/internal_client.h
@@ -29,8 +29,6 @@ class TSerializableHunkDescriptor
, public NYTree::TYsonStruct
{
public:
- TSerializableHunkDescriptor(const THunkDescriptor& descriptor);
-
REGISTER_YSON_STRUCT(TSerializableHunkDescriptor);
static void Register(TRegistrar registrar);
@@ -38,6 +36,8 @@ public:
using TSerializableHunkDescriptorPtr = TIntrusivePtr<TSerializableHunkDescriptor>;
+TSerializableHunkDescriptorPtr CreateSerializableHunkDescriptor(const THunkDescriptor& descriptor);
+
////////////////////////////////////////////////////////////////////////////////
struct TReadHunksOptions
diff --git a/yt/yt/client/api/operations_archive_schema.cpp b/yt/yt/client/api/operations_archive_schema.cpp
index bf0470bb47b..82a69e46ede 100644
--- a/yt/yt/client/api/operations_archive_schema.cpp
+++ b/yt/yt/client/api/operations_archive_schema.cpp
@@ -77,52 +77,4 @@ TOrderedByStartTimeTableDescriptor::TIndex::TIndex(const TNameTablePtr& nameTabl
////////////////////////////////////////////////////////////////////////////////
-TJobTableDescriptor::TJobTableDescriptor()
- : NameTable(New<TNameTable>())
- , Index(NameTable)
-{ }
-
-const TJobTableDescriptor& TJobTableDescriptor::Get()
-{
- static const TJobTableDescriptor descriptor;
- return descriptor;
-}
-
-TJobTableDescriptor::TIndex::TIndex(const TNameTablePtr& nameTable)
- : OperationIdHi(nameTable->RegisterName("operation_id_hi"))
- , OperationIdLo(nameTable->RegisterName("operation_id_lo"))
- , JobIdHi(nameTable->RegisterName("job_id_hi"))
- , JobIdLo(nameTable->RegisterName("job_id_lo"))
- , Type(nameTable->RegisterName("type"))
- , State(nameTable->RegisterName("state"))
- , TransientState(nameTable->RegisterName("transient_state"))
- , StartTime(nameTable->RegisterName("start_time"))
- , FinishTime(nameTable->RegisterName("finish_time"))
- , UpdateTime(nameTable->RegisterName("update_time"))
- , Address(nameTable->RegisterName("address"))
- , Error(nameTable->RegisterName("error"))
- , InterruptionInfo(nameTable->RegisterName("interruption_info"))
- , Statistics(nameTable->RegisterName("statistics"))
- , BriefStatistics(nameTable->RegisterName("brief_statistics"))
- , StatisticsLz4(nameTable->RegisterName("statistics_lz4"))
- , Events(nameTable->RegisterName("events"))
- , StderrSize(nameTable->RegisterName("stderr_size"))
- , HasSpec(nameTable->RegisterName("has_spec"))
- , HasFailContext(nameTable->RegisterName("has_fail_context"))
- , FailContextSize(nameTable->RegisterName("fail_context_size"))
- , CoreInfos(nameTable->RegisterName("core_infos"))
- , JobCompetitionId(nameTable->RegisterName("job_competition_id"))
- , ProbingJobCompetitionId(nameTable->RegisterName("probing_job_competition_id"))
- , HasCompetitors(nameTable->RegisterName("has_competitors"))
- , HasProbingCompetitors(nameTable->RegisterName("has_probing_competitors"))
- , ExecAttributes(nameTable->RegisterName("exec_attributes"))
- , TaskName(nameTable->RegisterName("task_name"))
- , PoolTree(nameTable->RegisterName("pool_tree"))
- , MonitoringDescriptor(nameTable->RegisterName("monitoring_descriptor"))
- , JobCookie(nameTable->RegisterName("job_cookie"))
- , ControllerState(nameTable->RegisterName("controller_state"))
-{ }
-
-////////////////////////////////////////////////////////////////////////////////
-
} // namespace NYT::NApi
diff --git a/yt/yt/client/api/operations_archive_schema.h b/yt/yt/client/api/operations_archive_schema.h
index b58864ed03a..93ec01aa752 100644
--- a/yt/yt/client/api/operations_archive_schema.h
+++ b/yt/yt/client/api/operations_archive_schema.h
@@ -81,54 +81,4 @@ struct TOrderedByStartTimeTableDescriptor
////////////////////////////////////////////////////////////////////////////////
-struct TJobTableDescriptor
-{
- TJobTableDescriptor();
-
- static const TJobTableDescriptor& Get();
-
- struct TIndex
- {
- explicit TIndex(const NTableClient::TNameTablePtr& nameTable);
-
- const int OperationIdHi;
- const int OperationIdLo;
- const int JobIdHi;
- const int JobIdLo;
- const int Type;
- const int State;
- const int TransientState;
- const int StartTime;
- const int FinishTime;
- const int UpdateTime;
- const int Address;
- const int Error;
- const int InterruptionInfo;
- const int Statistics;
- const int BriefStatistics;
- const int StatisticsLz4;
- const int Events;
- const int StderrSize;
- const int HasSpec;
- const int HasFailContext;
- const int FailContextSize;
- const int CoreInfos;
- const int JobCompetitionId;
- const int ProbingJobCompetitionId;
- const int HasCompetitors;
- const int HasProbingCompetitors;
- const int ExecAttributes;
- const int TaskName;
- const int PoolTree;
- const int MonitoringDescriptor;
- const int JobCookie;
- const int ControllerState;
- };
-
- const NTableClient::TNameTablePtr NameTable;
- const TIndex Index;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
} //namespace NYT::NApi
diff --git a/yt/yt/client/api/query_tracker_client.h b/yt/yt/client/api/query_tracker_client.h
index f85a6757d28..e2cb81d27e5 100644
--- a/yt/yt/client/api/query_tracker_client.h
+++ b/yt/yt/client/api/query_tracker_client.h
@@ -15,7 +15,7 @@ struct TQueryTrackerOptions
TString QueryTrackerStage = "production";
};
-DEFINE_ENUM(ContentType,
+DEFINE_ENUM(EContentType,
((RawInlineData) (0))
((Url) (1))
);
@@ -25,7 +25,7 @@ struct TQueryFile
{
TString Name;
TString Content;
- ContentType Type;
+ EContentType Type;
REGISTER_YSON_STRUCT(TQueryFile);
diff --git a/yt/yt/client/api/rpc_proxy/api_service_proxy.h b/yt/yt/client/api/rpc_proxy/api_service_proxy.h
index 6aaf2c1e369..d90e1ede0aa 100644
--- a/yt/yt/client/api/rpc_proxy/api_service_proxy.h
+++ b/yt/yt/client/api/rpc_proxy/api_service_proxy.h
@@ -183,6 +183,16 @@ public:
DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, PausePipeline);
DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, GetPipelineStatus);
+ // Query tracker
+ DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, StartQuery);
+ DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, AbortQuery);
+ DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, GetQueryResult);
+ DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, ReadQueryResult);
+ DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, GetQuery);
+ DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, ListQueries);
+ DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, AlterQuery);
+ DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, GetQueryTrackerInfo);
+
// Misc
DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, CheckClusterLiveness);
};
diff --git a/yt/yt/client/api/rpc_proxy/client_base.cpp b/yt/yt/client/api/rpc_proxy/client_base.cpp
index 191a57b9355..14079ff161a 100644
--- a/yt/yt/client/api/rpc_proxy/client_base.cpp
+++ b/yt/yt/client/api/rpc_proxy/client_base.cpp
@@ -999,8 +999,8 @@ TFuture<TSelectRowsResult> TClientBase::SelectRows(
req->set_fail_on_incomplete_result(options.FailOnIncompleteResult);
req->set_verbose_logging(options.VerboseLogging);
req->set_new_range_inference(options.NewRangeInference);
- if (options.UseWebAssembly) {
- req->set_use_web_assembly(*options.UseWebAssembly);
+ if (options.ExecutionBackend) {
+ req->set_execution_backend(static_cast<int>(*options.ExecutionBackend));
}
req->set_enable_code_cache(options.EnableCodeCache);
req->set_memory_limit_per_node(options.MemoryLimitPerNode);
diff --git a/yt/yt/client/api/rpc_proxy/client_impl.cpp b/yt/yt/client/api/rpc_proxy/client_impl.cpp
index 1089d991791..6daa5630300 100644
--- a/yt/yt/client/api/rpc_proxy/client_impl.cpp
+++ b/yt/yt/client/api/rpc_proxy/client_impl.cpp
@@ -2019,60 +2019,237 @@ TFuture<TRequestRestartResult> TClient::RequestRestart(
}
TFuture<NQueryTrackerClient::TQueryId> TClient::StartQuery(
- NQueryTrackerClient::EQueryEngine /*engine*/,
- const TString& /*query*/,
- const TStartQueryOptions& /*options*/)
+ NQueryTrackerClient::EQueryEngine engine,
+ const TString& query,
+ const TStartQueryOptions& options)
{
- ThrowUnimplemented("StartQuery");
+ auto proxy = CreateApiServiceProxy();
+
+ auto req = proxy.StartQuery();
+ SetTimeoutOptions(*req, options);
+
+ req->set_query_tracker_stage(options.QueryTrackerStage);
+ req->set_engine(NProto::ConvertQueryEngineToProto(engine));
+ req->set_query(query);
+ req->set_draft(options.Draft);
+
+ if (options.Settings) {
+ req->set_settings(ConvertToYsonString(options.Settings).ToString());
+ }
+ if (options.Annotations) {
+ req->set_annotations(ConvertToYsonString(options.Annotations).ToString());
+ }
+ if (options.AccessControlObject) {
+ req->set_access_control_object(*options.AccessControlObject);
+ }
+
+ for (const auto& file : options.Files) {
+ auto* protoFile = req->add_files();
+ protoFile->set_name(file->Name);
+ protoFile->set_content(file->Content);
+ protoFile->set_type(static_cast<NProto::EContentType>(file->Type));
+ }
+
+ return req->Invoke().Apply(BIND([] (const TApiServiceProxy::TRspStartQueryPtr& rsp) {
+ return FromProto<NQueryTrackerClient::TQueryId>(rsp->query_id());
+ }));
}
TFuture<void> TClient::AbortQuery(
- NQueryTrackerClient::TQueryId /*queryId*/,
- const TAbortQueryOptions& /*options*/)
+ NQueryTrackerClient::TQueryId queryId,
+ const TAbortQueryOptions& options)
{
- ThrowUnimplemented("AbortQuery");
+ auto proxy = CreateApiServiceProxy();
+
+ auto req = proxy.AbortQuery();
+ SetTimeoutOptions(*req, options);
+
+ req->set_query_tracker_stage(options.QueryTrackerStage);
+ ToProto(req->mutable_query_id(), queryId);
+
+ if (options.AbortMessage) {
+ req->set_abort_message(*options.AbortMessage);
+ }
+
+ return req->Invoke().AsVoid();
}
TFuture<TQueryResult> TClient::GetQueryResult(
- NQueryTrackerClient::TQueryId /*queryId*/,
- i64 /*resultIndex*/,
- const TGetQueryResultOptions& /*options*/)
+ NQueryTrackerClient::TQueryId queryId,
+ i64 resultIndex,
+ const TGetQueryResultOptions& options)
{
- ThrowUnimplemented("GetQueryResult");
+ auto proxy = CreateApiServiceProxy();
+
+ auto req = proxy.GetQueryResult();
+ SetTimeoutOptions(*req, options);
+
+ req->set_query_tracker_stage(options.QueryTrackerStage);
+ ToProto(req->mutable_query_id(), queryId);
+ req->set_result_index(resultIndex);
+
+ return req->Invoke().Apply(BIND([] (const TApiServiceProxy::TRspGetQueryResultPtr& rsp) {
+ return TQueryResult{
+ .Id = FromProto<NQueryTrackerClient::TQueryId>(rsp->query_id()),
+ .ResultIndex = rsp->result_index(),
+ .Error = FromProto<TError>(rsp->error()),
+ .Schema = rsp->has_schema() ? FromProto<NTableClient::TTableSchemaPtr>(rsp->schema()) : nullptr,
+ .DataStatistics = FromProto<NChunkClient::NProto::TDataStatistics>(rsp->data_statistics()),
+ .IsTruncated = rsp->is_truncated(),
+ };
+ }));
}
TFuture<IUnversionedRowsetPtr> TClient::ReadQueryResult(
- NQueryTrackerClient::TQueryId /*queryId*/,
- i64 /*resultIndex*/,
- const TReadQueryResultOptions& /*options*/)
+ NQueryTrackerClient::TQueryId queryId,
+ i64 resultIndex,
+ const TReadQueryResultOptions& options)
{
- ThrowUnimplemented("AbortQuery");
+ auto proxy = CreateApiServiceProxy();
+
+ auto req = proxy.ReadQueryResult();
+ SetTimeoutOptions(*req, options);
+
+ req->set_query_tracker_stage(options.QueryTrackerStage);
+ ToProto(req->mutable_query_id(), queryId);
+ req->set_result_index(resultIndex);
+
+ if (options.Columns) {
+ auto* protoColumns = req->mutable_columns();
+ for (const auto& column : *options.Columns) {
+ protoColumns->add_items(column);
+ }
+ }
+ if (options.LowerRowIndex) {
+ req->set_lower_row_index(*options.LowerRowIndex);
+ }
+ if (options.UpperRowIndex) {
+ req->set_upper_row_index(*options.UpperRowIndex);
+ }
+
+ return req->Invoke().Apply(BIND([] (const TApiServiceProxy::TRspReadQueryResultPtr& rsp) {
+ return DeserializeRowset<TUnversionedRow>(
+ rsp->rowset_descriptor(),
+ MergeRefsToRef<TRpcProxyClientBufferTag>(rsp->Attachments()));
+ }));
}
TFuture<TQuery> TClient::GetQuery(
- NQueryTrackerClient::TQueryId /*queryId*/,
- const TGetQueryOptions& /*options*/)
+ NQueryTrackerClient::TQueryId queryId,
+ const TGetQueryOptions& options)
{
- ThrowUnimplemented("GetQuery");
+ auto proxy = CreateApiServiceProxy();
+
+ auto req = proxy.GetQuery();
+ SetTimeoutOptions(*req, options);
+
+ req->set_query_tracker_stage(options.QueryTrackerStage);
+ ToProto(req->mutable_query_id(), queryId);
+
+ if (options.Attributes) {
+ ToProto(req->mutable_attributes(), options.Attributes);
+ }
+ if (options.Timestamp) {
+ req->set_timestamp(ToProto<i64>(options.Timestamp));
+ }
+
+ return req->Invoke().Apply(BIND([] (const TApiServiceProxy::TRspGetQueryPtr& rsp) {
+ return FromProto<TQuery>(rsp->query());
+ }));
}
TFuture<TListQueriesResult> TClient::ListQueries(
- const TListQueriesOptions& /*options*/)
+ const TListQueriesOptions& options)
{
- ThrowUnimplemented("ListQueries");
+ auto proxy = CreateApiServiceProxy();
+
+ auto req = proxy.ListQueries();
+ SetTimeoutOptions(*req, options);
+
+ req->set_query_tracker_stage(options.QueryTrackerStage);
+
+ if (options.FromTime) {
+ req->set_from_time(NYT::ToProto<i64>(*options.FromTime));
+ }
+ if (options.ToTime) {
+ req->set_to_time(NYT::ToProto<i64>(*options.ToTime));
+ }
+ if (options.CursorTime) {
+ req->set_cursor_time(NYT::ToProto<i64>(*options.CursorTime));
+ }
+ req->set_cursor_direction(static_cast<NProto::EOperationSortDirection>(options.CursorDirection));
+
+ if (options.UserFilter) {
+ req->set_user_filter(*options.UserFilter);
+ }
+ if (options.StateFilter) {
+ req->set_state_filter(NProto::ConvertQueryStateToProto(*options.StateFilter));
+ }
+ if (options.EngineFilter) {
+ req->set_engine_filter(NProto::ConvertQueryEngineToProto(*options.EngineFilter));
+ }
+ if (options.SubstrFilter) {
+ req->set_substr_filter(*options.SubstrFilter);
+ }
+
+ req->set_limit(options.Limit);
+
+ if (options.Attributes) {
+ ToProto(req->mutable_attributes(), options.Attributes);
+ }
+
+ return req->Invoke().Apply(BIND([] (const TApiServiceProxy::TRspListQueriesPtr& rsp) {
+ return TListQueriesResult{
+ .Queries = FromProto<std::vector<TQuery>>(rsp->queries()),
+ .Incomplete = rsp->incomplete(),
+ .Timestamp = rsp->timestamp(),
+ };
+ }));
}
TFuture<void> TClient::AlterQuery(
- NQueryTrackerClient::TQueryId /*queryId*/,
- const TAlterQueryOptions& /*options*/)
+ NQueryTrackerClient::TQueryId queryId,
+ const TAlterQueryOptions& options)
{
- ThrowUnimplemented("AlterQuery");
+ auto proxy = CreateApiServiceProxy();
+
+ auto req = proxy.AlterQuery();
+ SetTimeoutOptions(*req, options);
+
+ req->set_query_tracker_stage(options.QueryTrackerStage);
+ ToProto(req->mutable_query_id(), queryId);
+
+ if (options.Annotations) {
+ req->set_annotations(ConvertToYsonString(options.Annotations).ToString());
+ }
+ if (options.AccessControlObject) {
+ req->set_access_control_object(*options.AccessControlObject);
+ }
+
+ return req->Invoke().AsVoid();
}
TFuture<TGetQueryTrackerInfoResult> TClient::GetQueryTrackerInfo(
- const TGetQueryTrackerInfoOptions& /*options*/)
+ const TGetQueryTrackerInfoOptions& options)
{
- ThrowUnimplemented("GetQueryTrackerInfo");
+ auto proxy = CreateApiServiceProxy();
+
+ auto req = proxy.GetQueryTrackerInfo();
+ SetTimeoutOptions(*req, options);
+
+ req->set_query_tracker_stage(options.QueryTrackerStage);
+
+ if (options.Attributes) {
+ ToProto(req->mutable_attributes(), options.Attributes);
+ }
+
+ return req->Invoke().Apply(BIND([] (const TApiServiceProxy::TRspGetQueryTrackerInfoPtr& rsp) {
+ return TGetQueryTrackerInfoResult{
+ .ClusterName = rsp->cluster_name(),
+ .SupportedFeatures = TYsonString(rsp->supported_features()),
+ .AccessControlObjects = FromProto<std::vector<TString>>(rsp->access_control_objects()),
+ };
+ }));
}
TFuture<NBundleControllerClient::TBundleConfigDescriptorPtr> TClient::GetBundleConfig(
diff --git a/yt/yt/client/api/rpc_proxy/helpers.cpp b/yt/yt/client/api/rpc_proxy/helpers.cpp
index 45a5c48d6ae..1dff960561c 100644
--- a/yt/yt/client/api/rpc_proxy/helpers.cpp
+++ b/yt/yt/client/api/rpc_proxy/helpers.cpp
@@ -77,9 +77,9 @@ void ToProto(
{
proto->set_read_from(static_cast<NProto::EMasterReadKind>(options.ReadFrom));
proto->set_disable_per_user_cache(options.DisablePerUserCache);
- proto->set_expire_after_successful_update_time(NYT::ToProto<i64>(options.ExpireAfterSuccessfulUpdateTime));
- proto->set_expire_after_failed_update_time(NYT::ToProto<i64>(options.ExpireAfterFailedUpdateTime));
- proto->set_success_staleness_bound(NYT::ToProto<i64>(options.SuccessStalenessBound));
+ proto->set_expire_after_successful_update_time(ToProto<i64>(options.ExpireAfterSuccessfulUpdateTime));
+ proto->set_expire_after_failed_update_time(ToProto<i64>(options.ExpireAfterFailedUpdateTime));
+ proto->set_success_staleness_bound(ToProto<i64>(options.SuccessStalenessBound));
if (options.CacheStickyGroupSize) {
proto->set_cache_sticky_group_size(*options.CacheStickyGroupSize);
}
@@ -120,7 +120,7 @@ void ToProto(
{
protoOptions->set_read_from(static_cast<NProto::ETabletReadKind>(options.ReadFrom));
if (options.CachedSyncReplicasTimeout) {
- protoOptions->set_cached_sync_replicas_timeout(NYT::ToProto<i64>(*options.CachedSyncReplicasTimeout));
+ protoOptions->set_cached_sync_replicas_timeout(ToProto<i64>(*options.CachedSyncReplicasTimeout));
}
}
@@ -235,7 +235,7 @@ void ToProto(
proto->set_subject_name(*result.SubjectName);
}
- NYT::ToProto(proto->mutable_missing_subjects(), result.MissingSubjects);
+ ToProto(proto->mutable_missing_subjects(), result.MissingSubjects);
}
void FromProto(
@@ -251,7 +251,7 @@ void FromProto(
result->SubjectName.reset();
}
- NYT::FromProto(&result->MissingSubjects, proto.missing_subjects());
+ FromProto(&result->MissingSubjects, proto.missing_subjects());
}
void ToProto(
@@ -259,7 +259,7 @@ void ToProto(
const NApi::TListOperationsResult& result)
{
proto->Clear();
- NYT::ToProto(proto->mutable_operations(), result.Operations);
+ ToProto(proto->mutable_operations(), result.Operations);
if (result.PoolTreeCounts) {
auto* poolTreeCounts = proto->mutable_pool_tree_counts()->mutable_entries();
@@ -311,7 +311,7 @@ void FromProto(
NApi::TListOperationsResult* result,
const NProto::TListOperationsResult& proto)
{
- NYT::FromProto(&result->Operations, proto.operations());
+ FromProto(&result->Operations, proto.operations());
if (proto.has_pool_tree_counts()) {
result->PoolTreeCounts.emplace();
@@ -382,7 +382,7 @@ void ToProto(
const NApi::TListJobsResult& result)
{
proto->Clear();
- NYT::ToProto(proto->mutable_jobs(), result.Jobs);
+ ToProto(proto->mutable_jobs(), result.Jobs);
if (result.CypressJobCount) {
proto->set_cypress_job_count(*result.CypressJobCount);
@@ -395,14 +395,14 @@ void ToProto(
}
ToProto(proto->mutable_statistics(), result.Statistics);
- NYT::ToProto(proto->mutable_errors(), result.Errors);
+ ToProto(proto->mutable_errors(), result.Errors);
}
void FromProto(
NApi::TListJobsResult* result,
const NProto::TListJobsResult& proto)
{
- NYT::FromProto(&result->Jobs, proto.jobs());
+ FromProto(&result->Jobs, proto.jobs());
if (proto.has_cypress_job_count()) {
result->CypressJobCount = proto.cypress_job_count();
@@ -421,7 +421,7 @@ void FromProto(
}
FromProto(&result->Statistics, proto.statistics());
- NYT::FromProto(&result->Errors, proto.errors());
+ FromProto(&result->Errors, proto.errors());
}
////////////////////////////////////////////////////////////////////////////////
@@ -430,9 +430,9 @@ void FromProto(
void ToProto(NProto::TColumnSchema* protoSchema, const NTableClient::TColumnSchema& schema)
{
- protoSchema->set_stable_name(schema.StableName().Get());
+ protoSchema->set_stable_name(schema.StableName().Underlying());
protoSchema->set_name(schema.Name());
- protoSchema->set_type(NYT::ToProto<int>(GetPhysicalType(schema.CastToV1Type())));
+ protoSchema->set_type(ToProto<int>(GetPhysicalType(schema.CastToV1Type())));
auto typeV3Yson = ConvertToYsonString(TTypeV3LogicalTypeWrapper{schema.LogicalType()});
protoSchema->set_type_v3(typeV3Yson.ToString());
if (schema.Lock()) {
@@ -451,7 +451,7 @@ void ToProto(NProto::TColumnSchema* protoSchema, const NTableClient::TColumnSche
protoSchema->clear_aggregate();
}
if (schema.SortOrder()) {
- protoSchema->set_sort_order(NYT::ToProto<int>(*schema.SortOrder()));
+ protoSchema->set_sort_order(ToProto<int>(*schema.SortOrder()));
} else {
protoSchema->clear_sort_order();
}
@@ -477,8 +477,8 @@ void FromProto(NTableClient::TColumnSchema* schema, const NProto::TColumnSchema&
schema->SetName(protoSchema.name());
schema->SetStableName(
protoSchema.has_stable_name()
- ? TStableName(protoSchema.stable_name())
- : TStableName(protoSchema.name()));
+ ? TColumnStableName(protoSchema.stable_name())
+ : TColumnStableName(protoSchema.name()));
auto physicalType = CheckedEnumCast<EValueType>(protoSchema.type());
@@ -491,10 +491,10 @@ void FromProto(NTableClient::TColumnSchema* schema, const NProto::TColumnSchema&
<< TErrorAttribute("type_v3", ToString(*columnType))
<< TErrorAttribute("required", protoSchema.required());
}
- if (protoSchema.has_logical_type() && v1Type != NYT::FromProto<ESimpleLogicalValueType>(protoSchema.logical_type())) {
+ if (protoSchema.has_logical_type() && v1Type != FromProto<ESimpleLogicalValueType>(protoSchema.logical_type())) {
THROW_ERROR_EXCEPTION("Fields \"type_v3\" and \"logical_type\" do not match")
<< TErrorAttribute("type_v3", ToString(*columnType))
- << TErrorAttribute("logical_type", NYT::FromProto<ESimpleLogicalValueType>(protoSchema.logical_type()));
+ << TErrorAttribute("logical_type", FromProto<ESimpleLogicalValueType>(protoSchema.logical_type()));
}
if (protoSchema.has_type() && GetPhysicalType(v1Type) != physicalType) {
THROW_ERROR_EXCEPTION("Fields \"type_v3\" and \"logical_type\" do not match")
@@ -528,8 +528,6 @@ void FromProto(NTableClient::TColumnSchema* schema, const NProto::TColumnSchema&
void ToProto(NProto::TTableSchema* protoSchema, const NTableClient::TTableSchema& schema)
{
- using NYT::ToProto;
-
ToProto(protoSchema->mutable_columns(), schema.Columns());
protoSchema->set_strict(schema.GetStrict());
protoSchema->set_unique_keys(schema.GetUniqueKeys());
@@ -537,8 +535,6 @@ void ToProto(NProto::TTableSchema* protoSchema, const NTableClient::TTableSchema
void FromProto(NTableClient::TTableSchema* schema, const NProto::TTableSchema& protoSchema)
{
- using NYT::FromProto;
-
*schema = NTableClient::TTableSchema(
FromProto<std::vector<NTableClient::TColumnSchema>>(protoSchema.columns()),
protoSchema.strict(),
@@ -569,8 +565,6 @@ void ToProto(NProto::TTabletInfo* protoTabletInfo, const NTabletClient::TTabletI
void FromProto(NTabletClient::TTabletInfo* tabletInfo, const NProto::TTabletInfo& protoTabletInfo)
{
- using NYT::FromProto;
-
tabletInfo->TabletId =
FromProto<TTabletId>(protoTabletInfo.tablet_id());
tabletInfo->MountRevision = protoTabletInfo.mount_revision();
@@ -599,7 +593,7 @@ void ToProto(
protoStatistics->set_incomplete_output(statistics.IncompleteOutput);
protoStatistics->set_memory_usage(statistics.MemoryUsage);
- NYT::ToProto(protoStatistics->mutable_inner_statistics(), statistics.InnerStatistics);
+ ToProto(protoStatistics->mutable_inner_statistics(), statistics.InnerStatistics);
}
void FromProto(
@@ -620,7 +614,7 @@ void FromProto(
statistics->IncompleteOutput = protoStatistics.incomplete_output();
statistics->MemoryUsage = protoStatistics.memory_usage();
- NYT::FromProto(&statistics->InnerStatistics, protoStatistics.inner_statistics());
+ FromProto(&statistics->InnerStatistics, protoStatistics.inner_statistics());
}
void ToProto(NProto::TOperation* protoOperation, const NApi::TOperation& operation)
@@ -638,10 +632,10 @@ void ToProto(NProto::TOperation* protoOperation, const NApi::TOperation& operati
}
if (operation.StartTime) {
- protoOperation->set_start_time(NYT::ToProto<i64>(*operation.StartTime));
+ protoOperation->set_start_time(ToProto<i64>(*operation.StartTime));
}
if (operation.FinishTime) {
- protoOperation->set_finish_time(NYT::ToProto<i64>(*operation.FinishTime));
+ protoOperation->set_finish_time(ToProto<i64>(*operation.FinishTime));
}
if (operation.AuthenticatedUser) {
@@ -719,7 +713,7 @@ void ToProto(NProto::TOperation* protoOperation, const NApi::TOperation& operati
void FromProto(NApi::TOperation* operation, const NProto::TOperation& protoOperation)
{
if (protoOperation.has_id()) {
- operation->Id = NYT::FromProto<NScheduler::TOperationId>(protoOperation.id());
+ operation->Id = FromProto<NScheduler::TOperationId>(protoOperation.id());
} else {
operation->Id.reset();
}
@@ -883,10 +877,10 @@ void ToProto(NProto::TJob* protoJob, const NApi::TJob& job)
}
if (job.StartTime) {
- protoJob->set_start_time(NYT::ToProto<i64>(*job.StartTime));
+ protoJob->set_start_time(ToProto<i64>(*job.StartTime));
}
if (job.FinishTime) {
- protoJob->set_finish_time(NYT::ToProto<i64>(*job.FinishTime));
+ protoJob->set_finish_time(ToProto<i64>(*job.FinishTime));
}
if (job.Address) {
@@ -1150,10 +1144,10 @@ void FromProto(
const NChunkClient::TFetchChunkSpecConfigPtr& fetchChunkSpecConfig,
const NProto::TFetchChunkSpecConfig& protoFetchChunkSpecConfig)
{
- NYT::FromProto(
+ FromProto(
&fetchChunkSpecConfig->MaxChunksPerFetch,
protoFetchChunkSpecConfig.max_chunk_per_fetch());
- NYT::FromProto(
+ FromProto(
&fetchChunkSpecConfig->MaxChunksPerLocateRequest,
protoFetchChunkSpecConfig.max_chunk_per_locate_request());
}
@@ -1163,7 +1157,7 @@ void ToProto(
const NChunkClient::TFetcherConfigPtr& fetcherConfig)
{
protoFetcherConfig->set_node_rpc_timeout(
- NYT::ToProto<i64>(fetcherConfig->NodeRpcTimeout));
+ ToProto<i64>(fetcherConfig->NodeRpcTimeout));
}
void FromProto(
@@ -1179,7 +1173,7 @@ void ToProto(
{
protoStatistics->Clear();
- NYT::ToProto(protoStatistics->mutable_column_data_weights(), statistics.ColumnDataWeights);
+ ToProto(protoStatistics->mutable_column_data_weights(), statistics.ColumnDataWeights);
if (statistics.TimestampTotalWeight) {
protoStatistics->set_timestamp_total_weight(*statistics.TimestampTotalWeight);
}
@@ -1187,7 +1181,7 @@ void ToProto(
NYT::NTableClient::ToProto(protoStatistics->mutable_column_min_values(), statistics.ColumnMinValues);
NYT::NTableClient::ToProto(protoStatistics->mutable_column_max_values(), statistics.ColumnMaxValues);
- NYT::ToProto(protoStatistics->mutable_column_non_null_value_counts(), statistics.ColumnNonNullValueCounts);
+ ToProto(protoStatistics->mutable_column_non_null_value_counts(), statistics.ColumnNonNullValueCounts);
if (statistics.ChunkRowCount) {
protoStatistics->set_chunk_row_count(*statistics.ChunkRowCount);
@@ -1201,7 +1195,7 @@ void FromProto(
NTableClient::TColumnarStatistics* statistics,
const NProto::TColumnarStatistics& protoStatistics)
{
- NYT::FromProto(&statistics->ColumnDataWeights, protoStatistics.column_data_weights());
+ FromProto(&statistics->ColumnDataWeights, protoStatistics.column_data_weights());
if (protoStatistics.has_timestamp_total_weight()) {
statistics->TimestampTotalWeight = protoStatistics.timestamp_total_weight();
} else {
@@ -1211,7 +1205,7 @@ void FromProto(
NYT::NTableClient::FromProto(&statistics->ColumnMinValues, protoStatistics.column_min_values());
NYT::NTableClient::FromProto(&statistics->ColumnMaxValues, protoStatistics.column_max_values());
- NYT::FromProto(&statistics->ColumnNonNullValueCounts, protoStatistics.column_non_null_value_counts());
+ FromProto(&statistics->ColumnNonNullValueCounts, protoStatistics.column_non_null_value_counts());
if (protoStatistics.has_chunk_row_count()) {
statistics->ChunkRowCount = protoStatistics.chunk_row_count();
@@ -1261,7 +1255,7 @@ void FromProto(
NApi::TMultiTablePartitions* multiTablePartitions,
const NProto::TRspPartitionTables& protoRspPartitionTables)
{
- NYT::FromProto(
+ FromProto(
&multiTablePartitions->Partitions,
protoRspPartitionTables.partitions());
}
@@ -1338,6 +1332,136 @@ void FromProto(
FromProto(&manifest->Clusters, protoManifest.clusters());
}
+void ToProto(
+ NProto::TQuery* protoQuery,
+ const NApi::TQuery& query)
+{
+ protoQuery->Clear();
+
+ ToProto(protoQuery->mutable_id(), query.Id);
+
+ if (query.Engine) {
+ protoQuery->set_engine(ConvertQueryEngineToProto(*query.Engine));
+ }
+ if (query.Query) {
+ protoQuery->set_query(*query.Query);
+ }
+ if (query.Files) {
+ protoQuery->set_files(query.Files->ToString());
+ }
+ if (query.StartTime) {
+ protoQuery->set_start_time(NYT::ToProto<i64>(*query.StartTime));
+ }
+ if (query.FinishTime) {
+ protoQuery->set_start_time(NYT::ToProto<i64>(*query.FinishTime));
+ }
+ if (query.Settings) {
+ protoQuery->set_settings(query.Settings.ToString());
+ }
+ if (query.User) {
+ protoQuery->set_user(*query.User);
+ }
+ if (query.AccessControlObject) {
+ protoQuery->set_access_control_object(*query.AccessControlObject);
+ }
+ if (query.State) {
+ protoQuery->set_state(ConvertQueryStateToProto(*query.State));
+ }
+ if (query.ResultCount) {
+ protoQuery->set_result_count(*query.ResultCount);
+ }
+ if (query.Progress) {
+ protoQuery->set_progress(query.Progress.ToString());
+ }
+ if (query.Error) {
+ ToProto(protoQuery->mutable_error(), *query.Error);
+ }
+ if (query.Annotations) {
+ protoQuery->set_annotations(query.Annotations.ToString());
+ }
+ if (query.OtherAttributes) {
+ ToProto(protoQuery->mutable_other_attributes(), *query.OtherAttributes);
+ }
+}
+
+void FromProto(
+ NApi::TQuery* query,
+ const NProto::TQuery& protoQuery)
+{
+ FromProto(&query->Id, protoQuery.id());
+
+ if (protoQuery.has_engine()) {
+ query->Engine = ConvertQueryEngineFromProto(protoQuery.engine());
+ } else {
+ query->Engine.reset();
+ }
+ if (protoQuery.has_query()) {
+ query->Query = protoQuery.query();
+ } else {
+ query->Query.reset();
+ }
+ if (protoQuery.has_files()) {
+ query->Files = TYsonString(protoQuery.files());
+ } else {
+ query->Files.reset();
+ }
+ if (protoQuery.has_start_time()) {
+ query->StartTime = TInstant::FromValue(protoQuery.start_time());
+ } else {
+ query->StartTime.reset();
+ }
+ if (protoQuery.has_finish_time()) {
+ query->FinishTime = TInstant::FromValue(protoQuery.finish_time());
+ } else {
+ query->FinishTime.reset();
+ }
+ if (protoQuery.has_settings()) {
+ query->Settings = TYsonString(protoQuery.settings());
+ } else {
+ query->Settings = TYsonString{};
+ }
+ if (protoQuery.has_user()) {
+ query->User = protoQuery.user();
+ } else {
+ query->User.reset();
+ }
+ if (protoQuery.has_access_control_object()) {
+ query->AccessControlObject = protoQuery.access_control_object();
+ } else {
+ query->AccessControlObject.reset();
+ }
+ if (protoQuery.has_state()) {
+ query->State = ConvertQueryStateFromProto(protoQuery.state());
+ } else {
+ query->State.reset();
+ }
+ if (protoQuery.result_count()) {
+ query->ResultCount = protoQuery.result_count();
+ } else {
+ query->ResultCount.reset();
+ }
+ if (protoQuery.has_progress()) {
+ query->Progress = TYsonString(protoQuery.progress());
+ } else {
+ query->Progress = TYsonString{};
+ }
+ if (protoQuery.has_error()) {
+ query->Error = FromProto<TError>(protoQuery.error());
+ } else {
+ query->Error.reset();
+ }
+ if (protoQuery.has_annotations()) {
+ query->Annotations = TYsonString(protoQuery.annotations());
+ } else {
+ query->Annotations = TYsonString{};
+ }
+ if (protoQuery.has_other_attributes()) {
+ query->OtherAttributes = NYTree::FromProto(protoQuery.other_attributes());
+ } else if (query->OtherAttributes) {
+ query->OtherAttributes->Clear();
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
// ENUMS
////////////////////////////////////////////////////////////////////////////////
@@ -1654,6 +1778,98 @@ NJobTrackerClient::EJobState ConvertJobStateFromProto(
YT_ABORT();
}
+NProto::EQueryEngine ConvertQueryEngineToProto(
+ NQueryTrackerClient::EQueryEngine queryEngine)
+{
+ switch (queryEngine) {
+ case NQueryTrackerClient::EQueryEngine::Ql:
+ return NProto::EQueryEngine::QE_QL;
+ case NQueryTrackerClient::EQueryEngine::Yql:
+ return NProto::EQueryEngine::QE_YQL;
+ case NQueryTrackerClient::EQueryEngine::Chyt:
+ return NProto::EQueryEngine::QE_CHYT;
+ case NQueryTrackerClient::EQueryEngine::Mock:
+ return NProto::EQueryEngine::QE_MOCK;
+ case NQueryTrackerClient::EQueryEngine::Spyt:
+ return NProto::EQueryEngine::QE_SPYT;
+ }
+ YT_ABORT();
+}
+
+NQueryTrackerClient::EQueryEngine ConvertQueryEngineFromProto(
+ NProto::EQueryEngine proto)
+{
+ switch (proto) {
+ case NProto::EQueryEngine::QE_QL:
+ return NQueryTrackerClient::EQueryEngine::Ql;
+ case NProto::EQueryEngine::QE_YQL:
+ return NQueryTrackerClient::EQueryEngine::Yql;
+ case NProto::EQueryEngine::QE_CHYT:
+ return NQueryTrackerClient::EQueryEngine::Chyt;
+ case NProto::EQueryEngine::QE_MOCK:
+ return NQueryTrackerClient::EQueryEngine::Mock;
+ case NProto::EQueryEngine::QE_SPYT:
+ return NQueryTrackerClient::EQueryEngine::Spyt;
+ case NProto::EQueryEngine::QE_UNKNOWN:
+ THROW_ERROR_EXCEPTION("Protobuf contains unknown value for query engine");
+ }
+ YT_ABORT();
+}
+
+NProto::EQueryState ConvertQueryStateToProto(
+ NQueryTrackerClient::EQueryState queryState)
+{
+ switch (queryState) {
+ case NQueryTrackerClient::EQueryState::Draft:
+ return NProto::EQueryState::QS_DRAFT;
+ case NQueryTrackerClient::EQueryState::Pending:
+ return NProto::EQueryState::QS_PENDING;
+ case NQueryTrackerClient::EQueryState::Running:
+ return NProto::EQueryState::QS_RUNNING;
+ case NQueryTrackerClient::EQueryState::Aborting:
+ return NProto::EQueryState::QS_ABORTING;
+ case NQueryTrackerClient::EQueryState::Aborted:
+ return NProto::EQueryState::QS_ABORTED;
+ case NQueryTrackerClient::EQueryState::Completing:
+ return NProto::EQueryState::QS_COMPLETING;
+ case NQueryTrackerClient::EQueryState::Completed:
+ return NProto::EQueryState::QS_COMPLETED;
+ case NQueryTrackerClient::EQueryState::Failing:
+ return NProto::EQueryState::QS_FAILING;
+ case NQueryTrackerClient::EQueryState::Failed:
+ return NProto::EQueryState::QS_FAILED;
+ }
+ YT_ABORT();
+}
+
+NQueryTrackerClient::EQueryState ConvertQueryStateFromProto(
+ NProto::EQueryState proto)
+{
+ switch (proto) {
+ case NProto::EQueryState::QS_DRAFT:
+ return NQueryTrackerClient::EQueryState::Draft;
+ case NProto::EQueryState::QS_PENDING:
+ return NQueryTrackerClient::EQueryState::Pending;
+ case NProto::EQueryState::QS_RUNNING:
+ return NQueryTrackerClient::EQueryState::Running;
+ case NProto::EQueryState::QS_ABORTING:
+ return NQueryTrackerClient::EQueryState::Aborting;
+ case NProto::EQueryState::QS_ABORTED:
+ return NQueryTrackerClient::EQueryState::Aborted;
+ case NProto::EQueryState::QS_COMPLETING:
+ return NQueryTrackerClient::EQueryState::Completing;
+ case NProto::EQueryState::QS_COMPLETED:
+ return NQueryTrackerClient::EQueryState::Completed;
+ case NProto::EQueryState::QS_FAILING:
+ return NQueryTrackerClient::EQueryState::Failing;
+ case NProto::EQueryState::QS_FAILED:
+ return NQueryTrackerClient::EQueryState::Failed;
+ case NProto::EQueryState::QS_UNKNOWN:
+ THROW_ERROR_EXCEPTION("Protobuf contains unknown value for query state");
+ }
+ YT_ABORT();
+}
+
////////////////////////////////////////////////////////////////////////////////
} // namespace NProto
@@ -1662,12 +1878,14 @@ NJobTrackerClient::EJobState ConvertJobStateFromProto(
bool IsDynamicTableRetriableError(const TError& error)
{
- // TODO(dgolear): Consider adding NoSuchTablet and TabletNotMounted errors?
return
error.FindMatching(NTabletClient::EErrorCode::RowIsBlocked) ||
error.FindMatching(NTabletClient::EErrorCode::BlockedRowWaitTimeout) ||
error.FindMatching(NTabletClient::EErrorCode::NoSuchCell) ||
- error.FindMatching(NTabletClient::EErrorCode::ChunkIsNotPreloaded);
+ error.FindMatching(NTabletClient::EErrorCode::ChunkIsNotPreloaded) ||
+ error.FindMatching(NTabletClient::EErrorCode::NoInSyncReplicas) ||
+ error.FindMatching(NTabletClient::EErrorCode::TabletNotMounted) ||
+ error.FindMatching(NTabletClient::EErrorCode::NoSuchTablet);
}
bool IsRetriableError(const TError& error, bool retryProxyBanned)
@@ -1802,7 +2020,7 @@ TTableSchemaPtr DeserializeRowsetSchema(
const NProto::TRowsetDescriptor& descriptor)
{
if (descriptor.has_schema()) {
- return NYT::FromProto<TTableSchemaPtr>(descriptor.schema());
+ return FromProto<TTableSchemaPtr>(descriptor.schema());
}
// COMPAT(babenko)
@@ -1812,7 +2030,7 @@ TTableSchemaPtr DeserializeRowsetSchema(
const auto& entry = descriptor.name_table_entries(i);
if (entry.has_name()) {
columns[i].SetName(entry.name());
- columns[i].SetStableName(TStableName(entry.name()));
+ columns[i].SetStableName(TColumnStableName(entry.name()));
}
if (entry.has_logical_type()) {
auto simpleLogicalType = CheckedEnumCast<NTableClient::ESimpleLogicalValueType>(entry.logical_type());
diff --git a/yt/yt/client/api/rpc_proxy/helpers.h b/yt/yt/client/api/rpc_proxy/helpers.h
index 4b01c4ae11a..722e47380e9 100644
--- a/yt/yt/client/api/rpc_proxy/helpers.h
+++ b/yt/yt/client/api/rpc_proxy/helpers.h
@@ -228,6 +228,14 @@ void FromProto(
NApi::TBackupManifest* manifest,
const NProto::TBackupManifest& protoManifest);
+void ToProto(
+ NProto::TQuery* protoQuery,
+ const NApi::TQuery& query);
+
+void FromProto(
+ NApi::TQuery* query,
+ const NProto::TQuery& protoQuery);
+
NProto::EOperationType ConvertOperationTypeToProto(
NScheduler::EOperationType operationType);
@@ -252,6 +260,17 @@ NProto::EJobState ConvertJobStateToProto(
NJobTrackerClient::EJobState ConvertJobStateFromProto(
NProto::EJobState proto);
+NProto::EQueryEngine ConvertQueryEngineToProto(
+ NQueryTrackerClient::EQueryEngine queryEngine);
+
+NQueryTrackerClient::EQueryEngine ConvertQueryEngineFromProto(
+ NProto::EQueryEngine proto);
+
+NProto::EQueryState ConvertQueryStateToProto(
+ NQueryTrackerClient::EQueryState queryState);
+
+NQueryTrackerClient::EQueryState ConvertQueryStateFromProto(
+ NProto::EQueryState proto);
} // namespace NProto
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/client/chunk_client/data_statistics.cpp b/yt/yt/client/chunk_client/data_statistics.cpp
index ce4ca1cd846..34327adbf7c 100644
--- a/yt/yt/client/chunk_client/data_statistics.cpp
+++ b/yt/yt/client/chunk_client/data_statistics.cpp
@@ -212,9 +212,8 @@ TDuration TCodecStatistics::GetTotalDuration() const
void FormatValue(TStringBuilderBase* builder, const TCodecStatistics& statistics, TStringBuf /* spec */)
{
FormatKeyValueRange(builder, statistics.CodecToDuration(), TDefaultFormatter());
- if (statistics.ValueDictionaryCompressionDuration()) {
- builder->AppendString(", ");
- builder->AppendFormat("ValueDictionaryCompressionDuration: %v",
+ if (statistics.ValueDictionaryCompressionDuration() != TDuration::Zero()) {
+ builder->AppendFormat(", ValueDictionaryCompressionDuration: %v",
statistics.ValueDictionaryCompressionDuration());
}
}
diff --git a/yt/yt/client/driver/command-inl.h b/yt/yt/client/driver/command-inl.h
index 2b63b335f4f..a27f748e715 100644
--- a/yt/yt/client/driver/command-inl.h
+++ b/yt/yt/client/driver/command-inl.h
@@ -413,20 +413,6 @@ void TSelectRowsCommandBase<
})
.Optional(/*init*/ false);
- registrar.template ParameterWithUniversalAccessor<bool>(
- "use_canonical_null_relations",
- [] (TThis* command) -> auto& {
- return command->Options.UseCanonicalNullRelations;
- })
- .Optional(/*init*/ false);
-
- registrar.template ParameterWithUniversalAccessor<bool>(
- "merge_versioned_rows",
- [] (TThis* command) -> auto& {
- return command->Options.MergeVersionedRows;
- })
- .Optional(/*init*/ false);
-
registrar.template ParameterWithUniversalAccessor<int>(
"syntax_version",
[] (TThis* command) -> auto& {
diff --git a/yt/yt/client/driver/internal_commands.cpp b/yt/yt/client/driver/internal_commands.cpp
index 889737f91a7..a69011714ee 100644
--- a/yt/yt/client/driver/internal_commands.cpp
+++ b/yt/yt/client/driver/internal_commands.cpp
@@ -75,7 +75,7 @@ void TWriteHunksCommand::DoExecute(ICommandContextPtr context)
std::vector<NApi::TSerializableHunkDescriptorPtr> serializableDescriptors;
serializableDescriptors.reserve(descriptors.size());
for (const auto& descriptor : descriptors) {
- serializableDescriptors.push_back(New<NApi::TSerializableHunkDescriptor>(descriptor));
+ serializableDescriptors.push_back(CreateSerializableHunkDescriptor(descriptor));
}
context->ProduceOutputValue(BuildYsonStringFluently()
diff --git a/yt/yt/client/driver/table_commands.cpp b/yt/yt/client/driver/table_commands.cpp
index 7dea19cd842..a74c854b740 100644
--- a/yt/yt/client/driver/table_commands.cpp
+++ b/yt/yt/client/driver/table_commands.cpp
@@ -784,10 +784,24 @@ void TSelectRowsCommand::Register(TRegistrar registrar)
registrar.Parameter("placeholder_values", &TThis::PlaceholderValues)
.Optional();
- registrar.ParameterWithUniversalAccessor<std::optional<bool>>(
- "use_web_assembly",
+ registrar.ParameterWithUniversalAccessor<bool>(
+ "use_canonical_null_relations",
+ [] (TThis* command) -> auto& {
+ return command->Options.UseCanonicalNullRelations;
+ })
+ .Optional(/*init*/ false);
+
+ registrar.ParameterWithUniversalAccessor<bool>(
+ "merge_versioned_rows",
+ [] (TThis* command) -> auto& {
+ return command->Options.MergeVersionedRows;
+ })
+ .Optional(/*init*/ false);
+
+ registrar.ParameterWithUniversalAccessor<std::optional<NApi::EExecutionBackend>>(
+ "execution_backend",
[] (TThis* command) -> auto& {
- return command->Options.UseWebAssembly;
+ return command->Options.ExecutionBackend;
})
.Optional(/*init*/ false);
}
diff --git a/yt/yt/client/object_client/helpers.cpp b/yt/yt/client/object_client/helpers.cpp
index 1413c755f3e..b3058b99b43 100644
--- a/yt/yt/client/object_client/helpers.cpp
+++ b/yt/yt/client/object_client/helpers.cpp
@@ -6,8 +6,6 @@ namespace NYT::NObjectClient {
////////////////////////////////////////////////////////////////////////////////
-const TStringBuf ObjectIdPathPrefix("#");
-
NYPath::TYPath FromObjectId(TObjectId id)
{
return TString(ObjectIdPathPrefix) + ToString(id);
@@ -78,7 +76,6 @@ bool IsVersionedType(EObjectType type)
type == EObjectType::TransactionMap ||
type == EObjectType::TopmostTransactionMap ||
type == EObjectType::ClusterNodeNode ||
- type == EObjectType::LegacyClusterNodeMap ||
type == EObjectType::ClusterNodeMap ||
type == EObjectType::DataNodeMap ||
type == EObjectType::ExecNodeMap ||
@@ -95,11 +92,13 @@ bool IsVersionedType(EObjectType type)
type == EObjectType::LockMap ||
type == EObjectType::TabletMap ||
type == EObjectType::TabletCellMap ||
+ type == EObjectType::VirtualTabletCellMap ||
type == EObjectType::TabletCellNode ||
type == EObjectType::TabletCellBundleMap ||
type == EObjectType::TabletActionMap ||
type == EObjectType::AreaMap ||
type == EObjectType::ChaosCellMap ||
+ type == EObjectType::VirtualChaosCellMap ||
type == EObjectType::ChaosCellBundleMap ||
type == EObjectType::SysNode ||
type == EObjectType::PortalEntrance ||
diff --git a/yt/yt/client/object_client/helpers.h b/yt/yt/client/object_client/helpers.h
index 2070dc9f421..a258269afe7 100644
--- a/yt/yt/client/object_client/helpers.h
+++ b/yt/yt/client/object_client/helpers.h
@@ -15,9 +15,6 @@ namespace NYT::NObjectClient {
////////////////////////////////////////////////////////////////////////////////
-//! |#|-prefix.
-extern const TStringBuf ObjectIdPathPrefix;
-
//! Function for temporary use: to gradually allow types supported in Sequoia.
bool IsScalarType(NObjectClient::EObjectType type);
diff --git a/yt/yt/client/object_client/public.cpp b/yt/yt/client/object_client/public.cpp
index 11eb2f1a6be..cf368cc1c92 100644
--- a/yt/yt/client/object_client/public.cpp
+++ b/yt/yt/client/object_client/public.cpp
@@ -8,6 +8,8 @@ namespace NYT::NObjectClient {
////////////////////////////////////////////////////////////////////////////////
+const TStringBuf ObjectIdPathPrefix("#");
+
TVersionedObjectId::TVersionedObjectId(TObjectId objectId)
: ObjectId(objectId)
{ }
diff --git a/yt/yt/client/object_client/public.h b/yt/yt/client/object_client/public.h
index 0d774fcc806..b305d32ed3c 100644
--- a/yt/yt/client/object_client/public.h
+++ b/yt/yt/client/object_client/public.h
@@ -47,6 +47,9 @@ using TObjectId = TGuid;
//! The all-zero id used to denote a non-existing object.
constexpr TObjectId NullObjectId = {};
+//! |#|-prefix.
+extern const TStringBuf ObjectIdPathPrefix;
+
//! Used to mark counters for well-known ids.
constexpr ui64 WellKnownCounterMask = 0x8000000000000000;
@@ -285,13 +288,13 @@ DEFINE_ENUM(EObjectType,
((AreaMap) (714))
((HunkStorage) (715))
((HunkTablet) (716))
+ ((VirtualTabletCellMap) (717))
// Node Tracker stuff
((Rack) (800))
((RackMap) (801))
((ClusterNode) (802))
((ClusterNodeNode) (803))
- ((LegacyClusterNodeMap) (804))
((ClusterNodeMap) (807))
((DataNodeMap) (808))
((ExecNodeMap) (809))
@@ -324,6 +327,7 @@ DEFINE_ENUM(EObjectType,
((ChaosTableReplica) (1205))
((ChaosReplicatedTable) (1206))
((ReplicationCardCollocation) (1207))
+ ((VirtualChaosCellMap) (1208))
// Maintenance tracker stuff
((ClusterProxyNode) (1500))
diff --git a/yt/yt/client/table_client/check_schema_compatibility.cpp b/yt/yt/client/table_client/check_schema_compatibility.cpp
index 1541aaa7770..6efdf606fc4 100644
--- a/yt/yt/client/table_client/check_schema_compatibility.cpp
+++ b/yt/yt/client/table_client/check_schema_compatibility.cpp
@@ -57,8 +57,8 @@ std::pair<ESchemaCompatibility, TError> CheckTableSchemaCompatibilityImpl(
ESchemaCompatibility::Incompatible,
TError("Column %Qv has stable name %Qv in input and %Qv in output schema",
inputColumn->Name(),
- inputColumn->StableName().Get(),
- outputColumn.StableName().Get())
+ inputColumn->StableName(),
+ outputColumn.StableName())
};
}
@@ -121,8 +121,8 @@ std::pair<ESchemaCompatibility, TError> CheckTableSchemaCompatibilityImpl(
if (!inputColumn && !deletedColumn) {
return {
ESchemaCompatibility::Incompatible,
- TError("Deleted column \"%v\" is missing in the input schema",
- deletedOutputColumn.StableName().Get())
+ TError("Deleted column %Qv is missing in the input schema",
+ deletedOutputColumn.StableName())
};
}
}
@@ -133,8 +133,8 @@ std::pair<ESchemaCompatibility, TError> CheckTableSchemaCompatibilityImpl(
if (!deletedOutputColumn) {
return {
ESchemaCompatibility::Incompatible,
- TError("Deleted column \"%v\" must be deleted in the output schema",
- deletedInputColumn.StableName().Get())
+ TError("Deleted column %Qv must be deleted in the output schema",
+ deletedInputColumn.StableName())
};
}
}
diff --git a/yt/yt/client/table_client/columnar_statistics.cpp b/yt/yt/client/table_client/columnar_statistics.cpp
index 8ac42f07a4d..c894a759154 100644
--- a/yt/yt/client/table_client/columnar_statistics.cpp
+++ b/yt/yt/client/table_client/columnar_statistics.cpp
@@ -296,13 +296,12 @@ void TColumnarStatistics::Update(TRange<TVersionedRow> rows)
}
}
-TColumnarStatistics TColumnarStatistics::SelectByColumnNames(const TNameTablePtr& nameTable, const std::vector<TStableName>& columnStableNames) const
+TColumnarStatistics TColumnarStatistics::SelectByColumnNames(const TNameTablePtr& nameTable, const std::vector<TColumnStableName>& columnStableNames) const
{
auto result = MakeEmpty(columnStableNames.size(), HasValueStatistics());
for (const auto& [columnIndex, columnName] : Enumerate(columnStableNames)) {
- if (auto id = nameTable->FindId(columnName.Get()); id && *id < GetColumnCount()) {
-
+ if (auto id = nameTable->FindId(columnName.Underlying()); id && *id < GetColumnCount()) {
result.ColumnDataWeights[columnIndex] = ColumnDataWeights[*id];
if (HasValueStatistics()) {
diff --git a/yt/yt/client/table_client/columnar_statistics.h b/yt/yt/client/table_client/columnar_statistics.h
index 621ac152e8b..a4e3514f76f 100644
--- a/yt/yt/client/table_client/columnar_statistics.h
+++ b/yt/yt/client/table_client/columnar_statistics.h
@@ -87,7 +87,9 @@ struct TColumnarStatistics
void Update(TRange<TUnversionedRow> rows);
void Update(TRange<TVersionedRow> rows);
- TColumnarStatistics SelectByColumnNames(const TNameTablePtr& nameTable, const std::vector<TStableName>& columnStableNames) const;
+ TColumnarStatistics SelectByColumnNames(
+ const TNameTablePtr& nameTable,
+ const std::vector<TColumnStableName>& columnStableNames) const;
};
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/client/table_client/config.cpp b/yt/yt/client/table_client/config.cpp
index f11756c5962..d8629254d5a 100644
--- a/yt/yt/client/table_client/config.cpp
+++ b/yt/yt/client/table_client/config.cpp
@@ -270,11 +270,15 @@ void TDictionaryCompressionConfig::Register(TRegistrar registrar)
registrar.Parameter("column_dictionary_size", &TThis::ColumnDictionarySize)
.GreaterThanOrEqual(NCompression::GetDictionaryCompressionCodec()->GetMinDictionarySize())
.Default(32_KB);
+ registrar.Parameter("compression_level", &TThis::CompressionLevel)
+ .InRange(1, NCompression::GetDictionaryCompressionCodec()->GetMaxCompressionLevel())
+ .Default(NCompression::GetDictionaryCompressionCodec()->GetDefaultCompressionLevel());
registrar.Parameter("applied_policies", &TThis::AppliedPolicies)
.Default({
EDictionaryCompressionPolicy::LargeChunkFirst,
EDictionaryCompressionPolicy::FreshChunkFirst,
- });
+ })
+ .ResetOnLoad();
registrar.Parameter("policy_probation_samples_size", &TThis::PolicyProbationSamplesSize)
.GreaterThan(0)
diff --git a/yt/yt/client/table_client/config.h b/yt/yt/client/table_client/config.h
index cca367f23b5..332285c7b51 100644
--- a/yt/yt/client/table_client/config.h
+++ b/yt/yt/client/table_client/config.h
@@ -244,6 +244,10 @@ public:
//! Recommended to be ~100 times less than weight of samples for that column.
i64 ColumnDictionarySize;
+ //! Level of compression algorithm.
+ //! Applied to digested compression dictionary upon its construction.
+ int CompressionLevel;
+
//! Subset of all dictionary building policies.
//! Will build and apply dictionaries only from this subset.
//! Upon each chunk compression will independently decide which dictionary fits best.
diff --git a/yt/yt/client/table_client/name_table.cpp b/yt/yt/client/table_client/name_table.cpp
index d8918deb85d..2c22700fc71 100644
--- a/yt/yt/client/table_client/name_table.cpp
+++ b/yt/yt/client/table_client/name_table.cpp
@@ -26,7 +26,7 @@ TNameTablePtr TNameTable::FromSchemaStable(const TTableSchema& schema)
auto nameTable = New<TNameTable>();
nameTable->NameToId_.reserve(schema.Columns().size());
for (const auto& column : schema.Columns()) {
- nameTable->DoRegisterNameOrThrow(column.StableName().Get());
+ nameTable->DoRegisterNameOrThrow(column.StableName().Underlying());
}
return nameTable;
}
diff --git a/yt/yt/client/table_client/public.h b/yt/yt/client/table_client/public.h
index 592cbcacd36..195ce2e684e 100644
--- a/yt/yt/client/table_client/public.h
+++ b/yt/yt/client/table_client/public.h
@@ -9,11 +9,10 @@
#include <yt/yt/core/misc/range.h>
#include <library/cpp/yt/misc/enum.h>
+#include <library/cpp/yt/misc/strong_typedef.h>
#include <util/generic/size_literals.h>
-#include <initializer_list>
-
namespace NYT::NTableClient {
////////////////////////////////////////////////////////////////////////////////
@@ -299,7 +298,7 @@ class TKeyComparer;
struct TColumnRenameDescriptor;
using TColumnRenameDescriptors = std::vector<TColumnRenameDescriptor>;
-class TStableName;
+YT_DEFINE_STRONG_TYPEDEF(TColumnStableName, TString);
class TColumnSchema;
diff --git a/yt/yt/client/table_client/schema.cpp b/yt/yt/client/table_client/schema.cpp
index 7e64844acf2..3401696fea1 100644
--- a/yt/yt/client/table_client/schema.cpp
+++ b/yt/yt/client/table_client/schema.cpp
@@ -114,42 +114,6 @@ TLockMask MaxMask(TLockMask lhs, TLockMask rhs)
////////////////////////////////////////////////////////////////////////////////
-TStableName::TStableName(TString stableName)
- : Name_(std::move(stableName))
-{ }
-
-const TString& TStableName::Get() const
-{
- return Name_;
-}
-
-void FormatValue(TStringBuilderBase* builder, const TStableName& stableName, TStringBuf /*spec*/)
-{
- builder->AppendFormat("%v", stableName.Get());
-}
-
-bool operator == (const TStableName& lhs, const TStableName& rhs)
-{
- return lhs.Get() == rhs.Get();
-}
-
-bool operator < (const TStableName& lhs, const TStableName& rhs)
-{
- return lhs.Get() < rhs.Get();
-}
-
-void ToProto(TString* protoStableName, const TStableName& stableName)
-{
- *protoStableName = stableName.Get();
-}
-
-void FromProto(TStableName* stableName, const TString& protoStableName)
-{
- *stableName = TStableName(protoStableName);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
TColumnSchema::TColumnSchema()
: TColumnSchema(
TString(),
@@ -188,7 +152,7 @@ TColumnSchema::TColumnSchema(
SetLogicalType(std::move(type));
}
-TColumnSchema& TColumnSchema::SetStableName(TStableName value)
+TColumnSchema& TColumnSchema::SetStableName(TColumnStableName value)
{
StableName_ = std::move(value);
return *this;
@@ -269,7 +233,7 @@ i64 TColumnSchema::GetMemoryUsage() const
{
return
sizeof(TColumnSchema) +
- StableName_.Get().size() +
+ StableName_.Underlying().size() +
Name_.size() +
(LogicalType_ ? LogicalType_->GetMemoryUsage() : 0) +
(Lock_ ? Lock_->size() : 0) +
@@ -295,13 +259,13 @@ ESimpleLogicalValueType TColumnSchema::CastToV1Type() const
bool TColumnSchema::IsRenamed() const
{
- return Name() != StableName().Get();
+ return Name() != StableName().Underlying();
}
TString TColumnSchema::GetDiagnosticNameString() const
{
if (IsRenamed()) {
- return Format("%Qv (stable name %Qv)", Name(), StableName().Get());
+ return Format("%Qv (stable name %Qv)", Name(), StableName().Underlying());
} else {
return Format("%Qv", Name());
}
@@ -313,12 +277,12 @@ TDeletedColumn::TDeletedColumn()
{
}
-TDeletedColumn::TDeletedColumn(TStableName stableName)
+TDeletedColumn::TDeletedColumn(TColumnStableName stableName)
: StableName_(stableName)
{
}
-TDeletedColumn& TDeletedColumn::SetStableName(TStableName value)
+TDeletedColumn& TDeletedColumn::SetStableName(TColumnStableName value)
{
StableName_ = std::move(value);
return *this;
@@ -385,7 +349,7 @@ void ToProto(NProto::TColumnSchema* protoSchema, const TColumnSchema& schema)
{
protoSchema->set_name(schema.Name());
if (schema.IsRenamed()) {
- protoSchema->set_stable_name(schema.StableName().Get());
+ protoSchema->set_stable_name(schema.StableName().Underlying());
}
protoSchema->set_type(static_cast<int>(GetPhysicalType(schema.CastToV1Type())));
@@ -435,15 +399,15 @@ void ToProto(NProto::TColumnSchema* protoSchema, const TColumnSchema& schema)
void ToProto(NProto::TDeletedColumn* protoSchema, const TDeletedColumn& schema)
{
- protoSchema->set_stable_name(schema.StableName().Get());
+ protoSchema->set_stable_name(schema.StableName().Underlying());
}
void FromProto(TColumnSchema* schema, const NProto::TColumnSchema& protoSchema)
{
schema->SetName(protoSchema.name());
schema->SetStableName(protoSchema.has_stable_name()
- ? TStableName(protoSchema.stable_name())
- : TStableName(protoSchema.name()));
+ ? TColumnStableName(protoSchema.stable_name())
+ : TColumnStableName(protoSchema.name()));
if (protoSchema.has_logical_type()) {
TLogicalTypePtr logicalType;
@@ -469,7 +433,7 @@ void FromProto(TColumnSchema* schema, const NProto::TColumnSchema& protoSchema)
void FromProto(TDeletedColumn* schema, const NProto::TDeletedColumn& protoSchema)
{
- schema->SetStableName(TStableName{protoSchema.stable_name()});
+ schema->SetStableName(TColumnStableName{protoSchema.stable_name()});
}
void PrintTo(const TColumnSchema& columnSchema, std::ostream* os)
@@ -483,31 +447,31 @@ TTableSchema::TNameMapping::TNameMapping(const TTableSchema& schema)
: Schema_(schema)
{ }
-bool TTableSchema::TNameMapping::IsDeleted(const TStableName& stableName) const
+bool TTableSchema::TNameMapping::IsDeleted(const TColumnStableName& stableName) const
{
return Schema_.FindDeletedColumn(stableName) != nullptr;
}
-TString TTableSchema::TNameMapping::StableNameToName(const TStableName& stableName) const
+TString TTableSchema::TNameMapping::StableNameToName(const TColumnStableName& stableName) const
{
auto* column = Schema_.FindColumnByStableName(stableName);
if (!column) {
if (Schema_.GetStrict()) {
THROW_ERROR_EXCEPTION("No column with stable name %Qv in strict schema", stableName);
}
- return stableName.Get();
+ return stableName.Underlying();
}
return column->Name();
}
-TStableName TTableSchema::TNameMapping::NameToStableName(TStringBuf name) const
+TColumnStableName TTableSchema::TNameMapping::NameToStableName(TStringBuf name) const
{
auto* column = Schema_.FindColumn(name);
if (!column) {
if (Schema_.GetStrict()) {
THROW_ERROR_EXCEPTION("No column with name %Qv in strict schema", name);
}
- return TStableName(TString(name));
+ return TColumnStableName(TString(name));
}
return column->StableName();
}
@@ -516,8 +480,8 @@ TStableName TTableSchema::TNameMapping::NameToStableName(TStringBuf name) const
const std::vector<TColumnSchema>& TTableSchema::Columns() const
{
- if (Columns_) [[likely]] {
- return *Columns_;
+ if (ColumnInfo_) [[likely]] {
+ return ColumnInfo_->Columns;
} else {
static const std::vector<TColumnSchema> empty;
return empty;
@@ -526,7 +490,12 @@ const std::vector<TColumnSchema>& TTableSchema::Columns() const
const std::vector<TDeletedColumn>& TTableSchema::DeletedColumns() const
{
- return DeletedColumns_;
+ if (ColumnInfo_) [[likely]] {
+ return ColumnInfo_->DeletedColumns;
+ } else {
+ static std::vector<TDeletedColumn> empty;
+ return empty;
+ }
}
TTableSchema::TTableSchema(
@@ -538,11 +507,11 @@ TTableSchema::TTableSchema(
: Strict_(strict)
, UniqueKeys_(uniqueKeys)
, SchemaModification_(schemaModification)
- , Columns_(std::make_shared<const std::vector<TColumnSchema>>(std::move(columns)))
- , DeletedColumns_(std::move(deletedColumns))
+ , ColumnInfo_(std::make_shared<const TColumnInfo>(std::move(columns), std::move(deletedColumns)))
{
+ const auto& info = *ColumnInfo_;
for (int index = 0; index < std::ssize(Columns()); ++index) {
- const auto& column = Columns()[index];
+ const auto& column = info.Columns[index];
if (column.SortOrder()) {
++KeyColumnCount_;
}
@@ -558,26 +527,26 @@ TTableSchema::TTableSchema(
// NB(levysotsky): We ignore duplicates in both maps, they will be
// accounted for in consequent validation.
NameToColumnIndex_.emplace(column.Name(), index);
- StableNameToColumnIndex_.emplace(column.StableName().Get(), index);
+ StableNameToColumnIndex_.emplace(column.StableName().Underlying(), index);
}
for (int index = 0; index < std::ssize(DeletedColumns()); ++index) {
- const auto& deletedColumn = DeletedColumns()[index];
- StableNameToDeletedColumnIndex_.emplace(deletedColumn.StableName().Get(), index);
+ const auto& deletedColumn = info.DeletedColumns[index];
+ StableNameToDeletedColumnIndex_.emplace(deletedColumn.StableName().Underlying(), index);
}
}
-const TColumnSchema* TTableSchema::FindColumnByStableName(const TStableName& stableName) const
+const TColumnSchema* TTableSchema::FindColumnByStableName(const TColumnStableName& stableName) const
{
- auto it = StableNameToColumnIndex_.find(stableName.Get());
+ auto it = StableNameToColumnIndex_.find(stableName.Underlying());
if (it == StableNameToColumnIndex_.end()) {
return nullptr;
}
return &Columns()[it->second];
}
-const TDeletedColumn* TTableSchema::FindDeletedColumn(const TStableName& stableName) const
+const TDeletedColumn* TTableSchema::FindDeletedColumn(const TColumnStableName& stableName) const
{
- auto it = StableNameToDeletedColumnIndex_.find(stableName.Get());
+ auto it = StableNameToDeletedColumnIndex_.find(stableName.Underlying());
if (it == StableNameToDeletedColumnIndex_.end()) {
return nullptr;
}
@@ -637,7 +606,6 @@ TTableSchemaPtr TTableSchema::Filter(const TColumnFilter& columnFilter, bool dis
{
int newKeyColumnCount = 0;
std::vector<TColumnSchema> columns;
-
if (columnFilter.IsUniversal()) {
if (!discardSortOrder) {
return New<TTableSchema>(*this);
@@ -649,18 +617,19 @@ TTableSchemaPtr TTableSchema::Filter(const TColumnFilter& columnFilter, bool dis
}
} else {
bool inKeyColumns = !discardSortOrder;
+ const auto& schemaColumns = Columns();
for (int id : columnFilter.GetIndexes()) {
- if (id < 0 || id >= std::ssize(Columns())) {
+ if (id < 0 || id >= std::ssize(schemaColumns)) {
THROW_ERROR_EXCEPTION("Invalid column during schema filtering: expected in range [0, %v), got %v",
- Columns().size(),
+ schemaColumns.size(),
id);
}
- if (id != std::ssize(columns) || !Columns()[id].SortOrder()) {
+ if (id != std::ssize(columns) || !schemaColumns[id].SortOrder()) {
inKeyColumns = false;
}
- columns.push_back(Columns()[id]);
+ columns.push_back(schemaColumns[id]);
if (!inKeyColumns) {
columns.back().SetSortOrder(std::nullopt);
@@ -677,7 +646,7 @@ TTableSchemaPtr TTableSchema::Filter(const TColumnFilter& columnFilter, bool dis
Strict_,
UniqueKeys_ && (newKeyColumnCount == GetKeyColumnCount()),
ETableSchemaModification::None,
- DeletedColumns_);
+ DeletedColumns());
}
TTableSchemaPtr TTableSchema::Filter(const THashSet<TString>& columnNames, bool discardSortOrder) const
@@ -753,9 +722,9 @@ TKeyColumns TTableSchema::GetKeyColumnNames() const
return keyColumns;
}
-std::vector<TStableName> TTableSchema::GetKeyColumnStableNames() const
+std::vector<TColumnStableName> TTableSchema::GetKeyColumnStableNames() const
{
- std::vector<TStableName> keyColumns;
+ std::vector<TColumnStableName> keyColumns;
for (const auto& column : Columns()) {
if (column.SortOrder()) {
keyColumns.push_back(column.StableName());
@@ -776,19 +745,27 @@ int TTableSchema::GetColumnCount() const
std::vector<TString> TTableSchema::GetColumnNames() const
{
+ if (!ColumnInfo_) {
+ return std::vector<TString>();
+ }
std::vector<TString> result;
- result.reserve(Columns().size());
- for (const auto& column : Columns()) {
+ const auto& info = *ColumnInfo_;
+ result.reserve(info.Columns.size());
+ for (const auto& column : info.Columns) {
result.push_back(column.Name());
}
return result;
}
-std::vector<TStableName> TTableSchema::GetColumnStableNames() const
+std::vector<TColumnStableName> TTableSchema::GetColumnStableNames() const
{
- std::vector<TStableName> result;
- result.reserve(Columns().size());
- for (const auto& column : Columns()) {
+ if (!ColumnInfo_) {
+ return std::vector<TColumnStableName>();
+ }
+ std::vector<TColumnStableName> result;
+ const auto& info = *ColumnInfo_;
+ result.reserve(info.Columns.size());
+ for (const auto& column : info.Columns) {
result.push_back(column.StableName());
}
return result;
@@ -799,21 +776,21 @@ const THunkColumnIds& TTableSchema::GetHunkColumnIds() const
return HunkColumnsIds_;
}
-std::vector<TStableName> MapNamesToStableNames(
+std::vector<TColumnStableName> MapNamesToStableNames(
const TTableSchema& schema,
std::vector<TString> names,
const std::optional<TStringBuf>& missingColumnReplacement)
{
- std::vector<TStableName> stableNames;
+ std::vector<TColumnStableName> stableNames;
stableNames.reserve(names.size());
for (const auto& name : names) {
const auto* column = schema.FindColumn(name);
if (column) {
stableNames.push_back(column->StableName());
} else if (!schema.GetStrict()) {
- stableNames.push_back(TStableName(name));
+ stableNames.push_back(TColumnStableName(name));
} else if (missingColumnReplacement) {
- stableNames.push_back(TStableName(TString(*missingColumnReplacement)));
+ stableNames.push_back(TColumnStableName(TString(*missingColumnReplacement)));
} else {
THROW_ERROR_EXCEPTION("Column %Qv is missing in strict schema",
name);
@@ -882,7 +859,9 @@ TTableSchemaPtr TTableSchema::FromKeyColumns(const TKeyColumns& keyColumns)
TColumnSchema(columnName, ESimpleLogicalValueType::Any)
.SetSortOrder(ESortOrder::Ascending));
}
- schema.Columns_ = std::make_shared<const std::vector<TColumnSchema>>(std::move(columns));
+ schema.ColumnInfo_ = std::make_shared<const TColumnInfo>(
+ std::move(columns),
+ std::vector<TDeletedColumn>{});
schema.KeyColumnCount_ = keyColumns.size();
ValidateTableSchema(schema);
return New<TTableSchema>(std::move(schema));
@@ -897,7 +876,9 @@ TTableSchemaPtr TTableSchema::FromSortColumns(const TSortColumns& sortColumns)
TColumnSchema(sortColumn.Name, ESimpleLogicalValueType::Any)
.SetSortOrder(sortColumn.SortOrder));
}
- schema.Columns_ = std::make_shared<const std::vector<TColumnSchema>>(std::move(columns));
+ schema.ColumnInfo_ = std::make_shared<const TColumnInfo>(
+ std::move(columns),
+ std::vector<TDeletedColumn>{});
schema.KeyColumnCount_ = sortColumns.size();
ValidateTableSchema(schema);
return New<TTableSchema>(std::move(schema));
@@ -905,6 +886,15 @@ TTableSchemaPtr TTableSchema::FromSortColumns(const TSortColumns& sortColumns)
TTableSchemaPtr TTableSchema::ToQuery() const
{
+ if (!ColumnInfo_) {
+ return New<TTableSchema>(
+ std::vector<TColumnSchema>(),
+ true, /*strict*/
+ false, /*uniqueKeys*/
+ ETableSchemaModification::None,
+ std::vector<TDeletedColumn>());
+ }
+ const auto& info = *ColumnInfo_;
if (IsSorted()) {
return New<TTableSchema>(*this);
} else {
@@ -914,9 +904,9 @@ TTableSchemaPtr TTableSchema::ToQuery() const
TColumnSchema(RowIndexColumnName, ESimpleLogicalValueType::Int64)
.SetSortOrder(ESortOrder::Ascending)
};
- columns.insert(columns.end(), Columns().begin(), Columns().end());
+ columns.insert(columns.end(), info.Columns.begin(), info.Columns.end());
return New<TTableSchema>(std::move(columns), true, false,
- ETableSchemaModification::None, DeletedColumns_);
+ ETableSchemaModification::None, DeletedColumns());
}
}
@@ -933,15 +923,15 @@ TTableSchemaPtr TTableSchema::ToWrite() const
columns.push_back(TColumnSchema(TabletIndexColumnName, ESimpleLogicalValueType::Int64)
.SetSortOrder(ESortOrder::Ascending));
for (const auto& column : Columns()) {
- if (column.StableName().Get() != TimestampColumnName &&
- column.StableName().Get() != CumulativeDataWeightColumnName)
+ if (column.StableName().Underlying() != TimestampColumnName &&
+ column.StableName().Underlying() != CumulativeDataWeightColumnName)
{
columns.push_back(column);
}
}
}
return New<TTableSchema>(std::move(columns), Strict_, UniqueKeys_,
- ETableSchemaModification::None, DeletedColumns_);
+ ETableSchemaModification::None, DeletedColumns());
}
TTableSchemaPtr TTableSchema::WithTabletIndex() const
@@ -953,7 +943,7 @@ TTableSchemaPtr TTableSchema::WithTabletIndex() const
// XXX: Is it ok? $tablet_index is usually a key column.
columns.push_back(TColumnSchema(TabletIndexColumnName, ESimpleLogicalValueType::Int64));
return New<TTableSchema>(std::move(columns), Strict_, UniqueKeys_,
- ETableSchemaModification::None, DeletedColumns_);
+ ETableSchemaModification::None, DeletedColumns());
}
}
@@ -966,7 +956,7 @@ TTableSchemaPtr TTableSchema::ToVersionedWrite() const
columns.insert(columns.begin(), TColumnSchema(TabletIndexColumnName, ESimpleLogicalValueType::Int64)
.SetSortOrder(ESortOrder::Ascending));
return New<TTableSchema>(std::move(columns), Strict_, UniqueKeys_,
- ETableSchemaModification::None, DeletedColumns_);
+ ETableSchemaModification::None, DeletedColumns());
}
}
@@ -978,7 +968,12 @@ TTableSchemaPtr TTableSchema::ToLookup() const
columns.push_back(column);
}
}
- return New<TTableSchema>(std::move(columns), Strict_, UniqueKeys_, ETableSchemaModification::None, DeletedColumns_);
+ return New<TTableSchema>(
+ std::move(columns),
+ Strict_,
+ UniqueKeys_,
+ ETableSchemaModification::None,
+ DeletedColumns());
}
TTableSchemaPtr TTableSchema::ToDelete() const
@@ -988,42 +983,87 @@ TTableSchemaPtr TTableSchema::ToDelete() const
TTableSchemaPtr TTableSchema::ToKeys() const
{
- std::vector<TColumnSchema> columns(Columns().begin(), Columns().begin() + KeyColumnCount_);
+ if (!ColumnInfo_) {
+ return New<TTableSchema>(
+ std::vector<TColumnSchema>(),
+ Strict_,
+ UniqueKeys_,
+ ETableSchemaModification::None,
+ std::vector<TDeletedColumn>());
+ }
+ const auto& info = *ColumnInfo_;
+ std::vector<TColumnSchema> columns(info.Columns.begin(), info.Columns.begin() + KeyColumnCount_);
return New<TTableSchema>(std::move(columns), Strict_, UniqueKeys_,
- ETableSchemaModification::None, DeletedColumns_);
+ ETableSchemaModification::None, info.DeletedColumns);
}
TTableSchemaPtr TTableSchema::ToUniqueKeys() const
{
- return New<TTableSchema>(Columns(), Strict_, /*uniqueKeys*/ true,
- ETableSchemaModification::None, DeletedColumns_);
+ if (!ColumnInfo_) {
+ return New<TTableSchema>(
+ std::vector<TColumnSchema>(),
+ Strict_,
+ true, /*uniqueKeys*/
+ ETableSchemaModification::None,
+ std::vector<TDeletedColumn>());
+ }
+ const auto& info = *ColumnInfo_;
+ return New<TTableSchema>(info.Columns, Strict_, /*uniqueKeys*/ true,
+ ETableSchemaModification::None, info.DeletedColumns);
}
TTableSchemaPtr TTableSchema::ToStrippedColumnAttributes() const
{
+ if (!ColumnInfo_) {
+ return New<TTableSchema>(
+ std::vector<TColumnSchema>(),
+ Strict_,
+ false, /*uniqueKeys*/
+ ETableSchemaModification::None,
+ std::vector<TDeletedColumn>());
+ }
+ const auto& info = *ColumnInfo_;
std::vector<TColumnSchema> strippedColumns;
- for (const auto& column : Columns()) {
+ for (const auto& column : info.Columns) {
auto& strippedColumn = strippedColumns.emplace_back(column.Name(), column.LogicalType());
strippedColumn.SetStableName(column.StableName());
}
return New<TTableSchema>(std::move(strippedColumns), Strict_, /*uniqueKeys*/ false,
- ETableSchemaModification::None, DeletedColumns_);
+ ETableSchemaModification::None, info.DeletedColumns);
}
TTableSchemaPtr TTableSchema::ToSortedStrippedColumnAttributes() const
{
+ if (!ColumnInfo_) {
+ return New<TTableSchema>(
+ std::vector<TColumnSchema>(),
+ Strict_,
+ UniqueKeys_, /*uniqueKeys*/
+ ETableSchemaModification::None,
+ std::vector<TDeletedColumn>());
+ }
+ const auto& info = *ColumnInfo_;
std::vector<TColumnSchema> strippedColumns;
- for (const auto& column : Columns()) {
+ for (const auto& column : info.Columns) {
auto& strippedColumn = strippedColumns.emplace_back(column.Name(), column.LogicalType(), column.SortOrder());
strippedColumn.SetStableName(column.StableName());
}
return New<TTableSchema>(std::move(strippedColumns), Strict_, UniqueKeys_,
- ETableSchemaModification::None, DeletedColumns_);
+ ETableSchemaModification::None, info.DeletedColumns);
}
TTableSchemaPtr TTableSchema::ToCanonical() const
{
- auto columns = Columns();
+ if (!ColumnInfo_) {
+ return New<TTableSchema>(
+ std::vector<TColumnSchema>(),
+ Strict_,
+ UniqueKeys_, /*uniqueKeys*/
+ ETableSchemaModification::None,
+ std::vector<TDeletedColumn>());
+ }
+ const auto& info = *ColumnInfo_;
+ auto columns = info.Columns;
std::sort(
columns.begin() + KeyColumnCount_,
columns.end(),
@@ -1031,7 +1071,7 @@ TTableSchemaPtr TTableSchema::ToCanonical() const
return lhs.Name() < rhs.Name();
});
return New<TTableSchema>(columns, Strict_, UniqueKeys_,
- ETableSchemaModification::None, DeletedColumns_);
+ ETableSchemaModification::None, info.DeletedColumns);
}
TTableSchemaPtr TTableSchema::ToSorted(const TKeyColumns& keyColumns) const
@@ -1089,17 +1129,22 @@ TTableSchemaPtr TTableSchema::ToSorted(const TSortColumns& sortColumns) const
it->SetSortOrder(std::nullopt);
}
- return New<TTableSchema>(std::move(columns), Strict_, uniqueKeys, GetSchemaModification(),
- DeletedColumns_);
+ return New<TTableSchema>(
+ std::move(columns),
+ Strict_,
+ uniqueKeys,
+ GetSchemaModification(),
+ DeletedColumns());
}
TTableSchemaPtr TTableSchema::ToReplicationLog() const
{
+ const auto& schemaColumns = Columns();
std::vector<TColumnSchema> columns;
columns.push_back(TColumnSchema(TimestampColumnName, ESimpleLogicalValueType::Uint64));
if (IsSorted()) {
columns.push_back(TColumnSchema(TReplicationLogTable::ChangeTypeColumnName, ESimpleLogicalValueType::Int64));
- for (const auto& column : Columns()) {
+ for (const auto& column : schemaColumns) {
if (column.SortOrder()) {
columns.push_back(
TColumnSchema(
@@ -1115,7 +1160,7 @@ TTableSchemaPtr TTableSchema::ToReplicationLog() const
}
}
} else {
- for (const auto& column : Columns()) {
+ for (const auto& column : schemaColumns) {
columns.push_back(
TColumnSchema(
TReplicationLogTable::ValueColumnNamePrefix + column.Name(),
@@ -1129,12 +1174,13 @@ TTableSchemaPtr TTableSchema::ToReplicationLog() const
/* strict */ true,
/* uniqueKeys */ false,
ETableSchemaModification::None,
- DeletedColumns_);
+ DeletedColumns());
}
TTableSchemaPtr TTableSchema::ToUnversionedUpdate(bool sorted) const
{
YT_VERIFY(IsSorted());
+ const auto& info = *ColumnInfo_;
std::vector<TColumnSchema> columns;
columns.reserve(GetKeyColumnCount() + 1 + GetValueColumnCount() * 2);
@@ -1155,7 +1201,7 @@ TTableSchemaPtr TTableSchema::ToUnversionedUpdate(bool sorted) const
// Values.
for (int columnIndex = GetKeyColumnCount(); columnIndex < GetColumnCount(); ++columnIndex) {
- const auto& column = Columns()[columnIndex];
+ const auto& column = info.Columns[columnIndex];
YT_VERIFY(!column.SortOrder());
columns.emplace_back(
TUnversionedUpdateSchema::ValueColumnNamePrefix + column.Name(),
@@ -1170,7 +1216,7 @@ TTableSchemaPtr TTableSchema::ToUnversionedUpdate(bool sorted) const
/*strict*/ true,
/*uniqueKeys*/ sorted,
ETableSchemaModification::None,
- DeletedColumns_);
+ info.DeletedColumns);
}
TTableSchemaPtr TTableSchema::ToModifiedSchema(ETableSchemaModification schemaModification) const
@@ -1201,10 +1247,14 @@ TTableSchemaPtr TTableSchema::ToModifiedSchema(ETableSchemaModification schemaMo
TComparator TTableSchema::ToComparator() const
{
+ if (!ColumnInfo_) {
+ return TComparator(std::vector<ESortOrder>());
+ }
+ const auto& info = *ColumnInfo_;
std::vector<ESortOrder> sortOrders(KeyColumnCount_);
for (int index = 0; index < KeyColumnCount_; ++index) {
- YT_VERIFY(Columns()[index].SortOrder());
- sortOrders[index] = *Columns()[index].SortOrder();
+ YT_VERIFY(info.Columns[index].SortOrder());
+ sortOrders[index] = *info.Columns[index].SortOrder();
}
return TComparator(std::move(sortOrders));
}
@@ -1469,7 +1519,7 @@ void ValidateSystemColumnSchema(
if (columnSchema.IsRenamed()) {
THROW_ERROR_EXCEPTION("System column schema must have equal name and stable name")
<< TErrorAttribute("name", name)
- << TErrorAttribute("stable_name", columnSchema.StableName().Get());
+ << TErrorAttribute("stable_name", columnSchema.StableName().Underlying());
}
const auto& allowedSystemColumns = isTableSorted
@@ -1502,6 +1552,20 @@ void ValidateSystemColumnSchema(
name);
}
+void ValidateColumnName(const TString& name)
+{
+ if (name.empty()) {
+ THROW_ERROR_EXCEPTION("Column name cannot be empty");
+ }
+
+ if (name.size() > MaxColumnNameLength) {
+ THROW_ERROR_EXCEPTION("Column name %Qv is longer than maximum allowed: %v > %v",
+ name,
+ name.size(),
+ MaxColumnNameLength);
+ }
+}
+
void ValidateColumnSchema(
const TColumnSchema& columnSchema,
bool isTableSorted,
@@ -1518,31 +1582,15 @@ void ValidateColumnSchema(
"_yt_last_seen_replica_set",
};
- const auto& stableName = columnSchema.StableName();
- if (stableName.Get().empty()) {
- THROW_ERROR_EXCEPTION("Column stable name cannot be empty");
- }
-
- const auto& name = columnSchema.Name();
- if (name.empty()) {
- THROW_ERROR_EXCEPTION("Column name cannot be empty");
- }
-
try {
- if (stableName.Get().StartsWith(SystemColumnNamePrefix) || name.StartsWith(SystemColumnNamePrefix)) {
- ValidateSystemColumnSchema(columnSchema, isTableSorted, allowUnversionedUpdateColumns);
- }
+ const auto& stableName = columnSchema.StableName();
+ ValidateColumnName(stableName.Underlying());
- if (stableName.Get().size() > MaxColumnNameLength) {
- THROW_ERROR_EXCEPTION("Column stable name is longer than maximum allowed: %v > %v",
- stableName.Get().size(),
- MaxColumnNameLength);
- }
+ const auto& name = columnSchema.Name();
+ ValidateColumnName(name);
- if (name.size() > MaxColumnNameLength) {
- THROW_ERROR_EXCEPTION("Column name is longer than maximum allowed: %v > %v",
- name.size(),
- MaxColumnNameLength);
+ if (stableName.Underlying().StartsWith(SystemColumnNamePrefix) || name.StartsWith(SystemColumnNamePrefix)) {
+ ValidateSystemColumnSchema(columnSchema, isTableSorted, allowUnversionedUpdateColumns);
}
{
@@ -1673,7 +1721,7 @@ void ValidateColumnUniqueness(const TTableSchema& schema)
THashSet<TStringBuf> columnNames;
THashSet<TStringBuf> columnStableNames;
for (const auto& column : schema.Columns()) {
- if (!columnStableNames.insert(column.StableName().Get()).second) {
+ if (!columnStableNames.insert(column.StableName().Underlying()).second) {
THROW_ERROR_EXCEPTION("Duplicate column stable name %Qv in table schema",
column.StableName());
}
@@ -1683,7 +1731,7 @@ void ValidateColumnUniqueness(const TTableSchema& schema)
}
}
for (const auto& deletedColumn : schema.DeletedColumns()) {
- if (!columnStableNames.insert(deletedColumn.StableName().Get()).second) {
+ if (!columnStableNames.insert(deletedColumn.StableName().Underlying()).second) {
THROW_ERROR_EXCEPTION("Duplicate column stable name %Qv in table schema",
deletedColumn.StableName());
}
@@ -2001,9 +2049,9 @@ TCellTaggedTableSchemaPtr::TCellTaggedTableSchemaPtr(TTableSchemaPtr tableSchema
} // namespace NYT::NTableClient
-size_t THash<NYT::NTableClient::TStableName>::operator()(const NYT::NTableClient::TStableName& stableName) const
+size_t THash<NYT::NTableClient::TColumnStableName>::operator()(const NYT::NTableClient::TColumnStableName& stableName) const
{
- return THash<TString>()(stableName.Get());
+ return THash<TString>()(stableName.Underlying());
}
size_t THash<NYT::NTableClient::TColumnSchema>::operator()(const NYT::NTableClient::TColumnSchema& columnSchema) const
@@ -2022,7 +2070,7 @@ size_t THash<NYT::NTableClient::TColumnSchema>::operator()(const NYT::NTableClie
size_t THash<NYT::NTableClient::TDeletedColumn>::operator()(const NYT::NTableClient::TDeletedColumn& columnSchema) const
{
- return THash<NYT::NTableClient::TStableName>()(columnSchema.StableName());
+ return THash<NYT::NTableClient::TColumnStableName>()(columnSchema.StableName());
}
size_t THash<NYT::NTableClient::TTableSchema>::operator()(const NYT::NTableClient::TTableSchema& tableSchema) const
diff --git a/yt/yt/client/table_client/schema.h b/yt/yt/client/table_client/schema.h
index 0bf4b345d55..bc53ad71c5a 100644
--- a/yt/yt/client/table_client/schema.h
+++ b/yt/yt/client/table_client/schema.h
@@ -109,33 +109,11 @@ TLockMask MaxMask(TLockMask lhs, TLockMask rhs);
////////////////////////////////////////////////////////////////////////////////
-//
-// Strong typedef to avoid mixing stable names and names.
-class TStableName
-{
-public:
- explicit TStableName(TString stableName = "");
- const TString& Get() const;
-
-private:
- TString Name_;
-};
-
-void FormatValue(TStringBuilderBase* builder, const TStableName& stableName, TStringBuf spec);
-
-bool operator == (const TStableName& lhs, const TStableName& rhs);
-bool operator < (const TStableName& lhs, const TStableName& rhs);
-
-void ToProto(TString* protoStableName, const TStableName& stableName);
-void FromProto(TStableName* stableName, const TString& protoStableName);
-
-////////////////////////////////////////////////////////////////////////////////
-
class TColumnSchema
{
public:
// Keep in sync with hasher below.
- DEFINE_BYREF_RO_PROPERTY(TStableName, StableName);
+ DEFINE_BYREF_RO_PROPERTY(TColumnStableName, StableName);
DEFINE_BYREF_RO_PROPERTY(TString, Name);
DEFINE_BYREF_RO_PROPERTY(TLogicalTypePtr, LogicalType);
DEFINE_BYREF_RO_PROPERTY(std::optional<ESortOrder>, SortOrder);
@@ -168,7 +146,7 @@ public:
TColumnSchema& operator=(const TColumnSchema&) = default;
TColumnSchema& operator=(TColumnSchema&&) = default;
- TColumnSchema& SetStableName(TStableName stableName);
+ TColumnSchema& SetStableName(TColumnStableName stableName);
TColumnSchema& SetName(TString name);
TColumnSchema& SetLogicalType(TLogicalTypePtr valueType);
TColumnSchema& SetSimpleLogicalType(ESimpleLogicalValueType type);
@@ -207,10 +185,10 @@ class TDeletedColumn
{
public:
TDeletedColumn();
- explicit TDeletedColumn(TStableName stableName);
+ explicit TDeletedColumn(TColumnStableName stableName);
- DEFINE_BYREF_RO_PROPERTY(TStableName, StableName);
- TDeletedColumn& SetStableName(TStableName stableName);
+ DEFINE_BYREF_RO_PROPERTY(TColumnStableName, StableName);
+ TDeletedColumn& SetStableName(TColumnStableName stableName);
};
////////////////////////////////////////////////////////////////////////////////
@@ -237,9 +215,9 @@ public:
public:
explicit TNameMapping(const TTableSchema& schema);
- bool IsDeleted(const TStableName& stableName) const;
- TString StableNameToName(const TStableName& stableName) const;
- TStableName NameToStableName(TStringBuf name) const;
+ bool IsDeleted(const TColumnStableName& stableName) const;
+ TString StableNameToName(const TColumnStableName& stableName) const;
+ TColumnStableName NameToStableName(TStringBuf name) const;
private:
const TTableSchema& Schema_;
@@ -257,6 +235,11 @@ public:
//! Constructs an empty non-strict schema.
TTableSchema() = default;
+ TTableSchema(TTableSchema&&) = default;
+ TTableSchema& operator=(TTableSchema&&) = default;
+ TTableSchema(const TTableSchema&) = default;
+ TTableSchema& operator=(const TTableSchema&) = default;
+
//! Constructs a schema with given columns and strictness flag.
//! No validation is performed.
explicit TTableSchema(
@@ -266,8 +249,8 @@ public:
ETableSchemaModification schemaModification = ETableSchemaModification::None,
std::vector<TDeletedColumn> deletedColumns = {});
- const TColumnSchema* FindColumnByStableName(const TStableName& stableName) const;
- const TDeletedColumn* FindDeletedColumn(const TStableName& stableName) const;
+ const TColumnSchema* FindColumnByStableName(const TColumnStableName& stableName) const;
+ const TDeletedColumn* FindDeletedColumn(const TColumnStableName& stableName) const;
int GetColumnIndex(const TColumnSchema& column) const;
@@ -300,14 +283,14 @@ public:
bool HasRenamedColumns() const;
bool IsEmpty() const;
- std::vector<TStableName> GetKeyColumnStableNames() const;
+ std::vector<TColumnStableName> GetKeyColumnStableNames() const;
TKeyColumns GetKeyColumnNames() const;
TKeyColumns GetKeyColumns() const;
int GetColumnCount() const;
int GetKeyColumnCount() const;
int GetValueColumnCount() const;
- std::vector<TStableName> GetColumnStableNames() const;
+ std::vector<TColumnStableName> GetColumnStableNames() const;
const THunkColumnIds& GetHunkColumnIds() const;
TSortColumns GetSortColumns(const std::optional<TNameMapping>& nameMapping = std::nullopt) const;
@@ -397,16 +380,25 @@ public:
i64 GetMemoryUsage() const;
private:
- std::shared_ptr<const std::vector<TColumnSchema>> Columns_;
- std::vector<TDeletedColumn> DeletedColumns_;
+ struct TColumnInfo
+ {
+ TColumnInfo(std::vector<TColumnSchema> columns, std::vector<TDeletedColumn> deletedColumns)
+ : Columns(std::move(columns))
+ , DeletedColumns(std::move(deletedColumns))
+ {
+ }
+
+ std::vector<TColumnSchema> Columns;
+ std::vector<TDeletedColumn> DeletedColumns;
+ };
+
+ std::shared_ptr<const TColumnInfo> ColumnInfo_;
int KeyColumnCount_ = 0;
bool HasComputedColumns_ = false;
bool HasAggregateColumns_ = false;
THunkColumnIds HunkColumnsIds_;
- // NB: Strings are owned by Columns_, addresses are immutable
- // inside TTableSchema.
THashMap<TStringBuf, int> StableNameToColumnIndex_;
THashMap<TStringBuf, int> NameToColumnIndex_;
THashMap<TStringBuf, int> StableNameToDeletedColumnIndex_;
@@ -414,6 +406,8 @@ private:
DEFINE_REFCOUNTED_TYPE(TTableSchema)
+////////////////////////////////////////////////////////////////////////////////
+
void FormatValue(TStringBuilderBase* builder, const TTableSchema& schema, TStringBuf spec);
void FormatValue(TStringBuilderBase* builder, const TTableSchemaPtr& schema, TStringBuf spec);
@@ -464,7 +458,7 @@ bool IsEqualIgnoringRequiredness(const TTableSchema& lhs, const TTableSchema& rh
static constexpr TStringBuf NonexistentColumnName = "$__YT_NONEXISTENT_COLUMN_NAME__";
-std::vector<TStableName> MapNamesToStableNames(
+std::vector<TColumnStableName> MapNamesToStableNames(
const TTableSchema& schema,
std::vector<TString> names,
const std::optional<TStringBuf>& missingColumnReplacement = std::nullopt);
@@ -473,6 +467,8 @@ std::vector<TStableName> MapNamesToStableNames(
void ValidateKeyColumns(const TKeyColumns& keyColumns);
+void ValidateColumnName(const TString& name);
+
void ValidateColumnSchema(
const TColumnSchema& columnSchema,
bool isTableSorted = false,
@@ -584,9 +580,9 @@ struct TCellTaggedTableSchemaEquals
////////////////////////////////////////////////////////////////////////////////
template <>
-struct THash<NYT::NTableClient::TStableName>
+struct THash<NYT::NTableClient::TColumnStableName>
{
- size_t operator()(const NYT::NTableClient::TStableName& stableName) const;
+ size_t operator()(const NYT::NTableClient::TColumnStableName& stableName) const;
};
template <>
diff --git a/yt/yt/client/table_client/schema_serialization_helpers.cpp b/yt/yt/client/table_client/schema_serialization_helpers.cpp
index 27da822c48a..2190137b08b 100644
--- a/yt/yt/client/table_client/schema_serialization_helpers.cpp
+++ b/yt/yt/client/table_client/schema_serialization_helpers.cpp
@@ -95,7 +95,7 @@ void TSerializableColumnSchema::DeserializeFromCursor(NYson::TYsonPullParserCurs
SetMaxInlineHunkSize(ExtractTo<std::optional<i64>>(cursor));
} else if (key == TStringBuf("stable_name")) {
cursor->Next();
- SerializedStableName_ = ExtractTo<TString>(cursor);
+ SerializedStableName_ = ExtractTo<TColumnStableName>(cursor);
} else if (key == TStringBuf("deleted")) {
cursor->Next();
Deleted_ = ExtractTo<bool>(cursor);
@@ -112,7 +112,7 @@ void TSerializableColumnSchema::SetColumnSchema(const TColumnSchema& columnSchem
{
static_cast<TColumnSchema&>(*this) = columnSchema;
if (IsRenamed()) {
- SerializedStableName_ = StableName().Get();
+ SerializedStableName_ = StableName();
}
LogicalTypeV1_ = columnSchema.CastToV1Type();
RequiredV1_ = columnSchema.Required();
@@ -129,10 +129,10 @@ void TSerializableColumnSchema::SetDeletedColumnSchema(
void TSerializableColumnSchema::RunPostprocessor()
{
if (Deleted() && *Deleted()) {
- if (!SerializedStableName_ || SerializedStableName_->empty()) {
- THROW_ERROR_EXCEPTION("stable name should be set for a deleted column");
+ if (!SerializedStableName_) {
+ THROW_ERROR_EXCEPTION("Stable name should be set for a deleted column");
}
- SetStableName(TStableName(*SerializedStableName_));
+ SetStableName(*SerializedStableName_);
return;
}
@@ -141,13 +141,11 @@ void TSerializableColumnSchema::RunPostprocessor()
THROW_ERROR_EXCEPTION("Column name cannot be empty");
}
- if (SerializedStableName_.has_value()) {
- if (SerializedStableName_->empty()) {
- THROW_ERROR_EXCEPTION("Column stable name cannot be empty");
- }
- SetStableName(TStableName(*SerializedStableName_));
+ if (SerializedStableName_) {
+ ValidateColumnName(SerializedStableName_->Underlying());
+ SetStableName(*SerializedStableName_);
} else {
- SetStableName(TStableName(Name()));
+ SetStableName(TColumnStableName(Name()));
}
try {
@@ -219,7 +217,7 @@ void Serialize(const TDeletedColumn& schema, NYson::IYsonConsumer* consumer)
{
consumer->OnBeginMap();
consumer->OnKeyedItem("stable_name");
- consumer->OnStringScalar(schema.StableName().Get());
+ consumer->OnStringScalar(schema.StableName().Underlying());
consumer->OnKeyedItem("deleted");
consumer->OnBooleanScalar(true);
consumer->OnEndMap();
@@ -337,7 +335,6 @@ void Deserialize(TTableSchemaPtr& schema, NYson::TYsonPullParserCursor* cursor)
schema = New<TTableSchema>(std::move(actualSchema));
}
-
////////////////////////////////////////////////////////////////////////////////
} // namespace NYT::NTableClient
diff --git a/yt/yt/client/table_client/schema_serialization_helpers.h b/yt/yt/client/table_client/schema_serialization_helpers.h
index 43b9ad60703..24ff8511c95 100644
--- a/yt/yt/client/table_client/schema_serialization_helpers.h
+++ b/yt/yt/client/table_client/schema_serialization_helpers.h
@@ -38,7 +38,7 @@ public:
void SetDeletedColumnSchema(const TDeletedColumn& deletedColumnSchema);
private:
- std::optional<TString> SerializedStableName_;
+ std::optional<TColumnStableName> SerializedStableName_;
std::optional<ESimpleLogicalValueType> LogicalTypeV1_;
std::optional<bool> RequiredV1_;
diff --git a/yt/yt/client/table_client/unittests/columnar_statistics_ut.cpp b/yt/yt/client/table_client/unittests/columnar_statistics_ut.cpp
index 2508a5f225e..47054dff7b0 100644
--- a/yt/yt/client/table_client/unittests/columnar_statistics_ut.cpp
+++ b/yt/yt/client/table_client/unittests/columnar_statistics_ut.cpp
@@ -592,13 +592,13 @@ TEST(TColumnarStatisticsColumnSelectionTest, ColumnSelect)
.LegacyChunkRowCount = 2,
};
auto nameTable = TNameTable::FromKeyColumns({"buzz", "off", "taken", "sec", "list", "size", "friend"});
- std::vector<TStableName> stableNames = {
- TStableName("friend"),
- TStableName("taken"),
- TStableName("buzz"),
- TStableName("foo"),
- TStableName("list"),
- TStableName("bar"),
+ std::vector<TColumnStableName> stableNames = {
+ TColumnStableName("friend"),
+ TColumnStableName("taken"),
+ TColumnStableName("buzz"),
+ TColumnStableName("foo"),
+ TColumnStableName("list"),
+ TColumnStableName("bar"),
};
auto selectedStatistics = statistics.SelectByColumnNames(nameTable, stableNames);
diff --git a/yt/yt/client/table_client/unittests/serialization_ut.cpp b/yt/yt/client/table_client/unittests/serialization_ut.cpp
index 261b24cb1b0..9280dd1f760 100644
--- a/yt/yt/client/table_client/unittests/serialization_ut.cpp
+++ b/yt/yt/client/table_client/unittests/serialization_ut.cpp
@@ -21,7 +21,7 @@ TEST(TSchemaSerialization, ParseUsingNodeAndSerialize)
EXPECT_EQ(1, std::ssize(schema.Columns()));
EXPECT_EQ("a", schema.Columns()[0].Name());
EXPECT_EQ(1, std::ssize(schema.DeletedColumns()));
- EXPECT_EQ("b", schema.DeletedColumns()[0].StableName().Get());
+ EXPECT_EQ("b", schema.DeletedColumns()[0].StableName().Underlying());
NYT::NFormats::TFormat format(NFormats::EFormatType::Json);
@@ -52,7 +52,7 @@ TEST(TSchemaSerialization, Cursor)
EXPECT_EQ(1, std::ssize(schema.Columns()));
EXPECT_EQ("a", schema.Columns()[0].Name());
EXPECT_EQ(1, std::ssize(schema.DeletedColumns()));
- EXPECT_EQ("b", schema.DeletedColumns()[0].StableName().Get());
+ EXPECT_EQ("b", schema.DeletedColumns()[0].StableName().Underlying());
}
TEST(TSchemaSerialization, Deleted)
@@ -63,7 +63,7 @@ TEST(TSchemaSerialization, Deleted)
TTableSchema schema;
EXPECT_THROW_WITH_SUBSTRING(
Deserialize(schema, NYTree::ConvertToNode(NYson::TYsonString(TString(schemaString)))),
- "stable name should be set for a deleted column");
+ "Stable name should be set for a deleted column");
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/client/table_client/unittests/unversioned_row_ut.cpp b/yt/yt/client/table_client/unittests/unversioned_row_ut.cpp
new file mode 100644
index 00000000000..a766846c656
--- /dev/null
+++ b/yt/yt/client/table_client/unittests/unversioned_row_ut.cpp
@@ -0,0 +1,32 @@
+#include <yt/yt/client/table_client/unversioned_row.h>
+#include <yt/yt/client/table_client/row_buffer.h>
+
+#include <yt/yt/core/test_framework/framework.h>
+
+namespace NYT::NTableClient {
+namespace {
+
+////////////////////////////////////////////////////////////////////////////////
+
+TEST(TUnversionedOwningRowTest, DefaultCtor)
+{
+ TUnversionedOwningRow owningRow;
+ ASSERT_EQ(owningRow.GetSpaceUsed(), 0ull);
+}
+
+TEST(TUnversionedOwningRowTest, ConstructFromUnversionedRow)
+{
+ auto buffer = New<TRowBuffer>();
+ TUnversionedRowBuilder rowBuilder;
+ rowBuilder.AddValue(MakeUnversionedInt64Value(123, 0));
+ TUnversionedRow row = rowBuilder.GetRow();
+
+ TUnversionedOwningRow owningRow(row);
+ ASSERT_EQ(owningRow.GetCount(), 1);
+ ASSERT_GT(owningRow.GetSpaceUsed(), 0ull);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace
+} // namespace NYT::NTableClient
diff --git a/yt/yt/client/table_client/unittests/ya.make b/yt/yt/client/table_client/unittests/ya.make
index 911aa88179e..f7594f2b9aa 100644
--- a/yt/yt/client/table_client/unittests/ya.make
+++ b/yt/yt/client/table_client/unittests/ya.make
@@ -8,6 +8,7 @@ SRCS(
columnar_statistics_ut.cpp
columnar_ut.cpp
serialization_ut.cpp
+ unversioned_row_ut.cpp
)
INCLUDE(${ARCADIA_ROOT}/yt/opensource.inc)
diff --git a/yt/yt/client/table_client/unversioned_row.h b/yt/yt/client/table_client/unversioned_row.h
index 6ca7db3dabf..e24172331f8 100644
--- a/yt/yt/client/table_client/unversioned_row.h
+++ b/yt/yt/client/table_client/unversioned_row.h
@@ -772,11 +772,16 @@ public:
size_t GetSpaceUsed() const
{
- return StringData_.GetHolder()->GetTotalByteSize().value_or(StringData_.Size()) +
- RowData_.GetHolder()->GetTotalByteSize().value_or(RowData_.Size());
+ size_t size = 0;
+ if (StringData_) {
+ size += StringData_.GetHolder()->GetTotalByteSize().value_or(StringData_.Size());
+ }
+ if (RowData_) {
+ size += RowData_.GetHolder()->GetTotalByteSize().value_or(RowData_.Size());
+ }
+ return size;
}
-
friend void swap(TUnversionedOwningRow& lhs, TUnversionedOwningRow& rhs)
{
using std::swap;
diff --git a/yt/yt/client/tablet_client/public.h b/yt/yt/client/tablet_client/public.h
index 1a933865a6e..75a602eebfa 100644
--- a/yt/yt/client/tablet_client/public.h
+++ b/yt/yt/client/tablet_client/public.h
@@ -84,7 +84,7 @@ YT_DEFINE_ERROR_ENUM(
((NoInSyncReplicas) (1736))
((CellHasNoAssignedPeers) (1737))
((TableSchemaIncompatible) (1738))
- ((BundleIsBanned) (1739))
+ ((BundleIsBanned) (1739))
);
DEFINE_ENUM(EInMemoryMode,
diff --git a/yt/yt/client/transaction_client/config.cpp b/yt/yt/client/transaction_client/config.cpp
index 3264e5dcd1d..165be900a3b 100644
--- a/yt/yt/client/transaction_client/config.cpp
+++ b/yt/yt/client/transaction_client/config.cpp
@@ -31,4 +31,13 @@ void TRemoteTimestampProviderConfig::Register(TRegistrar registrar)
////////////////////////////////////////////////////////////////////////////////
+void TAlienTimestampProviderConfig::Register(TRegistrar registrar)
+{
+ registrar.Parameter("clock_cluster_tag", &TThis::ClockClusterTag);
+ registrar.Parameter("timestamp_provider", &TThis::TimestampProvider)
+ .DefaultNew();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
} // namespace NYT::NTransactionClient
diff --git a/yt/yt/client/transaction_client/config.h b/yt/yt/client/transaction_client/config.h
index 9c8c69d6a69..97b291de0ce 100644
--- a/yt/yt/client/transaction_client/config.h
+++ b/yt/yt/client/transaction_client/config.h
@@ -38,4 +38,24 @@ DEFINE_REFCOUNTED_TYPE(TRemoteTimestampProviderConfig)
////////////////////////////////////////////////////////////////////////////////
+class TAlienTimestampProviderConfig
+ : public NYTree::TYsonStruct
+{
+public:
+ //! Clock server cell tag
+ NObjectClient::TCellTag ClockClusterTag;
+
+ NTransactionClient::TRemoteTimestampProviderConfigPtr TimestampProvider;
+
+ REGISTER_YSON_STRUCT(TAlienTimestampProviderConfig);
+
+ static void Register(TRegistrar registrar);
+};
+
+DEFINE_REFCOUNTED_TYPE(TAlienTimestampProviderConfig)
+
+DECLARE_REFCOUNTED_CLASS(TAlienTimestampProviderConfig)
+
+////////////////////////////////////////////////////////////////////////////////
+
} // namespace NYT::NTransactionClient
diff --git a/yt/yt/client/transaction_client/remote_timestamp_provider.cpp b/yt/yt/client/transaction_client/remote_timestamp_provider.cpp
index 045620a75e4..f1e6107a11a 100644
--- a/yt/yt/client/transaction_client/remote_timestamp_provider.cpp
+++ b/yt/yt/client/transaction_client/remote_timestamp_provider.cpp
@@ -22,6 +22,10 @@ using namespace NConcurrency;
////////////////////////////////////////////////////////////////////////////////
+static const auto& Logger = TransactionClientLogger;
+
+////////////////////////////////////////////////////////////////////////////////
+
IChannelPtr CreateTimestampProviderChannel(
TRemoteTimestampProviderConfigPtr config,
IChannelFactoryPtr channelFactory)
@@ -105,6 +109,50 @@ ITimestampProviderPtr CreateBatchingRemoteTimestampProvider(
config->BatchPeriod);
}
+ITimestampProviderPtr CreateBatchingRemoteTimestampProvider(
+ const TRemoteTimestampProviderConfigPtr& config,
+ const IChannelFactoryPtr& channelFactory)
+{
+ return CreateBatchingRemoteTimestampProvider(
+ config,
+ CreateTimestampProviderChannel(config, channelFactory));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+TAlienRemoteTimestampProvidersMap CreateAlienTimestampProvidersMap(
+ const std::vector<TAlienTimestampProviderConfigPtr>& configs,
+ ITimestampProviderPtr nativeProvider,
+ TCellTag nativeProviderClockClusterTag,
+ const IChannelFactoryPtr& channelFactory)
+{
+ TAlienRemoteTimestampProvidersMap alienProvidersMap;
+
+ if (nativeProviderClockClusterTag == InvalidCellTag) {
+ return alienProvidersMap;
+ }
+
+ alienProvidersMap.reserve(configs.size() + 1);
+ EmplaceOrCrash(alienProvidersMap, nativeProviderClockClusterTag, std::move(nativeProvider));
+
+ for (const auto& foreignProviderConfig : configs) {
+ auto alienClockCellTag = foreignProviderConfig->ClockClusterTag;
+
+ if(alienProvidersMap.contains(alienClockCellTag)) {
+ YT_LOG_ALERT("Duplicate entry for alien clock clusters %d",
+ alienClockCellTag);
+ continue;
+ }
+
+ EmplaceOrCrash(
+ alienProvidersMap,
+ alienClockCellTag,
+ CreateBatchingRemoteTimestampProvider(foreignProviderConfig->TimestampProvider, channelFactory));
+ }
+
+ return alienProvidersMap;
+}
+
////////////////////////////////////////////////////////////////////////////////
} // namespace NYT::NTransactionClient
diff --git a/yt/yt/client/transaction_client/remote_timestamp_provider.h b/yt/yt/client/transaction_client/remote_timestamp_provider.h
index 91a7179e923..41a4a3d707d 100644
--- a/yt/yt/client/transaction_client/remote_timestamp_provider.h
+++ b/yt/yt/client/transaction_client/remote_timestamp_provider.h
@@ -2,12 +2,16 @@
#include "public.h"
+#include <yt/yt/client/transaction_client/config.h>
+
#include <yt/yt/core/rpc/public.h>
namespace NYT::NTransactionClient {
////////////////////////////////////////////////////////////////////////////////
+using TAlienRemoteTimestampProvidersMap = THashMap<NObjectClient::TCellTag, ITimestampProviderPtr>;
+
NRpc::IChannelPtr CreateTimestampProviderChannel(
TRemoteTimestampProviderConfigPtr config,
NRpc::IChannelFactoryPtr channelFactory);
@@ -29,6 +33,16 @@ ITimestampProviderPtr CreateBatchingRemoteTimestampProvider(
TRemoteTimestampProviderConfigPtr config,
NRpc::IChannelPtr channel);
+ITimestampProviderPtr CreateBatchingRemoteTimestampProvider(
+ const TRemoteTimestampProviderConfigPtr& config,
+ const NRpc::IChannelFactoryPtr& channelFactory);
+
+TAlienRemoteTimestampProvidersMap CreateAlienTimestampProvidersMap(
+ const std::vector<TAlienTimestampProviderConfigPtr>& configs,
+ ITimestampProviderPtr nativeProvider,
+ NObjectClient::TCellTag nativeProviderClockClusterTag,
+ const NRpc::IChannelFactoryPtr& channelFactory);
+
////////////////////////////////////////////////////////////////////////////////
} // namespace NYT::NTransactionClient
diff --git a/yt/yt/client/unittests/check_schema_compatibility_ut.cpp b/yt/yt/client/unittests/check_schema_compatibility_ut.cpp
index c1bb4440f52..c2be41a3b5c 100644
--- a/yt/yt/client/unittests/check_schema_compatibility_ut.cpp
+++ b/yt/yt/client/unittests/check_schema_compatibility_ut.cpp
@@ -310,7 +310,7 @@ TEST_F(TTableSchemaCompatibilityTest, DeletedColumns)
TColumnSchema("value", ESimpleLogicalValueType::String),
}, true, true, ETableSchemaModification::None,
{
- TDeletedColumn(TStableName("value1")),
+ TDeletedColumn(TColumnStableName("value1")),
}),
TTableSchema({
TColumnSchema("key1", ESimpleLogicalValueType::String, ESortOrder::Descending),
@@ -334,7 +334,7 @@ TEST_F(TTableSchemaCompatibilityTest, DeletedColumns)
TColumnSchema("value", ESimpleLogicalValueType::String),
}, true, true, ETableSchemaModification::None,
{
- TDeletedColumn(TStableName("value1")),
+ TDeletedColumn(TColumnStableName("value1")),
}),
false);
diff --git a/yt/yt/client/unittests/schema_ut.cpp b/yt/yt/client/unittests/schema_ut.cpp
index c1990743c2c..672ba634a2f 100644
--- a/yt/yt/client/unittests/schema_ut.cpp
+++ b/yt/yt/client/unittests/schema_ut.cpp
@@ -416,7 +416,7 @@ TEST(TTableSchemaTest, ColumnSchemaProtobufBackwardCompatibility)
EXPECT_EQ(*columnSchema.LogicalType(), *OptionalLogicalType(SimpleLogicalType(ESimpleLogicalValueType::Uint64)));
EXPECT_EQ(columnSchema.GetWireType(), EValueType::Uint64);
EXPECT_EQ(columnSchema.Name(), "foo");
- EXPECT_EQ(columnSchema.StableName().Get(), "foo");
+ EXPECT_EQ(columnSchema.StableName().Underlying(), "foo");
columnSchemaProto.set_simple_logical_type(static_cast<int>(ESimpleLogicalValueType::Uint32));
columnSchemaProto.set_name("foo");
@@ -426,7 +426,7 @@ TEST(TTableSchemaTest, ColumnSchemaProtobufBackwardCompatibility)
EXPECT_EQ(*columnSchema.LogicalType(), *OptionalLogicalType(SimpleLogicalType(ESimpleLogicalValueType::Uint32)));
EXPECT_EQ(columnSchema.GetWireType(), EValueType::Uint64);
EXPECT_EQ(columnSchema.Name(), "foo");
- EXPECT_EQ(columnSchema.StableName().Get(), "foo_stable");
+ EXPECT_EQ(columnSchema.StableName().Underlying(), "foo_stable");
}
TEST(TTableSchemaTest, EqualIgnoringRequiredness)
diff --git a/yt/yt/core/actions/invoker.h b/yt/yt/core/actions/invoker.h
index b70c177e3e6..49c231879f2 100644
--- a/yt/yt/core/actions/invoker.h
+++ b/yt/yt/core/actions/invoker.h
@@ -29,13 +29,20 @@ struct IInvoker
//! in some sense.
virtual bool CheckAffinity(const IInvokerPtr& invoker) const = 0;
- //! Returns true if invoker is serialized, i.e. never executes
- //! two callbacks concurrently.
+ //! Returns true if the invoker is serialized, i.e. no two callbacks can execute
+ //! concurrently.
+ /*!
+ * Note, however, that if a callback yields the execution context
+ * (e.g. by calling #WaitFor) another one can start running (or be resumed) within the
+ * same serialized invoker.
+ */
virtual bool IsSerialized() const = 0;
- using TWaitTimeObserver = std::function<void(TDuration)>;
+ using TWaitTimeObserver = std::function<void(TDuration waitTime)>;
+ //! Registers a callback that could be invoked to inform
+ //! of the current wait time for invocations via this invoker.
+ //! These invocations, however, are not guaranteed.
virtual void RegisterWaitTimeObserver(TWaitTimeObserver waitTimeObserver) = 0;
-
};
DEFINE_REFCOUNTED_TYPE(IInvoker)
diff --git a/yt/yt/core/bus/tcp/client.cpp b/yt/yt/core/bus/tcp/client.cpp
index 049727b8606..6fe8a08856b 100644
--- a/yt/yt/core/bus/tcp/client.cpp
+++ b/yt/yt/core/bus/tcp/client.cpp
@@ -175,16 +175,18 @@ public:
auto id = TConnectionId::Create();
- YT_LOG_DEBUG("Connecting to server (Address: %v, ConnectionId: %v, MultiplexingBand: %v, EncryptionMode: %v)",
+ YT_LOG_DEBUG("Connecting to server (Address: %v, ConnectionId: %v, MultiplexingBand: %v, EncryptionMode: %v, VerificationMode: %v)",
EndpointDescription_,
id,
options.MultiplexingBand,
- Config_->EncryptionMode);
+ Config_->EncryptionMode,
+ Config_->VerificationMode);
auto endpointAttributes = ConvertToAttributes(BuildYsonStringFluently()
.BeginMap()
.Items(*EndpointAttributes_)
.Item("connection_id").Value(id)
+ .Item("connection_type").Value(EConnectionType::Client)
.EndMap());
auto poller = TTcpDispatcher::TImpl::Get()->GetXferPoller();
diff --git a/yt/yt/core/bus/tcp/connection.cpp b/yt/yt/core/bus/tcp/connection.cpp
index 84e0f050e79..92ce193de74 100644
--- a/yt/yt/core/bus/tcp/connection.cpp
+++ b/yt/yt/core/bus/tcp/connection.cpp
@@ -121,11 +121,12 @@ TTcpConnection::TTcpConnection(
, UnixDomainSocketPath_(unixDomainSocketPath)
, Handler_(std::move(handler))
, Poller_(std::move(poller))
- , LoggingTag_(Format("ConnectionId: %v, ConnectionType: %v, RemoteAddress: %v, EncryptionMode: %v",
+ , LoggingTag_(Format("ConnectionId: %v, ConnectionType: %v, RemoteAddress: %v, EncryptionMode: %v, VerificationMode: %v",
Id_,
ConnectionType_,
EndpointDescription_,
- Config_->EncryptionMode))
+ Config_->EncryptionMode,
+ Config_->VerificationMode))
, Logger(BusLogger.WithTag(LoggingTag_.c_str()))
, GenerateChecksums_(Config_->GenerateChecksums)
, Socket_(socket)
@@ -287,11 +288,12 @@ void TTcpConnection::TryEnqueueHandshake()
}
NProto::THandshake handshake;
- ToProto(handshake.mutable_foreign_connection_id(), Id_);
+ ToProto(handshake.mutable_connection_id(), Id_);
if (ConnectionType_ == EConnectionType::Client) {
handshake.set_multiplexing_band(ToProto<int>(MultiplexingBand_.load()));
}
- handshake.set_encryption_mode(static_cast<int>(EncryptionMode_));
+ handshake.set_encryption_mode(ToProto<int>(EncryptionMode_));
+ handshake.set_verification_mode(ToProto<int>(VerificationMode_));
auto message = MakeHandshakeMessage(handshake);
auto messageSize = GetByteSize(message);
@@ -500,6 +502,9 @@ void TTcpConnection::Abort(const TError& error)
// Construct a detailed error.
YT_VERIFY(!error.IsOK());
auto detailedError = error << *EndpointAttributes_;
+ if (PeerAttributes_) {
+ detailedError <<= *PeerAttributes_;
+ }
{
auto guard = Guard(Lock_);
@@ -752,6 +757,9 @@ void TTcpConnection::Terminate(const TError& error)
// Construct a detailed error.
YT_VERIFY(!error.IsOK());
auto detailedError = error << *EndpointAttributes_;
+ if (PeerAttributes_) {
+ detailedError <<= *PeerAttributes_;
+ }
auto guard = Guard(Lock_);
@@ -1005,7 +1013,7 @@ ssize_t TTcpConnection::DoReadSocket(char* buffer, size_t size)
case ESslState::Established: {
auto result = SSL_read(Ssl_.get(), buffer, size);
if (PendingSslHandshake_ && result > 0) {
- YT_LOG_DEBUG("TLS/SSL connection has been established by SSL_read (VerificationMode: %v)", VerificationMode_);
+ YT_LOG_DEBUG("TLS/SSL connection has been established by SSL_read");
PendingSslHandshake_ = false;
ReadyPromise_.TrySet();
}
@@ -1178,10 +1186,18 @@ bool TTcpConnection::OnHandshakePacketReceived()
? std::make_optional(FromProto<EMultiplexingBand>(handshake.multiplexing_band()))
: std::nullopt;
- YT_LOG_DEBUG("Handshake received (ForeignConnectionId: %v, MultiplexingBand: %v, ForeignEncryptionMode: %v)",
- FromProto<TConnectionId>(handshake.foreign_connection_id()),
- optionalMultiplexingBand,
- static_cast<EEncryptionMode>(handshake.encryption_mode()));
+ PeerAttributes_ = ConvertToAttributes(BuildYsonStringFluently()
+ .BeginMap()
+ .Item("peer_connection_id").Value(FromProto<TConnectionId>(handshake.connection_id()))
+ .Item("peer_encryption_mode").Value(FromProto<EEncryptionMode>(handshake.encryption_mode()))
+ .Item("peer_verification_mode").Value(FromProto<EVerificationMode>(handshake.verification_mode()))
+ .EndMap());
+
+ YT_LOG_DEBUG("Handshake received (PeerConnectionId: %v, PeerEncryptionMode: %v, PeerVerificationMode: %v, MultiplexingBand: %v)",
+ PeerAttributes_->Get<TString>("peer_connection_id"),
+ PeerAttributes_->Get<TString>("peer_encryption_mode"),
+ PeerAttributes_->Get<TString>("peer_verification_mode"),
+ optionalMultiplexingBand);
if (ConnectionType_ == EConnectionType::Server && optionalMultiplexingBand) {
auto guard = Guard(Lock_);
@@ -1197,7 +1213,7 @@ bool TTcpConnection::OnHandshakePacketReceived()
TryEnqueueHandshake();
}
- auto otherEncryptionMode = handshake.has_encryption_mode() ? static_cast<EEncryptionMode>(handshake.encryption_mode()) : EEncryptionMode::Disabled;
+ auto otherEncryptionMode = handshake.has_encryption_mode() ? FromProto<EEncryptionMode>(handshake.encryption_mode()) : EEncryptionMode::Disabled;
if (EncryptionMode_ == EEncryptionMode::Required || otherEncryptionMode == EEncryptionMode::Required) {
if (EncryptionMode_ == EEncryptionMode::Disabled || otherEncryptionMode == EEncryptionMode::Disabled) {
@@ -1299,7 +1315,7 @@ ssize_t TTcpConnection::DoWriteFragments(const std::vector<struct iovec>& vec)
YT_ASSERT(vec.size() == 1);
auto result = SSL_write(Ssl_.get(), vec[0].iov_base, vec[0].iov_len);
if (PendingSslHandshake_ && result > 0) {
- YT_LOG_DEBUG("TLS/SSL connection has been established by SSL_write (VerificationMode: %v)", VerificationMode_);
+ YT_LOG_DEBUG("TLS/SSL connection has been established by SSL_write");
PendingSslHandshake_ = false;
ReadyPromise_.TrySet();
}
@@ -1857,7 +1873,7 @@ bool TTcpConnection::DoSslHandshake()
auto result = SSL_do_handshake(Ssl_.get());
switch (SSL_get_error(Ssl_.get(), result)) {
case SSL_ERROR_NONE:
- YT_LOG_DEBUG("TLS/SSL connection has been established by SSL_do_handshake (VerificationMode %v)", VerificationMode_);
+ YT_LOG_DEBUG("TLS/SSL connection has been established by SSL_do_handshake");
MaxFragmentsPerWrite_ = 1;
SslState_ = ESslState::Established;
ReadyPromise_.TrySet();
@@ -1918,7 +1934,7 @@ void TTcpConnection::TryEstablishSslSession()
return;
}
- YT_LOG_DEBUG("Starting TLS/SSL connection (VerificationMode: %v)", VerificationMode_);
+ YT_LOG_DEBUG("Starting TLS/SSL connection");
if (Config_->LoadCertsFromBusCertsDirectory && !TTcpDispatcher::TImpl::Get()->GetBusCertsDirectoryPath()) {
Abort(TError(NBus::EErrorCode::SslError, "bus_certs_directory_path is not set in tcp_dispatcher config"));
@@ -1995,16 +2011,33 @@ void TTcpConnection::TryEstablishSslSession()
switch (VerificationMode_) {
case EVerificationMode::Full:
- // Set the hostname for the peer certificate verification.
- if (SSL_set1_host(Ssl_.get(), EndpointHostName_.data()) != 1) {
- Abort(TError(NBus::EErrorCode::SslError, "Failed to set hostname %v for the peer certificate verification", EndpointHostName_));
- return;
- }
- if (Config_->PeerAlternativeHostName &&
- SSL_add1_host(Ssl_.get(), Config_->PeerAlternativeHostName->data()) != 1)
- {
- Abort(TError(NBus::EErrorCode::SslError, "Failed to set alternative hostname %v for the peer certificate verification", *Config_->PeerAlternativeHostName));
- return;
+ // Because of the implementation of check_id() from libs/openssl/crypto/x509/x509_vfy.c,
+ // we can not set both ip and host checks. So we separate them as follows.
+ if (Config_->PeerAlternativeHostName) {
+ // Set hostname for peer certificate verification.
+ if (SSL_set1_host(Ssl_.get(), EndpointHostName_.c_str()) != 1) {
+ Abort(TError(NBus::EErrorCode::SslError, "Failed to set hostname %v for peer certificate verification", EndpointHostName_));
+ return;
+ }
+
+ // Add alternative hostname for peer certificate verification.
+ if (SSL_add1_host(Ssl_.get(), Config_->PeerAlternativeHostName->c_str()) != 1) {
+ Abort(TError(NBus::EErrorCode::SslError, "Failed to add alternative hostname %v for peer certificate verification", *Config_->PeerAlternativeHostName));
+ return;
+ }
+ } else if (auto networkAddress = TNetworkAddress::TryParse(EndpointHostName_); networkAddress.IsOK() && networkAddress.Value().IsIP()) {
+ // Set ip address for peer certificate verification.
+ auto address = ToString(networkAddress.Value(), {.IncludePort = false, .IncludeTcpProtocol = false});
+ if (X509_VERIFY_PARAM_set1_ip_asc(SSL_get0_param(Ssl_.get()), address.c_str()) != 1) {
+ Abort(TError(NBus::EErrorCode::SslError, "Failed to set ip address %v for peer certificate verification", address));
+ return;
+ }
+ } else {
+ // Set hostname for peer certificate verification.
+ if (SSL_set1_host(Ssl_.get(), EndpointHostName_.c_str()) != 1) {
+ Abort(TError(NBus::EErrorCode::SslError, "Failed to set hostname %v for peer certificate verification", EndpointHostName_));
+ return;
+ }
}
[[fallthrough]];
case EVerificationMode::Ca: {
diff --git a/yt/yt/core/bus/tcp/connection.h b/yt/yt/core/bus/tcp/connection.h
index 39c5dea4d23..0f5d7581522 100644
--- a/yt/yt/core/bus/tcp/connection.h
+++ b/yt/yt/core/bus/tcp/connection.h
@@ -277,6 +277,8 @@ private:
const EEncryptionMode EncryptionMode_;
const EVerificationMode VerificationMode_;
+ NYTree::IAttributeDictionaryPtr PeerAttributes_;
+
size_t MaxFragmentsPerWrite_ = 256;
void Open();
diff --git a/yt/yt/core/bus/unittests/ssl_ut.cpp b/yt/yt/core/bus/unittests/ssl_ut.cpp
index 79d235e1a7c..4bceb132758 100644
--- a/yt/yt/core/bus/unittests/ssl_ut.cpp
+++ b/yt/yt/core/bus/unittests/ssl_ut.cpp
@@ -50,8 +50,9 @@ class TSslTest
{
public:
NTesting::TPortHolder Port;
- TString Address;
- TString AddressWithIp;
+ TString AddressWithHostName;
+ TString AddressWithIpV4;
+ TString AddressWithIpV6;
const char* CA = R"foo(-----BEGIN CERTIFICATE-----
MIIFWjCCA0KgAwIBAgIBATANBgkqhkiG9w0BAQsFADBGMQswCQYDVQQGEwJSVTEP
@@ -170,11 +171,128 @@ qrpW/AReSwhvwVugcMFUgMXaDx/3SAY75B808wX1tizv76omWZAQ774FeGQGyP4C
rPl77gAcribJm3TzBVHm2m6jBGtb
-----END PRIVATE KEY-----)foo";
+ const char* CAWithIpInSAN = R"foo(-----BEGIN CERTIFICATE-----
+MIIFHzCCAwegAwIBAgIUQEt4xnHWGulMGzqad434c4Mw+cAwDQYJKoZIhvcNAQEL
+BQAwJjERMA8GA1UECgwIWVRzYXVydXMxETAPBgNVBAMMCFlUc2F1cnVzMB4XDTI0
+MDIyOTEwMTIzM1oXDTM0MDIyNjEwMTIzM1owJjERMA8GA1UECgwIWVRzYXVydXMx
+ETAPBgNVBAMMCFlUc2F1cnVzMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKC
+AgEAwUS9deIwfMNeicFqw7/fDslSb7sSiPbYfYUxwuELBR8nVomaL/a7IpQx5dOw
+nB2CSUiTDsLczNaBvQyNkjJ8VIX4fEPtgfHCuoUaCg4NwcaHfY0TSssbCKh8U92z
+fM/iSCjjkMdp9pTzZL93yam72dqfFbHmBvO6XiGjYeR9BL6AqoZMBnIjmxsU9JCW
+SM7B0l+Sf8dsH8DmnzqtLUXKIZJyVK6LOVb7MtSw0iAYatrIt3t7IytqZMOe+dEZ
+V0C0YzTecOgCWKS+rA8X1h7zHW5vXLDYU6RR+qw3gFsRK0oHmECuo+4Ui2nMzkx1
+jf2nK8L0Z2MHP0YFI9cGCBfSZMv6eocbYZI1DmhNKZNFhSLL8lmfzv4uR7WPyNL6
+Ml+2xgp03r1QFx93cRNW5bjjFytzYQkEVwbvLsABHDFm056PpNXKh6eoXGkUfaWf
+iXxUWhAFJRxggkTrPawCr+YQtVbBFe/YcdrTkdvFengFLm4wE20RiJUZWvG4oXmV
+JdKvDMsR1RFoQQfSqKL3mERMvVBBO1CXqymdPW6K+S2r367ryXGCG6kRDGpfmu7R
+vYZcA9BJqNvGcowf5fBe2VZf3cqZwdZKjCYOR3dCVDbXClraeStzy0VXKgxukHyT
+g3XfPqptaUKtpy413b/AVG2YupEn+SoOGMP0NKMyj9XAr20CAwEAAaNFMEMwDgYD
+VR0PAQH/BAQDAgLkMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYEFAYGwcRb
+cWnfIkC1Mozkzm0CDcFbMA0GCSqGSIb3DQEBCwUAA4ICAQCztlZxgJNdhebicTkT
+B4iXXntoOzlnusua1lCBKRUowHAocw2ylXb32Ahh/fENmHyt/jYTlcFu/qK6Q1T8
+/pN14hnyF2pB+ZJjyAr3vNnZtHGJ2xz3wPqFRzD00YUqvvLi9xD2nhsfn4xex/OK
+KUx/dbV6FkJ60Fpg97zeOmO+5Kh9srIEGEczPb+y9meiMGB91tm+ZUcd9cGShTRH
+krFkuCySJuNgrAZCxqvdsUPvPDd12lPyqmfmuVjauON9ENYUYwNoxQc8MxEx0x6j
+QolYDmc2A2VP29rTLQhyjf8TvwXfq8z+zNoeQZCNCON5jg7zH67XarXxK1AZOePc
+ZqHtjfTLTqmmKkkG7IRt1h9dtGsROMaRfXf0t4M9mvqx/1Cx6abA6LfcOkp7OG8S
+0tx0IzIRnQh2iN4zR1MihS3hn3s9ayviiaopIPVyCKEKRZpsL3QzhzydnQM/Wb+r
+UTe546vZV3q2irHH/x4SZFWoFhDwepAyUMI4qo1REd+cM/MakLP5x4nFzzDmPjyf
+FiuyqHTlkMtjveytSblzpzWE1/Sum3RcMh4s9ECq8XaUl/8FerUYvIJfRDq1j79J
+w/cDyD142joRYwQG0HQkmE4ph4mYFwKhmYOv11Wik9zvEt156VPFaExu6rkjmLia
+nTkPBMUXiU3GIb4H7k78sEjv1g==
+-----END CERTIFICATE-----)foo";
+
+ const char* CertChainWithIpInSAN = R"foo(-----BEGIN CERTIFICATE-----
+MIIFVTCCAz2gAwIBAgIBATANBgkqhkiG9w0BAQsFADAmMREwDwYDVQQKDAhZVHNh
+dXJ1czERMA8GA1UEAwwIWVRzYXVydXMwHhcNMjQwMjI5MTAxMjMzWhcNMzQwMjI2
+MTAxMjMzWjATMREwDwYDVQQKDAhZVHNhdXJ1czCCAiIwDQYJKoZIhvcNAQEBBQAD
+ggIPADCCAgoCggIBAJ4BhT+WpWpkEEgaqcbZoV5/JOeAkFj2iZL08nIjkDRVhDBh
+dQoop47vB1lpLD/1i5+2YEackPrfeJawbNu32s/belvxHpTc1ljndCJlilMiR5B+
+MccP00fUZRsFhkzznANz++31PI4wamHJ1kdJOgD/4civ0mpWgd5s1hityqsypXI3
+RFbi689+mnBp2sGCD6l3QVbMj+8ORvXOVC1h1W3tExiivabjFILgXwb6WG6ZNgg8
+T20zdH4uEc4d2v6XKY4nz4AqYDHax9oqs3XTOTo0Bld6m7oipjGjToMqqpJD32pb
+nxSNT/XECpsNqZ/UMtcQf3HoA2LEOZOg/Knf1mosEww2svb0CqMGfsxxHehCaFJT
+CWkdd8GTQ/3t85xtrd5Ccdqb78o+5039H4GkfkcxAIZQe7siNLbUJ+dR6wRMzJw2
+GMcAHEIozOYVDgwyOT/Q3gaKMg4A3Ki2x7tkCie1KmmAcnECWDRhzG/Hg/RdnYqA
+L6g/m7Z3bw93rUbwXNudVj1ls5MPoyYtTACtZAXnv/PBBd+KR+RZ//T6dD7B9zzC
+MiIsIHemPzE3XsWB6I1AqXv2B8THELgJ8foN6Rho4YQ0t0wjhcM0higfSaiHwqhf
+Cgoc5xxOGa8PlEETWQvcT3ORAukpjM22QbZmA3uLN/MR1DJbwNHqiYPiFZ1zAgMB
+AAGjgaAwgZ0wDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggr
+BgEFBQcDAjAsBgNVHREEJTAjgglsb2NhbGhvc3SHBH8AAAGHEAAAAAAAAAAAAAAA
+AAAAAAEwHQYDVR0OBBYEFDyAfXqSAoKxK/sCyFs3d2yUpSntMB8GA1UdIwQYMBaA
+FAYGwcRbcWnfIkC1Mozkzm0CDcFbMA0GCSqGSIb3DQEBCwUAA4ICAQCHRuHI5XaS
+PIK3JKzA6l01z7YDHROGn5Xf9hqo5QKHv/aUD01UUhxCbx5z/YZMFDc6iRvu4xQw
+HMl8BCvTo3gHSS8JRcgRn1ov5m50NZMl0Ws9xvvy1j5rZWd3HkBTQSpzr4eSHAZp
+dUWXN2JEW7QIaIxtoiLwMZVjo3Lfr2Qv4uIn9lbIR0F7s39+qFlzvDx+6JbstJsv
+5wPjTS9og3WfpBDaOecHM/nP8v1H9ilx8/EW0nM3jlS0q0Gj9whkha0Pcl156Bga
+biLDoQk7uTccO8Wiyddwfq6tlYy1OAIMqDy0vmoz4L/3FHJUqrzO/fdI9VQLlug+
+M2G6qTJHKzmDkvmtxPfTjRFMu+g7L3QEdYCBogfIHS+VoB9a9K/XmoWBg85cWIPw
+Kfjjf7OouqksfOQopxY2+PCQ66nnkN7y13RjoU2heAme8Fexiowkjhzc1lq0Zn0Q
+XPlnvCHAQMNRNmvBLwNEkW+KN4no0TCImOOTuInBrlKGTaBkinUNS39AF9lZWwAE
+hd1kK5zzF6XvZnKXdVIn4MjcW81hcbrnulq5GHz7XY+lwmORYumYo3Gykjj/+G93
+K9HRlSRV1+BNXmPYtI8hvbAYw05+AWKCk0J5r1GQtPx+Tx3sug/2qks26oURgEHc
+ySl4OPJLp2lhKCUkKVP24Tzg/iS1xT/uHQ==
+-----END CERTIFICATE-----)foo";
+
+ const char* PrivateKeyWithIpInSAN = R"foo(-----BEGIN PRIVATE KEY-----
+MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCeAYU/lqVqZBBI
+GqnG2aFefyTngJBY9omS9PJyI5A0VYQwYXUKKKeO7wdZaSw/9YuftmBGnJD633iW
+sGzbt9rP23pb8R6U3NZY53QiZYpTIkeQfjHHD9NH1GUbBYZM85wDc/vt9TyOMGph
+ydZHSToA/+HIr9JqVoHebNYYrcqrMqVyN0RW4uvPfppwadrBgg+pd0FWzI/vDkb1
+zlQtYdVt7RMYor2m4xSC4F8G+lhumTYIPE9tM3R+LhHOHdr+lymOJ8+AKmAx2sfa
+KrN10zk6NAZXepu6IqYxo06DKqqSQ99qW58UjU/1xAqbDamf1DLXEH9x6ANixDmT
+oPyp39ZqLBMMNrL29AqjBn7McR3oQmhSUwlpHXfBk0P97fOcba3eQnHam+/KPudN
+/R+BpH5HMQCGUHu7IjS21CfnUesETMycNhjHABxCKMzmFQ4MMjk/0N4GijIOANyo
+tse7ZAontSppgHJxAlg0Ycxvx4P0XZ2KgC+oP5u2d28Pd61G8FzbnVY9ZbOTD6Mm
+LUwArWQF57/zwQXfikfkWf/0+nQ+wfc8wjIiLCB3pj8xN17FgeiNQKl79gfExxC4
+CfH6DekYaOGENLdMI4XDNIYoH0moh8KoXwoKHOccThmvD5RBE1kL3E9zkQLpKYzN
+tkG2ZgN7izfzEdQyW8DR6omD4hWdcwIDAQABAoICADzT/QZD6p6QsyvvB9lDwznr
+3Ls65Vc6YjAvGH8UbdmX6nHtsu8cQ5VlNAEZ2i0tTHlJ7rqAX9gU3Am3FdFocFaA
++hQXOVy5v9MuF6l+SchDdCWOT3+A+ie2/s1uTQum5TL3Hc+4D3316Z6H43RCHpBv
+8e4esfS6JPkKEUoi7dkGgGb+G9MPPRT+elo4hjzk4z6saH0P94Fij7LlocZu2Yme
+MTHUxQpQdX8E/dBj5FN/rCtzfGhf3MMO3U/qcnp8m0Tc0qdWqP3IahP1SG1dybQ8
+fwyCaR05ZZ3KbtlUPaJdes8pQo7Y8CV/OU4D7n9XY9MjyMyDM3p8bGYHHf4P7C0M
+qdTYAVXZ9NvKlf87J8zMJ4YDiKTMLdgFjgnj/tYJ9PkUZHgfsk1KSr5IT6wpLBAx
+jEs0+WsbQRmtlJ93ZvZsDJyGZbkeCRIAxyz/eN2Rf56YGrWZcPcn8yrAsnt4nYqz
+ewjM9wu6jB8bfAgDS0y3kPsl1www+AkRDnNQ9s+Vw5x0nccjbV7fdezkwf04cA6N
+QL+0WSALsU0iGGPKrLA5L/kC3W650xSeOgINdvCnZsSEPAF6HQ/E5udd9HD5+7Ma
+hVl2S7FbEVxKgXpXPd1GFBKZKnUTCB5erMDyaN7jAiaVBtRE8qc0hQRhHCtE7qNT
+HvWkztmzBuVGTpOkBQuRAoIBAQDDIsOMkYo/svV/lsUJM4fVMTVJ354ThhxvFdJs
+rlaUEX2mZIsbzjI76yuOsu6nlGKLuiYVfAAV3HNEhNrSnp6+3NPXMgSsE33TFRPR
+Y6P1oT/ZE8YrBkndSioU1ad9Z0ClRNhDlP2c9xCBGpXUSQLt/4C2Nk/wgG/wy7gG
++hJ2ybn133DPpwcx1KQCpslF+VaECPLrpjxWCFEGInOV8gVvxhEb7hrD8qmUPlAR
+3WYFT6/RJGCJ7BeOvXWYa8AfWRysLfLwnzuoUxl45O7X7eZqPufrhAJyDNgN3c6J
+VgVxNPSSc6mjsY0NyItQZEOXtzRJqnRlmGD2Zd5BJFG7PmIVAoIBAQDPSgFqnFe1
+RM7AtC5wRBLTU/LQo8XV3WPsvQpYaa2+YyPG1bjSMWmdejsy4k+lbUx4VzD+veX7
+ZdSmukYmeGT0pp6Yy7FYYAcZ8Tu+CSAxGH8Bvab+U1oy2Y3++lXdAc0OVjuezVSy
+RbUE97S9MjeFMTKxIg2RkJc4p+Ir0sFn8rC9a0ZqNdcV1BCzJkMB5Y0PbG+afopL
+wS4xIMIy2Jp3Y0CanOW/dl6LnWYdEtWMt0Pi5wFDVVn0/DgGNx0SDG5fKj4rJE4F
+6mezK3kyAf7qI35nf8wm/rL7wL262F4iGZp+OKNFQnaEuKmrUsz/l2GZZkfIIcbI
+pPVaqKbAQEtnAoIBAQCj9V/NirRY1WuFqw8frhahwVj/G09dJEBb7kACZXIFs7SZ
+zL09vcFjqzPMEPiKAhnTQbOiNbB0reiEWATtF65WvIGavUJDu5TreThPpaMsTjKx
+mPXXTM9fimNVYjf7HHiq5O+5yURXURijAc2Gs1os05Q4heYhNCnab7HO2uwMt27y
+8q19LODUs9CjEbTogJp7EnHaIrFrsE00FFp+UP7Ubd4OU8BViF2IW9s3R4njSJN3
+7VLYUHFy1CosycyCCoQW//yyxXiA9GHgvKsa75+9AeIod6D+Z2BaNlbF+mtUNaSS
+MXEGQ7c7L5gvEi/hGGRsyTZH7wL5xZo7reKmq8IJAoIBAHIiaHdAEFcBxOl8DFnK
+UadEgNz6X/LqzJtMV0bpIT5ELi3L/dDWXjXUWIYi8AHBFarpL1QEUX5Dynvm8rs5
+7TR8DbVJ6qMjdKWHGwL+2VfPChd2Sl2cnXyEJ1gulFp1JGfxeTBuFGV4Vjye+0h1
+Pva6aRP5EQmGWI1cev7wM4e9rC0PxRyz+nLNakiKF7kSoMHOTgD+Db26Z2mrhOIk
+O6Di6G55V1M9pL8w8kmt1iF9wwZLdXmSpE5tFZfufrYyXA9QHhz5B3DgaSrRFBFB
+4g8fbfkk9868zOYrcQxRGDukZ1l6bAO1nbZkSx/HHpLY0md5VqrOVjqiAWpilDYk
+8J8CggEAVN7WQIMWzuGBc9Hj6H539eXLnoWgccvYN+GwqclQGKQJdUQrM7Ci3kP/
+Zj00T//jew/vHtxx6U1XUfCIbI5SjujqhbkCkikUMAhozsjlmUlAxKz8689/XFXK
+9bPRRvmKw6p14drk507w6t3uD4E/O3PHeEtrdEeDmY78e01T5zkg90jVq10szUMo
+sxw0PoOG4ktYtCsmwXXPHq9gRtzfOqZT/UNHgnBsLALmWcec2gZLa++M1OnVaqI2
+hTyvWDnxD5oKa7hDSBXTOorcfQVRSaC05HPGMhX+HkfHwfXJBxAE1UC38UMD7x58
+AbE/BnHl1tAmZXLMrHq/4r0wYUjBsA==
+-----END PRIVATE KEY-----)foo";
+
TSslTest()
{
Port = NTesting::GetFreePort();
- Address = Format("localhost:%v", Port);
- AddressWithIp = Format("127.0.0.1:%v", Port);
+ AddressWithHostName = Format("localhost:%v", Port);
+ AddressWithIpV4 = Format("127.0.0.1:%v", Port);
+ AddressWithIpV6 = Format("[::1]:%v", Port);
}
};
@@ -191,7 +309,7 @@ TEST_F(TSslTest, RequiredAndRequiredEncryptionMode)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->EncryptionMode = EEncryptionMode::Required;
auto client = CreateBusClient(clientConfig);
@@ -219,7 +337,7 @@ TEST_F(TSslTest, RequiredAndOptionalEncryptionMode)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->EncryptionMode = EEncryptionMode::Optional;
auto client = CreateBusClient(clientConfig);
@@ -247,7 +365,7 @@ TEST_F(TSslTest, OptionalAndRequiredEncryptionMode)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->EncryptionMode = EEncryptionMode::Required;
auto client = CreateBusClient(clientConfig);
@@ -275,7 +393,7 @@ TEST_F(TSslTest, OptionalAndOptionalEncryptionMode)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->EncryptionMode = EEncryptionMode::Optional;
auto client = CreateBusClient(clientConfig);
@@ -299,7 +417,7 @@ TEST_F(TSslTest, DisabledAndDisabledEncryptionMode)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->EncryptionMode = EEncryptionMode::Disabled;
auto client = CreateBusClient(clientConfig);
@@ -327,7 +445,7 @@ TEST_F(TSslTest, RequiredAndDisabledEncryptionMode)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->EncryptionMode = EEncryptionMode::Disabled;
auto client = CreateBusClient(clientConfig);
@@ -346,7 +464,7 @@ TEST_F(TSslTest, DisabledAndRequiredEncryptionMode)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->EncryptionMode = EEncryptionMode::Required;
auto client = CreateBusClient(clientConfig);
@@ -365,7 +483,7 @@ TEST_F(TSslTest, DisabledAndOptionalEncryptionMode)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->EncryptionMode = EEncryptionMode::Optional;
auto client = CreateBusClient(clientConfig);
@@ -389,7 +507,7 @@ TEST_F(TSslTest, OptionalAndDisabledEncryptionMode)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->EncryptionMode = EEncryptionMode::Disabled;
auto client = CreateBusClient(clientConfig);
@@ -421,7 +539,7 @@ TEST_F(TSslTest, CAVerificationModeFailure)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->EncryptionMode = EEncryptionMode::Required;
clientConfig->VerificationMode = EVerificationMode::Ca;
auto client = CreateBusClient(clientConfig);
@@ -449,7 +567,7 @@ TEST_F(TSslTest, CAVerificationModeSuccess)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->CA = New<NCrypto::TPemBlobConfig>();
clientConfig->CA->Value = CA;
clientConfig->EncryptionMode = EEncryptionMode::Required;
@@ -472,7 +590,7 @@ TEST_F(TSslTest, CAVerificationModeSuccess)
.ThrowOnError();
}
-TEST_F(TSslTest, FullVerificationMode)
+TEST_F(TSslTest, FullVerificationModeByHostName)
{
// Reset ctx in order to unload possibly loaded CA.
TSslContext::Get()->Reset();
@@ -487,7 +605,7 @@ TEST_F(TSslTest, FullVerificationMode)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->EncryptionMode = EEncryptionMode::Required;
clientConfig->VerificationMode = EVerificationMode::Full;
clientConfig->CA = New<NCrypto::TPemBlobConfig>();
@@ -508,54 +626,95 @@ TEST_F(TSslTest, FullVerificationMode)
.ThrowOnError();
}
-TEST_F(TSslTest, FullVerificationAlternativeHostName)
+TEST_F(TSslTest, FullVerificationModeByIpAddress)
{
// Reset ctx in order to unload possibly loaded CA.
TSslContext::Get()->Reset();
- auto serverConfig = TBusServerConfig::CreateTcp(Port);
- serverConfig->EncryptionMode = EEncryptionMode::Required;
- serverConfig->VerificationMode = EVerificationMode::None;
- serverConfig->CertificateChain = New<NCrypto::TPemBlobConfig>();
- serverConfig->CertificateChain->Value = CertChain;
- serverConfig->PrivateKey = New<NCrypto::TPemBlobConfig>();
- serverConfig->PrivateKey->Value = PrivateKey;
- auto server = CreateBusServer(serverConfig);
- server->Start(New<TEmptyBusHandler>());
-
- // Connect via IP.
- auto clientConfig = TBusClientConfig::CreateTcp(AddressWithIp);
- clientConfig->EncryptionMode = EEncryptionMode::Required;
- clientConfig->VerificationMode = EVerificationMode::Full;
- clientConfig->CA = New<NCrypto::TPemBlobConfig>();
- clientConfig->CA->Value = CA;
-
- {
+ // Connect via ipv4 and ipv6 addresses.
+ for (const auto& address : {AddressWithIpV4, AddressWithIpV6}) {
+ auto serverConfig = TBusServerConfig::CreateTcp(Port);
+ serverConfig->EncryptionMode = EEncryptionMode::Required;
+ serverConfig->VerificationMode = EVerificationMode::None;
+ serverConfig->CertificateChain = New<NCrypto::TPemBlobConfig>();
+ serverConfig->CertificateChain->Value = CertChainWithIpInSAN;
+ serverConfig->PrivateKey = New<NCrypto::TPemBlobConfig>();
+ serverConfig->PrivateKey->Value = PrivateKeyWithIpInSAN;
+ auto server = CreateBusServer(serverConfig);
+ server->Start(New<TEmptyBusHandler>());
+
+ auto clientConfig = TBusClientConfig::CreateTcp(address);
+ clientConfig->EncryptionMode = EEncryptionMode::Required;
+ clientConfig->VerificationMode = EVerificationMode::Full;
+ clientConfig->CA = New<NCrypto::TPemBlobConfig>();
+ clientConfig->CA->Value = CAWithIpInSAN;
auto client = CreateBusClient(clientConfig);
+
auto bus = client->CreateBus(New<TEmptyBusHandler>());
- // This test should fail since 127.0.0.1 != localhost.
- EXPECT_THROW_MESSAGE_HAS_SUBSTR(
- bus->GetReadyFuture().Get().ThrowOnError(),
- NYT::TErrorException,
- "Failed to establish TLS/SSL session");
+ // This test should pass since (127.0.0.1 | [::1]) is in SAN.
+ EXPECT_TRUE(bus->GetReadyFuture().Get().IsOK());
+ EXPECT_TRUE(bus->IsEncrypted());
+
+ auto message = CreateMessage(1);
+ auto sendFuture = bus->Send(message, {.TrackingLevel = EDeliveryTrackingLevel::Full});
+ EXPECT_TRUE(sendFuture.Get().IsOK());
+
+ server->Stop()
+ .Get()
+ .ThrowOnError();
}
+}
- // Connect via IP with Alt Hostname.
- clientConfig->PeerAlternativeHostName = "localhost";
- auto client = CreateBusClient(clientConfig);
+TEST_F(TSslTest, FullVerificationByAlternativeHostName)
+{
+ // Reset ctx in order to unload possibly loaded CA.
+ TSslContext::Get()->Reset();
- auto bus = client->CreateBus(New<TEmptyBusHandler>());
- // This test should pass since key pair is issued for CN=localhost.
- EXPECT_NO_THROW(bus->GetReadyFuture().Get().ThrowOnError());
- EXPECT_TRUE(bus->IsEncrypted());
+ for (const auto& address : {AddressWithIpV4, AddressWithIpV6}) {
+ auto serverConfig = TBusServerConfig::CreateTcp(Port);
+ serverConfig->EncryptionMode = EEncryptionMode::Required;
+ serverConfig->VerificationMode = EVerificationMode::None;
+ serverConfig->CertificateChain = New<NCrypto::TPemBlobConfig>();
+ serverConfig->CertificateChain->Value = CertChain;
+ serverConfig->PrivateKey = New<NCrypto::TPemBlobConfig>();
+ serverConfig->PrivateKey->Value = PrivateKey;
+ auto server = CreateBusServer(serverConfig);
+ server->Start(New<TEmptyBusHandler>());
+
+ // Connect via IP.
+ auto clientConfig = TBusClientConfig::CreateTcp(address);
+ clientConfig->EncryptionMode = EEncryptionMode::Required;
+ clientConfig->VerificationMode = EVerificationMode::Full;
+ clientConfig->CA = New<NCrypto::TPemBlobConfig>();
+ clientConfig->CA->Value = CA;
+
+ {
+ auto client = CreateBusClient(clientConfig);
+ auto bus = client->CreateBus(New<TEmptyBusHandler>());
+ // This test should fail since (127.0.0.1 | [::1]) != localhost.
+ EXPECT_THROW_MESSAGE_HAS_SUBSTR(
+ bus->GetReadyFuture().Get().ThrowOnError(),
+ NYT::TErrorException,
+ "Failed to establish TLS/SSL session");
+ }
+
+ // Connect via IP with Alt Hostname.
+ clientConfig->PeerAlternativeHostName = "localhost";
+ auto client = CreateBusClient(clientConfig);
- auto message = CreateMessage(1);
- auto sendFuture = bus->Send(message, {.TrackingLevel = EDeliveryTrackingLevel::Full});
- EXPECT_NO_THROW(sendFuture.Get().ThrowOnError());
+ auto bus = client->CreateBus(New<TEmptyBusHandler>());
+ // This test should pass since key pair is issued for CN=localhost.
+ EXPECT_NO_THROW(bus->GetReadyFuture().Get().ThrowOnError());
+ EXPECT_TRUE(bus->IsEncrypted());
- server->Stop()
- .Get()
- .ThrowOnError();
+ auto message = CreateMessage(1);
+ auto sendFuture = bus->Send(message, {.TrackingLevel = EDeliveryTrackingLevel::Full});
+ EXPECT_NO_THROW(sendFuture.Get().ThrowOnError());
+
+ server->Stop()
+ .Get()
+ .ThrowOnError();
+ }
}
TEST_F(TSslTest, ServerCipherList)
@@ -571,7 +730,7 @@ TEST_F(TSslTest, ServerCipherList)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->EncryptionMode = EEncryptionMode::Required;
clientConfig->VerificationMode = EVerificationMode::None;
auto client = CreateBusClient(clientConfig);
@@ -605,7 +764,7 @@ TEST_F(TSslTest, DifferentCipherLists)
auto server = CreateBusServer(serverConfig);
server->Start(New<TEmptyBusHandler>());
- auto clientConfig = TBusClientConfig::CreateTcp(Address);
+ auto clientConfig = TBusClientConfig::CreateTcp(AddressWithHostName);
clientConfig->EncryptionMode = EEncryptionMode::Required;
clientConfig->VerificationMode = EVerificationMode::None;
clientConfig->CipherList = "AES128-GCM-SHA256";
diff --git a/yt/yt/core/compression/dictionary_codec.h b/yt/yt/core/compression/dictionary_codec.h
index 8205fa2c505..a394d452e61 100644
--- a/yt/yt/core/compression/dictionary_codec.h
+++ b/yt/yt/core/compression/dictionary_codec.h
@@ -35,7 +35,7 @@ struct IDictionaryDecompressor
: public TRefCounted
{
//! Decompresses #input into #ouput.
- //! Memory for output must be pre-allocated, its size can be infered from frame info.
+ //! Memory for output must be pre-allocated, its size can be inferred from frame info.
virtual void Decompress(
TRef input,
TMutableRef output) = 0;
@@ -73,13 +73,15 @@ DEFINE_REFCOUNTED_TYPE(IDigestedDecompressionDictionary)
struct IDictionaryCompressionCodec
{
+ virtual ~IDictionaryCompressionCodec() = default;
+
virtual int GetMinDictionarySize() const = 0;
virtual int GetMaxCompressionLevel() const = 0;
virtual int GetDefaultCompressionLevel() const = 0;
//! Trains compression dictionary of size not exceeding #dictionarySize.
- //! This dicionary may then be digested for (de)compression.
+ //! This dictionary may then be digested for (de)compression.
//! NB: May return null if training failed, e.g. due to lack of #samples
//! or no sufficient profit from using dictionary on them.
virtual TErrorOr<TSharedRef> TrainCompressionDictionary(
diff --git a/yt/yt/core/compression/zstd.cpp b/yt/yt/core/compression/zstd.cpp
index a22b4b682ae..e24a076938f 100644
--- a/yt/yt/core/compression/zstd.cpp
+++ b/yt/yt/core/compression/zstd.cpp
@@ -225,7 +225,7 @@ class TDigestedCompressionDictionary
, private TNonCopyable
{
public:
- TDigestedCompressionDictionary(ZSTD_CDict* digestedDictionary)
+ explicit TDigestedCompressionDictionary(ZSTD_CDict* digestedDictionary)
: DigestedDictionary_(digestedDictionary)
{
YT_VERIFY(DigestedDictionary_);
@@ -261,7 +261,7 @@ class TDigestedDecompressionDictionary
, private TNonCopyable
{
public:
- TDigestedDecompressionDictionary(ZSTD_DDict* digestedDictionary)
+ explicit TDigestedDecompressionDictionary(ZSTD_DDict* digestedDictionary)
: DigestedDictionary_(digestedDictionary)
{
YT_VERIFY(DigestedDictionary_);
@@ -459,11 +459,9 @@ TErrorOr<TSharedRef> ZstdTrainCompressionDictionary(i64 dictionarySize, const st
sampleSizes.data(),
sampleSizes.size());
if (ZSTD_isError(resultDictionarySize)) {
- auto error = TError("Compression dictionary training failed")
+ return TError("Compression dictionary training failed")
<< TErrorAttribute("zstd_error_code", static_cast<int>(ZSTD_getErrorCode(resultDictionarySize)))
<< TErrorAttribute("zstd_error_name", ZSTD_getErrorName(resultDictionarySize));
- YT_LOG_DEBUG(error);
- return error;
}
YT_VERIFY(resultDictionarySize <= dictionary.Size());
diff --git a/yt/yt/core/concurrency/async_semaphore.cpp b/yt/yt/core/concurrency/async_semaphore.cpp
index b5555ed6e0d..38ec2ccffe1 100644
--- a/yt/yt/core/concurrency/async_semaphore.cpp
+++ b/yt/yt/core/concurrency/async_semaphore.cpp
@@ -33,7 +33,7 @@ void TAsyncSemaphore::Release(i64 slots)
auto guard = WriterGuard(SpinLock_);
FreeSlots_ += slots;
- YT_ASSERT(FreeSlots_ <= TotalSlots_);
+ YT_VERIFY(FreeSlots_ <= TotalSlots_);
if (Releasing_) {
return;
@@ -67,8 +67,8 @@ void TAsyncSemaphore::Release(i64 slots)
}
for (const auto& waiter : waitersToRelease) {
- // NB: This may lead to a reentrant invocation of Release if the invoker discards the callback.
- waiter.Handler(TAsyncSemaphoreGuard(this, waiter.Slots));
+ // NB: This may lead to a reentrant invocation of Release if the invoker discards the subscriber.
+ waiter.Promise.TrySet(TAsyncSemaphoreGuard(this, waiter.Slots));
}
if (readyEventToSet) {
@@ -77,15 +77,17 @@ void TAsyncSemaphore::Release(i64 slots)
}
}
-void TAsyncSemaphore::Acquire(i64 slots /* = 1 */)
+bool TAsyncSemaphore::Acquire(i64 slots)
{
YT_VERIFY(slots >= 0);
auto guard = WriterGuard(SpinLock_);
FreeSlots_ -= slots;
+
+ return FreeSlots_ >= 0;
}
-bool TAsyncSemaphore::TryAcquire(i64 slots /*= 1*/)
+bool TAsyncSemaphore::TryAcquire(i64 slots)
{
YT_VERIFY(slots >= 0);
@@ -97,19 +99,18 @@ bool TAsyncSemaphore::TryAcquire(i64 slots /*= 1*/)
return true;
}
-void TAsyncSemaphore::AsyncAcquire(
- const TCallback<void(TAsyncSemaphoreGuard)>& handler,
- i64 slots)
+TFuture<TAsyncSemaphoreGuard> TAsyncSemaphore::AsyncAcquire(i64 slots)
{
YT_VERIFY(slots >= 0);
auto guard = WriterGuard(SpinLock_);
if (FreeSlots_ >= slots) {
FreeSlots_ -= slots;
- guard.Release();
- handler(TAsyncSemaphoreGuard(this, slots));
+ return MakeFuture(TAsyncSemaphoreGuard(this, slots));
} else {
- Waiters_.push(TWaiter{handler, slots});
+ auto promise = NewPromise<TAsyncSemaphoreGuard>();
+ Waiters_.push(TWaiter{promise, slots});
+ return promise.ToFuture();
}
}
@@ -170,19 +171,22 @@ TProfiledAsyncSemaphore::TProfiledAsyncSemaphore(
, Gauge_(std::move(gauge))
{ }
-void TProfiledAsyncSemaphore::Release(i64 slots /* = 1 */)
+void TProfiledAsyncSemaphore::Release(i64 slots)
{
TAsyncSemaphore::Release(slots);
Profile();
}
-void TProfiledAsyncSemaphore::Acquire(i64 slots /* = 1 */)
+bool TProfiledAsyncSemaphore::Acquire(i64 slots)
{
- TAsyncSemaphore::Acquire(slots);
+ auto result = TAsyncSemaphore::Acquire(slots);
+
Profile();
+
+ return result;
}
-bool TProfiledAsyncSemaphore::TryAcquire(i64 slots /* = 1 */)
+bool TProfiledAsyncSemaphore::TryAcquire(i64 slots)
{
if (TAsyncSemaphore::TryAcquire(slots)) {
Profile();
diff --git a/yt/yt/core/concurrency/async_semaphore.h b/yt/yt/core/concurrency/async_semaphore.h
index 7f6d646b134..a409cf00c7a 100644
--- a/yt/yt/core/concurrency/async_semaphore.h
+++ b/yt/yt/core/concurrency/async_semaphore.h
@@ -44,7 +44,6 @@ private:
TAsyncSemaphoreGuard(TAsyncSemaphorePtr semaphore, i64 slots);
void MoveFrom(TAsyncSemaphoreGuard&& other);
-
};
////////////////////////////////////////////////////////////////////////////////
@@ -64,17 +63,15 @@ public:
//! Acquires a given number of slots.
//! Cannot fail, may lead to an overcommit.
- virtual void Acquire(i64 slots = 1);
+ //! Returns whether overcommit happened.
+ virtual bool Acquire(i64 slots = 1);
//! Tries to acquire a given number of slots.
//! Returns |true| on success (the number of remaining slots is non-negative).
virtual bool TryAcquire(i64 slots = 1);
- //! Runs #handler when a given number of slots becomes available.
- //! These slots are immediately captured by TAsyncSemaphoreGuard instance passed to #handler.
- void AsyncAcquire(
- const TCallback<void(TAsyncSemaphoreGuard)>& handler,
- i64 slots = 1);
+ //! Returns a future that becomes set when a given number of slots becomes available and acquired.
+ TFuture<TAsyncSemaphoreGuard> AsyncAcquire(i64 slots = 1);
//! Returns |true| iff at least one slot is free.
bool IsReady() const;
@@ -104,7 +101,7 @@ private:
struct TWaiter
{
- TCallback<void(TAsyncSemaphoreGuard)> Handler;
+ TPromise<TAsyncSemaphoreGuard> Promise;
i64 Slots;
};
@@ -124,7 +121,7 @@ public:
NProfiling::TGauge gauge);
void Release(i64 slots = 1) override;
- void Acquire(i64 slots = 1) override;
+ bool Acquire(i64 slots = 1) override;
bool TryAcquire(i64 slots = 1) override;
private:
diff --git a/yt/yt/core/concurrency/unittests/scheduler_ut.cpp b/yt/yt/core/concurrency/unittests/scheduler_ut.cpp
index 80bf31e5971..9424918fa01 100644
--- a/yt/yt/core/concurrency/unittests/scheduler_ut.cpp
+++ b/yt/yt/core/concurrency/unittests/scheduler_ut.cpp
@@ -1042,15 +1042,15 @@ TEST_W(TSchedulerTest, TraceDisableSendBaggage)
parentContext->PackBaggage(parentBaggage);
auto parentBaggageString = ConvertToYsonString(parentBaggage);
- auto originalConfig = GetTracingConfig();
+ auto originalConfig = GetTracingTransportConfig();
auto guard = Finally([&] {
- SetTracingConfig(originalConfig);
+ SetTracingTransportConfig(originalConfig);
});
{
- auto config = New<TTracingConfig>();
+ auto config = New<TTracingTransportConfig>();
config->SendBaggage = true;
- SetTracingConfig(std::move(config));
+ SetTracingTransportConfig(std::move(config));
NTracing::NProto::TTracingExt tracingExt;
ToProto(&tracingExt, parentContext);
auto traceContext = TTraceContext::NewChildFromRpc(tracingExt, "Span");
@@ -1060,9 +1060,9 @@ TEST_W(TSchedulerTest, TraceDisableSendBaggage)
}
{
- auto config = New<TTracingConfig>();
+ auto config = New<TTracingTransportConfig>();
config->SendBaggage = false;
- SetTracingConfig(std::move(config));
+ SetTracingTransportConfig(std::move(config));
NTracing::NProto::TTracingExt tracingExt;
ToProto(&tracingExt, parentContext);
auto traceContext = TTraceContext::NewChildFromRpc(tracingExt, "Span");
diff --git a/yt/yt/core/crypto/tls.cpp b/yt/yt/core/crypto/tls.cpp
index a79a0c94588..96a5d244573 100644
--- a/yt/yt/core/crypto/tls.cpp
+++ b/yt/yt/core/crypto/tls.cpp
@@ -34,11 +34,18 @@ static const TLogger Logger{"Tls"};
namespace {
-TErrorAttribute GetLastSslError()
+TErrorAttribute GetOpenSSLErrors()
{
- char errorStr[256];
- ERR_error_string_n(ERR_get_error(), errorStr, sizeof(errorStr));
- return TErrorAttribute("ssl_error", TString(errorStr));
+ TString errorStr;
+ ERR_print_errors_cb([](const char* str, size_t len, void* ctx) {
+ TString& out = *reinterpret_cast<TString*>(ctx);
+ if (!out.empty()) {
+ out += ", ";
+ }
+ out.append(str, len);
+ return 1;
+ }, &errorStr);
+ return TErrorAttribute("ssl_error", errorStr);
}
constexpr auto TlsBufferSize = 1_MB;
@@ -54,35 +61,78 @@ struct TSslContextImpl
TSslContextImpl()
{
+ Reset();
+ }
+
+ ~TSslContextImpl()
+ {
+ if (Ctx) {
+ SSL_CTX_free(Ctx);
+ }
+ if (ActiveCtx_) {
+ SSL_CTX_free(ActiveCtx_);
+ }
+ }
+
+ void Reset()
+ {
+ if (Ctx) {
+ SSL_CTX_free(Ctx);
+ }
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
Ctx = SSL_CTX_new(TLS_method());
if (!Ctx) {
THROW_ERROR_EXCEPTION("SSL_CTX_new(TLS_method()) failed")
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
if (SSL_CTX_set_min_proto_version(Ctx, TLS1_2_VERSION) == 0) {
THROW_ERROR_EXCEPTION("SSL_CTX_set_min_proto_version failed")
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
if (SSL_CTX_set_max_proto_version(Ctx, TLS1_2_VERSION) == 0) {
THROW_ERROR_EXCEPTION("SSL_CTX_set_max_proto_version failed")
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
#else
Ctx = SSL_CTX_new(TLSv1_2_method());
if (!Ctx) {
THROW_ERROR_EXCEPTION("SSL_CTX_new(TLSv1_2_method()) failed")
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
#endif
}
- ~TSslContextImpl()
+ void Commit()
{
- if (Ctx) {
- SSL_CTX_free(Ctx);
+ SSL_CTX* oldCtx;
+ YT_ASSERT(Ctx);
+ {
+ auto guard = WriterGuard(Lock_);
+ oldCtx = ActiveCtx_;
+ ActiveCtx_ = Ctx;
+ Ctx = nullptr;
+ }
+ if (oldCtx) {
+ SSL_CTX_free(oldCtx);
}
}
+
+ SSL* NewSsl()
+ {
+ auto guard = ReaderGuard(Lock_);
+ YT_ASSERT(ActiveCtx_);
+ return SSL_new(ActiveCtx_);
+ }
+
+ bool IsActive(const SSL* ssl)
+ {
+ auto guard = ReaderGuard(Lock_);
+ return SSL_get_SSL_CTX(ssl) == ActiveCtx_;
+ }
+
+private:
+ YT_DECLARE_SPIN_LOCK(NThreading::TReaderWriterSpinLock, Lock_);
+ SSL_CTX* ActiveCtx_ = nullptr;
};
DEFINE_REFCOUNTED_TYPE(TSslContextImpl)
@@ -104,10 +154,10 @@ public:
, Invoker_(CreateSerializedInvoker(poller->GetInvoker(), "crypto_tls_connection"))
, Underlying_(std::move(connection))
{
- Ssl_ = SSL_new(Ctx_->Ctx);
+ Ssl_ = Ctx_->NewSsl();
if (!Ssl_) {
THROW_ERROR_EXCEPTION("SSL_new failed")
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
InputBIO_ = BIO_new(BIO_s_mem());
@@ -124,6 +174,11 @@ public:
OutputBuffer_ = TSharedMutableRef::Allocate<TTlsBufferTag>(TlsBufferSize);
}
+ void SetHost(const TString& host)
+ {
+ SSL_set_tlsext_host_name(Ssl_, host.c_str());
+ }
+
~TTlsConnection()
{
SSL_free(Ssl_);
@@ -418,7 +473,7 @@ private:
MaybeStartUnderlyingIO(true);
} else {
Error_ = TError("SSL_do_handshake failed")
- << GetLastSslError();
+ << GetOpenSSLErrors();
YT_LOG_DEBUG(Error_, "TLS handshake failed");
CheckError();
return;
@@ -437,7 +492,7 @@ private:
if (count < 0) {
Error_ = TError("SSL_write failed")
- << GetLastSslError();
+ << GetOpenSSLErrors();
YT_LOG_DEBUG(Error_, "TLS write failed");
CheckError();
return;
@@ -469,7 +524,7 @@ private:
MaybeStartUnderlyingIO(true);
} else {
Error_ = TError("SSL_read failed")
- << GetLastSslError();
+ << GetOpenSSLErrors();
YT_LOG_DEBUG(Error_, "TLS read failed");
CheckError();
return;
@@ -496,12 +551,16 @@ public:
, Poller_(std::move(poller))
{ }
- TFuture<IConnectionPtr> Dial(const TNetworkAddress& remote) override
+ TFuture<IConnectionPtr> Dial(const TNetworkAddress& remote, TRemoteContextPtr context) override
{
- return Underlying_->Dial(remote).Apply(BIND([ctx = Ctx_, poller = Poller_] (const IConnectionPtr& underlying) -> IConnectionPtr {
- auto connection = New<TTlsConnection>(ctx, poller, underlying);
- connection->StartClient();
- return connection;
+ return Underlying_->Dial(remote)
+ .Apply(BIND([ctx = Ctx_, poller = Poller_, context = std::move(context)](const IConnectionPtr& underlying) -> IConnectionPtr {
+ auto connection = New<TTlsConnection>(ctx, poller, underlying);
+ if (context != nullptr && context->Host != std::nullopt) {
+ connection->SetHost(*(context->Host));
+ }
+ connection->StartClient();
+ return connection;
}));
}
@@ -558,6 +617,22 @@ TSslContext::TSslContext()
: Impl_(New<TSslContextImpl>())
{ }
+void TSslContext::Reset()
+{
+ Impl_->Reset();
+}
+
+void TSslContext::Commit(TInstant time)
+{
+ CommitTime_ = time;
+ Impl_->Commit();
+}
+
+TInstant TSslContext::GetCommitTime()
+{
+ return CommitTime_;
+}
+
void TSslContext::UseBuiltinOpenSslX509Store()
{
SSL_CTX_set_cert_store(Impl_->Ctx, GetBuiltinOpenSslX509Store().Release());
@@ -568,7 +643,7 @@ void TSslContext::SetCipherList(const TString& list)
if (SSL_CTX_set_cipher_list(Impl_->Ctx, list.data()) == 0) {
THROW_ERROR_EXCEPTION("SSL_CTX_set_cipher_list failed")
<< TErrorAttribute("cipher_list", list)
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
}
@@ -577,7 +652,7 @@ void TSslContext::AddCertificateFromFile(const TString& path)
if (SSL_CTX_use_certificate_file(Impl_->Ctx, path.c_str(), SSL_FILETYPE_PEM) != 1) {
THROW_ERROR_EXCEPTION("SSL_CTX_use_certificate_file failed")
<< TErrorAttribute("path", path)
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
}
@@ -586,7 +661,7 @@ void TSslContext::AddCertificateChainFromFile(const TString& path)
if (SSL_CTX_use_certificate_chain_file(Impl_->Ctx, path.c_str()) != 1) {
THROW_ERROR_EXCEPTION("SSL_CTX_use_certificate_chain_file failed")
<< TErrorAttribute("path", path)
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
}
@@ -595,7 +670,7 @@ void TSslContext::AddPrivateKeyFromFile(const TString& path)
if (SSL_CTX_use_PrivateKey_file(Impl_->Ctx, path.c_str(), SSL_FILETYPE_PEM) != 1) {
THROW_ERROR_EXCEPTION("SSL_CTX_use_PrivateKey_file failed")
<< TErrorAttribute("path", path)
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
}
@@ -610,7 +685,7 @@ void TSslContext::AddCertificateChain(const TString& certificateChain)
auto certificateObject = PEM_read_bio_X509_AUX(bio, nullptr, nullptr, nullptr);
if (!certificateObject) {
THROW_ERROR_EXCEPTION("PEM_read_bio_X509_AUX failed")
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
auto freeCertificate = Finally([&] {
X509_free(certificateObject);
@@ -618,7 +693,7 @@ void TSslContext::AddCertificateChain(const TString& certificateChain)
if (SSL_CTX_use_certificate(Impl_->Ctx, certificateObject) != 1) {
THROW_ERROR_EXCEPTION("SSL_CTX_use_certificate failed")
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
SSL_CTX_clear_chain_certs(Impl_->Ctx);
@@ -632,14 +707,14 @@ void TSslContext::AddCertificateChain(const TString& certificateChain)
}
THROW_ERROR_EXCEPTION("PEM_read_bio_X509")
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
int result = SSL_CTX_add0_chain_cert(Impl_->Ctx, chainCertificateObject);
if (!result) {
X509_free(chainCertificateObject);
THROW_ERROR_EXCEPTION("SSL_CTX_add0_chain_cert")
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
}
}
@@ -655,7 +730,7 @@ void TSslContext::AddCertificate(const TString& certificate)
auto certificateObject = PEM_read_bio_X509_AUX(bio, nullptr, nullptr, nullptr);
if (!certificateObject) {
THROW_ERROR_EXCEPTION("PEM_read_bio_X509_AUX")
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
auto freeCertificate = Finally([&] {
X509_free(certificateObject);
@@ -663,7 +738,7 @@ void TSslContext::AddCertificate(const TString& certificate)
if (SSL_CTX_use_certificate(Impl_->Ctx, certificateObject) != 1) {
THROW_ERROR_EXCEPTION("SSL_CTX_use_certificate failed")
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
}
@@ -678,7 +753,7 @@ void TSslContext::AddPrivateKey(const TString& privateKey)
auto privateKeyObject = PEM_read_bio_PrivateKey(bio, nullptr, nullptr, nullptr);
if (!privateKeyObject) {
THROW_ERROR_EXCEPTION("PEM_read_bio_PrivateKey failed")
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
auto freePrivateKey = Finally([&] {
EVP_PKEY_free(privateKeyObject);
@@ -686,7 +761,7 @@ void TSslContext::AddPrivateKey(const TString& privateKey)
if (SSL_CTX_use_PrivateKey(Impl_->Ctx, privateKeyObject) != 1) {
THROW_ERROR_EXCEPTION("SSL_CTX_use_PrivateKey failed")
- << GetLastSslError();
+ << GetOpenSSLErrors();
}
}
diff --git a/yt/yt/core/crypto/tls.h b/yt/yt/core/crypto/tls.h
index 5844d3f0215..bb9f85503f5 100644
--- a/yt/yt/core/crypto/tls.h
+++ b/yt/yt/core/crypto/tls.h
@@ -20,6 +20,10 @@ class TSslContext
public:
TSslContext();
+ void Reset();
+ void Commit(TInstant time = TInstant::Zero());
+ TInstant GetCommitTime();
+
void UseBuiltinOpenSslX509Store();
void SetCipherList(const TString& list);
@@ -48,6 +52,7 @@ public:
private:
const TIntrusivePtr<TSslContextImpl> Impl_;
+ TInstant CommitTime_;
};
DEFINE_REFCOUNTED_TYPE(TSslContext)
diff --git a/yt/yt/core/crypto/unittests/tls_ut.cpp b/yt/yt/core/crypto/unittests/tls_ut.cpp
index 2981b24350f..288994abaff 100644
--- a/yt/yt/core/crypto/unittests/tls_ut.cpp
+++ b/yt/yt/core/crypto/unittests/tls_ut.cpp
@@ -37,6 +37,7 @@ public:
Context->AddCertificate(TestCertificate);
Context->AddPrivateKey(TestCertificate);
+ Context->Commit();
Poller = CreateThreadPoolPoller(2, "TlsTest");
}
@@ -78,7 +79,10 @@ TEST_F(TTlsTest, SimplePingPong)
config->SetDefaults();
auto dialer = Context->CreateDialer(config, Poller, NetLogger);
- auto asyncFirstSide = dialer->Dial(listener->GetAddress());
+ auto context = New<TRemoteContext>();
+ context->Host = "localhost";
+
+ auto asyncFirstSide = dialer->Dial(listener->GetAddress(), context);
auto asyncSecondSide = listener->Accept();
auto firstSide = asyncFirstSide.Get().ValueOrThrow();
@@ -106,6 +110,7 @@ TEST(TTlsTestWithoutFixture, LoadCertificateChain)
auto grpcLock = NRpc::NGrpc::TDispatcher::Get()->GetLibraryLock();
auto context = New<TSslContext>();
context->AddCertificateChain(TestCertificateChain);
+ context->Commit();
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/core/http/client.cpp b/yt/yt/core/http/client.cpp
index 49ab4286f77..f133c102917 100644
--- a/yt/yt/core/http/client.cpp
+++ b/yt/yt/core/http/client.cpp
@@ -126,11 +126,15 @@ private:
return TNetworkAddress(address, parsedUrl.Port.value_or(GetDefaultPort(parsedUrl)));
}
- std::pair<THttpOutputPtr, THttpInputPtr> OpenHttp(const TNetworkAddress& address)
+ std::pair<THttpOutputPtr, THttpInputPtr> OpenHttp(const TUrlRef& urlRef)
{
+ auto context = New<TRemoteContext>();
+ context->Host = urlRef.Host;
+ auto address = GetAddress(urlRef);
+
// TODO(aleexfi): Enable connection pool by default
if (Config_->MaxIdleConnections == 0) {
- auto connection = WaitFor(Dialer_->Dial(address)).ValueOrThrow();
+ auto connection = WaitFor(Dialer_->Dial(address, std::move(context))).ValueOrThrow();
auto input = New<THttpInput>(
connection,
@@ -146,7 +150,7 @@ private:
return {std::move(output), std::move(input)};
} else {
- auto connection = WaitFor(ConnectionPool_->Connect(address)).ValueOrThrow();
+ auto connection = WaitFor(ConnectionPool_->Connect(address, std::move(context))).ValueOrThrow();
auto reuseSharedState = New<NDetail::TReusableConnectionState>(connection, ConnectionPool_);
@@ -239,8 +243,8 @@ private:
THttpInputPtr response;
auto urlRef = ParseUrl(url);
- auto address = GetAddress(urlRef);
- std::tie(request, response) = OpenHttp(address);
+
+ std::tie(request, response) = OpenHttp(urlRef);
request->SetHost(urlRef.Host, urlRef.PortStr);
if (headers) {
@@ -266,27 +270,40 @@ private:
}));
}
- TFuture<IResponsePtr> Request(
+ IResponsePtr DoRequest(
EMethod method,
const TString& url,
const std::optional<TSharedRef>& body,
- const THeadersPtr& headers)
+ const THeadersPtr& headers,
+ int redirectCount = 0)
{
- return WrapError(url, BIND([=, this, this_ = MakeStrong(this)] {
- auto [request, response] = StartAndWriteHeaders(method, url, headers);
+ auto [request, response] = StartAndWriteHeaders(method, url, headers);
- if (body) {
- WaitFor(request->WriteBody(*body))
- .ThrowOnError();
- } else {
- WaitFor(request->Close())
- .ThrowOnError();
- }
+ if (body) {
+ WaitFor(request->WriteBody(*body))
+ .ThrowOnError();
+ } else {
+ WaitFor(request->Close())
+ .ThrowOnError();
+ }
+
+ // Waits for response headers internally.
+ auto redirectUrl = response->TryGetRedirectUrl();
+ if (redirectUrl && redirectCount < Config_->MaxRedirectCount) {
+ return DoRequest(method, *redirectUrl, body, headers, redirectCount + 1);
+ }
- // Waits for response headers internally.
- response->GetStatusCode();
+ return IResponsePtr(response);
+ }
- return IResponsePtr(response);
+ TFuture<IResponsePtr> Request(
+ EMethod method,
+ const TString& url,
+ const std::optional<TSharedRef>& body,
+ const THeadersPtr& headers)
+ {
+ return WrapError(url, BIND([=, this, this_ = MakeStrong(this)] {
+ return DoRequest(method, url, body, headers);
}));
}
};
diff --git a/yt/yt/core/http/config.cpp b/yt/yt/core/http/config.cpp
index 0497c153275..2ef4635792f 100644
--- a/yt/yt/core/http/config.cpp
+++ b/yt/yt/core/http/config.cpp
@@ -11,6 +11,9 @@ void THttpIOConfig::Register(TRegistrar registrar)
registrar.Parameter("read_buffer_size", &TThis::ReadBufferSize)
.Default(128_KB);
+ registrar.Parameter("max_redirect_count", &TThis::MaxRedirectCount)
+ .Default(0);
+
registrar.Parameter("connection_idle_timeout", &TThis::ConnectionIdleTimeout)
.Default(TDuration::Minutes(5));
diff --git a/yt/yt/core/http/config.h b/yt/yt/core/http/config.h
index 937f99a29a8..65d297d473a 100644
--- a/yt/yt/core/http/config.h
+++ b/yt/yt/core/http/config.h
@@ -16,6 +16,8 @@ class THttpIOConfig
public:
int ReadBufferSize;
+ int MaxRedirectCount;
+
TDuration ConnectionIdleTimeout;
TDuration HeaderReadTimeout;
diff --git a/yt/yt/core/http/connection_pool.cpp b/yt/yt/core/http/connection_pool.cpp
index 9cb971b8ab5..3684bda5912 100644
--- a/yt/yt/core/http/connection_pool.cpp
+++ b/yt/yt/core/http/connection_pool.cpp
@@ -52,7 +52,9 @@ TConnectionPool::~TConnectionPool()
YT_UNUSED_FUTURE(ExpiredConnectionsCollector_->Stop());
}
-TFuture<IConnectionPtr> TConnectionPool::Connect(const TNetworkAddress& address)
+TFuture<IConnectionPtr> TConnectionPool::Connect(
+ const TNetworkAddress& address,
+ TRemoteContextPtr context)
{
{
auto guard = Guard(SpinLock_);
@@ -64,7 +66,7 @@ TFuture<IConnectionPtr> TConnectionPool::Connect(const TNetworkAddress& address)
}
}
- return Dialer_->Dial(address);
+ return Dialer_->Dial(address, std::move(context));
}
void TConnectionPool::Release(const IConnectionPtr& connection)
diff --git a/yt/yt/core/http/connection_pool.h b/yt/yt/core/http/connection_pool.h
index b7c06245bd2..026626967f5 100644
--- a/yt/yt/core/http/connection_pool.h
+++ b/yt/yt/core/http/connection_pool.h
@@ -38,7 +38,9 @@ public:
~TConnectionPool();
- TFuture<NNet::IConnectionPtr> Connect(const NNet::TNetworkAddress& address);
+ TFuture<NNet::IConnectionPtr> Connect(
+ const NNet::TNetworkAddress& address,
+ NNet::TRemoteContextPtr context = nullptr);
void Release(const NNet::IConnectionPtr& connection);
diff --git a/yt/yt/core/http/helpers.cpp b/yt/yt/core/http/helpers.cpp
index fd96bd5c3f8..52e56c0dfab 100644
--- a/yt/yt/core/http/helpers.cpp
+++ b/yt/yt/core/http/helpers.cpp
@@ -162,6 +162,7 @@ static const auto HeadersWhitelist = JoinSeq(", ", std::vector<TString>{
"Content-Type",
"Accept",
"Cache-Control",
+ "Request-Timeout",
"X-Csrf-Token",
"X-YT-Parameters",
"X-YT-Parameters0",
diff --git a/yt/yt/core/http/stream.cpp b/yt/yt/core/http/stream.cpp
index 4820919f1fd..485903b1940 100644
--- a/yt/yt/core/http/stream.cpp
+++ b/yt/yt/core/http/stream.cpp
@@ -523,6 +523,25 @@ void THttpInput::MaybeLogSlowProgress()
}
}
+bool THttpInput::IsRedirectCode(EStatusCode code) const
+{
+ return code == EStatusCode::MovedPermanently || code == EStatusCode::Found ||
+ code == EStatusCode::SeeOther || code == EStatusCode::UseProxy ||
+ code == EStatusCode::TemporaryRedirect || code == EStatusCode::PermanentRedirect;
+}
+
+std::optional<TString> THttpInput::TryGetRedirectUrl()
+{
+ EnsureHeadersReceived();
+ if (IsRedirectCode(GetStatusCode())) {
+ auto url = Headers_->Find("Location");
+ if (url) {
+ return *url;
+ }
+ }
+ return std::nullopt;
+}
+
////////////////////////////////////////////////////////////////////////////////
THttpOutput::THttpOutput(
diff --git a/yt/yt/core/http/stream.h b/yt/yt/core/http/stream.h
index 44783c1013a..b01da702f16 100644
--- a/yt/yt/core/http/stream.h
+++ b/yt/yt/core/http/stream.h
@@ -129,6 +129,8 @@ public:
int GetPort() const override;
void SetPort(int port);
+ std::optional<TString> TryGetRedirectUrl();
+
private:
const NNet::IConnectionPtr Connection_;
const NNet::TNetworkAddress RemoteAddress_;
@@ -166,6 +168,8 @@ private:
TSharedRef DoRead();
void MaybeLogSlowProgress();
+
+ bool IsRedirectCode(EStatusCode code) const;
};
DEFINE_REFCOUNTED_TYPE(THttpInput)
diff --git a/yt/yt/core/https/client.cpp b/yt/yt/core/https/client.cpp
index 2f4b415b89e..8ce559a5832 100644
--- a/yt/yt/core/https/client.cpp
+++ b/yt/yt/core/https/client.cpp
@@ -120,6 +120,7 @@ IClientPtr CreateClient(
} else {
sslContext->UseBuiltinOpenSslX509Store();
}
+ sslContext->Commit();
auto tlsDialer = sslContext->CreateDialer(
New<TDialerConfig>(),
diff --git a/yt/yt/core/https/config.cpp b/yt/yt/core/https/config.cpp
index 49c59d5258e..c41fde96241 100644
--- a/yt/yt/core/https/config.cpp
+++ b/yt/yt/core/https/config.cpp
@@ -10,6 +10,8 @@ void TServerCredentialsConfig::Register(TRegistrar registrar)
.Optional();
registrar.Parameter("cert_chain", &TThis::CertChain)
.Optional();
+ registrar.Parameter("update_period", &TThis::UpdatePeriod)
+ .Optional();
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/core/https/config.h b/yt/yt/core/https/config.h
index fe4decc26ea..eb6f010008d 100644
--- a/yt/yt/core/https/config.h
+++ b/yt/yt/core/https/config.h
@@ -16,6 +16,7 @@ class TServerCredentialsConfig
public:
NCrypto::TPemBlobConfigPtr PrivateKey;
NCrypto::TPemBlobConfigPtr CertChain;
+ TDuration UpdatePeriod;
REGISTER_YSON_STRUCT(TServerCredentialsConfig);
diff --git a/yt/yt/core/https/server.cpp b/yt/yt/core/https/server.cpp
index e53f132c040..96fd1553907 100644
--- a/yt/yt/core/https/server.cpp
+++ b/yt/yt/core/https/server.cpp
@@ -2,15 +2,23 @@
#include "config.h"
#include <yt/yt/core/http/server.h>
+#include <yt/yt/core/http/private.h>
#include <yt/yt/core/crypto/tls.h>
+#include <yt/yt/core/logging/log.h>
+
+#include <yt/yt/core/misc/fs.h>
+
#include <yt/yt/core/net/address.h>
#include <yt/yt/core/concurrency/poller.h>
+#include <yt/yt/core/concurrency/periodic_executor.h>
namespace NYT::NHttps {
+static const auto& Logger = NHttp::HttpLogger;
+
using namespace NNet;
using namespace NHttp;
using namespace NCrypto;
@@ -22,8 +30,9 @@ class TServer
: public IServer
{
public:
- explicit TServer(IServerPtr underlying)
+ explicit TServer(IServerPtr underlying, TPeriodicExecutorPtr certificateUpdater)
: Underlying_(std::move(underlying))
+ , CertificateUpdater_(certificateUpdater)
{ }
void AddHandler(
@@ -42,12 +51,18 @@ public:
void Start() override
{
Underlying_->Start();
+ if (CertificateUpdater_) {
+ CertificateUpdater_->Start();
+ }
}
//! Stops the server.
void Stop() override
{
Underlying_->Stop();
+ if (CertificateUpdater_) {
+ YT_UNUSED_FUTURE(CertificateUpdater_->Stop());
+ }
}
void SetPathMatcher(const IRequestPathMatcherPtr& matcher) override
@@ -62,28 +77,66 @@ public:
private:
const IServerPtr Underlying_;
+ const TPeriodicExecutorPtr CertificateUpdater_;
};
-IServerPtr CreateServer(
- const TServerConfigPtr& config,
- const IPollerPtr& poller,
- const IPollerPtr& acceptor)
+static void ApplySslConfig(const TSslContextPtr& sslContext, const TServerCredentialsConfigPtr& sslConfig)
{
- auto sslContext = New<TSslContext>();
- if (config->Credentials->CertChain->FileName) {
- sslContext->AddCertificateChainFromFile(*config->Credentials->CertChain->FileName);
- } else if (config->Credentials->CertChain->Value) {
- sslContext->AddCertificateChain(*config->Credentials->CertChain->Value);
+ if (sslConfig->CertChain->FileName) {
+ sslContext->AddCertificateChainFromFile(*sslConfig->CertChain->FileName);
+ } else if (sslConfig->CertChain->Value) {
+ sslContext->AddCertificateChain(*sslConfig->CertChain->Value);
} else {
YT_ABORT();
}
- if (config->Credentials->PrivateKey->FileName) {
- sslContext->AddPrivateKeyFromFile(*config->Credentials->PrivateKey->FileName);
- } else if (config->Credentials->PrivateKey->Value) {
- sslContext->AddPrivateKey(*config->Credentials->PrivateKey->Value);
+ if (sslConfig->PrivateKey->FileName) {
+ sslContext->AddPrivateKeyFromFile(*sslConfig->PrivateKey->FileName);
+ } else if (sslConfig->PrivateKey->Value) {
+ sslContext->AddPrivateKey(*sslConfig->PrivateKey->Value);
} else {
YT_ABORT();
}
+}
+
+IServerPtr CreateServer(
+ const TServerConfigPtr& config,
+ const IPollerPtr& poller,
+ const IPollerPtr& acceptor)
+{
+ auto sslContext = New<TSslContext>();
+ ApplySslConfig(sslContext, config->Credentials);
+ sslContext->Commit();
+
+ auto sslConfig = config->Credentials;
+ TPeriodicExecutorPtr certificateUpdater;
+ if (sslConfig->UpdatePeriod &&
+ sslConfig->CertChain->FileName &&
+ sslConfig->PrivateKey->FileName)
+ {
+ certificateUpdater = New<TPeriodicExecutor>(
+ poller->GetInvoker(),
+ BIND([=, serverName = config->ServerName] {
+ try {
+ auto modificationTime = Max(
+ NFS::GetPathStatistics(*sslConfig->CertChain->FileName).ModificationTime,
+ NFS::GetPathStatistics(*sslConfig->PrivateKey->FileName).ModificationTime);
+
+ // Detect fresh and stable updates.
+ if (modificationTime > sslContext->GetCommitTime() &&
+ modificationTime + sslConfig->UpdatePeriod <= TInstant::Now())
+ {
+ YT_LOG_INFO("Updating TLS certificates (ServerName: %v, ModificationTime: %v)", serverName, modificationTime);
+ sslContext->Reset();
+ ApplySslConfig(sslContext, sslConfig);
+ sslContext->Commit(modificationTime);
+ YT_LOG_INFO("TLS certificates updated (ServerName: %v)", serverName);
+ }
+ } catch (const std::exception& ex) {
+ YT_LOG_WARNING(ex, "Unexpected exception while updating TLS certificates (ServerName: %v)", serverName);
+ }
+ }),
+ sslConfig->UpdatePeriod);
+ }
auto address = TNetworkAddress::CreateIPv6Any(config->Port);
auto tlsListener = sslContext->CreateListener(address, poller, acceptor);
@@ -92,7 +145,7 @@ IServerPtr CreateServer(
configCopy->IsHttps = true;
auto httpServer = NHttp::CreateServer(configCopy, tlsListener, poller, acceptor);
- return New<TServer>(std::move(httpServer));
+ return New<TServer>(std::move(httpServer), std::move(certificateUpdater));
}
IServerPtr CreateServer(const TServerConfigPtr& config, const IPollerPtr& poller)
diff --git a/yt/yt/core/logging/config.cpp b/yt/yt/core/logging/config.cpp
index 81694f3d6ff..213f9baf799 100644
--- a/yt/yt/core/logging/config.cpp
+++ b/yt/yt/core/logging/config.cpp
@@ -92,7 +92,8 @@ void TLogWriterConfig::Register(TRegistrar registrar)
.Default();
registrar.Parameter("enable_source_location", &TThis::EnableSourceLocation)
.Default(false);
- registrar.Parameter("enable_instant", &TThis::EnableInstant)
+ registrar.Parameter("enable_system_fields", &TThis::EnableSystemFields)
+ .Alias("enable_instant")
.Default(true);
registrar.Parameter("json_format", &TThis::JsonFormat)
.Default();
diff --git a/yt/yt/core/logging/config.h b/yt/yt/core/logging/config.h
index 5dbebb21cc2..8053d36dbed 100644
--- a/yt/yt/core/logging/config.h
+++ b/yt/yt/core/logging/config.h
@@ -89,10 +89,8 @@ public:
//! Plain text formatter options.
bool EnableSourceLocation;
- //! Enable writing instant field.
- bool EnableInstant;
-
//! Structured formatter options.
+ bool EnableSystemFields;
THashMap<TString, NYTree::INodePtr> CommonFields;
NJson::TJsonFormatConfigPtr JsonFormat;
diff --git a/yt/yt/core/logging/formatter.cpp b/yt/yt/core/logging/formatter.cpp
index 75a3c4f5be1..7c468c16b76 100644
--- a/yt/yt/core/logging/formatter.cpp
+++ b/yt/yt/core/logging/formatter.cpp
@@ -153,12 +153,12 @@ TStructuredLogFormatter::TStructuredLogFormatter(
THashMap<TString, NYTree::INodePtr> commonFields,
bool enableSystemMessages,
bool enableSourceLocation,
- bool enableInstant,
+ bool enableSystemFields,
NJson::TJsonFormatConfigPtr jsonFormat)
: TLogFormatterBase(enableSystemMessages, enableSourceLocation)
, Format_(format)
, CommonFields_(std::move(commonFields))
- , EnableInstant_(enableInstant)
+ , EnableSystemFields_(enableSystemFields)
, JsonFormat_(!jsonFormat && (Format_ == ELogFormat::Json)
? New<NJson::TJsonFormatConfig>()
: std::move(jsonFormat))
@@ -199,11 +199,12 @@ i64 TStructuredLogFormatter::WriteFormatted(IOutputStream* stream, const TLogEve
.DoIf(event.MessageKind == ELogMessageKind::Unstructured, [&] (auto fluent) {
fluent.Item("message").Value(event.MessageRef.ToStringBuf());
})
- .DoIf(EnableInstant_, [&] (auto fluent) {
- fluent.Item("instant").Value(dateTimeBuffer.GetBuffer());
+ .DoIf(EnableSystemFields_, [&] (auto fluent) {
+ fluent
+ .Item("instant").Value(dateTimeBuffer.GetBuffer())
+ .Item("level").Value(FormatEnum(event.Level))
+ .Item("category").Value(event.Category->Name);
})
- .Item("level").Value(FormatEnum(event.Level))
- .Item("category").Value(event.Category->Name)
.DoIf(event.Family == ELogFamily::PlainText, [&] (auto fluent) {
if (event.FiberId != TFiberId()) {
fluent.Item("fiber_id").Value(Format("%x", event.FiberId));
diff --git a/yt/yt/core/logging/formatter.h b/yt/yt/core/logging/formatter.h
index e4d41cf7196..70913773f84 100644
--- a/yt/yt/core/logging/formatter.h
+++ b/yt/yt/core/logging/formatter.h
@@ -69,7 +69,7 @@ public:
THashMap<TString, NYTree::INodePtr> commonFields,
bool enableSystemMessages = true,
bool enableSourceLocation = false,
- bool enableInstant = true,
+ bool enableSystemFields = true,
NJson::TJsonFormatConfigPtr jsonFormat = nullptr);
i64 WriteFormatted(IOutputStream* outputStream, const TLogEvent& event) override;
@@ -80,7 +80,7 @@ public:
private:
const ELogFormat Format_;
const THashMap<TString, NYTree::INodePtr> CommonFields_;
- const bool EnableInstant_;
+ const bool EnableSystemFields_;
const NJson::TJsonFormatConfigPtr JsonFormat_;
TCachingDateFormatter CachingDateFormatter_;
diff --git a/yt/yt/core/logging/log_manager.cpp b/yt/yt/core/logging/log_manager.cpp
index b31e28df5af..1481e4053da 100644
--- a/yt/yt/core/logging/log_manager.cpp
+++ b/yt/yt/core/logging/log_manager.cpp
@@ -852,7 +852,7 @@ private:
writerConfig->CommonFields,
writerConfig->AreSystemMessagesEnabled(),
writerConfig->EnableSourceLocation,
- writerConfig->EnableInstant,
+ writerConfig->EnableSystemFields,
writerConfig->JsonFormat);
default:
diff --git a/yt/yt/core/logging/unittests/logging_ut.cpp b/yt/yt/core/logging/unittests/logging_ut.cpp
index fd0bf73423e..9448c56b9bc 100644
--- a/yt/yt/core/logging/unittests/logging_ut.cpp
+++ b/yt/yt/core/logging/unittests/logging_ut.cpp
@@ -659,7 +659,7 @@ TEST_F(TLoggingTest, StructuredLoggingJsonFormat)
/*commonFields*/ THashMap<TString, INodePtr>{},
/*enableControlMessages*/ true,
/*enableSourceLocation*/ false,
- /*enableInstant*/ true,
+ /*enableSystemFields*/ true,
jsonFormat);
auto writer = CreateFileLogWriter(
@@ -763,6 +763,36 @@ TEST_F(TLoggingTest, StructuredValidationWithSamplingRate)
EXPECT_GT(counter, 0);
}
+TEST_F(TLoggingTest, StructuredLoggingDisableSystemFields)
+{
+ TLogEvent event;
+ event.Family = ELogFamily::Structured;
+ event.Category = Logger.GetCategory();
+ event.Level = ELogLevel::Debug;
+ event.MessageRef = BuildYsonStringFluently<EYsonType::MapFragment>()
+ .Item("message").Value("test_message")
+ .Finish()
+ .ToSharedRef();
+ event.MessageKind = ELogMessageKind::Structured;
+
+ auto formatter = std::make_unique<TStructuredLogFormatter>(
+ ELogFormat::Yson,
+ /*commonFields*/ THashMap<TString, INodePtr>{},
+ /*enableControlMessages*/ true,
+ /*enableSourceLocation*/ false,
+ /*enableSystemFields*/ false);
+
+ TStringStream stringStream;
+ formatter->WriteFormatted(&stringStream, event);
+
+ auto message = DeserializeStructuredEvent(stringStream.Str(), ELogFormat::Yson);
+ EXPECT_EQ(message->GetChildOrThrow("message")->AsString()->GetValue(), "test_message");
+
+ EXPECT_EQ(message->FindChild("instant"), nullptr);
+ EXPECT_EQ(message->FindChild("level"), nullptr);
+ EXPECT_EQ(message->FindChild("category"), nullptr);
+}
+
////////////////////////////////////////////////////////////////////////////////
class TBuiltinRotationTest
diff --git a/yt/yt/core/misc/arithmetic_formula.cpp b/yt/yt/core/misc/arithmetic_formula.cpp
index b8a4f733926..6aa84df4656 100644
--- a/yt/yt/core/misc/arithmetic_formula.cpp
+++ b/yt/yt/core/misc/arithmetic_formula.cpp
@@ -12,6 +12,8 @@
#include <util/generic/hash.h>
+#include <algorithm>
+
namespace NYT {
using namespace NYson;
@@ -31,11 +33,8 @@ bool IsSymbolAllowedInName(char c, EEvaluationContext context, bool isFirst)
if (std::isalpha(c) || c == '_') {
return true;
}
- if (isFirst) {
- return false;
- }
if (std::isdigit(c)) {
- return true;
+ return !isFirst || context == EEvaluationContext::Boolean;
}
if (context == EEvaluationContext::Boolean && extraAllowedBooleanVariableTokens.contains(c)) {
return true;
@@ -49,11 +48,16 @@ void ValidateFormulaVariable(const TString& variable, EEvaluationContext context
THROW_ERROR_EXCEPTION("Variable should not be empty");
}
for (char c : variable) {
- if (!IsSymbolAllowedInName(c, context, false)) {
+ if (!IsSymbolAllowedInName(c, context, /*isFirst*/ false)) {
THROW_ERROR_EXCEPTION("Invalid character %Qv in variable %Qv", c, variable);
}
}
- if (!IsSymbolAllowedInName(variable[0], context, true)) {
+ if (context == EEvaluationContext::Boolean) {
+ if (std::all_of(variable.begin(), variable.end(), [] (char c) {return std::isdigit(c);})) {
+ THROW_ERROR_EXCEPTION("All digits characters are prohibited for boolean variable %Qv", variable);
+ }
+ }
+ if (!IsSymbolAllowedInName(variable[0], context, /*isFirst*/ true)) {
THROW_ERROR_EXCEPTION("Invalid first character in variable %Qv", variable);
}
if (variable == "in") {
@@ -416,7 +420,7 @@ std::vector<TFormulaToken> TGenericFormulaImpl::Tokenize(const TString& formula,
char second = pos + 1 < formula.size() ? formula[pos + 1] : '\0';
if (first == 'i' && second == 'n') {
char third = pos + 2 < formula.size() ? formula[pos + 2] : '\0';
- if (IsSymbolAllowedInName(third, context, false)) {
+ if (IsSymbolAllowedInName(third, context, /*isFirst*/ false)) {
return std::nullopt;
} else {
pos += 2;
@@ -523,9 +527,10 @@ std::vector<TFormulaToken> TGenericFormulaImpl::Tokenize(const TString& formula,
auto extractVariable = [&] {
TString name;
- while (pos < formula.size() && IsSymbolAllowedInName(formula[pos], context, name.empty())) {
+ while (pos < formula.size() && IsSymbolAllowedInName(formula[pos], context, /*isFirst*/ name.empty())) {
name += formula[pos++];
}
+ ValidateFormulaVariable(name, context);
return name;
};
@@ -564,7 +569,7 @@ std::vector<TFormulaToken> TGenericFormulaImpl::Tokenize(const TString& formula,
TFormulaToken token;
token.Position = pos;
- if (std::isdigit(c) || (c == '-' && !expectBinaryOperator)) {
+ if (context == EEvaluationContext::Arithmetic && (std::isdigit(c) || (c == '-' && !expectBinaryOperator))) {
token.Type = EFormulaTokenType::Number;
token.Number = extractNumber();
expectBinaryOperator = true;
diff --git a/yt/yt/core/misc/atomic_ptr-inl.h b/yt/yt/core/misc/atomic_ptr-inl.h
index 6d57b1e4c73..021c82318bf 100644
--- a/yt/yt/core/misc/atomic_ptr-inl.h
+++ b/yt/yt/core/misc/atomic_ptr-inl.h
@@ -204,15 +204,15 @@ TAtomicPtr<T, EnableAcquireHazard>::operator bool() const
////////////////////////////////////////////////////////////////////////////////
template <class T, bool EnableAcquireHazard>
-bool operator==(const TAtomicPtr<T, EnableAcquireHazard>& lhs, const TIntrusivePtr<T>& rhs)
+bool operator==(const TAtomicPtr<T, EnableAcquireHazard>& lhs, const T* rhs)
{
- return lhs.Ptr_.load() == rhs.Get();
+ return lhs.Ptr_.load() == rhs;
}
template <class T, bool EnableAcquireHazard>
-bool operator==(const TIntrusivePtr<T>& lhs, const TAtomicPtr<T, EnableAcquireHazard>& rhs)
+bool operator==(const T* lhs, const TAtomicPtr<T, EnableAcquireHazard>& rhs)
{
- return lhs.Get() == rhs.Ptr_.load();
+ return lhs == rhs.Ptr_.load();
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/core/misc/atomic_ptr.h b/yt/yt/core/misc/atomic_ptr.h
index fe158982735..0fd38487b56 100644
--- a/yt/yt/core/misc/atomic_ptr.h
+++ b/yt/yt/core/misc/atomic_ptr.h
@@ -57,10 +57,10 @@ private:
explicit TAtomicPtr(T* ptr);
template <class T_, bool EnableAcquireHazard_>
- friend bool operator==(const TAtomicPtr<T_, EnableAcquireHazard_>& lhs, const TIntrusivePtr<T_>& rhs);
+ friend bool operator==(const TAtomicPtr<T_, EnableAcquireHazard_>& lhs, const T_* rhs);
template <class T_, bool EnableAcquireHazard_>
- friend bool operator==(const TIntrusivePtr<T_>& lhs, const TAtomicPtr<T_, EnableAcquireHazard_>& rhs);
+ friend bool operator==(const T_* lhs, const TAtomicPtr<T_, EnableAcquireHazard_>& rhs);
std::atomic<T*> Ptr_ = nullptr;
diff --git a/yt/yt/core/misc/concurrent_cache-inl.h b/yt/yt/core/misc/concurrent_cache-inl.h
index f6ca30b6ab2..8fe3021148f 100644
--- a/yt/yt/core/misc/concurrent_cache-inl.h
+++ b/yt/yt/core/misc/concurrent_cache-inl.h
@@ -25,14 +25,15 @@ struct TConcurrentCache<T>::TLookupTable final
, Capacity(capacity)
{ }
- bool Insert(TValuePtr item)
+ typename THashTable::TItemRef Insert(TValuePtr item)
{
auto fingerprint = THash<T>()(item.Get());
- if (THashTable::Insert(fingerprint, std::move(item))) {
+ auto result = THashTable::Insert(fingerprint, std::move(item));
+
+ if (result) {
++Size;
- return true;
}
- return false;
+ return result;
}
};
@@ -40,7 +41,7 @@ template <class T>
TIntrusivePtr<typename TConcurrentCache<T>::TLookupTable>
TConcurrentCache<T>::RenewTable(const TIntrusivePtr<TLookupTable>& head, size_t capacity)
{
- if (head != Head_) {
+ if (head.Get() != Head_) {
return Head_.Acquire();
}
@@ -207,6 +208,12 @@ void TConcurrentCache<T>::SetCapacity(size_t capacity)
}
}
+template <class T>
+bool TConcurrentCache<T>::IsHead(const TIntrusivePtr<TLookupTable>& head) const
+{
+ return Head_ == head.Get();
+}
+
/////////////////////////////////////////////////////////////////////////////
} // namespace NYT
diff --git a/yt/yt/core/misc/concurrent_cache.h b/yt/yt/core/misc/concurrent_cache.h
index 158a358eefc..7f0f52054ee 100644
--- a/yt/yt/core/misc/concurrent_cache.h
+++ b/yt/yt/core/misc/concurrent_cache.h
@@ -91,6 +91,8 @@ public:
void SetCapacity(size_t capacity);
+ bool IsHead(const TIntrusivePtr<TLookupTable>& head) const;
+
private:
std::atomic<size_t> Capacity_;
TAtomicPtr<TLookupTable> Head_;
diff --git a/yt/yt/core/misc/error.h b/yt/yt/core/misc/error.h
index 0d2b4bd456a..76a5dac28c9 100644
--- a/yt/yt/core/misc/error.h
+++ b/yt/yt/core/misc/error.h
@@ -1,10 +1,8 @@
#pragma once
#include "public.h"
-#include "property.h"
-#include "optional.h"
-#include <yt/yt/core/yson/string.h>
+#include <yt/yt/core/yson/public.h>
#include <yt/yt/core/ytree/public.h>
@@ -14,7 +12,12 @@
#include <yt/yt/core/threading/public.h>
+#include <library/cpp/yt/yson/public.h>
+
#include <library/cpp/yt/yson_string/convert.h>
+#include <library/cpp/yt/yson_string/string.h>
+
+#include <library/cpp/yt/misc/property.h>
#include <util/system/getpid.h>
diff --git a/yt/yt/core/misc/lock_free_hash_table-inl.h b/yt/yt/core/misc/lock_free_hash_table-inl.h
index 4f36d33831f..09d04035fda 100644
--- a/yt/yt/core/misc/lock_free_hash_table-inl.h
+++ b/yt/yt/core/misc/lock_free_hash_table-inl.h
@@ -49,8 +49,10 @@ size_t TLockFreeHashTable<T>::GetByteSize() const
}
template <class T>
-bool TLockFreeHashTable<T>::Insert(TFingerprint fingerprint, TValuePtr value)
+typename TLockFreeHashTable<T>::TItemRef TLockFreeHashTable<T>::Insert(TFingerprint fingerprint, TValuePtr value)
{
+ using TItemRef = typename TLockFreeHashTable<T>::TItemRef;
+
auto index = IndexFromFingerprint(fingerprint) % Size_;
auto stamp = StampFromFingerprint(fingerprint);
@@ -68,7 +70,7 @@ bool TLockFreeHashTable<T>::Insert(TFingerprint fingerprint, TValuePtr value)
std::memory_order::acquire);
if (success) {
value.Release();
- return true;
+ return TItemRef(&HashTable_[index]);
}
}
@@ -78,7 +80,7 @@ bool TLockFreeHashTable<T>::Insert(TFingerprint fingerprint, TValuePtr value)
}, ValueFromEntry(tableEntry));
if (TEqualTo<T>()(item.Get(), value.Get())) {
- return false;
+ return TItemRef(nullptr);
}
++index;
@@ -88,7 +90,7 @@ bool TLockFreeHashTable<T>::Insert(TFingerprint fingerprint, TValuePtr value)
--probeCount;
}
- return false;
+ return TItemRef(nullptr);
}
template <class T>
@@ -140,6 +142,7 @@ typename TLockFreeHashTable<T>::TItemRef TLockFreeHashTable<T>::FindRef(TFingerp
for (size_t probeCount = Size_; probeCount != 0;) {
auto tableEntry = HashTable_[index].load(std::memory_order::relaxed);
+ // TODO(lukyan): Rename to entryStamp.
auto tableStamp = StampFromEntry(tableEntry);
if (tableStamp == 0) {
@@ -179,16 +182,18 @@ typename TLockFreeHashTable<T>::TStamp
template <class T>
T* TLockFreeHashTable<T>::ValueFromEntry(TEntry entry)
{
- return reinterpret_cast<T*>(entry & ((1ULL << ValueLog) - 1));
+ constexpr auto Mask = (1ULL << ValueLog) - 1;
+ return reinterpret_cast<T*>(entry & (Mask ^ 1ULL));
}
template <class T>
typename TLockFreeHashTable<T>::TEntry
- TLockFreeHashTable<T>::MakeEntry(TStamp stamp, T* value)
+ TLockFreeHashTable<T>::MakeEntry(TStamp stamp, T* value, bool sealed)
{
YT_ASSERT(stamp != 0);
+ YT_ASSERT((reinterpret_cast<TEntry>(value) & 1ULL) == 0);
YT_ASSERT(StampFromEntry(reinterpret_cast<TEntry>(value)) == 0);
- return (static_cast<TEntry>(stamp) << ValueLog) | reinterpret_cast<TEntry>(value);
+ return (static_cast<TEntry>(stamp) << ValueLog) | reinterpret_cast<TEntry>(value) | (sealed ? 1ULL : 0ULL);
}
template <class T>
diff --git a/yt/yt/core/misc/lock_free_hash_table.h b/yt/yt/core/misc/lock_free_hash_table.h
index b837dc1811e..78d74822611 100644
--- a/yt/yt/core/misc/lock_free_hash_table.h
+++ b/yt/yt/core/misc/lock_free_hash_table.h
@@ -51,20 +51,20 @@ public:
return TValuePtr(item.Get());
}
- //! Updates existing element.
- void Update(TValuePtr value)
+ //! Replace existing element.
+ void Replace(TValuePtr value, bool sealed = true)
{
// Fingerprint must be equal.
auto stamp = StampFromEntry(Entry_->load(std::memory_order::acquire));
- auto entry = MakeEntry(stamp, value.Release());
+ auto entry = MakeEntry(stamp, value.Release(), sealed);
// TODO(lukyan): Keep dereferenced value and update via CAS.
auto oldEntry = Entry_->exchange(entry);
DeleteEntry(oldEntry);
}
- bool Update(TValuePtr value, const T* expected)
+ bool Replace(TValuePtr value, const T* expected, bool sealed = true)
{
if (value.Get() == expected) {
return false;
@@ -78,7 +78,7 @@ public:
return false;
}
- auto entry = MakeEntry(stamp, value.Get());
+ auto entry = MakeEntry(stamp, value.Get(), sealed);
if (!Entry_->compare_exchange_strong(currentEntry, entry)) {
return false;
@@ -89,6 +89,18 @@ public:
return true;
}
+ void SealItem()
+ {
+ auto oldValue = Entry_->fetch_add(1);
+ YT_VERIFY(!(oldValue & 1));
+ }
+
+ bool IsSealed() const
+ {
+ auto currentEntry = Entry_->load(std::memory_order::acquire);
+ return currentEntry & 1ULL;
+ }
+
private:
std::atomic<TEntry>* Entry_ = nullptr;
@@ -107,7 +119,7 @@ public:
size_t GetByteSize() const;
//! Inserts element. Called concurrently from multiple threads.
- bool Insert(TFingerprint fingerprint, TValuePtr value);
+ typename TLockFreeHashTable<T>::TItemRef Insert(TFingerprint fingerprint, TValuePtr value);
template <class TKey>
TIntrusivePtr<T> Find(TFingerprint fingerprint, const TKey& key);
@@ -126,7 +138,7 @@ private:
static T* ValueFromEntry(TEntry entry);
- static TEntry MakeEntry(TStamp stamp, T* value);
+ static TEntry MakeEntry(TStamp stamp, T* value, bool sealed = false);
static size_t IndexFromFingerprint(TFingerprint fingerprint);
diff --git a/yt/yt/core/misc/serialize-inl.h b/yt/yt/core/misc/serialize-inl.h
index dd39441912d..926fa3d3c1b 100644
--- a/yt/yt/core/misc/serialize-inl.h
+++ b/yt/yt/core/misc/serialize-inl.h
@@ -7,6 +7,8 @@
#include "collection_helpers.h"
#include "maybe_inf.h"
+#include <yt/yt/core/yson/string.h>
+
#include <library/cpp/yt/small_containers/compact_vector.h>
#include <library/cpp/yt/small_containers/compact_flat_map.h>
#include <library/cpp/yt/small_containers/compact_set.h>
@@ -1981,4 +1983,3 @@ struct TSerializerTraits<TMaybeInf<T>, C, void>
////////////////////////////////////////////////////////////////////////////////
} // namespace NYT
-
diff --git a/yt/yt/core/misc/unittests/boolean_formula_ut.cpp b/yt/yt/core/misc/unittests/boolean_formula_ut.cpp
index c4faaecca06..0bae531297b 100644
--- a/yt/yt/core/misc/unittests/boolean_formula_ut.cpp
+++ b/yt/yt/core/misc/unittests/boolean_formula_ut.cpp
@@ -148,8 +148,9 @@ TEST(TBooleanFormulaTest, ValidateVariable)
ValidateBooleanFormulaVariable("tablet_common/news-queue");
ValidateBooleanFormulaVariable("VAR123VAR");
ValidateBooleanFormulaVariable("IN");
+ ValidateBooleanFormulaVariable("2var");
- EXPECT_THROW(ValidateBooleanFormulaVariable("2var"), TErrorException);
+ EXPECT_THROW(ValidateBooleanFormulaVariable("2"), TErrorException);
EXPECT_THROW(ValidateBooleanFormulaVariable("foo bar"), TErrorException);
EXPECT_THROW(ValidateBooleanFormulaVariable(""), TErrorException);
EXPECT_THROW(ValidateBooleanFormulaVariable("a+b"), TErrorException);
diff --git a/yt/yt/core/misc/unittests/concurrent_cache_ut.cpp b/yt/yt/core/misc/unittests/concurrent_cache_ut.cpp
index af1e1ceef4e..26dc973c8ef 100644
--- a/yt/yt/core/misc/unittests/concurrent_cache_ut.cpp
+++ b/yt/yt/core/misc/unittests/concurrent_cache_ut.cpp
@@ -112,7 +112,7 @@ TEST_P(TConcurrentCacheTest, Stress)
if (!foundRef) {
auto value = NewWithExtraSpace<TElement>(&allocator, columnCount);
memcpy(value.Get(), key, sizeof(TElement) + columnCount);
- bool inserted = inserter.GetTable()->Insert(std::move(value));
+ auto inserted = static_cast<bool>(inserter.GetTable()->Insert(std::move(value)));
insertCount += inserted;
} else if (reinsert) {
diff --git a/yt/yt/core/misc/unittests/lock_free_hash_table_ut.cpp b/yt/yt/core/misc/unittests/lock_free_hash_table_ut.cpp
index 6c196f1bcea..6ff4d148c02 100644
--- a/yt/yt/core/misc/unittests/lock_free_hash_table_ut.cpp
+++ b/yt/yt/core/misc/unittests/lock_free_hash_table_ut.cpp
@@ -121,7 +121,7 @@ TEST(TLockFreeHashTableTest, Simple)
auto fingerprint = hash(item.Get());
auto foundRef = table.FindRef(fingerprint, item.Get());
EXPECT_TRUE(static_cast<bool>(foundRef));
- foundRef.Update(item);
+ foundRef.Replace(item);
}
for (const auto& item : checkTable) {
diff --git a/yt/yt/core/net/dialer.cpp b/yt/yt/core/net/dialer.cpp
index 1a23091b91f..c27489d23b8 100644
--- a/yt/yt/core/net/dialer.cpp
+++ b/yt/yt/core/net/dialer.cpp
@@ -85,7 +85,9 @@ public:
, Poller_(std::move(poller))
{ }
- TFuture<IConnectionPtr> Dial(const TNetworkAddress& remote) override
+ TFuture<IConnectionPtr> Dial(
+ const TNetworkAddress& remote,
+ TRemoteContextPtr /*context*/) override
{
auto session = New<TDialSession>(
remote,
diff --git a/yt/yt/core/net/dialer.h b/yt/yt/core/net/dialer.h
index b5a6ce3b2a8..8dbd67cc43e 100644
--- a/yt/yt/core/net/dialer.h
+++ b/yt/yt/core/net/dialer.h
@@ -14,12 +14,25 @@ namespace NYT::NNet {
////////////////////////////////////////////////////////////////////////////////
+//! Сontext that is passed to the Dialer.
+
+struct TRemoteContext
+ : public TRefCounted
+{
+ //! Host is used for TlsDialer.
+ std::optional<TString> Host;
+};
+
+DEFINE_REFCOUNTED_TYPE(TRemoteContext)
+
//! Dialer establishes connection to a (resolved) network address.
struct IDialer
: public virtual TRefCounted
{
- virtual TFuture<IConnectionPtr> Dial(const TNetworkAddress& remote) = 0;
+ virtual TFuture<IConnectionPtr> Dial(
+ const TNetworkAddress& remote,
+ TRemoteContextPtr context = nullptr) = 0;
};
DEFINE_REFCOUNTED_TYPE(IDialer)
diff --git a/yt/yt/core/net/mock/dialer.cpp b/yt/yt/core/net/mock/dialer.cpp
index 6e30a087a5f..4b3582b1b5e 100644
--- a/yt/yt/core/net/mock/dialer.cpp
+++ b/yt/yt/core/net/mock/dialer.cpp
@@ -7,7 +7,7 @@ namespace NYT::NNet {
TDialerMock::TDialerMock(IDialerPtr underlying)
: Underlying_(std::move(underlying))
{
- ON_CALL(*this, Dial).WillByDefault([this] (const TNetworkAddress& address) {
+ ON_CALL(*this, Dial).WillByDefault([this] (const TNetworkAddress& address, TRemoteContextPtr /*context*/) {
return Underlying_->Dial(address);
});
}
diff --git a/yt/yt/core/net/mock/dialer.h b/yt/yt/core/net/mock/dialer.h
index 707a7b3dadd..10a9237f09a 100644
--- a/yt/yt/core/net/mock/dialer.h
+++ b/yt/yt/core/net/mock/dialer.h
@@ -14,7 +14,7 @@ class TDialerMock
public:
explicit TDialerMock(IDialerPtr underlying);
- MOCK_METHOD(TFuture<IConnectionPtr>, Dial, (const TNetworkAddress& remote), (override));
+ MOCK_METHOD(TFuture<IConnectionPtr>, Dial, (const TNetworkAddress& remote, TRemoteContextPtr context), (override));
private:
const IDialerPtr Underlying_;
diff --git a/yt/yt/core/net/public.h b/yt/yt/core/net/public.h
index 05d3ec03de1..42566ad7faf 100644
--- a/yt/yt/core/net/public.h
+++ b/yt/yt/core/net/public.h
@@ -17,6 +17,7 @@ DECLARE_REFCOUNTED_STRUCT(IPacketConnection)
DECLARE_REFCOUNTED_STRUCT(IConnectionReader)
DECLARE_REFCOUNTED_STRUCT(IConnectionWriter)
DECLARE_REFCOUNTED_STRUCT(IListener)
+DECLARE_REFCOUNTED_STRUCT(TRemoteContext)
DECLARE_REFCOUNTED_STRUCT(IDialer)
DECLARE_REFCOUNTED_STRUCT(IAsyncDialer)
DECLARE_REFCOUNTED_STRUCT(IAsyncDialerSession)
diff --git a/yt/yt/core/rpc/config.cpp b/yt/yt/core/rpc/config.cpp
index cd0d4a28a55..e715e9b4e40 100644
--- a/yt/yt/core/rpc/config.cpp
+++ b/yt/yt/core/rpc/config.cpp
@@ -98,12 +98,15 @@ void TMethodConfig::Register(TRegistrar registrar)
registrar.Parameter("queue_size_limit", &TThis::QueueSizeLimit)
.Alias("max_queue_size")
.Optional();
- registrar.Parameter("queue_bytes_size_limit", &TThis::QueueBytesSizeLimit)
- .Alias("max_queue_bytes_size")
+ registrar.Parameter("queue_byte_size_limit", &TThis::QueueByteSizeLimit)
+ .Alias("max_queue_byte_size")
.Optional();
registrar.Parameter("concurrency_limit", &TThis::ConcurrencyLimit)
.Alias("max_concurrency")
.Optional();
+ registrar.Parameter("concurrency_byte_limit", &TThis::ConcurrencyByteLimit)
+ .Alias("max_concurrency_byte")
+ .Optional();
registrar.Parameter("log_level", &TThis::LogLevel)
.Optional();
registrar.Parameter("request_bytes_throttler", &TThis::RequestBytesThrottler)
diff --git a/yt/yt/core/rpc/config.h b/yt/yt/core/rpc/config.h
index 26214ea5fcb..707604e6f55 100644
--- a/yt/yt/core/rpc/config.h
+++ b/yt/yt/core/rpc/config.h
@@ -152,8 +152,9 @@ class TMethodConfig
public:
std::optional<bool> Heavy;
std::optional<int> QueueSizeLimit;
- std::optional<i64> QueueBytesSizeLimit;
+ std::optional<i64> QueueByteSizeLimit;
std::optional<int> ConcurrencyLimit;
+ std::optional<i64> ConcurrencyByteLimit;
std::optional<NLogging::ELogLevel> LogLevel;
std::optional<TDuration> LoggingSuppressionTimeout;
NConcurrency::TThroughputThrottlerConfigPtr RequestBytesThrottler;
diff --git a/yt/yt/core/rpc/grpc/config.cpp b/yt/yt/core/rpc/grpc/config.cpp
index dc3a003cb12..967a9a75d98 100644
--- a/yt/yt/core/rpc/grpc/config.cpp
+++ b/yt/yt/core/rpc/grpc/config.cpp
@@ -73,7 +73,7 @@ void TChannelCredentialsConfig::Register(TRegistrar registrar)
////////////////////////////////////////////////////////////////////////////////
-void TChannelConfigBase::Register(TRegistrar registrar)
+void TChannelConfigTemplate::Register(TRegistrar registrar)
{
registrar.Parameter("credentials", &TThis::Credentials)
.Optional();
diff --git a/yt/yt/core/rpc/grpc/config.h b/yt/yt/core/rpc/grpc/config.h
index 607d152c078..de0559bb738 100644
--- a/yt/yt/core/rpc/grpc/config.h
+++ b/yt/yt/core/rpc/grpc/config.h
@@ -122,24 +122,24 @@ DEFINE_REFCOUNTED_TYPE(TChannelCredentialsConfig)
////////////////////////////////////////////////////////////////////////////////
-class TChannelConfigBase
+class TChannelConfigTemplate
: public NYTree::TYsonStruct
{
public:
TChannelCredentialsConfigPtr Credentials;
THashMap<TString, NYTree::INodePtr> GrpcArguments;
- REGISTER_YSON_STRUCT(TChannelConfigBase);
+ REGISTER_YSON_STRUCT(TChannelConfigTemplate);
static void Register(TRegistrar registrar);
};
-DEFINE_REFCOUNTED_TYPE(TChannelConfigBase)
+DEFINE_REFCOUNTED_TYPE(TChannelConfigTemplate)
////////////////////////////////////////////////////////////////////////////////
class TChannelConfig
- : public TChannelConfigBase
+ : public TChannelConfigTemplate
{
public:
TString Address;
diff --git a/yt/yt/core/rpc/grpc/public.h b/yt/yt/core/rpc/grpc/public.h
index 58773a258bf..a34e2e768a0 100644
--- a/yt/yt/core/rpc/grpc/public.h
+++ b/yt/yt/core/rpc/grpc/public.h
@@ -12,7 +12,7 @@ DECLARE_REFCOUNTED_CLASS(TServerCredentialsConfig)
DECLARE_REFCOUNTED_CLASS(TServerAddressConfig)
DECLARE_REFCOUNTED_CLASS(TServerConfig)
DECLARE_REFCOUNTED_CLASS(TChannelCredentialsConfig)
-DECLARE_REFCOUNTED_CLASS(TChannelConfigBase)
+DECLARE_REFCOUNTED_CLASS(TChannelConfigTemplate)
DECLARE_REFCOUNTED_CLASS(TChannelConfig)
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/core/rpc/grpc/server.cpp b/yt/yt/core/rpc/grpc/server.cpp
index d4eaf72ff47..169bd8cb1ea 100644
--- a/yt/yt/core/rpc/grpc/server.cpp
+++ b/yt/yt/core/rpc/grpc/server.cpp
@@ -339,9 +339,6 @@ private:
~TCallHandler()
{
- if (ReplyBus_) {
- ReplyBus_->Terminate(TError(NYT::EErrorCode::Canceled, "GRPC call completed"));
- }
Owner_->OnCallHandlerDestroyed();
}
diff --git a/yt/yt/core/rpc/server_detail.cpp b/yt/yt/core/rpc/server_detail.cpp
index 46bfe2152b8..018fe746cb2 100644
--- a/yt/yt/core/rpc/server_detail.cpp
+++ b/yt/yt/core/rpc/server_detail.cpp
@@ -882,6 +882,7 @@ void TServerBase::ApplyConfig()
newAppliedConfig->EnableErrorCodeCounting = DynamicConfig_->EnableErrorCodeCounting.value_or(StaticConfig_->EnableErrorCodeCounting);
newAppliedConfig->EnablePerUserProfiling = DynamicConfig_->EnablePerUserProfiling.value_or(StaticConfig_->EnablePerUserProfiling);
newAppliedConfig->HistogramTimerProfiling = DynamicConfig_->HistogramTimerProfiling.value_or(StaticConfig_->HistogramTimerProfiling);
+ newAppliedConfig->TracingMode = DynamicConfig_->TracingMode.value_or(StaticConfig_->TracingMode);
newAppliedConfig->Services = StaticConfig_->Services;
for (const auto& [name, node] : DynamicConfig_->Services) {
diff --git a/yt/yt/core/rpc/service_detail.cpp b/yt/yt/core/rpc/service_detail.cpp
index 5c373605400..87093d5295b 100644
--- a/yt/yt/core/rpc/service_detail.cpp
+++ b/yt/yt/core/rpc/service_detail.cpp
@@ -115,6 +115,34 @@ void TDynamicConcurrencyLimit::SetDynamicLimit(std::optional<int> dynamicLimit)
////////////////////////////////////////////////////////////////////////////////
+void TDynamicConcurrencyByteLimit::Reconfigure(i64 limit)
+{
+ ConfigByteLimit_.store(limit, std::memory_order::relaxed);
+ SetDynamicByteLimit(limit);
+}
+
+i64 TDynamicConcurrencyByteLimit::GetByteLimitFromConfiguration() const
+{
+ return ConfigByteLimit_.load(std::memory_order::relaxed);
+}
+
+i64 TDynamicConcurrencyByteLimit::GetDynamicByteLimit() const
+{
+ return DynamicByteLimit_.load(std::memory_order::relaxed);
+}
+
+void TDynamicConcurrencyByteLimit::SetDynamicByteLimit(std::optional<i64> dynamicLimit)
+{
+ auto limit = dynamicLimit.has_value() ? *dynamicLimit : ConfigByteLimit_.load(std::memory_order::relaxed);
+ auto oldLimit = DynamicByteLimit_.exchange(limit, std::memory_order::relaxed);
+
+ if (oldLimit != limit) {
+ Updated_.Fire();
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
TServiceBase::TMethodDescriptor::TMethodDescriptor(
TString method,
TLiteHandler liteHandler,
@@ -166,10 +194,10 @@ auto TServiceBase::TMethodDescriptor::SetQueueSizeLimit(int value) const -> TMet
return result;
}
-auto TServiceBase::TMethodDescriptor::SetQueueBytesSizeLimit(i64 value) const -> TMethodDescriptor
+auto TServiceBase::TMethodDescriptor::SetQueueByteSizeLimit(i64 value) const -> TMethodDescriptor
{
auto result = *this;
- result.QueueBytesSizeLimit = value;
+ result.QueueByteSizeLimit = value;
return result;
}
@@ -180,6 +208,13 @@ auto TServiceBase::TMethodDescriptor::SetConcurrencyLimit(int value) const -> TM
return result;
}
+auto TServiceBase::TMethodDescriptor::SetConcurrencyByteLimit(i64 value) const -> TMethodDescriptor
+{
+ auto result = *this;
+ result.ConcurrencyByteLimit = value;
+ return result;
+}
+
auto TServiceBase::TMethodDescriptor::SetSystem(bool value) const -> TMethodDescriptor
{
auto result = *this;
@@ -229,6 +264,13 @@ auto TServiceBase::TMethodDescriptor::SetPooled(bool value) const -> TMethodDesc
return result;
}
+auto TServiceBase::TMethodDescriptor::SetHandleMethodError(bool value) const -> TMethodDescriptor
+{
+ auto result = *this;
+ result.HandleMethodError = value;
+ return result;
+}
+
////////////////////////////////////////////////////////////////////////////////
TServiceBase::TMethodPerformanceCounters::TMethodPerformanceCounters(
@@ -278,7 +320,7 @@ TServiceBase::TRuntimeMethodInfo::TRuntimeMethodInfo(
, ResponseLoggingAnchor(NLogging::TLogManager::Get()->RegisterDynamicAnchor(
Format("%v.%v ->", ServiceId.ServiceName, Descriptor.Method)))
, RequestQueueSizeLimitErrorCounter(Profiler.Counter("/request_queue_size_errors"))
- , RequestQueueBytesSizeLimitErrorCounter(Profiler.Counter("/request_queue_bytes_size_errors"))
+ , RequestQueueByteSizeLimitErrorCounter(Profiler.Counter("/request_queue_byte_size_errors"))
, UnauthenticatedRequestsCounter(Profiler.Counter("/unauthenticated_requests"))
, LoggingSuppressionFailedRequestThrottler(
CreateReconfigurableThroughputThrottler(
@@ -328,10 +370,18 @@ public:
~TServiceContext()
{
- if (!Replied_ && !CanceledList_.IsFired()) {
+ if (!Replied_) {
// Prevent alerting.
RequestInfoSet_ = true;
- Reply(TError(NRpc::EErrorCode::Unavailable, "Service is unable to complete your request"));
+ if (CanceledList_.IsFired()) {
+ if (TimedOutLatch_) {
+ Reply(TError(NYT::EErrorCode::Timeout, "Request timed out"));
+ } else {
+ Reply(TError(NYT::EErrorCode::Canceled, "Request canceled"));
+ }
+ } else {
+ Reply(TError(NRpc::EErrorCode::Unavailable, "Service is unable to complete your request"));
+ }
}
Finish();
@@ -459,7 +509,7 @@ public:
RequestId_);
if (RuntimeInfo_->Descriptor.StreamingEnabled) {
- static const auto CanceledError = TError("Request canceled");
+ static const auto CanceledError = TError(NYT::EErrorCode::Canceled, "Request canceled");
AbortStreamsUnlessClosed(CanceledError);
}
@@ -484,11 +534,12 @@ public:
stage);
if (RuntimeInfo_->Descriptor.StreamingEnabled) {
- static const auto TimedOutError = TError("Request timed out");
+ static const auto TimedOutError = TError(NYT::EErrorCode::Timeout, "Request timed out");
AbortStreamsUnlessClosed(TimedOutError);
}
CanceledList_.Fire(GetCanceledError());
+
MethodPerformanceCounters_->TimedOutRequestCounter.Increment();
// Guards from race with DoGuardedRun.
@@ -674,7 +725,7 @@ private:
bool IsRegistrable()
{
- if (RuntimeInfo_->Descriptor.Cancelable && !RequestHeader_->uncancelable()) {
+ if (Cancelable_) {
return true;
}
@@ -718,11 +769,11 @@ private:
BuildGlobalRequestInfo();
+ Cancelable_ = RuntimeInfo_->Descriptor.Cancelable && !RequestHeader_->uncancelable();
+
if (IsRegistrable()) {
Service_->RegisterRequest(this);
}
-
- Cancelable_ = RuntimeInfo_->Descriptor.Cancelable && !RequestHeader_->uncancelable();
}
void BuildGlobalRequestInfo()
@@ -844,6 +895,11 @@ private:
TCurrentTraceContextGuard guard(TraceContext_);
DoGuardedRun(handler);
} catch (const std::exception& ex) {
+ const auto& descriptor = RuntimeInfo_->Descriptor;
+ if (descriptor.HandleMethodError) {
+ Service_->OnMethodError(ex, descriptor.Method);
+ }
+
Reply(ex);
}
}
@@ -1021,16 +1077,16 @@ private:
}
if (RequestRun_) {
- RequestQueue_->OnRequestFinished();
+ auto requestTotalSize = GetMessageBodySize(RequestMessage_) +
+ GetTotalMessageAttachmentSize(RequestMessage_);
+ RequestQueue_->OnRequestFinished(requestTotalSize);
}
-
if (ActiveRequestCountIncremented_) {
Service_->DecrementActiveRequestCount();
}
}
-
void LogRequest() override
{
TStringBuilder builder;
@@ -1277,6 +1333,10 @@ bool TRequestQueue::Register(TServiceBase* service, TServiceBase::TRuntimeMethod
RuntimeInfo_->ConcurrencyLimit.SubscribeUpdated(BIND(
&TRequestQueue::OnConcurrencyLimitChanged,
MakeWeak(this)));
+
+ RuntimeInfo_->ConcurrencyByteLimit.SubscribeUpdated(BIND(
+ &TRequestQueue::OnConcurrencyByteLimitChanged,
+ MakeWeak(this)));
}
Registered_.store(true, std::memory_order::release);
}
@@ -1291,6 +1351,13 @@ void TRequestQueue::OnConcurrencyLimitChanged()
}
}
+void TRequestQueue::OnConcurrencyByteLimitChanged()
+{
+ if (QueueByteSize_.load() > 0) {
+ ScheduleRequestsFromQueue();
+ }
+}
+
void TRequestQueue::TRequestThrottler::Reconfigure(const TThroughputThrottlerConfigPtr& config)
{
Throttler->Reconfigure(config ? config : New<TThroughputThrottlerConfig>());
@@ -1327,10 +1394,10 @@ bool TRequestQueue::IsQueueSizeLimitExceeded() const
RuntimeInfo_->QueueSizeLimit.load(std::memory_order::relaxed);
}
-bool TRequestQueue::IsQueueBytesSizeLimitExceeded() const
+bool TRequestQueue::IsQueueByteSizeLimitExceeded() const
{
- return QueueBytesSize_.load(std::memory_order::relaxed) >=
- RuntimeInfo_->QueueBytesSizeLimit.load(std::memory_order::relaxed);
+ return QueueByteSize_.load(std::memory_order::relaxed) >=
+ RuntimeInfo_->QueueByteSizeLimit.load(std::memory_order::relaxed);
}
int TRequestQueue::GetQueueSize() const
@@ -1338,16 +1405,26 @@ int TRequestQueue::GetQueueSize() const
return QueueSize_.load(std::memory_order::relaxed);
}
+i64 TRequestQueue::GetQueueByteSize() const
+{
+ return QueueByteSize_.load(std::memory_order::relaxed);
+}
+
int TRequestQueue::GetConcurrency() const
{
return Concurrency_.load(std::memory_order::relaxed);
}
-void TRequestQueue::OnRequestArrived(TServiceBase::TServiceContextPtr context)
+i64 TRequestQueue::GetConcurrencyByte() const
+{
+ return ConcurrencyByte_.load(std::memory_order::relaxed);
+}
+
+void TRequestQueue::OnRequestArrived(const TServiceBase::TServiceContextPtr& context)
{
// Fast path.
- auto newConcurrencySemaphore = IncrementConcurrency();
- if (newConcurrencySemaphore <= RuntimeInfo_->ConcurrencyLimit.GetDynamicLimit() &&
+ auto concurrencyExceeded = IncrementConcurrency(context);
+ if (concurrencyExceeded &&
!AreThrottlersOverdrafted())
{
RunRequest(std::move(context));
@@ -1355,7 +1432,7 @@ void TRequestQueue::OnRequestArrived(TServiceBase::TServiceContextPtr context)
}
// Slow path.
- DecrementConcurrency();
+ DecrementConcurrency(GetTotalRequestSize(context));
IncrementQueueSize(context);
context->BeforeEnqueued();
@@ -1364,9 +1441,9 @@ void TRequestQueue::OnRequestArrived(TServiceBase::TServiceContextPtr context)
ScheduleRequestsFromQueue();
}
-void TRequestQueue::OnRequestFinished()
+void TRequestQueue::OnRequestFinished(i64 requestTotalSize)
{
- DecrementConcurrency();
+ DecrementConcurrency(requestTotalSize);
if (QueueSize_.load() > 0) {
// Slow path.
@@ -1398,7 +1475,8 @@ void TRequestQueue::ScheduleRequestsFromQueue()
// NB: Racy, may lead to overcommit in concurrency semaphore and request bytes throttler.
auto concurrencyLimit = RuntimeInfo_->ConcurrencyLimit.GetDynamicLimit();
- while (QueueSize_.load() > 0 && Concurrency_.load() < concurrencyLimit) {
+ auto concurrencyByteLimit = RuntimeInfo_->ConcurrencyByteLimit.GetDynamicByteLimit();
+ while (QueueSize_.load() > 0 && Concurrency_.load() < concurrencyLimit && ConcurrencyByte_.load() < concurrencyByteLimit) {
if (AreThrottlersOverdrafted()) {
SubscribeToThrottlers();
return;
@@ -1421,7 +1499,7 @@ void TRequestQueue::ScheduleRequestsFromQueue()
}
}
- IncrementConcurrency();
+ IncrementConcurrency(context);
RunRequest(std::move(context));
}
}
@@ -1448,34 +1526,38 @@ void TRequestQueue::RunRequest(TServiceBase::TServiceContextPtr context)
void TRequestQueue::IncrementQueueSize(const TServiceBase::TServiceContextPtr& context)
{
++QueueSize_;
-
- auto requestSize =
- GetMessageBodySize(context->GetRequestMessage()) +
- GetTotalMessageAttachmentSize(context->GetRequestMessage());
- QueueBytesSize_ += requestSize;
+ QueueByteSize_.fetch_add(GetTotalRequestSize(context));
}
void TRequestQueue::DecrementQueueSize(const TServiceBase::TServiceContextPtr& context)
{
auto newQueueSize = --QueueSize_;
+ auto oldQueueByteSize = QueueByteSize_.fetch_sub(GetTotalRequestSize(context));
+
YT_ASSERT(newQueueSize >= 0);
+ YT_ASSERT(oldQueueByteSize >= 0);
+}
- auto requestSize =
- GetMessageBodySize(context->GetRequestMessage()) +
+i64 TRequestQueue::GetTotalRequestSize(const TServiceBase::TServiceContextPtr& context)
+{
+ return GetMessageBodySize(context->GetRequestMessage()) +
GetTotalMessageAttachmentSize(context->GetRequestMessage());
- auto oldQueueBytesSize = QueueBytesSize_.fetch_sub(requestSize);
- YT_ASSERT(oldQueueBytesSize >= requestSize);
}
-int TRequestQueue::IncrementConcurrency()
+bool TRequestQueue::IncrementConcurrency(const TServiceBase::TServiceContextPtr& context)
{
- return ++Concurrency_;
+ auto resultSize = ++Concurrency_ <= RuntimeInfo_->ConcurrencyLimit.GetDynamicLimit();
+ auto resultByteSize = ConcurrencyByte_.fetch_add(GetTotalRequestSize(context)) <= RuntimeInfo_->ConcurrencyByteLimit.GetDynamicByteLimit();
+ return resultSize && resultByteSize;
}
-void TRequestQueue::DecrementConcurrency()
+void TRequestQueue::DecrementConcurrency(i64 requestTotalSize)
{
auto newConcurrencySemaphore = --Concurrency_;
+ auto newConcurrencyByteSemaphore = ConcurrencyByte_.fetch_sub(requestTotalSize);
+
YT_ASSERT(newConcurrencySemaphore >= 0);
+ YT_ASSERT(newConcurrencyByteSemaphore >= 0);
}
bool TRequestQueue::AreThrottlersOverdrafted() const
@@ -1490,9 +1572,7 @@ void TRequestQueue::AcquireThrottlers(const TServiceBase::TServiceContextPtr& co
{
if (BytesThrottler_.Specified.load(std::memory_order::acquire)) {
// Slow path.
- auto requestSize =
- GetMessageBodySize(context->GetRequestMessage()) +
- GetTotalMessageAttachmentSize(context->GetRequestMessage());
+ auto requestSize = GetTotalRequestSize(context);
BytesThrottler_.Throttler->Acquire(requestSize);
}
if (WeightThrottler_.Specified.load(std::memory_order::acquire)) {
@@ -1645,12 +1725,12 @@ void TServiceBase::HandleRequest(
return;
}
- if (requestQueue->IsQueueBytesSizeLimitExceeded()) {
- runtimeInfo->RequestQueueBytesSizeLimitErrorCounter.Increment();
+ if (requestQueue->IsQueueByteSizeLimitExceeded()) {
+ runtimeInfo->RequestQueueByteSizeLimitErrorCounter.Increment();
replyError(TError(
NRpc::EErrorCode::RequestQueueSizeLimitExceeded,
"Request queue bytes size limit exceeded")
- << TErrorAttribute("limit", runtimeInfo->QueueBytesSizeLimit.load())
+ << TErrorAttribute("limit", runtimeInfo->QueueByteSizeLimit.load())
<< TErrorAttribute("queue", requestQueue->GetName())
<< maybeThrottled);
return;
@@ -1735,6 +1815,9 @@ void TServiceBase::ReplyError(
YT_UNUSED_FUTURE(replyBus->Send(errorMessage));
}
+void TServiceBase::OnMethodError(const TError& /*error*/, const TString& /*method*/)
+{ }
+
void TServiceBase::OnRequestAuthenticated(
const NProfiling::TWallTimer& timer,
TAcceptedRequest&& acceptedRequest,
@@ -1845,9 +1928,15 @@ void TServiceBase::RegisterRequestQueue(
profiler.AddFuncGauge("/request_queue_size", MakeStrong(this), [=] {
return requestQueue->GetQueueSize();
});
+ profiler.AddFuncGauge("/request_queue_byte_size", MakeStrong(this), [=] {
+ return requestQueue->GetQueueByteSize();
+ });
profiler.AddFuncGauge("/concurrency", MakeStrong(this), [=] {
return requestQueue->GetConcurrency();
});
+ profiler.AddFuncGauge("/concurrency_byte", MakeStrong(this), [=] {
+ return requestQueue->GetConcurrencyByte();
+ });
TMethodConfigPtr methodConfig;
if (auto config = Config_.Acquire()) {
@@ -2023,10 +2112,10 @@ void TServiceBase::OnRequestTimeout(TRequestId requestId, ERequestProcessingStag
context->HandleTimeout(stage);
}
-void TServiceBase::OnReplyBusTerminated(const IBusPtr& bus, const TError& error)
+void TServiceBase::OnReplyBusTerminated(const NYT::TWeakPtr<NYT::NBus::IBus>& busWeak, const TError& error)
{
std::vector<TServiceContextPtr> contexts;
- {
+ if (auto bus = busWeak.Lock()) {
auto* bucket = GetReplyBusBucket(bus);
auto guard = Guard(bucket->Lock);
auto it = bucket->ReplyBusToContexts.find(bus);
@@ -2088,7 +2177,7 @@ void TServiceBase::RegisterRequest(TServiceContext* context)
}
if (subscribe) {
- replyBus->SubscribeTerminated(BIND(&TServiceBase::OnReplyBusTerminated, MakeWeak(this), replyBus));
+ replyBus->SubscribeTerminated(BIND(&TServiceBase::OnReplyBusTerminated, MakeWeak(this), MakeWeak(replyBus.Get())));
}
auto pendingPayloads = GetAndErasePendingPayloads(requestId);
@@ -2121,6 +2210,9 @@ void TServiceBase::UnregisterRequest(TServiceContext* context)
if (it != bucket->ReplyBusToContexts.end()) {
auto& contexts = it->second;
contexts.erase(context);
+ if (contexts.empty()) {
+ bucket->ReplyBusToContexts.erase(it);
+ }
}
}
}
@@ -2422,8 +2514,9 @@ TServiceBase::TRuntimeMethodInfoPtr TServiceBase::RegisterMethod(const TMethodDe
runtimeInfo->Heavy.store(descriptor.Options.Heavy);
runtimeInfo->QueueSizeLimit.store(descriptor.QueueSizeLimit);
- runtimeInfo->QueueBytesSizeLimit.store(descriptor.QueueBytesSizeLimit);
+ runtimeInfo->QueueByteSizeLimit.store(descriptor.QueueByteSizeLimit);
runtimeInfo->ConcurrencyLimit.Reconfigure(descriptor.ConcurrencyLimit);
+ runtimeInfo->ConcurrencyByteLimit.Reconfigure(descriptor.ConcurrencyByteLimit);
runtimeInfo->LogLevel.store(descriptor.LogLevel);
runtimeInfo->LoggingSuppressionTimeout.store(descriptor.LoggingSuppressionTimeout);
@@ -2434,12 +2527,15 @@ TServiceBase::TRuntimeMethodInfoPtr TServiceBase::RegisterMethod(const TMethodDe
profiler.AddFuncGauge("/request_queue_size_limit", MakeStrong(this), [=] {
return runtimeInfo->QueueSizeLimit.load(std::memory_order::relaxed);
});
- profiler.AddFuncGauge("/request_queue_bytes_size_limit", MakeStrong(this), [=] {
- return runtimeInfo->QueueBytesSizeLimit.load(std::memory_order::relaxed);
+ profiler.AddFuncGauge("/request_queue_byte_size_limit", MakeStrong(this), [=] {
+ return runtimeInfo->QueueByteSizeLimit.load(std::memory_order::relaxed);
});
profiler.AddFuncGauge("/concurrency_limit", MakeStrong(this), [=] {
return runtimeInfo->ConcurrencyLimit.GetDynamicLimit();
});
+ profiler.AddFuncGauge("/concurrency_byte_limit", MakeStrong(this), [=] {
+ return runtimeInfo->ConcurrencyByteLimit.GetDynamicByteLimit();
+ });
return runtimeInfo;
}
@@ -2500,8 +2596,9 @@ void TServiceBase::DoConfigure(
runtimeInfo->Heavy.store(methodConfig->Heavy.value_or(descriptor.Options.Heavy));
runtimeInfo->QueueSizeLimit.store(methodConfig->QueueSizeLimit.value_or(descriptor.QueueSizeLimit));
- runtimeInfo->QueueBytesSizeLimit.store(methodConfig->QueueBytesSizeLimit.value_or(descriptor.QueueBytesSizeLimit));
+ runtimeInfo->QueueByteSizeLimit.store(methodConfig->QueueByteSizeLimit.value_or(descriptor.QueueByteSizeLimit));
runtimeInfo->ConcurrencyLimit.Reconfigure(methodConfig->ConcurrencyLimit.value_or(descriptor.ConcurrencyLimit));
+ runtimeInfo->ConcurrencyByteLimit.Reconfigure(methodConfig->ConcurrencyByteLimit.value_or(descriptor.ConcurrencyByteLimit));
runtimeInfo->LogLevel.store(methodConfig->LogLevel.value_or(descriptor.LogLevel));
runtimeInfo->LoggingSuppressionTimeout.store(methodConfig->LoggingSuppressionTimeout.value_or(descriptor.LoggingSuppressionTimeout));
runtimeInfo->Pooled.store(methodConfig->Pooled.value_or(config->Pooled.value_or(descriptor.Pooled)));
diff --git a/yt/yt/core/rpc/service_detail.h b/yt/yt/core/rpc/service_detail.h
index 87a94584317..a388116d678 100644
--- a/yt/yt/core/rpc/service_detail.h
+++ b/yt/yt/core/rpc/service_detail.h
@@ -476,6 +476,24 @@ private:
////////////////////////////////////////////////////////////////////////////////
+class TDynamicConcurrencyByteLimit
+{
+public:
+ DEFINE_SIGNAL(void(), Updated);
+
+ void Reconfigure(i64 limit);
+ i64 GetByteLimitFromConfiguration() const;
+
+ i64 GetDynamicByteLimit() const;
+ void SetDynamicByteLimit(std::optional<i64> dynamicLimit);
+
+private:
+ std::atomic<i64> ConfigByteLimit_ = 0;
+ std::atomic<i64> DynamicByteLimit_ = 0;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+
//! Provides a base for implementing IService.
class TServiceBase
: public virtual IService
@@ -561,11 +579,14 @@ protected:
int QueueSizeLimit = 10'000;
//! Maximum total size of requests in queue (both waiting and executing).
- i64 QueueBytesSizeLimit = 2_GB;
+ i64 QueueByteSizeLimit = 2_GB;
//! Maximum number of requests executing concurrently.
int ConcurrencyLimit = 10'000;
+ //! Maximum total size of requests executing concurrently.
+ i64 ConcurrencyByteLimit = 4_GB;
+
//! System requests are completely transparent to derived classes;
//! in particular, |BeforeInvoke| is not called.
//! Also system methods do not require authentication.
@@ -594,14 +615,18 @@ protected:
//! If |true| then requests and responses are pooled.
bool Pooled = true;
+ // If |true| then method exception will be handled by |OnMethodError|.
+ bool HandleMethodError = false;
+
TMethodDescriptor SetRequestQueueProvider(IRequestQueueProviderPtr value) const;
TMethodDescriptor SetInvoker(IInvokerPtr value) const;
TMethodDescriptor SetInvokerProvider(TInvokerProvider value) const;
TMethodDescriptor SetHeavy(bool value) const;
TMethodDescriptor SetResponseCodec(NCompression::ECodec value) const;
TMethodDescriptor SetQueueSizeLimit(int value) const;
- TMethodDescriptor SetQueueBytesSizeLimit(i64 value) const;
+ TMethodDescriptor SetQueueByteSizeLimit(i64 value) const;
TMethodDescriptor SetConcurrencyLimit(int value) const;
+ TMethodDescriptor SetConcurrencyByteLimit(i64 value) const;
TMethodDescriptor SetSystem(bool value) const;
TMethodDescriptor SetLogLevel(NLogging::ELogLevel value) const;
TMethodDescriptor SetLoggingSuppressionTimeout(TDuration value) const;
@@ -609,6 +634,7 @@ protected:
TMethodDescriptor SetGenerateAttachmentChecksums(bool value) const;
TMethodDescriptor SetStreamingEnabled(bool value) const;
TMethodDescriptor SetPooled(bool value) const;
+ TMethodDescriptor SetHandleMethodError(bool value) const;
};
struct TErrorCodesCounter
@@ -704,13 +730,14 @@ protected:
std::atomic<bool> Pooled = true;
std::atomic<int> QueueSizeLimit = 0;
- std::atomic<i64> QueueBytesSizeLimit = 0;
+ std::atomic<i64> QueueByteSizeLimit = 0;
TDynamicConcurrencyLimit ConcurrencyLimit;
+ TDynamicConcurrencyByteLimit ConcurrencyByteLimit;
std::atomic<double> WaitingTimeoutFraction = 0;
NProfiling::TCounter RequestQueueSizeLimitErrorCounter;
- NProfiling::TCounter RequestQueueBytesSizeLimitErrorCounter;
+ NProfiling::TCounter RequestQueueByteSizeLimitErrorCounter;
NProfiling::TCounter UnauthenticatedRequestsCounter;
std::atomic<NLogging::ELogLevel> LogLevel = {};
@@ -850,6 +877,8 @@ protected:
const NProto::TRequestHeader& header,
const NYT::NBus::IBusPtr& replyBus);
+ virtual void OnMethodError(const TError& error, const TString& method);
+
private:
friend class TRequestQueue;
@@ -949,7 +978,7 @@ private:
TError DoCheckRequestCodecs(const NRpc::NProto::TRequestHeader& header);
void OnRequestTimeout(TRequestId requestId, ERequestProcessingStage stage, bool aborted);
- void OnReplyBusTerminated(const NYT::NBus::IBusPtr& bus, const TError& error);
+ void OnReplyBusTerminated(const NYT::TWeakPtr<NYT::NBus::IBus>& busWeak, const TError& error);
void OnRequestAuthenticated(
const NProfiling::TWallTimer& timer,
@@ -1026,13 +1055,15 @@ public:
void Configure(const TMethodConfigPtr& config);
bool IsQueueSizeLimitExceeded() const;
- bool IsQueueBytesSizeLimitExceeded() const;
+ bool IsQueueByteSizeLimitExceeded() const;
int GetQueueSize() const;
+ i64 GetQueueByteSize() const;
int GetConcurrency() const;
+ i64 GetConcurrencyByte() const;
- void OnRequestArrived(TServiceBase::TServiceContextPtr context);
- void OnRequestFinished();
+ void OnRequestArrived(const TServiceBase::TServiceContextPtr& context);
+ void OnRequestFinished(i64 requestTotalSize);
void ConfigureWeightThrottler(const NConcurrency::TThroughputThrottlerConfigPtr& config);
void ConfigureBytesThrottler(const NConcurrency::TThroughputThrottlerConfigPtr& config);
@@ -1047,6 +1078,7 @@ private:
TServiceBase::TRuntimeMethodInfo* RuntimeInfo_ = nullptr;
std::atomic<int> Concurrency_ = 0;
+ std::atomic<i64> ConcurrencyByte_ = 0;
struct TRequestThrottler
{
@@ -1061,24 +1093,27 @@ private:
std::atomic<bool> Throttled_ = false;
std::atomic<int> QueueSize_ = 0;
- std::atomic<i64> QueueBytesSize_ = 0;
+ std::atomic<i64> QueueByteSize_ = 0;
moodycamel::ConcurrentQueue<TServiceBase::TServiceContextPtr> Queue_;
void ScheduleRequestsFromQueue();
void RunRequest(TServiceBase::TServiceContextPtr context);
+ i64 GetTotalRequestSize(const TServiceBase::TServiceContextPtr& context);
+
void IncrementQueueSize(const TServiceBase::TServiceContextPtr& context);
void DecrementQueueSize(const TServiceBase::TServiceContextPtr& context);
- int IncrementConcurrency();
- void DecrementConcurrency();
+ bool IncrementConcurrency(const TServiceBase::TServiceContextPtr& context);
+ void DecrementConcurrency(i64 requestTotalSize);
bool AreThrottlersOverdrafted() const;
void AcquireThrottlers(const TServiceBase::TServiceContextPtr& context);
void SubscribeToThrottlers();
void OnConcurrencyLimitChanged();
+ void OnConcurrencyByteLimitChanged();
};
DEFINE_REFCOUNTED_TYPE(TRequestQueue)
diff --git a/yt/yt/core/threading/thread.cpp b/yt/yt/core/threading/thread.cpp
index 4b04e154bd9..87488626506 100644
--- a/yt/yt/core/threading/thread.cpp
+++ b/yt/yt/core/threading/thread.cpp
@@ -293,12 +293,12 @@ void TThread::ConfigureSignalHandlerStack()
// The size of of the custom stack to be provided for signal handlers.
constexpr size_t SignalHandlerStackSize = 16_KB;
- YT_THREAD_LOCAL(std::array<char, SignalHandlerStackSize>) Stack;
+ YT_THREAD_LOCAL(std::unique_ptr<char[]>) Stack = std::make_unique<char[]>(SignalHandlerStackSize);
stack_t stack{
- .ss_sp = GetTlsRef(Stack).data(),
+ .ss_sp = GetTlsRef(Stack).get(),
.ss_flags = 0,
- .ss_size = GetTlsRef(Stack).size(),
+ .ss_size = SignalHandlerStackSize,
};
YT_VERIFY(sigaltstack(&stack, nullptr) == 0);
#endif
diff --git a/yt/yt/core/tracing/config.cpp b/yt/yt/core/tracing/config.cpp
index 42eee6b0531..fc32a1437e6 100644
--- a/yt/yt/core/tracing/config.cpp
+++ b/yt/yt/core/tracing/config.cpp
@@ -4,7 +4,7 @@ namespace NYT::NTracing {
////////////////////////////////////////////////////////////////////////////////
-void TTracingConfig::Register(TRegistrar registrar)
+void TTracingTransportConfig::Register(TRegistrar registrar)
{
registrar.Parameter("send_baggage", &TThis::SendBaggage)
.Default(true);
diff --git a/yt/yt/core/tracing/config.h b/yt/yt/core/tracing/config.h
index b8dc889ee4a..9221ea9fad8 100644
--- a/yt/yt/core/tracing/config.h
+++ b/yt/yt/core/tracing/config.h
@@ -8,18 +8,18 @@ namespace NYT::NTracing {
////////////////////////////////////////////////////////////////////////////////
-class TTracingConfig
+class TTracingTransportConfig
: public NYTree::TYsonStruct
{
public:
bool SendBaggage;
- REGISTER_YSON_STRUCT(TTracingConfig);
+ REGISTER_YSON_STRUCT(TTracingTransportConfig);
static void Register(TRegistrar registrar);
};
-DEFINE_REFCOUNTED_TYPE(TTracingConfig)
+DEFINE_REFCOUNTED_TYPE(TTracingTransportConfig)
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/core/tracing/public.h b/yt/yt/core/tracing/public.h
index f6e8d090b55..6ced43f6b8e 100644
--- a/yt/yt/core/tracing/public.h
+++ b/yt/yt/core/tracing/public.h
@@ -16,7 +16,7 @@ class TTracingExt;
DECLARE_REFCOUNTED_CLASS(TTraceContext)
-DECLARE_REFCOUNTED_CLASS(TTracingConfig)
+DECLARE_REFCOUNTED_CLASS(TTracingTransportConfig)
DECLARE_REFCOUNTED_CLASS(TAllocationTags)
diff --git a/yt/yt/core/tracing/trace_context.cpp b/yt/yt/core/tracing/trace_context.cpp
index 7712c0b8dac..fd82e5e2450 100644
--- a/yt/yt/core/tracing/trace_context.cpp
+++ b/yt/yt/core/tracing/trace_context.cpp
@@ -78,22 +78,22 @@ void SetGlobalTracer(const ITracerPtr& tracer)
////////////////////////////////////////////////////////////////////////////////
-struct TTracingConfigSingleton
+struct TTracingConfigStorage
{
- TAtomicIntrusivePtr<TTracingConfig> Config{New<TTracingConfig>()};
+ TAtomicIntrusivePtr<TTracingTransportConfig> Config{New<TTracingTransportConfig>()};
};
-static TTracingConfigSingleton* GlobalTracingConfig()
+static TTracingConfigStorage* GlobalTracingConfig()
{
- return LeakySingleton<TTracingConfigSingleton>();
+ return LeakySingleton<TTracingConfigStorage>();
}
-void SetTracingConfig(TTracingConfigPtr config)
+void SetTracingTransportConfig(TTracingTransportConfigPtr config)
{
GlobalTracingConfig()->Config.Store(std::move(config));
}
-TTracingConfigPtr GetTracingConfig()
+TTracingTransportConfigPtr GetTracingTransportConfig()
{
return GlobalTracingConfig()->Config.Acquire();
}
@@ -627,7 +627,7 @@ void ToProto(NProto::TTracingExt* ext, const TTraceContextPtr& context)
if (auto endpoint = context->GetTargetEndpoint()){
ext->set_target_endpoint(endpoint.value());
}
- if (GetTracingConfig()->SendBaggage) {
+ if (GetTracingTransportConfig()->SendBaggage) {
if (auto baggage = context->GetBaggage()) {
ext->set_baggage(baggage.ToString());
}
diff --git a/yt/yt/core/tracing/trace_context.h b/yt/yt/core/tracing/trace_context.h
index 9db890d6957..957e6d45a29 100644
--- a/yt/yt/core/tracing/trace_context.h
+++ b/yt/yt/core/tracing/trace_context.h
@@ -42,8 +42,8 @@ ITracerPtr GetGlobalTracer();
////////////////////////////////////////////////////////////////////////////////
-void SetTracingConfig(TTracingConfigPtr config);
-TTracingConfigPtr GetTracingConfig();
+void SetTracingTransportConfig(TTracingTransportConfigPtr config);
+TTracingTransportConfigPtr GetTracingTransportConfig();
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/core/ya.make b/yt/yt/core/ya.make
index 552f269b6a3..8d449fdc30c 100644
--- a/yt/yt/core/ya.make
+++ b/yt/yt/core/ya.make
@@ -251,6 +251,7 @@ SRCS(
yson/writer.cpp
yson/string_merger.cpp
yson/ypath_designated_consumer.cpp
+ yson/ypath_filtering_consumer.cpp
yson/depth_limiting_yson_consumer.cpp
yson/list_verb_lazy_yson_consumer.cpp
yson/attributes_stripper.cpp
@@ -280,7 +281,6 @@ SRCS(
ytree/ypath_detail.cpp
ytree/ypath_resolver.cpp
ytree/ypath_service.cpp
- ytree/yson_serializable.cpp
ytree/yson_struct.cpp
ytree/yson_struct_detail.cpp
diff --git a/yt/yt/core/ypath/tokenizer.cpp b/yt/yt/core/ypath/tokenizer.cpp
index 86a2183dc9f..45fa0f40208 100644
--- a/yt/yt/core/ypath/tokenizer.cpp
+++ b/yt/yt/core/ypath/tokenizer.cpp
@@ -148,7 +148,7 @@ int TTokenizer::ParseHexDigit(char ch, TStringBuf context)
YT_ABORT();
}
-void TTokenizer::Expect(ETokenType expectedType)
+void TTokenizer::Expect(ETokenType expectedType) const
{
if (expectedType != Type_) {
if (Type_ == ETokenType::EndOfStream) {
@@ -169,7 +169,7 @@ void TTokenizer::Expect(ETokenType expectedType)
}
}
-void TTokenizer::ExpectListIndex()
+void TTokenizer::ExpectListIndex() const
{
Expect(NYPath::ETokenType::Literal);
i64 index;
@@ -190,7 +190,7 @@ bool TTokenizer::Skip(ETokenType expectedType)
return false;
}
-void TTokenizer::ThrowUnexpected()
+void TTokenizer::ThrowUnexpected() const
{
if (Type_ == ETokenType::EndOfStream) {
if (PreviousType_ == ETokenType::Slash) {
diff --git a/yt/yt/core/ypath/tokenizer.h b/yt/yt/core/ypath/tokenizer.h
index 27725db10ac..46cf2a058d2 100644
--- a/yt/yt/core/ypath/tokenizer.h
+++ b/yt/yt/core/ypath/tokenizer.h
@@ -14,6 +14,9 @@ public:
TTokenizer(const TTokenizer&) = delete;
TTokenizer& operator=(const TTokenizer&) = delete;
+ TTokenizer(TTokenizer&&) = default;
+ TTokenizer& operator=(TTokenizer&&) = default;
+
void Reset(TYPathBuf path);
ETokenType Advance();
@@ -27,10 +30,10 @@ public:
TStringBuf GetPath() const;
const TString& GetLiteralValue() const;
- void Expect(ETokenType expectedType);
- void ExpectListIndex();
+ void Expect(ETokenType expectedType) const;
+ void ExpectListIndex() const;
bool Skip(ETokenType expectedType);
- [[noreturn]] void ThrowUnexpected();
+ [[noreturn]] void ThrowUnexpected() const;
private:
TYPathBuf Path_;
diff --git a/yt/yt/core/yson/async_writer.cpp b/yt/yt/core/yson/async_writer.cpp
index d5dd646145e..13ae1115e23 100644
--- a/yt/yt/core/yson/async_writer.cpp
+++ b/yt/yt/core/yson/async_writer.cpp
@@ -94,7 +94,7 @@ void TAsyncYsonWriter::OnRaw(TFuture<TYsonString> asyncStr)
flushedSize->fetch_add(ysonStr.AsStringBuf().size(), std::memory_order::relaxed);
return TSegment{
ysonStr,
- ysonStr.GetType() == EYsonType::Node && (!topLevel || type != EYsonType::Node)
+ ysonStr.GetType() == EYsonType::Node && (!topLevel || type != EYsonType::Node),
};
})));
}
diff --git a/yt/yt/core/yson/consumer.h b/yt/yt/core/yson/consumer.h
index fb8bb29ba8a..96420f289c1 100644
--- a/yt/yt/core/yson/consumer.h
+++ b/yt/yt/core/yson/consumer.h
@@ -1,8 +1,6 @@
#pragma once
-#include "public.h"
-
-#include <library/cpp/yt/memory/ref.h>
+#include <library/cpp/yt/yson_string/public.h>
#include <library/cpp/yt/yson/consumer.h>
@@ -27,7 +25,6 @@ public:
//! Parses #str and converts it into a sequence of elementary calls.
void OnRaw(TStringBuf str, EYsonType type) override;
using IYsonConsumer::OnRaw;
-
};
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/core/yson/depth_limiting_yson_consumer.cpp b/yt/yt/core/yson/depth_limiting_yson_consumer.cpp
index 7dcfb86bf8d..108d690c560 100644
--- a/yt/yt/core/yson/depth_limiting_yson_consumer.cpp
+++ b/yt/yt/core/yson/depth_limiting_yson_consumer.cpp
@@ -2,12 +2,8 @@
#include "forwarding_consumer.h"
#include "null_consumer.h"
-#include <yt/yt/core/logging/log.h>
-
#include <yt/yt/core/misc/error.h>
-#include <yt/yt/core/ytree/public.h>
-
namespace NYT::NYson {
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/core/yson/depth_limiting_yson_consumer.h b/yt/yt/core/yson/depth_limiting_yson_consumer.h
index 2519a4047c2..ecb399ab909 100644
--- a/yt/yt/core/yson/depth_limiting_yson_consumer.h
+++ b/yt/yt/core/yson/depth_limiting_yson_consumer.h
@@ -1,5 +1,8 @@
-#include "public.h"
-#include "consumer.h"
+#pragma once
+
+#include <library/cpp/yt/yson_string/public.h>
+
+#include <library/cpp/yt/yson/public.h>
namespace NYT::NYson {
diff --git a/yt/yt/core/yson/pull_parser-inl.h b/yt/yt/core/yson/pull_parser-inl.h
index 2e8d7bf72fa..48a0ea9203e 100644
--- a/yt/yt/core/yson/pull_parser-inl.h
+++ b/yt/yt/core/yson/pull_parser-inl.h
@@ -6,6 +6,7 @@
#include "detail.h"
+#include <yt/yt/core/misc/optional.h>
#include <yt/yt/core/misc/parser_helpers.h>
#include <optional>
diff --git a/yt/yt/core/yson/pull_parser.h b/yt/yt/core/yson/pull_parser.h
index ed704ac1b03..5a632491e09 100644
--- a/yt/yt/core/yson/pull_parser.h
+++ b/yt/yt/core/yson/pull_parser.h
@@ -9,8 +9,6 @@
#include <util/stream/output.h>
#include <util/stream/zerocopy.h>
-#include <stack>
-
namespace NYT::NYson {
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/core/yson/unittests/ya.make b/yt/yt/core/yson/unittests/ya.make
index 5bb15cf408a..a153d12ce7a 100644
--- a/yt/yt/core/yson/unittests/ya.make
+++ b/yt/yt/core/yson/unittests/ya.make
@@ -17,6 +17,7 @@ SRCS(
protobuf_yson_schema_ut.cpp
protobuf_yson_ut.cpp
ypath_designated_yson_consumer_ut.cpp
+ ypath_filtering_yson_consumer_ut.cpp
yson_parser_ut.cpp
yson_pull_parser_ut.cpp
yson_token_writer_ut.cpp
diff --git a/yt/yt/core/yson/unittests/ypath_filtering_yson_consumer_ut.cpp b/yt/yt/core/yson/unittests/ypath_filtering_yson_consumer_ut.cpp
new file mode 100644
index 00000000000..3173d603dcb
--- /dev/null
+++ b/yt/yt/core/yson/unittests/ypath_filtering_yson_consumer_ut.cpp
@@ -0,0 +1,499 @@
+#include <yt/yt/core/test_framework/framework.h>
+
+#include <yt/yt/core/ytree/fluent.h>
+
+#include <yt/yt/core/yson/ypath_filtering_consumer.h>
+
+namespace NYT::NYson {
+
+////////////////////////////////////////////////////////////////////////////////
+
+namespace {
+
+////////////////////////////////////////////////////////////////////////////////
+
+class TYPathFilteringConsumerTest
+ : public ::testing::Test
+{
+public:
+ TYPathFilteringConsumerTest()
+ : Output_(ValueString_)
+ , Consumer_(CreateYsonWriter(&Output_, EYsonFormat::Text, EYsonType::Node, /*enableRaw*/ false))
+ { }
+
+ IYsonConsumer* GetConsumer()
+ {
+ return Consumer_.get();
+ }
+
+ TString FlushOutput()
+ {
+ auto result = std::move(ValueString_);
+ ValueString_.clear();
+ return result;
+ }
+
+private:
+ TString ValueString_;
+ TStringOutput Output_;
+ std::unique_ptr<IYsonConsumer> Consumer_;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+
+TEST_F(TYPathFilteringConsumerTest, BlacklistMap1)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/forbidden_key"},
+ EPathFilteringMode::Blacklist);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"key"="value";})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, BlacklistMap2)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/forbidden_key"},
+ EPathFilteringMode::Blacklist);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("forbidden_key").Value("value")
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), "{}");
+}
+
+TEST_F(TYPathFilteringConsumerTest, BlacklistMap3)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/forbidden_key"},
+ EPathFilteringMode::Blacklist);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("forbidden_key").Value("value")
+ .Item("key").Value("value")
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"key"="value";})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, BlacklistList)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/1/key"},
+ EPathFilteringMode::Blacklist);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginList()
+ .Item()
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap()
+ .Item()
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap()
+ .Item()
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap()
+ .EndList();
+
+ ASSERT_EQ(FlushOutput(), R"([{"key"="value";};{};{"key"="value";};])");
+}
+
+TEST_F(TYPathFilteringConsumerTest, BlacklistListNested)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/1/key"},
+ EPathFilteringMode::Blacklist);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginList()
+ .Item()
+ .BeginList()
+ .Item().Entity()
+ .Item().Entity()
+ .Item().Entity()
+ .EndList()
+ .Item()
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap()
+ .Item()
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap()
+ .EndList();
+
+ ASSERT_EQ(FlushOutput(), R"([[#;#;#;];{};{"key"="value";};])");
+}
+
+TEST_F(TYPathFilteringConsumerTest, BlacklistAttributes)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/@"},
+ EPathFilteringMode::Blacklist);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginAttributes()
+ .Item("some_attr").Entity()
+ .EndAttributes()
+ .Entity();
+
+ ASSERT_EQ(FlushOutput(), R"(#)");
+}
+
+TEST_F(TYPathFilteringConsumerTest, BlacklistAttribute)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/@forbidden_attr"},
+ EPathFilteringMode::Blacklist);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginAttributes()
+ .Item("forbidden_attr").Entity()
+ .Item("allowed_attr").Entity()
+ .EndAttributes()
+ .Entity();
+
+ ASSERT_EQ(FlushOutput(), R"(<"allowed_attr"=#;>#)");
+}
+
+TEST_F(TYPathFilteringConsumerTest, BlacklistNestedMap)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/forbidden_key", "/nested_map/forbidden_key"},
+ EPathFilteringMode::Blacklist);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("forbidden_key").Value("value")
+ .Item("key").Value("value")
+ .Item("nested_map")
+ .BeginMap()
+ .Item("forbidden_key").Value("value")
+ .Item("key").Value("value")
+ .EndMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"key"="value";"nested_map"={"key"="value";};})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, BlacklistNestedAsterisk)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/*/forbidden_key"},
+ EPathFilteringMode::Blacklist);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("nested_map1")
+ .BeginMap()
+ .Item("key").Value("value")
+ .Item("forbidden_key").Value("value")
+ .EndMap()
+ .Item("nested_map2")
+ .BeginMap()
+ .Item("forbidden_key").Value("value")
+ .Item("key").Value("value")
+ .EndMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"nested_map1"={"key"="value";};"nested_map2"={"key"="value";};})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, WhitelistMap1)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {""},
+ EPathFilteringMode::Whitelist);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"key"="value";})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, WhitelistMap2)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/allowed_key"},
+ EPathFilteringMode::Whitelist);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("allowed_key").Value("value")
+ .Item("key").Value("value")
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"allowed_key"="value";})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, WhitelistNestedMap)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/allowed_key", "/nested/allowed_key"},
+ EPathFilteringMode::Whitelist);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("key").Value("value")
+ .Item("allowed_key").Value("value")
+ .Item("nested")
+ .BeginMap()
+ .Item("key").Value("value")
+ .Item("allowed_key").Value("value")
+ .EndMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"allowed_key"="value";"nested"={"allowed_key"="value";};})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, ForcedSimple)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/forced_key"},
+ EPathFilteringMode::WhitelistWithForcedEntities);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"forced_key"=#;})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, ForcedNested)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/data/forced_key"},
+ EPathFilteringMode::WhitelistWithForcedEntities);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"data"={"forced_key"=#;};})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, ForcedWhitelistMixedNested)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/data/forced_key"},
+ EPathFilteringMode::WhitelistWithForcedEntities);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("data")
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"data"={"forced_key"=#;};})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, ForcedMixedNested)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/data/forced_key"},
+ EPathFilteringMode::ForcedEntities);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("data")
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"data"={"key"="value";"forced_key"=#;};})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, ForcedAttribute)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/data/@forced_attr"},
+ EPathFilteringMode::ForcedEntities);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("data")
+ .BeginAttributes()
+ .EndAttributes()
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"data"=<"forced_attr"=#;>{"key"="value";};})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, ForcedAttributes1)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/data/@"},
+ EPathFilteringMode::ForcedEntities);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("data")
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"data"=<>{"key"="value";};})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, ForcedAttributes2)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/data/@forced_key"},
+ EPathFilteringMode::ForcedEntities);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("data")
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"data"=<"forced_key"=#;>{"key"="value";};})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, ForcedMultiplePaths)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/forced_key1", "/forced_key2"},
+ EPathFilteringMode::WhitelistWithForcedEntities);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"forced_key1"=#;"forced_key2"=#;})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, ForcedMultiplePathsNested)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/data/forced_key","/forced_key"},
+ EPathFilteringMode::WhitelistWithForcedEntities);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"data"={"forced_key"=#;};"forced_key"=#;})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, ForcedFilteringSimple)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/forced_key"},
+ EPathFilteringMode::WhitelistWithForcedEntities);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"forced_key"=#;})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, ForcedFilteringSimplePrefix)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/forced_key"},
+ EPathFilteringMode::WhitelistWithForcedEntities);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("forced_key")
+ .BeginMap()
+ .Item("inner").Entity()
+ .EndMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"forced_key"={"inner"=#;};})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, ForcedFilteringNested)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/data/forced_key"},
+ EPathFilteringMode::WhitelistWithForcedEntities);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("key").Value("value")
+ .Item("data")
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"data"={"forced_key"=#;};})");
+}
+
+TEST_F(TYPathFilteringConsumerTest, ForcedFilteringMultiplePathsNested)
+{
+ auto consumer = CreateYPathFilteringConsumer(
+ GetConsumer(),
+ /*paths*/ {"/forced_key", "/data/forced_key"},
+ EPathFilteringMode::WhitelistWithForcedEntities);
+
+ NYTree::BuildYsonFluently(consumer.get())
+ .BeginMap()
+ .Item("key").Value("value")
+ .Item("some_map")
+ .BeginMap()
+ .Item("key").Value("value")
+ .EndMap()
+ .EndMap();
+
+ ASSERT_EQ(FlushOutput(), R"({"forced_key"=#;"data"={"forced_key"=#;};})");
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NYT::NYson
diff --git a/yt/yt/core/yson/ypath_designated_consumer.h b/yt/yt/core/yson/ypath_designated_consumer.h
index 546564237c2..2cb23e1fd78 100644
--- a/yt/yt/core/yson/ypath_designated_consumer.h
+++ b/yt/yt/core/yson/ypath_designated_consumer.h
@@ -1,8 +1,9 @@
-#include "public.h"
-#include "consumer.h"
+#pragma once
#include <yt/yt/core/ypath/public.h>
+#include <library/cpp/yt/yson/public.h>
+
namespace NYT::NYson {
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/core/yson/ypath_filtering_consumer.cpp b/yt/yt/core/yson/ypath_filtering_consumer.cpp
new file mode 100644
index 00000000000..ec1b610623b
--- /dev/null
+++ b/yt/yt/core/yson/ypath_filtering_consumer.cpp
@@ -0,0 +1,446 @@
+#include "ypath_filtering_consumer.h"
+
+#include "null_consumer.h"
+
+#include <yt/yt/core/misc/error.h>
+
+#include <yt/yt/core/ypath/tokenizer.h>
+
+namespace NYT::NYson {
+
+////////////////////////////////////////////////////////////////////////////////
+
+namespace {
+
+////////////////////////////////////////////////////////////////////////////////
+
+struct TAtTokenTag
+{ };
+
+////////////////////////////////////////////////////////////////////////////////
+
+class TYPathFilteringConsumerBase
+ : public NYson::TYsonConsumerBase
+{
+public:
+ void OnStringScalar(TStringBuf value) override
+ {
+ BeforeValue();
+ Forward_->OnStringScalar(value);
+ }
+
+ void OnInt64Scalar(i64 value) override
+ {
+ BeforeValue();
+ Forward_->OnInt64Scalar(value);
+ }
+
+ void OnUint64Scalar(ui64 value) override
+ {
+ BeforeValue();
+ Forward_->OnUint64Scalar(value);
+ }
+
+ void OnDoubleScalar(double value) override
+ {
+ BeforeValue();
+ Forward_->OnDoubleScalar(value);
+ }
+
+ void OnBooleanScalar(bool value) override
+ {
+ BeforeValue();
+ Forward_->OnBooleanScalar(value);
+ }
+
+ void OnEntity() override
+ {
+ BeforeValue();
+ Forward_->OnEntity();
+ }
+
+ void OnBeginMap() override
+ {
+ BeforeValue();
+ AfterCollectionBegin_ = true;
+
+ Forward_->OnBeginMap();
+ }
+
+ void OnKeyedItem(TStringBuf key) override
+ {
+ if (!AfterCollectionBegin_) {
+ RollbackPath();
+ }
+ AfterCollectionBegin_ = false;
+ AppendPath(key);
+
+ Forward_->OnKeyedItem(key);
+ }
+
+ void OnEndMap() override
+ {
+ if (!AfterCollectionBegin_) {
+ RollbackPath();
+ }
+ AfterCollectionBegin_ = false;
+ BeforeEndDictionary();
+ Forward_->OnEndMap();
+ }
+
+ void OnBeginList() override
+ {
+ BeforeValue();
+ AfterCollectionBegin_ = true;
+ ListIndexes_.push_back(0);
+
+ Forward_->OnBeginList();
+ }
+
+ void OnListItem() override
+ {
+ if (!AfterCollectionBegin_) {
+ RollbackPath();
+ }
+ AfterCollectionBegin_ = false;
+ AppendPath(ListIndexes_.back());
+ ++ListIndexes_.back();
+
+ Forward_->OnListItem();
+ }
+
+ void OnEndList() override
+ {
+ if (!AfterCollectionBegin_) {
+ RollbackPath();
+ }
+ AfterCollectionBegin_ = false;
+ ListIndexes_.pop_back();
+
+ Forward_->OnEndList();
+
+ }
+
+ void OnBeginAttributes() override
+ {
+ AppendPath(TAtTokenTag{});
+
+ AfterCollectionBegin_ = true;
+
+ Forward_->OnBeginAttributes();
+ }
+
+ void OnEndAttributes() override
+ {
+ if (!AfterCollectionBegin_) {
+ RollbackPath();
+ }
+
+ BeforeEndDictionary();
+ Forward_->OnEndAttributes();
+ RollbackPath();
+ }
+
+protected:
+ virtual void AppendPath(TStringBuf literal) = 0;
+ virtual void AppendPath(int listIndex) = 0;
+ virtual void AppendPath(TAtTokenTag) = 0;
+
+ virtual void RollbackPath() = 0;
+
+ virtual void BeforeValue() = 0;
+ virtual void BeforeEndDictionary() = 0;
+
+ void SetForward(NYson::IYsonConsumer* consumer)
+ {
+ Forward_ = consumer;
+ }
+
+ void ResetForward()
+ {
+ Forward_ = GetNullYsonConsumer();
+ }
+
+ NYson::IYsonConsumer* GetForward()
+ {
+ return Forward_;
+ }
+
+private:
+ NYson::IYsonConsumer* Forward_;
+ bool AfterCollectionBegin_ = false;
+ std::vector<int> ListIndexes_;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+
+class TYPathFilteringConsumer
+ : public TYPathFilteringConsumerBase
+{
+public:
+ TYPathFilteringConsumer(
+ NYson::IYsonConsumer* underlying,
+ std::vector<NYPath::TYPath> paths,
+ EPathFilteringMode mode)
+ : Underlying_(underlying)
+ , Paths_(std::move(paths))
+ , Mode_(mode)
+ {
+ SetForward(Underlying_);
+ PerPathFilteringStates_.reserve(Paths_.size());
+ for (int i = 0; i < std::ssize(Paths_); ++i) {
+ PerPathFilteringStates_.push_back(TPathFilteringState{
+ .Tokenizer = NYPath::TTokenizer(Paths_[i]),
+ .MaxMatchedDepth = 0,
+ .Fulfilled = false,
+ .Index = i
+ });
+ }
+
+ for (auto& state : PerPathFilteringStates_) {
+ state.Tokenizer.Expect(NYPath::ETokenType::StartOfStream);
+ if (!ToNextLiteral(state.Tokenizer)) {
+ state.Fulfilled = true;
+ SubtreeFiltering_ = true;
+ FilteringDepth_ = Depth_;
+ }
+ }
+ }
+
+private:
+ struct TPathFilteringState
+ {
+ NYPath::TTokenizer Tokenizer;
+ int MaxMatchedDepth;
+ bool Fulfilled;
+ int Index;
+ };
+
+ NYson::IYsonConsumer* Underlying_;
+ const std::vector<NYPath::TYPath> Paths_;
+ const EPathFilteringMode Mode_;
+ bool SubtreeFiltering_ = false;
+ int FilteringDepth_ = -1;
+ std::vector<TPathFilteringState> PerPathFilteringStates_;
+ int Depth_ = 0;
+
+ // For asterisk (*) matching support only.
+ std::vector<TPathFilteringState> SavedFilteringStates_;
+
+ template <typename TTokenType>
+ void AppendPathImpl(TTokenType token)
+ {
+ ++Depth_;
+
+ bool advancedAnyPath = false;
+
+ for (auto& state : PerPathFilteringStates_) {
+ if (Depth_ != state.MaxMatchedDepth + 1 || state.Fulfilled) {
+ continue;
+ }
+
+ if (DoesMatch(state.Tokenizer, token)) {
+ if (state.Tokenizer.GetType() == NYPath::ETokenType::Asterisk) {
+ SaveFilteringState(state);
+ }
+
+ ++state.MaxMatchedDepth;
+ advancedAnyPath = true;
+ if (!ToNextLiteral(state.Tokenizer)) {
+ state.Fulfilled = true;
+
+ if (!SubtreeFiltering_) {
+ if (IsBlacklistMode()) {
+ ResetForward();
+ SubtreeFiltering_ = true;
+ FilteringDepth_ = Depth_;
+ } else if (IsWhitelistMode()) {
+ SubtreeFiltering_ = true;
+ FilteringDepth_ = Depth_;
+ }
+ }
+ }
+ }
+ }
+
+ if (IsWhitelistMode() && !SubtreeFiltering_) {
+ if (!advancedAnyPath) {
+ SubtreeFiltering_ = true;
+ FilteringDepth_ = Depth_;
+ ResetForward();
+ }
+ }
+ }
+
+ void AppendPath(TStringBuf literal) override
+ {
+ AppendPathImpl(literal);
+ }
+
+ void AppendPath(int listIndex) override
+ {
+ AppendPathImpl<TStringBuf>(NYPath::ToYPathLiteral(listIndex));
+ }
+
+ void AppendPath(TAtTokenTag tag) override
+ {
+ AppendPathImpl(tag);
+ }
+
+ void RollbackPath() override
+ {
+ if (SubtreeFiltering_ && Depth_ == FilteringDepth_) {
+ SubtreeFiltering_ = false;
+ SetForward(Underlying_);
+ }
+
+ --Depth_;
+
+ if (!IsForcedEntitiesMode()) {
+ while (!SavedFilteringStates_.empty() && SavedFilteringStates_.back().MaxMatchedDepth == Depth_) {
+ PerPathFilteringStates_[SavedFilteringStates_.back().Index] = std::move(SavedFilteringStates_.back());
+ SavedFilteringStates_.pop_back();
+ }
+ }
+ }
+
+ void BeforeEndDictionary() override
+ {
+ if (!IsForcedEntitiesMode()) {
+ return;
+ }
+
+ for (auto& state : PerPathFilteringStates_) {
+ if (Depth_ != state.MaxMatchedDepth || state.Fulfilled) {
+ continue;
+ }
+
+ auto& tokenizer = state.Tokenizer;
+ std::vector<bool> isAttributesStack;
+ tokenizer.Expect(NYPath::ETokenType::Literal);
+ GetForward()->OnKeyedItem(tokenizer.GetLiteralValue());
+ while(ToNextLiteral(tokenizer)) {
+ if (tokenizer.GetType() == NYPath::ETokenType::At) {
+ isAttributesStack.push_back(true);
+ GetForward()->OnBeginAttributes();
+ tokenizer.Advance();
+ } else {
+ isAttributesStack.push_back(false);
+ GetForward()->OnBeginMap();
+ }
+ tokenizer.Expect(NYPath::ETokenType::Literal);
+ GetForward()->OnKeyedItem(tokenizer.GetLiteralValue());
+ }
+ GetForward()->OnEntity();
+ tokenizer.Expect(NYPath::ETokenType::EndOfStream);
+ while(!isAttributesStack.empty()) {
+ if (isAttributesStack.back()) {
+ GetForward()->OnEndAttributes();
+ } else {
+ GetForward()->OnEndMap();
+ }
+ isAttributesStack.pop_back();
+ }
+
+ state.Fulfilled = true;
+ }
+ }
+
+ void BeforeValue() override
+ {
+ for (auto& state : PerPathFilteringStates_) {
+ if (Depth_ != state.MaxMatchedDepth || state.Fulfilled) {
+ continue;
+ }
+
+ if (state.Tokenizer.GetType() == NYPath::ETokenType::At) {
+ OnBeginAttributes();
+ OnEndAttributes();
+ return;
+ }
+ }
+ }
+
+ bool ToNextLiteral(NYPath::TTokenizer& tokenizer)
+ {
+ if (tokenizer.GetType() == NYPath::ETokenType::At) {
+ return tokenizer.Advance() != NYPath::ETokenType::EndOfStream;
+ }
+ tokenizer.Advance();
+ if (tokenizer.GetType() == NYPath::ETokenType::EndOfStream) {
+ return false;
+ } else {
+ tokenizer.Expect(NYPath::ETokenType::Slash);
+ tokenizer.Advance();
+ return true;
+ }
+ }
+
+ bool IsBlacklistMode() const
+ {
+ return Mode_ == EPathFilteringMode::Blacklist;
+ }
+
+ bool IsWhitelistMode() const
+ {
+ return Mode_ == EPathFilteringMode::Whitelist || Mode_ == EPathFilteringMode::WhitelistWithForcedEntities;
+ }
+
+ bool IsForcedEntitiesMode() const
+ {
+ return Mode_ == EPathFilteringMode::ForcedEntities || Mode_ == EPathFilteringMode::WhitelistWithForcedEntities;
+ }
+
+ template <typename TTokenType>
+ bool DoesMatch(const NYPath::TTokenizer& tokenizer, TTokenType) const
+ {
+ if (tokenizer.GetType() == NYPath::ETokenType::At) {
+ return std::is_same_v<TTokenType, TAtTokenTag>;
+ }
+
+ return false;
+ }
+
+ template <>
+ bool DoesMatch<TStringBuf>(const NYPath::TTokenizer& tokenizer, TStringBuf token) const
+ {
+ if (tokenizer.GetType() == NYPath::ETokenType::Asterisk) {
+ THROW_ERROR_EXCEPTION_IF(IsForcedEntitiesMode(),
+ "YPathFilteringConsumer does not allow asterisk matching in forced entities modes");
+ return true;
+ }
+
+ tokenizer.Expect(NYPath::ETokenType::Literal);
+ return tokenizer.GetLiteralValue() == token;
+ }
+
+ void SaveFilteringState(const TPathFilteringState& state)
+ {
+ SavedFilteringStates_.push_back(TPathFilteringState{
+ .Tokenizer = NYPath::TTokenizer(state.Tokenizer.GetInput()),
+ .MaxMatchedDepth = state.MaxMatchedDepth,
+ .Fulfilled = state.Fulfilled,
+ .Index = state.Index,
+ });
+
+ SavedFilteringStates_.back().Tokenizer.Skip(NYPath::ETokenType::StartOfStream);
+ }
+};
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace
+
+////////////////////////////////////////////////////////////////////////////////
+
+std::unique_ptr<NYson::IYsonConsumer> CreateYPathFilteringConsumer(
+ NYson::IYsonConsumer* underlying,
+ std::vector<NYPath::TYPath> paths,
+ EPathFilteringMode mode)
+{
+ return std::make_unique<TYPathFilteringConsumer>(underlying, std::move(paths), mode);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NYT::NYson
diff --git a/yt/yt/core/yson/ypath_filtering_consumer.h b/yt/yt/core/yson/ypath_filtering_consumer.h
new file mode 100644
index 00000000000..afbd0c02364
--- /dev/null
+++ b/yt/yt/core/yson/ypath_filtering_consumer.h
@@ -0,0 +1,41 @@
+#pragma once
+
+#include <yt/yt/core/ypath/public.h>
+
+#include <library/cpp/yt/yson/consumer.h>
+
+namespace NYT::NYson {
+
+///////////////////////////////////////////////////////////////////////////////
+
+DEFINE_ENUM(EPathFilteringMode,
+ (Blacklist)
+ (Whitelist)
+ (WhitelistWithForcedEntities)
+ (ForcedEntities)
+);
+
+////////////////////////////////////////////////////////////////////////////////
+
+// Creates consumer that wraps underlying consumer providing
+// filtering and missing value handling support.
+// Several filtering modes are supported:
+// - In `Blacklist` mode all nodes inside matched paths are omitted.
+// - In `Whitelist` mode all nodes outside matched paths are omitted.
+// - In `ForcedEntities` mode an entity node is inserted in case
+// no value at given path is consumed.
+// - The `WhitelistWithForcedEntities` values are consumed only at provided
+// paths and entities are inserted in case of missing values.
+// Attribute handling is available in all modes. For `ForcedEntities` modes
+// `/@` path stands for inserting empty attribute dictionary, `/@ATTRIBUTE_NAME` for
+// inserting the certain attribute.
+// Asterisk matching is allowed only for `Blacklist` and `Whitelist` modes.
+// Only the `EYsonType::Node` consuming is supported.
+std::unique_ptr<NYson::IYsonConsumer> CreateYPathFilteringConsumer(
+ NYson::IYsonConsumer* underlying,
+ std::vector<NYPath::TYPath> paths,
+ EPathFilteringMode mode);
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NYT::NYson
diff --git a/yt/yt/core/ytree/public.h b/yt/yt/core/ytree/public.h
index f3265bb0855..2c512145278 100644
--- a/yt/yt/core/ytree/public.h
+++ b/yt/yt/core/ytree/public.h
@@ -19,13 +19,13 @@ class TAttributeFilter;
struct TAttributeFilter;
-class TYsonSerializableLite;
-class TYsonSerializable;
-
struct IYsonStructMeta;
class TYsonStructBase;
class TYsonStructLite;
+template <class T>
+concept CYsonStructDerived = std::derived_from<T, TYsonStructBase>;
+
DECLARE_REFCOUNTED_STRUCT(INode)
using IConstNodePtr = TIntrusivePtr<const INode>;
DECLARE_REFCOUNTED_STRUCT(ICompositeNode)
@@ -76,7 +76,6 @@ constexpr i64 DefaultVirtualChildLimit = 1000;
//! NB: Changing this value will invalidate all changelogs!
constexpr int MaxYPathResolveIterations = 256;
-DECLARE_REFCOUNTED_CLASS(TYsonSerializable)
DECLARE_REFCOUNTED_CLASS(TYsonStruct)
DECLARE_REFCOUNTED_CLASS(TYPathServiceContextWrapper)
diff --git a/yt/yt/core/ytree/unittests/ya.make b/yt/yt/core/ytree/unittests/ya.make
index 843bb076059..034ba0a1d5d 100644
--- a/yt/yt/core/ytree/unittests/ya.make
+++ b/yt/yt/core/ytree/unittests/ya.make
@@ -17,7 +17,6 @@ SRCS(
tree_builder_ut.cpp
lazy_ypath_service_ut.cpp
yson_schema_ut.cpp
- yson_serializable_ut.cpp
yson_struct_ut.cpp
ytree_fluent_ut.cpp
ytree_ut.cpp
diff --git a/yt/yt/core/ytree/unittests/yson_serializable_ut.cpp b/yt/yt/core/ytree/unittests/yson_serializable_ut.cpp
deleted file mode 100644
index 12835350a36..00000000000
--- a/yt/yt/core/ytree/unittests/yson_serializable_ut.cpp
+++ /dev/null
@@ -1,1171 +0,0 @@
-#include <yt/yt/core/test_framework/framework.h>
-
-#include <yt/yt/core/yson/writer.h>
-
-#include <yt/yt/core/ytree/ephemeral_node_factory.h>
-#include <yt/yt/core/ytree/fluent.h>
-#include <yt/yt/core/ytree/tree_builder.h>
-#include <yt/yt/core/ytree/tree_visitor.h>
-#include <yt/yt/core/ytree/ypath_client.h>
-#include <yt/yt/core/ytree/yson_serializable.h>
-#include <yt/yt/core/ytree/yson_struct.h>
-
-#include <array>
-
-namespace NYT::NYTree {
-namespace {
-
-using namespace NYson;
-
-////////////////////////////////////////////////////////////////////////////////
-
-DEFINE_ENUM(ETestEnum,
- (Value0)
- (Value1)
- (Value2)
-);
-
-////////////////////////////////////////////////////////////////////////////////
-
-struct TTestSubconfig
- : public TYsonSerializable
-{
- int MyInt;
- unsigned int MyUint;
- bool MyBool;
- std::vector<TString> MyStringList;
- ETestEnum MyEnum;
-
- TTestSubconfig()
- {
- RegisterParameter("my_int", MyInt).Default(100).InRange(95, 205);
- RegisterParameter("my_uint", MyUint).Default(50).InRange(31, 117);
- RegisterParameter("my_bool", MyBool).Default(false);
- RegisterParameter("my_string_list", MyStringList).Default();
- RegisterParameter("my_enum", MyEnum).Default(ETestEnum::Value1);
- }
-};
-
-using TTestSubconfigPtr = TIntrusivePtr<TTestSubconfig>;
-
-////////////////////////////////////////////////////////////////////////////////
-
-class TTestConfig
- : public TYsonSerializable
-{
-public:
- TString MyString;
- TTestSubconfigPtr Subconfig;
- std::vector<TTestSubconfigPtr> SubconfigList;
- std::unordered_map<TString, TTestSubconfigPtr> SubconfigMap;
- std::optional<i64> NullableInt;
-
- TTestConfig()
- {
- SetUnrecognizedStrategy(EUnrecognizedStrategy::KeepRecursive);
-
- RegisterParameter("my_string", MyString).NonEmpty();
- RegisterParameter("sub", Subconfig).DefaultNew();
- RegisterParameter("sub_list", SubconfigList).Default();
- RegisterParameter("sub_map", SubconfigMap).Default();
- RegisterParameter("nullable_int", NullableInt).Default();
-
- RegisterPreprocessor([&] () {
- MyString = "x";
- Subconfig->MyInt = 200;
- });
- }
-};
-
-using TTestConfigPtr = TIntrusivePtr<TTestConfig>;
-
-////////////////////////////////////////////////////////////////////////////////
-
-class TSimpleYsonSerializable
- : public TYsonSerializable
-{
-public:
- int IntValue;
-
- TSimpleYsonSerializable()
- {
- RegisterParameter("int_value", IntValue)
- .Default(1);
- }
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
-class TSimpleYsonStruct
- : public TYsonStruct
-{
-public:
- int IntValue;
-
- REGISTER_YSON_STRUCT(TSimpleYsonStruct);
-
- static void Register(TRegistrar registrar)
- {
- registrar.Parameter("int_value", &TSimpleYsonStruct::IntValue)
- .Default(1);
- }
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
-class TYsonSerializableWithSimpleYsonStruct
- : public TYsonSerializable
-{
-public:
- TIntrusivePtr<TSimpleYsonStruct> YsonStruct;
-
- TYsonSerializableWithSimpleYsonStruct()
- {
- SetUnrecognizedStrategy(EUnrecognizedStrategy::KeepRecursive);
-
- RegisterParameter("yson_struct", YsonStruct)
- .DefaultNew();
- }
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
-// {LoadFromNode}
-using TYsonSerializableParseTestParameter = std::tuple<bool>;
-
-class TYsonSerializableParseTest
- : public ::testing::TestWithParam<TYsonSerializableParseTestParameter>
-{
-public:
- template <typename T>
- TIntrusivePtr<T> Load(
- const INodePtr& node,
- bool postprocess = true,
- bool setDefaults = true,
- const NYPath::TYPath& path = {})
- {
- auto [loadFromNode] = GetParam();
- auto config = New<T>();
- if (loadFromNode) {
- config->Load(node, postprocess, setDefaults, path);
- } else {
- auto ysonString = ConvertToYsonString(node);
- auto string = ysonString.ToString();
- TStringInput input(string);
- TYsonPullParser parser(&input, EYsonType::Node);
- auto cursor = TYsonPullParserCursor(&parser);
- config->Load(&cursor, postprocess, setDefaults, path);
- }
- return config;
- }
-
- template <typename T>
- TIntrusivePtr<T> Load(const TYsonStringBuf& yson)
- {
- return Load<T>(ConvertTo<INodePtr>(yson));
- }
-};
-
-INSTANTIATE_TEST_SUITE_P(
- LoadFromNode,
- TYsonSerializableParseTest,
- ::testing::Values(TYsonSerializableParseTestParameter{
- true
- })
-);
-
-INSTANTIATE_TEST_SUITE_P(
- LoadFromCursor,
- TYsonSerializableParseTest,
- ::testing::Values(TYsonSerializableParseTestParameter{
- false
- })
-);
-
-////////////////////////////////////////////////////////////////////////////////
-
-void TestCompleteSubconfig(TTestSubconfig* subconfig)
-{
- EXPECT_EQ(99, subconfig->MyInt);
- EXPECT_EQ(101u, subconfig->MyUint);
- EXPECT_TRUE(subconfig->MyBool);
- EXPECT_EQ(3u, subconfig->MyStringList.size());
- EXPECT_EQ("ListItem0", subconfig->MyStringList[0]);
- EXPECT_EQ("ListItem1", subconfig->MyStringList[1]);
- EXPECT_EQ("ListItem2", subconfig->MyStringList[2]);
- EXPECT_EQ(ETestEnum::Value2, subconfig->MyEnum);
-}
-
-TEST_P(TYsonSerializableParseTest, Complete)
-{
- auto configNode = BuildYsonNodeFluently()
- .BeginMap()
- .Item("my_string").Value("TestString")
- .Item("sub").BeginMap()
- .Item("my_int").Value(99)
- .Item("my_uint").Value(101)
- .Item("my_bool").Value(true)
- .Item("my_enum").Value("value2")
- .Item("my_string_list").BeginList()
- .Item().Value("ListItem0")
- .Item().Value("ListItem1")
- .Item().Value("ListItem2")
- .EndList()
- .EndMap()
- .Item("sub_list").BeginList()
- .Item().BeginMap()
- .Item("my_int").Value(99)
- .Item("my_uint").Value(101)
- .Item("my_bool").Value(true)
- .Item("my_enum").Value("value2")
- .Item("my_string_list").BeginList()
- .Item().Value("ListItem0")
- .Item().Value("ListItem1")
- .Item().Value("ListItem2")
- .EndList()
- .EndMap()
- .Item().BeginMap()
- .Item("my_int").Value(99)
- .Item("my_uint").Value(101)
- .Item("my_bool").Value(true)
- .Item("my_enum").Value("value2")
- .Item("my_string_list").BeginList()
- .Item().Value("ListItem0")
- .Item().Value("ListItem1")
- .Item().Value("ListItem2")
- .EndList()
- .EndMap()
- .EndList()
- .Item("sub_map").BeginMap()
- .Item("sub1").BeginMap()
- .Item("my_int").Value(99)
- .Item("my_uint").Value(101)
- .Item("my_bool").Value(true)
- .Item("my_enum").Value("value2")
- .Item("my_string_list").BeginList()
- .Item().Value("ListItem0")
- .Item().Value("ListItem1")
- .Item().Value("ListItem2")
- .EndList()
- .EndMap()
- .Item("sub2").BeginMap()
- .Item("my_int").Value(99)
- .Item("my_uint").Value(101)
- .Item("my_bool").Value(true)
- .Item("my_enum").Value("value2")
- .Item("my_string_list").BeginList()
- .Item().Value("ListItem0")
- .Item().Value("ListItem1")
- .Item().Value("ListItem2")
- .EndList()
- .EndMap()
- .EndMap()
- .EndMap();
-
- auto config = Load<TTestConfig>(configNode->AsMap());
-
- EXPECT_EQ("TestString", config->MyString);
- TestCompleteSubconfig(config->Subconfig.Get());
- EXPECT_EQ(2u, config->SubconfigList.size());
- TestCompleteSubconfig(config->SubconfigList[0].Get());
- TestCompleteSubconfig(config->SubconfigList[1].Get());
- EXPECT_EQ(2u, config->SubconfigMap.size());
- auto it1 = config->SubconfigMap.find("sub1");
- EXPECT_FALSE(it1 == config->SubconfigMap.end());
- TestCompleteSubconfig(it1->second.Get());
- auto it2 = config->SubconfigMap.find("sub2");
- EXPECT_FALSE(it2 == config->SubconfigMap.end());
- TestCompleteSubconfig(it2->second.Get());
-}
-
-TEST_P(TYsonSerializableParseTest, MissingParameter)
-{
- auto configNode = BuildYsonNodeFluently()
- .BeginMap()
- .Item("my_string").Value("TestString")
- .Item("sub").BeginMap()
- .Item("my_bool").Value(true)
- .EndMap()
- .EndMap();
-
- auto config = Load<TTestConfig>(configNode->AsMap());
-
- EXPECT_EQ("TestString", config->MyString);
- EXPECT_EQ(200, config->Subconfig->MyInt);
- EXPECT_TRUE(config->Subconfig->MyBool);
- EXPECT_EQ(0u, config->Subconfig->MyStringList.size());
- EXPECT_EQ(ETestEnum::Value1, config->Subconfig->MyEnum);
- EXPECT_EQ(0u, config->SubconfigList.size());
- EXPECT_EQ(0u, config->SubconfigMap.size());
-}
-
-TEST_P(TYsonSerializableParseTest, MissingSubconfig)
-{
- auto configNode = BuildYsonNodeFluently()
- .BeginMap()
- .Item("my_string").Value("TestString")
- .EndMap();
-
- auto config = Load<TTestConfig>(configNode->AsMap());
-
- EXPECT_EQ("TestString", config->MyString);
- EXPECT_EQ(200, config->Subconfig->MyInt);
- EXPECT_FALSE(config->Subconfig->MyBool);
- EXPECT_EQ(0u, config->Subconfig->MyStringList.size());
- EXPECT_EQ(ETestEnum::Value1, config->Subconfig->MyEnum);
- EXPECT_EQ(0u, config->SubconfigList.size());
- EXPECT_EQ(0u, config->SubconfigMap.size());
-}
-
-TEST_P(TYsonSerializableParseTest, UnrecognizedSimple)
-{
- auto configNode = BuildYsonNodeFluently()
- .BeginMap()
- .Item("my_string").Value("TestString")
- .Item("option").Value(1)
- .EndMap();
-
- auto config = Load<TTestConfig>(configNode->AsMap());
-
- auto unrecognizedNode = config->GetUnrecognized();
- auto unrecognizedRecursivelyNode = config->GetUnrecognizedRecursively();
- EXPECT_TRUE(AreNodesEqual(unrecognizedNode, unrecognizedRecursivelyNode));
- EXPECT_EQ(1, unrecognizedNode->GetChildCount());
- for (const auto& [key, child] : unrecognizedNode->GetChildren()) {
- EXPECT_EQ("option", key);
- EXPECT_EQ(1, child->AsInt64()->GetValue());
- }
-
- auto output = ConvertToYsonString(config, NYson::EYsonFormat::Text);
- auto deserializedConfig = ConvertTo<TTestConfigPtr>(output);
- EXPECT_TRUE(AreNodesEqual(ConvertToNode(config), ConvertToNode(deserializedConfig)));
-}
-
-TEST_P(TYsonSerializableParseTest, UnrecognizedRecursive)
-{
- auto configNode = BuildYsonNodeFluently()
- .BeginMap()
- .Item("my_string").Value("TestString")
- .Item("option").Value(1)
- .Item("sub").BeginMap()
- .Item("sub_option").Value(42)
- .EndMap()
- .EndMap();
-
- auto config = Load<TTestConfig>(configNode->AsMap());
-
- auto unrecognizedRecursivelyNode = config->GetUnrecognizedRecursively();
- EXPECT_EQ(2, unrecognizedRecursivelyNode->GetChildCount());
- for (const auto& [key, child] : unrecognizedRecursivelyNode->GetChildren()) {
- if (key == "option") {
- EXPECT_EQ(1, child->AsInt64()->GetValue());
- } else {
- EXPECT_EQ("sub", key);
- EXPECT_EQ(42, child->AsMap()->GetChildOrThrow("sub_option")->AsInt64()->GetValue());
- }
- }
-
- auto output = ConvertToYsonString(config, NYson::EYsonFormat::Text);
- auto deserializedConfig = ConvertTo<TTestConfigPtr>(output);
- EXPECT_TRUE(AreNodesEqual(ConvertToNode(config), ConvertToNode(deserializedConfig)));
-}
-
-TEST_P(TYsonSerializableParseTest, UnrecognizedWithNestedYsonStruct)
-{
- auto configNode = BuildYsonNodeFluently()
- .BeginMap()
- .Item("yson_struct").BeginMap()
- .Item("unrecognized").Value(1)
- .EndMap()
- .EndMap();
-
- auto config = Load<TYsonSerializableWithSimpleYsonStruct>(configNode->AsMap());
-
- auto unrecognized = config->GetRecursiveUnrecognized();
- EXPECT_EQ(
- ConvertToYsonString(configNode, EYsonFormat::Text).AsStringBuf(),
- ConvertToYsonString(unrecognized, EYsonFormat::Text).AsStringBuf());
-}
-
-TEST_P(TYsonSerializableParseTest, MissingRequiredParameter)
-{
- auto configNode = BuildYsonNodeFluently()
- .BeginMap()
- .Item("sub").BeginMap()
- .Item("my_int").Value(99)
- .Item("my_bool").Value(true)
- .EndMap()
- .EndMap();
-
- EXPECT_THROW(Load<TTestConfig>(configNode->AsMap()), std::exception);
-}
-
-TEST_P(TYsonSerializableParseTest, IncorrectNodeType)
-{
- auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
- builder->BeginTree();
- BuildYsonFluently(builder.get())
- .BeginMap()
- .Item("my_string").Value(1) // incorrect type
- .EndMap();
- auto configNode = builder->EndTree();
-
- EXPECT_THROW(Load<TTestConfig>(configNode->AsMap()), std::exception);
-}
-
-TEST_P(TYsonSerializableParseTest, ArithmeticOverflow)
-{
- auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
- builder->BeginTree();
- BuildYsonFluently(builder.get())
- .BeginMap()
- .Item("my_string").Value("TestString")
- .Item("sub").BeginMap()
- .Item("my_int").Value(Max<i64>())
- .Item("my_bool").Value(true)
- .Item("my_enum").Value("Value2")
- .Item("my_string_list").BeginList()
- .Item().Value("ListItem0")
- .Item().Value("ListItem1")
- .Item().Value("ListItem2")
- .EndList()
- .EndMap()
- .EndMap();
- auto configNode = builder->EndTree();
-
- EXPECT_THROW(Load<TTestConfig>(configNode->AsMap()), std::exception);
-}
-
-TEST_P(TYsonSerializableParseTest, Postprocess)
-{
- auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
- builder->BeginTree();
- BuildYsonFluently(builder.get())
- .BeginMap()
- .Item("my_string").Value("") // empty!
- .EndMap();
- auto configNode = builder->EndTree();
-
- auto config = Load<TTestConfig>(configNode, false);
- EXPECT_THROW(config->Postprocess(), std::exception);
-}
-
-TEST_P(TYsonSerializableParseTest, PostprocessSubconfig)
-{
- auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
- builder->BeginTree();
- BuildYsonFluently(builder.get())
- .BeginMap()
- .Item("my_string").Value("TestString")
- .Item("sub").BeginMap()
- .Item("my_int").Value(210) // out of range
- .EndMap()
- .EndMap();
- auto configNode = builder->EndTree();
-
- auto config = Load<TTestConfig>(configNode, false);
- EXPECT_THROW(config->Postprocess(), std::exception);
-}
-
-TEST_P(TYsonSerializableParseTest, PostprocessSubconfigList)
-{
- auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
- builder->BeginTree();
- BuildYsonFluently(builder.get())
- .BeginMap()
- .Item("my_string").Value("TestString")
- .Item("sub_list").BeginList()
- .Item().BeginMap()
- .Item("my_int").Value(210) // out of range
- .EndMap()
- .EndList()
- .EndMap();
- auto configNode = builder->EndTree();
-
- auto config = Load<TTestConfig>(configNode, false);
- EXPECT_THROW(config->Postprocess(), std::exception);
-}
-
-TEST_P(TYsonSerializableParseTest, PostprocessSubconfigMap)
-{
- auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
- builder->BeginTree();
- BuildYsonFluently(builder.get())
- .BeginMap()
- .Item("my_string").Value("TestString")
- .Item("sub_map").BeginMap()
- .Item("sub").BeginMap()
- .Item("my_int").Value(210) // out of range
- .EndMap()
- .EndMap()
- .EndMap();
- auto configNode = builder->EndTree();
-
- auto config = Load<TTestConfig>(configNode, false);
- EXPECT_THROW(config->Postprocess(), std::exception);
-}
-
-TEST(TYsonSerializableTest, SaveSingleParameter)
-{
- auto config = New<TTestConfig>();
- config->MyString = "test";
- config->NullableInt = 10;
-
- auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
- builder->BeginTree();
- config->SaveParameter("my_string", builder.get());
- auto actual = ConvertTo<TString>(builder->EndTree());
- EXPECT_EQ("test", actual);
-}
-
-TEST(TYsonSerializableTest, LoadSingleParameter)
-{
- auto config = New<TTestConfig>();
- config->NullableInt = 10;
-
- config->LoadParameter("my_string", ConvertToNode("test"), EMergeStrategy::Default);
- EXPECT_EQ("test", config->MyString);
- EXPECT_EQ(10, config->NullableInt);
-}
-
-TEST(TYsonSerializableTest, LoadSingleParameterWithMergeStrategy)
-{
- auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
- builder->BeginTree();
- BuildYsonFluently(builder.get())
- .BeginMap()
- .Item("my_int").Value(100)
- .EndMap();
- auto subConfig = builder->EndTree();
-
- auto config1 = New<TTestConfig>();
- config1->Subconfig->MyBool = true;
- config1->LoadParameter("sub", subConfig, EMergeStrategy::Default);
- EXPECT_EQ(100, config1->Subconfig->MyInt);
- EXPECT_TRUE(config1->Subconfig->MyBool); // Subconfig merged by default.
-
- auto config2 = New<TTestConfig>();
- config2->Subconfig->MyBool = true;
- config2->LoadParameter("sub", subConfig, EMergeStrategy::Overwrite);
- EXPECT_EQ(100, config2->Subconfig->MyInt);
- EXPECT_FALSE(config2->Subconfig->MyBool); // Overwrite destroyed previous values.
-}
-
-TEST(TYsonSerializableTest, ResetSingleParameter)
-{
- auto config = New<TTestSubconfig>();
- config->MyInt = 10;
- config->MyUint = 10;
-
- config->ResetParameter("my_int");
- EXPECT_EQ(100, config->MyInt); // Default value.
- EXPECT_EQ(10u, config->MyUint);
-}
-
-TEST(TYsonSerializableTest, Save)
-{
- auto config = New<TTestConfig>();
-
- // add non-default fields;
- config->MyString = "hello!";
- config->SubconfigList.push_back(New<TTestSubconfig>());
- config->SubconfigMap["item"] = New<TTestSubconfig>();
- config->NullableInt = 42;
-
- auto output = ConvertToYsonString(config, NYson::EYsonFormat::Text);
-
- TString subconfigYson =
- "{\"my_bool\"=%false;"
- "\"my_enum\"=\"value1\";"
- "\"my_int\"=200;"
- "\"my_uint\"=50u;"
- "\"my_string_list\"=[]}";
-
- TString subconfigYsonOrigin =
- "{\"my_bool\"=%false;"
- "\"my_enum\"=\"value1\";"
- "\"my_int\"=100;"
- "\"my_uint\"=50u;"
- "\"my_string_list\"=[]}";
-
- TString expectedYson;
- expectedYson += "{\"my_string\"=\"hello!\";";
- expectedYson += "\"sub\"=" + subconfigYson + ";";
- expectedYson += "\"sub_list\"=[" + subconfigYsonOrigin + "];";
- expectedYson += "\"sub_map\"={\"item\"=" + subconfigYsonOrigin + "};";
- expectedYson += "\"nullable_int\"=42}";
-
- EXPECT_TRUE(AreNodesEqual(
- ConvertToNode(TYsonString(expectedYson)),
- ConvertToNode(output)));
-}
-
-TEST(TYsonSerializableTest, TestConfigUpdate)
-{
- auto config = New<TTestConfig>();
- {
- auto newConfig = UpdateYsonSerializable(config, nullptr);
- EXPECT_EQ(newConfig->Subconfig->MyInt, 200);
- }
-
- {
- auto newConfig = UpdateYsonSerializable(config, ConvertToNode(TYsonString(TStringBuf("{\"sub\"={\"my_int\"=150}}"))));
- EXPECT_EQ(newConfig->Subconfig->MyInt, 150);
- }
-
- {
- auto newConfig = UpdateYsonSerializable(config, ConvertToNode(TYsonString(TStringBuf("{\"sub\"={\"my_int_\"=150}}"))));
- EXPECT_EQ(newConfig->Subconfig->MyInt, 200);
- }
-}
-
-TEST(TYsonSerializableTest, NoDefaultNewAliasing)
-{
- auto config1 = New<TTestConfig>();
- auto config2 = New<TTestConfig>();
- EXPECT_NE(config1->Subconfig, config2->Subconfig);
-}
-
-TEST(TYsonSerializableTest, Reconfigure)
-{
- auto config = New<TTestConfig>();
- auto subconfig = config->Subconfig;
-
- EXPECT_EQ("x", config->MyString);
- EXPECT_EQ(200, subconfig->MyInt);
-
- auto configNode1 = BuildYsonNodeFluently()
- .BeginMap()
- .Item("my_string").Value("y")
- .EndMap();
- ReconfigureYsonSerializable(config, configNode1);
-
- EXPECT_EQ("y", config->MyString);
- EXPECT_EQ(subconfig, config->Subconfig);
- EXPECT_EQ(200, subconfig->MyInt);
-
- auto configNode2 = BuildYsonNodeFluently()
- .BeginMap()
- .Item("my_string").Value("z")
- .Item("sub").BeginMap()
- .Item("my_int").Value(95)
- .EndMap()
- .EndMap();
- ReconfigureYsonSerializable(config, configNode2);
-
- EXPECT_EQ("z", config->MyString);
- EXPECT_EQ(subconfig, config->Subconfig);
- EXPECT_EQ(95, subconfig->MyInt);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-class TTestConfigLite
- : public TYsonSerializableLite
-{
-public:
- TString MyString;
- std::optional<i64> NullableInt;
-
- TTestConfigLite()
- {
- RegisterParameter("my_string", MyString).NonEmpty();
- RegisterParameter("nullable_int", NullableInt).Default();
- }
-};
-
-TEST(TYsonSerializableTest, SaveLite)
-{
- TTestConfigLite config;
-
- config.MyString = "hello!";
- config.NullableInt = 42;
-
- auto output = ConvertToYsonString(config, NYson::EYsonFormat::Text);
-
- TString expectedYson;
- expectedYson += "{\"my_string\"=\"hello!\";";
- expectedYson += "\"nullable_int\"=42}";
-
- EXPECT_TRUE(AreNodesEqual(
- ConvertToNode(TYsonString(expectedYson)),
- ConvertToNode(output)));
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-class TTestConfigWithAliases
- : public TYsonSerializable
-{
-public:
- TString Value;
-
- TTestConfigWithAliases()
- {
- RegisterParameter("key", Value)
- .Alias("alias1")
- .Alias("alias2");
- }
-};
-
-TEST_P(TYsonSerializableParseTest, Aliases1)
-{
- auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
- builder->BeginTree();
- BuildYsonFluently(builder.get())
- .BeginMap()
- .Item("key").Value("value")
- .EndMap();
- auto configNode = builder->EndTree();
-
- auto config = Load<TTestConfigWithAliases>(configNode->AsMap(), false);
-
- EXPECT_EQ("value", config->Value);
-}
-
-TEST_P(TYsonSerializableParseTest, Aliases2)
-{
- auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
- builder->BeginTree();
- BuildYsonFluently(builder.get())
- .BeginMap()
- .Item("alias1").Value("value")
- .EndMap();
- auto configNode = builder->EndTree();
-
- auto config = Load<TTestConfigWithAliases>(configNode->AsMap(), false);
-
- EXPECT_EQ("value", config->Value);
-}
-
-TEST_P(TYsonSerializableParseTest, Aliases3)
-{
- auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
- builder->BeginTree();
- BuildYsonFluently(builder.get())
- .BeginMap()
- .Item("alias1").Value("value")
- .Item("alias2").Value("value")
- .EndMap();
- auto configNode = builder->EndTree();
-
- auto config = Load<TTestConfigWithAliases>(configNode->AsMap(), false);
-
- EXPECT_EQ("value", config->Value);
-}
-
-TEST_P(TYsonSerializableParseTest, Aliases4)
-{
- auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
- builder->BeginTree();
- BuildYsonFluently(builder.get())
- .BeginMap()
- .Item("alias1").Value("value1")
- .Item("alias2").Value("value2")
- .EndMap();
- auto configNode = builder->EndTree();
-
- EXPECT_THROW(Load<TTestConfigWithAliases>(configNode->AsMap()), std::exception);
-}
-
-TEST_P(TYsonSerializableParseTest, Aliases5)
-{
- auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
- builder->BeginTree();
- BuildYsonFluently(builder.get())
- .BeginMap()
- .EndMap();
- auto configNode = builder->EndTree();
-
- EXPECT_THROW(Load<TTestConfigWithAliases>(configNode->AsMap()), std::exception);
-}
-
-TEST_P(TYsonSerializableParseTest, ParameterTuplesAndContainers)
-{
- class TTestClass
- : public NYTree::TYsonSerializable
- {
- public:
- std::vector<TString> Vector;
- std::array<TString, 3> Array;
- std::pair<size_t, TString> Pair;
- std::set<TString> Set;
- std::map<TString, int> Map;
- std::multiset<int> MultiSet;
- std::unordered_set<TString> UnorderedSet;
- std::unordered_map<TString, int> UnorderedMap;
- std::unordered_multiset<size_t> UnorderedMultiSet;
-
- TTestClass()
- {
- RegisterParameter("vector", Vector)
- .Default();
- RegisterParameter("array", Array)
- .Default();
- RegisterParameter("pair", Pair)
- .Default();
- RegisterParameter("set", Set)
- .Default();
- RegisterParameter("map", Map)
- .Default();
- RegisterParameter("multiset", MultiSet)
- .Default();
- RegisterParameter("unordered_set", UnorderedSet)
- .Default();
- RegisterParameter("unordered_map", UnorderedMap)
- .Default();
- RegisterParameter("unordered_multiset", UnorderedMultiSet)
- .Default();
- }
- };
-
- auto original = New<TTestClass>();
- original->Vector = { "fceswf", "sadfcesa" };
- original->Array = {{ "UYTUY", ":LL:a", "78678678" }};
- original->Pair = { 7U, "UYTUY" };
- original->Set = { " q!", "12343e", "svvr", "0001" };
- original->Map = { {"!", 4398}, {"zzz", 0} };
- original->MultiSet = { 33, 33, 22, 22, 11 };
- original->UnorderedSet = { "41", "52", "001", "set" };
- original->UnorderedMap = { {"12345", 8}, {"XXX", 9}, {"XYZ", 42} };
- original->UnorderedMultiSet = { 1U, 2U, 1U, 0U, 0U };
-
- auto deserialized = Load<TTestClass>(ConvertToYsonString(*original));
-
- EXPECT_EQ(original->Vector, deserialized->Vector);
- EXPECT_EQ(original->Array, deserialized->Array);
- EXPECT_EQ(original->Pair, deserialized->Pair);
- EXPECT_EQ(original->Set, deserialized->Set);
- EXPECT_EQ(original->Map, deserialized->Map);
- EXPECT_EQ(original->MultiSet, deserialized->MultiSet);
- EXPECT_EQ(original->UnorderedSet, deserialized->UnorderedSet);
- EXPECT_EQ(original->UnorderedMap, deserialized->UnorderedMap);
- EXPECT_EQ(original->UnorderedMultiSet, deserialized->UnorderedMultiSet);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-TEST(TYsonSerializableTest, EnumAsKeyToYHash)
-{
- THashMap<ETestEnum, TString> deserialized, original = {
- {ETestEnum::Value0, "abc"}
- };
-
- TString serialized = "{\"value0\"=\"abc\";}";
- ASSERT_EQ(serialized, ConvertToYsonString(original, EYsonFormat::Text).AsStringBuf());
-
- Deserialize(deserialized, ConvertToNode(TYsonString(serialized, EYsonType::Node)));
-
- ASSERT_EQ(original, deserialized);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-TEST_P(TYsonSerializableParseTest, NullableWithNonNullDefault)
-{
- class TConfig
- : public TYsonSerializable
- {
- public:
- std::optional<int> Value;
-
- TConfig()
- {
- RegisterParameter("value", Value)
- .Default(123);
- }
- };
-
- {
- auto config = Load<TConfig>(TYsonStringBuf("{}"));
- EXPECT_EQ(123, *config->Value);
- EXPECT_EQ(123, ConvertToNode(config)->AsMap()->GetChildValueOrThrow<i64>("value"));
- }
-
- {
- auto config = Load<TConfig>(TYsonStringBuf("{value=#}"));
- EXPECT_FALSE(config->Value);
- EXPECT_EQ(ENodeType::Entity, ConvertToNode(config)->AsMap()->GetChildOrThrow("value")->GetType());
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-TEST(TYsonSerializableTest, DontSerializeDefault)
-{
- class TConfig
- : public TYsonSerializable
- {
- public:
- int Value;
- int OtherValue;
-
- TConfig()
- {
- RegisterParameter("value", Value)
- .Default(123);
- RegisterParameter("other_value", OtherValue)
- .Default(456)
- .DontSerializeDefault();
- }
- };
-
- {
- auto config = New<TConfig>();
- auto output = ConvertToYsonString(config, NYson::EYsonFormat::Text);
-
- TString expectedYson = "{\"value\"=123;}";
- EXPECT_TRUE(AreNodesEqual(
- ConvertToNode(TYsonString(expectedYson)),
- ConvertToNode(output)));
- }
-
- {
- auto config = New<TConfig>();
- config->OtherValue = 789;
- auto output = ConvertToYsonString(config, NYson::EYsonFormat::Text);
-
- TString expectedYson = "{\"value\"=123;\"other_value\"=789;}";
- EXPECT_TRUE(AreNodesEqual(
- ConvertToNode(TYsonString(expectedYson)),
- ConvertToNode(output)));
- }
-}
-
-class TYsonStructClass
- : public TYsonStruct
-{
-public:
- int IntValue;
-
- REGISTER_YSON_STRUCT(TYsonStructClass);
-
- static void Register(TRegistrar registrar)
- {
- registrar.Parameter("int_value", &TThis::IntValue)
- .Default(1);
- }
-};
-
-class TYsonSerializableClass
- : public TYsonSerializable
-{
-public:
- THashMap<TString, TIntrusivePtr<TYsonStructClass>> YsonStructHashMap;
-
- TIntrusivePtr<TYsonStructClass> YsonStructValue;
-
- TYsonSerializableClass()
- {
- RegisterParameter("yson_struct_hash_map", YsonStructHashMap)
- .Default();
-
- RegisterParameter("yson_struct_value", YsonStructValue)
- .DefaultNew();
-
- RegisterPreprocessor([&] () {
- YsonStructValue->IntValue = 5;
- });
- }
-};
-
-TEST_P(TYsonSerializableParseTest, YsonStructNestedToYsonSerializableSimple)
-{
- {
- auto config = New<TYsonSerializableClass>();
- EXPECT_EQ(config->YsonStructValue->IntValue, 5);
-
- config->YsonStructHashMap["x"] = New<TYsonStructClass>();
- config->YsonStructHashMap["x"]->IntValue = 10;
- config->YsonStructValue->IntValue = 2;
-
- auto output = ConvertToYsonString(config, NYson::EYsonFormat::Text);
- TString expectedYson = "{yson_struct_hash_map={x={int_value=10}};yson_struct_value={int_value=2}}";
- EXPECT_TRUE(AreNodesEqual(
- ConvertToNode(TYsonString(expectedYson)),
- ConvertToNode(TYsonString(output.AsStringBuf()))));
-
- auto deserialized = Load<TYsonSerializableClass>(output);
- EXPECT_EQ(deserialized->YsonStructHashMap["x"]->IntValue, 10);
- EXPECT_EQ(deserialized->YsonStructValue->IntValue, 2);
-
- }
-}
-
-TEST_P(TYsonSerializableParseTest, YsonStructNestedToYsonSerializableDeserializesFromEmpty)
-{
- {
- auto testInput = TYsonString(TStringBuf("{yson_struct_value={}}"));
- auto deserialized = Load<TYsonSerializableClass>(testInput);
- EXPECT_EQ(deserialized->YsonStructValue->IntValue, 5);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-class TNestedYsonStructClass
- : public TYsonStruct
-{
-public:
- int IntValue;
-
- REGISTER_YSON_STRUCT(TNestedYsonStructClass);
-
- static void Register(TRegistrar registrar)
- {
- registrar.Parameter("int_value", &TThis::IntValue)
- .Default(1);
- registrar.Postprocessor([&] (TNestedYsonStructClass* klass) {
- klass->IntValue = 10;
- });
- }
-};
-
-class TYsonSerializableClass2
- : public TYsonSerializable
-{
-public:
- THashMap<TString, TIntrusivePtr<TNestedYsonStructClass>> YsonStructHashMap;
-
- TYsonSerializableClass2()
- {
- RegisterParameter("yson_struct_hash_map", YsonStructHashMap)
- .Default();
- }
-};
-
-TEST_P(TYsonSerializableParseTest, PostprocessIsPropagatedFromYsonSerializableToYsonStruct)
-{
- auto testInput = TYsonString(TStringBuf("{yson_struct_hash_map={x={int_value=2}}}"));
- auto deserialized = Load<TYsonSerializableClass2>(testInput);
- EXPECT_EQ(deserialized->YsonStructHashMap["x"]->IntValue, 10);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-template <class T>
-TIntrusivePtr<T> CreateCustomDefault()
-{
- auto result = New<T>();
- result->IntValue = 10;
- return result;
-}
-
-class TYsonSerializableWithNestedStructsAndCustomDefaults
- : public TYsonSerializable
-{
-public:
- TIntrusivePtr<TSimpleYsonSerializable> YsonSerializable;
- TIntrusivePtr<TSimpleYsonStruct> YsonStruct;
-
- TYsonSerializableWithNestedStructsAndCustomDefaults()
- {
- RegisterParameter("yson_serializable", YsonSerializable)
- .Default(CreateCustomDefault<TSimpleYsonSerializable>());
- RegisterParameter("yson_struct", YsonStruct)
- .Default(CreateCustomDefault<TSimpleYsonStruct>());
- }
-};
-
-TEST(TYsonSerializableTest, TestCustomDefaultsOfNestedStructsAreDiscardedOnDeserialize)
-{
- auto testInput = TYsonString(TStringBuf("{}"));
- auto deserialized = ConvertTo<TIntrusivePtr<TYsonSerializableWithNestedStructsAndCustomDefaults>>(testInput);
- EXPECT_EQ(deserialized->YsonSerializable->IntValue, 1);
- EXPECT_EQ(deserialized->YsonStruct->IntValue, 1);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-class TYsonSerializableWithNestedStructsAndPreprocessors
- : public TYsonSerializable
-{
-public:
- TIntrusivePtr<TSimpleYsonSerializable> YsonSerializable;
- TIntrusivePtr<TSimpleYsonStruct> YsonStruct;
-
- TYsonSerializableWithNestedStructsAndPreprocessors()
- {
- RegisterParameter("yson_serializable", YsonSerializable)
- .Default();
- RegisterParameter("yson_struct", YsonStruct)
- .Default();
- RegisterPreprocessor([&] () {
- YsonSerializable = CreateCustomDefault<TSimpleYsonSerializable>();
- YsonStruct = CreateCustomDefault<TSimpleYsonStruct>();
- });
- }
-};
-
-TEST(TYsonSerializableTest, TestPreprocessorsEffectsOnNestedStructsArePreservedOnDeserialize)
-{
- auto testInput = TYsonString(TStringBuf("{}"));
- auto deserialized = ConvertTo<TIntrusivePtr<TYsonSerializableWithNestedStructsAndPreprocessors>>(testInput);
- EXPECT_EQ(deserialized->YsonSerializable->IntValue, 10);
- EXPECT_EQ(deserialized->YsonStruct->IntValue, 10);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-TEST(TYsonSerializableTest, TestStable)
-{
- class TInner
- : public NYTree::TYsonSerializable
- {
- public:
- int A;
- int B;
- int C;
- int D;
- int Q;
-
- TInner()
- {
- RegisterParameter("b", B)
- .Default(2);
- RegisterParameter("a", A)
- .Default(1);
- RegisterParameter("c", C)
- .Default(3);
- RegisterParameter("q", Q)
- .Default(9);
- RegisterParameter("d", D)
- .Default(4);
- }
- };
-
- class TOuter
- : public TYsonSerializable
- {
- public:
- TIntrusivePtr<TInner> Inner;
- TOuter()
- {
- RegisterParameter("inner", Inner)
- .DefaultNew();
- }
- };
-
- {
- auto outer = New<TOuter>();
- auto output = ConvertToYsonString(*outer, NYson::EYsonFormat::Text);
-
- auto result = BuildYsonStringFluently(NYson::EYsonFormat::Text)
- .BeginMap()
- .Item("inner").BeginMap()
- .Item("a").Value(1)
- .Item("b").Value(2)
- .Item("c").Value(3)
- .Item("d").Value(4)
- .Item("q").Value(9)
- .EndMap()
- .EndMap();
-
- EXPECT_EQ(result, output);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace
-} // namespace NYT::NYTree
diff --git a/yt/yt/core/ytree/unittests/yson_struct_ut.cpp b/yt/yt/core/ytree/unittests/yson_struct_ut.cpp
index cc507e31781..1410442a1ab 100644
--- a/yt/yt/core/ytree/unittests/yson_struct_ut.cpp
+++ b/yt/yt/core/ytree/unittests/yson_struct_ut.cpp
@@ -7,7 +7,6 @@
#include <yt/yt/core/ytree/tree_builder.h>
#include <yt/yt/core/ytree/tree_visitor.h>
#include <yt/yt/core/ytree/ypath_client.h>
-#include <yt/yt/core/ytree/yson_serializable.h>
#include <yt/yt/core/ytree/yson_struct.h>
#include <util/stream/buffer.h>
@@ -104,21 +103,6 @@ using TTestConfigPtr = TIntrusivePtr<TTestConfig>;
////////////////////////////////////////////////////////////////////////////////
-class TSimpleYsonSerializable
- : public TYsonSerializable
-{
-public:
- int IntValue;
-
- TSimpleYsonSerializable()
- {
- RegisterParameter("int_value", IntValue)
- .Default(1);
- }
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
class TSimpleYsonStruct
: public TYsonStruct
{
@@ -136,25 +120,6 @@ public:
////////////////////////////////////////////////////////////////////////////////
-class TYsonStructWithSimpleYsonSerializable
- : public TYsonStruct
-{
-public:
- TIntrusivePtr<TSimpleYsonSerializable> YsonSerializable;
-
- REGISTER_YSON_STRUCT(TYsonStructWithSimpleYsonSerializable);
-
- static void Register(TRegistrar registrar)
- {
- registrar.UnrecognizedStrategy(EUnrecognizedStrategy::KeepRecursive);
-
- registrar.Parameter("yson_serializable", &TYsonStructWithSimpleYsonSerializable::YsonSerializable)
- .DefaultNew();
- }
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
auto GetCompleteConfigNode(int offset = 0)
{
return BuildYsonNodeFluently()
@@ -501,23 +466,6 @@ TEST_P(TYsonStructParseTest, UnrecognizedRecursiveTwoLevelNesting)
ConvertToYsonString(unrecognized, EYsonFormat::Text).AsStringBuf());
}
-TEST_P(TYsonStructParseTest, UnrecognizedWithNestedYsonSerializable)
-{
- auto configNode = BuildYsonNodeFluently()
- .BeginMap()
- .Item("yson_serializable").BeginMap()
- .Item("unrecognized").Value(1)
- .EndMap()
- .EndMap();
-
- auto config = Load<TYsonStructWithSimpleYsonSerializable>(configNode->AsMap());
-
- auto unrecognized = config->GetRecursiveUnrecognized();
- EXPECT_EQ(
- ConvertToYsonString(configNode, EYsonFormat::Text).AsStringBuf(),
- ConvertToYsonString(unrecognized, EYsonFormat::Text).AsStringBuf());
-}
-
TEST_P(TYsonStructParseTest, MissingRequiredParameter)
{
auto configNode = BuildYsonNodeFluently()
@@ -654,12 +602,12 @@ TEST(TYsonStructTest, LoadSingleParameter)
auto config = New<TTestConfig>();
config->NullableInt = 10;
- config->LoadParameter("my_string", ConvertToNode("test"), EMergeStrategy::Default);
+ config->LoadParameter("my_string", ConvertToNode("test"));
EXPECT_EQ("test", config->MyString);
EXPECT_EQ(10, config->NullableInt);
}
-TEST(TYsonStructTest, LoadSingleParameterWithMergeStrategy)
+TEST(TYsonStructTest, LoadSingleParameterOverwriteDefaults)
{
auto builder = CreateBuilderFromFactory(GetEphemeralNodeFactory());
builder->BeginTree();
@@ -671,15 +619,9 @@ TEST(TYsonStructTest, LoadSingleParameterWithMergeStrategy)
auto config1 = New<TTestConfig>();
config1->Subconfig->MyBool = true;
- config1->LoadParameter("sub", subConfig, EMergeStrategy::Default);
+ config1->LoadParameter("sub", subConfig);
EXPECT_EQ(100, config1->Subconfig->MyInt);
- EXPECT_TRUE(config1->Subconfig->MyBool); // Subconfig merged by default.
-
- auto config2 = New<TTestConfig>();
- config2->Subconfig->MyBool = true;
- config2->LoadParameter("sub", subConfig, EMergeStrategy::Overwrite);
- EXPECT_EQ(100, config2->Subconfig->MyInt);
- EXPECT_FALSE(config2->Subconfig->MyBool); // Overwrite destroyed previous values.
+ EXPECT_FALSE(config1->Subconfig->MyBool); // Subconfig is overwritten.
}
TEST(TYsonStructTest, ResetSingleParameter)
@@ -1045,11 +987,11 @@ TEST(TYsonStructTest, EnumAsKeyToYHash)
};
TString serialized = "{\"value0\"=\"abc\";}";
- ASSERT_EQ(serialized, ConvertToYsonString(original, EYsonFormat::Text).AsStringBuf());
+ EXPECT_EQ(serialized, ConvertToYsonString(original, EYsonFormat::Text).AsStringBuf());
Deserialize(deserialized, ConvertToNode(TYsonString(serialized, EYsonType::Node)));
- ASSERT_EQ(original, deserialized);
+ EXPECT_EQ(original, deserialized);
}
////////////////////////////////////////////////////////////////////////////////
@@ -1245,76 +1187,6 @@ TEST(TYsonStructTest, RegisterBaseFieldInDerived)
////////////////////////////////////////////////////////////////////////////////
-class TYsonSerializableClass
- : public TYsonSerializable
-{
-public:
- TYsonSerializableClass()
- {
- RegisterParameter("int_value", IntValue)
- .Default(1);
- }
-
- int IntValue;
-};
-
-class TYsonStructClass
- : public TYsonStruct
-{
-public:
- THashMap<TString, TIntrusivePtr<TYsonSerializableClass>> YsonSerializableHashMap;
-
- TIntrusivePtr<TYsonSerializableClass> YsonSerializableValue;
-
- REGISTER_YSON_STRUCT(TYsonStructClass);
-
- static void Register(TRegistrar registrar)
- {
- registrar.Parameter("yson_serializable_hash_map", &TThis::YsonSerializableHashMap)
- .Default();
-
- registrar.Parameter("yson_serializable_value", &TThis::YsonSerializableValue)
- .DefaultNew();
-
- registrar.Preprocessor([] (TYsonStructClass* klass) {
- klass->YsonSerializableValue->IntValue = 5;
- });
- }
-};
-
-TEST(TYsonStructTest, YsonSerializableNestedToYsonStructSimple)
-{
- {
- auto config = New<TYsonStructClass>();
- EXPECT_EQ(config->YsonSerializableValue->IntValue, 5);
-
- config->YsonSerializableHashMap["x"] = New<TYsonSerializableClass>();
- config->YsonSerializableHashMap["x"]->IntValue = 10;
- config->YsonSerializableValue->IntValue = 2;
-
- auto output = ConvertToYsonString(config, NYson::EYsonFormat::Text);
- TString expectedYson = "{yson_serializable_hash_map={x={int_value=10}};yson_serializable_value={int_value=2}}";
- EXPECT_TRUE(AreNodesEqual(
- ConvertToNode(TYsonString(expectedYson)),
- ConvertToNode(TYsonString(output.AsStringBuf()))));
-
- auto deserialized = ConvertTo<TIntrusivePtr<TYsonStructClass>>(output);
- EXPECT_EQ(deserialized->YsonSerializableHashMap["x"]->IntValue, 10);
- EXPECT_EQ(deserialized->YsonSerializableValue->IntValue, 2);
-
- }
-}
-
-TEST(TYsonStructTest, YsonSerializableNestedToYsonStructDeserializesFromEmpty)
-{
- {
- auto testInput = TYsonString(TStringBuf("{yson_serializable_value={}}"));
- auto deserialized = ConvertTo<TIntrusivePtr<TYsonStructClass>>(testInput);
- EXPECT_EQ(deserialized->YsonSerializableValue->IntValue, 5);
- }
-}
-////////////////////////////////////////////////////////////////////////////////
-
class TClassLevelPostprocessConfig
: public TYsonStruct
{
@@ -1394,43 +1266,6 @@ TEST(TYsonStructTest, RecursiveConfig)
////////////////////////////////////////////////////////////////////////////////
-class TNestedYsonSerializableClass
- : public TYsonSerializable
-{
-public:
- TNestedYsonSerializableClass()
- {
- RegisterParameter("int_value", IntValue)
- .Default(1);
- RegisterPostprocessor([&] {
- IntValue = 10;
- });
- }
-
- int IntValue;
-};
-
-class TYsonStructClass2
- : public TYsonStruct
-{
-public:
- THashMap<TString, TIntrusivePtr<TNestedYsonSerializableClass>> YsonSerializableHashMap;
-
- REGISTER_YSON_STRUCT(TYsonStructClass2);
-
- static void Register(TRegistrar registrar)
- {
- registrar.Parameter("yson_serializable_hash_map", &TYsonStructClass2::YsonSerializableHashMap)
- .Default();
- }
-};
-
-TEST(TYsonStructTest, PostprocessIsPropagatedFromYsonStructToYsonSerializable)
-{
- auto testInput = TYsonString(TStringBuf("{yson_serializable_hash_map={x={int_value=2}}}"));
- auto deserialized = ConvertTo<TIntrusivePtr<TYsonStructClass2>>(testInput);
- EXPECT_EQ(deserialized->YsonSerializableHashMap["x"]->IntValue, 10);
-}
template <class T>
TIntrusivePtr<T> CreateCustomDefault()
@@ -1444,15 +1279,12 @@ class TYsonStructWithNestedStructsAndCustomDefaults
: public TYsonStruct
{
public:
- TIntrusivePtr<TSimpleYsonSerializable> YsonSerializable;
TIntrusivePtr<TSimpleYsonStruct> YsonStruct;
REGISTER_YSON_STRUCT(TYsonStructWithNestedStructsAndCustomDefaults);
static void Register(TRegistrar registrar)
{
- registrar.Parameter("yson_serializable", &TThis::YsonSerializable)
- .DefaultCtor([] () { return CreateCustomDefault<TSimpleYsonSerializable>(); });
registrar.Parameter("yson_struct", &TThis::YsonStruct)
.DefaultCtor([] () { return CreateCustomDefault<TSimpleYsonStruct>(); });
}
@@ -1461,7 +1293,6 @@ public:
TEST(TYsonStructTest, TestCustomDefaultsOfNestedStructsAreNotDiscardedOnDeserialize)
{
auto deserialized = ConvertTo<TIntrusivePtr<TYsonStructWithNestedStructsAndCustomDefaults>>(TYsonString(TStringBuf("{}")));
- EXPECT_EQ(deserialized->YsonSerializable->IntValue, 10);
EXPECT_EQ(deserialized->YsonStruct->IntValue, 10);
}
@@ -1471,7 +1302,6 @@ class TYsonStructWithNestedStructsAndPreprocessors
: public TYsonStruct
{
public:
- TIntrusivePtr<TSimpleYsonSerializable> YsonSerializable;
TIntrusivePtr<TSimpleYsonStruct> YsonStruct;
REGISTER_YSON_STRUCT(TYsonStructWithNestedStructsAndPreprocessors);
@@ -1480,10 +1310,7 @@ public:
{
registrar.Parameter("yson_struct", &TThis::YsonStruct)
.Default();
- registrar.Parameter("yson_serializable", &TThis::YsonSerializable)
- .Default();
registrar.Preprocessor([] (TThis* s) {
- s->YsonSerializable = CreateCustomDefault<TSimpleYsonSerializable>();
s->YsonStruct = CreateCustomDefault<TSimpleYsonStruct>();
});
}
@@ -1492,7 +1319,6 @@ public:
TEST(TYsonStructTest, TestPreprocessorsEffectsOnNestedStructsArePreservedOnDeserialize)
{
auto deserialized = ConvertTo<TIntrusivePtr<TYsonStructWithNestedStructsAndPreprocessors>>(TYsonString(TStringBuf("{}")));
- EXPECT_EQ(deserialized->YsonSerializable->IntValue, 10);
EXPECT_EQ(deserialized->YsonStruct->IntValue, 10);
}
@@ -2166,8 +1992,7 @@ public:
sub.MyInt = 11;
sub.MyString = "x";
return sub;
- })
- .MergeBy(EMergeStrategy::Combine);
+ });
}
};
@@ -2264,5 +2089,150 @@ TEST(TYsonStructTest, CustomSubExternalizedStruct)
////////////////////////////////////////////////////////////////////////////////
+TIntrusivePtr<TSimpleYsonStruct> CreateSimpleYsonStruct(int value)
+{
+ auto result = New<TSimpleYsonStruct>();
+ result->IntValue = value;
+ return result;
+}
+
+class TTestingNestedListWithCustomDefault
+ : public TYsonStruct
+{
+public:
+ std::vector<TIntrusivePtr<TSimpleYsonStruct>> NestedList;
+
+ REGISTER_YSON_STRUCT(TTestingNestedListWithCustomDefault);
+
+ static void Register(TRegistrar registrar)
+ {
+ registrar.Parameter("nested_list_1", &TThis::NestedList)
+ .DefaultCtor([] {
+ return std::vector{CreateSimpleYsonStruct(5)};
+ });
+ }
+};
+
+TEST(TYsonStructTest, NestedListWithCustomDefault)
+{
+ {
+ auto testInput = TYsonString(TStringBuf("{}"));
+ auto deserialized = ConvertTo<TIntrusivePtr<TTestingNestedListWithCustomDefault>>(testInput);
+
+ EXPECT_EQ(deserialized->NestedList.size(), 1u);
+ EXPECT_EQ(deserialized->NestedList[0]->IntValue, 5);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+class TTestingNestedMapWithCustomDefault
+ : public TYsonStruct
+{
+public:
+ THashMap<TString, TIntrusivePtr<TSimpleYsonStruct>> NestedMap;
+
+ REGISTER_YSON_STRUCT(TTestingNestedMapWithCustomDefault);
+
+ static void Register(TRegistrar registrar)
+ {
+ registrar.Parameter("nested_map", &TThis::NestedMap)
+ .DefaultCtor([] {
+ return THashMap<TString, TIntrusivePtr<TSimpleYsonStruct>>{
+ {"foo", CreateSimpleYsonStruct(42)},
+ {"bar", CreateSimpleYsonStruct(7)},
+ };
+ });
+ }
+};
+
+TEST(TYsonStructTest, NestedMapWithCustomDefault)
+{
+ {
+ auto testInput = TYsonString(TStringBuf("{}"));
+ auto deserialized = ConvertTo<TIntrusivePtr<TTestingNestedMapWithCustomDefault>>(testInput);
+
+ EXPECT_EQ(deserialized->NestedMap.size(), 2u);
+ EXPECT_EQ(deserialized->NestedMap["foo"]->IntValue, 42);
+ EXPECT_EQ(deserialized->NestedMap["bar"]->IntValue, 7);
+
+ auto testNode = BuildYsonNodeFluently()
+ .BeginMap()
+ .Item("nested_map")
+ .BeginMap()
+ .Item("baz")
+ .BeginMap()
+ .Item("int_value").Value(33)
+ .EndMap()
+ .Item("foo")
+ .BeginMap()
+ .Item("int_value").Value(88)
+ .EndMap()
+ .EndMap()
+ .EndMap();
+ Deserialize(deserialized, testNode->AsMap());
+ EXPECT_EQ(deserialized->NestedMap.size(), 3u);
+ EXPECT_EQ(deserialized->NestedMap["baz"]->IntValue, 33);
+ EXPECT_EQ(deserialized->NestedMap["foo"]->IntValue, 88);
+ EXPECT_EQ(deserialized->NestedMap["bar"]->IntValue, 7);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+class TTestingNestedMapWithCustomDefaultResetOnLoad
+ : public TYsonStruct
+{
+public:
+ THashMap<TString, TIntrusivePtr<TSimpleYsonStruct>> NestedMap;
+
+ REGISTER_YSON_STRUCT(TTestingNestedMapWithCustomDefaultResetOnLoad);
+
+ static void Register(TRegistrar registrar)
+ {
+ registrar.Parameter("nested_map", &TThis::NestedMap)
+ .DefaultCtor([] {
+ return THashMap<TString, TIntrusivePtr<TSimpleYsonStruct>>{
+ {"foo", CreateSimpleYsonStruct(42)},
+ {"bar", CreateSimpleYsonStruct(7)},
+ };
+ })
+ .ResetOnLoad();
+ }
+};
+
+TEST(TYsonStructTest, NestedMapWithCustomDefaultAndResetOnLoad)
+{
+ {
+ auto testInput = TYsonString(TStringBuf("{}"));
+ auto deserialized = ConvertTo<TIntrusivePtr<TTestingNestedMapWithCustomDefaultResetOnLoad>>(testInput);
+
+ EXPECT_EQ(deserialized->NestedMap.size(), 2u);
+ EXPECT_EQ(deserialized->NestedMap["foo"]->IntValue, 42);
+ EXPECT_EQ(deserialized->NestedMap["bar"]->IntValue, 7);
+
+ auto testNode = BuildYsonNodeFluently()
+ .BeginMap()
+ .Item("nested_map")
+ .BeginMap()
+ .Item("baz")
+ .BeginMap()
+ .Item("int_value").Value(33)
+ .EndMap()
+ .Item("foo")
+ .BeginMap()
+ .Item("int_value").Value(88)
+ .EndMap()
+ .EndMap()
+ .EndMap();
+ Deserialize(deserialized, testNode->AsMap());
+ EXPECT_EQ(deserialized->NestedMap.size(), 2u);
+ EXPECT_EQ(deserialized->NestedMap["baz"]->IntValue, 33);
+ EXPECT_EQ(deserialized->NestedMap["foo"]->IntValue, 88);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
} // namespace
} // namespace NYT::NYTree
diff --git a/yt/yt/core/ytree/virtual.cpp b/yt/yt/core/ytree/virtual.cpp
index 0d331fd7642..9a1c475cfe7 100644
--- a/yt/yt/core/ytree/virtual.cpp
+++ b/yt/yt/core/ytree/virtual.cpp
@@ -7,10 +7,9 @@
#include "ypath_service.h"
#include <yt/yt/core/yson/tokenizer.h>
-#include <yt/yt/core/yson/async_writer.h>
+#include <yt/yt/core/yson/writer.h>
#include <yt/yt/core/ypath/tokenizer.h>
-#include <yt/yt/core/yson/writer.h>
#include <util/generic/hash.h>
@@ -20,6 +19,7 @@ using namespace NRpc;
using namespace NYson;
using namespace NYTree;
using namespace NYPath;
+using namespace NConcurrency;
using NYT::FromProto;
@@ -29,16 +29,73 @@ using TAsyncYsonWriterPtr = TIntrusivePtr<TAsyncYsonWriter>;
namespace {
-template <class TContextPtr>
-void ReplyFromAsyncYsonWriter(TAsyncYsonWriterPtr writer, TContextPtr context)
+std::vector<std::pair<i64, i64>> SplitIntoBatches(i64 count, i64 batchSize)
{
+ YT_VERIFY(batchSize >= 1);
+
+ std::vector<std::pair<i64, i64>> result;
+ result.reserve((count + batchSize - 1) / batchSize);
+ i64 start = 0;
+ while (start < count) {
+ result.emplace_back(start, std::min(start + batchSize, count));
+ start += batchSize;
+ }
+ return result;
+}
- BIND([writer = std::move(writer)] {
+template <class TWriteItems>
+void ExecuteBatchRead(
+ std::optional<TVirtualCompositeNodeReadOffloadParams> offloadParams,
+ const TAsyncYsonWriterPtr& writer,
+ EYsonType ysonFragmentType,
+ i64 keyCount,
+ const TWriteItems& writeItems)
+{
+ if (offloadParams) {
+ auto batchIndexRanges = SplitIntoBatches(keyCount, offloadParams->BatchSize);
+
+ std::vector<TAsyncYsonWriterPtr> batchWriters;
+ batchWriters.reserve(batchIndexRanges.size());
+
+ std::vector<TFuture<void>> batchFutures;
+ batchFutures.reserve(batchIndexRanges.size());
+
+ for (int index = 0; index < std::ssize(batchIndexRanges); ++index) {
+ auto batchWriter = New<TAsyncYsonWriter>(ysonFragmentType);
+ batchWriters.push_back(batchWriter);
+ auto batchFuture = BIND([writeItems, batchWriter, batchIndexRange = batchIndexRanges[index]] {
+ writeItems(batchIndexRange, batchWriter);
+ })
+ .AsyncVia(NRpc::TDispatcher::Get()->GetHeavyInvoker())
+ .Run();
+ batchFutures.push_back(std::move(batchFuture));
+ }
+
+ // NB: Must wait for all futures to become set to ensure all lambdas above have finished accessing the state.
+ auto results = WaitForWithStrategy(AllSet(std::move(batchFutures)), offloadParams->WaitForStrategy)
+ .ValueOrThrow();
+ for (const auto& result : results) {
+ result.ThrowOnError();
+ }
+ for (const auto& batchWriter : batchWriters) {
+ writer->OnRaw(batchWriter->Finish());
+ }
+ } else {
+ writeItems(std::pair(0, keyCount), writer);
+ }
+}
+
+template <class TContext>
+void ReplyFromAsyncYsonWriter(
+ const TAsyncYsonWriterPtr& writer,
+ const TIntrusivePtr<TContext>& context)
+{
+ BIND([=] {
return writer->Finish();
})
.AsyncVia(NRpc::TDispatcher::Get()->GetHeavyInvoker())
.Run()
- .Subscribe(BIND([context = std::move(context)] (const TErrorOr<TYsonString>& resultOrError) {
+ .Subscribe(BIND([=] (const TErrorOr<TYsonString>& resultOrError) {
if (resultOrError.IsOK()) {
auto* response = &context->Response();
response->set_value(resultOrError.Value().ToString());
@@ -51,14 +108,17 @@ void ReplyFromAsyncYsonWriter(TAsyncYsonWriterPtr writer, TContextPtr context)
} // namespace
-TVirtualMapBase::TVirtualMapBase()
- : TVirtualMapBase(/*owningNode*/ nullptr)
-{ }
+////////////////////////////////////////////////////////////////////////////////
TVirtualMapBase::TVirtualMapBase(INodePtr owningNode)
: OwningNode_(std::move(owningNode))
{ }
+std::optional<TVirtualCompositeNodeReadOffloadParams> TVirtualMapBase::GetReadOffloadParams() const
+{
+ return {};
+}
+
bool TVirtualMapBase::DoInvoke(const IYPathServiceContextPtr& context)
{
DISPATCH_YPATH_SERVICE_METHOD(Get);
@@ -129,33 +189,43 @@ void TVirtualMapBase::GetSelf(
writer->OnBeginMap();
- if (attributeFilter) {
- for (const auto& key : keys) {
- if (auto service = FindItemService(key)) {
- writer->OnKeyedItem(key);
- if (Opaque_) {
- service->WriteAttributes(writer.Get(), attributeFilter, /*stable*/ false);
- writer->OnEntity();
- } else {
- auto asyncResult = AsyncYPathGet(service, "", attributeFilter);
- writer->OnRaw(asyncResult);
+ ExecuteBatchRead(
+ GetReadOffloadParams(),
+ writer,
+ EYsonType::MapFragment,
+ std::ssize(keys),
+ [&] (std::pair<i64, i64> keyIndexRange, const TAsyncYsonWriterPtr& writer) {
+ if (attributeFilter) {
+ for (i64 index = keyIndexRange.first; index < keyIndexRange.second; ++index) {
+ const auto& key = keys[index];
+ if (auto service = FindItemService(key)) {
+ writer->OnKeyedItem(key);
+ if (Opaque_) {
+ service->WriteAttributes(writer.Get(), attributeFilter, /*stable*/ false);
+ writer->OnEntity();
+ } else {
+ auto asyncResult = AsyncYPathGet(service, TYPath(), attributeFilter);
+ writer->OnRaw(asyncResult);
+ }
+ }
}
- }
- }
- } else {
- for (const auto& key : keys) {
- if (Opaque_) {
- writer->OnKeyedItem(key);
- writer->OnEntity();
} else {
- if (auto service = FindItemService(key)) {
- writer->OnKeyedItem(key);
- auto asyncResult = AsyncYPathGet(service, "");
- writer->OnRaw(asyncResult);
+ for (i64 index = keyIndexRange.first; index < keyIndexRange.second; ++index) {
+ const auto& key = keys[index];
+ if (Opaque_) {
+ writer->OnKeyedItem(key);
+ writer->OnEntity();
+ } else {
+ if (auto service = FindItemService(key)) {
+ writer->OnKeyedItem(key);
+ auto asyncResult = AsyncYPathGet(service, TYPath());
+ writer->OnRaw(asyncResult);
+ }
+ }
}
}
- }
- }
+ });
+
writer->OnEndMap();
ReplyFromAsyncYsonWriter(std::move(writer), context);
@@ -191,20 +261,31 @@ void TVirtualMapBase::ListSelf(
}
writer->OnBeginList();
- if (attributeFilter) {
- for (const auto& key : keys) {
- if (auto service = FindItemService(key)) {
- writer->OnListItem();
- service->WriteAttributes(writer.Get(), attributeFilter, /*stable*/ false);
- writer->OnStringScalar(key);
+
+ ExecuteBatchRead(
+ GetReadOffloadParams(),
+ writer,
+ EYsonType::MapFragment,
+ std::ssize(keys),
+ [&] (auto keyIndexRange, const TAsyncYsonWriterPtr& writer) {
+ if (attributeFilter) {
+ for (i64 index = keyIndexRange.first; index < keyIndexRange.second; ++index) {
+ const auto& key = keys[index];
+ if (auto service = FindItemService(key)) {
+ writer->OnListItem();
+ service->WriteAttributes(writer.Get(), attributeFilter, /*stable*/ false);
+ writer->OnStringScalar(key);
+ }
+ }
+ } else {
+ for (i64 index = keyIndexRange.first; index < keyIndexRange.second; ++index) {
+ const auto& key = keys[index];
+ writer->OnListItem();
+ writer->OnStringScalar(key);
+ }
}
- }
- } else {
- for (const auto& key : keys) {
- writer->OnListItem();
- writer->OnStringScalar(key);
- }
- }
+ });
+
writer->OnEndList();
ReplyFromAsyncYsonWriter(std::move(writer), context);
@@ -332,7 +413,6 @@ public:
private:
THashMap<TString, IYPathServicePtr> Services_;
THashMap<TInternedAttributeKey, TYsonCallback> Attributes_;
-
};
////////////////////////////////////////////////////////////////////////////////
@@ -341,8 +421,7 @@ TCompositeMapService::TCompositeMapService()
: Impl_(New<TImpl>())
{ }
-TCompositeMapService::~TCompositeMapService()
-{ }
+TCompositeMapService::~TCompositeMapService() = default;
std::vector<TString> TCompositeMapService::GetKeys(i64 limit) const
{
@@ -458,6 +537,11 @@ INodePtr CreateVirtualNode(IYPathServicePtr service)
////////////////////////////////////////////////////////////////////////////////
+std::optional<TVirtualCompositeNodeReadOffloadParams> TVirtualListBase::GetReadOffloadParams() const
+{
+ return {};
+}
+
bool TVirtualListBase::DoInvoke(const IYPathServiceContextPtr& context)
{
DISPATCH_YPATH_SERVICE_METHOD(Get);
@@ -493,7 +577,7 @@ IYPathService::TResolveResult TVirtualListBase::ResolveRecursive(
void TVirtualListBase::GetSelf(
TReqGet* request,
- TRspGet* response,
+ TRspGet* /*response*/,
const TCtxGetPtr& context)
{
YT_ASSERT(!NYson::TTokenizer(GetRequestTargetYPath(context->RequestHeader())).ParseNext());
@@ -512,63 +596,63 @@ void TVirtualListBase::GetSelf(
i64 size = GetSize();
- TAsyncYsonWriter writer;
+ auto writer = New<TAsyncYsonWriter>();
// NB: we do not want empty attributes (<>) to appear in the result in order to comply
// with current behaviour for some paths (like //sys/scheduler/orchid/scheduler/operations).
if (limit < size) {
- writer.OnBeginAttributes();
- writer.OnKeyedItem("incomplete");
- writer.OnBooleanScalar(true);
- writer.OnEndAttributes();
+ writer->OnBeginAttributes();
+ writer->OnKeyedItem("incomplete");
+ writer->OnBooleanScalar(true);
+ writer->OnEndAttributes();
}
- writer.OnBeginList();
-
- if (attributeFilter) {
- for (int index = 0; index < limit && index < size; ++index) {
- auto service = FindItemService(index);
- writer.OnListItem();
- if (service) {
- service->WriteAttributes(&writer, attributeFilter, false);
- if (Opaque_) {
- writer.OnEntity();
- } else {
- auto asyncResult = AsyncYPathGet(service, "");
- writer.OnRaw(asyncResult);
+ i64 count = std::min(size, limit);
+
+ writer->OnBeginList();
+
+ ExecuteBatchRead(
+ GetReadOffloadParams(),
+ writer,
+ EYsonType::ListFragment,
+ count,
+ [&] (std::pair<i64, i64> keyIndexRange, const TAsyncYsonWriterPtr& writer) {
+ if (attributeFilter) {
+ for (i64 index = keyIndexRange.first; index < keyIndexRange.second; ++index) {
+ writer->OnListItem();
+ if (auto service = FindItemService(index)) {
+ service->WriteAttributes(writer.Get(), attributeFilter, false);
+ if (Opaque_) {
+ writer->OnEntity();
+ } else {
+ auto asyncResult = AsyncYPathGet(service, TYPath());
+ writer->OnRaw(asyncResult);
+ }
+ } else {
+ writer->OnEntity();
+ }
}
} else {
- writer.OnEntity();
- }
- }
- } else {
- for (int index = 0; index < limit && index < size; ++index) {
- writer.OnListItem();
- if (Opaque_) {
- writer.OnEntity();
- } else {
- if (auto service = FindItemService(index)) {
- writer.OnListItem();
- auto asyncResult = AsyncYPathGet(service, "");
- writer.OnRaw(asyncResult);
- } else {
- writer.OnEntity();
+ for (i64 index = keyIndexRange.first; index < keyIndexRange.second; ++index) {
+ writer->OnListItem();
+ if (Opaque_) {
+ writer->OnEntity();
+ } else {
+ if (auto service = FindItemService(index)) {
+ writer->OnListItem();
+ auto asyncResult = AsyncYPathGet(service, TYPath());
+ writer->OnRaw(asyncResult);
+ } else {
+ writer->OnEntity();
+ }
+ }
}
}
- }
- }
+ });
- writer.OnEndList();
+ writer->OnEndList();
- writer.Finish()
- .Subscribe(BIND([=] (const TErrorOr<TYsonString>& resultOrError) {
- if (resultOrError.IsOK()) {
- response->set_value(resultOrError.Value().ToString());
- context->Reply();
- } else {
- context->Reply(resultOrError);
- }
- }));
+ ReplyFromAsyncYsonWriter(std::move(writer), context);
}
void TVirtualListBase::ListSystemAttributes(std::vector<TAttributeDescriptor>* descriptors)
diff --git a/yt/yt/core/ytree/virtual.h b/yt/yt/core/ytree/virtual.h
index 66ac03e531d..74a88f0dc54 100644
--- a/yt/yt/core/ytree/virtual.h
+++ b/yt/yt/core/ytree/virtual.h
@@ -4,11 +4,20 @@
#include "ypath_detail.h"
#include <yt/yt/core/yson/producer.h>
+#include <yt/yt/core/yson/async_writer.h>
namespace NYT::NYTree {
////////////////////////////////////////////////////////////////////////////////
+struct TVirtualCompositeNodeReadOffloadParams
+{
+ NConcurrency::EWaitForStrategy WaitForStrategy = NConcurrency::EWaitForStrategy::WaitFor;
+ i64 BatchSize = 10'000;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+
class TVirtualMapBase
: public TSupportsAttributes
, public ISystemAttributeProvider
@@ -17,10 +26,12 @@ public:
DEFINE_BYVAL_RW_PROPERTY(bool, Opaque, true);
protected:
- TVirtualMapBase();
- explicit TVirtualMapBase(INodePtr owningNode);
+ explicit TVirtualMapBase(INodePtr owningNode = nullptr);
+
+ virtual std::optional<TVirtualCompositeNodeReadOffloadParams> GetReadOffloadParams() const;
virtual std::vector<TString> GetKeys(i64 limit = std::numeric_limits<i64>::max()) const = 0;
+
virtual i64 GetSize() const = 0;
virtual IYPathServicePtr FindItemService(TStringBuf key) const = 0;
@@ -60,7 +71,6 @@ class TCompositeMapService
{
public:
TCompositeMapService();
-
~TCompositeMapService();
std::vector<TString> GetKeys(i64 limit = std::numeric_limits<i64>::max()) const override;
@@ -93,7 +103,10 @@ public:
DEFINE_BYVAL_RW_PROPERTY(bool, Opaque, true);
protected:
+ virtual std::optional<TVirtualCompositeNodeReadOffloadParams> GetReadOffloadParams() const;
+
virtual i64 GetSize() const = 0;
+
virtual IYPathServicePtr FindItemService(int index) const = 0;
bool DoInvoke(const IYPathServiceContextPtr& context) override;
diff --git a/yt/yt/core/ytree/yson_schema-inl.h b/yt/yt/core/ytree/yson_schema-inl.h
index ae8e3d59663..821048f19f2 100644
--- a/yt/yt/core/ytree/yson_schema-inl.h
+++ b/yt/yt/core/ytree/yson_schema-inl.h
@@ -21,9 +21,6 @@ template <class T>
concept CIsEnum = TEnumTraits<T>::IsEnum;
template <class T>
-concept CIsYsonStruct = std::derived_from<T, TYsonStructBase>;
-
-template <class T>
concept CIsProtobufMessage = std::derived_from<std::decay_t<T>, google::protobuf::Message>;
template <class T>
@@ -92,7 +89,7 @@ void WriteSchema(const T&, NYson::IYsonConsumer* consumer)
.EndMap();
}
-template <CIsYsonStruct T>
+template <CYsonStructDerived T>
void WriteSchema(const NYT::TIntrusivePtr<T>& value, NYson::IYsonConsumer* consumer)
{
BuildYsonFluently(consumer)
@@ -104,7 +101,7 @@ void WriteSchema(const NYT::TIntrusivePtr<T>& value, NYson::IYsonConsumer* consu
.EndMap();
}
-template <CIsYsonStruct T>
+template <CYsonStructDerived T>
void WriteSchema(const T& value, NYson::IYsonConsumer* consumer)
{
return value.WriteSchema(consumer);
diff --git a/yt/yt/core/ytree/yson_serializable-inl.h b/yt/yt/core/ytree/yson_serializable-inl.h
deleted file mode 100644
index a53c6aa26a8..00000000000
--- a/yt/yt/core/ytree/yson_serializable-inl.h
+++ /dev/null
@@ -1,1037 +0,0 @@
-#ifndef YSON_SERIALIZABLE_INL_H_
-#error "Direct inclusion of this file is not allowed, include yson_serializable.h"
-// For the sake of sane code completion.
-#include "yson_serializable.h"
-#endif
-
-#include "convert.h"
-#include "serialize.h"
-#include "tree_visitor.h"
-
-#include <yt/yt/core/yson/consumer.h>
-
-#include <yt/yt/core/misc/guid.h>
-#include <yt/yt/core/misc/serialize.h>
-
-#include <yt/yt/core/ypath/token.h>
-
-#include <yt/yt/core/ytree/ypath_client.h>
-#include <yt/yt/core/ytree/convert.h>
-
-#include <yt/yt/core/actions/bind.h>
-
-#include <library/cpp/yt/misc/enum.h>
-#include <library/cpp/yt/misc/wrapper_traits.h>
-
-#include <util/datetime/base.h>
-
-#include <optional>
-
-namespace NYT::NYTree {
-
-////////////////////////////////////////////////////////////////////////////////
-
-namespace NDetail {
-
-template <class T>
-concept IsYsonStructOrYsonSerializable = std::derived_from<T, TYsonStructBase> || std::derived_from<T, TYsonSerializableLite>;
-
-template <class T>
-void LoadFromNode(
- T& parameter,
- NYTree::INodePtr node,
- const NYPath::TYPath& path,
- EMergeStrategy /*mergeStrategy*/,
- bool /*keepUnrecognizedRecursively*/)
-{
- try {
- Deserialize(parameter, node);
- } catch (const std::exception& ex) {
- THROW_ERROR_EXCEPTION("Error reading parameter %v", path)
- << ex;
- }
-}
-
-// INodePtr
-template <>
-inline void LoadFromNode(
- NYTree::INodePtr& parameter,
- NYTree::INodePtr node,
- const NYPath::TYPath& /*path*/,
- EMergeStrategy mergeStrategy,
- bool /*keepUnrecognizedRecursively*/)
-{
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- parameter = node;
- break;
- }
-
- case EMergeStrategy::Combine: {
- if (!parameter) {
- parameter = node;
- } else {
- parameter = PatchNode(parameter, node);
- }
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
- }
-}
-
-// TYsonSerializable
-template <IsYsonStructOrYsonSerializable T>
-void LoadFromNode(
- TIntrusivePtr<T>& parameter,
- NYTree::INodePtr node,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively)
-{
- if (!parameter || mergeStrategy == EMergeStrategy::Overwrite) {
- parameter = New<T>();
- }
-
- if (keepUnrecognizedRecursively) {
- parameter->SetUnrecognizedStrategy(EUnrecognizedStrategy::KeepRecursive);
- }
-
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite:
- case EMergeStrategy::Combine: {
- parameter->Load(node, false, false, path);
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
- }
-}
-
-// std::optional
-template <class T>
-void LoadFromNode(
- std::optional<T>& parameter,
- NYTree::INodePtr node,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively)
-{
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- if (node->GetType() == NYTree::ENodeType::Entity) {
- parameter = std::nullopt;
- } else {
- T value;
- LoadFromNode(value, node, path, EMergeStrategy::Overwrite, keepUnrecognizedRecursively);
- parameter = std::move(value);
- }
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
- }
-}
-
-// std::vector
-template <class... T>
-void LoadFromNode(
- std::vector<T...>& parameter,
- NYTree::INodePtr node,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively)
-{
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- auto listNode = node->AsList();
- auto size = listNode->GetChildCount();
- parameter.resize(size);
- for (int i = 0; i < size; ++i) {
- LoadFromNode(
- parameter[i],
- listNode->GetChildOrThrow(i),
- path + "/" + NYPath::ToYPathLiteral(i),
- EMergeStrategy::Overwrite,
- keepUnrecognizedRecursively);
- }
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
- }
-}
-
-template <class T>
-T DeserializeMapKey(TStringBuf value)
-{
- if constexpr (TEnumTraits<T>::IsEnum) {
- return ParseEnum<T>(value);
- } else if constexpr (std::is_same_v<T, TGuid>) {
- return TGuid::FromString(value);
- } else {
- return FromString<T>(value);
- }
-}
-
-// For any map.
-template <template <typename...> class Map, class... T, class M = typename Map<T...>::mapped_type>
-void LoadFromNode(
- Map<T...>& parameter,
- NYTree::INodePtr node,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively)
-{
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- auto mapNode = node->AsMap();
- parameter.clear();
- for (const auto& [key, child] : mapNode->GetChildren()) {
- M value;
- LoadFromNode(
- value,
- child,
- path + "/" + NYPath::ToYPathLiteral(key),
- EMergeStrategy::Overwrite,
- keepUnrecognizedRecursively);
- parameter.emplace(DeserializeMapKey<typename Map<T...>::key_type>(key), std::move(value));
- }
- break;
- }
- case EMergeStrategy::Combine: {
- auto mapNode = node->AsMap();
- for (const auto& [key, child] : mapNode->GetChildren()) {
- M value;
- LoadFromNode(
- value,
- child,
- path + "/" + NYPath::ToYPathLiteral(key),
- EMergeStrategy::Combine,
- keepUnrecognizedRecursively);
- parameter[DeserializeMapKey<typename Map<T...>::key_type>(key)] = std::move(value);
- }
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
- }
-}
-////////////////////////////////////////////////////////////////////////////////
-
-template <class T>
-void LoadFromCursor(
- T& parameter,
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- EMergeStrategy /*mergeStrategy*/,
- bool /*keepUnrecognizedRecursively*/)
-{
- try {
- Deserialize(parameter, cursor);
- } catch (const std::exception& ex) {
- THROW_ERROR_EXCEPTION("Error reading parameter %v", path)
- << ex;
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-template <IsYsonStructOrYsonSerializable T>
-void LoadFromCursor(
- TIntrusivePtr<T>& parameterValue,
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively);
-
-template <class... T>
-void LoadFromCursor(
- std::vector<T...>& parameter,
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively);
-
-// std::optional
-template <class T>
-void LoadFromCursor(
- std::optional<T>& parameter,
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively);
-
-template <template <typename...> class Map, class... T, class M = typename Map<T...>::mapped_type>
-void LoadFromCursor(
- Map<T...>& parameter,
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively);
-
-////////////////////////////////////////////////////////////////////////////////
-
-// INodePtr
-template <>
-inline void LoadFromCursor(
- NYTree::INodePtr& parameter,
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively)
-{
- try {
- auto node = NYson::ExtractTo<INodePtr>(cursor);
- LoadFromNode(parameter, std::move(node), path, mergeStrategy, keepUnrecognizedRecursively);
- } catch (const std::exception& ex) {
- THROW_ERROR_EXCEPTION("Error loading parameter %v", path)
- << ex;
- }
-}
-
-// TYsonStruct or TYsonSerializable
-template <IsYsonStructOrYsonSerializable T>
-void LoadFromCursor(
- TIntrusivePtr<T>& parameterValue,
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively)
-{
- if (!parameterValue || mergeStrategy == EMergeStrategy::Overwrite) {
- parameterValue = New<T>();
- }
-
- if (keepUnrecognizedRecursively) {
- parameterValue->SetUnrecognizedStrategy(EUnrecognizedStrategy::KeepRecursive);
- }
-
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite:
- case EMergeStrategy::Combine: {
- parameterValue->Load(cursor, false, false, path);
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
- }
-}
-
-// std::optional
-template <class T>
-void LoadFromCursor(
- std::optional<T>& parameter,
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively)
-{
- try {
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- if ((*cursor)->GetType() == NYson::EYsonItemType::EntityValue) {
- parameter = std::nullopt;
- cursor->Next();
- } else {
- T value;
- LoadFromCursor(value, cursor, path, EMergeStrategy::Overwrite, keepUnrecognizedRecursively);
- parameter = std::move(value);
- }
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
- }
- } catch (const std::exception& ex) {
- THROW_ERROR_EXCEPTION("Error loading parameter %v", path)
- << ex;
- }
-}
-
-// std::vector
-template <class... T>
-void LoadFromCursor(
- std::vector<T...>& parameter,
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively)
-{
- try {
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- parameter.clear();
- int index = 0;
- cursor->ParseList([&](NYson::TYsonPullParserCursor* cursor) {
- LoadFromCursor(
- parameter.emplace_back(),
- cursor,
- path + "/" + NYPath::ToYPathLiteral(index),
- EMergeStrategy::Overwrite,
- keepUnrecognizedRecursively);
- ++index;
- });
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
- }
- } catch (const std::exception& ex) {
- THROW_ERROR_EXCEPTION("Error loading parameter %v", path)
- << ex;
- }
-}
-
-template <class TMapping, class TValue, class TEmplacer, class TSetter>
-void LoadMappingFromCursor(
- TMapping& mapping,
- TEmplacer emplacer,
- TSetter setter,
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively)
-{
- try {
- auto doParse = [&] (auto setterOrEmplacer, EMergeStrategy mergeStrategy) {
- cursor->ParseMap([&] (NYson::TYsonPullParserCursor* cursor) {
- auto key = ExtractTo<TString>(cursor);
- TValue value;
- LoadFromCursor(
- value,
- cursor,
- path + "/" + NYPath::ToYPathLiteral(key),
- mergeStrategy,
- keepUnrecognizedRecursively);
- setterOrEmplacer(mapping, key, std::move(value));
- });
- };
-
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- mapping = {};
- doParse(emplacer, EMergeStrategy::Overwrite);
- break;
- }
- case EMergeStrategy::Combine: {
- doParse(setter, EMergeStrategy::Combine);
- break;
- }
- default:
- YT_UNIMPLEMENTED();
- }
- } catch (const std::exception& ex) {
- THROW_ERROR_EXCEPTION("Error loading parameter %v", path)
- << ex;
- }
-}
-
-// For any map.
-template <template <typename...> class Map, class... T, class M>
-void LoadFromCursor(
- Map<T...>& parameter,
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
- bool keepUnrecognizedRecursively)
-{
- try {
- auto doParse = [&] (const auto& setterOrEmplacer, EMergeStrategy mergeStrategy) {
- cursor->ParseMap([&] (NYson::TYsonPullParserCursor* cursor) {
- auto key = ExtractTo<TString>(cursor);
- M value;
- LoadFromCursor(
- value,
- cursor,
- path + "/" + NYPath::ToYPathLiteral(key),
- mergeStrategy,
- keepUnrecognizedRecursively);
- setterOrEmplacer(key, std::move(value));
- });
- };
-
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- parameter.clear();
- auto emplacer = [&] (auto key, M&& value) {
- parameter.emplace(DeserializeMapKey<typename Map<T...>::key_type>(key), std::move(value));
- };
- doParse(emplacer, EMergeStrategy::Overwrite);
- break;
- }
- case EMergeStrategy::Combine: {
- auto setter = [&] (auto key, M&& value) {
- parameter[DeserializeMapKey<typename Map<T...>::key_type>(key)] = std::move(value);
- };
- doParse(setter, EMergeStrategy::Combine);
- break;
- }
- default:
- YT_UNIMPLEMENTED();
- }
- } catch (const std::exception& ex) {
- THROW_ERROR_EXCEPTION("Error loading parameter %v", path)
- << ex;
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-// For all classes except descendants of TYsonSerializableLite and their intrusive pointers
-// we do not attempt to extract unrecognzied members. C++ prohibits function template specialization
-// so we have to deal with static struct members.
-template <class T>
-struct TGetUnrecognizedRecursively
-{
- static IMapNodePtr Do(const T& /*parameter*/)
- {
- return nullptr;
- }
-};
-
-template <IsYsonStructOrYsonSerializable T>
-struct TGetUnrecognizedRecursively<T>
-{
- static IMapNodePtr Do(const T& parameter)
- {
- return parameter.GetRecursiveUnrecognized();
- }
-};
-
-template <IsYsonStructOrYsonSerializable T>
-struct TGetUnrecognizedRecursively<TIntrusivePtr<T>>
-{
- static IMapNodePtr Do(const TIntrusivePtr<T>& parameter)
- {
- return parameter ? parameter->GetRecursiveUnrecognized() : nullptr;
- }
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
-// all
-template <class F>
-void InvokeForComposites(
- const void* /*parameter*/,
- const NYPath::TYPath& /*path*/,
- const F& /*func*/)
-{ }
-
-// TYsonSerializable or TYsonStruct
-template <IsYsonStructOrYsonSerializable T, class F>
-inline void InvokeForComposites(
- const TIntrusivePtr<T>* parameter,
- const NYPath::TYPath& path,
- const F& func)
-{
- func(*parameter, path);
-}
-
-// std::vector
-template <class... T, class F>
-inline void InvokeForComposites(
- const std::vector<T...>* parameter,
- const NYPath::TYPath& path,
- const F& func)
-{
- for (size_t i = 0; i < parameter->size(); ++i) {
- InvokeForComposites(
- &(*parameter)[i],
- path + "/" + NYPath::ToYPathLiteral(i),
- func);
- }
-}
-
-// For any map.
-template <template<typename...> class Map, class... T, class F, class M = typename Map<T...>::mapped_type>
-inline void InvokeForComposites(
- const Map<T...>* parameter,
- const NYPath::TYPath& path,
- const F& func)
-{
- for (const auto& [key, value] : *parameter) {
- InvokeForComposites(
- &value,
- path + "/" + NYPath::ToYPathLiteral(key),
- func);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-// all
-template <class F>
-void InvokeForComposites(
- const void* /*parameter*/,
- const F& /*func*/)
-{ }
-
-// TYsonStruct or TYsonSerializable
-template <IsYsonStructOrYsonSerializable T, class F>
-inline void InvokeForComposites(const TIntrusivePtr<T>* parameter, const F& func)
-{
- func(*parameter);
-}
-
-// std::vector
-template <class... T, class F>
-inline void InvokeForComposites(const std::vector<T...>* parameter, const F& func)
-{
- for (const auto& item : *parameter) {
- InvokeForComposites(&item, func);
- }
-}
-
-// For any map.
-template <template<typename...> class Map, class... T, class F, class M = typename Map<T...>::mapped_type>
-inline void InvokeForComposites(const Map<T...>* parameter, const F& func)
-{
- for (const auto& [key, value] : *parameter) {
- InvokeForComposites(&value, func);
- }
-}
-
-// TODO(shakurov): get rid of this once concept support makes it into the standard
-// library implementation. Use equality-comparability instead.
-template <class T>
-concept SupportsDontSerializeDefaultImpl =
- std::is_arithmetic_v<T> ||
- std::is_same_v<T, TString> ||
- std::is_same_v<T, TDuration> ||
- std::is_same_v<T, TGuid> ||
- std::is_same_v<T, std::optional<std::vector<TString>>> ||
- std::is_same_v<T, THashSet<TString>>;
-
-template <class T>
-concept SupportsDontSerializeDefault =
- SupportsDontSerializeDefaultImpl<typename TWrapperTraits<T>::TRecursiveUnwrapped>;
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace NDetail
-
-template <class T>
-TYsonSerializableLite::TParameter<T>::TParameter(TString key, T& parameter)
- : Key(std::move(key))
- , Parameter(parameter)
- , MergeStrategy(EMergeStrategy::Default)
-{ }
-
-template <class T>
-void TYsonSerializableLite::TParameter<T>::Load(
- NYTree::INodePtr node,
- const NYPath::TYPath& path,
- std::optional<EMergeStrategy> mergeStrategy)
-{
- if (node) {
- NDetail::LoadFromNode(
- Parameter,
- node,
- path,
- mergeStrategy.value_or(MergeStrategy),
- KeepUnrecognizedRecursively);
- } else if (!DefaultValue) {
- THROW_ERROR_EXCEPTION("Missing required parameter %v",
- path);
- }
-}
-
-template <class T>
-void TYsonSerializableLite::TParameter<T>::SafeLoad(
- NYTree::INodePtr node,
- const NYPath::TYPath& path,
- const std::function<void()>& validate,
- std::optional<EMergeStrategy> mergeStrategy)
-{
- if (node) {
- T oldValue = Parameter;
- try {
- NDetail::LoadFromNode(
- Parameter,
- node,
- path,
- mergeStrategy.value_or(MergeStrategy),
- KeepUnrecognizedRecursively);
- validate();
- } catch (const std::exception&) {
- Parameter = std::move(oldValue);
- throw;
- }
- }
-}
-
-
-template <class T>
-void TYsonSerializableLite::TParameter<T>::Load(
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- std::optional<EMergeStrategy> mergeStrategy)
-{
- if (cursor) {
- NDetail::LoadFromCursor(
- Parameter,
- cursor,
- path,
- mergeStrategy.value_or(MergeStrategy),
- KeepUnrecognizedRecursively);
- } else if (!DefaultValue) {
- THROW_ERROR_EXCEPTION("Missing required parameter %v",
- path);
- }
-}
-
-template <class T>
-void TYsonSerializableLite::TParameter<T>::SafeLoad(
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- const std::function<void()>& validate,
- std::optional<EMergeStrategy> mergeStrategy)
-{
- if (cursor) {
- T oldValue = Parameter;
- try {
- NDetail::LoadFromCursor(
- Parameter,
- cursor,
- path,
- mergeStrategy.value_or(MergeStrategy),
- KeepUnrecognizedRecursively);
- validate();
- } catch (const std::exception&) {
- Parameter = std::move(oldValue);
- throw;
- }
- }
-}
-
-template <class T>
-void TYsonSerializableLite::TParameter<T>::Postprocess(const NYPath::TYPath& path) const
-{
- for (const auto& postprocessor : Postprocessors) {
- try {
- postprocessor(Parameter);
- } catch (const std::exception& ex) {
- THROW_ERROR_EXCEPTION("Postprocess failed at %v",
- path.empty() ? "root" : path)
- << ex;
- }
- }
-
- NYT::NYTree::NDetail::InvokeForComposites(
- &Parameter,
- path,
- [] <NDetail::IsYsonStructOrYsonSerializable TStruct> (TIntrusivePtr<TStruct> obj, const NYPath::TYPath& subpath) {
- if (obj) {
- obj->Postprocess(subpath);
- }
- });
-}
-
-template <class T>
-void TYsonSerializableLite::TParameter<T>::SetDefaults()
-{
- if (DefaultValue) {
- Parameter = *DefaultValue;
- }
-
- NYT::NYTree::NDetail::InvokeForComposites(
- &Parameter,
- [] <NDetail::IsYsonStructOrYsonSerializable TStruct> (TIntrusivePtr<TStruct> obj) {
- if (obj) {
- obj->SetDefaults();
- }
- });
-}
-
-template <class T>
-void TYsonSerializableLite::TParameter<T>::Save(NYson::IYsonConsumer* consumer) const
-{
- using NYTree::Serialize;
- Serialize(Parameter, consumer);
-}
-
-template <class T>
-bool TYsonSerializableLite::TParameter<T>::CanOmitValue() const
-{
- if constexpr (NDetail::SupportsDontSerializeDefault<T>) {
- if (!SerializeDefault && Parameter == DefaultValue) {
- return true;
- }
- }
-
- return NYT::NYTree::NDetail::CanOmitValue(&Parameter, DefaultValue ? &*DefaultValue : nullptr);
-}
-
-template <class T>
-TYsonSerializableLite::TParameter<T>& TYsonSerializableLite::TParameter<T>::Alias(const TString& name)
-{
- Aliases.push_back(name);
- return *this;
-}
-
-template <class T>
-const std::vector<TString>& TYsonSerializableLite::TParameter<T>::GetAliases() const
-{
- return Aliases;
-}
-
-template <class T>
-const TString& TYsonSerializableLite::TParameter<T>::GetKey() const
-{
- return Key;
-}
-
-template <class T>
-TYsonSerializableLite::TParameter<T>& TYsonSerializableLite::TParameter<T>::Optional()
-{
- DefaultValue = Parameter;
- return *this;
-}
-
-template <class T>
-TYsonSerializableLite::TParameter<T>& TYsonSerializableLite::TParameter<T>::Default(const T& defaultValue)
-{
- DefaultValue = defaultValue;
- Parameter = defaultValue;
- return *this;
-}
-
-template <class T>
-TYsonSerializableLite::TParameter<T>& TYsonSerializableLite::TParameter<T>::DontSerializeDefault()
-{
- // We should check for equality-comparability here but it is rather hard
- // to do the deep validation.
- static_assert(
- NDetail::SupportsDontSerializeDefault<T>,
- "DontSerializeDefault requires |Parameter| to be TString, TDuration, an arithmetic type or an optional of those");
-
- SerializeDefault = false;
- return *this;
-}
-
-template <class T>
-template <class... TArgs>
-TYsonSerializableLite::TParameter<T>& TYsonSerializableLite::TParameter<T>::DefaultNew(TArgs&&... args)
-{
- return Default(New<typename T::TUnderlying>(std::forward<TArgs>(args)...));
-}
-
-template <class T>
-TYsonSerializableLite::TParameter<T>& TYsonSerializableLite::TParameter<T>::CheckThat(TPostprocessor postprocessor)
-{
- Postprocessors.push_back(std::move(postprocessor));
- return *this;
-}
-
-template <class T>
-TYsonSerializableLite::TParameter<T>& TYsonSerializableLite::TParameter<T>::MergeBy(EMergeStrategy strategy)
-{
- MergeStrategy = strategy;
- return *this;
-}
-
-template <class T>
-IMapNodePtr TYsonSerializableLite::TParameter<T>::GetUnrecognizedRecursively() const
-{
- return NDetail::TGetUnrecognizedRecursively<T>::Do(Parameter);
-}
-
-template <class T>
-void TYsonSerializableLite::TParameter<T>::SetKeepUnrecognizedRecursively()
-{
- KeepUnrecognizedRecursively = true;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// Standard postprocessors
-
-#define DEFINE_POSTPROCESSOR(method, condition, error) \
- template <class T> \
- TYsonSerializableLite::TParameter<T>& TYsonSerializableLite::TParameter<T>::method \
- { \
- return CheckThat([=] (const T& parameter) { \
- using ::ToString; \
- std::optional<TValueType> nullableParameter(parameter); \
- if (nullableParameter) { \
- const auto& actual = *nullableParameter; \
- if (!(condition)) { \
- THROW_ERROR error; \
- } \
- } \
- }); \
- }
-
-DEFINE_POSTPROCESSOR(
- GreaterThan(TValueType expected),
- actual > expected,
- TError("Expected > %v, found %v", expected, actual)
-)
-
-DEFINE_POSTPROCESSOR(
- GreaterThanOrEqual(TValueType expected),
- actual >= expected,
- TError("Expected >= %v, found %v", expected, actual)
-)
-
-DEFINE_POSTPROCESSOR(
- LessThan(TValueType expected),
- actual < expected,
- TError("Expected < %v, found %v", expected, actual)
-)
-
-DEFINE_POSTPROCESSOR(
- LessThanOrEqual(TValueType expected),
- actual <= expected,
- TError("Expected <= %v, found %v", expected, actual)
-)
-
-DEFINE_POSTPROCESSOR(
- InRange(TValueType lowerBound, TValueType upperBound),
- lowerBound <= actual && actual <= upperBound,
- TError("Expected in range [%v,%v], found %v", lowerBound, upperBound, actual)
-)
-
-DEFINE_POSTPROCESSOR(
- NonEmpty(),
- actual.size() > 0,
- TError("Value must not be empty")
-)
-
-#undef DEFINE_POSTPROCESSOR
-
-////////////////////////////////////////////////////////////////////////////////
-
-template <class T>
-TYsonSerializableLite::TParameter<T>& TYsonSerializableLite::RegisterParameter(
- TString parameterName,
- T& value)
-{
- auto parameter = New<TParameter<T>>(parameterName, value);
- if (UnrecognizedStrategy == EUnrecognizedStrategy::KeepRecursive) {
- parameter->SetKeepUnrecognizedRecursively();
- }
- YT_VERIFY(Parameters.emplace(std::move(parameterName), parameter).second);
- return *parameter;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-template <class T>
-TIntrusivePtr<T> CloneYsonSerializable(const TIntrusivePtr<T>& obj)
-{
- static_assert(
- std::is_convertible_v<T*, TYsonSerializable*>,
- "'obj' must be convertible to TYsonSerializable");
-
- return NYTree::ConvertTo<TIntrusivePtr<T>>(NYson::ConvertToYsonString(*obj));
-}
-
-template <class T>
-std::vector<TIntrusivePtr<T>> CloneYsonSerializables(const std::vector<TIntrusivePtr<T>>& objs)
-{
- std::vector<TIntrusivePtr<T>> clonedObjs;
- clonedObjs.reserve(objs.size());
- for (const auto& obj : objs) {
- clonedObjs.push_back(CloneYsonSerializable(obj));
- }
- return clonedObjs;
-}
-
-template <class T>
-THashMap<TString, TIntrusivePtr<T>> CloneYsonSerializables(const THashMap<TString, TIntrusivePtr<T>>& objs)
-{
- THashMap<TString, TIntrusivePtr<T>> clonedObjs;
- clonedObjs.reserve(objs.size());
- for (const auto& [key, obj] : objs) {
- clonedObjs.emplace(key, CloneYsonSerializable(obj));
- }
- return clonedObjs;
-}
-
-template <class T>
-TIntrusivePtr<T> UpdateYsonSerializable(
- const TIntrusivePtr<T>& obj,
- const NYTree::INodePtr& patch)
-{
- static_assert(
- std::is_convertible_v<T*, TYsonSerializable*>,
- "'obj' must be convertible to TYsonSerializable");
-
- using NYTree::INodePtr;
- using NYTree::ConvertTo;
-
- if (patch) {
- return ConvertTo<TIntrusivePtr<T>>(PatchNode(ConvertTo<INodePtr>(obj), patch));
- } else {
- return CloneYsonSerializable(obj);
- }
-}
-
-template <class T>
-TIntrusivePtr<T> UpdateYsonSerializable(
- const TIntrusivePtr<T>& obj,
- const NYson::TYsonString& patch)
-{
- if (!patch) {
- return obj;
- }
-
- return UpdateYsonSerializable(obj, ConvertToNode(patch));
-}
-
-template <class T>
-bool ReconfigureYsonSerializable(
- const TIntrusivePtr<T>& config,
- const NYson::TYsonString& newConfigYson)
-{
- return ReconfigureYsonSerializable(config, ConvertToNode(newConfigYson));
-}
-
-template <class T>
-bool ReconfigureYsonSerializable(
- const TIntrusivePtr<T>& config,
- const TIntrusivePtr<T>& newConfig)
-{
- return ReconfigureYsonSerializable(config, ConvertToNode(newConfig));
-}
-
-template <class T>
-bool ReconfigureYsonSerializable(
- const TIntrusivePtr<T>& config,
- const NYTree::INodePtr& newConfigNode)
-{
- auto configNode = NYTree::ConvertToNode(config);
-
- auto newConfig = NYTree::ConvertTo<TIntrusivePtr<T>>(newConfigNode);
- auto newCanonicalConfigNode = NYTree::ConvertToNode(newConfig);
-
- if (NYTree::AreNodesEqual(configNode, newCanonicalConfigNode)) {
- return false;
- }
-
- config->Load(newConfigNode);
- return true;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace NYT::NYTree
diff --git a/yt/yt/core/ytree/yson_serializable.cpp b/yt/yt/core/ytree/yson_serializable.cpp
deleted file mode 100644
index f9557e19888..00000000000
--- a/yt/yt/core/ytree/yson_serializable.cpp
+++ /dev/null
@@ -1,385 +0,0 @@
-#include "yson_serializable.h"
-
-#include <yt/yt/core/yson/consumer.h>
-
-#include <yt/yt/core/yson/consumer.h>
-#include <yt/yt/core/yson/token_writer.h>
-
-#include <yt/yt/core/ytree/ephemeral_node_factory.h>
-#include <yt/yt/core/ytree/node.h>
-#include <yt/yt/core/ytree/ypath_detail.h>
-
-#include <util/generic/algorithm.h>
-
-namespace NYT::NYTree {
-
-using namespace NYPath;
-using namespace NYson;
-
-////////////////////////////////////////////////////////////////////////////////
-
-TYsonSerializableLite::TYsonSerializableLite()
-{ }
-
-IMapNodePtr TYsonSerializableLite::GetUnrecognized() const
-{
- return Unrecognized;
-}
-
-IMapNodePtr TYsonSerializableLite::GetRecursiveUnrecognized() const
-{
- return GetUnrecognizedRecursively();
-}
-
-IMapNodePtr TYsonSerializableLite::GetUnrecognizedRecursively() const
-{
- // Take a copy of `Unrecognized` and add parameter->GetUnrecognizedRecursively()
- // for all parameters that are TYsonSerializable's themselves.
- auto result = Unrecognized ? ConvertTo<IMapNodePtr>(Unrecognized) : GetEphemeralNodeFactory()->CreateMap();
- for (const auto& [name, parameter] : Parameters) {
- auto unrecognized = parameter->GetUnrecognizedRecursively();
- if (unrecognized && unrecognized->AsMap()->GetChildCount() > 0) {
- result->AddChild(name, unrecognized);
- }
- }
- return result;
-}
-
-void TYsonSerializableLite::SetUnrecognizedStrategy(EUnrecognizedStrategy strategy)
-{
- UnrecognizedStrategy = strategy;
- if (strategy == EUnrecognizedStrategy::KeepRecursive) {
- for (const auto& [name, parameter] : Parameters) {
- parameter->SetKeepUnrecognizedRecursively();
- }
- }
-}
-
-THashSet<TString> TYsonSerializableLite::GetRegisteredKeys() const
-{
- THashSet<TString> result(Parameters.size());
- for (const auto& [name, parameter] : Parameters) {
- result.insert(name);
- for (const auto& alias : parameter->GetAliases()) {
- result.insert(alias);
- }
- }
- return result;
-}
-
-void TYsonSerializableLite::Load(
- INodePtr node,
- bool postprocess,
- bool setDefaults,
- const TYPath& path)
-{
- YT_VERIFY(node);
-
- if (setDefaults) {
- SetDefaults();
- }
-
- auto mapNode = node->AsMap();
- for (const auto& [name, parameter] : Parameters) {
- TString key = name;
- auto child = mapNode->FindChild(name); // can be NULL
- for (const auto& alias : parameter->GetAliases()) {
- auto otherChild = mapNode->FindChild(alias);
- if (child && otherChild && !AreNodesEqual(child, otherChild)) {
- THROW_ERROR_EXCEPTION("Different values for aliased parameters %Qv and %Qv", key, alias)
- << TErrorAttribute("main_value", child)
- << TErrorAttribute("aliased_value", otherChild);
- }
- if (!child && otherChild) {
- child = otherChild;
- key = alias;
- }
- }
- auto childPath = path + "/" + key;
- parameter->Load(child, childPath);
- }
-
- if (UnrecognizedStrategy != EUnrecognizedStrategy::Drop) {
- auto registeredKeys = GetRegisteredKeys();
- if (!Unrecognized) {
- Unrecognized = GetEphemeralNodeFactory()->CreateMap();
- }
- for (const auto& [key, child] : mapNode->GetChildren()) {
- if (registeredKeys.find(key) == registeredKeys.end()) {
- Unrecognized->RemoveChild(key);
- YT_VERIFY(Unrecognized->AddChild(key, ConvertToNode(child)));
- }
- }
- }
-
- if (postprocess) {
- Postprocess(path);
- }
-}
-
-void TYsonSerializableLite::Load(
- TYsonPullParserCursor* cursor,
- bool postprocess,
- bool setDefaults,
- const TYPath& path)
-{
- YT_VERIFY(cursor);
-
- if (setDefaults) {
- SetDefaults();
- }
-
- THashMap<TStringBuf, IParameter*> keyToParameter;
- THashSet<IParameter*> pendingParameters;
- for (const auto& [key, parameter] : Parameters) {
- EmplaceOrCrash(keyToParameter, key, parameter.Get());
- for (const auto& alias : parameter->GetAliases()) {
- EmplaceOrCrash(keyToParameter, alias, parameter.Get());
- }
- InsertOrCrash(pendingParameters, parameter.Get());
- }
-
- THashMap<TString, TString> aliasedData;
-
- auto processPossibleAlias = [&] (
- IParameter* parameter,
- TStringBuf key,
- TYsonPullParserCursor* cursor)
- {
- TStringStream ss;
- {
- TCheckedInDebugYsonTokenWriter writer(&ss);
- cursor->TransferComplexValue(&writer);
- }
- auto data = std::move(ss.Str());
- const auto& canonicalKey = parameter->GetKey();
- auto aliasedDataIt = aliasedData.find(canonicalKey);
- if (aliasedDataIt != aliasedData.end()) {
- auto firstNode = ConvertTo<INodePtr>(TYsonStringBuf(aliasedDataIt->second));
- auto secondNode = ConvertTo<INodePtr>(TYsonStringBuf(data));
- if (!AreNodesEqual(firstNode, secondNode)) {
- THROW_ERROR_EXCEPTION("Different values for aliased parameters %Qv and %Qv", canonicalKey, key)
- << TErrorAttribute("main_value", firstNode)
- << TErrorAttribute("aliased_value", secondNode);
- }
- return;
- }
- {
- TStringInput input(data);
- TYsonPullParser parser(&input, NYson::EYsonType::Node);
- TYsonPullParserCursor newCursor(&parser);
- auto childPath = path + "/" + key;
- parameter->Load(&newCursor, childPath);
- }
- EmplaceOrCrash(aliasedData, canonicalKey, std::move(data));
- };
-
- auto processUnrecognized = [&, this] (const TString& key, TYsonPullParserCursor* cursor) {
- if (UnrecognizedStrategy == EUnrecognizedStrategy::Drop) {
- cursor->SkipComplexValue();
- return;
- }
- if (!Unrecognized) {
- Unrecognized = GetEphemeralNodeFactory()->CreateMap();
- }
- Unrecognized->RemoveChild(key);
- auto added = Unrecognized->AddChild(key, ExtractTo<INodePtr>(cursor));
- YT_VERIFY(added);
- };
-
- cursor->ParseMap([&] (TYsonPullParserCursor* cursor) {
- auto key = ExtractTo<TString>(cursor);
- auto it = keyToParameter.find(key);
- if (it == keyToParameter.end()) {
- processUnrecognized(key, cursor);
- return;
- }
-
- auto parameter = it->second;
- if (parameter->GetAliases().empty()) {
- auto childPath = path + "/" + key;
- parameter->Load(cursor, childPath);
- } else {
- processPossibleAlias(parameter, key, cursor);
- }
- // NB: Key may be missing in case of aliasing.
- pendingParameters.erase(parameter);
- });
-
- for (auto parameter : pendingParameters) {
- auto childPath = path + "/" + parameter->GetKey();
- parameter->Load(/*cursor*/ nullptr, childPath);
- }
-
- if (postprocess) {
- Postprocess(path);
- }
-}
-
-void TYsonSerializableLite::Save(IYsonConsumer* consumer) const
-{
- consumer->OnBeginMap();
-
- for (const auto& [name, parameter] : SortHashMapByKeys(Parameters)) {
- if (!parameter->CanOmitValue()) {
- consumer->OnKeyedItem(name);
- parameter->Save(consumer);
- }
- }
-
- if (Unrecognized) {
- auto children = Unrecognized->GetChildren();
- SortByFirst(children);
- for (const auto& [key, child] : children) {
- consumer->OnKeyedItem(key);
- Serialize(child, consumer);
- }
- }
-
- consumer->OnEndMap();
-}
-
-void TYsonSerializableLite::Postprocess(const TYPath& path) const
-{
- for (const auto& [name, parameter] : Parameters) {
- parameter->Postprocess(path + "/" + name);
- }
-
- try {
- for (const auto& postprocessor : Postprocessors) {
- postprocessor();
- }
- } catch (const std::exception& ex) {
- THROW_ERROR_EXCEPTION("Postprocess failed at %v",
- path.empty() ? "root" : path)
- << ex;
- }
-}
-
-void TYsonSerializableLite::SetDefaults()
-{
- for (const auto& [name, parameter] : Parameters) {
- parameter->SetDefaults();
- }
- for (const auto& initializer : Preprocessors) {
- initializer();
- }
-}
-
-void TYsonSerializableLite::RegisterPreprocessor(const TPreprocessor& func)
-{
- func();
- Preprocessors.push_back(func);
-}
-
-void TYsonSerializableLite::RegisterPostprocessor(const TPostprocessor& func)
-{
- Postprocessors.push_back(func);
-}
-
-void TYsonSerializableLite::SaveParameter(const TString& key, IYsonConsumer* consumer) const
-{
- GetParameter(key)->Save(consumer);
-}
-
-void TYsonSerializableLite::LoadParameter(const TString& key, const NYTree::INodePtr& node, EMergeStrategy mergeStrategy) const
-{
- const auto& parameter = GetParameter(key);
- auto validate = [&] () {
- parameter->Postprocess("/" + key);
- try {
- for (const auto& postprocessor : Postprocessors) {
- postprocessor();
- }
- } catch (const std::exception& ex) {
- THROW_ERROR_EXCEPTION(
- "Postprocess failed while loading parameter %Qv from value %Qv",
- key,
- ConvertToYsonString(node, EYsonFormat::Text))
- << ex;
- }
- };
- parameter->SafeLoad(node, /*path*/ "", validate, mergeStrategy);
-}
-
-void TYsonSerializableLite::ResetParameter(const TString& key) const
-{
- GetParameter(key)->SetDefaults();
-}
-
-TYsonSerializableLite::IParameterPtr TYsonSerializableLite::GetParameter(const TString& keyOrAlias) const
-{
- auto it = Parameters.find(keyOrAlias);
- if (it != Parameters.end()) {
- return it->second;
- }
-
- for (const auto& [_, parameter] : Parameters) {
- if (Count(parameter->GetAliases(), keyOrAlias) > 0) {
- return parameter;
- }
- }
- THROW_ERROR_EXCEPTION("Key or alias %Qv not found in yson serializable", keyOrAlias);
-}
-
-int TYsonSerializableLite::GetParameterCount() const
-{
- return Parameters.size();
-}
-
-std::vector<TString> TYsonSerializableLite::GetAllParameterAliases(const TString& key) const
-{
- auto parameter = GetParameter(key);
- auto result = parameter->GetAliases();
- result.push_back(parameter->GetKey());
- return result;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-void Serialize(const TYsonSerializableLite& value, IYsonConsumer* consumer)
-{
- value.Save(consumer);
-}
-
-void Deserialize(TYsonSerializableLite& value, INodePtr node)
-{
- value.Load(node);
-}
-
-void Deserialize(TYsonSerializableLite& value, NYson::TYsonPullParserCursor* cursor)
-{
- value.Load(cursor);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-DEFINE_REFCOUNTED_TYPE(TYsonSerializable)
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace NYT::NYTree
-
-
-namespace NYT {
-
-using namespace NYTree;
-
-////////////////////////////////////////////////////////////////////////////////
-
-void TBinaryYsonSerializer::Save(TStreamSaveContext& context, const TYsonSerializableLite& obj)
-{
- auto str = ConvertToYsonString(obj);
- NYT::Save(context, str);
-}
-
-void TBinaryYsonSerializer::Load(TStreamLoadContext& context, TYsonSerializableLite& obj)
-{
- auto str = NYT::Load<TYsonString>(context);
- auto node = ConvertTo<INodePtr>(str);
- obj.Load(node);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace NYT
diff --git a/yt/yt/core/ytree/yson_serializable.h b/yt/yt/core/ytree/yson_serializable.h
deleted file mode 100644
index 50f99e47b19..00000000000
--- a/yt/yt/core/ytree/yson_serializable.h
+++ /dev/null
@@ -1,268 +0,0 @@
-#pragma once
-
-#include "public.h"
-#include "node.h"
-#include "yson_serialize_common.h"
-
-#include <yt/yt/core/misc/error.h>
-#include <yt/yt/core/misc/mpl.h>
-#include <yt/yt/core/misc/property.h>
-
-#include <yt/yt/core/yson/public.h>
-
-#include <functional>
-#include <optional>
-
-namespace NYT::NYTree {
-
-////////////////////////////////////////////////////////////////////////////////
-
-class TYsonSerializableLite
- : private TNonCopyable
-{
-public:
- using TPostprocessor = std::function<void()>;
- using TPreprocessor = std::function<void()>;
-
- struct IParameter
- : public TRefCounted
- {
- virtual void Load(
- NYTree::INodePtr node,
- const NYPath::TYPath& path,
- std::optional<EMergeStrategy> mergeStrategy = std::nullopt) = 0;
-
- virtual void SafeLoad(
- NYTree::INodePtr node,
- const NYPath::TYPath& path,
- const std::function<void()>& validate,
- std::optional<EMergeStrategy> mergeStrategy = std::nullopt) = 0;
-
- virtual void Load(
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- std::optional<EMergeStrategy> mergeStrategy = std::nullopt) = 0;
-
- virtual void SafeLoad(
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- const std::function<void()>& validate,
- std::optional<EMergeStrategy> mergeStrategy = std::nullopt) = 0;
-
- virtual void Postprocess(const NYPath::TYPath& path) const = 0;
- virtual void SetDefaults() = 0;
- virtual void Save(NYson::IYsonConsumer* consumer) const = 0;
- virtual bool CanOmitValue() const = 0;
- virtual const TString& GetKey() const = 0;
- virtual const std::vector<TString>& GetAliases() const = 0;
- virtual IMapNodePtr GetUnrecognizedRecursively() const = 0;
- virtual void SetKeepUnrecognizedRecursively() = 0;
- };
-
- using IParameterPtr = TIntrusivePtr<IParameter>;
-
- template <class T>
- class TParameter
- : public IParameter
- {
- public:
- using TPostprocessor = std::function<void(const T&)>;
- using TValueType = typename TOptionalTraits<T>::TValue;
-
- TParameter(TString key, T& parameter);
-
- void Load(
- NYTree::INodePtr node,
- const NYPath::TYPath& path,
- std::optional<EMergeStrategy> mergeStrategy = std::nullopt) override;
-
- void SafeLoad(
- NYTree::INodePtr node,
- const NYPath::TYPath& path,
- const std::function<void()>& validate,
- std::optional<EMergeStrategy> mergeStrategy = std::nullopt) override;
-
- void Load(
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- std::optional<EMergeStrategy> mergeStrategy = std::nullopt) override;
-
- void SafeLoad(
- NYson::TYsonPullParserCursor* cursor,
- const NYPath::TYPath& path,
- const std::function<void()>& validate,
- std::optional<EMergeStrategy> mergeStrategy = std::nullopt) override;
-
- void Postprocess(const NYPath::TYPath& path) const override;
- void SetDefaults() override;
- void Save(NYson::IYsonConsumer* consumer) const override;
- bool CanOmitValue() const override;
- const TString& GetKey() const override;
- const std::vector<TString>& GetAliases() const override;
- IMapNodePtr GetUnrecognizedRecursively() const override;
- void SetKeepUnrecognizedRecursively() override;
-
- public:
- TParameter& Optional();
- TParameter& Default(const T& defaultValue = T());
- TParameter& DontSerializeDefault();
- TParameter& CheckThat(TPostprocessor validator);
- TParameter& GreaterThan(TValueType value);
- TParameter& GreaterThanOrEqual(TValueType value);
- TParameter& LessThan(TValueType value);
- TParameter& LessThanOrEqual(TValueType value);
- TParameter& InRange(TValueType lowerBound, TValueType upperBound);
- TParameter& NonEmpty();
- TParameter& Alias(const TString& name);
- TParameter& MergeBy(EMergeStrategy strategy);
-
- template <class... TArgs>
- TParameter& DefaultNew(TArgs&&... args);
-
- private:
- TString Key;
- T& Parameter;
- std::optional<T> DefaultValue;
- bool SerializeDefault = true;
- std::vector<TPostprocessor> Postprocessors;
- std::vector<TString> Aliases;
- EMergeStrategy MergeStrategy;
- bool KeepUnrecognizedRecursively = false;
- };
-
-public:
- TYsonSerializableLite();
-
- void Load(
- NYTree::INodePtr node,
- bool postprocess = true,
- bool setDefaults = true,
- const NYPath::TYPath& path = "");
-
- void Load(
- NYson::TYsonPullParserCursor* cursor,
- bool postprocess = true,
- bool setDefaults = true,
- const NYPath::TYPath& path = "");
-
- void Postprocess(const NYPath::TYPath& path = "") const;
-
- void SetDefaults();
-
- void Save(NYson::IYsonConsumer* consumer) const;
-
- IMapNodePtr GetUnrecognized() const;
- IMapNodePtr GetUnrecognizedRecursively() const;
- IMapNodePtr GetRecursiveUnrecognized() const;
-
- void SetUnrecognizedStrategy(EUnrecognizedStrategy strategy);
-
- THashSet<TString> GetRegisteredKeys() const;
- int GetParameterCount() const;
-
- void SaveParameter(const TString& key, NYson::IYsonConsumer* consumer) const;
- void LoadParameter(const TString& key, const NYTree::INodePtr& node, EMergeStrategy mergeStrategy) const;
- void ResetParameter(const TString& key) const;
-
- std::vector<TString> GetAllParameterAliases(const TString& key) const;
-
-protected:
- template <class T>
- TParameter<T>& RegisterParameter(
- TString parameterName,
- T& value);
-
- void RegisterPreprocessor(const TPreprocessor& func);
- void RegisterPostprocessor(const TPostprocessor& func);
-
-private:
- template <class T>
- friend class TParameter;
-
- THashMap<TString, IParameterPtr> Parameters;
-
- NYTree::IMapNodePtr Unrecognized;
- EUnrecognizedStrategy UnrecognizedStrategy = EUnrecognizedStrategy::Drop;
-
- std::vector<TPreprocessor> Preprocessors;
- std::vector<TPostprocessor> Postprocessors;
-
- IParameterPtr GetParameter(const TString& keyOrAlias) const;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
-class TYsonSerializable
- : public TRefCounted
- , public TYsonSerializableLite
-{ };
-
-////////////////////////////////////////////////////////////////////////////////
-
-template <class T>
-TIntrusivePtr<T> CloneYsonSerializable(const TIntrusivePtr<T>& obj);
-template <class T>
-std::vector<TIntrusivePtr<T>> CloneYsonSerializables(const std::vector<TIntrusivePtr<T>>& objs);
-template <class T>
-THashMap<TString, TIntrusivePtr<T>> CloneYsonSerializables(const THashMap<TString, TIntrusivePtr<T>>& objs);
-
-void Serialize(const TYsonSerializableLite& value, NYson::IYsonConsumer* consumer);
-void Deserialize(TYsonSerializableLite& value, NYTree::INodePtr node);
-void Deserialize(TYsonSerializableLite& value, NYson::TYsonPullParserCursor* cursor);
-
-template <class T>
-TIntrusivePtr<T> UpdateYsonSerializable(
- const TIntrusivePtr<T>& obj,
- const NYTree::INodePtr& patch);
-
-template <class T>
-TIntrusivePtr<T> UpdateYsonSerializable(
- const TIntrusivePtr<T>& obj,
- const NYson::TYsonString& patch);
-
-template <class T>
-bool ReconfigureYsonSerializable(
- const TIntrusivePtr<T>& config,
- const NYson::TYsonString& newConfigYson);
-
-template <class T>
-bool ReconfigureYsonSerializable(
- const TIntrusivePtr<T>& config,
- const TIntrusivePtr<T>& newConfig);
-
-template <class T>
-bool ReconfigureYsonSerializable(
- const TIntrusivePtr<T>& config,
- const NYTree::INodePtr& newConfigNode);
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace NYT::NYTree
-
-
-namespace NYT {
-
-////////////////////////////////////////////////////////////////////////////////
-
-struct TBinaryYsonSerializer
-{
- static void Save(TStreamSaveContext& context, const NYTree::TYsonSerializableLite& obj);
- static void Load(TStreamLoadContext& context, NYTree::TYsonSerializableLite& obj);
-};
-
-template <class T, class C>
-struct TSerializerTraits<
- T,
- C,
- typename std::enable_if_t<std::is_convertible_v<T&, NYTree::TYsonSerializableLite&>>>
-{
- using TSerializer = TBinaryYsonSerializer;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace NYT
-
-#define YSON_SERIALIZABLE_INL_H_
-#include "yson_serializable-inl.h"
-#undef YSON_SERIALIZABLE_INL_H_
diff --git a/yt/yt/core/ytree/yson_serialize_common.h b/yt/yt/core/ytree/yson_serialize_common.h
deleted file mode 100644
index 47824666fc4..00000000000
--- a/yt/yt/core/ytree/yson_serialize_common.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#pragma once
-
-#include <library/cpp/yt/memory/serialize.h>
-
-#include <library/cpp/yt/misc/enum.h>
-
-namespace NYT::NYTree {
-
-////////////////////////////////////////////////////////////////////////////////
-
-DEFINE_ENUM(EMergeStrategy,
- (Default)
- (Overwrite)
- (Combine)
-);
-
-DEFINE_ENUM(EUnrecognizedStrategy,
- (Drop)
- (Keep)
- (KeepRecursive)
- (Throw)
- (ThrowRecursive)
-);
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace NYT::NYTree
diff --git a/yt/yt/core/ytree/yson_struct.cpp b/yt/yt/core/ytree/yson_struct.cpp
index 09b98aebf32..0946a1168a5 100644
--- a/yt/yt/core/ytree/yson_struct.cpp
+++ b/yt/yt/core/ytree/yson_struct.cpp
@@ -112,9 +112,9 @@ void TYsonStructBase::SaveParameter(const TString& key, IYsonConsumer* consumer)
Meta_->GetParameter(key)->Save(this, consumer);
}
-void TYsonStructBase::LoadParameter(const TString& key, const NYTree::INodePtr& node, EMergeStrategy mergeStrategy)
+void TYsonStructBase::LoadParameter(const TString& key, const NYTree::INodePtr& node)
{
- Meta_->LoadParameter(this, key, node, mergeStrategy);
+ Meta_->LoadParameter(this, key, node);
}
void TYsonStructBase::ResetParameter(const TString& key)
diff --git a/yt/yt/core/ytree/yson_struct.h b/yt/yt/core/ytree/yson_struct.h
index f28f5808f71..fd66023a477 100644
--- a/yt/yt/core/ytree/yson_struct.h
+++ b/yt/yt/core/ytree/yson_struct.h
@@ -1,7 +1,7 @@
#pragma once
#include "node.h"
-#include "yson_serialize_common.h"
+#include "yson_struct_enum.h"
#include <yt/yt/core/misc/error.h>
#include <yt/yt/core/misc/mpl.h>
@@ -10,6 +10,8 @@
#include <yt/yt/core/yson/public.h>
#include <yt/yt/library/syncmap/map.h>
+#include <library/cpp/yt/misc/enum.h>
+
#include <util/generic/algorithm.h>
#include <functional>
@@ -88,7 +90,7 @@ public:
// TODO(renadeen): remove this methods.
void SaveParameter(const TString& key, NYson::IYsonConsumer* consumer) const;
- void LoadParameter(const TString& key, const NYTree::INodePtr& node, EMergeStrategy mergeStrategy);
+ void LoadParameter(const TString& key, const NYTree::INodePtr& node);
void ResetParameter(const TString& key);
std::vector<TString> GetAllParameterAliases(const TString& key) const;
diff --git a/yt/yt/core/ytree/yson_struct_detail-inl.h b/yt/yt/core/ytree/yson_struct_detail-inl.h
index 06a54ff6aed..0ca9f4ab2f4 100644
--- a/yt/yt/core/ytree/yson_struct_detail-inl.h
+++ b/yt/yt/core/ytree/yson_struct_detail-inl.h
@@ -18,9 +18,6 @@ namespace NYT::NYTree {
namespace NPrivate {
-template <class T>
-concept IsYsonStructOrYsonSerializable = std::derived_from<T, TYsonStructBase> || std::derived_from<T, TYsonSerializableLite>;
-
// TODO(shakurov): get rid of this once concept support makes it into the standard
// library implementation. Use equality-comparability instead.
template <class T>
@@ -44,13 +41,8 @@ void LoadFromNode(
T& parameter,
NYTree::INodePtr node,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> /*recursiveUnrecognizedStrategy*/)
{
- if (mergeStrategy == EMergeStrategy::Overwrite) {
- parameter = T();
- }
-
try {
Deserialize(parameter, node);
} catch (const std::exception& ex) {
@@ -65,40 +57,24 @@ inline void LoadFromNode(
NYTree::INodePtr& parameter,
NYTree::INodePtr node,
const NYPath::TYPath& /*path*/,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> /*recursiveUnrecognizedStrategy*/)
{
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- parameter = node;
- break;
- }
-
- case EMergeStrategy::Combine: {
- if (!parameter) {
- parameter = node;
- } else {
- parameter = PatchNode(parameter, node);
- }
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
+ if (!parameter) {
+ parameter = node;
+ } else {
+ parameter = PatchNode(parameter, node);
}
}
-// TYsonStruct or TYsonSerializable
-template <IsYsonStructOrYsonSerializable T>
+// TYsonStruct
+template <CYsonStructDerived T>
void LoadFromNode(
TIntrusivePtr<T>& parameterValue,
NYTree::INodePtr node,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy)
{
- if (!parameterValue || mergeStrategy == EMergeStrategy::Overwrite) {
+ if (!parameterValue) {
parameterValue = New<T>();
}
@@ -106,17 +82,7 @@ void LoadFromNode(
parameterValue->SetUnrecognizedStrategy(*recursiveUnrecognizedStrategy);
}
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite:
- case EMergeStrategy::Combine: {
- parameterValue->Load(node, false, false, path);
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
- }
+ parameterValue->Load(node, false, false, path);
}
// YsonStructLite or ExternalizedYsonStruct serializer
@@ -125,17 +91,8 @@ void LoadFromNode(
T& parameter,
NYTree::INodePtr node,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> /*recursiveUnrecognizedStrategy*/)
{
- if (mergeStrategy == EMergeStrategy::Overwrite) {
- // NB: We call SetDefaults here instead of plain T()
- // because ExternalizedYsonStruct serializer doesn't
- // own its data therefore defaulting it would drop the
- // reference to the actual object instead of overwriting it.
- parameter.SetDefaults();
- }
-
try {
parameter.Load(node, /*postprocess*/ true, /*setDefaults*/ false);
} catch (const std::exception& ex) {
@@ -150,13 +107,8 @@ void LoadFromNode(
T& parameter,
NYTree::INodePtr node,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> /*recursiveUnrecognizedStrategy*/)
{
- if (mergeStrategy == EMergeStrategy::Overwrite) {
- parameter = T();
- }
-
try {
DeserializeExternalized(parameter, node, /*postprocess*/ true, /*setDefaults*/ false);
} catch (const std::exception& ex) {
@@ -171,37 +123,19 @@ void LoadFromNode(
std::optional<T>& parameter,
NYTree::INodePtr node,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy)
{
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- if (node->GetType() == NYTree::ENodeType::Entity) {
- parameter = std::nullopt;
- } else {
- T value;
- LoadFromNode(value, node, path, EMergeStrategy::Overwrite, recursiveUnrecognizedStrategy);
- parameter = std::move(value);
- }
- break;
- }
-
- case EMergeStrategy::Combine: {
- if (node->GetType() != NYTree::ENodeType::Entity) {
- if (parameter.has_value()) {
- LoadFromNode(*parameter, node, path, EMergeStrategy::Combine, recursiveUnrecognizedStrategy);
- } else {
- T value;
- LoadFromNode(value, node, path, EMergeStrategy::Overwrite, recursiveUnrecognizedStrategy);
- parameter = std::move(value);
- }
- }
- break;
- }
+ if (node->GetType() == NYTree::ENodeType::Entity) {
+ parameter = std::nullopt;
+ return;
+ }
- default:
- YT_UNIMPLEMENTED();
+ if (parameter.has_value()) {
+ LoadFromNode(*parameter, node, path, recursiveUnrecognizedStrategy);
+ } else {
+ T value;
+ LoadFromNode(value, node, path, recursiveUnrecognizedStrategy);
+ parameter = std::move(value);
}
}
@@ -211,28 +145,18 @@ void LoadFromNode(
std::vector<T...>& parameter,
NYTree::INodePtr node,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy)
{
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- auto listNode = node->AsList();
- auto size = listNode->GetChildCount();
- parameter.resize(size);
- for (int i = 0; i < size; ++i) {
- LoadFromNode(
- parameter[i],
- listNode->GetChildOrThrow(i),
- path + "/" + NYPath::ToYPathLiteral(i),
- EMergeStrategy::Overwrite,
- recursiveUnrecognizedStrategy);
- }
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
+ auto listNode = node->AsList();
+ auto size = listNode->GetChildCount();
+ parameter.clear();
+ parameter.reserve(size);
+ for (int i = 0; i < size; ++i) {
+ LoadFromNode(
+ parameter.emplace_back(),
+ listNode->GetChildOrThrow(i),
+ path + "/" + NYPath::ToYPathLiteral(i),
+ recursiveUnrecognizedStrategy);
}
}
@@ -256,43 +180,17 @@ void LoadFromNode(
Map<T...>& parameter,
NYTree::INodePtr node,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy)
{
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- auto mapNode = node->AsMap();
- parameter.clear();
- for (const auto& [key, child] : mapNode->GetChildren()) {
- M value;
- LoadFromNode(
- value,
- child,
- path + "/" + NYPath::ToYPathLiteral(key),
- EMergeStrategy::Overwrite,
- recursiveUnrecognizedStrategy);
- parameter.emplace(DeserializeMapKey<typename Map<T...>::key_type>(key), std::move(value));
- }
- break;
- }
- case EMergeStrategy::Combine: {
- auto mapNode = node->AsMap();
- for (const auto& [key, child] : mapNode->GetChildren()) {
- M value;
- LoadFromNode(
- value,
- child,
- path + "/" + NYPath::ToYPathLiteral(key),
- EMergeStrategy::Combine,
- recursiveUnrecognizedStrategy);
- parameter[DeserializeMapKey<typename Map<T...>::key_type>(key)] = std::move(value);
- }
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
+ auto mapNode = node->AsMap();
+ for (const auto& [key, child] : mapNode->GetChildren()) {
+ M value;
+ LoadFromNode(
+ value,
+ child,
+ path + "/" + NYPath::ToYPathLiteral(key),
+ recursiveUnrecognizedStrategy);
+ parameter[DeserializeMapKey<typename Map<T...>::key_type>(key)] = std::move(value);
}
}
@@ -305,20 +203,18 @@ void LoadFromCursor(
T& parameter,
NYson::TYsonPullParserCursor* cursor,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy)
{
- LoadFromNode(parameter, NYson::ExtractTo<NYTree::INodePtr>(cursor), path, mergeStrategy, recursiveUnrecognizedStrategy);
+ LoadFromNode(parameter, NYson::ExtractTo<NYTree::INodePtr>(cursor), path, recursiveUnrecognizedStrategy);
}
////////////////////////////////////////////////////////////////////////////////
-template <IsYsonStructOrYsonSerializable T>
+template <CYsonStructDerived T>
void LoadFromCursor(
TIntrusivePtr<T>& parameterValue,
NYson::TYsonPullParserCursor* cursor,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy);
template <class... T>
@@ -326,7 +222,6 @@ void LoadFromCursor(
std::vector<T...>& parameter,
NYson::TYsonPullParserCursor* cursor,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy);
// std::optional
@@ -335,7 +230,6 @@ void LoadFromCursor(
std::optional<T>& parameter,
NYson::TYsonPullParserCursor* cursor,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy);
template <template <typename...> class Map, class... T, class M = typename Map<T...>::mapped_type>
@@ -343,7 +237,6 @@ void LoadFromCursor(
Map<T...>& parameter,
NYson::TYsonPullParserCursor* cursor,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy);
////////////////////////////////////////////////////////////////////////////////
@@ -354,28 +247,26 @@ inline void LoadFromCursor(
NYTree::INodePtr& parameter,
NYson::TYsonPullParserCursor* cursor,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy)
{
try {
auto node = NYson::ExtractTo<INodePtr>(cursor);
- LoadFromNode(parameter, std::move(node), path, mergeStrategy, recursiveUnrecognizedStrategy);
+ LoadFromNode(parameter, std::move(node), path, recursiveUnrecognizedStrategy);
} catch (const std::exception& ex) {
THROW_ERROR_EXCEPTION("Error loading parameter %v", path)
<< ex;
}
}
-// TYsonStruct or TYsonSerializable
-template <IsYsonStructOrYsonSerializable T>
+// TYsonStruct
+template <CYsonStructDerived T>
void LoadFromCursor(
TIntrusivePtr<T>& parameterValue,
NYson::TYsonPullParserCursor* cursor,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy)
{
- if (!parameterValue || mergeStrategy == EMergeStrategy::Overwrite) {
+ if (!parameterValue) {
parameterValue = New<T>();
}
@@ -383,17 +274,7 @@ void LoadFromCursor(
parameterValue->SetUnrecognizedStrategy(*recursiveUnrecognizedStrategy);
}
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite:
- case EMergeStrategy::Combine: {
- parameterValue->Load(cursor, false, false, path);
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
- }
+ parameterValue->Load(cursor, /*postprocess*/ false, /*setDefaults*/ false, path);
}
// std::optional
@@ -402,41 +283,20 @@ void LoadFromCursor(
std::optional<T>& parameter,
NYson::TYsonPullParserCursor* cursor,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy)
{
try {
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- if ((*cursor)->GetType() == NYson::EYsonItemType::EntityValue) {
- parameter = std::nullopt;
- cursor->Next();
- } else {
- T value;
- LoadFromCursor(value, cursor, path, EMergeStrategy::Overwrite, recursiveUnrecognizedStrategy);
- parameter = std::move(value);
- }
- break;
- }
-
- case EMergeStrategy::Combine: {
- if ((*cursor)->GetType() == NYson::EYsonItemType::EntityValue) {
- cursor->Next();
- } else {
- if (parameter.has_value()) {
- LoadFromCursor(*parameter, cursor, path, EMergeStrategy::Combine, recursiveUnrecognizedStrategy);
- } else {
- T value;
- LoadFromCursor(value, cursor, path, EMergeStrategy::Overwrite, recursiveUnrecognizedStrategy);
- parameter = std::move(value);
- }
- }
- break;
+ if ((*cursor)->GetType() == NYson::EYsonItemType::EntityValue) {
+ parameter = std::nullopt;
+ cursor->Next();
+ } else {
+ if (parameter.has_value()) {
+ LoadFromCursor(*parameter, cursor, path, recursiveUnrecognizedStrategy);
+ } else {
+ T value;
+ LoadFromCursor(value, cursor, path, recursiveUnrecognizedStrategy);
+ parameter = std::move(value);
}
-
- default:
- YT_UNIMPLEMENTED();
}
} catch (const std::exception& ex) {
THROW_ERROR_EXCEPTION("Error loading parameter %v", path)
@@ -450,30 +310,19 @@ void LoadFromCursor(
std::vector<T...>& parameter,
NYson::TYsonPullParserCursor* cursor,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy)
{
try {
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- parameter.clear();
- int index = 0;
- cursor->ParseList([&](NYson::TYsonPullParserCursor* cursor) {
- LoadFromCursor(
- parameter.emplace_back(),
- cursor,
- path + "/" + NYPath::ToYPathLiteral(index),
- EMergeStrategy::Overwrite,
- recursiveUnrecognizedStrategy);
- ++index;
- });
- break;
- }
-
- default:
- YT_UNIMPLEMENTED();
- }
+ parameter.clear();
+ int index = 0;
+ cursor->ParseList([&](NYson::TYsonPullParserCursor* cursor) {
+ LoadFromCursor(
+ parameter.emplace_back(),
+ cursor,
+ path + "/" + NYPath::ToYPathLiteral(index),
+ recursiveUnrecognizedStrategy);
+ ++index;
+ });
} catch (const std::exception& ex) {
THROW_ERROR_EXCEPTION("Error loading parameter %v", path)
<< ex;
@@ -486,44 +335,19 @@ void LoadFromCursor(
Map<T...>& parameter,
NYson::TYsonPullParserCursor* cursor,
const NYPath::TYPath& path,
- EMergeStrategy mergeStrategy,
std::optional<EUnrecognizedStrategy> recursiveUnrecognizedStrategy)
{
try {
- auto doParse = [&] (const auto& setterOrEmplacer, EMergeStrategy mergeStrategy) {
- cursor->ParseMap([&] (NYson::TYsonPullParserCursor* cursor) {
- auto key = ExtractTo<TString>(cursor);
- M value;
- LoadFromCursor(
- value,
- cursor,
- path + "/" + NYPath::ToYPathLiteral(key),
- mergeStrategy,
- recursiveUnrecognizedStrategy);
- setterOrEmplacer(key, std::move(value));
- });
- };
-
- switch (mergeStrategy) {
- case EMergeStrategy::Default:
- case EMergeStrategy::Overwrite: {
- parameter.clear();
- auto emplacer = [&] (auto key, M&& value) {
- parameter.emplace(DeserializeMapKey<typename Map<T...>::key_type>(key), std::move(value));
- };
- doParse(emplacer, EMergeStrategy::Overwrite);
- break;
- }
- case EMergeStrategy::Combine: {
- auto setter = [&] (auto key, M&& value) {
- parameter[DeserializeMapKey<typename Map<T...>::key_type>(key)] = std::move(value);
- };
- doParse(setter, EMergeStrategy::Combine);
- break;
- }
- default:
- YT_UNIMPLEMENTED();
- }
+ cursor->ParseMap([&] (NYson::TYsonPullParserCursor* cursor) {
+ auto key = ExtractTo<TString>(cursor);
+ M value;
+ LoadFromCursor(
+ value,
+ cursor,
+ path + "/" + NYPath::ToYPathLiteral(key),
+ recursiveUnrecognizedStrategy);
+ parameter[DeserializeMapKey<typename Map<T...>::key_type>(key)] = std::move(value);
+ });
} catch (const std::exception& ex) {
THROW_ERROR_EXCEPTION("Error loading parameter %v", path)
<< ex;
@@ -544,7 +368,7 @@ struct TGetRecursiveUnrecognized
}
};
-template <IsYsonStructOrYsonSerializable T>
+template <CYsonStructDerived T>
struct TGetRecursiveUnrecognized<T>
{
static IMapNodePtr Do(const T& parameter)
@@ -553,7 +377,7 @@ struct TGetRecursiveUnrecognized<T>
}
};
-template <IsYsonStructOrYsonSerializable T>
+template <CYsonStructDerived T>
struct TGetRecursiveUnrecognized<TIntrusivePtr<T>>
{
static IMapNodePtr Do(const TIntrusivePtr<T>& parameter)
@@ -572,8 +396,8 @@ void InvokeForComposites(
const F& /*func*/)
{ }
-// TYsonStruct or TYsonSerializable
-template <IsYsonStructOrYsonSerializable T, class F>
+// TYsonStruct
+template <CYsonStructDerived T, class F>
inline void InvokeForComposites(
const TIntrusivePtr<T>* parameterValue,
const NYPath::TYPath& path,
@@ -621,8 +445,8 @@ void InvokeForComposites(
const F& /*func*/)
{ }
-// TYsonStruct or TYsonSerializable
-template <IsYsonStructOrYsonSerializable T, class F>
+// TYsonStruct
+template <CYsonStructDerived T, class F>
inline void InvokeForComposites(const TIntrusivePtr<T>* parameter, const F& func)
{
func(*parameter);
@@ -648,7 +472,58 @@ inline void InvokeForComposites(const Map<T...>* parameter, const F& func)
////////////////////////////////////////////////////////////////////////////////
-} // namespace NYsonStructDetail
+// all
+template <class T>
+inline void ResetOnLoad(T& parameter)
+{
+ parameter = T();
+}
+
+// TYsonStruct
+template <std::derived_from<TYsonStruct> T>
+inline void ResetOnLoad(TIntrusivePtr<T>& parameter)
+{
+ parameter = New<T>();
+}
+
+// TYsonStructLite or TExternalizedYsonStruct Serializer
+template <std::derived_from<TYsonStructLite> T>
+inline void ResetOnLoad(T& parameter)
+{
+ parameter.SetDefaults();
+}
+
+// INodePtr
+template <>
+inline void ResetOnLoad(INodePtr& parameter)
+{
+ parameter.Reset();
+}
+
+// std::optional
+template <class T>
+inline void ResetOnLoad(std::optional<T>& parameter)
+{
+ parameter.reset();
+}
+
+// std::vector
+template <class T>
+inline void ResetOnLoad(std::vector<T>& parameter)
+{
+ parameter.clear();
+}
+
+// any map
+template <template <typename...> class Map, class... T, class M = typename Map<T...>::mapped_type>
+inline void ResetOnLoad(Map<T...>& parameter)
+{
+ parameter.clear();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NPrivate
////////////////////////////////////////////////////////////////////////////////
@@ -682,7 +557,6 @@ template <class TValue>
TYsonStructParameter<TValue>::TYsonStructParameter(TString key, std::unique_ptr<IYsonFieldAccessor<TValue>> fieldAccessor)
: Key_(std::move(key))
, FieldAccessor_(std::move(fieldAccessor))
- , MergeStrategy_(EMergeStrategy::Default)
{ }
template <class TValue>
@@ -692,11 +566,13 @@ void TYsonStructParameter<TValue>::Load(
const TLoadParameterOptions& options)
{
if (node) {
+ if (ResetOnLoad_) {
+ NPrivate::ResetOnLoad(FieldAccessor_->GetValue(self));
+ }
NPrivate::LoadFromNode(
FieldAccessor_->GetValue(self),
std::move(node),
options.Path,
- options.MergeStrategy.value_or(MergeStrategy_),
options.RecursiveUnrecognizedRecursively);
} else if (!Optional_) {
THROW_ERROR_EXCEPTION("Missing required parameter %v",
@@ -705,41 +581,19 @@ void TYsonStructParameter<TValue>::Load(
}
template <class TValue>
-void TYsonStructParameter<TValue>::SafeLoad(
- TYsonStructBase* self,
- NYTree::INodePtr node,
- const TLoadParameterOptions& options,
- const std::function<void()>& validate)
-{
- if (node) {
- TValue oldValue = FieldAccessor_->GetValue(self);
- try {
- NPrivate::LoadFromNode(
- FieldAccessor_->GetValue(self),
- node,
- options.Path,
- options.MergeStrategy.value_or(MergeStrategy_),
- /*recursivelyUnrecognizedStrategy*/ std::nullopt);
- validate();
- } catch (const std::exception ex) {
- FieldAccessor_->GetValue(self) = oldValue;
- throw;
- }
- }
-}
-
-template <class TValue>
void TYsonStructParameter<TValue>::Load(
TYsonStructBase* self,
NYson::TYsonPullParserCursor* cursor,
const TLoadParameterOptions& options)
{
if (cursor) {
+ if (ResetOnLoad_) {
+ NPrivate::ResetOnLoad(FieldAccessor_->GetValue(self));
+ }
NPrivate::LoadFromCursor(
FieldAccessor_->GetValue(self),
cursor,
options.Path,
- options.MergeStrategy.value_or(MergeStrategy_),
options.RecursiveUnrecognizedRecursively);
} else if (!Optional_) {
THROW_ERROR_EXCEPTION("Missing required parameter %v",
@@ -750,18 +604,18 @@ void TYsonStructParameter<TValue>::Load(
template <class TValue>
void TYsonStructParameter<TValue>::SafeLoad(
TYsonStructBase* self,
- NYson::TYsonPullParserCursor* cursor,
+ NYTree::INodePtr node,
const TLoadParameterOptions& options,
const std::function<void()>& validate)
{
- if (cursor) {
+ if (node) {
TValue oldValue = FieldAccessor_->GetValue(self);
try {
- NPrivate::LoadFromCursor(
+ FieldAccessor_->GetValue(self) = TValue();
+ NPrivate::LoadFromNode(
FieldAccessor_->GetValue(self),
- cursor,
+ node,
options.Path,
- options.MergeStrategy.value_or(MergeStrategy_),
/*recursivelyUnrecognizedStrategy*/ std::nullopt);
validate();
} catch (const std::exception ex) {
@@ -788,7 +642,7 @@ void TYsonStructParameter<TValue>::Postprocess(const TYsonStructBase* self, cons
NPrivate::InvokeForComposites(
&value,
path,
- [] <NPrivate::IsYsonStructOrYsonSerializable T> (TIntrusivePtr<T> obj, const NYPath::TYPath& subpath) {
+ [] <CYsonStructDerived T> (TIntrusivePtr<T> obj, const NYPath::TYPath& subpath) {
if (obj) {
obj->Postprocess(subpath);
}
@@ -842,6 +696,13 @@ TYsonStructParameter<TValue>& TYsonStructParameter<TValue>::Alias(const TString&
}
template <class TValue>
+TYsonStructParameter<TValue>& TYsonStructParameter<TValue>::ResetOnLoad()
+{
+ ResetOnLoad_ = true;
+ return *this;
+}
+
+template <class TValue>
const std::vector<TString>& TYsonStructParameter<TValue>::GetAliases() const
{
return Aliases_;
@@ -924,13 +785,6 @@ TYsonStructParameter<TValue>& TYsonStructParameter<TValue>::CheckThat(TPostproce
}
template <class TValue>
-TYsonStructParameter<TValue>& TYsonStructParameter<TValue>::MergeBy(EMergeStrategy strategy)
-{
- MergeStrategy_ = strategy;
- return *this;
-}
-
-template <class TValue>
IMapNodePtr TYsonStructParameter<TValue>::GetRecursiveUnrecognized(const TYsonStructBase* self) const
{
return NPrivate::TGetRecursiveUnrecognized<TValue>::Do(FieldAccessor_->GetValue(self));
diff --git a/yt/yt/core/ytree/yson_struct_detail.cpp b/yt/yt/core/ytree/yson_struct_detail.cpp
index 48919a5d22e..5ccb78dcbc1 100644
--- a/yt/yt/core/ytree/yson_struct_detail.cpp
+++ b/yt/yt/core/ytree/yson_struct_detail.cpp
@@ -68,7 +68,7 @@ IYsonStructParameterPtr TYsonStructMeta::GetParameter(const TString& keyOrAlias)
THROW_ERROR_EXCEPTION("Key or alias %Qv not found in yson struct", keyOrAlias);
}
-void TYsonStructMeta::LoadParameter(TYsonStructBase* target, const TString& key, const NYTree::INodePtr& node, EMergeStrategy mergeStrategy) const
+void TYsonStructMeta::LoadParameter(TYsonStructBase* target, const TString& key, const NYTree::INodePtr& node) const
{
const auto& parameter = GetParameter(key);
auto validate = [&] () {
@@ -87,7 +87,6 @@ void TYsonStructMeta::LoadParameter(TYsonStructBase* target, const TString& key,
};
auto loadOptions = TLoadParameterOptions{
.Path = "",
- .MergeStrategy = mergeStrategy
};
parameter->SafeLoad(target, node, loadOptions, validate);
diff --git a/yt/yt/core/ytree/yson_struct_detail.h b/yt/yt/core/ytree/yson_struct_detail.h
index d4e9fea19a6..046a66188d6 100644
--- a/yt/yt/core/ytree/yson_struct_detail.h
+++ b/yt/yt/core/ytree/yson_struct_detail.h
@@ -1,6 +1,6 @@
#pragma once
-#include "yson_serialize_common.h"
+#include "yson_struct_enum.h"
#include <yt/yt/core/yson/public.h>
#include <yt/yt/core/ypath/public.h>
@@ -18,7 +18,6 @@ struct TLoadParameterOptions
{
NYPath::TYPath Path;
std::optional<EUnrecognizedStrategy> RecursiveUnrecognizedRecursively;
- std::optional<EMergeStrategy> MergeStrategy;
};
////////////////////////////////////////////////////////////////////////////////
@@ -42,12 +41,6 @@ struct IYsonStructParameter
const TLoadParameterOptions& options,
const std::function<void()>& validate) = 0;
- virtual void SafeLoad(
- TYsonStructBase* self,
- NYson::TYsonPullParserCursor* cursor,
- const TLoadParameterOptions& options,
- const std::function<void()>& validate) = 0;
-
virtual void Save(const TYsonStructBase* self, NYson::IYsonConsumer* consumer) const = 0;
virtual void Postprocess(const TYsonStructBase* self, const NYPath::TYPath& path) const = 0;
@@ -77,7 +70,7 @@ struct IYsonStructMeta
virtual const THashSet<TString>& GetRegisteredKeys() const = 0;
virtual void Postprocess(TYsonStructBase* target, const TYPath& path) const = 0;
virtual IYsonStructParameterPtr GetParameter(const TString& keyOrAlias) const = 0;
- virtual void LoadParameter(TYsonStructBase* target, const TString& key, const NYTree::INodePtr& node, EMergeStrategy mergeStrategy) const = 0;
+ virtual void LoadParameter(TYsonStructBase* target, const TString& key, const NYTree::INodePtr& node) const = 0;
virtual void LoadStruct(
TYsonStructBase* target,
@@ -118,7 +111,7 @@ public:
const THashSet<TString>& GetRegisteredKeys() const override;
IYsonStructParameterPtr GetParameter(const TString& keyOrAlias) const override;
- void LoadParameter(TYsonStructBase* target, const TString& key, const NYTree::INodePtr& node, EMergeStrategy mergeStrategy) const override;
+ void LoadParameter(TYsonStructBase* target, const TString& key, const NYTree::INodePtr& node) const override;
void Postprocess(TYsonStructBase* target, const TYPath& path) const override;
@@ -223,12 +216,6 @@ public:
NYTree::INodePtr node,
const TLoadParameterOptions& options) override;
- void SafeLoad(
- TYsonStructBase* self,
- NYTree::INodePtr node,
- const TLoadParameterOptions& options,
- const std::function<void()>& validate) override;
-
void Load(
TYsonStructBase* self,
NYson::TYsonPullParserCursor* cursor,
@@ -236,7 +223,7 @@ public:
void SafeLoad(
TYsonStructBase* self,
- NYson::TYsonPullParserCursor* cursor,
+ NYTree::INodePtr node,
const TLoadParameterOptions& options,
const std::function<void()>& validate) override;
@@ -278,8 +265,8 @@ public:
TYsonStructParameter& NonEmpty();
// Register alias for parameter. Used in deserialization.
TYsonStructParameter& Alias(const TString& name);
- // Set merge strategy for parameter
- TYsonStructParameter& MergeBy(EMergeStrategy strategy);
+ // Set field to T() (or suitable analogue) before deserializations.
+ TYsonStructParameter& ResetOnLoad();
// Register constructor with parameters as initializer of default value for ref-counted class.
template <class... TArgs>
@@ -293,9 +280,9 @@ private:
bool SerializeDefault_ = true;
std::vector<TPostprocessor> Postprocessors_;
std::vector<TString> Aliases_;
- EMergeStrategy MergeStrategy_ = EMergeStrategy::Default;
bool TriviallyInitializedIntrusivePtr_ = false;
bool Optional_ = false;
+ bool ResetOnLoad_ = false;
};
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/core/ytree/yson_struct_enum.h b/yt/yt/core/ytree/yson_struct_enum.h
new file mode 100644
index 00000000000..a35fba6d0d2
--- /dev/null
+++ b/yt/yt/core/ytree/yson_struct_enum.h
@@ -0,0 +1,21 @@
+#pragma once
+
+#include <library/cpp/yt/memory/serialize.h>
+
+#include <library/cpp/yt/misc/enum.h>
+
+namespace NYT::NYTree {
+
+///////////////////////////////////////////////////////////////////////////////
+
+DEFINE_ENUM(EUnrecognizedStrategy,
+ (Drop)
+ (Keep)
+ (KeepRecursive)
+ (Throw)
+ (ThrowRecursive)
+);
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NYT::NYTree
diff --git a/yt/yt/library/monitoring/monitoring_manager.h b/yt/yt/library/monitoring/monitoring_manager.h
index fc5c3de6c76..b2582bbe708 100644
--- a/yt/yt/library/monitoring/monitoring_manager.h
+++ b/yt/yt/library/monitoring/monitoring_manager.h
@@ -3,6 +3,7 @@
#include "public.h"
#include <yt/yt/core/yson/consumer.h>
+#include <yt/yt/core/yson/producer.h>
#include <yt/yt/core/ypath/public.h>
diff --git a/yt/yt/library/profiling/sensor.cpp b/yt/yt/library/profiling/sensor.cpp
index 138a8ae9597..beb76248ccd 100644
--- a/yt/yt/library/profiling/sensor.cpp
+++ b/yt/yt/library/profiling/sensor.cpp
@@ -182,7 +182,7 @@ void TGaugeHistogram::Remove(double value, int count) const noexcept
Histogram_->Remove(value, count);
}
-void TGaugeHistogram::Reset() noexcept
+void TGaugeHistogram::Reset() const noexcept
{
if (!Histogram_) {
return;
@@ -200,7 +200,7 @@ THistogramSnapshot TGaugeHistogram::GetSnapshot() const
return Histogram_->GetSnapshot(false);
}
-void TGaugeHistogram::LoadSnapshot(THistogramSnapshot snapshot)
+void TGaugeHistogram::LoadSnapshot(THistogramSnapshot snapshot) const
{
if (!Histogram_) {
return;
@@ -225,42 +225,6 @@ void TRateHistogram::Add(double value, int count) const noexcept
Histogram_->Add(value, count);
}
-void TRateHistogram::Remove(double value, int count) const noexcept
-{
- if (!Histogram_) {
- return;
- }
-
- Histogram_->Remove(value, count);
-}
-
-void TRateHistogram::Reset() noexcept
-{
- if (!Histogram_) {
- return;
- }
-
- Histogram_->Reset();
-}
-
-THistogramSnapshot TRateHistogram::GetSnapshot() const
-{
- if (!Histogram_) {
- return {};
- }
-
- return Histogram_->GetSnapshot(false);
-}
-
-void TRateHistogram::LoadSnapshot(THistogramSnapshot snapshot)
-{
- if (!Histogram_) {
- return;
- }
-
- Histogram_->LoadSnapshot(snapshot);
-}
-
TRateHistogram::operator bool() const
{
return Histogram_.operator bool();
diff --git a/yt/yt/library/profiling/sensor.h b/yt/yt/library/profiling/sensor.h
index 4d80da1d8db..209ac43f415 100644
--- a/yt/yt/library/profiling/sensor.h
+++ b/yt/yt/library/profiling/sensor.h
@@ -142,10 +142,10 @@ class TGaugeHistogram
public:
void Add(double value, int count = 1) const noexcept;
void Remove(double value, int count = 1) const noexcept;
- void Reset() noexcept;
+ void Reset() const noexcept;
THistogramSnapshot GetSnapshot() const;
- void LoadSnapshot(THistogramSnapshot snapshot);
+ void LoadSnapshot(THistogramSnapshot snapshot) const;
explicit operator bool() const;
@@ -161,16 +161,12 @@ class TRateHistogram
{
public:
void Add(double value, int count = 1) const noexcept;
- void Remove(double value, int count = 1) const noexcept;
- void Reset() noexcept;
-
- THistogramSnapshot GetSnapshot() const;
- void LoadSnapshot(THistogramSnapshot snapshot);
explicit operator bool() const;
private:
friend class TProfiler;
+ friend struct TTesting;
IHistogramImplPtr Histogram_;
};
diff --git a/yt/yt/library/profiling/sensors_owner/README.md b/yt/yt/library/profiling/sensors_owner/README.md
new file mode 100644
index 00000000000..48e9ed83d96
--- /dev/null
+++ b/yt/yt/library/profiling/sensors_owner/README.md
@@ -0,0 +1,95 @@
+# Sensors owner
+
+Это персистентный слой для NYT::NProfiling. TSensorsOwner содержит внутри себя TProfiler и в дополнение
+владеет множеством объектов метрик с точки зрения времени их жизни.
+TSensorsOwner может владеть другими TSensorsOwner. Имеет апи для получения "дочерних" объектов с метриками.
+
+## Примеры использования
+
+* Простейший пример использования:
+```cpp
+sensorsOwner.Inc(".my_simple_counter", 1);
+```
+Когда в конкретном месте нужно проинкрементить всего один счетчик.
+Объект счетчика в этом случае создатся один раз и будет храниться внутри sensorsOwner.
+Не рекомендуется для более сложных случаев.
+
+* Инкремент метрик в функции:
+```cpp
+void DoSmth(/*... , */ const TSensorsOwner& sensorsOwner)
+{
+ // В функции можно прям по месту объявлять структуру с метриками и пользоваться.
+ struct TSensors
+ {
+ NYT::NProfiling::TProfiler Profiler;
+ NYT::NProfiling::TCounter TotalCount = Profiler.Counter(".count");
+ NYT::NProfiling::TCounter FailedCount = Profiler.Counter(".failed_count");
+ };
+ // Тут одна и та же ссылка на объект метрик при условии, что в функцию передается один и тот же sensorsOwner.
+ // Метод `.Get` достаточно эффективен, но всё же лучше не вызывать лишний раз.
+ const auto& sensors = sensorsOwner.Get<TSensors>();
+
+ //...
+ bool failed = false;
+ //...
+
+ sensors.TotalCount.Increment(1);
+ if (failed) {
+ sensors.FailedCount.Increment(1);
+ }
+}
+```
+
+* Когда очень хочется конструировать дочерние метрики не только от профайлера и ключа:
+```cpp
+struct THistogramSensors
+{
+ NYT::NProfiling::TProfiler Profiler;
+ int Key;
+ std::vector<TDuration> Buckets;
+ NYT::NProfiling::TEventTimer Histogram = Profiler.WithTag("tag", ToString(Key)).TimeHistogram(".another_counter", Buckets);
+};
+
+owner.Get<THistogramSensors>(/*Key*/ 132, /*Buckets*/ std::vector<TDuration>{5s, 10min}).Histogram.Record(6s);
+```
+
+* Можно и явно написать конструктор для структурки с метриками:
+```cpp
+struct TChildSensors
+{
+ NYT::NProfiling::TCounter Counter;
+
+ TChildSensors(const NYT::NProfiling::TProfiler& p)
+ : Counter(p.Counter(".my_counter_2"))
+ { }
+};
+```
+
+* Если структурку с метриками хочется куда-то дальше передавать и не беспокоиться о времени жизни:
+```cpp
+struct TSharedSensors final
+{
+ TProfiler Profiler;
+ TCounter Counter = Profiler.Counter(".under_ptr_counter");
+};
+using TSharedSensorsPtr = NYT::TIntrusivePtr<TSharedSensors>;
+
+owner.Get<TSharedSensorsPtr>()->Counter.Increment(1);
+```
+
+* TSensorsOwner мимикрирует под TProfiler в ряде моментов:
+```cpp
+auto subOwner = owner.WithPrefix("prefix.").WithTags(NYT::NProfiling::TTagSet().WithTag({"key", "value2"}));
+```
+
+## Когда использовать?
+
+* При реализации логики на функциях и отсутствии необходимости иметь объекты метрик
+(счетчиков и гистограмм как правило) вне функции.
+
+* В случаях, когда время жизни метрик должно превышать время жизни основного использующего эти метрики класса.
+Например, если при возникновении ошибки, вы хотите репортить метрику и разрушать класс,
+то вам важно, чтобы объект метрики ошибки не умер сразу - иначе апдейт метрики скорее всего не успеет отрепортиться мониторингу.
+
+* Когда вы просто не хотите, чтобы объекты метрик когда-либо разрушались.
+В этом случае можно подвешивать все к GetRootSensorsOwner().
diff --git a/yt/yt/library/profiling/sensors_owner/sensors_owner-inl.h b/yt/yt/library/profiling/sensors_owner/sensors_owner-inl.h
new file mode 100644
index 00000000000..61b6f02b86d
--- /dev/null
+++ b/yt/yt/library/profiling/sensors_owner/sensors_owner-inl.h
@@ -0,0 +1,102 @@
+#ifndef ALLOW_INCLUDE_SENSORS_OWNER_INL_H
+ #error "Direct inclusion of this file is not allowed, must be included from sensors_owner.h only! Include sensors_owner.h"
+#endif
+
+namespace NYT::NProfiling {
+
+////////////////////////////////////////////////////////////////////////////////
+
+namespace NSensorsOwnerPrivate {
+
+////////////////////////////////////////////////////////////////////////////////
+
+struct TTagSetKey
+{
+ TTagSet Tags;
+
+ operator ui64() const;
+ bool operator==(const TTagSetKey& key) const;
+};
+
+template <typename TMap>
+struct TOwnedMapWrapper
+{
+ mutable TMap Map;
+
+ TOwnedMapWrapper(const TProfiler&)
+ { }
+};
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NSensorsOwnerPrivate
+
+template <typename TChild, typename TFindKey, typename... TExtraConstructionArgs>
+const TChild& TSensorsOwner::Get(const TFindKey& key, const TExtraConstructionArgs&... extraArgs) const
+{
+ constexpr bool childHasKey = NSensorsOwnerPrivate::TChildTraits<TChild>::HasKey;
+
+ auto childConstructor = [&]<typename... TArgs>(TArgs&&... args) {
+ return NSensorsOwnerPrivate::TChildTraits<TChild>::Create(State_->Profiler, std::forward<TArgs>(args)..., extraArgs...);
+ };
+
+ if constexpr (std::is_same_v<TFindKey, std::monostate>) {
+ static_assert(!childHasKey);
+
+ struct TWrapper : public TRefCounted
+ {
+ TChild Child;
+
+ TWrapper(decltype(childConstructor)& childConstructor_)
+ : Child(childConstructor_())
+ { }
+ };
+
+ auto* wrapperPtr = State_->Children
+ .FindOrInsert(
+ std::type_index(typeid(TChild)),
+ [&] {
+ return New<TWrapper>(childConstructor);
+ })
+ .first->Get();
+ return static_cast<TWrapper*>(wrapperPtr)->Child;
+ } else {
+ using TChildKey = typename NSensorsOwnerPrivate::TChildTraits<TChild>::TKey;
+ using TMap = NConcurrency::TSyncMap<TChildKey, TChild>;
+
+ static_assert(childHasKey);
+ static_assert(!std::is_same_v<TChildKey, TTagSet>, "Use GetWithTags() method");
+
+ auto& childMap = Get<NSensorsOwnerPrivate::TOwnedMapWrapper<TMap>>().Map;
+
+ return *childMap
+ .FindOrInsert(
+ key,
+ [&] {
+ return childConstructor(TChildKey{key});
+ })
+ .first;
+ }
+}
+
+template <typename TChild>
+ requires(!NSensorsOwnerPrivate::TChildTraits<TChild>::HasKey)
+const TChild& TSensorsOwner::GetWithTags(const TTagSet& tags) const
+{
+ struct TSensors
+ {
+ using TKey = NSensorsOwnerPrivate::TTagSetKey;
+
+ TChild Child;
+
+ TSensors(const TProfiler& profiler, const NSensorsOwnerPrivate::TTagSetKey& key)
+ : Child{profiler.WithTags(key.Tags)}
+ { }
+ };
+
+ return Get<TSensors>(NSensorsOwnerPrivate::TTagSetKey{tags}).Child;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NYT::NProfiling
diff --git a/yt/yt/library/profiling/sensors_owner/sensors_owner.cpp b/yt/yt/library/profiling/sensors_owner/sensors_owner.cpp
new file mode 100644
index 00000000000..19a5c238a7a
--- /dev/null
+++ b/yt/yt/library/profiling/sensors_owner/sensors_owner.cpp
@@ -0,0 +1,181 @@
+#include "sensors_owner.h"
+
+#include <util/digest/sequence.h>
+
+namespace NYT::NProfiling {
+
+////////////////////////////////////////////////////////////////////////////////
+
+namespace NSensorsOwnerPrivate {
+
+////////////////////////////////////////////////////////////////////////////////
+
+TTagSetKey::operator ui64() const
+{
+ return TRangeHash<>{}(Tags.Tags());
+}
+
+bool TTagSetKey::operator==(const TTagSetKey& key) const
+{
+ return Tags.Tags() == key.Tags.Tags();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NSensorsOwnerPrivate
+
+namespace {
+
+////////////////////////////////////////////////////////////////////////////////
+
+template <typename TSensor, typename... TArgs>
+struct TSensorWrapper
+{
+ template <TSensor (TProfiler::*Getter)(const TString&, TArgs...) const>
+ struct TImpl
+ {
+ using TKey = TString;
+
+ TImpl(const TProfiler& profiler, const TString& key, TArgs... args)
+ : Sensor((profiler.*Getter)(key, std::move(args)...))
+ { }
+
+ TSensor Sensor;
+ };
+};
+
+using TCounterWrapper = TSensorWrapper<TCounter>::template TImpl<&TProfiler::Counter>;
+using TGaugeWrapper = TSensorWrapper<TGauge>::template TImpl<&TProfiler::Gauge>;
+
+template <typename... Args>
+using TTimeHistogramWrapper = typename TSensorWrapper<TEventTimer, Args...>::template TImpl<&TProfiler::TimeHistogram>;
+template <typename... Args>
+using TGaugeHistogramWrapper = typename TSensorWrapper<TGaugeHistogram, Args...>::template TImpl<&TProfiler::GaugeHistogram>;
+template <typename... Args>
+using TRateHistogramWrapper = typename TSensorWrapper<TRateHistogram, Args...>::template TImpl<&TProfiler::RateHistogram>;
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace
+
+TSensorsOwner::TSensorsOwner()
+ : State_(GetDefaultState())
+{ }
+
+TSensorsOwner::TSensorsOwner(const TProfiler& profiler)
+ : State_(New<TState>(profiler))
+{ }
+
+const TProfiler& TSensorsOwner::GetProfiler() const
+{
+ return State_->Profiler;
+}
+
+TSensorsOwner::TState::TState(const TProfiler& profiler)
+ : Profiler(profiler)
+{ }
+
+const TSensorsOwner& TSensorsOwner::WithTags(const TTagSet& tags) const
+{
+ struct TChild
+ {
+ TSensorsOwner SensorsOwner;
+
+ TChild(const TProfiler& profiler)
+ : SensorsOwner(profiler)
+ { }
+ };
+
+ return GetWithTags<TChild>(tags).SensorsOwner;
+}
+
+const TSensorsOwner& TSensorsOwner::WithTag(const TString& name, const TString& value) const
+{
+ return WithTags(TTagSet().WithTag({name, value}));
+}
+
+const TSensorsOwner& TSensorsOwner::WithRequiredTag(const TString& name, const TString& value) const
+{
+ return WithTags(TTagSet().WithRequiredTag({name, value}));
+}
+
+const TSensorsOwner& TSensorsOwner::WithExcludedTag(const TString& name, const TString& value) const
+{
+ return WithTags(TTagSet().WithExcludedTag({name, value}));
+}
+
+const TSensorsOwner& TSensorsOwner::WithAlternativeTag(const TString& name, const TString& value, int alternativeTo) const
+{
+ return WithTags(TTagSet().WithAlternativeTag({name, value}, alternativeTo));
+}
+
+const TSensorsOwner& TSensorsOwner::WithPrefix(const TString& prefix) const
+{
+ struct TChild
+ {
+ using TKey = TString;
+
+ TSensorsOwner SensorsOwner;
+
+ TChild(const TProfiler& profiler, const TString& prefix)
+ : SensorsOwner(profiler.WithPrefix(prefix))
+ { }
+ };
+
+ return Get<TChild>(prefix).SensorsOwner;
+}
+
+const TCounter& TSensorsOwner::GetCounter(TStringBuf name) const
+{
+ return Get<TCounterWrapper>(name).Sensor;
+}
+
+const TGauge& TSensorsOwner::GetGauge(TStringBuf name) const
+{
+ return Get<TGaugeWrapper>(name).Sensor;
+}
+
+const TEventTimer& TSensorsOwner::GetTimeHistogram(TStringBuf name, std::vector<TDuration> bounds) const
+{
+ return Get<TTimeHistogramWrapper<std::vector<TDuration>>>(name, std::move(bounds)).Sensor;
+}
+
+const TEventTimer& TSensorsOwner::GetTimeHistogram(TStringBuf name, TDuration min, TDuration max) const
+{
+ return Get<TTimeHistogramWrapper<TDuration, TDuration>>(name, min, max).Sensor;
+}
+
+const TGaugeHistogram& TSensorsOwner::GetGaugeHistogram(TStringBuf name, std::vector<double> buckets) const
+{
+ return Get<TGaugeHistogramWrapper<std::vector<double>>>(name, std::move(buckets)).Sensor;
+}
+
+const TRateHistogram& TSensorsOwner::GetRateHistogram(TStringBuf name, std::vector<double> buckets) const
+{
+ return Get<TRateHistogramWrapper<std::vector<double>>>(name, std::move(buckets)).Sensor;
+}
+
+void TSensorsOwner::Inc(TStringBuf name, i64 delta) const
+{
+ GetCounter(name).Increment(delta);
+}
+
+TIntrusivePtr<TSensorsOwner::TState> TSensorsOwner::GetDefaultState()
+{
+ static auto state = New<TState>(TProfiler());
+ return state;
+}
+
+const TSensorsOwner& GetRootSensorsOwner()
+{
+ struct TLocalType
+ {
+ TSensorsOwner SensorsOwner{TProfiler("", "")};
+ };
+
+ return Singleton<TLocalType>()->SensorsOwner;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NYT::NProfiling
diff --git a/yt/yt/library/profiling/sensors_owner/sensors_owner.h b/yt/yt/library/profiling/sensors_owner/sensors_owner.h
new file mode 100644
index 00000000000..d6b5467b0db
--- /dev/null
+++ b/yt/yt/library/profiling/sensors_owner/sensors_owner.h
@@ -0,0 +1,118 @@
+#pragma once
+
+#include "sensors_owner_traits.h"
+
+#include <yt/yt/library/profiling/sensor.h>
+#include <yt/yt/library/profiling/tag.h>
+
+#include <yt/yt/library/syncmap/map.h>
+
+namespace NYT::NProfiling {
+
+////////////////////////////////////////////////////////////////////////////////
+
+//! Class that can own metrics of different types.
+/*!
+ * What does 'own' means?
+ * YT profiler metric is reported only while the corresponding metric object is alive.
+ * So if you increment YT counter and destroy its object, you lost this increment.
+ * This class helps with storing metrics in long-living storage.
+ *
+ * You can find examples in unittests.
+ */
+class TSensorsOwner
+{
+public:
+ //! Returns no-op sensors owner, should be singleton to avoid memory leaks.
+ TSensorsOwner();
+ explicit TSensorsOwner(const TProfiler& profiler);
+
+ //! Gets owned struct of type TChild
+ /*!
+ * If std::is_same<TFindKey, std::monostate>
+ * TChild is constructed as TChild{Profiler, extraArgs...]}.
+ * Result of &Get<TChild>() is always the same with fixed *this, and TChild.
+ * TChild must not contain nested type TKey or member Key.
+ * Else
+ * TChild is constructed as TChild{Profiler, TChildKey{key}, extraArgs...]}.
+ * Result of &Get<TChild>(key) is always the same with fixed *this, key and TChild.
+ * TChild must contain nested type TKey or member Key, TChildKey is determined by them.
+ */
+ template <typename TChild, typename TFindKey = std::monostate, typename... TExtraConstructionArgs>
+ const TChild& Get(const TFindKey& key = {}, const TExtraConstructionArgs&... extraArgs) const;
+
+ //! Gets owned struct of type TChild.
+ /*!
+ * Result of &GetWithTags<TChild>(tags) is always the same with fixed *this, TChild and tags.Tags().
+ * TChild is constructed as TChild{Profiler.WithTags(tags)}.
+ */
+ template <typename TChild>
+ requires(!NSensorsOwnerPrivate::TChildTraits<TChild>::HasKey)
+ const TChild& GetWithTags(const TTagSet& tags) const;
+
+ //! Gets owned TSensorsOwner with profiler=Profiler.WithTags(...).
+ //! Result of WithTags(tags) is always the same with fixed *this and tags.Tags().
+ const TSensorsOwner& WithTags(const TTagSet& tags) const;
+ const TSensorsOwner& WithTag(const TString& name, const TString& value) const;
+ const TSensorsOwner& WithRequiredTag(const TString& name, const TString& value) const;
+ const TSensorsOwner& WithExcludedTag(const TString& name, const TString& value) const;
+ const TSensorsOwner& WithAlternativeTag(const TString& name, const TString& value, int alternativeTo) const;
+
+ //! Gets owned TSensorsOwner with profiler=Profiler.WithPrefix(...).
+ //! Result of WithPrefix(prefix) is always the same with fixed *this and prefix.
+ const TSensorsOwner& WithPrefix(const TString& prefix) const;
+
+ const TProfiler& GetProfiler() const;
+
+ /*!
+ * Note that it is generally better to have a structure storing all the sensors
+ * you need and access it through the Get method. Avoid using methods below
+ * unless you only need a single sensor and lookup by your key is not
+ * cheaper than by TString, or you don't care about performance.
+ */
+
+ //! Gets owned counter with given metric suffix.
+ const TCounter& GetCounter(TStringBuf name) const;
+
+ //! ~ .Counter(str).Increment(delta)
+ void Inc(TStringBuf name, i64 delta) const;
+
+ //! Gets owned gauge with given metric suffix.
+ const TGauge& GetGauge(TStringBuf name) const;
+
+ //! Gets owned TimeHistogram with given metric suffix using bounds as a constructor argument.
+ const TEventTimer& GetTimeHistogram(TStringBuf name, std::vector<TDuration> bounds) const;
+
+ //! Gets owned TimeHistogram with given metric suffix using min/max as a constructor arguments.
+ const TEventTimer& GetTimeHistogram(TStringBuf name, TDuration min, TDuration max) const;
+
+ //! Gets owned GaugeHistogram with given metric suffix using buckets as a constructor.
+ const TGaugeHistogram& GetGaugeHistogram(TStringBuf name, std::vector<double> buckets) const;
+
+ //! Gets owned RateHistogram with given metric suffix using buckets as a constructor.
+ const TRateHistogram& GetRateHistogram(TStringBuf name, std::vector<double> buckets) const;
+
+private:
+ struct TState final
+ {
+ TProfiler Profiler;
+ NConcurrency::TSyncMap<std::type_index, TRefCountedPtr> Children;
+
+ explicit TState(const TProfiler& profiler);
+ };
+
+ TIntrusivePtr<TState> State_;
+
+ static TIntrusivePtr<TState> GetDefaultState();
+};
+
+// Root sensors owner to create others from. Has empty prefix.
+const TSensorsOwner& GetRootSensorsOwner();
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NYT::NProfiling
+
+#define ALLOW_INCLUDE_SENSORS_OWNER_INL_H
+#include "sensors_owner-inl.h"
+#undef ALLOW_INCLUDE_SENSORS_OWNER_INL_H
diff --git a/yt/yt/library/profiling/sensors_owner/sensors_owner_traits.h b/yt/yt/library/profiling/sensors_owner/sensors_owner_traits.h
new file mode 100644
index 00000000000..504d94dee31
--- /dev/null
+++ b/yt/yt/library/profiling/sensors_owner/sensors_owner_traits.h
@@ -0,0 +1,100 @@
+#pragma once
+
+// Public API is in sensors_owner.h
+
+#include <library/cpp/yt/memory/new.h>
+
+#include <util/generic/ptr.h>
+
+namespace NYT::NProfiling::NSensorsOwnerPrivate {
+
+////////////////////////////////////////////////////////////////////////////////
+
+template <class TChild>
+struct TChildTypeTraits
+{
+ using TValue = TChild;
+
+ template <typename... TArgs>
+ static TChild Create(TArgs&&... args)
+ {
+ return TChild{std::forward<TArgs>(args)...};
+ }
+};
+
+template <class TValue_>
+struct TChildTypeTraits<TIntrusivePtr<TValue_>>
+{
+ using TValue = TValue_;
+
+ template <typename... TArgs>
+ static TIntrusivePtr<TValue> Create(TArgs&&... args)
+ {
+ return New<TValue>(std::forward<TArgs>(args)...);
+ }
+};
+
+template <typename TValue_, typename TPtr>
+struct TChildPtrTypeTraits
+{
+ using TValue = TValue_;
+
+ template <typename... TArgs>
+ static TPtr Create(TArgs&&... args)
+ {
+ return TPtr{new TValue{std::forward<TArgs>(args)...}};
+ }
+};
+
+template <class TValue>
+struct TChildTypeTraits<TAtomicSharedPtr<TValue>>
+ : public TChildPtrTypeTraits<TValue, TAtomicSharedPtr<TValue>>
+{ };
+
+template <class TValue>
+struct TChildTypeTraits<std::shared_ptr<TValue>>
+ : public TChildPtrTypeTraits<TValue, std::shared_ptr<TValue>>
+{ };
+
+template <class TChild>
+concept CHasKeyField = requires(TChild c) {
+ c.Key;
+};
+template <class TChild>
+concept CHasKeyAlias = requires {
+ typename TChild::TKey;
+};
+
+template <class TValue>
+struct TKeyTraits
+{
+ static constexpr bool HasKey = false;
+};
+
+template <CHasKeyField TValue>
+struct TKeyTraits<TValue>
+{
+ using TKey = std::decay_t<decltype(std::declval<TValue>().Key)>;
+
+ static constexpr bool HasKey = true;
+};
+
+template <CHasKeyAlias TValue>
+struct TKeyTraits<TValue>
+{
+ using TKey = typename TValue::TKey;
+
+ static constexpr bool HasKey = true;
+};
+
+template <class TChild>
+struct TChildTraits
+ : public TChildTypeTraits<TChild>
+ , public TKeyTraits<typename TChildTypeTraits<TChild>::TValue>
+{
+ static_assert(std::is_same_v<TChild, std::decay_t<TChild>>);
+};
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NYT::NProfiling::NSensorsOwnerPrivate
diff --git a/yt/yt/library/profiling/sensors_owner/unittests/sensors_owner_ut.cpp b/yt/yt/library/profiling/sensors_owner/unittests/sensors_owner_ut.cpp
new file mode 100644
index 00000000000..a1f101bb84a
--- /dev/null
+++ b/yt/yt/library/profiling/sensors_owner/unittests/sensors_owner_ut.cpp
@@ -0,0 +1,178 @@
+#include <yt/yt/library/profiling/sensors_owner/sensors_owner.h>
+
+#include <library/cpp/testing/gtest/gtest.h>
+
+using namespace std::literals;
+
+namespace NYT::NProfiling {
+namespace {
+
+////////////////////////////////////////////////////////////////////////////////
+
+TEST(TSensorsOwnerTest, Example)
+{
+ TProfiler profiler("", "bigrt.test");
+ auto owner = TSensorsOwner(profiler);
+
+ struct TSensors
+ {
+ TProfiler Profiler;
+ TCounter Counter = Profiler.Counter(".my_counter");
+ TSensorsOwner OtherSensors{Profiler};
+ };
+
+ struct TChildSensors
+ {
+ TCounter Counter;
+
+ TChildSensors(const TProfiler& p)
+ : Counter(p.Counter(".my_counter_2"))
+ { }
+ };
+
+ struct TAnotherSensors
+ {
+ TProfiler Profiler;
+ int Key;
+ TCounter Counter = Profiler.WithTag("counter", ToString(Key)).Counter(".another_counter");
+ };
+
+ struct TWithTagsSensors
+ {
+ TProfiler Profiler;
+ TCounter Counter = Profiler.Counter(".by_tags_counter");
+ };
+
+ struct TSharedSensors final
+ {
+ TProfiler Profiler;
+ TCounter Counter = Profiler.Counter(".under_ptr_counter");
+ };
+
+ using TSharedSensorsPtr = NYT::TIntrusivePtr<TSharedSensors>;
+
+ owner.Inc(".my_simple_counter", 1);
+ owner.Get<TSensors>().OtherSensors.Get<TChildSensors>().Counter.Increment(1);
+ owner.Get<TSharedSensorsPtr>()->Counter.Increment(1);
+ owner.Get<TAnotherSensors>(42).Counter.Increment(1);
+ owner.WithPrefix(".prefix").Get<TAnotherSensors>(42).Counter.Increment(1);
+ owner.GetWithTags<TWithTagsSensors>(TTagSet().WithTag({"key", "value"})).Counter.Increment(1);
+ owner.WithTags(TTagSet().WithTag({"key", "value2"})).Get<TWithTagsSensors>().Counter.Increment(1);
+
+ struct THistogramSensors
+ {
+ TProfiler Profiler;
+ int Key;
+ std::vector<TDuration> Buckets;
+ TEventTimer Histogram = Profiler.WithTag("tag", ToString(Key)).TimeHistogram(".another_counter", Buckets);
+ };
+
+ owner.Get<THistogramSensors>(/*Key*/ 132, /*Buckets*/ std::vector<TDuration>{5s, 10min}).Histogram.Record(6s);
+}
+
+void DoSmth(/*... , */ const TSensorsOwner& sensorsOwner)
+{
+ // В функции можно прям по месту объявлять структуру с метриками и пользоваться.
+ struct TSensors
+ {
+ TProfiler Profiler;
+ TCounter TotalCount = Profiler.Counter(".count");
+ TCounter FailedCount = Profiler.Counter(".failed_count");
+ };
+
+ // Тут одна и та же ссылка на объект метрик при условии, что в функцию передается один и тот же sensorsOwner.
+ // Метод `.Get` достаточно эффективен, но всё же лучше не вызывать лишний раз.
+ const auto& sensors = sensorsOwner.Get<TSensors>();
+
+ //...
+ bool failed = false;
+ //...
+
+ sensors.TotalCount.Increment(1);
+ if (failed) {
+ sensors.FailedCount.Increment(1);
+ }
+}
+
+TEST(TSensorsOwnerTest, Simple)
+{
+ TProfiler profiler("", "bigrt.test");
+ auto registryPtr = profiler.GetRegistry();
+ auto owner = TSensorsOwner(profiler);
+
+ DoSmth(owner);
+
+ ASSERT_EQ(registryPtr, owner.GetProfiler().GetRegistry()); // Equal profilers.
+
+ struct TChild1
+ {
+ TProfiler Profiler;
+ int A = 1;
+ };
+
+ ASSERT_EQ(registryPtr, owner.Get<TChild1>().Profiler.GetRegistry());
+ ASSERT_EQ(1, owner.Get<TChild1>().A);
+ ASSERT_EQ(owner.Get<TChild1>().Profiler.GetRegistry(), owner.Get<TChild1>().Profiler.GetRegistry());
+ ASSERT_EQ(&owner.Get<TChild1>(), &owner.Get<TChild1>());
+
+ struct TChild2
+ {
+ TProfiler Profiler;
+ int B = 2;
+
+ TChild2(const TProfiler& p)
+ : Profiler(p)
+ {
+ }
+ };
+
+ ASSERT_EQ(registryPtr, owner.Get<TChild2>().Profiler.GetRegistry());
+ ASSERT_EQ(2, owner.Get<TChild2>().B);
+ ASSERT_EQ(owner.Get<TChild2>().Profiler.GetRegistry(), owner.Get<TChild2>().Profiler.GetRegistry());
+
+ struct TSensorsByKey
+ {
+ TProfiler Profiler;
+ int Key;
+ TCounter Counter = Profiler.WithTag("key", ToString(Key)).Counter(".by_key_counter");
+ };
+
+ ASSERT_EQ(42, (owner.Get<TSensorsByKey>(42).Key));
+ ASSERT_EQ(43, (owner.Get<TSensorsByKey>(43).Key));
+
+ struct TWithTagsSensors
+ {
+ TProfiler Profiler;
+ TCounter Counter = Profiler.Counter(".by_tags_counter");
+ };
+
+ ASSERT_EQ(
+ &owner.GetWithTags<TWithTagsSensors>(TTagSet().WithTag({"key", "value"})),
+ &owner.GetWithTags<TWithTagsSensors>(TTagSet().WithTag({"key", "value"})));
+
+ ASSERT_EQ(
+ &owner.WithTags(TTagSet().WithTag({"key", "value2"})).Get<TWithTagsSensors>(),
+ &owner.WithTags(TTagSet().WithTag({"key", "value2"})).Get<TWithTagsSensors>());
+
+ ASSERT_EQ(
+ &owner.WithPrefix(".prefix").Get<TChild1>(),
+ &owner.WithPrefix(".prefix").Get<TChild1>());
+}
+
+TEST(TSensorsOwnerTest, Copy)
+{
+ auto owner = TSensorsOwner(TProfiler("", "bigrt.test"));
+ auto owner2 = owner;
+
+ struct TChild
+ {
+ TProfiler Profiler;
+ };
+
+ ASSERT_EQ(&owner.Get<TChild>(), &owner2.Get<TChild>()); // The same owner.
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace
+} // namespace NYT::NProfiling
diff --git a/yt/yt/library/profiling/sensors_owner/unittests/ya.make b/yt/yt/library/profiling/sensors_owner/unittests/ya.make
new file mode 100644
index 00000000000..ccb22b251d4
--- /dev/null
+++ b/yt/yt/library/profiling/sensors_owner/unittests/ya.make
@@ -0,0 +1,13 @@
+GTEST()
+
+INCLUDE(${ARCADIA_ROOT}/yt/ya_cpp.make.inc)
+
+SRCS(
+ sensors_owner_ut.cpp
+)
+
+PEERDIR(
+ yt/yt/library/profiling/sensors_owner
+)
+
+END()
diff --git a/yt/yt/library/profiling/sensors_owner/ya.make b/yt/yt/library/profiling/sensors_owner/ya.make
new file mode 100644
index 00000000000..e2a01ea0d04
--- /dev/null
+++ b/yt/yt/library/profiling/sensors_owner/ya.make
@@ -0,0 +1,16 @@
+LIBRARY()
+
+INCLUDE(${ARCADIA_ROOT}/yt/ya_cpp.make.inc)
+
+SRCS(
+ sensors_owner.cpp
+)
+
+PEERDIR(
+ yt/yt/core
+ yt/yt/library/profiling
+)
+
+END()
+
+RECURSE_FOR_TESTS(unittests)
diff --git a/yt/yt/library/profiling/testing.cpp b/yt/yt/library/profiling/testing.cpp
index 22276ac006a..b8989328a48 100644
--- a/yt/yt/library/profiling/testing.cpp
+++ b/yt/yt/library/profiling/testing.cpp
@@ -32,6 +32,12 @@ TDuration TTesting::ReadTimeCounter(const TTimeCounter& counter)
return counter.Counter_->GetValue();
}
+THistogramSnapshot TTesting::ReadRateHistogram(const TRateHistogram& histogram)
+{
+ Y_ENSURE(histogram.Histogram_, "Histogram is not registered");
+ return histogram.Histogram_->GetSnapshot(false);
+}
+
const TSensorOptions& TTesting::ReadOptions(const TProfiler& profiler) {
return profiler.Options_;
}
diff --git a/yt/yt/library/profiling/testing.h b/yt/yt/library/profiling/testing.h
index 116706a9518..62fac315919 100644
--- a/yt/yt/library/profiling/testing.h
+++ b/yt/yt/library/profiling/testing.h
@@ -12,6 +12,7 @@ struct TTesting
static TDuration ReadTimeGauge(const TTimeGauge& gauge);
static i64 ReadCounter(const TCounter& counter);
static TDuration ReadTimeCounter(const TTimeCounter& counter);
+ static THistogramSnapshot ReadRateHistogram(const TRateHistogram& histogram);
static const TSensorOptions& ReadOptions(const TProfiler& profiler);
};
diff --git a/yt/yt/library/profiling/ya.make b/yt/yt/library/profiling/ya.make
index 6e2e6265645..c59ab7d6432 100644
--- a/yt/yt/library/profiling/ya.make
+++ b/yt/yt/library/profiling/ya.make
@@ -22,6 +22,7 @@ PEERDIR(
END()
RECURSE(
+ sensors_owner
solomon
unittests
example
diff --git a/yt/yt/library/program/config.cpp b/yt/yt/library/program/config.cpp
index bff7c7ddc35..9e9437bddb0 100644
--- a/yt/yt/library/program/config.cpp
+++ b/yt/yt/library/program/config.cpp
@@ -6,14 +6,6 @@ using namespace NYTree;
////////////////////////////////////////////////////////////////////////////////
-void TRpcConfig::Register(TRegistrar registrar)
-{
- registrar.Parameter("tracing", &TThis::Tracing)
- .Default();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
void THeapSizeLimit::Register(TRegistrar registrar)
{
registrar.Parameter("container_memory_ratio", &TThis::ContainerMemoryRatio)
@@ -95,7 +87,7 @@ void TSingletonsConfig::Register(TRegistrar registrar)
.DefaultCtor([] () { return NLogging::TLogManagerConfig::CreateDefault(); });
registrar.Parameter("jaeger", &TThis::Jaeger)
.DefaultNew();
- registrar.Parameter("rpc", &TThis::Rpc)
+ registrar.Parameter("tracing_transport", &TThis::TracingTransport)
.DefaultNew();
registrar.Parameter("tcmalloc", &TThis::TCMalloc)
.DefaultNew();
@@ -135,7 +127,7 @@ void TSingletonsDynamicConfig::Register(TRegistrar registrar)
.DefaultNew();
registrar.Parameter("jaeger", &TThis::Jaeger)
.DefaultNew();
- registrar.Parameter("rpc", &TThis::Rpc)
+ registrar.Parameter("tracing_transport", &TThis::TracingTransport)
.DefaultNew();
registrar.Parameter("tcmalloc", &TThis::TCMalloc)
.Optional();
diff --git a/yt/yt/library/program/config.h b/yt/yt/library/program/config.h
index a5432c284ec..64723698f2e 100644
--- a/yt/yt/library/program/config.h
+++ b/yt/yt/library/program/config.h
@@ -2,6 +2,8 @@
#include "public.h"
+#include <yt/yt/core/tracing/config.h>
+
#include <yt/yt/core/ytree/yson_struct.h>
#include <yt/yt/core/ytalloc/config.h>
@@ -27,26 +29,10 @@
#include <library/cpp/yt/stockpile/stockpile.h>
-
namespace NYT {
////////////////////////////////////////////////////////////////////////////////
-class TRpcConfig
- : public NYTree::TYsonStruct
-{
-public:
- NTracing::TTracingConfigPtr Tracing;
-
- REGISTER_YSON_STRUCT(TRpcConfig);
-
- static void Register(TRegistrar registrar);
-};
-
-DEFINE_REFCOUNTED_TYPE(TRpcConfig)
-
-////////////////////////////////////////////////////////////////////////////////
-
class THeapSizeLimit
: public virtual NYTree::TYsonStruct
{
@@ -147,7 +133,7 @@ public:
NProfiling::TSolomonExporterConfigPtr SolomonExporter;
NLogging::TLogManagerConfigPtr Logging;
NTracing::TJaegerTracerConfigPtr Jaeger;
- TRpcConfigPtr Rpc;
+ NTracing::TTracingTransportConfigPtr TracingTransport;
TTCMallocConfigPtr TCMalloc;
TStockpileConfigPtr Stockpile;
bool EnableRefCountedTrackerProfiling;
@@ -175,7 +161,7 @@ public:
NRpc::TDispatcherDynamicConfigPtr RpcDispatcher;
NLogging::TLogManagerDynamicConfigPtr Logging;
NTracing::TJaegerTracerDynamicConfigPtr Jaeger;
- TRpcConfigPtr Rpc;
+ NTracing::TTracingTransportConfigPtr TracingTransport;
TTCMallocConfigPtr TCMalloc;
NYson::TProtobufInteropDynamicConfigPtr ProtobufInterop;
diff --git a/yt/yt/library/program/helpers.cpp b/yt/yt/library/program/helpers.cpp
index 2fdf0337911..6ac11133279 100644
--- a/yt/yt/library/program/helpers.cpp
+++ b/yt/yt/library/program/helpers.cpp
@@ -177,8 +177,7 @@ void ConfigureTCMalloc(const TTCMallocConfigPtr& config)
}
}
-template <class TConfig>
-void ConfigureSingletonsImpl(const TConfig& config)
+void ConfigureSingletons(const TSingletonsConfigPtr& config)
{
SetSpinWaitSlowPathLoggingThreshold(config->SpinWaitSlowPathLoggingThreshold);
@@ -213,8 +212,8 @@ void ConfigureSingletonsImpl(const TConfig& config)
NProfiling::EnablePerfCounters();
- if (auto tracingConfig = config->Rpc->Tracing) {
- NTracing::SetTracingConfig(tracingConfig);
+ if (auto tracingConfig = config->TracingTransport) {
+ NTracing::SetTracingTransportConfig(tracingConfig);
}
ConfigureTCMalloc(config->TCMalloc);
@@ -235,13 +234,7 @@ void ConfigureSingletonsImpl(const TConfig& config)
NYson::SetProtobufInteropConfig(config->ProtobufInterop);
}
-void ConfigureSingletons(const TSingletonsConfigPtr& config)
-{
- ConfigureSingletonsImpl(config);
-}
-
-template <class TStaticConfig, class TDynamicConfig>
-void ReconfigureSingletonsImpl(const TStaticConfig& config, const TDynamicConfig& dynamicConfig)
+void ReconfigureSingletons(const TSingletonsConfigPtr& config, const TSingletonsDynamicConfigPtr& dynamicConfig)
{
SetSpinWaitSlowPathLoggingThreshold(dynamicConfig->SpinWaitSlowPathLoggingThreshold.value_or(config->SpinWaitSlowPathLoggingThreshold));
@@ -264,10 +257,10 @@ void ReconfigureSingletonsImpl(const TStaticConfig& config, const TDynamicConfig
NRpc::TDispatcher::Get()->Configure(config->RpcDispatcher->ApplyDynamic(dynamicConfig->RpcDispatcher));
- if (dynamicConfig->Rpc->Tracing) {
- NTracing::SetTracingConfig(dynamicConfig->Rpc->Tracing);
- } else if (config->Rpc->Tracing) {
- NTracing::SetTracingConfig(config->Rpc->Tracing);
+ if (dynamicConfig->TracingTransport) {
+ NTracing::SetTracingTransportConfig(dynamicConfig->TracingTransport);
+ } else if (config->TracingTransport) {
+ NTracing::SetTracingTransportConfig(config->TracingTransport);
}
if (dynamicConfig->TCMalloc) {
@@ -279,11 +272,6 @@ void ReconfigureSingletonsImpl(const TStaticConfig& config, const TDynamicConfig
NYson::SetProtobufInteropConfig(config->ProtobufInterop->ApplyDynamic(dynamicConfig->ProtobufInterop));
}
-void ReconfigureSingletons(const TSingletonsConfigPtr& config, const TSingletonsDynamicConfigPtr& dynamicConfig)
-{
- ReconfigureSingletonsImpl(config, dynamicConfig);
-}
-
template <class TConfig>
void StartDiagnosticDumpImpl(const TConfig& config)
{
diff --git a/yt/yt/library/tracing/example/main.cpp b/yt/yt/library/tracing/example/main.cpp
index d2bbcb1972b..9f2fabcf690 100644
--- a/yt/yt/library/tracing/example/main.cpp
+++ b/yt/yt/library/tracing/example/main.cpp
@@ -113,7 +113,7 @@ int main(int argc, char* argv[])
throw yexception() << usage;
}
- auto config = New<NTracing::TJaegerTracerConfig>();
+ static auto config = New<NTracing::TJaegerTracerConfig>();
config->CollectorChannelConfig = New<NRpc::NGrpc::TChannelConfig>();
config->CollectorChannelConfig->Address = argv[1];
diff --git a/yt/yt/library/tracing/jaeger/tracer.cpp b/yt/yt/library/tracing/jaeger/tracer.cpp
index 43817c119f9..dec77c7f904 100644
--- a/yt/yt/library/tracing/jaeger/tracer.cpp
+++ b/yt/yt/library/tracing/jaeger/tracer.cpp
@@ -25,6 +25,8 @@
#include <util/system/env.h>
#include <util/system/byteorder.h>
+#include <stack>
+
namespace NYT::NTracing {
using namespace NRpc;
diff --git a/yt/yt/library/ytprof/allocation_tag_profiler/allocation_tag_profiler.cpp b/yt/yt/library/ytprof/allocation_tag_profiler/allocation_tag_profiler.cpp
new file mode 100644
index 00000000000..de5e7988bc7
--- /dev/null
+++ b/yt/yt/library/ytprof/allocation_tag_profiler/allocation_tag_profiler.cpp
@@ -0,0 +1,84 @@
+#include "allocation_tag_profiler.h"
+
+#include <yt/yt/core/concurrency/periodic_executor.h>
+#include <yt/yt/library/ytprof/heap_profiler.h>
+
+namespace NYT::NYTProf {
+
+using namespace NProfiling;
+using namespace NConcurrency;
+
+////////////////////////////////////////////////////////////////////////////////
+
+THeapUsageProfiler::THeapUsageProfiler(
+ std::vector<TString> tags,
+ IInvokerPtr invoker,
+ std::optional<TDuration> updatePeriod,
+ std::optional<i64> samplingRate,
+ NProfiling::TProfiler profiler)
+ : Profiler_(std::move(profiler))
+ , TagTypes_(std::move(tags))
+ , UpdateExecutor_(New<TPeriodicExecutor>(
+ std::move(invoker),
+ BIND(&THeapUsageProfiler::UpdateGauges, MakeWeak(this)),
+ std::move(updatePeriod)))
+{
+ if (samplingRate) {
+ tcmalloc::MallocExtension::SetProfileSamplingRate(*samplingRate);
+ }
+
+ UpdateExecutor_->Start();
+}
+
+void THeapUsageProfiler::UpdateGauges()
+{
+ const auto memorySnapshot = GetMemoryUsageSnapshot();
+ YT_VERIFY(memorySnapshot);
+
+ for (const auto& tagType : TagTypes_) {
+ auto& heapUsageMap = HeapUsageByType_.emplace(tagType, THashMap<TString, TGauge>{}).first->second;
+ const auto& snapshotSlice = memorySnapshot->GetUsage(tagType);
+
+ for (auto &[tag, gauge] : heapUsageMap) {
+ if (const auto& iter = snapshotSlice.find(tag)) {
+ gauge.Update(iter->second);
+ } else {
+ gauge.Update(0.0);
+ }
+ }
+
+ for (const auto& [tag, usage] : snapshotSlice) {
+ auto gauge = heapUsageMap.find(tag);
+
+ if (gauge.IsEnd()) {
+ gauge = heapUsageMap.emplace(tag, Profiler_
+ .WithTag(tagType, tag)
+ .Gauge(tagType))
+ .first;
+ gauge->second.Update(usage);
+ }
+ }
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+
+THeapUsageProfilerPtr CreateHeapProfilerWithTags(
+ std::vector<TString>&& tags,
+ IInvokerPtr invoker,
+ std::optional<TDuration> updatePeriod,
+ std::optional<i64> samplingRate,
+ NYT::NProfiling::TProfiler profiler)
+{
+ return New<THeapUsageProfiler>(
+ std::move(tags),
+ std::move(invoker),
+ std::move(updatePeriod),
+ std::move(samplingRate),
+ std::move(profiler));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NYT::NYTProf
+
diff --git a/yt/yt/library/ytprof/allocation_tag_profiler/allocation_tag_profiler.h b/yt/yt/library/ytprof/allocation_tag_profiler/allocation_tag_profiler.h
new file mode 100644
index 00000000000..fcf7be4cfe9
--- /dev/null
+++ b/yt/yt/library/ytprof/allocation_tag_profiler/allocation_tag_profiler.h
@@ -0,0 +1,53 @@
+#pragma once
+
+#include "public.h"
+
+#include <yt/yt/library/profiling/sensor.h>
+
+#include <yt/yt/core/actions/public.h>
+
+#include <yt/yt/core/concurrency/public.h>
+
+#include <yt/yt/core/tracing/public.h>
+
+#include <yt/yt/core/profiling/public.h>
+
+namespace NYT::NYTProf {
+
+////////////////////////////////////////////////////////////////////////////////
+
+class THeapUsageProfiler
+ : public TRefCounted
+{
+public:
+ THeapUsageProfiler(
+ std::vector<TString> tags,
+ IInvokerPtr invoker,
+ std::optional<TDuration> updatePeriod,
+ std::optional<i64> samplingRate,
+ NProfiling::TProfiler profiler);
+
+private:
+ NProfiling::TProfiler Profiler_;
+ const std::vector<TString> TagTypes_;
+ THashMap<TString, THashMap<TString, NProfiling::TGauge>> HeapUsageByType_;
+
+ const NConcurrency::TPeriodicExecutorPtr UpdateExecutor_;
+
+ void UpdateGauges();
+};
+
+DEFINE_REFCOUNTED_TYPE(THeapUsageProfiler)
+
+////////////////////////////////////////////////////////////////////////////////
+
+THeapUsageProfilerPtr CreateHeapProfilerWithTags(
+ std::vector<TString>&& tags,
+ IInvokerPtr invoker,
+ std::optional<TDuration> updatePeriod,
+ std::optional<i64> samplingRate,
+ NProfiling::TProfiler profiler = NProfiling::TProfiler{"/heap_usage/"});
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NYT::NYTProf
diff --git a/yt/yt/library/ytprof/allocation_tag_profiler/public.h b/yt/yt/library/ytprof/allocation_tag_profiler/public.h
new file mode 100644
index 00000000000..b5d8d9f9833
--- /dev/null
+++ b/yt/yt/library/ytprof/allocation_tag_profiler/public.h
@@ -0,0 +1,13 @@
+#pragma once
+
+#include <library/cpp/yt/memory/ref_counted.h>
+
+namespace NYT::NYTProf {
+
+////////////////////////////////////////////////////////////////////////////////
+
+DECLARE_REFCOUNTED_CLASS(THeapUsageProfiler);
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NYT::NYTProf
diff --git a/yt/yt/library/ytprof/allocation_tag_profiler/ya.make b/yt/yt/library/ytprof/allocation_tag_profiler/ya.make
new file mode 100644
index 00000000000..24aa93e4401
--- /dev/null
+++ b/yt/yt/library/ytprof/allocation_tag_profiler/ya.make
@@ -0,0 +1,17 @@
+LIBRARY()
+
+INCLUDE(${ARCADIA_ROOT}/yt/ya_cpp.make.inc)
+
+SRCS(
+ allocation_tag_profiler.cpp
+)
+
+PEERDIR(
+ yt/yt/library/profiling
+ yt/yt/library/ytprof
+ yt/yt/core
+)
+
+END()
+
+
diff --git a/yt/yt/library/ytprof/ya.make b/yt/yt/library/ytprof/ya.make
index 3ceb7aeda93..f093c2f7ad7 100644
--- a/yt/yt/library/ytprof/ya.make
+++ b/yt/yt/library/ytprof/ya.make
@@ -51,6 +51,7 @@ CXXFLAGS(-DYTPROF_BUILD_TYPE='\"${BUILD_TYPE}\"')
END()
RECURSE(
+ allocation_tag_profiler
http
example
bundle
diff --git a/yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto b/yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto
index 5abd0816534..f8977a71a45 100644
--- a/yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto
+++ b/yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto
@@ -271,6 +271,38 @@ enum EJobSpecSource
JSS_AUTO = 0xFFFF;
}
+enum EQueryEngine
+{
+ QE_UNKNOWN = 100;
+
+ QE_QL = 0;
+ QE_YQL = 1;
+ QE_CHYT = 2;
+ QE_MOCK = 3;
+ QE_SPYT = 4;
+}
+
+enum EContentType
+{
+ CT_RAW_INLINE_DATA = 0;
+ CT_URL = 1;
+}
+
+enum EQueryState
+{
+ QS_UNKNOWN = 100;
+
+ QS_DRAFT = 0;
+ QS_PENDING = 1;
+ QS_RUNNING = 2;
+ QS_ABORTING = 3;
+ QS_ABORTED = 4;
+ QS_COMPLETING = 5;
+ QS_COMPLETED = 6;
+ QS_FAILING = 7;
+ QS_FAILED = 8;
+}
+
// COMPAT(max42).
// A legacy analog of NYT.NYTree.NProto.TAttributeFilter.
// It is different in that universal filter is encoded via all = true
@@ -591,7 +623,7 @@ message TReqSelectRows
optional bool use_canonical_null_relations = 20;
optional bool merge_versioned_rows = 21;
optional int32 syntax_version = 22 [default = 1];
- optional bool use_web_assembly = 23;
+ optional int32 execution_backend = 23; // EExecutionBackend
optional TSuppressableAccessTrackingOptions suppressable_access_tracking_options = 104;
}
@@ -3004,3 +3036,174 @@ message TCheckPermissionByAclResult
optional string subject_name = 3;
repeated string missing_subjects = 4;
}
+
+////////////////////////////////////////////////////////////////////////////////
+// Query Tracker
+////////////////////////////////////////////////////////////////////////////////
+
+message TReqStartQuery
+{
+ message TQueryFile
+ {
+ required string name = 1;
+ required string content = 2;
+ required EContentType type = 3;
+ }
+
+ required string query_tracker_stage = 1;
+ required EQueryEngine engine = 2;
+ required string query = 3;
+ optional bytes settings = 4; // YSON
+ optional bool draft = 5;
+ optional bytes annotations = 6; // YSON
+ repeated TQueryFile files = 7;
+ optional string access_control_object = 8;
+}
+
+message TRspStartQuery
+{
+ optional NYT.NProto.TGuid query_id = 1;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+message TReqAbortQuery
+{
+ required string query_tracker_stage = 1;
+ required NYT.NProto.TGuid query_id = 2;
+ optional string abort_message = 3;
+}
+
+message TRspAbortQuery
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+message TReqGetQueryResult
+{
+ required string query_tracker_stage = 1;
+ required NYT.NProto.TGuid query_id = 2;
+ required int64 result_index = 3;
+}
+
+message TRspGetQueryResult
+{
+ required NYT.NProto.TGuid query_id = 1;
+ required int64 result_index = 2;
+ optional NYT.NProto.TError error = 3;
+ optional TTableSchema schema = 4;
+ required NYT.NChunkClient.NProto.TDataStatistics data_statistics = 5;
+ required bool is_truncated = 6;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+message TReqReadQueryResult
+{
+ message TColumns
+ {
+ repeated string items = 1;
+ }
+
+ required string query_tracker_stage = 1;
+ required NYT.NProto.TGuid query_id = 2;
+ required int64 result_index = 3;
+ optional TColumns columns = 4;
+ optional int64 lower_row_index = 5;
+ optional int64 upper_row_index = 6;
+}
+
+message TRspReadQueryResult
+{
+ required TRowsetDescriptor rowset_descriptor = 1;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+message TQuery
+{
+ required NYT.NProto.TGuid id = 1;
+ optional EQueryEngine engine = 2;
+ optional string query = 3;
+ optional bytes files = 4; // YSON
+ optional uint64 start_time = 5; // TInstant
+ optional uint64 finish_time = 6; // TInstant
+ optional bytes settings = 7; // YSON
+ optional string user = 8;
+ optional string access_control_object = 9;
+ optional EQueryState state = 10;
+ optional int64 result_count = 11;
+ optional bytes progress = 12; // YSON
+ optional NYT.NProto.TError error = 13;
+ optional bytes annotations = 14; // YSON
+ optional NYT.NYTree.NProto.TAttributeDictionary other_attributes = 15;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+message TReqGetQuery
+{
+ required string query_tracker_stage = 1;
+ required NYT.NProto.TGuid query_id = 2;
+ optional NYT.NYTree.NProto.TAttributeFilter attributes = 3;
+ optional uint64 timestamp = 4;
+}
+
+message TRspGetQuery
+{
+ optional TQuery query = 1;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+message TReqListQueries
+{
+ required string query_tracker_stage = 1;
+ optional uint64 from_time = 2; // TInstant
+ optional uint64 to_time = 3; // TInstant
+ optional uint64 cursor_time = 4; // TInstant
+ optional EOperationSortDirection cursor_direction = 5 [default = OSD_PAST];
+ optional string user_filter = 6;
+ optional EQueryState state_filter = 7;
+ optional EQueryEngine engine_filter = 8;
+ optional string substr_filter = 9;
+ optional uint64 limit = 10 [default = 100];
+ optional NYT.NYTree.NProto.TAttributeFilter attributes = 11;
+}
+
+message TRspListQueries
+{
+ repeated TQuery queries = 1;
+ required bool incomplete = 2;
+ required uint64 timestamp = 3;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+message TReqAlterQuery
+{
+ required string query_tracker_stage = 1;
+ required NYT.NProto.TGuid query_id = 2;
+ optional bytes annotations = 3; // YSON
+ optional string access_control_object = 4;
+}
+
+message TRspAlterQuery
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+message TReqGetQueryTrackerInfo
+{
+ required string query_tracker_stage = 1;
+ optional NYT.NYTree.NProto.TAttributeFilter attributes = 2;
+}
+
+message TRspGetQueryTrackerInfo
+{
+ required string cluster_name = 1;
+ required bytes supported_features = 2; // YSON
+ repeated string access_control_objects = 3;
+}
diff --git a/yt/yt_proto/yt/client/chunk_client/proto/chunk_meta.proto b/yt/yt_proto/yt/client/chunk_client/proto/chunk_meta.proto
index 874ec93151d..e6aad0b3c07 100644
--- a/yt/yt_proto/yt/client/chunk_client/proto/chunk_meta.proto
+++ b/yt/yt_proto/yt/client/chunk_client/proto/chunk_meta.proto
@@ -146,11 +146,10 @@ message TStripedErasurePlacementExt
// Sizes of the original blocks.
repeated int64 block_sizes = 3;
- // Some of the input blocks can be padded to fit into the segment.
- repeated int64 block_padding_sizes = 5;
-
// Checksums of the original blocks.
repeated fixed64 block_checksums = 4;
+
+ reserved 5;
}
// TChunkMeta is stored in *.meta files on data nodes
diff --git a/yt/yt_proto/yt/client/transaction_client/proto/timestamp_service.proto b/yt/yt_proto/yt/client/transaction_client/proto/timestamp_service.proto
index 792e964de30..7bc9ec79a8a 100644
--- a/yt/yt_proto/yt/client/transaction_client/proto/timestamp_service.proto
+++ b/yt/yt_proto/yt/client/transaction_client/proto/timestamp_service.proto
@@ -5,6 +5,7 @@ package NYT.NTransactionClient.NProto;
message TReqGenerateTimestamps
{
optional int32 count = 1 [default = 1];
+ optional int32 clock_cluster_tag = 2;
}
message TRspGenerateTimestamps
diff --git a/yt/yt_proto/yt/core/bus/proto/bus.proto b/yt/yt_proto/yt/core/bus/proto/bus.proto
index daf9d5f0830..96638368f59 100644
--- a/yt/yt_proto/yt/core/bus/proto/bus.proto
+++ b/yt/yt_proto/yt/core/bus/proto/bus.proto
@@ -4,10 +4,12 @@ import "yt_proto/yt/core/misc/proto/guid.proto";
message THandshake
{
- required NYT.NProto.TGuid foreign_connection_id = 1;
+ required NYT.NProto.TGuid connection_id = 1;
// Only passed from client to server.
optional int32 multiplexing_band = 2; // EMultiplexingBand
optional int32 encryption_mode = 3; // EEncryptionMode
+
+ optional int32 verification_mode = 4; // EVerificationMode
}